/* * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.amazonaws.services.iot.model; import java.io.Serializable; /** *

* The thing indexing configuration. For more information, see Managing Thing Indexing. *

*/ public class ThingIndexingConfiguration implements Serializable { /** *

* Thing indexing mode. Valid values are: *

* *

* Constraints:
* Allowed Values: OFF, REGISTRY, REGISTRY_AND_SHADOW */ private String thingIndexingMode; /** *

* Thing connectivity indexing mode. Valid values are: *

* *

* Constraints:
* Allowed Values: OFF, STATUS */ private String thingConnectivityIndexingMode; /** *

* Device Defender indexing mode. Valid values are: *

* *

* For more information about Device Defender violations, see Device Defender Detect. *

*

* Constraints:
* Allowed Values: OFF, VIOLATIONS */ private String deviceDefenderIndexingMode; /** *

* Named shadow indexing mode. Valid values are: *

* *

* For more information about Shadows, see IoT Device Shadow service. *

*

* Constraints:
* Allowed Values: OFF, ON */ private String namedShadowIndexingMode; /** *

* Contains fields that are indexed and whose types are already known by the * Fleet Indexing service. *

*/ private java.util.List managedFields; /** *

* Contains custom field names and their data type. *

*/ private java.util.List customFields; /** *

* Provides additional filters for specific data sources. Named shadow is * the only data source that currently supports and requires a filter. To * add named shadows to your fleet indexing configuration, set * namedShadowIndexingMode to be ON and specify * your shadow names in filter. *

*/ private IndexingFilter filter; /** *

* Thing indexing mode. Valid values are: *

* *

* Constraints:
* Allowed Values: OFF, REGISTRY, REGISTRY_AND_SHADOW * * @return

* Thing indexing mode. Valid values are: *

* * @see ThingIndexingMode */ public String getThingIndexingMode() { return thingIndexingMode; } /** *

* Thing indexing mode. Valid values are: *

* *

* Constraints:
* Allowed Values: OFF, REGISTRY, REGISTRY_AND_SHADOW * * @param thingIndexingMode

* Thing indexing mode. Valid values are: *

* * @see ThingIndexingMode */ public void setThingIndexingMode(String thingIndexingMode) { this.thingIndexingMode = thingIndexingMode; } /** *

* Thing indexing mode. Valid values are: *

* *

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: OFF, REGISTRY, REGISTRY_AND_SHADOW * * @param thingIndexingMode

* Thing indexing mode. Valid values are: *

* * @return A reference to this updated object so that method calls can be * chained together. * @see ThingIndexingMode */ public ThingIndexingConfiguration withThingIndexingMode(String thingIndexingMode) { this.thingIndexingMode = thingIndexingMode; return this; } /** *

* Thing indexing mode. Valid values are: *

* *

* Constraints:
* Allowed Values: OFF, REGISTRY, REGISTRY_AND_SHADOW * * @param thingIndexingMode

* Thing indexing mode. Valid values are: *

* * @see ThingIndexingMode */ public void setThingIndexingMode(ThingIndexingMode thingIndexingMode) { this.thingIndexingMode = thingIndexingMode.toString(); } /** *

* Thing indexing mode. Valid values are: *

* *

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: OFF, REGISTRY, REGISTRY_AND_SHADOW * * @param thingIndexingMode

* Thing indexing mode. Valid values are: *

* * @return A reference to this updated object so that method calls can be * chained together. * @see ThingIndexingMode */ public ThingIndexingConfiguration withThingIndexingMode(ThingIndexingMode thingIndexingMode) { this.thingIndexingMode = thingIndexingMode.toString(); return this; } /** *

* Thing connectivity indexing mode. Valid values are: *

* *

* Constraints:
* Allowed Values: OFF, STATUS * * @return

* Thing connectivity indexing mode. Valid values are: *

* * @see ThingConnectivityIndexingMode */ public String getThingConnectivityIndexingMode() { return thingConnectivityIndexingMode; } /** *

* Thing connectivity indexing mode. Valid values are: *

* *

* Constraints:
* Allowed Values: OFF, STATUS * * @param thingConnectivityIndexingMode

* Thing connectivity indexing mode. Valid values are: *

* * @see ThingConnectivityIndexingMode */ public void setThingConnectivityIndexingMode(String thingConnectivityIndexingMode) { this.thingConnectivityIndexingMode = thingConnectivityIndexingMode; } /** *

* Thing connectivity indexing mode. Valid values are: *

* *

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: OFF, STATUS * * @param thingConnectivityIndexingMode

* Thing connectivity indexing mode. Valid values are: *

* * @return A reference to this updated object so that method calls can be * chained together. * @see ThingConnectivityIndexingMode */ public ThingIndexingConfiguration withThingConnectivityIndexingMode( String thingConnectivityIndexingMode) { this.thingConnectivityIndexingMode = thingConnectivityIndexingMode; return this; } /** *

* Thing connectivity indexing mode. Valid values are: *

* *

* Constraints:
* Allowed Values: OFF, STATUS * * @param thingConnectivityIndexingMode

* Thing connectivity indexing mode. Valid values are: *

* * @see ThingConnectivityIndexingMode */ public void setThingConnectivityIndexingMode( ThingConnectivityIndexingMode thingConnectivityIndexingMode) { this.thingConnectivityIndexingMode = thingConnectivityIndexingMode.toString(); } /** *

* Thing connectivity indexing mode. Valid values are: *

* *

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: OFF, STATUS * * @param thingConnectivityIndexingMode

* Thing connectivity indexing mode. Valid values are: *

* * @return A reference to this updated object so that method calls can be * chained together. * @see ThingConnectivityIndexingMode */ public ThingIndexingConfiguration withThingConnectivityIndexingMode( ThingConnectivityIndexingMode thingConnectivityIndexingMode) { this.thingConnectivityIndexingMode = thingConnectivityIndexingMode.toString(); return this; } /** *

* Device Defender indexing mode. Valid values are: *

* *

* For more information about Device Defender violations, see Device Defender Detect. *

*

* Constraints:
* Allowed Values: OFF, VIOLATIONS * * @return

* Device Defender indexing mode. Valid values are: *

* *

* For more information about Device Defender violations, see Device Defender Detect. *

* @see DeviceDefenderIndexingMode */ public String getDeviceDefenderIndexingMode() { return deviceDefenderIndexingMode; } /** *

* Device Defender indexing mode. Valid values are: *

* *

* For more information about Device Defender violations, see Device Defender Detect. *

*

* Constraints:
* Allowed Values: OFF, VIOLATIONS * * @param deviceDefenderIndexingMode

* Device Defender indexing mode. Valid values are: *

* *

* For more information about Device Defender violations, see Device Defender Detect. *

* @see DeviceDefenderIndexingMode */ public void setDeviceDefenderIndexingMode(String deviceDefenderIndexingMode) { this.deviceDefenderIndexingMode = deviceDefenderIndexingMode; } /** *

* Device Defender indexing mode. Valid values are: *

* *

* For more information about Device Defender violations, see Device Defender Detect. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: OFF, VIOLATIONS * * @param deviceDefenderIndexingMode

* Device Defender indexing mode. Valid values are: *

* *

* For more information about Device Defender violations, see Device Defender Detect. *

* @return A reference to this updated object so that method calls can be * chained together. * @see DeviceDefenderIndexingMode */ public ThingIndexingConfiguration withDeviceDefenderIndexingMode( String deviceDefenderIndexingMode) { this.deviceDefenderIndexingMode = deviceDefenderIndexingMode; return this; } /** *

* Device Defender indexing mode. Valid values are: *

* *

* For more information about Device Defender violations, see Device Defender Detect. *

*

* Constraints:
* Allowed Values: OFF, VIOLATIONS * * @param deviceDefenderIndexingMode

* Device Defender indexing mode. Valid values are: *

* *

* For more information about Device Defender violations, see Device Defender Detect. *

* @see DeviceDefenderIndexingMode */ public void setDeviceDefenderIndexingMode(DeviceDefenderIndexingMode deviceDefenderIndexingMode) { this.deviceDefenderIndexingMode = deviceDefenderIndexingMode.toString(); } /** *

* Device Defender indexing mode. Valid values are: *

* *

* For more information about Device Defender violations, see Device Defender Detect. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: OFF, VIOLATIONS * * @param deviceDefenderIndexingMode

* Device Defender indexing mode. Valid values are: *

* *

* For more information about Device Defender violations, see Device Defender Detect. *

* @return A reference to this updated object so that method calls can be * chained together. * @see DeviceDefenderIndexingMode */ public ThingIndexingConfiguration withDeviceDefenderIndexingMode( DeviceDefenderIndexingMode deviceDefenderIndexingMode) { this.deviceDefenderIndexingMode = deviceDefenderIndexingMode.toString(); return this; } /** *

* Named shadow indexing mode. Valid values are: *

* *

* For more information about Shadows, see IoT Device Shadow service. *

*

* Constraints:
* Allowed Values: OFF, ON * * @return

* Named shadow indexing mode. Valid values are: *

* *

* For more information about Shadows, see IoT Device Shadow service. *

* @see NamedShadowIndexingMode */ public String getNamedShadowIndexingMode() { return namedShadowIndexingMode; } /** *

* Named shadow indexing mode. Valid values are: *

* *

* For more information about Shadows, see IoT Device Shadow service. *

*

* Constraints:
* Allowed Values: OFF, ON * * @param namedShadowIndexingMode

* Named shadow indexing mode. Valid values are: *

* *

* For more information about Shadows, see IoT Device Shadow service. *

* @see NamedShadowIndexingMode */ public void setNamedShadowIndexingMode(String namedShadowIndexingMode) { this.namedShadowIndexingMode = namedShadowIndexingMode; } /** *

* Named shadow indexing mode. Valid values are: *

* *

* For more information about Shadows, see IoT Device Shadow service. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: OFF, ON * * @param namedShadowIndexingMode

* Named shadow indexing mode. Valid values are: *

* *

* For more information about Shadows, see IoT Device Shadow service. *

* @return A reference to this updated object so that method calls can be * chained together. * @see NamedShadowIndexingMode */ public ThingIndexingConfiguration withNamedShadowIndexingMode(String namedShadowIndexingMode) { this.namedShadowIndexingMode = namedShadowIndexingMode; return this; } /** *

* Named shadow indexing mode. Valid values are: *

* *

* For more information about Shadows, see IoT Device Shadow service. *

*

* Constraints:
* Allowed Values: OFF, ON * * @param namedShadowIndexingMode

* Named shadow indexing mode. Valid values are: *

* *

* For more information about Shadows, see IoT Device Shadow service. *

* @see NamedShadowIndexingMode */ public void setNamedShadowIndexingMode(NamedShadowIndexingMode namedShadowIndexingMode) { this.namedShadowIndexingMode = namedShadowIndexingMode.toString(); } /** *

* Named shadow indexing mode. Valid values are: *

* *

* For more information about Shadows, see IoT Device Shadow service. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: OFF, ON * * @param namedShadowIndexingMode

* Named shadow indexing mode. Valid values are: *

* *

* For more information about Shadows, see IoT Device Shadow service. *

* @return A reference to this updated object so that method calls can be * chained together. * @see NamedShadowIndexingMode */ public ThingIndexingConfiguration withNamedShadowIndexingMode( NamedShadowIndexingMode namedShadowIndexingMode) { this.namedShadowIndexingMode = namedShadowIndexingMode.toString(); return this; } /** *

* Contains fields that are indexed and whose types are already known by the * Fleet Indexing service. *

* * @return

* Contains fields that are indexed and whose types are already * known by the Fleet Indexing service. *

*/ public java.util.List getManagedFields() { return managedFields; } /** *

* Contains fields that are indexed and whose types are already known by the * Fleet Indexing service. *

* * @param managedFields

* Contains fields that are indexed and whose types are already * known by the Fleet Indexing service. *

*/ public void setManagedFields(java.util.Collection managedFields) { if (managedFields == null) { this.managedFields = null; return; } this.managedFields = new java.util.ArrayList(managedFields); } /** *

* Contains fields that are indexed and whose types are already known by the * Fleet Indexing service. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param managedFields

* Contains fields that are indexed and whose types are already * known by the Fleet Indexing service. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ThingIndexingConfiguration withManagedFields(Field... managedFields) { if (getManagedFields() == null) { this.managedFields = new java.util.ArrayList(managedFields.length); } for (Field value : managedFields) { this.managedFields.add(value); } return this; } /** *

* Contains fields that are indexed and whose types are already known by the * Fleet Indexing service. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param managedFields

* Contains fields that are indexed and whose types are already * known by the Fleet Indexing service. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ThingIndexingConfiguration withManagedFields(java.util.Collection managedFields) { setManagedFields(managedFields); return this; } /** *

* Contains custom field names and their data type. *

* * @return

* Contains custom field names and their data type. *

*/ public java.util.List getCustomFields() { return customFields; } /** *

* Contains custom field names and their data type. *

* * @param customFields

* Contains custom field names and their data type. *

*/ public void setCustomFields(java.util.Collection customFields) { if (customFields == null) { this.customFields = null; return; } this.customFields = new java.util.ArrayList(customFields); } /** *

* Contains custom field names and their data type. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param customFields

* Contains custom field names and their data type. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ThingIndexingConfiguration withCustomFields(Field... customFields) { if (getCustomFields() == null) { this.customFields = new java.util.ArrayList(customFields.length); } for (Field value : customFields) { this.customFields.add(value); } return this; } /** *

* Contains custom field names and their data type. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param customFields

* Contains custom field names and their data type. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ThingIndexingConfiguration withCustomFields(java.util.Collection customFields) { setCustomFields(customFields); return this; } /** *

* Provides additional filters for specific data sources. Named shadow is * the only data source that currently supports and requires a filter. To * add named shadows to your fleet indexing configuration, set * namedShadowIndexingMode to be ON and specify * your shadow names in filter. *

* * @return

* Provides additional filters for specific data sources. Named * shadow is the only data source that currently supports and * requires a filter. To add named shadows to your fleet indexing * configuration, set namedShadowIndexingMode to be * ON and specify your shadow names in * filter. *

*/ public IndexingFilter getFilter() { return filter; } /** *

* Provides additional filters for specific data sources. Named shadow is * the only data source that currently supports and requires a filter. To * add named shadows to your fleet indexing configuration, set * namedShadowIndexingMode to be ON and specify * your shadow names in filter. *

* * @param filter

* Provides additional filters for specific data sources. Named * shadow is the only data source that currently supports and * requires a filter. To add named shadows to your fleet indexing * configuration, set namedShadowIndexingMode to be * ON and specify your shadow names in * filter. *

*/ public void setFilter(IndexingFilter filter) { this.filter = filter; } /** *

* Provides additional filters for specific data sources. Named shadow is * the only data source that currently supports and requires a filter. To * add named shadows to your fleet indexing configuration, set * namedShadowIndexingMode to be ON and specify * your shadow names in filter. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param filter

* Provides additional filters for specific data sources. Named * shadow is the only data source that currently supports and * requires a filter. To add named shadows to your fleet indexing * configuration, set namedShadowIndexingMode to be * ON and specify your shadow names in * filter. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ThingIndexingConfiguration withFilter(IndexingFilter filter) { this.filter = filter; return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getThingIndexingMode() != null) sb.append("thingIndexingMode: " + getThingIndexingMode() + ","); if (getThingConnectivityIndexingMode() != null) sb.append("thingConnectivityIndexingMode: " + getThingConnectivityIndexingMode() + ","); if (getDeviceDefenderIndexingMode() != null) sb.append("deviceDefenderIndexingMode: " + getDeviceDefenderIndexingMode() + ","); if (getNamedShadowIndexingMode() != null) sb.append("namedShadowIndexingMode: " + getNamedShadowIndexingMode() + ","); if (getManagedFields() != null) sb.append("managedFields: " + getManagedFields() + ","); if (getCustomFields() != null) sb.append("customFields: " + getCustomFields() + ","); if (getFilter() != null) sb.append("filter: " + getFilter()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getThingIndexingMode() == null) ? 0 : getThingIndexingMode().hashCode()); hashCode = prime * hashCode + ((getThingConnectivityIndexingMode() == null) ? 0 : getThingConnectivityIndexingMode().hashCode()); hashCode = prime * hashCode + ((getDeviceDefenderIndexingMode() == null) ? 0 : getDeviceDefenderIndexingMode() .hashCode()); hashCode = prime * hashCode + ((getNamedShadowIndexingMode() == null) ? 0 : getNamedShadowIndexingMode() .hashCode()); hashCode = prime * hashCode + ((getManagedFields() == null) ? 0 : getManagedFields().hashCode()); hashCode = prime * hashCode + ((getCustomFields() == null) ? 0 : getCustomFields().hashCode()); hashCode = prime * hashCode + ((getFilter() == null) ? 0 : getFilter().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ThingIndexingConfiguration == false) return false; ThingIndexingConfiguration other = (ThingIndexingConfiguration) obj; if (other.getThingIndexingMode() == null ^ this.getThingIndexingMode() == null) return false; if (other.getThingIndexingMode() != null && other.getThingIndexingMode().equals(this.getThingIndexingMode()) == false) return false; if (other.getThingConnectivityIndexingMode() == null ^ this.getThingConnectivityIndexingMode() == null) return false; if (other.getThingConnectivityIndexingMode() != null && other.getThingConnectivityIndexingMode().equals( this.getThingConnectivityIndexingMode()) == false) return false; if (other.getDeviceDefenderIndexingMode() == null ^ this.getDeviceDefenderIndexingMode() == null) return false; if (other.getDeviceDefenderIndexingMode() != null && other.getDeviceDefenderIndexingMode().equals( this.getDeviceDefenderIndexingMode()) == false) return false; if (other.getNamedShadowIndexingMode() == null ^ this.getNamedShadowIndexingMode() == null) return false; if (other.getNamedShadowIndexingMode() != null && other.getNamedShadowIndexingMode().equals(this.getNamedShadowIndexingMode()) == false) return false; if (other.getManagedFields() == null ^ this.getManagedFields() == null) return false; if (other.getManagedFields() != null && other.getManagedFields().equals(this.getManagedFields()) == false) return false; if (other.getCustomFields() == null ^ this.getCustomFields() == null) return false; if (other.getCustomFields() != null && other.getCustomFields().equals(this.getCustomFields()) == false) return false; if (other.getFilter() == null ^ this.getFilter() == null) return false; if (other.getFilter() != null && other.getFilter().equals(this.getFilter()) == false) return false; return true; } }