com.amazonaws.services.ec2.model.CapacityReservation Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ec2 Show documentation
/*
* Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.ec2.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* Describes a Capacity Reservation.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CapacityReservation implements Serializable, Cloneable {
/**
*
* The ID of the Capacity Reservation.
*
*/
private String capacityReservationId;
/**
*
* The ID of the Amazon Web Services account that owns the Capacity Reservation.
*
*/
private String ownerId;
/**
*
* The Amazon Resource Name (ARN) of the Capacity Reservation.
*
*/
private String capacityReservationArn;
/**
*
* The Availability Zone ID of the Capacity Reservation.
*
*/
private String availabilityZoneId;
/**
*
* The type of instance for which the Capacity Reservation reserves capacity.
*
*/
private String instanceType;
/**
*
* The type of operating system for which the Capacity Reservation reserves capacity.
*
*/
private String instancePlatform;
/**
*
* The Availability Zone in which the capacity is reserved.
*
*/
private String availabilityZone;
/**
*
* Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following tenancy
* settings:
*
*
* -
*
* default
- The Capacity Reservation is created on hardware that is shared with other Amazon Web
* Services accounts.
*
*
* -
*
* dedicated
- The Capacity Reservation is created on single-tenant hardware that is dedicated to a
* single Amazon Web Services account.
*
*
*
*/
private String tenancy;
/**
*
* The total number of instances for which the Capacity Reservation reserves capacity.
*
*/
private Integer totalInstanceCount;
/**
*
* The remaining capacity. Indicates the number of instances that can be launched in the Capacity Reservation.
*
*/
private Integer availableInstanceCount;
/**
*
* Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides dedicated
* throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This
* optimization isn't available with all instance types. Additional usage charges apply when using an EBS- optimized
* instance.
*
*/
private Boolean ebsOptimized;
/**
*
* Deprecated.
*
*/
private Boolean ephemeralStorage;
/**
*
* The current state of the Capacity Reservation. A Capacity Reservation can be in one of the following states:
*
*
* -
*
* active
- The Capacity Reservation is active and the capacity is available for your use.
*
*
* -
*
* expired
- The Capacity Reservation expired automatically at the date and time specified in your
* request. The reserved capacity is no longer available for your use.
*
*
* -
*
* cancelled
- The Capacity Reservation was cancelled. The reserved capacity is no longer available for
* your use.
*
*
* -
*
* pending
- The Capacity Reservation request was successful but the capacity provisioning is still
* pending.
*
*
* -
*
* failed
- The Capacity Reservation request has failed. A request might fail due to invalid request
* parameters, capacity constraints, or instance limit constraints. Failed requests are retained for 60 minutes.
*
*
*
*/
private String state;
/**
*
* The date and time at which the Capacity Reservation was started.
*
*/
private java.util.Date startDate;
/**
*
* The date and time at which the Capacity Reservation expires. When a Capacity Reservation expires, the reserved
* capacity is released and you can no longer launch instances into it. The Capacity Reservation's state changes to
* expired
when it reaches its end date and time.
*
*/
private java.util.Date endDate;
/**
*
* Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the following
* end types:
*
*
* -
*
* unlimited
- The Capacity Reservation remains active until you explicitly cancel it.
*
*
* -
*
* limited
- The Capacity Reservation expires automatically at a specified date and time.
*
*
*
*/
private String endDateType;
/**
*
* Indicates the type of instance launches that the Capacity Reservation accepts. The options include:
*
*
* -
*
* open
- The Capacity Reservation accepts all instances that have matching attributes (instance type,
* platform, and Availability Zone). Instances that have matching attributes launch into the Capacity Reservation
* automatically without specifying any additional parameters.
*
*
* -
*
* targeted
- The Capacity Reservation only accepts instances that have matching attributes (instance
* type, platform, and Availability Zone), and explicitly target the Capacity Reservation. This ensures that only
* permitted instances can use the reserved capacity.
*
*
*
*/
private String instanceMatchCriteria;
/**
*
* The date and time at which the Capacity Reservation was created.
*
*/
private java.util.Date createDate;
/**
*
* Any tags assigned to the Capacity Reservation.
*
*/
private com.amazonaws.internal.SdkInternalList tags;
/**
*
* The Amazon Resource Name (ARN) of the Outpost on which the Capacity Reservation was created.
*
*/
private String outpostArn;
/**
*
* The ID of the Capacity Reservation Fleet to which the Capacity Reservation belongs. Only valid for Capacity
* Reservations that were created by a Capacity Reservation Fleet.
*
*/
private String capacityReservationFleetId;
/**
*
* The Amazon Resource Name (ARN) of the cluster placement group in which the Capacity Reservation was created. For
* more information, see Capacity
* Reservations for cluster placement groups in the Amazon EC2 User Guide.
*
*/
private String placementGroupArn;
/**
*
* Information about instance capacity usage.
*
*/
private com.amazonaws.internal.SdkInternalList capacityAllocations;
/**
*
* The ID of the Capacity Reservation.
*
*
* @param capacityReservationId
* The ID of the Capacity Reservation.
*/
public void setCapacityReservationId(String capacityReservationId) {
this.capacityReservationId = capacityReservationId;
}
/**
*
* The ID of the Capacity Reservation.
*
*
* @return The ID of the Capacity Reservation.
*/
public String getCapacityReservationId() {
return this.capacityReservationId;
}
/**
*
* The ID of the Capacity Reservation.
*
*
* @param capacityReservationId
* The ID of the Capacity Reservation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CapacityReservation withCapacityReservationId(String capacityReservationId) {
setCapacityReservationId(capacityReservationId);
return this;
}
/**
*
* The ID of the Amazon Web Services account that owns the Capacity Reservation.
*
*
* @param ownerId
* The ID of the Amazon Web Services account that owns the Capacity Reservation.
*/
public void setOwnerId(String ownerId) {
this.ownerId = ownerId;
}
/**
*
* The ID of the Amazon Web Services account that owns the Capacity Reservation.
*
*
* @return The ID of the Amazon Web Services account that owns the Capacity Reservation.
*/
public String getOwnerId() {
return this.ownerId;
}
/**
*
* The ID of the Amazon Web Services account that owns the Capacity Reservation.
*
*
* @param ownerId
* The ID of the Amazon Web Services account that owns the Capacity Reservation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CapacityReservation withOwnerId(String ownerId) {
setOwnerId(ownerId);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of the Capacity Reservation.
*
*
* @param capacityReservationArn
* The Amazon Resource Name (ARN) of the Capacity Reservation.
*/
public void setCapacityReservationArn(String capacityReservationArn) {
this.capacityReservationArn = capacityReservationArn;
}
/**
*
* The Amazon Resource Name (ARN) of the Capacity Reservation.
*
*
* @return The Amazon Resource Name (ARN) of the Capacity Reservation.
*/
public String getCapacityReservationArn() {
return this.capacityReservationArn;
}
/**
*
* The Amazon Resource Name (ARN) of the Capacity Reservation.
*
*
* @param capacityReservationArn
* The Amazon Resource Name (ARN) of the Capacity Reservation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CapacityReservation withCapacityReservationArn(String capacityReservationArn) {
setCapacityReservationArn(capacityReservationArn);
return this;
}
/**
*
* The Availability Zone ID of the Capacity Reservation.
*
*
* @param availabilityZoneId
* The Availability Zone ID of the Capacity Reservation.
*/
public void setAvailabilityZoneId(String availabilityZoneId) {
this.availabilityZoneId = availabilityZoneId;
}
/**
*
* The Availability Zone ID of the Capacity Reservation.
*
*
* @return The Availability Zone ID of the Capacity Reservation.
*/
public String getAvailabilityZoneId() {
return this.availabilityZoneId;
}
/**
*
* The Availability Zone ID of the Capacity Reservation.
*
*
* @param availabilityZoneId
* The Availability Zone ID of the Capacity Reservation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CapacityReservation withAvailabilityZoneId(String availabilityZoneId) {
setAvailabilityZoneId(availabilityZoneId);
return this;
}
/**
*
* The type of instance for which the Capacity Reservation reserves capacity.
*
*
* @param instanceType
* The type of instance for which the Capacity Reservation reserves capacity.
*/
public void setInstanceType(String instanceType) {
this.instanceType = instanceType;
}
/**
*
* The type of instance for which the Capacity Reservation reserves capacity.
*
*
* @return The type of instance for which the Capacity Reservation reserves capacity.
*/
public String getInstanceType() {
return this.instanceType;
}
/**
*
* The type of instance for which the Capacity Reservation reserves capacity.
*
*
* @param instanceType
* The type of instance for which the Capacity Reservation reserves capacity.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CapacityReservation withInstanceType(String instanceType) {
setInstanceType(instanceType);
return this;
}
/**
*
* The type of operating system for which the Capacity Reservation reserves capacity.
*
*
* @param instancePlatform
* The type of operating system for which the Capacity Reservation reserves capacity.
* @see CapacityReservationInstancePlatform
*/
public void setInstancePlatform(String instancePlatform) {
this.instancePlatform = instancePlatform;
}
/**
*
* The type of operating system for which the Capacity Reservation reserves capacity.
*
*
* @return The type of operating system for which the Capacity Reservation reserves capacity.
* @see CapacityReservationInstancePlatform
*/
public String getInstancePlatform() {
return this.instancePlatform;
}
/**
*
* The type of operating system for which the Capacity Reservation reserves capacity.
*
*
* @param instancePlatform
* The type of operating system for which the Capacity Reservation reserves capacity.
* @return Returns a reference to this object so that method calls can be chained together.
* @see CapacityReservationInstancePlatform
*/
public CapacityReservation withInstancePlatform(String instancePlatform) {
setInstancePlatform(instancePlatform);
return this;
}
/**
*
* The type of operating system for which the Capacity Reservation reserves capacity.
*
*
* @param instancePlatform
* The type of operating system for which the Capacity Reservation reserves capacity.
* @return Returns a reference to this object so that method calls can be chained together.
* @see CapacityReservationInstancePlatform
*/
public CapacityReservation withInstancePlatform(CapacityReservationInstancePlatform instancePlatform) {
this.instancePlatform = instancePlatform.toString();
return this;
}
/**
*
* The Availability Zone in which the capacity is reserved.
*
*
* @param availabilityZone
* The Availability Zone in which the capacity is reserved.
*/
public void setAvailabilityZone(String availabilityZone) {
this.availabilityZone = availabilityZone;
}
/**
*
* The Availability Zone in which the capacity is reserved.
*
*
* @return The Availability Zone in which the capacity is reserved.
*/
public String getAvailabilityZone() {
return this.availabilityZone;
}
/**
*
* The Availability Zone in which the capacity is reserved.
*
*
* @param availabilityZone
* The Availability Zone in which the capacity is reserved.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CapacityReservation withAvailabilityZone(String availabilityZone) {
setAvailabilityZone(availabilityZone);
return this;
}
/**
*
* Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following tenancy
* settings:
*
*
* -
*
* default
- The Capacity Reservation is created on hardware that is shared with other Amazon Web
* Services accounts.
*
*
* -
*
* dedicated
- The Capacity Reservation is created on single-tenant hardware that is dedicated to a
* single Amazon Web Services account.
*
*
*
*
* @param tenancy
* Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following
* tenancy settings:
*
* -
*
* default
- The Capacity Reservation is created on hardware that is shared with other Amazon
* Web Services accounts.
*
*
* -
*
* dedicated
- The Capacity Reservation is created on single-tenant hardware that is dedicated
* to a single Amazon Web Services account.
*
*
* @see CapacityReservationTenancy
*/
public void setTenancy(String tenancy) {
this.tenancy = tenancy;
}
/**
*
* Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following tenancy
* settings:
*
*
* -
*
* default
- The Capacity Reservation is created on hardware that is shared with other Amazon Web
* Services accounts.
*
*
* -
*
* dedicated
- The Capacity Reservation is created on single-tenant hardware that is dedicated to a
* single Amazon Web Services account.
*
*
*
*
* @return Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following
* tenancy settings:
*
* -
*
* default
- The Capacity Reservation is created on hardware that is shared with other Amazon
* Web Services accounts.
*
*
* -
*
* dedicated
- The Capacity Reservation is created on single-tenant hardware that is dedicated
* to a single Amazon Web Services account.
*
*
* @see CapacityReservationTenancy
*/
public String getTenancy() {
return this.tenancy;
}
/**
*
* Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following tenancy
* settings:
*
*
* -
*
* default
- The Capacity Reservation is created on hardware that is shared with other Amazon Web
* Services accounts.
*
*
* -
*
* dedicated
- The Capacity Reservation is created on single-tenant hardware that is dedicated to a
* single Amazon Web Services account.
*
*
*
*
* @param tenancy
* Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following
* tenancy settings:
*
* -
*
* default
- The Capacity Reservation is created on hardware that is shared with other Amazon
* Web Services accounts.
*
*
* -
*
* dedicated
- The Capacity Reservation is created on single-tenant hardware that is dedicated
* to a single Amazon Web Services account.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see CapacityReservationTenancy
*/
public CapacityReservation withTenancy(String tenancy) {
setTenancy(tenancy);
return this;
}
/**
*
* Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following tenancy
* settings:
*
*
* -
*
* default
- The Capacity Reservation is created on hardware that is shared with other Amazon Web
* Services accounts.
*
*
* -
*
* dedicated
- The Capacity Reservation is created on single-tenant hardware that is dedicated to a
* single Amazon Web Services account.
*
*
*
*
* @param tenancy
* Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following
* tenancy settings:
*
* -
*
* default
- The Capacity Reservation is created on hardware that is shared with other Amazon
* Web Services accounts.
*
*
* -
*
* dedicated
- The Capacity Reservation is created on single-tenant hardware that is dedicated
* to a single Amazon Web Services account.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see CapacityReservationTenancy
*/
public CapacityReservation withTenancy(CapacityReservationTenancy tenancy) {
this.tenancy = tenancy.toString();
return this;
}
/**
*
* The total number of instances for which the Capacity Reservation reserves capacity.
*
*
* @param totalInstanceCount
* The total number of instances for which the Capacity Reservation reserves capacity.
*/
public void setTotalInstanceCount(Integer totalInstanceCount) {
this.totalInstanceCount = totalInstanceCount;
}
/**
*
* The total number of instances for which the Capacity Reservation reserves capacity.
*
*
* @return The total number of instances for which the Capacity Reservation reserves capacity.
*/
public Integer getTotalInstanceCount() {
return this.totalInstanceCount;
}
/**
*
* The total number of instances for which the Capacity Reservation reserves capacity.
*
*
* @param totalInstanceCount
* The total number of instances for which the Capacity Reservation reserves capacity.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CapacityReservation withTotalInstanceCount(Integer totalInstanceCount) {
setTotalInstanceCount(totalInstanceCount);
return this;
}
/**
*
* The remaining capacity. Indicates the number of instances that can be launched in the Capacity Reservation.
*
*
* @param availableInstanceCount
* The remaining capacity. Indicates the number of instances that can be launched in the Capacity
* Reservation.
*/
public void setAvailableInstanceCount(Integer availableInstanceCount) {
this.availableInstanceCount = availableInstanceCount;
}
/**
*
* The remaining capacity. Indicates the number of instances that can be launched in the Capacity Reservation.
*
*
* @return The remaining capacity. Indicates the number of instances that can be launched in the Capacity
* Reservation.
*/
public Integer getAvailableInstanceCount() {
return this.availableInstanceCount;
}
/**
*
* The remaining capacity. Indicates the number of instances that can be launched in the Capacity Reservation.
*
*
* @param availableInstanceCount
* The remaining capacity. Indicates the number of instances that can be launched in the Capacity
* Reservation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CapacityReservation withAvailableInstanceCount(Integer availableInstanceCount) {
setAvailableInstanceCount(availableInstanceCount);
return this;
}
/**
*
* Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides dedicated
* throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This
* optimization isn't available with all instance types. Additional usage charges apply when using an EBS- optimized
* instance.
*
*
* @param ebsOptimized
* Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides
* dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O
* performance. This optimization isn't available with all instance types. Additional usage charges apply
* when using an EBS- optimized instance.
*/
public void setEbsOptimized(Boolean ebsOptimized) {
this.ebsOptimized = ebsOptimized;
}
/**
*
* Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides dedicated
* throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This
* optimization isn't available with all instance types. Additional usage charges apply when using an EBS- optimized
* instance.
*
*
* @return Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides
* dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O
* performance. This optimization isn't available with all instance types. Additional usage charges apply
* when using an EBS- optimized instance.
*/
public Boolean getEbsOptimized() {
return this.ebsOptimized;
}
/**
*
* Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides dedicated
* throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This
* optimization isn't available with all instance types. Additional usage charges apply when using an EBS- optimized
* instance.
*
*
* @param ebsOptimized
* Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides
* dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O
* performance. This optimization isn't available with all instance types. Additional usage charges apply
* when using an EBS- optimized instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CapacityReservation withEbsOptimized(Boolean ebsOptimized) {
setEbsOptimized(ebsOptimized);
return this;
}
/**
*
* Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides dedicated
* throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This
* optimization isn't available with all instance types. Additional usage charges apply when using an EBS- optimized
* instance.
*
*
* @return Indicates whether the Capacity Reservation supports EBS-optimized instances. This optimization provides
* dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O
* performance. This optimization isn't available with all instance types. Additional usage charges apply
* when using an EBS- optimized instance.
*/
public Boolean isEbsOptimized() {
return this.ebsOptimized;
}
/**
*
* Deprecated.
*
*
* @param ephemeralStorage
* Deprecated.
*/
public void setEphemeralStorage(Boolean ephemeralStorage) {
this.ephemeralStorage = ephemeralStorage;
}
/**
*
* Deprecated.
*
*
* @return Deprecated.
*/
public Boolean getEphemeralStorage() {
return this.ephemeralStorage;
}
/**
*
* Deprecated.
*
*
* @param ephemeralStorage
* Deprecated.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CapacityReservation withEphemeralStorage(Boolean ephemeralStorage) {
setEphemeralStorage(ephemeralStorage);
return this;
}
/**
*
* Deprecated.
*
*
* @return Deprecated.
*/
public Boolean isEphemeralStorage() {
return this.ephemeralStorage;
}
/**
*
* The current state of the Capacity Reservation. A Capacity Reservation can be in one of the following states:
*
*
* -
*
* active
- The Capacity Reservation is active and the capacity is available for your use.
*
*
* -
*
* expired
- The Capacity Reservation expired automatically at the date and time specified in your
* request. The reserved capacity is no longer available for your use.
*
*
* -
*
* cancelled
- The Capacity Reservation was cancelled. The reserved capacity is no longer available for
* your use.
*
*
* -
*
* pending
- The Capacity Reservation request was successful but the capacity provisioning is still
* pending.
*
*
* -
*
* failed
- The Capacity Reservation request has failed. A request might fail due to invalid request
* parameters, capacity constraints, or instance limit constraints. Failed requests are retained for 60 minutes.
*
*
*
*
* @param state
* The current state of the Capacity Reservation. A Capacity Reservation can be in one of the following
* states:
*
* -
*
* active
- The Capacity Reservation is active and the capacity is available for your use.
*
*
* -
*
* expired
- The Capacity Reservation expired automatically at the date and time specified in
* your request. The reserved capacity is no longer available for your use.
*
*
* -
*
* cancelled
- The Capacity Reservation was cancelled. The reserved capacity is no longer
* available for your use.
*
*
* -
*
* pending
- The Capacity Reservation request was successful but the capacity provisioning is
* still pending.
*
*
* -
*
* failed
- The Capacity Reservation request has failed. A request might fail due to invalid
* request parameters, capacity constraints, or instance limit constraints. Failed requests are retained for
* 60 minutes.
*
*
* @see CapacityReservationState
*/
public void setState(String state) {
this.state = state;
}
/**
*
* The current state of the Capacity Reservation. A Capacity Reservation can be in one of the following states:
*
*
* -
*
* active
- The Capacity Reservation is active and the capacity is available for your use.
*
*
* -
*
* expired
- The Capacity Reservation expired automatically at the date and time specified in your
* request. The reserved capacity is no longer available for your use.
*
*
* -
*
* cancelled
- The Capacity Reservation was cancelled. The reserved capacity is no longer available for
* your use.
*
*
* -
*
* pending
- The Capacity Reservation request was successful but the capacity provisioning is still
* pending.
*
*
* -
*
* failed
- The Capacity Reservation request has failed. A request might fail due to invalid request
* parameters, capacity constraints, or instance limit constraints. Failed requests are retained for 60 minutes.
*
*
*
*
* @return The current state of the Capacity Reservation. A Capacity Reservation can be in one of the following
* states:
*
* -
*
* active
- The Capacity Reservation is active and the capacity is available for your use.
*
*
* -
*
* expired
- The Capacity Reservation expired automatically at the date and time specified in
* your request. The reserved capacity is no longer available for your use.
*
*
* -
*
* cancelled
- The Capacity Reservation was cancelled. The reserved capacity is no longer
* available for your use.
*
*
* -
*
* pending
- The Capacity Reservation request was successful but the capacity provisioning is
* still pending.
*
*
* -
*
* failed
- The Capacity Reservation request has failed. A request might fail due to invalid
* request parameters, capacity constraints, or instance limit constraints. Failed requests are retained for
* 60 minutes.
*
*
* @see CapacityReservationState
*/
public String getState() {
return this.state;
}
/**
*
* The current state of the Capacity Reservation. A Capacity Reservation can be in one of the following states:
*
*
* -
*
* active
- The Capacity Reservation is active and the capacity is available for your use.
*
*
* -
*
* expired
- The Capacity Reservation expired automatically at the date and time specified in your
* request. The reserved capacity is no longer available for your use.
*
*
* -
*
* cancelled
- The Capacity Reservation was cancelled. The reserved capacity is no longer available for
* your use.
*
*
* -
*
* pending
- The Capacity Reservation request was successful but the capacity provisioning is still
* pending.
*
*
* -
*
* failed
- The Capacity Reservation request has failed. A request might fail due to invalid request
* parameters, capacity constraints, or instance limit constraints. Failed requests are retained for 60 minutes.
*
*
*
*
* @param state
* The current state of the Capacity Reservation. A Capacity Reservation can be in one of the following
* states:
*
* -
*
* active
- The Capacity Reservation is active and the capacity is available for your use.
*
*
* -
*
* expired
- The Capacity Reservation expired automatically at the date and time specified in
* your request. The reserved capacity is no longer available for your use.
*
*
* -
*
* cancelled
- The Capacity Reservation was cancelled. The reserved capacity is no longer
* available for your use.
*
*
* -
*
* pending
- The Capacity Reservation request was successful but the capacity provisioning is
* still pending.
*
*
* -
*
* failed
- The Capacity Reservation request has failed. A request might fail due to invalid
* request parameters, capacity constraints, or instance limit constraints. Failed requests are retained for
* 60 minutes.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see CapacityReservationState
*/
public CapacityReservation withState(String state) {
setState(state);
return this;
}
/**
*
* The current state of the Capacity Reservation. A Capacity Reservation can be in one of the following states:
*
*
* -
*
* active
- The Capacity Reservation is active and the capacity is available for your use.
*
*
* -
*
* expired
- The Capacity Reservation expired automatically at the date and time specified in your
* request. The reserved capacity is no longer available for your use.
*
*
* -
*
* cancelled
- The Capacity Reservation was cancelled. The reserved capacity is no longer available for
* your use.
*
*
* -
*
* pending
- The Capacity Reservation request was successful but the capacity provisioning is still
* pending.
*
*
* -
*
* failed
- The Capacity Reservation request has failed. A request might fail due to invalid request
* parameters, capacity constraints, or instance limit constraints. Failed requests are retained for 60 minutes.
*
*
*
*
* @param state
* The current state of the Capacity Reservation. A Capacity Reservation can be in one of the following
* states:
*
* -
*
* active
- The Capacity Reservation is active and the capacity is available for your use.
*
*
* -
*
* expired
- The Capacity Reservation expired automatically at the date and time specified in
* your request. The reserved capacity is no longer available for your use.
*
*
* -
*
* cancelled
- The Capacity Reservation was cancelled. The reserved capacity is no longer
* available for your use.
*
*
* -
*
* pending
- The Capacity Reservation request was successful but the capacity provisioning is
* still pending.
*
*
* -
*
* failed
- The Capacity Reservation request has failed. A request might fail due to invalid
* request parameters, capacity constraints, or instance limit constraints. Failed requests are retained for
* 60 minutes.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see CapacityReservationState
*/
public CapacityReservation withState(CapacityReservationState state) {
this.state = state.toString();
return this;
}
/**
*
* The date and time at which the Capacity Reservation was started.
*
*
* @param startDate
* The date and time at which the Capacity Reservation was started.
*/
public void setStartDate(java.util.Date startDate) {
this.startDate = startDate;
}
/**
*
* The date and time at which the Capacity Reservation was started.
*
*
* @return The date and time at which the Capacity Reservation was started.
*/
public java.util.Date getStartDate() {
return this.startDate;
}
/**
*
* The date and time at which the Capacity Reservation was started.
*
*
* @param startDate
* The date and time at which the Capacity Reservation was started.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CapacityReservation withStartDate(java.util.Date startDate) {
setStartDate(startDate);
return this;
}
/**
*
* The date and time at which the Capacity Reservation expires. When a Capacity Reservation expires, the reserved
* capacity is released and you can no longer launch instances into it. The Capacity Reservation's state changes to
* expired
when it reaches its end date and time.
*
*
* @param endDate
* The date and time at which the Capacity Reservation expires. When a Capacity Reservation expires, the
* reserved capacity is released and you can no longer launch instances into it. The Capacity Reservation's
* state changes to expired
when it reaches its end date and time.
*/
public void setEndDate(java.util.Date endDate) {
this.endDate = endDate;
}
/**
*
* The date and time at which the Capacity Reservation expires. When a Capacity Reservation expires, the reserved
* capacity is released and you can no longer launch instances into it. The Capacity Reservation's state changes to
* expired
when it reaches its end date and time.
*
*
* @return The date and time at which the Capacity Reservation expires. When a Capacity Reservation expires, the
* reserved capacity is released and you can no longer launch instances into it. The Capacity Reservation's
* state changes to expired
when it reaches its end date and time.
*/
public java.util.Date getEndDate() {
return this.endDate;
}
/**
*
* The date and time at which the Capacity Reservation expires. When a Capacity Reservation expires, the reserved
* capacity is released and you can no longer launch instances into it. The Capacity Reservation's state changes to
* expired
when it reaches its end date and time.
*
*
* @param endDate
* The date and time at which the Capacity Reservation expires. When a Capacity Reservation expires, the
* reserved capacity is released and you can no longer launch instances into it. The Capacity Reservation's
* state changes to expired
when it reaches its end date and time.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CapacityReservation withEndDate(java.util.Date endDate) {
setEndDate(endDate);
return this;
}
/**
*
* Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the following
* end types:
*
*
* -
*
* unlimited
- The Capacity Reservation remains active until you explicitly cancel it.
*
*
* -
*
* limited
- The Capacity Reservation expires automatically at a specified date and time.
*
*
*
*
* @param endDateType
* Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the
* following end types:
*
* -
*
* unlimited
- The Capacity Reservation remains active until you explicitly cancel it.
*
*
* -
*
* limited
- The Capacity Reservation expires automatically at a specified date and time.
*
*
* @see EndDateType
*/
public void setEndDateType(String endDateType) {
this.endDateType = endDateType;
}
/**
*
* Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the following
* end types:
*
*
* -
*
* unlimited
- The Capacity Reservation remains active until you explicitly cancel it.
*
*
* -
*
* limited
- The Capacity Reservation expires automatically at a specified date and time.
*
*
*
*
* @return Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the
* following end types:
*
* -
*
* unlimited
- The Capacity Reservation remains active until you explicitly cancel it.
*
*
* -
*
* limited
- The Capacity Reservation expires automatically at a specified date and time.
*
*
* @see EndDateType
*/
public String getEndDateType() {
return this.endDateType;
}
/**
*
* Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the following
* end types:
*
*
* -
*
* unlimited
- The Capacity Reservation remains active until you explicitly cancel it.
*
*
* -
*
* limited
- The Capacity Reservation expires automatically at a specified date and time.
*
*
*
*
* @param endDateType
* Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the
* following end types:
*
* -
*
* unlimited
- The Capacity Reservation remains active until you explicitly cancel it.
*
*
* -
*
* limited
- The Capacity Reservation expires automatically at a specified date and time.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see EndDateType
*/
public CapacityReservation withEndDateType(String endDateType) {
setEndDateType(endDateType);
return this;
}
/**
*
* Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the following
* end types:
*
*
* -
*
* unlimited
- The Capacity Reservation remains active until you explicitly cancel it.
*
*
* -
*
* limited
- The Capacity Reservation expires automatically at a specified date and time.
*
*
*
*
* @param endDateType
* Indicates the way in which the Capacity Reservation ends. A Capacity Reservation can have one of the
* following end types:
*
* -
*
* unlimited
- The Capacity Reservation remains active until you explicitly cancel it.
*
*
* -
*
* limited
- The Capacity Reservation expires automatically at a specified date and time.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see EndDateType
*/
public CapacityReservation withEndDateType(EndDateType endDateType) {
this.endDateType = endDateType.toString();
return this;
}
/**
*
* Indicates the type of instance launches that the Capacity Reservation accepts. The options include:
*
*
* -
*
* open
- The Capacity Reservation accepts all instances that have matching attributes (instance type,
* platform, and Availability Zone). Instances that have matching attributes launch into the Capacity Reservation
* automatically without specifying any additional parameters.
*
*
* -
*
* targeted
- The Capacity Reservation only accepts instances that have matching attributes (instance
* type, platform, and Availability Zone), and explicitly target the Capacity Reservation. This ensures that only
* permitted instances can use the reserved capacity.
*
*
*
*
* @param instanceMatchCriteria
* Indicates the type of instance launches that the Capacity Reservation accepts. The options include:
*
* -
*
* open
- The Capacity Reservation accepts all instances that have matching attributes (instance
* type, platform, and Availability Zone). Instances that have matching attributes launch into the Capacity
* Reservation automatically without specifying any additional parameters.
*
*
* -
*
* targeted
- The Capacity Reservation only accepts instances that have matching attributes
* (instance type, platform, and Availability Zone), and explicitly target the Capacity Reservation. This
* ensures that only permitted instances can use the reserved capacity.
*
*
* @see InstanceMatchCriteria
*/
public void setInstanceMatchCriteria(String instanceMatchCriteria) {
this.instanceMatchCriteria = instanceMatchCriteria;
}
/**
*
* Indicates the type of instance launches that the Capacity Reservation accepts. The options include:
*
*
* -
*
* open
- The Capacity Reservation accepts all instances that have matching attributes (instance type,
* platform, and Availability Zone). Instances that have matching attributes launch into the Capacity Reservation
* automatically without specifying any additional parameters.
*
*
* -
*
* targeted
- The Capacity Reservation only accepts instances that have matching attributes (instance
* type, platform, and Availability Zone), and explicitly target the Capacity Reservation. This ensures that only
* permitted instances can use the reserved capacity.
*
*
*
*
* @return Indicates the type of instance launches that the Capacity Reservation accepts. The options include:
*
* -
*
* open
- The Capacity Reservation accepts all instances that have matching attributes
* (instance type, platform, and Availability Zone). Instances that have matching attributes launch into the
* Capacity Reservation automatically without specifying any additional parameters.
*
*
* -
*
* targeted
- The Capacity Reservation only accepts instances that have matching attributes
* (instance type, platform, and Availability Zone), and explicitly target the Capacity Reservation. This
* ensures that only permitted instances can use the reserved capacity.
*
*
* @see InstanceMatchCriteria
*/
public String getInstanceMatchCriteria() {
return this.instanceMatchCriteria;
}
/**
*
* Indicates the type of instance launches that the Capacity Reservation accepts. The options include:
*
*
* -
*
* open
- The Capacity Reservation accepts all instances that have matching attributes (instance type,
* platform, and Availability Zone). Instances that have matching attributes launch into the Capacity Reservation
* automatically without specifying any additional parameters.
*
*
* -
*
* targeted
- The Capacity Reservation only accepts instances that have matching attributes (instance
* type, platform, and Availability Zone), and explicitly target the Capacity Reservation. This ensures that only
* permitted instances can use the reserved capacity.
*
*
*
*
* @param instanceMatchCriteria
* Indicates the type of instance launches that the Capacity Reservation accepts. The options include:
*
* -
*
* open
- The Capacity Reservation accepts all instances that have matching attributes (instance
* type, platform, and Availability Zone). Instances that have matching attributes launch into the Capacity
* Reservation automatically without specifying any additional parameters.
*
*
* -
*
* targeted
- The Capacity Reservation only accepts instances that have matching attributes
* (instance type, platform, and Availability Zone), and explicitly target the Capacity Reservation. This
* ensures that only permitted instances can use the reserved capacity.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see InstanceMatchCriteria
*/
public CapacityReservation withInstanceMatchCriteria(String instanceMatchCriteria) {
setInstanceMatchCriteria(instanceMatchCriteria);
return this;
}
/**
*
* Indicates the type of instance launches that the Capacity Reservation accepts. The options include:
*
*
* -
*
* open
- The Capacity Reservation accepts all instances that have matching attributes (instance type,
* platform, and Availability Zone). Instances that have matching attributes launch into the Capacity Reservation
* automatically without specifying any additional parameters.
*
*
* -
*
* targeted
- The Capacity Reservation only accepts instances that have matching attributes (instance
* type, platform, and Availability Zone), and explicitly target the Capacity Reservation. This ensures that only
* permitted instances can use the reserved capacity.
*
*
*
*
* @param instanceMatchCriteria
* Indicates the type of instance launches that the Capacity Reservation accepts. The options include:
*
* -
*
* open
- The Capacity Reservation accepts all instances that have matching attributes (instance
* type, platform, and Availability Zone). Instances that have matching attributes launch into the Capacity
* Reservation automatically without specifying any additional parameters.
*
*
* -
*
* targeted
- The Capacity Reservation only accepts instances that have matching attributes
* (instance type, platform, and Availability Zone), and explicitly target the Capacity Reservation. This
* ensures that only permitted instances can use the reserved capacity.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see InstanceMatchCriteria
*/
public CapacityReservation withInstanceMatchCriteria(InstanceMatchCriteria instanceMatchCriteria) {
this.instanceMatchCriteria = instanceMatchCriteria.toString();
return this;
}
/**
*
* The date and time at which the Capacity Reservation was created.
*
*
* @param createDate
* The date and time at which the Capacity Reservation was created.
*/
public void setCreateDate(java.util.Date createDate) {
this.createDate = createDate;
}
/**
*
* The date and time at which the Capacity Reservation was created.
*
*
* @return The date and time at which the Capacity Reservation was created.
*/
public java.util.Date getCreateDate() {
return this.createDate;
}
/**
*
* The date and time at which the Capacity Reservation was created.
*
*
* @param createDate
* The date and time at which the Capacity Reservation was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CapacityReservation withCreateDate(java.util.Date createDate) {
setCreateDate(createDate);
return this;
}
/**
*
* Any tags assigned to the Capacity Reservation.
*
*
* @return Any tags assigned to the Capacity Reservation.
*/
public java.util.List getTags() {
if (tags == null) {
tags = new com.amazonaws.internal.SdkInternalList();
}
return tags;
}
/**
*
* Any tags assigned to the Capacity Reservation.
*
*
* @param tags
* Any tags assigned to the Capacity Reservation.
*/
public void setTags(java.util.Collection tags) {
if (tags == null) {
this.tags = null;
return;
}
this.tags = new com.amazonaws.internal.SdkInternalList(tags);
}
/**
*
* Any tags assigned to the Capacity Reservation.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param tags
* Any tags assigned to the Capacity Reservation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CapacityReservation withTags(Tag... tags) {
if (this.tags == null) {
setTags(new com.amazonaws.internal.SdkInternalList(tags.length));
}
for (Tag ele : tags) {
this.tags.add(ele);
}
return this;
}
/**
*
* Any tags assigned to the Capacity Reservation.
*
*
* @param tags
* Any tags assigned to the Capacity Reservation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CapacityReservation withTags(java.util.Collection tags) {
setTags(tags);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of the Outpost on which the Capacity Reservation was created.
*
*
* @param outpostArn
* The Amazon Resource Name (ARN) of the Outpost on which the Capacity Reservation was created.
*/
public void setOutpostArn(String outpostArn) {
this.outpostArn = outpostArn;
}
/**
*
* The Amazon Resource Name (ARN) of the Outpost on which the Capacity Reservation was created.
*
*
* @return The Amazon Resource Name (ARN) of the Outpost on which the Capacity Reservation was created.
*/
public String getOutpostArn() {
return this.outpostArn;
}
/**
*
* The Amazon Resource Name (ARN) of the Outpost on which the Capacity Reservation was created.
*
*
* @param outpostArn
* The Amazon Resource Name (ARN) of the Outpost on which the Capacity Reservation was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CapacityReservation withOutpostArn(String outpostArn) {
setOutpostArn(outpostArn);
return this;
}
/**
*
* The ID of the Capacity Reservation Fleet to which the Capacity Reservation belongs. Only valid for Capacity
* Reservations that were created by a Capacity Reservation Fleet.
*
*
* @param capacityReservationFleetId
* The ID of the Capacity Reservation Fleet to which the Capacity Reservation belongs. Only valid for
* Capacity Reservations that were created by a Capacity Reservation Fleet.
*/
public void setCapacityReservationFleetId(String capacityReservationFleetId) {
this.capacityReservationFleetId = capacityReservationFleetId;
}
/**
*
* The ID of the Capacity Reservation Fleet to which the Capacity Reservation belongs. Only valid for Capacity
* Reservations that were created by a Capacity Reservation Fleet.
*
*
* @return The ID of the Capacity Reservation Fleet to which the Capacity Reservation belongs. Only valid for
* Capacity Reservations that were created by a Capacity Reservation Fleet.
*/
public String getCapacityReservationFleetId() {
return this.capacityReservationFleetId;
}
/**
*
* The ID of the Capacity Reservation Fleet to which the Capacity Reservation belongs. Only valid for Capacity
* Reservations that were created by a Capacity Reservation Fleet.
*
*
* @param capacityReservationFleetId
* The ID of the Capacity Reservation Fleet to which the Capacity Reservation belongs. Only valid for
* Capacity Reservations that were created by a Capacity Reservation Fleet.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CapacityReservation withCapacityReservationFleetId(String capacityReservationFleetId) {
setCapacityReservationFleetId(capacityReservationFleetId);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of the cluster placement group in which the Capacity Reservation was created. For
* more information, see Capacity
* Reservations for cluster placement groups in the Amazon EC2 User Guide.
*
*
* @param placementGroupArn
* The Amazon Resource Name (ARN) of the cluster placement group in which the Capacity Reservation was
* created. For more information, see Capacity Reservations for cluster
* placement groups in the Amazon EC2 User Guide.
*/
public void setPlacementGroupArn(String placementGroupArn) {
this.placementGroupArn = placementGroupArn;
}
/**
*
* The Amazon Resource Name (ARN) of the cluster placement group in which the Capacity Reservation was created. For
* more information, see Capacity
* Reservations for cluster placement groups in the Amazon EC2 User Guide.
*
*
* @return The Amazon Resource Name (ARN) of the cluster placement group in which the Capacity Reservation was
* created. For more information, see Capacity Reservations for cluster
* placement groups in the Amazon EC2 User Guide.
*/
public String getPlacementGroupArn() {
return this.placementGroupArn;
}
/**
*
* The Amazon Resource Name (ARN) of the cluster placement group in which the Capacity Reservation was created. For
* more information, see Capacity
* Reservations for cluster placement groups in the Amazon EC2 User Guide.
*
*
* @param placementGroupArn
* The Amazon Resource Name (ARN) of the cluster placement group in which the Capacity Reservation was
* created. For more information, see Capacity Reservations for cluster
* placement groups in the Amazon EC2 User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CapacityReservation withPlacementGroupArn(String placementGroupArn) {
setPlacementGroupArn(placementGroupArn);
return this;
}
/**
*
* Information about instance capacity usage.
*
*
* @return Information about instance capacity usage.
*/
public java.util.List getCapacityAllocations() {
if (capacityAllocations == null) {
capacityAllocations = new com.amazonaws.internal.SdkInternalList();
}
return capacityAllocations;
}
/**
*
* Information about instance capacity usage.
*
*
* @param capacityAllocations
* Information about instance capacity usage.
*/
public void setCapacityAllocations(java.util.Collection capacityAllocations) {
if (capacityAllocations == null) {
this.capacityAllocations = null;
return;
}
this.capacityAllocations = new com.amazonaws.internal.SdkInternalList(capacityAllocations);
}
/**
*
* Information about instance capacity usage.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setCapacityAllocations(java.util.Collection)} or {@link #withCapacityAllocations(java.util.Collection)}
* if you want to override the existing values.
*
*
* @param capacityAllocations
* Information about instance capacity usage.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CapacityReservation withCapacityAllocations(CapacityAllocation... capacityAllocations) {
if (this.capacityAllocations == null) {
setCapacityAllocations(new com.amazonaws.internal.SdkInternalList(capacityAllocations.length));
}
for (CapacityAllocation ele : capacityAllocations) {
this.capacityAllocations.add(ele);
}
return this;
}
/**
*
* Information about instance capacity usage.
*
*
* @param capacityAllocations
* Information about instance capacity usage.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CapacityReservation withCapacityAllocations(java.util.Collection capacityAllocations) {
setCapacityAllocations(capacityAllocations);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getCapacityReservationId() != null)
sb.append("CapacityReservationId: ").append(getCapacityReservationId()).append(",");
if (getOwnerId() != null)
sb.append("OwnerId: ").append(getOwnerId()).append(",");
if (getCapacityReservationArn() != null)
sb.append("CapacityReservationArn: ").append(getCapacityReservationArn()).append(",");
if (getAvailabilityZoneId() != null)
sb.append("AvailabilityZoneId: ").append(getAvailabilityZoneId()).append(",");
if (getInstanceType() != null)
sb.append("InstanceType: ").append(getInstanceType()).append(",");
if (getInstancePlatform() != null)
sb.append("InstancePlatform: ").append(getInstancePlatform()).append(",");
if (getAvailabilityZone() != null)
sb.append("AvailabilityZone: ").append(getAvailabilityZone()).append(",");
if (getTenancy() != null)
sb.append("Tenancy: ").append(getTenancy()).append(",");
if (getTotalInstanceCount() != null)
sb.append("TotalInstanceCount: ").append(getTotalInstanceCount()).append(",");
if (getAvailableInstanceCount() != null)
sb.append("AvailableInstanceCount: ").append(getAvailableInstanceCount()).append(",");
if (getEbsOptimized() != null)
sb.append("EbsOptimized: ").append(getEbsOptimized()).append(",");
if (getEphemeralStorage() != null)
sb.append("EphemeralStorage: ").append(getEphemeralStorage()).append(",");
if (getState() != null)
sb.append("State: ").append(getState()).append(",");
if (getStartDate() != null)
sb.append("StartDate: ").append(getStartDate()).append(",");
if (getEndDate() != null)
sb.append("EndDate: ").append(getEndDate()).append(",");
if (getEndDateType() != null)
sb.append("EndDateType: ").append(getEndDateType()).append(",");
if (getInstanceMatchCriteria() != null)
sb.append("InstanceMatchCriteria: ").append(getInstanceMatchCriteria()).append(",");
if (getCreateDate() != null)
sb.append("CreateDate: ").append(getCreateDate()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags()).append(",");
if (getOutpostArn() != null)
sb.append("OutpostArn: ").append(getOutpostArn()).append(",");
if (getCapacityReservationFleetId() != null)
sb.append("CapacityReservationFleetId: ").append(getCapacityReservationFleetId()).append(",");
if (getPlacementGroupArn() != null)
sb.append("PlacementGroupArn: ").append(getPlacementGroupArn()).append(",");
if (getCapacityAllocations() != null)
sb.append("CapacityAllocations: ").append(getCapacityAllocations());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CapacityReservation == false)
return false;
CapacityReservation other = (CapacityReservation) obj;
if (other.getCapacityReservationId() == null ^ this.getCapacityReservationId() == null)
return false;
if (other.getCapacityReservationId() != null && other.getCapacityReservationId().equals(this.getCapacityReservationId()) == false)
return false;
if (other.getOwnerId() == null ^ this.getOwnerId() == null)
return false;
if (other.getOwnerId() != null && other.getOwnerId().equals(this.getOwnerId()) == false)
return false;
if (other.getCapacityReservationArn() == null ^ this.getCapacityReservationArn() == null)
return false;
if (other.getCapacityReservationArn() != null && other.getCapacityReservationArn().equals(this.getCapacityReservationArn()) == false)
return false;
if (other.getAvailabilityZoneId() == null ^ this.getAvailabilityZoneId() == null)
return false;
if (other.getAvailabilityZoneId() != null && other.getAvailabilityZoneId().equals(this.getAvailabilityZoneId()) == false)
return false;
if (other.getInstanceType() == null ^ this.getInstanceType() == null)
return false;
if (other.getInstanceType() != null && other.getInstanceType().equals(this.getInstanceType()) == false)
return false;
if (other.getInstancePlatform() == null ^ this.getInstancePlatform() == null)
return false;
if (other.getInstancePlatform() != null && other.getInstancePlatform().equals(this.getInstancePlatform()) == false)
return false;
if (other.getAvailabilityZone() == null ^ this.getAvailabilityZone() == null)
return false;
if (other.getAvailabilityZone() != null && other.getAvailabilityZone().equals(this.getAvailabilityZone()) == false)
return false;
if (other.getTenancy() == null ^ this.getTenancy() == null)
return false;
if (other.getTenancy() != null && other.getTenancy().equals(this.getTenancy()) == false)
return false;
if (other.getTotalInstanceCount() == null ^ this.getTotalInstanceCount() == null)
return false;
if (other.getTotalInstanceCount() != null && other.getTotalInstanceCount().equals(this.getTotalInstanceCount()) == false)
return false;
if (other.getAvailableInstanceCount() == null ^ this.getAvailableInstanceCount() == null)
return false;
if (other.getAvailableInstanceCount() != null && other.getAvailableInstanceCount().equals(this.getAvailableInstanceCount()) == false)
return false;
if (other.getEbsOptimized() == null ^ this.getEbsOptimized() == null)
return false;
if (other.getEbsOptimized() != null && other.getEbsOptimized().equals(this.getEbsOptimized()) == false)
return false;
if (other.getEphemeralStorage() == null ^ this.getEphemeralStorage() == null)
return false;
if (other.getEphemeralStorage() != null && other.getEphemeralStorage().equals(this.getEphemeralStorage()) == false)
return false;
if (other.getState() == null ^ this.getState() == null)
return false;
if (other.getState() != null && other.getState().equals(this.getState()) == false)
return false;
if (other.getStartDate() == null ^ this.getStartDate() == null)
return false;
if (other.getStartDate() != null && other.getStartDate().equals(this.getStartDate()) == false)
return false;
if (other.getEndDate() == null ^ this.getEndDate() == null)
return false;
if (other.getEndDate() != null && other.getEndDate().equals(this.getEndDate()) == false)
return false;
if (other.getEndDateType() == null ^ this.getEndDateType() == null)
return false;
if (other.getEndDateType() != null && other.getEndDateType().equals(this.getEndDateType()) == false)
return false;
if (other.getInstanceMatchCriteria() == null ^ this.getInstanceMatchCriteria() == null)
return false;
if (other.getInstanceMatchCriteria() != null && other.getInstanceMatchCriteria().equals(this.getInstanceMatchCriteria()) == false)
return false;
if (other.getCreateDate() == null ^ this.getCreateDate() == null)
return false;
if (other.getCreateDate() != null && other.getCreateDate().equals(this.getCreateDate()) == false)
return false;
if (other.getTags() == null ^ this.getTags() == null)
return false;
if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
return false;
if (other.getOutpostArn() == null ^ this.getOutpostArn() == null)
return false;
if (other.getOutpostArn() != null && other.getOutpostArn().equals(this.getOutpostArn()) == false)
return false;
if (other.getCapacityReservationFleetId() == null ^ this.getCapacityReservationFleetId() == null)
return false;
if (other.getCapacityReservationFleetId() != null && other.getCapacityReservationFleetId().equals(this.getCapacityReservationFleetId()) == false)
return false;
if (other.getPlacementGroupArn() == null ^ this.getPlacementGroupArn() == null)
return false;
if (other.getPlacementGroupArn() != null && other.getPlacementGroupArn().equals(this.getPlacementGroupArn()) == false)
return false;
if (other.getCapacityAllocations() == null ^ this.getCapacityAllocations() == null)
return false;
if (other.getCapacityAllocations() != null && other.getCapacityAllocations().equals(this.getCapacityAllocations()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getCapacityReservationId() == null) ? 0 : getCapacityReservationId().hashCode());
hashCode = prime * hashCode + ((getOwnerId() == null) ? 0 : getOwnerId().hashCode());
hashCode = prime * hashCode + ((getCapacityReservationArn() == null) ? 0 : getCapacityReservationArn().hashCode());
hashCode = prime * hashCode + ((getAvailabilityZoneId() == null) ? 0 : getAvailabilityZoneId().hashCode());
hashCode = prime * hashCode + ((getInstanceType() == null) ? 0 : getInstanceType().hashCode());
hashCode = prime * hashCode + ((getInstancePlatform() == null) ? 0 : getInstancePlatform().hashCode());
hashCode = prime * hashCode + ((getAvailabilityZone() == null) ? 0 : getAvailabilityZone().hashCode());
hashCode = prime * hashCode + ((getTenancy() == null) ? 0 : getTenancy().hashCode());
hashCode = prime * hashCode + ((getTotalInstanceCount() == null) ? 0 : getTotalInstanceCount().hashCode());
hashCode = prime * hashCode + ((getAvailableInstanceCount() == null) ? 0 : getAvailableInstanceCount().hashCode());
hashCode = prime * hashCode + ((getEbsOptimized() == null) ? 0 : getEbsOptimized().hashCode());
hashCode = prime * hashCode + ((getEphemeralStorage() == null) ? 0 : getEphemeralStorage().hashCode());
hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode());
hashCode = prime * hashCode + ((getStartDate() == null) ? 0 : getStartDate().hashCode());
hashCode = prime * hashCode + ((getEndDate() == null) ? 0 : getEndDate().hashCode());
hashCode = prime * hashCode + ((getEndDateType() == null) ? 0 : getEndDateType().hashCode());
hashCode = prime * hashCode + ((getInstanceMatchCriteria() == null) ? 0 : getInstanceMatchCriteria().hashCode());
hashCode = prime * hashCode + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
hashCode = prime * hashCode + ((getOutpostArn() == null) ? 0 : getOutpostArn().hashCode());
hashCode = prime * hashCode + ((getCapacityReservationFleetId() == null) ? 0 : getCapacityReservationFleetId().hashCode());
hashCode = prime * hashCode + ((getPlacementGroupArn() == null) ? 0 : getPlacementGroupArn().hashCode());
hashCode = prime * hashCode + ((getCapacityAllocations() == null) ? 0 : getCapacityAllocations().hashCode());
return hashCode;
}
@Override
public CapacityReservation clone() {
try {
return (CapacityReservation) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}