// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::cancel_subscription::_cancel_subscription_input::CancelSubscriptionInputBuilder;
pub use crate::operation::cancel_subscription::_cancel_subscription_output::CancelSubscriptionOutputBuilder;
impl crate::operation::cancel_subscription::builders::CancelSubscriptionInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::cancel_subscription::CancelSubscriptionOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::cancel_subscription::CancelSubscriptionError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.cancel_subscription();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `CancelSubscription`.
///
/// Cancels a user's subscription at the end of the current billing period.
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CancelSubscriptionFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::cancel_subscription::builders::CancelSubscriptionInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::cancel_subscription::CancelSubscriptionOutput,
crate::operation::cancel_subscription::CancelSubscriptionError,
> for CancelSubscriptionFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::cancel_subscription::CancelSubscriptionOutput,
crate::operation::cancel_subscription::CancelSubscriptionError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl CancelSubscriptionFluentBuilder {
/// Creates a new `CancelSubscriptionFluentBuilder`.
pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
Self {
handle,
inner: ::std::default::Default::default(),
config_override: ::std::option::Option::None,
}
}
/// Access the CancelSubscription as a reference.
pub fn as_input(&self) -> &crate::operation::cancel_subscription::builders::CancelSubscriptionInputBuilder {
&self.inner
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> ::std::result::Result<
crate::operation::cancel_subscription::CancelSubscriptionOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::cancel_subscription::CancelSubscriptionError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let input = self
.inner
.build()
.map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
let runtime_plugins = crate::operation::cancel_subscription::CancelSubscription::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::cancel_subscription::CancelSubscription::orchestrate(&runtime_plugins, input).await
}
/// Consumes this builder, creating a customizable operation that can be modified before being sent.
pub fn customize(
self,
) -> crate::client::customize::CustomizableOperation<
crate::operation::cancel_subscription::CancelSubscriptionOutput,
crate::operation::cancel_subscription::CancelSubscriptionError,
Self,
> {
crate::client::customize::CustomizableOperation::new(self)
}
pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
self.set_config_override(::std::option::Option::Some(config_override.into()));
self
}
pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
self.config_override = config_override;
self
}
/// The ID of the app.
pub fn app_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.app_id(input.into());
self
}
/// The ID of the app.
pub fn set_app_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_app_id(input);
self
}
/// The ID of the app.
pub fn get_app_id(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_app_id()
}
/// 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(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.user_id(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.inner = self.inner.set_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.inner.get_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.
pub fn effective_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.inner = self.inner.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 set_effective_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.inner = self.inner.set_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.inner.get_effective_at()
}
/// Required. The environment: live or sandbox.
pub fn scope(mut self, input: crate::types::RequestScope) -> Self {
self.inner = self.inner.scope(input);
self
}
/// Required. The environment: live or sandbox.
pub fn set_scope(mut self, input: ::std::option::Option<crate::types::RequestScope>) -> Self {
self.inner = self.inner.set_scope(input);
self
}
/// Required. The environment: live or sandbox.
pub fn get_scope(&self) -> &::std::option::Option<crate::types::RequestScope> {
self.inner.get_scope()
}
}