/* * 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 mitigation actions should be executed. *
*/ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class DetectMitigationActionExecution implements Serializable, Cloneable, StructuredPojo { /** ** The unique identifier of the task. *
*/ private String taskId; /** ** The unique identifier of the violation. *
*/ private String violationId; /** ** The friendly name that uniquely identifies the mitigation action. *
*/ private String actionName; /** ** The name of the thing. *
*/ private String thingName; /** ** The date a mitigation action was started. *
*/ private java.util.Date executionStartDate; /** ** The date a mitigation action ended. *
*/ private java.util.Date executionEndDate; /** ** The status of a mitigation action. *
*/ private String status; /** ** The error code of a mitigation action. *
*/ private String errorCode; /** ** The message of a mitigation action. *
*/ private String message; /** ** The unique identifier of the task. *
* * @param taskId * The unique identifier of the task. */ public void setTaskId(String taskId) { this.taskId = taskId; } /** ** The unique identifier of the task. *
* * @return The unique identifier of the task. */ public String getTaskId() { return this.taskId; } /** ** The unique identifier of the task. *
* * @param taskId * The unique identifier of the task. * @return Returns a reference to this object so that method calls can be chained together. */ public DetectMitigationActionExecution withTaskId(String taskId) { setTaskId(taskId); return this; } /** ** The unique identifier of the violation. *
* * @param violationId * The unique identifier of the violation. */ public void setViolationId(String violationId) { this.violationId = violationId; } /** ** The unique identifier of the violation. *
* * @return The unique identifier of the violation. */ public String getViolationId() { return this.violationId; } /** ** The unique identifier of the violation. *
* * @param violationId * The unique identifier of the violation. * @return Returns a reference to this object so that method calls can be chained together. */ public DetectMitigationActionExecution withViolationId(String violationId) { setViolationId(violationId); return this; } /** ** The friendly name that uniquely identifies the mitigation action. *
* * @param actionName * The friendly name that uniquely identifies the mitigation action. */ public void setActionName(String actionName) { this.actionName = actionName; } /** ** The friendly name that uniquely identifies the mitigation action. *
* * @return The friendly name that uniquely identifies the mitigation action. */ public String getActionName() { return this.actionName; } /** ** The friendly name that uniquely identifies the mitigation action. *
* * @param actionName * The friendly name that uniquely identifies the mitigation action. * @return Returns a reference to this object so that method calls can be chained together. */ public DetectMitigationActionExecution withActionName(String actionName) { setActionName(actionName); return this; } /** ** The name of the thing. *
* * @param thingName * The name of the thing. */ public void setThingName(String thingName) { this.thingName = thingName; } /** ** The name of the thing. *
* * @return The name of the thing. */ public String getThingName() { return this.thingName; } /** ** The name of the thing. *
* * @param thingName * The name of the thing. * @return Returns a reference to this object so that method calls can be chained together. */ public DetectMitigationActionExecution withThingName(String thingName) { setThingName(thingName); return this; } /** ** The date a mitigation action was started. *
* * @param executionStartDate * The date a mitigation action was started. */ public void setExecutionStartDate(java.util.Date executionStartDate) { this.executionStartDate = executionStartDate; } /** ** The date a mitigation action was started. *
* * @return The date a mitigation action was started. */ public java.util.Date getExecutionStartDate() { return this.executionStartDate; } /** ** The date a mitigation action was started. *
* * @param executionStartDate * The date a mitigation action was started. * @return Returns a reference to this object so that method calls can be chained together. */ public DetectMitigationActionExecution withExecutionStartDate(java.util.Date executionStartDate) { setExecutionStartDate(executionStartDate); return this; } /** ** The date a mitigation action ended. *
* * @param executionEndDate * The date a mitigation action ended. */ public void setExecutionEndDate(java.util.Date executionEndDate) { this.executionEndDate = executionEndDate; } /** ** The date a mitigation action ended. *
* * @return The date a mitigation action ended. */ public java.util.Date getExecutionEndDate() { return this.executionEndDate; } /** ** The date a mitigation action ended. *
* * @param executionEndDate * The date a mitigation action ended. * @return Returns a reference to this object so that method calls can be chained together. */ public DetectMitigationActionExecution withExecutionEndDate(java.util.Date executionEndDate) { setExecutionEndDate(executionEndDate); return this; } /** ** The status of a mitigation action. *
* * @param status * The status of a mitigation action. * @see DetectMitigationActionExecutionStatus */ public void setStatus(String status) { this.status = status; } /** ** The status of a mitigation action. *
* * @return The status of a mitigation action. * @see DetectMitigationActionExecutionStatus */ public String getStatus() { return this.status; } /** ** The status of a mitigation action. *
* * @param status * The status of a mitigation action. * @return Returns a reference to this object so that method calls can be chained together. * @see DetectMitigationActionExecutionStatus */ public DetectMitigationActionExecution withStatus(String status) { setStatus(status); return this; } /** ** The status of a mitigation action. *
* * @param status * The status of a mitigation action. * @return Returns a reference to this object so that method calls can be chained together. * @see DetectMitigationActionExecutionStatus */ public DetectMitigationActionExecution withStatus(DetectMitigationActionExecutionStatus status) { this.status = status.toString(); return this; } /** ** The error code of a mitigation action. *
* * @param errorCode * The error code of a mitigation action. */ public void setErrorCode(String errorCode) { this.errorCode = errorCode; } /** ** The error code of a mitigation action. *
* * @return The error code of a mitigation action. */ public String getErrorCode() { return this.errorCode; } /** ** The error code of a mitigation action. *
* * @param errorCode * The error code of a mitigation action. * @return Returns a reference to this object so that method calls can be chained together. */ public DetectMitigationActionExecution withErrorCode(String errorCode) { setErrorCode(errorCode); return this; } /** ** The message of a mitigation action. *
* * @param message * The message of a mitigation action. */ public void setMessage(String message) { this.message = message; } /** ** The message of a mitigation action. *
* * @return The message of a mitigation action. */ public String getMessage() { return this.message; } /** ** The message of a mitigation action. *
* * @param message * The message of a mitigation action. * @return Returns a reference to this object so that method calls can be chained together. */ public DetectMitigationActionExecution withMessage(String message) { setMessage(message); 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 (getTaskId() != null) sb.append("TaskId: ").append(getTaskId()).append(","); if (getViolationId() != null) sb.append("ViolationId: ").append(getViolationId()).append(","); if (getActionName() != null) sb.append("ActionName: ").append(getActionName()).append(","); if (getThingName() != null) sb.append("ThingName: ").append(getThingName()).append(","); if (getExecutionStartDate() != null) sb.append("ExecutionStartDate: ").append(getExecutionStartDate()).append(","); if (getExecutionEndDate() != null) sb.append("ExecutionEndDate: ").append(getExecutionEndDate()).append(","); if (getStatus() != null) sb.append("Status: ").append(getStatus()).append(","); if (getErrorCode() != null) sb.append("ErrorCode: ").append(getErrorCode()).append(","); if (getMessage() != null) sb.append("Message: ").append(getMessage()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DetectMitigationActionExecution == false) return false; DetectMitigationActionExecution other = (DetectMitigationActionExecution) obj; if (other.getTaskId() == null ^ this.getTaskId() == null) return false; if (other.getTaskId() != null && other.getTaskId().equals(this.getTaskId()) == false) return false; if (other.getViolationId() == null ^ this.getViolationId() == null) return false; if (other.getViolationId() != null && other.getViolationId().equals(this.getViolationId()) == false) return false; if (other.getActionName() == null ^ this.getActionName() == null) return false; if (other.getActionName() != null && other.getActionName().equals(this.getActionName()) == 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.getExecutionStartDate() == null ^ this.getExecutionStartDate() == null) return false; if (other.getExecutionStartDate() != null && other.getExecutionStartDate().equals(this.getExecutionStartDate()) == false) return false; if (other.getExecutionEndDate() == null ^ this.getExecutionEndDate() == null) return false; if (other.getExecutionEndDate() != null && other.getExecutionEndDate().equals(this.getExecutionEndDate()) == false) return false; if (other.getStatus() == null ^ this.getStatus() == null) return false; if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false) return false; if (other.getErrorCode() == null ^ this.getErrorCode() == null) return false; if (other.getErrorCode() != null && other.getErrorCode().equals(this.getErrorCode()) == false) return false; if (other.getMessage() == null ^ this.getMessage() == null) return false; if (other.getMessage() != null && other.getMessage().equals(this.getMessage()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTaskId() == null) ? 0 : getTaskId().hashCode()); hashCode = prime * hashCode + ((getViolationId() == null) ? 0 : getViolationId().hashCode()); hashCode = prime * hashCode + ((getActionName() == null) ? 0 : getActionName().hashCode()); hashCode = prime * hashCode + ((getThingName() == null) ? 0 : getThingName().hashCode()); hashCode = prime * hashCode + ((getExecutionStartDate() == null) ? 0 : getExecutionStartDate().hashCode()); hashCode = prime * hashCode + ((getExecutionEndDate() == null) ? 0 : getExecutionEndDate().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getErrorCode() == null) ? 0 : getErrorCode().hashCode()); hashCode = prime * hashCode + ((getMessage() == null) ? 0 : getMessage().hashCode()); return hashCode; } @Override public DetectMitigationActionExecution clone() { try { return (DetectMitigationActionExecution) 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.DetectMitigationActionExecutionMarshaller.getInstance().marshall(this, protocolMarshaller); } }