/* * 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; import com.amazonaws.AmazonWebServiceRequest; /** *

* Associates a group with a continuous job. The following criteria must be met: *

* *

* Requires permission to access the AssociateTargetsWithJob action. *

*/ public class AssociateTargetsWithJobRequest extends AmazonWebServiceRequest implements Serializable { /** *

* A list of thing group ARNs that define the targets of the job. *

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

* The unique identifier you assigned to this job when it was created. *

*

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

* An optional comment string describing why the job was associated with the * targets. *

*

* Constraints:
* Length: - 2028
* Pattern: [^\p{C}]+
*/ private String comment; /** *

* The namespace used to indicate that a job is a customer-managed job. *

*

* When you specify a value for this parameter, Amazon Web Services IoT Core * sends jobs notifications to MQTT topics that contain the value in the * following format. *

*

* $aws/things/THING_NAME/jobs/JOB_ID/notify-namespace-NAMESPACE_ID/ *

* *

* The namespaceId feature is in public preview. *

*
*

* Constraints:
* Pattern: [a-zA-Z0-9_-]+
*/ private String namespaceId; /** *

* A list of thing group ARNs that define the targets of the job. *

* * @return

* A list of thing group ARNs that define the targets of the job. *

*/ public java.util.List getTargets() { return targets; } /** *

* A list of thing group ARNs that define the targets of the job. *

* * @param targets

* A list of thing group ARNs that define the targets of the job. *

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

* A list of thing group ARNs that define the targets of the job. *

*

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

* A list of thing group ARNs that define the targets of the job. *

* @return A reference to this updated object so that method calls can be * chained together. */ public AssociateTargetsWithJobRequest withTargets(String... targets) { if (getTargets() == null) { this.targets = new java.util.ArrayList(targets.length); } for (String value : targets) { this.targets.add(value); } return this; } /** *

* A list of thing group ARNs that define the targets of the job. *

*

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

* A list of thing group ARNs that define the targets of the job. *

* @return A reference to this updated object so that method calls can be * chained together. */ public AssociateTargetsWithJobRequest withTargets(java.util.Collection targets) { setTargets(targets); return this; } /** *

* The unique identifier you assigned to this job when it was created. *

*

* Constraints:
* Length: 1 - 64
* Pattern: [a-zA-Z0-9_-]+
* * @return

* The unique identifier you assigned to this job when it was * created. *

*/ public String getJobId() { return jobId; } /** *

* The unique identifier you assigned to this job when it was created. *

*

* Constraints:
* Length: 1 - 64
* Pattern: [a-zA-Z0-9_-]+
* * @param jobId

* The unique identifier you assigned to this job when it was * created. *

*/ public void setJobId(String jobId) { this.jobId = jobId; } /** *

* The unique identifier you assigned to this job when it was created. *

*

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

* Constraints:
* Length: 1 - 64
* Pattern: [a-zA-Z0-9_-]+
* * @param jobId

* The unique identifier you assigned to this job when it was * created. *

* @return A reference to this updated object so that method calls can be * chained together. */ public AssociateTargetsWithJobRequest withJobId(String jobId) { this.jobId = jobId; return this; } /** *

* An optional comment string describing why the job was associated with the * targets. *

*

* Constraints:
* Length: - 2028
* Pattern: [^\p{C}]+
* * @return

* An optional comment string describing why the job was associated * with the targets. *

*/ public String getComment() { return comment; } /** *

* An optional comment string describing why the job was associated with the * targets. *

*

* Constraints:
* Length: - 2028
* Pattern: [^\p{C}]+
* * @param comment

* An optional comment string describing why the job was * associated with the targets. *

*/ public void setComment(String comment) { this.comment = comment; } /** *

* An optional comment string describing why the job was associated with the * targets. *

*

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

* Constraints:
* Length: - 2028
* Pattern: [^\p{C}]+
* * @param comment

* An optional comment string describing why the job was * associated with the targets. *

* @return A reference to this updated object so that method calls can be * chained together. */ public AssociateTargetsWithJobRequest withComment(String comment) { this.comment = comment; return this; } /** *

* The namespace used to indicate that a job is a customer-managed job. *

*

* When you specify a value for this parameter, Amazon Web Services IoT Core * sends jobs notifications to MQTT topics that contain the value in the * following format. *

*

* $aws/things/THING_NAME/jobs/JOB_ID/notify-namespace-NAMESPACE_ID/ *

* *

* The namespaceId feature is in public preview. *

*
*

* Constraints:
* Pattern: [a-zA-Z0-9_-]+
* * @return

* The namespace used to indicate that a job is a customer-managed * job. *

*

* When you specify a value for this parameter, Amazon Web Services * IoT Core sends jobs notifications to MQTT topics that contain the * value in the following format. *

*

* $aws/things/THING_NAME/jobs/JOB_ID/notify-namespace-NAMESPACE_ID/ *

* *

* The namespaceId feature is in public preview. *

*
*/ public String getNamespaceId() { return namespaceId; } /** *

* The namespace used to indicate that a job is a customer-managed job. *

*

* When you specify a value for this parameter, Amazon Web Services IoT Core * sends jobs notifications to MQTT topics that contain the value in the * following format. *

*

* $aws/things/THING_NAME/jobs/JOB_ID/notify-namespace-NAMESPACE_ID/ *

* *

* The namespaceId feature is in public preview. *

*
*

* Constraints:
* Pattern: [a-zA-Z0-9_-]+
* * @param namespaceId

* The namespace used to indicate that a job is a * customer-managed job. *

*

* When you specify a value for this parameter, Amazon Web * Services IoT Core sends jobs notifications to MQTT topics that * contain the value in the following format. *

*

* $aws/things/THING_NAME/jobs/JOB_ID/notify-namespace-NAMESPACE_ID/ *

* *

* The namespaceId feature is in public preview. *

*
*/ public void setNamespaceId(String namespaceId) { this.namespaceId = namespaceId; } /** *

* The namespace used to indicate that a job is a customer-managed job. *

*

* When you specify a value for this parameter, Amazon Web Services IoT Core * sends jobs notifications to MQTT topics that contain the value in the * following format. *

*

* $aws/things/THING_NAME/jobs/JOB_ID/notify-namespace-NAMESPACE_ID/ *

* *

* The namespaceId feature is in public preview. *

*
*

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

* Constraints:
* Pattern: [a-zA-Z0-9_-]+
* * @param namespaceId

* The namespace used to indicate that a job is a * customer-managed job. *

*

* When you specify a value for this parameter, Amazon Web * Services IoT Core sends jobs notifications to MQTT topics that * contain the value in the following format. *

*

* $aws/things/THING_NAME/jobs/JOB_ID/notify-namespace-NAMESPACE_ID/ *

* *

* The namespaceId feature is in public preview. *

*
* @return A reference to this updated object so that method calls can be * chained together. */ public AssociateTargetsWithJobRequest withNamespaceId(String namespaceId) { this.namespaceId = namespaceId; 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 (getTargets() != null) sb.append("targets: " + getTargets() + ","); if (getJobId() != null) sb.append("jobId: " + getJobId() + ","); if (getComment() != null) sb.append("comment: " + getComment() + ","); if (getNamespaceId() != null) sb.append("namespaceId: " + getNamespaceId()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTargets() == null) ? 0 : getTargets().hashCode()); hashCode = prime * hashCode + ((getJobId() == null) ? 0 : getJobId().hashCode()); hashCode = prime * hashCode + ((getComment() == null) ? 0 : getComment().hashCode()); hashCode = prime * hashCode + ((getNamespaceId() == null) ? 0 : getNamespaceId().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AssociateTargetsWithJobRequest == false) return false; AssociateTargetsWithJobRequest other = (AssociateTargetsWithJobRequest) obj; if (other.getTargets() == null ^ this.getTargets() == null) return false; if (other.getTargets() != null && other.getTargets().equals(this.getTargets()) == false) return false; if (other.getJobId() == null ^ this.getJobId() == null) return false; if (other.getJobId() != null && other.getJobId().equals(this.getJobId()) == false) return false; if (other.getComment() == null ^ this.getComment() == null) return false; if (other.getComment() != null && other.getComment().equals(this.getComment()) == false) return false; if (other.getNamespaceId() == null ^ this.getNamespaceId() == null) return false; if (other.getNamespaceId() != null && other.getNamespaceId().equals(this.getNamespaceId()) == false) return false; return true; } }