/* * 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; /** *
* Describes which changes should be applied as part of a mitigation action. *
*/ public class MitigationAction implements Serializable { /** ** A user-friendly name for the mitigation action. *
*
* Constraints:
* Length: - 128
* Pattern: [a-zA-Z0-9_-]+
*/
private String name;
/**
*
* A unique identifier for the mitigation action. *
*/ private String id; /** ** The IAM role ARN used to apply this mitigation action. *
*
* Constraints:
* Length: 20 - 2048
*/
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. *
*
* Constraints:
* Length: - 128
* Pattern: [a-zA-Z0-9_-]+
*
* @return
* A user-friendly name for the mitigation action. *
*/ public String getName() { return name; } /** ** A user-friendly name for the mitigation action. *
*
* Constraints:
* Length: - 128
* Pattern: [a-zA-Z0-9_-]+
*
* @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. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: - 128
* Pattern: [a-zA-Z0-9_-]+
*
* @param name
* A user-friendly name for the mitigation action. *
* @return A reference to this updated object so that method calls can be * chained together. */ public MitigationAction withName(String name) { this.name = name; return this; } /** ** A unique identifier for the mitigation action. *
* * @return* A unique identifier for the mitigation action. *
*/ public String getId() { return id; } /** ** 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. *
** Returns a reference to this object so that method calls can be chained * together. * * @param id
* A unique identifier for the mitigation action. *
* @return A reference to this updated object so that method calls can be * chained together. */ public MitigationAction withId(String id) { this.id = id; return this; } /** ** The IAM role ARN used to apply this mitigation action. *
*
* Constraints:
* Length: 20 - 2048
*
* @return
* The IAM role ARN used to apply this mitigation action. *
*/ public String getRoleArn() { return roleArn; } /** ** The IAM role ARN used to apply this mitigation action. *
*
* Constraints:
* Length: 20 - 2048
*
* @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. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 20 - 2048
*
* @param roleArn
* The IAM role ARN used to apply this mitigation action. *
* @return A reference to this updated object so that method calls can be * chained together. */ public MitigationAction withRoleArn(String roleArn) { this.roleArn = roleArn; return this; } /** ** 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 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. *
*/ 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. *
** Returns a reference to this object so that method calls can be chained * together. * * @param actionParams
* The set of parameters for this mitigation action. The * parameters vary, depending on the kind of action you apply. *
* @return A reference to this updated object so that method calls can be * chained together. */ public MitigationAction withActionParams(MitigationActionParams actionParams) { this.actionParams = actionParams; 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 (getName() != null) sb.append("name: " + getName() + ","); if (getId() != null) sb.append("id: " + getId() + ","); if (getRoleArn() != null) sb.append("roleArn: " + getRoleArn() + ","); if (getActionParams() != null) sb.append("actionParams: " + getActionParams()); sb.append("}"); return sb.toString(); } @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 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; } }