/* * 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 AssociateTargetsWithJobRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *

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

*/ private String jobId; /** *

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

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

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

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setTargets(java.util.Collection)} or {@link #withTargets(java.util.Collection)} if you want to override * the existing values. *

* * @param targets * A list of thing group ARNs that define the targets of the job. * @return Returns a reference to this object so that method calls can be chained together. */ public AssociateTargetsWithJobRequest withTargets(String... targets) { if (this.targets == null) { setTargets(new java.util.ArrayList(targets.length)); } for (String ele : targets) { this.targets.add(ele); } return this; } /** *

* 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. * @return Returns a reference to this 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. *

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

* * @return The unique identifier you assigned to this job when it was created. */ public String getJobId() { return this.jobId; } /** *

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

* * @param jobId * The unique identifier you assigned to this job when it was created. * @return Returns a reference to this object so that method calls can be chained together. */ public AssociateTargetsWithJobRequest withJobId(String jobId) { setJobId(jobId); return this; } /** *

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

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

* * @return An optional comment string describing why the job was associated with the targets. */ public String getComment() { return this.comment; } /** *

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

* * @param comment * An optional comment string describing why the job was associated with the targets. * @return Returns a reference to this object so that method calls can be chained together. */ public AssociateTargetsWithJobRequest withComment(String comment) { setComment(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. *

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

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

*
* * @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 Returns a reference to this object so that method calls can be chained together. */ public AssociateTargetsWithJobRequest withNamespaceId(String namespaceId) { setNamespaceId(namespaceId); 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 (getTargets() != null) sb.append("Targets: ").append(getTargets()).append(","); if (getJobId() != null) sb.append("JobId: ").append(getJobId()).append(","); if (getComment() != null) sb.append("Comment: ").append(getComment()).append(","); if (getNamespaceId() != null) sb.append("NamespaceId: ").append(getNamespaceId()); sb.append("}"); return sb.toString(); } @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; } @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 AssociateTargetsWithJobRequest clone() { return (AssociateTargetsWithJobRequest) super.clone(); } }