/* * 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; /** *

* The summary of the mitigation action tasks. *

*/ public class DetectMitigationActionsTaskSummary implements Serializable { /** *

* The unique identifier of the task. *

*

* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9_-]+
*/ private String taskId; /** *

* The status of the task. *

*

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

* The date the task started. *

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

* The date the task ended. *

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

* Specifies the ML Detect findings to which the mitigation actions are * applied. *

*/ private DetectMitigationActionsTaskTarget target; /** *

* Specifies the time period of which violation events occurred between. *

*/ private ViolationEventOccurrenceRange violationEventOccurrenceRange; /** *

* Includes only active violations. *

*/ private Boolean onlyActiveViolationsIncluded; /** *

* Includes suppressed alerts. *

*/ private Boolean suppressedAlertsIncluded; /** *

* The definition of the actions. *

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

* The statistics of a mitigation action task. *

*/ private DetectMitigationActionsTaskStatistics taskStatistics; /** *

* 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 DetectMitigationActionsTaskSummary withTaskId(String taskId) { this.taskId = taskId; return this; } /** *

* The status of the task. *

*

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

* The status of the task. *

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

* The status of the task. *

*

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

* The status of the task. *

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

* The status of the task. *

*

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

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

* The status of the task. *

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

* The status of the task. *

*

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

* The status of the task. *

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

* The status of the task. *

*

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

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

* The status of the task. *

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

* The date the task started. *

* * @return

* The date the task started. *

*/ public java.util.Date getTaskStartTime() { return taskStartTime; } /** *

* The date the task started. *

* * @param taskStartTime

* The date the task started. *

*/ public void setTaskStartTime(java.util.Date taskStartTime) { this.taskStartTime = taskStartTime; } /** *

* The date the task started. *

*

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

* The date the task started. *

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

* The date the task ended. *

* * @return

* The date the task ended. *

*/ public java.util.Date getTaskEndTime() { return taskEndTime; } /** *

* The date the task ended. *

* * @param taskEndTime

* The date the task ended. *

*/ public void setTaskEndTime(java.util.Date taskEndTime) { this.taskEndTime = taskEndTime; } /** *

* The date the task ended. *

*

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

* The date the task ended. *

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

* Specifies the ML Detect findings to which the mitigation actions are * applied. *

* * @return

* Specifies the ML Detect findings to which the mitigation actions * are applied. *

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

* Specifies the ML Detect findings to which the mitigation actions are * applied. *

* * @param target

* Specifies the ML Detect findings to which the mitigation * actions are applied. *

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

* Specifies the ML Detect findings to which the mitigation actions are * applied. *

*

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

* Specifies the ML Detect findings to which the mitigation * actions are applied. *

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

* Specifies the time period of which violation events occurred between. *

* * @return

* Specifies the time period of which violation events occurred * between. *

*/ public ViolationEventOccurrenceRange getViolationEventOccurrenceRange() { return violationEventOccurrenceRange; } /** *

* Specifies the time period of which violation events occurred between. *

* * @param violationEventOccurrenceRange

* Specifies the time period of which violation events occurred * between. *

*/ public void setViolationEventOccurrenceRange( ViolationEventOccurrenceRange violationEventOccurrenceRange) { this.violationEventOccurrenceRange = violationEventOccurrenceRange; } /** *

* Specifies the time period of which violation events occurred between. *

*

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

* Specifies the time period of which violation events occurred * between. *

* @return A reference to this updated object so that method calls can be * chained together. */ public DetectMitigationActionsTaskSummary withViolationEventOccurrenceRange( ViolationEventOccurrenceRange violationEventOccurrenceRange) { this.violationEventOccurrenceRange = violationEventOccurrenceRange; return this; } /** *

* Includes only active violations. *

* * @return

* Includes only active violations. *

*/ public Boolean isOnlyActiveViolationsIncluded() { return onlyActiveViolationsIncluded; } /** *

* Includes only active violations. *

* * @return

* Includes only active violations. *

*/ public Boolean getOnlyActiveViolationsIncluded() { return onlyActiveViolationsIncluded; } /** *

* Includes only active violations. *

* * @param onlyActiveViolationsIncluded

* Includes only active violations. *

*/ public void setOnlyActiveViolationsIncluded(Boolean onlyActiveViolationsIncluded) { this.onlyActiveViolationsIncluded = onlyActiveViolationsIncluded; } /** *

* Includes only active violations. *

*

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

* Includes only active violations. *

* @return A reference to this updated object so that method calls can be * chained together. */ public DetectMitigationActionsTaskSummary withOnlyActiveViolationsIncluded( Boolean onlyActiveViolationsIncluded) { this.onlyActiveViolationsIncluded = onlyActiveViolationsIncluded; return this; } /** *

* Includes suppressed alerts. *

* * @return

* Includes suppressed alerts. *

*/ public Boolean isSuppressedAlertsIncluded() { return suppressedAlertsIncluded; } /** *

* Includes suppressed alerts. *

* * @return

* Includes suppressed alerts. *

*/ public Boolean getSuppressedAlertsIncluded() { return suppressedAlertsIncluded; } /** *

* Includes suppressed alerts. *

* * @param suppressedAlertsIncluded

* Includes suppressed alerts. *

*/ public void setSuppressedAlertsIncluded(Boolean suppressedAlertsIncluded) { this.suppressedAlertsIncluded = suppressedAlertsIncluded; } /** *

* Includes suppressed alerts. *

*

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

* Includes suppressed alerts. *

* @return A reference to this updated object so that method calls can be * chained together. */ public DetectMitigationActionsTaskSummary withSuppressedAlertsIncluded( Boolean suppressedAlertsIncluded) { this.suppressedAlertsIncluded = suppressedAlertsIncluded; return this; } /** *

* The definition of the actions. *

* * @return

* The definition of the actions. *

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

* The definition of the actions. *

* * @param actionsDefinition

* The definition of the actions. *

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

* The definition of the actions. *

*

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

* The definition of the actions. *

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

* The definition of the actions. *

*

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

* The definition of the actions. *

* @return A reference to this updated object so that method calls can be * chained together. */ public DetectMitigationActionsTaskSummary withActionsDefinition( java.util.Collection actionsDefinition) { setActionsDefinition(actionsDefinition); return this; } /** *

* The statistics of a mitigation action task. *

* * @return

* The statistics of a mitigation action task. *

*/ public DetectMitigationActionsTaskStatistics getTaskStatistics() { return taskStatistics; } /** *

* The statistics of a mitigation action task. *

* * @param taskStatistics

* The statistics of a mitigation action task. *

*/ public void setTaskStatistics(DetectMitigationActionsTaskStatistics taskStatistics) { this.taskStatistics = taskStatistics; } /** *

* The statistics of a mitigation action task. *

*

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

* The statistics of a mitigation action task. *

* @return A reference to this updated object so that method calls can be * chained together. */ public DetectMitigationActionsTaskSummary withTaskStatistics( DetectMitigationActionsTaskStatistics taskStatistics) { this.taskStatistics = taskStatistics; 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 (getTaskStatus() != null) sb.append("taskStatus: " + getTaskStatus() + ","); if (getTaskStartTime() != null) sb.append("taskStartTime: " + getTaskStartTime() + ","); if (getTaskEndTime() != null) sb.append("taskEndTime: " + getTaskEndTime() + ","); if (getTarget() != null) sb.append("target: " + getTarget() + ","); if (getViolationEventOccurrenceRange() != null) sb.append("violationEventOccurrenceRange: " + getViolationEventOccurrenceRange() + ","); if (getOnlyActiveViolationsIncluded() != null) sb.append("onlyActiveViolationsIncluded: " + getOnlyActiveViolationsIncluded() + ","); if (getSuppressedAlertsIncluded() != null) sb.append("suppressedAlertsIncluded: " + getSuppressedAlertsIncluded() + ","); if (getActionsDefinition() != null) sb.append("actionsDefinition: " + getActionsDefinition() + ","); if (getTaskStatistics() != null) sb.append("taskStatistics: " + getTaskStatistics()); 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 + ((getTaskStatus() == null) ? 0 : getTaskStatus().hashCode()); hashCode = prime * hashCode + ((getTaskStartTime() == null) ? 0 : getTaskStartTime().hashCode()); hashCode = prime * hashCode + ((getTaskEndTime() == null) ? 0 : getTaskEndTime().hashCode()); hashCode = prime * hashCode + ((getTarget() == null) ? 0 : getTarget().hashCode()); hashCode = prime * hashCode + ((getViolationEventOccurrenceRange() == null) ? 0 : getViolationEventOccurrenceRange().hashCode()); hashCode = prime * hashCode + ((getOnlyActiveViolationsIncluded() == null) ? 0 : getOnlyActiveViolationsIncluded().hashCode()); hashCode = prime * hashCode + ((getSuppressedAlertsIncluded() == null) ? 0 : getSuppressedAlertsIncluded() .hashCode()); hashCode = prime * hashCode + ((getActionsDefinition() == null) ? 0 : getActionsDefinition().hashCode()); hashCode = prime * hashCode + ((getTaskStatistics() == null) ? 0 : getTaskStatistics().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DetectMitigationActionsTaskSummary == false) return false; DetectMitigationActionsTaskSummary other = (DetectMitigationActionsTaskSummary) obj; if (other.getTaskId() == null ^ this.getTaskId() == null) return false; if (other.getTaskId() != null && other.getTaskId().equals(this.getTaskId()) == false) return false; if (other.getTaskStatus() == null ^ this.getTaskStatus() == null) return false; if (other.getTaskStatus() != null && other.getTaskStatus().equals(this.getTaskStatus()) == false) return false; if (other.getTaskStartTime() == null ^ this.getTaskStartTime() == null) return false; if (other.getTaskStartTime() != null && other.getTaskStartTime().equals(this.getTaskStartTime()) == false) return false; if (other.getTaskEndTime() == null ^ this.getTaskEndTime() == null) return false; if (other.getTaskEndTime() != null && other.getTaskEndTime().equals(this.getTaskEndTime()) == 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.getViolationEventOccurrenceRange() == null ^ this.getViolationEventOccurrenceRange() == null) return false; if (other.getViolationEventOccurrenceRange() != null && other.getViolationEventOccurrenceRange().equals( this.getViolationEventOccurrenceRange()) == false) return false; if (other.getOnlyActiveViolationsIncluded() == null ^ this.getOnlyActiveViolationsIncluded() == null) return false; if (other.getOnlyActiveViolationsIncluded() != null && other.getOnlyActiveViolationsIncluded().equals( this.getOnlyActiveViolationsIncluded()) == false) return false; if (other.getSuppressedAlertsIncluded() == null ^ this.getSuppressedAlertsIncluded() == null) return false; if (other.getSuppressedAlertsIncluded() != null && other.getSuppressedAlertsIncluded().equals(this.getSuppressedAlertsIncluded()) == false) return false; if (other.getActionsDefinition() == null ^ this.getActionsDefinition() == null) return false; if (other.getActionsDefinition() != null && other.getActionsDefinition().equals(this.getActionsDefinition()) == false) return false; if (other.getTaskStatistics() == null ^ this.getTaskStatistics() == null) return false; if (other.getTaskStatistics() != null && other.getTaskStatistics().equals(this.getTaskStatistics()) == false) return false; return true; } }