aws-sdk-pricingplanmanager 1.0.0

AWS SDK for PricingPlanManager
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetSubscriptionOutput {
    /// <p>The details of the requested subscription.</p>
    pub subscription: ::std::option::Option<crate::types::Subscription>,
    /// <p>The entity tag for concurrency control. Use this value in the <code>If-Match</code> header for subsequent operations on this subscription.</p>
    pub e_tag: ::std::string::String,
    _request_id: Option<String>,
}
impl GetSubscriptionOutput {
    /// <p>The details of the requested subscription.</p>
    pub fn subscription(&self) -> ::std::option::Option<&crate::types::Subscription> {
        self.subscription.as_ref()
    }
    /// <p>The entity tag for concurrency control. Use this value in the <code>If-Match</code> header for subsequent operations on this subscription.</p>
    pub fn e_tag(&self) -> &str {
        use std::ops::Deref;
        self.e_tag.deref()
    }
}
impl ::aws_types::request_id::RequestId for GetSubscriptionOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetSubscriptionOutput {
    /// Creates a new builder-style object to manufacture [`GetSubscriptionOutput`](crate::operation::get_subscription::GetSubscriptionOutput).
    pub fn builder() -> crate::operation::get_subscription::builders::GetSubscriptionOutputBuilder {
        crate::operation::get_subscription::builders::GetSubscriptionOutputBuilder::default()
    }
}

/// A builder for [`GetSubscriptionOutput`](crate::operation::get_subscription::GetSubscriptionOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetSubscriptionOutputBuilder {
    pub(crate) subscription: ::std::option::Option<crate::types::Subscription>,
    pub(crate) e_tag: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl GetSubscriptionOutputBuilder {
    /// <p>The details of the requested subscription.</p>
    /// This field is required.
    pub fn subscription(mut self, input: crate::types::Subscription) -> Self {
        self.subscription = ::std::option::Option::Some(input);
        self
    }
    /// <p>The details of the requested subscription.</p>
    pub fn set_subscription(mut self, input: ::std::option::Option<crate::types::Subscription>) -> Self {
        self.subscription = input;
        self
    }
    /// <p>The details of the requested subscription.</p>
    pub fn get_subscription(&self) -> &::std::option::Option<crate::types::Subscription> {
        &self.subscription
    }
    /// <p>The entity tag for concurrency control. Use this value in the <code>If-Match</code> header for subsequent operations on this subscription.</p>
    /// This field is required.
    pub fn e_tag(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.e_tag = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The entity tag for concurrency control. Use this value in the <code>If-Match</code> header for subsequent operations on this subscription.</p>
    pub fn set_e_tag(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.e_tag = input;
        self
    }
    /// <p>The entity tag for concurrency control. Use this value in the <code>If-Match</code> header for subsequent operations on this subscription.</p>
    pub fn get_e_tag(&self) -> &::std::option::Option<::std::string::String> {
        &self.e_tag
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetSubscriptionOutput`](crate::operation::get_subscription::GetSubscriptionOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`e_tag`](crate::operation::get_subscription::builders::GetSubscriptionOutputBuilder::e_tag)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_subscription::GetSubscriptionOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_subscription::GetSubscriptionOutput {
            subscription: self.subscription,
            e_tag: self.e_tag.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "e_tag",
                    "e_tag was not specified but it is required when building GetSubscriptionOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}