/* * 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 template. *
** Requires permission to access the CreateJobTemplate action. *
*/ public class CreateJobTemplateRequest extends AmazonWebServiceRequest implements Serializable { /** ** A unique identifier for the job template. 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 jobTemplateId;
/**
*
* The ARN of the job to use as the basis for the job template. *
*/ private String jobArn; /** *
* An S3 link to the job document to use in the template. Required if you
* don't specify a value for document
.
*
* If the job document resides in an S3 bucket, you must use a placeholder * link when specifying the document. *
** The placeholder link is of the following form: *
*
* ${aws:iot:s3-presigned-url:https://s3.amazonaws.com/bucket/key}
*
* where bucket is your bucket name and key is the object in * the bucket to which you are linking. *
*
* 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 description of the job document. *
*
* Constraints:
* Length: - 2028
* Pattern: [^\p{C}]+
*/
private String description;
/**
*
* Configuration for pre-signed S3 URLs. *
*/ private PresignedUrlConfig presignedUrlConfig; /** ** Allows you to create a staged rollout of a job. *
*/ private JobExecutionsRolloutConfig jobExecutionsRolloutConfig; /** ** The criteria that determine when and how a job abort takes place. *
*/ private AbortConfig abortConfig; /** *
* Specifies the amount of time each device has to finish its execution of
* the job. A 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 timer expires, it will be automatically
* set to TIMED_OUT
.
*
* Metadata that can be used to manage the job template. *
*/ private java.util.List* Allows you to create the criteria to retry a job. *
*/ private JobExecutionsRetryConfig jobExecutionsRetryConfig; /** ** Allows you to configure an optional maintenance window for the rollout of * a job document to all devices in the target group for a job. *
*/ private 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. *
*/ private java.util.List* A unique identifier for the job template. 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 unique identifier for the job template. We recommend using a * UUID. Alpha-numeric characters, "-", and "_" are valid for use * here. *
*/ public String getJobTemplateId() { return jobTemplateId; } /** ** A unique identifier for the job template. We recommend using a UUID. * Alpha-numeric characters, "-", and "_" are valid for use here. *
*
* Constraints:
* Length: 1 - 64
* Pattern: [a-zA-Z0-9_-]+
*
* @param jobTemplateId
* A unique identifier for the job template. We recommend using a * UUID. Alpha-numeric characters, "-", and "_" are valid for use * here. *
*/ public void setJobTemplateId(String jobTemplateId) { this.jobTemplateId = jobTemplateId; } /** ** A unique identifier for the job template. 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 jobTemplateId
* A unique identifier for the job template. 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 CreateJobTemplateRequest withJobTemplateId(String jobTemplateId) { this.jobTemplateId = jobTemplateId; return this; } /** ** The ARN of the job to use as the basis for the job template. *
* * @return* The ARN of the job to use as the basis for the job template. *
*/ public String getJobArn() { return jobArn; } /** ** The ARN of the job to use as the basis for the job template. *
* * @param jobArn* The ARN of the job to use as the basis for the job template. *
*/ public void setJobArn(String jobArn) { this.jobArn = jobArn; } /** ** The ARN of the job to use as the basis for the job template. *
** Returns a reference to this object so that method calls can be chained * together. * * @param jobArn
* The ARN of the job to use as the basis for the job template. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateJobTemplateRequest withJobArn(String jobArn) { this.jobArn = jobArn; return this; } /** *
* An S3 link to the job document to use in the template. Required if you
* don't specify a value for document
.
*
* If the job document resides in an S3 bucket, you must use a placeholder * link when specifying the document. *
** The placeholder link is of the following form: *
*
* ${aws:iot:s3-presigned-url:https://s3.amazonaws.com/bucket/key}
*
* where bucket is your bucket name and key is the object in * the bucket to which you are linking. *
*
* Constraints:
* Length: 1 - 1350
*
* @return
* An S3 link to the job document to use in the template. Required
* if you don't specify a value for document
.
*
* If the job document resides in an S3 bucket, you must use a * placeholder link when specifying the document. *
** The placeholder link is of the following form: *
*
* ${aws:iot:s3-presigned-url:https://s3.amazonaws.com/bucket/key}
*
* where bucket is your bucket name and key is the * object in the bucket to which you are linking. *
*
* An S3 link to the job document to use in the template. Required if you
* don't specify a value for document
.
*
* If the job document resides in an S3 bucket, you must use a placeholder * link when specifying the document. *
** The placeholder link is of the following form: *
*
* ${aws:iot:s3-presigned-url:https://s3.amazonaws.com/bucket/key}
*
* where bucket is your bucket name and key is the object in * the bucket to which you are linking. *
*
* Constraints:
* Length: 1 - 1350
*
* @param documentSource
* An S3 link to the job document to use in the template.
* Required if you don't specify a value for
* document
.
*
* If the job document resides in an S3 bucket, you must use a * placeholder link when specifying the document. *
** The placeholder link is of the following form: *
*
* ${aws:iot:s3-presigned-url:https://s3.amazonaws.com/bucket/key}
*
* where bucket is your bucket name and key is the * object in the bucket to which you are linking. *
*
* An S3 link to the job document to use in the template. Required if you
* don't specify a value for document
.
*
* If the job document resides in an S3 bucket, you must use a placeholder * link when specifying the document. *
** The placeholder link is of the following form: *
*
* ${aws:iot:s3-presigned-url:https://s3.amazonaws.com/bucket/key}
*
* where bucket is your bucket name and key is the object in * the bucket to which you are linking. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 1 - 1350
*
* @param documentSource
* An S3 link to the job document to use in the template.
* Required if you don't specify a value for
* document
.
*
* If the job document resides in an S3 bucket, you must use a * placeholder link when specifying the document. *
** The placeholder link is of the following form: *
*
* ${aws:iot:s3-presigned-url:https://s3.amazonaws.com/bucket/key}
*
* where bucket is your bucket name and key is the * object in the bucket to which you are linking. *
*
* 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
.
*
* 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
.
*
* 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
.
*
* A description of the job document. *
*
* Constraints:
* Length: - 2028
* Pattern: [^\p{C}]+
*
* @return
* A description of the job document. *
*/ public String getDescription() { return description; } /** ** A description of the job document. *
*
* Constraints:
* Length: - 2028
* Pattern: [^\p{C}]+
*
* @param description
* A description of the job document. *
*/ public void setDescription(String description) { this.description = description; } /** ** A description of the job document. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: - 2028
* Pattern: [^\p{C}]+
*
* @param description
* A description of the job document. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateJobTemplateRequest withDescription(String description) { this.description = description; return this; } /** ** Configuration for pre-signed S3 URLs. *
* * @return* Configuration for pre-signed S3 URLs. *
*/ public PresignedUrlConfig getPresignedUrlConfig() { return presignedUrlConfig; } /** ** Configuration for pre-signed S3 URLs. *
* * @param presignedUrlConfig* Configuration for pre-signed S3 URLs. *
*/ public void setPresignedUrlConfig(PresignedUrlConfig presignedUrlConfig) { this.presignedUrlConfig = presignedUrlConfig; } /** ** Configuration for pre-signed S3 URLs. *
** Returns a reference to this object so that method calls can be chained * together. * * @param presignedUrlConfig
* Configuration for pre-signed S3 URLs. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateJobTemplateRequest withPresignedUrlConfig(PresignedUrlConfig presignedUrlConfig) { this.presignedUrlConfig = presignedUrlConfig; return this; } /** ** Allows you to create a staged rollout of a job. *
* * @return* Allows you to create a staged rollout of a job. *
*/ public JobExecutionsRolloutConfig getJobExecutionsRolloutConfig() { return jobExecutionsRolloutConfig; } /** ** Allows you to create a staged rollout of a job. *
* * @param jobExecutionsRolloutConfig* Allows you to create a staged rollout of a job. *
*/ public void setJobExecutionsRolloutConfig(JobExecutionsRolloutConfig jobExecutionsRolloutConfig) { this.jobExecutionsRolloutConfig = jobExecutionsRolloutConfig; } /** ** Allows you to create a staged rollout of a 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 a job. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateJobTemplateRequest withJobExecutionsRolloutConfig( JobExecutionsRolloutConfig jobExecutionsRolloutConfig) { this.jobExecutionsRolloutConfig = jobExecutionsRolloutConfig; return this; } /** ** The criteria that determine when and how a job abort takes place. *
* * @return* The criteria that determine when and how a job abort takes place. *
*/ public AbortConfig getAbortConfig() { return abortConfig; } /** ** The criteria that determine when and how a job abort takes place. *
* * @param abortConfig* The criteria that determine when and how a job abort takes * place. *
*/ public void setAbortConfig(AbortConfig abortConfig) { this.abortConfig = abortConfig; } /** ** The criteria that determine when and how a job abort takes place. *
** Returns a reference to this object so that method calls can be chained * together. * * @param abortConfig
* The criteria that determine when and how a job abort takes * place. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateJobTemplateRequest withAbortConfig(AbortConfig abortConfig) { this.abortConfig = abortConfig; return this; } /** *
* Specifies the amount of time each device has to finish its execution of
* the job. A 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 timer expires, it will be automatically
* set to TIMED_OUT
.
*
* Specifies the amount of time each device has to finish its
* execution of the job. A 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 timer
* expires, it will be automatically set to TIMED_OUT
.
*
* Specifies the amount of time each device has to finish its execution of
* the job. A 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 timer expires, it will be automatically
* set to TIMED_OUT
.
*
* Specifies the amount of time each device has to finish its
* execution of the job. A 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 timer expires, it will be automatically set to
* TIMED_OUT
.
*
* Specifies the amount of time each device has to finish its execution of
* the job. A 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 timer 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. A 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 timer expires, it will be automatically set to
* TIMED_OUT
.
*
* Metadata that can be used to manage the job template. *
* * @return* Metadata that can be used to manage the job template. *
*/ public java.util.List* Metadata that can be used to manage the job template. *
* * @param tags* Metadata that can be used to manage the job template. *
*/ public void setTags(java.util.Collection* Metadata that can be used to manage the job template. *
** Returns a reference to this object so that method calls can be chained * together. * * @param tags
* Metadata that can be used to manage the job template. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateJobTemplateRequest withTags(Tag... tags) { if (getTags() == null) { this.tags = new java.util.ArrayList* Metadata that can be used to manage the job template. *
** Returns a reference to this object so that method calls can be chained * together. * * @param tags
* Metadata that can be used to manage the job template. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateJobTemplateRequest withTags(java.util.Collection* 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 CreateJobTemplateRequest withJobExecutionsRetryConfig( JobExecutionsRetryConfig jobExecutionsRetryConfig) { this.jobExecutionsRetryConfig = jobExecutionsRetryConfig; return this; } /** ** Allows you to configure an optional maintenance window for the rollout of * a job document to all devices in the target group for a job. *
* * @return* Allows you to configure an optional maintenance window for the * rollout of a job document to all devices in the target group for * a job. *
*/ public java.util.List* Allows you to configure an optional maintenance window for the rollout of * a job document to all devices in the target group for a job. *
* * @param maintenanceWindows* Allows you to configure an optional maintenance window for the * rollout of a job document to all devices in the target group * for a job. *
*/ public void setMaintenanceWindows(java.util.Collection* Allows you to configure an optional maintenance window for the rollout of * a job document to all devices in the target group for a job. *
** Returns a reference to this object so that method calls can be chained * together. * * @param maintenanceWindows
* Allows you to configure an optional maintenance window for the * rollout of a job document to all devices in the target group * for a job. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateJobTemplateRequest withMaintenanceWindows(MaintenanceWindow... maintenanceWindows) { if (getMaintenanceWindows() == null) { this.maintenanceWindows = new java.util.ArrayList* Allows you to configure an optional maintenance window for the rollout of * a job document to all devices in the target group for a job. *
** Returns a reference to this object so that method calls can be chained * together. * * @param maintenanceWindows
* Allows you to configure an optional maintenance window for the * rollout of a job document to all devices in the target group * for a job. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateJobTemplateRequest withMaintenanceWindows( 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. *
* * @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. *
* * @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* 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 CreateJobTemplateRequest withDestinationPackageVersions( String... destinationPackageVersions) { if (getDestinationPackageVersions() == null) { this.destinationPackageVersions = 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. *
** 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 CreateJobTemplateRequest withDestinationPackageVersions( java.util.Collection