/* * 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 UpdateJobRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *
* The ID of the job to be updated. *
*/ private String jobId; /** ** A short text description of the job. *
*/ 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
.
*
* 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.
*
* Allows you to create the criteria to retry a job. *
*/ private JobExecutionsRetryConfig jobExecutionsRetryConfig; /** ** The ID of the job to be updated. *
* * @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. *
* * @return The ID of the job to be updated. */ public String getJobId() { return this.jobId; } /** ** The ID of the job to be updated. *
* * @param jobId * The ID of the job to be updated. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateJobRequest withJobId(String jobId) { setJobId(jobId); 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 UpdateJobRequest 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 UpdateJobRequest withPresignedUrlConfig(PresignedUrlConfig presignedUrlConfig) { setPresignedUrlConfig(presignedUrlConfig); 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 UpdateJobRequest withJobExecutionsRolloutConfig(JobExecutionsRolloutConfig jobExecutionsRolloutConfig) { setJobExecutionsRolloutConfig(jobExecutionsRolloutConfig); return this; } /** ** 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. *
* * @return Allows you to create criteria to abort a job. */ public AbortConfig getAbortConfig() { return this.abortConfig; } /** ** Allows you to create criteria to abort a job. *
* * @param abortConfig * Allows you to create criteria to abort a job. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateJobRequest 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 UpdateJobRequest withTimeoutConfig(TimeoutConfig timeoutConfig) {
setTimeoutConfig(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.
*
* 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.
*
* 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 UpdateJobRequest withJobExecutionsRetryConfig(JobExecutionsRetryConfig jobExecutionsRetryConfig) { setJobExecutionsRetryConfig(jobExecutionsRetryConfig); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @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: ").append(getJobId()).append(","); if (getDescription() != null) sb.append("Description: ").append(getDescription()).append(","); if (getPresignedUrlConfig() != null) sb.append("PresignedUrlConfig: ").append(getPresignedUrlConfig()).append(","); if (getJobExecutionsRolloutConfig() != null) sb.append("JobExecutionsRolloutConfig: ").append(getJobExecutionsRolloutConfig()).append(","); if (getAbortConfig() != null) sb.append("AbortConfig: ").append(getAbortConfig()).append(","); if (getTimeoutConfig() != null) sb.append("TimeoutConfig: ").append(getTimeoutConfig()).append(","); if (getNamespaceId() != null) sb.append("NamespaceId: ").append(getNamespaceId()).append(","); if (getJobExecutionsRetryConfig() != null) sb.append("JobExecutionsRetryConfig: ").append(getJobExecutionsRetryConfig()); sb.append("}"); return sb.toString(); } @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; } @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 UpdateJobRequest clone() { return (UpdateJobRequest) super.clone(); } }