All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.ec2.model.CreateCapacityReservationFleetResponse Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon EC2 module holds the client classes that are used for communicating with Amazon EC2 Service

The newest version!
/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.ec2.model;

import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
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 CreateCapacityReservationFleetResponse extends Ec2Response implements
        ToCopyableBuilder {
    private static final SdkField CAPACITY_RESERVATION_FLEET_ID_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("CapacityReservationFleetId")
            .getter(getter(CreateCapacityReservationFleetResponse::capacityReservationFleetId))
            .setter(setter(Builder::capacityReservationFleetId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CapacityReservationFleetId")
                    .unmarshallLocationName("capacityReservationFleetId").build()).build();

    private static final SdkField STATE_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("State")
            .getter(getter(CreateCapacityReservationFleetResponse::stateAsString))
            .setter(setter(Builder::state))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("State")
                    .unmarshallLocationName("state").build()).build();

    private static final SdkField TOTAL_TARGET_CAPACITY_FIELD = SdkField
            . builder(MarshallingType.INTEGER)
            .memberName("TotalTargetCapacity")
            .getter(getter(CreateCapacityReservationFleetResponse::totalTargetCapacity))
            .setter(setter(Builder::totalTargetCapacity))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TotalTargetCapacity")
                    .unmarshallLocationName("totalTargetCapacity").build()).build();

    private static final SdkField TOTAL_FULFILLED_CAPACITY_FIELD = SdkField
            . builder(MarshallingType.DOUBLE)
            .memberName("TotalFulfilledCapacity")
            .getter(getter(CreateCapacityReservationFleetResponse::totalFulfilledCapacity))
            .setter(setter(Builder::totalFulfilledCapacity))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TotalFulfilledCapacity")
                    .unmarshallLocationName("totalFulfilledCapacity").build()).build();

    private static final SdkField INSTANCE_MATCH_CRITERIA_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("InstanceMatchCriteria")
            .getter(getter(CreateCapacityReservationFleetResponse::instanceMatchCriteriaAsString))
            .setter(setter(Builder::instanceMatchCriteria))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InstanceMatchCriteria")
                    .unmarshallLocationName("instanceMatchCriteria").build()).build();

    private static final SdkField ALLOCATION_STRATEGY_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("AllocationStrategy")
            .getter(getter(CreateCapacityReservationFleetResponse::allocationStrategy))
            .setter(setter(Builder::allocationStrategy))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AllocationStrategy")
                    .unmarshallLocationName("allocationStrategy").build()).build();

    private static final SdkField CREATE_TIME_FIELD = SdkField
            . builder(MarshallingType.INSTANT)
            .memberName("CreateTime")
            .getter(getter(CreateCapacityReservationFleetResponse::createTime))
            .setter(setter(Builder::createTime))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreateTime")
                    .unmarshallLocationName("createTime").build()).build();

    private static final SdkField END_DATE_FIELD = SdkField
            . builder(MarshallingType.INSTANT)
            .memberName("EndDate")
            .getter(getter(CreateCapacityReservationFleetResponse::endDate))
            .setter(setter(Builder::endDate))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EndDate")
                    .unmarshallLocationName("endDate").build()).build();

    private static final SdkField TENANCY_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("Tenancy")
            .getter(getter(CreateCapacityReservationFleetResponse::tenancyAsString))
            .setter(setter(Builder::tenancy))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Tenancy")
                    .unmarshallLocationName("tenancy").build()).build();

    private static final SdkField> FLEET_CAPACITY_RESERVATIONS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("FleetCapacityReservations")
            .getter(getter(CreateCapacityReservationFleetResponse::fleetCapacityReservations))
            .setter(setter(Builder::fleetCapacityReservations))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FleetCapacityReservationSet")
                    .unmarshallLocationName("fleetCapacityReservationSet").build(),
                    ListTrait
                            .builder()
                            .memberLocationName("item")
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(FleetCapacityReservation::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("Item").unmarshallLocationName("item").build()).build())
                            .build()).build();

    private static final SdkField> TAGS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("Tags")
            .getter(getter(CreateCapacityReservationFleetResponse::tags))
            .setter(setter(Builder::tags))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TagSet")
                    .unmarshallLocationName("tagSet").build(),
                    ListTrait
                            .builder()
                            .memberLocationName("item")
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(Tag::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("Item").unmarshallLocationName("item").build()).build())
                            .build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
            CAPACITY_RESERVATION_FLEET_ID_FIELD, STATE_FIELD, TOTAL_TARGET_CAPACITY_FIELD, TOTAL_FULFILLED_CAPACITY_FIELD,
            INSTANCE_MATCH_CRITERIA_FIELD, ALLOCATION_STRATEGY_FIELD, CREATE_TIME_FIELD, END_DATE_FIELD, TENANCY_FIELD,
            FLEET_CAPACITY_RESERVATIONS_FIELD, TAGS_FIELD));

    private static final Map> SDK_NAME_TO_FIELD = Collections
            .unmodifiableMap(new HashMap>() {
                {
                    put("CapacityReservationFleetId", CAPACITY_RESERVATION_FLEET_ID_FIELD);
                    put("State", STATE_FIELD);
                    put("TotalTargetCapacity", TOTAL_TARGET_CAPACITY_FIELD);
                    put("TotalFulfilledCapacity", TOTAL_FULFILLED_CAPACITY_FIELD);
                    put("InstanceMatchCriteria", INSTANCE_MATCH_CRITERIA_FIELD);
                    put("AllocationStrategy", ALLOCATION_STRATEGY_FIELD);
                    put("CreateTime", CREATE_TIME_FIELD);
                    put("EndDate", END_DATE_FIELD);
                    put("Tenancy", TENANCY_FIELD);
                    put("FleetCapacityReservationSet", FLEET_CAPACITY_RESERVATIONS_FIELD);
                    put("TagSet", TAGS_FIELD);
                }
            });

    private final String capacityReservationFleetId;

    private final String state;

    private final Integer totalTargetCapacity;

    private final Double totalFulfilledCapacity;

    private final String instanceMatchCriteria;

    private final String allocationStrategy;

    private final Instant createTime;

    private final Instant endDate;

    private final String tenancy;

    private final List fleetCapacityReservations;

    private final List tags;

    private CreateCapacityReservationFleetResponse(BuilderImpl builder) {
        super(builder);
        this.capacityReservationFleetId = builder.capacityReservationFleetId;
        this.state = builder.state;
        this.totalTargetCapacity = builder.totalTargetCapacity;
        this.totalFulfilledCapacity = builder.totalFulfilledCapacity;
        this.instanceMatchCriteria = builder.instanceMatchCriteria;
        this.allocationStrategy = builder.allocationStrategy;
        this.createTime = builder.createTime;
        this.endDate = builder.endDate;
        this.tenancy = builder.tenancy;
        this.fleetCapacityReservations = builder.fleetCapacityReservations;
        this.tags = builder.tags;
    }

    /**
     * 

* The ID of the Capacity Reservation Fleet. *

* * @return The ID of the Capacity Reservation Fleet. */ public final String capacityReservationFleetId() { return capacityReservationFleetId; } /** *

* The status of the Capacity Reservation Fleet. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #state} will return * {@link CapacityReservationFleetState#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #stateAsString}. *

* * @return The status of the Capacity Reservation Fleet. * @see CapacityReservationFleetState */ public final CapacityReservationFleetState state() { return CapacityReservationFleetState.fromValue(state); } /** *

* The status of the Capacity Reservation Fleet. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #state} will return * {@link CapacityReservationFleetState#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #stateAsString}. *

* * @return The status of the Capacity Reservation Fleet. * @see CapacityReservationFleetState */ public final String stateAsString() { return state; } /** *

* The total number of capacity units for which the Capacity Reservation Fleet reserves capacity. *

* * @return The total number of capacity units for which the Capacity Reservation Fleet reserves capacity. */ public final Integer totalTargetCapacity() { return totalTargetCapacity; } /** *

* The requested capacity units that have been successfully reserved. *

* * @return The requested capacity units that have been successfully reserved. */ public final Double totalFulfilledCapacity() { return totalFulfilledCapacity; } /** *

* The instance matching criteria for the Capacity Reservation Fleet. *

*

* If the service returns an enum value that is not available in the current SDK version, * {@link #instanceMatchCriteria} will return {@link FleetInstanceMatchCriteria#UNKNOWN_TO_SDK_VERSION}. The raw * value returned by the service is available from {@link #instanceMatchCriteriaAsString}. *

* * @return The instance matching criteria for the Capacity Reservation Fleet. * @see FleetInstanceMatchCriteria */ public final FleetInstanceMatchCriteria instanceMatchCriteria() { return FleetInstanceMatchCriteria.fromValue(instanceMatchCriteria); } /** *

* The instance matching criteria for the Capacity Reservation Fleet. *

*

* If the service returns an enum value that is not available in the current SDK version, * {@link #instanceMatchCriteria} will return {@link FleetInstanceMatchCriteria#UNKNOWN_TO_SDK_VERSION}. The raw * value returned by the service is available from {@link #instanceMatchCriteriaAsString}. *

* * @return The instance matching criteria for the Capacity Reservation Fleet. * @see FleetInstanceMatchCriteria */ public final String instanceMatchCriteriaAsString() { return instanceMatchCriteria; } /** *

* The allocation strategy used by the Capacity Reservation Fleet. *

* * @return The allocation strategy used by the Capacity Reservation Fleet. */ public final String allocationStrategy() { return allocationStrategy; } /** *

* The date and time at which the Capacity Reservation Fleet was created. *

* * @return The date and time at which the Capacity Reservation Fleet was created. */ public final Instant createTime() { return createTime; } /** *

* The date and time at which the Capacity Reservation Fleet expires. *

* * @return The date and time at which the Capacity Reservation Fleet expires. */ public final Instant endDate() { return endDate; } /** *

* Indicates the tenancy of Capacity Reservation Fleet. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #tenancy} will * return {@link FleetCapacityReservationTenancy#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is * available from {@link #tenancyAsString}. *

* * @return Indicates the tenancy of Capacity Reservation Fleet. * @see FleetCapacityReservationTenancy */ public final FleetCapacityReservationTenancy tenancy() { return FleetCapacityReservationTenancy.fromValue(tenancy); } /** *

* Indicates the tenancy of Capacity Reservation Fleet. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #tenancy} will * return {@link FleetCapacityReservationTenancy#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is * available from {@link #tenancyAsString}. *

* * @return Indicates the tenancy of Capacity Reservation Fleet. * @see FleetCapacityReservationTenancy */ public final String tenancyAsString() { return tenancy; } /** * For responses, this returns true if the service returned a value for the FleetCapacityReservations property. This * DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the * property). This is useful because the SDK will never return a null collection or map, but you may need to * differentiate between the service returning nothing (or null) and the service returning an empty collection or * map. For requests, this returns true if a value for the property was specified in the request builder, and false * if a value was not specified. */ public final boolean hasFleetCapacityReservations() { return fleetCapacityReservations != null && !(fleetCapacityReservations instanceof SdkAutoConstructList); } /** *

* Information about the individual Capacity Reservations in the Capacity Reservation Fleet. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasFleetCapacityReservations} method. *

* * @return Information about the individual Capacity Reservations in the Capacity Reservation Fleet. */ public final List fleetCapacityReservations() { return fleetCapacityReservations; } /** * For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that * the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful * because the SDK will never return a null collection or map, but you may need to differentiate between the service * returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true * if a value for the property was specified in the request builder, and false if a value was not specified. */ public final boolean hasTags() { return tags != null && !(tags instanceof SdkAutoConstructList); } /** *

* The tags assigned to the Capacity Reservation Fleet. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasTags} method. *

* * @return The tags assigned to the Capacity Reservation Fleet. */ public final List tags() { return tags; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(capacityReservationFleetId()); hashCode = 31 * hashCode + Objects.hashCode(stateAsString()); hashCode = 31 * hashCode + Objects.hashCode(totalTargetCapacity()); hashCode = 31 * hashCode + Objects.hashCode(totalFulfilledCapacity()); hashCode = 31 * hashCode + Objects.hashCode(instanceMatchCriteriaAsString()); hashCode = 31 * hashCode + Objects.hashCode(allocationStrategy()); hashCode = 31 * hashCode + Objects.hashCode(createTime()); hashCode = 31 * hashCode + Objects.hashCode(endDate()); hashCode = 31 * hashCode + Objects.hashCode(tenancyAsString()); hashCode = 31 * hashCode + Objects.hashCode(hasFleetCapacityReservations() ? fleetCapacityReservations() : null); hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null); return hashCode; } @Override public final boolean equals(Object obj) { return super.equals(obj) && equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof CreateCapacityReservationFleetResponse)) { return false; } CreateCapacityReservationFleetResponse other = (CreateCapacityReservationFleetResponse) obj; return Objects.equals(capacityReservationFleetId(), other.capacityReservationFleetId()) && Objects.equals(stateAsString(), other.stateAsString()) && Objects.equals(totalTargetCapacity(), other.totalTargetCapacity()) && Objects.equals(totalFulfilledCapacity(), other.totalFulfilledCapacity()) && Objects.equals(instanceMatchCriteriaAsString(), other.instanceMatchCriteriaAsString()) && Objects.equals(allocationStrategy(), other.allocationStrategy()) && Objects.equals(createTime(), other.createTime()) && Objects.equals(endDate(), other.endDate()) && Objects.equals(tenancyAsString(), other.tenancyAsString()) && hasFleetCapacityReservations() == other.hasFleetCapacityReservations() && Objects.equals(fleetCapacityReservations(), other.fleetCapacityReservations()) && hasTags() == other.hasTags() && Objects.equals(tags(), other.tags()); } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. */ @Override public final String toString() { return ToString.builder("CreateCapacityReservationFleetResponse") .add("CapacityReservationFleetId", capacityReservationFleetId()).add("State", stateAsString()) .add("TotalTargetCapacity", totalTargetCapacity()).add("TotalFulfilledCapacity", totalFulfilledCapacity()) .add("InstanceMatchCriteria", instanceMatchCriteriaAsString()).add("AllocationStrategy", allocationStrategy()) .add("CreateTime", createTime()).add("EndDate", endDate()).add("Tenancy", tenancyAsString()) .add("FleetCapacityReservations", hasFleetCapacityReservations() ? fleetCapacityReservations() : null) .add("Tags", hasTags() ? tags() : null).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "CapacityReservationFleetId": return Optional.ofNullable(clazz.cast(capacityReservationFleetId())); case "State": return Optional.ofNullable(clazz.cast(stateAsString())); case "TotalTargetCapacity": return Optional.ofNullable(clazz.cast(totalTargetCapacity())); case "TotalFulfilledCapacity": return Optional.ofNullable(clazz.cast(totalFulfilledCapacity())); case "InstanceMatchCriteria": return Optional.ofNullable(clazz.cast(instanceMatchCriteriaAsString())); case "AllocationStrategy": return Optional.ofNullable(clazz.cast(allocationStrategy())); case "CreateTime": return Optional.ofNullable(clazz.cast(createTime())); case "EndDate": return Optional.ofNullable(clazz.cast(endDate())); case "Tenancy": return Optional.ofNullable(clazz.cast(tenancyAsString())); case "FleetCapacityReservations": return Optional.ofNullable(clazz.cast(fleetCapacityReservations())); case "Tags": return Optional.ofNullable(clazz.cast(tags())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } @Override public final Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } private static Function getter(Function g) { return obj -> g.apply((CreateCapacityReservationFleetResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends Ec2Response.Builder, SdkPojo, CopyableBuilder { /** *

* The ID of the Capacity Reservation Fleet. *

* * @param capacityReservationFleetId * The ID of the Capacity Reservation Fleet. * @return Returns a reference to this object so that method calls can be chained together. */ Builder capacityReservationFleetId(String capacityReservationFleetId); /** *

* The status of the Capacity Reservation Fleet. *

* * @param state * The status of the Capacity Reservation Fleet. * @see CapacityReservationFleetState * @return Returns a reference to this object so that method calls can be chained together. * @see CapacityReservationFleetState */ Builder state(String state); /** *

* The status of the Capacity Reservation Fleet. *

* * @param state * The status of the Capacity Reservation Fleet. * @see CapacityReservationFleetState * @return Returns a reference to this object so that method calls can be chained together. * @see CapacityReservationFleetState */ Builder state(CapacityReservationFleetState state); /** *

* The total number of capacity units for which the Capacity Reservation Fleet reserves capacity. *

* * @param totalTargetCapacity * The total number of capacity units for which the Capacity Reservation Fleet reserves capacity. * @return Returns a reference to this object so that method calls can be chained together. */ Builder totalTargetCapacity(Integer totalTargetCapacity); /** *

* The requested capacity units that have been successfully reserved. *

* * @param totalFulfilledCapacity * The requested capacity units that have been successfully reserved. * @return Returns a reference to this object so that method calls can be chained together. */ Builder totalFulfilledCapacity(Double totalFulfilledCapacity); /** *

* The instance matching criteria for the Capacity Reservation Fleet. *

* * @param instanceMatchCriteria * The instance matching criteria for the Capacity Reservation Fleet. * @see FleetInstanceMatchCriteria * @return Returns a reference to this object so that method calls can be chained together. * @see FleetInstanceMatchCriteria */ Builder instanceMatchCriteria(String instanceMatchCriteria); /** *

* The instance matching criteria for the Capacity Reservation Fleet. *

* * @param instanceMatchCriteria * The instance matching criteria for the Capacity Reservation Fleet. * @see FleetInstanceMatchCriteria * @return Returns a reference to this object so that method calls can be chained together. * @see FleetInstanceMatchCriteria */ Builder instanceMatchCriteria(FleetInstanceMatchCriteria instanceMatchCriteria); /** *

* The allocation strategy used by the Capacity Reservation Fleet. *

* * @param allocationStrategy * The allocation strategy used by the Capacity Reservation Fleet. * @return Returns a reference to this object so that method calls can be chained together. */ Builder allocationStrategy(String allocationStrategy); /** *

* The date and time at which the Capacity Reservation Fleet was created. *

* * @param createTime * The date and time at which the Capacity Reservation Fleet was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder createTime(Instant createTime); /** *

* The date and time at which the Capacity Reservation Fleet expires. *

* * @param endDate * The date and time at which the Capacity Reservation Fleet expires. * @return Returns a reference to this object so that method calls can be chained together. */ Builder endDate(Instant endDate); /** *

* Indicates the tenancy of Capacity Reservation Fleet. *

* * @param tenancy * Indicates the tenancy of Capacity Reservation Fleet. * @see FleetCapacityReservationTenancy * @return Returns a reference to this object so that method calls can be chained together. * @see FleetCapacityReservationTenancy */ Builder tenancy(String tenancy); /** *

* Indicates the tenancy of Capacity Reservation Fleet. *

* * @param tenancy * Indicates the tenancy of Capacity Reservation Fleet. * @see FleetCapacityReservationTenancy * @return Returns a reference to this object so that method calls can be chained together. * @see FleetCapacityReservationTenancy */ Builder tenancy(FleetCapacityReservationTenancy tenancy); /** *

* Information about the individual Capacity Reservations in the Capacity Reservation Fleet. *

* * @param fleetCapacityReservations * Information about the individual Capacity Reservations in the Capacity Reservation Fleet. * @return Returns a reference to this object so that method calls can be chained together. */ Builder fleetCapacityReservations(Collection fleetCapacityReservations); /** *

* Information about the individual Capacity Reservations in the Capacity Reservation Fleet. *

* * @param fleetCapacityReservations * Information about the individual Capacity Reservations in the Capacity Reservation Fleet. * @return Returns a reference to this object so that method calls can be chained together. */ Builder fleetCapacityReservations(FleetCapacityReservation... fleetCapacityReservations); /** *

* Information about the individual Capacity Reservations in the Capacity Reservation Fleet. *

* This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.ec2.model.FleetCapacityReservation.Builder} avoiding the need to * create one manually via {@link software.amazon.awssdk.services.ec2.model.FleetCapacityReservation#builder()}. * *

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.ec2.model.FleetCapacityReservation.Builder#build()} is called * immediately and its result is passed to {@link #fleetCapacityReservations(List)}. * * @param fleetCapacityReservations * a consumer that will call methods on * {@link software.amazon.awssdk.services.ec2.model.FleetCapacityReservation.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #fleetCapacityReservations(java.util.Collection) */ Builder fleetCapacityReservations(Consumer... fleetCapacityReservations); /** *

* The tags assigned to the Capacity Reservation Fleet. *

* * @param tags * The tags assigned to the Capacity Reservation Fleet. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Collection tags); /** *

* The tags assigned to the Capacity Reservation Fleet. *

* * @param tags * The tags assigned to the Capacity Reservation Fleet. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Tag... tags); /** *

* The tags assigned to the Capacity Reservation Fleet. *

* This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.ec2.model.Tag.Builder} avoiding the need to create one manually via * {@link software.amazon.awssdk.services.ec2.model.Tag#builder()}. * *

* When the {@link Consumer} completes, {@link software.amazon.awssdk.services.ec2.model.Tag.Builder#build()} is * called immediately and its result is passed to {@link #tags(List)}. * * @param tags * a consumer that will call methods on {@link software.amazon.awssdk.services.ec2.model.Tag.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #tags(java.util.Collection) */ Builder tags(Consumer... tags); } static final class BuilderImpl extends Ec2Response.BuilderImpl implements Builder { private String capacityReservationFleetId; private String state; private Integer totalTargetCapacity; private Double totalFulfilledCapacity; private String instanceMatchCriteria; private String allocationStrategy; private Instant createTime; private Instant endDate; private String tenancy; private List fleetCapacityReservations = DefaultSdkAutoConstructList.getInstance(); private List tags = DefaultSdkAutoConstructList.getInstance(); private BuilderImpl() { } private BuilderImpl(CreateCapacityReservationFleetResponse model) { super(model); capacityReservationFleetId(model.capacityReservationFleetId); state(model.state); totalTargetCapacity(model.totalTargetCapacity); totalFulfilledCapacity(model.totalFulfilledCapacity); instanceMatchCriteria(model.instanceMatchCriteria); allocationStrategy(model.allocationStrategy); createTime(model.createTime); endDate(model.endDate); tenancy(model.tenancy); fleetCapacityReservations(model.fleetCapacityReservations); tags(model.tags); } public final String getCapacityReservationFleetId() { return capacityReservationFleetId; } public final void setCapacityReservationFleetId(String capacityReservationFleetId) { this.capacityReservationFleetId = capacityReservationFleetId; } @Override public final Builder capacityReservationFleetId(String capacityReservationFleetId) { this.capacityReservationFleetId = capacityReservationFleetId; return this; } public final String getState() { return state; } public final void setState(String state) { this.state = state; } @Override public final Builder state(String state) { this.state = state; return this; } @Override public final Builder state(CapacityReservationFleetState state) { this.state(state == null ? null : state.toString()); return this; } public final Integer getTotalTargetCapacity() { return totalTargetCapacity; } public final void setTotalTargetCapacity(Integer totalTargetCapacity) { this.totalTargetCapacity = totalTargetCapacity; } @Override public final Builder totalTargetCapacity(Integer totalTargetCapacity) { this.totalTargetCapacity = totalTargetCapacity; return this; } public final Double getTotalFulfilledCapacity() { return totalFulfilledCapacity; } public final void setTotalFulfilledCapacity(Double totalFulfilledCapacity) { this.totalFulfilledCapacity = totalFulfilledCapacity; } @Override public final Builder totalFulfilledCapacity(Double totalFulfilledCapacity) { this.totalFulfilledCapacity = totalFulfilledCapacity; return this; } public final String getInstanceMatchCriteria() { return instanceMatchCriteria; } public final void setInstanceMatchCriteria(String instanceMatchCriteria) { this.instanceMatchCriteria = instanceMatchCriteria; } @Override public final Builder instanceMatchCriteria(String instanceMatchCriteria) { this.instanceMatchCriteria = instanceMatchCriteria; return this; } @Override public final Builder instanceMatchCriteria(FleetInstanceMatchCriteria instanceMatchCriteria) { this.instanceMatchCriteria(instanceMatchCriteria == null ? null : instanceMatchCriteria.toString()); return this; } public final String getAllocationStrategy() { return allocationStrategy; } public final void setAllocationStrategy(String allocationStrategy) { this.allocationStrategy = allocationStrategy; } @Override public final Builder allocationStrategy(String allocationStrategy) { this.allocationStrategy = allocationStrategy; return this; } public final Instant getCreateTime() { return createTime; } public final void setCreateTime(Instant createTime) { this.createTime = createTime; } @Override public final Builder createTime(Instant createTime) { this.createTime = createTime; return this; } public final Instant getEndDate() { return endDate; } public final void setEndDate(Instant endDate) { this.endDate = endDate; } @Override public final Builder endDate(Instant endDate) { this.endDate = endDate; return this; } public final String getTenancy() { return tenancy; } public final void setTenancy(String tenancy) { this.tenancy = tenancy; } @Override public final Builder tenancy(String tenancy) { this.tenancy = tenancy; return this; } @Override public final Builder tenancy(FleetCapacityReservationTenancy tenancy) { this.tenancy(tenancy == null ? null : tenancy.toString()); return this; } public final List getFleetCapacityReservations() { List result = FleetCapacityReservationSetCopier .copyToBuilder(this.fleetCapacityReservations); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setFleetCapacityReservations(Collection fleetCapacityReservations) { this.fleetCapacityReservations = FleetCapacityReservationSetCopier.copyFromBuilder(fleetCapacityReservations); } @Override public final Builder fleetCapacityReservations(Collection fleetCapacityReservations) { this.fleetCapacityReservations = FleetCapacityReservationSetCopier.copy(fleetCapacityReservations); return this; } @Override @SafeVarargs public final Builder fleetCapacityReservations(FleetCapacityReservation... fleetCapacityReservations) { fleetCapacityReservations(Arrays.asList(fleetCapacityReservations)); return this; } @Override @SafeVarargs public final Builder fleetCapacityReservations(Consumer... fleetCapacityReservations) { fleetCapacityReservations(Stream.of(fleetCapacityReservations) .map(c -> FleetCapacityReservation.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final List getTags() { List result = TagListCopier.copyToBuilder(this.tags); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setTags(Collection tags) { this.tags = TagListCopier.copyFromBuilder(tags); } @Override public final Builder tags(Collection tags) { this.tags = TagListCopier.copy(tags); return this; } @Override @SafeVarargs public final Builder tags(Tag... tags) { tags(Arrays.asList(tags)); return this; } @Override @SafeVarargs public final Builder tags(Consumer... tags) { tags(Stream.of(tags).map(c -> Tag.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } @Override public CreateCapacityReservationFleetResponse build() { return new CreateCapacityReservationFleetResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy