/* * 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.AmazonWebServiceRequest; @Generated("com.amazonaws:aws-java-sdk-code-generator") public class StartDetectMitigationActionsTaskRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *
* The unique identifier of the task. *
*/ private String taskId; /** ** Specifies the ML Detect findings to which the mitigation actions are applied. *
*/ private DetectMitigationActionsTaskTarget target; /** ** The actions to be performed when a device has unexpected behavior. *
*/ private java.util.List* Specifies the time period of which violation events occurred between. *
*/ private ViolationEventOccurrenceRange violationEventOccurrenceRange; /** ** Specifies to list only active violations. *
*/ private Boolean includeOnlyActiveViolations; /** ** Specifies to include suppressed alerts. *
*/ private Boolean includeSuppressedAlerts; /** ** Each mitigation action task must have a unique client request token. If you try to create a new task with the * same token as a task that already exists, an exception occurs. If you omit this value, Amazon Web Services SDKs * will automatically generate a unique client request. *
*/ private String clientRequestToken; /** ** The unique identifier of the task. *
* * @param taskId * The unique identifier of the task. */ public void setTaskId(String taskId) { this.taskId = taskId; } /** ** The unique identifier of the task. *
* * @return The unique identifier of the task. */ public String getTaskId() { return this.taskId; } /** ** The unique identifier of the task. *
* * @param taskId * The unique identifier of the task. * @return Returns a reference to this object so that method calls can be chained together. */ public StartDetectMitigationActionsTaskRequest withTaskId(String taskId) { setTaskId(taskId); return this; } /** ** 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. *
* * @return Specifies the ML Detect findings to which the mitigation actions are applied. */ public DetectMitigationActionsTaskTarget getTarget() { return this.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. * @return Returns a reference to this object so that method calls can be chained together. */ public StartDetectMitigationActionsTaskRequest withTarget(DetectMitigationActionsTaskTarget target) { setTarget(target); return this; } /** ** The actions to be performed when a device has unexpected behavior. *
* * @return The actions to be performed when a device has unexpected behavior. */ public java.util.List* The actions to be performed when a device has unexpected behavior. *
* * @param actions * The actions to be performed when a device has unexpected behavior. */ public void setActions(java.util.Collection* The actions to be performed when a device has unexpected behavior. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setActions(java.util.Collection)} or {@link #withActions(java.util.Collection)} if you want to override * the existing values. *
* * @param actions * The actions to be performed when a device has unexpected behavior. * @return Returns a reference to this object so that method calls can be chained together. */ public StartDetectMitigationActionsTaskRequest withActions(String... actions) { if (this.actions == null) { setActions(new java.util.ArrayList* The actions to be performed when a device has unexpected behavior. *
* * @param actions * The actions to be performed when a device has unexpected behavior. * @return Returns a reference to this object so that method calls can be chained together. */ public StartDetectMitigationActionsTaskRequest withActions(java.util.Collection* 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. *
* * @return Specifies the time period of which violation events occurred between. */ public ViolationEventOccurrenceRange getViolationEventOccurrenceRange() { return this.violationEventOccurrenceRange; } /** ** Specifies the time period of which violation events occurred between. *
* * @param violationEventOccurrenceRange * Specifies the time period of which violation events occurred between. * @return Returns a reference to this object so that method calls can be chained together. */ public StartDetectMitigationActionsTaskRequest withViolationEventOccurrenceRange(ViolationEventOccurrenceRange violationEventOccurrenceRange) { setViolationEventOccurrenceRange(violationEventOccurrenceRange); return this; } /** ** Specifies to list only active violations. *
* * @param includeOnlyActiveViolations * Specifies to list only active violations. */ public void setIncludeOnlyActiveViolations(Boolean includeOnlyActiveViolations) { this.includeOnlyActiveViolations = includeOnlyActiveViolations; } /** ** Specifies to list only active violations. *
* * @return Specifies to list only active violations. */ public Boolean getIncludeOnlyActiveViolations() { return this.includeOnlyActiveViolations; } /** ** Specifies to list only active violations. *
* * @param includeOnlyActiveViolations * Specifies to list only active violations. * @return Returns a reference to this object so that method calls can be chained together. */ public StartDetectMitigationActionsTaskRequest withIncludeOnlyActiveViolations(Boolean includeOnlyActiveViolations) { setIncludeOnlyActiveViolations(includeOnlyActiveViolations); return this; } /** ** Specifies to list only active violations. *
* * @return Specifies to list only active violations. */ public Boolean isIncludeOnlyActiveViolations() { return this.includeOnlyActiveViolations; } /** ** Specifies to include suppressed alerts. *
* * @param includeSuppressedAlerts * Specifies to include suppressed alerts. */ public void setIncludeSuppressedAlerts(Boolean includeSuppressedAlerts) { this.includeSuppressedAlerts = includeSuppressedAlerts; } /** ** Specifies to include suppressed alerts. *
* * @return Specifies to include suppressed alerts. */ public Boolean getIncludeSuppressedAlerts() { return this.includeSuppressedAlerts; } /** ** Specifies to include suppressed alerts. *
* * @param includeSuppressedAlerts * Specifies to include suppressed alerts. * @return Returns a reference to this object so that method calls can be chained together. */ public StartDetectMitigationActionsTaskRequest withIncludeSuppressedAlerts(Boolean includeSuppressedAlerts) { setIncludeSuppressedAlerts(includeSuppressedAlerts); return this; } /** ** Specifies to include suppressed alerts. *
* * @return Specifies to include suppressed alerts. */ public Boolean isIncludeSuppressedAlerts() { return this.includeSuppressedAlerts; } /** ** Each mitigation action task must have a unique client request token. If you try to create a new task with the * same token as a task that already exists, an exception occurs. If you omit this value, Amazon Web Services SDKs * will automatically generate a unique client request. *
* * @param clientRequestToken * Each mitigation action task must have a unique client request token. If you try to create a new task with * the same token as a task that already exists, an exception occurs. If you omit this value, Amazon Web * Services SDKs will automatically generate a unique client request. */ public void setClientRequestToken(String clientRequestToken) { this.clientRequestToken = clientRequestToken; } /** ** Each mitigation action task must have a unique client request token. If you try to create a new task with the * same token as a task that already exists, an exception occurs. If you omit this value, Amazon Web Services SDKs * will automatically generate a unique client request. *
* * @return Each mitigation action task must have a unique client request token. If you try to create a new task with * the same token as a task that already exists, an exception occurs. If you omit this value, Amazon Web * Services SDKs will automatically generate a unique client request. */ public String getClientRequestToken() { return this.clientRequestToken; } /** ** Each mitigation action task must have a unique client request token. If you try to create a new task with the * same token as a task that already exists, an exception occurs. If you omit this value, Amazon Web Services SDKs * will automatically generate a unique client request. *
* * @param clientRequestToken * Each mitigation action task must have a unique client request token. If you try to create a new task with * the same token as a task that already exists, an exception occurs. If you omit this value, Amazon Web * Services SDKs will automatically generate a unique client request. * @return Returns a reference to this object so that method calls can be chained together. */ public StartDetectMitigationActionsTaskRequest withClientRequestToken(String clientRequestToken) { setClientRequestToken(clientRequestToken); 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 (getTarget() != null) sb.append("Target: ").append(getTarget()).append(","); if (getActions() != null) sb.append("Actions: ").append(getActions()).append(","); if (getViolationEventOccurrenceRange() != null) sb.append("ViolationEventOccurrenceRange: ").append(getViolationEventOccurrenceRange()).append(","); if (getIncludeOnlyActiveViolations() != null) sb.append("IncludeOnlyActiveViolations: ").append(getIncludeOnlyActiveViolations()).append(","); if (getIncludeSuppressedAlerts() != null) sb.append("IncludeSuppressedAlerts: ").append(getIncludeSuppressedAlerts()).append(","); if (getClientRequestToken() != null) sb.append("ClientRequestToken: ").append(getClientRequestToken()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof StartDetectMitigationActionsTaskRequest == false) return false; StartDetectMitigationActionsTaskRequest other = (StartDetectMitigationActionsTaskRequest) obj; if (other.getTaskId() == null ^ this.getTaskId() == null) return false; if (other.getTaskId() != null && other.getTaskId().equals(this.getTaskId()) == 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.getActions() == null ^ this.getActions() == null) return false; if (other.getActions() != null && other.getActions().equals(this.getActions()) == 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.getIncludeOnlyActiveViolations() == null ^ this.getIncludeOnlyActiveViolations() == null) return false; if (other.getIncludeOnlyActiveViolations() != null && other.getIncludeOnlyActiveViolations().equals(this.getIncludeOnlyActiveViolations()) == false) return false; if (other.getIncludeSuppressedAlerts() == null ^ this.getIncludeSuppressedAlerts() == null) return false; if (other.getIncludeSuppressedAlerts() != null && other.getIncludeSuppressedAlerts().equals(this.getIncludeSuppressedAlerts()) == false) return false; if (other.getClientRequestToken() == null ^ this.getClientRequestToken() == null) return false; if (other.getClientRequestToken() != null && other.getClientRequestToken().equals(this.getClientRequestToken()) == 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 + ((getTarget() == null) ? 0 : getTarget().hashCode()); hashCode = prime * hashCode + ((getActions() == null) ? 0 : getActions().hashCode()); hashCode = prime * hashCode + ((getViolationEventOccurrenceRange() == null) ? 0 : getViolationEventOccurrenceRange().hashCode()); hashCode = prime * hashCode + ((getIncludeOnlyActiveViolations() == null) ? 0 : getIncludeOnlyActiveViolations().hashCode()); hashCode = prime * hashCode + ((getIncludeSuppressedAlerts() == null) ? 0 : getIncludeSuppressedAlerts().hashCode()); hashCode = prime * hashCode + ((getClientRequestToken() == null) ? 0 : getClientRequestToken().hashCode()); return hashCode; } @Override public StartDetectMitigationActionsTaskRequest clone() { return (StartDetectMitigationActionsTaskRequest) super.clone(); } }