Skip to main content

google_cloud_video_transcoder_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_rpc;
25extern crate serde;
26extern crate serde_json;
27extern crate serde_with;
28extern crate std;
29extern crate tracing;
30extern crate wkt;
31
32mod debug;
33mod deserialize;
34mod serialize;
35
36/// Transcoding job resource.
37#[derive(Clone, Default, PartialEq)]
38#[non_exhaustive]
39pub struct Job {
40    /// The resource name of the job.
41    /// Format: `projects/{project_number}/locations/{location}/jobs/{job}`
42    pub name: std::string::String,
43
44    /// Input only. Specify the `input_uri` to populate empty `uri` fields in each
45    /// element of `Job.config.inputs` or `JobTemplate.config.inputs` when using
46    /// template. URI of the media. Input files must be at least 5 seconds in
47    /// duration and stored in Cloud Storage (for example,
48    /// `gs://bucket/inputs/file.mp4`). See [Supported input and output
49    /// formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats).
50    pub input_uri: std::string::String,
51
52    /// Input only. Specify the `output_uri` to populate an empty
53    /// `Job.config.output.uri` or `JobTemplate.config.output.uri` when using
54    /// template. URI for the output file(s). For example,
55    /// `gs://my-bucket/outputs/`. See [Supported input and output
56    /// formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats).
57    pub output_uri: std::string::String,
58
59    /// Output only. The current state of the job.
60    pub state: crate::model::job::ProcessingState,
61
62    /// Output only. The time the job was created.
63    pub create_time: std::option::Option<wkt::Timestamp>,
64
65    /// Output only. The time the transcoding started.
66    pub start_time: std::option::Option<wkt::Timestamp>,
67
68    /// Output only. The time the transcoding finished.
69    pub end_time: std::option::Option<wkt::Timestamp>,
70
71    /// Job time to live value in days, which will be effective after job
72    /// completion. Job should be deleted automatically after the given TTL. Enter
73    /// a value between 1 and 90. The default is 30.
74    pub ttl_after_completion_days: i32,
75
76    /// The labels associated with this job. You can use these to organize and
77    /// group your jobs.
78    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
79
80    /// Output only. An error object that describes the reason for the failure.
81    /// This property is always present when
82    /// [ProcessingState][google.cloud.video.transcoder.v1.Job.ProcessingState] is
83    /// `FAILED`.
84    ///
85    /// [google.cloud.video.transcoder.v1.Job.ProcessingState]: crate::model::job::ProcessingState
86    pub error: std::option::Option<google_cloud_rpc::model::Status>,
87
88    /// The processing mode of the job.
89    /// The default is `PROCESSING_MODE_INTERACTIVE`.
90    pub mode: crate::model::job::ProcessingMode,
91
92    /// The processing priority of a batch job.
93    /// This field can only be set for batch mode jobs. The default value is 0.
94    /// This value cannot be negative. Higher values correspond to higher
95    /// priorities for the job.
96    pub batch_mode_priority: i32,
97
98    /// Optional. The optimization strategy of the job. The default is
99    /// `AUTODETECT`.
100    pub optimization: crate::model::job::OptimizationStrategy,
101
102    /// Optional. Insert silence and duplicate frames when timestamp gaps are
103    /// detected in a given stream.
104    pub fill_content_gaps: bool,
105
106    /// Specify the config for the transcoding job. If you don't specify the
107    /// `job_config`, the API selects `templateId`; this template ID is set to
108    /// `preset/web-hd` by default. When you use a `template_id` to create a job,
109    /// the `Job.config` is populated by the `JobTemplate.config`.\<br\>
110    pub job_config: std::option::Option<crate::model::job::JobConfig>,
111
112    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
113}
114
115impl Job {
116    pub fn new() -> Self {
117        std::default::Default::default()
118    }
119
120    /// Sets the value of [name][crate::model::Job::name].
121    ///
122    /// # Example
123    /// ```ignore,no_run
124    /// # use google_cloud_video_transcoder_v1::model::Job;
125    /// let x = Job::new().set_name("example");
126    /// ```
127    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
128        self.name = v.into();
129        self
130    }
131
132    /// Sets the value of [input_uri][crate::model::Job::input_uri].
133    ///
134    /// # Example
135    /// ```ignore,no_run
136    /// # use google_cloud_video_transcoder_v1::model::Job;
137    /// let x = Job::new().set_input_uri("example");
138    /// ```
139    pub fn set_input_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
140        self.input_uri = v.into();
141        self
142    }
143
144    /// Sets the value of [output_uri][crate::model::Job::output_uri].
145    ///
146    /// # Example
147    /// ```ignore,no_run
148    /// # use google_cloud_video_transcoder_v1::model::Job;
149    /// let x = Job::new().set_output_uri("example");
150    /// ```
151    pub fn set_output_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
152        self.output_uri = v.into();
153        self
154    }
155
156    /// Sets the value of [state][crate::model::Job::state].
157    ///
158    /// # Example
159    /// ```ignore,no_run
160    /// # use google_cloud_video_transcoder_v1::model::Job;
161    /// use google_cloud_video_transcoder_v1::model::job::ProcessingState;
162    /// let x0 = Job::new().set_state(ProcessingState::Pending);
163    /// let x1 = Job::new().set_state(ProcessingState::Running);
164    /// let x2 = Job::new().set_state(ProcessingState::Succeeded);
165    /// ```
166    pub fn set_state<T: std::convert::Into<crate::model::job::ProcessingState>>(
167        mut self,
168        v: T,
169    ) -> Self {
170        self.state = v.into();
171        self
172    }
173
174    /// Sets the value of [create_time][crate::model::Job::create_time].
175    ///
176    /// # Example
177    /// ```ignore,no_run
178    /// # use google_cloud_video_transcoder_v1::model::Job;
179    /// use wkt::Timestamp;
180    /// let x = Job::new().set_create_time(Timestamp::default()/* use setters */);
181    /// ```
182    pub fn set_create_time<T>(mut self, v: T) -> Self
183    where
184        T: std::convert::Into<wkt::Timestamp>,
185    {
186        self.create_time = std::option::Option::Some(v.into());
187        self
188    }
189
190    /// Sets or clears the value of [create_time][crate::model::Job::create_time].
191    ///
192    /// # Example
193    /// ```ignore,no_run
194    /// # use google_cloud_video_transcoder_v1::model::Job;
195    /// use wkt::Timestamp;
196    /// let x = Job::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
197    /// let x = Job::new().set_or_clear_create_time(None::<Timestamp>);
198    /// ```
199    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
200    where
201        T: std::convert::Into<wkt::Timestamp>,
202    {
203        self.create_time = v.map(|x| x.into());
204        self
205    }
206
207    /// Sets the value of [start_time][crate::model::Job::start_time].
208    ///
209    /// # Example
210    /// ```ignore,no_run
211    /// # use google_cloud_video_transcoder_v1::model::Job;
212    /// use wkt::Timestamp;
213    /// let x = Job::new().set_start_time(Timestamp::default()/* use setters */);
214    /// ```
215    pub fn set_start_time<T>(mut self, v: T) -> Self
216    where
217        T: std::convert::Into<wkt::Timestamp>,
218    {
219        self.start_time = std::option::Option::Some(v.into());
220        self
221    }
222
223    /// Sets or clears the value of [start_time][crate::model::Job::start_time].
224    ///
225    /// # Example
226    /// ```ignore,no_run
227    /// # use google_cloud_video_transcoder_v1::model::Job;
228    /// use wkt::Timestamp;
229    /// let x = Job::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
230    /// let x = Job::new().set_or_clear_start_time(None::<Timestamp>);
231    /// ```
232    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
233    where
234        T: std::convert::Into<wkt::Timestamp>,
235    {
236        self.start_time = v.map(|x| x.into());
237        self
238    }
239
240    /// Sets the value of [end_time][crate::model::Job::end_time].
241    ///
242    /// # Example
243    /// ```ignore,no_run
244    /// # use google_cloud_video_transcoder_v1::model::Job;
245    /// use wkt::Timestamp;
246    /// let x = Job::new().set_end_time(Timestamp::default()/* use setters */);
247    /// ```
248    pub fn set_end_time<T>(mut self, v: T) -> Self
249    where
250        T: std::convert::Into<wkt::Timestamp>,
251    {
252        self.end_time = std::option::Option::Some(v.into());
253        self
254    }
255
256    /// Sets or clears the value of [end_time][crate::model::Job::end_time].
257    ///
258    /// # Example
259    /// ```ignore,no_run
260    /// # use google_cloud_video_transcoder_v1::model::Job;
261    /// use wkt::Timestamp;
262    /// let x = Job::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
263    /// let x = Job::new().set_or_clear_end_time(None::<Timestamp>);
264    /// ```
265    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
266    where
267        T: std::convert::Into<wkt::Timestamp>,
268    {
269        self.end_time = v.map(|x| x.into());
270        self
271    }
272
273    /// Sets the value of [ttl_after_completion_days][crate::model::Job::ttl_after_completion_days].
274    ///
275    /// # Example
276    /// ```ignore,no_run
277    /// # use google_cloud_video_transcoder_v1::model::Job;
278    /// let x = Job::new().set_ttl_after_completion_days(42);
279    /// ```
280    pub fn set_ttl_after_completion_days<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
281        self.ttl_after_completion_days = v.into();
282        self
283    }
284
285    /// Sets the value of [labels][crate::model::Job::labels].
286    ///
287    /// # Example
288    /// ```ignore,no_run
289    /// # use google_cloud_video_transcoder_v1::model::Job;
290    /// let x = Job::new().set_labels([
291    ///     ("key0", "abc"),
292    ///     ("key1", "xyz"),
293    /// ]);
294    /// ```
295    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
296    where
297        T: std::iter::IntoIterator<Item = (K, V)>,
298        K: std::convert::Into<std::string::String>,
299        V: std::convert::Into<std::string::String>,
300    {
301        use std::iter::Iterator;
302        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
303        self
304    }
305
306    /// Sets the value of [error][crate::model::Job::error].
307    ///
308    /// # Example
309    /// ```ignore,no_run
310    /// # use google_cloud_video_transcoder_v1::model::Job;
311    /// use google_cloud_rpc::model::Status;
312    /// let x = Job::new().set_error(Status::default()/* use setters */);
313    /// ```
314    pub fn set_error<T>(mut self, v: T) -> Self
315    where
316        T: std::convert::Into<google_cloud_rpc::model::Status>,
317    {
318        self.error = std::option::Option::Some(v.into());
319        self
320    }
321
322    /// Sets or clears the value of [error][crate::model::Job::error].
323    ///
324    /// # Example
325    /// ```ignore,no_run
326    /// # use google_cloud_video_transcoder_v1::model::Job;
327    /// use google_cloud_rpc::model::Status;
328    /// let x = Job::new().set_or_clear_error(Some(Status::default()/* use setters */));
329    /// let x = Job::new().set_or_clear_error(None::<Status>);
330    /// ```
331    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
332    where
333        T: std::convert::Into<google_cloud_rpc::model::Status>,
334    {
335        self.error = v.map(|x| x.into());
336        self
337    }
338
339    /// Sets the value of [mode][crate::model::Job::mode].
340    ///
341    /// # Example
342    /// ```ignore,no_run
343    /// # use google_cloud_video_transcoder_v1::model::Job;
344    /// use google_cloud_video_transcoder_v1::model::job::ProcessingMode;
345    /// let x0 = Job::new().set_mode(ProcessingMode::Interactive);
346    /// let x1 = Job::new().set_mode(ProcessingMode::Batch);
347    /// ```
348    pub fn set_mode<T: std::convert::Into<crate::model::job::ProcessingMode>>(
349        mut self,
350        v: T,
351    ) -> Self {
352        self.mode = v.into();
353        self
354    }
355
356    /// Sets the value of [batch_mode_priority][crate::model::Job::batch_mode_priority].
357    ///
358    /// # Example
359    /// ```ignore,no_run
360    /// # use google_cloud_video_transcoder_v1::model::Job;
361    /// let x = Job::new().set_batch_mode_priority(42);
362    /// ```
363    pub fn set_batch_mode_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
364        self.batch_mode_priority = v.into();
365        self
366    }
367
368    /// Sets the value of [optimization][crate::model::Job::optimization].
369    ///
370    /// # Example
371    /// ```ignore,no_run
372    /// # use google_cloud_video_transcoder_v1::model::Job;
373    /// use google_cloud_video_transcoder_v1::model::job::OptimizationStrategy;
374    /// let x0 = Job::new().set_optimization(OptimizationStrategy::Autodetect);
375    /// let x1 = Job::new().set_optimization(OptimizationStrategy::Disabled);
376    /// ```
377    pub fn set_optimization<T: std::convert::Into<crate::model::job::OptimizationStrategy>>(
378        mut self,
379        v: T,
380    ) -> Self {
381        self.optimization = v.into();
382        self
383    }
384
385    /// Sets the value of [fill_content_gaps][crate::model::Job::fill_content_gaps].
386    ///
387    /// # Example
388    /// ```ignore,no_run
389    /// # use google_cloud_video_transcoder_v1::model::Job;
390    /// let x = Job::new().set_fill_content_gaps(true);
391    /// ```
392    pub fn set_fill_content_gaps<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
393        self.fill_content_gaps = v.into();
394        self
395    }
396
397    /// Sets the value of [job_config][crate::model::Job::job_config].
398    ///
399    /// Note that all the setters affecting `job_config` are mutually
400    /// exclusive.
401    ///
402    /// # Example
403    /// ```ignore,no_run
404    /// # use google_cloud_video_transcoder_v1::model::Job;
405    /// use google_cloud_video_transcoder_v1::model::job::JobConfig;
406    /// let x = Job::new().set_job_config(Some(JobConfig::TemplateId("example".to_string())));
407    /// ```
408    pub fn set_job_config<
409        T: std::convert::Into<std::option::Option<crate::model::job::JobConfig>>,
410    >(
411        mut self,
412        v: T,
413    ) -> Self {
414        self.job_config = v.into();
415        self
416    }
417
418    /// The value of [job_config][crate::model::Job::job_config]
419    /// if it holds a `TemplateId`, `None` if the field is not set or
420    /// holds a different branch.
421    pub fn template_id(&self) -> std::option::Option<&std::string::String> {
422        #[allow(unreachable_patterns)]
423        self.job_config.as_ref().and_then(|v| match v {
424            crate::model::job::JobConfig::TemplateId(v) => std::option::Option::Some(v),
425            _ => std::option::Option::None,
426        })
427    }
428
429    /// Sets the value of [job_config][crate::model::Job::job_config]
430    /// to hold a `TemplateId`.
431    ///
432    /// Note that all the setters affecting `job_config` are
433    /// mutually exclusive.
434    ///
435    /// # Example
436    /// ```ignore,no_run
437    /// # use google_cloud_video_transcoder_v1::model::Job;
438    /// let x = Job::new().set_template_id("example");
439    /// assert!(x.template_id().is_some());
440    /// assert!(x.config().is_none());
441    /// ```
442    pub fn set_template_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
443        self.job_config =
444            std::option::Option::Some(crate::model::job::JobConfig::TemplateId(v.into()));
445        self
446    }
447
448    /// The value of [job_config][crate::model::Job::job_config]
449    /// if it holds a `Config`, `None` if the field is not set or
450    /// holds a different branch.
451    pub fn config(&self) -> std::option::Option<&std::boxed::Box<crate::model::JobConfig>> {
452        #[allow(unreachable_patterns)]
453        self.job_config.as_ref().and_then(|v| match v {
454            crate::model::job::JobConfig::Config(v) => std::option::Option::Some(v),
455            _ => std::option::Option::None,
456        })
457    }
458
459    /// Sets the value of [job_config][crate::model::Job::job_config]
460    /// to hold a `Config`.
461    ///
462    /// Note that all the setters affecting `job_config` are
463    /// mutually exclusive.
464    ///
465    /// # Example
466    /// ```ignore,no_run
467    /// # use google_cloud_video_transcoder_v1::model::Job;
468    /// use google_cloud_video_transcoder_v1::model::JobConfig;
469    /// let x = Job::new().set_config(JobConfig::default()/* use setters */);
470    /// assert!(x.config().is_some());
471    /// assert!(x.template_id().is_none());
472    /// ```
473    pub fn set_config<T: std::convert::Into<std::boxed::Box<crate::model::JobConfig>>>(
474        mut self,
475        v: T,
476    ) -> Self {
477        self.job_config = std::option::Option::Some(crate::model::job::JobConfig::Config(v.into()));
478        self
479    }
480}
481
482impl wkt::message::Message for Job {
483    fn typename() -> &'static str {
484        "type.googleapis.com/google.cloud.video.transcoder.v1.Job"
485    }
486}
487
488/// Defines additional types related to [Job].
489pub mod job {
490    #[allow(unused_imports)]
491    use super::*;
492
493    /// The current state of the job.
494    ///
495    /// # Working with unknown values
496    ///
497    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
498    /// additional enum variants at any time. Adding new variants is not considered
499    /// a breaking change. Applications should write their code in anticipation of:
500    ///
501    /// - New values appearing in future releases of the client library, **and**
502    /// - New values received dynamically, without application changes.
503    ///
504    /// Please consult the [Working with enums] section in the user guide for some
505    /// guidelines.
506    ///
507    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
508    #[derive(Clone, Debug, PartialEq)]
509    #[non_exhaustive]
510    pub enum ProcessingState {
511        /// The processing state is not specified.
512        Unspecified,
513        /// The job is enqueued and will be picked up for processing soon.
514        Pending,
515        /// The job is being processed.
516        Running,
517        /// The job has been completed successfully.
518        Succeeded,
519        /// The job has failed. For additional information, see
520        /// [Troubleshooting](https://cloud.google.com/transcoder/docs/troubleshooting).
521        Failed,
522        /// If set, the enum was initialized with an unknown value.
523        ///
524        /// Applications can examine the value using [ProcessingState::value] or
525        /// [ProcessingState::name].
526        UnknownValue(processing_state::UnknownValue),
527    }
528
529    #[doc(hidden)]
530    pub mod processing_state {
531        #[allow(unused_imports)]
532        use super::*;
533        #[derive(Clone, Debug, PartialEq)]
534        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
535    }
536
537    impl ProcessingState {
538        /// Gets the enum value.
539        ///
540        /// Returns `None` if the enum contains an unknown value deserialized from
541        /// the string representation of enums.
542        pub fn value(&self) -> std::option::Option<i32> {
543            match self {
544                Self::Unspecified => std::option::Option::Some(0),
545                Self::Pending => std::option::Option::Some(1),
546                Self::Running => std::option::Option::Some(2),
547                Self::Succeeded => std::option::Option::Some(3),
548                Self::Failed => std::option::Option::Some(4),
549                Self::UnknownValue(u) => u.0.value(),
550            }
551        }
552
553        /// Gets the enum value as a string.
554        ///
555        /// Returns `None` if the enum contains an unknown value deserialized from
556        /// the integer representation of enums.
557        pub fn name(&self) -> std::option::Option<&str> {
558            match self {
559                Self::Unspecified => std::option::Option::Some("PROCESSING_STATE_UNSPECIFIED"),
560                Self::Pending => std::option::Option::Some("PENDING"),
561                Self::Running => std::option::Option::Some("RUNNING"),
562                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
563                Self::Failed => std::option::Option::Some("FAILED"),
564                Self::UnknownValue(u) => u.0.name(),
565            }
566        }
567    }
568
569    impl std::default::Default for ProcessingState {
570        fn default() -> Self {
571            use std::convert::From;
572            Self::from(0)
573        }
574    }
575
576    impl std::fmt::Display for ProcessingState {
577        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
578            wkt::internal::display_enum(f, self.name(), self.value())
579        }
580    }
581
582    impl std::convert::From<i32> for ProcessingState {
583        fn from(value: i32) -> Self {
584            match value {
585                0 => Self::Unspecified,
586                1 => Self::Pending,
587                2 => Self::Running,
588                3 => Self::Succeeded,
589                4 => Self::Failed,
590                _ => Self::UnknownValue(processing_state::UnknownValue(
591                    wkt::internal::UnknownEnumValue::Integer(value),
592                )),
593            }
594        }
595    }
596
597    impl std::convert::From<&str> for ProcessingState {
598        fn from(value: &str) -> Self {
599            use std::string::ToString;
600            match value {
601                "PROCESSING_STATE_UNSPECIFIED" => Self::Unspecified,
602                "PENDING" => Self::Pending,
603                "RUNNING" => Self::Running,
604                "SUCCEEDED" => Self::Succeeded,
605                "FAILED" => Self::Failed,
606                _ => Self::UnknownValue(processing_state::UnknownValue(
607                    wkt::internal::UnknownEnumValue::String(value.to_string()),
608                )),
609            }
610        }
611    }
612
613    impl serde::ser::Serialize for ProcessingState {
614        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
615        where
616            S: serde::Serializer,
617        {
618            match self {
619                Self::Unspecified => serializer.serialize_i32(0),
620                Self::Pending => serializer.serialize_i32(1),
621                Self::Running => serializer.serialize_i32(2),
622                Self::Succeeded => serializer.serialize_i32(3),
623                Self::Failed => serializer.serialize_i32(4),
624                Self::UnknownValue(u) => u.0.serialize(serializer),
625            }
626        }
627    }
628
629    impl<'de> serde::de::Deserialize<'de> for ProcessingState {
630        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
631        where
632            D: serde::Deserializer<'de>,
633        {
634            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProcessingState>::new(
635                ".google.cloud.video.transcoder.v1.Job.ProcessingState",
636            ))
637        }
638    }
639
640    /// The processing mode of the job.
641    ///
642    /// # Working with unknown values
643    ///
644    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
645    /// additional enum variants at any time. Adding new variants is not considered
646    /// a breaking change. Applications should write their code in anticipation of:
647    ///
648    /// - New values appearing in future releases of the client library, **and**
649    /// - New values received dynamically, without application changes.
650    ///
651    /// Please consult the [Working with enums] section in the user guide for some
652    /// guidelines.
653    ///
654    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
655    #[derive(Clone, Debug, PartialEq)]
656    #[non_exhaustive]
657    pub enum ProcessingMode {
658        /// The job processing mode is not specified.
659        Unspecified,
660        /// The job processing mode is interactive mode.
661        /// Interactive job will either be ran or rejected if quota does not allow
662        /// for it.
663        Interactive,
664        /// The job processing mode is batch mode.
665        /// Batch mode allows queuing of jobs.
666        Batch,
667        /// If set, the enum was initialized with an unknown value.
668        ///
669        /// Applications can examine the value using [ProcessingMode::value] or
670        /// [ProcessingMode::name].
671        UnknownValue(processing_mode::UnknownValue),
672    }
673
674    #[doc(hidden)]
675    pub mod processing_mode {
676        #[allow(unused_imports)]
677        use super::*;
678        #[derive(Clone, Debug, PartialEq)]
679        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
680    }
681
682    impl ProcessingMode {
683        /// Gets the enum value.
684        ///
685        /// Returns `None` if the enum contains an unknown value deserialized from
686        /// the string representation of enums.
687        pub fn value(&self) -> std::option::Option<i32> {
688            match self {
689                Self::Unspecified => std::option::Option::Some(0),
690                Self::Interactive => std::option::Option::Some(1),
691                Self::Batch => std::option::Option::Some(2),
692                Self::UnknownValue(u) => u.0.value(),
693            }
694        }
695
696        /// Gets the enum value as a string.
697        ///
698        /// Returns `None` if the enum contains an unknown value deserialized from
699        /// the integer representation of enums.
700        pub fn name(&self) -> std::option::Option<&str> {
701            match self {
702                Self::Unspecified => std::option::Option::Some("PROCESSING_MODE_UNSPECIFIED"),
703                Self::Interactive => std::option::Option::Some("PROCESSING_MODE_INTERACTIVE"),
704                Self::Batch => std::option::Option::Some("PROCESSING_MODE_BATCH"),
705                Self::UnknownValue(u) => u.0.name(),
706            }
707        }
708    }
709
710    impl std::default::Default for ProcessingMode {
711        fn default() -> Self {
712            use std::convert::From;
713            Self::from(0)
714        }
715    }
716
717    impl std::fmt::Display for ProcessingMode {
718        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
719            wkt::internal::display_enum(f, self.name(), self.value())
720        }
721    }
722
723    impl std::convert::From<i32> for ProcessingMode {
724        fn from(value: i32) -> Self {
725            match value {
726                0 => Self::Unspecified,
727                1 => Self::Interactive,
728                2 => Self::Batch,
729                _ => Self::UnknownValue(processing_mode::UnknownValue(
730                    wkt::internal::UnknownEnumValue::Integer(value),
731                )),
732            }
733        }
734    }
735
736    impl std::convert::From<&str> for ProcessingMode {
737        fn from(value: &str) -> Self {
738            use std::string::ToString;
739            match value {
740                "PROCESSING_MODE_UNSPECIFIED" => Self::Unspecified,
741                "PROCESSING_MODE_INTERACTIVE" => Self::Interactive,
742                "PROCESSING_MODE_BATCH" => Self::Batch,
743                _ => Self::UnknownValue(processing_mode::UnknownValue(
744                    wkt::internal::UnknownEnumValue::String(value.to_string()),
745                )),
746            }
747        }
748    }
749
750    impl serde::ser::Serialize for ProcessingMode {
751        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
752        where
753            S: serde::Serializer,
754        {
755            match self {
756                Self::Unspecified => serializer.serialize_i32(0),
757                Self::Interactive => serializer.serialize_i32(1),
758                Self::Batch => serializer.serialize_i32(2),
759                Self::UnknownValue(u) => u.0.serialize(serializer),
760            }
761        }
762    }
763
764    impl<'de> serde::de::Deserialize<'de> for ProcessingMode {
765        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
766        where
767            D: serde::Deserializer<'de>,
768        {
769            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProcessingMode>::new(
770                ".google.cloud.video.transcoder.v1.Job.ProcessingMode",
771            ))
772        }
773    }
774
775    /// The optimization strategy of the job. The default is `AUTODETECT`.
776    ///
777    /// # Working with unknown values
778    ///
779    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
780    /// additional enum variants at any time. Adding new variants is not considered
781    /// a breaking change. Applications should write their code in anticipation of:
782    ///
783    /// - New values appearing in future releases of the client library, **and**
784    /// - New values received dynamically, without application changes.
785    ///
786    /// Please consult the [Working with enums] section in the user guide for some
787    /// guidelines.
788    ///
789    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
790    #[derive(Clone, Debug, PartialEq)]
791    #[non_exhaustive]
792    pub enum OptimizationStrategy {
793        /// The optimization strategy is not specified.
794        Unspecified,
795        /// Prioritize job processing speed.
796        Autodetect,
797        /// Disable all optimizations.
798        Disabled,
799        /// If set, the enum was initialized with an unknown value.
800        ///
801        /// Applications can examine the value using [OptimizationStrategy::value] or
802        /// [OptimizationStrategy::name].
803        UnknownValue(optimization_strategy::UnknownValue),
804    }
805
806    #[doc(hidden)]
807    pub mod optimization_strategy {
808        #[allow(unused_imports)]
809        use super::*;
810        #[derive(Clone, Debug, PartialEq)]
811        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
812    }
813
814    impl OptimizationStrategy {
815        /// Gets the enum value.
816        ///
817        /// Returns `None` if the enum contains an unknown value deserialized from
818        /// the string representation of enums.
819        pub fn value(&self) -> std::option::Option<i32> {
820            match self {
821                Self::Unspecified => std::option::Option::Some(0),
822                Self::Autodetect => std::option::Option::Some(1),
823                Self::Disabled => std::option::Option::Some(2),
824                Self::UnknownValue(u) => u.0.value(),
825            }
826        }
827
828        /// Gets the enum value as a string.
829        ///
830        /// Returns `None` if the enum contains an unknown value deserialized from
831        /// the integer representation of enums.
832        pub fn name(&self) -> std::option::Option<&str> {
833            match self {
834                Self::Unspecified => std::option::Option::Some("OPTIMIZATION_STRATEGY_UNSPECIFIED"),
835                Self::Autodetect => std::option::Option::Some("AUTODETECT"),
836                Self::Disabled => std::option::Option::Some("DISABLED"),
837                Self::UnknownValue(u) => u.0.name(),
838            }
839        }
840    }
841
842    impl std::default::Default for OptimizationStrategy {
843        fn default() -> Self {
844            use std::convert::From;
845            Self::from(0)
846        }
847    }
848
849    impl std::fmt::Display for OptimizationStrategy {
850        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
851            wkt::internal::display_enum(f, self.name(), self.value())
852        }
853    }
854
855    impl std::convert::From<i32> for OptimizationStrategy {
856        fn from(value: i32) -> Self {
857            match value {
858                0 => Self::Unspecified,
859                1 => Self::Autodetect,
860                2 => Self::Disabled,
861                _ => Self::UnknownValue(optimization_strategy::UnknownValue(
862                    wkt::internal::UnknownEnumValue::Integer(value),
863                )),
864            }
865        }
866    }
867
868    impl std::convert::From<&str> for OptimizationStrategy {
869        fn from(value: &str) -> Self {
870            use std::string::ToString;
871            match value {
872                "OPTIMIZATION_STRATEGY_UNSPECIFIED" => Self::Unspecified,
873                "AUTODETECT" => Self::Autodetect,
874                "DISABLED" => Self::Disabled,
875                _ => Self::UnknownValue(optimization_strategy::UnknownValue(
876                    wkt::internal::UnknownEnumValue::String(value.to_string()),
877                )),
878            }
879        }
880    }
881
882    impl serde::ser::Serialize for OptimizationStrategy {
883        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
884        where
885            S: serde::Serializer,
886        {
887            match self {
888                Self::Unspecified => serializer.serialize_i32(0),
889                Self::Autodetect => serializer.serialize_i32(1),
890                Self::Disabled => serializer.serialize_i32(2),
891                Self::UnknownValue(u) => u.0.serialize(serializer),
892            }
893        }
894    }
895
896    impl<'de> serde::de::Deserialize<'de> for OptimizationStrategy {
897        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
898        where
899            D: serde::Deserializer<'de>,
900        {
901            deserializer.deserialize_any(wkt::internal::EnumVisitor::<OptimizationStrategy>::new(
902                ".google.cloud.video.transcoder.v1.Job.OptimizationStrategy",
903            ))
904        }
905    }
906
907    /// Specify the config for the transcoding job. If you don't specify the
908    /// `job_config`, the API selects `templateId`; this template ID is set to
909    /// `preset/web-hd` by default. When you use a `template_id` to create a job,
910    /// the `Job.config` is populated by the `JobTemplate.config`.\<br\>
911    #[derive(Clone, Debug, PartialEq)]
912    #[non_exhaustive]
913    pub enum JobConfig {
914        /// Input only. Specify the `template_id` to use for populating `Job.config`.
915        /// The default is `preset/web-hd`, which is the only supported preset.
916        ///
917        /// User defined JobTemplate: `{job_template_id}`
918        TemplateId(std::string::String),
919        /// The configuration for this job.
920        Config(std::boxed::Box<crate::model::JobConfig>),
921    }
922}
923
924/// Transcoding job template resource.
925#[derive(Clone, Default, PartialEq)]
926#[non_exhaustive]
927pub struct JobTemplate {
928    /// The resource name of the job template.
929    /// Format:
930    /// `projects/{project_number}/locations/{location}/jobTemplates/{job_template}`
931    pub name: std::string::String,
932
933    /// The configuration for this template.
934    pub config: std::option::Option<crate::model::JobConfig>,
935
936    /// The labels associated with this job template. You can use these to organize
937    /// and group your job templates.
938    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
939
940    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
941}
942
943impl JobTemplate {
944    pub fn new() -> Self {
945        std::default::Default::default()
946    }
947
948    /// Sets the value of [name][crate::model::JobTemplate::name].
949    ///
950    /// # Example
951    /// ```ignore,no_run
952    /// # use google_cloud_video_transcoder_v1::model::JobTemplate;
953    /// let x = JobTemplate::new().set_name("example");
954    /// ```
955    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
956        self.name = v.into();
957        self
958    }
959
960    /// Sets the value of [config][crate::model::JobTemplate::config].
961    ///
962    /// # Example
963    /// ```ignore,no_run
964    /// # use google_cloud_video_transcoder_v1::model::JobTemplate;
965    /// use google_cloud_video_transcoder_v1::model::JobConfig;
966    /// let x = JobTemplate::new().set_config(JobConfig::default()/* use setters */);
967    /// ```
968    pub fn set_config<T>(mut self, v: T) -> Self
969    where
970        T: std::convert::Into<crate::model::JobConfig>,
971    {
972        self.config = std::option::Option::Some(v.into());
973        self
974    }
975
976    /// Sets or clears the value of [config][crate::model::JobTemplate::config].
977    ///
978    /// # Example
979    /// ```ignore,no_run
980    /// # use google_cloud_video_transcoder_v1::model::JobTemplate;
981    /// use google_cloud_video_transcoder_v1::model::JobConfig;
982    /// let x = JobTemplate::new().set_or_clear_config(Some(JobConfig::default()/* use setters */));
983    /// let x = JobTemplate::new().set_or_clear_config(None::<JobConfig>);
984    /// ```
985    pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
986    where
987        T: std::convert::Into<crate::model::JobConfig>,
988    {
989        self.config = v.map(|x| x.into());
990        self
991    }
992
993    /// Sets the value of [labels][crate::model::JobTemplate::labels].
994    ///
995    /// # Example
996    /// ```ignore,no_run
997    /// # use google_cloud_video_transcoder_v1::model::JobTemplate;
998    /// let x = JobTemplate::new().set_labels([
999    ///     ("key0", "abc"),
1000    ///     ("key1", "xyz"),
1001    /// ]);
1002    /// ```
1003    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1004    where
1005        T: std::iter::IntoIterator<Item = (K, V)>,
1006        K: std::convert::Into<std::string::String>,
1007        V: std::convert::Into<std::string::String>,
1008    {
1009        use std::iter::Iterator;
1010        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1011        self
1012    }
1013}
1014
1015impl wkt::message::Message for JobTemplate {
1016    fn typename() -> &'static str {
1017        "type.googleapis.com/google.cloud.video.transcoder.v1.JobTemplate"
1018    }
1019}
1020
1021/// Job configuration
1022#[derive(Clone, Default, PartialEq)]
1023#[non_exhaustive]
1024pub struct JobConfig {
1025    /// List of input assets stored in Cloud Storage.
1026    pub inputs: std::vec::Vec<crate::model::Input>,
1027
1028    /// List of edit atoms. Defines the ultimate timeline of the resulting
1029    /// file or manifest.
1030    pub edit_list: std::vec::Vec<crate::model::EditAtom>,
1031
1032    /// List of elementary streams.
1033    pub elementary_streams: std::vec::Vec<crate::model::ElementaryStream>,
1034
1035    /// List of multiplexing settings for output streams.
1036    pub mux_streams: std::vec::Vec<crate::model::MuxStream>,
1037
1038    /// List of output manifests.
1039    pub manifests: std::vec::Vec<crate::model::Manifest>,
1040
1041    /// Output configuration.
1042    pub output: std::option::Option<crate::model::Output>,
1043
1044    /// List of ad breaks. Specifies where to insert ad break tags in the output
1045    /// manifests.
1046    pub ad_breaks: std::vec::Vec<crate::model::AdBreak>,
1047
1048    /// Destination on Pub/Sub.
1049    pub pubsub_destination: std::option::Option<crate::model::PubsubDestination>,
1050
1051    /// List of output sprite sheets.
1052    /// Spritesheets require at least one VideoStream in the Jobconfig.
1053    pub sprite_sheets: std::vec::Vec<crate::model::SpriteSheet>,
1054
1055    /// List of overlays on the output video, in descending Z-order.
1056    pub overlays: std::vec::Vec<crate::model::Overlay>,
1057
1058    /// List of encryption configurations for the content.
1059    /// Each configuration has an ID. Specify this ID in the
1060    /// [MuxStream.encryption_id][google.cloud.video.transcoder.v1.MuxStream.encryption_id]
1061    /// field to indicate the configuration to use for that `MuxStream` output.
1062    ///
1063    /// [google.cloud.video.transcoder.v1.MuxStream.encryption_id]: crate::model::MuxStream::encryption_id
1064    pub encryptions: std::vec::Vec<crate::model::Encryption>,
1065
1066    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1067}
1068
1069impl JobConfig {
1070    pub fn new() -> Self {
1071        std::default::Default::default()
1072    }
1073
1074    /// Sets the value of [inputs][crate::model::JobConfig::inputs].
1075    ///
1076    /// # Example
1077    /// ```ignore,no_run
1078    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1079    /// use google_cloud_video_transcoder_v1::model::Input;
1080    /// let x = JobConfig::new()
1081    ///     .set_inputs([
1082    ///         Input::default()/* use setters */,
1083    ///         Input::default()/* use (different) setters */,
1084    ///     ]);
1085    /// ```
1086    pub fn set_inputs<T, V>(mut self, v: T) -> Self
1087    where
1088        T: std::iter::IntoIterator<Item = V>,
1089        V: std::convert::Into<crate::model::Input>,
1090    {
1091        use std::iter::Iterator;
1092        self.inputs = v.into_iter().map(|i| i.into()).collect();
1093        self
1094    }
1095
1096    /// Sets the value of [edit_list][crate::model::JobConfig::edit_list].
1097    ///
1098    /// # Example
1099    /// ```ignore,no_run
1100    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1101    /// use google_cloud_video_transcoder_v1::model::EditAtom;
1102    /// let x = JobConfig::new()
1103    ///     .set_edit_list([
1104    ///         EditAtom::default()/* use setters */,
1105    ///         EditAtom::default()/* use (different) setters */,
1106    ///     ]);
1107    /// ```
1108    pub fn set_edit_list<T, V>(mut self, v: T) -> Self
1109    where
1110        T: std::iter::IntoIterator<Item = V>,
1111        V: std::convert::Into<crate::model::EditAtom>,
1112    {
1113        use std::iter::Iterator;
1114        self.edit_list = v.into_iter().map(|i| i.into()).collect();
1115        self
1116    }
1117
1118    /// Sets the value of [elementary_streams][crate::model::JobConfig::elementary_streams].
1119    ///
1120    /// # Example
1121    /// ```ignore,no_run
1122    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1123    /// use google_cloud_video_transcoder_v1::model::ElementaryStream;
1124    /// let x = JobConfig::new()
1125    ///     .set_elementary_streams([
1126    ///         ElementaryStream::default()/* use setters */,
1127    ///         ElementaryStream::default()/* use (different) setters */,
1128    ///     ]);
1129    /// ```
1130    pub fn set_elementary_streams<T, V>(mut self, v: T) -> Self
1131    where
1132        T: std::iter::IntoIterator<Item = V>,
1133        V: std::convert::Into<crate::model::ElementaryStream>,
1134    {
1135        use std::iter::Iterator;
1136        self.elementary_streams = v.into_iter().map(|i| i.into()).collect();
1137        self
1138    }
1139
1140    /// Sets the value of [mux_streams][crate::model::JobConfig::mux_streams].
1141    ///
1142    /// # Example
1143    /// ```ignore,no_run
1144    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1145    /// use google_cloud_video_transcoder_v1::model::MuxStream;
1146    /// let x = JobConfig::new()
1147    ///     .set_mux_streams([
1148    ///         MuxStream::default()/* use setters */,
1149    ///         MuxStream::default()/* use (different) setters */,
1150    ///     ]);
1151    /// ```
1152    pub fn set_mux_streams<T, V>(mut self, v: T) -> Self
1153    where
1154        T: std::iter::IntoIterator<Item = V>,
1155        V: std::convert::Into<crate::model::MuxStream>,
1156    {
1157        use std::iter::Iterator;
1158        self.mux_streams = v.into_iter().map(|i| i.into()).collect();
1159        self
1160    }
1161
1162    /// Sets the value of [manifests][crate::model::JobConfig::manifests].
1163    ///
1164    /// # Example
1165    /// ```ignore,no_run
1166    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1167    /// use google_cloud_video_transcoder_v1::model::Manifest;
1168    /// let x = JobConfig::new()
1169    ///     .set_manifests([
1170    ///         Manifest::default()/* use setters */,
1171    ///         Manifest::default()/* use (different) setters */,
1172    ///     ]);
1173    /// ```
1174    pub fn set_manifests<T, V>(mut self, v: T) -> Self
1175    where
1176        T: std::iter::IntoIterator<Item = V>,
1177        V: std::convert::Into<crate::model::Manifest>,
1178    {
1179        use std::iter::Iterator;
1180        self.manifests = v.into_iter().map(|i| i.into()).collect();
1181        self
1182    }
1183
1184    /// Sets the value of [output][crate::model::JobConfig::output].
1185    ///
1186    /// # Example
1187    /// ```ignore,no_run
1188    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1189    /// use google_cloud_video_transcoder_v1::model::Output;
1190    /// let x = JobConfig::new().set_output(Output::default()/* use setters */);
1191    /// ```
1192    pub fn set_output<T>(mut self, v: T) -> Self
1193    where
1194        T: std::convert::Into<crate::model::Output>,
1195    {
1196        self.output = std::option::Option::Some(v.into());
1197        self
1198    }
1199
1200    /// Sets or clears the value of [output][crate::model::JobConfig::output].
1201    ///
1202    /// # Example
1203    /// ```ignore,no_run
1204    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1205    /// use google_cloud_video_transcoder_v1::model::Output;
1206    /// let x = JobConfig::new().set_or_clear_output(Some(Output::default()/* use setters */));
1207    /// let x = JobConfig::new().set_or_clear_output(None::<Output>);
1208    /// ```
1209    pub fn set_or_clear_output<T>(mut self, v: std::option::Option<T>) -> Self
1210    where
1211        T: std::convert::Into<crate::model::Output>,
1212    {
1213        self.output = v.map(|x| x.into());
1214        self
1215    }
1216
1217    /// Sets the value of [ad_breaks][crate::model::JobConfig::ad_breaks].
1218    ///
1219    /// # Example
1220    /// ```ignore,no_run
1221    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1222    /// use google_cloud_video_transcoder_v1::model::AdBreak;
1223    /// let x = JobConfig::new()
1224    ///     .set_ad_breaks([
1225    ///         AdBreak::default()/* use setters */,
1226    ///         AdBreak::default()/* use (different) setters */,
1227    ///     ]);
1228    /// ```
1229    pub fn set_ad_breaks<T, V>(mut self, v: T) -> Self
1230    where
1231        T: std::iter::IntoIterator<Item = V>,
1232        V: std::convert::Into<crate::model::AdBreak>,
1233    {
1234        use std::iter::Iterator;
1235        self.ad_breaks = v.into_iter().map(|i| i.into()).collect();
1236        self
1237    }
1238
1239    /// Sets the value of [pubsub_destination][crate::model::JobConfig::pubsub_destination].
1240    ///
1241    /// # Example
1242    /// ```ignore,no_run
1243    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1244    /// use google_cloud_video_transcoder_v1::model::PubsubDestination;
1245    /// let x = JobConfig::new().set_pubsub_destination(PubsubDestination::default()/* use setters */);
1246    /// ```
1247    pub fn set_pubsub_destination<T>(mut self, v: T) -> Self
1248    where
1249        T: std::convert::Into<crate::model::PubsubDestination>,
1250    {
1251        self.pubsub_destination = std::option::Option::Some(v.into());
1252        self
1253    }
1254
1255    /// Sets or clears the value of [pubsub_destination][crate::model::JobConfig::pubsub_destination].
1256    ///
1257    /// # Example
1258    /// ```ignore,no_run
1259    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1260    /// use google_cloud_video_transcoder_v1::model::PubsubDestination;
1261    /// let x = JobConfig::new().set_or_clear_pubsub_destination(Some(PubsubDestination::default()/* use setters */));
1262    /// let x = JobConfig::new().set_or_clear_pubsub_destination(None::<PubsubDestination>);
1263    /// ```
1264    pub fn set_or_clear_pubsub_destination<T>(mut self, v: std::option::Option<T>) -> Self
1265    where
1266        T: std::convert::Into<crate::model::PubsubDestination>,
1267    {
1268        self.pubsub_destination = v.map(|x| x.into());
1269        self
1270    }
1271
1272    /// Sets the value of [sprite_sheets][crate::model::JobConfig::sprite_sheets].
1273    ///
1274    /// # Example
1275    /// ```ignore,no_run
1276    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1277    /// use google_cloud_video_transcoder_v1::model::SpriteSheet;
1278    /// let x = JobConfig::new()
1279    ///     .set_sprite_sheets([
1280    ///         SpriteSheet::default()/* use setters */,
1281    ///         SpriteSheet::default()/* use (different) setters */,
1282    ///     ]);
1283    /// ```
1284    pub fn set_sprite_sheets<T, V>(mut self, v: T) -> Self
1285    where
1286        T: std::iter::IntoIterator<Item = V>,
1287        V: std::convert::Into<crate::model::SpriteSheet>,
1288    {
1289        use std::iter::Iterator;
1290        self.sprite_sheets = v.into_iter().map(|i| i.into()).collect();
1291        self
1292    }
1293
1294    /// Sets the value of [overlays][crate::model::JobConfig::overlays].
1295    ///
1296    /// # Example
1297    /// ```ignore,no_run
1298    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1299    /// use google_cloud_video_transcoder_v1::model::Overlay;
1300    /// let x = JobConfig::new()
1301    ///     .set_overlays([
1302    ///         Overlay::default()/* use setters */,
1303    ///         Overlay::default()/* use (different) setters */,
1304    ///     ]);
1305    /// ```
1306    pub fn set_overlays<T, V>(mut self, v: T) -> Self
1307    where
1308        T: std::iter::IntoIterator<Item = V>,
1309        V: std::convert::Into<crate::model::Overlay>,
1310    {
1311        use std::iter::Iterator;
1312        self.overlays = v.into_iter().map(|i| i.into()).collect();
1313        self
1314    }
1315
1316    /// Sets the value of [encryptions][crate::model::JobConfig::encryptions].
1317    ///
1318    /// # Example
1319    /// ```ignore,no_run
1320    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1321    /// use google_cloud_video_transcoder_v1::model::Encryption;
1322    /// let x = JobConfig::new()
1323    ///     .set_encryptions([
1324    ///         Encryption::default()/* use setters */,
1325    ///         Encryption::default()/* use (different) setters */,
1326    ///     ]);
1327    /// ```
1328    pub fn set_encryptions<T, V>(mut self, v: T) -> Self
1329    where
1330        T: std::iter::IntoIterator<Item = V>,
1331        V: std::convert::Into<crate::model::Encryption>,
1332    {
1333        use std::iter::Iterator;
1334        self.encryptions = v.into_iter().map(|i| i.into()).collect();
1335        self
1336    }
1337}
1338
1339impl wkt::message::Message for JobConfig {
1340    fn typename() -> &'static str {
1341        "type.googleapis.com/google.cloud.video.transcoder.v1.JobConfig"
1342    }
1343}
1344
1345/// Input asset.
1346#[derive(Clone, Default, PartialEq)]
1347#[non_exhaustive]
1348pub struct Input {
1349    /// A unique key for this input. Must be specified when using advanced
1350    /// mapping and edit lists.
1351    pub key: std::string::String,
1352
1353    /// URI of the media. Input files must be at least 5 seconds in duration and
1354    /// stored in Cloud Storage (for example, `gs://bucket/inputs/file.mp4`).
1355    /// If empty, the value is populated from
1356    /// [Job.input_uri][google.cloud.video.transcoder.v1.Job.input_uri]. See
1357    /// [Supported input and output
1358    /// formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats).
1359    ///
1360    /// [google.cloud.video.transcoder.v1.Job.input_uri]: crate::model::Job::input_uri
1361    pub uri: std::string::String,
1362
1363    /// Preprocessing configurations.
1364    pub preprocessing_config: std::option::Option<crate::model::PreprocessingConfig>,
1365
1366    /// Optional. Input Attributes.
1367    pub attributes: std::option::Option<crate::model::InputAttributes>,
1368
1369    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1370}
1371
1372impl Input {
1373    pub fn new() -> Self {
1374        std::default::Default::default()
1375    }
1376
1377    /// Sets the value of [key][crate::model::Input::key].
1378    ///
1379    /// # Example
1380    /// ```ignore,no_run
1381    /// # use google_cloud_video_transcoder_v1::model::Input;
1382    /// let x = Input::new().set_key("example");
1383    /// ```
1384    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1385        self.key = v.into();
1386        self
1387    }
1388
1389    /// Sets the value of [uri][crate::model::Input::uri].
1390    ///
1391    /// # Example
1392    /// ```ignore,no_run
1393    /// # use google_cloud_video_transcoder_v1::model::Input;
1394    /// let x = Input::new().set_uri("example");
1395    /// ```
1396    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1397        self.uri = v.into();
1398        self
1399    }
1400
1401    /// Sets the value of [preprocessing_config][crate::model::Input::preprocessing_config].
1402    ///
1403    /// # Example
1404    /// ```ignore,no_run
1405    /// # use google_cloud_video_transcoder_v1::model::Input;
1406    /// use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
1407    /// let x = Input::new().set_preprocessing_config(PreprocessingConfig::default()/* use setters */);
1408    /// ```
1409    pub fn set_preprocessing_config<T>(mut self, v: T) -> Self
1410    where
1411        T: std::convert::Into<crate::model::PreprocessingConfig>,
1412    {
1413        self.preprocessing_config = std::option::Option::Some(v.into());
1414        self
1415    }
1416
1417    /// Sets or clears the value of [preprocessing_config][crate::model::Input::preprocessing_config].
1418    ///
1419    /// # Example
1420    /// ```ignore,no_run
1421    /// # use google_cloud_video_transcoder_v1::model::Input;
1422    /// use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
1423    /// let x = Input::new().set_or_clear_preprocessing_config(Some(PreprocessingConfig::default()/* use setters */));
1424    /// let x = Input::new().set_or_clear_preprocessing_config(None::<PreprocessingConfig>);
1425    /// ```
1426    pub fn set_or_clear_preprocessing_config<T>(mut self, v: std::option::Option<T>) -> Self
1427    where
1428        T: std::convert::Into<crate::model::PreprocessingConfig>,
1429    {
1430        self.preprocessing_config = v.map(|x| x.into());
1431        self
1432    }
1433
1434    /// Sets the value of [attributes][crate::model::Input::attributes].
1435    ///
1436    /// # Example
1437    /// ```ignore,no_run
1438    /// # use google_cloud_video_transcoder_v1::model::Input;
1439    /// use google_cloud_video_transcoder_v1::model::InputAttributes;
1440    /// let x = Input::new().set_attributes(InputAttributes::default()/* use setters */);
1441    /// ```
1442    pub fn set_attributes<T>(mut self, v: T) -> Self
1443    where
1444        T: std::convert::Into<crate::model::InputAttributes>,
1445    {
1446        self.attributes = std::option::Option::Some(v.into());
1447        self
1448    }
1449
1450    /// Sets or clears the value of [attributes][crate::model::Input::attributes].
1451    ///
1452    /// # Example
1453    /// ```ignore,no_run
1454    /// # use google_cloud_video_transcoder_v1::model::Input;
1455    /// use google_cloud_video_transcoder_v1::model::InputAttributes;
1456    /// let x = Input::new().set_or_clear_attributes(Some(InputAttributes::default()/* use setters */));
1457    /// let x = Input::new().set_or_clear_attributes(None::<InputAttributes>);
1458    /// ```
1459    pub fn set_or_clear_attributes<T>(mut self, v: std::option::Option<T>) -> Self
1460    where
1461        T: std::convert::Into<crate::model::InputAttributes>,
1462    {
1463        self.attributes = v.map(|x| x.into());
1464        self
1465    }
1466}
1467
1468impl wkt::message::Message for Input {
1469    fn typename() -> &'static str {
1470        "type.googleapis.com/google.cloud.video.transcoder.v1.Input"
1471    }
1472}
1473
1474/// Location of output file(s) in a Cloud Storage bucket.
1475#[derive(Clone, Default, PartialEq)]
1476#[non_exhaustive]
1477pub struct Output {
1478    /// URI for the output file(s). For example, `gs://my-bucket/outputs/`. Must be
1479    /// a directory and not a top-level bucket. If empty, the value is populated
1480    /// from [Job.output_uri][google.cloud.video.transcoder.v1.Job.output_uri]. See
1481    /// [Supported input and output
1482    /// formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats).
1483    ///
1484    /// [google.cloud.video.transcoder.v1.Job.output_uri]: crate::model::Job::output_uri
1485    pub uri: std::string::String,
1486
1487    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1488}
1489
1490impl Output {
1491    pub fn new() -> Self {
1492        std::default::Default::default()
1493    }
1494
1495    /// Sets the value of [uri][crate::model::Output::uri].
1496    ///
1497    /// # Example
1498    /// ```ignore,no_run
1499    /// # use google_cloud_video_transcoder_v1::model::Output;
1500    /// let x = Output::new().set_uri("example");
1501    /// ```
1502    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1503        self.uri = v.into();
1504        self
1505    }
1506}
1507
1508impl wkt::message::Message for Output {
1509    fn typename() -> &'static str {
1510        "type.googleapis.com/google.cloud.video.transcoder.v1.Output"
1511    }
1512}
1513
1514/// Edit atom.
1515#[derive(Clone, Default, PartialEq)]
1516#[non_exhaustive]
1517pub struct EditAtom {
1518    /// A unique key for this atom. Must be specified when using advanced
1519    /// mapping.
1520    pub key: std::string::String,
1521
1522    /// List of [Input.key][google.cloud.video.transcoder.v1.Input.key] values
1523    /// identifying files that should be used in this atom. The listed `inputs`
1524    /// must have the same timeline.
1525    ///
1526    /// [google.cloud.video.transcoder.v1.Input.key]: crate::model::Input::key
1527    pub inputs: std::vec::Vec<std::string::String>,
1528
1529    /// End time in seconds for the atom, relative to the input file timeline.
1530    /// When `end_time_offset` is not specified, the `inputs` are used until
1531    /// the end of the atom.
1532    pub end_time_offset: std::option::Option<wkt::Duration>,
1533
1534    /// Start time in seconds for the atom, relative to the input file timeline.
1535    /// The default is `0s`.
1536    pub start_time_offset: std::option::Option<wkt::Duration>,
1537
1538    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1539}
1540
1541impl EditAtom {
1542    pub fn new() -> Self {
1543        std::default::Default::default()
1544    }
1545
1546    /// Sets the value of [key][crate::model::EditAtom::key].
1547    ///
1548    /// # Example
1549    /// ```ignore,no_run
1550    /// # use google_cloud_video_transcoder_v1::model::EditAtom;
1551    /// let x = EditAtom::new().set_key("example");
1552    /// ```
1553    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1554        self.key = v.into();
1555        self
1556    }
1557
1558    /// Sets the value of [inputs][crate::model::EditAtom::inputs].
1559    ///
1560    /// # Example
1561    /// ```ignore,no_run
1562    /// # use google_cloud_video_transcoder_v1::model::EditAtom;
1563    /// let x = EditAtom::new().set_inputs(["a", "b", "c"]);
1564    /// ```
1565    pub fn set_inputs<T, V>(mut self, v: T) -> Self
1566    where
1567        T: std::iter::IntoIterator<Item = V>,
1568        V: std::convert::Into<std::string::String>,
1569    {
1570        use std::iter::Iterator;
1571        self.inputs = v.into_iter().map(|i| i.into()).collect();
1572        self
1573    }
1574
1575    /// Sets the value of [end_time_offset][crate::model::EditAtom::end_time_offset].
1576    ///
1577    /// # Example
1578    /// ```ignore,no_run
1579    /// # use google_cloud_video_transcoder_v1::model::EditAtom;
1580    /// use wkt::Duration;
1581    /// let x = EditAtom::new().set_end_time_offset(Duration::default()/* use setters */);
1582    /// ```
1583    pub fn set_end_time_offset<T>(mut self, v: T) -> Self
1584    where
1585        T: std::convert::Into<wkt::Duration>,
1586    {
1587        self.end_time_offset = std::option::Option::Some(v.into());
1588        self
1589    }
1590
1591    /// Sets or clears the value of [end_time_offset][crate::model::EditAtom::end_time_offset].
1592    ///
1593    /// # Example
1594    /// ```ignore,no_run
1595    /// # use google_cloud_video_transcoder_v1::model::EditAtom;
1596    /// use wkt::Duration;
1597    /// let x = EditAtom::new().set_or_clear_end_time_offset(Some(Duration::default()/* use setters */));
1598    /// let x = EditAtom::new().set_or_clear_end_time_offset(None::<Duration>);
1599    /// ```
1600    pub fn set_or_clear_end_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
1601    where
1602        T: std::convert::Into<wkt::Duration>,
1603    {
1604        self.end_time_offset = v.map(|x| x.into());
1605        self
1606    }
1607
1608    /// Sets the value of [start_time_offset][crate::model::EditAtom::start_time_offset].
1609    ///
1610    /// # Example
1611    /// ```ignore,no_run
1612    /// # use google_cloud_video_transcoder_v1::model::EditAtom;
1613    /// use wkt::Duration;
1614    /// let x = EditAtom::new().set_start_time_offset(Duration::default()/* use setters */);
1615    /// ```
1616    pub fn set_start_time_offset<T>(mut self, v: T) -> Self
1617    where
1618        T: std::convert::Into<wkt::Duration>,
1619    {
1620        self.start_time_offset = std::option::Option::Some(v.into());
1621        self
1622    }
1623
1624    /// Sets or clears the value of [start_time_offset][crate::model::EditAtom::start_time_offset].
1625    ///
1626    /// # Example
1627    /// ```ignore,no_run
1628    /// # use google_cloud_video_transcoder_v1::model::EditAtom;
1629    /// use wkt::Duration;
1630    /// let x = EditAtom::new().set_or_clear_start_time_offset(Some(Duration::default()/* use setters */));
1631    /// let x = EditAtom::new().set_or_clear_start_time_offset(None::<Duration>);
1632    /// ```
1633    pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
1634    where
1635        T: std::convert::Into<wkt::Duration>,
1636    {
1637        self.start_time_offset = v.map(|x| x.into());
1638        self
1639    }
1640}
1641
1642impl wkt::message::Message for EditAtom {
1643    fn typename() -> &'static str {
1644        "type.googleapis.com/google.cloud.video.transcoder.v1.EditAtom"
1645    }
1646}
1647
1648/// Ad break.
1649#[derive(Clone, Default, PartialEq)]
1650#[non_exhaustive]
1651pub struct AdBreak {
1652    /// Start time in seconds for the ad break, relative to the output file
1653    /// timeline. The default is `0s`.
1654    pub start_time_offset: std::option::Option<wkt::Duration>,
1655
1656    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1657}
1658
1659impl AdBreak {
1660    pub fn new() -> Self {
1661        std::default::Default::default()
1662    }
1663
1664    /// Sets the value of [start_time_offset][crate::model::AdBreak::start_time_offset].
1665    ///
1666    /// # Example
1667    /// ```ignore,no_run
1668    /// # use google_cloud_video_transcoder_v1::model::AdBreak;
1669    /// use wkt::Duration;
1670    /// let x = AdBreak::new().set_start_time_offset(Duration::default()/* use setters */);
1671    /// ```
1672    pub fn set_start_time_offset<T>(mut self, v: T) -> Self
1673    where
1674        T: std::convert::Into<wkt::Duration>,
1675    {
1676        self.start_time_offset = std::option::Option::Some(v.into());
1677        self
1678    }
1679
1680    /// Sets or clears the value of [start_time_offset][crate::model::AdBreak::start_time_offset].
1681    ///
1682    /// # Example
1683    /// ```ignore,no_run
1684    /// # use google_cloud_video_transcoder_v1::model::AdBreak;
1685    /// use wkt::Duration;
1686    /// let x = AdBreak::new().set_or_clear_start_time_offset(Some(Duration::default()/* use setters */));
1687    /// let x = AdBreak::new().set_or_clear_start_time_offset(None::<Duration>);
1688    /// ```
1689    pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
1690    where
1691        T: std::convert::Into<wkt::Duration>,
1692    {
1693        self.start_time_offset = v.map(|x| x.into());
1694        self
1695    }
1696}
1697
1698impl wkt::message::Message for AdBreak {
1699    fn typename() -> &'static str {
1700        "type.googleapis.com/google.cloud.video.transcoder.v1.AdBreak"
1701    }
1702}
1703
1704/// Encoding of an input file such as an audio, video, or text track.
1705/// Elementary streams must be packaged before
1706/// mapping and sharing between different output formats.
1707#[derive(Clone, Default, PartialEq)]
1708#[non_exhaustive]
1709pub struct ElementaryStream {
1710    /// A unique key for this elementary stream.
1711    pub key: std::string::String,
1712
1713    /// Encoding of an audio, video, or text track.
1714    pub elementary_stream: std::option::Option<crate::model::elementary_stream::ElementaryStream>,
1715
1716    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1717}
1718
1719impl ElementaryStream {
1720    pub fn new() -> Self {
1721        std::default::Default::default()
1722    }
1723
1724    /// Sets the value of [key][crate::model::ElementaryStream::key].
1725    ///
1726    /// # Example
1727    /// ```ignore,no_run
1728    /// # use google_cloud_video_transcoder_v1::model::ElementaryStream;
1729    /// let x = ElementaryStream::new().set_key("example");
1730    /// ```
1731    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1732        self.key = v.into();
1733        self
1734    }
1735
1736    /// Sets the value of [elementary_stream][crate::model::ElementaryStream::elementary_stream].
1737    ///
1738    /// Note that all the setters affecting `elementary_stream` are mutually
1739    /// exclusive.
1740    ///
1741    /// # Example
1742    /// ```ignore,no_run
1743    /// # use google_cloud_video_transcoder_v1::model::ElementaryStream;
1744    /// use google_cloud_video_transcoder_v1::model::VideoStream;
1745    /// let x = ElementaryStream::new().set_elementary_stream(Some(
1746    ///     google_cloud_video_transcoder_v1::model::elementary_stream::ElementaryStream::VideoStream(VideoStream::default().into())));
1747    /// ```
1748    pub fn set_elementary_stream<
1749        T: std::convert::Into<std::option::Option<crate::model::elementary_stream::ElementaryStream>>,
1750    >(
1751        mut self,
1752        v: T,
1753    ) -> Self {
1754        self.elementary_stream = v.into();
1755        self
1756    }
1757
1758    /// The value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
1759    /// if it holds a `VideoStream`, `None` if the field is not set or
1760    /// holds a different branch.
1761    pub fn video_stream(&self) -> std::option::Option<&std::boxed::Box<crate::model::VideoStream>> {
1762        #[allow(unreachable_patterns)]
1763        self.elementary_stream.as_ref().and_then(|v| match v {
1764            crate::model::elementary_stream::ElementaryStream::VideoStream(v) => {
1765                std::option::Option::Some(v)
1766            }
1767            _ => std::option::Option::None,
1768        })
1769    }
1770
1771    /// Sets the value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
1772    /// to hold a `VideoStream`.
1773    ///
1774    /// Note that all the setters affecting `elementary_stream` are
1775    /// mutually exclusive.
1776    ///
1777    /// # Example
1778    /// ```ignore,no_run
1779    /// # use google_cloud_video_transcoder_v1::model::ElementaryStream;
1780    /// use google_cloud_video_transcoder_v1::model::VideoStream;
1781    /// let x = ElementaryStream::new().set_video_stream(VideoStream::default()/* use setters */);
1782    /// assert!(x.video_stream().is_some());
1783    /// assert!(x.audio_stream().is_none());
1784    /// assert!(x.text_stream().is_none());
1785    /// ```
1786    pub fn set_video_stream<T: std::convert::Into<std::boxed::Box<crate::model::VideoStream>>>(
1787        mut self,
1788        v: T,
1789    ) -> Self {
1790        self.elementary_stream = std::option::Option::Some(
1791            crate::model::elementary_stream::ElementaryStream::VideoStream(v.into()),
1792        );
1793        self
1794    }
1795
1796    /// The value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
1797    /// if it holds a `AudioStream`, `None` if the field is not set or
1798    /// holds a different branch.
1799    pub fn audio_stream(&self) -> std::option::Option<&std::boxed::Box<crate::model::AudioStream>> {
1800        #[allow(unreachable_patterns)]
1801        self.elementary_stream.as_ref().and_then(|v| match v {
1802            crate::model::elementary_stream::ElementaryStream::AudioStream(v) => {
1803                std::option::Option::Some(v)
1804            }
1805            _ => std::option::Option::None,
1806        })
1807    }
1808
1809    /// Sets the value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
1810    /// to hold a `AudioStream`.
1811    ///
1812    /// Note that all the setters affecting `elementary_stream` are
1813    /// mutually exclusive.
1814    ///
1815    /// # Example
1816    /// ```ignore,no_run
1817    /// # use google_cloud_video_transcoder_v1::model::ElementaryStream;
1818    /// use google_cloud_video_transcoder_v1::model::AudioStream;
1819    /// let x = ElementaryStream::new().set_audio_stream(AudioStream::default()/* use setters */);
1820    /// assert!(x.audio_stream().is_some());
1821    /// assert!(x.video_stream().is_none());
1822    /// assert!(x.text_stream().is_none());
1823    /// ```
1824    pub fn set_audio_stream<T: std::convert::Into<std::boxed::Box<crate::model::AudioStream>>>(
1825        mut self,
1826        v: T,
1827    ) -> Self {
1828        self.elementary_stream = std::option::Option::Some(
1829            crate::model::elementary_stream::ElementaryStream::AudioStream(v.into()),
1830        );
1831        self
1832    }
1833
1834    /// The value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
1835    /// if it holds a `TextStream`, `None` if the field is not set or
1836    /// holds a different branch.
1837    pub fn text_stream(&self) -> std::option::Option<&std::boxed::Box<crate::model::TextStream>> {
1838        #[allow(unreachable_patterns)]
1839        self.elementary_stream.as_ref().and_then(|v| match v {
1840            crate::model::elementary_stream::ElementaryStream::TextStream(v) => {
1841                std::option::Option::Some(v)
1842            }
1843            _ => std::option::Option::None,
1844        })
1845    }
1846
1847    /// Sets the value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
1848    /// to hold a `TextStream`.
1849    ///
1850    /// Note that all the setters affecting `elementary_stream` are
1851    /// mutually exclusive.
1852    ///
1853    /// # Example
1854    /// ```ignore,no_run
1855    /// # use google_cloud_video_transcoder_v1::model::ElementaryStream;
1856    /// use google_cloud_video_transcoder_v1::model::TextStream;
1857    /// let x = ElementaryStream::new().set_text_stream(TextStream::default()/* use setters */);
1858    /// assert!(x.text_stream().is_some());
1859    /// assert!(x.video_stream().is_none());
1860    /// assert!(x.audio_stream().is_none());
1861    /// ```
1862    pub fn set_text_stream<T: std::convert::Into<std::boxed::Box<crate::model::TextStream>>>(
1863        mut self,
1864        v: T,
1865    ) -> Self {
1866        self.elementary_stream = std::option::Option::Some(
1867            crate::model::elementary_stream::ElementaryStream::TextStream(v.into()),
1868        );
1869        self
1870    }
1871}
1872
1873impl wkt::message::Message for ElementaryStream {
1874    fn typename() -> &'static str {
1875        "type.googleapis.com/google.cloud.video.transcoder.v1.ElementaryStream"
1876    }
1877}
1878
1879/// Defines additional types related to [ElementaryStream].
1880pub mod elementary_stream {
1881    #[allow(unused_imports)]
1882    use super::*;
1883
1884    /// Encoding of an audio, video, or text track.
1885    #[derive(Clone, Debug, PartialEq)]
1886    #[non_exhaustive]
1887    pub enum ElementaryStream {
1888        /// Encoding of a video stream.
1889        VideoStream(std::boxed::Box<crate::model::VideoStream>),
1890        /// Encoding of an audio stream.
1891        AudioStream(std::boxed::Box<crate::model::AudioStream>),
1892        /// Encoding of a text stream. For example, closed captions or subtitles.
1893        TextStream(std::boxed::Box<crate::model::TextStream>),
1894    }
1895}
1896
1897/// Multiplexing settings for output stream.
1898#[derive(Clone, Default, PartialEq)]
1899#[non_exhaustive]
1900pub struct MuxStream {
1901    /// A unique key for this multiplexed stream.
1902    pub key: std::string::String,
1903
1904    /// The name of the generated file. The default is
1905    /// [MuxStream.key][google.cloud.video.transcoder.v1.MuxStream.key] with the
1906    /// extension suffix corresponding to the
1907    /// [MuxStream.container][google.cloud.video.transcoder.v1.MuxStream.container].
1908    ///
1909    /// Individual segments also have an incremental 10-digit zero-padded suffix
1910    /// starting from 0 before the extension, such as `mux_stream0000000123.ts`.
1911    ///
1912    /// [google.cloud.video.transcoder.v1.MuxStream.container]: crate::model::MuxStream::container
1913    /// [google.cloud.video.transcoder.v1.MuxStream.key]: crate::model::MuxStream::key
1914    pub file_name: std::string::String,
1915
1916    /// The container format. The default is `mp4`
1917    ///
1918    /// Supported streaming formats:
1919    ///
1920    /// - `ts`
1921    /// - `fmp4`- the corresponding file extension is `.m4s`
1922    ///
1923    /// Supported standalone file formats:
1924    ///
1925    /// - `mp4`
1926    /// - `mp3`
1927    /// - `ogg`
1928    /// - `vtt`
1929    ///
1930    /// See also:
1931    /// [Supported input and output
1932    /// formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats)
1933    pub container: std::string::String,
1934
1935    /// List of
1936    /// [ElementaryStream.key][google.cloud.video.transcoder.v1.ElementaryStream.key]
1937    /// values multiplexed in this stream.
1938    ///
1939    /// [google.cloud.video.transcoder.v1.ElementaryStream.key]: crate::model::ElementaryStream::key
1940    pub elementary_streams: std::vec::Vec<std::string::String>,
1941
1942    /// Segment settings for `ts`, `fmp4` and `vtt`.
1943    pub segment_settings: std::option::Option<crate::model::SegmentSettings>,
1944
1945    /// Identifier of the encryption configuration to use. If omitted, output will
1946    /// be unencrypted.
1947    pub encryption_id: std::string::String,
1948
1949    /// Specifies the container configuration.
1950    pub container_config: std::option::Option<crate::model::mux_stream::ContainerConfig>,
1951
1952    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1953}
1954
1955impl MuxStream {
1956    pub fn new() -> Self {
1957        std::default::Default::default()
1958    }
1959
1960    /// Sets the value of [key][crate::model::MuxStream::key].
1961    ///
1962    /// # Example
1963    /// ```ignore,no_run
1964    /// # use google_cloud_video_transcoder_v1::model::MuxStream;
1965    /// let x = MuxStream::new().set_key("example");
1966    /// ```
1967    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1968        self.key = v.into();
1969        self
1970    }
1971
1972    /// Sets the value of [file_name][crate::model::MuxStream::file_name].
1973    ///
1974    /// # Example
1975    /// ```ignore,no_run
1976    /// # use google_cloud_video_transcoder_v1::model::MuxStream;
1977    /// let x = MuxStream::new().set_file_name("example");
1978    /// ```
1979    pub fn set_file_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1980        self.file_name = v.into();
1981        self
1982    }
1983
1984    /// Sets the value of [container][crate::model::MuxStream::container].
1985    ///
1986    /// # Example
1987    /// ```ignore,no_run
1988    /// # use google_cloud_video_transcoder_v1::model::MuxStream;
1989    /// let x = MuxStream::new().set_container("example");
1990    /// ```
1991    pub fn set_container<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1992        self.container = v.into();
1993        self
1994    }
1995
1996    /// Sets the value of [elementary_streams][crate::model::MuxStream::elementary_streams].
1997    ///
1998    /// # Example
1999    /// ```ignore,no_run
2000    /// # use google_cloud_video_transcoder_v1::model::MuxStream;
2001    /// let x = MuxStream::new().set_elementary_streams(["a", "b", "c"]);
2002    /// ```
2003    pub fn set_elementary_streams<T, V>(mut self, v: T) -> Self
2004    where
2005        T: std::iter::IntoIterator<Item = V>,
2006        V: std::convert::Into<std::string::String>,
2007    {
2008        use std::iter::Iterator;
2009        self.elementary_streams = v.into_iter().map(|i| i.into()).collect();
2010        self
2011    }
2012
2013    /// Sets the value of [segment_settings][crate::model::MuxStream::segment_settings].
2014    ///
2015    /// # Example
2016    /// ```ignore,no_run
2017    /// # use google_cloud_video_transcoder_v1::model::MuxStream;
2018    /// use google_cloud_video_transcoder_v1::model::SegmentSettings;
2019    /// let x = MuxStream::new().set_segment_settings(SegmentSettings::default()/* use setters */);
2020    /// ```
2021    pub fn set_segment_settings<T>(mut self, v: T) -> Self
2022    where
2023        T: std::convert::Into<crate::model::SegmentSettings>,
2024    {
2025        self.segment_settings = std::option::Option::Some(v.into());
2026        self
2027    }
2028
2029    /// Sets or clears the value of [segment_settings][crate::model::MuxStream::segment_settings].
2030    ///
2031    /// # Example
2032    /// ```ignore,no_run
2033    /// # use google_cloud_video_transcoder_v1::model::MuxStream;
2034    /// use google_cloud_video_transcoder_v1::model::SegmentSettings;
2035    /// let x = MuxStream::new().set_or_clear_segment_settings(Some(SegmentSettings::default()/* use setters */));
2036    /// let x = MuxStream::new().set_or_clear_segment_settings(None::<SegmentSettings>);
2037    /// ```
2038    pub fn set_or_clear_segment_settings<T>(mut self, v: std::option::Option<T>) -> Self
2039    where
2040        T: std::convert::Into<crate::model::SegmentSettings>,
2041    {
2042        self.segment_settings = v.map(|x| x.into());
2043        self
2044    }
2045
2046    /// Sets the value of [encryption_id][crate::model::MuxStream::encryption_id].
2047    ///
2048    /// # Example
2049    /// ```ignore,no_run
2050    /// # use google_cloud_video_transcoder_v1::model::MuxStream;
2051    /// let x = MuxStream::new().set_encryption_id("example");
2052    /// ```
2053    pub fn set_encryption_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2054        self.encryption_id = v.into();
2055        self
2056    }
2057
2058    /// Sets the value of [container_config][crate::model::MuxStream::container_config].
2059    ///
2060    /// Note that all the setters affecting `container_config` are mutually
2061    /// exclusive.
2062    ///
2063    /// # Example
2064    /// ```ignore,no_run
2065    /// # use google_cloud_video_transcoder_v1::model::MuxStream;
2066    /// use google_cloud_video_transcoder_v1::model::mux_stream::Fmp4Config;
2067    /// let x = MuxStream::new().set_container_config(Some(
2068    ///     google_cloud_video_transcoder_v1::model::mux_stream::ContainerConfig::Fmp4(Fmp4Config::default().into())));
2069    /// ```
2070    pub fn set_container_config<
2071        T: std::convert::Into<std::option::Option<crate::model::mux_stream::ContainerConfig>>,
2072    >(
2073        mut self,
2074        v: T,
2075    ) -> Self {
2076        self.container_config = v.into();
2077        self
2078    }
2079
2080    /// The value of [container_config][crate::model::MuxStream::container_config]
2081    /// if it holds a `Fmp4`, `None` if the field is not set or
2082    /// holds a different branch.
2083    pub fn fmp4(
2084        &self,
2085    ) -> std::option::Option<&std::boxed::Box<crate::model::mux_stream::Fmp4Config>> {
2086        #[allow(unreachable_patterns)]
2087        self.container_config.as_ref().and_then(|v| match v {
2088            crate::model::mux_stream::ContainerConfig::Fmp4(v) => std::option::Option::Some(v),
2089            _ => std::option::Option::None,
2090        })
2091    }
2092
2093    /// Sets the value of [container_config][crate::model::MuxStream::container_config]
2094    /// to hold a `Fmp4`.
2095    ///
2096    /// Note that all the setters affecting `container_config` are
2097    /// mutually exclusive.
2098    ///
2099    /// # Example
2100    /// ```ignore,no_run
2101    /// # use google_cloud_video_transcoder_v1::model::MuxStream;
2102    /// use google_cloud_video_transcoder_v1::model::mux_stream::Fmp4Config;
2103    /// let x = MuxStream::new().set_fmp4(Fmp4Config::default()/* use setters */);
2104    /// assert!(x.fmp4().is_some());
2105    /// ```
2106    pub fn set_fmp4<
2107        T: std::convert::Into<std::boxed::Box<crate::model::mux_stream::Fmp4Config>>,
2108    >(
2109        mut self,
2110        v: T,
2111    ) -> Self {
2112        self.container_config =
2113            std::option::Option::Some(crate::model::mux_stream::ContainerConfig::Fmp4(v.into()));
2114        self
2115    }
2116}
2117
2118impl wkt::message::Message for MuxStream {
2119    fn typename() -> &'static str {
2120        "type.googleapis.com/google.cloud.video.transcoder.v1.MuxStream"
2121    }
2122}
2123
2124/// Defines additional types related to [MuxStream].
2125pub mod mux_stream {
2126    #[allow(unused_imports)]
2127    use super::*;
2128
2129    /// `fmp4` container configuration.
2130    #[derive(Clone, Default, PartialEq)]
2131    #[non_exhaustive]
2132    pub struct Fmp4Config {
2133        /// Optional. Specify the codec tag string that will be used in the media
2134        /// bitstream. When not specified, the codec appropriate value is used.
2135        ///
2136        /// Supported H265 codec tags:
2137        ///
2138        /// - `hvc1` (default)
2139        /// - `hev1`
2140        pub codec_tag: std::string::String,
2141
2142        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2143    }
2144
2145    impl Fmp4Config {
2146        pub fn new() -> Self {
2147            std::default::Default::default()
2148        }
2149
2150        /// Sets the value of [codec_tag][crate::model::mux_stream::Fmp4Config::codec_tag].
2151        ///
2152        /// # Example
2153        /// ```ignore,no_run
2154        /// # use google_cloud_video_transcoder_v1::model::mux_stream::Fmp4Config;
2155        /// let x = Fmp4Config::new().set_codec_tag("example");
2156        /// ```
2157        pub fn set_codec_tag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2158            self.codec_tag = v.into();
2159            self
2160        }
2161    }
2162
2163    impl wkt::message::Message for Fmp4Config {
2164        fn typename() -> &'static str {
2165            "type.googleapis.com/google.cloud.video.transcoder.v1.MuxStream.Fmp4Config"
2166        }
2167    }
2168
2169    /// Specifies the container configuration.
2170    #[derive(Clone, Debug, PartialEq)]
2171    #[non_exhaustive]
2172    pub enum ContainerConfig {
2173        /// Optional. `fmp4` container configuration.
2174        Fmp4(std::boxed::Box<crate::model::mux_stream::Fmp4Config>),
2175    }
2176}
2177
2178/// Manifest configuration.
2179#[derive(Clone, Default, PartialEq)]
2180#[non_exhaustive]
2181pub struct Manifest {
2182    /// The name of the generated file. The default is `manifest` with the
2183    /// extension suffix corresponding to the
2184    /// [Manifest.type][google.cloud.video.transcoder.v1.Manifest.type].
2185    ///
2186    /// [google.cloud.video.transcoder.v1.Manifest.type]: crate::model::Manifest::type
2187    pub file_name: std::string::String,
2188
2189    /// Required. Type of the manifest.
2190    pub r#type: crate::model::manifest::ManifestType,
2191
2192    /// Required. List of user supplied
2193    /// [MuxStream.key][google.cloud.video.transcoder.v1.MuxStream.key] values that
2194    /// should appear in this manifest.
2195    ///
2196    /// When [Manifest.type][google.cloud.video.transcoder.v1.Manifest.type] is
2197    /// `HLS`, a media manifest with name
2198    /// [MuxStream.key][google.cloud.video.transcoder.v1.MuxStream.key] and `.m3u8`
2199    /// extension is generated for each element in this list.
2200    ///
2201    /// [google.cloud.video.transcoder.v1.Manifest.type]: crate::model::Manifest::type
2202    /// [google.cloud.video.transcoder.v1.MuxStream.key]: crate::model::MuxStream::key
2203    pub mux_streams: std::vec::Vec<std::string::String>,
2204
2205    /// Specifies the manifest configuration.
2206    pub manifest_config: std::option::Option<crate::model::manifest::ManifestConfig>,
2207
2208    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2209}
2210
2211impl Manifest {
2212    pub fn new() -> Self {
2213        std::default::Default::default()
2214    }
2215
2216    /// Sets the value of [file_name][crate::model::Manifest::file_name].
2217    ///
2218    /// # Example
2219    /// ```ignore,no_run
2220    /// # use google_cloud_video_transcoder_v1::model::Manifest;
2221    /// let x = Manifest::new().set_file_name("example");
2222    /// ```
2223    pub fn set_file_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2224        self.file_name = v.into();
2225        self
2226    }
2227
2228    /// Sets the value of [r#type][crate::model::Manifest::type].
2229    ///
2230    /// # Example
2231    /// ```ignore,no_run
2232    /// # use google_cloud_video_transcoder_v1::model::Manifest;
2233    /// use google_cloud_video_transcoder_v1::model::manifest::ManifestType;
2234    /// let x0 = Manifest::new().set_type(ManifestType::Hls);
2235    /// let x1 = Manifest::new().set_type(ManifestType::Dash);
2236    /// ```
2237    pub fn set_type<T: std::convert::Into<crate::model::manifest::ManifestType>>(
2238        mut self,
2239        v: T,
2240    ) -> Self {
2241        self.r#type = v.into();
2242        self
2243    }
2244
2245    /// Sets the value of [mux_streams][crate::model::Manifest::mux_streams].
2246    ///
2247    /// # Example
2248    /// ```ignore,no_run
2249    /// # use google_cloud_video_transcoder_v1::model::Manifest;
2250    /// let x = Manifest::new().set_mux_streams(["a", "b", "c"]);
2251    /// ```
2252    pub fn set_mux_streams<T, V>(mut self, v: T) -> Self
2253    where
2254        T: std::iter::IntoIterator<Item = V>,
2255        V: std::convert::Into<std::string::String>,
2256    {
2257        use std::iter::Iterator;
2258        self.mux_streams = v.into_iter().map(|i| i.into()).collect();
2259        self
2260    }
2261
2262    /// Sets the value of [manifest_config][crate::model::Manifest::manifest_config].
2263    ///
2264    /// Note that all the setters affecting `manifest_config` are mutually
2265    /// exclusive.
2266    ///
2267    /// # Example
2268    /// ```ignore,no_run
2269    /// # use google_cloud_video_transcoder_v1::model::Manifest;
2270    /// use google_cloud_video_transcoder_v1::model::manifest::DashConfig;
2271    /// let x = Manifest::new().set_manifest_config(Some(
2272    ///     google_cloud_video_transcoder_v1::model::manifest::ManifestConfig::Dash(DashConfig::default().into())));
2273    /// ```
2274    pub fn set_manifest_config<
2275        T: std::convert::Into<std::option::Option<crate::model::manifest::ManifestConfig>>,
2276    >(
2277        mut self,
2278        v: T,
2279    ) -> Self {
2280        self.manifest_config = v.into();
2281        self
2282    }
2283
2284    /// The value of [manifest_config][crate::model::Manifest::manifest_config]
2285    /// if it holds a `Dash`, `None` if the field is not set or
2286    /// holds a different branch.
2287    pub fn dash(
2288        &self,
2289    ) -> std::option::Option<&std::boxed::Box<crate::model::manifest::DashConfig>> {
2290        #[allow(unreachable_patterns)]
2291        self.manifest_config.as_ref().and_then(|v| match v {
2292            crate::model::manifest::ManifestConfig::Dash(v) => std::option::Option::Some(v),
2293            _ => std::option::Option::None,
2294        })
2295    }
2296
2297    /// Sets the value of [manifest_config][crate::model::Manifest::manifest_config]
2298    /// to hold a `Dash`.
2299    ///
2300    /// Note that all the setters affecting `manifest_config` are
2301    /// mutually exclusive.
2302    ///
2303    /// # Example
2304    /// ```ignore,no_run
2305    /// # use google_cloud_video_transcoder_v1::model::Manifest;
2306    /// use google_cloud_video_transcoder_v1::model::manifest::DashConfig;
2307    /// let x = Manifest::new().set_dash(DashConfig::default()/* use setters */);
2308    /// assert!(x.dash().is_some());
2309    /// ```
2310    pub fn set_dash<T: std::convert::Into<std::boxed::Box<crate::model::manifest::DashConfig>>>(
2311        mut self,
2312        v: T,
2313    ) -> Self {
2314        self.manifest_config =
2315            std::option::Option::Some(crate::model::manifest::ManifestConfig::Dash(v.into()));
2316        self
2317    }
2318}
2319
2320impl wkt::message::Message for Manifest {
2321    fn typename() -> &'static str {
2322        "type.googleapis.com/google.cloud.video.transcoder.v1.Manifest"
2323    }
2324}
2325
2326/// Defines additional types related to [Manifest].
2327pub mod manifest {
2328    #[allow(unused_imports)]
2329    use super::*;
2330
2331    /// `DASH` manifest configuration.
2332    #[derive(Clone, Default, PartialEq)]
2333    #[non_exhaustive]
2334    pub struct DashConfig {
2335        /// The segment reference scheme for a `DASH` manifest. The default is
2336        /// `SEGMENT_LIST`.
2337        pub segment_reference_scheme: crate::model::manifest::dash_config::SegmentReferenceScheme,
2338
2339        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2340    }
2341
2342    impl DashConfig {
2343        pub fn new() -> Self {
2344            std::default::Default::default()
2345        }
2346
2347        /// Sets the value of [segment_reference_scheme][crate::model::manifest::DashConfig::segment_reference_scheme].
2348        ///
2349        /// # Example
2350        /// ```ignore,no_run
2351        /// # use google_cloud_video_transcoder_v1::model::manifest::DashConfig;
2352        /// use google_cloud_video_transcoder_v1::model::manifest::dash_config::SegmentReferenceScheme;
2353        /// let x0 = DashConfig::new().set_segment_reference_scheme(SegmentReferenceScheme::SegmentList);
2354        /// let x1 = DashConfig::new().set_segment_reference_scheme(SegmentReferenceScheme::SegmentTemplateNumber);
2355        /// ```
2356        pub fn set_segment_reference_scheme<
2357            T: std::convert::Into<crate::model::manifest::dash_config::SegmentReferenceScheme>,
2358        >(
2359            mut self,
2360            v: T,
2361        ) -> Self {
2362            self.segment_reference_scheme = v.into();
2363            self
2364        }
2365    }
2366
2367    impl wkt::message::Message for DashConfig {
2368        fn typename() -> &'static str {
2369            "type.googleapis.com/google.cloud.video.transcoder.v1.Manifest.DashConfig"
2370        }
2371    }
2372
2373    /// Defines additional types related to [DashConfig].
2374    pub mod dash_config {
2375        #[allow(unused_imports)]
2376        use super::*;
2377
2378        /// The segment reference scheme for a `DASH` manifest.
2379        ///
2380        /// # Working with unknown values
2381        ///
2382        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2383        /// additional enum variants at any time. Adding new variants is not considered
2384        /// a breaking change. Applications should write their code in anticipation of:
2385        ///
2386        /// - New values appearing in future releases of the client library, **and**
2387        /// - New values received dynamically, without application changes.
2388        ///
2389        /// Please consult the [Working with enums] section in the user guide for some
2390        /// guidelines.
2391        ///
2392        /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2393        #[derive(Clone, Debug, PartialEq)]
2394        #[non_exhaustive]
2395        pub enum SegmentReferenceScheme {
2396            /// The segment reference scheme is not specified.
2397            Unspecified,
2398            /// Explicitly lists the URLs of media files for each segment. For example,
2399            /// if
2400            /// [SegmentSettings.individual_segments][google.cloud.video.transcoder.v1.SegmentSettings.individual_segments]
2401            /// is `true`, then the manifest contains fields similar to the following:
2402            ///
2403            /// ```norust
2404            /// <Initialization sourceURL="my-hd-stream-init.m4s"/>
2405            ///   <SegmentList presentationTimeOffset="0" duration="1000"
2406            ///   timescale="10000">
2407            ///     <SegmentURL media="hd-stream0000000000.m4s"/>
2408            ///     <SegmentURL media="hd-stream0000000001.m4s"/>
2409            ///     ...
2410            /// ```
2411            ///
2412            /// [google.cloud.video.transcoder.v1.SegmentSettings.individual_segments]: crate::model::SegmentSettings::individual_segments
2413            SegmentList,
2414            /// [SegmentSettings.individual_segments][google.cloud.video.transcoder.v1.SegmentSettings.individual_segments]
2415            /// must be set to `true` to use this segment reference scheme. Uses the
2416            /// DASH specification
2417            /// `<SegmentTemplate>` tag to determine the URLs of media files for each
2418            /// segment. For example:
2419            ///
2420            /// ```norust
2421            /// <SegmentTemplate presentationTimeOffset="0" timescale="10000"
2422            ///       initialization="my-hd-stream-init.m4s"
2423            ///       media="hd-stream$Number%010d$.m4s" startNumber="0">
2424            ///   ...
2425            /// ```
2426            ///
2427            /// [google.cloud.video.transcoder.v1.SegmentSettings.individual_segments]: crate::model::SegmentSettings::individual_segments
2428            SegmentTemplateNumber,
2429            /// If set, the enum was initialized with an unknown value.
2430            ///
2431            /// Applications can examine the value using [SegmentReferenceScheme::value] or
2432            /// [SegmentReferenceScheme::name].
2433            UnknownValue(segment_reference_scheme::UnknownValue),
2434        }
2435
2436        #[doc(hidden)]
2437        pub mod segment_reference_scheme {
2438            #[allow(unused_imports)]
2439            use super::*;
2440            #[derive(Clone, Debug, PartialEq)]
2441            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2442        }
2443
2444        impl SegmentReferenceScheme {
2445            /// Gets the enum value.
2446            ///
2447            /// Returns `None` if the enum contains an unknown value deserialized from
2448            /// the string representation of enums.
2449            pub fn value(&self) -> std::option::Option<i32> {
2450                match self {
2451                    Self::Unspecified => std::option::Option::Some(0),
2452                    Self::SegmentList => std::option::Option::Some(1),
2453                    Self::SegmentTemplateNumber => std::option::Option::Some(2),
2454                    Self::UnknownValue(u) => u.0.value(),
2455                }
2456            }
2457
2458            /// Gets the enum value as a string.
2459            ///
2460            /// Returns `None` if the enum contains an unknown value deserialized from
2461            /// the integer representation of enums.
2462            pub fn name(&self) -> std::option::Option<&str> {
2463                match self {
2464                    Self::Unspecified => {
2465                        std::option::Option::Some("SEGMENT_REFERENCE_SCHEME_UNSPECIFIED")
2466                    }
2467                    Self::SegmentList => std::option::Option::Some("SEGMENT_LIST"),
2468                    Self::SegmentTemplateNumber => {
2469                        std::option::Option::Some("SEGMENT_TEMPLATE_NUMBER")
2470                    }
2471                    Self::UnknownValue(u) => u.0.name(),
2472                }
2473            }
2474        }
2475
2476        impl std::default::Default for SegmentReferenceScheme {
2477            fn default() -> Self {
2478                use std::convert::From;
2479                Self::from(0)
2480            }
2481        }
2482
2483        impl std::fmt::Display for SegmentReferenceScheme {
2484            fn fmt(
2485                &self,
2486                f: &mut std::fmt::Formatter<'_>,
2487            ) -> std::result::Result<(), std::fmt::Error> {
2488                wkt::internal::display_enum(f, self.name(), self.value())
2489            }
2490        }
2491
2492        impl std::convert::From<i32> for SegmentReferenceScheme {
2493            fn from(value: i32) -> Self {
2494                match value {
2495                    0 => Self::Unspecified,
2496                    1 => Self::SegmentList,
2497                    2 => Self::SegmentTemplateNumber,
2498                    _ => Self::UnknownValue(segment_reference_scheme::UnknownValue(
2499                        wkt::internal::UnknownEnumValue::Integer(value),
2500                    )),
2501                }
2502            }
2503        }
2504
2505        impl std::convert::From<&str> for SegmentReferenceScheme {
2506            fn from(value: &str) -> Self {
2507                use std::string::ToString;
2508                match value {
2509                    "SEGMENT_REFERENCE_SCHEME_UNSPECIFIED" => Self::Unspecified,
2510                    "SEGMENT_LIST" => Self::SegmentList,
2511                    "SEGMENT_TEMPLATE_NUMBER" => Self::SegmentTemplateNumber,
2512                    _ => Self::UnknownValue(segment_reference_scheme::UnknownValue(
2513                        wkt::internal::UnknownEnumValue::String(value.to_string()),
2514                    )),
2515                }
2516            }
2517        }
2518
2519        impl serde::ser::Serialize for SegmentReferenceScheme {
2520            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2521            where
2522                S: serde::Serializer,
2523            {
2524                match self {
2525                    Self::Unspecified => serializer.serialize_i32(0),
2526                    Self::SegmentList => serializer.serialize_i32(1),
2527                    Self::SegmentTemplateNumber => serializer.serialize_i32(2),
2528                    Self::UnknownValue(u) => u.0.serialize(serializer),
2529                }
2530            }
2531        }
2532
2533        impl<'de> serde::de::Deserialize<'de> for SegmentReferenceScheme {
2534            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2535            where
2536                D: serde::Deserializer<'de>,
2537            {
2538                deserializer.deserialize_any(wkt::internal::EnumVisitor::<SegmentReferenceScheme>::new(
2539                    ".google.cloud.video.transcoder.v1.Manifest.DashConfig.SegmentReferenceScheme"))
2540            }
2541        }
2542    }
2543
2544    /// The manifest type, which corresponds to the adaptive streaming format used.
2545    ///
2546    /// # Working with unknown values
2547    ///
2548    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2549    /// additional enum variants at any time. Adding new variants is not considered
2550    /// a breaking change. Applications should write their code in anticipation of:
2551    ///
2552    /// - New values appearing in future releases of the client library, **and**
2553    /// - New values received dynamically, without application changes.
2554    ///
2555    /// Please consult the [Working with enums] section in the user guide for some
2556    /// guidelines.
2557    ///
2558    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2559    #[derive(Clone, Debug, PartialEq)]
2560    #[non_exhaustive]
2561    pub enum ManifestType {
2562        /// The manifest type is not specified.
2563        Unspecified,
2564        /// Create an HLS manifest. The corresponding file extension is `.m3u8`.
2565        Hls,
2566        /// Create an MPEG-DASH manifest. The corresponding file extension is `.mpd`.
2567        Dash,
2568        /// If set, the enum was initialized with an unknown value.
2569        ///
2570        /// Applications can examine the value using [ManifestType::value] or
2571        /// [ManifestType::name].
2572        UnknownValue(manifest_type::UnknownValue),
2573    }
2574
2575    #[doc(hidden)]
2576    pub mod manifest_type {
2577        #[allow(unused_imports)]
2578        use super::*;
2579        #[derive(Clone, Debug, PartialEq)]
2580        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2581    }
2582
2583    impl ManifestType {
2584        /// Gets the enum value.
2585        ///
2586        /// Returns `None` if the enum contains an unknown value deserialized from
2587        /// the string representation of enums.
2588        pub fn value(&self) -> std::option::Option<i32> {
2589            match self {
2590                Self::Unspecified => std::option::Option::Some(0),
2591                Self::Hls => std::option::Option::Some(1),
2592                Self::Dash => std::option::Option::Some(2),
2593                Self::UnknownValue(u) => u.0.value(),
2594            }
2595        }
2596
2597        /// Gets the enum value as a string.
2598        ///
2599        /// Returns `None` if the enum contains an unknown value deserialized from
2600        /// the integer representation of enums.
2601        pub fn name(&self) -> std::option::Option<&str> {
2602            match self {
2603                Self::Unspecified => std::option::Option::Some("MANIFEST_TYPE_UNSPECIFIED"),
2604                Self::Hls => std::option::Option::Some("HLS"),
2605                Self::Dash => std::option::Option::Some("DASH"),
2606                Self::UnknownValue(u) => u.0.name(),
2607            }
2608        }
2609    }
2610
2611    impl std::default::Default for ManifestType {
2612        fn default() -> Self {
2613            use std::convert::From;
2614            Self::from(0)
2615        }
2616    }
2617
2618    impl std::fmt::Display for ManifestType {
2619        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2620            wkt::internal::display_enum(f, self.name(), self.value())
2621        }
2622    }
2623
2624    impl std::convert::From<i32> for ManifestType {
2625        fn from(value: i32) -> Self {
2626            match value {
2627                0 => Self::Unspecified,
2628                1 => Self::Hls,
2629                2 => Self::Dash,
2630                _ => Self::UnknownValue(manifest_type::UnknownValue(
2631                    wkt::internal::UnknownEnumValue::Integer(value),
2632                )),
2633            }
2634        }
2635    }
2636
2637    impl std::convert::From<&str> for ManifestType {
2638        fn from(value: &str) -> Self {
2639            use std::string::ToString;
2640            match value {
2641                "MANIFEST_TYPE_UNSPECIFIED" => Self::Unspecified,
2642                "HLS" => Self::Hls,
2643                "DASH" => Self::Dash,
2644                _ => Self::UnknownValue(manifest_type::UnknownValue(
2645                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2646                )),
2647            }
2648        }
2649    }
2650
2651    impl serde::ser::Serialize for ManifestType {
2652        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2653        where
2654            S: serde::Serializer,
2655        {
2656            match self {
2657                Self::Unspecified => serializer.serialize_i32(0),
2658                Self::Hls => serializer.serialize_i32(1),
2659                Self::Dash => serializer.serialize_i32(2),
2660                Self::UnknownValue(u) => u.0.serialize(serializer),
2661            }
2662        }
2663    }
2664
2665    impl<'de> serde::de::Deserialize<'de> for ManifestType {
2666        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2667        where
2668            D: serde::Deserializer<'de>,
2669        {
2670            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ManifestType>::new(
2671                ".google.cloud.video.transcoder.v1.Manifest.ManifestType",
2672            ))
2673        }
2674    }
2675
2676    /// Specifies the manifest configuration.
2677    #[derive(Clone, Debug, PartialEq)]
2678    #[non_exhaustive]
2679    pub enum ManifestConfig {
2680        /// `DASH` manifest configuration.
2681        Dash(std::boxed::Box<crate::model::manifest::DashConfig>),
2682    }
2683}
2684
2685/// A Pub/Sub destination.
2686#[derive(Clone, Default, PartialEq)]
2687#[non_exhaustive]
2688pub struct PubsubDestination {
2689    /// The name of the Pub/Sub topic to publish job completion notification
2690    /// to. For example: `projects/{project}/topics/{topic}`.
2691    pub topic: std::string::String,
2692
2693    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2694}
2695
2696impl PubsubDestination {
2697    pub fn new() -> Self {
2698        std::default::Default::default()
2699    }
2700
2701    /// Sets the value of [topic][crate::model::PubsubDestination::topic].
2702    ///
2703    /// # Example
2704    /// ```ignore,no_run
2705    /// # use google_cloud_video_transcoder_v1::model::PubsubDestination;
2706    /// let x = PubsubDestination::new().set_topic("example");
2707    /// ```
2708    pub fn set_topic<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2709        self.topic = v.into();
2710        self
2711    }
2712}
2713
2714impl wkt::message::Message for PubsubDestination {
2715    fn typename() -> &'static str {
2716        "type.googleapis.com/google.cloud.video.transcoder.v1.PubsubDestination"
2717    }
2718}
2719
2720/// Sprite sheet configuration.
2721#[derive(Clone, Default, PartialEq)]
2722#[non_exhaustive]
2723pub struct SpriteSheet {
2724    /// Format type. The default is `jpeg`.
2725    ///
2726    /// Supported formats:
2727    ///
2728    /// - `jpeg`
2729    pub format: std::string::String,
2730
2731    /// Required. File name prefix for the generated sprite sheets.
2732    ///
2733    /// Each sprite sheet has an incremental 10-digit zero-padded suffix starting
2734    /// from 0 before the extension, such as `sprite_sheet0000000123.jpeg`.
2735    pub file_prefix: std::string::String,
2736
2737    /// Required. The width of sprite in pixels. Must be an even integer. To
2738    /// preserve the source aspect ratio, set the
2739    /// [SpriteSheet.sprite_width_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_width_pixels]
2740    /// field or the
2741    /// [SpriteSheet.sprite_height_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_height_pixels]
2742    /// field, but not both (the API will automatically calculate the missing
2743    /// field).
2744    ///
2745    /// For portrait videos that contain horizontal ASR and rotation metadata,
2746    /// provide the width, in pixels, per the horizontal ASR. The API calculates
2747    /// the height per the horizontal ASR. The API detects any rotation metadata
2748    /// and swaps the requested height and width for the output.
2749    ///
2750    /// [google.cloud.video.transcoder.v1.SpriteSheet.sprite_height_pixels]: crate::model::SpriteSheet::sprite_height_pixels
2751    /// [google.cloud.video.transcoder.v1.SpriteSheet.sprite_width_pixels]: crate::model::SpriteSheet::sprite_width_pixels
2752    pub sprite_width_pixels: i32,
2753
2754    /// Required. The height of sprite in pixels. Must be an even integer. To
2755    /// preserve the source aspect ratio, set the
2756    /// [SpriteSheet.sprite_height_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_height_pixels]
2757    /// field or the
2758    /// [SpriteSheet.sprite_width_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_width_pixels]
2759    /// field, but not both (the API will automatically calculate the missing
2760    /// field).
2761    ///
2762    /// For portrait videos that contain horizontal ASR and rotation metadata,
2763    /// provide the height, in pixels, per the horizontal ASR. The API calculates
2764    /// the width per the horizontal ASR. The API detects any rotation metadata
2765    /// and swaps the requested height and width for the output.
2766    ///
2767    /// [google.cloud.video.transcoder.v1.SpriteSheet.sprite_height_pixels]: crate::model::SpriteSheet::sprite_height_pixels
2768    /// [google.cloud.video.transcoder.v1.SpriteSheet.sprite_width_pixels]: crate::model::SpriteSheet::sprite_width_pixels
2769    pub sprite_height_pixels: i32,
2770
2771    /// The maximum number of sprites per row in a sprite sheet. The default is 0,
2772    /// which indicates no maximum limit.
2773    pub column_count: i32,
2774
2775    /// The maximum number of rows per sprite sheet. When the sprite sheet is full,
2776    /// a new sprite sheet is created. The default is 0, which indicates no maximum
2777    /// limit.
2778    pub row_count: i32,
2779
2780    /// Start time in seconds, relative to the output file timeline. Determines the
2781    /// first sprite to pick. The default is `0s`.
2782    pub start_time_offset: std::option::Option<wkt::Duration>,
2783
2784    /// End time in seconds, relative to the output file timeline. When
2785    /// `end_time_offset` is not specified, the sprites are generated until the end
2786    /// of the output file.
2787    pub end_time_offset: std::option::Option<wkt::Duration>,
2788
2789    /// The quality of the generated sprite sheet. Enter a value between 1
2790    /// and 100, where 1 is the lowest quality and 100 is the highest quality.
2791    /// The default is 100. A high quality value corresponds to a low image data
2792    /// compression ratio.
2793    pub quality: i32,
2794
2795    /// Specify either total number of sprites or interval to create sprites.
2796    pub extraction_strategy: std::option::Option<crate::model::sprite_sheet::ExtractionStrategy>,
2797
2798    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2799}
2800
2801impl SpriteSheet {
2802    pub fn new() -> Self {
2803        std::default::Default::default()
2804    }
2805
2806    /// Sets the value of [format][crate::model::SpriteSheet::format].
2807    ///
2808    /// # Example
2809    /// ```ignore,no_run
2810    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2811    /// let x = SpriteSheet::new().set_format("example");
2812    /// ```
2813    pub fn set_format<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2814        self.format = v.into();
2815        self
2816    }
2817
2818    /// Sets the value of [file_prefix][crate::model::SpriteSheet::file_prefix].
2819    ///
2820    /// # Example
2821    /// ```ignore,no_run
2822    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2823    /// let x = SpriteSheet::new().set_file_prefix("example");
2824    /// ```
2825    pub fn set_file_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2826        self.file_prefix = v.into();
2827        self
2828    }
2829
2830    /// Sets the value of [sprite_width_pixels][crate::model::SpriteSheet::sprite_width_pixels].
2831    ///
2832    /// # Example
2833    /// ```ignore,no_run
2834    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2835    /// let x = SpriteSheet::new().set_sprite_width_pixels(42);
2836    /// ```
2837    pub fn set_sprite_width_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2838        self.sprite_width_pixels = v.into();
2839        self
2840    }
2841
2842    /// Sets the value of [sprite_height_pixels][crate::model::SpriteSheet::sprite_height_pixels].
2843    ///
2844    /// # Example
2845    /// ```ignore,no_run
2846    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2847    /// let x = SpriteSheet::new().set_sprite_height_pixels(42);
2848    /// ```
2849    pub fn set_sprite_height_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2850        self.sprite_height_pixels = v.into();
2851        self
2852    }
2853
2854    /// Sets the value of [column_count][crate::model::SpriteSheet::column_count].
2855    ///
2856    /// # Example
2857    /// ```ignore,no_run
2858    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2859    /// let x = SpriteSheet::new().set_column_count(42);
2860    /// ```
2861    pub fn set_column_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2862        self.column_count = v.into();
2863        self
2864    }
2865
2866    /// Sets the value of [row_count][crate::model::SpriteSheet::row_count].
2867    ///
2868    /// # Example
2869    /// ```ignore,no_run
2870    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2871    /// let x = SpriteSheet::new().set_row_count(42);
2872    /// ```
2873    pub fn set_row_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2874        self.row_count = v.into();
2875        self
2876    }
2877
2878    /// Sets the value of [start_time_offset][crate::model::SpriteSheet::start_time_offset].
2879    ///
2880    /// # Example
2881    /// ```ignore,no_run
2882    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2883    /// use wkt::Duration;
2884    /// let x = SpriteSheet::new().set_start_time_offset(Duration::default()/* use setters */);
2885    /// ```
2886    pub fn set_start_time_offset<T>(mut self, v: T) -> Self
2887    where
2888        T: std::convert::Into<wkt::Duration>,
2889    {
2890        self.start_time_offset = std::option::Option::Some(v.into());
2891        self
2892    }
2893
2894    /// Sets or clears the value of [start_time_offset][crate::model::SpriteSheet::start_time_offset].
2895    ///
2896    /// # Example
2897    /// ```ignore,no_run
2898    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2899    /// use wkt::Duration;
2900    /// let x = SpriteSheet::new().set_or_clear_start_time_offset(Some(Duration::default()/* use setters */));
2901    /// let x = SpriteSheet::new().set_or_clear_start_time_offset(None::<Duration>);
2902    /// ```
2903    pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
2904    where
2905        T: std::convert::Into<wkt::Duration>,
2906    {
2907        self.start_time_offset = v.map(|x| x.into());
2908        self
2909    }
2910
2911    /// Sets the value of [end_time_offset][crate::model::SpriteSheet::end_time_offset].
2912    ///
2913    /// # Example
2914    /// ```ignore,no_run
2915    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2916    /// use wkt::Duration;
2917    /// let x = SpriteSheet::new().set_end_time_offset(Duration::default()/* use setters */);
2918    /// ```
2919    pub fn set_end_time_offset<T>(mut self, v: T) -> Self
2920    where
2921        T: std::convert::Into<wkt::Duration>,
2922    {
2923        self.end_time_offset = std::option::Option::Some(v.into());
2924        self
2925    }
2926
2927    /// Sets or clears the value of [end_time_offset][crate::model::SpriteSheet::end_time_offset].
2928    ///
2929    /// # Example
2930    /// ```ignore,no_run
2931    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2932    /// use wkt::Duration;
2933    /// let x = SpriteSheet::new().set_or_clear_end_time_offset(Some(Duration::default()/* use setters */));
2934    /// let x = SpriteSheet::new().set_or_clear_end_time_offset(None::<Duration>);
2935    /// ```
2936    pub fn set_or_clear_end_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
2937    where
2938        T: std::convert::Into<wkt::Duration>,
2939    {
2940        self.end_time_offset = v.map(|x| x.into());
2941        self
2942    }
2943
2944    /// Sets the value of [quality][crate::model::SpriteSheet::quality].
2945    ///
2946    /// # Example
2947    /// ```ignore,no_run
2948    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2949    /// let x = SpriteSheet::new().set_quality(42);
2950    /// ```
2951    pub fn set_quality<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2952        self.quality = v.into();
2953        self
2954    }
2955
2956    /// Sets the value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy].
2957    ///
2958    /// Note that all the setters affecting `extraction_strategy` are mutually
2959    /// exclusive.
2960    ///
2961    /// # Example
2962    /// ```ignore,no_run
2963    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2964    /// use google_cloud_video_transcoder_v1::model::sprite_sheet::ExtractionStrategy;
2965    /// let x = SpriteSheet::new().set_extraction_strategy(Some(ExtractionStrategy::TotalCount(42)));
2966    /// ```
2967    pub fn set_extraction_strategy<
2968        T: std::convert::Into<std::option::Option<crate::model::sprite_sheet::ExtractionStrategy>>,
2969    >(
2970        mut self,
2971        v: T,
2972    ) -> Self {
2973        self.extraction_strategy = v.into();
2974        self
2975    }
2976
2977    /// The value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy]
2978    /// if it holds a `TotalCount`, `None` if the field is not set or
2979    /// holds a different branch.
2980    pub fn total_count(&self) -> std::option::Option<&i32> {
2981        #[allow(unreachable_patterns)]
2982        self.extraction_strategy.as_ref().and_then(|v| match v {
2983            crate::model::sprite_sheet::ExtractionStrategy::TotalCount(v) => {
2984                std::option::Option::Some(v)
2985            }
2986            _ => std::option::Option::None,
2987        })
2988    }
2989
2990    /// Sets the value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy]
2991    /// to hold a `TotalCount`.
2992    ///
2993    /// Note that all the setters affecting `extraction_strategy` are
2994    /// mutually exclusive.
2995    ///
2996    /// # Example
2997    /// ```ignore,no_run
2998    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2999    /// let x = SpriteSheet::new().set_total_count(42);
3000    /// assert!(x.total_count().is_some());
3001    /// assert!(x.interval().is_none());
3002    /// ```
3003    pub fn set_total_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3004        self.extraction_strategy = std::option::Option::Some(
3005            crate::model::sprite_sheet::ExtractionStrategy::TotalCount(v.into()),
3006        );
3007        self
3008    }
3009
3010    /// The value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy]
3011    /// if it holds a `Interval`, `None` if the field is not set or
3012    /// holds a different branch.
3013    pub fn interval(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
3014        #[allow(unreachable_patterns)]
3015        self.extraction_strategy.as_ref().and_then(|v| match v {
3016            crate::model::sprite_sheet::ExtractionStrategy::Interval(v) => {
3017                std::option::Option::Some(v)
3018            }
3019            _ => std::option::Option::None,
3020        })
3021    }
3022
3023    /// Sets the value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy]
3024    /// to hold a `Interval`.
3025    ///
3026    /// Note that all the setters affecting `extraction_strategy` are
3027    /// mutually exclusive.
3028    ///
3029    /// # Example
3030    /// ```ignore,no_run
3031    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
3032    /// use wkt::Duration;
3033    /// let x = SpriteSheet::new().set_interval(Duration::default()/* use setters */);
3034    /// assert!(x.interval().is_some());
3035    /// assert!(x.total_count().is_none());
3036    /// ```
3037    pub fn set_interval<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
3038        mut self,
3039        v: T,
3040    ) -> Self {
3041        self.extraction_strategy = std::option::Option::Some(
3042            crate::model::sprite_sheet::ExtractionStrategy::Interval(v.into()),
3043        );
3044        self
3045    }
3046}
3047
3048impl wkt::message::Message for SpriteSheet {
3049    fn typename() -> &'static str {
3050        "type.googleapis.com/google.cloud.video.transcoder.v1.SpriteSheet"
3051    }
3052}
3053
3054/// Defines additional types related to [SpriteSheet].
3055pub mod sprite_sheet {
3056    #[allow(unused_imports)]
3057    use super::*;
3058
3059    /// Specify either total number of sprites or interval to create sprites.
3060    #[derive(Clone, Debug, PartialEq)]
3061    #[non_exhaustive]
3062    pub enum ExtractionStrategy {
3063        /// Total number of sprites. Create the specified number of sprites
3064        /// distributed evenly across the timeline of the output media. The default
3065        /// is 100.
3066        TotalCount(i32),
3067        /// Starting from `0s`, create sprites at regular intervals. Specify the
3068        /// interval value in seconds.
3069        Interval(std::boxed::Box<wkt::Duration>),
3070    }
3071}
3072
3073/// Overlay configuration.
3074#[derive(Clone, Default, PartialEq)]
3075#[non_exhaustive]
3076pub struct Overlay {
3077    /// Image overlay.
3078    pub image: std::option::Option<crate::model::overlay::Image>,
3079
3080    /// List of animations. The list should be chronological, without any time
3081    /// overlap.
3082    pub animations: std::vec::Vec<crate::model::overlay::Animation>,
3083
3084    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3085}
3086
3087impl Overlay {
3088    pub fn new() -> Self {
3089        std::default::Default::default()
3090    }
3091
3092    /// Sets the value of [image][crate::model::Overlay::image].
3093    ///
3094    /// # Example
3095    /// ```ignore,no_run
3096    /// # use google_cloud_video_transcoder_v1::model::Overlay;
3097    /// use google_cloud_video_transcoder_v1::model::overlay::Image;
3098    /// let x = Overlay::new().set_image(Image::default()/* use setters */);
3099    /// ```
3100    pub fn set_image<T>(mut self, v: T) -> Self
3101    where
3102        T: std::convert::Into<crate::model::overlay::Image>,
3103    {
3104        self.image = std::option::Option::Some(v.into());
3105        self
3106    }
3107
3108    /// Sets or clears the value of [image][crate::model::Overlay::image].
3109    ///
3110    /// # Example
3111    /// ```ignore,no_run
3112    /// # use google_cloud_video_transcoder_v1::model::Overlay;
3113    /// use google_cloud_video_transcoder_v1::model::overlay::Image;
3114    /// let x = Overlay::new().set_or_clear_image(Some(Image::default()/* use setters */));
3115    /// let x = Overlay::new().set_or_clear_image(None::<Image>);
3116    /// ```
3117    pub fn set_or_clear_image<T>(mut self, v: std::option::Option<T>) -> Self
3118    where
3119        T: std::convert::Into<crate::model::overlay::Image>,
3120    {
3121        self.image = v.map(|x| x.into());
3122        self
3123    }
3124
3125    /// Sets the value of [animations][crate::model::Overlay::animations].
3126    ///
3127    /// # Example
3128    /// ```ignore,no_run
3129    /// # use google_cloud_video_transcoder_v1::model::Overlay;
3130    /// use google_cloud_video_transcoder_v1::model::overlay::Animation;
3131    /// let x = Overlay::new()
3132    ///     .set_animations([
3133    ///         Animation::default()/* use setters */,
3134    ///         Animation::default()/* use (different) setters */,
3135    ///     ]);
3136    /// ```
3137    pub fn set_animations<T, V>(mut self, v: T) -> Self
3138    where
3139        T: std::iter::IntoIterator<Item = V>,
3140        V: std::convert::Into<crate::model::overlay::Animation>,
3141    {
3142        use std::iter::Iterator;
3143        self.animations = v.into_iter().map(|i| i.into()).collect();
3144        self
3145    }
3146}
3147
3148impl wkt::message::Message for Overlay {
3149    fn typename() -> &'static str {
3150        "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay"
3151    }
3152}
3153
3154/// Defines additional types related to [Overlay].
3155pub mod overlay {
3156    #[allow(unused_imports)]
3157    use super::*;
3158
3159    /// 2D normalized coordinates. Default: `{0.0, 0.0}`
3160    #[derive(Clone, Default, PartialEq)]
3161    #[non_exhaustive]
3162    pub struct NormalizedCoordinate {
3163        /// Normalized x coordinate.
3164        pub x: f64,
3165
3166        /// Normalized y coordinate.
3167        pub y: f64,
3168
3169        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3170    }
3171
3172    impl NormalizedCoordinate {
3173        pub fn new() -> Self {
3174            std::default::Default::default()
3175        }
3176
3177        /// Sets the value of [x][crate::model::overlay::NormalizedCoordinate::x].
3178        ///
3179        /// # Example
3180        /// ```ignore,no_run
3181        /// # use google_cloud_video_transcoder_v1::model::overlay::NormalizedCoordinate;
3182        /// let x = NormalizedCoordinate::new().set_x(42.0);
3183        /// ```
3184        pub fn set_x<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
3185            self.x = v.into();
3186            self
3187        }
3188
3189        /// Sets the value of [y][crate::model::overlay::NormalizedCoordinate::y].
3190        ///
3191        /// # Example
3192        /// ```ignore,no_run
3193        /// # use google_cloud_video_transcoder_v1::model::overlay::NormalizedCoordinate;
3194        /// let x = NormalizedCoordinate::new().set_y(42.0);
3195        /// ```
3196        pub fn set_y<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
3197            self.y = v.into();
3198            self
3199        }
3200    }
3201
3202    impl wkt::message::Message for NormalizedCoordinate {
3203        fn typename() -> &'static str {
3204            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate"
3205        }
3206    }
3207
3208    /// Overlaid image.
3209    #[derive(Clone, Default, PartialEq)]
3210    #[non_exhaustive]
3211    pub struct Image {
3212        /// Required. URI of the image in Cloud Storage. For example,
3213        /// `gs://bucket/inputs/image.png`. Only PNG and JPEG images are supported.
3214        pub uri: std::string::String,
3215
3216        /// Normalized image resolution, based on output video resolution. Valid
3217        /// values: `0.0`–`1.0`. To respect the original image aspect ratio, set
3218        /// either `x` or `y` to `0.0`. To use the original image resolution, set
3219        /// both `x` and `y` to `0.0`.
3220        pub resolution: std::option::Option<crate::model::overlay::NormalizedCoordinate>,
3221
3222        /// Target image opacity. Valid values are from  `1.0` (solid, default) to
3223        /// `0.0` (transparent), exclusive. Set this to a value greater than `0.0`.
3224        pub alpha: f64,
3225
3226        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3227    }
3228
3229    impl Image {
3230        pub fn new() -> Self {
3231            std::default::Default::default()
3232        }
3233
3234        /// Sets the value of [uri][crate::model::overlay::Image::uri].
3235        ///
3236        /// # Example
3237        /// ```ignore,no_run
3238        /// # use google_cloud_video_transcoder_v1::model::overlay::Image;
3239        /// let x = Image::new().set_uri("example");
3240        /// ```
3241        pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3242            self.uri = v.into();
3243            self
3244        }
3245
3246        /// Sets the value of [resolution][crate::model::overlay::Image::resolution].
3247        ///
3248        /// # Example
3249        /// ```ignore,no_run
3250        /// # use google_cloud_video_transcoder_v1::model::overlay::Image;
3251        /// use google_cloud_video_transcoder_v1::model::overlay::NormalizedCoordinate;
3252        /// let x = Image::new().set_resolution(NormalizedCoordinate::default()/* use setters */);
3253        /// ```
3254        pub fn set_resolution<T>(mut self, v: T) -> Self
3255        where
3256            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
3257        {
3258            self.resolution = std::option::Option::Some(v.into());
3259            self
3260        }
3261
3262        /// Sets or clears the value of [resolution][crate::model::overlay::Image::resolution].
3263        ///
3264        /// # Example
3265        /// ```ignore,no_run
3266        /// # use google_cloud_video_transcoder_v1::model::overlay::Image;
3267        /// use google_cloud_video_transcoder_v1::model::overlay::NormalizedCoordinate;
3268        /// let x = Image::new().set_or_clear_resolution(Some(NormalizedCoordinate::default()/* use setters */));
3269        /// let x = Image::new().set_or_clear_resolution(None::<NormalizedCoordinate>);
3270        /// ```
3271        pub fn set_or_clear_resolution<T>(mut self, v: std::option::Option<T>) -> Self
3272        where
3273            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
3274        {
3275            self.resolution = v.map(|x| x.into());
3276            self
3277        }
3278
3279        /// Sets the value of [alpha][crate::model::overlay::Image::alpha].
3280        ///
3281        /// # Example
3282        /// ```ignore,no_run
3283        /// # use google_cloud_video_transcoder_v1::model::overlay::Image;
3284        /// let x = Image::new().set_alpha(42.0);
3285        /// ```
3286        pub fn set_alpha<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
3287            self.alpha = v.into();
3288            self
3289        }
3290    }
3291
3292    impl wkt::message::Message for Image {
3293        fn typename() -> &'static str {
3294            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.Image"
3295        }
3296    }
3297
3298    /// Display static overlay object.
3299    #[derive(Clone, Default, PartialEq)]
3300    #[non_exhaustive]
3301    pub struct AnimationStatic {
3302        /// Normalized coordinates based on output video resolution. Valid
3303        /// values: `0.0`–`1.0`. `xy` is the upper-left coordinate of the overlay
3304        /// object. For example, use the x and y coordinates {0,0} to position the
3305        /// top-left corner of the overlay animation in the top-left corner of the
3306        /// output video.
3307        pub xy: std::option::Option<crate::model::overlay::NormalizedCoordinate>,
3308
3309        /// The time to start displaying the overlay object, in seconds. Default: 0
3310        pub start_time_offset: std::option::Option<wkt::Duration>,
3311
3312        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3313    }
3314
3315    impl AnimationStatic {
3316        pub fn new() -> Self {
3317            std::default::Default::default()
3318        }
3319
3320        /// Sets the value of [xy][crate::model::overlay::AnimationStatic::xy].
3321        ///
3322        /// # Example
3323        /// ```ignore,no_run
3324        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationStatic;
3325        /// use google_cloud_video_transcoder_v1::model::overlay::NormalizedCoordinate;
3326        /// let x = AnimationStatic::new().set_xy(NormalizedCoordinate::default()/* use setters */);
3327        /// ```
3328        pub fn set_xy<T>(mut self, v: T) -> Self
3329        where
3330            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
3331        {
3332            self.xy = std::option::Option::Some(v.into());
3333            self
3334        }
3335
3336        /// Sets or clears the value of [xy][crate::model::overlay::AnimationStatic::xy].
3337        ///
3338        /// # Example
3339        /// ```ignore,no_run
3340        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationStatic;
3341        /// use google_cloud_video_transcoder_v1::model::overlay::NormalizedCoordinate;
3342        /// let x = AnimationStatic::new().set_or_clear_xy(Some(NormalizedCoordinate::default()/* use setters */));
3343        /// let x = AnimationStatic::new().set_or_clear_xy(None::<NormalizedCoordinate>);
3344        /// ```
3345        pub fn set_or_clear_xy<T>(mut self, v: std::option::Option<T>) -> Self
3346        where
3347            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
3348        {
3349            self.xy = v.map(|x| x.into());
3350            self
3351        }
3352
3353        /// Sets the value of [start_time_offset][crate::model::overlay::AnimationStatic::start_time_offset].
3354        ///
3355        /// # Example
3356        /// ```ignore,no_run
3357        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationStatic;
3358        /// use wkt::Duration;
3359        /// let x = AnimationStatic::new().set_start_time_offset(Duration::default()/* use setters */);
3360        /// ```
3361        pub fn set_start_time_offset<T>(mut self, v: T) -> Self
3362        where
3363            T: std::convert::Into<wkt::Duration>,
3364        {
3365            self.start_time_offset = std::option::Option::Some(v.into());
3366            self
3367        }
3368
3369        /// Sets or clears the value of [start_time_offset][crate::model::overlay::AnimationStatic::start_time_offset].
3370        ///
3371        /// # Example
3372        /// ```ignore,no_run
3373        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationStatic;
3374        /// use wkt::Duration;
3375        /// let x = AnimationStatic::new().set_or_clear_start_time_offset(Some(Duration::default()/* use setters */));
3376        /// let x = AnimationStatic::new().set_or_clear_start_time_offset(None::<Duration>);
3377        /// ```
3378        pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
3379        where
3380            T: std::convert::Into<wkt::Duration>,
3381        {
3382            self.start_time_offset = v.map(|x| x.into());
3383            self
3384        }
3385    }
3386
3387    impl wkt::message::Message for AnimationStatic {
3388        fn typename() -> &'static str {
3389            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.AnimationStatic"
3390        }
3391    }
3392
3393    /// Display overlay object with fade animation.
3394    #[derive(Clone, Default, PartialEq)]
3395    #[non_exhaustive]
3396    pub struct AnimationFade {
3397        /// Required. Type of fade animation: `FADE_IN` or `FADE_OUT`.
3398        pub fade_type: crate::model::overlay::FadeType,
3399
3400        /// Normalized coordinates based on output video resolution. Valid
3401        /// values: `0.0`–`1.0`. `xy` is the upper-left coordinate of the overlay
3402        /// object. For example, use the x and y coordinates {0,0} to position the
3403        /// top-left corner of the overlay animation in the top-left corner of the
3404        /// output video.
3405        pub xy: std::option::Option<crate::model::overlay::NormalizedCoordinate>,
3406
3407        /// The time to start the fade animation, in seconds. Default: 0
3408        pub start_time_offset: std::option::Option<wkt::Duration>,
3409
3410        /// The time to end the fade animation, in seconds. Default:
3411        /// `start_time_offset` + 1s
3412        pub end_time_offset: std::option::Option<wkt::Duration>,
3413
3414        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3415    }
3416
3417    impl AnimationFade {
3418        pub fn new() -> Self {
3419            std::default::Default::default()
3420        }
3421
3422        /// Sets the value of [fade_type][crate::model::overlay::AnimationFade::fade_type].
3423        ///
3424        /// # Example
3425        /// ```ignore,no_run
3426        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationFade;
3427        /// use google_cloud_video_transcoder_v1::model::overlay::FadeType;
3428        /// let x0 = AnimationFade::new().set_fade_type(FadeType::FadeIn);
3429        /// let x1 = AnimationFade::new().set_fade_type(FadeType::FadeOut);
3430        /// ```
3431        pub fn set_fade_type<T: std::convert::Into<crate::model::overlay::FadeType>>(
3432            mut self,
3433            v: T,
3434        ) -> Self {
3435            self.fade_type = v.into();
3436            self
3437        }
3438
3439        /// Sets the value of [xy][crate::model::overlay::AnimationFade::xy].
3440        ///
3441        /// # Example
3442        /// ```ignore,no_run
3443        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationFade;
3444        /// use google_cloud_video_transcoder_v1::model::overlay::NormalizedCoordinate;
3445        /// let x = AnimationFade::new().set_xy(NormalizedCoordinate::default()/* use setters */);
3446        /// ```
3447        pub fn set_xy<T>(mut self, v: T) -> Self
3448        where
3449            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
3450        {
3451            self.xy = std::option::Option::Some(v.into());
3452            self
3453        }
3454
3455        /// Sets or clears the value of [xy][crate::model::overlay::AnimationFade::xy].
3456        ///
3457        /// # Example
3458        /// ```ignore,no_run
3459        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationFade;
3460        /// use google_cloud_video_transcoder_v1::model::overlay::NormalizedCoordinate;
3461        /// let x = AnimationFade::new().set_or_clear_xy(Some(NormalizedCoordinate::default()/* use setters */));
3462        /// let x = AnimationFade::new().set_or_clear_xy(None::<NormalizedCoordinate>);
3463        /// ```
3464        pub fn set_or_clear_xy<T>(mut self, v: std::option::Option<T>) -> Self
3465        where
3466            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
3467        {
3468            self.xy = v.map(|x| x.into());
3469            self
3470        }
3471
3472        /// Sets the value of [start_time_offset][crate::model::overlay::AnimationFade::start_time_offset].
3473        ///
3474        /// # Example
3475        /// ```ignore,no_run
3476        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationFade;
3477        /// use wkt::Duration;
3478        /// let x = AnimationFade::new().set_start_time_offset(Duration::default()/* use setters */);
3479        /// ```
3480        pub fn set_start_time_offset<T>(mut self, v: T) -> Self
3481        where
3482            T: std::convert::Into<wkt::Duration>,
3483        {
3484            self.start_time_offset = std::option::Option::Some(v.into());
3485            self
3486        }
3487
3488        /// Sets or clears the value of [start_time_offset][crate::model::overlay::AnimationFade::start_time_offset].
3489        ///
3490        /// # Example
3491        /// ```ignore,no_run
3492        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationFade;
3493        /// use wkt::Duration;
3494        /// let x = AnimationFade::new().set_or_clear_start_time_offset(Some(Duration::default()/* use setters */));
3495        /// let x = AnimationFade::new().set_or_clear_start_time_offset(None::<Duration>);
3496        /// ```
3497        pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
3498        where
3499            T: std::convert::Into<wkt::Duration>,
3500        {
3501            self.start_time_offset = v.map(|x| x.into());
3502            self
3503        }
3504
3505        /// Sets the value of [end_time_offset][crate::model::overlay::AnimationFade::end_time_offset].
3506        ///
3507        /// # Example
3508        /// ```ignore,no_run
3509        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationFade;
3510        /// use wkt::Duration;
3511        /// let x = AnimationFade::new().set_end_time_offset(Duration::default()/* use setters */);
3512        /// ```
3513        pub fn set_end_time_offset<T>(mut self, v: T) -> Self
3514        where
3515            T: std::convert::Into<wkt::Duration>,
3516        {
3517            self.end_time_offset = std::option::Option::Some(v.into());
3518            self
3519        }
3520
3521        /// Sets or clears the value of [end_time_offset][crate::model::overlay::AnimationFade::end_time_offset].
3522        ///
3523        /// # Example
3524        /// ```ignore,no_run
3525        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationFade;
3526        /// use wkt::Duration;
3527        /// let x = AnimationFade::new().set_or_clear_end_time_offset(Some(Duration::default()/* use setters */));
3528        /// let x = AnimationFade::new().set_or_clear_end_time_offset(None::<Duration>);
3529        /// ```
3530        pub fn set_or_clear_end_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
3531        where
3532            T: std::convert::Into<wkt::Duration>,
3533        {
3534            self.end_time_offset = v.map(|x| x.into());
3535            self
3536        }
3537    }
3538
3539    impl wkt::message::Message for AnimationFade {
3540        fn typename() -> &'static str {
3541            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.AnimationFade"
3542        }
3543    }
3544
3545    /// End previous overlay animation from the video. Without `AnimationEnd`, the
3546    /// overlay object will keep the state of previous animation until the end of
3547    /// the video.
3548    #[derive(Clone, Default, PartialEq)]
3549    #[non_exhaustive]
3550    pub struct AnimationEnd {
3551        /// The time to end overlay object, in seconds. Default: 0
3552        pub start_time_offset: std::option::Option<wkt::Duration>,
3553
3554        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3555    }
3556
3557    impl AnimationEnd {
3558        pub fn new() -> Self {
3559            std::default::Default::default()
3560        }
3561
3562        /// Sets the value of [start_time_offset][crate::model::overlay::AnimationEnd::start_time_offset].
3563        ///
3564        /// # Example
3565        /// ```ignore,no_run
3566        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationEnd;
3567        /// use wkt::Duration;
3568        /// let x = AnimationEnd::new().set_start_time_offset(Duration::default()/* use setters */);
3569        /// ```
3570        pub fn set_start_time_offset<T>(mut self, v: T) -> Self
3571        where
3572            T: std::convert::Into<wkt::Duration>,
3573        {
3574            self.start_time_offset = std::option::Option::Some(v.into());
3575            self
3576        }
3577
3578        /// Sets or clears the value of [start_time_offset][crate::model::overlay::AnimationEnd::start_time_offset].
3579        ///
3580        /// # Example
3581        /// ```ignore,no_run
3582        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationEnd;
3583        /// use wkt::Duration;
3584        /// let x = AnimationEnd::new().set_or_clear_start_time_offset(Some(Duration::default()/* use setters */));
3585        /// let x = AnimationEnd::new().set_or_clear_start_time_offset(None::<Duration>);
3586        /// ```
3587        pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
3588        where
3589            T: std::convert::Into<wkt::Duration>,
3590        {
3591            self.start_time_offset = v.map(|x| x.into());
3592            self
3593        }
3594    }
3595
3596    impl wkt::message::Message for AnimationEnd {
3597        fn typename() -> &'static str {
3598            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.AnimationEnd"
3599        }
3600    }
3601
3602    /// Animation types.
3603    #[derive(Clone, Default, PartialEq)]
3604    #[non_exhaustive]
3605    pub struct Animation {
3606        /// Animations can be static or fade, or they can end the previous animation.
3607        pub animation_type: std::option::Option<crate::model::overlay::animation::AnimationType>,
3608
3609        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3610    }
3611
3612    impl Animation {
3613        pub fn new() -> Self {
3614            std::default::Default::default()
3615        }
3616
3617        /// Sets the value of [animation_type][crate::model::overlay::Animation::animation_type].
3618        ///
3619        /// Note that all the setters affecting `animation_type` are mutually
3620        /// exclusive.
3621        ///
3622        /// # Example
3623        /// ```ignore,no_run
3624        /// # use google_cloud_video_transcoder_v1::model::overlay::Animation;
3625        /// use google_cloud_video_transcoder_v1::model::overlay::AnimationStatic;
3626        /// let x = Animation::new().set_animation_type(Some(
3627        ///     google_cloud_video_transcoder_v1::model::overlay::animation::AnimationType::AnimationStatic(AnimationStatic::default().into())));
3628        /// ```
3629        pub fn set_animation_type<
3630            T: std::convert::Into<
3631                    std::option::Option<crate::model::overlay::animation::AnimationType>,
3632                >,
3633        >(
3634            mut self,
3635            v: T,
3636        ) -> Self {
3637            self.animation_type = v.into();
3638            self
3639        }
3640
3641        /// The value of [animation_type][crate::model::overlay::Animation::animation_type]
3642        /// if it holds a `AnimationStatic`, `None` if the field is not set or
3643        /// holds a different branch.
3644        pub fn animation_static(
3645            &self,
3646        ) -> std::option::Option<&std::boxed::Box<crate::model::overlay::AnimationStatic>> {
3647            #[allow(unreachable_patterns)]
3648            self.animation_type.as_ref().and_then(|v| match v {
3649                crate::model::overlay::animation::AnimationType::AnimationStatic(v) => {
3650                    std::option::Option::Some(v)
3651                }
3652                _ => std::option::Option::None,
3653            })
3654        }
3655
3656        /// Sets the value of [animation_type][crate::model::overlay::Animation::animation_type]
3657        /// to hold a `AnimationStatic`.
3658        ///
3659        /// Note that all the setters affecting `animation_type` are
3660        /// mutually exclusive.
3661        ///
3662        /// # Example
3663        /// ```ignore,no_run
3664        /// # use google_cloud_video_transcoder_v1::model::overlay::Animation;
3665        /// use google_cloud_video_transcoder_v1::model::overlay::AnimationStatic;
3666        /// let x = Animation::new().set_animation_static(AnimationStatic::default()/* use setters */);
3667        /// assert!(x.animation_static().is_some());
3668        /// assert!(x.animation_fade().is_none());
3669        /// assert!(x.animation_end().is_none());
3670        /// ```
3671        pub fn set_animation_static<
3672            T: std::convert::Into<std::boxed::Box<crate::model::overlay::AnimationStatic>>,
3673        >(
3674            mut self,
3675            v: T,
3676        ) -> Self {
3677            self.animation_type = std::option::Option::Some(
3678                crate::model::overlay::animation::AnimationType::AnimationStatic(v.into()),
3679            );
3680            self
3681        }
3682
3683        /// The value of [animation_type][crate::model::overlay::Animation::animation_type]
3684        /// if it holds a `AnimationFade`, `None` if the field is not set or
3685        /// holds a different branch.
3686        pub fn animation_fade(
3687            &self,
3688        ) -> std::option::Option<&std::boxed::Box<crate::model::overlay::AnimationFade>> {
3689            #[allow(unreachable_patterns)]
3690            self.animation_type.as_ref().and_then(|v| match v {
3691                crate::model::overlay::animation::AnimationType::AnimationFade(v) => {
3692                    std::option::Option::Some(v)
3693                }
3694                _ => std::option::Option::None,
3695            })
3696        }
3697
3698        /// Sets the value of [animation_type][crate::model::overlay::Animation::animation_type]
3699        /// to hold a `AnimationFade`.
3700        ///
3701        /// Note that all the setters affecting `animation_type` are
3702        /// mutually exclusive.
3703        ///
3704        /// # Example
3705        /// ```ignore,no_run
3706        /// # use google_cloud_video_transcoder_v1::model::overlay::Animation;
3707        /// use google_cloud_video_transcoder_v1::model::overlay::AnimationFade;
3708        /// let x = Animation::new().set_animation_fade(AnimationFade::default()/* use setters */);
3709        /// assert!(x.animation_fade().is_some());
3710        /// assert!(x.animation_static().is_none());
3711        /// assert!(x.animation_end().is_none());
3712        /// ```
3713        pub fn set_animation_fade<
3714            T: std::convert::Into<std::boxed::Box<crate::model::overlay::AnimationFade>>,
3715        >(
3716            mut self,
3717            v: T,
3718        ) -> Self {
3719            self.animation_type = std::option::Option::Some(
3720                crate::model::overlay::animation::AnimationType::AnimationFade(v.into()),
3721            );
3722            self
3723        }
3724
3725        /// The value of [animation_type][crate::model::overlay::Animation::animation_type]
3726        /// if it holds a `AnimationEnd`, `None` if the field is not set or
3727        /// holds a different branch.
3728        pub fn animation_end(
3729            &self,
3730        ) -> std::option::Option<&std::boxed::Box<crate::model::overlay::AnimationEnd>> {
3731            #[allow(unreachable_patterns)]
3732            self.animation_type.as_ref().and_then(|v| match v {
3733                crate::model::overlay::animation::AnimationType::AnimationEnd(v) => {
3734                    std::option::Option::Some(v)
3735                }
3736                _ => std::option::Option::None,
3737            })
3738        }
3739
3740        /// Sets the value of [animation_type][crate::model::overlay::Animation::animation_type]
3741        /// to hold a `AnimationEnd`.
3742        ///
3743        /// Note that all the setters affecting `animation_type` are
3744        /// mutually exclusive.
3745        ///
3746        /// # Example
3747        /// ```ignore,no_run
3748        /// # use google_cloud_video_transcoder_v1::model::overlay::Animation;
3749        /// use google_cloud_video_transcoder_v1::model::overlay::AnimationEnd;
3750        /// let x = Animation::new().set_animation_end(AnimationEnd::default()/* use setters */);
3751        /// assert!(x.animation_end().is_some());
3752        /// assert!(x.animation_static().is_none());
3753        /// assert!(x.animation_fade().is_none());
3754        /// ```
3755        pub fn set_animation_end<
3756            T: std::convert::Into<std::boxed::Box<crate::model::overlay::AnimationEnd>>,
3757        >(
3758            mut self,
3759            v: T,
3760        ) -> Self {
3761            self.animation_type = std::option::Option::Some(
3762                crate::model::overlay::animation::AnimationType::AnimationEnd(v.into()),
3763            );
3764            self
3765        }
3766    }
3767
3768    impl wkt::message::Message for Animation {
3769        fn typename() -> &'static str {
3770            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.Animation"
3771        }
3772    }
3773
3774    /// Defines additional types related to [Animation].
3775    pub mod animation {
3776        #[allow(unused_imports)]
3777        use super::*;
3778
3779        /// Animations can be static or fade, or they can end the previous animation.
3780        #[derive(Clone, Debug, PartialEq)]
3781        #[non_exhaustive]
3782        pub enum AnimationType {
3783            /// Display static overlay object.
3784            AnimationStatic(std::boxed::Box<crate::model::overlay::AnimationStatic>),
3785            /// Display overlay object with fade animation.
3786            AnimationFade(std::boxed::Box<crate::model::overlay::AnimationFade>),
3787            /// End previous animation.
3788            AnimationEnd(std::boxed::Box<crate::model::overlay::AnimationEnd>),
3789        }
3790    }
3791
3792    /// Fade type for the overlay: `FADE_IN` or `FADE_OUT`.
3793    ///
3794    /// # Working with unknown values
3795    ///
3796    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3797    /// additional enum variants at any time. Adding new variants is not considered
3798    /// a breaking change. Applications should write their code in anticipation of:
3799    ///
3800    /// - New values appearing in future releases of the client library, **and**
3801    /// - New values received dynamically, without application changes.
3802    ///
3803    /// Please consult the [Working with enums] section in the user guide for some
3804    /// guidelines.
3805    ///
3806    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3807    #[derive(Clone, Debug, PartialEq)]
3808    #[non_exhaustive]
3809    pub enum FadeType {
3810        /// The fade type is not specified.
3811        Unspecified,
3812        /// Fade the overlay object into view.
3813        FadeIn,
3814        /// Fade the overlay object out of view.
3815        FadeOut,
3816        /// If set, the enum was initialized with an unknown value.
3817        ///
3818        /// Applications can examine the value using [FadeType::value] or
3819        /// [FadeType::name].
3820        UnknownValue(fade_type::UnknownValue),
3821    }
3822
3823    #[doc(hidden)]
3824    pub mod fade_type {
3825        #[allow(unused_imports)]
3826        use super::*;
3827        #[derive(Clone, Debug, PartialEq)]
3828        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3829    }
3830
3831    impl FadeType {
3832        /// Gets the enum value.
3833        ///
3834        /// Returns `None` if the enum contains an unknown value deserialized from
3835        /// the string representation of enums.
3836        pub fn value(&self) -> std::option::Option<i32> {
3837            match self {
3838                Self::Unspecified => std::option::Option::Some(0),
3839                Self::FadeIn => std::option::Option::Some(1),
3840                Self::FadeOut => std::option::Option::Some(2),
3841                Self::UnknownValue(u) => u.0.value(),
3842            }
3843        }
3844
3845        /// Gets the enum value as a string.
3846        ///
3847        /// Returns `None` if the enum contains an unknown value deserialized from
3848        /// the integer representation of enums.
3849        pub fn name(&self) -> std::option::Option<&str> {
3850            match self {
3851                Self::Unspecified => std::option::Option::Some("FADE_TYPE_UNSPECIFIED"),
3852                Self::FadeIn => std::option::Option::Some("FADE_IN"),
3853                Self::FadeOut => std::option::Option::Some("FADE_OUT"),
3854                Self::UnknownValue(u) => u.0.name(),
3855            }
3856        }
3857    }
3858
3859    impl std::default::Default for FadeType {
3860        fn default() -> Self {
3861            use std::convert::From;
3862            Self::from(0)
3863        }
3864    }
3865
3866    impl std::fmt::Display for FadeType {
3867        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3868            wkt::internal::display_enum(f, self.name(), self.value())
3869        }
3870    }
3871
3872    impl std::convert::From<i32> for FadeType {
3873        fn from(value: i32) -> Self {
3874            match value {
3875                0 => Self::Unspecified,
3876                1 => Self::FadeIn,
3877                2 => Self::FadeOut,
3878                _ => Self::UnknownValue(fade_type::UnknownValue(
3879                    wkt::internal::UnknownEnumValue::Integer(value),
3880                )),
3881            }
3882        }
3883    }
3884
3885    impl std::convert::From<&str> for FadeType {
3886        fn from(value: &str) -> Self {
3887            use std::string::ToString;
3888            match value {
3889                "FADE_TYPE_UNSPECIFIED" => Self::Unspecified,
3890                "FADE_IN" => Self::FadeIn,
3891                "FADE_OUT" => Self::FadeOut,
3892                _ => Self::UnknownValue(fade_type::UnknownValue(
3893                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3894                )),
3895            }
3896        }
3897    }
3898
3899    impl serde::ser::Serialize for FadeType {
3900        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3901        where
3902            S: serde::Serializer,
3903        {
3904            match self {
3905                Self::Unspecified => serializer.serialize_i32(0),
3906                Self::FadeIn => serializer.serialize_i32(1),
3907                Self::FadeOut => serializer.serialize_i32(2),
3908                Self::UnknownValue(u) => u.0.serialize(serializer),
3909            }
3910        }
3911    }
3912
3913    impl<'de> serde::de::Deserialize<'de> for FadeType {
3914        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3915        where
3916            D: serde::Deserializer<'de>,
3917        {
3918            deserializer.deserialize_any(wkt::internal::EnumVisitor::<FadeType>::new(
3919                ".google.cloud.video.transcoder.v1.Overlay.FadeType",
3920            ))
3921        }
3922    }
3923}
3924
3925/// Preprocessing configurations.
3926#[derive(Clone, Default, PartialEq)]
3927#[non_exhaustive]
3928pub struct PreprocessingConfig {
3929    /// Color preprocessing configuration.
3930    pub color: std::option::Option<crate::model::preprocessing_config::Color>,
3931
3932    /// Denoise preprocessing configuration.
3933    pub denoise: std::option::Option<crate::model::preprocessing_config::Denoise>,
3934
3935    /// Deblock preprocessing configuration.
3936    pub deblock: std::option::Option<crate::model::preprocessing_config::Deblock>,
3937
3938    /// Audio preprocessing configuration.
3939    pub audio: std::option::Option<crate::model::preprocessing_config::Audio>,
3940
3941    /// Specify the video cropping configuration.
3942    pub crop: std::option::Option<crate::model::preprocessing_config::Crop>,
3943
3944    /// Specify the video pad filter configuration.
3945    pub pad: std::option::Option<crate::model::preprocessing_config::Pad>,
3946
3947    /// Specify the video deinterlace configuration.
3948    pub deinterlace: std::option::Option<crate::model::preprocessing_config::Deinterlace>,
3949
3950    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3951}
3952
3953impl PreprocessingConfig {
3954    pub fn new() -> Self {
3955        std::default::Default::default()
3956    }
3957
3958    /// Sets the value of [color][crate::model::PreprocessingConfig::color].
3959    ///
3960    /// # Example
3961    /// ```ignore,no_run
3962    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
3963    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Color;
3964    /// let x = PreprocessingConfig::new().set_color(Color::default()/* use setters */);
3965    /// ```
3966    pub fn set_color<T>(mut self, v: T) -> Self
3967    where
3968        T: std::convert::Into<crate::model::preprocessing_config::Color>,
3969    {
3970        self.color = std::option::Option::Some(v.into());
3971        self
3972    }
3973
3974    /// Sets or clears the value of [color][crate::model::PreprocessingConfig::color].
3975    ///
3976    /// # Example
3977    /// ```ignore,no_run
3978    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
3979    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Color;
3980    /// let x = PreprocessingConfig::new().set_or_clear_color(Some(Color::default()/* use setters */));
3981    /// let x = PreprocessingConfig::new().set_or_clear_color(None::<Color>);
3982    /// ```
3983    pub fn set_or_clear_color<T>(mut self, v: std::option::Option<T>) -> Self
3984    where
3985        T: std::convert::Into<crate::model::preprocessing_config::Color>,
3986    {
3987        self.color = v.map(|x| x.into());
3988        self
3989    }
3990
3991    /// Sets the value of [denoise][crate::model::PreprocessingConfig::denoise].
3992    ///
3993    /// # Example
3994    /// ```ignore,no_run
3995    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
3996    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Denoise;
3997    /// let x = PreprocessingConfig::new().set_denoise(Denoise::default()/* use setters */);
3998    /// ```
3999    pub fn set_denoise<T>(mut self, v: T) -> Self
4000    where
4001        T: std::convert::Into<crate::model::preprocessing_config::Denoise>,
4002    {
4003        self.denoise = std::option::Option::Some(v.into());
4004        self
4005    }
4006
4007    /// Sets or clears the value of [denoise][crate::model::PreprocessingConfig::denoise].
4008    ///
4009    /// # Example
4010    /// ```ignore,no_run
4011    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4012    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Denoise;
4013    /// let x = PreprocessingConfig::new().set_or_clear_denoise(Some(Denoise::default()/* use setters */));
4014    /// let x = PreprocessingConfig::new().set_or_clear_denoise(None::<Denoise>);
4015    /// ```
4016    pub fn set_or_clear_denoise<T>(mut self, v: std::option::Option<T>) -> Self
4017    where
4018        T: std::convert::Into<crate::model::preprocessing_config::Denoise>,
4019    {
4020        self.denoise = v.map(|x| x.into());
4021        self
4022    }
4023
4024    /// Sets the value of [deblock][crate::model::PreprocessingConfig::deblock].
4025    ///
4026    /// # Example
4027    /// ```ignore,no_run
4028    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4029    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Deblock;
4030    /// let x = PreprocessingConfig::new().set_deblock(Deblock::default()/* use setters */);
4031    /// ```
4032    pub fn set_deblock<T>(mut self, v: T) -> Self
4033    where
4034        T: std::convert::Into<crate::model::preprocessing_config::Deblock>,
4035    {
4036        self.deblock = std::option::Option::Some(v.into());
4037        self
4038    }
4039
4040    /// Sets or clears the value of [deblock][crate::model::PreprocessingConfig::deblock].
4041    ///
4042    /// # Example
4043    /// ```ignore,no_run
4044    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4045    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Deblock;
4046    /// let x = PreprocessingConfig::new().set_or_clear_deblock(Some(Deblock::default()/* use setters */));
4047    /// let x = PreprocessingConfig::new().set_or_clear_deblock(None::<Deblock>);
4048    /// ```
4049    pub fn set_or_clear_deblock<T>(mut self, v: std::option::Option<T>) -> Self
4050    where
4051        T: std::convert::Into<crate::model::preprocessing_config::Deblock>,
4052    {
4053        self.deblock = v.map(|x| x.into());
4054        self
4055    }
4056
4057    /// Sets the value of [audio][crate::model::PreprocessingConfig::audio].
4058    ///
4059    /// # Example
4060    /// ```ignore,no_run
4061    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4062    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Audio;
4063    /// let x = PreprocessingConfig::new().set_audio(Audio::default()/* use setters */);
4064    /// ```
4065    pub fn set_audio<T>(mut self, v: T) -> Self
4066    where
4067        T: std::convert::Into<crate::model::preprocessing_config::Audio>,
4068    {
4069        self.audio = std::option::Option::Some(v.into());
4070        self
4071    }
4072
4073    /// Sets or clears the value of [audio][crate::model::PreprocessingConfig::audio].
4074    ///
4075    /// # Example
4076    /// ```ignore,no_run
4077    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4078    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Audio;
4079    /// let x = PreprocessingConfig::new().set_or_clear_audio(Some(Audio::default()/* use setters */));
4080    /// let x = PreprocessingConfig::new().set_or_clear_audio(None::<Audio>);
4081    /// ```
4082    pub fn set_or_clear_audio<T>(mut self, v: std::option::Option<T>) -> Self
4083    where
4084        T: std::convert::Into<crate::model::preprocessing_config::Audio>,
4085    {
4086        self.audio = v.map(|x| x.into());
4087        self
4088    }
4089
4090    /// Sets the value of [crop][crate::model::PreprocessingConfig::crop].
4091    ///
4092    /// # Example
4093    /// ```ignore,no_run
4094    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4095    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Crop;
4096    /// let x = PreprocessingConfig::new().set_crop(Crop::default()/* use setters */);
4097    /// ```
4098    pub fn set_crop<T>(mut self, v: T) -> Self
4099    where
4100        T: std::convert::Into<crate::model::preprocessing_config::Crop>,
4101    {
4102        self.crop = std::option::Option::Some(v.into());
4103        self
4104    }
4105
4106    /// Sets or clears the value of [crop][crate::model::PreprocessingConfig::crop].
4107    ///
4108    /// # Example
4109    /// ```ignore,no_run
4110    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4111    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Crop;
4112    /// let x = PreprocessingConfig::new().set_or_clear_crop(Some(Crop::default()/* use setters */));
4113    /// let x = PreprocessingConfig::new().set_or_clear_crop(None::<Crop>);
4114    /// ```
4115    pub fn set_or_clear_crop<T>(mut self, v: std::option::Option<T>) -> Self
4116    where
4117        T: std::convert::Into<crate::model::preprocessing_config::Crop>,
4118    {
4119        self.crop = v.map(|x| x.into());
4120        self
4121    }
4122
4123    /// Sets the value of [pad][crate::model::PreprocessingConfig::pad].
4124    ///
4125    /// # Example
4126    /// ```ignore,no_run
4127    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4128    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Pad;
4129    /// let x = PreprocessingConfig::new().set_pad(Pad::default()/* use setters */);
4130    /// ```
4131    pub fn set_pad<T>(mut self, v: T) -> Self
4132    where
4133        T: std::convert::Into<crate::model::preprocessing_config::Pad>,
4134    {
4135        self.pad = std::option::Option::Some(v.into());
4136        self
4137    }
4138
4139    /// Sets or clears the value of [pad][crate::model::PreprocessingConfig::pad].
4140    ///
4141    /// # Example
4142    /// ```ignore,no_run
4143    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4144    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Pad;
4145    /// let x = PreprocessingConfig::new().set_or_clear_pad(Some(Pad::default()/* use setters */));
4146    /// let x = PreprocessingConfig::new().set_or_clear_pad(None::<Pad>);
4147    /// ```
4148    pub fn set_or_clear_pad<T>(mut self, v: std::option::Option<T>) -> Self
4149    where
4150        T: std::convert::Into<crate::model::preprocessing_config::Pad>,
4151    {
4152        self.pad = v.map(|x| x.into());
4153        self
4154    }
4155
4156    /// Sets the value of [deinterlace][crate::model::PreprocessingConfig::deinterlace].
4157    ///
4158    /// # Example
4159    /// ```ignore,no_run
4160    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4161    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Deinterlace;
4162    /// let x = PreprocessingConfig::new().set_deinterlace(Deinterlace::default()/* use setters */);
4163    /// ```
4164    pub fn set_deinterlace<T>(mut self, v: T) -> Self
4165    where
4166        T: std::convert::Into<crate::model::preprocessing_config::Deinterlace>,
4167    {
4168        self.deinterlace = std::option::Option::Some(v.into());
4169        self
4170    }
4171
4172    /// Sets or clears the value of [deinterlace][crate::model::PreprocessingConfig::deinterlace].
4173    ///
4174    /// # Example
4175    /// ```ignore,no_run
4176    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4177    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Deinterlace;
4178    /// let x = PreprocessingConfig::new().set_or_clear_deinterlace(Some(Deinterlace::default()/* use setters */));
4179    /// let x = PreprocessingConfig::new().set_or_clear_deinterlace(None::<Deinterlace>);
4180    /// ```
4181    pub fn set_or_clear_deinterlace<T>(mut self, v: std::option::Option<T>) -> Self
4182    where
4183        T: std::convert::Into<crate::model::preprocessing_config::Deinterlace>,
4184    {
4185        self.deinterlace = v.map(|x| x.into());
4186        self
4187    }
4188}
4189
4190impl wkt::message::Message for PreprocessingConfig {
4191    fn typename() -> &'static str {
4192        "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig"
4193    }
4194}
4195
4196/// Defines additional types related to [PreprocessingConfig].
4197pub mod preprocessing_config {
4198    #[allow(unused_imports)]
4199    use super::*;
4200
4201    /// Color preprocessing configuration.
4202    ///
4203    /// **Note:** This configuration is not supported.
4204    #[derive(Clone, Default, PartialEq)]
4205    #[non_exhaustive]
4206    pub struct Color {
4207        /// Control color saturation of the video. Enter a value between -1 and 1,
4208        /// where -1 is fully desaturated and 1 is maximum saturation. 0 is no
4209        /// change. The default is 0.
4210        pub saturation: f64,
4211
4212        /// Control black and white contrast of the video. Enter a value between -1
4213        /// and 1, where -1 is minimum contrast and 1 is maximum contrast. 0 is no
4214        /// change. The default is 0.
4215        pub contrast: f64,
4216
4217        /// Control brightness of the video. Enter a value between -1 and 1, where -1
4218        /// is minimum brightness and 1 is maximum brightness. 0 is no change. The
4219        /// default is 0.
4220        pub brightness: f64,
4221
4222        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4223    }
4224
4225    impl Color {
4226        pub fn new() -> Self {
4227            std::default::Default::default()
4228        }
4229
4230        /// Sets the value of [saturation][crate::model::preprocessing_config::Color::saturation].
4231        ///
4232        /// # Example
4233        /// ```ignore,no_run
4234        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Color;
4235        /// let x = Color::new().set_saturation(42.0);
4236        /// ```
4237        pub fn set_saturation<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
4238            self.saturation = v.into();
4239            self
4240        }
4241
4242        /// Sets the value of [contrast][crate::model::preprocessing_config::Color::contrast].
4243        ///
4244        /// # Example
4245        /// ```ignore,no_run
4246        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Color;
4247        /// let x = Color::new().set_contrast(42.0);
4248        /// ```
4249        pub fn set_contrast<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
4250            self.contrast = v.into();
4251            self
4252        }
4253
4254        /// Sets the value of [brightness][crate::model::preprocessing_config::Color::brightness].
4255        ///
4256        /// # Example
4257        /// ```ignore,no_run
4258        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Color;
4259        /// let x = Color::new().set_brightness(42.0);
4260        /// ```
4261        pub fn set_brightness<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
4262            self.brightness = v.into();
4263            self
4264        }
4265    }
4266
4267    impl wkt::message::Message for Color {
4268        fn typename() -> &'static str {
4269            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Color"
4270        }
4271    }
4272
4273    /// Denoise preprocessing configuration.
4274    ///
4275    /// **Note:** This configuration is not supported.
4276    #[derive(Clone, Default, PartialEq)]
4277    #[non_exhaustive]
4278    pub struct Denoise {
4279        /// Set strength of the denoise. Enter a value between 0 and 1. The higher
4280        /// the value, the smoother the image. 0 is no denoising. The default is 0.
4281        pub strength: f64,
4282
4283        /// Set the denoiser mode. The default is `standard`.
4284        ///
4285        /// Supported denoiser modes:
4286        ///
4287        /// - `standard`
4288        /// - `grain`
4289        pub tune: std::string::String,
4290
4291        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4292    }
4293
4294    impl Denoise {
4295        pub fn new() -> Self {
4296            std::default::Default::default()
4297        }
4298
4299        /// Sets the value of [strength][crate::model::preprocessing_config::Denoise::strength].
4300        ///
4301        /// # Example
4302        /// ```ignore,no_run
4303        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Denoise;
4304        /// let x = Denoise::new().set_strength(42.0);
4305        /// ```
4306        pub fn set_strength<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
4307            self.strength = v.into();
4308            self
4309        }
4310
4311        /// Sets the value of [tune][crate::model::preprocessing_config::Denoise::tune].
4312        ///
4313        /// # Example
4314        /// ```ignore,no_run
4315        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Denoise;
4316        /// let x = Denoise::new().set_tune("example");
4317        /// ```
4318        pub fn set_tune<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4319            self.tune = v.into();
4320            self
4321        }
4322    }
4323
4324    impl wkt::message::Message for Denoise {
4325        fn typename() -> &'static str {
4326            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise"
4327        }
4328    }
4329
4330    /// Deblock preprocessing configuration.
4331    ///
4332    /// **Note:** This configuration is not supported.
4333    #[derive(Clone, Default, PartialEq)]
4334    #[non_exhaustive]
4335    pub struct Deblock {
4336        /// Set strength of the deblocker. Enter a value between 0 and 1. The higher
4337        /// the value, the stronger the block removal. 0 is no deblocking. The
4338        /// default is 0.
4339        pub strength: f64,
4340
4341        /// Enable deblocker. The default is `false`.
4342        pub enabled: bool,
4343
4344        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4345    }
4346
4347    impl Deblock {
4348        pub fn new() -> Self {
4349            std::default::Default::default()
4350        }
4351
4352        /// Sets the value of [strength][crate::model::preprocessing_config::Deblock::strength].
4353        ///
4354        /// # Example
4355        /// ```ignore,no_run
4356        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Deblock;
4357        /// let x = Deblock::new().set_strength(42.0);
4358        /// ```
4359        pub fn set_strength<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
4360            self.strength = v.into();
4361            self
4362        }
4363
4364        /// Sets the value of [enabled][crate::model::preprocessing_config::Deblock::enabled].
4365        ///
4366        /// # Example
4367        /// ```ignore,no_run
4368        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Deblock;
4369        /// let x = Deblock::new().set_enabled(true);
4370        /// ```
4371        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4372            self.enabled = v.into();
4373            self
4374        }
4375    }
4376
4377    impl wkt::message::Message for Deblock {
4378        fn typename() -> &'static str {
4379            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock"
4380        }
4381    }
4382
4383    /// Audio preprocessing configuration.
4384    #[derive(Clone, Default, PartialEq)]
4385    #[non_exhaustive]
4386    pub struct Audio {
4387        /// Specify audio loudness normalization in loudness units relative to full
4388        /// scale (LUFS). Enter a value between -24 and 0 (the default), where:
4389        ///
4390        /// * -24 is the Advanced Television Systems Committee (ATSC A/85) standard
4391        /// * -23 is the EU R128 broadcast standard
4392        /// * -19 is the prior standard for online mono audio
4393        /// * -18 is the ReplayGain standard
4394        /// * -16 is the prior standard for stereo audio
4395        /// * -14 is the new online audio standard recommended by Spotify, as well
4396        ///   as Amazon Echo
4397        /// * 0 disables normalization
4398        pub lufs: f64,
4399
4400        /// Enable boosting high frequency components. The default is `false`.
4401        ///
4402        /// **Note:** This field is not supported.
4403        pub high_boost: bool,
4404
4405        /// Enable boosting low frequency components. The default is `false`.
4406        ///
4407        /// **Note:** This field is not supported.
4408        pub low_boost: bool,
4409
4410        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4411    }
4412
4413    impl Audio {
4414        pub fn new() -> Self {
4415            std::default::Default::default()
4416        }
4417
4418        /// Sets the value of [lufs][crate::model::preprocessing_config::Audio::lufs].
4419        ///
4420        /// # Example
4421        /// ```ignore,no_run
4422        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Audio;
4423        /// let x = Audio::new().set_lufs(42.0);
4424        /// ```
4425        pub fn set_lufs<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
4426            self.lufs = v.into();
4427            self
4428        }
4429
4430        /// Sets the value of [high_boost][crate::model::preprocessing_config::Audio::high_boost].
4431        ///
4432        /// # Example
4433        /// ```ignore,no_run
4434        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Audio;
4435        /// let x = Audio::new().set_high_boost(true);
4436        /// ```
4437        pub fn set_high_boost<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4438            self.high_boost = v.into();
4439            self
4440        }
4441
4442        /// Sets the value of [low_boost][crate::model::preprocessing_config::Audio::low_boost].
4443        ///
4444        /// # Example
4445        /// ```ignore,no_run
4446        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Audio;
4447        /// let x = Audio::new().set_low_boost(true);
4448        /// ```
4449        pub fn set_low_boost<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4450            self.low_boost = v.into();
4451            self
4452        }
4453    }
4454
4455    impl wkt::message::Message for Audio {
4456        fn typename() -> &'static str {
4457            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Audio"
4458        }
4459    }
4460
4461    /// Video cropping configuration for the input video. The cropped input video
4462    /// is scaled to match the output resolution.
4463    #[derive(Clone, Default, PartialEq)]
4464    #[non_exhaustive]
4465    pub struct Crop {
4466        /// The number of pixels to crop from the top. The default is 0.
4467        pub top_pixels: i32,
4468
4469        /// The number of pixels to crop from the bottom. The default is 0.
4470        pub bottom_pixels: i32,
4471
4472        /// The number of pixels to crop from the left. The default is 0.
4473        pub left_pixels: i32,
4474
4475        /// The number of pixels to crop from the right. The default is 0.
4476        pub right_pixels: i32,
4477
4478        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4479    }
4480
4481    impl Crop {
4482        pub fn new() -> Self {
4483            std::default::Default::default()
4484        }
4485
4486        /// Sets the value of [top_pixels][crate::model::preprocessing_config::Crop::top_pixels].
4487        ///
4488        /// # Example
4489        /// ```ignore,no_run
4490        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Crop;
4491        /// let x = Crop::new().set_top_pixels(42);
4492        /// ```
4493        pub fn set_top_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4494            self.top_pixels = v.into();
4495            self
4496        }
4497
4498        /// Sets the value of [bottom_pixels][crate::model::preprocessing_config::Crop::bottom_pixels].
4499        ///
4500        /// # Example
4501        /// ```ignore,no_run
4502        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Crop;
4503        /// let x = Crop::new().set_bottom_pixels(42);
4504        /// ```
4505        pub fn set_bottom_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4506            self.bottom_pixels = v.into();
4507            self
4508        }
4509
4510        /// Sets the value of [left_pixels][crate::model::preprocessing_config::Crop::left_pixels].
4511        ///
4512        /// # Example
4513        /// ```ignore,no_run
4514        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Crop;
4515        /// let x = Crop::new().set_left_pixels(42);
4516        /// ```
4517        pub fn set_left_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4518            self.left_pixels = v.into();
4519            self
4520        }
4521
4522        /// Sets the value of [right_pixels][crate::model::preprocessing_config::Crop::right_pixels].
4523        ///
4524        /// # Example
4525        /// ```ignore,no_run
4526        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Crop;
4527        /// let x = Crop::new().set_right_pixels(42);
4528        /// ```
4529        pub fn set_right_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4530            self.right_pixels = v.into();
4531            self
4532        }
4533    }
4534
4535    impl wkt::message::Message for Crop {
4536        fn typename() -> &'static str {
4537            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Crop"
4538        }
4539    }
4540
4541    /// Pad filter configuration for the input video. The padded input video
4542    /// is scaled after padding with black to match the output resolution.
4543    #[derive(Clone, Default, PartialEq)]
4544    #[non_exhaustive]
4545    pub struct Pad {
4546        /// The number of pixels to add to the top. The default is 0.
4547        pub top_pixels: i32,
4548
4549        /// The number of pixels to add to the bottom. The default is 0.
4550        pub bottom_pixels: i32,
4551
4552        /// The number of pixels to add to the left. The default is 0.
4553        pub left_pixels: i32,
4554
4555        /// The number of pixels to add to the right. The default is 0.
4556        pub right_pixels: i32,
4557
4558        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4559    }
4560
4561    impl Pad {
4562        pub fn new() -> Self {
4563            std::default::Default::default()
4564        }
4565
4566        /// Sets the value of [top_pixels][crate::model::preprocessing_config::Pad::top_pixels].
4567        ///
4568        /// # Example
4569        /// ```ignore,no_run
4570        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Pad;
4571        /// let x = Pad::new().set_top_pixels(42);
4572        /// ```
4573        pub fn set_top_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4574            self.top_pixels = v.into();
4575            self
4576        }
4577
4578        /// Sets the value of [bottom_pixels][crate::model::preprocessing_config::Pad::bottom_pixels].
4579        ///
4580        /// # Example
4581        /// ```ignore,no_run
4582        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Pad;
4583        /// let x = Pad::new().set_bottom_pixels(42);
4584        /// ```
4585        pub fn set_bottom_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4586            self.bottom_pixels = v.into();
4587            self
4588        }
4589
4590        /// Sets the value of [left_pixels][crate::model::preprocessing_config::Pad::left_pixels].
4591        ///
4592        /// # Example
4593        /// ```ignore,no_run
4594        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Pad;
4595        /// let x = Pad::new().set_left_pixels(42);
4596        /// ```
4597        pub fn set_left_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4598            self.left_pixels = v.into();
4599            self
4600        }
4601
4602        /// Sets the value of [right_pixels][crate::model::preprocessing_config::Pad::right_pixels].
4603        ///
4604        /// # Example
4605        /// ```ignore,no_run
4606        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Pad;
4607        /// let x = Pad::new().set_right_pixels(42);
4608        /// ```
4609        pub fn set_right_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4610            self.right_pixels = v.into();
4611            self
4612        }
4613    }
4614
4615    impl wkt::message::Message for Pad {
4616        fn typename() -> &'static str {
4617            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Pad"
4618        }
4619    }
4620
4621    /// Deinterlace configuration for input video.
4622    #[derive(Clone, Default, PartialEq)]
4623    #[non_exhaustive]
4624    pub struct Deinterlace {
4625        /// Specify the video deinterlacing filter. The default is `yadif`.
4626        pub deinterlacing_filter: std::option::Option<
4627            crate::model::preprocessing_config::deinterlace::DeinterlacingFilter,
4628        >,
4629
4630        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4631    }
4632
4633    impl Deinterlace {
4634        pub fn new() -> Self {
4635            std::default::Default::default()
4636        }
4637
4638        /// Sets the value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter].
4639        ///
4640        /// Note that all the setters affecting `deinterlacing_filter` are mutually
4641        /// exclusive.
4642        ///
4643        /// # Example
4644        /// ```ignore,no_run
4645        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Deinterlace;
4646        /// use google_cloud_video_transcoder_v1::model::preprocessing_config::deinterlace::YadifConfig;
4647        /// let x = Deinterlace::new().set_deinterlacing_filter(Some(
4648        ///     google_cloud_video_transcoder_v1::model::preprocessing_config::deinterlace::DeinterlacingFilter::Yadif(YadifConfig::default().into())));
4649        /// ```
4650        pub fn set_deinterlacing_filter<
4651            T: std::convert::Into<
4652                    std::option::Option<
4653                        crate::model::preprocessing_config::deinterlace::DeinterlacingFilter,
4654                    >,
4655                >,
4656        >(
4657            mut self,
4658            v: T,
4659        ) -> Self {
4660            self.deinterlacing_filter = v.into();
4661            self
4662        }
4663
4664        /// The value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter]
4665        /// if it holds a `Yadif`, `None` if the field is not set or
4666        /// holds a different branch.
4667        pub fn yadif(
4668            &self,
4669        ) -> std::option::Option<
4670            &std::boxed::Box<crate::model::preprocessing_config::deinterlace::YadifConfig>,
4671        > {
4672            #[allow(unreachable_patterns)]
4673            self.deinterlacing_filter.as_ref().and_then(|v| match v {
4674                crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Yadif(v) => {
4675                    std::option::Option::Some(v)
4676                }
4677                _ => std::option::Option::None,
4678            })
4679        }
4680
4681        /// Sets the value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter]
4682        /// to hold a `Yadif`.
4683        ///
4684        /// Note that all the setters affecting `deinterlacing_filter` are
4685        /// mutually exclusive.
4686        ///
4687        /// # Example
4688        /// ```ignore,no_run
4689        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Deinterlace;
4690        /// use google_cloud_video_transcoder_v1::model::preprocessing_config::deinterlace::YadifConfig;
4691        /// let x = Deinterlace::new().set_yadif(YadifConfig::default()/* use setters */);
4692        /// assert!(x.yadif().is_some());
4693        /// assert!(x.bwdif().is_none());
4694        /// ```
4695        pub fn set_yadif<
4696            T: std::convert::Into<
4697                    std::boxed::Box<crate::model::preprocessing_config::deinterlace::YadifConfig>,
4698                >,
4699        >(
4700            mut self,
4701            v: T,
4702        ) -> Self {
4703            self.deinterlacing_filter = std::option::Option::Some(
4704                crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Yadif(
4705                    v.into(),
4706                ),
4707            );
4708            self
4709        }
4710
4711        /// The value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter]
4712        /// if it holds a `Bwdif`, `None` if the field is not set or
4713        /// holds a different branch.
4714        pub fn bwdif(
4715            &self,
4716        ) -> std::option::Option<
4717            &std::boxed::Box<crate::model::preprocessing_config::deinterlace::BwdifConfig>,
4718        > {
4719            #[allow(unreachable_patterns)]
4720            self.deinterlacing_filter.as_ref().and_then(|v| match v {
4721                crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Bwdif(v) => {
4722                    std::option::Option::Some(v)
4723                }
4724                _ => std::option::Option::None,
4725            })
4726        }
4727
4728        /// Sets the value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter]
4729        /// to hold a `Bwdif`.
4730        ///
4731        /// Note that all the setters affecting `deinterlacing_filter` are
4732        /// mutually exclusive.
4733        ///
4734        /// # Example
4735        /// ```ignore,no_run
4736        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Deinterlace;
4737        /// use google_cloud_video_transcoder_v1::model::preprocessing_config::deinterlace::BwdifConfig;
4738        /// let x = Deinterlace::new().set_bwdif(BwdifConfig::default()/* use setters */);
4739        /// assert!(x.bwdif().is_some());
4740        /// assert!(x.yadif().is_none());
4741        /// ```
4742        pub fn set_bwdif<
4743            T: std::convert::Into<
4744                    std::boxed::Box<crate::model::preprocessing_config::deinterlace::BwdifConfig>,
4745                >,
4746        >(
4747            mut self,
4748            v: T,
4749        ) -> Self {
4750            self.deinterlacing_filter = std::option::Option::Some(
4751                crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Bwdif(
4752                    v.into(),
4753                ),
4754            );
4755            self
4756        }
4757    }
4758
4759    impl wkt::message::Message for Deinterlace {
4760        fn typename() -> &'static str {
4761            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace"
4762        }
4763    }
4764
4765    /// Defines additional types related to [Deinterlace].
4766    pub mod deinterlace {
4767        #[allow(unused_imports)]
4768        use super::*;
4769
4770        /// Yet Another Deinterlacing Filter Configuration.
4771        #[derive(Clone, Default, PartialEq)]
4772        #[non_exhaustive]
4773        pub struct YadifConfig {
4774            /// Specifies the deinterlacing mode to adopt.
4775            /// The default is `send_frame`.
4776            /// Supported values:
4777            ///
4778            /// - `send_frame`: Output one frame for each frame
4779            /// - `send_field`: Output one frame for each field
4780            pub mode: std::string::String,
4781
4782            /// Disable spacial interlacing.
4783            /// The default is `false`.
4784            pub disable_spatial_interlacing: bool,
4785
4786            /// The picture field parity assumed for the input interlaced video.
4787            /// The default is `auto`.
4788            /// Supported values:
4789            ///
4790            /// - `tff`: Assume the top field is first
4791            /// - `bff`: Assume the bottom field is first
4792            /// - `auto`: Enable automatic detection of field parity
4793            pub parity: std::string::String,
4794
4795            /// Deinterlace all frames rather than just the frames identified as
4796            /// interlaced. The default is `false`.
4797            pub deinterlace_all_frames: bool,
4798
4799            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4800        }
4801
4802        impl YadifConfig {
4803            pub fn new() -> Self {
4804                std::default::Default::default()
4805            }
4806
4807            /// Sets the value of [mode][crate::model::preprocessing_config::deinterlace::YadifConfig::mode].
4808            ///
4809            /// # Example
4810            /// ```ignore,no_run
4811            /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::deinterlace::YadifConfig;
4812            /// let x = YadifConfig::new().set_mode("example");
4813            /// ```
4814            pub fn set_mode<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4815                self.mode = v.into();
4816                self
4817            }
4818
4819            /// Sets the value of [disable_spatial_interlacing][crate::model::preprocessing_config::deinterlace::YadifConfig::disable_spatial_interlacing].
4820            ///
4821            /// # Example
4822            /// ```ignore,no_run
4823            /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::deinterlace::YadifConfig;
4824            /// let x = YadifConfig::new().set_disable_spatial_interlacing(true);
4825            /// ```
4826            pub fn set_disable_spatial_interlacing<T: std::convert::Into<bool>>(
4827                mut self,
4828                v: T,
4829            ) -> Self {
4830                self.disable_spatial_interlacing = v.into();
4831                self
4832            }
4833
4834            /// Sets the value of [parity][crate::model::preprocessing_config::deinterlace::YadifConfig::parity].
4835            ///
4836            /// # Example
4837            /// ```ignore,no_run
4838            /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::deinterlace::YadifConfig;
4839            /// let x = YadifConfig::new().set_parity("example");
4840            /// ```
4841            pub fn set_parity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4842                self.parity = v.into();
4843                self
4844            }
4845
4846            /// Sets the value of [deinterlace_all_frames][crate::model::preprocessing_config::deinterlace::YadifConfig::deinterlace_all_frames].
4847            ///
4848            /// # Example
4849            /// ```ignore,no_run
4850            /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::deinterlace::YadifConfig;
4851            /// let x = YadifConfig::new().set_deinterlace_all_frames(true);
4852            /// ```
4853            pub fn set_deinterlace_all_frames<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4854                self.deinterlace_all_frames = v.into();
4855                self
4856            }
4857        }
4858
4859        impl wkt::message::Message for YadifConfig {
4860            fn typename() -> &'static str {
4861                "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace.YadifConfig"
4862            }
4863        }
4864
4865        /// Bob Weaver Deinterlacing Filter Configuration.
4866        #[derive(Clone, Default, PartialEq)]
4867        #[non_exhaustive]
4868        pub struct BwdifConfig {
4869            /// Specifies the deinterlacing mode to adopt.
4870            /// The default is `send_frame`.
4871            /// Supported values:
4872            ///
4873            /// - `send_frame`: Output one frame for each frame
4874            /// - `send_field`: Output one frame for each field
4875            pub mode: std::string::String,
4876
4877            /// The picture field parity assumed for the input interlaced video.
4878            /// The default is `auto`.
4879            /// Supported values:
4880            ///
4881            /// - `tff`: Assume the top field is first
4882            /// - `bff`: Assume the bottom field is first
4883            /// - `auto`: Enable automatic detection of field parity
4884            pub parity: std::string::String,
4885
4886            /// Deinterlace all frames rather than just the frames identified as
4887            /// interlaced. The default is `false`.
4888            pub deinterlace_all_frames: bool,
4889
4890            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4891        }
4892
4893        impl BwdifConfig {
4894            pub fn new() -> Self {
4895                std::default::Default::default()
4896            }
4897
4898            /// Sets the value of [mode][crate::model::preprocessing_config::deinterlace::BwdifConfig::mode].
4899            ///
4900            /// # Example
4901            /// ```ignore,no_run
4902            /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::deinterlace::BwdifConfig;
4903            /// let x = BwdifConfig::new().set_mode("example");
4904            /// ```
4905            pub fn set_mode<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4906                self.mode = v.into();
4907                self
4908            }
4909
4910            /// Sets the value of [parity][crate::model::preprocessing_config::deinterlace::BwdifConfig::parity].
4911            ///
4912            /// # Example
4913            /// ```ignore,no_run
4914            /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::deinterlace::BwdifConfig;
4915            /// let x = BwdifConfig::new().set_parity("example");
4916            /// ```
4917            pub fn set_parity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4918                self.parity = v.into();
4919                self
4920            }
4921
4922            /// Sets the value of [deinterlace_all_frames][crate::model::preprocessing_config::deinterlace::BwdifConfig::deinterlace_all_frames].
4923            ///
4924            /// # Example
4925            /// ```ignore,no_run
4926            /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::deinterlace::BwdifConfig;
4927            /// let x = BwdifConfig::new().set_deinterlace_all_frames(true);
4928            /// ```
4929            pub fn set_deinterlace_all_frames<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4930                self.deinterlace_all_frames = v.into();
4931                self
4932            }
4933        }
4934
4935        impl wkt::message::Message for BwdifConfig {
4936            fn typename() -> &'static str {
4937                "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace.BwdifConfig"
4938            }
4939        }
4940
4941        /// Specify the video deinterlacing filter. The default is `yadif`.
4942        #[derive(Clone, Debug, PartialEq)]
4943        #[non_exhaustive]
4944        pub enum DeinterlacingFilter {
4945            /// Specifies the Yet Another Deinterlacing Filter Configuration.
4946            Yadif(std::boxed::Box<crate::model::preprocessing_config::deinterlace::YadifConfig>),
4947            /// Specifies the Bob Weaver Deinterlacing Filter Configuration.
4948            Bwdif(std::boxed::Box<crate::model::preprocessing_config::deinterlace::BwdifConfig>),
4949        }
4950    }
4951}
4952
4953/// Track definition for the input asset.
4954#[derive(Clone, Default, PartialEq)]
4955#[non_exhaustive]
4956pub struct TrackDefinition {
4957    /// The input track.
4958    pub input_track: std::option::Option<i32>,
4959
4960    /// Optional. A list of languages spoken in the input asset, represented by a
4961    /// BCP 47 language code, such as "en-US" or "sr-Latn". For more information,
4962    /// see <https://www.unicode.org/reports/tr35/#Unicode_locale_identifier>.
4963    pub languages: std::vec::Vec<std::string::String>,
4964
4965    /// Optional. Whether to automatically detect the languages present in the
4966    /// track. If true, the system will attempt to identify all the languages
4967    /// present in the track and populate the languages field.
4968    pub detect_languages: bool,
4969
4970    /// Output only. A list of languages detected in the input asset, represented
4971    /// by a BCP 47 language code, such as "en-US" or "sr-Latn". For more
4972    /// information, see
4973    /// <https://www.unicode.org/reports/tr35/#Unicode_locale_identifier>.
4974    /// This field is only populated if the detect_languages field is set to true.
4975    pub detected_languages: std::vec::Vec<std::string::String>,
4976
4977    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4978}
4979
4980impl TrackDefinition {
4981    pub fn new() -> Self {
4982        std::default::Default::default()
4983    }
4984
4985    /// Sets the value of [input_track][crate::model::TrackDefinition::input_track].
4986    ///
4987    /// # Example
4988    /// ```ignore,no_run
4989    /// # use google_cloud_video_transcoder_v1::model::TrackDefinition;
4990    /// let x = TrackDefinition::new().set_input_track(42);
4991    /// ```
4992    pub fn set_input_track<T>(mut self, v: T) -> Self
4993    where
4994        T: std::convert::Into<i32>,
4995    {
4996        self.input_track = std::option::Option::Some(v.into());
4997        self
4998    }
4999
5000    /// Sets or clears the value of [input_track][crate::model::TrackDefinition::input_track].
5001    ///
5002    /// # Example
5003    /// ```ignore,no_run
5004    /// # use google_cloud_video_transcoder_v1::model::TrackDefinition;
5005    /// let x = TrackDefinition::new().set_or_clear_input_track(Some(42));
5006    /// let x = TrackDefinition::new().set_or_clear_input_track(None::<i32>);
5007    /// ```
5008    pub fn set_or_clear_input_track<T>(mut self, v: std::option::Option<T>) -> Self
5009    where
5010        T: std::convert::Into<i32>,
5011    {
5012        self.input_track = v.map(|x| x.into());
5013        self
5014    }
5015
5016    /// Sets the value of [languages][crate::model::TrackDefinition::languages].
5017    ///
5018    /// # Example
5019    /// ```ignore,no_run
5020    /// # use google_cloud_video_transcoder_v1::model::TrackDefinition;
5021    /// let x = TrackDefinition::new().set_languages(["a", "b", "c"]);
5022    /// ```
5023    pub fn set_languages<T, V>(mut self, v: T) -> Self
5024    where
5025        T: std::iter::IntoIterator<Item = V>,
5026        V: std::convert::Into<std::string::String>,
5027    {
5028        use std::iter::Iterator;
5029        self.languages = v.into_iter().map(|i| i.into()).collect();
5030        self
5031    }
5032
5033    /// Sets the value of [detect_languages][crate::model::TrackDefinition::detect_languages].
5034    ///
5035    /// # Example
5036    /// ```ignore,no_run
5037    /// # use google_cloud_video_transcoder_v1::model::TrackDefinition;
5038    /// let x = TrackDefinition::new().set_detect_languages(true);
5039    /// ```
5040    pub fn set_detect_languages<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5041        self.detect_languages = v.into();
5042        self
5043    }
5044
5045    /// Sets the value of [detected_languages][crate::model::TrackDefinition::detected_languages].
5046    ///
5047    /// # Example
5048    /// ```ignore,no_run
5049    /// # use google_cloud_video_transcoder_v1::model::TrackDefinition;
5050    /// let x = TrackDefinition::new().set_detected_languages(["a", "b", "c"]);
5051    /// ```
5052    pub fn set_detected_languages<T, V>(mut self, v: T) -> Self
5053    where
5054        T: std::iter::IntoIterator<Item = V>,
5055        V: std::convert::Into<std::string::String>,
5056    {
5057        use std::iter::Iterator;
5058        self.detected_languages = v.into_iter().map(|i| i.into()).collect();
5059        self
5060    }
5061}
5062
5063impl wkt::message::Message for TrackDefinition {
5064    fn typename() -> &'static str {
5065        "type.googleapis.com/google.cloud.video.transcoder.v1.TrackDefinition"
5066    }
5067}
5068
5069/// Input attributes that provide additional information about the input asset.
5070#[derive(Clone, Default, PartialEq)]
5071#[non_exhaustive]
5072pub struct InputAttributes {
5073    /// Optional. A list of track definitions for the input asset.
5074    pub track_definitions: std::vec::Vec<crate::model::TrackDefinition>,
5075
5076    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5077}
5078
5079impl InputAttributes {
5080    pub fn new() -> Self {
5081        std::default::Default::default()
5082    }
5083
5084    /// Sets the value of [track_definitions][crate::model::InputAttributes::track_definitions].
5085    ///
5086    /// # Example
5087    /// ```ignore,no_run
5088    /// # use google_cloud_video_transcoder_v1::model::InputAttributes;
5089    /// use google_cloud_video_transcoder_v1::model::TrackDefinition;
5090    /// let x = InputAttributes::new()
5091    ///     .set_track_definitions([
5092    ///         TrackDefinition::default()/* use setters */,
5093    ///         TrackDefinition::default()/* use (different) setters */,
5094    ///     ]);
5095    /// ```
5096    pub fn set_track_definitions<T, V>(mut self, v: T) -> Self
5097    where
5098        T: std::iter::IntoIterator<Item = V>,
5099        V: std::convert::Into<crate::model::TrackDefinition>,
5100    {
5101        use std::iter::Iterator;
5102        self.track_definitions = v.into_iter().map(|i| i.into()).collect();
5103        self
5104    }
5105}
5106
5107impl wkt::message::Message for InputAttributes {
5108    fn typename() -> &'static str {
5109        "type.googleapis.com/google.cloud.video.transcoder.v1.InputAttributes"
5110    }
5111}
5112
5113/// Video stream resource.
5114#[derive(Clone, Default, PartialEq)]
5115#[non_exhaustive]
5116pub struct VideoStream {
5117    /// Codec settings can be h264, h265, or vp9.
5118    pub codec_settings: std::option::Option<crate::model::video_stream::CodecSettings>,
5119
5120    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5121}
5122
5123impl VideoStream {
5124    pub fn new() -> Self {
5125        std::default::Default::default()
5126    }
5127
5128    /// Sets the value of [codec_settings][crate::model::VideoStream::codec_settings].
5129    ///
5130    /// Note that all the setters affecting `codec_settings` are mutually
5131    /// exclusive.
5132    ///
5133    /// # Example
5134    /// ```ignore,no_run
5135    /// # use google_cloud_video_transcoder_v1::model::VideoStream;
5136    /// use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5137    /// let x = VideoStream::new().set_codec_settings(Some(
5138    ///     google_cloud_video_transcoder_v1::model::video_stream::CodecSettings::H264(H264CodecSettings::default().into())));
5139    /// ```
5140    pub fn set_codec_settings<
5141        T: std::convert::Into<std::option::Option<crate::model::video_stream::CodecSettings>>,
5142    >(
5143        mut self,
5144        v: T,
5145    ) -> Self {
5146        self.codec_settings = v.into();
5147        self
5148    }
5149
5150    /// The value of [codec_settings][crate::model::VideoStream::codec_settings]
5151    /// if it holds a `H264`, `None` if the field is not set or
5152    /// holds a different branch.
5153    pub fn h264(
5154        &self,
5155    ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H264CodecSettings>> {
5156        #[allow(unreachable_patterns)]
5157        self.codec_settings.as_ref().and_then(|v| match v {
5158            crate::model::video_stream::CodecSettings::H264(v) => std::option::Option::Some(v),
5159            _ => std::option::Option::None,
5160        })
5161    }
5162
5163    /// Sets the value of [codec_settings][crate::model::VideoStream::codec_settings]
5164    /// to hold a `H264`.
5165    ///
5166    /// Note that all the setters affecting `codec_settings` are
5167    /// mutually exclusive.
5168    ///
5169    /// # Example
5170    /// ```ignore,no_run
5171    /// # use google_cloud_video_transcoder_v1::model::VideoStream;
5172    /// use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5173    /// let x = VideoStream::new().set_h264(H264CodecSettings::default()/* use setters */);
5174    /// assert!(x.h264().is_some());
5175    /// assert!(x.h265().is_none());
5176    /// assert!(x.vp9().is_none());
5177    /// ```
5178    pub fn set_h264<
5179        T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H264CodecSettings>>,
5180    >(
5181        mut self,
5182        v: T,
5183    ) -> Self {
5184        self.codec_settings =
5185            std::option::Option::Some(crate::model::video_stream::CodecSettings::H264(v.into()));
5186        self
5187    }
5188
5189    /// The value of [codec_settings][crate::model::VideoStream::codec_settings]
5190    /// if it holds a `H265`, `None` if the field is not set or
5191    /// holds a different branch.
5192    pub fn h265(
5193        &self,
5194    ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H265CodecSettings>> {
5195        #[allow(unreachable_patterns)]
5196        self.codec_settings.as_ref().and_then(|v| match v {
5197            crate::model::video_stream::CodecSettings::H265(v) => std::option::Option::Some(v),
5198            _ => std::option::Option::None,
5199        })
5200    }
5201
5202    /// Sets the value of [codec_settings][crate::model::VideoStream::codec_settings]
5203    /// to hold a `H265`.
5204    ///
5205    /// Note that all the setters affecting `codec_settings` are
5206    /// mutually exclusive.
5207    ///
5208    /// # Example
5209    /// ```ignore,no_run
5210    /// # use google_cloud_video_transcoder_v1::model::VideoStream;
5211    /// use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
5212    /// let x = VideoStream::new().set_h265(H265CodecSettings::default()/* use setters */);
5213    /// assert!(x.h265().is_some());
5214    /// assert!(x.h264().is_none());
5215    /// assert!(x.vp9().is_none());
5216    /// ```
5217    pub fn set_h265<
5218        T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H265CodecSettings>>,
5219    >(
5220        mut self,
5221        v: T,
5222    ) -> Self {
5223        self.codec_settings =
5224            std::option::Option::Some(crate::model::video_stream::CodecSettings::H265(v.into()));
5225        self
5226    }
5227
5228    /// The value of [codec_settings][crate::model::VideoStream::codec_settings]
5229    /// if it holds a `Vp9`, `None` if the field is not set or
5230    /// holds a different branch.
5231    pub fn vp9(
5232        &self,
5233    ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::Vp9CodecSettings>> {
5234        #[allow(unreachable_patterns)]
5235        self.codec_settings.as_ref().and_then(|v| match v {
5236            crate::model::video_stream::CodecSettings::Vp9(v) => std::option::Option::Some(v),
5237            _ => std::option::Option::None,
5238        })
5239    }
5240
5241    /// Sets the value of [codec_settings][crate::model::VideoStream::codec_settings]
5242    /// to hold a `Vp9`.
5243    ///
5244    /// Note that all the setters affecting `codec_settings` are
5245    /// mutually exclusive.
5246    ///
5247    /// # Example
5248    /// ```ignore,no_run
5249    /// # use google_cloud_video_transcoder_v1::model::VideoStream;
5250    /// use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
5251    /// let x = VideoStream::new().set_vp9(Vp9CodecSettings::default()/* use setters */);
5252    /// assert!(x.vp9().is_some());
5253    /// assert!(x.h264().is_none());
5254    /// assert!(x.h265().is_none());
5255    /// ```
5256    pub fn set_vp9<
5257        T: std::convert::Into<std::boxed::Box<crate::model::video_stream::Vp9CodecSettings>>,
5258    >(
5259        mut self,
5260        v: T,
5261    ) -> Self {
5262        self.codec_settings =
5263            std::option::Option::Some(crate::model::video_stream::CodecSettings::Vp9(v.into()));
5264        self
5265    }
5266}
5267
5268impl wkt::message::Message for VideoStream {
5269    fn typename() -> &'static str {
5270        "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream"
5271    }
5272}
5273
5274/// Defines additional types related to [VideoStream].
5275pub mod video_stream {
5276    #[allow(unused_imports)]
5277    use super::*;
5278
5279    /// Convert the input video to a Standard Dynamic Range (SDR) video.
5280    #[derive(Clone, Default, PartialEq)]
5281    #[non_exhaustive]
5282    pub struct H264ColorFormatSDR {
5283        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5284    }
5285
5286    impl H264ColorFormatSDR {
5287        pub fn new() -> Self {
5288            std::default::Default::default()
5289        }
5290    }
5291
5292    impl wkt::message::Message for H264ColorFormatSDR {
5293        fn typename() -> &'static str {
5294            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H264ColorFormatSDR"
5295        }
5296    }
5297
5298    /// Convert the input video to a Hybrid Log Gamma (HLG) video.
5299    #[derive(Clone, Default, PartialEq)]
5300    #[non_exhaustive]
5301    pub struct H264ColorFormatHLG {
5302        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5303    }
5304
5305    impl H264ColorFormatHLG {
5306        pub fn new() -> Self {
5307            std::default::Default::default()
5308        }
5309    }
5310
5311    impl wkt::message::Message for H264ColorFormatHLG {
5312        fn typename() -> &'static str {
5313            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H264ColorFormatHLG"
5314        }
5315    }
5316
5317    /// H264 codec settings.
5318    #[derive(Clone, Default, PartialEq)]
5319    #[non_exhaustive]
5320    pub struct H264CodecSettings {
5321        /// The width of the video in pixels. Must be an even integer.
5322        /// When not specified, the width is adjusted to match the specified height
5323        /// and input aspect ratio. If both are omitted, the input width is used.
5324        ///
5325        /// For portrait videos that contain horizontal ASR and rotation metadata,
5326        /// provide the width, in pixels, per the horizontal ASR. The API calculates
5327        /// the height per the horizontal ASR. The API detects any rotation metadata
5328        /// and swaps the requested height and width for the output.
5329        pub width_pixels: i32,
5330
5331        /// The height of the video in pixels. Must be an even integer.
5332        /// When not specified, the height is adjusted to match the specified width
5333        /// and input aspect ratio. If both are omitted, the input height is used.
5334        ///
5335        /// For portrait videos that contain horizontal ASR and rotation metadata,
5336        /// provide the height, in pixels, per the horizontal ASR. The API calculates
5337        /// the width per the horizontal ASR. The API detects any rotation metadata
5338        /// and swaps the requested height and width for the output.
5339        pub height_pixels: i32,
5340
5341        /// Required. The target video frame rate in frames per second (FPS). Must be
5342        /// less than or equal to 120.
5343        pub frame_rate: f64,
5344
5345        /// Optional. Frame rate conversion strategy for desired frame rate. The
5346        /// default is `DOWNSAMPLE`.
5347        pub frame_rate_conversion_strategy: crate::model::video_stream::FrameRateConversionStrategy,
5348
5349        /// Required. The video bitrate in bits per second. The minimum value is
5350        /// 1,000. The maximum value is 800,000,000.
5351        pub bitrate_bps: i32,
5352
5353        /// Pixel format to use. The default is `yuv420p`.
5354        ///
5355        /// Supported pixel formats:
5356        ///
5357        /// - `yuv420p` pixel format
5358        /// - `yuv422p` pixel format
5359        /// - `yuv444p` pixel format
5360        /// - `yuv420p10` 10-bit HDR pixel format
5361        /// - `yuv422p10` 10-bit HDR pixel format
5362        /// - `yuv444p10` 10-bit HDR pixel format
5363        /// - `yuv420p12` 12-bit HDR pixel format
5364        /// - `yuv422p12` 12-bit HDR pixel format
5365        /// - `yuv444p12` 12-bit HDR pixel format
5366        pub pixel_format: std::string::String,
5367
5368        /// Specify the mode. The default is `vbr`.
5369        ///
5370        /// Supported rate control modes:
5371        ///
5372        /// - `vbr` - variable bitrate
5373        /// - `crf` - constant rate factor
5374        pub rate_control_mode: std::string::String,
5375
5376        /// Target CRF level. Must be between 10 and 36, where 10 is the highest
5377        /// quality and 36 is the most efficient compression. The default is 21.
5378        pub crf_level: i32,
5379
5380        /// Specifies whether an open Group of Pictures (GOP) structure should be
5381        /// allowed or not. The default is `false`.
5382        pub allow_open_gop: bool,
5383
5384        /// Use two-pass encoding strategy to achieve better video quality.
5385        /// [H264CodecSettings.rate_control_mode][google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.rate_control_mode]
5386        /// must be `vbr`. The default is `false`.
5387        ///
5388        /// [google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.rate_control_mode]: crate::model::video_stream::H264CodecSettings::rate_control_mode
5389        pub enable_two_pass: bool,
5390
5391        /// Size of the Video Buffering Verifier (VBV) buffer in bits. Must be
5392        /// greater than zero. The default is equal to
5393        /// [H264CodecSettings.bitrate_bps][google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.bitrate_bps].
5394        ///
5395        /// [google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.bitrate_bps]: crate::model::video_stream::H264CodecSettings::bitrate_bps
5396        pub vbv_size_bits: i32,
5397
5398        /// Initial fullness of the Video Buffering Verifier (VBV) buffer in bits.
5399        /// Must be greater than zero. The default is equal to 90% of
5400        /// [H264CodecSettings.vbv_size_bits][google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.vbv_size_bits].
5401        ///
5402        /// [google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.vbv_size_bits]: crate::model::video_stream::H264CodecSettings::vbv_size_bits
5403        pub vbv_fullness_bits: i32,
5404
5405        /// The entropy coder to use. The default is `cabac`.
5406        ///
5407        /// Supported entropy coders:
5408        ///
5409        /// - `cavlc`
5410        /// - `cabac`
5411        pub entropy_coder: std::string::String,
5412
5413        /// Allow B-pyramid for reference frame selection. This may not be supported
5414        /// on all decoders. The default is `false`.
5415        pub b_pyramid: bool,
5416
5417        /// The number of consecutive B-frames. Must be greater than or equal to
5418        /// zero. Must be less than
5419        /// [H264CodecSettings.gop_frame_count][google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.gop_frame_count]
5420        /// if set. The default is 0.
5421        ///
5422        /// [google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.gop_frame_count]: crate::model::video_stream::H264CodecSettings::gop_mode
5423        pub b_frame_count: i32,
5424
5425        /// Specify the intensity of the adaptive quantizer (AQ). Must be between 0
5426        /// and 1, where 0 disables the quantizer and 1 maximizes the quantizer. A
5427        /// higher value equals a lower bitrate but smoother image. The default is 0.
5428        pub aq_strength: f64,
5429
5430        /// Enforces the specified codec profile. The following profiles are
5431        /// supported:
5432        ///
5433        /// * `baseline`
5434        /// * `main`
5435        /// * `high` (default)
5436        ///
5437        /// The available options are
5438        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.264#Tune).
5439        /// Note that certain values for this field may cause the
5440        /// transcoder to override other fields you set in the `H264CodecSettings`
5441        /// message.
5442        pub profile: std::string::String,
5443
5444        /// Enforces the specified codec tune. The available options are
5445        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.264#Tune).
5446        /// Note that certain values for this field may cause the
5447        /// transcoder to override other fields you set in the `H264CodecSettings`
5448        /// message.
5449        pub tune: std::string::String,
5450
5451        /// Enforces the specified codec preset. The default is `veryfast`. The
5452        /// available options are
5453        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.264#Preset).
5454        /// Note that certain values for this field may cause the
5455        /// transcoder to override other fields you set in the `H264CodecSettings`
5456        /// message.
5457        pub preset: std::string::String,
5458
5459        /// GOP mode can be either by frame count or duration.
5460        pub gop_mode:
5461            std::option::Option<crate::model::video_stream::h_264_codec_settings::GopMode>,
5462
5463        /// Color format can be sdr or hlg.
5464        pub color_format:
5465            std::option::Option<crate::model::video_stream::h_264_codec_settings::ColorFormat>,
5466
5467        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5468    }
5469
5470    impl H264CodecSettings {
5471        pub fn new() -> Self {
5472            std::default::Default::default()
5473        }
5474
5475        /// Sets the value of [width_pixels][crate::model::video_stream::H264CodecSettings::width_pixels].
5476        ///
5477        /// # Example
5478        /// ```ignore,no_run
5479        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5480        /// let x = H264CodecSettings::new().set_width_pixels(42);
5481        /// ```
5482        pub fn set_width_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5483            self.width_pixels = v.into();
5484            self
5485        }
5486
5487        /// Sets the value of [height_pixels][crate::model::video_stream::H264CodecSettings::height_pixels].
5488        ///
5489        /// # Example
5490        /// ```ignore,no_run
5491        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5492        /// let x = H264CodecSettings::new().set_height_pixels(42);
5493        /// ```
5494        pub fn set_height_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5495            self.height_pixels = v.into();
5496            self
5497        }
5498
5499        /// Sets the value of [frame_rate][crate::model::video_stream::H264CodecSettings::frame_rate].
5500        ///
5501        /// # Example
5502        /// ```ignore,no_run
5503        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5504        /// let x = H264CodecSettings::new().set_frame_rate(42.0);
5505        /// ```
5506        pub fn set_frame_rate<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
5507            self.frame_rate = v.into();
5508            self
5509        }
5510
5511        /// Sets the value of [frame_rate_conversion_strategy][crate::model::video_stream::H264CodecSettings::frame_rate_conversion_strategy].
5512        ///
5513        /// # Example
5514        /// ```ignore,no_run
5515        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5516        /// use google_cloud_video_transcoder_v1::model::video_stream::FrameRateConversionStrategy;
5517        /// let x0 = H264CodecSettings::new().set_frame_rate_conversion_strategy(FrameRateConversionStrategy::Downsample);
5518        /// let x1 = H264CodecSettings::new().set_frame_rate_conversion_strategy(FrameRateConversionStrategy::DropDuplicate);
5519        /// ```
5520        pub fn set_frame_rate_conversion_strategy<
5521            T: std::convert::Into<crate::model::video_stream::FrameRateConversionStrategy>,
5522        >(
5523            mut self,
5524            v: T,
5525        ) -> Self {
5526            self.frame_rate_conversion_strategy = v.into();
5527            self
5528        }
5529
5530        /// Sets the value of [bitrate_bps][crate::model::video_stream::H264CodecSettings::bitrate_bps].
5531        ///
5532        /// # Example
5533        /// ```ignore,no_run
5534        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5535        /// let x = H264CodecSettings::new().set_bitrate_bps(42);
5536        /// ```
5537        pub fn set_bitrate_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5538            self.bitrate_bps = v.into();
5539            self
5540        }
5541
5542        /// Sets the value of [pixel_format][crate::model::video_stream::H264CodecSettings::pixel_format].
5543        ///
5544        /// # Example
5545        /// ```ignore,no_run
5546        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5547        /// let x = H264CodecSettings::new().set_pixel_format("example");
5548        /// ```
5549        pub fn set_pixel_format<T: std::convert::Into<std::string::String>>(
5550            mut self,
5551            v: T,
5552        ) -> Self {
5553            self.pixel_format = v.into();
5554            self
5555        }
5556
5557        /// Sets the value of [rate_control_mode][crate::model::video_stream::H264CodecSettings::rate_control_mode].
5558        ///
5559        /// # Example
5560        /// ```ignore,no_run
5561        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5562        /// let x = H264CodecSettings::new().set_rate_control_mode("example");
5563        /// ```
5564        pub fn set_rate_control_mode<T: std::convert::Into<std::string::String>>(
5565            mut self,
5566            v: T,
5567        ) -> Self {
5568            self.rate_control_mode = v.into();
5569            self
5570        }
5571
5572        /// Sets the value of [crf_level][crate::model::video_stream::H264CodecSettings::crf_level].
5573        ///
5574        /// # Example
5575        /// ```ignore,no_run
5576        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5577        /// let x = H264CodecSettings::new().set_crf_level(42);
5578        /// ```
5579        pub fn set_crf_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5580            self.crf_level = v.into();
5581            self
5582        }
5583
5584        /// Sets the value of [allow_open_gop][crate::model::video_stream::H264CodecSettings::allow_open_gop].
5585        ///
5586        /// # Example
5587        /// ```ignore,no_run
5588        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5589        /// let x = H264CodecSettings::new().set_allow_open_gop(true);
5590        /// ```
5591        pub fn set_allow_open_gop<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5592            self.allow_open_gop = v.into();
5593            self
5594        }
5595
5596        /// Sets the value of [enable_two_pass][crate::model::video_stream::H264CodecSettings::enable_two_pass].
5597        ///
5598        /// # Example
5599        /// ```ignore,no_run
5600        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5601        /// let x = H264CodecSettings::new().set_enable_two_pass(true);
5602        /// ```
5603        pub fn set_enable_two_pass<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5604            self.enable_two_pass = v.into();
5605            self
5606        }
5607
5608        /// Sets the value of [vbv_size_bits][crate::model::video_stream::H264CodecSettings::vbv_size_bits].
5609        ///
5610        /// # Example
5611        /// ```ignore,no_run
5612        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5613        /// let x = H264CodecSettings::new().set_vbv_size_bits(42);
5614        /// ```
5615        pub fn set_vbv_size_bits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5616            self.vbv_size_bits = v.into();
5617            self
5618        }
5619
5620        /// Sets the value of [vbv_fullness_bits][crate::model::video_stream::H264CodecSettings::vbv_fullness_bits].
5621        ///
5622        /// # Example
5623        /// ```ignore,no_run
5624        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5625        /// let x = H264CodecSettings::new().set_vbv_fullness_bits(42);
5626        /// ```
5627        pub fn set_vbv_fullness_bits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5628            self.vbv_fullness_bits = v.into();
5629            self
5630        }
5631
5632        /// Sets the value of [entropy_coder][crate::model::video_stream::H264CodecSettings::entropy_coder].
5633        ///
5634        /// # Example
5635        /// ```ignore,no_run
5636        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5637        /// let x = H264CodecSettings::new().set_entropy_coder("example");
5638        /// ```
5639        pub fn set_entropy_coder<T: std::convert::Into<std::string::String>>(
5640            mut self,
5641            v: T,
5642        ) -> Self {
5643            self.entropy_coder = v.into();
5644            self
5645        }
5646
5647        /// Sets the value of [b_pyramid][crate::model::video_stream::H264CodecSettings::b_pyramid].
5648        ///
5649        /// # Example
5650        /// ```ignore,no_run
5651        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5652        /// let x = H264CodecSettings::new().set_b_pyramid(true);
5653        /// ```
5654        pub fn set_b_pyramid<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5655            self.b_pyramid = v.into();
5656            self
5657        }
5658
5659        /// Sets the value of [b_frame_count][crate::model::video_stream::H264CodecSettings::b_frame_count].
5660        ///
5661        /// # Example
5662        /// ```ignore,no_run
5663        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5664        /// let x = H264CodecSettings::new().set_b_frame_count(42);
5665        /// ```
5666        pub fn set_b_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5667            self.b_frame_count = v.into();
5668            self
5669        }
5670
5671        /// Sets the value of [aq_strength][crate::model::video_stream::H264CodecSettings::aq_strength].
5672        ///
5673        /// # Example
5674        /// ```ignore,no_run
5675        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5676        /// let x = H264CodecSettings::new().set_aq_strength(42.0);
5677        /// ```
5678        pub fn set_aq_strength<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
5679            self.aq_strength = v.into();
5680            self
5681        }
5682
5683        /// Sets the value of [profile][crate::model::video_stream::H264CodecSettings::profile].
5684        ///
5685        /// # Example
5686        /// ```ignore,no_run
5687        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5688        /// let x = H264CodecSettings::new().set_profile("example");
5689        /// ```
5690        pub fn set_profile<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5691            self.profile = v.into();
5692            self
5693        }
5694
5695        /// Sets the value of [tune][crate::model::video_stream::H264CodecSettings::tune].
5696        ///
5697        /// # Example
5698        /// ```ignore,no_run
5699        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5700        /// let x = H264CodecSettings::new().set_tune("example");
5701        /// ```
5702        pub fn set_tune<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5703            self.tune = v.into();
5704            self
5705        }
5706
5707        /// Sets the value of [preset][crate::model::video_stream::H264CodecSettings::preset].
5708        ///
5709        /// # Example
5710        /// ```ignore,no_run
5711        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5712        /// let x = H264CodecSettings::new().set_preset("example");
5713        /// ```
5714        pub fn set_preset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5715            self.preset = v.into();
5716            self
5717        }
5718
5719        /// Sets the value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode].
5720        ///
5721        /// Note that all the setters affecting `gop_mode` are mutually
5722        /// exclusive.
5723        ///
5724        /// # Example
5725        /// ```ignore,no_run
5726        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5727        /// use google_cloud_video_transcoder_v1::model::video_stream::h_264_codec_settings::GopMode;
5728        /// let x = H264CodecSettings::new().set_gop_mode(Some(GopMode::GopFrameCount(42)));
5729        /// ```
5730        pub fn set_gop_mode<
5731            T: std::convert::Into<
5732                    std::option::Option<crate::model::video_stream::h_264_codec_settings::GopMode>,
5733                >,
5734        >(
5735            mut self,
5736            v: T,
5737        ) -> Self {
5738            self.gop_mode = v.into();
5739            self
5740        }
5741
5742        /// The value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode]
5743        /// if it holds a `GopFrameCount`, `None` if the field is not set or
5744        /// holds a different branch.
5745        pub fn gop_frame_count(&self) -> std::option::Option<&i32> {
5746            #[allow(unreachable_patterns)]
5747            self.gop_mode.as_ref().and_then(|v| match v {
5748                crate::model::video_stream::h_264_codec_settings::GopMode::GopFrameCount(v) => {
5749                    std::option::Option::Some(v)
5750                }
5751                _ => std::option::Option::None,
5752            })
5753        }
5754
5755        /// Sets the value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode]
5756        /// to hold a `GopFrameCount`.
5757        ///
5758        /// Note that all the setters affecting `gop_mode` are
5759        /// mutually exclusive.
5760        ///
5761        /// # Example
5762        /// ```ignore,no_run
5763        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5764        /// let x = H264CodecSettings::new().set_gop_frame_count(42);
5765        /// assert!(x.gop_frame_count().is_some());
5766        /// assert!(x.gop_duration().is_none());
5767        /// ```
5768        pub fn set_gop_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5769            self.gop_mode = std::option::Option::Some(
5770                crate::model::video_stream::h_264_codec_settings::GopMode::GopFrameCount(v.into()),
5771            );
5772            self
5773        }
5774
5775        /// The value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode]
5776        /// if it holds a `GopDuration`, `None` if the field is not set or
5777        /// holds a different branch.
5778        pub fn gop_duration(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
5779            #[allow(unreachable_patterns)]
5780            self.gop_mode.as_ref().and_then(|v| match v {
5781                crate::model::video_stream::h_264_codec_settings::GopMode::GopDuration(v) => {
5782                    std::option::Option::Some(v)
5783                }
5784                _ => std::option::Option::None,
5785            })
5786        }
5787
5788        /// Sets the value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode]
5789        /// to hold a `GopDuration`.
5790        ///
5791        /// Note that all the setters affecting `gop_mode` are
5792        /// mutually exclusive.
5793        ///
5794        /// # Example
5795        /// ```ignore,no_run
5796        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5797        /// use wkt::Duration;
5798        /// let x = H264CodecSettings::new().set_gop_duration(Duration::default()/* use setters */);
5799        /// assert!(x.gop_duration().is_some());
5800        /// assert!(x.gop_frame_count().is_none());
5801        /// ```
5802        pub fn set_gop_duration<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
5803            mut self,
5804            v: T,
5805        ) -> Self {
5806            self.gop_mode = std::option::Option::Some(
5807                crate::model::video_stream::h_264_codec_settings::GopMode::GopDuration(v.into()),
5808            );
5809            self
5810        }
5811
5812        /// Sets the value of [color_format][crate::model::video_stream::H264CodecSettings::color_format].
5813        ///
5814        /// Note that all the setters affecting `color_format` are mutually
5815        /// exclusive.
5816        ///
5817        /// # Example
5818        /// ```ignore,no_run
5819        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5820        /// use google_cloud_video_transcoder_v1::model::video_stream::H264ColorFormatSDR;
5821        /// let x = H264CodecSettings::new().set_color_format(Some(
5822        ///     google_cloud_video_transcoder_v1::model::video_stream::h_264_codec_settings::ColorFormat::Sdr(H264ColorFormatSDR::default().into())));
5823        /// ```
5824        pub fn set_color_format<
5825            T: std::convert::Into<
5826                    std::option::Option<
5827                        crate::model::video_stream::h_264_codec_settings::ColorFormat,
5828                    >,
5829                >,
5830        >(
5831            mut self,
5832            v: T,
5833        ) -> Self {
5834            self.color_format = v.into();
5835            self
5836        }
5837
5838        /// The value of [color_format][crate::model::video_stream::H264CodecSettings::color_format]
5839        /// if it holds a `Sdr`, `None` if the field is not set or
5840        /// holds a different branch.
5841        pub fn sdr(
5842            &self,
5843        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H264ColorFormatSDR>>
5844        {
5845            #[allow(unreachable_patterns)]
5846            self.color_format.as_ref().and_then(|v| match v {
5847                crate::model::video_stream::h_264_codec_settings::ColorFormat::Sdr(v) => {
5848                    std::option::Option::Some(v)
5849                }
5850                _ => std::option::Option::None,
5851            })
5852        }
5853
5854        /// Sets the value of [color_format][crate::model::video_stream::H264CodecSettings::color_format]
5855        /// to hold a `Sdr`.
5856        ///
5857        /// Note that all the setters affecting `color_format` are
5858        /// mutually exclusive.
5859        ///
5860        /// # Example
5861        /// ```ignore,no_run
5862        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5863        /// use google_cloud_video_transcoder_v1::model::video_stream::H264ColorFormatSDR;
5864        /// let x = H264CodecSettings::new().set_sdr(H264ColorFormatSDR::default()/* use setters */);
5865        /// assert!(x.sdr().is_some());
5866        /// assert!(x.hlg().is_none());
5867        /// ```
5868        pub fn set_sdr<
5869            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H264ColorFormatSDR>>,
5870        >(
5871            mut self,
5872            v: T,
5873        ) -> Self {
5874            self.color_format = std::option::Option::Some(
5875                crate::model::video_stream::h_264_codec_settings::ColorFormat::Sdr(v.into()),
5876            );
5877            self
5878        }
5879
5880        /// The value of [color_format][crate::model::video_stream::H264CodecSettings::color_format]
5881        /// if it holds a `Hlg`, `None` if the field is not set or
5882        /// holds a different branch.
5883        pub fn hlg(
5884            &self,
5885        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H264ColorFormatHLG>>
5886        {
5887            #[allow(unreachable_patterns)]
5888            self.color_format.as_ref().and_then(|v| match v {
5889                crate::model::video_stream::h_264_codec_settings::ColorFormat::Hlg(v) => {
5890                    std::option::Option::Some(v)
5891                }
5892                _ => std::option::Option::None,
5893            })
5894        }
5895
5896        /// Sets the value of [color_format][crate::model::video_stream::H264CodecSettings::color_format]
5897        /// to hold a `Hlg`.
5898        ///
5899        /// Note that all the setters affecting `color_format` are
5900        /// mutually exclusive.
5901        ///
5902        /// # Example
5903        /// ```ignore,no_run
5904        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5905        /// use google_cloud_video_transcoder_v1::model::video_stream::H264ColorFormatHLG;
5906        /// let x = H264CodecSettings::new().set_hlg(H264ColorFormatHLG::default()/* use setters */);
5907        /// assert!(x.hlg().is_some());
5908        /// assert!(x.sdr().is_none());
5909        /// ```
5910        pub fn set_hlg<
5911            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H264ColorFormatHLG>>,
5912        >(
5913            mut self,
5914            v: T,
5915        ) -> Self {
5916            self.color_format = std::option::Option::Some(
5917                crate::model::video_stream::h_264_codec_settings::ColorFormat::Hlg(v.into()),
5918            );
5919            self
5920        }
5921    }
5922
5923    impl wkt::message::Message for H264CodecSettings {
5924        fn typename() -> &'static str {
5925            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings"
5926        }
5927    }
5928
5929    /// Defines additional types related to [H264CodecSettings].
5930    pub mod h_264_codec_settings {
5931        #[allow(unused_imports)]
5932        use super::*;
5933
5934        /// GOP mode can be either by frame count or duration.
5935        #[derive(Clone, Debug, PartialEq)]
5936        #[non_exhaustive]
5937        pub enum GopMode {
5938            /// Select the GOP size based on the specified frame count. Must be greater
5939            /// than zero.
5940            GopFrameCount(i32),
5941            /// Select the GOP size based on the specified duration. The default is
5942            /// `3s`. Note that `gopDuration` must be less than or equal to
5943            /// [`segmentDuration`](#SegmentSettings), and
5944            /// [`segmentDuration`](#SegmentSettings) must be divisible by
5945            /// `gopDuration`.
5946            GopDuration(std::boxed::Box<wkt::Duration>),
5947        }
5948
5949        /// Color format can be sdr or hlg.
5950        #[derive(Clone, Debug, PartialEq)]
5951        #[non_exhaustive]
5952        pub enum ColorFormat {
5953            /// Optional. SDR color format setting for H264.
5954            Sdr(std::boxed::Box<crate::model::video_stream::H264ColorFormatSDR>),
5955            /// Optional. HLG color format setting for H264.
5956            Hlg(std::boxed::Box<crate::model::video_stream::H264ColorFormatHLG>),
5957        }
5958    }
5959
5960    /// Convert the input video to a Standard Dynamic Range (SDR) video.
5961    #[derive(Clone, Default, PartialEq)]
5962    #[non_exhaustive]
5963    pub struct H265ColorFormatSDR {
5964        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5965    }
5966
5967    impl H265ColorFormatSDR {
5968        pub fn new() -> Self {
5969            std::default::Default::default()
5970        }
5971    }
5972
5973    impl wkt::message::Message for H265ColorFormatSDR {
5974        fn typename() -> &'static str {
5975            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H265ColorFormatSDR"
5976        }
5977    }
5978
5979    /// Convert the input video to a Hybrid Log Gamma (HLG) video.
5980    #[derive(Clone, Default, PartialEq)]
5981    #[non_exhaustive]
5982    pub struct H265ColorFormatHLG {
5983        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5984    }
5985
5986    impl H265ColorFormatHLG {
5987        pub fn new() -> Self {
5988            std::default::Default::default()
5989        }
5990    }
5991
5992    impl wkt::message::Message for H265ColorFormatHLG {
5993        fn typename() -> &'static str {
5994            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H265ColorFormatHLG"
5995        }
5996    }
5997
5998    /// Convert the input video to a High Dynamic Range 10 (HDR10) video.
5999    #[derive(Clone, Default, PartialEq)]
6000    #[non_exhaustive]
6001    pub struct H265ColorFormatHDR10 {
6002        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6003    }
6004
6005    impl H265ColorFormatHDR10 {
6006        pub fn new() -> Self {
6007            std::default::Default::default()
6008        }
6009    }
6010
6011    impl wkt::message::Message for H265ColorFormatHDR10 {
6012        fn typename() -> &'static str {
6013            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H265ColorFormatHDR10"
6014        }
6015    }
6016
6017    /// H265 codec settings.
6018    #[derive(Clone, Default, PartialEq)]
6019    #[non_exhaustive]
6020    pub struct H265CodecSettings {
6021        /// The width of the video in pixels. Must be an even integer.
6022        /// When not specified, the width is adjusted to match the specified height
6023        /// and input aspect ratio. If both are omitted, the input width is used.
6024        ///
6025        /// For portrait videos that contain horizontal ASR and rotation metadata,
6026        /// provide the width, in pixels, per the horizontal ASR. The API calculates
6027        /// the height per the horizontal ASR. The API detects any rotation metadata
6028        /// and swaps the requested height and width for the output.
6029        pub width_pixels: i32,
6030
6031        /// The height of the video in pixels. Must be an even integer.
6032        /// When not specified, the height is adjusted to match the specified width
6033        /// and input aspect ratio. If both are omitted, the input height is used.
6034        ///
6035        /// For portrait videos that contain horizontal ASR and rotation metadata,
6036        /// provide the height, in pixels, per the horizontal ASR. The API calculates
6037        /// the width per the horizontal ASR. The API detects any rotation metadata
6038        /// and swaps the requested height and width for the output.
6039        pub height_pixels: i32,
6040
6041        /// Required. The target video frame rate in frames per second (FPS). Must be
6042        /// less than or equal to 120.
6043        pub frame_rate: f64,
6044
6045        /// Optional. Frame rate conversion strategy for desired frame rate. The
6046        /// default is `DOWNSAMPLE`.
6047        pub frame_rate_conversion_strategy: crate::model::video_stream::FrameRateConversionStrategy,
6048
6049        /// Required. The video bitrate in bits per second. The minimum value is
6050        /// 1,000. The maximum value is 800,000,000.
6051        pub bitrate_bps: i32,
6052
6053        /// Pixel format to use. The default is `yuv420p`.
6054        ///
6055        /// Supported pixel formats:
6056        ///
6057        /// - `yuv420p` pixel format
6058        /// - `yuv422p` pixel format
6059        /// - `yuv444p` pixel format
6060        /// - `yuv420p10` 10-bit HDR pixel format
6061        /// - `yuv422p10` 10-bit HDR pixel format
6062        /// - `yuv444p10` 10-bit HDR pixel format
6063        /// - `yuv420p12` 12-bit HDR pixel format
6064        /// - `yuv422p12` 12-bit HDR pixel format
6065        /// - `yuv444p12` 12-bit HDR pixel format
6066        pub pixel_format: std::string::String,
6067
6068        /// Specify the mode. The default is `vbr`.
6069        ///
6070        /// Supported rate control modes:
6071        ///
6072        /// - `vbr` - variable bitrate
6073        /// - `crf` - constant rate factor
6074        pub rate_control_mode: std::string::String,
6075
6076        /// Target CRF level. Must be between 10 and 36, where 10 is the highest
6077        /// quality and 36 is the most efficient compression. The default is 21.
6078        pub crf_level: i32,
6079
6080        /// Specifies whether an open Group of Pictures (GOP) structure should be
6081        /// allowed or not. The default is `false`.
6082        pub allow_open_gop: bool,
6083
6084        /// Use two-pass encoding strategy to achieve better video quality.
6085        /// [H265CodecSettings.rate_control_mode][google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.rate_control_mode]
6086        /// must be `vbr`. The default is `false`.
6087        ///
6088        /// [google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.rate_control_mode]: crate::model::video_stream::H265CodecSettings::rate_control_mode
6089        pub enable_two_pass: bool,
6090
6091        /// Size of the Video Buffering Verifier (VBV) buffer in bits. Must be
6092        /// greater than zero. The default is equal to `VideoStream.bitrate_bps`.
6093        pub vbv_size_bits: i32,
6094
6095        /// Initial fullness of the Video Buffering Verifier (VBV) buffer in bits.
6096        /// Must be greater than zero. The default is equal to 90% of
6097        /// [H265CodecSettings.vbv_size_bits][google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.vbv_size_bits].
6098        ///
6099        /// [google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.vbv_size_bits]: crate::model::video_stream::H265CodecSettings::vbv_size_bits
6100        pub vbv_fullness_bits: i32,
6101
6102        /// Allow B-pyramid for reference frame selection. This may not be supported
6103        /// on all decoders. The default is `false`.
6104        pub b_pyramid: bool,
6105
6106        /// The number of consecutive B-frames. Must be greater than or equal to
6107        /// zero. Must be less than
6108        /// [H265CodecSettings.gop_frame_count][google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.gop_frame_count]
6109        /// if set. The default is 0.
6110        ///
6111        /// [google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.gop_frame_count]: crate::model::video_stream::H265CodecSettings::gop_mode
6112        pub b_frame_count: i32,
6113
6114        /// Specify the intensity of the adaptive quantizer (AQ). Must be between 0
6115        /// and 1, where 0 disables the quantizer and 1 maximizes the quantizer. A
6116        /// higher value equals a lower bitrate but smoother image. The default is 0.
6117        pub aq_strength: f64,
6118
6119        /// Enforces the specified codec profile. The following profiles are
6120        /// supported:
6121        ///
6122        /// * 8-bit profiles
6123        ///   * `main` (default)
6124        ///   * `main-intra`
6125        ///   * `mainstillpicture`
6126        /// * 10-bit profiles
6127        ///   * `main10` (default)
6128        ///   * `main10-intra`
6129        ///   * `main422-10`
6130        ///   * `main422-10-intra`
6131        ///   * `main444-10`
6132        ///   * `main444-10-intra`
6133        /// * 12-bit profiles
6134        ///   * `main12` (default)
6135        ///   * `main12-intra`
6136        ///   * `main422-12`
6137        ///   * `main422-12-intra`
6138        ///   * `main444-12`
6139        ///   * `main444-12-intra`
6140        ///
6141        /// The available options are
6142        /// [FFmpeg-compatible](https://x265.readthedocs.io/).
6143        /// Note that certain values for this field may cause the
6144        /// transcoder to override other fields you set in the `H265CodecSettings`
6145        /// message.
6146        pub profile: std::string::String,
6147
6148        /// Enforces the specified codec tune. The available options are
6149        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.265).
6150        /// Note that certain values for this field may cause the
6151        /// transcoder to override other fields you set in the `H265CodecSettings`
6152        /// message.
6153        pub tune: std::string::String,
6154
6155        /// Enforces the specified codec preset. The default is `veryfast`. The
6156        /// available options are
6157        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.265).
6158        /// Note that certain values for this field may cause the
6159        /// transcoder to override other fields you set in the `H265CodecSettings`
6160        /// message.
6161        pub preset: std::string::String,
6162
6163        /// GOP mode can be either by frame count or duration.
6164        pub gop_mode:
6165            std::option::Option<crate::model::video_stream::h_265_codec_settings::GopMode>,
6166
6167        /// Color format can be sdr, hlg, hdr10.
6168        pub color_format:
6169            std::option::Option<crate::model::video_stream::h_265_codec_settings::ColorFormat>,
6170
6171        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6172    }
6173
6174    impl H265CodecSettings {
6175        pub fn new() -> Self {
6176            std::default::Default::default()
6177        }
6178
6179        /// Sets the value of [width_pixels][crate::model::video_stream::H265CodecSettings::width_pixels].
6180        ///
6181        /// # Example
6182        /// ```ignore,no_run
6183        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6184        /// let x = H265CodecSettings::new().set_width_pixels(42);
6185        /// ```
6186        pub fn set_width_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6187            self.width_pixels = v.into();
6188            self
6189        }
6190
6191        /// Sets the value of [height_pixels][crate::model::video_stream::H265CodecSettings::height_pixels].
6192        ///
6193        /// # Example
6194        /// ```ignore,no_run
6195        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6196        /// let x = H265CodecSettings::new().set_height_pixels(42);
6197        /// ```
6198        pub fn set_height_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6199            self.height_pixels = v.into();
6200            self
6201        }
6202
6203        /// Sets the value of [frame_rate][crate::model::video_stream::H265CodecSettings::frame_rate].
6204        ///
6205        /// # Example
6206        /// ```ignore,no_run
6207        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6208        /// let x = H265CodecSettings::new().set_frame_rate(42.0);
6209        /// ```
6210        pub fn set_frame_rate<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
6211            self.frame_rate = v.into();
6212            self
6213        }
6214
6215        /// Sets the value of [frame_rate_conversion_strategy][crate::model::video_stream::H265CodecSettings::frame_rate_conversion_strategy].
6216        ///
6217        /// # Example
6218        /// ```ignore,no_run
6219        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6220        /// use google_cloud_video_transcoder_v1::model::video_stream::FrameRateConversionStrategy;
6221        /// let x0 = H265CodecSettings::new().set_frame_rate_conversion_strategy(FrameRateConversionStrategy::Downsample);
6222        /// let x1 = H265CodecSettings::new().set_frame_rate_conversion_strategy(FrameRateConversionStrategy::DropDuplicate);
6223        /// ```
6224        pub fn set_frame_rate_conversion_strategy<
6225            T: std::convert::Into<crate::model::video_stream::FrameRateConversionStrategy>,
6226        >(
6227            mut self,
6228            v: T,
6229        ) -> Self {
6230            self.frame_rate_conversion_strategy = v.into();
6231            self
6232        }
6233
6234        /// Sets the value of [bitrate_bps][crate::model::video_stream::H265CodecSettings::bitrate_bps].
6235        ///
6236        /// # Example
6237        /// ```ignore,no_run
6238        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6239        /// let x = H265CodecSettings::new().set_bitrate_bps(42);
6240        /// ```
6241        pub fn set_bitrate_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6242            self.bitrate_bps = v.into();
6243            self
6244        }
6245
6246        /// Sets the value of [pixel_format][crate::model::video_stream::H265CodecSettings::pixel_format].
6247        ///
6248        /// # Example
6249        /// ```ignore,no_run
6250        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6251        /// let x = H265CodecSettings::new().set_pixel_format("example");
6252        /// ```
6253        pub fn set_pixel_format<T: std::convert::Into<std::string::String>>(
6254            mut self,
6255            v: T,
6256        ) -> Self {
6257            self.pixel_format = v.into();
6258            self
6259        }
6260
6261        /// Sets the value of [rate_control_mode][crate::model::video_stream::H265CodecSettings::rate_control_mode].
6262        ///
6263        /// # Example
6264        /// ```ignore,no_run
6265        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6266        /// let x = H265CodecSettings::new().set_rate_control_mode("example");
6267        /// ```
6268        pub fn set_rate_control_mode<T: std::convert::Into<std::string::String>>(
6269            mut self,
6270            v: T,
6271        ) -> Self {
6272            self.rate_control_mode = v.into();
6273            self
6274        }
6275
6276        /// Sets the value of [crf_level][crate::model::video_stream::H265CodecSettings::crf_level].
6277        ///
6278        /// # Example
6279        /// ```ignore,no_run
6280        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6281        /// let x = H265CodecSettings::new().set_crf_level(42);
6282        /// ```
6283        pub fn set_crf_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6284            self.crf_level = v.into();
6285            self
6286        }
6287
6288        /// Sets the value of [allow_open_gop][crate::model::video_stream::H265CodecSettings::allow_open_gop].
6289        ///
6290        /// # Example
6291        /// ```ignore,no_run
6292        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6293        /// let x = H265CodecSettings::new().set_allow_open_gop(true);
6294        /// ```
6295        pub fn set_allow_open_gop<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6296            self.allow_open_gop = v.into();
6297            self
6298        }
6299
6300        /// Sets the value of [enable_two_pass][crate::model::video_stream::H265CodecSettings::enable_two_pass].
6301        ///
6302        /// # Example
6303        /// ```ignore,no_run
6304        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6305        /// let x = H265CodecSettings::new().set_enable_two_pass(true);
6306        /// ```
6307        pub fn set_enable_two_pass<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6308            self.enable_two_pass = v.into();
6309            self
6310        }
6311
6312        /// Sets the value of [vbv_size_bits][crate::model::video_stream::H265CodecSettings::vbv_size_bits].
6313        ///
6314        /// # Example
6315        /// ```ignore,no_run
6316        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6317        /// let x = H265CodecSettings::new().set_vbv_size_bits(42);
6318        /// ```
6319        pub fn set_vbv_size_bits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6320            self.vbv_size_bits = v.into();
6321            self
6322        }
6323
6324        /// Sets the value of [vbv_fullness_bits][crate::model::video_stream::H265CodecSettings::vbv_fullness_bits].
6325        ///
6326        /// # Example
6327        /// ```ignore,no_run
6328        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6329        /// let x = H265CodecSettings::new().set_vbv_fullness_bits(42);
6330        /// ```
6331        pub fn set_vbv_fullness_bits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6332            self.vbv_fullness_bits = v.into();
6333            self
6334        }
6335
6336        /// Sets the value of [b_pyramid][crate::model::video_stream::H265CodecSettings::b_pyramid].
6337        ///
6338        /// # Example
6339        /// ```ignore,no_run
6340        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6341        /// let x = H265CodecSettings::new().set_b_pyramid(true);
6342        /// ```
6343        pub fn set_b_pyramid<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6344            self.b_pyramid = v.into();
6345            self
6346        }
6347
6348        /// Sets the value of [b_frame_count][crate::model::video_stream::H265CodecSettings::b_frame_count].
6349        ///
6350        /// # Example
6351        /// ```ignore,no_run
6352        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6353        /// let x = H265CodecSettings::new().set_b_frame_count(42);
6354        /// ```
6355        pub fn set_b_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6356            self.b_frame_count = v.into();
6357            self
6358        }
6359
6360        /// Sets the value of [aq_strength][crate::model::video_stream::H265CodecSettings::aq_strength].
6361        ///
6362        /// # Example
6363        /// ```ignore,no_run
6364        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6365        /// let x = H265CodecSettings::new().set_aq_strength(42.0);
6366        /// ```
6367        pub fn set_aq_strength<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
6368            self.aq_strength = v.into();
6369            self
6370        }
6371
6372        /// Sets the value of [profile][crate::model::video_stream::H265CodecSettings::profile].
6373        ///
6374        /// # Example
6375        /// ```ignore,no_run
6376        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6377        /// let x = H265CodecSettings::new().set_profile("example");
6378        /// ```
6379        pub fn set_profile<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6380            self.profile = v.into();
6381            self
6382        }
6383
6384        /// Sets the value of [tune][crate::model::video_stream::H265CodecSettings::tune].
6385        ///
6386        /// # Example
6387        /// ```ignore,no_run
6388        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6389        /// let x = H265CodecSettings::new().set_tune("example");
6390        /// ```
6391        pub fn set_tune<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6392            self.tune = v.into();
6393            self
6394        }
6395
6396        /// Sets the value of [preset][crate::model::video_stream::H265CodecSettings::preset].
6397        ///
6398        /// # Example
6399        /// ```ignore,no_run
6400        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6401        /// let x = H265CodecSettings::new().set_preset("example");
6402        /// ```
6403        pub fn set_preset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6404            self.preset = v.into();
6405            self
6406        }
6407
6408        /// Sets the value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode].
6409        ///
6410        /// Note that all the setters affecting `gop_mode` are mutually
6411        /// exclusive.
6412        ///
6413        /// # Example
6414        /// ```ignore,no_run
6415        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6416        /// use google_cloud_video_transcoder_v1::model::video_stream::h_265_codec_settings::GopMode;
6417        /// let x = H265CodecSettings::new().set_gop_mode(Some(GopMode::GopFrameCount(42)));
6418        /// ```
6419        pub fn set_gop_mode<
6420            T: std::convert::Into<
6421                    std::option::Option<crate::model::video_stream::h_265_codec_settings::GopMode>,
6422                >,
6423        >(
6424            mut self,
6425            v: T,
6426        ) -> Self {
6427            self.gop_mode = v.into();
6428            self
6429        }
6430
6431        /// The value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode]
6432        /// if it holds a `GopFrameCount`, `None` if the field is not set or
6433        /// holds a different branch.
6434        pub fn gop_frame_count(&self) -> std::option::Option<&i32> {
6435            #[allow(unreachable_patterns)]
6436            self.gop_mode.as_ref().and_then(|v| match v {
6437                crate::model::video_stream::h_265_codec_settings::GopMode::GopFrameCount(v) => {
6438                    std::option::Option::Some(v)
6439                }
6440                _ => std::option::Option::None,
6441            })
6442        }
6443
6444        /// Sets the value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode]
6445        /// to hold a `GopFrameCount`.
6446        ///
6447        /// Note that all the setters affecting `gop_mode` are
6448        /// mutually exclusive.
6449        ///
6450        /// # Example
6451        /// ```ignore,no_run
6452        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6453        /// let x = H265CodecSettings::new().set_gop_frame_count(42);
6454        /// assert!(x.gop_frame_count().is_some());
6455        /// assert!(x.gop_duration().is_none());
6456        /// ```
6457        pub fn set_gop_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6458            self.gop_mode = std::option::Option::Some(
6459                crate::model::video_stream::h_265_codec_settings::GopMode::GopFrameCount(v.into()),
6460            );
6461            self
6462        }
6463
6464        /// The value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode]
6465        /// if it holds a `GopDuration`, `None` if the field is not set or
6466        /// holds a different branch.
6467        pub fn gop_duration(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
6468            #[allow(unreachable_patterns)]
6469            self.gop_mode.as_ref().and_then(|v| match v {
6470                crate::model::video_stream::h_265_codec_settings::GopMode::GopDuration(v) => {
6471                    std::option::Option::Some(v)
6472                }
6473                _ => std::option::Option::None,
6474            })
6475        }
6476
6477        /// Sets the value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode]
6478        /// to hold a `GopDuration`.
6479        ///
6480        /// Note that all the setters affecting `gop_mode` are
6481        /// mutually exclusive.
6482        ///
6483        /// # Example
6484        /// ```ignore,no_run
6485        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6486        /// use wkt::Duration;
6487        /// let x = H265CodecSettings::new().set_gop_duration(Duration::default()/* use setters */);
6488        /// assert!(x.gop_duration().is_some());
6489        /// assert!(x.gop_frame_count().is_none());
6490        /// ```
6491        pub fn set_gop_duration<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
6492            mut self,
6493            v: T,
6494        ) -> Self {
6495            self.gop_mode = std::option::Option::Some(
6496                crate::model::video_stream::h_265_codec_settings::GopMode::GopDuration(v.into()),
6497            );
6498            self
6499        }
6500
6501        /// Sets the value of [color_format][crate::model::video_stream::H265CodecSettings::color_format].
6502        ///
6503        /// Note that all the setters affecting `color_format` are mutually
6504        /// exclusive.
6505        ///
6506        /// # Example
6507        /// ```ignore,no_run
6508        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6509        /// use google_cloud_video_transcoder_v1::model::video_stream::H265ColorFormatSDR;
6510        /// let x = H265CodecSettings::new().set_color_format(Some(
6511        ///     google_cloud_video_transcoder_v1::model::video_stream::h_265_codec_settings::ColorFormat::Sdr(H265ColorFormatSDR::default().into())));
6512        /// ```
6513        pub fn set_color_format<
6514            T: std::convert::Into<
6515                    std::option::Option<
6516                        crate::model::video_stream::h_265_codec_settings::ColorFormat,
6517                    >,
6518                >,
6519        >(
6520            mut self,
6521            v: T,
6522        ) -> Self {
6523            self.color_format = v.into();
6524            self
6525        }
6526
6527        /// The value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
6528        /// if it holds a `Sdr`, `None` if the field is not set or
6529        /// holds a different branch.
6530        pub fn sdr(
6531            &self,
6532        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H265ColorFormatSDR>>
6533        {
6534            #[allow(unreachable_patterns)]
6535            self.color_format.as_ref().and_then(|v| match v {
6536                crate::model::video_stream::h_265_codec_settings::ColorFormat::Sdr(v) => {
6537                    std::option::Option::Some(v)
6538                }
6539                _ => std::option::Option::None,
6540            })
6541        }
6542
6543        /// Sets the value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
6544        /// to hold a `Sdr`.
6545        ///
6546        /// Note that all the setters affecting `color_format` are
6547        /// mutually exclusive.
6548        ///
6549        /// # Example
6550        /// ```ignore,no_run
6551        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6552        /// use google_cloud_video_transcoder_v1::model::video_stream::H265ColorFormatSDR;
6553        /// let x = H265CodecSettings::new().set_sdr(H265ColorFormatSDR::default()/* use setters */);
6554        /// assert!(x.sdr().is_some());
6555        /// assert!(x.hlg().is_none());
6556        /// assert!(x.hdr10().is_none());
6557        /// ```
6558        pub fn set_sdr<
6559            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H265ColorFormatSDR>>,
6560        >(
6561            mut self,
6562            v: T,
6563        ) -> Self {
6564            self.color_format = std::option::Option::Some(
6565                crate::model::video_stream::h_265_codec_settings::ColorFormat::Sdr(v.into()),
6566            );
6567            self
6568        }
6569
6570        /// The value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
6571        /// if it holds a `Hlg`, `None` if the field is not set or
6572        /// holds a different branch.
6573        pub fn hlg(
6574            &self,
6575        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H265ColorFormatHLG>>
6576        {
6577            #[allow(unreachable_patterns)]
6578            self.color_format.as_ref().and_then(|v| match v {
6579                crate::model::video_stream::h_265_codec_settings::ColorFormat::Hlg(v) => {
6580                    std::option::Option::Some(v)
6581                }
6582                _ => std::option::Option::None,
6583            })
6584        }
6585
6586        /// Sets the value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
6587        /// to hold a `Hlg`.
6588        ///
6589        /// Note that all the setters affecting `color_format` are
6590        /// mutually exclusive.
6591        ///
6592        /// # Example
6593        /// ```ignore,no_run
6594        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6595        /// use google_cloud_video_transcoder_v1::model::video_stream::H265ColorFormatHLG;
6596        /// let x = H265CodecSettings::new().set_hlg(H265ColorFormatHLG::default()/* use setters */);
6597        /// assert!(x.hlg().is_some());
6598        /// assert!(x.sdr().is_none());
6599        /// assert!(x.hdr10().is_none());
6600        /// ```
6601        pub fn set_hlg<
6602            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H265ColorFormatHLG>>,
6603        >(
6604            mut self,
6605            v: T,
6606        ) -> Self {
6607            self.color_format = std::option::Option::Some(
6608                crate::model::video_stream::h_265_codec_settings::ColorFormat::Hlg(v.into()),
6609            );
6610            self
6611        }
6612
6613        /// The value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
6614        /// if it holds a `Hdr10`, `None` if the field is not set or
6615        /// holds a different branch.
6616        pub fn hdr10(
6617            &self,
6618        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H265ColorFormatHDR10>>
6619        {
6620            #[allow(unreachable_patterns)]
6621            self.color_format.as_ref().and_then(|v| match v {
6622                crate::model::video_stream::h_265_codec_settings::ColorFormat::Hdr10(v) => {
6623                    std::option::Option::Some(v)
6624                }
6625                _ => std::option::Option::None,
6626            })
6627        }
6628
6629        /// Sets the value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
6630        /// to hold a `Hdr10`.
6631        ///
6632        /// Note that all the setters affecting `color_format` are
6633        /// mutually exclusive.
6634        ///
6635        /// # Example
6636        /// ```ignore,no_run
6637        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6638        /// use google_cloud_video_transcoder_v1::model::video_stream::H265ColorFormatHDR10;
6639        /// let x = H265CodecSettings::new().set_hdr10(H265ColorFormatHDR10::default()/* use setters */);
6640        /// assert!(x.hdr10().is_some());
6641        /// assert!(x.sdr().is_none());
6642        /// assert!(x.hlg().is_none());
6643        /// ```
6644        pub fn set_hdr10<
6645            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H265ColorFormatHDR10>>,
6646        >(
6647            mut self,
6648            v: T,
6649        ) -> Self {
6650            self.color_format = std::option::Option::Some(
6651                crate::model::video_stream::h_265_codec_settings::ColorFormat::Hdr10(v.into()),
6652            );
6653            self
6654        }
6655    }
6656
6657    impl wkt::message::Message for H265CodecSettings {
6658        fn typename() -> &'static str {
6659            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings"
6660        }
6661    }
6662
6663    /// Defines additional types related to [H265CodecSettings].
6664    pub mod h_265_codec_settings {
6665        #[allow(unused_imports)]
6666        use super::*;
6667
6668        /// GOP mode can be either by frame count or duration.
6669        #[derive(Clone, Debug, PartialEq)]
6670        #[non_exhaustive]
6671        pub enum GopMode {
6672            /// Select the GOP size based on the specified frame count. Must be greater
6673            /// than zero.
6674            GopFrameCount(i32),
6675            /// Select the GOP size based on the specified duration. The default is
6676            /// `3s`. Note that `gopDuration` must be less than or equal to
6677            /// [`segmentDuration`](#SegmentSettings), and
6678            /// [`segmentDuration`](#SegmentSettings) must be divisible by
6679            /// `gopDuration`.
6680            GopDuration(std::boxed::Box<wkt::Duration>),
6681        }
6682
6683        /// Color format can be sdr, hlg, hdr10.
6684        #[derive(Clone, Debug, PartialEq)]
6685        #[non_exhaustive]
6686        pub enum ColorFormat {
6687            /// Optional. SDR color format setting for H265.
6688            Sdr(std::boxed::Box<crate::model::video_stream::H265ColorFormatSDR>),
6689            /// Optional. HLG color format setting for H265.
6690            Hlg(std::boxed::Box<crate::model::video_stream::H265ColorFormatHLG>),
6691            /// Optional. HDR10 color format setting for H265.
6692            Hdr10(std::boxed::Box<crate::model::video_stream::H265ColorFormatHDR10>),
6693        }
6694    }
6695
6696    /// Convert the input video to a Standard Dynamic Range (SDR) video.
6697    #[derive(Clone, Default, PartialEq)]
6698    #[non_exhaustive]
6699    pub struct Vp9ColorFormatSDR {
6700        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6701    }
6702
6703    impl Vp9ColorFormatSDR {
6704        pub fn new() -> Self {
6705            std::default::Default::default()
6706        }
6707    }
6708
6709    impl wkt::message::Message for Vp9ColorFormatSDR {
6710        fn typename() -> &'static str {
6711            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.Vp9ColorFormatSDR"
6712        }
6713    }
6714
6715    /// Convert the input video to a Hybrid Log Gamma (HLG) video.
6716    #[derive(Clone, Default, PartialEq)]
6717    #[non_exhaustive]
6718    pub struct Vp9ColorFormatHLG {
6719        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6720    }
6721
6722    impl Vp9ColorFormatHLG {
6723        pub fn new() -> Self {
6724            std::default::Default::default()
6725        }
6726    }
6727
6728    impl wkt::message::Message for Vp9ColorFormatHLG {
6729        fn typename() -> &'static str {
6730            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.Vp9ColorFormatHLG"
6731        }
6732    }
6733
6734    /// VP9 codec settings.
6735    #[derive(Clone, Default, PartialEq)]
6736    #[non_exhaustive]
6737    pub struct Vp9CodecSettings {
6738        /// The width of the video in pixels. Must be an even integer.
6739        /// When not specified, the width is adjusted to match the specified height
6740        /// and input aspect ratio. If both are omitted, the input width is used.
6741        ///
6742        /// For portrait videos that contain horizontal ASR and rotation metadata,
6743        /// provide the width, in pixels, per the horizontal ASR. The API calculates
6744        /// the height per the horizontal ASR. The API detects any rotation metadata
6745        /// and swaps the requested height and width for the output.
6746        pub width_pixels: i32,
6747
6748        /// The height of the video in pixels. Must be an even integer.
6749        /// When not specified, the height is adjusted to match the specified width
6750        /// and input aspect ratio. If both are omitted, the input height is used.
6751        ///
6752        /// For portrait videos that contain horizontal ASR and rotation metadata,
6753        /// provide the height, in pixels, per the horizontal ASR. The API calculates
6754        /// the width per the horizontal ASR. The API detects any rotation metadata
6755        /// and swaps the requested height and width for the output.
6756        pub height_pixels: i32,
6757
6758        /// Required. The target video frame rate in frames per second (FPS). Must be
6759        /// less than or equal to 120.
6760        pub frame_rate: f64,
6761
6762        /// Optional. Frame rate conversion strategy for desired frame rate. The
6763        /// default is `DOWNSAMPLE`.
6764        pub frame_rate_conversion_strategy: crate::model::video_stream::FrameRateConversionStrategy,
6765
6766        /// Required. The video bitrate in bits per second. The minimum value is
6767        /// 1,000. The maximum value is 480,000,000.
6768        pub bitrate_bps: i32,
6769
6770        /// Pixel format to use. The default is `yuv420p`.
6771        ///
6772        /// Supported pixel formats:
6773        ///
6774        /// - `yuv420p` pixel format
6775        /// - `yuv422p` pixel format
6776        /// - `yuv444p` pixel format
6777        /// - `yuv420p10` 10-bit HDR pixel format
6778        /// - `yuv422p10` 10-bit HDR pixel format
6779        /// - `yuv444p10` 10-bit HDR pixel format
6780        /// - `yuv420p12` 12-bit HDR pixel format
6781        /// - `yuv422p12` 12-bit HDR pixel format
6782        /// - `yuv444p12` 12-bit HDR pixel format
6783        pub pixel_format: std::string::String,
6784
6785        /// Specify the mode. The default is `vbr`.
6786        ///
6787        /// Supported rate control modes:
6788        ///
6789        /// - `vbr` - variable bitrate
6790        pub rate_control_mode: std::string::String,
6791
6792        /// Target CRF level. Must be between 10 and 36, where 10 is the highest
6793        /// quality and 36 is the most efficient compression. The default is 21.
6794        ///
6795        /// **Note:** This field is not supported.
6796        pub crf_level: i32,
6797
6798        /// Enforces the specified codec profile. The following profiles are
6799        /// supported:
6800        ///
6801        /// * `profile0` (default)
6802        /// * `profile1`
6803        /// * `profile2`
6804        /// * `profile3`
6805        ///
6806        /// The available options are
6807        /// [WebM-compatible](https://www.webmproject.org/vp9/profiles/).
6808        /// Note that certain values for this field may cause the
6809        /// transcoder to override other fields you set in the `Vp9CodecSettings`
6810        /// message.
6811        pub profile: std::string::String,
6812
6813        /// GOP mode can be either by frame count or duration.
6814        pub gop_mode: std::option::Option<crate::model::video_stream::vp_9_codec_settings::GopMode>,
6815
6816        /// Color format can be sdr or hlg.
6817        pub color_format:
6818            std::option::Option<crate::model::video_stream::vp_9_codec_settings::ColorFormat>,
6819
6820        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6821    }
6822
6823    impl Vp9CodecSettings {
6824        pub fn new() -> Self {
6825            std::default::Default::default()
6826        }
6827
6828        /// Sets the value of [width_pixels][crate::model::video_stream::Vp9CodecSettings::width_pixels].
6829        ///
6830        /// # Example
6831        /// ```ignore,no_run
6832        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
6833        /// let x = Vp9CodecSettings::new().set_width_pixels(42);
6834        /// ```
6835        pub fn set_width_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6836            self.width_pixels = v.into();
6837            self
6838        }
6839
6840        /// Sets the value of [height_pixels][crate::model::video_stream::Vp9CodecSettings::height_pixels].
6841        ///
6842        /// # Example
6843        /// ```ignore,no_run
6844        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
6845        /// let x = Vp9CodecSettings::new().set_height_pixels(42);
6846        /// ```
6847        pub fn set_height_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6848            self.height_pixels = v.into();
6849            self
6850        }
6851
6852        /// Sets the value of [frame_rate][crate::model::video_stream::Vp9CodecSettings::frame_rate].
6853        ///
6854        /// # Example
6855        /// ```ignore,no_run
6856        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
6857        /// let x = Vp9CodecSettings::new().set_frame_rate(42.0);
6858        /// ```
6859        pub fn set_frame_rate<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
6860            self.frame_rate = v.into();
6861            self
6862        }
6863
6864        /// Sets the value of [frame_rate_conversion_strategy][crate::model::video_stream::Vp9CodecSettings::frame_rate_conversion_strategy].
6865        ///
6866        /// # Example
6867        /// ```ignore,no_run
6868        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
6869        /// use google_cloud_video_transcoder_v1::model::video_stream::FrameRateConversionStrategy;
6870        /// let x0 = Vp9CodecSettings::new().set_frame_rate_conversion_strategy(FrameRateConversionStrategy::Downsample);
6871        /// let x1 = Vp9CodecSettings::new().set_frame_rate_conversion_strategy(FrameRateConversionStrategy::DropDuplicate);
6872        /// ```
6873        pub fn set_frame_rate_conversion_strategy<
6874            T: std::convert::Into<crate::model::video_stream::FrameRateConversionStrategy>,
6875        >(
6876            mut self,
6877            v: T,
6878        ) -> Self {
6879            self.frame_rate_conversion_strategy = v.into();
6880            self
6881        }
6882
6883        /// Sets the value of [bitrate_bps][crate::model::video_stream::Vp9CodecSettings::bitrate_bps].
6884        ///
6885        /// # Example
6886        /// ```ignore,no_run
6887        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
6888        /// let x = Vp9CodecSettings::new().set_bitrate_bps(42);
6889        /// ```
6890        pub fn set_bitrate_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6891            self.bitrate_bps = v.into();
6892            self
6893        }
6894
6895        /// Sets the value of [pixel_format][crate::model::video_stream::Vp9CodecSettings::pixel_format].
6896        ///
6897        /// # Example
6898        /// ```ignore,no_run
6899        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
6900        /// let x = Vp9CodecSettings::new().set_pixel_format("example");
6901        /// ```
6902        pub fn set_pixel_format<T: std::convert::Into<std::string::String>>(
6903            mut self,
6904            v: T,
6905        ) -> Self {
6906            self.pixel_format = v.into();
6907            self
6908        }
6909
6910        /// Sets the value of [rate_control_mode][crate::model::video_stream::Vp9CodecSettings::rate_control_mode].
6911        ///
6912        /// # Example
6913        /// ```ignore,no_run
6914        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
6915        /// let x = Vp9CodecSettings::new().set_rate_control_mode("example");
6916        /// ```
6917        pub fn set_rate_control_mode<T: std::convert::Into<std::string::String>>(
6918            mut self,
6919            v: T,
6920        ) -> Self {
6921            self.rate_control_mode = v.into();
6922            self
6923        }
6924
6925        /// Sets the value of [crf_level][crate::model::video_stream::Vp9CodecSettings::crf_level].
6926        ///
6927        /// # Example
6928        /// ```ignore,no_run
6929        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
6930        /// let x = Vp9CodecSettings::new().set_crf_level(42);
6931        /// ```
6932        pub fn set_crf_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6933            self.crf_level = v.into();
6934            self
6935        }
6936
6937        /// Sets the value of [profile][crate::model::video_stream::Vp9CodecSettings::profile].
6938        ///
6939        /// # Example
6940        /// ```ignore,no_run
6941        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
6942        /// let x = Vp9CodecSettings::new().set_profile("example");
6943        /// ```
6944        pub fn set_profile<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6945            self.profile = v.into();
6946            self
6947        }
6948
6949        /// Sets the value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode].
6950        ///
6951        /// Note that all the setters affecting `gop_mode` are mutually
6952        /// exclusive.
6953        ///
6954        /// # Example
6955        /// ```ignore,no_run
6956        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
6957        /// use google_cloud_video_transcoder_v1::model::video_stream::vp_9_codec_settings::GopMode;
6958        /// let x = Vp9CodecSettings::new().set_gop_mode(Some(GopMode::GopFrameCount(42)));
6959        /// ```
6960        pub fn set_gop_mode<
6961            T: std::convert::Into<
6962                    std::option::Option<crate::model::video_stream::vp_9_codec_settings::GopMode>,
6963                >,
6964        >(
6965            mut self,
6966            v: T,
6967        ) -> Self {
6968            self.gop_mode = v.into();
6969            self
6970        }
6971
6972        /// The value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode]
6973        /// if it holds a `GopFrameCount`, `None` if the field is not set or
6974        /// holds a different branch.
6975        pub fn gop_frame_count(&self) -> std::option::Option<&i32> {
6976            #[allow(unreachable_patterns)]
6977            self.gop_mode.as_ref().and_then(|v| match v {
6978                crate::model::video_stream::vp_9_codec_settings::GopMode::GopFrameCount(v) => {
6979                    std::option::Option::Some(v)
6980                }
6981                _ => std::option::Option::None,
6982            })
6983        }
6984
6985        /// Sets the value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode]
6986        /// to hold a `GopFrameCount`.
6987        ///
6988        /// Note that all the setters affecting `gop_mode` are
6989        /// mutually exclusive.
6990        ///
6991        /// # Example
6992        /// ```ignore,no_run
6993        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
6994        /// let x = Vp9CodecSettings::new().set_gop_frame_count(42);
6995        /// assert!(x.gop_frame_count().is_some());
6996        /// assert!(x.gop_duration().is_none());
6997        /// ```
6998        pub fn set_gop_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6999            self.gop_mode = std::option::Option::Some(
7000                crate::model::video_stream::vp_9_codec_settings::GopMode::GopFrameCount(v.into()),
7001            );
7002            self
7003        }
7004
7005        /// The value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode]
7006        /// if it holds a `GopDuration`, `None` if the field is not set or
7007        /// holds a different branch.
7008        pub fn gop_duration(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
7009            #[allow(unreachable_patterns)]
7010            self.gop_mode.as_ref().and_then(|v| match v {
7011                crate::model::video_stream::vp_9_codec_settings::GopMode::GopDuration(v) => {
7012                    std::option::Option::Some(v)
7013                }
7014                _ => std::option::Option::None,
7015            })
7016        }
7017
7018        /// Sets the value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode]
7019        /// to hold a `GopDuration`.
7020        ///
7021        /// Note that all the setters affecting `gop_mode` are
7022        /// mutually exclusive.
7023        ///
7024        /// # Example
7025        /// ```ignore,no_run
7026        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
7027        /// use wkt::Duration;
7028        /// let x = Vp9CodecSettings::new().set_gop_duration(Duration::default()/* use setters */);
7029        /// assert!(x.gop_duration().is_some());
7030        /// assert!(x.gop_frame_count().is_none());
7031        /// ```
7032        pub fn set_gop_duration<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
7033            mut self,
7034            v: T,
7035        ) -> Self {
7036            self.gop_mode = std::option::Option::Some(
7037                crate::model::video_stream::vp_9_codec_settings::GopMode::GopDuration(v.into()),
7038            );
7039            self
7040        }
7041
7042        /// Sets the value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format].
7043        ///
7044        /// Note that all the setters affecting `color_format` are mutually
7045        /// exclusive.
7046        ///
7047        /// # Example
7048        /// ```ignore,no_run
7049        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
7050        /// use google_cloud_video_transcoder_v1::model::video_stream::Vp9ColorFormatSDR;
7051        /// let x = Vp9CodecSettings::new().set_color_format(Some(
7052        ///     google_cloud_video_transcoder_v1::model::video_stream::vp_9_codec_settings::ColorFormat::Sdr(Vp9ColorFormatSDR::default().into())));
7053        /// ```
7054        pub fn set_color_format<
7055            T: std::convert::Into<
7056                    std::option::Option<
7057                        crate::model::video_stream::vp_9_codec_settings::ColorFormat,
7058                    >,
7059                >,
7060        >(
7061            mut self,
7062            v: T,
7063        ) -> Self {
7064            self.color_format = v.into();
7065            self
7066        }
7067
7068        /// The value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format]
7069        /// if it holds a `Sdr`, `None` if the field is not set or
7070        /// holds a different branch.
7071        pub fn sdr(
7072            &self,
7073        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::Vp9ColorFormatSDR>>
7074        {
7075            #[allow(unreachable_patterns)]
7076            self.color_format.as_ref().and_then(|v| match v {
7077                crate::model::video_stream::vp_9_codec_settings::ColorFormat::Sdr(v) => {
7078                    std::option::Option::Some(v)
7079                }
7080                _ => std::option::Option::None,
7081            })
7082        }
7083
7084        /// Sets the value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format]
7085        /// to hold a `Sdr`.
7086        ///
7087        /// Note that all the setters affecting `color_format` are
7088        /// mutually exclusive.
7089        ///
7090        /// # Example
7091        /// ```ignore,no_run
7092        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
7093        /// use google_cloud_video_transcoder_v1::model::video_stream::Vp9ColorFormatSDR;
7094        /// let x = Vp9CodecSettings::new().set_sdr(Vp9ColorFormatSDR::default()/* use setters */);
7095        /// assert!(x.sdr().is_some());
7096        /// assert!(x.hlg().is_none());
7097        /// ```
7098        pub fn set_sdr<
7099            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::Vp9ColorFormatSDR>>,
7100        >(
7101            mut self,
7102            v: T,
7103        ) -> Self {
7104            self.color_format = std::option::Option::Some(
7105                crate::model::video_stream::vp_9_codec_settings::ColorFormat::Sdr(v.into()),
7106            );
7107            self
7108        }
7109
7110        /// The value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format]
7111        /// if it holds a `Hlg`, `None` if the field is not set or
7112        /// holds a different branch.
7113        pub fn hlg(
7114            &self,
7115        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::Vp9ColorFormatHLG>>
7116        {
7117            #[allow(unreachable_patterns)]
7118            self.color_format.as_ref().and_then(|v| match v {
7119                crate::model::video_stream::vp_9_codec_settings::ColorFormat::Hlg(v) => {
7120                    std::option::Option::Some(v)
7121                }
7122                _ => std::option::Option::None,
7123            })
7124        }
7125
7126        /// Sets the value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format]
7127        /// to hold a `Hlg`.
7128        ///
7129        /// Note that all the setters affecting `color_format` are
7130        /// mutually exclusive.
7131        ///
7132        /// # Example
7133        /// ```ignore,no_run
7134        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
7135        /// use google_cloud_video_transcoder_v1::model::video_stream::Vp9ColorFormatHLG;
7136        /// let x = Vp9CodecSettings::new().set_hlg(Vp9ColorFormatHLG::default()/* use setters */);
7137        /// assert!(x.hlg().is_some());
7138        /// assert!(x.sdr().is_none());
7139        /// ```
7140        pub fn set_hlg<
7141            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::Vp9ColorFormatHLG>>,
7142        >(
7143            mut self,
7144            v: T,
7145        ) -> Self {
7146            self.color_format = std::option::Option::Some(
7147                crate::model::video_stream::vp_9_codec_settings::ColorFormat::Hlg(v.into()),
7148            );
7149            self
7150        }
7151    }
7152
7153    impl wkt::message::Message for Vp9CodecSettings {
7154        fn typename() -> &'static str {
7155            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings"
7156        }
7157    }
7158
7159    /// Defines additional types related to [Vp9CodecSettings].
7160    pub mod vp_9_codec_settings {
7161        #[allow(unused_imports)]
7162        use super::*;
7163
7164        /// GOP mode can be either by frame count or duration.
7165        #[derive(Clone, Debug, PartialEq)]
7166        #[non_exhaustive]
7167        pub enum GopMode {
7168            /// Select the GOP size based on the specified frame count. Must be greater
7169            /// than zero.
7170            GopFrameCount(i32),
7171            /// Select the GOP size based on the specified duration. The default is
7172            /// `3s`. Note that `gopDuration` must be less than or equal to
7173            /// [`segmentDuration`](#SegmentSettings), and
7174            /// [`segmentDuration`](#SegmentSettings) must be divisible by
7175            /// `gopDuration`.
7176            GopDuration(std::boxed::Box<wkt::Duration>),
7177        }
7178
7179        /// Color format can be sdr or hlg.
7180        #[derive(Clone, Debug, PartialEq)]
7181        #[non_exhaustive]
7182        pub enum ColorFormat {
7183            /// Optional. SDR color format setting for VP9.
7184            Sdr(std::boxed::Box<crate::model::video_stream::Vp9ColorFormatSDR>),
7185            /// Optional. HLG color format setting for VP9.
7186            Hlg(std::boxed::Box<crate::model::video_stream::Vp9ColorFormatHLG>),
7187        }
7188    }
7189
7190    /// The conversion strategy for desired frame rate.
7191    ///
7192    /// # Working with unknown values
7193    ///
7194    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7195    /// additional enum variants at any time. Adding new variants is not considered
7196    /// a breaking change. Applications should write their code in anticipation of:
7197    ///
7198    /// - New values appearing in future releases of the client library, **and**
7199    /// - New values received dynamically, without application changes.
7200    ///
7201    /// Please consult the [Working with enums] section in the user guide for some
7202    /// guidelines.
7203    ///
7204    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7205    #[derive(Clone, Debug, PartialEq)]
7206    #[non_exhaustive]
7207    pub enum FrameRateConversionStrategy {
7208        /// Unspecified frame rate conversion strategy.
7209        Unspecified,
7210        /// Selectively retain frames to reduce the output frame rate.
7211        /// Every _n_ th frame is kept, where `n = ceil(input frame rate / target
7212        /// frame rate)`. When _n_ = 1 (that is, the target frame rate is greater
7213        /// than the input frame rate), the output frame rate matches the input frame
7214        /// rate. When _n_ > 1, frames are dropped and the output frame rate is
7215        /// equal to `(input frame rate / n)`. For more information, see
7216        /// [Calculate frame
7217        /// rate](https://cloud.google.com/transcoder/docs/concepts/frame-rate).
7218        Downsample,
7219        /// Drop or duplicate frames to match the specified frame rate.
7220        DropDuplicate,
7221        /// If set, the enum was initialized with an unknown value.
7222        ///
7223        /// Applications can examine the value using [FrameRateConversionStrategy::value] or
7224        /// [FrameRateConversionStrategy::name].
7225        UnknownValue(frame_rate_conversion_strategy::UnknownValue),
7226    }
7227
7228    #[doc(hidden)]
7229    pub mod frame_rate_conversion_strategy {
7230        #[allow(unused_imports)]
7231        use super::*;
7232        #[derive(Clone, Debug, PartialEq)]
7233        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7234    }
7235
7236    impl FrameRateConversionStrategy {
7237        /// Gets the enum value.
7238        ///
7239        /// Returns `None` if the enum contains an unknown value deserialized from
7240        /// the string representation of enums.
7241        pub fn value(&self) -> std::option::Option<i32> {
7242            match self {
7243                Self::Unspecified => std::option::Option::Some(0),
7244                Self::Downsample => std::option::Option::Some(1),
7245                Self::DropDuplicate => std::option::Option::Some(2),
7246                Self::UnknownValue(u) => u.0.value(),
7247            }
7248        }
7249
7250        /// Gets the enum value as a string.
7251        ///
7252        /// Returns `None` if the enum contains an unknown value deserialized from
7253        /// the integer representation of enums.
7254        pub fn name(&self) -> std::option::Option<&str> {
7255            match self {
7256                Self::Unspecified => {
7257                    std::option::Option::Some("FRAME_RATE_CONVERSION_STRATEGY_UNSPECIFIED")
7258                }
7259                Self::Downsample => std::option::Option::Some("DOWNSAMPLE"),
7260                Self::DropDuplicate => std::option::Option::Some("DROP_DUPLICATE"),
7261                Self::UnknownValue(u) => u.0.name(),
7262            }
7263        }
7264    }
7265
7266    impl std::default::Default for FrameRateConversionStrategy {
7267        fn default() -> Self {
7268            use std::convert::From;
7269            Self::from(0)
7270        }
7271    }
7272
7273    impl std::fmt::Display for FrameRateConversionStrategy {
7274        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7275            wkt::internal::display_enum(f, self.name(), self.value())
7276        }
7277    }
7278
7279    impl std::convert::From<i32> for FrameRateConversionStrategy {
7280        fn from(value: i32) -> Self {
7281            match value {
7282                0 => Self::Unspecified,
7283                1 => Self::Downsample,
7284                2 => Self::DropDuplicate,
7285                _ => Self::UnknownValue(frame_rate_conversion_strategy::UnknownValue(
7286                    wkt::internal::UnknownEnumValue::Integer(value),
7287                )),
7288            }
7289        }
7290    }
7291
7292    impl std::convert::From<&str> for FrameRateConversionStrategy {
7293        fn from(value: &str) -> Self {
7294            use std::string::ToString;
7295            match value {
7296                "FRAME_RATE_CONVERSION_STRATEGY_UNSPECIFIED" => Self::Unspecified,
7297                "DOWNSAMPLE" => Self::Downsample,
7298                "DROP_DUPLICATE" => Self::DropDuplicate,
7299                _ => Self::UnknownValue(frame_rate_conversion_strategy::UnknownValue(
7300                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7301                )),
7302            }
7303        }
7304    }
7305
7306    impl serde::ser::Serialize for FrameRateConversionStrategy {
7307        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7308        where
7309            S: serde::Serializer,
7310        {
7311            match self {
7312                Self::Unspecified => serializer.serialize_i32(0),
7313                Self::Downsample => serializer.serialize_i32(1),
7314                Self::DropDuplicate => serializer.serialize_i32(2),
7315                Self::UnknownValue(u) => u.0.serialize(serializer),
7316            }
7317        }
7318    }
7319
7320    impl<'de> serde::de::Deserialize<'de> for FrameRateConversionStrategy {
7321        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7322        where
7323            D: serde::Deserializer<'de>,
7324        {
7325            deserializer.deserialize_any(
7326                wkt::internal::EnumVisitor::<FrameRateConversionStrategy>::new(
7327                    ".google.cloud.video.transcoder.v1.VideoStream.FrameRateConversionStrategy",
7328                ),
7329            )
7330        }
7331    }
7332
7333    /// Codec settings can be h264, h265, or vp9.
7334    #[derive(Clone, Debug, PartialEq)]
7335    #[non_exhaustive]
7336    pub enum CodecSettings {
7337        /// H264 codec settings.
7338        H264(std::boxed::Box<crate::model::video_stream::H264CodecSettings>),
7339        /// H265 codec settings.
7340        H265(std::boxed::Box<crate::model::video_stream::H265CodecSettings>),
7341        /// VP9 codec settings.
7342        Vp9(std::boxed::Box<crate::model::video_stream::Vp9CodecSettings>),
7343    }
7344}
7345
7346/// Audio stream resource.
7347#[derive(Clone, Default, PartialEq)]
7348#[non_exhaustive]
7349pub struct AudioStream {
7350    /// The codec for this audio stream. The default is `aac`.
7351    ///
7352    /// Supported audio codecs:
7353    ///
7354    /// - `aac`
7355    /// - `aac-he`
7356    /// - `aac-he-v2`
7357    /// - `mp3`
7358    /// - `ac3`
7359    /// - `eac3`
7360    /// - `vorbis`
7361    pub codec: std::string::String,
7362
7363    /// Required. Audio bitrate in bits per second. Must be between 1 and
7364    /// 10,000,000.
7365    pub bitrate_bps: i32,
7366
7367    /// Number of audio channels. Must be between 1 and 6. The default is 2.
7368    pub channel_count: i32,
7369
7370    /// A list of channel names specifying layout of the audio channels.
7371    /// This only affects the metadata embedded in the container headers, if
7372    /// supported by the specified format. The default is `["fl", "fr"]`.
7373    ///
7374    /// Supported channel names:
7375    ///
7376    /// - `fl` - Front left channel
7377    /// - `fr` - Front right channel
7378    /// - `sl` - Side left channel
7379    /// - `sr` - Side right channel
7380    /// - `fc` - Front center channel
7381    /// - `lfe` - Low frequency
7382    pub channel_layout: std::vec::Vec<std::string::String>,
7383
7384    /// The mapping for the
7385    /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list]
7386    /// atoms with audio
7387    /// [EditAtom.inputs][google.cloud.video.transcoder.v1.EditAtom.inputs].
7388    ///
7389    /// [google.cloud.video.transcoder.v1.EditAtom.inputs]: crate::model::EditAtom::inputs
7390    /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
7391    pub mapping: std::vec::Vec<crate::model::audio_stream::AudioMapping>,
7392
7393    /// The audio sample rate in Hertz. The default is 48000 Hertz.
7394    pub sample_rate_hertz: i32,
7395
7396    /// The BCP-47 language code, such as `en-US` or `sr-Latn`. For more
7397    /// information, see
7398    /// <https://www.unicode.org/reports/tr35/#Unicode_locale_identifier>. Not
7399    /// supported in MP4 files.
7400    pub language_code: std::string::String,
7401
7402    /// The name for this particular audio stream that
7403    /// will be added to the HLS/DASH manifest. Not supported in MP4 files.
7404    pub display_name: std::string::String,
7405
7406    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7407}
7408
7409impl AudioStream {
7410    pub fn new() -> Self {
7411        std::default::Default::default()
7412    }
7413
7414    /// Sets the value of [codec][crate::model::AudioStream::codec].
7415    ///
7416    /// # Example
7417    /// ```ignore,no_run
7418    /// # use google_cloud_video_transcoder_v1::model::AudioStream;
7419    /// let x = AudioStream::new().set_codec("example");
7420    /// ```
7421    pub fn set_codec<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7422        self.codec = v.into();
7423        self
7424    }
7425
7426    /// Sets the value of [bitrate_bps][crate::model::AudioStream::bitrate_bps].
7427    ///
7428    /// # Example
7429    /// ```ignore,no_run
7430    /// # use google_cloud_video_transcoder_v1::model::AudioStream;
7431    /// let x = AudioStream::new().set_bitrate_bps(42);
7432    /// ```
7433    pub fn set_bitrate_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7434        self.bitrate_bps = v.into();
7435        self
7436    }
7437
7438    /// Sets the value of [channel_count][crate::model::AudioStream::channel_count].
7439    ///
7440    /// # Example
7441    /// ```ignore,no_run
7442    /// # use google_cloud_video_transcoder_v1::model::AudioStream;
7443    /// let x = AudioStream::new().set_channel_count(42);
7444    /// ```
7445    pub fn set_channel_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7446        self.channel_count = v.into();
7447        self
7448    }
7449
7450    /// Sets the value of [channel_layout][crate::model::AudioStream::channel_layout].
7451    ///
7452    /// # Example
7453    /// ```ignore,no_run
7454    /// # use google_cloud_video_transcoder_v1::model::AudioStream;
7455    /// let x = AudioStream::new().set_channel_layout(["a", "b", "c"]);
7456    /// ```
7457    pub fn set_channel_layout<T, V>(mut self, v: T) -> Self
7458    where
7459        T: std::iter::IntoIterator<Item = V>,
7460        V: std::convert::Into<std::string::String>,
7461    {
7462        use std::iter::Iterator;
7463        self.channel_layout = v.into_iter().map(|i| i.into()).collect();
7464        self
7465    }
7466
7467    /// Sets the value of [mapping][crate::model::AudioStream::mapping].
7468    ///
7469    /// # Example
7470    /// ```ignore,no_run
7471    /// # use google_cloud_video_transcoder_v1::model::AudioStream;
7472    /// use google_cloud_video_transcoder_v1::model::audio_stream::AudioMapping;
7473    /// let x = AudioStream::new()
7474    ///     .set_mapping([
7475    ///         AudioMapping::default()/* use setters */,
7476    ///         AudioMapping::default()/* use (different) setters */,
7477    ///     ]);
7478    /// ```
7479    pub fn set_mapping<T, V>(mut self, v: T) -> Self
7480    where
7481        T: std::iter::IntoIterator<Item = V>,
7482        V: std::convert::Into<crate::model::audio_stream::AudioMapping>,
7483    {
7484        use std::iter::Iterator;
7485        self.mapping = v.into_iter().map(|i| i.into()).collect();
7486        self
7487    }
7488
7489    /// Sets the value of [sample_rate_hertz][crate::model::AudioStream::sample_rate_hertz].
7490    ///
7491    /// # Example
7492    /// ```ignore,no_run
7493    /// # use google_cloud_video_transcoder_v1::model::AudioStream;
7494    /// let x = AudioStream::new().set_sample_rate_hertz(42);
7495    /// ```
7496    pub fn set_sample_rate_hertz<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7497        self.sample_rate_hertz = v.into();
7498        self
7499    }
7500
7501    /// Sets the value of [language_code][crate::model::AudioStream::language_code].
7502    ///
7503    /// # Example
7504    /// ```ignore,no_run
7505    /// # use google_cloud_video_transcoder_v1::model::AudioStream;
7506    /// let x = AudioStream::new().set_language_code("example");
7507    /// ```
7508    pub fn set_language_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7509        self.language_code = v.into();
7510        self
7511    }
7512
7513    /// Sets the value of [display_name][crate::model::AudioStream::display_name].
7514    ///
7515    /// # Example
7516    /// ```ignore,no_run
7517    /// # use google_cloud_video_transcoder_v1::model::AudioStream;
7518    /// let x = AudioStream::new().set_display_name("example");
7519    /// ```
7520    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7521        self.display_name = v.into();
7522        self
7523    }
7524}
7525
7526impl wkt::message::Message for AudioStream {
7527    fn typename() -> &'static str {
7528        "type.googleapis.com/google.cloud.video.transcoder.v1.AudioStream"
7529    }
7530}
7531
7532/// Defines additional types related to [AudioStream].
7533pub mod audio_stream {
7534    #[allow(unused_imports)]
7535    use super::*;
7536
7537    /// The mapping for the
7538    /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list]
7539    /// atoms with audio
7540    /// [EditAtom.inputs][google.cloud.video.transcoder.v1.EditAtom.inputs].
7541    ///
7542    /// [google.cloud.video.transcoder.v1.EditAtom.inputs]: crate::model::EditAtom::inputs
7543    /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
7544    #[derive(Clone, Default, PartialEq)]
7545    #[non_exhaustive]
7546    pub struct AudioMapping {
7547        /// Required. The
7548        /// [EditAtom.key][google.cloud.video.transcoder.v1.EditAtom.key] that
7549        /// references the atom with audio inputs in the
7550        /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list].
7551        ///
7552        /// [google.cloud.video.transcoder.v1.EditAtom.key]: crate::model::EditAtom::key
7553        /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
7554        pub atom_key: std::string::String,
7555
7556        /// Required. The [Input.key][google.cloud.video.transcoder.v1.Input.key]
7557        /// that identifies the input file.
7558        ///
7559        /// [google.cloud.video.transcoder.v1.Input.key]: crate::model::Input::key
7560        pub input_key: std::string::String,
7561
7562        /// Required. The zero-based index of the track in the input file.
7563        pub input_track: i32,
7564
7565        /// Required. The zero-based index of the channel in the input audio stream.
7566        pub input_channel: i32,
7567
7568        /// Required. The zero-based index of the channel in the output audio stream.
7569        pub output_channel: i32,
7570
7571        /// Audio volume control in dB. Negative values decrease volume,
7572        /// positive values increase. The default is 0.
7573        pub gain_db: f64,
7574
7575        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7576    }
7577
7578    impl AudioMapping {
7579        pub fn new() -> Self {
7580            std::default::Default::default()
7581        }
7582
7583        /// Sets the value of [atom_key][crate::model::audio_stream::AudioMapping::atom_key].
7584        ///
7585        /// # Example
7586        /// ```ignore,no_run
7587        /// # use google_cloud_video_transcoder_v1::model::audio_stream::AudioMapping;
7588        /// let x = AudioMapping::new().set_atom_key("example");
7589        /// ```
7590        pub fn set_atom_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7591            self.atom_key = v.into();
7592            self
7593        }
7594
7595        /// Sets the value of [input_key][crate::model::audio_stream::AudioMapping::input_key].
7596        ///
7597        /// # Example
7598        /// ```ignore,no_run
7599        /// # use google_cloud_video_transcoder_v1::model::audio_stream::AudioMapping;
7600        /// let x = AudioMapping::new().set_input_key("example");
7601        /// ```
7602        pub fn set_input_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7603            self.input_key = v.into();
7604            self
7605        }
7606
7607        /// Sets the value of [input_track][crate::model::audio_stream::AudioMapping::input_track].
7608        ///
7609        /// # Example
7610        /// ```ignore,no_run
7611        /// # use google_cloud_video_transcoder_v1::model::audio_stream::AudioMapping;
7612        /// let x = AudioMapping::new().set_input_track(42);
7613        /// ```
7614        pub fn set_input_track<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7615            self.input_track = v.into();
7616            self
7617        }
7618
7619        /// Sets the value of [input_channel][crate::model::audio_stream::AudioMapping::input_channel].
7620        ///
7621        /// # Example
7622        /// ```ignore,no_run
7623        /// # use google_cloud_video_transcoder_v1::model::audio_stream::AudioMapping;
7624        /// let x = AudioMapping::new().set_input_channel(42);
7625        /// ```
7626        pub fn set_input_channel<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7627            self.input_channel = v.into();
7628            self
7629        }
7630
7631        /// Sets the value of [output_channel][crate::model::audio_stream::AudioMapping::output_channel].
7632        ///
7633        /// # Example
7634        /// ```ignore,no_run
7635        /// # use google_cloud_video_transcoder_v1::model::audio_stream::AudioMapping;
7636        /// let x = AudioMapping::new().set_output_channel(42);
7637        /// ```
7638        pub fn set_output_channel<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7639            self.output_channel = v.into();
7640            self
7641        }
7642
7643        /// Sets the value of [gain_db][crate::model::audio_stream::AudioMapping::gain_db].
7644        ///
7645        /// # Example
7646        /// ```ignore,no_run
7647        /// # use google_cloud_video_transcoder_v1::model::audio_stream::AudioMapping;
7648        /// let x = AudioMapping::new().set_gain_db(42.0);
7649        /// ```
7650        pub fn set_gain_db<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
7651            self.gain_db = v.into();
7652            self
7653        }
7654    }
7655
7656    impl wkt::message::Message for AudioMapping {
7657        fn typename() -> &'static str {
7658            "type.googleapis.com/google.cloud.video.transcoder.v1.AudioStream.AudioMapping"
7659        }
7660    }
7661}
7662
7663/// Encoding of a text stream. For example, closed captions or subtitles.
7664#[derive(Clone, Default, PartialEq)]
7665#[non_exhaustive]
7666pub struct TextStream {
7667    /// The codec for this text stream. The default is `webvtt`.
7668    ///
7669    /// Supported text codecs:
7670    ///
7671    /// - `srt`
7672    /// - `ttml`
7673    /// - `cea608`
7674    /// - `cea708`
7675    /// - `webvtt`
7676    pub codec: std::string::String,
7677
7678    /// The BCP-47 language code, such as `en-US` or `sr-Latn`. For more
7679    /// information, see
7680    /// <https://www.unicode.org/reports/tr35/#Unicode_locale_identifier>. Not
7681    /// supported in MP4 files.
7682    pub language_code: std::string::String,
7683
7684    /// The mapping for the
7685    /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list]
7686    /// atoms with text
7687    /// [EditAtom.inputs][google.cloud.video.transcoder.v1.EditAtom.inputs].
7688    ///
7689    /// [google.cloud.video.transcoder.v1.EditAtom.inputs]: crate::model::EditAtom::inputs
7690    /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
7691    pub mapping: std::vec::Vec<crate::model::text_stream::TextMapping>,
7692
7693    /// The name for this particular text stream that
7694    /// will be added to the HLS/DASH manifest. Not supported in MP4 files.
7695    pub display_name: std::string::String,
7696
7697    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7698}
7699
7700impl TextStream {
7701    pub fn new() -> Self {
7702        std::default::Default::default()
7703    }
7704
7705    /// Sets the value of [codec][crate::model::TextStream::codec].
7706    ///
7707    /// # Example
7708    /// ```ignore,no_run
7709    /// # use google_cloud_video_transcoder_v1::model::TextStream;
7710    /// let x = TextStream::new().set_codec("example");
7711    /// ```
7712    pub fn set_codec<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7713        self.codec = v.into();
7714        self
7715    }
7716
7717    /// Sets the value of [language_code][crate::model::TextStream::language_code].
7718    ///
7719    /// # Example
7720    /// ```ignore,no_run
7721    /// # use google_cloud_video_transcoder_v1::model::TextStream;
7722    /// let x = TextStream::new().set_language_code("example");
7723    /// ```
7724    pub fn set_language_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7725        self.language_code = v.into();
7726        self
7727    }
7728
7729    /// Sets the value of [mapping][crate::model::TextStream::mapping].
7730    ///
7731    /// # Example
7732    /// ```ignore,no_run
7733    /// # use google_cloud_video_transcoder_v1::model::TextStream;
7734    /// use google_cloud_video_transcoder_v1::model::text_stream::TextMapping;
7735    /// let x = TextStream::new()
7736    ///     .set_mapping([
7737    ///         TextMapping::default()/* use setters */,
7738    ///         TextMapping::default()/* use (different) setters */,
7739    ///     ]);
7740    /// ```
7741    pub fn set_mapping<T, V>(mut self, v: T) -> Self
7742    where
7743        T: std::iter::IntoIterator<Item = V>,
7744        V: std::convert::Into<crate::model::text_stream::TextMapping>,
7745    {
7746        use std::iter::Iterator;
7747        self.mapping = v.into_iter().map(|i| i.into()).collect();
7748        self
7749    }
7750
7751    /// Sets the value of [display_name][crate::model::TextStream::display_name].
7752    ///
7753    /// # Example
7754    /// ```ignore,no_run
7755    /// # use google_cloud_video_transcoder_v1::model::TextStream;
7756    /// let x = TextStream::new().set_display_name("example");
7757    /// ```
7758    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7759        self.display_name = v.into();
7760        self
7761    }
7762}
7763
7764impl wkt::message::Message for TextStream {
7765    fn typename() -> &'static str {
7766        "type.googleapis.com/google.cloud.video.transcoder.v1.TextStream"
7767    }
7768}
7769
7770/// Defines additional types related to [TextStream].
7771pub mod text_stream {
7772    #[allow(unused_imports)]
7773    use super::*;
7774
7775    /// The mapping for the
7776    /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list]
7777    /// atoms with text
7778    /// [EditAtom.inputs][google.cloud.video.transcoder.v1.EditAtom.inputs].
7779    ///
7780    /// [google.cloud.video.transcoder.v1.EditAtom.inputs]: crate::model::EditAtom::inputs
7781    /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
7782    #[derive(Clone, Default, PartialEq)]
7783    #[non_exhaustive]
7784    pub struct TextMapping {
7785        /// Required. The
7786        /// [EditAtom.key][google.cloud.video.transcoder.v1.EditAtom.key] that
7787        /// references atom with text inputs in the
7788        /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list].
7789        ///
7790        /// [google.cloud.video.transcoder.v1.EditAtom.key]: crate::model::EditAtom::key
7791        /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
7792        pub atom_key: std::string::String,
7793
7794        /// Required. The [Input.key][google.cloud.video.transcoder.v1.Input.key]
7795        /// that identifies the input file.
7796        ///
7797        /// [google.cloud.video.transcoder.v1.Input.key]: crate::model::Input::key
7798        pub input_key: std::string::String,
7799
7800        /// Required. The zero-based index of the track in the input file.
7801        pub input_track: i32,
7802
7803        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7804    }
7805
7806    impl TextMapping {
7807        pub fn new() -> Self {
7808            std::default::Default::default()
7809        }
7810
7811        /// Sets the value of [atom_key][crate::model::text_stream::TextMapping::atom_key].
7812        ///
7813        /// # Example
7814        /// ```ignore,no_run
7815        /// # use google_cloud_video_transcoder_v1::model::text_stream::TextMapping;
7816        /// let x = TextMapping::new().set_atom_key("example");
7817        /// ```
7818        pub fn set_atom_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7819            self.atom_key = v.into();
7820            self
7821        }
7822
7823        /// Sets the value of [input_key][crate::model::text_stream::TextMapping::input_key].
7824        ///
7825        /// # Example
7826        /// ```ignore,no_run
7827        /// # use google_cloud_video_transcoder_v1::model::text_stream::TextMapping;
7828        /// let x = TextMapping::new().set_input_key("example");
7829        /// ```
7830        pub fn set_input_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7831            self.input_key = v.into();
7832            self
7833        }
7834
7835        /// Sets the value of [input_track][crate::model::text_stream::TextMapping::input_track].
7836        ///
7837        /// # Example
7838        /// ```ignore,no_run
7839        /// # use google_cloud_video_transcoder_v1::model::text_stream::TextMapping;
7840        /// let x = TextMapping::new().set_input_track(42);
7841        /// ```
7842        pub fn set_input_track<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7843            self.input_track = v.into();
7844            self
7845        }
7846    }
7847
7848    impl wkt::message::Message for TextMapping {
7849        fn typename() -> &'static str {
7850            "type.googleapis.com/google.cloud.video.transcoder.v1.TextStream.TextMapping"
7851        }
7852    }
7853}
7854
7855/// Segment settings for `ts`, `fmp4` and `vtt`.
7856#[derive(Clone, Default, PartialEq)]
7857#[non_exhaustive]
7858pub struct SegmentSettings {
7859    /// Duration of the segments in seconds. The default is `6.0s`. Note that
7860    /// `segmentDuration` must be greater than or equal to
7861    /// [`gopDuration`](#videostream), and `segmentDuration` must be divisible by
7862    /// [`gopDuration`](#videostream).
7863    pub segment_duration: std::option::Option<wkt::Duration>,
7864
7865    /// Required. Create an individual segment file. The default is `false`.
7866    pub individual_segments: bool,
7867
7868    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7869}
7870
7871impl SegmentSettings {
7872    pub fn new() -> Self {
7873        std::default::Default::default()
7874    }
7875
7876    /// Sets the value of [segment_duration][crate::model::SegmentSettings::segment_duration].
7877    ///
7878    /// # Example
7879    /// ```ignore,no_run
7880    /// # use google_cloud_video_transcoder_v1::model::SegmentSettings;
7881    /// use wkt::Duration;
7882    /// let x = SegmentSettings::new().set_segment_duration(Duration::default()/* use setters */);
7883    /// ```
7884    pub fn set_segment_duration<T>(mut self, v: T) -> Self
7885    where
7886        T: std::convert::Into<wkt::Duration>,
7887    {
7888        self.segment_duration = std::option::Option::Some(v.into());
7889        self
7890    }
7891
7892    /// Sets or clears the value of [segment_duration][crate::model::SegmentSettings::segment_duration].
7893    ///
7894    /// # Example
7895    /// ```ignore,no_run
7896    /// # use google_cloud_video_transcoder_v1::model::SegmentSettings;
7897    /// use wkt::Duration;
7898    /// let x = SegmentSettings::new().set_or_clear_segment_duration(Some(Duration::default()/* use setters */));
7899    /// let x = SegmentSettings::new().set_or_clear_segment_duration(None::<Duration>);
7900    /// ```
7901    pub fn set_or_clear_segment_duration<T>(mut self, v: std::option::Option<T>) -> Self
7902    where
7903        T: std::convert::Into<wkt::Duration>,
7904    {
7905        self.segment_duration = v.map(|x| x.into());
7906        self
7907    }
7908
7909    /// Sets the value of [individual_segments][crate::model::SegmentSettings::individual_segments].
7910    ///
7911    /// # Example
7912    /// ```ignore,no_run
7913    /// # use google_cloud_video_transcoder_v1::model::SegmentSettings;
7914    /// let x = SegmentSettings::new().set_individual_segments(true);
7915    /// ```
7916    pub fn set_individual_segments<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7917        self.individual_segments = v.into();
7918        self
7919    }
7920}
7921
7922impl wkt::message::Message for SegmentSettings {
7923    fn typename() -> &'static str {
7924        "type.googleapis.com/google.cloud.video.transcoder.v1.SegmentSettings"
7925    }
7926}
7927
7928/// Encryption settings.
7929#[derive(Clone, Default, PartialEq)]
7930#[non_exhaustive]
7931pub struct Encryption {
7932    /// Required. Identifier for this set of encryption options.
7933    pub id: std::string::String,
7934
7935    /// Required. DRM system(s) to use; at least one must be specified. If a
7936    /// DRM system is omitted, it is considered disabled.
7937    pub drm_systems: std::option::Option<crate::model::encryption::DrmSystems>,
7938
7939    /// Encryption mode can be either `aes` or `cenc`.
7940    pub encryption_mode: std::option::Option<crate::model::encryption::EncryptionMode>,
7941
7942    /// Defines where content keys are stored.
7943    pub secret_source: std::option::Option<crate::model::encryption::SecretSource>,
7944
7945    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7946}
7947
7948impl Encryption {
7949    pub fn new() -> Self {
7950        std::default::Default::default()
7951    }
7952
7953    /// Sets the value of [id][crate::model::Encryption::id].
7954    ///
7955    /// # Example
7956    /// ```ignore,no_run
7957    /// # use google_cloud_video_transcoder_v1::model::Encryption;
7958    /// let x = Encryption::new().set_id("example");
7959    /// ```
7960    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7961        self.id = v.into();
7962        self
7963    }
7964
7965    /// Sets the value of [drm_systems][crate::model::Encryption::drm_systems].
7966    ///
7967    /// # Example
7968    /// ```ignore,no_run
7969    /// # use google_cloud_video_transcoder_v1::model::Encryption;
7970    /// use google_cloud_video_transcoder_v1::model::encryption::DrmSystems;
7971    /// let x = Encryption::new().set_drm_systems(DrmSystems::default()/* use setters */);
7972    /// ```
7973    pub fn set_drm_systems<T>(mut self, v: T) -> Self
7974    where
7975        T: std::convert::Into<crate::model::encryption::DrmSystems>,
7976    {
7977        self.drm_systems = std::option::Option::Some(v.into());
7978        self
7979    }
7980
7981    /// Sets or clears the value of [drm_systems][crate::model::Encryption::drm_systems].
7982    ///
7983    /// # Example
7984    /// ```ignore,no_run
7985    /// # use google_cloud_video_transcoder_v1::model::Encryption;
7986    /// use google_cloud_video_transcoder_v1::model::encryption::DrmSystems;
7987    /// let x = Encryption::new().set_or_clear_drm_systems(Some(DrmSystems::default()/* use setters */));
7988    /// let x = Encryption::new().set_or_clear_drm_systems(None::<DrmSystems>);
7989    /// ```
7990    pub fn set_or_clear_drm_systems<T>(mut self, v: std::option::Option<T>) -> Self
7991    where
7992        T: std::convert::Into<crate::model::encryption::DrmSystems>,
7993    {
7994        self.drm_systems = v.map(|x| x.into());
7995        self
7996    }
7997
7998    /// Sets the value of [encryption_mode][crate::model::Encryption::encryption_mode].
7999    ///
8000    /// Note that all the setters affecting `encryption_mode` are mutually
8001    /// exclusive.
8002    ///
8003    /// # Example
8004    /// ```ignore,no_run
8005    /// # use google_cloud_video_transcoder_v1::model::Encryption;
8006    /// use google_cloud_video_transcoder_v1::model::encryption::Aes128Encryption;
8007    /// let x = Encryption::new().set_encryption_mode(Some(
8008    ///     google_cloud_video_transcoder_v1::model::encryption::EncryptionMode::Aes128(Aes128Encryption::default().into())));
8009    /// ```
8010    pub fn set_encryption_mode<
8011        T: std::convert::Into<std::option::Option<crate::model::encryption::EncryptionMode>>,
8012    >(
8013        mut self,
8014        v: T,
8015    ) -> Self {
8016        self.encryption_mode = v.into();
8017        self
8018    }
8019
8020    /// The value of [encryption_mode][crate::model::Encryption::encryption_mode]
8021    /// if it holds a `Aes128`, `None` if the field is not set or
8022    /// holds a different branch.
8023    pub fn aes_128(
8024        &self,
8025    ) -> std::option::Option<&std::boxed::Box<crate::model::encryption::Aes128Encryption>> {
8026        #[allow(unreachable_patterns)]
8027        self.encryption_mode.as_ref().and_then(|v| match v {
8028            crate::model::encryption::EncryptionMode::Aes128(v) => std::option::Option::Some(v),
8029            _ => std::option::Option::None,
8030        })
8031    }
8032
8033    /// Sets the value of [encryption_mode][crate::model::Encryption::encryption_mode]
8034    /// to hold a `Aes128`.
8035    ///
8036    /// Note that all the setters affecting `encryption_mode` are
8037    /// mutually exclusive.
8038    ///
8039    /// # Example
8040    /// ```ignore,no_run
8041    /// # use google_cloud_video_transcoder_v1::model::Encryption;
8042    /// use google_cloud_video_transcoder_v1::model::encryption::Aes128Encryption;
8043    /// let x = Encryption::new().set_aes_128(Aes128Encryption::default()/* use setters */);
8044    /// assert!(x.aes_128().is_some());
8045    /// assert!(x.sample_aes().is_none());
8046    /// assert!(x.mpeg_cenc().is_none());
8047    /// ```
8048    pub fn set_aes_128<
8049        T: std::convert::Into<std::boxed::Box<crate::model::encryption::Aes128Encryption>>,
8050    >(
8051        mut self,
8052        v: T,
8053    ) -> Self {
8054        self.encryption_mode =
8055            std::option::Option::Some(crate::model::encryption::EncryptionMode::Aes128(v.into()));
8056        self
8057    }
8058
8059    /// The value of [encryption_mode][crate::model::Encryption::encryption_mode]
8060    /// if it holds a `SampleAes`, `None` if the field is not set or
8061    /// holds a different branch.
8062    pub fn sample_aes(
8063        &self,
8064    ) -> std::option::Option<&std::boxed::Box<crate::model::encryption::SampleAesEncryption>> {
8065        #[allow(unreachable_patterns)]
8066        self.encryption_mode.as_ref().and_then(|v| match v {
8067            crate::model::encryption::EncryptionMode::SampleAes(v) => std::option::Option::Some(v),
8068            _ => std::option::Option::None,
8069        })
8070    }
8071
8072    /// Sets the value of [encryption_mode][crate::model::Encryption::encryption_mode]
8073    /// to hold a `SampleAes`.
8074    ///
8075    /// Note that all the setters affecting `encryption_mode` are
8076    /// mutually exclusive.
8077    ///
8078    /// # Example
8079    /// ```ignore,no_run
8080    /// # use google_cloud_video_transcoder_v1::model::Encryption;
8081    /// use google_cloud_video_transcoder_v1::model::encryption::SampleAesEncryption;
8082    /// let x = Encryption::new().set_sample_aes(SampleAesEncryption::default()/* use setters */);
8083    /// assert!(x.sample_aes().is_some());
8084    /// assert!(x.aes_128().is_none());
8085    /// assert!(x.mpeg_cenc().is_none());
8086    /// ```
8087    pub fn set_sample_aes<
8088        T: std::convert::Into<std::boxed::Box<crate::model::encryption::SampleAesEncryption>>,
8089    >(
8090        mut self,
8091        v: T,
8092    ) -> Self {
8093        self.encryption_mode = std::option::Option::Some(
8094            crate::model::encryption::EncryptionMode::SampleAes(v.into()),
8095        );
8096        self
8097    }
8098
8099    /// The value of [encryption_mode][crate::model::Encryption::encryption_mode]
8100    /// if it holds a `MpegCenc`, `None` if the field is not set or
8101    /// holds a different branch.
8102    pub fn mpeg_cenc(
8103        &self,
8104    ) -> std::option::Option<&std::boxed::Box<crate::model::encryption::MpegCommonEncryption>> {
8105        #[allow(unreachable_patterns)]
8106        self.encryption_mode.as_ref().and_then(|v| match v {
8107            crate::model::encryption::EncryptionMode::MpegCenc(v) => std::option::Option::Some(v),
8108            _ => std::option::Option::None,
8109        })
8110    }
8111
8112    /// Sets the value of [encryption_mode][crate::model::Encryption::encryption_mode]
8113    /// to hold a `MpegCenc`.
8114    ///
8115    /// Note that all the setters affecting `encryption_mode` are
8116    /// mutually exclusive.
8117    ///
8118    /// # Example
8119    /// ```ignore,no_run
8120    /// # use google_cloud_video_transcoder_v1::model::Encryption;
8121    /// use google_cloud_video_transcoder_v1::model::encryption::MpegCommonEncryption;
8122    /// let x = Encryption::new().set_mpeg_cenc(MpegCommonEncryption::default()/* use setters */);
8123    /// assert!(x.mpeg_cenc().is_some());
8124    /// assert!(x.aes_128().is_none());
8125    /// assert!(x.sample_aes().is_none());
8126    /// ```
8127    pub fn set_mpeg_cenc<
8128        T: std::convert::Into<std::boxed::Box<crate::model::encryption::MpegCommonEncryption>>,
8129    >(
8130        mut self,
8131        v: T,
8132    ) -> Self {
8133        self.encryption_mode =
8134            std::option::Option::Some(crate::model::encryption::EncryptionMode::MpegCenc(v.into()));
8135        self
8136    }
8137
8138    /// Sets the value of [secret_source][crate::model::Encryption::secret_source].
8139    ///
8140    /// Note that all the setters affecting `secret_source` are mutually
8141    /// exclusive.
8142    ///
8143    /// # Example
8144    /// ```ignore,no_run
8145    /// # use google_cloud_video_transcoder_v1::model::Encryption;
8146    /// use google_cloud_video_transcoder_v1::model::encryption::SecretManagerSource;
8147    /// let x = Encryption::new().set_secret_source(Some(
8148    ///     google_cloud_video_transcoder_v1::model::encryption::SecretSource::SecretManagerKeySource(SecretManagerSource::default().into())));
8149    /// ```
8150    pub fn set_secret_source<
8151        T: std::convert::Into<std::option::Option<crate::model::encryption::SecretSource>>,
8152    >(
8153        mut self,
8154        v: T,
8155    ) -> Self {
8156        self.secret_source = v.into();
8157        self
8158    }
8159
8160    /// The value of [secret_source][crate::model::Encryption::secret_source]
8161    /// if it holds a `SecretManagerKeySource`, `None` if the field is not set or
8162    /// holds a different branch.
8163    pub fn secret_manager_key_source(
8164        &self,
8165    ) -> std::option::Option<&std::boxed::Box<crate::model::encryption::SecretManagerSource>> {
8166        #[allow(unreachable_patterns)]
8167        self.secret_source.as_ref().and_then(|v| match v {
8168            crate::model::encryption::SecretSource::SecretManagerKeySource(v) => {
8169                std::option::Option::Some(v)
8170            }
8171            _ => std::option::Option::None,
8172        })
8173    }
8174
8175    /// Sets the value of [secret_source][crate::model::Encryption::secret_source]
8176    /// to hold a `SecretManagerKeySource`.
8177    ///
8178    /// Note that all the setters affecting `secret_source` are
8179    /// mutually exclusive.
8180    ///
8181    /// # Example
8182    /// ```ignore,no_run
8183    /// # use google_cloud_video_transcoder_v1::model::Encryption;
8184    /// use google_cloud_video_transcoder_v1::model::encryption::SecretManagerSource;
8185    /// let x = Encryption::new().set_secret_manager_key_source(SecretManagerSource::default()/* use setters */);
8186    /// assert!(x.secret_manager_key_source().is_some());
8187    /// ```
8188    pub fn set_secret_manager_key_source<
8189        T: std::convert::Into<std::boxed::Box<crate::model::encryption::SecretManagerSource>>,
8190    >(
8191        mut self,
8192        v: T,
8193    ) -> Self {
8194        self.secret_source = std::option::Option::Some(
8195            crate::model::encryption::SecretSource::SecretManagerKeySource(v.into()),
8196        );
8197        self
8198    }
8199}
8200
8201impl wkt::message::Message for Encryption {
8202    fn typename() -> &'static str {
8203        "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption"
8204    }
8205}
8206
8207/// Defines additional types related to [Encryption].
8208pub mod encryption {
8209    #[allow(unused_imports)]
8210    use super::*;
8211
8212    /// Configuration for AES-128 encryption.
8213    #[derive(Clone, Default, PartialEq)]
8214    #[non_exhaustive]
8215    pub struct Aes128Encryption {
8216        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8217    }
8218
8219    impl Aes128Encryption {
8220        pub fn new() -> Self {
8221            std::default::Default::default()
8222        }
8223    }
8224
8225    impl wkt::message::Message for Aes128Encryption {
8226        fn typename() -> &'static str {
8227            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Aes128Encryption"
8228        }
8229    }
8230
8231    /// Configuration for SAMPLE-AES encryption.
8232    #[derive(Clone, Default, PartialEq)]
8233    #[non_exhaustive]
8234    pub struct SampleAesEncryption {
8235        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8236    }
8237
8238    impl SampleAesEncryption {
8239        pub fn new() -> Self {
8240            std::default::Default::default()
8241        }
8242    }
8243
8244    impl wkt::message::Message for SampleAesEncryption {
8245        fn typename() -> &'static str {
8246            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.SampleAesEncryption"
8247        }
8248    }
8249
8250    /// Configuration for MPEG Common Encryption (MPEG-CENC).
8251    #[derive(Clone, Default, PartialEq)]
8252    #[non_exhaustive]
8253    pub struct MpegCommonEncryption {
8254        /// Required. Specify the encryption scheme.
8255        ///
8256        /// Supported encryption schemes:
8257        ///
8258        /// - `cenc`
8259        /// - `cbcs`
8260        pub scheme: std::string::String,
8261
8262        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8263    }
8264
8265    impl MpegCommonEncryption {
8266        pub fn new() -> Self {
8267            std::default::Default::default()
8268        }
8269
8270        /// Sets the value of [scheme][crate::model::encryption::MpegCommonEncryption::scheme].
8271        ///
8272        /// # Example
8273        /// ```ignore,no_run
8274        /// # use google_cloud_video_transcoder_v1::model::encryption::MpegCommonEncryption;
8275        /// let x = MpegCommonEncryption::new().set_scheme("example");
8276        /// ```
8277        pub fn set_scheme<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8278            self.scheme = v.into();
8279            self
8280        }
8281    }
8282
8283    impl wkt::message::Message for MpegCommonEncryption {
8284        fn typename() -> &'static str {
8285            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.MpegCommonEncryption"
8286        }
8287    }
8288
8289    /// Configuration for secrets stored in Google Secret Manager.
8290    #[derive(Clone, Default, PartialEq)]
8291    #[non_exhaustive]
8292    pub struct SecretManagerSource {
8293        /// Required. The name of the Secret Version containing the encryption key in
8294        /// the following format:
8295        /// `projects/{project}/secrets/{secret_id}/versions/{version_number}`
8296        ///
8297        /// Note that only numbered versions are supported. Aliases like "latest" are
8298        /// not supported.
8299        pub secret_version: std::string::String,
8300
8301        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8302    }
8303
8304    impl SecretManagerSource {
8305        pub fn new() -> Self {
8306            std::default::Default::default()
8307        }
8308
8309        /// Sets the value of [secret_version][crate::model::encryption::SecretManagerSource::secret_version].
8310        ///
8311        /// # Example
8312        /// ```ignore,no_run
8313        /// # use google_cloud_video_transcoder_v1::model::encryption::SecretManagerSource;
8314        /// let x = SecretManagerSource::new().set_secret_version("example");
8315        /// ```
8316        pub fn set_secret_version<T: std::convert::Into<std::string::String>>(
8317            mut self,
8318            v: T,
8319        ) -> Self {
8320            self.secret_version = v.into();
8321            self
8322        }
8323    }
8324
8325    impl wkt::message::Message for SecretManagerSource {
8326        fn typename() -> &'static str {
8327            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.SecretManagerSource"
8328        }
8329    }
8330
8331    /// Widevine configuration.
8332    #[derive(Clone, Default, PartialEq)]
8333    #[non_exhaustive]
8334    pub struct Widevine {
8335        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8336    }
8337
8338    impl Widevine {
8339        pub fn new() -> Self {
8340            std::default::Default::default()
8341        }
8342    }
8343
8344    impl wkt::message::Message for Widevine {
8345        fn typename() -> &'static str {
8346            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Widevine"
8347        }
8348    }
8349
8350    /// Fairplay configuration.
8351    #[derive(Clone, Default, PartialEq)]
8352    #[non_exhaustive]
8353    pub struct Fairplay {
8354        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8355    }
8356
8357    impl Fairplay {
8358        pub fn new() -> Self {
8359            std::default::Default::default()
8360        }
8361    }
8362
8363    impl wkt::message::Message for Fairplay {
8364        fn typename() -> &'static str {
8365            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Fairplay"
8366        }
8367    }
8368
8369    /// Playready configuration.
8370    #[derive(Clone, Default, PartialEq)]
8371    #[non_exhaustive]
8372    pub struct Playready {
8373        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8374    }
8375
8376    impl Playready {
8377        pub fn new() -> Self {
8378            std::default::Default::default()
8379        }
8380    }
8381
8382    impl wkt::message::Message for Playready {
8383        fn typename() -> &'static str {
8384            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Playready"
8385        }
8386    }
8387
8388    /// Clearkey configuration.
8389    #[derive(Clone, Default, PartialEq)]
8390    #[non_exhaustive]
8391    pub struct Clearkey {
8392        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8393    }
8394
8395    impl Clearkey {
8396        pub fn new() -> Self {
8397            std::default::Default::default()
8398        }
8399    }
8400
8401    impl wkt::message::Message for Clearkey {
8402        fn typename() -> &'static str {
8403            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Clearkey"
8404        }
8405    }
8406
8407    /// Defines configuration for DRM systems in use.
8408    #[derive(Clone, Default, PartialEq)]
8409    #[non_exhaustive]
8410    pub struct DrmSystems {
8411        /// Widevine configuration.
8412        pub widevine: std::option::Option<crate::model::encryption::Widevine>,
8413
8414        /// Fairplay configuration.
8415        pub fairplay: std::option::Option<crate::model::encryption::Fairplay>,
8416
8417        /// Playready configuration.
8418        pub playready: std::option::Option<crate::model::encryption::Playready>,
8419
8420        /// Clearkey configuration.
8421        pub clearkey: std::option::Option<crate::model::encryption::Clearkey>,
8422
8423        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8424    }
8425
8426    impl DrmSystems {
8427        pub fn new() -> Self {
8428            std::default::Default::default()
8429        }
8430
8431        /// Sets the value of [widevine][crate::model::encryption::DrmSystems::widevine].
8432        ///
8433        /// # Example
8434        /// ```ignore,no_run
8435        /// # use google_cloud_video_transcoder_v1::model::encryption::DrmSystems;
8436        /// use google_cloud_video_transcoder_v1::model::encryption::Widevine;
8437        /// let x = DrmSystems::new().set_widevine(Widevine::default()/* use setters */);
8438        /// ```
8439        pub fn set_widevine<T>(mut self, v: T) -> Self
8440        where
8441            T: std::convert::Into<crate::model::encryption::Widevine>,
8442        {
8443            self.widevine = std::option::Option::Some(v.into());
8444            self
8445        }
8446
8447        /// Sets or clears the value of [widevine][crate::model::encryption::DrmSystems::widevine].
8448        ///
8449        /// # Example
8450        /// ```ignore,no_run
8451        /// # use google_cloud_video_transcoder_v1::model::encryption::DrmSystems;
8452        /// use google_cloud_video_transcoder_v1::model::encryption::Widevine;
8453        /// let x = DrmSystems::new().set_or_clear_widevine(Some(Widevine::default()/* use setters */));
8454        /// let x = DrmSystems::new().set_or_clear_widevine(None::<Widevine>);
8455        /// ```
8456        pub fn set_or_clear_widevine<T>(mut self, v: std::option::Option<T>) -> Self
8457        where
8458            T: std::convert::Into<crate::model::encryption::Widevine>,
8459        {
8460            self.widevine = v.map(|x| x.into());
8461            self
8462        }
8463
8464        /// Sets the value of [fairplay][crate::model::encryption::DrmSystems::fairplay].
8465        ///
8466        /// # Example
8467        /// ```ignore,no_run
8468        /// # use google_cloud_video_transcoder_v1::model::encryption::DrmSystems;
8469        /// use google_cloud_video_transcoder_v1::model::encryption::Fairplay;
8470        /// let x = DrmSystems::new().set_fairplay(Fairplay::default()/* use setters */);
8471        /// ```
8472        pub fn set_fairplay<T>(mut self, v: T) -> Self
8473        where
8474            T: std::convert::Into<crate::model::encryption::Fairplay>,
8475        {
8476            self.fairplay = std::option::Option::Some(v.into());
8477            self
8478        }
8479
8480        /// Sets or clears the value of [fairplay][crate::model::encryption::DrmSystems::fairplay].
8481        ///
8482        /// # Example
8483        /// ```ignore,no_run
8484        /// # use google_cloud_video_transcoder_v1::model::encryption::DrmSystems;
8485        /// use google_cloud_video_transcoder_v1::model::encryption::Fairplay;
8486        /// let x = DrmSystems::new().set_or_clear_fairplay(Some(Fairplay::default()/* use setters */));
8487        /// let x = DrmSystems::new().set_or_clear_fairplay(None::<Fairplay>);
8488        /// ```
8489        pub fn set_or_clear_fairplay<T>(mut self, v: std::option::Option<T>) -> Self
8490        where
8491            T: std::convert::Into<crate::model::encryption::Fairplay>,
8492        {
8493            self.fairplay = v.map(|x| x.into());
8494            self
8495        }
8496
8497        /// Sets the value of [playready][crate::model::encryption::DrmSystems::playready].
8498        ///
8499        /// # Example
8500        /// ```ignore,no_run
8501        /// # use google_cloud_video_transcoder_v1::model::encryption::DrmSystems;
8502        /// use google_cloud_video_transcoder_v1::model::encryption::Playready;
8503        /// let x = DrmSystems::new().set_playready(Playready::default()/* use setters */);
8504        /// ```
8505        pub fn set_playready<T>(mut self, v: T) -> Self
8506        where
8507            T: std::convert::Into<crate::model::encryption::Playready>,
8508        {
8509            self.playready = std::option::Option::Some(v.into());
8510            self
8511        }
8512
8513        /// Sets or clears the value of [playready][crate::model::encryption::DrmSystems::playready].
8514        ///
8515        /// # Example
8516        /// ```ignore,no_run
8517        /// # use google_cloud_video_transcoder_v1::model::encryption::DrmSystems;
8518        /// use google_cloud_video_transcoder_v1::model::encryption::Playready;
8519        /// let x = DrmSystems::new().set_or_clear_playready(Some(Playready::default()/* use setters */));
8520        /// let x = DrmSystems::new().set_or_clear_playready(None::<Playready>);
8521        /// ```
8522        pub fn set_or_clear_playready<T>(mut self, v: std::option::Option<T>) -> Self
8523        where
8524            T: std::convert::Into<crate::model::encryption::Playready>,
8525        {
8526            self.playready = v.map(|x| x.into());
8527            self
8528        }
8529
8530        /// Sets the value of [clearkey][crate::model::encryption::DrmSystems::clearkey].
8531        ///
8532        /// # Example
8533        /// ```ignore,no_run
8534        /// # use google_cloud_video_transcoder_v1::model::encryption::DrmSystems;
8535        /// use google_cloud_video_transcoder_v1::model::encryption::Clearkey;
8536        /// let x = DrmSystems::new().set_clearkey(Clearkey::default()/* use setters */);
8537        /// ```
8538        pub fn set_clearkey<T>(mut self, v: T) -> Self
8539        where
8540            T: std::convert::Into<crate::model::encryption::Clearkey>,
8541        {
8542            self.clearkey = std::option::Option::Some(v.into());
8543            self
8544        }
8545
8546        /// Sets or clears the value of [clearkey][crate::model::encryption::DrmSystems::clearkey].
8547        ///
8548        /// # Example
8549        /// ```ignore,no_run
8550        /// # use google_cloud_video_transcoder_v1::model::encryption::DrmSystems;
8551        /// use google_cloud_video_transcoder_v1::model::encryption::Clearkey;
8552        /// let x = DrmSystems::new().set_or_clear_clearkey(Some(Clearkey::default()/* use setters */));
8553        /// let x = DrmSystems::new().set_or_clear_clearkey(None::<Clearkey>);
8554        /// ```
8555        pub fn set_or_clear_clearkey<T>(mut self, v: std::option::Option<T>) -> Self
8556        where
8557            T: std::convert::Into<crate::model::encryption::Clearkey>,
8558        {
8559            self.clearkey = v.map(|x| x.into());
8560            self
8561        }
8562    }
8563
8564    impl wkt::message::Message for DrmSystems {
8565        fn typename() -> &'static str {
8566            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.DrmSystems"
8567        }
8568    }
8569
8570    /// Encryption mode can be either `aes` or `cenc`.
8571    #[derive(Clone, Debug, PartialEq)]
8572    #[non_exhaustive]
8573    pub enum EncryptionMode {
8574        /// Configuration for AES-128 encryption.
8575        Aes128(std::boxed::Box<crate::model::encryption::Aes128Encryption>),
8576        /// Configuration for SAMPLE-AES encryption.
8577        SampleAes(std::boxed::Box<crate::model::encryption::SampleAesEncryption>),
8578        /// Configuration for MPEG Common Encryption (MPEG-CENC).
8579        MpegCenc(std::boxed::Box<crate::model::encryption::MpegCommonEncryption>),
8580    }
8581
8582    /// Defines where content keys are stored.
8583    #[derive(Clone, Debug, PartialEq)]
8584    #[non_exhaustive]
8585    pub enum SecretSource {
8586        /// Keys are stored in Google Secret Manager.
8587        SecretManagerKeySource(std::boxed::Box<crate::model::encryption::SecretManagerSource>),
8588    }
8589}
8590
8591/// Request message for `TranscoderService.CreateJob`.
8592#[derive(Clone, Default, PartialEq)]
8593#[non_exhaustive]
8594pub struct CreateJobRequest {
8595    /// Required. The parent location to create and process this job.
8596    /// Format: `projects/{project}/locations/{location}`
8597    pub parent: std::string::String,
8598
8599    /// Required. Parameters for creating transcoding job.
8600    pub job: std::option::Option<crate::model::Job>,
8601
8602    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8603}
8604
8605impl CreateJobRequest {
8606    pub fn new() -> Self {
8607        std::default::Default::default()
8608    }
8609
8610    /// Sets the value of [parent][crate::model::CreateJobRequest::parent].
8611    ///
8612    /// # Example
8613    /// ```ignore,no_run
8614    /// # use google_cloud_video_transcoder_v1::model::CreateJobRequest;
8615    /// let x = CreateJobRequest::new().set_parent("example");
8616    /// ```
8617    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8618        self.parent = v.into();
8619        self
8620    }
8621
8622    /// Sets the value of [job][crate::model::CreateJobRequest::job].
8623    ///
8624    /// # Example
8625    /// ```ignore,no_run
8626    /// # use google_cloud_video_transcoder_v1::model::CreateJobRequest;
8627    /// use google_cloud_video_transcoder_v1::model::Job;
8628    /// let x = CreateJobRequest::new().set_job(Job::default()/* use setters */);
8629    /// ```
8630    pub fn set_job<T>(mut self, v: T) -> Self
8631    where
8632        T: std::convert::Into<crate::model::Job>,
8633    {
8634        self.job = std::option::Option::Some(v.into());
8635        self
8636    }
8637
8638    /// Sets or clears the value of [job][crate::model::CreateJobRequest::job].
8639    ///
8640    /// # Example
8641    /// ```ignore,no_run
8642    /// # use google_cloud_video_transcoder_v1::model::CreateJobRequest;
8643    /// use google_cloud_video_transcoder_v1::model::Job;
8644    /// let x = CreateJobRequest::new().set_or_clear_job(Some(Job::default()/* use setters */));
8645    /// let x = CreateJobRequest::new().set_or_clear_job(None::<Job>);
8646    /// ```
8647    pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
8648    where
8649        T: std::convert::Into<crate::model::Job>,
8650    {
8651        self.job = v.map(|x| x.into());
8652        self
8653    }
8654}
8655
8656impl wkt::message::Message for CreateJobRequest {
8657    fn typename() -> &'static str {
8658        "type.googleapis.com/google.cloud.video.transcoder.v1.CreateJobRequest"
8659    }
8660}
8661
8662/// Request message for `TranscoderService.ListJobs`.
8663/// The parent location from which to retrieve the collection of jobs.
8664#[derive(Clone, Default, PartialEq)]
8665#[non_exhaustive]
8666pub struct ListJobsRequest {
8667    /// Required. Format: `projects/{project}/locations/{location}`
8668    pub parent: std::string::String,
8669
8670    /// The maximum number of items to return.
8671    pub page_size: i32,
8672
8673    /// The `next_page_token` value returned from a previous List request, if
8674    /// any.
8675    pub page_token: std::string::String,
8676
8677    /// The filter expression, following the syntax outlined in
8678    /// <https://google.aip.dev/160>.
8679    pub filter: std::string::String,
8680
8681    /// One or more fields to compare and use to sort the output.
8682    /// See <https://google.aip.dev/132#ordering>.
8683    pub order_by: std::string::String,
8684
8685    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8686}
8687
8688impl ListJobsRequest {
8689    pub fn new() -> Self {
8690        std::default::Default::default()
8691    }
8692
8693    /// Sets the value of [parent][crate::model::ListJobsRequest::parent].
8694    ///
8695    /// # Example
8696    /// ```ignore,no_run
8697    /// # use google_cloud_video_transcoder_v1::model::ListJobsRequest;
8698    /// let x = ListJobsRequest::new().set_parent("example");
8699    /// ```
8700    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8701        self.parent = v.into();
8702        self
8703    }
8704
8705    /// Sets the value of [page_size][crate::model::ListJobsRequest::page_size].
8706    ///
8707    /// # Example
8708    /// ```ignore,no_run
8709    /// # use google_cloud_video_transcoder_v1::model::ListJobsRequest;
8710    /// let x = ListJobsRequest::new().set_page_size(42);
8711    /// ```
8712    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8713        self.page_size = v.into();
8714        self
8715    }
8716
8717    /// Sets the value of [page_token][crate::model::ListJobsRequest::page_token].
8718    ///
8719    /// # Example
8720    /// ```ignore,no_run
8721    /// # use google_cloud_video_transcoder_v1::model::ListJobsRequest;
8722    /// let x = ListJobsRequest::new().set_page_token("example");
8723    /// ```
8724    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8725        self.page_token = v.into();
8726        self
8727    }
8728
8729    /// Sets the value of [filter][crate::model::ListJobsRequest::filter].
8730    ///
8731    /// # Example
8732    /// ```ignore,no_run
8733    /// # use google_cloud_video_transcoder_v1::model::ListJobsRequest;
8734    /// let x = ListJobsRequest::new().set_filter("example");
8735    /// ```
8736    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8737        self.filter = v.into();
8738        self
8739    }
8740
8741    /// Sets the value of [order_by][crate::model::ListJobsRequest::order_by].
8742    ///
8743    /// # Example
8744    /// ```ignore,no_run
8745    /// # use google_cloud_video_transcoder_v1::model::ListJobsRequest;
8746    /// let x = ListJobsRequest::new().set_order_by("example");
8747    /// ```
8748    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8749        self.order_by = v.into();
8750        self
8751    }
8752}
8753
8754impl wkt::message::Message for ListJobsRequest {
8755    fn typename() -> &'static str {
8756        "type.googleapis.com/google.cloud.video.transcoder.v1.ListJobsRequest"
8757    }
8758}
8759
8760/// Request message for `TranscoderService.GetJob`.
8761#[derive(Clone, Default, PartialEq)]
8762#[non_exhaustive]
8763pub struct GetJobRequest {
8764    /// Required. The name of the job to retrieve.
8765    /// Format: `projects/{project}/locations/{location}/jobs/{job}`
8766    pub name: std::string::String,
8767
8768    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8769}
8770
8771impl GetJobRequest {
8772    pub fn new() -> Self {
8773        std::default::Default::default()
8774    }
8775
8776    /// Sets the value of [name][crate::model::GetJobRequest::name].
8777    ///
8778    /// # Example
8779    /// ```ignore,no_run
8780    /// # use google_cloud_video_transcoder_v1::model::GetJobRequest;
8781    /// let x = GetJobRequest::new().set_name("example");
8782    /// ```
8783    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8784        self.name = v.into();
8785        self
8786    }
8787}
8788
8789impl wkt::message::Message for GetJobRequest {
8790    fn typename() -> &'static str {
8791        "type.googleapis.com/google.cloud.video.transcoder.v1.GetJobRequest"
8792    }
8793}
8794
8795/// Request message for `TranscoderService.DeleteJob`.
8796#[derive(Clone, Default, PartialEq)]
8797#[non_exhaustive]
8798pub struct DeleteJobRequest {
8799    /// Required. The name of the job to delete.
8800    /// Format: `projects/{project}/locations/{location}/jobs/{job}`
8801    pub name: std::string::String,
8802
8803    /// If set to true, and the job is not found, the request will succeed but no
8804    /// action will be taken on the server.
8805    pub allow_missing: bool,
8806
8807    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8808}
8809
8810impl DeleteJobRequest {
8811    pub fn new() -> Self {
8812        std::default::Default::default()
8813    }
8814
8815    /// Sets the value of [name][crate::model::DeleteJobRequest::name].
8816    ///
8817    /// # Example
8818    /// ```ignore,no_run
8819    /// # use google_cloud_video_transcoder_v1::model::DeleteJobRequest;
8820    /// let x = DeleteJobRequest::new().set_name("example");
8821    /// ```
8822    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8823        self.name = v.into();
8824        self
8825    }
8826
8827    /// Sets the value of [allow_missing][crate::model::DeleteJobRequest::allow_missing].
8828    ///
8829    /// # Example
8830    /// ```ignore,no_run
8831    /// # use google_cloud_video_transcoder_v1::model::DeleteJobRequest;
8832    /// let x = DeleteJobRequest::new().set_allow_missing(true);
8833    /// ```
8834    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8835        self.allow_missing = v.into();
8836        self
8837    }
8838}
8839
8840impl wkt::message::Message for DeleteJobRequest {
8841    fn typename() -> &'static str {
8842        "type.googleapis.com/google.cloud.video.transcoder.v1.DeleteJobRequest"
8843    }
8844}
8845
8846/// Response message for `TranscoderService.ListJobs`.
8847#[derive(Clone, Default, PartialEq)]
8848#[non_exhaustive]
8849pub struct ListJobsResponse {
8850    /// List of jobs in the specified region.
8851    pub jobs: std::vec::Vec<crate::model::Job>,
8852
8853    /// The pagination token.
8854    pub next_page_token: std::string::String,
8855
8856    /// List of regions that could not be reached.
8857    pub unreachable: std::vec::Vec<std::string::String>,
8858
8859    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8860}
8861
8862impl ListJobsResponse {
8863    pub fn new() -> Self {
8864        std::default::Default::default()
8865    }
8866
8867    /// Sets the value of [jobs][crate::model::ListJobsResponse::jobs].
8868    ///
8869    /// # Example
8870    /// ```ignore,no_run
8871    /// # use google_cloud_video_transcoder_v1::model::ListJobsResponse;
8872    /// use google_cloud_video_transcoder_v1::model::Job;
8873    /// let x = ListJobsResponse::new()
8874    ///     .set_jobs([
8875    ///         Job::default()/* use setters */,
8876    ///         Job::default()/* use (different) setters */,
8877    ///     ]);
8878    /// ```
8879    pub fn set_jobs<T, V>(mut self, v: T) -> Self
8880    where
8881        T: std::iter::IntoIterator<Item = V>,
8882        V: std::convert::Into<crate::model::Job>,
8883    {
8884        use std::iter::Iterator;
8885        self.jobs = v.into_iter().map(|i| i.into()).collect();
8886        self
8887    }
8888
8889    /// Sets the value of [next_page_token][crate::model::ListJobsResponse::next_page_token].
8890    ///
8891    /// # Example
8892    /// ```ignore,no_run
8893    /// # use google_cloud_video_transcoder_v1::model::ListJobsResponse;
8894    /// let x = ListJobsResponse::new().set_next_page_token("example");
8895    /// ```
8896    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8897        self.next_page_token = v.into();
8898        self
8899    }
8900
8901    /// Sets the value of [unreachable][crate::model::ListJobsResponse::unreachable].
8902    ///
8903    /// # Example
8904    /// ```ignore,no_run
8905    /// # use google_cloud_video_transcoder_v1::model::ListJobsResponse;
8906    /// let x = ListJobsResponse::new().set_unreachable(["a", "b", "c"]);
8907    /// ```
8908    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
8909    where
8910        T: std::iter::IntoIterator<Item = V>,
8911        V: std::convert::Into<std::string::String>,
8912    {
8913        use std::iter::Iterator;
8914        self.unreachable = v.into_iter().map(|i| i.into()).collect();
8915        self
8916    }
8917}
8918
8919impl wkt::message::Message for ListJobsResponse {
8920    fn typename() -> &'static str {
8921        "type.googleapis.com/google.cloud.video.transcoder.v1.ListJobsResponse"
8922    }
8923}
8924
8925#[doc(hidden)]
8926impl google_cloud_gax::paginator::internal::PageableResponse for ListJobsResponse {
8927    type PageItem = crate::model::Job;
8928
8929    fn items(self) -> std::vec::Vec<Self::PageItem> {
8930        self.jobs
8931    }
8932
8933    fn next_page_token(&self) -> std::string::String {
8934        use std::clone::Clone;
8935        self.next_page_token.clone()
8936    }
8937}
8938
8939/// Request message for `TranscoderService.CreateJobTemplate`.
8940#[derive(Clone, Default, PartialEq)]
8941#[non_exhaustive]
8942pub struct CreateJobTemplateRequest {
8943    /// Required. The parent location to create this job template.
8944    /// Format: `projects/{project}/locations/{location}`
8945    pub parent: std::string::String,
8946
8947    /// Required. Parameters for creating job template.
8948    pub job_template: std::option::Option<crate::model::JobTemplate>,
8949
8950    /// Required. The ID to use for the job template, which will become the final
8951    /// component of the job template's resource name.
8952    ///
8953    /// This value should be 4-63 characters, and valid characters must match the
8954    /// regular expression `[a-zA-Z][a-zA-Z0-9_-]*`.
8955    pub job_template_id: std::string::String,
8956
8957    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8958}
8959
8960impl CreateJobTemplateRequest {
8961    pub fn new() -> Self {
8962        std::default::Default::default()
8963    }
8964
8965    /// Sets the value of [parent][crate::model::CreateJobTemplateRequest::parent].
8966    ///
8967    /// # Example
8968    /// ```ignore,no_run
8969    /// # use google_cloud_video_transcoder_v1::model::CreateJobTemplateRequest;
8970    /// let x = CreateJobTemplateRequest::new().set_parent("example");
8971    /// ```
8972    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8973        self.parent = v.into();
8974        self
8975    }
8976
8977    /// Sets the value of [job_template][crate::model::CreateJobTemplateRequest::job_template].
8978    ///
8979    /// # Example
8980    /// ```ignore,no_run
8981    /// # use google_cloud_video_transcoder_v1::model::CreateJobTemplateRequest;
8982    /// use google_cloud_video_transcoder_v1::model::JobTemplate;
8983    /// let x = CreateJobTemplateRequest::new().set_job_template(JobTemplate::default()/* use setters */);
8984    /// ```
8985    pub fn set_job_template<T>(mut self, v: T) -> Self
8986    where
8987        T: std::convert::Into<crate::model::JobTemplate>,
8988    {
8989        self.job_template = std::option::Option::Some(v.into());
8990        self
8991    }
8992
8993    /// Sets or clears the value of [job_template][crate::model::CreateJobTemplateRequest::job_template].
8994    ///
8995    /// # Example
8996    /// ```ignore,no_run
8997    /// # use google_cloud_video_transcoder_v1::model::CreateJobTemplateRequest;
8998    /// use google_cloud_video_transcoder_v1::model::JobTemplate;
8999    /// let x = CreateJobTemplateRequest::new().set_or_clear_job_template(Some(JobTemplate::default()/* use setters */));
9000    /// let x = CreateJobTemplateRequest::new().set_or_clear_job_template(None::<JobTemplate>);
9001    /// ```
9002    pub fn set_or_clear_job_template<T>(mut self, v: std::option::Option<T>) -> Self
9003    where
9004        T: std::convert::Into<crate::model::JobTemplate>,
9005    {
9006        self.job_template = v.map(|x| x.into());
9007        self
9008    }
9009
9010    /// Sets the value of [job_template_id][crate::model::CreateJobTemplateRequest::job_template_id].
9011    ///
9012    /// # Example
9013    /// ```ignore,no_run
9014    /// # use google_cloud_video_transcoder_v1::model::CreateJobTemplateRequest;
9015    /// let x = CreateJobTemplateRequest::new().set_job_template_id("example");
9016    /// ```
9017    pub fn set_job_template_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9018        self.job_template_id = v.into();
9019        self
9020    }
9021}
9022
9023impl wkt::message::Message for CreateJobTemplateRequest {
9024    fn typename() -> &'static str {
9025        "type.googleapis.com/google.cloud.video.transcoder.v1.CreateJobTemplateRequest"
9026    }
9027}
9028
9029/// Request message for `TranscoderService.ListJobTemplates`.
9030#[derive(Clone, Default, PartialEq)]
9031#[non_exhaustive]
9032pub struct ListJobTemplatesRequest {
9033    /// Required. The parent location from which to retrieve the collection of job
9034    /// templates. Format: `projects/{project}/locations/{location}`
9035    pub parent: std::string::String,
9036
9037    /// The maximum number of items to return.
9038    pub page_size: i32,
9039
9040    /// The `next_page_token` value returned from a previous List request, if
9041    /// any.
9042    pub page_token: std::string::String,
9043
9044    /// The filter expression, following the syntax outlined in
9045    /// <https://google.aip.dev/160>.
9046    pub filter: std::string::String,
9047
9048    /// One or more fields to compare and use to sort the output.
9049    /// See <https://google.aip.dev/132#ordering>.
9050    pub order_by: std::string::String,
9051
9052    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9053}
9054
9055impl ListJobTemplatesRequest {
9056    pub fn new() -> Self {
9057        std::default::Default::default()
9058    }
9059
9060    /// Sets the value of [parent][crate::model::ListJobTemplatesRequest::parent].
9061    ///
9062    /// # Example
9063    /// ```ignore,no_run
9064    /// # use google_cloud_video_transcoder_v1::model::ListJobTemplatesRequest;
9065    /// let x = ListJobTemplatesRequest::new().set_parent("example");
9066    /// ```
9067    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9068        self.parent = v.into();
9069        self
9070    }
9071
9072    /// Sets the value of [page_size][crate::model::ListJobTemplatesRequest::page_size].
9073    ///
9074    /// # Example
9075    /// ```ignore,no_run
9076    /// # use google_cloud_video_transcoder_v1::model::ListJobTemplatesRequest;
9077    /// let x = ListJobTemplatesRequest::new().set_page_size(42);
9078    /// ```
9079    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9080        self.page_size = v.into();
9081        self
9082    }
9083
9084    /// Sets the value of [page_token][crate::model::ListJobTemplatesRequest::page_token].
9085    ///
9086    /// # Example
9087    /// ```ignore,no_run
9088    /// # use google_cloud_video_transcoder_v1::model::ListJobTemplatesRequest;
9089    /// let x = ListJobTemplatesRequest::new().set_page_token("example");
9090    /// ```
9091    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9092        self.page_token = v.into();
9093        self
9094    }
9095
9096    /// Sets the value of [filter][crate::model::ListJobTemplatesRequest::filter].
9097    ///
9098    /// # Example
9099    /// ```ignore,no_run
9100    /// # use google_cloud_video_transcoder_v1::model::ListJobTemplatesRequest;
9101    /// let x = ListJobTemplatesRequest::new().set_filter("example");
9102    /// ```
9103    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9104        self.filter = v.into();
9105        self
9106    }
9107
9108    /// Sets the value of [order_by][crate::model::ListJobTemplatesRequest::order_by].
9109    ///
9110    /// # Example
9111    /// ```ignore,no_run
9112    /// # use google_cloud_video_transcoder_v1::model::ListJobTemplatesRequest;
9113    /// let x = ListJobTemplatesRequest::new().set_order_by("example");
9114    /// ```
9115    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9116        self.order_by = v.into();
9117        self
9118    }
9119}
9120
9121impl wkt::message::Message for ListJobTemplatesRequest {
9122    fn typename() -> &'static str {
9123        "type.googleapis.com/google.cloud.video.transcoder.v1.ListJobTemplatesRequest"
9124    }
9125}
9126
9127/// Request message for `TranscoderService.GetJobTemplate`.
9128#[derive(Clone, Default, PartialEq)]
9129#[non_exhaustive]
9130pub struct GetJobTemplateRequest {
9131    /// Required. The name of the job template to retrieve.
9132    /// Format:
9133    /// `projects/{project}/locations/{location}/jobTemplates/{job_template}`
9134    pub name: std::string::String,
9135
9136    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9137}
9138
9139impl GetJobTemplateRequest {
9140    pub fn new() -> Self {
9141        std::default::Default::default()
9142    }
9143
9144    /// Sets the value of [name][crate::model::GetJobTemplateRequest::name].
9145    ///
9146    /// # Example
9147    /// ```ignore,no_run
9148    /// # use google_cloud_video_transcoder_v1::model::GetJobTemplateRequest;
9149    /// let x = GetJobTemplateRequest::new().set_name("example");
9150    /// ```
9151    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9152        self.name = v.into();
9153        self
9154    }
9155}
9156
9157impl wkt::message::Message for GetJobTemplateRequest {
9158    fn typename() -> &'static str {
9159        "type.googleapis.com/google.cloud.video.transcoder.v1.GetJobTemplateRequest"
9160    }
9161}
9162
9163/// Request message for `TranscoderService.DeleteJobTemplate`.
9164#[derive(Clone, Default, PartialEq)]
9165#[non_exhaustive]
9166pub struct DeleteJobTemplateRequest {
9167    /// Required. The name of the job template to delete.
9168    /// `projects/{project}/locations/{location}/jobTemplates/{job_template}`
9169    pub name: std::string::String,
9170
9171    /// If set to true, and the job template is not found, the request will succeed
9172    /// but no action will be taken on the server.
9173    pub allow_missing: bool,
9174
9175    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9176}
9177
9178impl DeleteJobTemplateRequest {
9179    pub fn new() -> Self {
9180        std::default::Default::default()
9181    }
9182
9183    /// Sets the value of [name][crate::model::DeleteJobTemplateRequest::name].
9184    ///
9185    /// # Example
9186    /// ```ignore,no_run
9187    /// # use google_cloud_video_transcoder_v1::model::DeleteJobTemplateRequest;
9188    /// let x = DeleteJobTemplateRequest::new().set_name("example");
9189    /// ```
9190    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9191        self.name = v.into();
9192        self
9193    }
9194
9195    /// Sets the value of [allow_missing][crate::model::DeleteJobTemplateRequest::allow_missing].
9196    ///
9197    /// # Example
9198    /// ```ignore,no_run
9199    /// # use google_cloud_video_transcoder_v1::model::DeleteJobTemplateRequest;
9200    /// let x = DeleteJobTemplateRequest::new().set_allow_missing(true);
9201    /// ```
9202    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9203        self.allow_missing = v.into();
9204        self
9205    }
9206}
9207
9208impl wkt::message::Message for DeleteJobTemplateRequest {
9209    fn typename() -> &'static str {
9210        "type.googleapis.com/google.cloud.video.transcoder.v1.DeleteJobTemplateRequest"
9211    }
9212}
9213
9214/// Response message for `TranscoderService.ListJobTemplates`.
9215#[derive(Clone, Default, PartialEq)]
9216#[non_exhaustive]
9217pub struct ListJobTemplatesResponse {
9218    /// List of job templates in the specified region.
9219    pub job_templates: std::vec::Vec<crate::model::JobTemplate>,
9220
9221    /// The pagination token.
9222    pub next_page_token: std::string::String,
9223
9224    /// List of regions that could not be reached.
9225    pub unreachable: std::vec::Vec<std::string::String>,
9226
9227    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9228}
9229
9230impl ListJobTemplatesResponse {
9231    pub fn new() -> Self {
9232        std::default::Default::default()
9233    }
9234
9235    /// Sets the value of [job_templates][crate::model::ListJobTemplatesResponse::job_templates].
9236    ///
9237    /// # Example
9238    /// ```ignore,no_run
9239    /// # use google_cloud_video_transcoder_v1::model::ListJobTemplatesResponse;
9240    /// use google_cloud_video_transcoder_v1::model::JobTemplate;
9241    /// let x = ListJobTemplatesResponse::new()
9242    ///     .set_job_templates([
9243    ///         JobTemplate::default()/* use setters */,
9244    ///         JobTemplate::default()/* use (different) setters */,
9245    ///     ]);
9246    /// ```
9247    pub fn set_job_templates<T, V>(mut self, v: T) -> Self
9248    where
9249        T: std::iter::IntoIterator<Item = V>,
9250        V: std::convert::Into<crate::model::JobTemplate>,
9251    {
9252        use std::iter::Iterator;
9253        self.job_templates = v.into_iter().map(|i| i.into()).collect();
9254        self
9255    }
9256
9257    /// Sets the value of [next_page_token][crate::model::ListJobTemplatesResponse::next_page_token].
9258    ///
9259    /// # Example
9260    /// ```ignore,no_run
9261    /// # use google_cloud_video_transcoder_v1::model::ListJobTemplatesResponse;
9262    /// let x = ListJobTemplatesResponse::new().set_next_page_token("example");
9263    /// ```
9264    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9265        self.next_page_token = v.into();
9266        self
9267    }
9268
9269    /// Sets the value of [unreachable][crate::model::ListJobTemplatesResponse::unreachable].
9270    ///
9271    /// # Example
9272    /// ```ignore,no_run
9273    /// # use google_cloud_video_transcoder_v1::model::ListJobTemplatesResponse;
9274    /// let x = ListJobTemplatesResponse::new().set_unreachable(["a", "b", "c"]);
9275    /// ```
9276    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9277    where
9278        T: std::iter::IntoIterator<Item = V>,
9279        V: std::convert::Into<std::string::String>,
9280    {
9281        use std::iter::Iterator;
9282        self.unreachable = v.into_iter().map(|i| i.into()).collect();
9283        self
9284    }
9285}
9286
9287impl wkt::message::Message for ListJobTemplatesResponse {
9288    fn typename() -> &'static str {
9289        "type.googleapis.com/google.cloud.video.transcoder.v1.ListJobTemplatesResponse"
9290    }
9291}
9292
9293#[doc(hidden)]
9294impl google_cloud_gax::paginator::internal::PageableResponse for ListJobTemplatesResponse {
9295    type PageItem = crate::model::JobTemplate;
9296
9297    fn items(self) -> std::vec::Vec<Self::PageItem> {
9298        self.job_templates
9299    }
9300
9301    fn next_page_token(&self) -> std::string::String {
9302        use std::clone::Clone;
9303        self.next_page_token.clone()
9304    }
9305}