/* * 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 mitigation actions should be executed. *
*/ public class DetectMitigationActionExecution implements Serializable { /** ** The unique identifier of the task. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9_-]+
*/
private String taskId;
/**
*
* The unique identifier of the violation. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9\-]+
*/
private String violationId;
/**
*
* The friendly name that uniquely identifies the mitigation action. *
*
* Constraints:
* Length: - 128
* Pattern: [a-zA-Z0-9_-]+
*/
private String actionName;
/**
*
* The name of the thing. *
*
* Constraints:
* Length: 1 - 128
*/
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. *
*
* Constraints:
* Allowed Values: IN_PROGRESS, SUCCESSFUL, FAILED, SKIPPED
*/
private String status;
/**
*
* The error code of a mitigation action. *
*/ private String errorCode; /** ** The message of a mitigation action. *
*
* Constraints:
* Length: - 2048
*/
private String message;
/**
*
* The unique identifier of the task. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9_-]+
*
* @return
* The unique identifier of the task. *
*/ public String getTaskId() { return taskId; } /** ** The unique identifier of the task. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9_-]+
*
* @param taskId
* The unique identifier of the task. *
*/ public void setTaskId(String taskId) { this.taskId = taskId; } /** ** The unique identifier of the task. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9_-]+
*
* @param taskId
* The unique identifier of the task. *
* @return A reference to this updated object so that method calls can be * chained together. */ public DetectMitigationActionExecution withTaskId(String taskId) { this.taskId = taskId; return this; } /** ** The unique identifier of the violation. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9\-]+
*
* @return
* The unique identifier of the violation. *
*/ public String getViolationId() { return violationId; } /** ** The unique identifier of the violation. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9\-]+
*
* @param violationId
* The unique identifier of the violation. *
*/ public void setViolationId(String violationId) { this.violationId = violationId; } /** ** The unique identifier of the violation. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9\-]+
*
* @param violationId
* The unique identifier of the violation. *
* @return A reference to this updated object so that method calls can be * chained together. */ public DetectMitigationActionExecution withViolationId(String violationId) { this.violationId = violationId; return this; } /** ** The friendly name that uniquely identifies the mitigation action. *
*
* Constraints:
* Length: - 128
* Pattern: [a-zA-Z0-9_-]+
*
* @return
* The friendly name that uniquely identifies the mitigation action. *
*/ public String getActionName() { return actionName; } /** ** The friendly name that uniquely identifies the mitigation action. *
*
* Constraints:
* Length: - 128
* Pattern: [a-zA-Z0-9_-]+
*
* @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. *
** 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 that uniquely identifies the mitigation * action. *
* @return A reference to this updated object so that method calls can be * chained together. */ public DetectMitigationActionExecution withActionName(String actionName) { this.actionName = actionName; return this; } /** ** The name of the thing. *
*
* Constraints:
* Length: 1 - 128
*
* @return
* The name of the thing. *
*/ public String getThingName() { return thingName; } /** ** The name of the thing. *
*
* Constraints:
* Length: 1 - 128
*
* @param thingName
* The name of the thing. *
*/ public void setThingName(String thingName) { this.thingName = thingName; } /** ** The name of the thing. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 1 - 128
*
* @param thingName
* The name of the thing. *
* @return A reference to this updated object so that method calls can be * chained together. */ public DetectMitigationActionExecution withThingName(String thingName) { this.thingName = thingName; return this; } /** ** The date a mitigation action was started. *
* * @return* The date a mitigation action was started. *
*/ public java.util.Date getExecutionStartDate() { return executionStartDate; } /** ** 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. *
** Returns a reference to this object so that method calls can be chained * together. * * @param executionStartDate
* The date a mitigation action was started. *
* @return A reference to this updated object so that method calls can be * chained together. */ public DetectMitigationActionExecution withExecutionStartDate(java.util.Date executionStartDate) { this.executionStartDate = executionStartDate; return this; } /** ** The date a mitigation action ended. *
* * @return* The date a mitigation action ended. *
*/ public java.util.Date getExecutionEndDate() { return executionEndDate; } /** ** 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. *
** Returns a reference to this object so that method calls can be chained * together. * * @param executionEndDate
* The date a mitigation action ended. *
* @return A reference to this updated object so that method calls can be * chained together. */ public DetectMitigationActionExecution withExecutionEndDate(java.util.Date executionEndDate) { this.executionEndDate = executionEndDate; return this; } /** ** The status of a mitigation action. *
*
* Constraints:
* Allowed Values: IN_PROGRESS, SUCCESSFUL, FAILED, SKIPPED
*
* @return
* The status of a mitigation action. *
* @see DetectMitigationActionExecutionStatus */ public String getStatus() { return status; } /** ** The status of a mitigation action. *
*
* Constraints:
* Allowed Values: IN_PROGRESS, SUCCESSFUL, FAILED, SKIPPED
*
* @param status
* The status of a mitigation action. *
* @see DetectMitigationActionExecutionStatus */ public void setStatus(String status) { this.status = status; } /** ** The status of a mitigation action. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: IN_PROGRESS, SUCCESSFUL, FAILED, SKIPPED
*
* @param status
* The status of a mitigation action. *
* @return A reference to this updated object so that method calls can be * chained together. * @see DetectMitigationActionExecutionStatus */ public DetectMitigationActionExecution withStatus(String status) { this.status = status; return this; } /** ** The status of a mitigation action. *
*
* Constraints:
* Allowed Values: IN_PROGRESS, SUCCESSFUL, FAILED, SKIPPED
*
* @param status
* The status of a mitigation action. *
* @see DetectMitigationActionExecutionStatus */ public void setStatus(DetectMitigationActionExecutionStatus status) { this.status = status.toString(); } /** ** The status of a mitigation action. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: IN_PROGRESS, SUCCESSFUL, FAILED, SKIPPED
*
* @param status
* The status of a mitigation action. *
* @return A reference to this updated 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. *
* * @return* The error code of a mitigation action. *
*/ public String getErrorCode() { return errorCode; } /** ** 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. *
** Returns a reference to this object so that method calls can be chained * together. * * @param errorCode
* The error code of a mitigation action. *
* @return A reference to this updated object so that method calls can be * chained together. */ public DetectMitigationActionExecution withErrorCode(String errorCode) { this.errorCode = errorCode; return this; } /** ** The message of a mitigation action. *
*
* Constraints:
* Length: - 2048
*
* @return
* The message of a mitigation action. *
*/ public String getMessage() { return message; } /** ** The message of a mitigation action. *
*
* Constraints:
* Length: - 2048
*
* @param message
* The message of a mitigation action. *
*/ public void setMessage(String message) { this.message = message; } /** ** The message of a mitigation action. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: - 2048
*
* @param message
* The message of a mitigation action. *
* @return A reference to this updated object so that method calls can be * chained together. */ public DetectMitigationActionExecution withMessage(String message) { this.message = message; 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 (getTaskId() != null) sb.append("taskId: " + getTaskId() + ","); if (getViolationId() != null) sb.append("violationId: " + getViolationId() + ","); if (getActionName() != null) sb.append("actionName: " + getActionName() + ","); if (getThingName() != null) sb.append("thingName: " + getThingName() + ","); if (getExecutionStartDate() != null) sb.append("executionStartDate: " + getExecutionStartDate() + ","); if (getExecutionEndDate() != null) sb.append("executionEndDate: " + getExecutionEndDate() + ","); if (getStatus() != null) sb.append("status: " + getStatus() + ","); if (getErrorCode() != null) sb.append("errorCode: " + getErrorCode() + ","); if (getMessage() != null) sb.append("message: " + getMessage()); sb.append("}"); return sb.toString(); } @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 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; } }