/* * 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; /** *
* Returned by ListAuditMitigationActionsTask, this object contains information that describes a mitigation action that * has been started. *
*/ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AuditMitigationActionExecutionMetadata implements Serializable, Cloneable, StructuredPojo { /** ** The unique identifier for the task that applies the mitigation action. *
*/ private String taskId; /** ** The unique identifier for the findings to which the task and associated mitigation action are applied. *
*/ private String findingId; /** ** The friendly name of the mitigation action being applied by the task. *
*/ 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. *
*/ 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. *
*/ private String message; /** ** The unique identifier for the task that applies the mitigation action. *
* * @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. *
* * @return The unique identifier for the task that applies the mitigation action. */ public String getTaskId() { return this.taskId; } /** ** The unique identifier for the task that applies the mitigation action. *
* * @param taskId * The unique identifier for the task that applies the mitigation action. * @return Returns a reference to this object so that method calls can be chained together. */ public AuditMitigationActionExecutionMetadata withTaskId(String taskId) { setTaskId(taskId); return this; } /** ** The unique identifier for the findings to which the task and associated mitigation action are applied. *
* * @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. *
* * @return The unique identifier for the findings to which the task and associated mitigation action are applied. */ public String getFindingId() { return this.findingId; } /** ** The unique identifier for the findings to which the task and associated mitigation action are applied. *
* * @param findingId * The unique identifier for the findings to which the task and associated mitigation action are applied. * @return Returns a reference to this object so that method calls can be chained together. */ public AuditMitigationActionExecutionMetadata withFindingId(String findingId) { setFindingId(findingId); return this; } /** ** The friendly name of the mitigation action being applied by the task. *
* * @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. *
* * @return The friendly name of the mitigation action being applied by the task. */ public String getActionName() { return this.actionName; } /** ** The friendly name of the mitigation action being applied by the task. *
* * @param actionName * The friendly name of the mitigation action being applied by the task. * @return Returns a reference to this object so that method calls can be chained together. */ public AuditMitigationActionExecutionMetadata withActionName(String actionName) { setActionName(actionName); return this; } /** ** 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. *
* * @return The unique identifier for the mitigation action being applied by the task. */ public String getActionId() { return this.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. * @return Returns a reference to this object so that method calls can be chained together. */ public AuditMitigationActionExecutionMetadata withActionId(String actionId) { setActionId(actionId); return this; } /** ** The current status of the task being executed. *
* * @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. *
* * @return The current status of the task being executed. * @see AuditMitigationActionsExecutionStatus */ public String getStatus() { return this.status; } /** ** The current status of the task being executed. *
* * @param status * The current status of the task being executed. * @return Returns a reference to this object so that method calls can be chained together. * @see AuditMitigationActionsExecutionStatus */ public AuditMitigationActionExecutionMetadata withStatus(String status) { setStatus(status); return this; } /** ** The current status of the task being executed. *
* * @param status * The current status of the task being executed. * @return Returns a reference to this 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. *
* * @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. *
* * @return The date and time when the task was started. */ public java.util.Date getStartTime() { return this.startTime; } /** ** The date and time when the task was started. *
* * @param startTime * The date and time when the task was started. * @return Returns a reference to this object so that method calls can be chained together. */ public AuditMitigationActionExecutionMetadata withStartTime(java.util.Date startTime) { setStartTime(startTime); return this; } /** ** 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. *
* * @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 this.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. * @return Returns a reference to this object so that method calls can be chained together. */ public AuditMitigationActionExecutionMetadata withEndTime(java.util.Date endTime) { setEndTime(endTime); return this; } /** ** 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. *
* * @return If an error occurred, the code that indicates which type of error occurred. */ public String getErrorCode() { return this.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. * @return Returns a reference to this object so that method calls can be chained together. */ public AuditMitigationActionExecutionMetadata withErrorCode(String errorCode) { setErrorCode(errorCode); return this; } /** ** If an error occurred, a message that describes the error. *
* * @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. *
* * @return If an error occurred, a message that describes the error. */ public String getMessage() { return this.message; } /** ** If an error occurred, a message that describes the error. *
* * @param message * If an error occurred, a message that describes the error. * @return Returns a reference to this object so that method calls can be chained together. */ public AuditMitigationActionExecutionMetadata 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 (getFindingId() != null) sb.append("FindingId: ").append(getFindingId()).append(","); if (getActionName() != null) sb.append("ActionName: ").append(getActionName()).append(","); if (getActionId() != null) sb.append("ActionId: ").append(getActionId()).append(","); if (getStatus() != null) sb.append("Status: ").append(getStatus()).append(","); if (getStartTime() != null) sb.append("StartTime: ").append(getStartTime()).append(","); if (getEndTime() != null) sb.append("EndTime: ").append(getEndTime()).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 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; } @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 AuditMitigationActionExecutionMetadata clone() { try { return (AuditMitigationActionExecutionMetadata) 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.AuditMitigationActionExecutionMetadataMarshaller.getInstance().marshall(this, protocolMarshaller); } }