/* * 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; /** *
* Remove the specified thing from the specified group. *
*
* You must specify either a thingGroupArn
or a
* thingGroupName
to identify the thing group and either a
* thingArn
or a thingName
to identify the thing to
* remove from the thing group.
*
* Requires permission to access the RemoveThingFromThingGroup action. *
*/ public class RemoveThingFromThingGroupRequest extends AmazonWebServiceRequest implements Serializable { /** ** The group name. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9:_-]+
*/
private String thingGroupName;
/**
*
* The group ARN. *
*/ private String thingGroupArn; /** ** The name of the thing to remove from the group. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9:_-]+
*/
private String thingName;
/**
*
* The ARN of the thing to remove from the group. *
*/ private String thingArn; /** ** The group name. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9:_-]+
*
* @return
* The group name. *
*/ public String getThingGroupName() { return thingGroupName; } /** ** The group name. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9:_-]+
*
* @param thingGroupName
* The group name. *
*/ public void setThingGroupName(String thingGroupName) { this.thingGroupName = thingGroupName; } /** ** The group name. *
** 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 group name. *
* @return A reference to this updated object so that method calls can be * chained together. */ public RemoveThingFromThingGroupRequest withThingGroupName(String thingGroupName) { this.thingGroupName = thingGroupName; return this; } /** ** The group ARN. *
* * @return* The group ARN. *
*/ public String getThingGroupArn() { return thingGroupArn; } /** ** The group ARN. *
* * @param thingGroupArn* The group ARN. *
*/ public void setThingGroupArn(String thingGroupArn) { this.thingGroupArn = thingGroupArn; } /** ** The group ARN. *
** Returns a reference to this object so that method calls can be chained * together. * * @param thingGroupArn
* The group ARN. *
* @return A reference to this updated object so that method calls can be * chained together. */ public RemoveThingFromThingGroupRequest withThingGroupArn(String thingGroupArn) { this.thingGroupArn = thingGroupArn; return this; } /** ** The name of the thing to remove from the group. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9:_-]+
*
* @return
* The name of the thing to remove from the group. *
*/ public String getThingName() { return thingName; } /** ** The name of the thing to remove from the group. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9:_-]+
*
* @param thingName
* The name of the thing to remove from the group. *
*/ public void setThingName(String thingName) { this.thingName = thingName; } /** ** The name of the thing to remove from the 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 remove from the group. *
* @return A reference to this updated object so that method calls can be * chained together. */ public RemoveThingFromThingGroupRequest withThingName(String thingName) { this.thingName = thingName; return this; } /** ** The ARN of the thing to remove from the group. *
* * @return* The ARN of the thing to remove from the group. *
*/ public String getThingArn() { return thingArn; } /** ** The ARN of the thing to remove from the group. *
* * @param thingArn* The ARN of the thing to remove from the group. *
*/ public void setThingArn(String thingArn) { this.thingArn = thingArn; } /** ** The ARN of the thing to remove from the group. *
** Returns a reference to this object so that method calls can be chained * together. * * @param thingArn
* The ARN of the thing to remove from the group. *
* @return A reference to this updated object so that method calls can be * chained together. */ public RemoveThingFromThingGroupRequest withThingArn(String thingArn) { this.thingArn = thingArn; 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()); 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()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof RemoveThingFromThingGroupRequest == false) return false; RemoveThingFromThingGroupRequest other = (RemoveThingFromThingGroupRequest) 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; return true; } }