aws_sdk_elastictranscoder/operation/create_preset/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_preset::_create_preset_output::CreatePresetOutputBuilder;
3
4pub use crate::operation::create_preset::_create_preset_input::CreatePresetInputBuilder;
5
6impl crate::operation::create_preset::builders::CreatePresetInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_preset::CreatePresetOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_preset::CreatePresetError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_preset();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreatePreset`.
24///
25/// <p>The CreatePreset operation creates a preset with settings that you specify.</p><important>
26/// <p>Elastic Transcoder checks the CreatePreset settings to ensure that they meet Elastic Transcoder requirements and to determine whether they comply with H.264 standards. If your settings are not valid for Elastic Transcoder, Elastic Transcoder returns an HTTP 400 response (<code>ValidationException</code>) and does not create the preset. If the settings are valid for Elastic Transcoder but aren't strictly compliant with the H.264 standard, Elastic Transcoder creates the preset and returns a warning message in the response. This helps you determine whether your settings comply with the H.264 standard while giving you greater flexibility with respect to the video that Elastic Transcoder produces.</p>
27/// </important>
28/// <p>Elastic Transcoder uses the H.264 video-compression format. For more information, see the International Telecommunication Union publication <i>Recommendation ITU-T H.264: Advanced video coding for generic audiovisual services</i>.</p>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct CreatePresetFluentBuilder {
31    handle: ::std::sync::Arc<crate::client::Handle>,
32    inner: crate::operation::create_preset::builders::CreatePresetInputBuilder,
33    config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36    crate::client::customize::internal::CustomizableSend<
37        crate::operation::create_preset::CreatePresetOutput,
38        crate::operation::create_preset::CreatePresetError,
39    > for CreatePresetFluentBuilder
40{
41    fn send(
42        self,
43        config_override: crate::config::Builder,
44    ) -> crate::client::customize::internal::BoxFuture<
45        crate::client::customize::internal::SendResult<
46            crate::operation::create_preset::CreatePresetOutput,
47            crate::operation::create_preset::CreatePresetError,
48        >,
49    > {
50        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51    }
52}
53impl CreatePresetFluentBuilder {
54    /// Creates a new `CreatePresetFluentBuilder`.
55    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56        Self {
57            handle,
58            inner: ::std::default::Default::default(),
59            config_override: ::std::option::Option::None,
60        }
61    }
62    /// Access the CreatePreset as a reference.
63    pub fn as_input(&self) -> &crate::operation::create_preset::builders::CreatePresetInputBuilder {
64        &self.inner
65    }
66    /// Sends the request and returns the response.
67    ///
68    /// If an error occurs, an `SdkError` will be returned with additional details that
69    /// can be matched against.
70    ///
71    /// By default, any retryable failures will be retried twice. Retry behavior
72    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73    /// set when configuring the client.
74    pub async fn send(
75        self,
76    ) -> ::std::result::Result<
77        crate::operation::create_preset::CreatePresetOutput,
78        ::aws_smithy_runtime_api::client::result::SdkError<
79            crate::operation::create_preset::CreatePresetError,
80            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81        >,
82    > {
83        let input = self
84            .inner
85            .build()
86            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87        let runtime_plugins = crate::operation::create_preset::CreatePreset::operation_runtime_plugins(
88            self.handle.runtime_plugins.clone(),
89            &self.handle.conf,
90            self.config_override,
91        );
92        crate::operation::create_preset::CreatePreset::orchestrate(&runtime_plugins, input).await
93    }
94
95    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96    pub fn customize(
97        self,
98    ) -> crate::client::customize::CustomizableOperation<
99        crate::operation::create_preset::CreatePresetOutput,
100        crate::operation::create_preset::CreatePresetError,
101        Self,
102    > {
103        crate::client::customize::CustomizableOperation::new(self)
104    }
105    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106        self.set_config_override(::std::option::Option::Some(config_override.into()));
107        self
108    }
109
110    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111        self.config_override = config_override;
112        self
113    }
114    /// <p>The name of the preset. We recommend that the name be unique within the AWS account, but uniqueness is not enforced.</p>
115    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116        self.inner = self.inner.name(input.into());
117        self
118    }
119    /// <p>The name of the preset. We recommend that the name be unique within the AWS account, but uniqueness is not enforced.</p>
120    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121        self.inner = self.inner.set_name(input);
122        self
123    }
124    /// <p>The name of the preset. We recommend that the name be unique within the AWS account, but uniqueness is not enforced.</p>
125    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
126        self.inner.get_name()
127    }
128    /// <p>A description of the preset.</p>
129    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        self.inner = self.inner.description(input.into());
131        self
132    }
133    /// <p>A description of the preset.</p>
134    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135        self.inner = self.inner.set_description(input);
136        self
137    }
138    /// <p>A description of the preset.</p>
139    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
140        self.inner.get_description()
141    }
142    /// <p>The container type for the output file. Valid values include <code>flac</code>, <code>flv</code>, <code>fmp4</code>, <code>gif</code>, <code>mp3</code>, <code>mp4</code>, <code>mpg</code>, <code>mxf</code>, <code>oga</code>, <code>ogg</code>, <code>ts</code>, and <code>webm</code>.</p>
143    pub fn container(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.inner = self.inner.container(input.into());
145        self
146    }
147    /// <p>The container type for the output file. Valid values include <code>flac</code>, <code>flv</code>, <code>fmp4</code>, <code>gif</code>, <code>mp3</code>, <code>mp4</code>, <code>mpg</code>, <code>mxf</code>, <code>oga</code>, <code>ogg</code>, <code>ts</code>, and <code>webm</code>.</p>
148    pub fn set_container(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149        self.inner = self.inner.set_container(input);
150        self
151    }
152    /// <p>The container type for the output file. Valid values include <code>flac</code>, <code>flv</code>, <code>fmp4</code>, <code>gif</code>, <code>mp3</code>, <code>mp4</code>, <code>mpg</code>, <code>mxf</code>, <code>oga</code>, <code>ogg</code>, <code>ts</code>, and <code>webm</code>.</p>
153    pub fn get_container(&self) -> &::std::option::Option<::std::string::String> {
154        self.inner.get_container()
155    }
156    /// <p>A section of the request body that specifies the video parameters.</p>
157    pub fn video(mut self, input: crate::types::VideoParameters) -> Self {
158        self.inner = self.inner.video(input);
159        self
160    }
161    /// <p>A section of the request body that specifies the video parameters.</p>
162    pub fn set_video(mut self, input: ::std::option::Option<crate::types::VideoParameters>) -> Self {
163        self.inner = self.inner.set_video(input);
164        self
165    }
166    /// <p>A section of the request body that specifies the video parameters.</p>
167    pub fn get_video(&self) -> &::std::option::Option<crate::types::VideoParameters> {
168        self.inner.get_video()
169    }
170    /// <p>A section of the request body that specifies the audio parameters.</p>
171    pub fn audio(mut self, input: crate::types::AudioParameters) -> Self {
172        self.inner = self.inner.audio(input);
173        self
174    }
175    /// <p>A section of the request body that specifies the audio parameters.</p>
176    pub fn set_audio(mut self, input: ::std::option::Option<crate::types::AudioParameters>) -> Self {
177        self.inner = self.inner.set_audio(input);
178        self
179    }
180    /// <p>A section of the request body that specifies the audio parameters.</p>
181    pub fn get_audio(&self) -> &::std::option::Option<crate::types::AudioParameters> {
182        self.inner.get_audio()
183    }
184    /// <p>A section of the request body that specifies the thumbnail parameters, if any.</p>
185    pub fn thumbnails(mut self, input: crate::types::Thumbnails) -> Self {
186        self.inner = self.inner.thumbnails(input);
187        self
188    }
189    /// <p>A section of the request body that specifies the thumbnail parameters, if any.</p>
190    pub fn set_thumbnails(mut self, input: ::std::option::Option<crate::types::Thumbnails>) -> Self {
191        self.inner = self.inner.set_thumbnails(input);
192        self
193    }
194    /// <p>A section of the request body that specifies the thumbnail parameters, if any.</p>
195    pub fn get_thumbnails(&self) -> &::std::option::Option<crate::types::Thumbnails> {
196        self.inner.get_thumbnails()
197    }
198}