/* * 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; /** *
* Updates the definition for the specified mitigation action. *
** Requires permission to access the UpdateMitigationAction action. *
*/ public class UpdateMitigationActionRequest extends AmazonWebServiceRequest implements Serializable { /** *
* The friendly name for the mitigation action. You cannot change the name
* by using UpdateMitigationAction
. Instead, you must delete
* and recreate the mitigation action with the new name.
*
* Constraints:
* Length: - 128
* Pattern: [a-zA-Z0-9_-]+
*/
private String actionName;
/**
*
* The ARN of the IAM role that is used to apply the mitigation action. *
*
* Constraints:
* Length: 20 - 2048
*/
private String roleArn;
/**
*
* Defines the type of action and the parameters for that action. *
*/ private MitigationActionParams actionParams; /** *
* The friendly name for the mitigation action. You cannot change the name
* by using UpdateMitigationAction
. Instead, you must delete
* and recreate the mitigation action with the new name.
*
* Constraints:
* Length: - 128
* Pattern: [a-zA-Z0-9_-]+
*
* @return
* The friendly name for the mitigation action. You cannot change
* the name by using UpdateMitigationAction
. Instead,
* you must delete and recreate the mitigation action with the new
* name.
*
* The friendly name for the mitigation action. You cannot change the name
* by using UpdateMitigationAction
. Instead, you must delete
* and recreate the mitigation action with the new name.
*
* Constraints:
* Length: - 128
* Pattern: [a-zA-Z0-9_-]+
*
* @param actionName
* The friendly name for the mitigation action. You cannot change
* the name by using UpdateMitigationAction
.
* Instead, you must delete and recreate the mitigation action
* with the new name.
*
* The friendly name for the mitigation action. You cannot change the name
* by using UpdateMitigationAction
. Instead, you must delete
* and recreate the mitigation action with the new name.
*
* Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: - 128
* Pattern: [a-zA-Z0-9_-]+
*
* @param actionName
* The friendly name for the mitigation action. You cannot change
* the name by using UpdateMitigationAction
.
* Instead, you must delete and recreate the mitigation action
* with the new name.
*
* The ARN of the IAM role that is used to apply the mitigation action. *
*
* Constraints:
* Length: 20 - 2048
*
* @return
* The ARN of the IAM role that is used to apply the mitigation * action. *
*/ public String getRoleArn() { return roleArn; } /** ** The ARN of the IAM role that is used to apply the mitigation action. *
*
* Constraints:
* Length: 20 - 2048
*
* @param roleArn
* The ARN of the IAM role that is used to apply the mitigation * action. *
*/ public void setRoleArn(String roleArn) { this.roleArn = roleArn; } /** ** The ARN of the IAM role that is used to apply the mitigation action. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 20 - 2048
*
* @param roleArn
* The ARN of the IAM role that is used to apply the mitigation * action. *
* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateMitigationActionRequest withRoleArn(String roleArn) { this.roleArn = roleArn; return this; } /** ** Defines the type of action and the parameters for that action. *
* * @return* Defines the type of action and the parameters for that action. *
*/ public MitigationActionParams getActionParams() { return actionParams; } /** ** Defines the type of action and the parameters for that action. *
* * @param actionParams* Defines the type of action and the parameters for that action. *
*/ public void setActionParams(MitigationActionParams actionParams) { this.actionParams = actionParams; } /** ** Defines the type of action and the parameters for that action. *
** Returns a reference to this object so that method calls can be chained * together. * * @param actionParams
* Defines the type of action and the parameters for that action. *
* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateMitigationActionRequest 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 (getActionName() != null) sb.append("actionName: " + getActionName() + ","); 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 + ((getActionName() == null) ? 0 : getActionName().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 UpdateMitigationActionRequest == false) return false; UpdateMitigationActionRequest other = (UpdateMitigationActionRequest) obj; if (other.getActionName() == null ^ this.getActionName() == null) return false; if (other.getActionName() != null && other.getActionName().equals(this.getActionName()) == 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; } }