/* * 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; import com.amazonaws.AmazonWebServiceRequest; /** *

* Adds a thing to a thing group. *

*

* Requires permission to access the AddThingToThingGroup action. *

*/ public class AddThingToThingGroupRequest extends AmazonWebServiceRequest implements Serializable { /** *

* The name of the group to which you are adding a thing. *

*

* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9:_-]+
*/ private String thingGroupName; /** *

* The ARN of the group to which you are adding a thing. *

*/ private String thingGroupArn; /** *

* The name of the thing to add to a group. *

*

* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9:_-]+
*/ private String thingName; /** *

* The ARN of the thing to add to a group. *

*/ private String thingArn; /** *

* Override dynamic thing groups with static thing groups when 10-group * limit is reached. If a thing belongs to 10 thing groups, and one or more * of those groups are dynamic thing groups, adding a thing to a static * group removes the thing from the last dynamic group. *

*/ private Boolean overrideDynamicGroups; /** *

* The name of the group to which you are adding a thing. *

*

* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9:_-]+
* * @return

* The name of the group to which you are adding a thing. *

*/ public String getThingGroupName() { return thingGroupName; } /** *

* The name of the group to which you are adding a thing. *

*

* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9:_-]+
* * @param thingGroupName

* The name of the group to which you are adding a thing. *

*/ public void setThingGroupName(String thingGroupName) { this.thingGroupName = thingGroupName; } /** *

* The name of the group to which you are adding a thing. *

*

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

* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9:_-]+
* * @param thingGroupName

* The name of the group to which you are adding a thing. *

* @return A reference to this updated object so that method calls can be * chained together. */ public AddThingToThingGroupRequest withThingGroupName(String thingGroupName) { this.thingGroupName = thingGroupName; return this; } /** *

* The ARN of the group to which you are adding a thing. *

* * @return

* The ARN of the group to which you are adding a thing. *

*/ public String getThingGroupArn() { return thingGroupArn; } /** *

* The ARN of the group to which you are adding a thing. *

* * @param thingGroupArn

* The ARN of the group to which you are adding a thing. *

*/ public void setThingGroupArn(String thingGroupArn) { this.thingGroupArn = thingGroupArn; } /** *

* The ARN of the group to which you are adding a thing. *

*

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

* The ARN of the group to which you are adding a thing. *

* @return A reference to this updated object so that method calls can be * chained together. */ public AddThingToThingGroupRequest withThingGroupArn(String thingGroupArn) { this.thingGroupArn = thingGroupArn; return this; } /** *

* The name of the thing to add to a group. *

*

* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9:_-]+
* * @return

* The name of the thing to add to a group. *

*/ public String getThingName() { return thingName; } /** *

* The name of the thing to add to a group. *

*

* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9:_-]+
* * @param thingName

* The name of the thing to add to a group. *

*/ public void setThingName(String thingName) { this.thingName = thingName; } /** *

* The name of the thing to add to a group. *

*

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

* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9:_-]+
* * @param thingName

* The name of the thing to add to a group. *

* @return A reference to this updated object so that method calls can be * chained together. */ public AddThingToThingGroupRequest withThingName(String thingName) { this.thingName = thingName; return this; } /** *

* The ARN of the thing to add to a group. *

* * @return

* The ARN of the thing to add to a group. *

*/ public String getThingArn() { return thingArn; } /** *

* The ARN of the thing to add to a group. *

* * @param thingArn

* The ARN of the thing to add to a group. *

*/ public void setThingArn(String thingArn) { this.thingArn = thingArn; } /** *

* The ARN of the thing to add to a group. *

*

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

* The ARN of the thing to add to a group. *

* @return A reference to this updated object so that method calls can be * chained together. */ public AddThingToThingGroupRequest withThingArn(String thingArn) { this.thingArn = thingArn; return this; } /** *

* Override dynamic thing groups with static thing groups when 10-group * limit is reached. If a thing belongs to 10 thing groups, and one or more * of those groups are dynamic thing groups, adding a thing to a static * group removes the thing from the last dynamic group. *

* * @return

* Override dynamic thing groups with static thing groups when * 10-group limit is reached. If a thing belongs to 10 thing groups, * and one or more of those groups are dynamic thing groups, adding * a thing to a static group removes the thing from the last dynamic * group. *

*/ public Boolean isOverrideDynamicGroups() { return overrideDynamicGroups; } /** *

* Override dynamic thing groups with static thing groups when 10-group * limit is reached. If a thing belongs to 10 thing groups, and one or more * of those groups are dynamic thing groups, adding a thing to a static * group removes the thing from the last dynamic group. *

* * @return

* Override dynamic thing groups with static thing groups when * 10-group limit is reached. If a thing belongs to 10 thing groups, * and one or more of those groups are dynamic thing groups, adding * a thing to a static group removes the thing from the last dynamic * group. *

*/ public Boolean getOverrideDynamicGroups() { return overrideDynamicGroups; } /** *

* Override dynamic thing groups with static thing groups when 10-group * limit is reached. If a thing belongs to 10 thing groups, and one or more * of those groups are dynamic thing groups, adding a thing to a static * group removes the thing from the last dynamic group. *

* * @param overrideDynamicGroups

* Override dynamic thing groups with static thing groups when * 10-group limit is reached. If a thing belongs to 10 thing * groups, and one or more of those groups are dynamic thing * groups, adding a thing to a static group removes the thing * from the last dynamic group. *

*/ public void setOverrideDynamicGroups(Boolean overrideDynamicGroups) { this.overrideDynamicGroups = overrideDynamicGroups; } /** *

* Override dynamic thing groups with static thing groups when 10-group * limit is reached. If a thing belongs to 10 thing groups, and one or more * of those groups are dynamic thing groups, adding a thing to a static * group removes the thing from the last dynamic group. *

*

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

* Override dynamic thing groups with static thing groups when * 10-group limit is reached. If a thing belongs to 10 thing * groups, and one or more of those groups are dynamic thing * groups, adding a thing to a static group removes the thing * from the last dynamic group. *

* @return A reference to this updated object so that method calls can be * chained together. */ public AddThingToThingGroupRequest withOverrideDynamicGroups(Boolean overrideDynamicGroups) { this.overrideDynamicGroups = overrideDynamicGroups; 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 (getThingGroupName() != null) sb.append("thingGroupName: " + getThingGroupName() + ","); if (getThingGroupArn() != null) sb.append("thingGroupArn: " + getThingGroupArn() + ","); if (getThingName() != null) sb.append("thingName: " + getThingName() + ","); if (getThingArn() != null) sb.append("thingArn: " + getThingArn() + ","); if (getOverrideDynamicGroups() != null) sb.append("overrideDynamicGroups: " + getOverrideDynamicGroups()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getThingGroupName() == null) ? 0 : getThingGroupName().hashCode()); hashCode = prime * hashCode + ((getThingGroupArn() == null) ? 0 : getThingGroupArn().hashCode()); hashCode = prime * hashCode + ((getThingName() == null) ? 0 : getThingName().hashCode()); hashCode = prime * hashCode + ((getThingArn() == null) ? 0 : getThingArn().hashCode()); hashCode = prime * hashCode + ((getOverrideDynamicGroups() == null) ? 0 : getOverrideDynamicGroups().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AddThingToThingGroupRequest == false) return false; AddThingToThingGroupRequest other = (AddThingToThingGroupRequest) obj; if (other.getThingGroupName() == null ^ this.getThingGroupName() == null) return false; if (other.getThingGroupName() != null && other.getThingGroupName().equals(this.getThingGroupName()) == false) return false; if (other.getThingGroupArn() == null ^ this.getThingGroupArn() == null) return false; if (other.getThingGroupArn() != null && other.getThingGroupArn().equals(this.getThingGroupArn()) == false) return false; if (other.getThingName() == null ^ this.getThingName() == null) return false; if (other.getThingName() != null && other.getThingName().equals(this.getThingName()) == false) return false; if (other.getThingArn() == null ^ this.getThingArn() == null) return false; if (other.getThingArn() != null && other.getThingArn().equals(this.getThingArn()) == false) return false; if (other.getOverrideDynamicGroups() == null ^ this.getOverrideDynamicGroups() == null) return false; if (other.getOverrideDynamicGroups() != null && other.getOverrideDynamicGroups().equals(this.getOverrideDynamicGroups()) == false) return false; return true; } }