/* * 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; public class DescribeAuditMitigationActionsTaskResult implements Serializable { /** *

* The current status of the task. *

*

* Constraints:
* Allowed Values: IN_PROGRESS, COMPLETED, FAILED, CANCELED */ private String taskStatus; /** *

* 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. *

*/ private java.util.Date endTime; /** *

* Aggregate counts of the results when the mitigation tasks were applied to * the findings for this audit mitigation actions task. *

*/ private java.util.Map taskStatistics; /** *

* Identifies the findings to which the mitigation actions are applied. This * can be by audit checks, by audit task, or a set of findings. *

*/ private AuditMitigationActionsTaskTarget target; /** *

* Specifies the mitigation actions that should be applied to specific audit * checks. *

*/ private java.util.Map> auditCheckToActionsMapping; /** *

* Specifies the mitigation actions and their parameters that are applied as * part of this task. *

*/ private java.util.List actionsDefinition; /** *

* The current status of the task. *

*

* Constraints:
* Allowed Values: IN_PROGRESS, COMPLETED, FAILED, CANCELED * * @return

* The current status of the task. *

* @see AuditMitigationActionsTaskStatus */ public String getTaskStatus() { return taskStatus; } /** *

* The current status of the task. *

*

* Constraints:
* Allowed Values: IN_PROGRESS, COMPLETED, FAILED, CANCELED * * @param taskStatus

* The current status of the task. *

* @see AuditMitigationActionsTaskStatus */ public void setTaskStatus(String taskStatus) { this.taskStatus = taskStatus; } /** *

* The current status of the task. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: IN_PROGRESS, COMPLETED, FAILED, CANCELED * * @param taskStatus

* The current status of the task. *

* @return A reference to this updated object so that method calls can be * chained together. * @see AuditMitigationActionsTaskStatus */ public DescribeAuditMitigationActionsTaskResult withTaskStatus(String taskStatus) { this.taskStatus = taskStatus; return this; } /** *

* The current status of the task. *

*

* Constraints:
* Allowed Values: IN_PROGRESS, COMPLETED, FAILED, CANCELED * * @param taskStatus

* The current status of the task. *

* @see AuditMitigationActionsTaskStatus */ public void setTaskStatus(AuditMitigationActionsTaskStatus taskStatus) { this.taskStatus = taskStatus.toString(); } /** *

* The current status of the task. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: IN_PROGRESS, COMPLETED, FAILED, CANCELED * * @param taskStatus

* The current status of the task. *

* @return A reference to this updated object so that method calls can be * chained together. * @see AuditMitigationActionsTaskStatus */ public DescribeAuditMitigationActionsTaskResult withTaskStatus( AuditMitigationActionsTaskStatus taskStatus) { this.taskStatus = taskStatus.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 DescribeAuditMitigationActionsTaskResult withStartTime(java.util.Date startTime) { this.startTime = startTime; return this; } /** *

* The date and time when the task was completed or canceled. *

* * @return

* The date and time when the task was completed or canceled. *

*/ public java.util.Date getEndTime() { return endTime; } /** *

* The date and time when the task was completed or canceled. *

* * @param endTime

* The date and time when the task was completed or canceled. *

*/ public void setEndTime(java.util.Date endTime) { this.endTime = endTime; } /** *

* The date and time when the task was completed or canceled. *

*

* 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. *

* @return A reference to this updated object so that method calls can be * chained together. */ public DescribeAuditMitigationActionsTaskResult withEndTime(java.util.Date endTime) { this.endTime = endTime; return this; } /** *

* Aggregate counts of the results when the mitigation tasks were applied to * the findings for this audit mitigation actions task. *

* * @return

* Aggregate counts of the results when the mitigation tasks were * applied to the findings for this audit mitigation actions task. *

*/ public java.util.Map getTaskStatistics() { return taskStatistics; } /** *

* Aggregate counts of the results when the mitigation tasks were applied to * the findings for this audit mitigation actions task. *

* * @param taskStatistics

* Aggregate counts of the results when the mitigation tasks were * applied to the findings for this audit mitigation actions * task. *

*/ public void setTaskStatistics(java.util.Map taskStatistics) { this.taskStatistics = taskStatistics; } /** *

* Aggregate counts of the results when the mitigation tasks were applied to * the findings for this audit mitigation actions task. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param taskStatistics

* Aggregate counts of the results when the mitigation tasks were * applied to the findings for this audit mitigation actions * task. *

* @return A reference to this updated object so that method calls can be * chained together. */ public DescribeAuditMitigationActionsTaskResult withTaskStatistics( java.util.Map taskStatistics) { this.taskStatistics = taskStatistics; return this; } /** *

* Aggregate counts of the results when the mitigation tasks were applied to * the findings for this audit mitigation actions task. *

*

* The method adds a new key-value pair into taskStatistics parameter, and * returns a reference to this object so that method calls can be chained * together. * * @param key The key of the entry to be added into taskStatistics. * @param value The corresponding value of the entry to be added into * taskStatistics. * @return A reference to this updated object so that method calls can be * chained together. */ public DescribeAuditMitigationActionsTaskResult addtaskStatisticsEntry(String key, TaskStatisticsForAuditCheck value) { if (null == this.taskStatistics) { this.taskStatistics = new java.util.HashMap(); } if (this.taskStatistics.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.taskStatistics.put(key, value); return this; } /** * Removes all the entries added into taskStatistics. *

* Returns a reference to this object so that method calls can be chained * together. */ public DescribeAuditMitigationActionsTaskResult cleartaskStatisticsEntries() { this.taskStatistics = null; return this; } /** *

* Identifies the findings to which the mitigation actions are applied. This * can be by audit checks, by audit task, or a set of findings. *

* * @return

* Identifies the findings to which the mitigation actions are * applied. This can be by audit checks, by audit task, or a set of * findings. *

*/ public AuditMitigationActionsTaskTarget getTarget() { return target; } /** *

* Identifies the findings to which the mitigation actions are applied. This * can be by audit checks, by audit task, or a set of findings. *

* * @param target

* Identifies the findings to which the mitigation actions are * applied. This can be by audit checks, by audit task, or a set * of findings. *

*/ public void setTarget(AuditMitigationActionsTaskTarget target) { this.target = target; } /** *

* Identifies the findings to which the mitigation actions are applied. This * can be by audit checks, by audit task, or a set of findings. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param target

* Identifies the findings to which the mitigation actions are * applied. This can be by audit checks, by audit task, or a set * of findings. *

* @return A reference to this updated object so that method calls can be * chained together. */ public DescribeAuditMitigationActionsTaskResult withTarget( AuditMitigationActionsTaskTarget target) { this.target = target; return this; } /** *

* Specifies the mitigation actions that should be applied to specific audit * checks. *

* * @return

* Specifies the mitigation actions that should be applied to * specific audit checks. *

*/ public java.util.Map> getAuditCheckToActionsMapping() { return auditCheckToActionsMapping; } /** *

* Specifies the mitigation actions that should be applied to specific audit * checks. *

* * @param auditCheckToActionsMapping

* Specifies the mitigation actions that should be applied to * specific audit checks. *

*/ public void setAuditCheckToActionsMapping( java.util.Map> auditCheckToActionsMapping) { this.auditCheckToActionsMapping = auditCheckToActionsMapping; } /** *

* Specifies the mitigation actions that should be applied to specific audit * checks. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param auditCheckToActionsMapping

* Specifies the mitigation actions that should be applied to * specific audit checks. *

* @return A reference to this updated object so that method calls can be * chained together. */ public DescribeAuditMitigationActionsTaskResult withAuditCheckToActionsMapping( java.util.Map> auditCheckToActionsMapping) { this.auditCheckToActionsMapping = auditCheckToActionsMapping; return this; } /** *

* Specifies the mitigation actions that should be applied to specific audit * checks. *

*

* The method adds a new key-value pair into auditCheckToActionsMapping * parameter, and returns a reference to this object so that method calls * can be chained together. * * @param key The key of the entry to be added into * auditCheckToActionsMapping. * @param value The corresponding value of the entry to be added into * auditCheckToActionsMapping. * @return A reference to this updated object so that method calls can be * chained together. */ public DescribeAuditMitigationActionsTaskResult addauditCheckToActionsMappingEntry(String key, java.util.List value) { if (null == this.auditCheckToActionsMapping) { this.auditCheckToActionsMapping = new java.util.HashMap>(); } if (this.auditCheckToActionsMapping.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.auditCheckToActionsMapping.put(key, value); return this; } /** * Removes all the entries added into auditCheckToActionsMapping. *

* Returns a reference to this object so that method calls can be chained * together. */ public DescribeAuditMitigationActionsTaskResult clearauditCheckToActionsMappingEntries() { this.auditCheckToActionsMapping = null; return this; } /** *

* Specifies the mitigation actions and their parameters that are applied as * part of this task. *

* * @return

* Specifies the mitigation actions and their parameters that are * applied as part of this task. *

*/ public java.util.List getActionsDefinition() { return actionsDefinition; } /** *

* Specifies the mitigation actions and their parameters that are applied as * part of this task. *

* * @param actionsDefinition

* Specifies the mitigation actions and their parameters that are * applied as part of this task. *

*/ public void setActionsDefinition(java.util.Collection actionsDefinition) { if (actionsDefinition == null) { this.actionsDefinition = null; return; } this.actionsDefinition = new java.util.ArrayList(actionsDefinition); } /** *

* Specifies the mitigation actions and their parameters that are applied as * part of this task. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param actionsDefinition

* Specifies the mitigation actions and their parameters that are * applied as part of this task. *

* @return A reference to this updated object so that method calls can be * chained together. */ public DescribeAuditMitigationActionsTaskResult withActionsDefinition( MitigationAction... actionsDefinition) { if (getActionsDefinition() == null) { this.actionsDefinition = new java.util.ArrayList( actionsDefinition.length); } for (MitigationAction value : actionsDefinition) { this.actionsDefinition.add(value); } return this; } /** *

* Specifies the mitigation actions and their parameters that are applied as * part of this task. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param actionsDefinition

* Specifies the mitigation actions and their parameters that are * applied as part of this task. *

* @return A reference to this updated object so that method calls can be * chained together. */ public DescribeAuditMitigationActionsTaskResult withActionsDefinition( java.util.Collection actionsDefinition) { setActionsDefinition(actionsDefinition); 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 (getTaskStatus() != null) sb.append("taskStatus: " + getTaskStatus() + ","); if (getStartTime() != null) sb.append("startTime: " + getStartTime() + ","); if (getEndTime() != null) sb.append("endTime: " + getEndTime() + ","); if (getTaskStatistics() != null) sb.append("taskStatistics: " + getTaskStatistics() + ","); if (getTarget() != null) sb.append("target: " + getTarget() + ","); if (getAuditCheckToActionsMapping() != null) sb.append("auditCheckToActionsMapping: " + getAuditCheckToActionsMapping() + ","); if (getActionsDefinition() != null) sb.append("actionsDefinition: " + getActionsDefinition()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTaskStatus() == null) ? 0 : getTaskStatus().hashCode()); hashCode = prime * hashCode + ((getStartTime() == null) ? 0 : getStartTime().hashCode()); hashCode = prime * hashCode + ((getEndTime() == null) ? 0 : getEndTime().hashCode()); hashCode = prime * hashCode + ((getTaskStatistics() == null) ? 0 : getTaskStatistics().hashCode()); hashCode = prime * hashCode + ((getTarget() == null) ? 0 : getTarget().hashCode()); hashCode = prime * hashCode + ((getAuditCheckToActionsMapping() == null) ? 0 : getAuditCheckToActionsMapping() .hashCode()); hashCode = prime * hashCode + ((getActionsDefinition() == null) ? 0 : getActionsDefinition().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DescribeAuditMitigationActionsTaskResult == false) return false; DescribeAuditMitigationActionsTaskResult other = (DescribeAuditMitigationActionsTaskResult) obj; if (other.getTaskStatus() == null ^ this.getTaskStatus() == null) return false; if (other.getTaskStatus() != null && other.getTaskStatus().equals(this.getTaskStatus()) == 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.getTaskStatistics() == null ^ this.getTaskStatistics() == null) return false; if (other.getTaskStatistics() != null && other.getTaskStatistics().equals(this.getTaskStatistics()) == false) return false; if (other.getTarget() == null ^ this.getTarget() == null) return false; if (other.getTarget() != null && other.getTarget().equals(this.getTarget()) == false) return false; if (other.getAuditCheckToActionsMapping() == null ^ this.getAuditCheckToActionsMapping() == null) return false; if (other.getAuditCheckToActionsMapping() != null && other.getAuditCheckToActionsMapping().equals( this.getAuditCheckToActionsMapping()) == false) return false; if (other.getActionsDefinition() == null ^ this.getActionsDefinition() == null) return false; if (other.getActionsDefinition() != null && other.getActionsDefinition().equals(this.getActionsDefinition()) == false) return false; return true; } }