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 CancelSubscriptionInput {
    /// <p>The ARN of the subscription to cancel.</p>
    pub arn: ::std::option::Option<::std::string::String>,
    /// <p>The <code>ETag</code> value from a previous <code>GetSubscription</code> or <code>ListSubscriptions</code> response.</p>
    pub if_match: ::std::option::Option<::std::string::String>,
    /// <p>A unique, case-sensitive identifier that you provide to ensure the request is handled only once.</p>
    pub client_token: ::std::option::Option<::std::string::String>,
}
impl CancelSubscriptionInput {
    /// <p>The ARN of the subscription to cancel.</p>
    pub fn arn(&self) -> ::std::option::Option<&str> {
        self.arn.as_deref()
    }
    /// <p>The <code>ETag</code> value from a previous <code>GetSubscription</code> or <code>ListSubscriptions</code> response.</p>
    pub fn if_match(&self) -> ::std::option::Option<&str> {
        self.if_match.as_deref()
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure the request is handled only once.</p>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
}
impl CancelSubscriptionInput {
    /// Creates a new builder-style object to manufacture [`CancelSubscriptionInput`](crate::operation::cancel_subscription::CancelSubscriptionInput).
    pub fn builder() -> crate::operation::cancel_subscription::builders::CancelSubscriptionInputBuilder {
        crate::operation::cancel_subscription::builders::CancelSubscriptionInputBuilder::default()
    }
}

/// A builder for [`CancelSubscriptionInput`](crate::operation::cancel_subscription::CancelSubscriptionInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CancelSubscriptionInputBuilder {
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    pub(crate) if_match: ::std::option::Option<::std::string::String>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
}
impl CancelSubscriptionInputBuilder {
    /// <p>The ARN of the subscription to cancel.</p>
    /// This field is required.
    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the subscription to cancel.</p>
    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// <p>The ARN of the subscription to cancel.</p>
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    /// <p>The <code>ETag</code> value from a previous <code>GetSubscription</code> or <code>ListSubscriptions</code> response.</p>
    /// This field is required.
    pub fn if_match(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.if_match = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The <code>ETag</code> value from a previous <code>GetSubscription</code> or <code>ListSubscriptions</code> response.</p>
    pub fn set_if_match(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.if_match = input;
        self
    }
    /// <p>The <code>ETag</code> value from a previous <code>GetSubscription</code> or <code>ListSubscriptions</code> response.</p>
    pub fn get_if_match(&self) -> &::std::option::Option<::std::string::String> {
        &self.if_match
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure the request is handled only once.</p>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure the request is handled only once.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure the request is handled only once.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// Consumes the builder and constructs a [`CancelSubscriptionInput`](crate::operation::cancel_subscription::CancelSubscriptionInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::cancel_subscription::CancelSubscriptionInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::cancel_subscription::CancelSubscriptionInput {
            arn: self.arn,
            if_match: self.if_match,
            client_token: self.client_token,
        })
    }
}