Skip to main content

aws_sdk_pricingplanmanager/operation/update_subscription/
_update_subscription_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct UpdateSubscriptionOutput {
6    /// <p>The details of the updated subscription. For downgrades, the current tier remains unchanged and a <code>scheduledChange</code> indicates the pending change.</p>
7    pub subscription: ::std::option::Option<crate::types::Subscription>,
8    /// <p>The updated entity tag for concurrency control.</p>
9    pub e_tag: ::std::string::String,
10    _request_id: Option<String>,
11}
12impl UpdateSubscriptionOutput {
13    /// <p>The details of the updated subscription. For downgrades, the current tier remains unchanged and a <code>scheduledChange</code> indicates the pending change.</p>
14    pub fn subscription(&self) -> ::std::option::Option<&crate::types::Subscription> {
15        self.subscription.as_ref()
16    }
17    /// <p>The updated entity tag for concurrency control.</p>
18    pub fn e_tag(&self) -> &str {
19        use std::ops::Deref;
20        self.e_tag.deref()
21    }
22}
23impl ::aws_types::request_id::RequestId for UpdateSubscriptionOutput {
24    fn request_id(&self) -> Option<&str> {
25        self._request_id.as_deref()
26    }
27}
28impl UpdateSubscriptionOutput {
29    /// Creates a new builder-style object to manufacture [`UpdateSubscriptionOutput`](crate::operation::update_subscription::UpdateSubscriptionOutput).
30    pub fn builder() -> crate::operation::update_subscription::builders::UpdateSubscriptionOutputBuilder {
31        crate::operation::update_subscription::builders::UpdateSubscriptionOutputBuilder::default()
32    }
33}
34
35/// A builder for [`UpdateSubscriptionOutput`](crate::operation::update_subscription::UpdateSubscriptionOutput).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct UpdateSubscriptionOutputBuilder {
39    pub(crate) subscription: ::std::option::Option<crate::types::Subscription>,
40    pub(crate) e_tag: ::std::option::Option<::std::string::String>,
41    _request_id: Option<String>,
42}
43impl UpdateSubscriptionOutputBuilder {
44    /// <p>The details of the updated subscription. For downgrades, the current tier remains unchanged and a <code>scheduledChange</code> indicates the pending change.</p>
45    /// This field is required.
46    pub fn subscription(mut self, input: crate::types::Subscription) -> Self {
47        self.subscription = ::std::option::Option::Some(input);
48        self
49    }
50    /// <p>The details of the updated subscription. For downgrades, the current tier remains unchanged and a <code>scheduledChange</code> indicates the pending change.</p>
51    pub fn set_subscription(mut self, input: ::std::option::Option<crate::types::Subscription>) -> Self {
52        self.subscription = input;
53        self
54    }
55    /// <p>The details of the updated subscription. For downgrades, the current tier remains unchanged and a <code>scheduledChange</code> indicates the pending change.</p>
56    pub fn get_subscription(&self) -> &::std::option::Option<crate::types::Subscription> {
57        &self.subscription
58    }
59    /// <p>The updated entity tag for concurrency control.</p>
60    /// This field is required.
61    pub fn e_tag(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.e_tag = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The updated entity tag for concurrency control.</p>
66    pub fn set_e_tag(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.e_tag = input;
68        self
69    }
70    /// <p>The updated entity tag for concurrency control.</p>
71    pub fn get_e_tag(&self) -> &::std::option::Option<::std::string::String> {
72        &self.e_tag
73    }
74    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
75        self._request_id = Some(request_id.into());
76        self
77    }
78
79    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
80        self._request_id = request_id;
81        self
82    }
83    /// Consumes the builder and constructs a [`UpdateSubscriptionOutput`](crate::operation::update_subscription::UpdateSubscriptionOutput).
84    /// This method will fail if any of the following fields are not set:
85    /// - [`e_tag`](crate::operation::update_subscription::builders::UpdateSubscriptionOutputBuilder::e_tag)
86    pub fn build(
87        self,
88    ) -> ::std::result::Result<crate::operation::update_subscription::UpdateSubscriptionOutput, ::aws_smithy_types::error::operation::BuildError>
89    {
90        ::std::result::Result::Ok(crate::operation::update_subscription::UpdateSubscriptionOutput {
91            subscription: self.subscription,
92            e_tag: self.e_tag.ok_or_else(|| {
93                ::aws_smithy_types::error::operation::BuildError::missing_field(
94                    "e_tag",
95                    "e_tag was not specified but it is required when building UpdateSubscriptionOutput",
96                )
97            })?,
98            _request_id: self._request_id,
99        })
100    }
101}