aws-sdk-medialive 1.78.0

AWS SDK for AWS Elemental MediaLive
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::purchase_offering::_purchase_offering_output::PurchaseOfferingOutputBuilder;

pub use crate::operation::purchase_offering::_purchase_offering_input::PurchaseOfferingInputBuilder;

impl crate::operation::purchase_offering::builders::PurchaseOfferingInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::purchase_offering::PurchaseOfferingOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::purchase_offering::PurchaseOfferingError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.purchase_offering();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `PurchaseOffering`.
///
/// Purchase an offering and create a reservation.
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct PurchaseOfferingFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::purchase_offering::builders::PurchaseOfferingInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::purchase_offering::PurchaseOfferingOutput,
        crate::operation::purchase_offering::PurchaseOfferingError,
    > for PurchaseOfferingFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::purchase_offering::PurchaseOfferingOutput,
            crate::operation::purchase_offering::PurchaseOfferingError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl PurchaseOfferingFluentBuilder {
    /// Creates a new `PurchaseOfferingFluentBuilder`.
    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 PurchaseOffering as a reference.
    pub fn as_input(&self) -> &crate::operation::purchase_offering::builders::PurchaseOfferingInputBuilder {
        &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::purchase_offering::PurchaseOfferingOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::purchase_offering::PurchaseOfferingError,
            ::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::purchase_offering::PurchaseOffering::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::purchase_offering::PurchaseOffering::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::purchase_offering::PurchaseOfferingOutput,
        crate::operation::purchase_offering::PurchaseOfferingError,
        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
    }
    /// Number of resources
    pub fn count(mut self, input: i32) -> Self {
        self.inner = self.inner.count(input);
        self
    }
    /// Number of resources
    pub fn set_count(mut self, input: ::std::option::Option<i32>) -> Self {
        self.inner = self.inner.set_count(input);
        self
    }
    /// Number of resources
    pub fn get_count(&self) -> &::std::option::Option<i32> {
        self.inner.get_count()
    }
    /// Name for the new reservation
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.name(input.into());
        self
    }
    /// Name for the new reservation
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_name(input);
        self
    }
    /// Name for the new reservation
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_name()
    }
    /// Offering to purchase, e.g. '87654321'
    pub fn offering_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.offering_id(input.into());
        self
    }
    /// Offering to purchase, e.g. '87654321'
    pub fn set_offering_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_offering_id(input);
        self
    }
    /// Offering to purchase, e.g. '87654321'
    pub fn get_offering_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_offering_id()
    }
    /// Renewal settings for the reservation
    pub fn renewal_settings(mut self, input: crate::types::RenewalSettings) -> Self {
        self.inner = self.inner.renewal_settings(input);
        self
    }
    /// Renewal settings for the reservation
    pub fn set_renewal_settings(mut self, input: ::std::option::Option<crate::types::RenewalSettings>) -> Self {
        self.inner = self.inner.set_renewal_settings(input);
        self
    }
    /// Renewal settings for the reservation
    pub fn get_renewal_settings(&self) -> &::std::option::Option<crate::types::RenewalSettings> {
        self.inner.get_renewal_settings()
    }
    /// Unique request ID to be specified. This is needed to prevent retries from creating multiple resources.
    pub fn request_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.request_id(input.into());
        self
    }
    /// Unique request ID to be specified. This is needed to prevent retries from creating multiple resources.
    pub fn set_request_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_request_id(input);
        self
    }
    /// Unique request ID to be specified. This is needed to prevent retries from creating multiple resources.
    pub fn get_request_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_request_id()
    }
    /// Requested reservation start time (UTC) in ISO-8601 format. The specified time must be between the first day of the current month and one year from now. If no value is given, the default is now.
    pub fn start(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.start(input.into());
        self
    }
    /// Requested reservation start time (UTC) in ISO-8601 format. The specified time must be between the first day of the current month and one year from now. If no value is given, the default is now.
    pub fn set_start(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_start(input);
        self
    }
    /// Requested reservation start time (UTC) in ISO-8601 format. The specified time must be between the first day of the current month and one year from now. If no value is given, the default is now.
    pub fn get_start(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_start()
    }
    ///
    /// Adds a key-value pair to `Tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// A collection of key-value pairs
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.tags(k.into(), v.into());
        self
    }
    /// A collection of key-value pairs
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.inner = self.inner.set_tags(input);
        self
    }
    /// A collection of key-value pairs
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.inner.get_tags()
    }
}