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 GetPlan.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetPlanInput {
    /// The ID of the app.
    pub app_id: ::std::option::Option<::std::string::String>,
    /// The identifier of the plan. AWS App Monetization generates this value when you create the plan. It is unique within the app and is never reused. Treat it as opaque.
    pub plan_id: ::std::option::Option<::std::string::String>,
    /// The offering stage to read the plan from: DRAFT (the latest draft) or PUBLISHED (the offering customers see). Absent: PUBLISHED when scope=live, DRAFT when scope=sandbox.
    pub stage: ::std::option::Option<crate::types::PlanStage>,
    /// Required. The environment: live or sandbox. live reads the published offering by default; sandbox reads the app's draft (what the sandbox runs).
    pub scope: ::std::option::Option<crate::types::RequestScope>,
}
impl GetPlanInput {
    /// The ID of the app.
    pub fn app_id(&self) -> ::std::option::Option<&str> {
        self.app_id.as_deref()
    }
    /// The identifier of the plan. AWS App Monetization generates this value when you create the plan. It is unique within the app and is never reused. Treat it as opaque.
    pub fn plan_id(&self) -> ::std::option::Option<&str> {
        self.plan_id.as_deref()
    }
    /// The offering stage to read the plan from: DRAFT (the latest draft) or PUBLISHED (the offering customers see). Absent: PUBLISHED when scope=live, DRAFT when scope=sandbox.
    pub fn stage(&self) -> ::std::option::Option<&crate::types::PlanStage> {
        self.stage.as_ref()
    }
    /// Required. The environment: live or sandbox. live reads the published offering by default; sandbox reads the app's draft (what the sandbox runs).
    pub fn scope(&self) -> ::std::option::Option<&crate::types::RequestScope> {
        self.scope.as_ref()
    }
}
impl GetPlanInput {
    /// Creates a new builder-style object to manufacture [`GetPlanInput`](crate::operation::get_plan::GetPlanInput).
    pub fn builder() -> crate::operation::get_plan::builders::GetPlanInputBuilder {
        crate::operation::get_plan::builders::GetPlanInputBuilder::default()
    }
}

/// A builder for [`GetPlanInput`](crate::operation::get_plan::GetPlanInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetPlanInputBuilder {
    pub(crate) app_id: ::std::option::Option<::std::string::String>,
    pub(crate) plan_id: ::std::option::Option<::std::string::String>,
    pub(crate) stage: ::std::option::Option<crate::types::PlanStage>,
    pub(crate) scope: ::std::option::Option<crate::types::RequestScope>,
}
impl GetPlanInputBuilder {
    /// 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
    }
    /// The identifier of the plan. AWS App Monetization generates this value when you create the plan. It is unique within the app and is never reused. Treat it as opaque.
    /// This field is required.
    pub fn plan_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.plan_id = ::std::option::Option::Some(input.into());
        self
    }
    /// The identifier of the plan. AWS App Monetization generates this value when you create the plan. It is unique within the app and is never reused. Treat it as opaque.
    pub fn set_plan_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.plan_id = input;
        self
    }
    /// The identifier of the plan. AWS App Monetization generates this value when you create the plan. It is unique within the app and is never reused. Treat it as opaque.
    pub fn get_plan_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.plan_id
    }
    /// The offering stage to read the plan from: DRAFT (the latest draft) or PUBLISHED (the offering customers see). Absent: PUBLISHED when scope=live, DRAFT when scope=sandbox.
    pub fn stage(mut self, input: crate::types::PlanStage) -> Self {
        self.stage = ::std::option::Option::Some(input);
        self
    }
    /// The offering stage to read the plan from: DRAFT (the latest draft) or PUBLISHED (the offering customers see). Absent: PUBLISHED when scope=live, DRAFT when scope=sandbox.
    pub fn set_stage(mut self, input: ::std::option::Option<crate::types::PlanStage>) -> Self {
        self.stage = input;
        self
    }
    /// The offering stage to read the plan from: DRAFT (the latest draft) or PUBLISHED (the offering customers see). Absent: PUBLISHED when scope=live, DRAFT when scope=sandbox.
    pub fn get_stage(&self) -> &::std::option::Option<crate::types::PlanStage> {
        &self.stage
    }
    /// Required. The environment: live or sandbox. live reads the published offering by default; sandbox reads the app's draft (what the sandbox runs).
    /// 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. live reads the published offering by default; sandbox reads the app's draft (what the sandbox runs).
    pub fn set_scope(mut self, input: ::std::option::Option<crate::types::RequestScope>) -> Self {
        self.scope = input;
        self
    }
    /// Required. The environment: live or sandbox. live reads the published offering by default; sandbox reads the app's draft (what the sandbox runs).
    pub fn get_scope(&self) -> &::std::option::Option<crate::types::RequestScope> {
        &self.scope
    }
    /// Consumes the builder and constructs a [`GetPlanInput`](crate::operation::get_plan::GetPlanInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::get_plan::GetPlanInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_plan::GetPlanInput {
            app_id: self.app_id,
            plan_id: self.plan_id,
            stage: self.stage,
            scope: self.scope,
        })
    }
}