
com.amazonaws.services.imagebuilder.model.CreateWorkflowRequest Maven / Gradle / Ivy
/*
* Copyright 2019-2024 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.imagebuilder.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateWorkflowRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The name of the workflow to create.
*
*/
private String name;
/**
*
* The semantic version of this workflow resource. The semantic version syntax adheres to the following rules.
*
*
*
* The semantic version has four nodes: <major>.<minor>.<patch>/<build>. You can assign
* values for the first three, and can filter on all of them.
*
*
* Assignment: For the first three nodes you can assign any positive integer value, including zero, with an
* upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the build number to the
* fourth node.
*
*
* Patterns: You can use any numeric pattern that adheres to the assignment requirements for the nodes that
* you can assign. For example, you might choose a software version pattern, such as 1.0.0, or a date, such as
* 2021.01.01.
*
*
*/
private String semanticVersion;
/**
*
* Describes the workflow.
*
*/
private String description;
/**
*
* Describes what change has been made in this version of the workflow, or what makes this version different from
* other versions of the workflow.
*
*/
private String changeDescription;
/**
*
* Contains the UTF-8 encoded YAML document content for the workflow. Alternatively, you can specify the
* uri
of a YAML document file stored in Amazon S3. However, you cannot specify both properties.
*
*/
private String data;
/**
*
* The uri
of a YAML component document file. This must be an S3 URL (s3://bucket/key
),
* and the requester must have permission to access the S3 bucket it points to. If you use Amazon S3, you can
* specify component content up to your service quota.
*
*
* Alternatively, you can specify the YAML document inline, using the component data
property. You
* cannot specify both properties.
*
*/
private String uri;
/**
*
* The ID of the KMS key that is used to encrypt this workflow resource.
*
*/
private String kmsKeyId;
/**
*
* Tags that apply to the workflow resource.
*
*/
private java.util.Map tags;
/**
*
* Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see Ensuring
* idempotency in the Amazon EC2 API Reference.
*
*/
private String clientToken;
/**
*
* The phase in the image build process for which the workflow resource is responsible.
*
*/
private String type;
/**
*
* The name of the workflow to create.
*
*
* @param name
* The name of the workflow to create.
*/
public void setName(String name) {
this.name = name;
}
/**
*
* The name of the workflow to create.
*
*
* @return The name of the workflow to create.
*/
public String getName() {
return this.name;
}
/**
*
* The name of the workflow to create.
*
*
* @param name
* The name of the workflow to create.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateWorkflowRequest withName(String name) {
setName(name);
return this;
}
/**
*
* The semantic version of this workflow resource. The semantic version syntax adheres to the following rules.
*
*
*
* The semantic version has four nodes: <major>.<minor>.<patch>/<build>. You can assign
* values for the first three, and can filter on all of them.
*
*
* Assignment: For the first three nodes you can assign any positive integer value, including zero, with an
* upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the build number to the
* fourth node.
*
*
* Patterns: You can use any numeric pattern that adheres to the assignment requirements for the nodes that
* you can assign. For example, you might choose a software version pattern, such as 1.0.0, or a date, such as
* 2021.01.01.
*
*
*
* @param semanticVersion
* The semantic version of this workflow resource. The semantic version syntax adheres to the following
* rules.
*
* The semantic version has four nodes: <major>.<minor>.<patch>/<build>. You can
* assign values for the first three, and can filter on all of them.
*
*
* Assignment: For the first three nodes you can assign any positive integer value, including zero,
* with an upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the build
* number to the fourth node.
*
*
* Patterns: You can use any numeric pattern that adheres to the assignment requirements for the nodes
* that you can assign. For example, you might choose a software version pattern, such as 1.0.0, or a date,
* such as 2021.01.01.
*
*/
public void setSemanticVersion(String semanticVersion) {
this.semanticVersion = semanticVersion;
}
/**
*
* The semantic version of this workflow resource. The semantic version syntax adheres to the following rules.
*
*
*
* The semantic version has four nodes: <major>.<minor>.<patch>/<build>. You can assign
* values for the first three, and can filter on all of them.
*
*
* Assignment: For the first three nodes you can assign any positive integer value, including zero, with an
* upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the build number to the
* fourth node.
*
*
* Patterns: You can use any numeric pattern that adheres to the assignment requirements for the nodes that
* you can assign. For example, you might choose a software version pattern, such as 1.0.0, or a date, such as
* 2021.01.01.
*
*
*
* @return The semantic version of this workflow resource. The semantic version syntax adheres to the following
* rules.
*
* The semantic version has four nodes: <major>.<minor>.<patch>/<build>. You can
* assign values for the first three, and can filter on all of them.
*
*
* Assignment: For the first three nodes you can assign any positive integer value, including zero,
* with an upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the build
* number to the fourth node.
*
*
* Patterns: You can use any numeric pattern that adheres to the assignment requirements for the
* nodes that you can assign. For example, you might choose a software version pattern, such as 1.0.0, or a
* date, such as 2021.01.01.
*
*/
public String getSemanticVersion() {
return this.semanticVersion;
}
/**
*
* The semantic version of this workflow resource. The semantic version syntax adheres to the following rules.
*
*
*
* The semantic version has four nodes: <major>.<minor>.<patch>/<build>. You can assign
* values for the first three, and can filter on all of them.
*
*
* Assignment: For the first three nodes you can assign any positive integer value, including zero, with an
* upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the build number to the
* fourth node.
*
*
* Patterns: You can use any numeric pattern that adheres to the assignment requirements for the nodes that
* you can assign. For example, you might choose a software version pattern, such as 1.0.0, or a date, such as
* 2021.01.01.
*
*
*
* @param semanticVersion
* The semantic version of this workflow resource. The semantic version syntax adheres to the following
* rules.
*
* The semantic version has four nodes: <major>.<minor>.<patch>/<build>. You can
* assign values for the first three, and can filter on all of them.
*
*
* Assignment: For the first three nodes you can assign any positive integer value, including zero,
* with an upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the build
* number to the fourth node.
*
*
* Patterns: You can use any numeric pattern that adheres to the assignment requirements for the nodes
* that you can assign. For example, you might choose a software version pattern, such as 1.0.0, or a date,
* such as 2021.01.01.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateWorkflowRequest withSemanticVersion(String semanticVersion) {
setSemanticVersion(semanticVersion);
return this;
}
/**
*
* Describes the workflow.
*
*
* @param description
* Describes the workflow.
*/
public void setDescription(String description) {
this.description = description;
}
/**
*
* Describes the workflow.
*
*
* @return Describes the workflow.
*/
public String getDescription() {
return this.description;
}
/**
*
* Describes the workflow.
*
*
* @param description
* Describes the workflow.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateWorkflowRequest withDescription(String description) {
setDescription(description);
return this;
}
/**
*
* Describes what change has been made in this version of the workflow, or what makes this version different from
* other versions of the workflow.
*
*
* @param changeDescription
* Describes what change has been made in this version of the workflow, or what makes this version different
* from other versions of the workflow.
*/
public void setChangeDescription(String changeDescription) {
this.changeDescription = changeDescription;
}
/**
*
* Describes what change has been made in this version of the workflow, or what makes this version different from
* other versions of the workflow.
*
*
* @return Describes what change has been made in this version of the workflow, or what makes this version different
* from other versions of the workflow.
*/
public String getChangeDescription() {
return this.changeDescription;
}
/**
*
* Describes what change has been made in this version of the workflow, or what makes this version different from
* other versions of the workflow.
*
*
* @param changeDescription
* Describes what change has been made in this version of the workflow, or what makes this version different
* from other versions of the workflow.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateWorkflowRequest withChangeDescription(String changeDescription) {
setChangeDescription(changeDescription);
return this;
}
/**
*
* Contains the UTF-8 encoded YAML document content for the workflow. Alternatively, you can specify the
* uri
of a YAML document file stored in Amazon S3. However, you cannot specify both properties.
*
*
* @param data
* Contains the UTF-8 encoded YAML document content for the workflow. Alternatively, you can specify the
* uri
of a YAML document file stored in Amazon S3. However, you cannot specify both properties.
*/
public void setData(String data) {
this.data = data;
}
/**
*
* Contains the UTF-8 encoded YAML document content for the workflow. Alternatively, you can specify the
* uri
of a YAML document file stored in Amazon S3. However, you cannot specify both properties.
*
*
* @return Contains the UTF-8 encoded YAML document content for the workflow. Alternatively, you can specify the
* uri
of a YAML document file stored in Amazon S3. However, you cannot specify both
* properties.
*/
public String getData() {
return this.data;
}
/**
*
* Contains the UTF-8 encoded YAML document content for the workflow. Alternatively, you can specify the
* uri
of a YAML document file stored in Amazon S3. However, you cannot specify both properties.
*
*
* @param data
* Contains the UTF-8 encoded YAML document content for the workflow. Alternatively, you can specify the
* uri
of a YAML document file stored in Amazon S3. However, you cannot specify both properties.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateWorkflowRequest withData(String data) {
setData(data);
return this;
}
/**
*
* The uri
of a YAML component document file. This must be an S3 URL (s3://bucket/key
),
* and the requester must have permission to access the S3 bucket it points to. If you use Amazon S3, you can
* specify component content up to your service quota.
*
*
* Alternatively, you can specify the YAML document inline, using the component data
property. You
* cannot specify both properties.
*
*
* @param uri
* The uri
of a YAML component document file. This must be an S3 URL (
* s3://bucket/key
), and the requester must have permission to access the S3 bucket it points
* to. If you use Amazon S3, you can specify component content up to your service quota.
*
* Alternatively, you can specify the YAML document inline, using the component data
property.
* You cannot specify both properties.
*/
public void setUri(String uri) {
this.uri = uri;
}
/**
*
* The uri
of a YAML component document file. This must be an S3 URL (s3://bucket/key
),
* and the requester must have permission to access the S3 bucket it points to. If you use Amazon S3, you can
* specify component content up to your service quota.
*
*
* Alternatively, you can specify the YAML document inline, using the component data
property. You
* cannot specify both properties.
*
*
* @return The uri
of a YAML component document file. This must be an S3 URL (
* s3://bucket/key
), and the requester must have permission to access the S3 bucket it points
* to. If you use Amazon S3, you can specify component content up to your service quota.
*
* Alternatively, you can specify the YAML document inline, using the component data
property.
* You cannot specify both properties.
*/
public String getUri() {
return this.uri;
}
/**
*
* The uri
of a YAML component document file. This must be an S3 URL (s3://bucket/key
),
* and the requester must have permission to access the S3 bucket it points to. If you use Amazon S3, you can
* specify component content up to your service quota.
*
*
* Alternatively, you can specify the YAML document inline, using the component data
property. You
* cannot specify both properties.
*
*
* @param uri
* The uri
of a YAML component document file. This must be an S3 URL (
* s3://bucket/key
), and the requester must have permission to access the S3 bucket it points
* to. If you use Amazon S3, you can specify component content up to your service quota.
*
* Alternatively, you can specify the YAML document inline, using the component data
property.
* You cannot specify both properties.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateWorkflowRequest withUri(String uri) {
setUri(uri);
return this;
}
/**
*
* The ID of the KMS key that is used to encrypt this workflow resource.
*
*
* @param kmsKeyId
* The ID of the KMS key that is used to encrypt this workflow resource.
*/
public void setKmsKeyId(String kmsKeyId) {
this.kmsKeyId = kmsKeyId;
}
/**
*
* The ID of the KMS key that is used to encrypt this workflow resource.
*
*
* @return The ID of the KMS key that is used to encrypt this workflow resource.
*/
public String getKmsKeyId() {
return this.kmsKeyId;
}
/**
*
* The ID of the KMS key that is used to encrypt this workflow resource.
*
*
* @param kmsKeyId
* The ID of the KMS key that is used to encrypt this workflow resource.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateWorkflowRequest withKmsKeyId(String kmsKeyId) {
setKmsKeyId(kmsKeyId);
return this;
}
/**
*
* Tags that apply to the workflow resource.
*
*
* @return Tags that apply to the workflow resource.
*/
public java.util.Map getTags() {
return tags;
}
/**
*
* Tags that apply to the workflow resource.
*
*
* @param tags
* Tags that apply to the workflow resource.
*/
public void setTags(java.util.Map tags) {
this.tags = tags;
}
/**
*
* Tags that apply to the workflow resource.
*
*
* @param tags
* Tags that apply to the workflow resource.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateWorkflowRequest withTags(java.util.Map tags) {
setTags(tags);
return this;
}
/**
* Add a single Tags entry
*
* @see CreateWorkflowRequest#withTags
* @returns a reference to this object so that method calls can be chained together.
*/
public CreateWorkflowRequest addTagsEntry(String key, String value) {
if (null == this.tags) {
this.tags = new java.util.HashMap();
}
if (this.tags.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.tags.put(key, value);
return this;
}
/**
* Removes all the entries added into Tags.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateWorkflowRequest clearTagsEntries() {
this.tags = null;
return this;
}
/**
*
* Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see Ensuring
* idempotency in the Amazon EC2 API Reference.
*
*
* @param clientToken
* Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information,
* see Ensuring
* idempotency in the Amazon EC2 API Reference.
*/
public void setClientToken(String clientToken) {
this.clientToken = clientToken;
}
/**
*
* Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see Ensuring
* idempotency in the Amazon EC2 API Reference.
*
*
* @return Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information,
* see Ensuring
* idempotency in the Amazon EC2 API Reference.
*/
public String getClientToken() {
return this.clientToken;
}
/**
*
* Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see Ensuring
* idempotency in the Amazon EC2 API Reference.
*
*
* @param clientToken
* Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information,
* see Ensuring
* idempotency in the Amazon EC2 API Reference.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateWorkflowRequest withClientToken(String clientToken) {
setClientToken(clientToken);
return this;
}
/**
*
* The phase in the image build process for which the workflow resource is responsible.
*
*
* @param type
* The phase in the image build process for which the workflow resource is responsible.
* @see WorkflowType
*/
public void setType(String type) {
this.type = type;
}
/**
*
* The phase in the image build process for which the workflow resource is responsible.
*
*
* @return The phase in the image build process for which the workflow resource is responsible.
* @see WorkflowType
*/
public String getType() {
return this.type;
}
/**
*
* The phase in the image build process for which the workflow resource is responsible.
*
*
* @param type
* The phase in the image build process for which the workflow resource is responsible.
* @return Returns a reference to this object so that method calls can be chained together.
* @see WorkflowType
*/
public CreateWorkflowRequest withType(String type) {
setType(type);
return this;
}
/**
*
* The phase in the image build process for which the workflow resource is responsible.
*
*
* @param type
* The phase in the image build process for which the workflow resource is responsible.
* @return Returns a reference to this object so that method calls can be chained together.
* @see WorkflowType
*/
public CreateWorkflowRequest withType(WorkflowType type) {
this.type = type.toString();
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 (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getSemanticVersion() != null)
sb.append("SemanticVersion: ").append(getSemanticVersion()).append(",");
if (getDescription() != null)
sb.append("Description: ").append(getDescription()).append(",");
if (getChangeDescription() != null)
sb.append("ChangeDescription: ").append(getChangeDescription()).append(",");
if (getData() != null)
sb.append("Data: ").append(getData()).append(",");
if (getUri() != null)
sb.append("Uri: ").append(getUri()).append(",");
if (getKmsKeyId() != null)
sb.append("KmsKeyId: ").append(getKmsKeyId()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags()).append(",");
if (getClientToken() != null)
sb.append("ClientToken: ").append(getClientToken()).append(",");
if (getType() != null)
sb.append("Type: ").append(getType());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateWorkflowRequest == false)
return false;
CreateWorkflowRequest other = (CreateWorkflowRequest) obj;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getSemanticVersion() == null ^ this.getSemanticVersion() == null)
return false;
if (other.getSemanticVersion() != null && other.getSemanticVersion().equals(this.getSemanticVersion()) == 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.getChangeDescription() == null ^ this.getChangeDescription() == null)
return false;
if (other.getChangeDescription() != null && other.getChangeDescription().equals(this.getChangeDescription()) == false)
return false;
if (other.getData() == null ^ this.getData() == null)
return false;
if (other.getData() != null && other.getData().equals(this.getData()) == false)
return false;
if (other.getUri() == null ^ this.getUri() == null)
return false;
if (other.getUri() != null && other.getUri().equals(this.getUri()) == false)
return false;
if (other.getKmsKeyId() == null ^ this.getKmsKeyId() == null)
return false;
if (other.getKmsKeyId() != null && other.getKmsKeyId().equals(this.getKmsKeyId()) == false)
return false;
if (other.getTags() == null ^ this.getTags() == null)
return false;
if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
return false;
if (other.getClientToken() == null ^ this.getClientToken() == null)
return false;
if (other.getClientToken() != null && other.getClientToken().equals(this.getClientToken()) == false)
return false;
if (other.getType() == null ^ this.getType() == null)
return false;
if (other.getType() != null && other.getType().equals(this.getType()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getSemanticVersion() == null) ? 0 : getSemanticVersion().hashCode());
hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode());
hashCode = prime * hashCode + ((getChangeDescription() == null) ? 0 : getChangeDescription().hashCode());
hashCode = prime * hashCode + ((getData() == null) ? 0 : getData().hashCode());
hashCode = prime * hashCode + ((getUri() == null) ? 0 : getUri().hashCode());
hashCode = prime * hashCode + ((getKmsKeyId() == null) ? 0 : getKmsKeyId().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode());
hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode());
return hashCode;
}
@Override
public CreateWorkflowRequest clone() {
return (CreateWorkflowRequest) super.clone();
}
}