// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.aws.ec2.outputs;

import com.pulumi.aws.ec2.outputs.SpotInstanceRequestCapacityReservationSpecificationCapacityReservationTarget;
import com.pulumi.core.annotations.CustomType;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class SpotInstanceRequestCapacityReservationSpecification {
    /**
     * @return Indicates the instance&#39;s Capacity Reservation preferences. Can be `&#34;open&#34;` or `&#34;none&#34;`. (Default: `&#34;open&#34;`).
     * 
     */
    private @Nullable String capacityReservationPreference;
    /**
     * @return Information about the target Capacity Reservation. See Capacity Reservation Target below for more details.
     * 
     * For more information, see the documentation on [Capacity Reservations](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/capacity-reservations-using.html).
     * 
     */
    private @Nullable SpotInstanceRequestCapacityReservationSpecificationCapacityReservationTarget capacityReservationTarget;

    private SpotInstanceRequestCapacityReservationSpecification() {}
    /**
     * @return Indicates the instance&#39;s Capacity Reservation preferences. Can be `&#34;open&#34;` or `&#34;none&#34;`. (Default: `&#34;open&#34;`).
     * 
     */
    public Optional<String> capacityReservationPreference() {
        return Optional.ofNullable(this.capacityReservationPreference);
    }
    /**
     * @return Information about the target Capacity Reservation. See Capacity Reservation Target below for more details.
     * 
     * For more information, see the documentation on [Capacity Reservations](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/capacity-reservations-using.html).
     * 
     */
    public Optional<SpotInstanceRequestCapacityReservationSpecificationCapacityReservationTarget> capacityReservationTarget() {
        return Optional.ofNullable(this.capacityReservationTarget);
    }

    public static Builder builder() {
        return new Builder();
    }

    public static Builder builder(SpotInstanceRequestCapacityReservationSpecification defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable String capacityReservationPreference;
        private @Nullable SpotInstanceRequestCapacityReservationSpecificationCapacityReservationTarget capacityReservationTarget;
        public Builder() {}
        public Builder(SpotInstanceRequestCapacityReservationSpecification defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.capacityReservationPreference = defaults.capacityReservationPreference;
    	      this.capacityReservationTarget = defaults.capacityReservationTarget;
        }

        @CustomType.Setter
        public Builder capacityReservationPreference(@Nullable String capacityReservationPreference) {
            this.capacityReservationPreference = capacityReservationPreference;
            return this;
        }
        @CustomType.Setter
        public Builder capacityReservationTarget(@Nullable SpotInstanceRequestCapacityReservationSpecificationCapacityReservationTarget capacityReservationTarget) {
            this.capacityReservationTarget = capacityReservationTarget;
            return this;
        }
        public SpotInstanceRequestCapacityReservationSpecification build() {
            final var o = new SpotInstanceRequestCapacityReservationSpecification();
            o.capacityReservationPreference = capacityReservationPreference;
            o.capacityReservationTarget = capacityReservationTarget;
            return o;
        }
    }
}
