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.

/// Input for GetSubscription.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetSubscriptionInput {
    /// The ID of the app.
    pub app_id: ::std::option::Option<::std::string::String>,
    /// An opaque identifier that you assign to an end user. Do not include personally identifiable or otherwise sensitive data in this value.
    pub user_id: ::std::option::Option<::std::string::String>,
    /// Required. The environment: live or sandbox.
    pub scope: ::std::option::Option<crate::types::RequestScope>,
}
impl GetSubscriptionInput {
    /// The ID of the app.
    pub fn app_id(&self) -> ::std::option::Option<&str> {
        self.app_id.as_deref()
    }
    /// An opaque identifier that you assign to an end user. Do not include personally identifiable or otherwise sensitive data in this value.
    pub fn user_id(&self) -> ::std::option::Option<&str> {
        self.user_id.as_deref()
    }
    /// Required. The environment: live or sandbox.
    pub fn scope(&self) -> ::std::option::Option<&crate::types::RequestScope> {
        self.scope.as_ref()
    }
}
impl GetSubscriptionInput {
    /// Creates a new builder-style object to manufacture [`GetSubscriptionInput`](crate::operation::get_subscription::GetSubscriptionInput).
    pub fn builder() -> crate::operation::get_subscription::builders::GetSubscriptionInputBuilder {
        crate::operation::get_subscription::builders::GetSubscriptionInputBuilder::default()
    }
}

/// A builder for [`GetSubscriptionInput`](crate::operation::get_subscription::GetSubscriptionInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetSubscriptionInputBuilder {
    pub(crate) app_id: ::std::option::Option<::std::string::String>,
    pub(crate) user_id: ::std::option::Option<::std::string::String>,
    pub(crate) scope: ::std::option::Option<crate::types::RequestScope>,
}
impl GetSubscriptionInputBuilder {
    /// The ID of the app.
    /// This field is required.
    pub fn app_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.app_id = ::std::option::Option::Some(input.into());
        self
    }
    /// The ID of the app.
    pub fn set_app_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.app_id = input;
        self
    }
    /// The ID of the app.
    pub fn get_app_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.app_id
    }
    /// An opaque identifier that you assign to an end user. Do not include personally identifiable or otherwise sensitive data in this value.
    /// This field is required.
    pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.user_id = ::std::option::Option::Some(input.into());
        self
    }
    /// An opaque identifier that you assign to an end user. Do not include personally identifiable or otherwise sensitive data in this value.
    pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.user_id = input;
        self
    }
    /// An opaque identifier that you assign to an end user. Do not include personally identifiable or otherwise sensitive data in this value.
    pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.user_id
    }
    /// Required. The environment: live or sandbox.
    /// This field is required.
    pub fn scope(mut self, input: crate::types::RequestScope) -> Self {
        self.scope = ::std::option::Option::Some(input);
        self
    }
    /// Required. The environment: live or sandbox.
    pub fn set_scope(mut self, input: ::std::option::Option<crate::types::RequestScope>) -> Self {
        self.scope = input;
        self
    }
    /// Required. The environment: live or sandbox.
    pub fn get_scope(&self) -> &::std::option::Option<crate::types::RequestScope> {
        &self.scope
    }
    /// Consumes the builder and constructs a [`GetSubscriptionInput`](crate::operation::get_subscription::GetSubscriptionInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_subscription::GetSubscriptionInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_subscription::GetSubscriptionInput {
            app_id: self.app_id,
            user_id: self.user_id,
            scope: self.scope,
        })
    }
}