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 UpdatePlan. This operation carries no scope selector: plan authoring always addresses the live app. The sandbox always runs the live app's draft, so its plans are read-only through this API. Read them with GetPlan or ListPlans using scope=sandbox or stage=DRAFT.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct UpdatePlanInput {
    /// 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 plan's updated pricing and packaging definition.
    pub definition: ::std::option::Option<crate::types::PlanDefinition>,
}
impl UpdatePlanInput {
    /// 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 plan's updated pricing and packaging definition.
    pub fn definition(&self) -> ::std::option::Option<&crate::types::PlanDefinition> {
        self.definition.as_ref()
    }
}
impl UpdatePlanInput {
    /// Creates a new builder-style object to manufacture [`UpdatePlanInput`](crate::operation::update_plan::UpdatePlanInput).
    pub fn builder() -> crate::operation::update_plan::builders::UpdatePlanInputBuilder {
        crate::operation::update_plan::builders::UpdatePlanInputBuilder::default()
    }
}

/// A builder for [`UpdatePlanInput`](crate::operation::update_plan::UpdatePlanInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdatePlanInputBuilder {
    pub(crate) app_id: ::std::option::Option<::std::string::String>,
    pub(crate) plan_id: ::std::option::Option<::std::string::String>,
    pub(crate) definition: ::std::option::Option<crate::types::PlanDefinition>,
}
impl UpdatePlanInputBuilder {
    /// 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 plan's updated pricing and packaging definition.
    /// This field is required.
    pub fn definition(mut self, input: crate::types::PlanDefinition) -> Self {
        self.definition = ::std::option::Option::Some(input);
        self
    }
    /// The plan's updated pricing and packaging definition.
    pub fn set_definition(mut self, input: ::std::option::Option<crate::types::PlanDefinition>) -> Self {
        self.definition = input;
        self
    }
    /// The plan's updated pricing and packaging definition.
    pub fn get_definition(&self) -> &::std::option::Option<crate::types::PlanDefinition> {
        &self.definition
    }
    /// Consumes the builder and constructs a [`UpdatePlanInput`](crate::operation::update_plan::UpdatePlanInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::update_plan::UpdatePlanInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::update_plan::UpdatePlanInput {
            app_id: self.app_id,
            plan_id: self.plan_id,
            definition: self.definition,
        })
    }
}