/* * 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 an IoT OTA update on a target group of things or groups. *
** Requires permission to access the CreateOTAUpdate action. *
*/ public class CreateOTAUpdateRequest extends AmazonWebServiceRequest implements Serializable { /** ** The ID of the OTA update to be created. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9_-]+
*/
private String otaUpdateId;
/**
*
* The description of the OTA update. *
*
* Constraints:
* Length: - 2028
* Pattern: [^\p{C}]+
*/
private String description;
/**
*
* The devices targeted to receive OTA updates. *
*/ private java.util.List* The protocol used to transfer the OTA update image. Valid values are * [HTTP], [MQTT], [HTTP, MQTT]. When both HTTP and MQTT are specified, the * target device can choose the protocol. *
*/ private java.util.List* Specifies whether the update will continue to run (CONTINUOUS), or will * be complete after all the things specified as targets have completed the * update (SNAPSHOT). If continuous, the update may also be run on a thing * when a change is detected in a target. For example, an update will run on * a thing when the thing is added to a target group, even after the update * was completed by all things originally in the group. Valid values: * CONTINUOUS | SNAPSHOT. *
*
* Constraints:
* Allowed Values: CONTINUOUS, SNAPSHOT
*/
private String targetSelection;
/**
*
* Configuration for the rollout of OTA updates. *
*/ private AwsJobExecutionsRolloutConfig awsJobExecutionsRolloutConfig; /** ** Configuration information for pre-signed URLs. *
*/ private AwsJobPresignedUrlConfig awsJobPresignedUrlConfig; /** ** The criteria that determine when and how a job abort takes place. *
*/ private AwsJobAbortConfig awsJobAbortConfig; /** *
* 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
.
*
* The files to be streamed by the OTA update. *
*/ private java.util.List* The IAM role that grants Amazon Web Services IoT Core access to the * Amazon S3, IoT jobs and Amazon Web Services Code Signing resources to * create an OTA update job. *
*
* Constraints:
* Length: 20 - 2048
*/
private String roleArn;
/**
*
* A list of additional OTA update parameters which are name-value pairs. *
*/ private java.util.Map* Metadata which can be used to manage updates. *
*/ private java.util.List* The ID of the OTA update to be created. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9_-]+
*
* @return
* The ID of the OTA update to be created. *
*/ public String getOtaUpdateId() { return otaUpdateId; } /** ** The ID of the OTA update to be created. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9_-]+
*
* @param otaUpdateId
* The ID of the OTA update to be created. *
*/ public void setOtaUpdateId(String otaUpdateId) { this.otaUpdateId = otaUpdateId; } /** ** The ID of the OTA update to be created. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9_-]+
*
* @param otaUpdateId
* The ID of the OTA update to be created. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateOTAUpdateRequest withOtaUpdateId(String otaUpdateId) { this.otaUpdateId = otaUpdateId; return this; } /** ** The description of the OTA update. *
*
* Constraints:
* Length: - 2028
* Pattern: [^\p{C}]+
*
* @return
* The description of the OTA update. *
*/ public String getDescription() { return description; } /** ** The description of the OTA update. *
*
* Constraints:
* Length: - 2028
* Pattern: [^\p{C}]+
*
* @param description
* The description of the OTA update. *
*/ public void setDescription(String description) { this.description = description; } /** ** The description of the OTA update. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: - 2028
* Pattern: [^\p{C}]+
*
* @param description
* The description of the OTA update. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateOTAUpdateRequest withDescription(String description) { this.description = description; return this; } /** ** The devices targeted to receive OTA updates. *
* * @return* The devices targeted to receive OTA updates. *
*/ public java.util.List* The devices targeted to receive OTA updates. *
* * @param targets* The devices targeted to receive OTA updates. *
*/ public void setTargets(java.util.Collection* The devices targeted to receive OTA updates. *
** Returns a reference to this object so that method calls can be chained * together. * * @param targets
* The devices targeted to receive OTA updates. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateOTAUpdateRequest withTargets(String... targets) { if (getTargets() == null) { this.targets = new java.util.ArrayList* The devices targeted to receive OTA updates. *
** Returns a reference to this object so that method calls can be chained * together. * * @param targets
* The devices targeted to receive OTA updates. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateOTAUpdateRequest withTargets(java.util.Collection* The protocol used to transfer the OTA update image. Valid values are * [HTTP], [MQTT], [HTTP, MQTT]. When both HTTP and MQTT are specified, the * target device can choose the protocol. *
* * @return* The protocol used to transfer the OTA update image. Valid values * are [HTTP], [MQTT], [HTTP, MQTT]. When both HTTP and MQTT are * specified, the target device can choose the protocol. *
*/ public java.util.List* The protocol used to transfer the OTA update image. Valid values are * [HTTP], [MQTT], [HTTP, MQTT]. When both HTTP and MQTT are specified, the * target device can choose the protocol. *
* * @param protocols* The protocol used to transfer the OTA update image. Valid * values are [HTTP], [MQTT], [HTTP, MQTT]. When both HTTP and * MQTT are specified, the target device can choose the protocol. *
*/ public void setProtocols(java.util.Collection* The protocol used to transfer the OTA update image. Valid values are * [HTTP], [MQTT], [HTTP, MQTT]. When both HTTP and MQTT are specified, the * target device can choose the protocol. *
** Returns a reference to this object so that method calls can be chained * together. * * @param protocols
* The protocol used to transfer the OTA update image. Valid * values are [HTTP], [MQTT], [HTTP, MQTT]. When both HTTP and * MQTT are specified, the target device can choose the protocol. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateOTAUpdateRequest withProtocols(String... protocols) { if (getProtocols() == null) { this.protocols = new java.util.ArrayList* The protocol used to transfer the OTA update image. Valid values are * [HTTP], [MQTT], [HTTP, MQTT]. When both HTTP and MQTT are specified, the * target device can choose the protocol. *
** Returns a reference to this object so that method calls can be chained * together. * * @param protocols
* The protocol used to transfer the OTA update image. Valid * values are [HTTP], [MQTT], [HTTP, MQTT]. When both HTTP and * MQTT are specified, the target device can choose the protocol. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateOTAUpdateRequest withProtocols(java.util.Collection* Specifies whether the update will continue to run (CONTINUOUS), or will * be complete after all the things specified as targets have completed the * update (SNAPSHOT). If continuous, the update may also be run on a thing * when a change is detected in a target. For example, an update will run on * a thing when the thing is added to a target group, even after the update * was completed by all things originally in the group. Valid values: * CONTINUOUS | SNAPSHOT. *
*
* Constraints:
* Allowed Values: CONTINUOUS, SNAPSHOT
*
* @return
* Specifies whether the update will continue to run (CONTINUOUS), * or will be complete after all the things specified as targets * have completed the update (SNAPSHOT). If continuous, the update * may also be run on a thing when a change is detected in a target. * For example, an update will run on a thing when the thing is * added to a target group, even after the update was completed by * all things originally in the group. Valid values: CONTINUOUS | * SNAPSHOT. *
* @see TargetSelection */ public String getTargetSelection() { return targetSelection; } /** ** Specifies whether the update will continue to run (CONTINUOUS), or will * be complete after all the things specified as targets have completed the * update (SNAPSHOT). If continuous, the update may also be run on a thing * when a change is detected in a target. For example, an update will run on * a thing when the thing is added to a target group, even after the update * was completed by all things originally in the group. Valid values: * CONTINUOUS | SNAPSHOT. *
*
* Constraints:
* Allowed Values: CONTINUOUS, SNAPSHOT
*
* @param targetSelection
* Specifies whether the update will continue to run * (CONTINUOUS), or will be complete after all the things * specified as targets have completed the update (SNAPSHOT). If * continuous, the update may also be run on a thing when a * change is detected in a target. For example, an update will * run on a thing when the thing is added to a target group, even * after the update was completed by all things originally in the * group. Valid values: CONTINUOUS | SNAPSHOT. *
* @see TargetSelection */ public void setTargetSelection(String targetSelection) { this.targetSelection = targetSelection; } /** ** Specifies whether the update will continue to run (CONTINUOUS), or will * be complete after all the things specified as targets have completed the * update (SNAPSHOT). If continuous, the update may also be run on a thing * when a change is detected in a target. For example, an update will run on * a thing when the thing is added to a target group, even after the update * was completed by all things originally in the group. Valid values: * CONTINUOUS | SNAPSHOT. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: CONTINUOUS, SNAPSHOT
*
* @param targetSelection
* Specifies whether the update will continue to run * (CONTINUOUS), or will be complete after all the things * specified as targets have completed the update (SNAPSHOT). If * continuous, the update may also be run on a thing when a * change is detected in a target. For example, an update will * run on a thing when the thing is added to a target group, even * after the update was completed by all things originally in the * group. Valid values: CONTINUOUS | SNAPSHOT. *
* @return A reference to this updated object so that method calls can be * chained together. * @see TargetSelection */ public CreateOTAUpdateRequest withTargetSelection(String targetSelection) { this.targetSelection = targetSelection; return this; } /** ** Specifies whether the update will continue to run (CONTINUOUS), or will * be complete after all the things specified as targets have completed the * update (SNAPSHOT). If continuous, the update may also be run on a thing * when a change is detected in a target. For example, an update will run on * a thing when the thing is added to a target group, even after the update * was completed by all things originally in the group. Valid values: * CONTINUOUS | SNAPSHOT. *
*
* Constraints:
* Allowed Values: CONTINUOUS, SNAPSHOT
*
* @param targetSelection
* Specifies whether the update will continue to run * (CONTINUOUS), or will be complete after all the things * specified as targets have completed the update (SNAPSHOT). If * continuous, the update may also be run on a thing when a * change is detected in a target. For example, an update will * run on a thing when the thing is added to a target group, even * after the update was completed by all things originally in the * group. Valid values: CONTINUOUS | SNAPSHOT. *
* @see TargetSelection */ public void setTargetSelection(TargetSelection targetSelection) { this.targetSelection = targetSelection.toString(); } /** ** Specifies whether the update will continue to run (CONTINUOUS), or will * be complete after all the things specified as targets have completed the * update (SNAPSHOT). If continuous, the update may also be run on a thing * when a change is detected in a target. For example, an update will run on * a thing when the thing is added to a target group, even after the update * was completed by all things originally in the group. Valid values: * CONTINUOUS | SNAPSHOT. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: CONTINUOUS, SNAPSHOT
*
* @param targetSelection
* Specifies whether the update will continue to run * (CONTINUOUS), or will be complete after all the things * specified as targets have completed the update (SNAPSHOT). If * continuous, the update may also be run on a thing when a * change is detected in a target. For example, an update will * run on a thing when the thing is added to a target group, even * after the update was completed by all things originally in the * group. Valid values: CONTINUOUS | SNAPSHOT. *
* @return A reference to this updated object so that method calls can be * chained together. * @see TargetSelection */ public CreateOTAUpdateRequest withTargetSelection(TargetSelection targetSelection) { this.targetSelection = targetSelection.toString(); return this; } /** ** Configuration for the rollout of OTA updates. *
* * @return* Configuration for the rollout of OTA updates. *
*/ public AwsJobExecutionsRolloutConfig getAwsJobExecutionsRolloutConfig() { return awsJobExecutionsRolloutConfig; } /** ** Configuration for the rollout of OTA updates. *
* * @param awsJobExecutionsRolloutConfig* Configuration for the rollout of OTA updates. *
*/ public void setAwsJobExecutionsRolloutConfig( AwsJobExecutionsRolloutConfig awsJobExecutionsRolloutConfig) { this.awsJobExecutionsRolloutConfig = awsJobExecutionsRolloutConfig; } /** ** Configuration for the rollout of OTA updates. *
** Returns a reference to this object so that method calls can be chained * together. * * @param awsJobExecutionsRolloutConfig
* Configuration for the rollout of OTA updates. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateOTAUpdateRequest withAwsJobExecutionsRolloutConfig( AwsJobExecutionsRolloutConfig awsJobExecutionsRolloutConfig) { this.awsJobExecutionsRolloutConfig = awsJobExecutionsRolloutConfig; return this; } /** ** Configuration information for pre-signed URLs. *
* * @return* Configuration information for pre-signed URLs. *
*/ public AwsJobPresignedUrlConfig getAwsJobPresignedUrlConfig() { return awsJobPresignedUrlConfig; } /** ** Configuration information for pre-signed URLs. *
* * @param awsJobPresignedUrlConfig* Configuration information for pre-signed URLs. *
*/ public void setAwsJobPresignedUrlConfig(AwsJobPresignedUrlConfig awsJobPresignedUrlConfig) { this.awsJobPresignedUrlConfig = awsJobPresignedUrlConfig; } /** ** Configuration information for pre-signed URLs. *
** Returns a reference to this object so that method calls can be chained * together. * * @param awsJobPresignedUrlConfig
* Configuration information for pre-signed URLs. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateOTAUpdateRequest withAwsJobPresignedUrlConfig( AwsJobPresignedUrlConfig awsJobPresignedUrlConfig) { this.awsJobPresignedUrlConfig = awsJobPresignedUrlConfig; 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 AwsJobAbortConfig getAwsJobAbortConfig() { return awsJobAbortConfig; } /** ** The criteria that determine when and how a job abort takes place. *
* * @param awsJobAbortConfig* The criteria that determine when and how a job abort takes * place. *
*/ public void setAwsJobAbortConfig(AwsJobAbortConfig awsJobAbortConfig) { this.awsJobAbortConfig = awsJobAbortConfig; } /** ** 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 awsJobAbortConfig
* 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 CreateOTAUpdateRequest withAwsJobAbortConfig(AwsJobAbortConfig awsJobAbortConfig) { this.awsJobAbortConfig = awsJobAbortConfig; 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 awsJobTimeoutConfig
* 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
.
*
* The files to be streamed by the OTA update. *
* * @return* The files to be streamed by the OTA update. *
*/ public java.util.List* The files to be streamed by the OTA update. *
* * @param files* The files to be streamed by the OTA update. *
*/ public void setFiles(java.util.Collection* The files to be streamed by the OTA update. *
** Returns a reference to this object so that method calls can be chained * together. * * @param files
* The files to be streamed by the OTA update. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateOTAUpdateRequest withFiles(OTAUpdateFile... files) { if (getFiles() == null) { this.files = new java.util.ArrayList* The files to be streamed by the OTA update. *
** Returns a reference to this object so that method calls can be chained * together. * * @param files
* The files to be streamed by the OTA update. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateOTAUpdateRequest withFiles(java.util.Collection* The IAM role that grants Amazon Web Services IoT Core access to the * Amazon S3, IoT jobs and Amazon Web Services Code Signing resources to * create an OTA update job. *
*
* Constraints:
* Length: 20 - 2048
*
* @return
* The IAM role that grants Amazon Web Services IoT Core access to * the Amazon S3, IoT jobs and Amazon Web Services Code Signing * resources to create an OTA update job. *
*/ public String getRoleArn() { return roleArn; } /** ** The IAM role that grants Amazon Web Services IoT Core access to the * Amazon S3, IoT jobs and Amazon Web Services Code Signing resources to * create an OTA update job. *
*
* Constraints:
* Length: 20 - 2048
*
* @param roleArn
* The IAM role that grants Amazon Web Services IoT Core access * to the Amazon S3, IoT jobs and Amazon Web Services Code * Signing resources to create an OTA update job. *
*/ public void setRoleArn(String roleArn) { this.roleArn = roleArn; } /** ** The IAM role that grants Amazon Web Services IoT Core access to the * Amazon S3, IoT jobs and Amazon Web Services Code Signing resources to * create an OTA update job. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 20 - 2048
*
* @param roleArn
* The IAM role that grants Amazon Web Services IoT Core access * to the Amazon S3, IoT jobs and Amazon Web Services Code * Signing resources to create an OTA update job. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateOTAUpdateRequest withRoleArn(String roleArn) { this.roleArn = roleArn; return this; } /** ** A list of additional OTA update parameters which are name-value pairs. *
* * @return* A list of additional OTA update parameters which are name-value * pairs. *
*/ public java.util.Map* A list of additional OTA update parameters which are name-value pairs. *
* * @param additionalParameters* A list of additional OTA update parameters which are * name-value pairs. *
*/ public void setAdditionalParameters(java.util.Map* A list of additional OTA update parameters which are name-value pairs. *
** Returns a reference to this object so that method calls can be chained * together. * * @param additionalParameters
* A list of additional OTA update parameters which are * name-value pairs. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateOTAUpdateRequest withAdditionalParameters( java.util.Map* A list of additional OTA update parameters which are name-value pairs. *
*
* The method adds a new key-value pair into additionalParameters 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 additionalParameters.
* @param value The corresponding value of the entry to be added into
* additionalParameters.
* @return A reference to this updated object so that method calls can be
* chained together.
*/
public CreateOTAUpdateRequest addadditionalParametersEntry(String key, String value) {
if (null == this.additionalParameters) {
this.additionalParameters = new java.util.HashMap
* Returns a reference to this object so that method calls can be chained
* together.
*/
public CreateOTAUpdateRequest clearadditionalParametersEntries() {
this.additionalParameters = null;
return this;
}
/**
*
* Metadata which can be used to manage updates.
*
* Metadata which can be used to manage updates.
*
* Metadata which can be used to manage updates.
*
* Metadata which can be used to manage updates.
*
* Metadata which can be used to manage updates.
*
* Returns a reference to this object so that method calls can be chained
* together.
*
* @param tags
* Metadata which can be used to manage updates.
*
* Metadata which can be used to manage updates.
*
* Returns a reference to this object so that method calls can be chained
* together.
*
* @param tags
* Metadata which can be used to manage updates.
*