software.amazon.awsconstructs.services.constructsfactories.StateMachineFactoryProps Maven / Gradle / Ivy
package software.amazon.awsconstructs.services.constructsfactories;
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-18T13:39:27.727Z")
@software.amazon.jsii.Jsii(module = software.amazon.awsconstructs.services.constructsfactories.$Module.class, fqn = "@aws-solutions-constructs/aws-constructs-factories.StateMachineFactoryProps")
@software.amazon.jsii.Jsii.Proxy(StateMachineFactoryProps.Jsii$Proxy.class)
public interface StateMachineFactoryProps extends software.amazon.jsii.JsiiSerializable {
/**
* The CDK properties that define the state machine.
*
* This property is required and
* must include a definitionBody or definition (definition is deprecated)
*/
@org.jetbrains.annotations.NotNull software.amazon.awscdk.services.stepfunctions.StateMachineProps getStateMachineProps();
/**
* Creating multiple State Machines in 1 stack with constructs will result in name collisions as the cloudwatch alarms originally had fixed resource ids.
*
* This value was added to avoid collisions while not making changes that would be
* destructive for existing stacks. Unless you are creating multiple State Machines using constructs
* you can ignore it.
*
* Default: - undefined
*/
default @org.jetbrains.annotations.Nullable java.lang.String getCloudWatchAlarmsPrefix() {
return null;
}
/**
* Whether to create recommended CloudWatch alarms.
*
* Default: - Alarms are created
*/
default @org.jetbrains.annotations.Nullable java.lang.Boolean getCreateCloudWatchAlarms() {
return null;
}
/**
* An existing LogGroup to which the new state machine will write log entries.
*
* Default: none, the construct will create a new log group.
*/
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.logs.LogGroupProps getLogGroupProps() {
return null;
}
/**
* @return a {@link Builder} of {@link StateMachineFactoryProps}
*/
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link StateMachineFactoryProps}
*/
public static final class Builder implements software.amazon.jsii.Builder {
software.amazon.awscdk.services.stepfunctions.StateMachineProps stateMachineProps;
java.lang.String cloudWatchAlarmsPrefix;
java.lang.Boolean createCloudWatchAlarms;
software.amazon.awscdk.services.logs.LogGroupProps logGroupProps;
/**
* Sets the value of {@link StateMachineFactoryProps#getStateMachineProps}
* @param stateMachineProps The CDK properties that define the state machine. This parameter is required.
* This property is required and
* must include a definitionBody or definition (definition is deprecated)
* @return {@code this}
*/
public Builder stateMachineProps(software.amazon.awscdk.services.stepfunctions.StateMachineProps stateMachineProps) {
this.stateMachineProps = stateMachineProps;
return this;
}
/**
* Sets the value of {@link StateMachineFactoryProps#getCloudWatchAlarmsPrefix}
* @param cloudWatchAlarmsPrefix Creating multiple State Machines in 1 stack with constructs will result in name collisions as the cloudwatch alarms originally had fixed resource ids.
* This value was added to avoid collisions while not making changes that would be
* destructive for existing stacks. Unless you are creating multiple State Machines using constructs
* you can ignore it.
* @return {@code this}
*/
public Builder cloudWatchAlarmsPrefix(java.lang.String cloudWatchAlarmsPrefix) {
this.cloudWatchAlarmsPrefix = cloudWatchAlarmsPrefix;
return this;
}
/**
* Sets the value of {@link StateMachineFactoryProps#getCreateCloudWatchAlarms}
* @param createCloudWatchAlarms Whether to create recommended CloudWatch alarms.
* @return {@code this}
*/
public Builder createCloudWatchAlarms(java.lang.Boolean createCloudWatchAlarms) {
this.createCloudWatchAlarms = createCloudWatchAlarms;
return this;
}
/**
* Sets the value of {@link StateMachineFactoryProps#getLogGroupProps}
* @param logGroupProps An existing LogGroup to which the new state machine will write log entries.
* Default: none, the construct will create a new log group.
* @return {@code this}
*/
public Builder logGroupProps(software.amazon.awscdk.services.logs.LogGroupProps logGroupProps) {
this.logGroupProps = logGroupProps;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link StateMachineFactoryProps}
* @throws NullPointerException if any required attribute was not provided
*/
@Override
public StateMachineFactoryProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link StateMachineFactoryProps}
*/
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements StateMachineFactoryProps {
private final software.amazon.awscdk.services.stepfunctions.StateMachineProps stateMachineProps;
private final java.lang.String cloudWatchAlarmsPrefix;
private final java.lang.Boolean createCloudWatchAlarms;
private final software.amazon.awscdk.services.logs.LogGroupProps logGroupProps;
/**
* Constructor that initializes the object based on values retrieved from the JsiiObject.
* @param objRef Reference to the JSII managed object.
*/
protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
this.stateMachineProps = software.amazon.jsii.Kernel.get(this, "stateMachineProps", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.stepfunctions.StateMachineProps.class));
this.cloudWatchAlarmsPrefix = software.amazon.jsii.Kernel.get(this, "cloudWatchAlarmsPrefix", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.createCloudWatchAlarms = software.amazon.jsii.Kernel.get(this, "createCloudWatchAlarms", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.logGroupProps = software.amazon.jsii.Kernel.get(this, "logGroupProps", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.logs.LogGroupProps.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.stateMachineProps = java.util.Objects.requireNonNull(builder.stateMachineProps, "stateMachineProps is required");
this.cloudWatchAlarmsPrefix = builder.cloudWatchAlarmsPrefix;
this.createCloudWatchAlarms = builder.createCloudWatchAlarms;
this.logGroupProps = builder.logGroupProps;
}
@Override
public final software.amazon.awscdk.services.stepfunctions.StateMachineProps getStateMachineProps() {
return this.stateMachineProps;
}
@Override
public final java.lang.String getCloudWatchAlarmsPrefix() {
return this.cloudWatchAlarmsPrefix;
}
@Override
public final java.lang.Boolean getCreateCloudWatchAlarms() {
return this.createCloudWatchAlarms;
}
@Override
public final software.amazon.awscdk.services.logs.LogGroupProps getLogGroupProps() {
return this.logGroupProps;
}
@Override
@software.amazon.jsii.Internal
public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() {
final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE;
final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
data.set("stateMachineProps", om.valueToTree(this.getStateMachineProps()));
if (this.getCloudWatchAlarmsPrefix() != null) {
data.set("cloudWatchAlarmsPrefix", om.valueToTree(this.getCloudWatchAlarmsPrefix()));
}
if (this.getCreateCloudWatchAlarms() != null) {
data.set("createCloudWatchAlarms", om.valueToTree(this.getCreateCloudWatchAlarms()));
}
if (this.getLogGroupProps() != null) {
data.set("logGroupProps", om.valueToTree(this.getLogGroupProps()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@aws-solutions-constructs/aws-constructs-factories.StateMachineFactoryProps"));
struct.set("data", data);
final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
obj.set("$jsii.struct", struct);
return obj;
}
@Override
public final boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
StateMachineFactoryProps.Jsii$Proxy that = (StateMachineFactoryProps.Jsii$Proxy) o;
if (!stateMachineProps.equals(that.stateMachineProps)) return false;
if (this.cloudWatchAlarmsPrefix != null ? !this.cloudWatchAlarmsPrefix.equals(that.cloudWatchAlarmsPrefix) : that.cloudWatchAlarmsPrefix != null) return false;
if (this.createCloudWatchAlarms != null ? !this.createCloudWatchAlarms.equals(that.createCloudWatchAlarms) : that.createCloudWatchAlarms != null) return false;
return this.logGroupProps != null ? this.logGroupProps.equals(that.logGroupProps) : that.logGroupProps == null;
}
@Override
public final int hashCode() {
int result = this.stateMachineProps.hashCode();
result = 31 * result + (this.cloudWatchAlarmsPrefix != null ? this.cloudWatchAlarmsPrefix.hashCode() : 0);
result = 31 * result + (this.createCloudWatchAlarms != null ? this.createCloudWatchAlarms.hashCode() : 0);
result = 31 * result + (this.logGroupProps != null ? this.logGroupProps.hashCode() : 0);
return result;
}
}
}