/* * 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; /** *
* Returned by ListAuditMitigationActionsTask, this object contains information * that describes a mitigation action that has been started. *
*/ public class AuditMitigationActionExecutionMetadata implements Serializable { /** ** The unique identifier for the task that applies the mitigation action. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9_-]+
*/
private String taskId;
/**
*
* The unique identifier for the findings to which the task and associated * mitigation action are applied. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9_-]+
*/
private String findingId;
/**
*
* The friendly name of the mitigation action being applied by the task. *
*
* Constraints:
* Length: - 128
* Pattern: [a-zA-Z0-9_-]+
*/
private String actionName;
/**
*
* The unique identifier for the mitigation action being applied by the * task. *
*/ private String actionId; /** ** The current status of the task being executed. *
*
* Constraints:
* Allowed Values: IN_PROGRESS, COMPLETED, FAILED, CANCELED, SKIPPED,
* PENDING
*/
private String status;
/**
*
* The date and time when the task was started. *
*/ private java.util.Date startTime; /** ** The date and time when the task was completed or canceled. Blank if the * task is still running. *
*/ private java.util.Date endTime; /** ** If an error occurred, the code that indicates which type of error * occurred. *
*/ private String errorCode; /** ** If an error occurred, a message that describes the error. *
*
* Constraints:
* Length: - 2048
*/
private String message;
/**
*
* The unique identifier for the task that applies the mitigation action. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9_-]+
*
* @return
* The unique identifier for the task that applies the mitigation * action. *
*/ public String getTaskId() { return taskId; } /** ** The unique identifier for the task that applies the mitigation action. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9_-]+
*
* @param taskId
* The unique identifier for the task that applies the mitigation * action. *
*/ public void setTaskId(String taskId) { this.taskId = taskId; } /** ** The unique identifier for the task that applies the mitigation action. *
** 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 for the task that applies the mitigation * action. *
* @return A reference to this updated object so that method calls can be * chained together. */ public AuditMitigationActionExecutionMetadata withTaskId(String taskId) { this.taskId = taskId; return this; } /** ** The unique identifier for the findings to which the task and associated * mitigation action are applied. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9_-]+
*
* @return
* The unique identifier for the findings to which the task and * associated mitigation action are applied. *
*/ public String getFindingId() { return findingId; } /** ** The unique identifier for the findings to which the task and associated * mitigation action are applied. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9_-]+
*
* @param findingId
* The unique identifier for the findings to which the task and * associated mitigation action are applied. *
*/ public void setFindingId(String findingId) { this.findingId = findingId; } /** ** The unique identifier for the findings to which the task and associated * mitigation action are applied. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9_-]+
*
* @param findingId
* The unique identifier for the findings to which the task and * associated mitigation action are applied. *
* @return A reference to this updated object so that method calls can be * chained together. */ public AuditMitigationActionExecutionMetadata withFindingId(String findingId) { this.findingId = findingId; return this; } /** ** The friendly name of the mitigation action being applied by the task. *
*
* Constraints:
* Length: - 128
* Pattern: [a-zA-Z0-9_-]+
*
* @return
* The friendly name of the mitigation action being applied by the * task. *
*/ public String getActionName() { return actionName; } /** ** The friendly name of the mitigation action being applied by the task. *
*
* Constraints:
* Length: - 128
* Pattern: [a-zA-Z0-9_-]+
*
* @param actionName
* The friendly name of the mitigation action being applied by * the task. *
*/ public void setActionName(String actionName) { this.actionName = actionName; } /** ** The friendly name of the mitigation action being applied by the task. *
** 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 of the mitigation action being applied by * the task. *
* @return A reference to this updated object so that method calls can be * chained together. */ public AuditMitigationActionExecutionMetadata withActionName(String actionName) { this.actionName = actionName; return this; } /** ** The unique identifier for the mitigation action being applied by the * task. *
* * @return* The unique identifier for the mitigation action being applied by * the task. *
*/ public String getActionId() { return actionId; } /** ** The unique identifier for the mitigation action being applied by the * task. *
* * @param actionId* The unique identifier for the mitigation action being applied * by the task. *
*/ public void setActionId(String actionId) { this.actionId = actionId; } /** ** The unique identifier for the mitigation action being applied by the * task. *
** Returns a reference to this object so that method calls can be chained * together. * * @param actionId
* The unique identifier for the mitigation action being applied * by the task. *
* @return A reference to this updated object so that method calls can be * chained together. */ public AuditMitigationActionExecutionMetadata withActionId(String actionId) { this.actionId = actionId; return this; } /** ** The current status of the task being executed. *
*
* Constraints:
* Allowed Values: IN_PROGRESS, COMPLETED, FAILED, CANCELED, SKIPPED,
* PENDING
*
* @return
* The current status of the task being executed. *
* @see AuditMitigationActionsExecutionStatus */ public String getStatus() { return status; } /** ** The current status of the task being executed. *
*
* Constraints:
* Allowed Values: IN_PROGRESS, COMPLETED, FAILED, CANCELED, SKIPPED,
* PENDING
*
* @param status
* The current status of the task being executed. *
* @see AuditMitigationActionsExecutionStatus */ public void setStatus(String status) { this.status = status; } /** ** The current status of the task being executed. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: IN_PROGRESS, COMPLETED, FAILED, CANCELED, SKIPPED,
* PENDING
*
* @param status
* The current status of the task being executed. *
* @return A reference to this updated object so that method calls can be * chained together. * @see AuditMitigationActionsExecutionStatus */ public AuditMitigationActionExecutionMetadata withStatus(String status) { this.status = status; return this; } /** ** The current status of the task being executed. *
*
* Constraints:
* Allowed Values: IN_PROGRESS, COMPLETED, FAILED, CANCELED, SKIPPED,
* PENDING
*
* @param status
* The current status of the task being executed. *
* @see AuditMitigationActionsExecutionStatus */ public void setStatus(AuditMitigationActionsExecutionStatus status) { this.status = status.toString(); } /** ** The current status of the task being executed. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: IN_PROGRESS, COMPLETED, FAILED, CANCELED, SKIPPED,
* PENDING
*
* @param status
* The current status of the task being executed. *
* @return A reference to this updated object so that method calls can be * chained together. * @see AuditMitigationActionsExecutionStatus */ public AuditMitigationActionExecutionMetadata withStatus( AuditMitigationActionsExecutionStatus status) { this.status = status.toString(); return this; } /** ** The date and time when the task was started. *
* * @return* The date and time when the task was started. *
*/ public java.util.Date getStartTime() { return startTime; } /** ** The date and time when the task was started. *
* * @param startTime* The date and time when the task was started. *
*/ public void setStartTime(java.util.Date startTime) { this.startTime = startTime; } /** ** The date and time when the task was started. *
** Returns a reference to this object so that method calls can be chained * together. * * @param startTime
* The date and time when the task was started. *
* @return A reference to this updated object so that method calls can be * chained together. */ public AuditMitigationActionExecutionMetadata withStartTime(java.util.Date startTime) { this.startTime = startTime; return this; } /** ** The date and time when the task was completed or canceled. Blank if the * task is still running. *
* * @return* The date and time when the task was completed or canceled. Blank * if the task is still running. *
*/ public java.util.Date getEndTime() { return endTime; } /** ** The date and time when the task was completed or canceled. Blank if the * task is still running. *
* * @param endTime* The date and time when the task was completed or canceled. * Blank if the task is still running. *
*/ public void setEndTime(java.util.Date endTime) { this.endTime = endTime; } /** ** The date and time when the task was completed or canceled. Blank if the * task is still running. *
** Returns a reference to this object so that method calls can be chained * together. * * @param endTime
* The date and time when the task was completed or canceled. * Blank if the task is still running. *
* @return A reference to this updated object so that method calls can be * chained together. */ public AuditMitigationActionExecutionMetadata withEndTime(java.util.Date endTime) { this.endTime = endTime; return this; } /** ** If an error occurred, the code that indicates which type of error * occurred. *
* * @return* If an error occurred, the code that indicates which type of error * occurred. *
*/ public String getErrorCode() { return errorCode; } /** ** If an error occurred, the code that indicates which type of error * occurred. *
* * @param errorCode* If an error occurred, the code that indicates which type of * error occurred. *
*/ public void setErrorCode(String errorCode) { this.errorCode = errorCode; } /** ** If an error occurred, the code that indicates which type of error * occurred. *
** Returns a reference to this object so that method calls can be chained * together. * * @param errorCode
* If an error occurred, the code that indicates which type of * error occurred. *
* @return A reference to this updated object so that method calls can be * chained together. */ public AuditMitigationActionExecutionMetadata withErrorCode(String errorCode) { this.errorCode = errorCode; return this; } /** ** If an error occurred, a message that describes the error. *
*
* Constraints:
* Length: - 2048
*
* @return
* If an error occurred, a message that describes the error. *
*/ public String getMessage() { return message; } /** ** If an error occurred, a message that describes the error. *
*
* Constraints:
* Length: - 2048
*
* @param message
* If an error occurred, a message that describes the error. *
*/ public void setMessage(String message) { this.message = message; } /** ** If an error occurred, a message that describes the error. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: - 2048
*
* @param message
* If an error occurred, a message that describes the error. *
* @return A reference to this updated object so that method calls can be * chained together. */ public AuditMitigationActionExecutionMetadata 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 (getFindingId() != null) sb.append("findingId: " + getFindingId() + ","); if (getActionName() != null) sb.append("actionName: " + getActionName() + ","); if (getActionId() != null) sb.append("actionId: " + getActionId() + ","); if (getStatus() != null) sb.append("status: " + getStatus() + ","); if (getStartTime() != null) sb.append("startTime: " + getStartTime() + ","); if (getEndTime() != null) sb.append("endTime: " + getEndTime() + ","); 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 + ((getFindingId() == null) ? 0 : getFindingId().hashCode()); hashCode = prime * hashCode + ((getActionName() == null) ? 0 : getActionName().hashCode()); hashCode = prime * hashCode + ((getActionId() == null) ? 0 : getActionId().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getStartTime() == null) ? 0 : getStartTime().hashCode()); hashCode = prime * hashCode + ((getEndTime() == null) ? 0 : getEndTime().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 AuditMitigationActionExecutionMetadata == false) return false; AuditMitigationActionExecutionMetadata other = (AuditMitigationActionExecutionMetadata) obj; if (other.getTaskId() == null ^ this.getTaskId() == null) return false; if (other.getTaskId() != null && other.getTaskId().equals(this.getTaskId()) == false) return false; if (other.getFindingId() == null ^ this.getFindingId() == null) return false; if (other.getFindingId() != null && other.getFindingId().equals(this.getFindingId()) == 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.getActionId() == null ^ this.getActionId() == null) return false; if (other.getActionId() != null && other.getActionId().equals(this.getActionId()) == 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.getStartTime() == null ^ this.getStartTime() == null) return false; if (other.getStartTime() != null && other.getStartTime().equals(this.getStartTime()) == false) return false; if (other.getEndTime() == null ^ this.getEndTime() == null) return false; if (other.getEndTime() != null && other.getEndTime().equals(this.getEndTime()) == 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; } }