tags;
private CreateDeploymentStrategyRequest(BuilderImpl builder) {
super(builder);
this.name = builder.name;
this.description = builder.description;
this.deploymentDurationInMinutes = builder.deploymentDurationInMinutes;
this.finalBakeTimeInMinutes = builder.finalBakeTimeInMinutes;
this.growthFactor = builder.growthFactor;
this.growthType = builder.growthType;
this.replicateTo = builder.replicateTo;
this.tags = builder.tags;
}
/**
*
* A name for the deployment strategy.
*
*
* @return A name for the deployment strategy.
*/
public final String name() {
return name;
}
/**
*
* A description of the deployment strategy.
*
*
* @return A description of the deployment strategy.
*/
public final String description() {
return description;
}
/**
*
* Total amount of time for a deployment to last.
*
*
* @return Total amount of time for a deployment to last.
*/
public final Integer deploymentDurationInMinutes() {
return deploymentDurationInMinutes;
}
/**
*
* The amount of time AppConfig monitors for alarms before considering the deployment to be complete and no longer
* eligible for automatic roll back.
*
*
* @return The amount of time AppConfig monitors for alarms before considering the deployment to be complete and no
* longer eligible for automatic roll back.
*/
public final Integer finalBakeTimeInMinutes() {
return finalBakeTimeInMinutes;
}
/**
*
* The percentage of targets to receive a deployed configuration during each interval.
*
*
* @return The percentage of targets to receive a deployed configuration during each interval.
*/
public final Float growthFactor() {
return growthFactor;
}
/**
*
* The algorithm used to define how percentage grows over time. AWS AppConfig supports the following growth types:
*
*
* Linear : For this type, AppConfig processes the deployment by dividing the total number of targets by the
* value specified for Step percentage
. For example, a linear deployment that uses a
* Step percentage
of 10 deploys the configuration to 10 percent of the hosts. After those deployments
* are complete, the system deploys the configuration to the next 10 percent. This continues until 100% of the
* targets have successfully received the configuration.
*
*
* Exponential : For this type, AppConfig processes the deployment exponentially using the following formula:
* G*(2^N)
. In this formula, G
is the growth factor specified by the user and
* N
is the number of steps until the configuration is deployed to all targets. For example, if you
* specify a growth factor of 2, then the system rolls out the configuration as follows:
*
*
* 2*(2^0)
*
*
* 2*(2^1)
*
*
* 2*(2^2)
*
*
* Expressed numerically, the deployment rolls out as follows: 2% of the targets, 4% of the targets, 8% of the
* targets, and continues until the configuration has been deployed to all targets.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #growthType} will
* return {@link GrowthType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #growthTypeAsString}.
*
*
* @return The algorithm used to define how percentage grows over time. AWS AppConfig supports the following growth
* types:
*
* Linear : For this type, AppConfig processes the deployment by dividing the total number of targets
* by the value specified for Step percentage
. For example, a linear deployment that uses a
* Step percentage
of 10 deploys the configuration to 10 percent of the hosts. After those
* deployments are complete, the system deploys the configuration to the next 10 percent. This continues
* until 100% of the targets have successfully received the configuration.
*
*
* Exponential : For this type, AppConfig processes the deployment exponentially using the following
* formula: G*(2^N)
. In this formula, G
is the growth factor specified by the user
* and N
is the number of steps until the configuration is deployed to all targets. For
* example, if you specify a growth factor of 2, then the system rolls out the configuration as follows:
*
*
* 2*(2^0)
*
*
* 2*(2^1)
*
*
* 2*(2^2)
*
*
* Expressed numerically, the deployment rolls out as follows: 2% of the targets, 4% of the targets, 8% of
* the targets, and continues until the configuration has been deployed to all targets.
* @see GrowthType
*/
public final GrowthType growthType() {
return GrowthType.fromValue(growthType);
}
/**
*
* The algorithm used to define how percentage grows over time. AWS AppConfig supports the following growth types:
*
*
* Linear : For this type, AppConfig processes the deployment by dividing the total number of targets by the
* value specified for Step percentage
. For example, a linear deployment that uses a
* Step percentage
of 10 deploys the configuration to 10 percent of the hosts. After those deployments
* are complete, the system deploys the configuration to the next 10 percent. This continues until 100% of the
* targets have successfully received the configuration.
*
*
* Exponential : For this type, AppConfig processes the deployment exponentially using the following formula:
* G*(2^N)
. In this formula, G
is the growth factor specified by the user and
* N
is the number of steps until the configuration is deployed to all targets. For example, if you
* specify a growth factor of 2, then the system rolls out the configuration as follows:
*
*
* 2*(2^0)
*
*
* 2*(2^1)
*
*
* 2*(2^2)
*
*
* Expressed numerically, the deployment rolls out as follows: 2% of the targets, 4% of the targets, 8% of the
* targets, and continues until the configuration has been deployed to all targets.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #growthType} will
* return {@link GrowthType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #growthTypeAsString}.
*
*
* @return The algorithm used to define how percentage grows over time. AWS AppConfig supports the following growth
* types:
*
* Linear : For this type, AppConfig processes the deployment by dividing the total number of targets
* by the value specified for Step percentage
. For example, a linear deployment that uses a
* Step percentage
of 10 deploys the configuration to 10 percent of the hosts. After those
* deployments are complete, the system deploys the configuration to the next 10 percent. This continues
* until 100% of the targets have successfully received the configuration.
*
*
* Exponential : For this type, AppConfig processes the deployment exponentially using the following
* formula: G*(2^N)
. In this formula, G
is the growth factor specified by the user
* and N
is the number of steps until the configuration is deployed to all targets. For
* example, if you specify a growth factor of 2, then the system rolls out the configuration as follows:
*
*
* 2*(2^0)
*
*
* 2*(2^1)
*
*
* 2*(2^2)
*
*
* Expressed numerically, the deployment rolls out as follows: 2% of the targets, 4% of the targets, 8% of
* the targets, and continues until the configuration has been deployed to all targets.
* @see GrowthType
*/
public final String growthTypeAsString() {
return growthType;
}
/**
*
* Save the deployment strategy to a Systems Manager (SSM) document.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #replicateTo} will
* return {@link ReplicateTo#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #replicateToAsString}.
*
*
* @return Save the deployment strategy to a Systems Manager (SSM) document.
* @see ReplicateTo
*/
public final ReplicateTo replicateTo() {
return ReplicateTo.fromValue(replicateTo);
}
/**
*
* Save the deployment strategy to a Systems Manager (SSM) document.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #replicateTo} will
* return {@link ReplicateTo#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #replicateToAsString}.
*
*
* @return Save the deployment strategy to a Systems Manager (SSM) document.
* @see ReplicateTo
*/
public final String replicateToAsString() {
return replicateTo;
}
/**
* For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that
* the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful
* because the SDK will never return a null collection or map, but you may need to differentiate between the service
* returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true
* if a value for the property was specified in the request builder, and false if a value was not specified.
*/
public final boolean hasTags() {
return tags != null && !(tags instanceof SdkAutoConstructMap);
}
/**
*
* Metadata to assign to the deployment strategy. Tags help organize and categorize your AppConfig resources. Each
* tag consists of a key and an optional value, both of which you define.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasTags} method.
*
*
* @return Metadata to assign to the deployment strategy. Tags help organize and categorize your AppConfig
* resources. Each tag consists of a key and an optional value, both of which you define.
*/
public final Map tags() {
return tags;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(deploymentDurationInMinutes());
hashCode = 31 * hashCode + Objects.hashCode(finalBakeTimeInMinutes());
hashCode = 31 * hashCode + Objects.hashCode(growthFactor());
hashCode = 31 * hashCode + Objects.hashCode(growthTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(replicateToAsString());
hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null);
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof CreateDeploymentStrategyRequest)) {
return false;
}
CreateDeploymentStrategyRequest other = (CreateDeploymentStrategyRequest) obj;
return Objects.equals(name(), other.name()) && Objects.equals(description(), other.description())
&& Objects.equals(deploymentDurationInMinutes(), other.deploymentDurationInMinutes())
&& Objects.equals(finalBakeTimeInMinutes(), other.finalBakeTimeInMinutes())
&& Objects.equals(growthFactor(), other.growthFactor())
&& Objects.equals(growthTypeAsString(), other.growthTypeAsString())
&& Objects.equals(replicateToAsString(), other.replicateToAsString()) && hasTags() == other.hasTags()
&& Objects.equals(tags(), other.tags());
}
/**
* 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.
*/
@Override
public final String toString() {
return ToString.builder("CreateDeploymentStrategyRequest").add("Name", name()).add("Description", description())
.add("DeploymentDurationInMinutes", deploymentDurationInMinutes())
.add("FinalBakeTimeInMinutes", finalBakeTimeInMinutes()).add("GrowthFactor", growthFactor())
.add("GrowthType", growthTypeAsString()).add("ReplicateTo", replicateToAsString())
.add("Tags", hasTags() ? tags() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Name":
return Optional.ofNullable(clazz.cast(name()));
case "Description":
return Optional.ofNullable(clazz.cast(description()));
case "DeploymentDurationInMinutes":
return Optional.ofNullable(clazz.cast(deploymentDurationInMinutes()));
case "FinalBakeTimeInMinutes":
return Optional.ofNullable(clazz.cast(finalBakeTimeInMinutes()));
case "GrowthFactor":
return Optional.ofNullable(clazz.cast(growthFactor()));
case "GrowthType":
return Optional.ofNullable(clazz.cast(growthTypeAsString()));
case "ReplicateTo":
return Optional.ofNullable(clazz.cast(replicateToAsString()));
case "Tags":
return Optional.ofNullable(clazz.cast(tags()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((CreateDeploymentStrategyRequest) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends AppConfigRequest.Builder, SdkPojo, CopyableBuilder {
/**
*
* A name for the deployment strategy.
*
*
* @param name
* A name for the deployment strategy.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder name(String name);
/**
*
* A description of the deployment strategy.
*
*
* @param description
* A description of the deployment strategy.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder description(String description);
/**
*
* Total amount of time for a deployment to last.
*
*
* @param deploymentDurationInMinutes
* Total amount of time for a deployment to last.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder deploymentDurationInMinutes(Integer deploymentDurationInMinutes);
/**
*
* The amount of time AppConfig monitors for alarms before considering the deployment to be complete and no
* longer eligible for automatic roll back.
*
*
* @param finalBakeTimeInMinutes
* The amount of time AppConfig monitors for alarms before considering the deployment to be complete and
* no longer eligible for automatic roll back.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder finalBakeTimeInMinutes(Integer finalBakeTimeInMinutes);
/**
*
* The percentage of targets to receive a deployed configuration during each interval.
*
*
* @param growthFactor
* The percentage of targets to receive a deployed configuration during each interval.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder growthFactor(Float growthFactor);
/**
*
* The algorithm used to define how percentage grows over time. AWS AppConfig supports the following growth
* types:
*
*
* Linear : For this type, AppConfig processes the deployment by dividing the total number of targets by
* the value specified for Step percentage
. For example, a linear deployment that uses a
* Step percentage
of 10 deploys the configuration to 10 percent of the hosts. After those
* deployments are complete, the system deploys the configuration to the next 10 percent. This continues until
* 100% of the targets have successfully received the configuration.
*
*
* Exponential : For this type, AppConfig processes the deployment exponentially using the following
* formula: G*(2^N)
. In this formula, G
is the growth factor specified by the user and
* N
is the number of steps until the configuration is deployed to all targets. For example, if you
* specify a growth factor of 2, then the system rolls out the configuration as follows:
*
*
* 2*(2^0)
*
*
* 2*(2^1)
*
*
* 2*(2^2)
*
*
* Expressed numerically, the deployment rolls out as follows: 2% of the targets, 4% of the targets, 8% of the
* targets, and continues until the configuration has been deployed to all targets.
*
*
* @param growthType
* The algorithm used to define how percentage grows over time. AWS AppConfig supports the following
* growth types:
*
* Linear : For this type, AppConfig processes the deployment by dividing the total number of
* targets by the value specified for Step percentage
. For example, a linear deployment that
* uses a Step percentage
of 10 deploys the configuration to 10 percent of the hosts. After
* those deployments are complete, the system deploys the configuration to the next 10 percent. This
* continues until 100% of the targets have successfully received the configuration.
*
*
* Exponential : For this type, AppConfig processes the deployment exponentially using the
* following formula: G*(2^N)
. In this formula, G
is the growth factor
* specified by the user and N
is the number of steps until the configuration is deployed to
* all targets. For example, if you specify a growth factor of 2, then the system rolls out the
* configuration as follows:
*
*
* 2*(2^0)
*
*
* 2*(2^1)
*
*
* 2*(2^2)
*
*
* Expressed numerically, the deployment rolls out as follows: 2% of the targets, 4% of the targets, 8%
* of the targets, and continues until the configuration has been deployed to all targets.
* @see GrowthType
* @return Returns a reference to this object so that method calls can be chained together.
* @see GrowthType
*/
Builder growthType(String growthType);
/**
*
* The algorithm used to define how percentage grows over time. AWS AppConfig supports the following growth
* types:
*
*
* Linear : For this type, AppConfig processes the deployment by dividing the total number of targets by
* the value specified for Step percentage
. For example, a linear deployment that uses a
* Step percentage
of 10 deploys the configuration to 10 percent of the hosts. After those
* deployments are complete, the system deploys the configuration to the next 10 percent. This continues until
* 100% of the targets have successfully received the configuration.
*
*
* Exponential : For this type, AppConfig processes the deployment exponentially using the following
* formula: G*(2^N)
. In this formula, G
is the growth factor specified by the user and
* N
is the number of steps until the configuration is deployed to all targets. For example, if you
* specify a growth factor of 2, then the system rolls out the configuration as follows:
*
*
* 2*(2^0)
*
*
* 2*(2^1)
*
*
* 2*(2^2)
*
*
* Expressed numerically, the deployment rolls out as follows: 2% of the targets, 4% of the targets, 8% of the
* targets, and continues until the configuration has been deployed to all targets.
*
*
* @param growthType
* The algorithm used to define how percentage grows over time. AWS AppConfig supports the following
* growth types:
*
* Linear : For this type, AppConfig processes the deployment by dividing the total number of
* targets by the value specified for Step percentage
. For example, a linear deployment that
* uses a Step percentage
of 10 deploys the configuration to 10 percent of the hosts. After
* those deployments are complete, the system deploys the configuration to the next 10 percent. This
* continues until 100% of the targets have successfully received the configuration.
*
*
* Exponential : For this type, AppConfig processes the deployment exponentially using the
* following formula: G*(2^N)
. In this formula, G
is the growth factor
* specified by the user and N
is the number of steps until the configuration is deployed to
* all targets. For example, if you specify a growth factor of 2, then the system rolls out the
* configuration as follows:
*
*
* 2*(2^0)
*
*
* 2*(2^1)
*
*
* 2*(2^2)
*
*
* Expressed numerically, the deployment rolls out as follows: 2% of the targets, 4% of the targets, 8%
* of the targets, and continues until the configuration has been deployed to all targets.
* @see GrowthType
* @return Returns a reference to this object so that method calls can be chained together.
* @see GrowthType
*/
Builder growthType(GrowthType growthType);
/**
*
* Save the deployment strategy to a Systems Manager (SSM) document.
*
*
* @param replicateTo
* Save the deployment strategy to a Systems Manager (SSM) document.
* @see ReplicateTo
* @return Returns a reference to this object so that method calls can be chained together.
* @see ReplicateTo
*/
Builder replicateTo(String replicateTo);
/**
*
* Save the deployment strategy to a Systems Manager (SSM) document.
*
*
* @param replicateTo
* Save the deployment strategy to a Systems Manager (SSM) document.
* @see ReplicateTo
* @return Returns a reference to this object so that method calls can be chained together.
* @see ReplicateTo
*/
Builder replicateTo(ReplicateTo replicateTo);
/**
*
* Metadata to assign to the deployment strategy. Tags help organize and categorize your AppConfig resources.
* Each tag consists of a key and an optional value, both of which you define.
*
*
* @param tags
* Metadata to assign to the deployment strategy. Tags help organize and categorize your AppConfig
* resources. Each tag consists of a key and an optional value, both of which you define.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tags(Map tags);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer builderConsumer);
}
static final class BuilderImpl extends AppConfigRequest.BuilderImpl implements Builder {
private String name;
private String description;
private Integer deploymentDurationInMinutes;
private Integer finalBakeTimeInMinutes;
private Float growthFactor;
private String growthType;
private String replicateTo;
private Map tags = DefaultSdkAutoConstructMap.getInstance();
private BuilderImpl() {
}
private BuilderImpl(CreateDeploymentStrategyRequest model) {
super(model);
name(model.name);
description(model.description);
deploymentDurationInMinutes(model.deploymentDurationInMinutes);
finalBakeTimeInMinutes(model.finalBakeTimeInMinutes);
growthFactor(model.growthFactor);
growthType(model.growthType);
replicateTo(model.replicateTo);
tags(model.tags);
}
public final String getName() {
return name;
}
public final void setName(String name) {
this.name = name;
}
@Override
@Transient
public final Builder name(String name) {
this.name = name;
return this;
}
public final String getDescription() {
return description;
}
public final void setDescription(String description) {
this.description = description;
}
@Override
@Transient
public final Builder description(String description) {
this.description = description;
return this;
}
public final Integer getDeploymentDurationInMinutes() {
return deploymentDurationInMinutes;
}
public final void setDeploymentDurationInMinutes(Integer deploymentDurationInMinutes) {
this.deploymentDurationInMinutes = deploymentDurationInMinutes;
}
@Override
@Transient
public final Builder deploymentDurationInMinutes(Integer deploymentDurationInMinutes) {
this.deploymentDurationInMinutes = deploymentDurationInMinutes;
return this;
}
public final Integer getFinalBakeTimeInMinutes() {
return finalBakeTimeInMinutes;
}
public final void setFinalBakeTimeInMinutes(Integer finalBakeTimeInMinutes) {
this.finalBakeTimeInMinutes = finalBakeTimeInMinutes;
}
@Override
@Transient
public final Builder finalBakeTimeInMinutes(Integer finalBakeTimeInMinutes) {
this.finalBakeTimeInMinutes = finalBakeTimeInMinutes;
return this;
}
public final Float getGrowthFactor() {
return growthFactor;
}
public final void setGrowthFactor(Float growthFactor) {
this.growthFactor = growthFactor;
}
@Override
@Transient
public final Builder growthFactor(Float growthFactor) {
this.growthFactor = growthFactor;
return this;
}
public final String getGrowthType() {
return growthType;
}
public final void setGrowthType(String growthType) {
this.growthType = growthType;
}
@Override
@Transient
public final Builder growthType(String growthType) {
this.growthType = growthType;
return this;
}
@Override
@Transient
public final Builder growthType(GrowthType growthType) {
this.growthType(growthType == null ? null : growthType.toString());
return this;
}
public final String getReplicateTo() {
return replicateTo;
}
public final void setReplicateTo(String replicateTo) {
this.replicateTo = replicateTo;
}
@Override
@Transient
public final Builder replicateTo(String replicateTo) {
this.replicateTo = replicateTo;
return this;
}
@Override
@Transient
public final Builder replicateTo(ReplicateTo replicateTo) {
this.replicateTo(replicateTo == null ? null : replicateTo.toString());
return this;
}
public final Map getTags() {
if (tags instanceof SdkAutoConstructMap) {
return null;
}
return tags;
}
public final void setTags(Map tags) {
this.tags = TagMapCopier.copy(tags);
}
@Override
@Transient
public final Builder tags(Map tags) {
this.tags = TagMapCopier.copy(tags);
return this;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public CreateDeploymentStrategyRequest build() {
return new CreateDeploymentStrategyRequest(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}