aws-sdk-appmonetization 1.0.0

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

/// Output for GetSubscription.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetSubscriptionOutput {
    /// The user's current subscription.
    pub subscription: ::std::option::Option<crate::types::Subscription>,
    /// The scheduled change to the subscription, if one is pending; null otherwise.
    pub pending_change: ::std::option::Option<crate::types::PendingChange>,
    /// The time when the current billing period ends and the next begins. Pending changes take effect and usage quotas reset at this time. Null for one-time subscriptions.
    pub current_period_ends_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl GetSubscriptionOutput {
    /// The user's current subscription.
    pub fn subscription(&self) -> ::std::option::Option<&crate::types::Subscription> {
        self.subscription.as_ref()
    }
    /// The scheduled change to the subscription, if one is pending; null otherwise.
    pub fn pending_change(&self) -> ::std::option::Option<&crate::types::PendingChange> {
        self.pending_change.as_ref()
    }
    /// The time when the current billing period ends and the next begins. Pending changes take effect and usage quotas reset at this time. Null for one-time subscriptions.
    pub fn current_period_ends_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.current_period_ends_at.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for GetSubscriptionOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetSubscriptionOutput {
    /// Creates a new builder-style object to manufacture [`GetSubscriptionOutput`](crate::operation::get_subscription::GetSubscriptionOutput).
    pub fn builder() -> crate::operation::get_subscription::builders::GetSubscriptionOutputBuilder {
        crate::operation::get_subscription::builders::GetSubscriptionOutputBuilder::default()
    }
}

/// A builder for [`GetSubscriptionOutput`](crate::operation::get_subscription::GetSubscriptionOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetSubscriptionOutputBuilder {
    pub(crate) subscription: ::std::option::Option<crate::types::Subscription>,
    pub(crate) pending_change: ::std::option::Option<crate::types::PendingChange>,
    pub(crate) current_period_ends_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl GetSubscriptionOutputBuilder {
    /// The user's current subscription.
    /// This field is required.
    pub fn subscription(mut self, input: crate::types::Subscription) -> Self {
        self.subscription = ::std::option::Option::Some(input);
        self
    }
    /// The user's current subscription.
    pub fn set_subscription(mut self, input: ::std::option::Option<crate::types::Subscription>) -> Self {
        self.subscription = input;
        self
    }
    /// The user's current subscription.
    pub fn get_subscription(&self) -> &::std::option::Option<crate::types::Subscription> {
        &self.subscription
    }
    /// The scheduled change to the subscription, if one is pending; null otherwise.
    pub fn pending_change(mut self, input: crate::types::PendingChange) -> Self {
        self.pending_change = ::std::option::Option::Some(input);
        self
    }
    /// The scheduled change to the subscription, if one is pending; null otherwise.
    pub fn set_pending_change(mut self, input: ::std::option::Option<crate::types::PendingChange>) -> Self {
        self.pending_change = input;
        self
    }
    /// The scheduled change to the subscription, if one is pending; null otherwise.
    pub fn get_pending_change(&self) -> &::std::option::Option<crate::types::PendingChange> {
        &self.pending_change
    }
    /// The time when the current billing period ends and the next begins. Pending changes take effect and usage quotas reset at this time. Null for one-time subscriptions.
    pub fn current_period_ends_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.current_period_ends_at = ::std::option::Option::Some(input);
        self
    }
    /// The time when the current billing period ends and the next begins. Pending changes take effect and usage quotas reset at this time. Null for one-time subscriptions.
    pub fn set_current_period_ends_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.current_period_ends_at = input;
        self
    }
    /// The time when the current billing period ends and the next begins. Pending changes take effect and usage quotas reset at this time. Null for one-time subscriptions.
    pub fn get_current_period_ends_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.current_period_ends_at
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetSubscriptionOutput`](crate::operation::get_subscription::GetSubscriptionOutput).
    pub fn build(self) -> crate::operation::get_subscription::GetSubscriptionOutput {
        crate::operation::get_subscription::GetSubscriptionOutput {
            subscription: self.subscription,
            pending_change: self.pending_change,
            current_period_ends_at: self.current_period_ends_at,
            _request_id: self._request_id,
        }
    }
}