aws-sdk-ec2 1.232.1

AWS SDK for Amazon Elastic Compute Cloud
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CancelCapacityReservationInput {
    /// <p>The ID of the Capacity Reservation to be cancelled.</p>
    pub capacity_reservation_id: ::std::option::Option<::std::string::String>,
    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
    pub dry_run: ::std::option::Option<bool>,
    /// <p>Specifies the cancellation charge type to apply when cancelling a future-dated Capacity Reservation during its commitment duration. Possible values include <code>commitment-wind-down</code>, which continues billing for the remaining commitment duration without delivering capacity.</p>
    pub apply_cancellation_charges: ::std::option::Option<crate::types::ApplyCancellationCharges>,
    /// <p>The ID of the cancellation quote to use for the cancellation. You can generate a cancellation quote by using the <code>CreateCapacityReservationCancellationQuote</code> action. The cancellation quote must be in an <code>active</code> state.</p>
    pub quote_id: ::std::option::Option<::std::string::String>,
}
impl CancelCapacityReservationInput {
    /// <p>The ID of the Capacity Reservation to be cancelled.</p>
    pub fn capacity_reservation_id(&self) -> ::std::option::Option<&str> {
        self.capacity_reservation_id.as_deref()
    }
    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
    pub fn dry_run(&self) -> ::std::option::Option<bool> {
        self.dry_run
    }
    /// <p>Specifies the cancellation charge type to apply when cancelling a future-dated Capacity Reservation during its commitment duration. Possible values include <code>commitment-wind-down</code>, which continues billing for the remaining commitment duration without delivering capacity.</p>
    pub fn apply_cancellation_charges(&self) -> ::std::option::Option<&crate::types::ApplyCancellationCharges> {
        self.apply_cancellation_charges.as_ref()
    }
    /// <p>The ID of the cancellation quote to use for the cancellation. You can generate a cancellation quote by using the <code>CreateCapacityReservationCancellationQuote</code> action. The cancellation quote must be in an <code>active</code> state.</p>
    pub fn quote_id(&self) -> ::std::option::Option<&str> {
        self.quote_id.as_deref()
    }
}
impl CancelCapacityReservationInput {
    /// Creates a new builder-style object to manufacture [`CancelCapacityReservationInput`](crate::operation::cancel_capacity_reservation::CancelCapacityReservationInput).
    pub fn builder() -> crate::operation::cancel_capacity_reservation::builders::CancelCapacityReservationInputBuilder {
        crate::operation::cancel_capacity_reservation::builders::CancelCapacityReservationInputBuilder::default()
    }
}

/// A builder for [`CancelCapacityReservationInput`](crate::operation::cancel_capacity_reservation::CancelCapacityReservationInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CancelCapacityReservationInputBuilder {
    pub(crate) capacity_reservation_id: ::std::option::Option<::std::string::String>,
    pub(crate) dry_run: ::std::option::Option<bool>,
    pub(crate) apply_cancellation_charges: ::std::option::Option<crate::types::ApplyCancellationCharges>,
    pub(crate) quote_id: ::std::option::Option<::std::string::String>,
}
impl CancelCapacityReservationInputBuilder {
    /// <p>The ID of the Capacity Reservation to be cancelled.</p>
    /// This field is required.
    pub fn capacity_reservation_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.capacity_reservation_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the Capacity Reservation to be cancelled.</p>
    pub fn set_capacity_reservation_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.capacity_reservation_id = input;
        self
    }
    /// <p>The ID of the Capacity Reservation to be cancelled.</p>
    pub fn get_capacity_reservation_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.capacity_reservation_id
    }
    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
    pub fn dry_run(mut self, input: bool) -> Self {
        self.dry_run = ::std::option::Option::Some(input);
        self
    }
    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
        self.dry_run = input;
        self
    }
    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
        &self.dry_run
    }
    /// <p>Specifies the cancellation charge type to apply when cancelling a future-dated Capacity Reservation during its commitment duration. Possible values include <code>commitment-wind-down</code>, which continues billing for the remaining commitment duration without delivering capacity.</p>
    pub fn apply_cancellation_charges(mut self, input: crate::types::ApplyCancellationCharges) -> Self {
        self.apply_cancellation_charges = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies the cancellation charge type to apply when cancelling a future-dated Capacity Reservation during its commitment duration. Possible values include <code>commitment-wind-down</code>, which continues billing for the remaining commitment duration without delivering capacity.</p>
    pub fn set_apply_cancellation_charges(mut self, input: ::std::option::Option<crate::types::ApplyCancellationCharges>) -> Self {
        self.apply_cancellation_charges = input;
        self
    }
    /// <p>Specifies the cancellation charge type to apply when cancelling a future-dated Capacity Reservation during its commitment duration. Possible values include <code>commitment-wind-down</code>, which continues billing for the remaining commitment duration without delivering capacity.</p>
    pub fn get_apply_cancellation_charges(&self) -> &::std::option::Option<crate::types::ApplyCancellationCharges> {
        &self.apply_cancellation_charges
    }
    /// <p>The ID of the cancellation quote to use for the cancellation. You can generate a cancellation quote by using the <code>CreateCapacityReservationCancellationQuote</code> action. The cancellation quote must be in an <code>active</code> state.</p>
    pub fn quote_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.quote_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the cancellation quote to use for the cancellation. You can generate a cancellation quote by using the <code>CreateCapacityReservationCancellationQuote</code> action. The cancellation quote must be in an <code>active</code> state.</p>
    pub fn set_quote_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.quote_id = input;
        self
    }
    /// <p>The ID of the cancellation quote to use for the cancellation. You can generate a cancellation quote by using the <code>CreateCapacityReservationCancellationQuote</code> action. The cancellation quote must be in an <code>active</code> state.</p>
    pub fn get_quote_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.quote_id
    }
    /// Consumes the builder and constructs a [`CancelCapacityReservationInput`](crate::operation::cancel_capacity_reservation::CancelCapacityReservationInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::cancel_capacity_reservation::CancelCapacityReservationInput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::cancel_capacity_reservation::CancelCapacityReservationInput {
            capacity_reservation_id: self.capacity_reservation_id,
            dry_run: self.dry_run,
            apply_cancellation_charges: self.apply_cancellation_charges,
            quote_id: self.quote_id,
        })
    }
}