aws_sdk_elastictranscoder/operation/create_job/
_create_job_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The <code>CreateJobRequest</code> structure.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateJobInput {
7    /// <p>The <code>Id</code> of the pipeline that you want Elastic Transcoder to use for transcoding. The pipeline determines several settings, including the Amazon S3 bucket from which Elastic Transcoder gets the files to transcode and the bucket into which Elastic Transcoder puts the transcoded files.</p>
8    pub pipeline_id: ::std::option::Option<::std::string::String>,
9    /// <p>A section of the request body that provides information about the file that is being transcoded.</p>
10    pub input: ::std::option::Option<crate::types::JobInput>,
11    /// <p>A section of the request body that provides information about the files that are being transcoded.</p>
12    pub inputs: ::std::option::Option<::std::vec::Vec<crate::types::JobInput>>,
13    /// <p>A section of the request body that provides information about the transcoded (target) file. We strongly recommend that you use the <code>Outputs</code> syntax instead of the <code>Output</code> syntax.</p>
14    pub output: ::std::option::Option<crate::types::CreateJobOutput>,
15    /// <p>A section of the request body that provides information about the transcoded (target) files. We recommend that you use the <code>Outputs</code> syntax instead of the <code>Output</code> syntax.</p>
16    pub outputs: ::std::option::Option<::std::vec::Vec<crate::types::CreateJobOutput>>,
17    /// <p>The value, if any, that you want Elastic Transcoder to prepend to the names of all files that this job creates, including output files, thumbnails, and playlists.</p>
18    pub output_key_prefix: ::std::option::Option<::std::string::String>,
19    /// <p>If you specify a preset in <code>PresetId</code> for which the value of <code>Container</code> is fmp4 (Fragmented MP4) or ts (MPEG-TS), Playlists contains information about the master playlists that you want Elastic Transcoder to create.</p>
20    /// <p>The maximum number of master playlists in a job is 30.</p>
21    pub playlists: ::std::option::Option<::std::vec::Vec<crate::types::CreateJobPlaylist>>,
22    /// <p>User-defined metadata that you want to associate with an Elastic Transcoder job. You specify metadata in <code>key/value</code> pairs, and you can add up to 10 <code>key/value</code> pairs per job. Elastic Transcoder does not guarantee that <code>key/value</code> pairs are returned in the same order in which you specify them.</p>
23    pub user_metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
24}
25impl CreateJobInput {
26    /// <p>The <code>Id</code> of the pipeline that you want Elastic Transcoder to use for transcoding. The pipeline determines several settings, including the Amazon S3 bucket from which Elastic Transcoder gets the files to transcode and the bucket into which Elastic Transcoder puts the transcoded files.</p>
27    pub fn pipeline_id(&self) -> ::std::option::Option<&str> {
28        self.pipeline_id.as_deref()
29    }
30    /// <p>A section of the request body that provides information about the file that is being transcoded.</p>
31    pub fn input(&self) -> ::std::option::Option<&crate::types::JobInput> {
32        self.input.as_ref()
33    }
34    /// <p>A section of the request body that provides information about the files that are being transcoded.</p>
35    ///
36    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.inputs.is_none()`.
37    pub fn inputs(&self) -> &[crate::types::JobInput] {
38        self.inputs.as_deref().unwrap_or_default()
39    }
40    /// <p>A section of the request body that provides information about the transcoded (target) file. We strongly recommend that you use the <code>Outputs</code> syntax instead of the <code>Output</code> syntax.</p>
41    pub fn output(&self) -> ::std::option::Option<&crate::types::CreateJobOutput> {
42        self.output.as_ref()
43    }
44    /// <p>A section of the request body that provides information about the transcoded (target) files. We recommend that you use the <code>Outputs</code> syntax instead of the <code>Output</code> syntax.</p>
45    ///
46    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.outputs.is_none()`.
47    pub fn outputs(&self) -> &[crate::types::CreateJobOutput] {
48        self.outputs.as_deref().unwrap_or_default()
49    }
50    /// <p>The value, if any, that you want Elastic Transcoder to prepend to the names of all files that this job creates, including output files, thumbnails, and playlists.</p>
51    pub fn output_key_prefix(&self) -> ::std::option::Option<&str> {
52        self.output_key_prefix.as_deref()
53    }
54    /// <p>If you specify a preset in <code>PresetId</code> for which the value of <code>Container</code> is fmp4 (Fragmented MP4) or ts (MPEG-TS), Playlists contains information about the master playlists that you want Elastic Transcoder to create.</p>
55    /// <p>The maximum number of master playlists in a job is 30.</p>
56    ///
57    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.playlists.is_none()`.
58    pub fn playlists(&self) -> &[crate::types::CreateJobPlaylist] {
59        self.playlists.as_deref().unwrap_or_default()
60    }
61    /// <p>User-defined metadata that you want to associate with an Elastic Transcoder job. You specify metadata in <code>key/value</code> pairs, and you can add up to 10 <code>key/value</code> pairs per job. Elastic Transcoder does not guarantee that <code>key/value</code> pairs are returned in the same order in which you specify them.</p>
62    pub fn user_metadata(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
63        self.user_metadata.as_ref()
64    }
65}
66impl CreateJobInput {
67    /// Creates a new builder-style object to manufacture [`CreateJobInput`](crate::operation::create_job::CreateJobInput).
68    pub fn builder() -> crate::operation::create_job::builders::CreateJobInputBuilder {
69        crate::operation::create_job::builders::CreateJobInputBuilder::default()
70    }
71}
72
73/// A builder for [`CreateJobInput`](crate::operation::create_job::CreateJobInput).
74#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
75#[non_exhaustive]
76pub struct CreateJobInputBuilder {
77    pub(crate) pipeline_id: ::std::option::Option<::std::string::String>,
78    pub(crate) input: ::std::option::Option<crate::types::JobInput>,
79    pub(crate) inputs: ::std::option::Option<::std::vec::Vec<crate::types::JobInput>>,
80    pub(crate) output: ::std::option::Option<crate::types::CreateJobOutput>,
81    pub(crate) outputs: ::std::option::Option<::std::vec::Vec<crate::types::CreateJobOutput>>,
82    pub(crate) output_key_prefix: ::std::option::Option<::std::string::String>,
83    pub(crate) playlists: ::std::option::Option<::std::vec::Vec<crate::types::CreateJobPlaylist>>,
84    pub(crate) user_metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
85}
86impl CreateJobInputBuilder {
87    /// <p>The <code>Id</code> of the pipeline that you want Elastic Transcoder to use for transcoding. The pipeline determines several settings, including the Amazon S3 bucket from which Elastic Transcoder gets the files to transcode and the bucket into which Elastic Transcoder puts the transcoded files.</p>
88    /// This field is required.
89    pub fn pipeline_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
90        self.pipeline_id = ::std::option::Option::Some(input.into());
91        self
92    }
93    /// <p>The <code>Id</code> of the pipeline that you want Elastic Transcoder to use for transcoding. The pipeline determines several settings, including the Amazon S3 bucket from which Elastic Transcoder gets the files to transcode and the bucket into which Elastic Transcoder puts the transcoded files.</p>
94    pub fn set_pipeline_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
95        self.pipeline_id = input;
96        self
97    }
98    /// <p>The <code>Id</code> of the pipeline that you want Elastic Transcoder to use for transcoding. The pipeline determines several settings, including the Amazon S3 bucket from which Elastic Transcoder gets the files to transcode and the bucket into which Elastic Transcoder puts the transcoded files.</p>
99    pub fn get_pipeline_id(&self) -> &::std::option::Option<::std::string::String> {
100        &self.pipeline_id
101    }
102    /// <p>A section of the request body that provides information about the file that is being transcoded.</p>
103    pub fn input(mut self, input: crate::types::JobInput) -> Self {
104        self.input = ::std::option::Option::Some(input);
105        self
106    }
107    /// <p>A section of the request body that provides information about the file that is being transcoded.</p>
108    pub fn set_input(mut self, input: ::std::option::Option<crate::types::JobInput>) -> Self {
109        self.input = input;
110        self
111    }
112    /// <p>A section of the request body that provides information about the file that is being transcoded.</p>
113    pub fn get_input(&self) -> &::std::option::Option<crate::types::JobInput> {
114        &self.input
115    }
116    /// Appends an item to `inputs`.
117    ///
118    /// To override the contents of this collection use [`set_inputs`](Self::set_inputs).
119    ///
120    /// <p>A section of the request body that provides information about the files that are being transcoded.</p>
121    pub fn inputs(mut self, input: crate::types::JobInput) -> Self {
122        let mut v = self.inputs.unwrap_or_default();
123        v.push(input);
124        self.inputs = ::std::option::Option::Some(v);
125        self
126    }
127    /// <p>A section of the request body that provides information about the files that are being transcoded.</p>
128    pub fn set_inputs(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::JobInput>>) -> Self {
129        self.inputs = input;
130        self
131    }
132    /// <p>A section of the request body that provides information about the files that are being transcoded.</p>
133    pub fn get_inputs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::JobInput>> {
134        &self.inputs
135    }
136    /// <p>A section of the request body that provides information about the transcoded (target) file. We strongly recommend that you use the <code>Outputs</code> syntax instead of the <code>Output</code> syntax.</p>
137    pub fn output(mut self, input: crate::types::CreateJobOutput) -> Self {
138        self.output = ::std::option::Option::Some(input);
139        self
140    }
141    /// <p>A section of the request body that provides information about the transcoded (target) file. We strongly recommend that you use the <code>Outputs</code> syntax instead of the <code>Output</code> syntax.</p>
142    pub fn set_output(mut self, input: ::std::option::Option<crate::types::CreateJobOutput>) -> Self {
143        self.output = input;
144        self
145    }
146    /// <p>A section of the request body that provides information about the transcoded (target) file. We strongly recommend that you use the <code>Outputs</code> syntax instead of the <code>Output</code> syntax.</p>
147    pub fn get_output(&self) -> &::std::option::Option<crate::types::CreateJobOutput> {
148        &self.output
149    }
150    /// Appends an item to `outputs`.
151    ///
152    /// To override the contents of this collection use [`set_outputs`](Self::set_outputs).
153    ///
154    /// <p>A section of the request body that provides information about the transcoded (target) files. We recommend that you use the <code>Outputs</code> syntax instead of the <code>Output</code> syntax.</p>
155    pub fn outputs(mut self, input: crate::types::CreateJobOutput) -> Self {
156        let mut v = self.outputs.unwrap_or_default();
157        v.push(input);
158        self.outputs = ::std::option::Option::Some(v);
159        self
160    }
161    /// <p>A section of the request body that provides information about the transcoded (target) files. We recommend that you use the <code>Outputs</code> syntax instead of the <code>Output</code> syntax.</p>
162    pub fn set_outputs(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CreateJobOutput>>) -> Self {
163        self.outputs = input;
164        self
165    }
166    /// <p>A section of the request body that provides information about the transcoded (target) files. We recommend that you use the <code>Outputs</code> syntax instead of the <code>Output</code> syntax.</p>
167    pub fn get_outputs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CreateJobOutput>> {
168        &self.outputs
169    }
170    /// <p>The value, if any, that you want Elastic Transcoder to prepend to the names of all files that this job creates, including output files, thumbnails, and playlists.</p>
171    pub fn output_key_prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172        self.output_key_prefix = ::std::option::Option::Some(input.into());
173        self
174    }
175    /// <p>The value, if any, that you want Elastic Transcoder to prepend to the names of all files that this job creates, including output files, thumbnails, and playlists.</p>
176    pub fn set_output_key_prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
177        self.output_key_prefix = input;
178        self
179    }
180    /// <p>The value, if any, that you want Elastic Transcoder to prepend to the names of all files that this job creates, including output files, thumbnails, and playlists.</p>
181    pub fn get_output_key_prefix(&self) -> &::std::option::Option<::std::string::String> {
182        &self.output_key_prefix
183    }
184    /// Appends an item to `playlists`.
185    ///
186    /// To override the contents of this collection use [`set_playlists`](Self::set_playlists).
187    ///
188    /// <p>If you specify a preset in <code>PresetId</code> for which the value of <code>Container</code> is fmp4 (Fragmented MP4) or ts (MPEG-TS), Playlists contains information about the master playlists that you want Elastic Transcoder to create.</p>
189    /// <p>The maximum number of master playlists in a job is 30.</p>
190    pub fn playlists(mut self, input: crate::types::CreateJobPlaylist) -> Self {
191        let mut v = self.playlists.unwrap_or_default();
192        v.push(input);
193        self.playlists = ::std::option::Option::Some(v);
194        self
195    }
196    /// <p>If you specify a preset in <code>PresetId</code> for which the value of <code>Container</code> is fmp4 (Fragmented MP4) or ts (MPEG-TS), Playlists contains information about the master playlists that you want Elastic Transcoder to create.</p>
197    /// <p>The maximum number of master playlists in a job is 30.</p>
198    pub fn set_playlists(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CreateJobPlaylist>>) -> Self {
199        self.playlists = input;
200        self
201    }
202    /// <p>If you specify a preset in <code>PresetId</code> for which the value of <code>Container</code> is fmp4 (Fragmented MP4) or ts (MPEG-TS), Playlists contains information about the master playlists that you want Elastic Transcoder to create.</p>
203    /// <p>The maximum number of master playlists in a job is 30.</p>
204    pub fn get_playlists(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CreateJobPlaylist>> {
205        &self.playlists
206    }
207    /// Adds a key-value pair to `user_metadata`.
208    ///
209    /// To override the contents of this collection use [`set_user_metadata`](Self::set_user_metadata).
210    ///
211    /// <p>User-defined metadata that you want to associate with an Elastic Transcoder job. You specify metadata in <code>key/value</code> pairs, and you can add up to 10 <code>key/value</code> pairs per job. Elastic Transcoder does not guarantee that <code>key/value</code> pairs are returned in the same order in which you specify them.</p>
212    pub fn user_metadata(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
213        let mut hash_map = self.user_metadata.unwrap_or_default();
214        hash_map.insert(k.into(), v.into());
215        self.user_metadata = ::std::option::Option::Some(hash_map);
216        self
217    }
218    /// <p>User-defined metadata that you want to associate with an Elastic Transcoder job. You specify metadata in <code>key/value</code> pairs, and you can add up to 10 <code>key/value</code> pairs per job. Elastic Transcoder does not guarantee that <code>key/value</code> pairs are returned in the same order in which you specify them.</p>
219    pub fn set_user_metadata(
220        mut self,
221        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
222    ) -> Self {
223        self.user_metadata = input;
224        self
225    }
226    /// <p>User-defined metadata that you want to associate with an Elastic Transcoder job. You specify metadata in <code>key/value</code> pairs, and you can add up to 10 <code>key/value</code> pairs per job. Elastic Transcoder does not guarantee that <code>key/value</code> pairs are returned in the same order in which you specify them.</p>
227    pub fn get_user_metadata(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
228        &self.user_metadata
229    }
230    /// Consumes the builder and constructs a [`CreateJobInput`](crate::operation::create_job::CreateJobInput).
231    pub fn build(self) -> ::std::result::Result<crate::operation::create_job::CreateJobInput, ::aws_smithy_types::error::operation::BuildError> {
232        ::std::result::Result::Ok(crate::operation::create_job::CreateJobInput {
233            pipeline_id: self.pipeline_id,
234            input: self.input,
235            inputs: self.inputs,
236            output: self.output,
237            outputs: self.outputs,
238            output_key_prefix: self.output_key_prefix,
239            playlists: self.playlists,
240            user_metadata: self.user_metadata,
241        })
242    }
243}