/* * 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 CreateJobRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *
* 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. *
*/ private String jobId; /** ** A list of things and thing groups to which the job should be sent. *
*/ private java.util.List
* 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. *
*/ private String documentSource; /** *
* The job document. Required if you don't specify a value for documentSource
.
*
* A short text description of the job. *
*/ 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. *
** 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
.
*
* Metadata which can be used to manage the job. *
*/ private java.util.List* 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.
*
* The ARN of the job template used to create the job. *
*/ 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.
*
* 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* 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. *
* * @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. *
* * @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 this.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. *
* * @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 Returns a reference to this object so that method calls can be chained together. */ public CreateJobRequest withJobId(String jobId) { setJobId(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* 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* A list of things and thing groups to which the job should be sent. *
** 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 things and thing groups to which the job should be sent. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateJobRequest withTargets(String... targets) { if (this.targets == null) { setTargets(new java.util.ArrayList* 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. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateJobRequest withTargets(java.util.Collection
* 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. *
* * @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 fordocument
.
*
* 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. *
* * @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 fordocument
.
*
* 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 this.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. *
* * @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 fordocument
.
*
* 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 Returns a reference to this object so that method calls can be chained together. */ public CreateJobRequest withDocumentSource(String documentSource) { setDocumentSource(documentSource); return this; } /** *
* The job document. Required if you don't specify a value for documentSource
.
*
documentSource
.
*/
public void setDocument(String document) {
this.document = document;
}
/**
*
* The job document. Required if you don't specify a value for documentSource
.
*
documentSource
.
*/
public String getDocument() {
return this.document;
}
/**
*
* The job document. Required if you don't specify a value for documentSource
.
*
documentSource
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateJobRequest withDocument(String document) {
setDocument(document);
return this;
}
/**
* * A short text description of the job. *
* * @param description * A short text description of the job. */ public void setDescription(String description) { this.description = description; } /** ** A short text description of the job. *
* * @return A short text description of the job. */ public String getDescription() { return this.description; } /** ** A short text description of the job. *
* * @param description * A short text description of the job. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateJobRequest withDescription(String description) { setDescription(description); return this; } /** ** 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. *
* * @return Configuration information for pre-signed S3 URLs. */ public PresignedUrlConfig getPresignedUrlConfig() { return this.presignedUrlConfig; } /** ** Configuration information for pre-signed S3 URLs. *
* * @param presignedUrlConfig * Configuration information for pre-signed S3 URLs. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateJobRequest withPresignedUrlConfig(PresignedUrlConfig presignedUrlConfig) { setPresignedUrlConfig(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. *
** 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. *
** 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 this.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. *
** 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 Returns a reference to this object so that method calls can be chained together. * @see TargetSelection */ public CreateJobRequest withTargetSelection(String targetSelection) { setTargetSelection(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. *
** 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 Returns a reference to this 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. *
* * @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. *
* * @return Allows you to create a staged rollout of the job. */ public JobExecutionsRolloutConfig getJobExecutionsRolloutConfig() { return this.jobExecutionsRolloutConfig; } /** ** Allows you to create a staged rollout of the job. *
* * @param jobExecutionsRolloutConfig * Allows you to create a staged rollout of the job. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateJobRequest withJobExecutionsRolloutConfig(JobExecutionsRolloutConfig jobExecutionsRolloutConfig) { setJobExecutionsRolloutConfig(jobExecutionsRolloutConfig); return this; } /** ** 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. *
* * @return Allows you to create the criteria to abort a job. */ public AbortConfig getAbortConfig() { return this.abortConfig; } /** ** Allows you to create the criteria to abort a job. *
* * @param abortConfig * Allows you to create the criteria to abort a job. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateJobRequest withAbortConfig(AbortConfig abortConfig) { setAbortConfig(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
.
*
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
.
*
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 this.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
.
*
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 Returns a reference to this object so that method calls can be chained together.
*/
public CreateJobRequest withTimeoutConfig(TimeoutConfig timeoutConfig) {
setTimeoutConfig(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* 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* Metadata which can be used to manage the job. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the * existing values. *
* * @param tags * Metadata which can be used to manage the job. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateJobRequest withTags(Tag... tags) { if (this.tags == null) { setTags(new java.util.ArrayList* Metadata which can be used to manage the job. *
* * @param tags * Metadata which can be used to manage the job. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateJobRequest withTags(java.util.Collection* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* The ARN of the job template used to create the job. *
* * @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. *
* * @return The ARN of the job template used to create the job. */ public String getJobTemplateArn() { return this.jobTemplateArn; } /** ** The ARN of the job template used to create the job. *
* * @param jobTemplateArn * The ARN of the job template used to create the job. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateJobRequest withJobTemplateArn(String jobTemplateArn) { setJobTemplateArn(jobTemplateArn); return this; } /** ** 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. *
* * @return Allows you to create the criteria to retry a job. */ public JobExecutionsRetryConfig getJobExecutionsRetryConfig() { return this.jobExecutionsRetryConfig; } /** ** Allows you to create the criteria to retry a job. *
* * @param jobExecutionsRetryConfig * Allows you to create the criteria to retry a job. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateJobRequest withJobExecutionsRetryConfig(JobExecutionsRetryConfig jobExecutionsRetryConfig) { setJobExecutionsRetryConfig(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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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 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. *
* * @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 this.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. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateJobRequest withSchedulingConfig(SchedulingConfig schedulingConfig) { setSchedulingConfig(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
* 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.
*
* Note:The following Length Constraints relates to a single string. Up to five strings are allowed.
*/
public void setDestinationPackageVersions(java.util.Collection
* 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.
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setDestinationPackageVersions(java.util.Collection)} or
* {@link #withDestinationPackageVersions(java.util.Collection)} if you want to override the existing values.
*
* Note:The following Length Constraints relates to a single string. Up to five strings are allowed.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateJobRequest withDestinationPackageVersions(String... destinationPackageVersions) {
if (this.destinationPackageVersions == null) {
setDestinationPackageVersions(new java.util.ArrayList
* 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.
*
* Note:The following Length Constraints relates to a single string. Up to five strings are allowed.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateJobRequest withDestinationPackageVersions(java.util.Collection