aws-sdk-outposts 1.109.0

AWS SDK for AWS Outposts
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Provides information about your Amazon Web Services Outposts subscriptions.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Subscription {
    /// <p>The ID of the subscription that appears on the Amazon Web Services Billing Center console.</p>
    pub subscription_id: ::std::option::Option<::std::string::String>,
    /// <p>The type of subscription which can be one of the following:</p>
    /// <ul>
    /// <li>
    /// <p><b>ORIGINAL</b> - The first order on the Amazon Web Services Outposts.</p></li>
    /// <li>
    /// <p><b>RENEWAL</b> - Renewal requests, both month to month and longer term.</p></li>
    /// <li>
    /// <p><b>CAPACITY_INCREASE</b> - Capacity scaling orders.</p></li>
    /// </ul>
    pub subscription_type: ::std::option::Option<crate::types::SubscriptionType>,
    /// <p>The status of subscription which can be one of the following:</p>
    /// <ul>
    /// <li>
    /// <p><b>INACTIVE</b> - Subscription requests that are inactive.</p></li>
    /// <li>
    /// <p><b>ACTIVE</b> - Subscription requests that are in progress and have an end date in the future.</p></li>
    /// <li>
    /// <p><b>PENDING</b> - Subscription has been created but billing has not yet commenced because the subscription begin date has not been reached.</p></li>
    /// <li>
    /// <p><b>CANCELLED</b> - Subscription requests that are cancelled.</p></li>
    /// </ul>
    pub subscription_status: ::std::option::Option<crate::types::SubscriptionStatus>,
    /// <p>The order ID for your subscription.</p>
    pub order_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>The date your subscription starts.</p>
    pub begin_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The date your subscription ends.</p>
    pub end_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The amount you are billed each month in the subscription period.</p>
    pub monthly_recurring_price: ::std::option::Option<f64>,
    /// <p>The amount billed when the subscription is created. This is a one-time charge.</p>
    pub upfront_price: ::std::option::Option<f64>,
}
impl Subscription {
    /// <p>The ID of the subscription that appears on the Amazon Web Services Billing Center console.</p>
    pub fn subscription_id(&self) -> ::std::option::Option<&str> {
        self.subscription_id.as_deref()
    }
    /// <p>The type of subscription which can be one of the following:</p>
    /// <ul>
    /// <li>
    /// <p><b>ORIGINAL</b> - The first order on the Amazon Web Services Outposts.</p></li>
    /// <li>
    /// <p><b>RENEWAL</b> - Renewal requests, both month to month and longer term.</p></li>
    /// <li>
    /// <p><b>CAPACITY_INCREASE</b> - Capacity scaling orders.</p></li>
    /// </ul>
    pub fn subscription_type(&self) -> ::std::option::Option<&crate::types::SubscriptionType> {
        self.subscription_type.as_ref()
    }
    /// <p>The status of subscription which can be one of the following:</p>
    /// <ul>
    /// <li>
    /// <p><b>INACTIVE</b> - Subscription requests that are inactive.</p></li>
    /// <li>
    /// <p><b>ACTIVE</b> - Subscription requests that are in progress and have an end date in the future.</p></li>
    /// <li>
    /// <p><b>PENDING</b> - Subscription has been created but billing has not yet commenced because the subscription begin date has not been reached.</p></li>
    /// <li>
    /// <p><b>CANCELLED</b> - Subscription requests that are cancelled.</p></li>
    /// </ul>
    pub fn subscription_status(&self) -> ::std::option::Option<&crate::types::SubscriptionStatus> {
        self.subscription_status.as_ref()
    }
    /// <p>The order ID for your subscription.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.order_ids.is_none()`.
    pub fn order_ids(&self) -> &[::std::string::String] {
        self.order_ids.as_deref().unwrap_or_default()
    }
    /// <p>The date your subscription starts.</p>
    pub fn begin_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.begin_date.as_ref()
    }
    /// <p>The date your subscription ends.</p>
    pub fn end_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.end_date.as_ref()
    }
    /// <p>The amount you are billed each month in the subscription period.</p>
    pub fn monthly_recurring_price(&self) -> ::std::option::Option<f64> {
        self.monthly_recurring_price
    }
    /// <p>The amount billed when the subscription is created. This is a one-time charge.</p>
    pub fn upfront_price(&self) -> ::std::option::Option<f64> {
        self.upfront_price
    }
}
impl Subscription {
    /// Creates a new builder-style object to manufacture [`Subscription`](crate::types::Subscription).
    pub fn builder() -> crate::types::builders::SubscriptionBuilder {
        crate::types::builders::SubscriptionBuilder::default()
    }
}

/// A builder for [`Subscription`](crate::types::Subscription).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SubscriptionBuilder {
    pub(crate) subscription_id: ::std::option::Option<::std::string::String>,
    pub(crate) subscription_type: ::std::option::Option<crate::types::SubscriptionType>,
    pub(crate) subscription_status: ::std::option::Option<crate::types::SubscriptionStatus>,
    pub(crate) order_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) begin_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) end_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) monthly_recurring_price: ::std::option::Option<f64>,
    pub(crate) upfront_price: ::std::option::Option<f64>,
}
impl SubscriptionBuilder {
    /// <p>The ID of the subscription that appears on the Amazon Web Services Billing Center console.</p>
    pub fn subscription_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.subscription_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the subscription that appears on the Amazon Web Services Billing Center console.</p>
    pub fn set_subscription_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.subscription_id = input;
        self
    }
    /// <p>The ID of the subscription that appears on the Amazon Web Services Billing Center console.</p>
    pub fn get_subscription_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.subscription_id
    }
    /// <p>The type of subscription which can be one of the following:</p>
    /// <ul>
    /// <li>
    /// <p><b>ORIGINAL</b> - The first order on the Amazon Web Services Outposts.</p></li>
    /// <li>
    /// <p><b>RENEWAL</b> - Renewal requests, both month to month and longer term.</p></li>
    /// <li>
    /// <p><b>CAPACITY_INCREASE</b> - Capacity scaling orders.</p></li>
    /// </ul>
    pub fn subscription_type(mut self, input: crate::types::SubscriptionType) -> Self {
        self.subscription_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of subscription which can be one of the following:</p>
    /// <ul>
    /// <li>
    /// <p><b>ORIGINAL</b> - The first order on the Amazon Web Services Outposts.</p></li>
    /// <li>
    /// <p><b>RENEWAL</b> - Renewal requests, both month to month and longer term.</p></li>
    /// <li>
    /// <p><b>CAPACITY_INCREASE</b> - Capacity scaling orders.</p></li>
    /// </ul>
    pub fn set_subscription_type(mut self, input: ::std::option::Option<crate::types::SubscriptionType>) -> Self {
        self.subscription_type = input;
        self
    }
    /// <p>The type of subscription which can be one of the following:</p>
    /// <ul>
    /// <li>
    /// <p><b>ORIGINAL</b> - The first order on the Amazon Web Services Outposts.</p></li>
    /// <li>
    /// <p><b>RENEWAL</b> - Renewal requests, both month to month and longer term.</p></li>
    /// <li>
    /// <p><b>CAPACITY_INCREASE</b> - Capacity scaling orders.</p></li>
    /// </ul>
    pub fn get_subscription_type(&self) -> &::std::option::Option<crate::types::SubscriptionType> {
        &self.subscription_type
    }
    /// <p>The status of subscription which can be one of the following:</p>
    /// <ul>
    /// <li>
    /// <p><b>INACTIVE</b> - Subscription requests that are inactive.</p></li>
    /// <li>
    /// <p><b>ACTIVE</b> - Subscription requests that are in progress and have an end date in the future.</p></li>
    /// <li>
    /// <p><b>PENDING</b> - Subscription has been created but billing has not yet commenced because the subscription begin date has not been reached.</p></li>
    /// <li>
    /// <p><b>CANCELLED</b> - Subscription requests that are cancelled.</p></li>
    /// </ul>
    pub fn subscription_status(mut self, input: crate::types::SubscriptionStatus) -> Self {
        self.subscription_status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The status of subscription which can be one of the following:</p>
    /// <ul>
    /// <li>
    /// <p><b>INACTIVE</b> - Subscription requests that are inactive.</p></li>
    /// <li>
    /// <p><b>ACTIVE</b> - Subscription requests that are in progress and have an end date in the future.</p></li>
    /// <li>
    /// <p><b>PENDING</b> - Subscription has been created but billing has not yet commenced because the subscription begin date has not been reached.</p></li>
    /// <li>
    /// <p><b>CANCELLED</b> - Subscription requests that are cancelled.</p></li>
    /// </ul>
    pub fn set_subscription_status(mut self, input: ::std::option::Option<crate::types::SubscriptionStatus>) -> Self {
        self.subscription_status = input;
        self
    }
    /// <p>The status of subscription which can be one of the following:</p>
    /// <ul>
    /// <li>
    /// <p><b>INACTIVE</b> - Subscription requests that are inactive.</p></li>
    /// <li>
    /// <p><b>ACTIVE</b> - Subscription requests that are in progress and have an end date in the future.</p></li>
    /// <li>
    /// <p><b>PENDING</b> - Subscription has been created but billing has not yet commenced because the subscription begin date has not been reached.</p></li>
    /// <li>
    /// <p><b>CANCELLED</b> - Subscription requests that are cancelled.</p></li>
    /// </ul>
    pub fn get_subscription_status(&self) -> &::std::option::Option<crate::types::SubscriptionStatus> {
        &self.subscription_status
    }
    /// Appends an item to `order_ids`.
    ///
    /// To override the contents of this collection use [`set_order_ids`](Self::set_order_ids).
    ///
    /// <p>The order ID for your subscription.</p>
    pub fn order_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.order_ids.unwrap_or_default();
        v.push(input.into());
        self.order_ids = ::std::option::Option::Some(v);
        self
    }
    /// <p>The order ID for your subscription.</p>
    pub fn set_order_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.order_ids = input;
        self
    }
    /// <p>The order ID for your subscription.</p>
    pub fn get_order_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.order_ids
    }
    /// <p>The date your subscription starts.</p>
    pub fn begin_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.begin_date = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date your subscription starts.</p>
    pub fn set_begin_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.begin_date = input;
        self
    }
    /// <p>The date your subscription starts.</p>
    pub fn get_begin_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.begin_date
    }
    /// <p>The date your subscription ends.</p>
    pub fn end_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.end_date = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date your subscription ends.</p>
    pub fn set_end_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.end_date = input;
        self
    }
    /// <p>The date your subscription ends.</p>
    pub fn get_end_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.end_date
    }
    /// <p>The amount you are billed each month in the subscription period.</p>
    pub fn monthly_recurring_price(mut self, input: f64) -> Self {
        self.monthly_recurring_price = ::std::option::Option::Some(input);
        self
    }
    /// <p>The amount you are billed each month in the subscription period.</p>
    pub fn set_monthly_recurring_price(mut self, input: ::std::option::Option<f64>) -> Self {
        self.monthly_recurring_price = input;
        self
    }
    /// <p>The amount you are billed each month in the subscription period.</p>
    pub fn get_monthly_recurring_price(&self) -> &::std::option::Option<f64> {
        &self.monthly_recurring_price
    }
    /// <p>The amount billed when the subscription is created. This is a one-time charge.</p>
    pub fn upfront_price(mut self, input: f64) -> Self {
        self.upfront_price = ::std::option::Option::Some(input);
        self
    }
    /// <p>The amount billed when the subscription is created. This is a one-time charge.</p>
    pub fn set_upfront_price(mut self, input: ::std::option::Option<f64>) -> Self {
        self.upfront_price = input;
        self
    }
    /// <p>The amount billed when the subscription is created. This is a one-time charge.</p>
    pub fn get_upfront_price(&self) -> &::std::option::Option<f64> {
        &self.upfront_price
    }
    /// Consumes the builder and constructs a [`Subscription`](crate::types::Subscription).
    pub fn build(self) -> crate::types::Subscription {
        crate::types::Subscription {
            subscription_id: self.subscription_id,
            subscription_type: self.subscription_type,
            subscription_status: self.subscription_status,
            order_ids: self.order_ids,
            begin_date: self.begin_date,
            end_date: self.end_date,
            monthly_recurring_price: self.monthly_recurring_price,
            upfront_price: self.upfront_price,
        }
    }
}