aws_sdk_elastictranscoder/operation/create_preset/
_create_preset_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The <code>CreatePresetRequest</code> structure.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreatePresetInput {
7    /// <p>The name of the preset. We recommend that the name be unique within the AWS account, but uniqueness is not enforced.</p>
8    pub name: ::std::option::Option<::std::string::String>,
9    /// <p>A description of the preset.</p>
10    pub description: ::std::option::Option<::std::string::String>,
11    /// <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>
12    pub container: ::std::option::Option<::std::string::String>,
13    /// <p>A section of the request body that specifies the video parameters.</p>
14    pub video: ::std::option::Option<crate::types::VideoParameters>,
15    /// <p>A section of the request body that specifies the audio parameters.</p>
16    pub audio: ::std::option::Option<crate::types::AudioParameters>,
17    /// <p>A section of the request body that specifies the thumbnail parameters, if any.</p>
18    pub thumbnails: ::std::option::Option<crate::types::Thumbnails>,
19}
20impl CreatePresetInput {
21    /// <p>The name of the preset. We recommend that the name be unique within the AWS account, but uniqueness is not enforced.</p>
22    pub fn name(&self) -> ::std::option::Option<&str> {
23        self.name.as_deref()
24    }
25    /// <p>A description of the preset.</p>
26    pub fn description(&self) -> ::std::option::Option<&str> {
27        self.description.as_deref()
28    }
29    /// <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>
30    pub fn container(&self) -> ::std::option::Option<&str> {
31        self.container.as_deref()
32    }
33    /// <p>A section of the request body that specifies the video parameters.</p>
34    pub fn video(&self) -> ::std::option::Option<&crate::types::VideoParameters> {
35        self.video.as_ref()
36    }
37    /// <p>A section of the request body that specifies the audio parameters.</p>
38    pub fn audio(&self) -> ::std::option::Option<&crate::types::AudioParameters> {
39        self.audio.as_ref()
40    }
41    /// <p>A section of the request body that specifies the thumbnail parameters, if any.</p>
42    pub fn thumbnails(&self) -> ::std::option::Option<&crate::types::Thumbnails> {
43        self.thumbnails.as_ref()
44    }
45}
46impl CreatePresetInput {
47    /// Creates a new builder-style object to manufacture [`CreatePresetInput`](crate::operation::create_preset::CreatePresetInput).
48    pub fn builder() -> crate::operation::create_preset::builders::CreatePresetInputBuilder {
49        crate::operation::create_preset::builders::CreatePresetInputBuilder::default()
50    }
51}
52
53/// A builder for [`CreatePresetInput`](crate::operation::create_preset::CreatePresetInput).
54#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
55#[non_exhaustive]
56pub struct CreatePresetInputBuilder {
57    pub(crate) name: ::std::option::Option<::std::string::String>,
58    pub(crate) description: ::std::option::Option<::std::string::String>,
59    pub(crate) container: ::std::option::Option<::std::string::String>,
60    pub(crate) video: ::std::option::Option<crate::types::VideoParameters>,
61    pub(crate) audio: ::std::option::Option<crate::types::AudioParameters>,
62    pub(crate) thumbnails: ::std::option::Option<crate::types::Thumbnails>,
63}
64impl CreatePresetInputBuilder {
65    /// <p>The name of the preset. We recommend that the name be unique within the AWS account, but uniqueness is not enforced.</p>
66    /// This field is required.
67    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68        self.name = ::std::option::Option::Some(input.into());
69        self
70    }
71    /// <p>The name of the preset. We recommend that the name be unique within the AWS account, but uniqueness is not enforced.</p>
72    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73        self.name = input;
74        self
75    }
76    /// <p>The name of the preset. We recommend that the name be unique within the AWS account, but uniqueness is not enforced.</p>
77    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
78        &self.name
79    }
80    /// <p>A description of the preset.</p>
81    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82        self.description = ::std::option::Option::Some(input.into());
83        self
84    }
85    /// <p>A description of the preset.</p>
86    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87        self.description = input;
88        self
89    }
90    /// <p>A description of the preset.</p>
91    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
92        &self.description
93    }
94    /// <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>
95    /// This field is required.
96    pub fn container(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97        self.container = ::std::option::Option::Some(input.into());
98        self
99    }
100    /// <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>
101    pub fn set_container(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102        self.container = input;
103        self
104    }
105    /// <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>
106    pub fn get_container(&self) -> &::std::option::Option<::std::string::String> {
107        &self.container
108    }
109    /// <p>A section of the request body that specifies the video parameters.</p>
110    pub fn video(mut self, input: crate::types::VideoParameters) -> Self {
111        self.video = ::std::option::Option::Some(input);
112        self
113    }
114    /// <p>A section of the request body that specifies the video parameters.</p>
115    pub fn set_video(mut self, input: ::std::option::Option<crate::types::VideoParameters>) -> Self {
116        self.video = input;
117        self
118    }
119    /// <p>A section of the request body that specifies the video parameters.</p>
120    pub fn get_video(&self) -> &::std::option::Option<crate::types::VideoParameters> {
121        &self.video
122    }
123    /// <p>A section of the request body that specifies the audio parameters.</p>
124    pub fn audio(mut self, input: crate::types::AudioParameters) -> Self {
125        self.audio = ::std::option::Option::Some(input);
126        self
127    }
128    /// <p>A section of the request body that specifies the audio parameters.</p>
129    pub fn set_audio(mut self, input: ::std::option::Option<crate::types::AudioParameters>) -> Self {
130        self.audio = input;
131        self
132    }
133    /// <p>A section of the request body that specifies the audio parameters.</p>
134    pub fn get_audio(&self) -> &::std::option::Option<crate::types::AudioParameters> {
135        &self.audio
136    }
137    /// <p>A section of the request body that specifies the thumbnail parameters, if any.</p>
138    pub fn thumbnails(mut self, input: crate::types::Thumbnails) -> Self {
139        self.thumbnails = ::std::option::Option::Some(input);
140        self
141    }
142    /// <p>A section of the request body that specifies the thumbnail parameters, if any.</p>
143    pub fn set_thumbnails(mut self, input: ::std::option::Option<crate::types::Thumbnails>) -> Self {
144        self.thumbnails = input;
145        self
146    }
147    /// <p>A section of the request body that specifies the thumbnail parameters, if any.</p>
148    pub fn get_thumbnails(&self) -> &::std::option::Option<crate::types::Thumbnails> {
149        &self.thumbnails
150    }
151    /// Consumes the builder and constructs a [`CreatePresetInput`](crate::operation::create_preset::CreatePresetInput).
152    pub fn build(
153        self,
154    ) -> ::std::result::Result<crate::operation::create_preset::CreatePresetInput, ::aws_smithy_types::error::operation::BuildError> {
155        ::std::result::Result::Ok(crate::operation::create_preset::CreatePresetInput {
156            name: self.name,
157            description: self.description,
158            container: self.container,
159            video: self.video,
160            audio: self.audio,
161            thumbnails: self.thumbnails,
162        })
163    }
164}