Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
software.amazon.awssdk.services.opsworks.model.Stack Maven / Gradle / Ivy
Go to download
The AWS Java SDK for AWS OpsWorks module holds the client classes that are used for communicating with
AWS OpsWorks Service
/*
* Copyright 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 software.amazon.awssdk.services.opsworks.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Describes a stack.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class Stack implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField STACK_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("StackId").getter(getter(Stack::stackId)).setter(setter(Builder::stackId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StackId").build()).build();
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name")
.getter(getter(Stack::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name").build()).build();
private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Arn")
.getter(getter(Stack::arn)).setter(setter(Builder::arn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Arn").build()).build();
private static final SdkField REGION_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Region")
.getter(getter(Stack::region)).setter(setter(Builder::region))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Region").build()).build();
private static final SdkField VPC_ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("VpcId")
.getter(getter(Stack::vpcId)).setter(setter(Builder::vpcId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VpcId").build()).build();
private static final SdkField> ATTRIBUTES_FIELD = SdkField
.> builder(MarshallingType.MAP)
.memberName("Attributes")
.getter(getter(Stack::attributesAsStrings))
.setter(setter(Builder::attributesWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Attributes").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField SERVICE_ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ServiceRoleArn").getter(getter(Stack::serviceRoleArn)).setter(setter(Builder::serviceRoleArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ServiceRoleArn").build()).build();
private static final SdkField DEFAULT_INSTANCE_PROFILE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DefaultInstanceProfileArn").getter(getter(Stack::defaultInstanceProfileArn))
.setter(setter(Builder::defaultInstanceProfileArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DefaultInstanceProfileArn").build())
.build();
private static final SdkField DEFAULT_OS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DefaultOs").getter(getter(Stack::defaultOs)).setter(setter(Builder::defaultOs))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DefaultOs").build()).build();
private static final SdkField HOSTNAME_THEME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("HostnameTheme").getter(getter(Stack::hostnameTheme)).setter(setter(Builder::hostnameTheme))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HostnameTheme").build()).build();
private static final SdkField DEFAULT_AVAILABILITY_ZONE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DefaultAvailabilityZone").getter(getter(Stack::defaultAvailabilityZone))
.setter(setter(Builder::defaultAvailabilityZone))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DefaultAvailabilityZone").build())
.build();
private static final SdkField DEFAULT_SUBNET_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DefaultSubnetId").getter(getter(Stack::defaultSubnetId)).setter(setter(Builder::defaultSubnetId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DefaultSubnetId").build()).build();
private static final SdkField CUSTOM_JSON_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CustomJson").getter(getter(Stack::customJson)).setter(setter(Builder::customJson))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CustomJson").build()).build();
private static final SdkField CONFIGURATION_MANAGER_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("ConfigurationManager")
.getter(getter(Stack::configurationManager)).setter(setter(Builder::configurationManager))
.constructor(StackConfigurationManager::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ConfigurationManager").build())
.build();
private static final SdkField CHEF_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("ChefConfiguration")
.getter(getter(Stack::chefConfiguration)).setter(setter(Builder::chefConfiguration))
.constructor(ChefConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ChefConfiguration").build()).build();
private static final SdkField USE_CUSTOM_COOKBOOKS_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("UseCustomCookbooks").getter(getter(Stack::useCustomCookbooks))
.setter(setter(Builder::useCustomCookbooks))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UseCustomCookbooks").build())
.build();
private static final SdkField USE_OPSWORKS_SECURITY_GROUPS_FIELD = SdkField
. builder(MarshallingType.BOOLEAN).memberName("UseOpsworksSecurityGroups")
.getter(getter(Stack::useOpsworksSecurityGroups)).setter(setter(Builder::useOpsworksSecurityGroups))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UseOpsworksSecurityGroups").build())
.build();
private static final SdkField CUSTOM_COOKBOOKS_SOURCE_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("CustomCookbooksSource").getter(getter(Stack::customCookbooksSource))
.setter(setter(Builder::customCookbooksSource)).constructor(Source::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CustomCookbooksSource").build())
.build();
private static final SdkField DEFAULT_SSH_KEY_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DefaultSshKeyName").getter(getter(Stack::defaultSshKeyName)).setter(setter(Builder::defaultSshKeyName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DefaultSshKeyName").build()).build();
private static final SdkField CREATED_AT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CreatedAt").getter(getter(Stack::createdAt)).setter(setter(Builder::createdAt))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreatedAt").build()).build();
private static final SdkField DEFAULT_ROOT_DEVICE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DefaultRootDeviceType").getter(getter(Stack::defaultRootDeviceTypeAsString))
.setter(setter(Builder::defaultRootDeviceType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DefaultRootDeviceType").build())
.build();
private static final SdkField AGENT_VERSION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("AgentVersion").getter(getter(Stack::agentVersion)).setter(setter(Builder::agentVersion))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AgentVersion").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(STACK_ID_FIELD, NAME_FIELD,
ARN_FIELD, REGION_FIELD, VPC_ID_FIELD, ATTRIBUTES_FIELD, SERVICE_ROLE_ARN_FIELD, DEFAULT_INSTANCE_PROFILE_ARN_FIELD,
DEFAULT_OS_FIELD, HOSTNAME_THEME_FIELD, DEFAULT_AVAILABILITY_ZONE_FIELD, DEFAULT_SUBNET_ID_FIELD, CUSTOM_JSON_FIELD,
CONFIGURATION_MANAGER_FIELD, CHEF_CONFIGURATION_FIELD, USE_CUSTOM_COOKBOOKS_FIELD,
USE_OPSWORKS_SECURITY_GROUPS_FIELD, CUSTOM_COOKBOOKS_SOURCE_FIELD, DEFAULT_SSH_KEY_NAME_FIELD, CREATED_AT_FIELD,
DEFAULT_ROOT_DEVICE_TYPE_FIELD, AGENT_VERSION_FIELD));
private static final long serialVersionUID = 1L;
private final String stackId;
private final String name;
private final String arn;
private final String region;
private final String vpcId;
private final Map attributes;
private final String serviceRoleArn;
private final String defaultInstanceProfileArn;
private final String defaultOs;
private final String hostnameTheme;
private final String defaultAvailabilityZone;
private final String defaultSubnetId;
private final String customJson;
private final StackConfigurationManager configurationManager;
private final ChefConfiguration chefConfiguration;
private final Boolean useCustomCookbooks;
private final Boolean useOpsworksSecurityGroups;
private final Source customCookbooksSource;
private final String defaultSshKeyName;
private final String createdAt;
private final String defaultRootDeviceType;
private final String agentVersion;
private Stack(BuilderImpl builder) {
this.stackId = builder.stackId;
this.name = builder.name;
this.arn = builder.arn;
this.region = builder.region;
this.vpcId = builder.vpcId;
this.attributes = builder.attributes;
this.serviceRoleArn = builder.serviceRoleArn;
this.defaultInstanceProfileArn = builder.defaultInstanceProfileArn;
this.defaultOs = builder.defaultOs;
this.hostnameTheme = builder.hostnameTheme;
this.defaultAvailabilityZone = builder.defaultAvailabilityZone;
this.defaultSubnetId = builder.defaultSubnetId;
this.customJson = builder.customJson;
this.configurationManager = builder.configurationManager;
this.chefConfiguration = builder.chefConfiguration;
this.useCustomCookbooks = builder.useCustomCookbooks;
this.useOpsworksSecurityGroups = builder.useOpsworksSecurityGroups;
this.customCookbooksSource = builder.customCookbooksSource;
this.defaultSshKeyName = builder.defaultSshKeyName;
this.createdAt = builder.createdAt;
this.defaultRootDeviceType = builder.defaultRootDeviceType;
this.agentVersion = builder.agentVersion;
}
/**
*
* The stack ID.
*
*
* @return The stack ID.
*/
public final String stackId() {
return stackId;
}
/**
*
* The stack name. Stack names can be a maximum of 64 characters.
*
*
* @return The stack name. Stack names can be a maximum of 64 characters.
*/
public final String name() {
return name;
}
/**
*
* The stack's ARN.
*
*
* @return The stack's ARN.
*/
public final String arn() {
return arn;
}
/**
*
* The stack Amazon Web Services Region, such as ap-northeast-2
. For more information about Amazon Web
* Services Regions, see Regions and
* Endpoints .
*
*
* @return The stack Amazon Web Services Region, such as ap-northeast-2
. For more information about
* Amazon Web Services Regions, see Regions and Endpoints .
*/
public final String region() {
return region;
}
/**
*
* The VPC ID; applicable only if the stack is running in a VPC.
*
*
* @return The VPC ID; applicable only if the stack is running in a VPC.
*/
public final String vpcId() {
return vpcId;
}
/**
*
* The stack's attributes.
*
*
* 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 #hasAttributes} method.
*
*
* @return The stack's attributes.
*/
public final Map attributes() {
return StackAttributesCopier.copyStringToEnum(attributes);
}
/**
* For responses, this returns true if the service returned a value for the Attributes 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 hasAttributes() {
return attributes != null && !(attributes instanceof SdkAutoConstructMap);
}
/**
*
* The stack's attributes.
*
*
* 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 #hasAttributes} method.
*
*
* @return The stack's attributes.
*/
public final Map attributesAsStrings() {
return attributes;
}
/**
*
* The stack Identity and Access Management (IAM) role.
*
*
* @return The stack Identity and Access Management (IAM) role.
*/
public final String serviceRoleArn() {
return serviceRoleArn;
}
/**
*
* The ARN of an IAM profile that is the default profile for all of the stack's EC2 instances. For more information
* about IAM ARNs, see Using
* Identifiers .
*
*
* @return The ARN of an IAM profile that is the default profile for all of the stack's EC2 instances. For more
* information about IAM ARNs, see Using Identifiers .
*/
public final String defaultInstanceProfileArn() {
return defaultInstanceProfileArn;
}
/**
*
* The stack's default operating system.
*
*
* @return The stack's default operating system.
*/
public final String defaultOs() {
return defaultOs;
}
/**
*
* The stack host name theme, with spaces replaced by underscores.
*
*
* @return The stack host name theme, with spaces replaced by underscores.
*/
public final String hostnameTheme() {
return hostnameTheme;
}
/**
*
* The stack's default Availability Zone. For more information, see Regions and Endpoints .
*
*
* @return The stack's default Availability Zone. For more information, see Regions and Endpoints .
*/
public final String defaultAvailabilityZone() {
return defaultAvailabilityZone;
}
/**
*
* The default subnet ID; applicable only if the stack is running in a VPC.
*
*
* @return The default subnet ID; applicable only if the stack is running in a VPC.
*/
public final String defaultSubnetId() {
return defaultSubnetId;
}
/**
*
* A JSON object that contains user-defined attributes to be added to the stack configuration and deployment
* attributes. You can use custom JSON to override the corresponding default stack configuration attribute values or
* to pass data to recipes. The string should be in the following format:
*
*
* "{\"key1\": \"value1\", \"key2\": \"value2\",...}"
*
*
* For more information on custom JSON, see Use Custom JSON to Modify
* the Stack Configuration Attributes .
*
*
* @return A JSON object that contains user-defined attributes to be added to the stack configuration and deployment
* attributes. You can use custom JSON to override the corresponding default stack configuration attribute
* values or to pass data to recipes. The string should be in the following format:
*
* "{\"key1\": \"value1\", \"key2\": \"value2\",...}"
*
*
* For more information on custom JSON, see Use Custom JSON to
* Modify the Stack Configuration Attributes .
*/
public final String customJson() {
return customJson;
}
/**
*
* The configuration manager.
*
*
* @return The configuration manager.
*/
public final StackConfigurationManager configurationManager() {
return configurationManager;
}
/**
*
* A ChefConfiguration
object that specifies whether to enable Berkshelf and the Berkshelf version. For
* more information, see Create a New Stack .
*
*
* @return A ChefConfiguration
object that specifies whether to enable Berkshelf and the Berkshelf
* version. For more information, see Create a New
* Stack .
*/
public final ChefConfiguration chefConfiguration() {
return chefConfiguration;
}
/**
*
* Whether the stack uses custom cookbooks.
*
*
* @return Whether the stack uses custom cookbooks.
*/
public final Boolean useCustomCookbooks() {
return useCustomCookbooks;
}
/**
*
* Whether the stack automatically associates the OpsWorks Stacks built-in security groups with the stack's layers.
*
*
* @return Whether the stack automatically associates the OpsWorks Stacks built-in security groups with the stack's
* layers.
*/
public final Boolean useOpsworksSecurityGroups() {
return useOpsworksSecurityGroups;
}
/**
*
* Contains the information required to retrieve an app or cookbook from a repository. For more information, see Adding Apps or Cookbooks and Recipes .
*
*
* @return Contains the information required to retrieve an app or cookbook from a repository. For more information,
* see Adding
* Apps or Cookbooks and
* Recipes .
*/
public final Source customCookbooksSource() {
return customCookbooksSource;
}
/**
*
* A default Amazon EC2 key pair for the stack's instances. You can override this value when you create or update an
* instance.
*
*
* @return A default Amazon EC2 key pair for the stack's instances. You can override this value when you create or
* update an instance.
*/
public final String defaultSshKeyName() {
return defaultSshKeyName;
}
/**
*
* The date when the stack was created.
*
*
* @return The date when the stack was created.
*/
public final String createdAt() {
return createdAt;
}
/**
*
* The default root device type. This value is used by default for all instances in the stack, but you can override
* it when you create an instance. For more information, see Storage for the Root Device .
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #defaultRootDeviceType} will return {@link RootDeviceType#UNKNOWN_TO_SDK_VERSION}. The raw value returned
* by the service is available from {@link #defaultRootDeviceTypeAsString}.
*
*
* @return The default root device type. This value is used by default for all instances in the stack, but you can
* override it when you create an instance. For more information, see Storage for the Root Device .
* @see RootDeviceType
*/
public final RootDeviceType defaultRootDeviceType() {
return RootDeviceType.fromValue(defaultRootDeviceType);
}
/**
*
* The default root device type. This value is used by default for all instances in the stack, but you can override
* it when you create an instance. For more information, see Storage for the Root Device .
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #defaultRootDeviceType} will return {@link RootDeviceType#UNKNOWN_TO_SDK_VERSION}. The raw value returned
* by the service is available from {@link #defaultRootDeviceTypeAsString}.
*
*
* @return The default root device type. This value is used by default for all instances in the stack, but you can
* override it when you create an instance. For more information, see Storage for the Root Device .
* @see RootDeviceType
*/
public final String defaultRootDeviceTypeAsString() {
return defaultRootDeviceType;
}
/**
*
* The agent version. This parameter is set to LATEST
for auto-update. or a version number for a fixed
* agent version.
*
*
* @return The agent version. This parameter is set to LATEST
for auto-update. or a version number for
* a fixed agent version.
*/
public final String agentVersion() {
return agentVersion;
}
@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 + Objects.hashCode(stackId());
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(arn());
hashCode = 31 * hashCode + Objects.hashCode(region());
hashCode = 31 * hashCode + Objects.hashCode(vpcId());
hashCode = 31 * hashCode + Objects.hashCode(hasAttributes() ? attributesAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(serviceRoleArn());
hashCode = 31 * hashCode + Objects.hashCode(defaultInstanceProfileArn());
hashCode = 31 * hashCode + Objects.hashCode(defaultOs());
hashCode = 31 * hashCode + Objects.hashCode(hostnameTheme());
hashCode = 31 * hashCode + Objects.hashCode(defaultAvailabilityZone());
hashCode = 31 * hashCode + Objects.hashCode(defaultSubnetId());
hashCode = 31 * hashCode + Objects.hashCode(customJson());
hashCode = 31 * hashCode + Objects.hashCode(configurationManager());
hashCode = 31 * hashCode + Objects.hashCode(chefConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(useCustomCookbooks());
hashCode = 31 * hashCode + Objects.hashCode(useOpsworksSecurityGroups());
hashCode = 31 * hashCode + Objects.hashCode(customCookbooksSource());
hashCode = 31 * hashCode + Objects.hashCode(defaultSshKeyName());
hashCode = 31 * hashCode + Objects.hashCode(createdAt());
hashCode = 31 * hashCode + Objects.hashCode(defaultRootDeviceTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(agentVersion());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof Stack)) {
return false;
}
Stack other = (Stack) obj;
return Objects.equals(stackId(), other.stackId()) && Objects.equals(name(), other.name())
&& Objects.equals(arn(), other.arn()) && Objects.equals(region(), other.region())
&& Objects.equals(vpcId(), other.vpcId()) && hasAttributes() == other.hasAttributes()
&& Objects.equals(attributesAsStrings(), other.attributesAsStrings())
&& Objects.equals(serviceRoleArn(), other.serviceRoleArn())
&& Objects.equals(defaultInstanceProfileArn(), other.defaultInstanceProfileArn())
&& Objects.equals(defaultOs(), other.defaultOs()) && Objects.equals(hostnameTheme(), other.hostnameTheme())
&& Objects.equals(defaultAvailabilityZone(), other.defaultAvailabilityZone())
&& Objects.equals(defaultSubnetId(), other.defaultSubnetId()) && Objects.equals(customJson(), other.customJson())
&& Objects.equals(configurationManager(), other.configurationManager())
&& Objects.equals(chefConfiguration(), other.chefConfiguration())
&& Objects.equals(useCustomCookbooks(), other.useCustomCookbooks())
&& Objects.equals(useOpsworksSecurityGroups(), other.useOpsworksSecurityGroups())
&& Objects.equals(customCookbooksSource(), other.customCookbooksSource())
&& Objects.equals(defaultSshKeyName(), other.defaultSshKeyName())
&& Objects.equals(createdAt(), other.createdAt())
&& Objects.equals(defaultRootDeviceTypeAsString(), other.defaultRootDeviceTypeAsString())
&& Objects.equals(agentVersion(), other.agentVersion());
}
/**
* 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("Stack").add("StackId", stackId()).add("Name", name()).add("Arn", arn()).add("Region", region())
.add("VpcId", vpcId()).add("Attributes", hasAttributes() ? attributesAsStrings() : null)
.add("ServiceRoleArn", serviceRoleArn()).add("DefaultInstanceProfileArn", defaultInstanceProfileArn())
.add("DefaultOs", defaultOs()).add("HostnameTheme", hostnameTheme())
.add("DefaultAvailabilityZone", defaultAvailabilityZone()).add("DefaultSubnetId", defaultSubnetId())
.add("CustomJson", customJson()).add("ConfigurationManager", configurationManager())
.add("ChefConfiguration", chefConfiguration()).add("UseCustomCookbooks", useCustomCookbooks())
.add("UseOpsworksSecurityGroups", useOpsworksSecurityGroups())
.add("CustomCookbooksSource", customCookbooksSource()).add("DefaultSshKeyName", defaultSshKeyName())
.add("CreatedAt", createdAt()).add("DefaultRootDeviceType", defaultRootDeviceTypeAsString())
.add("AgentVersion", agentVersion()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "StackId":
return Optional.ofNullable(clazz.cast(stackId()));
case "Name":
return Optional.ofNullable(clazz.cast(name()));
case "Arn":
return Optional.ofNullable(clazz.cast(arn()));
case "Region":
return Optional.ofNullable(clazz.cast(region()));
case "VpcId":
return Optional.ofNullable(clazz.cast(vpcId()));
case "Attributes":
return Optional.ofNullable(clazz.cast(attributesAsStrings()));
case "ServiceRoleArn":
return Optional.ofNullable(clazz.cast(serviceRoleArn()));
case "DefaultInstanceProfileArn":
return Optional.ofNullable(clazz.cast(defaultInstanceProfileArn()));
case "DefaultOs":
return Optional.ofNullable(clazz.cast(defaultOs()));
case "HostnameTheme":
return Optional.ofNullable(clazz.cast(hostnameTheme()));
case "DefaultAvailabilityZone":
return Optional.ofNullable(clazz.cast(defaultAvailabilityZone()));
case "DefaultSubnetId":
return Optional.ofNullable(clazz.cast(defaultSubnetId()));
case "CustomJson":
return Optional.ofNullable(clazz.cast(customJson()));
case "ConfigurationManager":
return Optional.ofNullable(clazz.cast(configurationManager()));
case "ChefConfiguration":
return Optional.ofNullable(clazz.cast(chefConfiguration()));
case "UseCustomCookbooks":
return Optional.ofNullable(clazz.cast(useCustomCookbooks()));
case "UseOpsworksSecurityGroups":
return Optional.ofNullable(clazz.cast(useOpsworksSecurityGroups()));
case "CustomCookbooksSource":
return Optional.ofNullable(clazz.cast(customCookbooksSource()));
case "DefaultSshKeyName":
return Optional.ofNullable(clazz.cast(defaultSshKeyName()));
case "CreatedAt":
return Optional.ofNullable(clazz.cast(createdAt()));
case "DefaultRootDeviceType":
return Optional.ofNullable(clazz.cast(defaultRootDeviceTypeAsString()));
case "AgentVersion":
return Optional.ofNullable(clazz.cast(agentVersion()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((Stack) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder {
/**
*
* The stack ID.
*
*
* @param stackId
* The stack ID.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder stackId(String stackId);
/**
*
* The stack name. Stack names can be a maximum of 64 characters.
*
*
* @param name
* The stack name. Stack names can be a maximum of 64 characters.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder name(String name);
/**
*
* The stack's ARN.
*
*
* @param arn
* The stack's ARN.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder arn(String arn);
/**
*
* The stack Amazon Web Services Region, such as ap-northeast-2
. For more information about Amazon
* Web Services Regions, see Regions and
* Endpoints .
*
*
* @param region
* The stack Amazon Web Services Region, such as ap-northeast-2
. For more information about
* Amazon Web Services Regions, see Regions and Endpoints .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder region(String region);
/**
*
* The VPC ID; applicable only if the stack is running in a VPC.
*
*
* @param vpcId
* The VPC ID; applicable only if the stack is running in a VPC.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder vpcId(String vpcId);
/**
*
* The stack's attributes.
*
*
* @param attributes
* The stack's attributes.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder attributesWithStrings(Map attributes);
/**
*
* The stack's attributes.
*
*
* @param attributes
* The stack's attributes.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder attributes(Map attributes);
/**
*
* The stack Identity and Access Management (IAM) role.
*
*
* @param serviceRoleArn
* The stack Identity and Access Management (IAM) role.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder serviceRoleArn(String serviceRoleArn);
/**
*
* The ARN of an IAM profile that is the default profile for all of the stack's EC2 instances. For more
* information about IAM ARNs, see Using Identifiers .
*
*
* @param defaultInstanceProfileArn
* The ARN of an IAM profile that is the default profile for all of the stack's EC2 instances. For more
* information about IAM ARNs, see Using Identifiers .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder defaultInstanceProfileArn(String defaultInstanceProfileArn);
/**
*
* The stack's default operating system.
*
*
* @param defaultOs
* The stack's default operating system.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder defaultOs(String defaultOs);
/**
*
* The stack host name theme, with spaces replaced by underscores.
*
*
* @param hostnameTheme
* The stack host name theme, with spaces replaced by underscores.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder hostnameTheme(String hostnameTheme);
/**
*
* The stack's default Availability Zone. For more information, see Regions and Endpoints .
*
*
* @param defaultAvailabilityZone
* The stack's default Availability Zone. For more information, see Regions and Endpoints .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder defaultAvailabilityZone(String defaultAvailabilityZone);
/**
*
* The default subnet ID; applicable only if the stack is running in a VPC.
*
*
* @param defaultSubnetId
* The default subnet ID; applicable only if the stack is running in a VPC.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder defaultSubnetId(String defaultSubnetId);
/**
*
* A JSON object that contains user-defined attributes to be added to the stack configuration and deployment
* attributes. You can use custom JSON to override the corresponding default stack configuration attribute
* values or to pass data to recipes. The string should be in the following format:
*
*
* "{\"key1\": \"value1\", \"key2\": \"value2\",...}"
*
*
* For more information on custom JSON, see Use Custom JSON to
* Modify the Stack Configuration Attributes .
*
*
* @param customJson
* A JSON object that contains user-defined attributes to be added to the stack configuration and
* deployment attributes. You can use custom JSON to override the corresponding default stack
* configuration attribute values or to pass data to recipes. The string should be in the following
* format:
*
* "{\"key1\": \"value1\", \"key2\": \"value2\",...}"
*
*
* For more information on custom JSON, see Use Custom JSON
* to Modify the Stack Configuration Attributes .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder customJson(String customJson);
/**
*
* The configuration manager.
*
*
* @param configurationManager
* The configuration manager.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder configurationManager(StackConfigurationManager configurationManager);
/**
*
* The configuration manager.
*
* This is a convenience method that creates an instance of the {@link StackConfigurationManager.Builder}
* avoiding the need to create one manually via {@link StackConfigurationManager#builder()}.
*
*
* When the {@link Consumer} completes, {@link StackConfigurationManager.Builder#build()} is called immediately
* and its result is passed to {@link #configurationManager(StackConfigurationManager)}.
*
* @param configurationManager
* a consumer that will call methods on {@link StackConfigurationManager.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #configurationManager(StackConfigurationManager)
*/
default Builder configurationManager(Consumer configurationManager) {
return configurationManager(StackConfigurationManager.builder().applyMutation(configurationManager).build());
}
/**
*
* A ChefConfiguration
object that specifies whether to enable Berkshelf and the Berkshelf version.
* For more information, see Create a New
* Stack .
*
*
* @param chefConfiguration
* A ChefConfiguration
object that specifies whether to enable Berkshelf and the Berkshelf
* version. For more information, see Create a New
* Stack .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder chefConfiguration(ChefConfiguration chefConfiguration);
/**
*
* A ChefConfiguration
object that specifies whether to enable Berkshelf and the Berkshelf version.
* For more information, see Create a New
* Stack .
*
* This is a convenience method that creates an instance of the {@link ChefConfiguration.Builder} avoiding the
* need to create one manually via {@link ChefConfiguration#builder()}.
*
*
* When the {@link Consumer} completes, {@link ChefConfiguration.Builder#build()} is called immediately and its
* result is passed to {@link #chefConfiguration(ChefConfiguration)}.
*
* @param chefConfiguration
* a consumer that will call methods on {@link ChefConfiguration.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #chefConfiguration(ChefConfiguration)
*/
default Builder chefConfiguration(Consumer chefConfiguration) {
return chefConfiguration(ChefConfiguration.builder().applyMutation(chefConfiguration).build());
}
/**
*
* Whether the stack uses custom cookbooks.
*
*
* @param useCustomCookbooks
* Whether the stack uses custom cookbooks.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder useCustomCookbooks(Boolean useCustomCookbooks);
/**
*
* Whether the stack automatically associates the OpsWorks Stacks built-in security groups with the stack's
* layers.
*
*
* @param useOpsworksSecurityGroups
* Whether the stack automatically associates the OpsWorks Stacks built-in security groups with the
* stack's layers.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder useOpsworksSecurityGroups(Boolean useOpsworksSecurityGroups);
/**
*
* Contains the information required to retrieve an app or cookbook from a repository. For more information, see
* Adding Apps or
* Cookbooks and
* Recipes .
*
*
* @param customCookbooksSource
* Contains the information required to retrieve an app or cookbook from a repository. For more
* information, see Adding Apps
* or Cookbooks and
* Recipes .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder customCookbooksSource(Source customCookbooksSource);
/**
*
* Contains the information required to retrieve an app or cookbook from a repository. For more information, see
* Adding Apps or
* Cookbooks and
* Recipes .
*
* This is a convenience method that creates an instance of the {@link Source.Builder} avoiding the need to
* create one manually via {@link Source#builder()}.
*
*
* When the {@link Consumer} completes, {@link Source.Builder#build()} is called immediately and its result is
* passed to {@link #customCookbooksSource(Source)}.
*
* @param customCookbooksSource
* a consumer that will call methods on {@link Source.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #customCookbooksSource(Source)
*/
default Builder customCookbooksSource(Consumer customCookbooksSource) {
return customCookbooksSource(Source.builder().applyMutation(customCookbooksSource).build());
}
/**
*
* A default Amazon EC2 key pair for the stack's instances. You can override this value when you create or
* update an instance.
*
*
* @param defaultSshKeyName
* A default Amazon EC2 key pair for the stack's instances. You can override this value when you create
* or update an instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder defaultSshKeyName(String defaultSshKeyName);
/**
*
* The date when the stack was created.
*
*
* @param createdAt
* The date when the stack was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder createdAt(String createdAt);
/**
*
* The default root device type. This value is used by default for all instances in the stack, but you can
* override it when you create an instance. For more information, see Storage for the Root Device .
*
*
* @param defaultRootDeviceType
* The default root device type. This value is used by default for all instances in the stack, but you
* can override it when you create an instance. For more information, see Storage for the Root Device .
* @see RootDeviceType
* @return Returns a reference to this object so that method calls can be chained together.
* @see RootDeviceType
*/
Builder defaultRootDeviceType(String defaultRootDeviceType);
/**
*
* The default root device type. This value is used by default for all instances in the stack, but you can
* override it when you create an instance. For more information, see Storage for the Root Device .
*
*
* @param defaultRootDeviceType
* The default root device type. This value is used by default for all instances in the stack, but you
* can override it when you create an instance. For more information, see Storage for the Root Device .
* @see RootDeviceType
* @return Returns a reference to this object so that method calls can be chained together.
* @see RootDeviceType
*/
Builder defaultRootDeviceType(RootDeviceType defaultRootDeviceType);
/**
*
* The agent version. This parameter is set to LATEST
for auto-update. or a version number for a
* fixed agent version.
*
*
* @param agentVersion
* The agent version. This parameter is set to LATEST
for auto-update. or a version number
* for a fixed agent version.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder agentVersion(String agentVersion);
}
static final class BuilderImpl implements Builder {
private String stackId;
private String name;
private String arn;
private String region;
private String vpcId;
private Map attributes = DefaultSdkAutoConstructMap.getInstance();
private String serviceRoleArn;
private String defaultInstanceProfileArn;
private String defaultOs;
private String hostnameTheme;
private String defaultAvailabilityZone;
private String defaultSubnetId;
private String customJson;
private StackConfigurationManager configurationManager;
private ChefConfiguration chefConfiguration;
private Boolean useCustomCookbooks;
private Boolean useOpsworksSecurityGroups;
private Source customCookbooksSource;
private String defaultSshKeyName;
private String createdAt;
private String defaultRootDeviceType;
private String agentVersion;
private BuilderImpl() {
}
private BuilderImpl(Stack model) {
stackId(model.stackId);
name(model.name);
arn(model.arn);
region(model.region);
vpcId(model.vpcId);
attributesWithStrings(model.attributes);
serviceRoleArn(model.serviceRoleArn);
defaultInstanceProfileArn(model.defaultInstanceProfileArn);
defaultOs(model.defaultOs);
hostnameTheme(model.hostnameTheme);
defaultAvailabilityZone(model.defaultAvailabilityZone);
defaultSubnetId(model.defaultSubnetId);
customJson(model.customJson);
configurationManager(model.configurationManager);
chefConfiguration(model.chefConfiguration);
useCustomCookbooks(model.useCustomCookbooks);
useOpsworksSecurityGroups(model.useOpsworksSecurityGroups);
customCookbooksSource(model.customCookbooksSource);
defaultSshKeyName(model.defaultSshKeyName);
createdAt(model.createdAt);
defaultRootDeviceType(model.defaultRootDeviceType);
agentVersion(model.agentVersion);
}
public final String getStackId() {
return stackId;
}
public final void setStackId(String stackId) {
this.stackId = stackId;
}
@Override
public final Builder stackId(String stackId) {
this.stackId = stackId;
return this;
}
public final String getName() {
return name;
}
public final void setName(String name) {
this.name = name;
}
@Override
public final Builder name(String name) {
this.name = name;
return this;
}
public final String getArn() {
return arn;
}
public final void setArn(String arn) {
this.arn = arn;
}
@Override
public final Builder arn(String arn) {
this.arn = arn;
return this;
}
public final String getRegion() {
return region;
}
public final void setRegion(String region) {
this.region = region;
}
@Override
public final Builder region(String region) {
this.region = region;
return this;
}
public final String getVpcId() {
return vpcId;
}
public final void setVpcId(String vpcId) {
this.vpcId = vpcId;
}
@Override
public final Builder vpcId(String vpcId) {
this.vpcId = vpcId;
return this;
}
public final Map getAttributes() {
if (attributes instanceof SdkAutoConstructMap) {
return null;
}
return attributes;
}
public final void setAttributes(Map attributes) {
this.attributes = StackAttributesCopier.copy(attributes);
}
@Override
public final Builder attributesWithStrings(Map attributes) {
this.attributes = StackAttributesCopier.copy(attributes);
return this;
}
@Override
public final Builder attributes(Map attributes) {
this.attributes = StackAttributesCopier.copyEnumToString(attributes);
return this;
}
public final String getServiceRoleArn() {
return serviceRoleArn;
}
public final void setServiceRoleArn(String serviceRoleArn) {
this.serviceRoleArn = serviceRoleArn;
}
@Override
public final Builder serviceRoleArn(String serviceRoleArn) {
this.serviceRoleArn = serviceRoleArn;
return this;
}
public final String getDefaultInstanceProfileArn() {
return defaultInstanceProfileArn;
}
public final void setDefaultInstanceProfileArn(String defaultInstanceProfileArn) {
this.defaultInstanceProfileArn = defaultInstanceProfileArn;
}
@Override
public final Builder defaultInstanceProfileArn(String defaultInstanceProfileArn) {
this.defaultInstanceProfileArn = defaultInstanceProfileArn;
return this;
}
public final String getDefaultOs() {
return defaultOs;
}
public final void setDefaultOs(String defaultOs) {
this.defaultOs = defaultOs;
}
@Override
public final Builder defaultOs(String defaultOs) {
this.defaultOs = defaultOs;
return this;
}
public final String getHostnameTheme() {
return hostnameTheme;
}
public final void setHostnameTheme(String hostnameTheme) {
this.hostnameTheme = hostnameTheme;
}
@Override
public final Builder hostnameTheme(String hostnameTheme) {
this.hostnameTheme = hostnameTheme;
return this;
}
public final String getDefaultAvailabilityZone() {
return defaultAvailabilityZone;
}
public final void setDefaultAvailabilityZone(String defaultAvailabilityZone) {
this.defaultAvailabilityZone = defaultAvailabilityZone;
}
@Override
public final Builder defaultAvailabilityZone(String defaultAvailabilityZone) {
this.defaultAvailabilityZone = defaultAvailabilityZone;
return this;
}
public final String getDefaultSubnetId() {
return defaultSubnetId;
}
public final void setDefaultSubnetId(String defaultSubnetId) {
this.defaultSubnetId = defaultSubnetId;
}
@Override
public final Builder defaultSubnetId(String defaultSubnetId) {
this.defaultSubnetId = defaultSubnetId;
return this;
}
public final String getCustomJson() {
return customJson;
}
public final void setCustomJson(String customJson) {
this.customJson = customJson;
}
@Override
public final Builder customJson(String customJson) {
this.customJson = customJson;
return this;
}
public final StackConfigurationManager.Builder getConfigurationManager() {
return configurationManager != null ? configurationManager.toBuilder() : null;
}
public final void setConfigurationManager(StackConfigurationManager.BuilderImpl configurationManager) {
this.configurationManager = configurationManager != null ? configurationManager.build() : null;
}
@Override
public final Builder configurationManager(StackConfigurationManager configurationManager) {
this.configurationManager = configurationManager;
return this;
}
public final ChefConfiguration.Builder getChefConfiguration() {
return chefConfiguration != null ? chefConfiguration.toBuilder() : null;
}
public final void setChefConfiguration(ChefConfiguration.BuilderImpl chefConfiguration) {
this.chefConfiguration = chefConfiguration != null ? chefConfiguration.build() : null;
}
@Override
public final Builder chefConfiguration(ChefConfiguration chefConfiguration) {
this.chefConfiguration = chefConfiguration;
return this;
}
public final Boolean getUseCustomCookbooks() {
return useCustomCookbooks;
}
public final void setUseCustomCookbooks(Boolean useCustomCookbooks) {
this.useCustomCookbooks = useCustomCookbooks;
}
@Override
public final Builder useCustomCookbooks(Boolean useCustomCookbooks) {
this.useCustomCookbooks = useCustomCookbooks;
return this;
}
public final Boolean getUseOpsworksSecurityGroups() {
return useOpsworksSecurityGroups;
}
public final void setUseOpsworksSecurityGroups(Boolean useOpsworksSecurityGroups) {
this.useOpsworksSecurityGroups = useOpsworksSecurityGroups;
}
@Override
public final Builder useOpsworksSecurityGroups(Boolean useOpsworksSecurityGroups) {
this.useOpsworksSecurityGroups = useOpsworksSecurityGroups;
return this;
}
public final Source.Builder getCustomCookbooksSource() {
return customCookbooksSource != null ? customCookbooksSource.toBuilder() : null;
}
public final void setCustomCookbooksSource(Source.BuilderImpl customCookbooksSource) {
this.customCookbooksSource = customCookbooksSource != null ? customCookbooksSource.build() : null;
}
@Override
public final Builder customCookbooksSource(Source customCookbooksSource) {
this.customCookbooksSource = customCookbooksSource;
return this;
}
public final String getDefaultSshKeyName() {
return defaultSshKeyName;
}
public final void setDefaultSshKeyName(String defaultSshKeyName) {
this.defaultSshKeyName = defaultSshKeyName;
}
@Override
public final Builder defaultSshKeyName(String defaultSshKeyName) {
this.defaultSshKeyName = defaultSshKeyName;
return this;
}
public final String getCreatedAt() {
return createdAt;
}
public final void setCreatedAt(String createdAt) {
this.createdAt = createdAt;
}
@Override
public final Builder createdAt(String createdAt) {
this.createdAt = createdAt;
return this;
}
public final String getDefaultRootDeviceType() {
return defaultRootDeviceType;
}
public final void setDefaultRootDeviceType(String defaultRootDeviceType) {
this.defaultRootDeviceType = defaultRootDeviceType;
}
@Override
public final Builder defaultRootDeviceType(String defaultRootDeviceType) {
this.defaultRootDeviceType = defaultRootDeviceType;
return this;
}
@Override
public final Builder defaultRootDeviceType(RootDeviceType defaultRootDeviceType) {
this.defaultRootDeviceType(defaultRootDeviceType == null ? null : defaultRootDeviceType.toString());
return this;
}
public final String getAgentVersion() {
return agentVersion;
}
public final void setAgentVersion(String agentVersion) {
this.agentVersion = agentVersion;
}
@Override
public final Builder agentVersion(String agentVersion) {
this.agentVersion = agentVersion;
return this;
}
@Override
public Stack build() {
return new Stack(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}