/* * 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.stepfunctions.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 CreateStateMachineRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *

* The name of the state machine. *

*

* A name must not contain: *

* *

* To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z, a-z, - and _. *

*/ private String name; /** *

* The Amazon States Language definition of the state machine. See Amazon States * Language. *

*/ private String definition; /** *

* The Amazon Resource Name (ARN) of the IAM role to use for this state machine. *

*/ private String roleArn; /** *

* Determines whether a Standard or Express state machine is created. The default is STANDARD. You * cannot update the type of a state machine once it has been created. *

*/ private String type; /** *

* Defines what execution history events are logged and where they are logged. *

* *

* By default, the level is set to OFF. For more information see Log Levels in the Step * Functions User Guide. *

*
*/ private LoggingConfiguration loggingConfiguration; /** *

* Tags to be added when creating a state machine. *

*

* An array of key-value pairs. For more information, see Using Cost Allocation * Tags in the Amazon Web Services Billing and Cost Management User Guide, and Controlling Access Using IAM * Tags. *

*

* Tags may only contain Unicode letters, digits, white space, or these symbols: _ . : / = + - @. *

*/ private java.util.List tags; /** *

* Selects whether X-Ray tracing is enabled. *

*/ private TracingConfiguration tracingConfiguration; /** *

* Set to true to publish the first version of the state machine during creation. The default is * false. *

*/ private Boolean publish; /** *

* Sets description about the state machine version. You can only set the description if the publish * parameter is set to true. Otherwise, if you set versionDescription, but * publish to false, this API action throws ValidationException. *

*/ private String versionDescription; /** *

* The name of the state machine. *

*

* A name must not contain: *

* *

* To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z, a-z, - and _. *

* * @param name * The name of the state machine.

*

* A name must not contain: *

* *

* To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z, a-z, - and _. */ public void setName(String name) { this.name = name; } /** *

* The name of the state machine. *

*

* A name must not contain: *

* *

* To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z, a-z, - and _. *

* * @return The name of the state machine.

*

* A name must not contain: *

* *

* To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z, a-z, - and _. */ public String getName() { return this.name; } /** *

* The name of the state machine. *

*

* A name must not contain: *

* *

* To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z, a-z, - and _. *

* * @param name * The name of the state machine.

*

* A name must not contain: *

* *

* To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z, a-z, - and _. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateStateMachineRequest withName(String name) { setName(name); return this; } /** *

* The Amazon States Language definition of the state machine. See Amazon States * Language. *

* * @param definition * The Amazon States Language definition of the state machine. See Amazon * States Language. */ public void setDefinition(String definition) { this.definition = definition; } /** *

* The Amazon States Language definition of the state machine. See Amazon States * Language. *

* * @return The Amazon States Language definition of the state machine. See Amazon * States Language. */ public String getDefinition() { return this.definition; } /** *

* The Amazon States Language definition of the state machine. See Amazon States * Language. *

* * @param definition * The Amazon States Language definition of the state machine. See Amazon * States Language. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateStateMachineRequest withDefinition(String definition) { setDefinition(definition); return this; } /** *

* The Amazon States Language definition of the state machine. See Amazon States * Language. *

* * @param definition * The Amazon States Language definition of the state machine. See Amazon * States Language. */ public void setDefinition(com.amazonaws.services.stepfunctions.builder.StateMachine definition) { setDefinition(new com.amazonaws.services.stepfunctions.builder.StateMachineAdapter().adapt(definition)); } /** *

* The Amazon States Language definition of the state machine. See Amazon States * Language. *

* * @param definition * The Amazon States Language definition of the state machine. See Amazon * States Language. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateStateMachineRequest withDefinition(com.amazonaws.services.stepfunctions.builder.StateMachine definition) { setDefinition(new com.amazonaws.services.stepfunctions.builder.StateMachineAdapter().adapt(definition)); return this; } /** *

* The Amazon Resource Name (ARN) of the IAM role to use for this state machine. *

* * @param roleArn * The Amazon Resource Name (ARN) of the IAM role to use for this state machine. */ public void setRoleArn(String roleArn) { this.roleArn = roleArn; } /** *

* The Amazon Resource Name (ARN) of the IAM role to use for this state machine. *

* * @return The Amazon Resource Name (ARN) of the IAM role to use for this state machine. */ public String getRoleArn() { return this.roleArn; } /** *

* The Amazon Resource Name (ARN) of the IAM role to use for this state machine. *

* * @param roleArn * The Amazon Resource Name (ARN) of the IAM role to use for this state machine. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateStateMachineRequest withRoleArn(String roleArn) { setRoleArn(roleArn); return this; } /** *

* Determines whether a Standard or Express state machine is created. The default is STANDARD. You * cannot update the type of a state machine once it has been created. *

* * @param type * Determines whether a Standard or Express state machine is created. The default is STANDARD. * You cannot update the type of a state machine once it has been created. * @see StateMachineType */ public void setType(String type) { this.type = type; } /** *

* Determines whether a Standard or Express state machine is created. The default is STANDARD. You * cannot update the type of a state machine once it has been created. *

* * @return Determines whether a Standard or Express state machine is created. The default is STANDARD. * You cannot update the type of a state machine once it has been created. * @see StateMachineType */ public String getType() { return this.type; } /** *

* Determines whether a Standard or Express state machine is created. The default is STANDARD. You * cannot update the type of a state machine once it has been created. *

* * @param type * Determines whether a Standard or Express state machine is created. The default is STANDARD. * You cannot update the type of a state machine once it has been created. * @return Returns a reference to this object so that method calls can be chained together. * @see StateMachineType */ public CreateStateMachineRequest withType(String type) { setType(type); return this; } /** *

* Determines whether a Standard or Express state machine is created. The default is STANDARD. You * cannot update the type of a state machine once it has been created. *

* * @param type * Determines whether a Standard or Express state machine is created. The default is STANDARD. * You cannot update the type of a state machine once it has been created. * @return Returns a reference to this object so that method calls can be chained together. * @see StateMachineType */ public CreateStateMachineRequest withType(StateMachineType type) { this.type = type.toString(); return this; } /** *

* Defines what execution history events are logged and where they are logged. *

* *

* By default, the level is set to OFF. For more information see Log Levels in the Step * Functions User Guide. *

*
* * @param loggingConfiguration * Defines what execution history events are logged and where they are logged.

*

* By default, the level is set to OFF. For more information see Log Levels in * the Step Functions User Guide. *

*/ public void setLoggingConfiguration(LoggingConfiguration loggingConfiguration) { this.loggingConfiguration = loggingConfiguration; } /** *

* Defines what execution history events are logged and where they are logged. *

* *

* By default, the level is set to OFF. For more information see Log Levels in the Step * Functions User Guide. *

*
* * @return Defines what execution history events are logged and where they are logged.

*

* By default, the level is set to OFF. For more information see Log Levels in * the Step Functions User Guide. *

*/ public LoggingConfiguration getLoggingConfiguration() { return this.loggingConfiguration; } /** *

* Defines what execution history events are logged and where they are logged. *

* *

* By default, the level is set to OFF. For more information see Log Levels in the Step * Functions User Guide. *

*
* * @param loggingConfiguration * Defines what execution history events are logged and where they are logged.

*

* By default, the level is set to OFF. For more information see Log Levels in * the Step Functions User Guide. *

* @return Returns a reference to this object so that method calls can be chained together. */ public CreateStateMachineRequest withLoggingConfiguration(LoggingConfiguration loggingConfiguration) { setLoggingConfiguration(loggingConfiguration); return this; } /** *

* Tags to be added when creating a state machine. *

*

* An array of key-value pairs. For more information, see Using Cost Allocation * Tags in the Amazon Web Services Billing and Cost Management User Guide, and Controlling Access Using IAM * Tags. *

*

* Tags may only contain Unicode letters, digits, white space, or these symbols: _ . : / = + - @. *

* * @return Tags to be added when creating a state machine.

*

* An array of key-value pairs. For more information, see Using Cost * Allocation Tags in the Amazon Web Services Billing and Cost Management User Guide, and Controlling Access Using IAM * Tags. *

*

* Tags may only contain Unicode letters, digits, white space, or these symbols: * _ . : / = + - @. */ public java.util.List getTags() { return tags; } /** *

* Tags to be added when creating a state machine. *

*

* An array of key-value pairs. For more information, see Using Cost Allocation * Tags in the Amazon Web Services Billing and Cost Management User Guide, and Controlling Access Using IAM * Tags. *

*

* Tags may only contain Unicode letters, digits, white space, or these symbols: _ . : / = + - @. *

* * @param tags * Tags to be added when creating a state machine.

*

* An array of key-value pairs. For more information, see Using Cost * Allocation Tags in the Amazon Web Services Billing and Cost Management User Guide, and Controlling Access Using IAM * Tags. *

*

* Tags may only contain Unicode letters, digits, white space, or these symbols: _ . : / = + - @. */ public void setTags(java.util.Collection tags) { if (tags == null) { this.tags = null; return; } this.tags = new java.util.ArrayList(tags); } /** *

* Tags to be added when creating a state machine. *

*

* An array of key-value pairs. For more information, see Using Cost Allocation * Tags in the Amazon Web Services Billing and Cost Management User Guide, and Controlling Access Using IAM * Tags. *

*

* Tags may only contain Unicode letters, digits, white space, or these symbols: _ . : / = + - @. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the * existing values. *

* * @param tags * Tags to be added when creating a state machine.

*

* An array of key-value pairs. For more information, see Using Cost * Allocation Tags in the Amazon Web Services Billing and Cost Management User Guide, and Controlling Access Using IAM * Tags. *

*

* Tags may only contain Unicode letters, digits, white space, or these symbols: _ . : / = + - @. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateStateMachineRequest withTags(Tag... tags) { if (this.tags == null) { setTags(new java.util.ArrayList(tags.length)); } for (Tag ele : tags) { this.tags.add(ele); } return this; } /** *

* Tags to be added when creating a state machine. *

*

* An array of key-value pairs. For more information, see Using Cost Allocation * Tags in the Amazon Web Services Billing and Cost Management User Guide, and Controlling Access Using IAM * Tags. *

*

* Tags may only contain Unicode letters, digits, white space, or these symbols: _ . : / = + - @. *

* * @param tags * Tags to be added when creating a state machine.

*

* An array of key-value pairs. For more information, see Using Cost * Allocation Tags in the Amazon Web Services Billing and Cost Management User Guide, and Controlling Access Using IAM * Tags. *

*

* Tags may only contain Unicode letters, digits, white space, or these symbols: _ . : / = + - @. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateStateMachineRequest withTags(java.util.Collection tags) { setTags(tags); return this; } /** *

* Selects whether X-Ray tracing is enabled. *

* * @param tracingConfiguration * Selects whether X-Ray tracing is enabled. */ public void setTracingConfiguration(TracingConfiguration tracingConfiguration) { this.tracingConfiguration = tracingConfiguration; } /** *

* Selects whether X-Ray tracing is enabled. *

* * @return Selects whether X-Ray tracing is enabled. */ public TracingConfiguration getTracingConfiguration() { return this.tracingConfiguration; } /** *

* Selects whether X-Ray tracing is enabled. *

* * @param tracingConfiguration * Selects whether X-Ray tracing is enabled. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateStateMachineRequest withTracingConfiguration(TracingConfiguration tracingConfiguration) { setTracingConfiguration(tracingConfiguration); return this; } /** *

* Set to true to publish the first version of the state machine during creation. The default is * false. *

* * @param publish * Set to true to publish the first version of the state machine during creation. The default is * false. */ public void setPublish(Boolean publish) { this.publish = publish; } /** *

* Set to true to publish the first version of the state machine during creation. The default is * false. *

* * @return Set to true to publish the first version of the state machine during creation. The default * is false. */ public Boolean getPublish() { return this.publish; } /** *

* Set to true to publish the first version of the state machine during creation. The default is * false. *

* * @param publish * Set to true to publish the first version of the state machine during creation. The default is * false. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateStateMachineRequest withPublish(Boolean publish) { setPublish(publish); return this; } /** *

* Set to true to publish the first version of the state machine during creation. The default is * false. *

* * @return Set to true to publish the first version of the state machine during creation. The default * is false. */ public Boolean isPublish() { return this.publish; } /** *

* Sets description about the state machine version. You can only set the description if the publish * parameter is set to true. Otherwise, if you set versionDescription, but * publish to false, this API action throws ValidationException. *

* * @param versionDescription * Sets description about the state machine version. You can only set the description if the * publish parameter is set to true. Otherwise, if you set * versionDescription, but publish to false, this API action throws * ValidationException. */ public void setVersionDescription(String versionDescription) { this.versionDescription = versionDescription; } /** *

* Sets description about the state machine version. You can only set the description if the publish * parameter is set to true. Otherwise, if you set versionDescription, but * publish to false, this API action throws ValidationException. *

* * @return Sets description about the state machine version. You can only set the description if the * publish parameter is set to true. Otherwise, if you set * versionDescription, but publish to false, this API action throws * ValidationException. */ public String getVersionDescription() { return this.versionDescription; } /** *

* Sets description about the state machine version. You can only set the description if the publish * parameter is set to true. Otherwise, if you set versionDescription, but * publish to false, this API action throws ValidationException. *

* * @param versionDescription * Sets description about the state machine version. You can only set the description if the * publish parameter is set to true. Otherwise, if you set * versionDescription, but publish to false, this API action throws * ValidationException. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateStateMachineRequest withVersionDescription(String versionDescription) { setVersionDescription(versionDescription); 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 (getDefinition() != null) sb.append("Definition: ").append("***Sensitive Data Redacted***").append(","); if (getRoleArn() != null) sb.append("RoleArn: ").append(getRoleArn()).append(","); if (getType() != null) sb.append("Type: ").append(getType()).append(","); if (getLoggingConfiguration() != null) sb.append("LoggingConfiguration: ").append(getLoggingConfiguration()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()).append(","); if (getTracingConfiguration() != null) sb.append("TracingConfiguration: ").append(getTracingConfiguration()).append(","); if (getPublish() != null) sb.append("Publish: ").append(getPublish()).append(","); if (getVersionDescription() != null) sb.append("VersionDescription: ").append("***Sensitive Data Redacted***"); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateStateMachineRequest == false) return false; CreateStateMachineRequest other = (CreateStateMachineRequest) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getDefinition() == null ^ this.getDefinition() == null) return false; if (other.getDefinition() != null && other.getDefinition().equals(this.getDefinition()) == false) return false; if (other.getRoleArn() == null ^ this.getRoleArn() == null) return false; if (other.getRoleArn() != null && other.getRoleArn().equals(this.getRoleArn()) == false) return false; if (other.getType() == null ^ this.getType() == null) return false; if (other.getType() != null && other.getType().equals(this.getType()) == false) return false; if (other.getLoggingConfiguration() == null ^ this.getLoggingConfiguration() == null) return false; if (other.getLoggingConfiguration() != null && other.getLoggingConfiguration().equals(this.getLoggingConfiguration()) == 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.getTracingConfiguration() == null ^ this.getTracingConfiguration() == null) return false; if (other.getTracingConfiguration() != null && other.getTracingConfiguration().equals(this.getTracingConfiguration()) == false) return false; if (other.getPublish() == null ^ this.getPublish() == null) return false; if (other.getPublish() != null && other.getPublish().equals(this.getPublish()) == false) return false; if (other.getVersionDescription() == null ^ this.getVersionDescription() == null) return false; if (other.getVersionDescription() != null && other.getVersionDescription().equals(this.getVersionDescription()) == 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 + ((getDefinition() == null) ? 0 : getDefinition().hashCode()); hashCode = prime * hashCode + ((getRoleArn() == null) ? 0 : getRoleArn().hashCode()); hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode()); hashCode = prime * hashCode + ((getLoggingConfiguration() == null) ? 0 : getLoggingConfiguration().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); hashCode = prime * hashCode + ((getTracingConfiguration() == null) ? 0 : getTracingConfiguration().hashCode()); hashCode = prime * hashCode + ((getPublish() == null) ? 0 : getPublish().hashCode()); hashCode = prime * hashCode + ((getVersionDescription() == null) ? 0 : getVersionDescription().hashCode()); return hashCode; } @Override public CreateStateMachineRequest clone() { return (CreateStateMachineRequest) super.clone(); } }