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

* Creates a job. *

*

* Requires permission to access the CreateJob action. *

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

* A job identifier which must be unique for your Amazon Web Services * account. We recommend using a UUID. Alpha-numeric characters, "-" and "_" * are valid for use here. *

*

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

* A list of things and thing groups to which the job should be sent. *

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

* An S3 link, or S3 object URL, to the job document. The link is an Amazon * S3 object URL and is required if you don't specify a value for * document. *

*

* For example, * --document-source https://s3.region-code.amazonaws.com/example-firmware/device-firmware.1.0 *

*

* For more information, see Methods for accessing a bucket. *

*

* Constraints:
* Length: 1 - 1350
*/ private String documentSource; /** *

* The job document. Required if you don't specify a value for * documentSource. *

*

* Constraints:
* Length: - 32768
*/ private String document; /** *

* A short text description of the job. *

*

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

* Configuration information for pre-signed S3 URLs. *

*/ private PresignedUrlConfig presignedUrlConfig; /** *

* Specifies whether the job will continue to run (CONTINUOUS), or will be * complete after all those things specified as targets have completed the * job (SNAPSHOT). If continuous, the job may also be run on a thing when a * change is detected in a target. For example, a job will run on a thing * when the thing is added to a target group, even after the job was * completed by all things originally in the group. *

* *

* We recommend that you use continuous jobs instead of snapshot jobs for * dynamic thing group targets. By using continuous jobs, devices that join * the group receive the job execution even after the job has been created. *

*
*

* Constraints:
* Allowed Values: CONTINUOUS, SNAPSHOT */ private String targetSelection; /** *

* Allows you to create a staged rollout of the job. *

*/ private JobExecutionsRolloutConfig jobExecutionsRolloutConfig; /** *

* Allows you to create the criteria to abort a job. *

*/ private AbortConfig abortConfig; /** *

* Specifies the amount of time each device has to finish its execution of * the job. The timer is started when the job execution status is set to * IN_PROGRESS. If the job execution status is not set to * another terminal state before the time expires, it will be automatically * set to TIMED_OUT. *

*/ private TimeoutConfig timeoutConfig; /** *

* Metadata which can be used to manage the job. *

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

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

* The ARN of the job template used to create the job. *

*

* Constraints:
* Length: 1 - 1600
* Pattern: ^arn:[!-~]+$
*/ private String jobTemplateArn; /** *

* Allows you to create the criteria to retry a job. *

*/ private JobExecutionsRetryConfig jobExecutionsRetryConfig; /** *

* Parameters of an Amazon Web Services managed template that you can * specify to create the job document. *

* *

* documentParameters can only be used when creating jobs from * Amazon Web Services managed templates. This parameter can't be used with * custom job templates or to create jobs from them. *

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

* The configuration that allows you to schedule a job for a future date and * time in addition to specifying the end behavior for each job execution. *

*/ private SchedulingConfig schedulingConfig; /** *

* The package version Amazon Resource Names (ARNs) that are installed on * the device when the job successfully completes. *

*

* Note:The following Length Constraints relates to a single string. * Up to five strings are allowed. *

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

* A job identifier which must be unique for your Amazon Web Services * account. We recommend using a UUID. Alpha-numeric characters, "-" and "_" * are valid for use here. *

*

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

* A job identifier which must be unique for your Amazon Web * Services account. We recommend using a UUID. Alpha-numeric * characters, "-" and "_" are valid for use here. *

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

* A job identifier which must be unique for your Amazon Web Services * account. We recommend using a UUID. Alpha-numeric characters, "-" and "_" * are valid for use here. *

*

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

* A job identifier which must be unique for your Amazon Web * Services account. We recommend using a UUID. Alpha-numeric * characters, "-" and "_" are valid for use here. *

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

* A job identifier which must be unique for your Amazon Web Services * account. We recommend using a UUID. Alpha-numeric characters, "-" and "_" * are valid for use here. *

*

* 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

* A job identifier which must be unique for your Amazon Web * Services account. We recommend using a UUID. Alpha-numeric * characters, "-" and "_" are valid for use here. *

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

* A list of things and thing groups to which the job should be sent. *

* * @return

* A list of things and thing groups to which the job should be * sent. *

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

* A list of things and thing groups to which the job should be sent. *

* * @param targets

* A list of things and thing groups to which the job should be * sent. *

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

* A list of things and thing groups to which the job should be sent. *

*

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

* A list of things and thing groups to which the job should be * sent. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateJobRequest 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 things and thing groups to which the job should be sent. *

*

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

* A list of things and thing groups to which the job should be * sent. *

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

* An S3 link, or S3 object URL, to the job document. The link is an Amazon * S3 object URL and is required if you don't specify a value for * document. *

*

* For example, * --document-source https://s3.region-code.amazonaws.com/example-firmware/device-firmware.1.0 *

*

* For more information, see Methods for accessing a bucket. *

*

* Constraints:
* Length: 1 - 1350
* * @return

* An S3 link, or S3 object URL, to the job document. The link is an * Amazon S3 object URL and is required if you don't specify a value * for document. *

*

* For example, * --document-source https://s3.region-code.amazonaws.com/example-firmware/device-firmware.1.0 *

*

* For more information, see Methods for accessing a bucket. *

*/ public String getDocumentSource() { return documentSource; } /** *

* An S3 link, or S3 object URL, to the job document. The link is an Amazon * S3 object URL and is required if you don't specify a value for * document. *

*

* For example, * --document-source https://s3.region-code.amazonaws.com/example-firmware/device-firmware.1.0 *

*

* For more information, see Methods for accessing a bucket. *

*

* Constraints:
* Length: 1 - 1350
* * @param documentSource

* An S3 link, or S3 object URL, to the job document. The link is * an Amazon S3 object URL and is required if you don't specify a * value for document. *

*

* For example, * --document-source https://s3.region-code.amazonaws.com/example-firmware/device-firmware.1.0 *

*

* For more information, see Methods for accessing a bucket. *

*/ public void setDocumentSource(String documentSource) { this.documentSource = documentSource; } /** *

* An S3 link, or S3 object URL, to the job document. The link is an Amazon * S3 object URL and is required if you don't specify a value for * document. *

*

* For example, * --document-source https://s3.region-code.amazonaws.com/example-firmware/device-firmware.1.0 *

*

* For more information, see Methods for accessing a bucket. *

*

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

* Constraints:
* Length: 1 - 1350
* * @param documentSource

* An S3 link, or S3 object URL, to the job document. The link is * an Amazon S3 object URL and is required if you don't specify a * value for document. *

*

* For example, * --document-source https://s3.region-code.amazonaws.com/example-firmware/device-firmware.1.0 *

*

* For more information, see Methods for accessing a bucket. *

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

* The job document. Required if you don't specify a value for * documentSource. *

*

* Constraints:
* Length: - 32768
* * @return

* The job document. Required if you don't specify a value for * documentSource. *

*/ public String getDocument() { return document; } /** *

* The job document. Required if you don't specify a value for * documentSource. *

*

* Constraints:
* Length: - 32768
* * @param document

* The job document. Required if you don't specify a value for * documentSource. *

*/ public void setDocument(String document) { this.document = document; } /** *

* The job document. Required if you don't specify a value for * documentSource. *

*

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

* Constraints:
* Length: - 32768
* * @param document

* The job document. Required if you don't specify a value for * documentSource. *

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

* A short text description of the job. *

*

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

* A short text description of the job. *

*/ public String getDescription() { return description; } /** *

* A short text description of the job. *

*

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

* A short text description of the job. *

*/ public void setDescription(String description) { this.description = description; } /** *

* A short text description of the job. *

*

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

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

* A short text description of the job. *

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

* Configuration information for pre-signed S3 URLs. *

* * @return

* Configuration information for pre-signed S3 URLs. *

*/ public PresignedUrlConfig getPresignedUrlConfig() { return presignedUrlConfig; } /** *

* Configuration information for pre-signed S3 URLs. *

* * @param presignedUrlConfig

* Configuration information for pre-signed S3 URLs. *

*/ public void setPresignedUrlConfig(PresignedUrlConfig presignedUrlConfig) { this.presignedUrlConfig = presignedUrlConfig; } /** *

* Configuration information for pre-signed S3 URLs. *

*

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

* Configuration information for pre-signed S3 URLs. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateJobRequest withPresignedUrlConfig(PresignedUrlConfig presignedUrlConfig) { this.presignedUrlConfig = presignedUrlConfig; return this; } /** *

* Specifies whether the job will continue to run (CONTINUOUS), or will be * complete after all those things specified as targets have completed the * job (SNAPSHOT). If continuous, the job may also be run on a thing when a * change is detected in a target. For example, a job will run on a thing * when the thing is added to a target group, even after the job was * completed by all things originally in the group. *

* *

* We recommend that you use continuous jobs instead of snapshot jobs for * dynamic thing group targets. By using continuous jobs, devices that join * the group receive the job execution even after the job has been created. *

*
*

* Constraints:
* Allowed Values: CONTINUOUS, SNAPSHOT * * @return

* Specifies whether the job will continue to run (CONTINUOUS), or * will be complete after all those things specified as targets have * completed the job (SNAPSHOT). If continuous, the job may also be * run on a thing when a change is detected in a target. For * example, a job will run on a thing when the thing is added to a * target group, even after the job was completed by all things * originally in the group. *

* *

* We recommend that you use continuous jobs instead of snapshot * jobs for dynamic thing group targets. By using continuous jobs, * devices that join the group receive the job execution even after * the job has been created. *

*
* @see TargetSelection */ public String getTargetSelection() { return targetSelection; } /** *

* Specifies whether the job will continue to run (CONTINUOUS), or will be * complete after all those things specified as targets have completed the * job (SNAPSHOT). If continuous, the job may also be run on a thing when a * change is detected in a target. For example, a job will run on a thing * when the thing is added to a target group, even after the job was * completed by all things originally in the group. *

* *

* We recommend that you use continuous jobs instead of snapshot jobs for * dynamic thing group targets. By using continuous jobs, devices that join * the group receive the job execution even after the job has been created. *

*
*

* Constraints:
* Allowed Values: CONTINUOUS, SNAPSHOT * * @param targetSelection

* Specifies whether the job will continue to run (CONTINUOUS), * or will be complete after all those things specified as * targets have completed the job (SNAPSHOT). If continuous, the * job may also be run on a thing when a change is detected in a * target. For example, a job will run on a thing when the thing * is added to a target group, even after the job was completed * by all things originally in the group. *

* *

* We recommend that you use continuous jobs instead of snapshot * jobs for dynamic thing group targets. By using continuous * jobs, devices that join the group receive the job execution * even after the job has been created. *

*
* @see TargetSelection */ public void setTargetSelection(String targetSelection) { this.targetSelection = targetSelection; } /** *

* Specifies whether the job will continue to run (CONTINUOUS), or will be * complete after all those things specified as targets have completed the * job (SNAPSHOT). If continuous, the job may also be run on a thing when a * change is detected in a target. For example, a job will run on a thing * when the thing is added to a target group, even after the job was * completed by all things originally in the group. *

* *

* We recommend that you use continuous jobs instead of snapshot jobs for * dynamic thing group targets. By using continuous jobs, devices that join * the group receive the job execution even after the job has been created. *

*
*

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

* Constraints:
* Allowed Values: CONTINUOUS, SNAPSHOT * * @param targetSelection

* Specifies whether the job will continue to run (CONTINUOUS), * or will be complete after all those things specified as * targets have completed the job (SNAPSHOT). If continuous, the * job may also be run on a thing when a change is detected in a * target. For example, a job will run on a thing when the thing * is added to a target group, even after the job was completed * by all things originally in the group. *

* *

* We recommend that you use continuous jobs instead of snapshot * jobs for dynamic thing group targets. By using continuous * jobs, devices that join the group receive the job execution * even after the job has been created. *

*
* @return A reference to this updated object so that method calls can be * chained together. * @see TargetSelection */ public CreateJobRequest withTargetSelection(String targetSelection) { this.targetSelection = targetSelection; return this; } /** *

* Specifies whether the job will continue to run (CONTINUOUS), or will be * complete after all those things specified as targets have completed the * job (SNAPSHOT). If continuous, the job may also be run on a thing when a * change is detected in a target. For example, a job will run on a thing * when the thing is added to a target group, even after the job was * completed by all things originally in the group. *

* *

* We recommend that you use continuous jobs instead of snapshot jobs for * dynamic thing group targets. By using continuous jobs, devices that join * the group receive the job execution even after the job has been created. *

*
*

* Constraints:
* Allowed Values: CONTINUOUS, SNAPSHOT * * @param targetSelection

* Specifies whether the job will continue to run (CONTINUOUS), * or will be complete after all those things specified as * targets have completed the job (SNAPSHOT). If continuous, the * job may also be run on a thing when a change is detected in a * target. For example, a job will run on a thing when the thing * is added to a target group, even after the job was completed * by all things originally in the group. *

* *

* We recommend that you use continuous jobs instead of snapshot * jobs for dynamic thing group targets. By using continuous * jobs, devices that join the group receive the job execution * even after the job has been created. *

*
* @see TargetSelection */ public void setTargetSelection(TargetSelection targetSelection) { this.targetSelection = targetSelection.toString(); } /** *

* Specifies whether the job will continue to run (CONTINUOUS), or will be * complete after all those things specified as targets have completed the * job (SNAPSHOT). If continuous, the job may also be run on a thing when a * change is detected in a target. For example, a job will run on a thing * when the thing is added to a target group, even after the job was * completed by all things originally in the group. *

* *

* We recommend that you use continuous jobs instead of snapshot jobs for * dynamic thing group targets. By using continuous jobs, devices that join * the group receive the job execution even after the job has been created. *

*
*

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

* Constraints:
* Allowed Values: CONTINUOUS, SNAPSHOT * * @param targetSelection

* Specifies whether the job will continue to run (CONTINUOUS), * or will be complete after all those things specified as * targets have completed the job (SNAPSHOT). If continuous, the * job may also be run on a thing when a change is detected in a * target. For example, a job will run on a thing when the thing * is added to a target group, even after the job was completed * by all things originally in the group. *

* *

* We recommend that you use continuous jobs instead of snapshot * jobs for dynamic thing group targets. By using continuous * jobs, devices that join the group receive the job execution * even after the job has been created. *

*
* @return A reference to this updated object so that method calls can be * chained together. * @see TargetSelection */ public CreateJobRequest withTargetSelection(TargetSelection targetSelection) { this.targetSelection = targetSelection.toString(); return this; } /** *

* Allows you to create a staged rollout of the job. *

* * @return

* Allows you to create a staged rollout of the job. *

*/ public JobExecutionsRolloutConfig getJobExecutionsRolloutConfig() { return jobExecutionsRolloutConfig; } /** *

* Allows you to create a staged rollout of the job. *

* * @param jobExecutionsRolloutConfig

* Allows you to create a staged rollout of the job. *

*/ public void setJobExecutionsRolloutConfig(JobExecutionsRolloutConfig jobExecutionsRolloutConfig) { this.jobExecutionsRolloutConfig = jobExecutionsRolloutConfig; } /** *

* Allows you to create a staged rollout of the job. *

*

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

* Allows you to create a staged rollout of the job. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateJobRequest withJobExecutionsRolloutConfig( JobExecutionsRolloutConfig jobExecutionsRolloutConfig) { this.jobExecutionsRolloutConfig = jobExecutionsRolloutConfig; return this; } /** *

* Allows you to create the criteria to abort a job. *

* * @return

* Allows you to create the criteria to abort a job. *

*/ public AbortConfig getAbortConfig() { return abortConfig; } /** *

* Allows you to create the criteria to abort a job. *

* * @param abortConfig

* Allows you to create the criteria to abort a job. *

*/ public void setAbortConfig(AbortConfig abortConfig) { this.abortConfig = abortConfig; } /** *

* Allows you to create the criteria to abort a job. *

*

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

* Allows you to create the criteria to abort a job. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateJobRequest withAbortConfig(AbortConfig abortConfig) { this.abortConfig = abortConfig; return this; } /** *

* Specifies the amount of time each device has to finish its execution of * the job. The timer is started when the job execution status is set to * IN_PROGRESS. If the job execution status is not set to * another terminal state before the time expires, it will be automatically * set to TIMED_OUT. *

* * @return

* Specifies the amount of time each device has to finish its * execution of the job. The timer is started when the job execution * status is set to IN_PROGRESS. If the job execution * status is not set to another terminal state before the time * expires, it will be automatically set to TIMED_OUT. *

*/ public TimeoutConfig getTimeoutConfig() { return timeoutConfig; } /** *

* Specifies the amount of time each device has to finish its execution of * the job. The timer is started when the job execution status is set to * IN_PROGRESS. If the job execution status is not set to * another terminal state before the time expires, it will be automatically * set to TIMED_OUT. *

* * @param timeoutConfig

* Specifies the amount of time each device has to finish its * execution of the job. The timer is started when the job * execution status is set to IN_PROGRESS. If the * job execution status is not set to another terminal state * before the time expires, it will be automatically set to * TIMED_OUT. *

*/ public void setTimeoutConfig(TimeoutConfig timeoutConfig) { this.timeoutConfig = timeoutConfig; } /** *

* Specifies the amount of time each device has to finish its execution of * the job. The timer is started when the job execution status is set to * IN_PROGRESS. If the job execution status is not set to * another terminal state before the time expires, it will be automatically * set to TIMED_OUT. *

*

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

* Specifies the amount of time each device has to finish its * execution of the job. The timer is started when the job * execution status is set to IN_PROGRESS. If the * job execution status is not set to another terminal state * before the time expires, it will be automatically set to * TIMED_OUT. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateJobRequest withTimeoutConfig(TimeoutConfig timeoutConfig) { this.timeoutConfig = timeoutConfig; return this; } /** *

* Metadata which can be used to manage the job. *

* * @return

* Metadata which can be used to manage the job. *

*/ public java.util.List getTags() { return tags; } /** *

* Metadata which can be used to manage the job. *

* * @param tags

* Metadata which can be used to manage the job. *

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

* Metadata which can be used to manage the job. *

*

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

* Metadata which can be used to manage the job. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateJobRequest withTags(Tag... tags) { if (getTags() == null) { this.tags = new java.util.ArrayList(tags.length); } for (Tag value : tags) { this.tags.add(value); } return this; } /** *

* Metadata which can be used to manage the job. *

*

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

* Metadata which can be used to manage the job. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateJobRequest withTags(java.util.Collection tags) { setTags(tags); 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 CreateJobRequest withNamespaceId(String namespaceId) { this.namespaceId = namespaceId; return this; } /** *

* The ARN of the job template used to create the job. *

*

* Constraints:
* Length: 1 - 1600
* Pattern: ^arn:[!-~]+$
* * @return

* The ARN of the job template used to create the job. *

*/ public String getJobTemplateArn() { return jobTemplateArn; } /** *

* The ARN of the job template used to create the job. *

*

* Constraints:
* Length: 1 - 1600
* Pattern: ^arn:[!-~]+$
* * @param jobTemplateArn

* The ARN of the job template used to create the job. *

*/ public void setJobTemplateArn(String jobTemplateArn) { this.jobTemplateArn = jobTemplateArn; } /** *

* The ARN of the job template used to create the job. *

*

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

* Constraints:
* Length: 1 - 1600
* Pattern: ^arn:[!-~]+$
* * @param jobTemplateArn

* The ARN of the job template used to create the job. *

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

* Allows you to create the criteria to retry a job. *

* * @return

* Allows you to create the criteria to retry a job. *

*/ public JobExecutionsRetryConfig getJobExecutionsRetryConfig() { return jobExecutionsRetryConfig; } /** *

* Allows you to create the criteria to retry a job. *

* * @param jobExecutionsRetryConfig

* Allows you to create the criteria to retry a job. *

*/ public void setJobExecutionsRetryConfig(JobExecutionsRetryConfig jobExecutionsRetryConfig) { this.jobExecutionsRetryConfig = jobExecutionsRetryConfig; } /** *

* Allows you to create the criteria to retry a job. *

*

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

* Allows you to create the criteria to retry a job. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateJobRequest withJobExecutionsRetryConfig( JobExecutionsRetryConfig jobExecutionsRetryConfig) { this.jobExecutionsRetryConfig = jobExecutionsRetryConfig; return this; } /** *

* Parameters of an Amazon Web Services managed template that you can * specify to create the job document. *

* *

* documentParameters can only be used when creating jobs from * Amazon Web Services managed templates. This parameter can't be used with * custom job templates or to create jobs from them. *

*
* * @return

* Parameters of an Amazon Web Services managed template that you * can specify to create the job document. *

* *

* documentParameters can only be used when creating * jobs from Amazon Web Services managed templates. This parameter * can't be used with custom job templates or to create jobs from * them. *

*
*/ public java.util.Map getDocumentParameters() { return documentParameters; } /** *

* Parameters of an Amazon Web Services managed template that you can * specify to create the job document. *

* *

* documentParameters can only be used when creating jobs from * Amazon Web Services managed templates. This parameter can't be used with * custom job templates or to create jobs from them. *

*
* * @param documentParameters

* Parameters of an Amazon Web Services managed template that you * can specify to create the job document. *

* *

* documentParameters can only be used when creating * jobs from Amazon Web Services managed templates. This * parameter can't be used with custom job templates or to create * jobs from them. *

*
*/ public void setDocumentParameters(java.util.Map documentParameters) { this.documentParameters = documentParameters; } /** *

* Parameters of an Amazon Web Services managed template that you can * specify to create the job document. *

* *

* documentParameters can only be used when creating jobs from * Amazon Web Services managed templates. This parameter can't be used with * custom job templates or to create jobs from them. *

*
*

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

* Parameters of an Amazon Web Services managed template that you * can specify to create the job document. *

* *

* documentParameters can only be used when creating * jobs from Amazon Web Services managed templates. This * parameter can't be used with custom job templates or to create * jobs from them. *

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

* Parameters of an Amazon Web Services managed template that you can * specify to create the job document. *

* *

* documentParameters can only be used when creating jobs from * Amazon Web Services managed templates. This parameter can't be used with * custom job templates or to create jobs from them. *

*
*

* The method adds a new key-value pair into documentParameters 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 documentParameters. * @param value The corresponding value of the entry to be added into * documentParameters. * @return A reference to this updated object so that method calls can be * chained together. */ public CreateJobRequest adddocumentParametersEntry(String key, String value) { if (null == this.documentParameters) { this.documentParameters = new java.util.HashMap(); } if (this.documentParameters.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.documentParameters.put(key, value); return this; } /** * Removes all the entries added into documentParameters. *

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

* The configuration that allows you to schedule a job for a future date and * time in addition to specifying the end behavior for each job execution. *

* * @return

* The configuration that allows you to schedule a job for a future * date and time in addition to specifying the end behavior for each * job execution. *

*/ public SchedulingConfig getSchedulingConfig() { return schedulingConfig; } /** *

* The configuration that allows you to schedule a job for a future date and * time in addition to specifying the end behavior for each job execution. *

* * @param schedulingConfig

* The configuration that allows you to schedule a job for a * future date and time in addition to specifying the end * behavior for each job execution. *

*/ public void setSchedulingConfig(SchedulingConfig schedulingConfig) { this.schedulingConfig = schedulingConfig; } /** *

* The configuration that allows you to schedule a job for a future date and * time in addition to specifying the end behavior for each job execution. *

*

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

* The configuration that allows you to schedule a job for a * future date and time in addition to specifying the end * behavior for each job execution. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateJobRequest withSchedulingConfig(SchedulingConfig schedulingConfig) { this.schedulingConfig = schedulingConfig; return this; } /** *

* The package version Amazon Resource Names (ARNs) that are installed on * the device when the job successfully completes. *

*

* Note:The following Length Constraints relates to a single string. * Up to five strings are allowed. *

* * @return

* The package version Amazon Resource Names (ARNs) that are * installed on the device when the job successfully completes. *

*

* Note:The following Length Constraints relates to a single * string. Up to five strings are allowed. *

*/ public java.util.List getDestinationPackageVersions() { return destinationPackageVersions; } /** *

* The package version Amazon Resource Names (ARNs) that are installed on * the device when the job successfully completes. *

*

* Note:The following Length Constraints relates to a single string. * Up to five strings are allowed. *

* * @param destinationPackageVersions

* The package version Amazon Resource Names (ARNs) that are * installed on the device when the job successfully completes. *

*

* Note:The following Length Constraints relates to a * single string. Up to five strings are allowed. *

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

* The package version Amazon Resource Names (ARNs) that are installed on * the device when the job successfully completes. *

*

* Note:The following Length Constraints relates to a single string. * Up to five strings are allowed. *

*

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

* The package version Amazon Resource Names (ARNs) that are * installed on the device when the job successfully completes. *

*

* Note:The following Length Constraints relates to a * single string. Up to five strings are allowed. *

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

* The package version Amazon Resource Names (ARNs) that are installed on * the device when the job successfully completes. *

*

* Note:The following Length Constraints relates to a single string. * Up to five strings are allowed. *

*

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

* The package version Amazon Resource Names (ARNs) that are * installed on the device when the job successfully completes. *

*

* Note:The following Length Constraints relates to a * single string. Up to five strings are allowed. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateJobRequest withDestinationPackageVersions( java.util.Collection destinationPackageVersions) { setDestinationPackageVersions(destinationPackageVersions); 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 (getJobId() != null) sb.append("jobId: " + getJobId() + ","); if (getTargets() != null) sb.append("targets: " + getTargets() + ","); if (getDocumentSource() != null) sb.append("documentSource: " + getDocumentSource() + ","); if (getDocument() != null) sb.append("document: " + getDocument() + ","); if (getDescription() != null) sb.append("description: " + getDescription() + ","); if (getPresignedUrlConfig() != null) sb.append("presignedUrlConfig: " + getPresignedUrlConfig() + ","); if (getTargetSelection() != null) sb.append("targetSelection: " + getTargetSelection() + ","); if (getJobExecutionsRolloutConfig() != null) sb.append("jobExecutionsRolloutConfig: " + getJobExecutionsRolloutConfig() + ","); if (getAbortConfig() != null) sb.append("abortConfig: " + getAbortConfig() + ","); if (getTimeoutConfig() != null) sb.append("timeoutConfig: " + getTimeoutConfig() + ","); if (getTags() != null) sb.append("tags: " + getTags() + ","); if (getNamespaceId() != null) sb.append("namespaceId: " + getNamespaceId() + ","); if (getJobTemplateArn() != null) sb.append("jobTemplateArn: " + getJobTemplateArn() + ","); if (getJobExecutionsRetryConfig() != null) sb.append("jobExecutionsRetryConfig: " + getJobExecutionsRetryConfig() + ","); if (getDocumentParameters() != null) sb.append("documentParameters: " + getDocumentParameters() + ","); if (getSchedulingConfig() != null) sb.append("schedulingConfig: " + getSchedulingConfig() + ","); if (getDestinationPackageVersions() != null) sb.append("destinationPackageVersions: " + getDestinationPackageVersions()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getJobId() == null) ? 0 : getJobId().hashCode()); hashCode = prime * hashCode + ((getTargets() == null) ? 0 : getTargets().hashCode()); hashCode = prime * hashCode + ((getDocumentSource() == null) ? 0 : getDocumentSource().hashCode()); hashCode = prime * hashCode + ((getDocument() == null) ? 0 : getDocument().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getPresignedUrlConfig() == null) ? 0 : getPresignedUrlConfig().hashCode()); hashCode = prime * hashCode + ((getTargetSelection() == null) ? 0 : getTargetSelection().hashCode()); hashCode = prime * hashCode + ((getJobExecutionsRolloutConfig() == null) ? 0 : getJobExecutionsRolloutConfig() .hashCode()); hashCode = prime * hashCode + ((getAbortConfig() == null) ? 0 : getAbortConfig().hashCode()); hashCode = prime * hashCode + ((getTimeoutConfig() == null) ? 0 : getTimeoutConfig().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); hashCode = prime * hashCode + ((getNamespaceId() == null) ? 0 : getNamespaceId().hashCode()); hashCode = prime * hashCode + ((getJobTemplateArn() == null) ? 0 : getJobTemplateArn().hashCode()); hashCode = prime * hashCode + ((getJobExecutionsRetryConfig() == null) ? 0 : getJobExecutionsRetryConfig() .hashCode()); hashCode = prime * hashCode + ((getDocumentParameters() == null) ? 0 : getDocumentParameters().hashCode()); hashCode = prime * hashCode + ((getSchedulingConfig() == null) ? 0 : getSchedulingConfig().hashCode()); hashCode = prime * hashCode + ((getDestinationPackageVersions() == null) ? 0 : getDestinationPackageVersions() .hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateJobRequest == false) return false; CreateJobRequest other = (CreateJobRequest) obj; if (other.getJobId() == null ^ this.getJobId() == null) return false; if (other.getJobId() != null && other.getJobId().equals(this.getJobId()) == false) return false; if (other.getTargets() == null ^ this.getTargets() == null) return false; if (other.getTargets() != null && other.getTargets().equals(this.getTargets()) == false) return false; if (other.getDocumentSource() == null ^ this.getDocumentSource() == null) return false; if (other.getDocumentSource() != null && other.getDocumentSource().equals(this.getDocumentSource()) == false) return false; if (other.getDocument() == null ^ this.getDocument() == null) return false; if (other.getDocument() != null && other.getDocument().equals(this.getDocument()) == false) return false; if (other.getDescription() == null ^ this.getDescription() == null) return false; if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false) return false; if (other.getPresignedUrlConfig() == null ^ this.getPresignedUrlConfig() == null) return false; if (other.getPresignedUrlConfig() != null && other.getPresignedUrlConfig().equals(this.getPresignedUrlConfig()) == false) return false; if (other.getTargetSelection() == null ^ this.getTargetSelection() == null) return false; if (other.getTargetSelection() != null && other.getTargetSelection().equals(this.getTargetSelection()) == false) return false; if (other.getJobExecutionsRolloutConfig() == null ^ this.getJobExecutionsRolloutConfig() == null) return false; if (other.getJobExecutionsRolloutConfig() != null && other.getJobExecutionsRolloutConfig().equals( this.getJobExecutionsRolloutConfig()) == false) return false; if (other.getAbortConfig() == null ^ this.getAbortConfig() == null) return false; if (other.getAbortConfig() != null && other.getAbortConfig().equals(this.getAbortConfig()) == false) return false; if (other.getTimeoutConfig() == null ^ this.getTimeoutConfig() == null) return false; if (other.getTimeoutConfig() != null && other.getTimeoutConfig().equals(this.getTimeoutConfig()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; if (other.getNamespaceId() == null ^ this.getNamespaceId() == null) return false; if (other.getNamespaceId() != null && other.getNamespaceId().equals(this.getNamespaceId()) == false) return false; if (other.getJobTemplateArn() == null ^ this.getJobTemplateArn() == null) return false; if (other.getJobTemplateArn() != null && other.getJobTemplateArn().equals(this.getJobTemplateArn()) == false) return false; if (other.getJobExecutionsRetryConfig() == null ^ this.getJobExecutionsRetryConfig() == null) return false; if (other.getJobExecutionsRetryConfig() != null && other.getJobExecutionsRetryConfig().equals(this.getJobExecutionsRetryConfig()) == false) return false; if (other.getDocumentParameters() == null ^ this.getDocumentParameters() == null) return false; if (other.getDocumentParameters() != null && other.getDocumentParameters().equals(this.getDocumentParameters()) == false) return false; if (other.getSchedulingConfig() == null ^ this.getSchedulingConfig() == null) return false; if (other.getSchedulingConfig() != null && other.getSchedulingConfig().equals(this.getSchedulingConfig()) == false) return false; if (other.getDestinationPackageVersions() == null ^ this.getDestinationPackageVersions() == null) return false; if (other.getDestinationPackageVersions() != null && other.getDestinationPackageVersions().equals( this.getDestinationPackageVersions()) == false) return false; return true; } }