aws_sdk_elastictranscoder/operation/create_job/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_job::_create_job_output::CreateJobOutputBuilder;
3
4pub use crate::operation::create_job::_create_job_input::CreateJobInputBuilder;
5
6impl crate::operation::create_job::builders::CreateJobInputBuilder {
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_job::CreateJobOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_job::CreateJobError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_job();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateJob`.
24///
25/// <p>When you create a job, Elastic Transcoder returns JSON data that includes the values that you specified plus information about the job that is created.</p>
26/// <p>If you have specified more than one output for your jobs (for example, one output for the Kindle Fire and another output for the Apple iPhone 4s), you currently must use the Elastic Transcoder API to list the jobs (as opposed to the AWS Console).</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct CreateJobFluentBuilder {
29 handle: ::std::sync::Arc<crate::client::Handle>,
30 inner: crate::operation::create_job::builders::CreateJobInputBuilder,
31 config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl crate::client::customize::internal::CustomizableSend<crate::operation::create_job::CreateJobOutput, crate::operation::create_job::CreateJobError>
34 for CreateJobFluentBuilder
35{
36 fn send(
37 self,
38 config_override: crate::config::Builder,
39 ) -> crate::client::customize::internal::BoxFuture<
40 crate::client::customize::internal::SendResult<crate::operation::create_job::CreateJobOutput, crate::operation::create_job::CreateJobError>,
41 > {
42 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
43 }
44}
45impl CreateJobFluentBuilder {
46 /// Creates a new `CreateJobFluentBuilder`.
47 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
48 Self {
49 handle,
50 inner: ::std::default::Default::default(),
51 config_override: ::std::option::Option::None,
52 }
53 }
54 /// Access the CreateJob as a reference.
55 pub fn as_input(&self) -> &crate::operation::create_job::builders::CreateJobInputBuilder {
56 &self.inner
57 }
58 /// Sends the request and returns the response.
59 ///
60 /// If an error occurs, an `SdkError` will be returned with additional details that
61 /// can be matched against.
62 ///
63 /// By default, any retryable failures will be retried twice. Retry behavior
64 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
65 /// set when configuring the client.
66 pub async fn send(
67 self,
68 ) -> ::std::result::Result<
69 crate::operation::create_job::CreateJobOutput,
70 ::aws_smithy_runtime_api::client::result::SdkError<
71 crate::operation::create_job::CreateJobError,
72 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
73 >,
74 > {
75 let input = self
76 .inner
77 .build()
78 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
79 let runtime_plugins = crate::operation::create_job::CreateJob::operation_runtime_plugins(
80 self.handle.runtime_plugins.clone(),
81 &self.handle.conf,
82 self.config_override,
83 );
84 crate::operation::create_job::CreateJob::orchestrate(&runtime_plugins, input).await
85 }
86
87 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
88 pub fn customize(
89 self,
90 ) -> crate::client::customize::CustomizableOperation<
91 crate::operation::create_job::CreateJobOutput,
92 crate::operation::create_job::CreateJobError,
93 Self,
94 > {
95 crate::client::customize::CustomizableOperation::new(self)
96 }
97 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
98 self.set_config_override(::std::option::Option::Some(config_override.into()));
99 self
100 }
101
102 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
103 self.config_override = config_override;
104 self
105 }
106 /// <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>
107 pub fn pipeline_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
108 self.inner = self.inner.pipeline_id(input.into());
109 self
110 }
111 /// <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>
112 pub fn set_pipeline_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
113 self.inner = self.inner.set_pipeline_id(input);
114 self
115 }
116 /// <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>
117 pub fn get_pipeline_id(&self) -> &::std::option::Option<::std::string::String> {
118 self.inner.get_pipeline_id()
119 }
120 /// <p>A section of the request body that provides information about the file that is being transcoded.</p>
121 pub fn input(mut self, input: crate::types::JobInput) -> Self {
122 self.inner = self.inner.input(input);
123 self
124 }
125 /// <p>A section of the request body that provides information about the file that is being transcoded.</p>
126 pub fn set_input(mut self, input: ::std::option::Option<crate::types::JobInput>) -> Self {
127 self.inner = self.inner.set_input(input);
128 self
129 }
130 /// <p>A section of the request body that provides information about the file that is being transcoded.</p>
131 pub fn get_input(&self) -> &::std::option::Option<crate::types::JobInput> {
132 self.inner.get_input()
133 }
134 ///
135 /// Appends an item to `Inputs`.
136 ///
137 /// To override the contents of this collection use [`set_inputs`](Self::set_inputs).
138 ///
139 /// <p>A section of the request body that provides information about the files that are being transcoded.</p>
140 pub fn inputs(mut self, input: crate::types::JobInput) -> Self {
141 self.inner = self.inner.inputs(input);
142 self
143 }
144 /// <p>A section of the request body that provides information about the files that are being transcoded.</p>
145 pub fn set_inputs(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::JobInput>>) -> Self {
146 self.inner = self.inner.set_inputs(input);
147 self
148 }
149 /// <p>A section of the request body that provides information about the files that are being transcoded.</p>
150 pub fn get_inputs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::JobInput>> {
151 self.inner.get_inputs()
152 }
153 /// <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>
154 pub fn output(mut self, input: crate::types::CreateJobOutput) -> Self {
155 self.inner = self.inner.output(input);
156 self
157 }
158 /// <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>
159 pub fn set_output(mut self, input: ::std::option::Option<crate::types::CreateJobOutput>) -> Self {
160 self.inner = self.inner.set_output(input);
161 self
162 }
163 /// <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>
164 pub fn get_output(&self) -> &::std::option::Option<crate::types::CreateJobOutput> {
165 self.inner.get_output()
166 }
167 ///
168 /// Appends an item to `Outputs`.
169 ///
170 /// To override the contents of this collection use [`set_outputs`](Self::set_outputs).
171 ///
172 /// <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>
173 pub fn outputs(mut self, input: crate::types::CreateJobOutput) -> Self {
174 self.inner = self.inner.outputs(input);
175 self
176 }
177 /// <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>
178 pub fn set_outputs(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CreateJobOutput>>) -> Self {
179 self.inner = self.inner.set_outputs(input);
180 self
181 }
182 /// <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>
183 pub fn get_outputs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CreateJobOutput>> {
184 self.inner.get_outputs()
185 }
186 /// <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>
187 pub fn output_key_prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
188 self.inner = self.inner.output_key_prefix(input.into());
189 self
190 }
191 /// <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>
192 pub fn set_output_key_prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
193 self.inner = self.inner.set_output_key_prefix(input);
194 self
195 }
196 /// <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>
197 pub fn get_output_key_prefix(&self) -> &::std::option::Option<::std::string::String> {
198 self.inner.get_output_key_prefix()
199 }
200 ///
201 /// Appends an item to `Playlists`.
202 ///
203 /// To override the contents of this collection use [`set_playlists`](Self::set_playlists).
204 ///
205 /// <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>
206 /// <p>The maximum number of master playlists in a job is 30.</p>
207 pub fn playlists(mut self, input: crate::types::CreateJobPlaylist) -> Self {
208 self.inner = self.inner.playlists(input);
209 self
210 }
211 /// <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>
212 /// <p>The maximum number of master playlists in a job is 30.</p>
213 pub fn set_playlists(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CreateJobPlaylist>>) -> Self {
214 self.inner = self.inner.set_playlists(input);
215 self
216 }
217 /// <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>
218 /// <p>The maximum number of master playlists in a job is 30.</p>
219 pub fn get_playlists(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CreateJobPlaylist>> {
220 self.inner.get_playlists()
221 }
222 ///
223 /// Adds a key-value pair to `UserMetadata`.
224 ///
225 /// To override the contents of this collection use [`set_user_metadata`](Self::set_user_metadata).
226 ///
227 /// <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>
228 pub fn user_metadata(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
229 self.inner = self.inner.user_metadata(k.into(), v.into());
230 self
231 }
232 /// <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>
233 pub fn set_user_metadata(
234 mut self,
235 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
236 ) -> Self {
237 self.inner = self.inner.set_user_metadata(input);
238 self
239 }
240 /// <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>
241 pub fn get_user_metadata(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
242 self.inner.get_user_metadata()
243 }
244}