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