/* * Copyright 2018-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 javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Describes which changes should be applied as part of a mitigation action. *
*/ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class MitigationAction implements Serializable, Cloneable, StructuredPojo { /** ** A user-friendly name for the mitigation action. *
*/ private String name; /** ** A unique identifier for the mitigation action. *
*/ private String id; /** ** The IAM role ARN used to apply this mitigation action. *
*/ private String roleArn; /** ** The set of parameters for this mitigation action. The parameters vary, depending on the kind of action you apply. *
*/ private MitigationActionParams actionParams; /** ** A user-friendly name for the mitigation action. *
* * @param name * A user-friendly name for the mitigation action. */ public void setName(String name) { this.name = name; } /** ** A user-friendly name for the mitigation action. *
* * @return A user-friendly name for the mitigation action. */ public String getName() { return this.name; } /** ** A user-friendly name for the mitigation action. *
* * @param name * A user-friendly name for the mitigation action. * @return Returns a reference to this object so that method calls can be chained together. */ public MitigationAction withName(String name) { setName(name); return this; } /** ** A unique identifier for the mitigation action. *
* * @param id * A unique identifier for the mitigation action. */ public void setId(String id) { this.id = id; } /** ** A unique identifier for the mitigation action. *
* * @return A unique identifier for the mitigation action. */ public String getId() { return this.id; } /** ** A unique identifier for the mitigation action. *
* * @param id * A unique identifier for the mitigation action. * @return Returns a reference to this object so that method calls can be chained together. */ public MitigationAction withId(String id) { setId(id); return this; } /** ** The IAM role ARN used to apply this mitigation action. *
* * @param roleArn * The IAM role ARN used to apply this mitigation action. */ public void setRoleArn(String roleArn) { this.roleArn = roleArn; } /** ** The IAM role ARN used to apply this mitigation action. *
* * @return The IAM role ARN used to apply this mitigation action. */ public String getRoleArn() { return this.roleArn; } /** ** The IAM role ARN used to apply this mitigation action. *
* * @param roleArn * The IAM role ARN used to apply this mitigation action. * @return Returns a reference to this object so that method calls can be chained together. */ public MitigationAction withRoleArn(String roleArn) { setRoleArn(roleArn); return this; } /** ** The set of parameters for this mitigation action. The parameters vary, depending on the kind of action you apply. *
* * @param actionParams * The set of parameters for this mitigation action. The parameters vary, depending on the kind of action you * apply. */ public void setActionParams(MitigationActionParams actionParams) { this.actionParams = actionParams; } /** ** The set of parameters for this mitigation action. The parameters vary, depending on the kind of action you apply. *
* * @return The set of parameters for this mitigation action. The parameters vary, depending on the kind of action * you apply. */ public MitigationActionParams getActionParams() { return this.actionParams; } /** ** The set of parameters for this mitigation action. The parameters vary, depending on the kind of action you apply. *
* * @param actionParams * The set of parameters for this mitigation action. The parameters vary, depending on the kind of action you * apply. * @return Returns a reference to this object so that method calls can be chained together. */ public MitigationAction withActionParams(MitigationActionParams actionParams) { setActionParams(actionParams); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getId() != null) sb.append("Id: ").append(getId()).append(","); if (getRoleArn() != null) sb.append("RoleArn: ").append(getRoleArn()).append(","); if (getActionParams() != null) sb.append("ActionParams: ").append(getActionParams()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof MitigationAction == false) return false; MitigationAction other = (MitigationAction) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getId() == null ^ this.getId() == null) return false; if (other.getId() != null && other.getId().equals(this.getId()) == false) return false; if (other.getRoleArn() == null ^ this.getRoleArn() == null) return false; if (other.getRoleArn() != null && other.getRoleArn().equals(this.getRoleArn()) == false) return false; if (other.getActionParams() == null ^ this.getActionParams() == null) return false; if (other.getActionParams() != null && other.getActionParams().equals(this.getActionParams()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode()); hashCode = prime * hashCode + ((getRoleArn() == null) ? 0 : getRoleArn().hashCode()); hashCode = prime * hashCode + ((getActionParams() == null) ? 0 : getActionParams().hashCode()); return hashCode; } @Override public MitigationAction clone() { try { return (MitigationAction) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.iot.model.transform.MitigationActionMarshaller.getInstance().marshall(this, protocolMarshaller); } }