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

* Updates supported fields of the specified job. *

*

* Requires permission to access the UpdateJob action. *

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

* The ID of the job to be updated. *

*

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

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

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

*/ private JobExecutionsRolloutConfig jobExecutionsRolloutConfig; /** *

* Allows you to create 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; /** *

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

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

*/ private JobExecutionsRetryConfig jobExecutionsRetryConfig; /** *

* The ID of the job to be updated. *

*

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

* The ID of the job to be updated. *

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

* The ID of the job to be updated. *

*

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

* The ID of the job to be updated. *

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

* The ID of the job to be updated. *

*

* 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

* The ID of the job to be updated. *

* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateJobRequest withJobId(String jobId) { this.jobId = jobId; 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 UpdateJobRequest 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 UpdateJobRequest withPresignedUrlConfig(PresignedUrlConfig presignedUrlConfig) { this.presignedUrlConfig = presignedUrlConfig; 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 UpdateJobRequest withJobExecutionsRolloutConfig( JobExecutionsRolloutConfig jobExecutionsRolloutConfig) { this.jobExecutionsRolloutConfig = jobExecutionsRolloutConfig; return this; } /** *

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

* * @return

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

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

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

* * @param abortConfig

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

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

* Allows you to create 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 criteria to abort a job. *

* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateJobRequest 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 UpdateJobRequest withTimeoutConfig(TimeoutConfig timeoutConfig) { this.timeoutConfig = timeoutConfig; 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 UpdateJobRequest withNamespaceId(String namespaceId) { this.namespaceId = namespaceId; 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 UpdateJobRequest withJobExecutionsRetryConfig( JobExecutionsRetryConfig jobExecutionsRetryConfig) { this.jobExecutionsRetryConfig = jobExecutionsRetryConfig; 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 (getDescription() != null) sb.append("description: " + getDescription() + ","); if (getPresignedUrlConfig() != null) sb.append("presignedUrlConfig: " + getPresignedUrlConfig() + ","); if (getJobExecutionsRolloutConfig() != null) sb.append("jobExecutionsRolloutConfig: " + getJobExecutionsRolloutConfig() + ","); if (getAbortConfig() != null) sb.append("abortConfig: " + getAbortConfig() + ","); if (getTimeoutConfig() != null) sb.append("timeoutConfig: " + getTimeoutConfig() + ","); if (getNamespaceId() != null) sb.append("namespaceId: " + getNamespaceId() + ","); if (getJobExecutionsRetryConfig() != null) sb.append("jobExecutionsRetryConfig: " + getJobExecutionsRetryConfig()); 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 + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getPresignedUrlConfig() == null) ? 0 : getPresignedUrlConfig().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 + ((getNamespaceId() == null) ? 0 : getNamespaceId().hashCode()); hashCode = prime * hashCode + ((getJobExecutionsRetryConfig() == null) ? 0 : getJobExecutionsRetryConfig() .hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof UpdateJobRequest == false) return false; UpdateJobRequest other = (UpdateJobRequest) obj; if (other.getJobId() == null ^ this.getJobId() == null) return false; if (other.getJobId() != null && other.getJobId().equals(this.getJobId()) == 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.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.getNamespaceId() == null ^ this.getNamespaceId() == null) return false; if (other.getNamespaceId() != null && other.getNamespaceId().equals(this.getNamespaceId()) == false) return false; if (other.getJobExecutionsRetryConfig() == null ^ this.getJobExecutionsRetryConfig() == null) return false; if (other.getJobExecutionsRetryConfig() != null && other.getJobExecutionsRetryConfig().equals(this.getJobExecutionsRetryConfig()) == false) return false; return true; } }