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 CancelSubscription.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CancelSubscriptionInput {
    /// The ID of the app.
    pub app_id: ::std::option::Option<::std::string::String>,
    /// An opaque identifier that you assign to an end user. Do not include personally identifiable or otherwise sensitive data in this value.
    pub user_id: ::std::option::Option<::std::string::String>,
    /// The subscription's current effective time, as returned by GetSubscription, used as an optimistic-concurrency check. If GetSubscription returns a pending change, pass `pendingChange.effectiveAt`; otherwise pass `subscription.effectiveAt`. This value does not choose when the cancellation takes effect: a new cancellation takes effect at the end of the current billing period, returned as `cancellationEffectiveAt`. If the subscription's effective time has changed since you read it (for example, because another plan change was made), the value no longer matches and the request fails with ConflictException; call GetSubscription again and retry with the new value. If the subscription is already cancelled or a cancellation is already scheduled, the request returns its current state and does not compare this value.
    pub effective_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// Required. The environment: live or sandbox.
    pub scope: ::std::option::Option<crate::types::RequestScope>,
}
impl CancelSubscriptionInput {
    /// The ID of the app.
    pub fn app_id(&self) -> ::std::option::Option<&str> {
        self.app_id.as_deref()
    }
    /// An opaque identifier that you assign to an end user. Do not include personally identifiable or otherwise sensitive data in this value.
    pub fn user_id(&self) -> ::std::option::Option<&str> {
        self.user_id.as_deref()
    }
    /// The subscription's current effective time, as returned by GetSubscription, used as an optimistic-concurrency check. If GetSubscription returns a pending change, pass `pendingChange.effectiveAt`; otherwise pass `subscription.effectiveAt`. This value does not choose when the cancellation takes effect: a new cancellation takes effect at the end of the current billing period, returned as `cancellationEffectiveAt`. If the subscription's effective time has changed since you read it (for example, because another plan change was made), the value no longer matches and the request fails with ConflictException; call GetSubscription again and retry with the new value. If the subscription is already cancelled or a cancellation is already scheduled, the request returns its current state and does not compare this value.
    pub fn effective_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.effective_at.as_ref()
    }
    /// Required. The environment: live or sandbox.
    pub fn scope(&self) -> ::std::option::Option<&crate::types::RequestScope> {
        self.scope.as_ref()
    }
}
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) app_id: ::std::option::Option<::std::string::String>,
    pub(crate) user_id: ::std::option::Option<::std::string::String>,
    pub(crate) effective_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) scope: ::std::option::Option<crate::types::RequestScope>,
}
impl CancelSubscriptionInputBuilder {
    /// 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
    }
    /// An opaque identifier that you assign to an end user. Do not include personally identifiable or otherwise sensitive data in this value.
    /// This field is required.
    pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.user_id = ::std::option::Option::Some(input.into());
        self
    }
    /// An opaque identifier that you assign to an end user. Do not include personally identifiable or otherwise sensitive data in this value.
    pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.user_id = input;
        self
    }
    /// An opaque identifier that you assign to an end user. Do not include personally identifiable or otherwise sensitive data in this value.
    pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.user_id
    }
    /// The subscription's current effective time, as returned by GetSubscription, used as an optimistic-concurrency check. If GetSubscription returns a pending change, pass `pendingChange.effectiveAt`; otherwise pass `subscription.effectiveAt`. This value does not choose when the cancellation takes effect: a new cancellation takes effect at the end of the current billing period, returned as `cancellationEffectiveAt`. If the subscription's effective time has changed since you read it (for example, because another plan change was made), the value no longer matches and the request fails with ConflictException; call GetSubscription again and retry with the new value. If the subscription is already cancelled or a cancellation is already scheduled, the request returns its current state and does not compare this value.
    /// This field is required.
    pub fn effective_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.effective_at = ::std::option::Option::Some(input);
        self
    }
    /// The subscription's current effective time, as returned by GetSubscription, used as an optimistic-concurrency check. If GetSubscription returns a pending change, pass `pendingChange.effectiveAt`; otherwise pass `subscription.effectiveAt`. This value does not choose when the cancellation takes effect: a new cancellation takes effect at the end of the current billing period, returned as `cancellationEffectiveAt`. If the subscription's effective time has changed since you read it (for example, because another plan change was made), the value no longer matches and the request fails with ConflictException; call GetSubscription again and retry with the new value. If the subscription is already cancelled or a cancellation is already scheduled, the request returns its current state and does not compare this value.
    pub fn set_effective_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.effective_at = input;
        self
    }
    /// The subscription's current effective time, as returned by GetSubscription, used as an optimistic-concurrency check. If GetSubscription returns a pending change, pass `pendingChange.effectiveAt`; otherwise pass `subscription.effectiveAt`. This value does not choose when the cancellation takes effect: a new cancellation takes effect at the end of the current billing period, returned as `cancellationEffectiveAt`. If the subscription's effective time has changed since you read it (for example, because another plan change was made), the value no longer matches and the request fails with ConflictException; call GetSubscription again and retry with the new value. If the subscription is already cancelled or a cancellation is already scheduled, the request returns its current state and does not compare this value.
    pub fn get_effective_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.effective_at
    }
    /// Required. The environment: live or sandbox.
    /// This field is required.
    pub fn scope(mut self, input: crate::types::RequestScope) -> Self {
        self.scope = ::std::option::Option::Some(input);
        self
    }
    /// Required. The environment: live or sandbox.
    pub fn set_scope(mut self, input: ::std::option::Option<crate::types::RequestScope>) -> Self {
        self.scope = input;
        self
    }
    /// Required. The environment: live or sandbox.
    pub fn get_scope(&self) -> &::std::option::Option<crate::types::RequestScope> {
        &self.scope
    }
    /// 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 {
            app_id: self.app_id,
            user_id: self.user_id,
            effective_at: self.effective_at,
            scope: self.scope,
        })
    }
}