
software.amazon.awssdk.services.opsworks.model.CreateInstanceRequest Maven / Gradle / Ivy
/*
* Copyright 2014-2019 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.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class CreateInstanceRequest extends OpsWorksRequest implements
ToCopyableBuilder {
private static final SdkField STACK_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(CreateInstanceRequest::stackId)).setter(setter(Builder::stackId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StackId").build()).build();
private static final SdkField> LAYER_IDS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.getter(getter(CreateInstanceRequest::layerIds))
.setter(setter(Builder::layerIds))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LayerIds").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField INSTANCE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(CreateInstanceRequest::instanceType)).setter(setter(Builder::instanceType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InstanceType").build()).build();
private static final SdkField AUTO_SCALING_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(CreateInstanceRequest::autoScalingTypeAsString)).setter(setter(Builder::autoScalingType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AutoScalingType").build()).build();
private static final SdkField HOSTNAME_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(CreateInstanceRequest::hostname)).setter(setter(Builder::hostname))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Hostname").build()).build();
private static final SdkField OS_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(CreateInstanceRequest::os)).setter(setter(Builder::os))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Os").build()).build();
private static final SdkField AMI_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(CreateInstanceRequest::amiId)).setter(setter(Builder::amiId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AmiId").build()).build();
private static final SdkField SSH_KEY_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(CreateInstanceRequest::sshKeyName)).setter(setter(Builder::sshKeyName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SshKeyName").build()).build();
private static final SdkField AVAILABILITY_ZONE_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(CreateInstanceRequest::availabilityZone)).setter(setter(Builder::availabilityZone))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AvailabilityZone").build()).build();
private static final SdkField VIRTUALIZATION_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(CreateInstanceRequest::virtualizationType)).setter(setter(Builder::virtualizationType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VirtualizationType").build())
.build();
private static final SdkField SUBNET_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(CreateInstanceRequest::subnetId)).setter(setter(Builder::subnetId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SubnetId").build()).build();
private static final SdkField ARCHITECTURE_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(CreateInstanceRequest::architectureAsString)).setter(setter(Builder::architecture))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Architecture").build()).build();
private static final SdkField ROOT_DEVICE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(CreateInstanceRequest::rootDeviceTypeAsString)).setter(setter(Builder::rootDeviceType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RootDeviceType").build()).build();
private static final SdkField> BLOCK_DEVICE_MAPPINGS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.getter(getter(CreateInstanceRequest::blockDeviceMappings))
.setter(setter(Builder::blockDeviceMappings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BlockDeviceMappings").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(BlockDeviceMapping::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField INSTALL_UPDATES_ON_BOOT_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.getter(getter(CreateInstanceRequest::installUpdatesOnBoot)).setter(setter(Builder::installUpdatesOnBoot))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InstallUpdatesOnBoot").build())
.build();
private static final SdkField EBS_OPTIMIZED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.getter(getter(CreateInstanceRequest::ebsOptimized)).setter(setter(Builder::ebsOptimized))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EbsOptimized").build()).build();
private static final SdkField AGENT_VERSION_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(CreateInstanceRequest::agentVersion)).setter(setter(Builder::agentVersion))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AgentVersion").build()).build();
private static final SdkField TENANCY_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(CreateInstanceRequest::tenancy)).setter(setter(Builder::tenancy))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Tenancy").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(STACK_ID_FIELD,
LAYER_IDS_FIELD, INSTANCE_TYPE_FIELD, AUTO_SCALING_TYPE_FIELD, HOSTNAME_FIELD, OS_FIELD, AMI_ID_FIELD,
SSH_KEY_NAME_FIELD, AVAILABILITY_ZONE_FIELD, VIRTUALIZATION_TYPE_FIELD, SUBNET_ID_FIELD, ARCHITECTURE_FIELD,
ROOT_DEVICE_TYPE_FIELD, BLOCK_DEVICE_MAPPINGS_FIELD, INSTALL_UPDATES_ON_BOOT_FIELD, EBS_OPTIMIZED_FIELD,
AGENT_VERSION_FIELD, TENANCY_FIELD));
private final String stackId;
private final List layerIds;
private final String instanceType;
private final String autoScalingType;
private final String hostname;
private final String os;
private final String amiId;
private final String sshKeyName;
private final String availabilityZone;
private final String virtualizationType;
private final String subnetId;
private final String architecture;
private final String rootDeviceType;
private final List blockDeviceMappings;
private final Boolean installUpdatesOnBoot;
private final Boolean ebsOptimized;
private final String agentVersion;
private final String tenancy;
private CreateInstanceRequest(BuilderImpl builder) {
super(builder);
this.stackId = builder.stackId;
this.layerIds = builder.layerIds;
this.instanceType = builder.instanceType;
this.autoScalingType = builder.autoScalingType;
this.hostname = builder.hostname;
this.os = builder.os;
this.amiId = builder.amiId;
this.sshKeyName = builder.sshKeyName;
this.availabilityZone = builder.availabilityZone;
this.virtualizationType = builder.virtualizationType;
this.subnetId = builder.subnetId;
this.architecture = builder.architecture;
this.rootDeviceType = builder.rootDeviceType;
this.blockDeviceMappings = builder.blockDeviceMappings;
this.installUpdatesOnBoot = builder.installUpdatesOnBoot;
this.ebsOptimized = builder.ebsOptimized;
this.agentVersion = builder.agentVersion;
this.tenancy = builder.tenancy;
}
/**
*
* The stack ID.
*
*
* @return The stack ID.
*/
public String stackId() {
return stackId;
}
/**
*
* An array that contains the instance's layer IDs.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return An array that contains the instance's layer IDs.
*/
public List layerIds() {
return layerIds;
}
/**
*
* The instance type, such as t2.micro
. For a list of supported instance types, open the stack in the
* console, choose Instances, and choose + Instance. The Size list contains the currently
* supported types. For more information, see Instance Families and Types.
* The parameter values that you use to specify the various types are in the API Name column of the
* Available Instance Types table.
*
*
* @return The instance type, such as t2.micro
. For a list of supported instance types, open the stack
* in the console, choose Instances, and choose + Instance. The Size list contains the
* currently supported types. For more information, see Instance Families and
* Types. The parameter values that you use to specify the various types are in the API Name
* column of the Available Instance Types table.
*/
public String instanceType() {
return instanceType;
}
/**
*
* For load-based or time-based instances, the type. Windows stacks can use only time-based instances.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #autoScalingType}
* will return {@link AutoScalingType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #autoScalingTypeAsString}.
*
*
* @return For load-based or time-based instances, the type. Windows stacks can use only time-based instances.
* @see AutoScalingType
*/
public AutoScalingType autoScalingType() {
return AutoScalingType.fromValue(autoScalingType);
}
/**
*
* For load-based or time-based instances, the type. Windows stacks can use only time-based instances.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #autoScalingType}
* will return {@link AutoScalingType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #autoScalingTypeAsString}.
*
*
* @return For load-based or time-based instances, the type. Windows stacks can use only time-based instances.
* @see AutoScalingType
*/
public String autoScalingTypeAsString() {
return autoScalingType;
}
/**
*
* The instance host name.
*
*
* @return The instance host name.
*/
public String hostname() {
return hostname;
}
/**
*
* The instance's operating system, which must be set to one of the following.
*
*
* -
*
* A supported Linux operating system: An Amazon Linux version, such as Amazon Linux 2017.09
,
* Amazon Linux 2017.03
, Amazon Linux 2016.09
, Amazon Linux 2016.03
,
* Amazon Linux 2015.09
, or Amazon Linux 2015.03
.
*
*
* -
*
* A supported Ubuntu operating system, such as Ubuntu 16.04 LTS
, Ubuntu 14.04 LTS
, or
* Ubuntu 12.04 LTS
.
*
*
* -
*
* CentOS Linux 7
*
*
* -
*
* Red Hat Enterprise Linux 7
*
*
* -
*
* A supported Windows operating system, such as Microsoft Windows Server 2012 R2 Base
,
* Microsoft Windows Server 2012 R2 with SQL Server Express
,
* Microsoft Windows Server 2012 R2 with SQL Server Standard
, or
* Microsoft Windows Server 2012 R2 with SQL Server Web
.
*
*
* -
*
* A custom AMI: Custom
.
*
*
*
*
* For more information about the supported operating systems, see AWS OpsWorks Stacks
* Operating Systems.
*
*
* The default option is the current Amazon Linux version. If you set this parameter to Custom
, you
* must use the CreateInstance action's AmiId parameter to specify the custom AMI that you want to use. Block
* device mappings are not supported if the value is Custom
. For more information about supported
* operating systems, see Operating SystemsFor
* more information about how to use custom AMIs with AWS OpsWorks Stacks, see Using Custom
* AMIs.
*
*
* @return The instance's operating system, which must be set to one of the following.
*
* -
*
* A supported Linux operating system: An Amazon Linux version, such as Amazon Linux 2017.09
,
* Amazon Linux 2017.03
, Amazon Linux 2016.09
, Amazon Linux 2016.03
,
* Amazon Linux 2015.09
, or Amazon Linux 2015.03
.
*
*
* -
*
* A supported Ubuntu operating system, such as Ubuntu 16.04 LTS
, Ubuntu 14.04 LTS
* , or Ubuntu 12.04 LTS
.
*
*
* -
*
* CentOS Linux 7
*
*
* -
*
* Red Hat Enterprise Linux 7
*
*
* -
*
* A supported Windows operating system, such as Microsoft Windows Server 2012 R2 Base
,
* Microsoft Windows Server 2012 R2 with SQL Server Express
,
* Microsoft Windows Server 2012 R2 with SQL Server Standard
, or
* Microsoft Windows Server 2012 R2 with SQL Server Web
.
*
*
* -
*
* A custom AMI: Custom
.
*
*
*
*
* For more information about the supported operating systems, see AWS OpsWorks Stacks
* Operating Systems.
*
*
* The default option is the current Amazon Linux version. If you set this parameter to Custom
,
* you must use the CreateInstance action's AmiId parameter to specify the custom AMI that you want
* to use. Block device mappings are not supported if the value is Custom
. For more information
* about supported operating systems, see Operating
* SystemsFor more information about how to use custom AMIs with AWS OpsWorks Stacks, see Using Custom
* AMIs.
*/
public String os() {
return os;
}
/**
*
* A custom AMI ID to be used to create the instance. The AMI should be based on one of the supported operating
* systems. For more information, see Using Custom
* AMIs.
*
*
*
* If you specify a custom AMI, you must set Os
to Custom
.
*
*
*
* @return A custom AMI ID to be used to create the instance. The AMI should be based on one of the supported
* operating systems. For more information, see Using Custom
* AMIs.
*
* If you specify a custom AMI, you must set Os
to Custom
.
*
*/
public String amiId() {
return amiId;
}
/**
*
* The instance's Amazon EC2 key-pair name.
*
*
* @return The instance's Amazon EC2 key-pair name.
*/
public String sshKeyName() {
return sshKeyName;
}
/**
*
* The instance Availability Zone. For more information, see Regions and Endpoints.
*
*
* @return The instance Availability Zone. For more information, see Regions and Endpoints.
*/
public String availabilityZone() {
return availabilityZone;
}
/**
*
* The instance's virtualization type, paravirtual
or hvm
.
*
*
* @return The instance's virtualization type, paravirtual
or hvm
.
*/
public String virtualizationType() {
return virtualizationType;
}
/**
*
* The ID of the instance's subnet. If the stack is running in a VPC, you can use this parameter to override the
* stack's default subnet ID value and direct AWS OpsWorks Stacks to launch the instance in a different subnet.
*
*
* @return The ID of the instance's subnet. If the stack is running in a VPC, you can use this parameter to override
* the stack's default subnet ID value and direct AWS OpsWorks Stacks to launch the instance in a different
* subnet.
*/
public String subnetId() {
return subnetId;
}
/**
*
* The instance architecture. The default option is x86_64
. Instance types do not necessarily support
* both architectures. For a list of the architectures that are supported by the different instance types, see Instance Families and Types.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #architecture} will
* return {@link Architecture#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #architectureAsString}.
*
*
* @return The instance architecture. The default option is x86_64
. Instance types do not necessarily
* support both architectures. For a list of the architectures that are supported by the different instance
* types, see Instance
* Families and Types.
* @see Architecture
*/
public Architecture architecture() {
return Architecture.fromValue(architecture);
}
/**
*
* The instance architecture. The default option is x86_64
. Instance types do not necessarily support
* both architectures. For a list of the architectures that are supported by the different instance types, see Instance Families and Types.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #architecture} will
* return {@link Architecture#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #architectureAsString}.
*
*
* @return The instance architecture. The default option is x86_64
. Instance types do not necessarily
* support both architectures. For a list of the architectures that are supported by the different instance
* types, see Instance
* Families and Types.
* @see Architecture
*/
public String architectureAsString() {
return architecture;
}
/**
*
* The instance root device type. 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 #rootDeviceType}
* will return {@link RootDeviceType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #rootDeviceTypeAsString}.
*
*
* @return The instance root device type. For more information, see Storage for the Root Device.
* @see RootDeviceType
*/
public RootDeviceType rootDeviceType() {
return RootDeviceType.fromValue(rootDeviceType);
}
/**
*
* The instance root device type. 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 #rootDeviceType}
* will return {@link RootDeviceType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #rootDeviceTypeAsString}.
*
*
* @return The instance root device type. For more information, see Storage for the Root Device.
* @see RootDeviceType
*/
public String rootDeviceTypeAsString() {
return rootDeviceType;
}
/**
*
* An array of BlockDeviceMapping
objects that specify the instance's block devices. For more
* information, see Block Device
* Mapping. Note that block device mappings are not supported for custom AMIs.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return An array of BlockDeviceMapping
objects that specify the instance's block devices. For more
* information, see Block Device
* Mapping. Note that block device mappings are not supported for custom AMIs.
*/
public List blockDeviceMappings() {
return blockDeviceMappings;
}
/**
*
* Whether to install operating system and package updates when the instance boots. The default value is
* true
. To control when updates are installed, set this value to false
. You must then
* update your instances manually by using CreateDeployment to run the update_dependencies
stack
* command or by manually running yum
(Amazon Linux) or apt-get
(Ubuntu) on the instances.
*
*
*
* We strongly recommend using the default value of true
to ensure that your instances have the latest
* security updates.
*
*
*
* @return Whether to install operating system and package updates when the instance boots. The default value is
* true
. To control when updates are installed, set this value to false
. You must
* then update your instances manually by using CreateDeployment to run the
* update_dependencies
stack command or by manually running yum
(Amazon Linux) or
* apt-get
(Ubuntu) on the instances.
*
* We strongly recommend using the default value of true
to ensure that your instances have the
* latest security updates.
*
*/
public Boolean installUpdatesOnBoot() {
return installUpdatesOnBoot;
}
/**
*
* Whether to create an Amazon EBS-optimized instance.
*
*
* @return Whether to create an Amazon EBS-optimized instance.
*/
public Boolean ebsOptimized() {
return ebsOptimized;
}
/**
*
* The default AWS OpsWorks Stacks agent version. You have the following options:
*
*
* -
*
* INHERIT
- Use the stack's default agent version setting.
*
*
* -
*
* version_number - Use the specified agent version. This value overrides the stack's default setting. To
* update the agent version, edit the instance configuration and specify a new version. AWS OpsWorks Stacks then
* automatically installs that version on the instance.
*
*
*
*
* The default setting is INHERIT
. To specify an agent version, you must use the complete version
* number, not the abbreviated number shown on the console. For a list of available agent version numbers, call
* DescribeAgentVersions. AgentVersion cannot be set to Chef 12.2.
*
*
* @return The default AWS OpsWorks Stacks agent version. You have the following options:
*
* -
*
* INHERIT
- Use the stack's default agent version setting.
*
*
* -
*
* version_number - Use the specified agent version. This value overrides the stack's default
* setting. To update the agent version, edit the instance configuration and specify a new version. AWS
* OpsWorks Stacks then automatically installs that version on the instance.
*
*
*
*
* The default setting is INHERIT
. To specify an agent version, you must use the complete
* version number, not the abbreviated number shown on the console. For a list of available agent version
* numbers, call DescribeAgentVersions. AgentVersion cannot be set to Chef 12.2.
*/
public String agentVersion() {
return agentVersion;
}
/**
*
* The instance's tenancy option. The default option is no tenancy, or if the instance is running in a VPC, inherit
* tenancy settings from the VPC. The following are valid values for this parameter: dedicated
,
* default
, or host
. Because there are costs associated with changes in tenancy options,
* we recommend that you research tenancy options before choosing them for your instances. For more information
* about dedicated hosts, see Dedicated Hosts Overview and
* Amazon EC2 Dedicated Hosts. For more information about
* dedicated instances, see Dedicated Instances and
* Amazon EC2 Dedicated Instances.
*
*
* @return The instance's tenancy option. The default option is no tenancy, or if the instance is running in a VPC,
* inherit tenancy settings from the VPC. The following are valid values for this parameter:
* dedicated
, default
, or host
. Because there are costs associated
* with changes in tenancy options, we recommend that you research tenancy options before choosing them for
* your instances. For more information about dedicated hosts, see Dedicated Hosts Overview and Amazon EC2 Dedicated Hosts. For more information
* about dedicated instances, see Dedicated
* Instances and Amazon EC2
* Dedicated Instances.
*/
public String tenancy() {
return tenancy;
}
@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 int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(stackId());
hashCode = 31 * hashCode + Objects.hashCode(layerIds());
hashCode = 31 * hashCode + Objects.hashCode(instanceType());
hashCode = 31 * hashCode + Objects.hashCode(autoScalingTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(hostname());
hashCode = 31 * hashCode + Objects.hashCode(os());
hashCode = 31 * hashCode + Objects.hashCode(amiId());
hashCode = 31 * hashCode + Objects.hashCode(sshKeyName());
hashCode = 31 * hashCode + Objects.hashCode(availabilityZone());
hashCode = 31 * hashCode + Objects.hashCode(virtualizationType());
hashCode = 31 * hashCode + Objects.hashCode(subnetId());
hashCode = 31 * hashCode + Objects.hashCode(architectureAsString());
hashCode = 31 * hashCode + Objects.hashCode(rootDeviceTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(blockDeviceMappings());
hashCode = 31 * hashCode + Objects.hashCode(installUpdatesOnBoot());
hashCode = 31 * hashCode + Objects.hashCode(ebsOptimized());
hashCode = 31 * hashCode + Objects.hashCode(agentVersion());
hashCode = 31 * hashCode + Objects.hashCode(tenancy());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof CreateInstanceRequest)) {
return false;
}
CreateInstanceRequest other = (CreateInstanceRequest) obj;
return Objects.equals(stackId(), other.stackId()) && Objects.equals(layerIds(), other.layerIds())
&& Objects.equals(instanceType(), other.instanceType())
&& Objects.equals(autoScalingTypeAsString(), other.autoScalingTypeAsString())
&& Objects.equals(hostname(), other.hostname()) && Objects.equals(os(), other.os())
&& Objects.equals(amiId(), other.amiId()) && Objects.equals(sshKeyName(), other.sshKeyName())
&& Objects.equals(availabilityZone(), other.availabilityZone())
&& Objects.equals(virtualizationType(), other.virtualizationType())
&& Objects.equals(subnetId(), other.subnetId())
&& Objects.equals(architectureAsString(), other.architectureAsString())
&& Objects.equals(rootDeviceTypeAsString(), other.rootDeviceTypeAsString())
&& Objects.equals(blockDeviceMappings(), other.blockDeviceMappings())
&& Objects.equals(installUpdatesOnBoot(), other.installUpdatesOnBoot())
&& Objects.equals(ebsOptimized(), other.ebsOptimized()) && Objects.equals(agentVersion(), other.agentVersion())
&& Objects.equals(tenancy(), other.tenancy());
}
/**
* 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 String toString() {
return ToString.builder("CreateInstanceRequest").add("StackId", stackId()).add("LayerIds", layerIds())
.add("InstanceType", instanceType()).add("AutoScalingType", autoScalingTypeAsString())
.add("Hostname", hostname()).add("Os", os()).add("AmiId", amiId()).add("SshKeyName", sshKeyName())
.add("AvailabilityZone", availabilityZone()).add("VirtualizationType", virtualizationType())
.add("SubnetId", subnetId()).add("Architecture", architectureAsString())
.add("RootDeviceType", rootDeviceTypeAsString()).add("BlockDeviceMappings", blockDeviceMappings())
.add("InstallUpdatesOnBoot", installUpdatesOnBoot()).add("EbsOptimized", ebsOptimized())
.add("AgentVersion", agentVersion()).add("Tenancy", tenancy()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "StackId":
return Optional.ofNullable(clazz.cast(stackId()));
case "LayerIds":
return Optional.ofNullable(clazz.cast(layerIds()));
case "InstanceType":
return Optional.ofNullable(clazz.cast(instanceType()));
case "AutoScalingType":
return Optional.ofNullable(clazz.cast(autoScalingTypeAsString()));
case "Hostname":
return Optional.ofNullable(clazz.cast(hostname()));
case "Os":
return Optional.ofNullable(clazz.cast(os()));
case "AmiId":
return Optional.ofNullable(clazz.cast(amiId()));
case "SshKeyName":
return Optional.ofNullable(clazz.cast(sshKeyName()));
case "AvailabilityZone":
return Optional.ofNullable(clazz.cast(availabilityZone()));
case "VirtualizationType":
return Optional.ofNullable(clazz.cast(virtualizationType()));
case "SubnetId":
return Optional.ofNullable(clazz.cast(subnetId()));
case "Architecture":
return Optional.ofNullable(clazz.cast(architectureAsString()));
case "RootDeviceType":
return Optional.ofNullable(clazz.cast(rootDeviceTypeAsString()));
case "BlockDeviceMappings":
return Optional.ofNullable(clazz.cast(blockDeviceMappings()));
case "InstallUpdatesOnBoot":
return Optional.ofNullable(clazz.cast(installUpdatesOnBoot()));
case "EbsOptimized":
return Optional.ofNullable(clazz.cast(ebsOptimized()));
case "AgentVersion":
return Optional.ofNullable(clazz.cast(agentVersion()));
case "Tenancy":
return Optional.ofNullable(clazz.cast(tenancy()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function