aws-sdk-mediaconvert 1.128.0

AWS SDK for AWS Elemental MediaConvert
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_preset::_create_preset_input::CreatePresetInputBuilder;

pub use crate::operation::create_preset::_create_preset_output::CreatePresetOutputBuilder;

impl crate::operation::create_preset::builders::CreatePresetInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::create_preset::CreatePresetOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_preset::CreatePresetError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.create_preset();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `CreatePreset`.
///
/// Create a new preset. For information about job templates see the User Guide at http://docs.aws.amazon.com/mediaconvert/latest/ug/what-is.html
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreatePresetFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::create_preset::builders::CreatePresetInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::create_preset::CreatePresetOutput,
        crate::operation::create_preset::CreatePresetError,
    > for CreatePresetFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::create_preset::CreatePresetOutput,
            crate::operation::create_preset::CreatePresetError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl CreatePresetFluentBuilder {
    /// Creates a new `CreatePresetFluentBuilder`.
    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 CreatePreset as a reference.
    pub fn as_input(&self) -> &crate::operation::create_preset::builders::CreatePresetInputBuilder {
        &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::create_preset::CreatePresetOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_preset::CreatePresetError,
            ::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::create_preset::CreatePreset::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::create_preset::CreatePreset::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::create_preset::CreatePresetOutput,
        crate::operation::create_preset::CreatePresetError,
        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
    }
    /// Optional. A category for the preset you are creating.
    pub fn category(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.category(input.into());
        self
    }
    /// Optional. A category for the preset you are creating.
    pub fn set_category(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_category(input);
        self
    }
    /// Optional. A category for the preset you are creating.
    pub fn get_category(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_category()
    }
    /// Optional. A description of the preset you are creating.
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.description(input.into());
        self
    }
    /// Optional. A description of the preset you are creating.
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_description(input);
        self
    }
    /// Optional. A description of the preset you are creating.
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_description()
    }
    /// The name of the preset you are creating.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.name(input.into());
        self
    }
    /// The name of the preset you are creating.
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_name(input);
        self
    }
    /// The name of the preset you are creating.
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_name()
    }
    /// Settings for preset
    pub fn settings(mut self, input: crate::types::PresetSettings) -> Self {
        self.inner = self.inner.settings(input);
        self
    }
    /// Settings for preset
    pub fn set_settings(mut self, input: ::std::option::Option<crate::types::PresetSettings>) -> Self {
        self.inner = self.inner.set_settings(input);
        self
    }
    /// Settings for preset
    pub fn get_settings(&self) -> &::std::option::Option<crate::types::PresetSettings> {
        self.inner.get_settings()
    }
    ///
    /// Adds a key-value pair to `Tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// The tags that you want to add to the resource. You can tag resources with a key-value pair or with only a key.
    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
    }
    /// The tags that you want to add to the resource. You can tag resources with a key-value pair or with only a key.
    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
    }
    /// The tags that you want to add to the resource. You can tag resources with a key-value pair or with only a key.
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.inner.get_tags()
    }
}