Skip to main content

aws_sdk_appmonetization/operation/create_plan/
_create_plan_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// Output for CreatePlan.
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreatePlanOutput {
7    /// The newly created plan, carrying its server-generated planId. It exists on the draft (DRAFT) offering until it is published.
8    pub plan: ::std::option::Option<crate::types::Plan>,
9    _request_id: Option<String>,
10}
11impl CreatePlanOutput {
12    /// The newly created plan, carrying its server-generated planId. It exists on the draft (DRAFT) offering until it is published.
13    pub fn plan(&self) -> ::std::option::Option<&crate::types::Plan> {
14        self.plan.as_ref()
15    }
16}
17impl ::aws_types::request_id::RequestId for CreatePlanOutput {
18    fn request_id(&self) -> Option<&str> {
19        self._request_id.as_deref()
20    }
21}
22impl CreatePlanOutput {
23    /// Creates a new builder-style object to manufacture [`CreatePlanOutput`](crate::operation::create_plan::CreatePlanOutput).
24    pub fn builder() -> crate::operation::create_plan::builders::CreatePlanOutputBuilder {
25        crate::operation::create_plan::builders::CreatePlanOutputBuilder::default()
26    }
27}
28
29/// A builder for [`CreatePlanOutput`](crate::operation::create_plan::CreatePlanOutput).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct CreatePlanOutputBuilder {
33    pub(crate) plan: ::std::option::Option<crate::types::Plan>,
34    _request_id: Option<String>,
35}
36impl CreatePlanOutputBuilder {
37    /// The newly created plan, carrying its server-generated planId. It exists on the draft (DRAFT) offering until it is published.
38    /// This field is required.
39    pub fn plan(mut self, input: crate::types::Plan) -> Self {
40        self.plan = ::std::option::Option::Some(input);
41        self
42    }
43    /// The newly created plan, carrying its server-generated planId. It exists on the draft (DRAFT) offering until it is published.
44    pub fn set_plan(mut self, input: ::std::option::Option<crate::types::Plan>) -> Self {
45        self.plan = input;
46        self
47    }
48    /// The newly created plan, carrying its server-generated planId. It exists on the draft (DRAFT) offering until it is published.
49    pub fn get_plan(&self) -> &::std::option::Option<crate::types::Plan> {
50        &self.plan
51    }
52    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
53        self._request_id = Some(request_id.into());
54        self
55    }
56
57    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
58        self._request_id = request_id;
59        self
60    }
61    /// Consumes the builder and constructs a [`CreatePlanOutput`](crate::operation::create_plan::CreatePlanOutput).
62    pub fn build(self) -> crate::operation::create_plan::CreatePlanOutput {
63        crate::operation::create_plan::CreatePlanOutput {
64            plan: self.plan,
65            _request_id: self._request_id,
66        }
67    }
68}