Skip to main content

google_cloud_video_transcoder_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_rpc;
25extern crate serde;
26extern crate serde_json;
27extern crate serde_with;
28extern crate std;
29extern crate tracing;
30extern crate wkt;
31
32mod debug;
33mod deserialize;
34mod serialize;
35
36/// Transcoding job resource.
37#[derive(Clone, Default, PartialEq)]
38#[non_exhaustive]
39pub struct Job {
40    /// The resource name of the job.
41    /// Format: `projects/{project_number}/locations/{location}/jobs/{job}`
42    pub name: std::string::String,
43
44    /// Input only. Specify the `input_uri` to populate empty `uri` fields in each
45    /// element of `Job.config.inputs` or `JobTemplate.config.inputs` when using
46    /// template. URI of the media. Input files must be at least 5 seconds in
47    /// duration and stored in Cloud Storage (for example,
48    /// `gs://bucket/inputs/file.mp4`). See [Supported input and output
49    /// formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats).
50    pub input_uri: std::string::String,
51
52    /// Input only. Specify the `output_uri` to populate an empty
53    /// `Job.config.output.uri` or `JobTemplate.config.output.uri` when using
54    /// template. URI for the output file(s). For example,
55    /// `gs://my-bucket/outputs/`. See [Supported input and output
56    /// formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats).
57    pub output_uri: std::string::String,
58
59    /// Output only. The current state of the job.
60    pub state: crate::model::job::ProcessingState,
61
62    /// Output only. The time the job was created.
63    pub create_time: std::option::Option<wkt::Timestamp>,
64
65    /// Output only. The time the transcoding started.
66    pub start_time: std::option::Option<wkt::Timestamp>,
67
68    /// Output only. The time the transcoding finished.
69    pub end_time: std::option::Option<wkt::Timestamp>,
70
71    /// Job time to live value in days, which will be effective after job
72    /// completion. Job should be deleted automatically after the given TTL. Enter
73    /// a value between 1 and 90. The default is 30.
74    pub ttl_after_completion_days: i32,
75
76    /// The labels associated with this job. You can use these to organize and
77    /// group your jobs.
78    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
79
80    /// Output only. An error object that describes the reason for the failure.
81    /// This property is always present when
82    /// [ProcessingState][google.cloud.video.transcoder.v1.Job.ProcessingState] is
83    /// `FAILED`.
84    ///
85    /// [google.cloud.video.transcoder.v1.Job.ProcessingState]: crate::model::job::ProcessingState
86    pub error: std::option::Option<google_cloud_rpc::model::Status>,
87
88    /// The processing mode of the job.
89    /// The default is `PROCESSING_MODE_INTERACTIVE`.
90    pub mode: crate::model::job::ProcessingMode,
91
92    /// The processing priority of a batch job.
93    /// This field can only be set for batch mode jobs. The default value is 0.
94    /// This value cannot be negative. Higher values correspond to higher
95    /// priorities for the job.
96    pub batch_mode_priority: i32,
97
98    /// Optional. The optimization strategy of the job. The default is
99    /// `AUTODETECT`.
100    pub optimization: crate::model::job::OptimizationStrategy,
101
102    /// Optional. Insert silence and duplicate frames when timestamp gaps are
103    /// detected in a given stream.
104    pub fill_content_gaps: bool,
105
106    /// Specify the config for the transcoding job. If you don't specify the
107    /// `job_config`, the API selects `templateId`; this template ID is set to
108    /// `preset/web-hd` by default. When you use a `template_id` to create a job,
109    /// the `Job.config` is populated by the `JobTemplate.config`.\<br\>
110    pub job_config: std::option::Option<crate::model::job::JobConfig>,
111
112    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
113}
114
115impl Job {
116    /// Creates a new default instance.
117    pub fn new() -> Self {
118        std::default::Default::default()
119    }
120
121    /// Sets the value of [name][crate::model::Job::name].
122    ///
123    /// # Example
124    /// ```ignore,no_run
125    /// # use google_cloud_video_transcoder_v1::model::Job;
126    /// # let project_id = "project_id";
127    /// # let location_id = "location_id";
128    /// # let job_id = "job_id";
129    /// let x = Job::new().set_name(format!("projects/{project_id}/locations/{location_id}/jobs/{job_id}"));
130    /// ```
131    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
132        self.name = v.into();
133        self
134    }
135
136    /// Sets the value of [input_uri][crate::model::Job::input_uri].
137    ///
138    /// # Example
139    /// ```ignore,no_run
140    /// # use google_cloud_video_transcoder_v1::model::Job;
141    /// let x = Job::new().set_input_uri("example");
142    /// ```
143    pub fn set_input_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
144        self.input_uri = v.into();
145        self
146    }
147
148    /// Sets the value of [output_uri][crate::model::Job::output_uri].
149    ///
150    /// # Example
151    /// ```ignore,no_run
152    /// # use google_cloud_video_transcoder_v1::model::Job;
153    /// let x = Job::new().set_output_uri("example");
154    /// ```
155    pub fn set_output_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
156        self.output_uri = v.into();
157        self
158    }
159
160    /// Sets the value of [state][crate::model::Job::state].
161    ///
162    /// # Example
163    /// ```ignore,no_run
164    /// # use google_cloud_video_transcoder_v1::model::Job;
165    /// use google_cloud_video_transcoder_v1::model::job::ProcessingState;
166    /// let x0 = Job::new().set_state(ProcessingState::Pending);
167    /// let x1 = Job::new().set_state(ProcessingState::Running);
168    /// let x2 = Job::new().set_state(ProcessingState::Succeeded);
169    /// ```
170    pub fn set_state<T: std::convert::Into<crate::model::job::ProcessingState>>(
171        mut self,
172        v: T,
173    ) -> Self {
174        self.state = v.into();
175        self
176    }
177
178    /// Sets the value of [create_time][crate::model::Job::create_time].
179    ///
180    /// # Example
181    /// ```ignore,no_run
182    /// # use google_cloud_video_transcoder_v1::model::Job;
183    /// use wkt::Timestamp;
184    /// let x = Job::new().set_create_time(Timestamp::default()/* use setters */);
185    /// ```
186    pub fn set_create_time<T>(mut self, v: T) -> Self
187    where
188        T: std::convert::Into<wkt::Timestamp>,
189    {
190        self.create_time = std::option::Option::Some(v.into());
191        self
192    }
193
194    /// Sets or clears the value of [create_time][crate::model::Job::create_time].
195    ///
196    /// # Example
197    /// ```ignore,no_run
198    /// # use google_cloud_video_transcoder_v1::model::Job;
199    /// use wkt::Timestamp;
200    /// let x = Job::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
201    /// let x = Job::new().set_or_clear_create_time(None::<Timestamp>);
202    /// ```
203    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
204    where
205        T: std::convert::Into<wkt::Timestamp>,
206    {
207        self.create_time = v.map(|x| x.into());
208        self
209    }
210
211    /// Sets the value of [start_time][crate::model::Job::start_time].
212    ///
213    /// # Example
214    /// ```ignore,no_run
215    /// # use google_cloud_video_transcoder_v1::model::Job;
216    /// use wkt::Timestamp;
217    /// let x = Job::new().set_start_time(Timestamp::default()/* use setters */);
218    /// ```
219    pub fn set_start_time<T>(mut self, v: T) -> Self
220    where
221        T: std::convert::Into<wkt::Timestamp>,
222    {
223        self.start_time = std::option::Option::Some(v.into());
224        self
225    }
226
227    /// Sets or clears the value of [start_time][crate::model::Job::start_time].
228    ///
229    /// # Example
230    /// ```ignore,no_run
231    /// # use google_cloud_video_transcoder_v1::model::Job;
232    /// use wkt::Timestamp;
233    /// let x = Job::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
234    /// let x = Job::new().set_or_clear_start_time(None::<Timestamp>);
235    /// ```
236    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
237    where
238        T: std::convert::Into<wkt::Timestamp>,
239    {
240        self.start_time = v.map(|x| x.into());
241        self
242    }
243
244    /// Sets the value of [end_time][crate::model::Job::end_time].
245    ///
246    /// # Example
247    /// ```ignore,no_run
248    /// # use google_cloud_video_transcoder_v1::model::Job;
249    /// use wkt::Timestamp;
250    /// let x = Job::new().set_end_time(Timestamp::default()/* use setters */);
251    /// ```
252    pub fn set_end_time<T>(mut self, v: T) -> Self
253    where
254        T: std::convert::Into<wkt::Timestamp>,
255    {
256        self.end_time = std::option::Option::Some(v.into());
257        self
258    }
259
260    /// Sets or clears the value of [end_time][crate::model::Job::end_time].
261    ///
262    /// # Example
263    /// ```ignore,no_run
264    /// # use google_cloud_video_transcoder_v1::model::Job;
265    /// use wkt::Timestamp;
266    /// let x = Job::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
267    /// let x = Job::new().set_or_clear_end_time(None::<Timestamp>);
268    /// ```
269    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
270    where
271        T: std::convert::Into<wkt::Timestamp>,
272    {
273        self.end_time = v.map(|x| x.into());
274        self
275    }
276
277    /// Sets the value of [ttl_after_completion_days][crate::model::Job::ttl_after_completion_days].
278    ///
279    /// # Example
280    /// ```ignore,no_run
281    /// # use google_cloud_video_transcoder_v1::model::Job;
282    /// let x = Job::new().set_ttl_after_completion_days(42);
283    /// ```
284    pub fn set_ttl_after_completion_days<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
285        self.ttl_after_completion_days = v.into();
286        self
287    }
288
289    /// Sets the value of [labels][crate::model::Job::labels].
290    ///
291    /// # Example
292    /// ```ignore,no_run
293    /// # use google_cloud_video_transcoder_v1::model::Job;
294    /// let x = Job::new().set_labels([
295    ///     ("key0", "abc"),
296    ///     ("key1", "xyz"),
297    /// ]);
298    /// ```
299    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
300    where
301        T: std::iter::IntoIterator<Item = (K, V)>,
302        K: std::convert::Into<std::string::String>,
303        V: std::convert::Into<std::string::String>,
304    {
305        use std::iter::Iterator;
306        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
307        self
308    }
309
310    /// Sets the value of [error][crate::model::Job::error].
311    ///
312    /// # Example
313    /// ```ignore,no_run
314    /// # use google_cloud_video_transcoder_v1::model::Job;
315    /// use google_cloud_rpc::model::Status;
316    /// let x = Job::new().set_error(Status::default()/* use setters */);
317    /// ```
318    pub fn set_error<T>(mut self, v: T) -> Self
319    where
320        T: std::convert::Into<google_cloud_rpc::model::Status>,
321    {
322        self.error = std::option::Option::Some(v.into());
323        self
324    }
325
326    /// Sets or clears the value of [error][crate::model::Job::error].
327    ///
328    /// # Example
329    /// ```ignore,no_run
330    /// # use google_cloud_video_transcoder_v1::model::Job;
331    /// use google_cloud_rpc::model::Status;
332    /// let x = Job::new().set_or_clear_error(Some(Status::default()/* use setters */));
333    /// let x = Job::new().set_or_clear_error(None::<Status>);
334    /// ```
335    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
336    where
337        T: std::convert::Into<google_cloud_rpc::model::Status>,
338    {
339        self.error = v.map(|x| x.into());
340        self
341    }
342
343    /// Sets the value of [mode][crate::model::Job::mode].
344    ///
345    /// # Example
346    /// ```ignore,no_run
347    /// # use google_cloud_video_transcoder_v1::model::Job;
348    /// use google_cloud_video_transcoder_v1::model::job::ProcessingMode;
349    /// let x0 = Job::new().set_mode(ProcessingMode::Interactive);
350    /// let x1 = Job::new().set_mode(ProcessingMode::Batch);
351    /// ```
352    pub fn set_mode<T: std::convert::Into<crate::model::job::ProcessingMode>>(
353        mut self,
354        v: T,
355    ) -> Self {
356        self.mode = v.into();
357        self
358    }
359
360    /// Sets the value of [batch_mode_priority][crate::model::Job::batch_mode_priority].
361    ///
362    /// # Example
363    /// ```ignore,no_run
364    /// # use google_cloud_video_transcoder_v1::model::Job;
365    /// let x = Job::new().set_batch_mode_priority(42);
366    /// ```
367    pub fn set_batch_mode_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
368        self.batch_mode_priority = v.into();
369        self
370    }
371
372    /// Sets the value of [optimization][crate::model::Job::optimization].
373    ///
374    /// # Example
375    /// ```ignore,no_run
376    /// # use google_cloud_video_transcoder_v1::model::Job;
377    /// use google_cloud_video_transcoder_v1::model::job::OptimizationStrategy;
378    /// let x0 = Job::new().set_optimization(OptimizationStrategy::Autodetect);
379    /// let x1 = Job::new().set_optimization(OptimizationStrategy::Disabled);
380    /// ```
381    pub fn set_optimization<T: std::convert::Into<crate::model::job::OptimizationStrategy>>(
382        mut self,
383        v: T,
384    ) -> Self {
385        self.optimization = v.into();
386        self
387    }
388
389    /// Sets the value of [fill_content_gaps][crate::model::Job::fill_content_gaps].
390    ///
391    /// # Example
392    /// ```ignore,no_run
393    /// # use google_cloud_video_transcoder_v1::model::Job;
394    /// let x = Job::new().set_fill_content_gaps(true);
395    /// ```
396    pub fn set_fill_content_gaps<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
397        self.fill_content_gaps = v.into();
398        self
399    }
400
401    /// Sets the value of [job_config][crate::model::Job::job_config].
402    ///
403    /// Note that all the setters affecting `job_config` are mutually
404    /// exclusive.
405    ///
406    /// # Example
407    /// ```ignore,no_run
408    /// # use google_cloud_video_transcoder_v1::model::Job;
409    /// use google_cloud_video_transcoder_v1::model::job::JobConfig;
410    /// let x = Job::new().set_job_config(Some(JobConfig::TemplateId("example".to_string())));
411    /// ```
412    pub fn set_job_config<
413        T: std::convert::Into<std::option::Option<crate::model::job::JobConfig>>,
414    >(
415        mut self,
416        v: T,
417    ) -> Self {
418        self.job_config = v.into();
419        self
420    }
421
422    /// The value of [job_config][crate::model::Job::job_config]
423    /// if it holds a `TemplateId`, `None` if the field is not set or
424    /// holds a different branch.
425    pub fn template_id(&self) -> std::option::Option<&std::string::String> {
426        #[allow(unreachable_patterns)]
427        self.job_config.as_ref().and_then(|v| match v {
428            crate::model::job::JobConfig::TemplateId(v) => std::option::Option::Some(v),
429            _ => std::option::Option::None,
430        })
431    }
432
433    /// Sets the value of [job_config][crate::model::Job::job_config]
434    /// to hold a `TemplateId`.
435    ///
436    /// Note that all the setters affecting `job_config` are
437    /// mutually exclusive.
438    ///
439    /// # Example
440    /// ```ignore,no_run
441    /// # use google_cloud_video_transcoder_v1::model::Job;
442    /// let x = Job::new().set_template_id("example");
443    /// assert!(x.template_id().is_some());
444    /// assert!(x.config().is_none());
445    /// ```
446    pub fn set_template_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
447        self.job_config =
448            std::option::Option::Some(crate::model::job::JobConfig::TemplateId(v.into()));
449        self
450    }
451
452    /// The value of [job_config][crate::model::Job::job_config]
453    /// if it holds a `Config`, `None` if the field is not set or
454    /// holds a different branch.
455    pub fn config(&self) -> std::option::Option<&std::boxed::Box<crate::model::JobConfig>> {
456        #[allow(unreachable_patterns)]
457        self.job_config.as_ref().and_then(|v| match v {
458            crate::model::job::JobConfig::Config(v) => std::option::Option::Some(v),
459            _ => std::option::Option::None,
460        })
461    }
462
463    /// Sets the value of [job_config][crate::model::Job::job_config]
464    /// to hold a `Config`.
465    ///
466    /// Note that all the setters affecting `job_config` are
467    /// mutually exclusive.
468    ///
469    /// # Example
470    /// ```ignore,no_run
471    /// # use google_cloud_video_transcoder_v1::model::Job;
472    /// use google_cloud_video_transcoder_v1::model::JobConfig;
473    /// let x = Job::new().set_config(JobConfig::default()/* use setters */);
474    /// assert!(x.config().is_some());
475    /// assert!(x.template_id().is_none());
476    /// ```
477    pub fn set_config<T: std::convert::Into<std::boxed::Box<crate::model::JobConfig>>>(
478        mut self,
479        v: T,
480    ) -> Self {
481        self.job_config = std::option::Option::Some(crate::model::job::JobConfig::Config(v.into()));
482        self
483    }
484}
485
486impl wkt::message::Message for Job {
487    fn typename() -> &'static str {
488        "type.googleapis.com/google.cloud.video.transcoder.v1.Job"
489    }
490}
491
492/// Defines additional types related to [Job].
493pub mod job {
494    #[allow(unused_imports)]
495    use super::*;
496
497    /// The current state of the job.
498    ///
499    /// # Working with unknown values
500    ///
501    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
502    /// additional enum variants at any time. Adding new variants is not considered
503    /// a breaking change. Applications should write their code in anticipation of:
504    ///
505    /// - New values appearing in future releases of the client library, **and**
506    /// - New values received dynamically, without application changes.
507    ///
508    /// Please consult the [Working with enums] section in the user guide for some
509    /// guidelines.
510    ///
511    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
512    #[derive(Clone, Debug, PartialEq)]
513    #[non_exhaustive]
514    pub enum ProcessingState {
515        /// The processing state is not specified.
516        Unspecified,
517        /// The job is enqueued and will be picked up for processing soon.
518        Pending,
519        /// The job is being processed.
520        Running,
521        /// The job has been completed successfully.
522        Succeeded,
523        /// The job has failed. For additional information, see
524        /// [Troubleshooting](https://cloud.google.com/transcoder/docs/troubleshooting).
525        Failed,
526        /// If set, the enum was initialized with an unknown value.
527        ///
528        /// Applications can examine the value using [ProcessingState::value] or
529        /// [ProcessingState::name].
530        UnknownValue(processing_state::UnknownValue),
531    }
532
533    #[doc(hidden)]
534    pub mod processing_state {
535        #[allow(unused_imports)]
536        use super::*;
537        #[derive(Clone, Debug, PartialEq)]
538        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
539    }
540
541    impl ProcessingState {
542        /// Gets the enum value.
543        ///
544        /// Returns `None` if the enum contains an unknown value deserialized from
545        /// the string representation of enums.
546        pub fn value(&self) -> std::option::Option<i32> {
547            match self {
548                Self::Unspecified => std::option::Option::Some(0),
549                Self::Pending => std::option::Option::Some(1),
550                Self::Running => std::option::Option::Some(2),
551                Self::Succeeded => std::option::Option::Some(3),
552                Self::Failed => std::option::Option::Some(4),
553                Self::UnknownValue(u) => u.0.value(),
554            }
555        }
556
557        /// Gets the enum value as a string.
558        ///
559        /// Returns `None` if the enum contains an unknown value deserialized from
560        /// the integer representation of enums.
561        pub fn name(&self) -> std::option::Option<&str> {
562            match self {
563                Self::Unspecified => std::option::Option::Some("PROCESSING_STATE_UNSPECIFIED"),
564                Self::Pending => std::option::Option::Some("PENDING"),
565                Self::Running => std::option::Option::Some("RUNNING"),
566                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
567                Self::Failed => std::option::Option::Some("FAILED"),
568                Self::UnknownValue(u) => u.0.name(),
569            }
570        }
571    }
572
573    impl std::default::Default for ProcessingState {
574        fn default() -> Self {
575            use std::convert::From;
576            Self::from(0)
577        }
578    }
579
580    impl std::fmt::Display for ProcessingState {
581        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
582            wkt::internal::display_enum(f, self.name(), self.value())
583        }
584    }
585
586    impl std::convert::From<i32> for ProcessingState {
587        fn from(value: i32) -> Self {
588            match value {
589                0 => Self::Unspecified,
590                1 => Self::Pending,
591                2 => Self::Running,
592                3 => Self::Succeeded,
593                4 => Self::Failed,
594                _ => Self::UnknownValue(processing_state::UnknownValue(
595                    wkt::internal::UnknownEnumValue::Integer(value),
596                )),
597            }
598        }
599    }
600
601    impl std::convert::From<&str> for ProcessingState {
602        fn from(value: &str) -> Self {
603            use std::string::ToString;
604            match value {
605                "PROCESSING_STATE_UNSPECIFIED" => Self::Unspecified,
606                "PENDING" => Self::Pending,
607                "RUNNING" => Self::Running,
608                "SUCCEEDED" => Self::Succeeded,
609                "FAILED" => Self::Failed,
610                _ => Self::UnknownValue(processing_state::UnknownValue(
611                    wkt::internal::UnknownEnumValue::String(value.to_string()),
612                )),
613            }
614        }
615    }
616
617    impl serde::ser::Serialize for ProcessingState {
618        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
619        where
620            S: serde::Serializer,
621        {
622            match self {
623                Self::Unspecified => serializer.serialize_i32(0),
624                Self::Pending => serializer.serialize_i32(1),
625                Self::Running => serializer.serialize_i32(2),
626                Self::Succeeded => serializer.serialize_i32(3),
627                Self::Failed => serializer.serialize_i32(4),
628                Self::UnknownValue(u) => u.0.serialize(serializer),
629            }
630        }
631    }
632
633    impl<'de> serde::de::Deserialize<'de> for ProcessingState {
634        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
635        where
636            D: serde::Deserializer<'de>,
637        {
638            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProcessingState>::new(
639                ".google.cloud.video.transcoder.v1.Job.ProcessingState",
640            ))
641        }
642    }
643
644    /// The processing mode of the job.
645    ///
646    /// # Working with unknown values
647    ///
648    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
649    /// additional enum variants at any time. Adding new variants is not considered
650    /// a breaking change. Applications should write their code in anticipation of:
651    ///
652    /// - New values appearing in future releases of the client library, **and**
653    /// - New values received dynamically, without application changes.
654    ///
655    /// Please consult the [Working with enums] section in the user guide for some
656    /// guidelines.
657    ///
658    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
659    #[derive(Clone, Debug, PartialEq)]
660    #[non_exhaustive]
661    pub enum ProcessingMode {
662        /// The job processing mode is not specified.
663        Unspecified,
664        /// The job processing mode is interactive mode.
665        /// Interactive job will either be ran or rejected if quota does not allow
666        /// for it.
667        Interactive,
668        /// The job processing mode is batch mode.
669        /// Batch mode allows queuing of jobs.
670        Batch,
671        /// If set, the enum was initialized with an unknown value.
672        ///
673        /// Applications can examine the value using [ProcessingMode::value] or
674        /// [ProcessingMode::name].
675        UnknownValue(processing_mode::UnknownValue),
676    }
677
678    #[doc(hidden)]
679    pub mod processing_mode {
680        #[allow(unused_imports)]
681        use super::*;
682        #[derive(Clone, Debug, PartialEq)]
683        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
684    }
685
686    impl ProcessingMode {
687        /// Gets the enum value.
688        ///
689        /// Returns `None` if the enum contains an unknown value deserialized from
690        /// the string representation of enums.
691        pub fn value(&self) -> std::option::Option<i32> {
692            match self {
693                Self::Unspecified => std::option::Option::Some(0),
694                Self::Interactive => std::option::Option::Some(1),
695                Self::Batch => std::option::Option::Some(2),
696                Self::UnknownValue(u) => u.0.value(),
697            }
698        }
699
700        /// Gets the enum value as a string.
701        ///
702        /// Returns `None` if the enum contains an unknown value deserialized from
703        /// the integer representation of enums.
704        pub fn name(&self) -> std::option::Option<&str> {
705            match self {
706                Self::Unspecified => std::option::Option::Some("PROCESSING_MODE_UNSPECIFIED"),
707                Self::Interactive => std::option::Option::Some("PROCESSING_MODE_INTERACTIVE"),
708                Self::Batch => std::option::Option::Some("PROCESSING_MODE_BATCH"),
709                Self::UnknownValue(u) => u.0.name(),
710            }
711        }
712    }
713
714    impl std::default::Default for ProcessingMode {
715        fn default() -> Self {
716            use std::convert::From;
717            Self::from(0)
718        }
719    }
720
721    impl std::fmt::Display for ProcessingMode {
722        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
723            wkt::internal::display_enum(f, self.name(), self.value())
724        }
725    }
726
727    impl std::convert::From<i32> for ProcessingMode {
728        fn from(value: i32) -> Self {
729            match value {
730                0 => Self::Unspecified,
731                1 => Self::Interactive,
732                2 => Self::Batch,
733                _ => Self::UnknownValue(processing_mode::UnknownValue(
734                    wkt::internal::UnknownEnumValue::Integer(value),
735                )),
736            }
737        }
738    }
739
740    impl std::convert::From<&str> for ProcessingMode {
741        fn from(value: &str) -> Self {
742            use std::string::ToString;
743            match value {
744                "PROCESSING_MODE_UNSPECIFIED" => Self::Unspecified,
745                "PROCESSING_MODE_INTERACTIVE" => Self::Interactive,
746                "PROCESSING_MODE_BATCH" => Self::Batch,
747                _ => Self::UnknownValue(processing_mode::UnknownValue(
748                    wkt::internal::UnknownEnumValue::String(value.to_string()),
749                )),
750            }
751        }
752    }
753
754    impl serde::ser::Serialize for ProcessingMode {
755        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
756        where
757            S: serde::Serializer,
758        {
759            match self {
760                Self::Unspecified => serializer.serialize_i32(0),
761                Self::Interactive => serializer.serialize_i32(1),
762                Self::Batch => serializer.serialize_i32(2),
763                Self::UnknownValue(u) => u.0.serialize(serializer),
764            }
765        }
766    }
767
768    impl<'de> serde::de::Deserialize<'de> for ProcessingMode {
769        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
770        where
771            D: serde::Deserializer<'de>,
772        {
773            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProcessingMode>::new(
774                ".google.cloud.video.transcoder.v1.Job.ProcessingMode",
775            ))
776        }
777    }
778
779    /// The optimization strategy of the job. The default is `AUTODETECT`.
780    ///
781    /// # Working with unknown values
782    ///
783    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
784    /// additional enum variants at any time. Adding new variants is not considered
785    /// a breaking change. Applications should write their code in anticipation of:
786    ///
787    /// - New values appearing in future releases of the client library, **and**
788    /// - New values received dynamically, without application changes.
789    ///
790    /// Please consult the [Working with enums] section in the user guide for some
791    /// guidelines.
792    ///
793    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
794    #[derive(Clone, Debug, PartialEq)]
795    #[non_exhaustive]
796    pub enum OptimizationStrategy {
797        /// The optimization strategy is not specified.
798        Unspecified,
799        /// Prioritize job processing speed.
800        Autodetect,
801        /// Disable all optimizations.
802        Disabled,
803        /// If set, the enum was initialized with an unknown value.
804        ///
805        /// Applications can examine the value using [OptimizationStrategy::value] or
806        /// [OptimizationStrategy::name].
807        UnknownValue(optimization_strategy::UnknownValue),
808    }
809
810    #[doc(hidden)]
811    pub mod optimization_strategy {
812        #[allow(unused_imports)]
813        use super::*;
814        #[derive(Clone, Debug, PartialEq)]
815        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
816    }
817
818    impl OptimizationStrategy {
819        /// Gets the enum value.
820        ///
821        /// Returns `None` if the enum contains an unknown value deserialized from
822        /// the string representation of enums.
823        pub fn value(&self) -> std::option::Option<i32> {
824            match self {
825                Self::Unspecified => std::option::Option::Some(0),
826                Self::Autodetect => std::option::Option::Some(1),
827                Self::Disabled => std::option::Option::Some(2),
828                Self::UnknownValue(u) => u.0.value(),
829            }
830        }
831
832        /// Gets the enum value as a string.
833        ///
834        /// Returns `None` if the enum contains an unknown value deserialized from
835        /// the integer representation of enums.
836        pub fn name(&self) -> std::option::Option<&str> {
837            match self {
838                Self::Unspecified => std::option::Option::Some("OPTIMIZATION_STRATEGY_UNSPECIFIED"),
839                Self::Autodetect => std::option::Option::Some("AUTODETECT"),
840                Self::Disabled => std::option::Option::Some("DISABLED"),
841                Self::UnknownValue(u) => u.0.name(),
842            }
843        }
844    }
845
846    impl std::default::Default for OptimizationStrategy {
847        fn default() -> Self {
848            use std::convert::From;
849            Self::from(0)
850        }
851    }
852
853    impl std::fmt::Display for OptimizationStrategy {
854        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
855            wkt::internal::display_enum(f, self.name(), self.value())
856        }
857    }
858
859    impl std::convert::From<i32> for OptimizationStrategy {
860        fn from(value: i32) -> Self {
861            match value {
862                0 => Self::Unspecified,
863                1 => Self::Autodetect,
864                2 => Self::Disabled,
865                _ => Self::UnknownValue(optimization_strategy::UnknownValue(
866                    wkt::internal::UnknownEnumValue::Integer(value),
867                )),
868            }
869        }
870    }
871
872    impl std::convert::From<&str> for OptimizationStrategy {
873        fn from(value: &str) -> Self {
874            use std::string::ToString;
875            match value {
876                "OPTIMIZATION_STRATEGY_UNSPECIFIED" => Self::Unspecified,
877                "AUTODETECT" => Self::Autodetect,
878                "DISABLED" => Self::Disabled,
879                _ => Self::UnknownValue(optimization_strategy::UnknownValue(
880                    wkt::internal::UnknownEnumValue::String(value.to_string()),
881                )),
882            }
883        }
884    }
885
886    impl serde::ser::Serialize for OptimizationStrategy {
887        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
888        where
889            S: serde::Serializer,
890        {
891            match self {
892                Self::Unspecified => serializer.serialize_i32(0),
893                Self::Autodetect => serializer.serialize_i32(1),
894                Self::Disabled => serializer.serialize_i32(2),
895                Self::UnknownValue(u) => u.0.serialize(serializer),
896            }
897        }
898    }
899
900    impl<'de> serde::de::Deserialize<'de> for OptimizationStrategy {
901        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
902        where
903            D: serde::Deserializer<'de>,
904        {
905            deserializer.deserialize_any(wkt::internal::EnumVisitor::<OptimizationStrategy>::new(
906                ".google.cloud.video.transcoder.v1.Job.OptimizationStrategy",
907            ))
908        }
909    }
910
911    /// Specify the config for the transcoding job. If you don't specify the
912    /// `job_config`, the API selects `templateId`; this template ID is set to
913    /// `preset/web-hd` by default. When you use a `template_id` to create a job,
914    /// the `Job.config` is populated by the `JobTemplate.config`.\<br\>
915    #[derive(Clone, Debug, PartialEq)]
916    #[non_exhaustive]
917    pub enum JobConfig {
918        /// Input only. Specify the `template_id` to use for populating `Job.config`.
919        /// The default is `preset/web-hd`, which is the only supported preset.
920        ///
921        /// User defined JobTemplate: `{job_template_id}`
922        TemplateId(std::string::String),
923        /// The configuration for this job.
924        Config(std::boxed::Box<crate::model::JobConfig>),
925    }
926}
927
928/// Transcoding job template resource.
929#[derive(Clone, Default, PartialEq)]
930#[non_exhaustive]
931pub struct JobTemplate {
932    /// The resource name of the job template.
933    /// Format:
934    /// `projects/{project_number}/locations/{location}/jobTemplates/{job_template}`
935    pub name: std::string::String,
936
937    /// The configuration for this template.
938    pub config: std::option::Option<crate::model::JobConfig>,
939
940    /// The labels associated with this job template. You can use these to organize
941    /// and group your job templates.
942    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
943
944    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
945}
946
947impl JobTemplate {
948    /// Creates a new default instance.
949    pub fn new() -> Self {
950        std::default::Default::default()
951    }
952
953    /// Sets the value of [name][crate::model::JobTemplate::name].
954    ///
955    /// # Example
956    /// ```ignore,no_run
957    /// # use google_cloud_video_transcoder_v1::model::JobTemplate;
958    /// # let project_id = "project_id";
959    /// # let location_id = "location_id";
960    /// # let job_template_id = "job_template_id";
961    /// let x = JobTemplate::new().set_name(format!("projects/{project_id}/locations/{location_id}/jobTemplates/{job_template_id}"));
962    /// ```
963    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
964        self.name = v.into();
965        self
966    }
967
968    /// Sets the value of [config][crate::model::JobTemplate::config].
969    ///
970    /// # Example
971    /// ```ignore,no_run
972    /// # use google_cloud_video_transcoder_v1::model::JobTemplate;
973    /// use google_cloud_video_transcoder_v1::model::JobConfig;
974    /// let x = JobTemplate::new().set_config(JobConfig::default()/* use setters */);
975    /// ```
976    pub fn set_config<T>(mut self, v: T) -> Self
977    where
978        T: std::convert::Into<crate::model::JobConfig>,
979    {
980        self.config = std::option::Option::Some(v.into());
981        self
982    }
983
984    /// Sets or clears the value of [config][crate::model::JobTemplate::config].
985    ///
986    /// # Example
987    /// ```ignore,no_run
988    /// # use google_cloud_video_transcoder_v1::model::JobTemplate;
989    /// use google_cloud_video_transcoder_v1::model::JobConfig;
990    /// let x = JobTemplate::new().set_or_clear_config(Some(JobConfig::default()/* use setters */));
991    /// let x = JobTemplate::new().set_or_clear_config(None::<JobConfig>);
992    /// ```
993    pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
994    where
995        T: std::convert::Into<crate::model::JobConfig>,
996    {
997        self.config = v.map(|x| x.into());
998        self
999    }
1000
1001    /// Sets the value of [labels][crate::model::JobTemplate::labels].
1002    ///
1003    /// # Example
1004    /// ```ignore,no_run
1005    /// # use google_cloud_video_transcoder_v1::model::JobTemplate;
1006    /// let x = JobTemplate::new().set_labels([
1007    ///     ("key0", "abc"),
1008    ///     ("key1", "xyz"),
1009    /// ]);
1010    /// ```
1011    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1012    where
1013        T: std::iter::IntoIterator<Item = (K, V)>,
1014        K: std::convert::Into<std::string::String>,
1015        V: std::convert::Into<std::string::String>,
1016    {
1017        use std::iter::Iterator;
1018        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1019        self
1020    }
1021}
1022
1023impl wkt::message::Message for JobTemplate {
1024    fn typename() -> &'static str {
1025        "type.googleapis.com/google.cloud.video.transcoder.v1.JobTemplate"
1026    }
1027}
1028
1029/// Job configuration
1030#[derive(Clone, Default, PartialEq)]
1031#[non_exhaustive]
1032pub struct JobConfig {
1033    /// List of input assets stored in Cloud Storage.
1034    pub inputs: std::vec::Vec<crate::model::Input>,
1035
1036    /// List of edit atoms. Defines the ultimate timeline of the resulting
1037    /// file or manifest.
1038    pub edit_list: std::vec::Vec<crate::model::EditAtom>,
1039
1040    /// List of elementary streams.
1041    pub elementary_streams: std::vec::Vec<crate::model::ElementaryStream>,
1042
1043    /// List of multiplexing settings for output streams.
1044    pub mux_streams: std::vec::Vec<crate::model::MuxStream>,
1045
1046    /// List of output manifests.
1047    pub manifests: std::vec::Vec<crate::model::Manifest>,
1048
1049    /// Output configuration.
1050    pub output: std::option::Option<crate::model::Output>,
1051
1052    /// List of ad breaks. Specifies where to insert ad break tags in the output
1053    /// manifests.
1054    pub ad_breaks: std::vec::Vec<crate::model::AdBreak>,
1055
1056    /// Destination on Pub/Sub.
1057    pub pubsub_destination: std::option::Option<crate::model::PubsubDestination>,
1058
1059    /// List of output sprite sheets.
1060    /// Spritesheets require at least one VideoStream in the Jobconfig.
1061    pub sprite_sheets: std::vec::Vec<crate::model::SpriteSheet>,
1062
1063    /// List of overlays on the output video, in descending Z-order.
1064    pub overlays: std::vec::Vec<crate::model::Overlay>,
1065
1066    /// List of encryption configurations for the content.
1067    /// Each configuration has an ID. Specify this ID in the
1068    /// [MuxStream.encryption_id][google.cloud.video.transcoder.v1.MuxStream.encryption_id]
1069    /// field to indicate the configuration to use for that `MuxStream` output.
1070    ///
1071    /// [google.cloud.video.transcoder.v1.MuxStream.encryption_id]: crate::model::MuxStream::encryption_id
1072    pub encryptions: std::vec::Vec<crate::model::Encryption>,
1073
1074    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1075}
1076
1077impl JobConfig {
1078    /// Creates a new default instance.
1079    pub fn new() -> Self {
1080        std::default::Default::default()
1081    }
1082
1083    /// Sets the value of [inputs][crate::model::JobConfig::inputs].
1084    ///
1085    /// # Example
1086    /// ```ignore,no_run
1087    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1088    /// use google_cloud_video_transcoder_v1::model::Input;
1089    /// let x = JobConfig::new()
1090    ///     .set_inputs([
1091    ///         Input::default()/* use setters */,
1092    ///         Input::default()/* use (different) setters */,
1093    ///     ]);
1094    /// ```
1095    pub fn set_inputs<T, V>(mut self, v: T) -> Self
1096    where
1097        T: std::iter::IntoIterator<Item = V>,
1098        V: std::convert::Into<crate::model::Input>,
1099    {
1100        use std::iter::Iterator;
1101        self.inputs = v.into_iter().map(|i| i.into()).collect();
1102        self
1103    }
1104
1105    /// Sets the value of [edit_list][crate::model::JobConfig::edit_list].
1106    ///
1107    /// # Example
1108    /// ```ignore,no_run
1109    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1110    /// use google_cloud_video_transcoder_v1::model::EditAtom;
1111    /// let x = JobConfig::new()
1112    ///     .set_edit_list([
1113    ///         EditAtom::default()/* use setters */,
1114    ///         EditAtom::default()/* use (different) setters */,
1115    ///     ]);
1116    /// ```
1117    pub fn set_edit_list<T, V>(mut self, v: T) -> Self
1118    where
1119        T: std::iter::IntoIterator<Item = V>,
1120        V: std::convert::Into<crate::model::EditAtom>,
1121    {
1122        use std::iter::Iterator;
1123        self.edit_list = v.into_iter().map(|i| i.into()).collect();
1124        self
1125    }
1126
1127    /// Sets the value of [elementary_streams][crate::model::JobConfig::elementary_streams].
1128    ///
1129    /// # Example
1130    /// ```ignore,no_run
1131    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1132    /// use google_cloud_video_transcoder_v1::model::ElementaryStream;
1133    /// let x = JobConfig::new()
1134    ///     .set_elementary_streams([
1135    ///         ElementaryStream::default()/* use setters */,
1136    ///         ElementaryStream::default()/* use (different) setters */,
1137    ///     ]);
1138    /// ```
1139    pub fn set_elementary_streams<T, V>(mut self, v: T) -> Self
1140    where
1141        T: std::iter::IntoIterator<Item = V>,
1142        V: std::convert::Into<crate::model::ElementaryStream>,
1143    {
1144        use std::iter::Iterator;
1145        self.elementary_streams = v.into_iter().map(|i| i.into()).collect();
1146        self
1147    }
1148
1149    /// Sets the value of [mux_streams][crate::model::JobConfig::mux_streams].
1150    ///
1151    /// # Example
1152    /// ```ignore,no_run
1153    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1154    /// use google_cloud_video_transcoder_v1::model::MuxStream;
1155    /// let x = JobConfig::new()
1156    ///     .set_mux_streams([
1157    ///         MuxStream::default()/* use setters */,
1158    ///         MuxStream::default()/* use (different) setters */,
1159    ///     ]);
1160    /// ```
1161    pub fn set_mux_streams<T, V>(mut self, v: T) -> Self
1162    where
1163        T: std::iter::IntoIterator<Item = V>,
1164        V: std::convert::Into<crate::model::MuxStream>,
1165    {
1166        use std::iter::Iterator;
1167        self.mux_streams = v.into_iter().map(|i| i.into()).collect();
1168        self
1169    }
1170
1171    /// Sets the value of [manifests][crate::model::JobConfig::manifests].
1172    ///
1173    /// # Example
1174    /// ```ignore,no_run
1175    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1176    /// use google_cloud_video_transcoder_v1::model::Manifest;
1177    /// let x = JobConfig::new()
1178    ///     .set_manifests([
1179    ///         Manifest::default()/* use setters */,
1180    ///         Manifest::default()/* use (different) setters */,
1181    ///     ]);
1182    /// ```
1183    pub fn set_manifests<T, V>(mut self, v: T) -> Self
1184    where
1185        T: std::iter::IntoIterator<Item = V>,
1186        V: std::convert::Into<crate::model::Manifest>,
1187    {
1188        use std::iter::Iterator;
1189        self.manifests = v.into_iter().map(|i| i.into()).collect();
1190        self
1191    }
1192
1193    /// Sets the value of [output][crate::model::JobConfig::output].
1194    ///
1195    /// # Example
1196    /// ```ignore,no_run
1197    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1198    /// use google_cloud_video_transcoder_v1::model::Output;
1199    /// let x = JobConfig::new().set_output(Output::default()/* use setters */);
1200    /// ```
1201    pub fn set_output<T>(mut self, v: T) -> Self
1202    where
1203        T: std::convert::Into<crate::model::Output>,
1204    {
1205        self.output = std::option::Option::Some(v.into());
1206        self
1207    }
1208
1209    /// Sets or clears the value of [output][crate::model::JobConfig::output].
1210    ///
1211    /// # Example
1212    /// ```ignore,no_run
1213    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1214    /// use google_cloud_video_transcoder_v1::model::Output;
1215    /// let x = JobConfig::new().set_or_clear_output(Some(Output::default()/* use setters */));
1216    /// let x = JobConfig::new().set_or_clear_output(None::<Output>);
1217    /// ```
1218    pub fn set_or_clear_output<T>(mut self, v: std::option::Option<T>) -> Self
1219    where
1220        T: std::convert::Into<crate::model::Output>,
1221    {
1222        self.output = v.map(|x| x.into());
1223        self
1224    }
1225
1226    /// Sets the value of [ad_breaks][crate::model::JobConfig::ad_breaks].
1227    ///
1228    /// # Example
1229    /// ```ignore,no_run
1230    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1231    /// use google_cloud_video_transcoder_v1::model::AdBreak;
1232    /// let x = JobConfig::new()
1233    ///     .set_ad_breaks([
1234    ///         AdBreak::default()/* use setters */,
1235    ///         AdBreak::default()/* use (different) setters */,
1236    ///     ]);
1237    /// ```
1238    pub fn set_ad_breaks<T, V>(mut self, v: T) -> Self
1239    where
1240        T: std::iter::IntoIterator<Item = V>,
1241        V: std::convert::Into<crate::model::AdBreak>,
1242    {
1243        use std::iter::Iterator;
1244        self.ad_breaks = v.into_iter().map(|i| i.into()).collect();
1245        self
1246    }
1247
1248    /// Sets the value of [pubsub_destination][crate::model::JobConfig::pubsub_destination].
1249    ///
1250    /// # Example
1251    /// ```ignore,no_run
1252    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1253    /// use google_cloud_video_transcoder_v1::model::PubsubDestination;
1254    /// let x = JobConfig::new().set_pubsub_destination(PubsubDestination::default()/* use setters */);
1255    /// ```
1256    pub fn set_pubsub_destination<T>(mut self, v: T) -> Self
1257    where
1258        T: std::convert::Into<crate::model::PubsubDestination>,
1259    {
1260        self.pubsub_destination = std::option::Option::Some(v.into());
1261        self
1262    }
1263
1264    /// Sets or clears the value of [pubsub_destination][crate::model::JobConfig::pubsub_destination].
1265    ///
1266    /// # Example
1267    /// ```ignore,no_run
1268    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1269    /// use google_cloud_video_transcoder_v1::model::PubsubDestination;
1270    /// let x = JobConfig::new().set_or_clear_pubsub_destination(Some(PubsubDestination::default()/* use setters */));
1271    /// let x = JobConfig::new().set_or_clear_pubsub_destination(None::<PubsubDestination>);
1272    /// ```
1273    pub fn set_or_clear_pubsub_destination<T>(mut self, v: std::option::Option<T>) -> Self
1274    where
1275        T: std::convert::Into<crate::model::PubsubDestination>,
1276    {
1277        self.pubsub_destination = v.map(|x| x.into());
1278        self
1279    }
1280
1281    /// Sets the value of [sprite_sheets][crate::model::JobConfig::sprite_sheets].
1282    ///
1283    /// # Example
1284    /// ```ignore,no_run
1285    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1286    /// use google_cloud_video_transcoder_v1::model::SpriteSheet;
1287    /// let x = JobConfig::new()
1288    ///     .set_sprite_sheets([
1289    ///         SpriteSheet::default()/* use setters */,
1290    ///         SpriteSheet::default()/* use (different) setters */,
1291    ///     ]);
1292    /// ```
1293    pub fn set_sprite_sheets<T, V>(mut self, v: T) -> Self
1294    where
1295        T: std::iter::IntoIterator<Item = V>,
1296        V: std::convert::Into<crate::model::SpriteSheet>,
1297    {
1298        use std::iter::Iterator;
1299        self.sprite_sheets = v.into_iter().map(|i| i.into()).collect();
1300        self
1301    }
1302
1303    /// Sets the value of [overlays][crate::model::JobConfig::overlays].
1304    ///
1305    /// # Example
1306    /// ```ignore,no_run
1307    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1308    /// use google_cloud_video_transcoder_v1::model::Overlay;
1309    /// let x = JobConfig::new()
1310    ///     .set_overlays([
1311    ///         Overlay::default()/* use setters */,
1312    ///         Overlay::default()/* use (different) setters */,
1313    ///     ]);
1314    /// ```
1315    pub fn set_overlays<T, V>(mut self, v: T) -> Self
1316    where
1317        T: std::iter::IntoIterator<Item = V>,
1318        V: std::convert::Into<crate::model::Overlay>,
1319    {
1320        use std::iter::Iterator;
1321        self.overlays = v.into_iter().map(|i| i.into()).collect();
1322        self
1323    }
1324
1325    /// Sets the value of [encryptions][crate::model::JobConfig::encryptions].
1326    ///
1327    /// # Example
1328    /// ```ignore,no_run
1329    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1330    /// use google_cloud_video_transcoder_v1::model::Encryption;
1331    /// let x = JobConfig::new()
1332    ///     .set_encryptions([
1333    ///         Encryption::default()/* use setters */,
1334    ///         Encryption::default()/* use (different) setters */,
1335    ///     ]);
1336    /// ```
1337    pub fn set_encryptions<T, V>(mut self, v: T) -> Self
1338    where
1339        T: std::iter::IntoIterator<Item = V>,
1340        V: std::convert::Into<crate::model::Encryption>,
1341    {
1342        use std::iter::Iterator;
1343        self.encryptions = v.into_iter().map(|i| i.into()).collect();
1344        self
1345    }
1346}
1347
1348impl wkt::message::Message for JobConfig {
1349    fn typename() -> &'static str {
1350        "type.googleapis.com/google.cloud.video.transcoder.v1.JobConfig"
1351    }
1352}
1353
1354/// Input asset.
1355#[derive(Clone, Default, PartialEq)]
1356#[non_exhaustive]
1357pub struct Input {
1358    /// A unique key for this input. Must be specified when using advanced
1359    /// mapping and edit lists.
1360    pub key: std::string::String,
1361
1362    /// URI of the media. Input files must be at least 5 seconds in duration and
1363    /// stored in Cloud Storage (for example, `gs://bucket/inputs/file.mp4`).
1364    /// If empty, the value is populated from
1365    /// [Job.input_uri][google.cloud.video.transcoder.v1.Job.input_uri]. See
1366    /// [Supported input and output
1367    /// formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats).
1368    ///
1369    /// [google.cloud.video.transcoder.v1.Job.input_uri]: crate::model::Job::input_uri
1370    pub uri: std::string::String,
1371
1372    /// Preprocessing configurations.
1373    pub preprocessing_config: std::option::Option<crate::model::PreprocessingConfig>,
1374
1375    /// Optional. Input Attributes.
1376    pub attributes: std::option::Option<crate::model::InputAttributes>,
1377
1378    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1379}
1380
1381impl Input {
1382    /// Creates a new default instance.
1383    pub fn new() -> Self {
1384        std::default::Default::default()
1385    }
1386
1387    /// Sets the value of [key][crate::model::Input::key].
1388    ///
1389    /// # Example
1390    /// ```ignore,no_run
1391    /// # use google_cloud_video_transcoder_v1::model::Input;
1392    /// let x = Input::new().set_key("example");
1393    /// ```
1394    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1395        self.key = v.into();
1396        self
1397    }
1398
1399    /// Sets the value of [uri][crate::model::Input::uri].
1400    ///
1401    /// # Example
1402    /// ```ignore,no_run
1403    /// # use google_cloud_video_transcoder_v1::model::Input;
1404    /// let x = Input::new().set_uri("example");
1405    /// ```
1406    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1407        self.uri = v.into();
1408        self
1409    }
1410
1411    /// Sets the value of [preprocessing_config][crate::model::Input::preprocessing_config].
1412    ///
1413    /// # Example
1414    /// ```ignore,no_run
1415    /// # use google_cloud_video_transcoder_v1::model::Input;
1416    /// use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
1417    /// let x = Input::new().set_preprocessing_config(PreprocessingConfig::default()/* use setters */);
1418    /// ```
1419    pub fn set_preprocessing_config<T>(mut self, v: T) -> Self
1420    where
1421        T: std::convert::Into<crate::model::PreprocessingConfig>,
1422    {
1423        self.preprocessing_config = std::option::Option::Some(v.into());
1424        self
1425    }
1426
1427    /// Sets or clears the value of [preprocessing_config][crate::model::Input::preprocessing_config].
1428    ///
1429    /// # Example
1430    /// ```ignore,no_run
1431    /// # use google_cloud_video_transcoder_v1::model::Input;
1432    /// use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
1433    /// let x = Input::new().set_or_clear_preprocessing_config(Some(PreprocessingConfig::default()/* use setters */));
1434    /// let x = Input::new().set_or_clear_preprocessing_config(None::<PreprocessingConfig>);
1435    /// ```
1436    pub fn set_or_clear_preprocessing_config<T>(mut self, v: std::option::Option<T>) -> Self
1437    where
1438        T: std::convert::Into<crate::model::PreprocessingConfig>,
1439    {
1440        self.preprocessing_config = v.map(|x| x.into());
1441        self
1442    }
1443
1444    /// Sets the value of [attributes][crate::model::Input::attributes].
1445    ///
1446    /// # Example
1447    /// ```ignore,no_run
1448    /// # use google_cloud_video_transcoder_v1::model::Input;
1449    /// use google_cloud_video_transcoder_v1::model::InputAttributes;
1450    /// let x = Input::new().set_attributes(InputAttributes::default()/* use setters */);
1451    /// ```
1452    pub fn set_attributes<T>(mut self, v: T) -> Self
1453    where
1454        T: std::convert::Into<crate::model::InputAttributes>,
1455    {
1456        self.attributes = std::option::Option::Some(v.into());
1457        self
1458    }
1459
1460    /// Sets or clears the value of [attributes][crate::model::Input::attributes].
1461    ///
1462    /// # Example
1463    /// ```ignore,no_run
1464    /// # use google_cloud_video_transcoder_v1::model::Input;
1465    /// use google_cloud_video_transcoder_v1::model::InputAttributes;
1466    /// let x = Input::new().set_or_clear_attributes(Some(InputAttributes::default()/* use setters */));
1467    /// let x = Input::new().set_or_clear_attributes(None::<InputAttributes>);
1468    /// ```
1469    pub fn set_or_clear_attributes<T>(mut self, v: std::option::Option<T>) -> Self
1470    where
1471        T: std::convert::Into<crate::model::InputAttributes>,
1472    {
1473        self.attributes = v.map(|x| x.into());
1474        self
1475    }
1476}
1477
1478impl wkt::message::Message for Input {
1479    fn typename() -> &'static str {
1480        "type.googleapis.com/google.cloud.video.transcoder.v1.Input"
1481    }
1482}
1483
1484/// Location of output file(s) in a Cloud Storage bucket.
1485#[derive(Clone, Default, PartialEq)]
1486#[non_exhaustive]
1487pub struct Output {
1488    /// URI for the output file(s). For example, `gs://my-bucket/outputs/`. Must be
1489    /// a directory and not a top-level bucket. If empty, the value is populated
1490    /// from [Job.output_uri][google.cloud.video.transcoder.v1.Job.output_uri]. See
1491    /// [Supported input and output
1492    /// formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats).
1493    ///
1494    /// [google.cloud.video.transcoder.v1.Job.output_uri]: crate::model::Job::output_uri
1495    pub uri: std::string::String,
1496
1497    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1498}
1499
1500impl Output {
1501    /// Creates a new default instance.
1502    pub fn new() -> Self {
1503        std::default::Default::default()
1504    }
1505
1506    /// Sets the value of [uri][crate::model::Output::uri].
1507    ///
1508    /// # Example
1509    /// ```ignore,no_run
1510    /// # use google_cloud_video_transcoder_v1::model::Output;
1511    /// let x = Output::new().set_uri("example");
1512    /// ```
1513    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1514        self.uri = v.into();
1515        self
1516    }
1517}
1518
1519impl wkt::message::Message for Output {
1520    fn typename() -> &'static str {
1521        "type.googleapis.com/google.cloud.video.transcoder.v1.Output"
1522    }
1523}
1524
1525/// Edit atom.
1526#[derive(Clone, Default, PartialEq)]
1527#[non_exhaustive]
1528pub struct EditAtom {
1529    /// A unique key for this atom. Must be specified when using advanced
1530    /// mapping.
1531    pub key: std::string::String,
1532
1533    /// List of [Input.key][google.cloud.video.transcoder.v1.Input.key] values
1534    /// identifying files that should be used in this atom. The listed `inputs`
1535    /// must have the same timeline.
1536    ///
1537    /// [google.cloud.video.transcoder.v1.Input.key]: crate::model::Input::key
1538    pub inputs: std::vec::Vec<std::string::String>,
1539
1540    /// End time in seconds for the atom, relative to the input file timeline.
1541    /// When `end_time_offset` is not specified, the `inputs` are used until
1542    /// the end of the atom.
1543    pub end_time_offset: std::option::Option<wkt::Duration>,
1544
1545    /// Start time in seconds for the atom, relative to the input file timeline.
1546    /// The default is `0s`.
1547    pub start_time_offset: std::option::Option<wkt::Duration>,
1548
1549    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1550}
1551
1552impl EditAtom {
1553    /// Creates a new default instance.
1554    pub fn new() -> Self {
1555        std::default::Default::default()
1556    }
1557
1558    /// Sets the value of [key][crate::model::EditAtom::key].
1559    ///
1560    /// # Example
1561    /// ```ignore,no_run
1562    /// # use google_cloud_video_transcoder_v1::model::EditAtom;
1563    /// let x = EditAtom::new().set_key("example");
1564    /// ```
1565    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1566        self.key = v.into();
1567        self
1568    }
1569
1570    /// Sets the value of [inputs][crate::model::EditAtom::inputs].
1571    ///
1572    /// # Example
1573    /// ```ignore,no_run
1574    /// # use google_cloud_video_transcoder_v1::model::EditAtom;
1575    /// let x = EditAtom::new().set_inputs(["a", "b", "c"]);
1576    /// ```
1577    pub fn set_inputs<T, V>(mut self, v: T) -> Self
1578    where
1579        T: std::iter::IntoIterator<Item = V>,
1580        V: std::convert::Into<std::string::String>,
1581    {
1582        use std::iter::Iterator;
1583        self.inputs = v.into_iter().map(|i| i.into()).collect();
1584        self
1585    }
1586
1587    /// Sets the value of [end_time_offset][crate::model::EditAtom::end_time_offset].
1588    ///
1589    /// # Example
1590    /// ```ignore,no_run
1591    /// # use google_cloud_video_transcoder_v1::model::EditAtom;
1592    /// use wkt::Duration;
1593    /// let x = EditAtom::new().set_end_time_offset(Duration::default()/* use setters */);
1594    /// ```
1595    pub fn set_end_time_offset<T>(mut self, v: T) -> Self
1596    where
1597        T: std::convert::Into<wkt::Duration>,
1598    {
1599        self.end_time_offset = std::option::Option::Some(v.into());
1600        self
1601    }
1602
1603    /// Sets or clears the value of [end_time_offset][crate::model::EditAtom::end_time_offset].
1604    ///
1605    /// # Example
1606    /// ```ignore,no_run
1607    /// # use google_cloud_video_transcoder_v1::model::EditAtom;
1608    /// use wkt::Duration;
1609    /// let x = EditAtom::new().set_or_clear_end_time_offset(Some(Duration::default()/* use setters */));
1610    /// let x = EditAtom::new().set_or_clear_end_time_offset(None::<Duration>);
1611    /// ```
1612    pub fn set_or_clear_end_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
1613    where
1614        T: std::convert::Into<wkt::Duration>,
1615    {
1616        self.end_time_offset = v.map(|x| x.into());
1617        self
1618    }
1619
1620    /// Sets the value of [start_time_offset][crate::model::EditAtom::start_time_offset].
1621    ///
1622    /// # Example
1623    /// ```ignore,no_run
1624    /// # use google_cloud_video_transcoder_v1::model::EditAtom;
1625    /// use wkt::Duration;
1626    /// let x = EditAtom::new().set_start_time_offset(Duration::default()/* use setters */);
1627    /// ```
1628    pub fn set_start_time_offset<T>(mut self, v: T) -> Self
1629    where
1630        T: std::convert::Into<wkt::Duration>,
1631    {
1632        self.start_time_offset = std::option::Option::Some(v.into());
1633        self
1634    }
1635
1636    /// Sets or clears the value of [start_time_offset][crate::model::EditAtom::start_time_offset].
1637    ///
1638    /// # Example
1639    /// ```ignore,no_run
1640    /// # use google_cloud_video_transcoder_v1::model::EditAtom;
1641    /// use wkt::Duration;
1642    /// let x = EditAtom::new().set_or_clear_start_time_offset(Some(Duration::default()/* use setters */));
1643    /// let x = EditAtom::new().set_or_clear_start_time_offset(None::<Duration>);
1644    /// ```
1645    pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
1646    where
1647        T: std::convert::Into<wkt::Duration>,
1648    {
1649        self.start_time_offset = v.map(|x| x.into());
1650        self
1651    }
1652}
1653
1654impl wkt::message::Message for EditAtom {
1655    fn typename() -> &'static str {
1656        "type.googleapis.com/google.cloud.video.transcoder.v1.EditAtom"
1657    }
1658}
1659
1660/// Ad break.
1661#[derive(Clone, Default, PartialEq)]
1662#[non_exhaustive]
1663pub struct AdBreak {
1664    /// Start time in seconds for the ad break, relative to the output file
1665    /// timeline. The default is `0s`.
1666    pub start_time_offset: std::option::Option<wkt::Duration>,
1667
1668    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1669}
1670
1671impl AdBreak {
1672    /// Creates a new default instance.
1673    pub fn new() -> Self {
1674        std::default::Default::default()
1675    }
1676
1677    /// Sets the value of [start_time_offset][crate::model::AdBreak::start_time_offset].
1678    ///
1679    /// # Example
1680    /// ```ignore,no_run
1681    /// # use google_cloud_video_transcoder_v1::model::AdBreak;
1682    /// use wkt::Duration;
1683    /// let x = AdBreak::new().set_start_time_offset(Duration::default()/* use setters */);
1684    /// ```
1685    pub fn set_start_time_offset<T>(mut self, v: T) -> Self
1686    where
1687        T: std::convert::Into<wkt::Duration>,
1688    {
1689        self.start_time_offset = std::option::Option::Some(v.into());
1690        self
1691    }
1692
1693    /// Sets or clears the value of [start_time_offset][crate::model::AdBreak::start_time_offset].
1694    ///
1695    /// # Example
1696    /// ```ignore,no_run
1697    /// # use google_cloud_video_transcoder_v1::model::AdBreak;
1698    /// use wkt::Duration;
1699    /// let x = AdBreak::new().set_or_clear_start_time_offset(Some(Duration::default()/* use setters */));
1700    /// let x = AdBreak::new().set_or_clear_start_time_offset(None::<Duration>);
1701    /// ```
1702    pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
1703    where
1704        T: std::convert::Into<wkt::Duration>,
1705    {
1706        self.start_time_offset = v.map(|x| x.into());
1707        self
1708    }
1709}
1710
1711impl wkt::message::Message for AdBreak {
1712    fn typename() -> &'static str {
1713        "type.googleapis.com/google.cloud.video.transcoder.v1.AdBreak"
1714    }
1715}
1716
1717/// Encoding of an input file such as an audio, video, or text track.
1718/// Elementary streams must be packaged before
1719/// mapping and sharing between different output formats.
1720#[derive(Clone, Default, PartialEq)]
1721#[non_exhaustive]
1722pub struct ElementaryStream {
1723    /// A unique key for this elementary stream.
1724    pub key: std::string::String,
1725
1726    /// Encoding of an audio, video, or text track.
1727    pub elementary_stream: std::option::Option<crate::model::elementary_stream::ElementaryStream>,
1728
1729    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1730}
1731
1732impl ElementaryStream {
1733    /// Creates a new default instance.
1734    pub fn new() -> Self {
1735        std::default::Default::default()
1736    }
1737
1738    /// Sets the value of [key][crate::model::ElementaryStream::key].
1739    ///
1740    /// # Example
1741    /// ```ignore,no_run
1742    /// # use google_cloud_video_transcoder_v1::model::ElementaryStream;
1743    /// let x = ElementaryStream::new().set_key("example");
1744    /// ```
1745    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1746        self.key = v.into();
1747        self
1748    }
1749
1750    /// Sets the value of [elementary_stream][crate::model::ElementaryStream::elementary_stream].
1751    ///
1752    /// Note that all the setters affecting `elementary_stream` are mutually
1753    /// exclusive.
1754    ///
1755    /// # Example
1756    /// ```ignore,no_run
1757    /// # use google_cloud_video_transcoder_v1::model::ElementaryStream;
1758    /// use google_cloud_video_transcoder_v1::model::VideoStream;
1759    /// let x = ElementaryStream::new().set_elementary_stream(Some(
1760    ///     google_cloud_video_transcoder_v1::model::elementary_stream::ElementaryStream::VideoStream(VideoStream::default().into())));
1761    /// ```
1762    pub fn set_elementary_stream<
1763        T: std::convert::Into<std::option::Option<crate::model::elementary_stream::ElementaryStream>>,
1764    >(
1765        mut self,
1766        v: T,
1767    ) -> Self {
1768        self.elementary_stream = v.into();
1769        self
1770    }
1771
1772    /// The value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
1773    /// if it holds a `VideoStream`, `None` if the field is not set or
1774    /// holds a different branch.
1775    pub fn video_stream(&self) -> std::option::Option<&std::boxed::Box<crate::model::VideoStream>> {
1776        #[allow(unreachable_patterns)]
1777        self.elementary_stream.as_ref().and_then(|v| match v {
1778            crate::model::elementary_stream::ElementaryStream::VideoStream(v) => {
1779                std::option::Option::Some(v)
1780            }
1781            _ => std::option::Option::None,
1782        })
1783    }
1784
1785    /// Sets the value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
1786    /// to hold a `VideoStream`.
1787    ///
1788    /// Note that all the setters affecting `elementary_stream` are
1789    /// mutually exclusive.
1790    ///
1791    /// # Example
1792    /// ```ignore,no_run
1793    /// # use google_cloud_video_transcoder_v1::model::ElementaryStream;
1794    /// use google_cloud_video_transcoder_v1::model::VideoStream;
1795    /// let x = ElementaryStream::new().set_video_stream(VideoStream::default()/* use setters */);
1796    /// assert!(x.video_stream().is_some());
1797    /// assert!(x.audio_stream().is_none());
1798    /// assert!(x.text_stream().is_none());
1799    /// ```
1800    pub fn set_video_stream<T: std::convert::Into<std::boxed::Box<crate::model::VideoStream>>>(
1801        mut self,
1802        v: T,
1803    ) -> Self {
1804        self.elementary_stream = std::option::Option::Some(
1805            crate::model::elementary_stream::ElementaryStream::VideoStream(v.into()),
1806        );
1807        self
1808    }
1809
1810    /// The value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
1811    /// if it holds a `AudioStream`, `None` if the field is not set or
1812    /// holds a different branch.
1813    pub fn audio_stream(&self) -> std::option::Option<&std::boxed::Box<crate::model::AudioStream>> {
1814        #[allow(unreachable_patterns)]
1815        self.elementary_stream.as_ref().and_then(|v| match v {
1816            crate::model::elementary_stream::ElementaryStream::AudioStream(v) => {
1817                std::option::Option::Some(v)
1818            }
1819            _ => std::option::Option::None,
1820        })
1821    }
1822
1823    /// Sets the value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
1824    /// to hold a `AudioStream`.
1825    ///
1826    /// Note that all the setters affecting `elementary_stream` are
1827    /// mutually exclusive.
1828    ///
1829    /// # Example
1830    /// ```ignore,no_run
1831    /// # use google_cloud_video_transcoder_v1::model::ElementaryStream;
1832    /// use google_cloud_video_transcoder_v1::model::AudioStream;
1833    /// let x = ElementaryStream::new().set_audio_stream(AudioStream::default()/* use setters */);
1834    /// assert!(x.audio_stream().is_some());
1835    /// assert!(x.video_stream().is_none());
1836    /// assert!(x.text_stream().is_none());
1837    /// ```
1838    pub fn set_audio_stream<T: std::convert::Into<std::boxed::Box<crate::model::AudioStream>>>(
1839        mut self,
1840        v: T,
1841    ) -> Self {
1842        self.elementary_stream = std::option::Option::Some(
1843            crate::model::elementary_stream::ElementaryStream::AudioStream(v.into()),
1844        );
1845        self
1846    }
1847
1848    /// The value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
1849    /// if it holds a `TextStream`, `None` if the field is not set or
1850    /// holds a different branch.
1851    pub fn text_stream(&self) -> std::option::Option<&std::boxed::Box<crate::model::TextStream>> {
1852        #[allow(unreachable_patterns)]
1853        self.elementary_stream.as_ref().and_then(|v| match v {
1854            crate::model::elementary_stream::ElementaryStream::TextStream(v) => {
1855                std::option::Option::Some(v)
1856            }
1857            _ => std::option::Option::None,
1858        })
1859    }
1860
1861    /// Sets the value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
1862    /// to hold a `TextStream`.
1863    ///
1864    /// Note that all the setters affecting `elementary_stream` are
1865    /// mutually exclusive.
1866    ///
1867    /// # Example
1868    /// ```ignore,no_run
1869    /// # use google_cloud_video_transcoder_v1::model::ElementaryStream;
1870    /// use google_cloud_video_transcoder_v1::model::TextStream;
1871    /// let x = ElementaryStream::new().set_text_stream(TextStream::default()/* use setters */);
1872    /// assert!(x.text_stream().is_some());
1873    /// assert!(x.video_stream().is_none());
1874    /// assert!(x.audio_stream().is_none());
1875    /// ```
1876    pub fn set_text_stream<T: std::convert::Into<std::boxed::Box<crate::model::TextStream>>>(
1877        mut self,
1878        v: T,
1879    ) -> Self {
1880        self.elementary_stream = std::option::Option::Some(
1881            crate::model::elementary_stream::ElementaryStream::TextStream(v.into()),
1882        );
1883        self
1884    }
1885}
1886
1887impl wkt::message::Message for ElementaryStream {
1888    fn typename() -> &'static str {
1889        "type.googleapis.com/google.cloud.video.transcoder.v1.ElementaryStream"
1890    }
1891}
1892
1893/// Defines additional types related to [ElementaryStream].
1894pub mod elementary_stream {
1895    #[allow(unused_imports)]
1896    use super::*;
1897
1898    /// Encoding of an audio, video, or text track.
1899    #[derive(Clone, Debug, PartialEq)]
1900    #[non_exhaustive]
1901    pub enum ElementaryStream {
1902        /// Encoding of a video stream.
1903        VideoStream(std::boxed::Box<crate::model::VideoStream>),
1904        /// Encoding of an audio stream.
1905        AudioStream(std::boxed::Box<crate::model::AudioStream>),
1906        /// Encoding of a text stream. For example, closed captions or subtitles.
1907        TextStream(std::boxed::Box<crate::model::TextStream>),
1908    }
1909}
1910
1911/// Multiplexing settings for output stream.
1912#[derive(Clone, Default, PartialEq)]
1913#[non_exhaustive]
1914pub struct MuxStream {
1915    /// A unique key for this multiplexed stream.
1916    pub key: std::string::String,
1917
1918    /// The name of the generated file. The default is
1919    /// [MuxStream.key][google.cloud.video.transcoder.v1.MuxStream.key] with the
1920    /// extension suffix corresponding to the
1921    /// [MuxStream.container][google.cloud.video.transcoder.v1.MuxStream.container].
1922    ///
1923    /// Individual segments also have an incremental 10-digit zero-padded suffix
1924    /// starting from 0 before the extension, such as `mux_stream0000000123.ts`.
1925    ///
1926    /// [google.cloud.video.transcoder.v1.MuxStream.container]: crate::model::MuxStream::container
1927    /// [google.cloud.video.transcoder.v1.MuxStream.key]: crate::model::MuxStream::key
1928    pub file_name: std::string::String,
1929
1930    /// The container format. The default is `mp4`
1931    ///
1932    /// Supported streaming formats:
1933    ///
1934    /// - `ts`
1935    /// - `fmp4`- the corresponding file extension is `.m4s`
1936    ///
1937    /// Supported standalone file formats:
1938    ///
1939    /// - `mp4`
1940    /// - `mp3`
1941    /// - `ogg`
1942    /// - `vtt`
1943    ///
1944    /// See also:
1945    /// [Supported input and output
1946    /// formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats)
1947    pub container: std::string::String,
1948
1949    /// List of
1950    /// [ElementaryStream.key][google.cloud.video.transcoder.v1.ElementaryStream.key]
1951    /// values multiplexed in this stream.
1952    ///
1953    /// [google.cloud.video.transcoder.v1.ElementaryStream.key]: crate::model::ElementaryStream::key
1954    pub elementary_streams: std::vec::Vec<std::string::String>,
1955
1956    /// Segment settings for `ts`, `fmp4` and `vtt`.
1957    pub segment_settings: std::option::Option<crate::model::SegmentSettings>,
1958
1959    /// Identifier of the encryption configuration to use. If omitted, output will
1960    /// be unencrypted.
1961    pub encryption_id: std::string::String,
1962
1963    /// Specifies the container configuration.
1964    pub container_config: std::option::Option<crate::model::mux_stream::ContainerConfig>,
1965
1966    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1967}
1968
1969impl MuxStream {
1970    /// Creates a new default instance.
1971    pub fn new() -> Self {
1972        std::default::Default::default()
1973    }
1974
1975    /// Sets the value of [key][crate::model::MuxStream::key].
1976    ///
1977    /// # Example
1978    /// ```ignore,no_run
1979    /// # use google_cloud_video_transcoder_v1::model::MuxStream;
1980    /// let x = MuxStream::new().set_key("example");
1981    /// ```
1982    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1983        self.key = v.into();
1984        self
1985    }
1986
1987    /// Sets the value of [file_name][crate::model::MuxStream::file_name].
1988    ///
1989    /// # Example
1990    /// ```ignore,no_run
1991    /// # use google_cloud_video_transcoder_v1::model::MuxStream;
1992    /// let x = MuxStream::new().set_file_name("example");
1993    /// ```
1994    pub fn set_file_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1995        self.file_name = v.into();
1996        self
1997    }
1998
1999    /// Sets the value of [container][crate::model::MuxStream::container].
2000    ///
2001    /// # Example
2002    /// ```ignore,no_run
2003    /// # use google_cloud_video_transcoder_v1::model::MuxStream;
2004    /// let x = MuxStream::new().set_container("example");
2005    /// ```
2006    pub fn set_container<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2007        self.container = v.into();
2008        self
2009    }
2010
2011    /// Sets the value of [elementary_streams][crate::model::MuxStream::elementary_streams].
2012    ///
2013    /// # Example
2014    /// ```ignore,no_run
2015    /// # use google_cloud_video_transcoder_v1::model::MuxStream;
2016    /// let x = MuxStream::new().set_elementary_streams(["a", "b", "c"]);
2017    /// ```
2018    pub fn set_elementary_streams<T, V>(mut self, v: T) -> Self
2019    where
2020        T: std::iter::IntoIterator<Item = V>,
2021        V: std::convert::Into<std::string::String>,
2022    {
2023        use std::iter::Iterator;
2024        self.elementary_streams = v.into_iter().map(|i| i.into()).collect();
2025        self
2026    }
2027
2028    /// Sets the value of [segment_settings][crate::model::MuxStream::segment_settings].
2029    ///
2030    /// # Example
2031    /// ```ignore,no_run
2032    /// # use google_cloud_video_transcoder_v1::model::MuxStream;
2033    /// use google_cloud_video_transcoder_v1::model::SegmentSettings;
2034    /// let x = MuxStream::new().set_segment_settings(SegmentSettings::default()/* use setters */);
2035    /// ```
2036    pub fn set_segment_settings<T>(mut self, v: T) -> Self
2037    where
2038        T: std::convert::Into<crate::model::SegmentSettings>,
2039    {
2040        self.segment_settings = std::option::Option::Some(v.into());
2041        self
2042    }
2043
2044    /// Sets or clears the value of [segment_settings][crate::model::MuxStream::segment_settings].
2045    ///
2046    /// # Example
2047    /// ```ignore,no_run
2048    /// # use google_cloud_video_transcoder_v1::model::MuxStream;
2049    /// use google_cloud_video_transcoder_v1::model::SegmentSettings;
2050    /// let x = MuxStream::new().set_or_clear_segment_settings(Some(SegmentSettings::default()/* use setters */));
2051    /// let x = MuxStream::new().set_or_clear_segment_settings(None::<SegmentSettings>);
2052    /// ```
2053    pub fn set_or_clear_segment_settings<T>(mut self, v: std::option::Option<T>) -> Self
2054    where
2055        T: std::convert::Into<crate::model::SegmentSettings>,
2056    {
2057        self.segment_settings = v.map(|x| x.into());
2058        self
2059    }
2060
2061    /// Sets the value of [encryption_id][crate::model::MuxStream::encryption_id].
2062    ///
2063    /// # Example
2064    /// ```ignore,no_run
2065    /// # use google_cloud_video_transcoder_v1::model::MuxStream;
2066    /// let x = MuxStream::new().set_encryption_id("example");
2067    /// ```
2068    pub fn set_encryption_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2069        self.encryption_id = v.into();
2070        self
2071    }
2072
2073    /// Sets the value of [container_config][crate::model::MuxStream::container_config].
2074    ///
2075    /// Note that all the setters affecting `container_config` are mutually
2076    /// exclusive.
2077    ///
2078    /// # Example
2079    /// ```ignore,no_run
2080    /// # use google_cloud_video_transcoder_v1::model::MuxStream;
2081    /// use google_cloud_video_transcoder_v1::model::mux_stream::Fmp4Config;
2082    /// let x = MuxStream::new().set_container_config(Some(
2083    ///     google_cloud_video_transcoder_v1::model::mux_stream::ContainerConfig::Fmp4(Fmp4Config::default().into())));
2084    /// ```
2085    pub fn set_container_config<
2086        T: std::convert::Into<std::option::Option<crate::model::mux_stream::ContainerConfig>>,
2087    >(
2088        mut self,
2089        v: T,
2090    ) -> Self {
2091        self.container_config = v.into();
2092        self
2093    }
2094
2095    /// The value of [container_config][crate::model::MuxStream::container_config]
2096    /// if it holds a `Fmp4`, `None` if the field is not set or
2097    /// holds a different branch.
2098    pub fn fmp4(
2099        &self,
2100    ) -> std::option::Option<&std::boxed::Box<crate::model::mux_stream::Fmp4Config>> {
2101        #[allow(unreachable_patterns)]
2102        self.container_config.as_ref().and_then(|v| match v {
2103            crate::model::mux_stream::ContainerConfig::Fmp4(v) => std::option::Option::Some(v),
2104            _ => std::option::Option::None,
2105        })
2106    }
2107
2108    /// Sets the value of [container_config][crate::model::MuxStream::container_config]
2109    /// to hold a `Fmp4`.
2110    ///
2111    /// Note that all the setters affecting `container_config` are
2112    /// mutually exclusive.
2113    ///
2114    /// # Example
2115    /// ```ignore,no_run
2116    /// # use google_cloud_video_transcoder_v1::model::MuxStream;
2117    /// use google_cloud_video_transcoder_v1::model::mux_stream::Fmp4Config;
2118    /// let x = MuxStream::new().set_fmp4(Fmp4Config::default()/* use setters */);
2119    /// assert!(x.fmp4().is_some());
2120    /// ```
2121    pub fn set_fmp4<
2122        T: std::convert::Into<std::boxed::Box<crate::model::mux_stream::Fmp4Config>>,
2123    >(
2124        mut self,
2125        v: T,
2126    ) -> Self {
2127        self.container_config =
2128            std::option::Option::Some(crate::model::mux_stream::ContainerConfig::Fmp4(v.into()));
2129        self
2130    }
2131}
2132
2133impl wkt::message::Message for MuxStream {
2134    fn typename() -> &'static str {
2135        "type.googleapis.com/google.cloud.video.transcoder.v1.MuxStream"
2136    }
2137}
2138
2139/// Defines additional types related to [MuxStream].
2140pub mod mux_stream {
2141    #[allow(unused_imports)]
2142    use super::*;
2143
2144    /// `fmp4` container configuration.
2145    #[derive(Clone, Default, PartialEq)]
2146    #[non_exhaustive]
2147    pub struct Fmp4Config {
2148        /// Optional. Specify the codec tag string that will be used in the media
2149        /// bitstream. When not specified, the codec appropriate value is used.
2150        ///
2151        /// Supported H265 codec tags:
2152        ///
2153        /// - `hvc1` (default)
2154        /// - `hev1`
2155        pub codec_tag: std::string::String,
2156
2157        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2158    }
2159
2160    impl Fmp4Config {
2161        /// Creates a new default instance.
2162        pub fn new() -> Self {
2163            std::default::Default::default()
2164        }
2165
2166        /// Sets the value of [codec_tag][crate::model::mux_stream::Fmp4Config::codec_tag].
2167        ///
2168        /// # Example
2169        /// ```ignore,no_run
2170        /// # use google_cloud_video_transcoder_v1::model::mux_stream::Fmp4Config;
2171        /// let x = Fmp4Config::new().set_codec_tag("example");
2172        /// ```
2173        pub fn set_codec_tag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2174            self.codec_tag = v.into();
2175            self
2176        }
2177    }
2178
2179    impl wkt::message::Message for Fmp4Config {
2180        fn typename() -> &'static str {
2181            "type.googleapis.com/google.cloud.video.transcoder.v1.MuxStream.Fmp4Config"
2182        }
2183    }
2184
2185    /// Specifies the container configuration.
2186    #[derive(Clone, Debug, PartialEq)]
2187    #[non_exhaustive]
2188    pub enum ContainerConfig {
2189        /// Optional. `fmp4` container configuration.
2190        Fmp4(std::boxed::Box<crate::model::mux_stream::Fmp4Config>),
2191    }
2192}
2193
2194/// Manifest configuration.
2195#[derive(Clone, Default, PartialEq)]
2196#[non_exhaustive]
2197pub struct Manifest {
2198    /// The name of the generated file. The default is `manifest` with the
2199    /// extension suffix corresponding to the
2200    /// [Manifest.type][google.cloud.video.transcoder.v1.Manifest.type].
2201    ///
2202    /// [google.cloud.video.transcoder.v1.Manifest.type]: crate::model::Manifest::type
2203    pub file_name: std::string::String,
2204
2205    /// Required. Type of the manifest.
2206    pub r#type: crate::model::manifest::ManifestType,
2207
2208    /// Required. List of user supplied
2209    /// [MuxStream.key][google.cloud.video.transcoder.v1.MuxStream.key] values that
2210    /// should appear in this manifest.
2211    ///
2212    /// When [Manifest.type][google.cloud.video.transcoder.v1.Manifest.type] is
2213    /// `HLS`, a media manifest with name
2214    /// [MuxStream.key][google.cloud.video.transcoder.v1.MuxStream.key] and `.m3u8`
2215    /// extension is generated for each element in this list.
2216    ///
2217    /// [google.cloud.video.transcoder.v1.Manifest.type]: crate::model::Manifest::type
2218    /// [google.cloud.video.transcoder.v1.MuxStream.key]: crate::model::MuxStream::key
2219    pub mux_streams: std::vec::Vec<std::string::String>,
2220
2221    /// Specifies the manifest configuration.
2222    pub manifest_config: std::option::Option<crate::model::manifest::ManifestConfig>,
2223
2224    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2225}
2226
2227impl Manifest {
2228    /// Creates a new default instance.
2229    pub fn new() -> Self {
2230        std::default::Default::default()
2231    }
2232
2233    /// Sets the value of [file_name][crate::model::Manifest::file_name].
2234    ///
2235    /// # Example
2236    /// ```ignore,no_run
2237    /// # use google_cloud_video_transcoder_v1::model::Manifest;
2238    /// let x = Manifest::new().set_file_name("example");
2239    /// ```
2240    pub fn set_file_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2241        self.file_name = v.into();
2242        self
2243    }
2244
2245    /// Sets the value of [r#type][crate::model::Manifest::type].
2246    ///
2247    /// # Example
2248    /// ```ignore,no_run
2249    /// # use google_cloud_video_transcoder_v1::model::Manifest;
2250    /// use google_cloud_video_transcoder_v1::model::manifest::ManifestType;
2251    /// let x0 = Manifest::new().set_type(ManifestType::Hls);
2252    /// let x1 = Manifest::new().set_type(ManifestType::Dash);
2253    /// ```
2254    pub fn set_type<T: std::convert::Into<crate::model::manifest::ManifestType>>(
2255        mut self,
2256        v: T,
2257    ) -> Self {
2258        self.r#type = v.into();
2259        self
2260    }
2261
2262    /// Sets the value of [mux_streams][crate::model::Manifest::mux_streams].
2263    ///
2264    /// # Example
2265    /// ```ignore,no_run
2266    /// # use google_cloud_video_transcoder_v1::model::Manifest;
2267    /// let x = Manifest::new().set_mux_streams(["a", "b", "c"]);
2268    /// ```
2269    pub fn set_mux_streams<T, V>(mut self, v: T) -> Self
2270    where
2271        T: std::iter::IntoIterator<Item = V>,
2272        V: std::convert::Into<std::string::String>,
2273    {
2274        use std::iter::Iterator;
2275        self.mux_streams = v.into_iter().map(|i| i.into()).collect();
2276        self
2277    }
2278
2279    /// Sets the value of [manifest_config][crate::model::Manifest::manifest_config].
2280    ///
2281    /// Note that all the setters affecting `manifest_config` are mutually
2282    /// exclusive.
2283    ///
2284    /// # Example
2285    /// ```ignore,no_run
2286    /// # use google_cloud_video_transcoder_v1::model::Manifest;
2287    /// use google_cloud_video_transcoder_v1::model::manifest::DashConfig;
2288    /// let x = Manifest::new().set_manifest_config(Some(
2289    ///     google_cloud_video_transcoder_v1::model::manifest::ManifestConfig::Dash(DashConfig::default().into())));
2290    /// ```
2291    pub fn set_manifest_config<
2292        T: std::convert::Into<std::option::Option<crate::model::manifest::ManifestConfig>>,
2293    >(
2294        mut self,
2295        v: T,
2296    ) -> Self {
2297        self.manifest_config = v.into();
2298        self
2299    }
2300
2301    /// The value of [manifest_config][crate::model::Manifest::manifest_config]
2302    /// if it holds a `Dash`, `None` if the field is not set or
2303    /// holds a different branch.
2304    pub fn dash(
2305        &self,
2306    ) -> std::option::Option<&std::boxed::Box<crate::model::manifest::DashConfig>> {
2307        #[allow(unreachable_patterns)]
2308        self.manifest_config.as_ref().and_then(|v| match v {
2309            crate::model::manifest::ManifestConfig::Dash(v) => std::option::Option::Some(v),
2310            _ => std::option::Option::None,
2311        })
2312    }
2313
2314    /// Sets the value of [manifest_config][crate::model::Manifest::manifest_config]
2315    /// to hold a `Dash`.
2316    ///
2317    /// Note that all the setters affecting `manifest_config` are
2318    /// mutually exclusive.
2319    ///
2320    /// # Example
2321    /// ```ignore,no_run
2322    /// # use google_cloud_video_transcoder_v1::model::Manifest;
2323    /// use google_cloud_video_transcoder_v1::model::manifest::DashConfig;
2324    /// let x = Manifest::new().set_dash(DashConfig::default()/* use setters */);
2325    /// assert!(x.dash().is_some());
2326    /// ```
2327    pub fn set_dash<T: std::convert::Into<std::boxed::Box<crate::model::manifest::DashConfig>>>(
2328        mut self,
2329        v: T,
2330    ) -> Self {
2331        self.manifest_config =
2332            std::option::Option::Some(crate::model::manifest::ManifestConfig::Dash(v.into()));
2333        self
2334    }
2335}
2336
2337impl wkt::message::Message for Manifest {
2338    fn typename() -> &'static str {
2339        "type.googleapis.com/google.cloud.video.transcoder.v1.Manifest"
2340    }
2341}
2342
2343/// Defines additional types related to [Manifest].
2344pub mod manifest {
2345    #[allow(unused_imports)]
2346    use super::*;
2347
2348    /// `DASH` manifest configuration.
2349    #[derive(Clone, Default, PartialEq)]
2350    #[non_exhaustive]
2351    pub struct DashConfig {
2352        /// The segment reference scheme for a `DASH` manifest. The default is
2353        /// `SEGMENT_LIST`.
2354        pub segment_reference_scheme: crate::model::manifest::dash_config::SegmentReferenceScheme,
2355
2356        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2357    }
2358
2359    impl DashConfig {
2360        /// Creates a new default instance.
2361        pub fn new() -> Self {
2362            std::default::Default::default()
2363        }
2364
2365        /// Sets the value of [segment_reference_scheme][crate::model::manifest::DashConfig::segment_reference_scheme].
2366        ///
2367        /// # Example
2368        /// ```ignore,no_run
2369        /// # use google_cloud_video_transcoder_v1::model::manifest::DashConfig;
2370        /// use google_cloud_video_transcoder_v1::model::manifest::dash_config::SegmentReferenceScheme;
2371        /// let x0 = DashConfig::new().set_segment_reference_scheme(SegmentReferenceScheme::SegmentList);
2372        /// let x1 = DashConfig::new().set_segment_reference_scheme(SegmentReferenceScheme::SegmentTemplateNumber);
2373        /// ```
2374        pub fn set_segment_reference_scheme<
2375            T: std::convert::Into<crate::model::manifest::dash_config::SegmentReferenceScheme>,
2376        >(
2377            mut self,
2378            v: T,
2379        ) -> Self {
2380            self.segment_reference_scheme = v.into();
2381            self
2382        }
2383    }
2384
2385    impl wkt::message::Message for DashConfig {
2386        fn typename() -> &'static str {
2387            "type.googleapis.com/google.cloud.video.transcoder.v1.Manifest.DashConfig"
2388        }
2389    }
2390
2391    /// Defines additional types related to [DashConfig].
2392    pub mod dash_config {
2393        #[allow(unused_imports)]
2394        use super::*;
2395
2396        /// The segment reference scheme for a `DASH` manifest.
2397        ///
2398        /// # Working with unknown values
2399        ///
2400        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2401        /// additional enum variants at any time. Adding new variants is not considered
2402        /// a breaking change. Applications should write their code in anticipation of:
2403        ///
2404        /// - New values appearing in future releases of the client library, **and**
2405        /// - New values received dynamically, without application changes.
2406        ///
2407        /// Please consult the [Working with enums] section in the user guide for some
2408        /// guidelines.
2409        ///
2410        /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2411        #[derive(Clone, Debug, PartialEq)]
2412        #[non_exhaustive]
2413        pub enum SegmentReferenceScheme {
2414            /// The segment reference scheme is not specified.
2415            Unspecified,
2416            /// Explicitly lists the URLs of media files for each segment. For example,
2417            /// if
2418            /// [SegmentSettings.individual_segments][google.cloud.video.transcoder.v1.SegmentSettings.individual_segments]
2419            /// is `true`, then the manifest contains fields similar to the following:
2420            ///
2421            /// ```norust
2422            /// <Initialization sourceURL="my-hd-stream-init.m4s"/>
2423            ///   <SegmentList presentationTimeOffset="0" duration="1000"
2424            ///   timescale="10000">
2425            ///     <SegmentURL media="hd-stream0000000000.m4s"/>
2426            ///     <SegmentURL media="hd-stream0000000001.m4s"/>
2427            ///     ...
2428            /// ```
2429            ///
2430            /// [google.cloud.video.transcoder.v1.SegmentSettings.individual_segments]: crate::model::SegmentSettings::individual_segments
2431            SegmentList,
2432            /// [SegmentSettings.individual_segments][google.cloud.video.transcoder.v1.SegmentSettings.individual_segments]
2433            /// must be set to `true` to use this segment reference scheme. Uses the
2434            /// DASH specification
2435            /// `<SegmentTemplate>` tag to determine the URLs of media files for each
2436            /// segment. For example:
2437            ///
2438            /// ```norust
2439            /// <SegmentTemplate presentationTimeOffset="0" timescale="10000"
2440            ///       initialization="my-hd-stream-init.m4s"
2441            ///       media="hd-stream$Number%010d$.m4s" startNumber="0">
2442            ///   ...
2443            /// ```
2444            ///
2445            /// [google.cloud.video.transcoder.v1.SegmentSettings.individual_segments]: crate::model::SegmentSettings::individual_segments
2446            SegmentTemplateNumber,
2447            /// If set, the enum was initialized with an unknown value.
2448            ///
2449            /// Applications can examine the value using [SegmentReferenceScheme::value] or
2450            /// [SegmentReferenceScheme::name].
2451            UnknownValue(segment_reference_scheme::UnknownValue),
2452        }
2453
2454        #[doc(hidden)]
2455        pub mod segment_reference_scheme {
2456            #[allow(unused_imports)]
2457            use super::*;
2458            #[derive(Clone, Debug, PartialEq)]
2459            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2460        }
2461
2462        impl SegmentReferenceScheme {
2463            /// Gets the enum value.
2464            ///
2465            /// Returns `None` if the enum contains an unknown value deserialized from
2466            /// the string representation of enums.
2467            pub fn value(&self) -> std::option::Option<i32> {
2468                match self {
2469                    Self::Unspecified => std::option::Option::Some(0),
2470                    Self::SegmentList => std::option::Option::Some(1),
2471                    Self::SegmentTemplateNumber => std::option::Option::Some(2),
2472                    Self::UnknownValue(u) => u.0.value(),
2473                }
2474            }
2475
2476            /// Gets the enum value as a string.
2477            ///
2478            /// Returns `None` if the enum contains an unknown value deserialized from
2479            /// the integer representation of enums.
2480            pub fn name(&self) -> std::option::Option<&str> {
2481                match self {
2482                    Self::Unspecified => {
2483                        std::option::Option::Some("SEGMENT_REFERENCE_SCHEME_UNSPECIFIED")
2484                    }
2485                    Self::SegmentList => std::option::Option::Some("SEGMENT_LIST"),
2486                    Self::SegmentTemplateNumber => {
2487                        std::option::Option::Some("SEGMENT_TEMPLATE_NUMBER")
2488                    }
2489                    Self::UnknownValue(u) => u.0.name(),
2490                }
2491            }
2492        }
2493
2494        impl std::default::Default for SegmentReferenceScheme {
2495            fn default() -> Self {
2496                use std::convert::From;
2497                Self::from(0)
2498            }
2499        }
2500
2501        impl std::fmt::Display for SegmentReferenceScheme {
2502            fn fmt(
2503                &self,
2504                f: &mut std::fmt::Formatter<'_>,
2505            ) -> std::result::Result<(), std::fmt::Error> {
2506                wkt::internal::display_enum(f, self.name(), self.value())
2507            }
2508        }
2509
2510        impl std::convert::From<i32> for SegmentReferenceScheme {
2511            fn from(value: i32) -> Self {
2512                match value {
2513                    0 => Self::Unspecified,
2514                    1 => Self::SegmentList,
2515                    2 => Self::SegmentTemplateNumber,
2516                    _ => Self::UnknownValue(segment_reference_scheme::UnknownValue(
2517                        wkt::internal::UnknownEnumValue::Integer(value),
2518                    )),
2519                }
2520            }
2521        }
2522
2523        impl std::convert::From<&str> for SegmentReferenceScheme {
2524            fn from(value: &str) -> Self {
2525                use std::string::ToString;
2526                match value {
2527                    "SEGMENT_REFERENCE_SCHEME_UNSPECIFIED" => Self::Unspecified,
2528                    "SEGMENT_LIST" => Self::SegmentList,
2529                    "SEGMENT_TEMPLATE_NUMBER" => Self::SegmentTemplateNumber,
2530                    _ => Self::UnknownValue(segment_reference_scheme::UnknownValue(
2531                        wkt::internal::UnknownEnumValue::String(value.to_string()),
2532                    )),
2533                }
2534            }
2535        }
2536
2537        impl serde::ser::Serialize for SegmentReferenceScheme {
2538            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2539            where
2540                S: serde::Serializer,
2541            {
2542                match self {
2543                    Self::Unspecified => serializer.serialize_i32(0),
2544                    Self::SegmentList => serializer.serialize_i32(1),
2545                    Self::SegmentTemplateNumber => serializer.serialize_i32(2),
2546                    Self::UnknownValue(u) => u.0.serialize(serializer),
2547                }
2548            }
2549        }
2550
2551        impl<'de> serde::de::Deserialize<'de> for SegmentReferenceScheme {
2552            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2553            where
2554                D: serde::Deserializer<'de>,
2555            {
2556                deserializer.deserialize_any(wkt::internal::EnumVisitor::<SegmentReferenceScheme>::new(
2557                    ".google.cloud.video.transcoder.v1.Manifest.DashConfig.SegmentReferenceScheme"))
2558            }
2559        }
2560    }
2561
2562    /// The manifest type, which corresponds to the adaptive streaming format used.
2563    ///
2564    /// # Working with unknown values
2565    ///
2566    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2567    /// additional enum variants at any time. Adding new variants is not considered
2568    /// a breaking change. Applications should write their code in anticipation of:
2569    ///
2570    /// - New values appearing in future releases of the client library, **and**
2571    /// - New values received dynamically, without application changes.
2572    ///
2573    /// Please consult the [Working with enums] section in the user guide for some
2574    /// guidelines.
2575    ///
2576    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2577    #[derive(Clone, Debug, PartialEq)]
2578    #[non_exhaustive]
2579    pub enum ManifestType {
2580        /// The manifest type is not specified.
2581        Unspecified,
2582        /// Create an HLS manifest. The corresponding file extension is `.m3u8`.
2583        Hls,
2584        /// Create an MPEG-DASH manifest. The corresponding file extension is `.mpd`.
2585        Dash,
2586        /// If set, the enum was initialized with an unknown value.
2587        ///
2588        /// Applications can examine the value using [ManifestType::value] or
2589        /// [ManifestType::name].
2590        UnknownValue(manifest_type::UnknownValue),
2591    }
2592
2593    #[doc(hidden)]
2594    pub mod manifest_type {
2595        #[allow(unused_imports)]
2596        use super::*;
2597        #[derive(Clone, Debug, PartialEq)]
2598        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2599    }
2600
2601    impl ManifestType {
2602        /// Gets the enum value.
2603        ///
2604        /// Returns `None` if the enum contains an unknown value deserialized from
2605        /// the string representation of enums.
2606        pub fn value(&self) -> std::option::Option<i32> {
2607            match self {
2608                Self::Unspecified => std::option::Option::Some(0),
2609                Self::Hls => std::option::Option::Some(1),
2610                Self::Dash => std::option::Option::Some(2),
2611                Self::UnknownValue(u) => u.0.value(),
2612            }
2613        }
2614
2615        /// Gets the enum value as a string.
2616        ///
2617        /// Returns `None` if the enum contains an unknown value deserialized from
2618        /// the integer representation of enums.
2619        pub fn name(&self) -> std::option::Option<&str> {
2620            match self {
2621                Self::Unspecified => std::option::Option::Some("MANIFEST_TYPE_UNSPECIFIED"),
2622                Self::Hls => std::option::Option::Some("HLS"),
2623                Self::Dash => std::option::Option::Some("DASH"),
2624                Self::UnknownValue(u) => u.0.name(),
2625            }
2626        }
2627    }
2628
2629    impl std::default::Default for ManifestType {
2630        fn default() -> Self {
2631            use std::convert::From;
2632            Self::from(0)
2633        }
2634    }
2635
2636    impl std::fmt::Display for ManifestType {
2637        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2638            wkt::internal::display_enum(f, self.name(), self.value())
2639        }
2640    }
2641
2642    impl std::convert::From<i32> for ManifestType {
2643        fn from(value: i32) -> Self {
2644            match value {
2645                0 => Self::Unspecified,
2646                1 => Self::Hls,
2647                2 => Self::Dash,
2648                _ => Self::UnknownValue(manifest_type::UnknownValue(
2649                    wkt::internal::UnknownEnumValue::Integer(value),
2650                )),
2651            }
2652        }
2653    }
2654
2655    impl std::convert::From<&str> for ManifestType {
2656        fn from(value: &str) -> Self {
2657            use std::string::ToString;
2658            match value {
2659                "MANIFEST_TYPE_UNSPECIFIED" => Self::Unspecified,
2660                "HLS" => Self::Hls,
2661                "DASH" => Self::Dash,
2662                _ => Self::UnknownValue(manifest_type::UnknownValue(
2663                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2664                )),
2665            }
2666        }
2667    }
2668
2669    impl serde::ser::Serialize for ManifestType {
2670        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2671        where
2672            S: serde::Serializer,
2673        {
2674            match self {
2675                Self::Unspecified => serializer.serialize_i32(0),
2676                Self::Hls => serializer.serialize_i32(1),
2677                Self::Dash => serializer.serialize_i32(2),
2678                Self::UnknownValue(u) => u.0.serialize(serializer),
2679            }
2680        }
2681    }
2682
2683    impl<'de> serde::de::Deserialize<'de> for ManifestType {
2684        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2685        where
2686            D: serde::Deserializer<'de>,
2687        {
2688            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ManifestType>::new(
2689                ".google.cloud.video.transcoder.v1.Manifest.ManifestType",
2690            ))
2691        }
2692    }
2693
2694    /// Specifies the manifest configuration.
2695    #[derive(Clone, Debug, PartialEq)]
2696    #[non_exhaustive]
2697    pub enum ManifestConfig {
2698        /// `DASH` manifest configuration.
2699        Dash(std::boxed::Box<crate::model::manifest::DashConfig>),
2700    }
2701}
2702
2703/// A Pub/Sub destination.
2704#[derive(Clone, Default, PartialEq)]
2705#[non_exhaustive]
2706pub struct PubsubDestination {
2707    /// The name of the Pub/Sub topic to publish job completion notification
2708    /// to. For example: `projects/{project}/topics/{topic}`.
2709    pub topic: std::string::String,
2710
2711    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2712}
2713
2714impl PubsubDestination {
2715    /// Creates a new default instance.
2716    pub fn new() -> Self {
2717        std::default::Default::default()
2718    }
2719
2720    /// Sets the value of [topic][crate::model::PubsubDestination::topic].
2721    ///
2722    /// # Example
2723    /// ```ignore,no_run
2724    /// # use google_cloud_video_transcoder_v1::model::PubsubDestination;
2725    /// let x = PubsubDestination::new().set_topic("example");
2726    /// ```
2727    pub fn set_topic<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2728        self.topic = v.into();
2729        self
2730    }
2731}
2732
2733impl wkt::message::Message for PubsubDestination {
2734    fn typename() -> &'static str {
2735        "type.googleapis.com/google.cloud.video.transcoder.v1.PubsubDestination"
2736    }
2737}
2738
2739/// Sprite sheet configuration.
2740#[derive(Clone, Default, PartialEq)]
2741#[non_exhaustive]
2742pub struct SpriteSheet {
2743    /// Format type. The default is `jpeg`.
2744    ///
2745    /// Supported formats:
2746    ///
2747    /// - `jpeg`
2748    pub format: std::string::String,
2749
2750    /// Required. File name prefix for the generated sprite sheets.
2751    ///
2752    /// Each sprite sheet has an incremental 10-digit zero-padded suffix starting
2753    /// from 0 before the extension, such as `sprite_sheet0000000123.jpeg`.
2754    pub file_prefix: std::string::String,
2755
2756    /// Required. The width of sprite in pixels. Must be an even integer. To
2757    /// preserve the source aspect ratio, set the
2758    /// [SpriteSheet.sprite_width_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_width_pixels]
2759    /// field or the
2760    /// [SpriteSheet.sprite_height_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_height_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 width, in pixels, per the horizontal ASR. The API calculates
2766    /// the height 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_width_pixels: i32,
2772
2773    /// Required. The height of sprite in pixels. Must be an even integer. To
2774    /// preserve the source aspect ratio, set the
2775    /// [SpriteSheet.sprite_height_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_height_pixels]
2776    /// field or the
2777    /// [SpriteSheet.sprite_width_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_width_pixels]
2778    /// field, but not both (the API will automatically calculate the missing
2779    /// field).
2780    ///
2781    /// For portrait videos that contain horizontal ASR and rotation metadata,
2782    /// provide the height, in pixels, per the horizontal ASR. The API calculates
2783    /// the width per the horizontal ASR. The API detects any rotation metadata
2784    /// and swaps the requested height and width for the output.
2785    ///
2786    /// [google.cloud.video.transcoder.v1.SpriteSheet.sprite_height_pixels]: crate::model::SpriteSheet::sprite_height_pixels
2787    /// [google.cloud.video.transcoder.v1.SpriteSheet.sprite_width_pixels]: crate::model::SpriteSheet::sprite_width_pixels
2788    pub sprite_height_pixels: i32,
2789
2790    /// The maximum number of sprites per row in a sprite sheet. The default is 0,
2791    /// which indicates no maximum limit.
2792    pub column_count: i32,
2793
2794    /// The maximum number of rows per sprite sheet. When the sprite sheet is full,
2795    /// a new sprite sheet is created. The default is 0, which indicates no maximum
2796    /// limit.
2797    pub row_count: i32,
2798
2799    /// Start time in seconds, relative to the output file timeline. Determines the
2800    /// first sprite to pick. The default is `0s`.
2801    pub start_time_offset: std::option::Option<wkt::Duration>,
2802
2803    /// End time in seconds, relative to the output file timeline. When
2804    /// `end_time_offset` is not specified, the sprites are generated until the end
2805    /// of the output file.
2806    pub end_time_offset: std::option::Option<wkt::Duration>,
2807
2808    /// The quality of the generated sprite sheet. Enter a value between 1
2809    /// and 100, where 1 is the lowest quality and 100 is the highest quality.
2810    /// The default is 100. A high quality value corresponds to a low image data
2811    /// compression ratio.
2812    pub quality: i32,
2813
2814    /// Specify either total number of sprites or interval to create sprites.
2815    pub extraction_strategy: std::option::Option<crate::model::sprite_sheet::ExtractionStrategy>,
2816
2817    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2818}
2819
2820impl SpriteSheet {
2821    /// Creates a new default instance.
2822    pub fn new() -> Self {
2823        std::default::Default::default()
2824    }
2825
2826    /// Sets the value of [format][crate::model::SpriteSheet::format].
2827    ///
2828    /// # Example
2829    /// ```ignore,no_run
2830    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2831    /// let x = SpriteSheet::new().set_format("example");
2832    /// ```
2833    pub fn set_format<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2834        self.format = v.into();
2835        self
2836    }
2837
2838    /// Sets the value of [file_prefix][crate::model::SpriteSheet::file_prefix].
2839    ///
2840    /// # Example
2841    /// ```ignore,no_run
2842    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2843    /// let x = SpriteSheet::new().set_file_prefix("example");
2844    /// ```
2845    pub fn set_file_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2846        self.file_prefix = v.into();
2847        self
2848    }
2849
2850    /// Sets the value of [sprite_width_pixels][crate::model::SpriteSheet::sprite_width_pixels].
2851    ///
2852    /// # Example
2853    /// ```ignore,no_run
2854    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2855    /// let x = SpriteSheet::new().set_sprite_width_pixels(42);
2856    /// ```
2857    pub fn set_sprite_width_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2858        self.sprite_width_pixels = v.into();
2859        self
2860    }
2861
2862    /// Sets the value of [sprite_height_pixels][crate::model::SpriteSheet::sprite_height_pixels].
2863    ///
2864    /// # Example
2865    /// ```ignore,no_run
2866    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2867    /// let x = SpriteSheet::new().set_sprite_height_pixels(42);
2868    /// ```
2869    pub fn set_sprite_height_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2870        self.sprite_height_pixels = v.into();
2871        self
2872    }
2873
2874    /// Sets the value of [column_count][crate::model::SpriteSheet::column_count].
2875    ///
2876    /// # Example
2877    /// ```ignore,no_run
2878    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2879    /// let x = SpriteSheet::new().set_column_count(42);
2880    /// ```
2881    pub fn set_column_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2882        self.column_count = v.into();
2883        self
2884    }
2885
2886    /// Sets the value of [row_count][crate::model::SpriteSheet::row_count].
2887    ///
2888    /// # Example
2889    /// ```ignore,no_run
2890    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2891    /// let x = SpriteSheet::new().set_row_count(42);
2892    /// ```
2893    pub fn set_row_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2894        self.row_count = v.into();
2895        self
2896    }
2897
2898    /// Sets the value of [start_time_offset][crate::model::SpriteSheet::start_time_offset].
2899    ///
2900    /// # Example
2901    /// ```ignore,no_run
2902    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2903    /// use wkt::Duration;
2904    /// let x = SpriteSheet::new().set_start_time_offset(Duration::default()/* use setters */);
2905    /// ```
2906    pub fn set_start_time_offset<T>(mut self, v: T) -> Self
2907    where
2908        T: std::convert::Into<wkt::Duration>,
2909    {
2910        self.start_time_offset = std::option::Option::Some(v.into());
2911        self
2912    }
2913
2914    /// Sets or clears the value of [start_time_offset][crate::model::SpriteSheet::start_time_offset].
2915    ///
2916    /// # Example
2917    /// ```ignore,no_run
2918    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2919    /// use wkt::Duration;
2920    /// let x = SpriteSheet::new().set_or_clear_start_time_offset(Some(Duration::default()/* use setters */));
2921    /// let x = SpriteSheet::new().set_or_clear_start_time_offset(None::<Duration>);
2922    /// ```
2923    pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
2924    where
2925        T: std::convert::Into<wkt::Duration>,
2926    {
2927        self.start_time_offset = v.map(|x| x.into());
2928        self
2929    }
2930
2931    /// Sets the value of [end_time_offset][crate::model::SpriteSheet::end_time_offset].
2932    ///
2933    /// # Example
2934    /// ```ignore,no_run
2935    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2936    /// use wkt::Duration;
2937    /// let x = SpriteSheet::new().set_end_time_offset(Duration::default()/* use setters */);
2938    /// ```
2939    pub fn set_end_time_offset<T>(mut self, v: T) -> Self
2940    where
2941        T: std::convert::Into<wkt::Duration>,
2942    {
2943        self.end_time_offset = std::option::Option::Some(v.into());
2944        self
2945    }
2946
2947    /// Sets or clears the value of [end_time_offset][crate::model::SpriteSheet::end_time_offset].
2948    ///
2949    /// # Example
2950    /// ```ignore,no_run
2951    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2952    /// use wkt::Duration;
2953    /// let x = SpriteSheet::new().set_or_clear_end_time_offset(Some(Duration::default()/* use setters */));
2954    /// let x = SpriteSheet::new().set_or_clear_end_time_offset(None::<Duration>);
2955    /// ```
2956    pub fn set_or_clear_end_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
2957    where
2958        T: std::convert::Into<wkt::Duration>,
2959    {
2960        self.end_time_offset = v.map(|x| x.into());
2961        self
2962    }
2963
2964    /// Sets the value of [quality][crate::model::SpriteSheet::quality].
2965    ///
2966    /// # Example
2967    /// ```ignore,no_run
2968    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2969    /// let x = SpriteSheet::new().set_quality(42);
2970    /// ```
2971    pub fn set_quality<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2972        self.quality = v.into();
2973        self
2974    }
2975
2976    /// Sets the value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy].
2977    ///
2978    /// Note that all the setters affecting `extraction_strategy` are mutually
2979    /// exclusive.
2980    ///
2981    /// # Example
2982    /// ```ignore,no_run
2983    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2984    /// use google_cloud_video_transcoder_v1::model::sprite_sheet::ExtractionStrategy;
2985    /// let x = SpriteSheet::new().set_extraction_strategy(Some(ExtractionStrategy::TotalCount(42)));
2986    /// ```
2987    pub fn set_extraction_strategy<
2988        T: std::convert::Into<std::option::Option<crate::model::sprite_sheet::ExtractionStrategy>>,
2989    >(
2990        mut self,
2991        v: T,
2992    ) -> Self {
2993        self.extraction_strategy = v.into();
2994        self
2995    }
2996
2997    /// The value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy]
2998    /// if it holds a `TotalCount`, `None` if the field is not set or
2999    /// holds a different branch.
3000    pub fn total_count(&self) -> std::option::Option<&i32> {
3001        #[allow(unreachable_patterns)]
3002        self.extraction_strategy.as_ref().and_then(|v| match v {
3003            crate::model::sprite_sheet::ExtractionStrategy::TotalCount(v) => {
3004                std::option::Option::Some(v)
3005            }
3006            _ => std::option::Option::None,
3007        })
3008    }
3009
3010    /// Sets the value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy]
3011    /// to hold a `TotalCount`.
3012    ///
3013    /// Note that all the setters affecting `extraction_strategy` are
3014    /// mutually exclusive.
3015    ///
3016    /// # Example
3017    /// ```ignore,no_run
3018    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
3019    /// let x = SpriteSheet::new().set_total_count(42);
3020    /// assert!(x.total_count().is_some());
3021    /// assert!(x.interval().is_none());
3022    /// ```
3023    pub fn set_total_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3024        self.extraction_strategy = std::option::Option::Some(
3025            crate::model::sprite_sheet::ExtractionStrategy::TotalCount(v.into()),
3026        );
3027        self
3028    }
3029
3030    /// The value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy]
3031    /// if it holds a `Interval`, `None` if the field is not set or
3032    /// holds a different branch.
3033    pub fn interval(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
3034        #[allow(unreachable_patterns)]
3035        self.extraction_strategy.as_ref().and_then(|v| match v {
3036            crate::model::sprite_sheet::ExtractionStrategy::Interval(v) => {
3037                std::option::Option::Some(v)
3038            }
3039            _ => std::option::Option::None,
3040        })
3041    }
3042
3043    /// Sets the value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy]
3044    /// to hold a `Interval`.
3045    ///
3046    /// Note that all the setters affecting `extraction_strategy` are
3047    /// mutually exclusive.
3048    ///
3049    /// # Example
3050    /// ```ignore,no_run
3051    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
3052    /// use wkt::Duration;
3053    /// let x = SpriteSheet::new().set_interval(Duration::default()/* use setters */);
3054    /// assert!(x.interval().is_some());
3055    /// assert!(x.total_count().is_none());
3056    /// ```
3057    pub fn set_interval<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
3058        mut self,
3059        v: T,
3060    ) -> Self {
3061        self.extraction_strategy = std::option::Option::Some(
3062            crate::model::sprite_sheet::ExtractionStrategy::Interval(v.into()),
3063        );
3064        self
3065    }
3066}
3067
3068impl wkt::message::Message for SpriteSheet {
3069    fn typename() -> &'static str {
3070        "type.googleapis.com/google.cloud.video.transcoder.v1.SpriteSheet"
3071    }
3072}
3073
3074/// Defines additional types related to [SpriteSheet].
3075pub mod sprite_sheet {
3076    #[allow(unused_imports)]
3077    use super::*;
3078
3079    /// Specify either total number of sprites or interval to create sprites.
3080    #[derive(Clone, Debug, PartialEq)]
3081    #[non_exhaustive]
3082    pub enum ExtractionStrategy {
3083        /// Total number of sprites. Create the specified number of sprites
3084        /// distributed evenly across the timeline of the output media. The default
3085        /// is 100.
3086        TotalCount(i32),
3087        /// Starting from `0s`, create sprites at regular intervals. Specify the
3088        /// interval value in seconds.
3089        Interval(std::boxed::Box<wkt::Duration>),
3090    }
3091}
3092
3093/// Overlay configuration.
3094#[derive(Clone, Default, PartialEq)]
3095#[non_exhaustive]
3096pub struct Overlay {
3097    /// Image overlay.
3098    pub image: std::option::Option<crate::model::overlay::Image>,
3099
3100    /// List of animations. The list should be chronological, without any time
3101    /// overlap.
3102    pub animations: std::vec::Vec<crate::model::overlay::Animation>,
3103
3104    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3105}
3106
3107impl Overlay {
3108    /// Creates a new default instance.
3109    pub fn new() -> Self {
3110        std::default::Default::default()
3111    }
3112
3113    /// Sets the value of [image][crate::model::Overlay::image].
3114    ///
3115    /// # Example
3116    /// ```ignore,no_run
3117    /// # use google_cloud_video_transcoder_v1::model::Overlay;
3118    /// use google_cloud_video_transcoder_v1::model::overlay::Image;
3119    /// let x = Overlay::new().set_image(Image::default()/* use setters */);
3120    /// ```
3121    pub fn set_image<T>(mut self, v: T) -> Self
3122    where
3123        T: std::convert::Into<crate::model::overlay::Image>,
3124    {
3125        self.image = std::option::Option::Some(v.into());
3126        self
3127    }
3128
3129    /// Sets or clears the value of [image][crate::model::Overlay::image].
3130    ///
3131    /// # Example
3132    /// ```ignore,no_run
3133    /// # use google_cloud_video_transcoder_v1::model::Overlay;
3134    /// use google_cloud_video_transcoder_v1::model::overlay::Image;
3135    /// let x = Overlay::new().set_or_clear_image(Some(Image::default()/* use setters */));
3136    /// let x = Overlay::new().set_or_clear_image(None::<Image>);
3137    /// ```
3138    pub fn set_or_clear_image<T>(mut self, v: std::option::Option<T>) -> Self
3139    where
3140        T: std::convert::Into<crate::model::overlay::Image>,
3141    {
3142        self.image = v.map(|x| x.into());
3143        self
3144    }
3145
3146    /// Sets the value of [animations][crate::model::Overlay::animations].
3147    ///
3148    /// # Example
3149    /// ```ignore,no_run
3150    /// # use google_cloud_video_transcoder_v1::model::Overlay;
3151    /// use google_cloud_video_transcoder_v1::model::overlay::Animation;
3152    /// let x = Overlay::new()
3153    ///     .set_animations([
3154    ///         Animation::default()/* use setters */,
3155    ///         Animation::default()/* use (different) setters */,
3156    ///     ]);
3157    /// ```
3158    pub fn set_animations<T, V>(mut self, v: T) -> Self
3159    where
3160        T: std::iter::IntoIterator<Item = V>,
3161        V: std::convert::Into<crate::model::overlay::Animation>,
3162    {
3163        use std::iter::Iterator;
3164        self.animations = v.into_iter().map(|i| i.into()).collect();
3165        self
3166    }
3167}
3168
3169impl wkt::message::Message for Overlay {
3170    fn typename() -> &'static str {
3171        "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay"
3172    }
3173}
3174
3175/// Defines additional types related to [Overlay].
3176pub mod overlay {
3177    #[allow(unused_imports)]
3178    use super::*;
3179
3180    /// 2D normalized coordinates. Default: `{0.0, 0.0}`
3181    #[derive(Clone, Default, PartialEq)]
3182    #[non_exhaustive]
3183    pub struct NormalizedCoordinate {
3184        /// Normalized x coordinate.
3185        pub x: f64,
3186
3187        /// Normalized y coordinate.
3188        pub y: f64,
3189
3190        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3191    }
3192
3193    impl NormalizedCoordinate {
3194        /// Creates a new default instance.
3195        pub fn new() -> Self {
3196            std::default::Default::default()
3197        }
3198
3199        /// Sets the value of [x][crate::model::overlay::NormalizedCoordinate::x].
3200        ///
3201        /// # Example
3202        /// ```ignore,no_run
3203        /// # use google_cloud_video_transcoder_v1::model::overlay::NormalizedCoordinate;
3204        /// let x = NormalizedCoordinate::new().set_x(42.0);
3205        /// ```
3206        pub fn set_x<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
3207            self.x = v.into();
3208            self
3209        }
3210
3211        /// Sets the value of [y][crate::model::overlay::NormalizedCoordinate::y].
3212        ///
3213        /// # Example
3214        /// ```ignore,no_run
3215        /// # use google_cloud_video_transcoder_v1::model::overlay::NormalizedCoordinate;
3216        /// let x = NormalizedCoordinate::new().set_y(42.0);
3217        /// ```
3218        pub fn set_y<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
3219            self.y = v.into();
3220            self
3221        }
3222    }
3223
3224    impl wkt::message::Message for NormalizedCoordinate {
3225        fn typename() -> &'static str {
3226            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate"
3227        }
3228    }
3229
3230    /// Overlaid image.
3231    #[derive(Clone, Default, PartialEq)]
3232    #[non_exhaustive]
3233    pub struct Image {
3234        /// Required. URI of the image in Cloud Storage. For example,
3235        /// `gs://bucket/inputs/image.png`. Only PNG and JPEG images are supported.
3236        pub uri: std::string::String,
3237
3238        /// Normalized image resolution, based on output video resolution. Valid
3239        /// values: `0.0`–`1.0`. To respect the original image aspect ratio, set
3240        /// either `x` or `y` to `0.0`. To use the original image resolution, set
3241        /// both `x` and `y` to `0.0`.
3242        pub resolution: std::option::Option<crate::model::overlay::NormalizedCoordinate>,
3243
3244        /// Target image opacity. Valid values are from  `1.0` (solid, default) to
3245        /// `0.0` (transparent), exclusive. Set this to a value greater than `0.0`.
3246        pub alpha: f64,
3247
3248        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3249    }
3250
3251    impl Image {
3252        /// Creates a new default instance.
3253        pub fn new() -> Self {
3254            std::default::Default::default()
3255        }
3256
3257        /// Sets the value of [uri][crate::model::overlay::Image::uri].
3258        ///
3259        /// # Example
3260        /// ```ignore,no_run
3261        /// # use google_cloud_video_transcoder_v1::model::overlay::Image;
3262        /// let x = Image::new().set_uri("example");
3263        /// ```
3264        pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3265            self.uri = v.into();
3266            self
3267        }
3268
3269        /// Sets the value of [resolution][crate::model::overlay::Image::resolution].
3270        ///
3271        /// # Example
3272        /// ```ignore,no_run
3273        /// # use google_cloud_video_transcoder_v1::model::overlay::Image;
3274        /// use google_cloud_video_transcoder_v1::model::overlay::NormalizedCoordinate;
3275        /// let x = Image::new().set_resolution(NormalizedCoordinate::default()/* use setters */);
3276        /// ```
3277        pub fn set_resolution<T>(mut self, v: T) -> Self
3278        where
3279            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
3280        {
3281            self.resolution = std::option::Option::Some(v.into());
3282            self
3283        }
3284
3285        /// Sets or clears the value of [resolution][crate::model::overlay::Image::resolution].
3286        ///
3287        /// # Example
3288        /// ```ignore,no_run
3289        /// # use google_cloud_video_transcoder_v1::model::overlay::Image;
3290        /// use google_cloud_video_transcoder_v1::model::overlay::NormalizedCoordinate;
3291        /// let x = Image::new().set_or_clear_resolution(Some(NormalizedCoordinate::default()/* use setters */));
3292        /// let x = Image::new().set_or_clear_resolution(None::<NormalizedCoordinate>);
3293        /// ```
3294        pub fn set_or_clear_resolution<T>(mut self, v: std::option::Option<T>) -> Self
3295        where
3296            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
3297        {
3298            self.resolution = v.map(|x| x.into());
3299            self
3300        }
3301
3302        /// Sets the value of [alpha][crate::model::overlay::Image::alpha].
3303        ///
3304        /// # Example
3305        /// ```ignore,no_run
3306        /// # use google_cloud_video_transcoder_v1::model::overlay::Image;
3307        /// let x = Image::new().set_alpha(42.0);
3308        /// ```
3309        pub fn set_alpha<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
3310            self.alpha = v.into();
3311            self
3312        }
3313    }
3314
3315    impl wkt::message::Message for Image {
3316        fn typename() -> &'static str {
3317            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.Image"
3318        }
3319    }
3320
3321    /// Display static overlay object.
3322    #[derive(Clone, Default, PartialEq)]
3323    #[non_exhaustive]
3324    pub struct AnimationStatic {
3325        /// Normalized coordinates based on output video resolution. Valid
3326        /// values: `0.0`–`1.0`. `xy` is the upper-left coordinate of the overlay
3327        /// object. For example, use the x and y coordinates {0,0} to position the
3328        /// top-left corner of the overlay animation in the top-left corner of the
3329        /// output video.
3330        pub xy: std::option::Option<crate::model::overlay::NormalizedCoordinate>,
3331
3332        /// The time to start displaying the overlay object, in seconds. Default: 0
3333        pub start_time_offset: std::option::Option<wkt::Duration>,
3334
3335        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3336    }
3337
3338    impl AnimationStatic {
3339        /// Creates a new default instance.
3340        pub fn new() -> Self {
3341            std::default::Default::default()
3342        }
3343
3344        /// Sets the value of [xy][crate::model::overlay::AnimationStatic::xy].
3345        ///
3346        /// # Example
3347        /// ```ignore,no_run
3348        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationStatic;
3349        /// use google_cloud_video_transcoder_v1::model::overlay::NormalizedCoordinate;
3350        /// let x = AnimationStatic::new().set_xy(NormalizedCoordinate::default()/* use setters */);
3351        /// ```
3352        pub fn set_xy<T>(mut self, v: T) -> Self
3353        where
3354            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
3355        {
3356            self.xy = std::option::Option::Some(v.into());
3357            self
3358        }
3359
3360        /// Sets or clears the value of [xy][crate::model::overlay::AnimationStatic::xy].
3361        ///
3362        /// # Example
3363        /// ```ignore,no_run
3364        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationStatic;
3365        /// use google_cloud_video_transcoder_v1::model::overlay::NormalizedCoordinate;
3366        /// let x = AnimationStatic::new().set_or_clear_xy(Some(NormalizedCoordinate::default()/* use setters */));
3367        /// let x = AnimationStatic::new().set_or_clear_xy(None::<NormalizedCoordinate>);
3368        /// ```
3369        pub fn set_or_clear_xy<T>(mut self, v: std::option::Option<T>) -> Self
3370        where
3371            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
3372        {
3373            self.xy = v.map(|x| x.into());
3374            self
3375        }
3376
3377        /// Sets the value of [start_time_offset][crate::model::overlay::AnimationStatic::start_time_offset].
3378        ///
3379        /// # Example
3380        /// ```ignore,no_run
3381        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationStatic;
3382        /// use wkt::Duration;
3383        /// let x = AnimationStatic::new().set_start_time_offset(Duration::default()/* use setters */);
3384        /// ```
3385        pub fn set_start_time_offset<T>(mut self, v: T) -> Self
3386        where
3387            T: std::convert::Into<wkt::Duration>,
3388        {
3389            self.start_time_offset = std::option::Option::Some(v.into());
3390            self
3391        }
3392
3393        /// Sets or clears the value of [start_time_offset][crate::model::overlay::AnimationStatic::start_time_offset].
3394        ///
3395        /// # Example
3396        /// ```ignore,no_run
3397        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationStatic;
3398        /// use wkt::Duration;
3399        /// let x = AnimationStatic::new().set_or_clear_start_time_offset(Some(Duration::default()/* use setters */));
3400        /// let x = AnimationStatic::new().set_or_clear_start_time_offset(None::<Duration>);
3401        /// ```
3402        pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
3403        where
3404            T: std::convert::Into<wkt::Duration>,
3405        {
3406            self.start_time_offset = v.map(|x| x.into());
3407            self
3408        }
3409    }
3410
3411    impl wkt::message::Message for AnimationStatic {
3412        fn typename() -> &'static str {
3413            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.AnimationStatic"
3414        }
3415    }
3416
3417    /// Display overlay object with fade animation.
3418    #[derive(Clone, Default, PartialEq)]
3419    #[non_exhaustive]
3420    pub struct AnimationFade {
3421        /// Required. Type of fade animation: `FADE_IN` or `FADE_OUT`.
3422        pub fade_type: crate::model::overlay::FadeType,
3423
3424        /// Normalized coordinates based on output video resolution. Valid
3425        /// values: `0.0`–`1.0`. `xy` is the upper-left coordinate of the overlay
3426        /// object. For example, use the x and y coordinates {0,0} to position the
3427        /// top-left corner of the overlay animation in the top-left corner of the
3428        /// output video.
3429        pub xy: std::option::Option<crate::model::overlay::NormalizedCoordinate>,
3430
3431        /// The time to start the fade animation, in seconds. Default: 0
3432        pub start_time_offset: std::option::Option<wkt::Duration>,
3433
3434        /// The time to end the fade animation, in seconds. Default:
3435        /// `start_time_offset` + 1s
3436        pub end_time_offset: std::option::Option<wkt::Duration>,
3437
3438        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3439    }
3440
3441    impl AnimationFade {
3442        /// Creates a new default instance.
3443        pub fn new() -> Self {
3444            std::default::Default::default()
3445        }
3446
3447        /// Sets the value of [fade_type][crate::model::overlay::AnimationFade::fade_type].
3448        ///
3449        /// # Example
3450        /// ```ignore,no_run
3451        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationFade;
3452        /// use google_cloud_video_transcoder_v1::model::overlay::FadeType;
3453        /// let x0 = AnimationFade::new().set_fade_type(FadeType::FadeIn);
3454        /// let x1 = AnimationFade::new().set_fade_type(FadeType::FadeOut);
3455        /// ```
3456        pub fn set_fade_type<T: std::convert::Into<crate::model::overlay::FadeType>>(
3457            mut self,
3458            v: T,
3459        ) -> Self {
3460            self.fade_type = v.into();
3461            self
3462        }
3463
3464        /// Sets the value of [xy][crate::model::overlay::AnimationFade::xy].
3465        ///
3466        /// # Example
3467        /// ```ignore,no_run
3468        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationFade;
3469        /// use google_cloud_video_transcoder_v1::model::overlay::NormalizedCoordinate;
3470        /// let x = AnimationFade::new().set_xy(NormalizedCoordinate::default()/* use setters */);
3471        /// ```
3472        pub fn set_xy<T>(mut self, v: T) -> Self
3473        where
3474            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
3475        {
3476            self.xy = std::option::Option::Some(v.into());
3477            self
3478        }
3479
3480        /// Sets or clears the value of [xy][crate::model::overlay::AnimationFade::xy].
3481        ///
3482        /// # Example
3483        /// ```ignore,no_run
3484        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationFade;
3485        /// use google_cloud_video_transcoder_v1::model::overlay::NormalizedCoordinate;
3486        /// let x = AnimationFade::new().set_or_clear_xy(Some(NormalizedCoordinate::default()/* use setters */));
3487        /// let x = AnimationFade::new().set_or_clear_xy(None::<NormalizedCoordinate>);
3488        /// ```
3489        pub fn set_or_clear_xy<T>(mut self, v: std::option::Option<T>) -> Self
3490        where
3491            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
3492        {
3493            self.xy = v.map(|x| x.into());
3494            self
3495        }
3496
3497        /// Sets the value of [start_time_offset][crate::model::overlay::AnimationFade::start_time_offset].
3498        ///
3499        /// # Example
3500        /// ```ignore,no_run
3501        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationFade;
3502        /// use wkt::Duration;
3503        /// let x = AnimationFade::new().set_start_time_offset(Duration::default()/* use setters */);
3504        /// ```
3505        pub fn set_start_time_offset<T>(mut self, v: T) -> Self
3506        where
3507            T: std::convert::Into<wkt::Duration>,
3508        {
3509            self.start_time_offset = std::option::Option::Some(v.into());
3510            self
3511        }
3512
3513        /// Sets or clears the value of [start_time_offset][crate::model::overlay::AnimationFade::start_time_offset].
3514        ///
3515        /// # Example
3516        /// ```ignore,no_run
3517        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationFade;
3518        /// use wkt::Duration;
3519        /// let x = AnimationFade::new().set_or_clear_start_time_offset(Some(Duration::default()/* use setters */));
3520        /// let x = AnimationFade::new().set_or_clear_start_time_offset(None::<Duration>);
3521        /// ```
3522        pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
3523        where
3524            T: std::convert::Into<wkt::Duration>,
3525        {
3526            self.start_time_offset = v.map(|x| x.into());
3527            self
3528        }
3529
3530        /// Sets the value of [end_time_offset][crate::model::overlay::AnimationFade::end_time_offset].
3531        ///
3532        /// # Example
3533        /// ```ignore,no_run
3534        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationFade;
3535        /// use wkt::Duration;
3536        /// let x = AnimationFade::new().set_end_time_offset(Duration::default()/* use setters */);
3537        /// ```
3538        pub fn set_end_time_offset<T>(mut self, v: T) -> Self
3539        where
3540            T: std::convert::Into<wkt::Duration>,
3541        {
3542            self.end_time_offset = std::option::Option::Some(v.into());
3543            self
3544        }
3545
3546        /// Sets or clears the value of [end_time_offset][crate::model::overlay::AnimationFade::end_time_offset].
3547        ///
3548        /// # Example
3549        /// ```ignore,no_run
3550        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationFade;
3551        /// use wkt::Duration;
3552        /// let x = AnimationFade::new().set_or_clear_end_time_offset(Some(Duration::default()/* use setters */));
3553        /// let x = AnimationFade::new().set_or_clear_end_time_offset(None::<Duration>);
3554        /// ```
3555        pub fn set_or_clear_end_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
3556        where
3557            T: std::convert::Into<wkt::Duration>,
3558        {
3559            self.end_time_offset = v.map(|x| x.into());
3560            self
3561        }
3562    }
3563
3564    impl wkt::message::Message for AnimationFade {
3565        fn typename() -> &'static str {
3566            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.AnimationFade"
3567        }
3568    }
3569
3570    /// End previous overlay animation from the video. Without `AnimationEnd`, the
3571    /// overlay object will keep the state of previous animation until the end of
3572    /// the video.
3573    #[derive(Clone, Default, PartialEq)]
3574    #[non_exhaustive]
3575    pub struct AnimationEnd {
3576        /// The time to end overlay object, in seconds. Default: 0
3577        pub start_time_offset: std::option::Option<wkt::Duration>,
3578
3579        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3580    }
3581
3582    impl AnimationEnd {
3583        /// Creates a new default instance.
3584        pub fn new() -> Self {
3585            std::default::Default::default()
3586        }
3587
3588        /// Sets the value of [start_time_offset][crate::model::overlay::AnimationEnd::start_time_offset].
3589        ///
3590        /// # Example
3591        /// ```ignore,no_run
3592        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationEnd;
3593        /// use wkt::Duration;
3594        /// let x = AnimationEnd::new().set_start_time_offset(Duration::default()/* use setters */);
3595        /// ```
3596        pub fn set_start_time_offset<T>(mut self, v: T) -> Self
3597        where
3598            T: std::convert::Into<wkt::Duration>,
3599        {
3600            self.start_time_offset = std::option::Option::Some(v.into());
3601            self
3602        }
3603
3604        /// Sets or clears the value of [start_time_offset][crate::model::overlay::AnimationEnd::start_time_offset].
3605        ///
3606        /// # Example
3607        /// ```ignore,no_run
3608        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationEnd;
3609        /// use wkt::Duration;
3610        /// let x = AnimationEnd::new().set_or_clear_start_time_offset(Some(Duration::default()/* use setters */));
3611        /// let x = AnimationEnd::new().set_or_clear_start_time_offset(None::<Duration>);
3612        /// ```
3613        pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
3614        where
3615            T: std::convert::Into<wkt::Duration>,
3616        {
3617            self.start_time_offset = v.map(|x| x.into());
3618            self
3619        }
3620    }
3621
3622    impl wkt::message::Message for AnimationEnd {
3623        fn typename() -> &'static str {
3624            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.AnimationEnd"
3625        }
3626    }
3627
3628    /// Animation types.
3629    #[derive(Clone, Default, PartialEq)]
3630    #[non_exhaustive]
3631    pub struct Animation {
3632        /// Animations can be static or fade, or they can end the previous animation.
3633        pub animation_type: std::option::Option<crate::model::overlay::animation::AnimationType>,
3634
3635        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3636    }
3637
3638    impl Animation {
3639        /// Creates a new default instance.
3640        pub fn new() -> Self {
3641            std::default::Default::default()
3642        }
3643
3644        /// Sets the value of [animation_type][crate::model::overlay::Animation::animation_type].
3645        ///
3646        /// Note that all the setters affecting `animation_type` are mutually
3647        /// exclusive.
3648        ///
3649        /// # Example
3650        /// ```ignore,no_run
3651        /// # use google_cloud_video_transcoder_v1::model::overlay::Animation;
3652        /// use google_cloud_video_transcoder_v1::model::overlay::AnimationStatic;
3653        /// let x = Animation::new().set_animation_type(Some(
3654        ///     google_cloud_video_transcoder_v1::model::overlay::animation::AnimationType::AnimationStatic(AnimationStatic::default().into())));
3655        /// ```
3656        pub fn set_animation_type<
3657            T: std::convert::Into<
3658                    std::option::Option<crate::model::overlay::animation::AnimationType>,
3659                >,
3660        >(
3661            mut self,
3662            v: T,
3663        ) -> Self {
3664            self.animation_type = v.into();
3665            self
3666        }
3667
3668        /// The value of [animation_type][crate::model::overlay::Animation::animation_type]
3669        /// if it holds a `AnimationStatic`, `None` if the field is not set or
3670        /// holds a different branch.
3671        pub fn animation_static(
3672            &self,
3673        ) -> std::option::Option<&std::boxed::Box<crate::model::overlay::AnimationStatic>> {
3674            #[allow(unreachable_patterns)]
3675            self.animation_type.as_ref().and_then(|v| match v {
3676                crate::model::overlay::animation::AnimationType::AnimationStatic(v) => {
3677                    std::option::Option::Some(v)
3678                }
3679                _ => std::option::Option::None,
3680            })
3681        }
3682
3683        /// Sets the value of [animation_type][crate::model::overlay::Animation::animation_type]
3684        /// to hold a `AnimationStatic`.
3685        ///
3686        /// Note that all the setters affecting `animation_type` are
3687        /// mutually exclusive.
3688        ///
3689        /// # Example
3690        /// ```ignore,no_run
3691        /// # use google_cloud_video_transcoder_v1::model::overlay::Animation;
3692        /// use google_cloud_video_transcoder_v1::model::overlay::AnimationStatic;
3693        /// let x = Animation::new().set_animation_static(AnimationStatic::default()/* use setters */);
3694        /// assert!(x.animation_static().is_some());
3695        /// assert!(x.animation_fade().is_none());
3696        /// assert!(x.animation_end().is_none());
3697        /// ```
3698        pub fn set_animation_static<
3699            T: std::convert::Into<std::boxed::Box<crate::model::overlay::AnimationStatic>>,
3700        >(
3701            mut self,
3702            v: T,
3703        ) -> Self {
3704            self.animation_type = std::option::Option::Some(
3705                crate::model::overlay::animation::AnimationType::AnimationStatic(v.into()),
3706            );
3707            self
3708        }
3709
3710        /// The value of [animation_type][crate::model::overlay::Animation::animation_type]
3711        /// if it holds a `AnimationFade`, `None` if the field is not set or
3712        /// holds a different branch.
3713        pub fn animation_fade(
3714            &self,
3715        ) -> std::option::Option<&std::boxed::Box<crate::model::overlay::AnimationFade>> {
3716            #[allow(unreachable_patterns)]
3717            self.animation_type.as_ref().and_then(|v| match v {
3718                crate::model::overlay::animation::AnimationType::AnimationFade(v) => {
3719                    std::option::Option::Some(v)
3720                }
3721                _ => std::option::Option::None,
3722            })
3723        }
3724
3725        /// Sets the value of [animation_type][crate::model::overlay::Animation::animation_type]
3726        /// to hold a `AnimationFade`.
3727        ///
3728        /// Note that all the setters affecting `animation_type` are
3729        /// mutually exclusive.
3730        ///
3731        /// # Example
3732        /// ```ignore,no_run
3733        /// # use google_cloud_video_transcoder_v1::model::overlay::Animation;
3734        /// use google_cloud_video_transcoder_v1::model::overlay::AnimationFade;
3735        /// let x = Animation::new().set_animation_fade(AnimationFade::default()/* use setters */);
3736        /// assert!(x.animation_fade().is_some());
3737        /// assert!(x.animation_static().is_none());
3738        /// assert!(x.animation_end().is_none());
3739        /// ```
3740        pub fn set_animation_fade<
3741            T: std::convert::Into<std::boxed::Box<crate::model::overlay::AnimationFade>>,
3742        >(
3743            mut self,
3744            v: T,
3745        ) -> Self {
3746            self.animation_type = std::option::Option::Some(
3747                crate::model::overlay::animation::AnimationType::AnimationFade(v.into()),
3748            );
3749            self
3750        }
3751
3752        /// The value of [animation_type][crate::model::overlay::Animation::animation_type]
3753        /// if it holds a `AnimationEnd`, `None` if the field is not set or
3754        /// holds a different branch.
3755        pub fn animation_end(
3756            &self,
3757        ) -> std::option::Option<&std::boxed::Box<crate::model::overlay::AnimationEnd>> {
3758            #[allow(unreachable_patterns)]
3759            self.animation_type.as_ref().and_then(|v| match v {
3760                crate::model::overlay::animation::AnimationType::AnimationEnd(v) => {
3761                    std::option::Option::Some(v)
3762                }
3763                _ => std::option::Option::None,
3764            })
3765        }
3766
3767        /// Sets the value of [animation_type][crate::model::overlay::Animation::animation_type]
3768        /// to hold a `AnimationEnd`.
3769        ///
3770        /// Note that all the setters affecting `animation_type` are
3771        /// mutually exclusive.
3772        ///
3773        /// # Example
3774        /// ```ignore,no_run
3775        /// # use google_cloud_video_transcoder_v1::model::overlay::Animation;
3776        /// use google_cloud_video_transcoder_v1::model::overlay::AnimationEnd;
3777        /// let x = Animation::new().set_animation_end(AnimationEnd::default()/* use setters */);
3778        /// assert!(x.animation_end().is_some());
3779        /// assert!(x.animation_static().is_none());
3780        /// assert!(x.animation_fade().is_none());
3781        /// ```
3782        pub fn set_animation_end<
3783            T: std::convert::Into<std::boxed::Box<crate::model::overlay::AnimationEnd>>,
3784        >(
3785            mut self,
3786            v: T,
3787        ) -> Self {
3788            self.animation_type = std::option::Option::Some(
3789                crate::model::overlay::animation::AnimationType::AnimationEnd(v.into()),
3790            );
3791            self
3792        }
3793    }
3794
3795    impl wkt::message::Message for Animation {
3796        fn typename() -> &'static str {
3797            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.Animation"
3798        }
3799    }
3800
3801    /// Defines additional types related to [Animation].
3802    pub mod animation {
3803        #[allow(unused_imports)]
3804        use super::*;
3805
3806        /// Animations can be static or fade, or they can end the previous animation.
3807        #[derive(Clone, Debug, PartialEq)]
3808        #[non_exhaustive]
3809        pub enum AnimationType {
3810            /// Display static overlay object.
3811            AnimationStatic(std::boxed::Box<crate::model::overlay::AnimationStatic>),
3812            /// Display overlay object with fade animation.
3813            AnimationFade(std::boxed::Box<crate::model::overlay::AnimationFade>),
3814            /// End previous animation.
3815            AnimationEnd(std::boxed::Box<crate::model::overlay::AnimationEnd>),
3816        }
3817    }
3818
3819    /// Fade type for the overlay: `FADE_IN` or `FADE_OUT`.
3820    ///
3821    /// # Working with unknown values
3822    ///
3823    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3824    /// additional enum variants at any time. Adding new variants is not considered
3825    /// a breaking change. Applications should write their code in anticipation of:
3826    ///
3827    /// - New values appearing in future releases of the client library, **and**
3828    /// - New values received dynamically, without application changes.
3829    ///
3830    /// Please consult the [Working with enums] section in the user guide for some
3831    /// guidelines.
3832    ///
3833    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3834    #[derive(Clone, Debug, PartialEq)]
3835    #[non_exhaustive]
3836    pub enum FadeType {
3837        /// The fade type is not specified.
3838        Unspecified,
3839        /// Fade the overlay object into view.
3840        FadeIn,
3841        /// Fade the overlay object out of view.
3842        FadeOut,
3843        /// If set, the enum was initialized with an unknown value.
3844        ///
3845        /// Applications can examine the value using [FadeType::value] or
3846        /// [FadeType::name].
3847        UnknownValue(fade_type::UnknownValue),
3848    }
3849
3850    #[doc(hidden)]
3851    pub mod fade_type {
3852        #[allow(unused_imports)]
3853        use super::*;
3854        #[derive(Clone, Debug, PartialEq)]
3855        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3856    }
3857
3858    impl FadeType {
3859        /// Gets the enum value.
3860        ///
3861        /// Returns `None` if the enum contains an unknown value deserialized from
3862        /// the string representation of enums.
3863        pub fn value(&self) -> std::option::Option<i32> {
3864            match self {
3865                Self::Unspecified => std::option::Option::Some(0),
3866                Self::FadeIn => std::option::Option::Some(1),
3867                Self::FadeOut => std::option::Option::Some(2),
3868                Self::UnknownValue(u) => u.0.value(),
3869            }
3870        }
3871
3872        /// Gets the enum value as a string.
3873        ///
3874        /// Returns `None` if the enum contains an unknown value deserialized from
3875        /// the integer representation of enums.
3876        pub fn name(&self) -> std::option::Option<&str> {
3877            match self {
3878                Self::Unspecified => std::option::Option::Some("FADE_TYPE_UNSPECIFIED"),
3879                Self::FadeIn => std::option::Option::Some("FADE_IN"),
3880                Self::FadeOut => std::option::Option::Some("FADE_OUT"),
3881                Self::UnknownValue(u) => u.0.name(),
3882            }
3883        }
3884    }
3885
3886    impl std::default::Default for FadeType {
3887        fn default() -> Self {
3888            use std::convert::From;
3889            Self::from(0)
3890        }
3891    }
3892
3893    impl std::fmt::Display for FadeType {
3894        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3895            wkt::internal::display_enum(f, self.name(), self.value())
3896        }
3897    }
3898
3899    impl std::convert::From<i32> for FadeType {
3900        fn from(value: i32) -> Self {
3901            match value {
3902                0 => Self::Unspecified,
3903                1 => Self::FadeIn,
3904                2 => Self::FadeOut,
3905                _ => Self::UnknownValue(fade_type::UnknownValue(
3906                    wkt::internal::UnknownEnumValue::Integer(value),
3907                )),
3908            }
3909        }
3910    }
3911
3912    impl std::convert::From<&str> for FadeType {
3913        fn from(value: &str) -> Self {
3914            use std::string::ToString;
3915            match value {
3916                "FADE_TYPE_UNSPECIFIED" => Self::Unspecified,
3917                "FADE_IN" => Self::FadeIn,
3918                "FADE_OUT" => Self::FadeOut,
3919                _ => Self::UnknownValue(fade_type::UnknownValue(
3920                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3921                )),
3922            }
3923        }
3924    }
3925
3926    impl serde::ser::Serialize for FadeType {
3927        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3928        where
3929            S: serde::Serializer,
3930        {
3931            match self {
3932                Self::Unspecified => serializer.serialize_i32(0),
3933                Self::FadeIn => serializer.serialize_i32(1),
3934                Self::FadeOut => serializer.serialize_i32(2),
3935                Self::UnknownValue(u) => u.0.serialize(serializer),
3936            }
3937        }
3938    }
3939
3940    impl<'de> serde::de::Deserialize<'de> for FadeType {
3941        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3942        where
3943            D: serde::Deserializer<'de>,
3944        {
3945            deserializer.deserialize_any(wkt::internal::EnumVisitor::<FadeType>::new(
3946                ".google.cloud.video.transcoder.v1.Overlay.FadeType",
3947            ))
3948        }
3949    }
3950}
3951
3952/// Preprocessing configurations.
3953#[derive(Clone, Default, PartialEq)]
3954#[non_exhaustive]
3955pub struct PreprocessingConfig {
3956    /// Color preprocessing configuration.
3957    pub color: std::option::Option<crate::model::preprocessing_config::Color>,
3958
3959    /// Denoise preprocessing configuration.
3960    pub denoise: std::option::Option<crate::model::preprocessing_config::Denoise>,
3961
3962    /// Deblock preprocessing configuration.
3963    pub deblock: std::option::Option<crate::model::preprocessing_config::Deblock>,
3964
3965    /// Audio preprocessing configuration.
3966    pub audio: std::option::Option<crate::model::preprocessing_config::Audio>,
3967
3968    /// Specify the video cropping configuration.
3969    pub crop: std::option::Option<crate::model::preprocessing_config::Crop>,
3970
3971    /// Specify the video pad filter configuration.
3972    pub pad: std::option::Option<crate::model::preprocessing_config::Pad>,
3973
3974    /// Specify the video deinterlace configuration.
3975    pub deinterlace: std::option::Option<crate::model::preprocessing_config::Deinterlace>,
3976
3977    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3978}
3979
3980impl PreprocessingConfig {
3981    /// Creates a new default instance.
3982    pub fn new() -> Self {
3983        std::default::Default::default()
3984    }
3985
3986    /// Sets the value of [color][crate::model::PreprocessingConfig::color].
3987    ///
3988    /// # Example
3989    /// ```ignore,no_run
3990    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
3991    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Color;
3992    /// let x = PreprocessingConfig::new().set_color(Color::default()/* use setters */);
3993    /// ```
3994    pub fn set_color<T>(mut self, v: T) -> Self
3995    where
3996        T: std::convert::Into<crate::model::preprocessing_config::Color>,
3997    {
3998        self.color = std::option::Option::Some(v.into());
3999        self
4000    }
4001
4002    /// Sets or clears the value of [color][crate::model::PreprocessingConfig::color].
4003    ///
4004    /// # Example
4005    /// ```ignore,no_run
4006    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4007    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Color;
4008    /// let x = PreprocessingConfig::new().set_or_clear_color(Some(Color::default()/* use setters */));
4009    /// let x = PreprocessingConfig::new().set_or_clear_color(None::<Color>);
4010    /// ```
4011    pub fn set_or_clear_color<T>(mut self, v: std::option::Option<T>) -> Self
4012    where
4013        T: std::convert::Into<crate::model::preprocessing_config::Color>,
4014    {
4015        self.color = v.map(|x| x.into());
4016        self
4017    }
4018
4019    /// Sets the value of [denoise][crate::model::PreprocessingConfig::denoise].
4020    ///
4021    /// # Example
4022    /// ```ignore,no_run
4023    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4024    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Denoise;
4025    /// let x = PreprocessingConfig::new().set_denoise(Denoise::default()/* use setters */);
4026    /// ```
4027    pub fn set_denoise<T>(mut self, v: T) -> Self
4028    where
4029        T: std::convert::Into<crate::model::preprocessing_config::Denoise>,
4030    {
4031        self.denoise = std::option::Option::Some(v.into());
4032        self
4033    }
4034
4035    /// Sets or clears the value of [denoise][crate::model::PreprocessingConfig::denoise].
4036    ///
4037    /// # Example
4038    /// ```ignore,no_run
4039    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4040    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Denoise;
4041    /// let x = PreprocessingConfig::new().set_or_clear_denoise(Some(Denoise::default()/* use setters */));
4042    /// let x = PreprocessingConfig::new().set_or_clear_denoise(None::<Denoise>);
4043    /// ```
4044    pub fn set_or_clear_denoise<T>(mut self, v: std::option::Option<T>) -> Self
4045    where
4046        T: std::convert::Into<crate::model::preprocessing_config::Denoise>,
4047    {
4048        self.denoise = v.map(|x| x.into());
4049        self
4050    }
4051
4052    /// Sets the value of [deblock][crate::model::PreprocessingConfig::deblock].
4053    ///
4054    /// # Example
4055    /// ```ignore,no_run
4056    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4057    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Deblock;
4058    /// let x = PreprocessingConfig::new().set_deblock(Deblock::default()/* use setters */);
4059    /// ```
4060    pub fn set_deblock<T>(mut self, v: T) -> Self
4061    where
4062        T: std::convert::Into<crate::model::preprocessing_config::Deblock>,
4063    {
4064        self.deblock = std::option::Option::Some(v.into());
4065        self
4066    }
4067
4068    /// Sets or clears the value of [deblock][crate::model::PreprocessingConfig::deblock].
4069    ///
4070    /// # Example
4071    /// ```ignore,no_run
4072    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4073    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Deblock;
4074    /// let x = PreprocessingConfig::new().set_or_clear_deblock(Some(Deblock::default()/* use setters */));
4075    /// let x = PreprocessingConfig::new().set_or_clear_deblock(None::<Deblock>);
4076    /// ```
4077    pub fn set_or_clear_deblock<T>(mut self, v: std::option::Option<T>) -> Self
4078    where
4079        T: std::convert::Into<crate::model::preprocessing_config::Deblock>,
4080    {
4081        self.deblock = v.map(|x| x.into());
4082        self
4083    }
4084
4085    /// Sets the value of [audio][crate::model::PreprocessingConfig::audio].
4086    ///
4087    /// # Example
4088    /// ```ignore,no_run
4089    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4090    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Audio;
4091    /// let x = PreprocessingConfig::new().set_audio(Audio::default()/* use setters */);
4092    /// ```
4093    pub fn set_audio<T>(mut self, v: T) -> Self
4094    where
4095        T: std::convert::Into<crate::model::preprocessing_config::Audio>,
4096    {
4097        self.audio = std::option::Option::Some(v.into());
4098        self
4099    }
4100
4101    /// Sets or clears the value of [audio][crate::model::PreprocessingConfig::audio].
4102    ///
4103    /// # Example
4104    /// ```ignore,no_run
4105    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4106    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Audio;
4107    /// let x = PreprocessingConfig::new().set_or_clear_audio(Some(Audio::default()/* use setters */));
4108    /// let x = PreprocessingConfig::new().set_or_clear_audio(None::<Audio>);
4109    /// ```
4110    pub fn set_or_clear_audio<T>(mut self, v: std::option::Option<T>) -> Self
4111    where
4112        T: std::convert::Into<crate::model::preprocessing_config::Audio>,
4113    {
4114        self.audio = v.map(|x| x.into());
4115        self
4116    }
4117
4118    /// Sets the value of [crop][crate::model::PreprocessingConfig::crop].
4119    ///
4120    /// # Example
4121    /// ```ignore,no_run
4122    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4123    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Crop;
4124    /// let x = PreprocessingConfig::new().set_crop(Crop::default()/* use setters */);
4125    /// ```
4126    pub fn set_crop<T>(mut self, v: T) -> Self
4127    where
4128        T: std::convert::Into<crate::model::preprocessing_config::Crop>,
4129    {
4130        self.crop = std::option::Option::Some(v.into());
4131        self
4132    }
4133
4134    /// Sets or clears the value of [crop][crate::model::PreprocessingConfig::crop].
4135    ///
4136    /// # Example
4137    /// ```ignore,no_run
4138    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4139    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Crop;
4140    /// let x = PreprocessingConfig::new().set_or_clear_crop(Some(Crop::default()/* use setters */));
4141    /// let x = PreprocessingConfig::new().set_or_clear_crop(None::<Crop>);
4142    /// ```
4143    pub fn set_or_clear_crop<T>(mut self, v: std::option::Option<T>) -> Self
4144    where
4145        T: std::convert::Into<crate::model::preprocessing_config::Crop>,
4146    {
4147        self.crop = v.map(|x| x.into());
4148        self
4149    }
4150
4151    /// Sets the value of [pad][crate::model::PreprocessingConfig::pad].
4152    ///
4153    /// # Example
4154    /// ```ignore,no_run
4155    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4156    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Pad;
4157    /// let x = PreprocessingConfig::new().set_pad(Pad::default()/* use setters */);
4158    /// ```
4159    pub fn set_pad<T>(mut self, v: T) -> Self
4160    where
4161        T: std::convert::Into<crate::model::preprocessing_config::Pad>,
4162    {
4163        self.pad = std::option::Option::Some(v.into());
4164        self
4165    }
4166
4167    /// Sets or clears the value of [pad][crate::model::PreprocessingConfig::pad].
4168    ///
4169    /// # Example
4170    /// ```ignore,no_run
4171    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4172    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Pad;
4173    /// let x = PreprocessingConfig::new().set_or_clear_pad(Some(Pad::default()/* use setters */));
4174    /// let x = PreprocessingConfig::new().set_or_clear_pad(None::<Pad>);
4175    /// ```
4176    pub fn set_or_clear_pad<T>(mut self, v: std::option::Option<T>) -> Self
4177    where
4178        T: std::convert::Into<crate::model::preprocessing_config::Pad>,
4179    {
4180        self.pad = v.map(|x| x.into());
4181        self
4182    }
4183
4184    /// Sets the value of [deinterlace][crate::model::PreprocessingConfig::deinterlace].
4185    ///
4186    /// # Example
4187    /// ```ignore,no_run
4188    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4189    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Deinterlace;
4190    /// let x = PreprocessingConfig::new().set_deinterlace(Deinterlace::default()/* use setters */);
4191    /// ```
4192    pub fn set_deinterlace<T>(mut self, v: T) -> Self
4193    where
4194        T: std::convert::Into<crate::model::preprocessing_config::Deinterlace>,
4195    {
4196        self.deinterlace = std::option::Option::Some(v.into());
4197        self
4198    }
4199
4200    /// Sets or clears the value of [deinterlace][crate::model::PreprocessingConfig::deinterlace].
4201    ///
4202    /// # Example
4203    /// ```ignore,no_run
4204    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4205    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Deinterlace;
4206    /// let x = PreprocessingConfig::new().set_or_clear_deinterlace(Some(Deinterlace::default()/* use setters */));
4207    /// let x = PreprocessingConfig::new().set_or_clear_deinterlace(None::<Deinterlace>);
4208    /// ```
4209    pub fn set_or_clear_deinterlace<T>(mut self, v: std::option::Option<T>) -> Self
4210    where
4211        T: std::convert::Into<crate::model::preprocessing_config::Deinterlace>,
4212    {
4213        self.deinterlace = v.map(|x| x.into());
4214        self
4215    }
4216}
4217
4218impl wkt::message::Message for PreprocessingConfig {
4219    fn typename() -> &'static str {
4220        "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig"
4221    }
4222}
4223
4224/// Defines additional types related to [PreprocessingConfig].
4225pub mod preprocessing_config {
4226    #[allow(unused_imports)]
4227    use super::*;
4228
4229    /// Color preprocessing configuration.
4230    ///
4231    /// **Note:** This configuration is not supported.
4232    #[derive(Clone, Default, PartialEq)]
4233    #[non_exhaustive]
4234    pub struct Color {
4235        /// Control color saturation of the video. Enter a value between -1 and 1,
4236        /// where -1 is fully desaturated and 1 is maximum saturation. 0 is no
4237        /// change. The default is 0.
4238        pub saturation: f64,
4239
4240        /// Control black and white contrast of the video. Enter a value between -1
4241        /// and 1, where -1 is minimum contrast and 1 is maximum contrast. 0 is no
4242        /// change. The default is 0.
4243        pub contrast: f64,
4244
4245        /// Control brightness of the video. Enter a value between -1 and 1, where -1
4246        /// is minimum brightness and 1 is maximum brightness. 0 is no change. The
4247        /// default is 0.
4248        pub brightness: f64,
4249
4250        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4251    }
4252
4253    impl Color {
4254        /// Creates a new default instance.
4255        pub fn new() -> Self {
4256            std::default::Default::default()
4257        }
4258
4259        /// Sets the value of [saturation][crate::model::preprocessing_config::Color::saturation].
4260        ///
4261        /// # Example
4262        /// ```ignore,no_run
4263        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Color;
4264        /// let x = Color::new().set_saturation(42.0);
4265        /// ```
4266        pub fn set_saturation<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
4267            self.saturation = v.into();
4268            self
4269        }
4270
4271        /// Sets the value of [contrast][crate::model::preprocessing_config::Color::contrast].
4272        ///
4273        /// # Example
4274        /// ```ignore,no_run
4275        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Color;
4276        /// let x = Color::new().set_contrast(42.0);
4277        /// ```
4278        pub fn set_contrast<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
4279            self.contrast = v.into();
4280            self
4281        }
4282
4283        /// Sets the value of [brightness][crate::model::preprocessing_config::Color::brightness].
4284        ///
4285        /// # Example
4286        /// ```ignore,no_run
4287        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Color;
4288        /// let x = Color::new().set_brightness(42.0);
4289        /// ```
4290        pub fn set_brightness<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
4291            self.brightness = v.into();
4292            self
4293        }
4294    }
4295
4296    impl wkt::message::Message for Color {
4297        fn typename() -> &'static str {
4298            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Color"
4299        }
4300    }
4301
4302    /// Denoise preprocessing configuration.
4303    ///
4304    /// **Note:** This configuration is not supported.
4305    #[derive(Clone, Default, PartialEq)]
4306    #[non_exhaustive]
4307    pub struct Denoise {
4308        /// Set strength of the denoise. Enter a value between 0 and 1. The higher
4309        /// the value, the smoother the image. 0 is no denoising. The default is 0.
4310        pub strength: f64,
4311
4312        /// Set the denoiser mode. The default is `standard`.
4313        ///
4314        /// Supported denoiser modes:
4315        ///
4316        /// - `standard`
4317        /// - `grain`
4318        pub tune: std::string::String,
4319
4320        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4321    }
4322
4323    impl Denoise {
4324        /// Creates a new default instance.
4325        pub fn new() -> Self {
4326            std::default::Default::default()
4327        }
4328
4329        /// Sets the value of [strength][crate::model::preprocessing_config::Denoise::strength].
4330        ///
4331        /// # Example
4332        /// ```ignore,no_run
4333        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Denoise;
4334        /// let x = Denoise::new().set_strength(42.0);
4335        /// ```
4336        pub fn set_strength<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
4337            self.strength = v.into();
4338            self
4339        }
4340
4341        /// Sets the value of [tune][crate::model::preprocessing_config::Denoise::tune].
4342        ///
4343        /// # Example
4344        /// ```ignore,no_run
4345        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Denoise;
4346        /// let x = Denoise::new().set_tune("example");
4347        /// ```
4348        pub fn set_tune<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4349            self.tune = v.into();
4350            self
4351        }
4352    }
4353
4354    impl wkt::message::Message for Denoise {
4355        fn typename() -> &'static str {
4356            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise"
4357        }
4358    }
4359
4360    /// Deblock preprocessing configuration.
4361    ///
4362    /// **Note:** This configuration is not supported.
4363    #[derive(Clone, Default, PartialEq)]
4364    #[non_exhaustive]
4365    pub struct Deblock {
4366        /// Set strength of the deblocker. Enter a value between 0 and 1. The higher
4367        /// the value, the stronger the block removal. 0 is no deblocking. The
4368        /// default is 0.
4369        pub strength: f64,
4370
4371        /// Enable deblocker. The default is `false`.
4372        pub enabled: bool,
4373
4374        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4375    }
4376
4377    impl Deblock {
4378        /// Creates a new default instance.
4379        pub fn new() -> Self {
4380            std::default::Default::default()
4381        }
4382
4383        /// Sets the value of [strength][crate::model::preprocessing_config::Deblock::strength].
4384        ///
4385        /// # Example
4386        /// ```ignore,no_run
4387        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Deblock;
4388        /// let x = Deblock::new().set_strength(42.0);
4389        /// ```
4390        pub fn set_strength<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
4391            self.strength = v.into();
4392            self
4393        }
4394
4395        /// Sets the value of [enabled][crate::model::preprocessing_config::Deblock::enabled].
4396        ///
4397        /// # Example
4398        /// ```ignore,no_run
4399        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Deblock;
4400        /// let x = Deblock::new().set_enabled(true);
4401        /// ```
4402        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4403            self.enabled = v.into();
4404            self
4405        }
4406    }
4407
4408    impl wkt::message::Message for Deblock {
4409        fn typename() -> &'static str {
4410            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock"
4411        }
4412    }
4413
4414    /// Audio preprocessing configuration.
4415    #[derive(Clone, Default, PartialEq)]
4416    #[non_exhaustive]
4417    pub struct Audio {
4418        /// Specify audio loudness normalization in loudness units relative to full
4419        /// scale (LUFS). Enter a value between -24 and 0 (the default), where:
4420        ///
4421        /// * -24 is the Advanced Television Systems Committee (ATSC A/85) standard
4422        /// * -23 is the EU R128 broadcast standard
4423        /// * -19 is the prior standard for online mono audio
4424        /// * -18 is the ReplayGain standard
4425        /// * -16 is the prior standard for stereo audio
4426        /// * -14 is the new online audio standard recommended by Spotify, as well
4427        ///   as Amazon Echo
4428        /// * 0 disables normalization
4429        pub lufs: f64,
4430
4431        /// Enable boosting high frequency components. The default is `false`.
4432        ///
4433        /// **Note:** This field is not supported.
4434        pub high_boost: bool,
4435
4436        /// Enable boosting low frequency components. The default is `false`.
4437        ///
4438        /// **Note:** This field is not supported.
4439        pub low_boost: bool,
4440
4441        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4442    }
4443
4444    impl Audio {
4445        /// Creates a new default instance.
4446        pub fn new() -> Self {
4447            std::default::Default::default()
4448        }
4449
4450        /// Sets the value of [lufs][crate::model::preprocessing_config::Audio::lufs].
4451        ///
4452        /// # Example
4453        /// ```ignore,no_run
4454        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Audio;
4455        /// let x = Audio::new().set_lufs(42.0);
4456        /// ```
4457        pub fn set_lufs<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
4458            self.lufs = v.into();
4459            self
4460        }
4461
4462        /// Sets the value of [high_boost][crate::model::preprocessing_config::Audio::high_boost].
4463        ///
4464        /// # Example
4465        /// ```ignore,no_run
4466        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Audio;
4467        /// let x = Audio::new().set_high_boost(true);
4468        /// ```
4469        pub fn set_high_boost<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4470            self.high_boost = v.into();
4471            self
4472        }
4473
4474        /// Sets the value of [low_boost][crate::model::preprocessing_config::Audio::low_boost].
4475        ///
4476        /// # Example
4477        /// ```ignore,no_run
4478        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Audio;
4479        /// let x = Audio::new().set_low_boost(true);
4480        /// ```
4481        pub fn set_low_boost<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4482            self.low_boost = v.into();
4483            self
4484        }
4485    }
4486
4487    impl wkt::message::Message for Audio {
4488        fn typename() -> &'static str {
4489            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Audio"
4490        }
4491    }
4492
4493    /// Video cropping configuration for the input video. The cropped input video
4494    /// is scaled to match the output resolution.
4495    #[derive(Clone, Default, PartialEq)]
4496    #[non_exhaustive]
4497    pub struct Crop {
4498        /// The number of pixels to crop from the top. The default is 0.
4499        pub top_pixels: i32,
4500
4501        /// The number of pixels to crop from the bottom. The default is 0.
4502        pub bottom_pixels: i32,
4503
4504        /// The number of pixels to crop from the left. The default is 0.
4505        pub left_pixels: i32,
4506
4507        /// The number of pixels to crop from the right. The default is 0.
4508        pub right_pixels: i32,
4509
4510        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4511    }
4512
4513    impl Crop {
4514        /// Creates a new default instance.
4515        pub fn new() -> Self {
4516            std::default::Default::default()
4517        }
4518
4519        /// Sets the value of [top_pixels][crate::model::preprocessing_config::Crop::top_pixels].
4520        ///
4521        /// # Example
4522        /// ```ignore,no_run
4523        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Crop;
4524        /// let x = Crop::new().set_top_pixels(42);
4525        /// ```
4526        pub fn set_top_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4527            self.top_pixels = v.into();
4528            self
4529        }
4530
4531        /// Sets the value of [bottom_pixels][crate::model::preprocessing_config::Crop::bottom_pixels].
4532        ///
4533        /// # Example
4534        /// ```ignore,no_run
4535        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Crop;
4536        /// let x = Crop::new().set_bottom_pixels(42);
4537        /// ```
4538        pub fn set_bottom_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4539            self.bottom_pixels = v.into();
4540            self
4541        }
4542
4543        /// Sets the value of [left_pixels][crate::model::preprocessing_config::Crop::left_pixels].
4544        ///
4545        /// # Example
4546        /// ```ignore,no_run
4547        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Crop;
4548        /// let x = Crop::new().set_left_pixels(42);
4549        /// ```
4550        pub fn set_left_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4551            self.left_pixels = v.into();
4552            self
4553        }
4554
4555        /// Sets the value of [right_pixels][crate::model::preprocessing_config::Crop::right_pixels].
4556        ///
4557        /// # Example
4558        /// ```ignore,no_run
4559        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Crop;
4560        /// let x = Crop::new().set_right_pixels(42);
4561        /// ```
4562        pub fn set_right_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4563            self.right_pixels = v.into();
4564            self
4565        }
4566    }
4567
4568    impl wkt::message::Message for Crop {
4569        fn typename() -> &'static str {
4570            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Crop"
4571        }
4572    }
4573
4574    /// Pad filter configuration for the input video. The padded input video
4575    /// is scaled after padding with black to match the output resolution.
4576    #[derive(Clone, Default, PartialEq)]
4577    #[non_exhaustive]
4578    pub struct Pad {
4579        /// The number of pixels to add to the top. The default is 0.
4580        pub top_pixels: i32,
4581
4582        /// The number of pixels to add to the bottom. The default is 0.
4583        pub bottom_pixels: i32,
4584
4585        /// The number of pixels to add to the left. The default is 0.
4586        pub left_pixels: i32,
4587
4588        /// The number of pixels to add to the right. The default is 0.
4589        pub right_pixels: i32,
4590
4591        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4592    }
4593
4594    impl Pad {
4595        /// Creates a new default instance.
4596        pub fn new() -> Self {
4597            std::default::Default::default()
4598        }
4599
4600        /// Sets the value of [top_pixels][crate::model::preprocessing_config::Pad::top_pixels].
4601        ///
4602        /// # Example
4603        /// ```ignore,no_run
4604        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Pad;
4605        /// let x = Pad::new().set_top_pixels(42);
4606        /// ```
4607        pub fn set_top_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4608            self.top_pixels = v.into();
4609            self
4610        }
4611
4612        /// Sets the value of [bottom_pixels][crate::model::preprocessing_config::Pad::bottom_pixels].
4613        ///
4614        /// # Example
4615        /// ```ignore,no_run
4616        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Pad;
4617        /// let x = Pad::new().set_bottom_pixels(42);
4618        /// ```
4619        pub fn set_bottom_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4620            self.bottom_pixels = v.into();
4621            self
4622        }
4623
4624        /// Sets the value of [left_pixels][crate::model::preprocessing_config::Pad::left_pixels].
4625        ///
4626        /// # Example
4627        /// ```ignore,no_run
4628        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Pad;
4629        /// let x = Pad::new().set_left_pixels(42);
4630        /// ```
4631        pub fn set_left_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4632            self.left_pixels = v.into();
4633            self
4634        }
4635
4636        /// Sets the value of [right_pixels][crate::model::preprocessing_config::Pad::right_pixels].
4637        ///
4638        /// # Example
4639        /// ```ignore,no_run
4640        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Pad;
4641        /// let x = Pad::new().set_right_pixels(42);
4642        /// ```
4643        pub fn set_right_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4644            self.right_pixels = v.into();
4645            self
4646        }
4647    }
4648
4649    impl wkt::message::Message for Pad {
4650        fn typename() -> &'static str {
4651            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Pad"
4652        }
4653    }
4654
4655    /// Deinterlace configuration for input video.
4656    #[derive(Clone, Default, PartialEq)]
4657    #[non_exhaustive]
4658    pub struct Deinterlace {
4659        /// Specify the video deinterlacing filter. The default is `yadif`.
4660        pub deinterlacing_filter: std::option::Option<
4661            crate::model::preprocessing_config::deinterlace::DeinterlacingFilter,
4662        >,
4663
4664        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4665    }
4666
4667    impl Deinterlace {
4668        /// Creates a new default instance.
4669        pub fn new() -> Self {
4670            std::default::Default::default()
4671        }
4672
4673        /// Sets the value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter].
4674        ///
4675        /// Note that all the setters affecting `deinterlacing_filter` are mutually
4676        /// exclusive.
4677        ///
4678        /// # Example
4679        /// ```ignore,no_run
4680        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Deinterlace;
4681        /// use google_cloud_video_transcoder_v1::model::preprocessing_config::deinterlace::YadifConfig;
4682        /// let x = Deinterlace::new().set_deinterlacing_filter(Some(
4683        ///     google_cloud_video_transcoder_v1::model::preprocessing_config::deinterlace::DeinterlacingFilter::Yadif(YadifConfig::default().into())));
4684        /// ```
4685        pub fn set_deinterlacing_filter<
4686            T: std::convert::Into<
4687                    std::option::Option<
4688                        crate::model::preprocessing_config::deinterlace::DeinterlacingFilter,
4689                    >,
4690                >,
4691        >(
4692            mut self,
4693            v: T,
4694        ) -> Self {
4695            self.deinterlacing_filter = v.into();
4696            self
4697        }
4698
4699        /// The value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter]
4700        /// if it holds a `Yadif`, `None` if the field is not set or
4701        /// holds a different branch.
4702        pub fn yadif(
4703            &self,
4704        ) -> std::option::Option<
4705            &std::boxed::Box<crate::model::preprocessing_config::deinterlace::YadifConfig>,
4706        > {
4707            #[allow(unreachable_patterns)]
4708            self.deinterlacing_filter.as_ref().and_then(|v| match v {
4709                crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Yadif(v) => {
4710                    std::option::Option::Some(v)
4711                }
4712                _ => std::option::Option::None,
4713            })
4714        }
4715
4716        /// Sets the value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter]
4717        /// to hold a `Yadif`.
4718        ///
4719        /// Note that all the setters affecting `deinterlacing_filter` are
4720        /// mutually exclusive.
4721        ///
4722        /// # Example
4723        /// ```ignore,no_run
4724        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Deinterlace;
4725        /// use google_cloud_video_transcoder_v1::model::preprocessing_config::deinterlace::YadifConfig;
4726        /// let x = Deinterlace::new().set_yadif(YadifConfig::default()/* use setters */);
4727        /// assert!(x.yadif().is_some());
4728        /// assert!(x.bwdif().is_none());
4729        /// ```
4730        pub fn set_yadif<
4731            T: std::convert::Into<
4732                    std::boxed::Box<crate::model::preprocessing_config::deinterlace::YadifConfig>,
4733                >,
4734        >(
4735            mut self,
4736            v: T,
4737        ) -> Self {
4738            self.deinterlacing_filter = std::option::Option::Some(
4739                crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Yadif(
4740                    v.into(),
4741                ),
4742            );
4743            self
4744        }
4745
4746        /// The value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter]
4747        /// if it holds a `Bwdif`, `None` if the field is not set or
4748        /// holds a different branch.
4749        pub fn bwdif(
4750            &self,
4751        ) -> std::option::Option<
4752            &std::boxed::Box<crate::model::preprocessing_config::deinterlace::BwdifConfig>,
4753        > {
4754            #[allow(unreachable_patterns)]
4755            self.deinterlacing_filter.as_ref().and_then(|v| match v {
4756                crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Bwdif(v) => {
4757                    std::option::Option::Some(v)
4758                }
4759                _ => std::option::Option::None,
4760            })
4761        }
4762
4763        /// Sets the value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter]
4764        /// to hold a `Bwdif`.
4765        ///
4766        /// Note that all the setters affecting `deinterlacing_filter` are
4767        /// mutually exclusive.
4768        ///
4769        /// # Example
4770        /// ```ignore,no_run
4771        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Deinterlace;
4772        /// use google_cloud_video_transcoder_v1::model::preprocessing_config::deinterlace::BwdifConfig;
4773        /// let x = Deinterlace::new().set_bwdif(BwdifConfig::default()/* use setters */);
4774        /// assert!(x.bwdif().is_some());
4775        /// assert!(x.yadif().is_none());
4776        /// ```
4777        pub fn set_bwdif<
4778            T: std::convert::Into<
4779                    std::boxed::Box<crate::model::preprocessing_config::deinterlace::BwdifConfig>,
4780                >,
4781        >(
4782            mut self,
4783            v: T,
4784        ) -> Self {
4785            self.deinterlacing_filter = std::option::Option::Some(
4786                crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Bwdif(
4787                    v.into(),
4788                ),
4789            );
4790            self
4791        }
4792    }
4793
4794    impl wkt::message::Message for Deinterlace {
4795        fn typename() -> &'static str {
4796            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace"
4797        }
4798    }
4799
4800    /// Defines additional types related to [Deinterlace].
4801    pub mod deinterlace {
4802        #[allow(unused_imports)]
4803        use super::*;
4804
4805        /// Yet Another Deinterlacing Filter Configuration.
4806        #[derive(Clone, Default, PartialEq)]
4807        #[non_exhaustive]
4808        pub struct YadifConfig {
4809            /// Specifies the deinterlacing mode to adopt.
4810            /// The default is `send_frame`.
4811            /// Supported values:
4812            ///
4813            /// - `send_frame`: Output one frame for each frame
4814            /// - `send_field`: Output one frame for each field
4815            pub mode: std::string::String,
4816
4817            /// Disable spacial interlacing.
4818            /// The default is `false`.
4819            pub disable_spatial_interlacing: bool,
4820
4821            /// The picture field parity assumed for the input interlaced video.
4822            /// The default is `auto`.
4823            /// Supported values:
4824            ///
4825            /// - `tff`: Assume the top field is first
4826            /// - `bff`: Assume the bottom field is first
4827            /// - `auto`: Enable automatic detection of field parity
4828            pub parity: std::string::String,
4829
4830            /// Deinterlace all frames rather than just the frames identified as
4831            /// interlaced. The default is `false`.
4832            pub deinterlace_all_frames: bool,
4833
4834            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4835        }
4836
4837        impl YadifConfig {
4838            /// Creates a new default instance.
4839            pub fn new() -> Self {
4840                std::default::Default::default()
4841            }
4842
4843            /// Sets the value of [mode][crate::model::preprocessing_config::deinterlace::YadifConfig::mode].
4844            ///
4845            /// # Example
4846            /// ```ignore,no_run
4847            /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::deinterlace::YadifConfig;
4848            /// let x = YadifConfig::new().set_mode("example");
4849            /// ```
4850            pub fn set_mode<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4851                self.mode = v.into();
4852                self
4853            }
4854
4855            /// Sets the value of [disable_spatial_interlacing][crate::model::preprocessing_config::deinterlace::YadifConfig::disable_spatial_interlacing].
4856            ///
4857            /// # Example
4858            /// ```ignore,no_run
4859            /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::deinterlace::YadifConfig;
4860            /// let x = YadifConfig::new().set_disable_spatial_interlacing(true);
4861            /// ```
4862            pub fn set_disable_spatial_interlacing<T: std::convert::Into<bool>>(
4863                mut self,
4864                v: T,
4865            ) -> Self {
4866                self.disable_spatial_interlacing = v.into();
4867                self
4868            }
4869
4870            /// Sets the value of [parity][crate::model::preprocessing_config::deinterlace::YadifConfig::parity].
4871            ///
4872            /// # Example
4873            /// ```ignore,no_run
4874            /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::deinterlace::YadifConfig;
4875            /// let x = YadifConfig::new().set_parity("example");
4876            /// ```
4877            pub fn set_parity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4878                self.parity = v.into();
4879                self
4880            }
4881
4882            /// Sets the value of [deinterlace_all_frames][crate::model::preprocessing_config::deinterlace::YadifConfig::deinterlace_all_frames].
4883            ///
4884            /// # Example
4885            /// ```ignore,no_run
4886            /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::deinterlace::YadifConfig;
4887            /// let x = YadifConfig::new().set_deinterlace_all_frames(true);
4888            /// ```
4889            pub fn set_deinterlace_all_frames<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4890                self.deinterlace_all_frames = v.into();
4891                self
4892            }
4893        }
4894
4895        impl wkt::message::Message for YadifConfig {
4896            fn typename() -> &'static str {
4897                "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace.YadifConfig"
4898            }
4899        }
4900
4901        /// Bob Weaver Deinterlacing Filter Configuration.
4902        #[derive(Clone, Default, PartialEq)]
4903        #[non_exhaustive]
4904        pub struct BwdifConfig {
4905            /// Specifies the deinterlacing mode to adopt.
4906            /// The default is `send_frame`.
4907            /// Supported values:
4908            ///
4909            /// - `send_frame`: Output one frame for each frame
4910            /// - `send_field`: Output one frame for each field
4911            pub mode: std::string::String,
4912
4913            /// The picture field parity assumed for the input interlaced video.
4914            /// The default is `auto`.
4915            /// Supported values:
4916            ///
4917            /// - `tff`: Assume the top field is first
4918            /// - `bff`: Assume the bottom field is first
4919            /// - `auto`: Enable automatic detection of field parity
4920            pub parity: std::string::String,
4921
4922            /// Deinterlace all frames rather than just the frames identified as
4923            /// interlaced. The default is `false`.
4924            pub deinterlace_all_frames: bool,
4925
4926            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4927        }
4928
4929        impl BwdifConfig {
4930            /// Creates a new default instance.
4931            pub fn new() -> Self {
4932                std::default::Default::default()
4933            }
4934
4935            /// Sets the value of [mode][crate::model::preprocessing_config::deinterlace::BwdifConfig::mode].
4936            ///
4937            /// # Example
4938            /// ```ignore,no_run
4939            /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::deinterlace::BwdifConfig;
4940            /// let x = BwdifConfig::new().set_mode("example");
4941            /// ```
4942            pub fn set_mode<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4943                self.mode = v.into();
4944                self
4945            }
4946
4947            /// Sets the value of [parity][crate::model::preprocessing_config::deinterlace::BwdifConfig::parity].
4948            ///
4949            /// # Example
4950            /// ```ignore,no_run
4951            /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::deinterlace::BwdifConfig;
4952            /// let x = BwdifConfig::new().set_parity("example");
4953            /// ```
4954            pub fn set_parity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4955                self.parity = v.into();
4956                self
4957            }
4958
4959            /// Sets the value of [deinterlace_all_frames][crate::model::preprocessing_config::deinterlace::BwdifConfig::deinterlace_all_frames].
4960            ///
4961            /// # Example
4962            /// ```ignore,no_run
4963            /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::deinterlace::BwdifConfig;
4964            /// let x = BwdifConfig::new().set_deinterlace_all_frames(true);
4965            /// ```
4966            pub fn set_deinterlace_all_frames<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4967                self.deinterlace_all_frames = v.into();
4968                self
4969            }
4970        }
4971
4972        impl wkt::message::Message for BwdifConfig {
4973            fn typename() -> &'static str {
4974                "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace.BwdifConfig"
4975            }
4976        }
4977
4978        /// Specify the video deinterlacing filter. The default is `yadif`.
4979        #[derive(Clone, Debug, PartialEq)]
4980        #[non_exhaustive]
4981        pub enum DeinterlacingFilter {
4982            /// Specifies the Yet Another Deinterlacing Filter Configuration.
4983            Yadif(std::boxed::Box<crate::model::preprocessing_config::deinterlace::YadifConfig>),
4984            /// Specifies the Bob Weaver Deinterlacing Filter Configuration.
4985            Bwdif(std::boxed::Box<crate::model::preprocessing_config::deinterlace::BwdifConfig>),
4986        }
4987    }
4988}
4989
4990/// Track definition for the input asset.
4991#[derive(Clone, Default, PartialEq)]
4992#[non_exhaustive]
4993pub struct TrackDefinition {
4994    /// The input track.
4995    pub input_track: std::option::Option<i32>,
4996
4997    /// Optional. A list of languages spoken in the input asset, represented by a
4998    /// BCP 47 language code, such as "en-US" or "sr-Latn". For more information,
4999    /// see <https://www.unicode.org/reports/tr35/#Unicode_locale_identifier>.
5000    pub languages: std::vec::Vec<std::string::String>,
5001
5002    /// Optional. Whether to automatically detect the languages present in the
5003    /// track. If true, the system will attempt to identify all the languages
5004    /// present in the track and populate the languages field.
5005    pub detect_languages: bool,
5006
5007    /// Output only. A list of languages detected in the input asset, represented
5008    /// by a BCP 47 language code, such as "en-US" or "sr-Latn". For more
5009    /// information, see
5010    /// <https://www.unicode.org/reports/tr35/#Unicode_locale_identifier>.
5011    /// This field is only populated if the detect_languages field is set to true.
5012    pub detected_languages: std::vec::Vec<std::string::String>,
5013
5014    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5015}
5016
5017impl TrackDefinition {
5018    /// Creates a new default instance.
5019    pub fn new() -> Self {
5020        std::default::Default::default()
5021    }
5022
5023    /// Sets the value of [input_track][crate::model::TrackDefinition::input_track].
5024    ///
5025    /// # Example
5026    /// ```ignore,no_run
5027    /// # use google_cloud_video_transcoder_v1::model::TrackDefinition;
5028    /// let x = TrackDefinition::new().set_input_track(42);
5029    /// ```
5030    pub fn set_input_track<T>(mut self, v: T) -> Self
5031    where
5032        T: std::convert::Into<i32>,
5033    {
5034        self.input_track = std::option::Option::Some(v.into());
5035        self
5036    }
5037
5038    /// Sets or clears the value of [input_track][crate::model::TrackDefinition::input_track].
5039    ///
5040    /// # Example
5041    /// ```ignore,no_run
5042    /// # use google_cloud_video_transcoder_v1::model::TrackDefinition;
5043    /// let x = TrackDefinition::new().set_or_clear_input_track(Some(42));
5044    /// let x = TrackDefinition::new().set_or_clear_input_track(None::<i32>);
5045    /// ```
5046    pub fn set_or_clear_input_track<T>(mut self, v: std::option::Option<T>) -> Self
5047    where
5048        T: std::convert::Into<i32>,
5049    {
5050        self.input_track = v.map(|x| x.into());
5051        self
5052    }
5053
5054    /// Sets the value of [languages][crate::model::TrackDefinition::languages].
5055    ///
5056    /// # Example
5057    /// ```ignore,no_run
5058    /// # use google_cloud_video_transcoder_v1::model::TrackDefinition;
5059    /// let x = TrackDefinition::new().set_languages(["a", "b", "c"]);
5060    /// ```
5061    pub fn set_languages<T, V>(mut self, v: T) -> Self
5062    where
5063        T: std::iter::IntoIterator<Item = V>,
5064        V: std::convert::Into<std::string::String>,
5065    {
5066        use std::iter::Iterator;
5067        self.languages = v.into_iter().map(|i| i.into()).collect();
5068        self
5069    }
5070
5071    /// Sets the value of [detect_languages][crate::model::TrackDefinition::detect_languages].
5072    ///
5073    /// # Example
5074    /// ```ignore,no_run
5075    /// # use google_cloud_video_transcoder_v1::model::TrackDefinition;
5076    /// let x = TrackDefinition::new().set_detect_languages(true);
5077    /// ```
5078    pub fn set_detect_languages<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5079        self.detect_languages = v.into();
5080        self
5081    }
5082
5083    /// Sets the value of [detected_languages][crate::model::TrackDefinition::detected_languages].
5084    ///
5085    /// # Example
5086    /// ```ignore,no_run
5087    /// # use google_cloud_video_transcoder_v1::model::TrackDefinition;
5088    /// let x = TrackDefinition::new().set_detected_languages(["a", "b", "c"]);
5089    /// ```
5090    pub fn set_detected_languages<T, V>(mut self, v: T) -> Self
5091    where
5092        T: std::iter::IntoIterator<Item = V>,
5093        V: std::convert::Into<std::string::String>,
5094    {
5095        use std::iter::Iterator;
5096        self.detected_languages = v.into_iter().map(|i| i.into()).collect();
5097        self
5098    }
5099}
5100
5101impl wkt::message::Message for TrackDefinition {
5102    fn typename() -> &'static str {
5103        "type.googleapis.com/google.cloud.video.transcoder.v1.TrackDefinition"
5104    }
5105}
5106
5107/// Input attributes that provide additional information about the input asset.
5108#[derive(Clone, Default, PartialEq)]
5109#[non_exhaustive]
5110pub struct InputAttributes {
5111    /// Optional. A list of track definitions for the input asset.
5112    pub track_definitions: std::vec::Vec<crate::model::TrackDefinition>,
5113
5114    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5115}
5116
5117impl InputAttributes {
5118    /// Creates a new default instance.
5119    pub fn new() -> Self {
5120        std::default::Default::default()
5121    }
5122
5123    /// Sets the value of [track_definitions][crate::model::InputAttributes::track_definitions].
5124    ///
5125    /// # Example
5126    /// ```ignore,no_run
5127    /// # use google_cloud_video_transcoder_v1::model::InputAttributes;
5128    /// use google_cloud_video_transcoder_v1::model::TrackDefinition;
5129    /// let x = InputAttributes::new()
5130    ///     .set_track_definitions([
5131    ///         TrackDefinition::default()/* use setters */,
5132    ///         TrackDefinition::default()/* use (different) setters */,
5133    ///     ]);
5134    /// ```
5135    pub fn set_track_definitions<T, V>(mut self, v: T) -> Self
5136    where
5137        T: std::iter::IntoIterator<Item = V>,
5138        V: std::convert::Into<crate::model::TrackDefinition>,
5139    {
5140        use std::iter::Iterator;
5141        self.track_definitions = v.into_iter().map(|i| i.into()).collect();
5142        self
5143    }
5144}
5145
5146impl wkt::message::Message for InputAttributes {
5147    fn typename() -> &'static str {
5148        "type.googleapis.com/google.cloud.video.transcoder.v1.InputAttributes"
5149    }
5150}
5151
5152/// Video stream resource.
5153#[derive(Clone, Default, PartialEq)]
5154#[non_exhaustive]
5155pub struct VideoStream {
5156    /// Codec settings can be h264, h265, or vp9.
5157    pub codec_settings: std::option::Option<crate::model::video_stream::CodecSettings>,
5158
5159    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5160}
5161
5162impl VideoStream {
5163    /// Creates a new default instance.
5164    pub fn new() -> Self {
5165        std::default::Default::default()
5166    }
5167
5168    /// Sets the value of [codec_settings][crate::model::VideoStream::codec_settings].
5169    ///
5170    /// Note that all the setters affecting `codec_settings` are mutually
5171    /// exclusive.
5172    ///
5173    /// # Example
5174    /// ```ignore,no_run
5175    /// # use google_cloud_video_transcoder_v1::model::VideoStream;
5176    /// use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5177    /// let x = VideoStream::new().set_codec_settings(Some(
5178    ///     google_cloud_video_transcoder_v1::model::video_stream::CodecSettings::H264(H264CodecSettings::default().into())));
5179    /// ```
5180    pub fn set_codec_settings<
5181        T: std::convert::Into<std::option::Option<crate::model::video_stream::CodecSettings>>,
5182    >(
5183        mut self,
5184        v: T,
5185    ) -> Self {
5186        self.codec_settings = v.into();
5187        self
5188    }
5189
5190    /// The value of [codec_settings][crate::model::VideoStream::codec_settings]
5191    /// if it holds a `H264`, `None` if the field is not set or
5192    /// holds a different branch.
5193    pub fn h264(
5194        &self,
5195    ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H264CodecSettings>> {
5196        #[allow(unreachable_patterns)]
5197        self.codec_settings.as_ref().and_then(|v| match v {
5198            crate::model::video_stream::CodecSettings::H264(v) => std::option::Option::Some(v),
5199            _ => std::option::Option::None,
5200        })
5201    }
5202
5203    /// Sets the value of [codec_settings][crate::model::VideoStream::codec_settings]
5204    /// to hold a `H264`.
5205    ///
5206    /// Note that all the setters affecting `codec_settings` are
5207    /// mutually exclusive.
5208    ///
5209    /// # Example
5210    /// ```ignore,no_run
5211    /// # use google_cloud_video_transcoder_v1::model::VideoStream;
5212    /// use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5213    /// let x = VideoStream::new().set_h264(H264CodecSettings::default()/* use setters */);
5214    /// assert!(x.h264().is_some());
5215    /// assert!(x.h265().is_none());
5216    /// assert!(x.vp9().is_none());
5217    /// ```
5218    pub fn set_h264<
5219        T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H264CodecSettings>>,
5220    >(
5221        mut self,
5222        v: T,
5223    ) -> Self {
5224        self.codec_settings =
5225            std::option::Option::Some(crate::model::video_stream::CodecSettings::H264(v.into()));
5226        self
5227    }
5228
5229    /// The value of [codec_settings][crate::model::VideoStream::codec_settings]
5230    /// if it holds a `H265`, `None` if the field is not set or
5231    /// holds a different branch.
5232    pub fn h265(
5233        &self,
5234    ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H265CodecSettings>> {
5235        #[allow(unreachable_patterns)]
5236        self.codec_settings.as_ref().and_then(|v| match v {
5237            crate::model::video_stream::CodecSettings::H265(v) => std::option::Option::Some(v),
5238            _ => std::option::Option::None,
5239        })
5240    }
5241
5242    /// Sets the value of [codec_settings][crate::model::VideoStream::codec_settings]
5243    /// to hold a `H265`.
5244    ///
5245    /// Note that all the setters affecting `codec_settings` are
5246    /// mutually exclusive.
5247    ///
5248    /// # Example
5249    /// ```ignore,no_run
5250    /// # use google_cloud_video_transcoder_v1::model::VideoStream;
5251    /// use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
5252    /// let x = VideoStream::new().set_h265(H265CodecSettings::default()/* use setters */);
5253    /// assert!(x.h265().is_some());
5254    /// assert!(x.h264().is_none());
5255    /// assert!(x.vp9().is_none());
5256    /// ```
5257    pub fn set_h265<
5258        T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H265CodecSettings>>,
5259    >(
5260        mut self,
5261        v: T,
5262    ) -> Self {
5263        self.codec_settings =
5264            std::option::Option::Some(crate::model::video_stream::CodecSettings::H265(v.into()));
5265        self
5266    }
5267
5268    /// The value of [codec_settings][crate::model::VideoStream::codec_settings]
5269    /// if it holds a `Vp9`, `None` if the field is not set or
5270    /// holds a different branch.
5271    pub fn vp9(
5272        &self,
5273    ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::Vp9CodecSettings>> {
5274        #[allow(unreachable_patterns)]
5275        self.codec_settings.as_ref().and_then(|v| match v {
5276            crate::model::video_stream::CodecSettings::Vp9(v) => std::option::Option::Some(v),
5277            _ => std::option::Option::None,
5278        })
5279    }
5280
5281    /// Sets the value of [codec_settings][crate::model::VideoStream::codec_settings]
5282    /// to hold a `Vp9`.
5283    ///
5284    /// Note that all the setters affecting `codec_settings` are
5285    /// mutually exclusive.
5286    ///
5287    /// # Example
5288    /// ```ignore,no_run
5289    /// # use google_cloud_video_transcoder_v1::model::VideoStream;
5290    /// use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
5291    /// let x = VideoStream::new().set_vp9(Vp9CodecSettings::default()/* use setters */);
5292    /// assert!(x.vp9().is_some());
5293    /// assert!(x.h264().is_none());
5294    /// assert!(x.h265().is_none());
5295    /// ```
5296    pub fn set_vp9<
5297        T: std::convert::Into<std::boxed::Box<crate::model::video_stream::Vp9CodecSettings>>,
5298    >(
5299        mut self,
5300        v: T,
5301    ) -> Self {
5302        self.codec_settings =
5303            std::option::Option::Some(crate::model::video_stream::CodecSettings::Vp9(v.into()));
5304        self
5305    }
5306}
5307
5308impl wkt::message::Message for VideoStream {
5309    fn typename() -> &'static str {
5310        "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream"
5311    }
5312}
5313
5314/// Defines additional types related to [VideoStream].
5315pub mod video_stream {
5316    #[allow(unused_imports)]
5317    use super::*;
5318
5319    /// Convert the input video to a Standard Dynamic Range (SDR) video.
5320    #[derive(Clone, Default, PartialEq)]
5321    #[non_exhaustive]
5322    pub struct H264ColorFormatSDR {
5323        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5324    }
5325
5326    impl H264ColorFormatSDR {
5327        /// Creates a new default instance.
5328        pub fn new() -> Self {
5329            std::default::Default::default()
5330        }
5331    }
5332
5333    impl wkt::message::Message for H264ColorFormatSDR {
5334        fn typename() -> &'static str {
5335            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H264ColorFormatSDR"
5336        }
5337    }
5338
5339    /// Convert the input video to a Hybrid Log Gamma (HLG) video.
5340    #[derive(Clone, Default, PartialEq)]
5341    #[non_exhaustive]
5342    pub struct H264ColorFormatHLG {
5343        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5344    }
5345
5346    impl H264ColorFormatHLG {
5347        /// Creates a new default instance.
5348        pub fn new() -> Self {
5349            std::default::Default::default()
5350        }
5351    }
5352
5353    impl wkt::message::Message for H264ColorFormatHLG {
5354        fn typename() -> &'static str {
5355            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H264ColorFormatHLG"
5356        }
5357    }
5358
5359    /// H264 codec settings.
5360    #[derive(Clone, Default, PartialEq)]
5361    #[non_exhaustive]
5362    pub struct H264CodecSettings {
5363        /// The width of the video in pixels. Must be an even integer.
5364        /// When not specified, the width is adjusted to match the specified height
5365        /// and input aspect ratio. If both are omitted, the input width is used.
5366        ///
5367        /// For portrait videos that contain horizontal ASR and rotation metadata,
5368        /// provide the width, in pixels, per the horizontal ASR. The API calculates
5369        /// the height per the horizontal ASR. The API detects any rotation metadata
5370        /// and swaps the requested height and width for the output.
5371        pub width_pixels: i32,
5372
5373        /// The height of the video in pixels. Must be an even integer.
5374        /// When not specified, the height is adjusted to match the specified width
5375        /// and input aspect ratio. If both are omitted, the input height is used.
5376        ///
5377        /// For portrait videos that contain horizontal ASR and rotation metadata,
5378        /// provide the height, in pixels, per the horizontal ASR. The API calculates
5379        /// the width per the horizontal ASR. The API detects any rotation metadata
5380        /// and swaps the requested height and width for the output.
5381        pub height_pixels: i32,
5382
5383        /// Required. The target video frame rate in frames per second (FPS). Must be
5384        /// less than or equal to 120.
5385        pub frame_rate: f64,
5386
5387        /// Optional. Frame rate conversion strategy for desired frame rate. The
5388        /// default is `DOWNSAMPLE`.
5389        pub frame_rate_conversion_strategy: crate::model::video_stream::FrameRateConversionStrategy,
5390
5391        /// Required. The video bitrate in bits per second. The minimum value is
5392        /// 1,000. The maximum value is 800,000,000.
5393        pub bitrate_bps: i32,
5394
5395        /// Pixel format to use. The default is `yuv420p`.
5396        ///
5397        /// Supported pixel formats:
5398        ///
5399        /// - `yuv420p` pixel format
5400        /// - `yuv422p` pixel format
5401        /// - `yuv444p` pixel format
5402        /// - `yuv420p10` 10-bit HDR pixel format
5403        /// - `yuv422p10` 10-bit HDR pixel format
5404        /// - `yuv444p10` 10-bit HDR pixel format
5405        /// - `yuv420p12` 12-bit HDR pixel format
5406        /// - `yuv422p12` 12-bit HDR pixel format
5407        /// - `yuv444p12` 12-bit HDR pixel format
5408        pub pixel_format: std::string::String,
5409
5410        /// Specify the mode. The default is `vbr`.
5411        ///
5412        /// Supported rate control modes:
5413        ///
5414        /// - `vbr` - variable bitrate
5415        /// - `crf` - constant rate factor
5416        pub rate_control_mode: std::string::String,
5417
5418        /// Target CRF level. Must be between 10 and 36, where 10 is the highest
5419        /// quality and 36 is the most efficient compression. The default is 21.
5420        pub crf_level: i32,
5421
5422        /// Specifies whether an open Group of Pictures (GOP) structure should be
5423        /// allowed or not. The default is `false`.
5424        pub allow_open_gop: bool,
5425
5426        /// Use two-pass encoding strategy to achieve better video quality.
5427        /// [H264CodecSettings.rate_control_mode][google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.rate_control_mode]
5428        /// must be `vbr`. The default is `false`.
5429        ///
5430        /// [google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.rate_control_mode]: crate::model::video_stream::H264CodecSettings::rate_control_mode
5431        pub enable_two_pass: bool,
5432
5433        /// Size of the Video Buffering Verifier (VBV) buffer in bits. Must be
5434        /// greater than zero. The default is equal to
5435        /// [H264CodecSettings.bitrate_bps][google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.bitrate_bps].
5436        ///
5437        /// [google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.bitrate_bps]: crate::model::video_stream::H264CodecSettings::bitrate_bps
5438        pub vbv_size_bits: i32,
5439
5440        /// Initial fullness of the Video Buffering Verifier (VBV) buffer in bits.
5441        /// Must be greater than zero. The default is equal to 90% of
5442        /// [H264CodecSettings.vbv_size_bits][google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.vbv_size_bits].
5443        ///
5444        /// [google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.vbv_size_bits]: crate::model::video_stream::H264CodecSettings::vbv_size_bits
5445        pub vbv_fullness_bits: i32,
5446
5447        /// The entropy coder to use. The default is `cabac`.
5448        ///
5449        /// Supported entropy coders:
5450        ///
5451        /// - `cavlc`
5452        /// - `cabac`
5453        pub entropy_coder: std::string::String,
5454
5455        /// Allow B-pyramid for reference frame selection. This may not be supported
5456        /// on all decoders. The default is `false`.
5457        pub b_pyramid: bool,
5458
5459        /// The number of consecutive B-frames. Must be greater than or equal to
5460        /// zero. Must be less than
5461        /// [H264CodecSettings.gop_frame_count][google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.gop_frame_count]
5462        /// if set. The default is 0.
5463        ///
5464        /// [google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.gop_frame_count]: crate::model::video_stream::H264CodecSettings::gop_mode
5465        pub b_frame_count: i32,
5466
5467        /// Specify the intensity of the adaptive quantizer (AQ). Must be between 0
5468        /// and 1, where 0 disables the quantizer and 1 maximizes the quantizer. A
5469        /// higher value equals a lower bitrate but smoother image. The default is 0.
5470        pub aq_strength: f64,
5471
5472        /// Enforces the specified codec profile. The following profiles are
5473        /// supported:
5474        ///
5475        /// * `baseline`
5476        /// * `main`
5477        /// * `high` (default)
5478        ///
5479        /// The available options are
5480        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.264#Tune).
5481        /// Note that certain values for this field may cause the
5482        /// transcoder to override other fields you set in the `H264CodecSettings`
5483        /// message.
5484        pub profile: std::string::String,
5485
5486        /// Enforces the specified codec tune. The available options are
5487        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.264#Tune).
5488        /// Note that certain values for this field may cause the
5489        /// transcoder to override other fields you set in the `H264CodecSettings`
5490        /// message.
5491        pub tune: std::string::String,
5492
5493        /// Enforces the specified codec preset. The default is `veryfast`. The
5494        /// available options are
5495        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.264#Preset).
5496        /// Note that certain values for this field may cause the
5497        /// transcoder to override other fields you set in the `H264CodecSettings`
5498        /// message.
5499        pub preset: std::string::String,
5500
5501        /// GOP mode can be either by frame count or duration.
5502        pub gop_mode:
5503            std::option::Option<crate::model::video_stream::h_264_codec_settings::GopMode>,
5504
5505        /// Color format can be sdr or hlg.
5506        pub color_format:
5507            std::option::Option<crate::model::video_stream::h_264_codec_settings::ColorFormat>,
5508
5509        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5510    }
5511
5512    impl H264CodecSettings {
5513        /// Creates a new default instance.
5514        pub fn new() -> Self {
5515            std::default::Default::default()
5516        }
5517
5518        /// Sets the value of [width_pixels][crate::model::video_stream::H264CodecSettings::width_pixels].
5519        ///
5520        /// # Example
5521        /// ```ignore,no_run
5522        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5523        /// let x = H264CodecSettings::new().set_width_pixels(42);
5524        /// ```
5525        pub fn set_width_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5526            self.width_pixels = v.into();
5527            self
5528        }
5529
5530        /// Sets the value of [height_pixels][crate::model::video_stream::H264CodecSettings::height_pixels].
5531        ///
5532        /// # Example
5533        /// ```ignore,no_run
5534        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5535        /// let x = H264CodecSettings::new().set_height_pixels(42);
5536        /// ```
5537        pub fn set_height_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5538            self.height_pixels = v.into();
5539            self
5540        }
5541
5542        /// Sets the value of [frame_rate][crate::model::video_stream::H264CodecSettings::frame_rate].
5543        ///
5544        /// # Example
5545        /// ```ignore,no_run
5546        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5547        /// let x = H264CodecSettings::new().set_frame_rate(42.0);
5548        /// ```
5549        pub fn set_frame_rate<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
5550            self.frame_rate = v.into();
5551            self
5552        }
5553
5554        /// Sets the value of [frame_rate_conversion_strategy][crate::model::video_stream::H264CodecSettings::frame_rate_conversion_strategy].
5555        ///
5556        /// # Example
5557        /// ```ignore,no_run
5558        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5559        /// use google_cloud_video_transcoder_v1::model::video_stream::FrameRateConversionStrategy;
5560        /// let x0 = H264CodecSettings::new().set_frame_rate_conversion_strategy(FrameRateConversionStrategy::Downsample);
5561        /// let x1 = H264CodecSettings::new().set_frame_rate_conversion_strategy(FrameRateConversionStrategy::DropDuplicate);
5562        /// ```
5563        pub fn set_frame_rate_conversion_strategy<
5564            T: std::convert::Into<crate::model::video_stream::FrameRateConversionStrategy>,
5565        >(
5566            mut self,
5567            v: T,
5568        ) -> Self {
5569            self.frame_rate_conversion_strategy = v.into();
5570            self
5571        }
5572
5573        /// Sets the value of [bitrate_bps][crate::model::video_stream::H264CodecSettings::bitrate_bps].
5574        ///
5575        /// # Example
5576        /// ```ignore,no_run
5577        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5578        /// let x = H264CodecSettings::new().set_bitrate_bps(42);
5579        /// ```
5580        pub fn set_bitrate_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5581            self.bitrate_bps = v.into();
5582            self
5583        }
5584
5585        /// Sets the value of [pixel_format][crate::model::video_stream::H264CodecSettings::pixel_format].
5586        ///
5587        /// # Example
5588        /// ```ignore,no_run
5589        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5590        /// let x = H264CodecSettings::new().set_pixel_format("example");
5591        /// ```
5592        pub fn set_pixel_format<T: std::convert::Into<std::string::String>>(
5593            mut self,
5594            v: T,
5595        ) -> Self {
5596            self.pixel_format = v.into();
5597            self
5598        }
5599
5600        /// Sets the value of [rate_control_mode][crate::model::video_stream::H264CodecSettings::rate_control_mode].
5601        ///
5602        /// # Example
5603        /// ```ignore,no_run
5604        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5605        /// let x = H264CodecSettings::new().set_rate_control_mode("example");
5606        /// ```
5607        pub fn set_rate_control_mode<T: std::convert::Into<std::string::String>>(
5608            mut self,
5609            v: T,
5610        ) -> Self {
5611            self.rate_control_mode = v.into();
5612            self
5613        }
5614
5615        /// Sets the value of [crf_level][crate::model::video_stream::H264CodecSettings::crf_level].
5616        ///
5617        /// # Example
5618        /// ```ignore,no_run
5619        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5620        /// let x = H264CodecSettings::new().set_crf_level(42);
5621        /// ```
5622        pub fn set_crf_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5623            self.crf_level = v.into();
5624            self
5625        }
5626
5627        /// Sets the value of [allow_open_gop][crate::model::video_stream::H264CodecSettings::allow_open_gop].
5628        ///
5629        /// # Example
5630        /// ```ignore,no_run
5631        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5632        /// let x = H264CodecSettings::new().set_allow_open_gop(true);
5633        /// ```
5634        pub fn set_allow_open_gop<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5635            self.allow_open_gop = v.into();
5636            self
5637        }
5638
5639        /// Sets the value of [enable_two_pass][crate::model::video_stream::H264CodecSettings::enable_two_pass].
5640        ///
5641        /// # Example
5642        /// ```ignore,no_run
5643        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5644        /// let x = H264CodecSettings::new().set_enable_two_pass(true);
5645        /// ```
5646        pub fn set_enable_two_pass<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5647            self.enable_two_pass = v.into();
5648            self
5649        }
5650
5651        /// Sets the value of [vbv_size_bits][crate::model::video_stream::H264CodecSettings::vbv_size_bits].
5652        ///
5653        /// # Example
5654        /// ```ignore,no_run
5655        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5656        /// let x = H264CodecSettings::new().set_vbv_size_bits(42);
5657        /// ```
5658        pub fn set_vbv_size_bits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5659            self.vbv_size_bits = v.into();
5660            self
5661        }
5662
5663        /// Sets the value of [vbv_fullness_bits][crate::model::video_stream::H264CodecSettings::vbv_fullness_bits].
5664        ///
5665        /// # Example
5666        /// ```ignore,no_run
5667        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5668        /// let x = H264CodecSettings::new().set_vbv_fullness_bits(42);
5669        /// ```
5670        pub fn set_vbv_fullness_bits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5671            self.vbv_fullness_bits = v.into();
5672            self
5673        }
5674
5675        /// Sets the value of [entropy_coder][crate::model::video_stream::H264CodecSettings::entropy_coder].
5676        ///
5677        /// # Example
5678        /// ```ignore,no_run
5679        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5680        /// let x = H264CodecSettings::new().set_entropy_coder("example");
5681        /// ```
5682        pub fn set_entropy_coder<T: std::convert::Into<std::string::String>>(
5683            mut self,
5684            v: T,
5685        ) -> Self {
5686            self.entropy_coder = v.into();
5687            self
5688        }
5689
5690        /// Sets the value of [b_pyramid][crate::model::video_stream::H264CodecSettings::b_pyramid].
5691        ///
5692        /// # Example
5693        /// ```ignore,no_run
5694        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5695        /// let x = H264CodecSettings::new().set_b_pyramid(true);
5696        /// ```
5697        pub fn set_b_pyramid<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5698            self.b_pyramid = v.into();
5699            self
5700        }
5701
5702        /// Sets the value of [b_frame_count][crate::model::video_stream::H264CodecSettings::b_frame_count].
5703        ///
5704        /// # Example
5705        /// ```ignore,no_run
5706        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5707        /// let x = H264CodecSettings::new().set_b_frame_count(42);
5708        /// ```
5709        pub fn set_b_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5710            self.b_frame_count = v.into();
5711            self
5712        }
5713
5714        /// Sets the value of [aq_strength][crate::model::video_stream::H264CodecSettings::aq_strength].
5715        ///
5716        /// # Example
5717        /// ```ignore,no_run
5718        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5719        /// let x = H264CodecSettings::new().set_aq_strength(42.0);
5720        /// ```
5721        pub fn set_aq_strength<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
5722            self.aq_strength = v.into();
5723            self
5724        }
5725
5726        /// Sets the value of [profile][crate::model::video_stream::H264CodecSettings::profile].
5727        ///
5728        /// # Example
5729        /// ```ignore,no_run
5730        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5731        /// let x = H264CodecSettings::new().set_profile("example");
5732        /// ```
5733        pub fn set_profile<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5734            self.profile = v.into();
5735            self
5736        }
5737
5738        /// Sets the value of [tune][crate::model::video_stream::H264CodecSettings::tune].
5739        ///
5740        /// # Example
5741        /// ```ignore,no_run
5742        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5743        /// let x = H264CodecSettings::new().set_tune("example");
5744        /// ```
5745        pub fn set_tune<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5746            self.tune = v.into();
5747            self
5748        }
5749
5750        /// Sets the value of [preset][crate::model::video_stream::H264CodecSettings::preset].
5751        ///
5752        /// # Example
5753        /// ```ignore,no_run
5754        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5755        /// let x = H264CodecSettings::new().set_preset("example");
5756        /// ```
5757        pub fn set_preset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5758            self.preset = v.into();
5759            self
5760        }
5761
5762        /// Sets the value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode].
5763        ///
5764        /// Note that all the setters affecting `gop_mode` are mutually
5765        /// exclusive.
5766        ///
5767        /// # Example
5768        /// ```ignore,no_run
5769        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5770        /// use google_cloud_video_transcoder_v1::model::video_stream::h_264_codec_settings::GopMode;
5771        /// let x = H264CodecSettings::new().set_gop_mode(Some(GopMode::GopFrameCount(42)));
5772        /// ```
5773        pub fn set_gop_mode<
5774            T: std::convert::Into<
5775                    std::option::Option<crate::model::video_stream::h_264_codec_settings::GopMode>,
5776                >,
5777        >(
5778            mut self,
5779            v: T,
5780        ) -> Self {
5781            self.gop_mode = v.into();
5782            self
5783        }
5784
5785        /// The value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode]
5786        /// if it holds a `GopFrameCount`, `None` if the field is not set or
5787        /// holds a different branch.
5788        pub fn gop_frame_count(&self) -> std::option::Option<&i32> {
5789            #[allow(unreachable_patterns)]
5790            self.gop_mode.as_ref().and_then(|v| match v {
5791                crate::model::video_stream::h_264_codec_settings::GopMode::GopFrameCount(v) => {
5792                    std::option::Option::Some(v)
5793                }
5794                _ => std::option::Option::None,
5795            })
5796        }
5797
5798        /// Sets the value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode]
5799        /// to hold a `GopFrameCount`.
5800        ///
5801        /// Note that all the setters affecting `gop_mode` are
5802        /// mutually exclusive.
5803        ///
5804        /// # Example
5805        /// ```ignore,no_run
5806        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5807        /// let x = H264CodecSettings::new().set_gop_frame_count(42);
5808        /// assert!(x.gop_frame_count().is_some());
5809        /// assert!(x.gop_duration().is_none());
5810        /// ```
5811        pub fn set_gop_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5812            self.gop_mode = std::option::Option::Some(
5813                crate::model::video_stream::h_264_codec_settings::GopMode::GopFrameCount(v.into()),
5814            );
5815            self
5816        }
5817
5818        /// The value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode]
5819        /// if it holds a `GopDuration`, `None` if the field is not set or
5820        /// holds a different branch.
5821        pub fn gop_duration(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
5822            #[allow(unreachable_patterns)]
5823            self.gop_mode.as_ref().and_then(|v| match v {
5824                crate::model::video_stream::h_264_codec_settings::GopMode::GopDuration(v) => {
5825                    std::option::Option::Some(v)
5826                }
5827                _ => std::option::Option::None,
5828            })
5829        }
5830
5831        /// Sets the value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode]
5832        /// to hold a `GopDuration`.
5833        ///
5834        /// Note that all the setters affecting `gop_mode` are
5835        /// mutually exclusive.
5836        ///
5837        /// # Example
5838        /// ```ignore,no_run
5839        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5840        /// use wkt::Duration;
5841        /// let x = H264CodecSettings::new().set_gop_duration(Duration::default()/* use setters */);
5842        /// assert!(x.gop_duration().is_some());
5843        /// assert!(x.gop_frame_count().is_none());
5844        /// ```
5845        pub fn set_gop_duration<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
5846            mut self,
5847            v: T,
5848        ) -> Self {
5849            self.gop_mode = std::option::Option::Some(
5850                crate::model::video_stream::h_264_codec_settings::GopMode::GopDuration(v.into()),
5851            );
5852            self
5853        }
5854
5855        /// Sets the value of [color_format][crate::model::video_stream::H264CodecSettings::color_format].
5856        ///
5857        /// Note that all the setters affecting `color_format` are mutually
5858        /// exclusive.
5859        ///
5860        /// # Example
5861        /// ```ignore,no_run
5862        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5863        /// use google_cloud_video_transcoder_v1::model::video_stream::H264ColorFormatSDR;
5864        /// let x = H264CodecSettings::new().set_color_format(Some(
5865        ///     google_cloud_video_transcoder_v1::model::video_stream::h_264_codec_settings::ColorFormat::Sdr(H264ColorFormatSDR::default().into())));
5866        /// ```
5867        pub fn set_color_format<
5868            T: std::convert::Into<
5869                    std::option::Option<
5870                        crate::model::video_stream::h_264_codec_settings::ColorFormat,
5871                    >,
5872                >,
5873        >(
5874            mut self,
5875            v: T,
5876        ) -> Self {
5877            self.color_format = v.into();
5878            self
5879        }
5880
5881        /// The value of [color_format][crate::model::video_stream::H264CodecSettings::color_format]
5882        /// if it holds a `Sdr`, `None` if the field is not set or
5883        /// holds a different branch.
5884        pub fn sdr(
5885            &self,
5886        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H264ColorFormatSDR>>
5887        {
5888            #[allow(unreachable_patterns)]
5889            self.color_format.as_ref().and_then(|v| match v {
5890                crate::model::video_stream::h_264_codec_settings::ColorFormat::Sdr(v) => {
5891                    std::option::Option::Some(v)
5892                }
5893                _ => std::option::Option::None,
5894            })
5895        }
5896
5897        /// Sets the value of [color_format][crate::model::video_stream::H264CodecSettings::color_format]
5898        /// to hold a `Sdr`.
5899        ///
5900        /// Note that all the setters affecting `color_format` are
5901        /// mutually exclusive.
5902        ///
5903        /// # Example
5904        /// ```ignore,no_run
5905        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5906        /// use google_cloud_video_transcoder_v1::model::video_stream::H264ColorFormatSDR;
5907        /// let x = H264CodecSettings::new().set_sdr(H264ColorFormatSDR::default()/* use setters */);
5908        /// assert!(x.sdr().is_some());
5909        /// assert!(x.hlg().is_none());
5910        /// ```
5911        pub fn set_sdr<
5912            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H264ColorFormatSDR>>,
5913        >(
5914            mut self,
5915            v: T,
5916        ) -> Self {
5917            self.color_format = std::option::Option::Some(
5918                crate::model::video_stream::h_264_codec_settings::ColorFormat::Sdr(v.into()),
5919            );
5920            self
5921        }
5922
5923        /// The value of [color_format][crate::model::video_stream::H264CodecSettings::color_format]
5924        /// if it holds a `Hlg`, `None` if the field is not set or
5925        /// holds a different branch.
5926        pub fn hlg(
5927            &self,
5928        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H264ColorFormatHLG>>
5929        {
5930            #[allow(unreachable_patterns)]
5931            self.color_format.as_ref().and_then(|v| match v {
5932                crate::model::video_stream::h_264_codec_settings::ColorFormat::Hlg(v) => {
5933                    std::option::Option::Some(v)
5934                }
5935                _ => std::option::Option::None,
5936            })
5937        }
5938
5939        /// Sets the value of [color_format][crate::model::video_stream::H264CodecSettings::color_format]
5940        /// to hold a `Hlg`.
5941        ///
5942        /// Note that all the setters affecting `color_format` are
5943        /// mutually exclusive.
5944        ///
5945        /// # Example
5946        /// ```ignore,no_run
5947        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5948        /// use google_cloud_video_transcoder_v1::model::video_stream::H264ColorFormatHLG;
5949        /// let x = H264CodecSettings::new().set_hlg(H264ColorFormatHLG::default()/* use setters */);
5950        /// assert!(x.hlg().is_some());
5951        /// assert!(x.sdr().is_none());
5952        /// ```
5953        pub fn set_hlg<
5954            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H264ColorFormatHLG>>,
5955        >(
5956            mut self,
5957            v: T,
5958        ) -> Self {
5959            self.color_format = std::option::Option::Some(
5960                crate::model::video_stream::h_264_codec_settings::ColorFormat::Hlg(v.into()),
5961            );
5962            self
5963        }
5964    }
5965
5966    impl wkt::message::Message for H264CodecSettings {
5967        fn typename() -> &'static str {
5968            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings"
5969        }
5970    }
5971
5972    /// Defines additional types related to [H264CodecSettings].
5973    pub mod h_264_codec_settings {
5974        #[allow(unused_imports)]
5975        use super::*;
5976
5977        /// GOP mode can be either by frame count or duration.
5978        #[derive(Clone, Debug, PartialEq)]
5979        #[non_exhaustive]
5980        pub enum GopMode {
5981            /// Select the GOP size based on the specified frame count. Must be greater
5982            /// than zero.
5983            GopFrameCount(i32),
5984            /// Select the GOP size based on the specified duration. The default is
5985            /// `3s`. Note that `gopDuration` must be less than or equal to
5986            /// [`segmentDuration`](#SegmentSettings), and
5987            /// [`segmentDuration`](#SegmentSettings) must be divisible by
5988            /// `gopDuration`.
5989            GopDuration(std::boxed::Box<wkt::Duration>),
5990        }
5991
5992        /// Color format can be sdr or hlg.
5993        #[derive(Clone, Debug, PartialEq)]
5994        #[non_exhaustive]
5995        pub enum ColorFormat {
5996            /// Optional. SDR color format setting for H264.
5997            Sdr(std::boxed::Box<crate::model::video_stream::H264ColorFormatSDR>),
5998            /// Optional. HLG color format setting for H264.
5999            Hlg(std::boxed::Box<crate::model::video_stream::H264ColorFormatHLG>),
6000        }
6001    }
6002
6003    /// Convert the input video to a Standard Dynamic Range (SDR) video.
6004    #[derive(Clone, Default, PartialEq)]
6005    #[non_exhaustive]
6006    pub struct H265ColorFormatSDR {
6007        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6008    }
6009
6010    impl H265ColorFormatSDR {
6011        /// Creates a new default instance.
6012        pub fn new() -> Self {
6013            std::default::Default::default()
6014        }
6015    }
6016
6017    impl wkt::message::Message for H265ColorFormatSDR {
6018        fn typename() -> &'static str {
6019            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H265ColorFormatSDR"
6020        }
6021    }
6022
6023    /// Convert the input video to a Hybrid Log Gamma (HLG) video.
6024    #[derive(Clone, Default, PartialEq)]
6025    #[non_exhaustive]
6026    pub struct H265ColorFormatHLG {
6027        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6028    }
6029
6030    impl H265ColorFormatHLG {
6031        /// Creates a new default instance.
6032        pub fn new() -> Self {
6033            std::default::Default::default()
6034        }
6035    }
6036
6037    impl wkt::message::Message for H265ColorFormatHLG {
6038        fn typename() -> &'static str {
6039            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H265ColorFormatHLG"
6040        }
6041    }
6042
6043    /// Convert the input video to a High Dynamic Range 10 (HDR10) video.
6044    #[derive(Clone, Default, PartialEq)]
6045    #[non_exhaustive]
6046    pub struct H265ColorFormatHDR10 {
6047        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6048    }
6049
6050    impl H265ColorFormatHDR10 {
6051        /// Creates a new default instance.
6052        pub fn new() -> Self {
6053            std::default::Default::default()
6054        }
6055    }
6056
6057    impl wkt::message::Message for H265ColorFormatHDR10 {
6058        fn typename() -> &'static str {
6059            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H265ColorFormatHDR10"
6060        }
6061    }
6062
6063    /// H265 codec settings.
6064    #[derive(Clone, Default, PartialEq)]
6065    #[non_exhaustive]
6066    pub struct H265CodecSettings {
6067        /// The width of the video in pixels. Must be an even integer.
6068        /// When not specified, the width is adjusted to match the specified height
6069        /// and input aspect ratio. If both are omitted, the input width is used.
6070        ///
6071        /// For portrait videos that contain horizontal ASR and rotation metadata,
6072        /// provide the width, in pixels, per the horizontal ASR. The API calculates
6073        /// the height per the horizontal ASR. The API detects any rotation metadata
6074        /// and swaps the requested height and width for the output.
6075        pub width_pixels: i32,
6076
6077        /// The height of the video in pixels. Must be an even integer.
6078        /// When not specified, the height is adjusted to match the specified width
6079        /// and input aspect ratio. If both are omitted, the input height is used.
6080        ///
6081        /// For portrait videos that contain horizontal ASR and rotation metadata,
6082        /// provide the height, in pixels, per the horizontal ASR. The API calculates
6083        /// the width per the horizontal ASR. The API detects any rotation metadata
6084        /// and swaps the requested height and width for the output.
6085        pub height_pixels: i32,
6086
6087        /// Required. The target video frame rate in frames per second (FPS). Must be
6088        /// less than or equal to 120.
6089        pub frame_rate: f64,
6090
6091        /// Optional. Frame rate conversion strategy for desired frame rate. The
6092        /// default is `DOWNSAMPLE`.
6093        pub frame_rate_conversion_strategy: crate::model::video_stream::FrameRateConversionStrategy,
6094
6095        /// Required. The video bitrate in bits per second. The minimum value is
6096        /// 1,000. The maximum value is 800,000,000.
6097        pub bitrate_bps: i32,
6098
6099        /// Pixel format to use. The default is `yuv420p`.
6100        ///
6101        /// Supported pixel formats:
6102        ///
6103        /// - `yuv420p` pixel format
6104        /// - `yuv422p` pixel format
6105        /// - `yuv444p` pixel format
6106        /// - `yuv420p10` 10-bit HDR pixel format
6107        /// - `yuv422p10` 10-bit HDR pixel format
6108        /// - `yuv444p10` 10-bit HDR pixel format
6109        /// - `yuv420p12` 12-bit HDR pixel format
6110        /// - `yuv422p12` 12-bit HDR pixel format
6111        /// - `yuv444p12` 12-bit HDR pixel format
6112        pub pixel_format: std::string::String,
6113
6114        /// Specify the mode. The default is `vbr`.
6115        ///
6116        /// Supported rate control modes:
6117        ///
6118        /// - `vbr` - variable bitrate
6119        /// - `crf` - constant rate factor
6120        pub rate_control_mode: std::string::String,
6121
6122        /// Target CRF level. Must be between 10 and 36, where 10 is the highest
6123        /// quality and 36 is the most efficient compression. The default is 21.
6124        pub crf_level: i32,
6125
6126        /// Specifies whether an open Group of Pictures (GOP) structure should be
6127        /// allowed or not. The default is `false`.
6128        pub allow_open_gop: bool,
6129
6130        /// Use two-pass encoding strategy to achieve better video quality.
6131        /// [H265CodecSettings.rate_control_mode][google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.rate_control_mode]
6132        /// must be `vbr`. The default is `false`.
6133        ///
6134        /// [google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.rate_control_mode]: crate::model::video_stream::H265CodecSettings::rate_control_mode
6135        pub enable_two_pass: bool,
6136
6137        /// Size of the Video Buffering Verifier (VBV) buffer in bits. Must be
6138        /// greater than zero. The default is equal to `VideoStream.bitrate_bps`.
6139        pub vbv_size_bits: i32,
6140
6141        /// Initial fullness of the Video Buffering Verifier (VBV) buffer in bits.
6142        /// Must be greater than zero. The default is equal to 90% of
6143        /// [H265CodecSettings.vbv_size_bits][google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.vbv_size_bits].
6144        ///
6145        /// [google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.vbv_size_bits]: crate::model::video_stream::H265CodecSettings::vbv_size_bits
6146        pub vbv_fullness_bits: i32,
6147
6148        /// Allow B-pyramid for reference frame selection. This may not be supported
6149        /// on all decoders. The default is `false`.
6150        pub b_pyramid: bool,
6151
6152        /// The number of consecutive B-frames. Must be greater than or equal to
6153        /// zero. Must be less than
6154        /// [H265CodecSettings.gop_frame_count][google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.gop_frame_count]
6155        /// if set. The default is 0.
6156        ///
6157        /// [google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.gop_frame_count]: crate::model::video_stream::H265CodecSettings::gop_mode
6158        pub b_frame_count: i32,
6159
6160        /// Specify the intensity of the adaptive quantizer (AQ). Must be between 0
6161        /// and 1, where 0 disables the quantizer and 1 maximizes the quantizer. A
6162        /// higher value equals a lower bitrate but smoother image. The default is 0.
6163        pub aq_strength: f64,
6164
6165        /// Enforces the specified codec profile. The following profiles are
6166        /// supported:
6167        ///
6168        /// * 8-bit profiles
6169        ///   * `main` (default)
6170        ///   * `main-intra`
6171        ///   * `mainstillpicture`
6172        /// * 10-bit profiles
6173        ///   * `main10` (default)
6174        ///   * `main10-intra`
6175        ///   * `main422-10`
6176        ///   * `main422-10-intra`
6177        ///   * `main444-10`
6178        ///   * `main444-10-intra`
6179        /// * 12-bit profiles
6180        ///   * `main12` (default)
6181        ///   * `main12-intra`
6182        ///   * `main422-12`
6183        ///   * `main422-12-intra`
6184        ///   * `main444-12`
6185        ///   * `main444-12-intra`
6186        ///
6187        /// The available options are
6188        /// [FFmpeg-compatible](https://x265.readthedocs.io/).
6189        /// Note that certain values for this field may cause the
6190        /// transcoder to override other fields you set in the `H265CodecSettings`
6191        /// message.
6192        pub profile: std::string::String,
6193
6194        /// Enforces the specified codec tune. The available options are
6195        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.265).
6196        /// Note that certain values for this field may cause the
6197        /// transcoder to override other fields you set in the `H265CodecSettings`
6198        /// message.
6199        pub tune: std::string::String,
6200
6201        /// Enforces the specified codec preset. The default is `veryfast`. The
6202        /// available options are
6203        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.265).
6204        /// Note that certain values for this field may cause the
6205        /// transcoder to override other fields you set in the `H265CodecSettings`
6206        /// message.
6207        pub preset: std::string::String,
6208
6209        /// GOP mode can be either by frame count or duration.
6210        pub gop_mode:
6211            std::option::Option<crate::model::video_stream::h_265_codec_settings::GopMode>,
6212
6213        /// Color format can be sdr, hlg, hdr10.
6214        pub color_format:
6215            std::option::Option<crate::model::video_stream::h_265_codec_settings::ColorFormat>,
6216
6217        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6218    }
6219
6220    impl H265CodecSettings {
6221        /// Creates a new default instance.
6222        pub fn new() -> Self {
6223            std::default::Default::default()
6224        }
6225
6226        /// Sets the value of [width_pixels][crate::model::video_stream::H265CodecSettings::width_pixels].
6227        ///
6228        /// # Example
6229        /// ```ignore,no_run
6230        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6231        /// let x = H265CodecSettings::new().set_width_pixels(42);
6232        /// ```
6233        pub fn set_width_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6234            self.width_pixels = v.into();
6235            self
6236        }
6237
6238        /// Sets the value of [height_pixels][crate::model::video_stream::H265CodecSettings::height_pixels].
6239        ///
6240        /// # Example
6241        /// ```ignore,no_run
6242        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6243        /// let x = H265CodecSettings::new().set_height_pixels(42);
6244        /// ```
6245        pub fn set_height_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6246            self.height_pixels = v.into();
6247            self
6248        }
6249
6250        /// Sets the value of [frame_rate][crate::model::video_stream::H265CodecSettings::frame_rate].
6251        ///
6252        /// # Example
6253        /// ```ignore,no_run
6254        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6255        /// let x = H265CodecSettings::new().set_frame_rate(42.0);
6256        /// ```
6257        pub fn set_frame_rate<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
6258            self.frame_rate = v.into();
6259            self
6260        }
6261
6262        /// Sets the value of [frame_rate_conversion_strategy][crate::model::video_stream::H265CodecSettings::frame_rate_conversion_strategy].
6263        ///
6264        /// # Example
6265        /// ```ignore,no_run
6266        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6267        /// use google_cloud_video_transcoder_v1::model::video_stream::FrameRateConversionStrategy;
6268        /// let x0 = H265CodecSettings::new().set_frame_rate_conversion_strategy(FrameRateConversionStrategy::Downsample);
6269        /// let x1 = H265CodecSettings::new().set_frame_rate_conversion_strategy(FrameRateConversionStrategy::DropDuplicate);
6270        /// ```
6271        pub fn set_frame_rate_conversion_strategy<
6272            T: std::convert::Into<crate::model::video_stream::FrameRateConversionStrategy>,
6273        >(
6274            mut self,
6275            v: T,
6276        ) -> Self {
6277            self.frame_rate_conversion_strategy = v.into();
6278            self
6279        }
6280
6281        /// Sets the value of [bitrate_bps][crate::model::video_stream::H265CodecSettings::bitrate_bps].
6282        ///
6283        /// # Example
6284        /// ```ignore,no_run
6285        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6286        /// let x = H265CodecSettings::new().set_bitrate_bps(42);
6287        /// ```
6288        pub fn set_bitrate_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6289            self.bitrate_bps = v.into();
6290            self
6291        }
6292
6293        /// Sets the value of [pixel_format][crate::model::video_stream::H265CodecSettings::pixel_format].
6294        ///
6295        /// # Example
6296        /// ```ignore,no_run
6297        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6298        /// let x = H265CodecSettings::new().set_pixel_format("example");
6299        /// ```
6300        pub fn set_pixel_format<T: std::convert::Into<std::string::String>>(
6301            mut self,
6302            v: T,
6303        ) -> Self {
6304            self.pixel_format = v.into();
6305            self
6306        }
6307
6308        /// Sets the value of [rate_control_mode][crate::model::video_stream::H265CodecSettings::rate_control_mode].
6309        ///
6310        /// # Example
6311        /// ```ignore,no_run
6312        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6313        /// let x = H265CodecSettings::new().set_rate_control_mode("example");
6314        /// ```
6315        pub fn set_rate_control_mode<T: std::convert::Into<std::string::String>>(
6316            mut self,
6317            v: T,
6318        ) -> Self {
6319            self.rate_control_mode = v.into();
6320            self
6321        }
6322
6323        /// Sets the value of [crf_level][crate::model::video_stream::H265CodecSettings::crf_level].
6324        ///
6325        /// # Example
6326        /// ```ignore,no_run
6327        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6328        /// let x = H265CodecSettings::new().set_crf_level(42);
6329        /// ```
6330        pub fn set_crf_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6331            self.crf_level = v.into();
6332            self
6333        }
6334
6335        /// Sets the value of [allow_open_gop][crate::model::video_stream::H265CodecSettings::allow_open_gop].
6336        ///
6337        /// # Example
6338        /// ```ignore,no_run
6339        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6340        /// let x = H265CodecSettings::new().set_allow_open_gop(true);
6341        /// ```
6342        pub fn set_allow_open_gop<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6343            self.allow_open_gop = v.into();
6344            self
6345        }
6346
6347        /// Sets the value of [enable_two_pass][crate::model::video_stream::H265CodecSettings::enable_two_pass].
6348        ///
6349        /// # Example
6350        /// ```ignore,no_run
6351        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6352        /// let x = H265CodecSettings::new().set_enable_two_pass(true);
6353        /// ```
6354        pub fn set_enable_two_pass<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6355            self.enable_two_pass = v.into();
6356            self
6357        }
6358
6359        /// Sets the value of [vbv_size_bits][crate::model::video_stream::H265CodecSettings::vbv_size_bits].
6360        ///
6361        /// # Example
6362        /// ```ignore,no_run
6363        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6364        /// let x = H265CodecSettings::new().set_vbv_size_bits(42);
6365        /// ```
6366        pub fn set_vbv_size_bits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6367            self.vbv_size_bits = v.into();
6368            self
6369        }
6370
6371        /// Sets the value of [vbv_fullness_bits][crate::model::video_stream::H265CodecSettings::vbv_fullness_bits].
6372        ///
6373        /// # Example
6374        /// ```ignore,no_run
6375        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6376        /// let x = H265CodecSettings::new().set_vbv_fullness_bits(42);
6377        /// ```
6378        pub fn set_vbv_fullness_bits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6379            self.vbv_fullness_bits = v.into();
6380            self
6381        }
6382
6383        /// Sets the value of [b_pyramid][crate::model::video_stream::H265CodecSettings::b_pyramid].
6384        ///
6385        /// # Example
6386        /// ```ignore,no_run
6387        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6388        /// let x = H265CodecSettings::new().set_b_pyramid(true);
6389        /// ```
6390        pub fn set_b_pyramid<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6391            self.b_pyramid = v.into();
6392            self
6393        }
6394
6395        /// Sets the value of [b_frame_count][crate::model::video_stream::H265CodecSettings::b_frame_count].
6396        ///
6397        /// # Example
6398        /// ```ignore,no_run
6399        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6400        /// let x = H265CodecSettings::new().set_b_frame_count(42);
6401        /// ```
6402        pub fn set_b_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6403            self.b_frame_count = v.into();
6404            self
6405        }
6406
6407        /// Sets the value of [aq_strength][crate::model::video_stream::H265CodecSettings::aq_strength].
6408        ///
6409        /// # Example
6410        /// ```ignore,no_run
6411        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6412        /// let x = H265CodecSettings::new().set_aq_strength(42.0);
6413        /// ```
6414        pub fn set_aq_strength<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
6415            self.aq_strength = v.into();
6416            self
6417        }
6418
6419        /// Sets the value of [profile][crate::model::video_stream::H265CodecSettings::profile].
6420        ///
6421        /// # Example
6422        /// ```ignore,no_run
6423        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6424        /// let x = H265CodecSettings::new().set_profile("example");
6425        /// ```
6426        pub fn set_profile<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6427            self.profile = v.into();
6428            self
6429        }
6430
6431        /// Sets the value of [tune][crate::model::video_stream::H265CodecSettings::tune].
6432        ///
6433        /// # Example
6434        /// ```ignore,no_run
6435        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6436        /// let x = H265CodecSettings::new().set_tune("example");
6437        /// ```
6438        pub fn set_tune<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6439            self.tune = v.into();
6440            self
6441        }
6442
6443        /// Sets the value of [preset][crate::model::video_stream::H265CodecSettings::preset].
6444        ///
6445        /// # Example
6446        /// ```ignore,no_run
6447        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6448        /// let x = H265CodecSettings::new().set_preset("example");
6449        /// ```
6450        pub fn set_preset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6451            self.preset = v.into();
6452            self
6453        }
6454
6455        /// Sets the value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode].
6456        ///
6457        /// Note that all the setters affecting `gop_mode` are mutually
6458        /// exclusive.
6459        ///
6460        /// # Example
6461        /// ```ignore,no_run
6462        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6463        /// use google_cloud_video_transcoder_v1::model::video_stream::h_265_codec_settings::GopMode;
6464        /// let x = H265CodecSettings::new().set_gop_mode(Some(GopMode::GopFrameCount(42)));
6465        /// ```
6466        pub fn set_gop_mode<
6467            T: std::convert::Into<
6468                    std::option::Option<crate::model::video_stream::h_265_codec_settings::GopMode>,
6469                >,
6470        >(
6471            mut self,
6472            v: T,
6473        ) -> Self {
6474            self.gop_mode = v.into();
6475            self
6476        }
6477
6478        /// The value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode]
6479        /// if it holds a `GopFrameCount`, `None` if the field is not set or
6480        /// holds a different branch.
6481        pub fn gop_frame_count(&self) -> std::option::Option<&i32> {
6482            #[allow(unreachable_patterns)]
6483            self.gop_mode.as_ref().and_then(|v| match v {
6484                crate::model::video_stream::h_265_codec_settings::GopMode::GopFrameCount(v) => {
6485                    std::option::Option::Some(v)
6486                }
6487                _ => std::option::Option::None,
6488            })
6489        }
6490
6491        /// Sets the value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode]
6492        /// to hold a `GopFrameCount`.
6493        ///
6494        /// Note that all the setters affecting `gop_mode` are
6495        /// mutually exclusive.
6496        ///
6497        /// # Example
6498        /// ```ignore,no_run
6499        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6500        /// let x = H265CodecSettings::new().set_gop_frame_count(42);
6501        /// assert!(x.gop_frame_count().is_some());
6502        /// assert!(x.gop_duration().is_none());
6503        /// ```
6504        pub fn set_gop_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6505            self.gop_mode = std::option::Option::Some(
6506                crate::model::video_stream::h_265_codec_settings::GopMode::GopFrameCount(v.into()),
6507            );
6508            self
6509        }
6510
6511        /// The value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode]
6512        /// if it holds a `GopDuration`, `None` if the field is not set or
6513        /// holds a different branch.
6514        pub fn gop_duration(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
6515            #[allow(unreachable_patterns)]
6516            self.gop_mode.as_ref().and_then(|v| match v {
6517                crate::model::video_stream::h_265_codec_settings::GopMode::GopDuration(v) => {
6518                    std::option::Option::Some(v)
6519                }
6520                _ => std::option::Option::None,
6521            })
6522        }
6523
6524        /// Sets the value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode]
6525        /// to hold a `GopDuration`.
6526        ///
6527        /// Note that all the setters affecting `gop_mode` are
6528        /// mutually exclusive.
6529        ///
6530        /// # Example
6531        /// ```ignore,no_run
6532        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6533        /// use wkt::Duration;
6534        /// let x = H265CodecSettings::new().set_gop_duration(Duration::default()/* use setters */);
6535        /// assert!(x.gop_duration().is_some());
6536        /// assert!(x.gop_frame_count().is_none());
6537        /// ```
6538        pub fn set_gop_duration<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
6539            mut self,
6540            v: T,
6541        ) -> Self {
6542            self.gop_mode = std::option::Option::Some(
6543                crate::model::video_stream::h_265_codec_settings::GopMode::GopDuration(v.into()),
6544            );
6545            self
6546        }
6547
6548        /// Sets the value of [color_format][crate::model::video_stream::H265CodecSettings::color_format].
6549        ///
6550        /// Note that all the setters affecting `color_format` are mutually
6551        /// exclusive.
6552        ///
6553        /// # Example
6554        /// ```ignore,no_run
6555        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6556        /// use google_cloud_video_transcoder_v1::model::video_stream::H265ColorFormatSDR;
6557        /// let x = H265CodecSettings::new().set_color_format(Some(
6558        ///     google_cloud_video_transcoder_v1::model::video_stream::h_265_codec_settings::ColorFormat::Sdr(H265ColorFormatSDR::default().into())));
6559        /// ```
6560        pub fn set_color_format<
6561            T: std::convert::Into<
6562                    std::option::Option<
6563                        crate::model::video_stream::h_265_codec_settings::ColorFormat,
6564                    >,
6565                >,
6566        >(
6567            mut self,
6568            v: T,
6569        ) -> Self {
6570            self.color_format = v.into();
6571            self
6572        }
6573
6574        /// The value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
6575        /// if it holds a `Sdr`, `None` if the field is not set or
6576        /// holds a different branch.
6577        pub fn sdr(
6578            &self,
6579        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H265ColorFormatSDR>>
6580        {
6581            #[allow(unreachable_patterns)]
6582            self.color_format.as_ref().and_then(|v| match v {
6583                crate::model::video_stream::h_265_codec_settings::ColorFormat::Sdr(v) => {
6584                    std::option::Option::Some(v)
6585                }
6586                _ => std::option::Option::None,
6587            })
6588        }
6589
6590        /// Sets the value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
6591        /// to hold a `Sdr`.
6592        ///
6593        /// Note that all the setters affecting `color_format` are
6594        /// mutually exclusive.
6595        ///
6596        /// # Example
6597        /// ```ignore,no_run
6598        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6599        /// use google_cloud_video_transcoder_v1::model::video_stream::H265ColorFormatSDR;
6600        /// let x = H265CodecSettings::new().set_sdr(H265ColorFormatSDR::default()/* use setters */);
6601        /// assert!(x.sdr().is_some());
6602        /// assert!(x.hlg().is_none());
6603        /// assert!(x.hdr10().is_none());
6604        /// ```
6605        pub fn set_sdr<
6606            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H265ColorFormatSDR>>,
6607        >(
6608            mut self,
6609            v: T,
6610        ) -> Self {
6611            self.color_format = std::option::Option::Some(
6612                crate::model::video_stream::h_265_codec_settings::ColorFormat::Sdr(v.into()),
6613            );
6614            self
6615        }
6616
6617        /// The value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
6618        /// if it holds a `Hlg`, `None` if the field is not set or
6619        /// holds a different branch.
6620        pub fn hlg(
6621            &self,
6622        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H265ColorFormatHLG>>
6623        {
6624            #[allow(unreachable_patterns)]
6625            self.color_format.as_ref().and_then(|v| match v {
6626                crate::model::video_stream::h_265_codec_settings::ColorFormat::Hlg(v) => {
6627                    std::option::Option::Some(v)
6628                }
6629                _ => std::option::Option::None,
6630            })
6631        }
6632
6633        /// Sets the value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
6634        /// to hold a `Hlg`.
6635        ///
6636        /// Note that all the setters affecting `color_format` are
6637        /// mutually exclusive.
6638        ///
6639        /// # Example
6640        /// ```ignore,no_run
6641        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6642        /// use google_cloud_video_transcoder_v1::model::video_stream::H265ColorFormatHLG;
6643        /// let x = H265CodecSettings::new().set_hlg(H265ColorFormatHLG::default()/* use setters */);
6644        /// assert!(x.hlg().is_some());
6645        /// assert!(x.sdr().is_none());
6646        /// assert!(x.hdr10().is_none());
6647        /// ```
6648        pub fn set_hlg<
6649            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H265ColorFormatHLG>>,
6650        >(
6651            mut self,
6652            v: T,
6653        ) -> Self {
6654            self.color_format = std::option::Option::Some(
6655                crate::model::video_stream::h_265_codec_settings::ColorFormat::Hlg(v.into()),
6656            );
6657            self
6658        }
6659
6660        /// The value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
6661        /// if it holds a `Hdr10`, `None` if the field is not set or
6662        /// holds a different branch.
6663        pub fn hdr10(
6664            &self,
6665        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H265ColorFormatHDR10>>
6666        {
6667            #[allow(unreachable_patterns)]
6668            self.color_format.as_ref().and_then(|v| match v {
6669                crate::model::video_stream::h_265_codec_settings::ColorFormat::Hdr10(v) => {
6670                    std::option::Option::Some(v)
6671                }
6672                _ => std::option::Option::None,
6673            })
6674        }
6675
6676        /// Sets the value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
6677        /// to hold a `Hdr10`.
6678        ///
6679        /// Note that all the setters affecting `color_format` are
6680        /// mutually exclusive.
6681        ///
6682        /// # Example
6683        /// ```ignore,no_run
6684        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6685        /// use google_cloud_video_transcoder_v1::model::video_stream::H265ColorFormatHDR10;
6686        /// let x = H265CodecSettings::new().set_hdr10(H265ColorFormatHDR10::default()/* use setters */);
6687        /// assert!(x.hdr10().is_some());
6688        /// assert!(x.sdr().is_none());
6689        /// assert!(x.hlg().is_none());
6690        /// ```
6691        pub fn set_hdr10<
6692            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H265ColorFormatHDR10>>,
6693        >(
6694            mut self,
6695            v: T,
6696        ) -> Self {
6697            self.color_format = std::option::Option::Some(
6698                crate::model::video_stream::h_265_codec_settings::ColorFormat::Hdr10(v.into()),
6699            );
6700            self
6701        }
6702    }
6703
6704    impl wkt::message::Message for H265CodecSettings {
6705        fn typename() -> &'static str {
6706            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings"
6707        }
6708    }
6709
6710    /// Defines additional types related to [H265CodecSettings].
6711    pub mod h_265_codec_settings {
6712        #[allow(unused_imports)]
6713        use super::*;
6714
6715        /// GOP mode can be either by frame count or duration.
6716        #[derive(Clone, Debug, PartialEq)]
6717        #[non_exhaustive]
6718        pub enum GopMode {
6719            /// Select the GOP size based on the specified frame count. Must be greater
6720            /// than zero.
6721            GopFrameCount(i32),
6722            /// Select the GOP size based on the specified duration. The default is
6723            /// `3s`. Note that `gopDuration` must be less than or equal to
6724            /// [`segmentDuration`](#SegmentSettings), and
6725            /// [`segmentDuration`](#SegmentSettings) must be divisible by
6726            /// `gopDuration`.
6727            GopDuration(std::boxed::Box<wkt::Duration>),
6728        }
6729
6730        /// Color format can be sdr, hlg, hdr10.
6731        #[derive(Clone, Debug, PartialEq)]
6732        #[non_exhaustive]
6733        pub enum ColorFormat {
6734            /// Optional. SDR color format setting for H265.
6735            Sdr(std::boxed::Box<crate::model::video_stream::H265ColorFormatSDR>),
6736            /// Optional. HLG color format setting for H265.
6737            Hlg(std::boxed::Box<crate::model::video_stream::H265ColorFormatHLG>),
6738            /// Optional. HDR10 color format setting for H265.
6739            Hdr10(std::boxed::Box<crate::model::video_stream::H265ColorFormatHDR10>),
6740        }
6741    }
6742
6743    /// Convert the input video to a Standard Dynamic Range (SDR) video.
6744    #[derive(Clone, Default, PartialEq)]
6745    #[non_exhaustive]
6746    pub struct Vp9ColorFormatSDR {
6747        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6748    }
6749
6750    impl Vp9ColorFormatSDR {
6751        /// Creates a new default instance.
6752        pub fn new() -> Self {
6753            std::default::Default::default()
6754        }
6755    }
6756
6757    impl wkt::message::Message for Vp9ColorFormatSDR {
6758        fn typename() -> &'static str {
6759            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.Vp9ColorFormatSDR"
6760        }
6761    }
6762
6763    /// Convert the input video to a Hybrid Log Gamma (HLG) video.
6764    #[derive(Clone, Default, PartialEq)]
6765    #[non_exhaustive]
6766    pub struct Vp9ColorFormatHLG {
6767        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6768    }
6769
6770    impl Vp9ColorFormatHLG {
6771        /// Creates a new default instance.
6772        pub fn new() -> Self {
6773            std::default::Default::default()
6774        }
6775    }
6776
6777    impl wkt::message::Message for Vp9ColorFormatHLG {
6778        fn typename() -> &'static str {
6779            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.Vp9ColorFormatHLG"
6780        }
6781    }
6782
6783    /// VP9 codec settings.
6784    #[derive(Clone, Default, PartialEq)]
6785    #[non_exhaustive]
6786    pub struct Vp9CodecSettings {
6787        /// The width of the video in pixels. Must be an even integer.
6788        /// When not specified, the width is adjusted to match the specified height
6789        /// and input aspect ratio. If both are omitted, the input width is used.
6790        ///
6791        /// For portrait videos that contain horizontal ASR and rotation metadata,
6792        /// provide the width, in pixels, per the horizontal ASR. The API calculates
6793        /// the height per the horizontal ASR. The API detects any rotation metadata
6794        /// and swaps the requested height and width for the output.
6795        pub width_pixels: i32,
6796
6797        /// The height of the video in pixels. Must be an even integer.
6798        /// When not specified, the height is adjusted to match the specified width
6799        /// and input aspect ratio. If both are omitted, the input height is used.
6800        ///
6801        /// For portrait videos that contain horizontal ASR and rotation metadata,
6802        /// provide the height, in pixels, per the horizontal ASR. The API calculates
6803        /// the width per the horizontal ASR. The API detects any rotation metadata
6804        /// and swaps the requested height and width for the output.
6805        pub height_pixels: i32,
6806
6807        /// Required. The target video frame rate in frames per second (FPS). Must be
6808        /// less than or equal to 120.
6809        pub frame_rate: f64,
6810
6811        /// Optional. Frame rate conversion strategy for desired frame rate. The
6812        /// default is `DOWNSAMPLE`.
6813        pub frame_rate_conversion_strategy: crate::model::video_stream::FrameRateConversionStrategy,
6814
6815        /// Required. The video bitrate in bits per second. The minimum value is
6816        /// 1,000. The maximum value is 480,000,000.
6817        pub bitrate_bps: i32,
6818
6819        /// Pixel format to use. The default is `yuv420p`.
6820        ///
6821        /// Supported pixel formats:
6822        ///
6823        /// - `yuv420p` pixel format
6824        /// - `yuv422p` pixel format
6825        /// - `yuv444p` pixel format
6826        /// - `yuv420p10` 10-bit HDR pixel format
6827        /// - `yuv422p10` 10-bit HDR pixel format
6828        /// - `yuv444p10` 10-bit HDR pixel format
6829        /// - `yuv420p12` 12-bit HDR pixel format
6830        /// - `yuv422p12` 12-bit HDR pixel format
6831        /// - `yuv444p12` 12-bit HDR pixel format
6832        pub pixel_format: std::string::String,
6833
6834        /// Specify the mode. The default is `vbr`.
6835        ///
6836        /// Supported rate control modes:
6837        ///
6838        /// - `vbr` - variable bitrate
6839        pub rate_control_mode: std::string::String,
6840
6841        /// Target CRF level. Must be between 10 and 36, where 10 is the highest
6842        /// quality and 36 is the most efficient compression. The default is 21.
6843        ///
6844        /// **Note:** This field is not supported.
6845        pub crf_level: i32,
6846
6847        /// Enforces the specified codec profile. The following profiles are
6848        /// supported:
6849        ///
6850        /// * `profile0` (default)
6851        /// * `profile1`
6852        /// * `profile2`
6853        /// * `profile3`
6854        ///
6855        /// The available options are
6856        /// [WebM-compatible](https://www.webmproject.org/vp9/profiles/).
6857        /// Note that certain values for this field may cause the
6858        /// transcoder to override other fields you set in the `Vp9CodecSettings`
6859        /// message.
6860        pub profile: std::string::String,
6861
6862        /// GOP mode can be either by frame count or duration.
6863        pub gop_mode: std::option::Option<crate::model::video_stream::vp_9_codec_settings::GopMode>,
6864
6865        /// Color format can be sdr or hlg.
6866        pub color_format:
6867            std::option::Option<crate::model::video_stream::vp_9_codec_settings::ColorFormat>,
6868
6869        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6870    }
6871
6872    impl Vp9CodecSettings {
6873        /// Creates a new default instance.
6874        pub fn new() -> Self {
6875            std::default::Default::default()
6876        }
6877
6878        /// Sets the value of [width_pixels][crate::model::video_stream::Vp9CodecSettings::width_pixels].
6879        ///
6880        /// # Example
6881        /// ```ignore,no_run
6882        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
6883        /// let x = Vp9CodecSettings::new().set_width_pixels(42);
6884        /// ```
6885        pub fn set_width_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6886            self.width_pixels = v.into();
6887            self
6888        }
6889
6890        /// Sets the value of [height_pixels][crate::model::video_stream::Vp9CodecSettings::height_pixels].
6891        ///
6892        /// # Example
6893        /// ```ignore,no_run
6894        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
6895        /// let x = Vp9CodecSettings::new().set_height_pixels(42);
6896        /// ```
6897        pub fn set_height_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6898            self.height_pixels = v.into();
6899            self
6900        }
6901
6902        /// Sets the value of [frame_rate][crate::model::video_stream::Vp9CodecSettings::frame_rate].
6903        ///
6904        /// # Example
6905        /// ```ignore,no_run
6906        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
6907        /// let x = Vp9CodecSettings::new().set_frame_rate(42.0);
6908        /// ```
6909        pub fn set_frame_rate<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
6910            self.frame_rate = v.into();
6911            self
6912        }
6913
6914        /// Sets the value of [frame_rate_conversion_strategy][crate::model::video_stream::Vp9CodecSettings::frame_rate_conversion_strategy].
6915        ///
6916        /// # Example
6917        /// ```ignore,no_run
6918        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
6919        /// use google_cloud_video_transcoder_v1::model::video_stream::FrameRateConversionStrategy;
6920        /// let x0 = Vp9CodecSettings::new().set_frame_rate_conversion_strategy(FrameRateConversionStrategy::Downsample);
6921        /// let x1 = Vp9CodecSettings::new().set_frame_rate_conversion_strategy(FrameRateConversionStrategy::DropDuplicate);
6922        /// ```
6923        pub fn set_frame_rate_conversion_strategy<
6924            T: std::convert::Into<crate::model::video_stream::FrameRateConversionStrategy>,
6925        >(
6926            mut self,
6927            v: T,
6928        ) -> Self {
6929            self.frame_rate_conversion_strategy = v.into();
6930            self
6931        }
6932
6933        /// Sets the value of [bitrate_bps][crate::model::video_stream::Vp9CodecSettings::bitrate_bps].
6934        ///
6935        /// # Example
6936        /// ```ignore,no_run
6937        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
6938        /// let x = Vp9CodecSettings::new().set_bitrate_bps(42);
6939        /// ```
6940        pub fn set_bitrate_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6941            self.bitrate_bps = v.into();
6942            self
6943        }
6944
6945        /// Sets the value of [pixel_format][crate::model::video_stream::Vp9CodecSettings::pixel_format].
6946        ///
6947        /// # Example
6948        /// ```ignore,no_run
6949        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
6950        /// let x = Vp9CodecSettings::new().set_pixel_format("example");
6951        /// ```
6952        pub fn set_pixel_format<T: std::convert::Into<std::string::String>>(
6953            mut self,
6954            v: T,
6955        ) -> Self {
6956            self.pixel_format = v.into();
6957            self
6958        }
6959
6960        /// Sets the value of [rate_control_mode][crate::model::video_stream::Vp9CodecSettings::rate_control_mode].
6961        ///
6962        /// # Example
6963        /// ```ignore,no_run
6964        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
6965        /// let x = Vp9CodecSettings::new().set_rate_control_mode("example");
6966        /// ```
6967        pub fn set_rate_control_mode<T: std::convert::Into<std::string::String>>(
6968            mut self,
6969            v: T,
6970        ) -> Self {
6971            self.rate_control_mode = v.into();
6972            self
6973        }
6974
6975        /// Sets the value of [crf_level][crate::model::video_stream::Vp9CodecSettings::crf_level].
6976        ///
6977        /// # Example
6978        /// ```ignore,no_run
6979        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
6980        /// let x = Vp9CodecSettings::new().set_crf_level(42);
6981        /// ```
6982        pub fn set_crf_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6983            self.crf_level = v.into();
6984            self
6985        }
6986
6987        /// Sets the value of [profile][crate::model::video_stream::Vp9CodecSettings::profile].
6988        ///
6989        /// # Example
6990        /// ```ignore,no_run
6991        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
6992        /// let x = Vp9CodecSettings::new().set_profile("example");
6993        /// ```
6994        pub fn set_profile<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6995            self.profile = v.into();
6996            self
6997        }
6998
6999        /// Sets the value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode].
7000        ///
7001        /// Note that all the setters affecting `gop_mode` are mutually
7002        /// exclusive.
7003        ///
7004        /// # Example
7005        /// ```ignore,no_run
7006        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
7007        /// use google_cloud_video_transcoder_v1::model::video_stream::vp_9_codec_settings::GopMode;
7008        /// let x = Vp9CodecSettings::new().set_gop_mode(Some(GopMode::GopFrameCount(42)));
7009        /// ```
7010        pub fn set_gop_mode<
7011            T: std::convert::Into<
7012                    std::option::Option<crate::model::video_stream::vp_9_codec_settings::GopMode>,
7013                >,
7014        >(
7015            mut self,
7016            v: T,
7017        ) -> Self {
7018            self.gop_mode = v.into();
7019            self
7020        }
7021
7022        /// The value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode]
7023        /// if it holds a `GopFrameCount`, `None` if the field is not set or
7024        /// holds a different branch.
7025        pub fn gop_frame_count(&self) -> std::option::Option<&i32> {
7026            #[allow(unreachable_patterns)]
7027            self.gop_mode.as_ref().and_then(|v| match v {
7028                crate::model::video_stream::vp_9_codec_settings::GopMode::GopFrameCount(v) => {
7029                    std::option::Option::Some(v)
7030                }
7031                _ => std::option::Option::None,
7032            })
7033        }
7034
7035        /// Sets the value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode]
7036        /// to hold a `GopFrameCount`.
7037        ///
7038        /// Note that all the setters affecting `gop_mode` are
7039        /// mutually exclusive.
7040        ///
7041        /// # Example
7042        /// ```ignore,no_run
7043        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
7044        /// let x = Vp9CodecSettings::new().set_gop_frame_count(42);
7045        /// assert!(x.gop_frame_count().is_some());
7046        /// assert!(x.gop_duration().is_none());
7047        /// ```
7048        pub fn set_gop_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7049            self.gop_mode = std::option::Option::Some(
7050                crate::model::video_stream::vp_9_codec_settings::GopMode::GopFrameCount(v.into()),
7051            );
7052            self
7053        }
7054
7055        /// The value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode]
7056        /// if it holds a `GopDuration`, `None` if the field is not set or
7057        /// holds a different branch.
7058        pub fn gop_duration(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
7059            #[allow(unreachable_patterns)]
7060            self.gop_mode.as_ref().and_then(|v| match v {
7061                crate::model::video_stream::vp_9_codec_settings::GopMode::GopDuration(v) => {
7062                    std::option::Option::Some(v)
7063                }
7064                _ => std::option::Option::None,
7065            })
7066        }
7067
7068        /// Sets the value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode]
7069        /// to hold a `GopDuration`.
7070        ///
7071        /// Note that all the setters affecting `gop_mode` are
7072        /// mutually exclusive.
7073        ///
7074        /// # Example
7075        /// ```ignore,no_run
7076        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
7077        /// use wkt::Duration;
7078        /// let x = Vp9CodecSettings::new().set_gop_duration(Duration::default()/* use setters */);
7079        /// assert!(x.gop_duration().is_some());
7080        /// assert!(x.gop_frame_count().is_none());
7081        /// ```
7082        pub fn set_gop_duration<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
7083            mut self,
7084            v: T,
7085        ) -> Self {
7086            self.gop_mode = std::option::Option::Some(
7087                crate::model::video_stream::vp_9_codec_settings::GopMode::GopDuration(v.into()),
7088            );
7089            self
7090        }
7091
7092        /// Sets the value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format].
7093        ///
7094        /// Note that all the setters affecting `color_format` are mutually
7095        /// exclusive.
7096        ///
7097        /// # Example
7098        /// ```ignore,no_run
7099        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
7100        /// use google_cloud_video_transcoder_v1::model::video_stream::Vp9ColorFormatSDR;
7101        /// let x = Vp9CodecSettings::new().set_color_format(Some(
7102        ///     google_cloud_video_transcoder_v1::model::video_stream::vp_9_codec_settings::ColorFormat::Sdr(Vp9ColorFormatSDR::default().into())));
7103        /// ```
7104        pub fn set_color_format<
7105            T: std::convert::Into<
7106                    std::option::Option<
7107                        crate::model::video_stream::vp_9_codec_settings::ColorFormat,
7108                    >,
7109                >,
7110        >(
7111            mut self,
7112            v: T,
7113        ) -> Self {
7114            self.color_format = v.into();
7115            self
7116        }
7117
7118        /// The value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format]
7119        /// if it holds a `Sdr`, `None` if the field is not set or
7120        /// holds a different branch.
7121        pub fn sdr(
7122            &self,
7123        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::Vp9ColorFormatSDR>>
7124        {
7125            #[allow(unreachable_patterns)]
7126            self.color_format.as_ref().and_then(|v| match v {
7127                crate::model::video_stream::vp_9_codec_settings::ColorFormat::Sdr(v) => {
7128                    std::option::Option::Some(v)
7129                }
7130                _ => std::option::Option::None,
7131            })
7132        }
7133
7134        /// Sets the value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format]
7135        /// to hold a `Sdr`.
7136        ///
7137        /// Note that all the setters affecting `color_format` are
7138        /// mutually exclusive.
7139        ///
7140        /// # Example
7141        /// ```ignore,no_run
7142        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
7143        /// use google_cloud_video_transcoder_v1::model::video_stream::Vp9ColorFormatSDR;
7144        /// let x = Vp9CodecSettings::new().set_sdr(Vp9ColorFormatSDR::default()/* use setters */);
7145        /// assert!(x.sdr().is_some());
7146        /// assert!(x.hlg().is_none());
7147        /// ```
7148        pub fn set_sdr<
7149            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::Vp9ColorFormatSDR>>,
7150        >(
7151            mut self,
7152            v: T,
7153        ) -> Self {
7154            self.color_format = std::option::Option::Some(
7155                crate::model::video_stream::vp_9_codec_settings::ColorFormat::Sdr(v.into()),
7156            );
7157            self
7158        }
7159
7160        /// The value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format]
7161        /// if it holds a `Hlg`, `None` if the field is not set or
7162        /// holds a different branch.
7163        pub fn hlg(
7164            &self,
7165        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::Vp9ColorFormatHLG>>
7166        {
7167            #[allow(unreachable_patterns)]
7168            self.color_format.as_ref().and_then(|v| match v {
7169                crate::model::video_stream::vp_9_codec_settings::ColorFormat::Hlg(v) => {
7170                    std::option::Option::Some(v)
7171                }
7172                _ => std::option::Option::None,
7173            })
7174        }
7175
7176        /// Sets the value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format]
7177        /// to hold a `Hlg`.
7178        ///
7179        /// Note that all the setters affecting `color_format` are
7180        /// mutually exclusive.
7181        ///
7182        /// # Example
7183        /// ```ignore,no_run
7184        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
7185        /// use google_cloud_video_transcoder_v1::model::video_stream::Vp9ColorFormatHLG;
7186        /// let x = Vp9CodecSettings::new().set_hlg(Vp9ColorFormatHLG::default()/* use setters */);
7187        /// assert!(x.hlg().is_some());
7188        /// assert!(x.sdr().is_none());
7189        /// ```
7190        pub fn set_hlg<
7191            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::Vp9ColorFormatHLG>>,
7192        >(
7193            mut self,
7194            v: T,
7195        ) -> Self {
7196            self.color_format = std::option::Option::Some(
7197                crate::model::video_stream::vp_9_codec_settings::ColorFormat::Hlg(v.into()),
7198            );
7199            self
7200        }
7201    }
7202
7203    impl wkt::message::Message for Vp9CodecSettings {
7204        fn typename() -> &'static str {
7205            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings"
7206        }
7207    }
7208
7209    /// Defines additional types related to [Vp9CodecSettings].
7210    pub mod vp_9_codec_settings {
7211        #[allow(unused_imports)]
7212        use super::*;
7213
7214        /// GOP mode can be either by frame count or duration.
7215        #[derive(Clone, Debug, PartialEq)]
7216        #[non_exhaustive]
7217        pub enum GopMode {
7218            /// Select the GOP size based on the specified frame count. Must be greater
7219            /// than zero.
7220            GopFrameCount(i32),
7221            /// Select the GOP size based on the specified duration. The default is
7222            /// `3s`. Note that `gopDuration` must be less than or equal to
7223            /// [`segmentDuration`](#SegmentSettings), and
7224            /// [`segmentDuration`](#SegmentSettings) must be divisible by
7225            /// `gopDuration`.
7226            GopDuration(std::boxed::Box<wkt::Duration>),
7227        }
7228
7229        /// Color format can be sdr or hlg.
7230        #[derive(Clone, Debug, PartialEq)]
7231        #[non_exhaustive]
7232        pub enum ColorFormat {
7233            /// Optional. SDR color format setting for VP9.
7234            Sdr(std::boxed::Box<crate::model::video_stream::Vp9ColorFormatSDR>),
7235            /// Optional. HLG color format setting for VP9.
7236            Hlg(std::boxed::Box<crate::model::video_stream::Vp9ColorFormatHLG>),
7237        }
7238    }
7239
7240    /// The conversion strategy for desired frame rate.
7241    ///
7242    /// # Working with unknown values
7243    ///
7244    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7245    /// additional enum variants at any time. Adding new variants is not considered
7246    /// a breaking change. Applications should write their code in anticipation of:
7247    ///
7248    /// - New values appearing in future releases of the client library, **and**
7249    /// - New values received dynamically, without application changes.
7250    ///
7251    /// Please consult the [Working with enums] section in the user guide for some
7252    /// guidelines.
7253    ///
7254    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7255    #[derive(Clone, Debug, PartialEq)]
7256    #[non_exhaustive]
7257    pub enum FrameRateConversionStrategy {
7258        /// Unspecified frame rate conversion strategy.
7259        Unspecified,
7260        /// Selectively retain frames to reduce the output frame rate.
7261        /// Every _n_ th frame is kept, where `n = ceil(input frame rate / target
7262        /// frame rate)`. When _n_ = 1 (that is, the target frame rate is greater
7263        /// than the input frame rate), the output frame rate matches the input frame
7264        /// rate. When _n_ > 1, frames are dropped and the output frame rate is
7265        /// equal to `(input frame rate / n)`. For more information, see
7266        /// [Calculate frame
7267        /// rate](https://cloud.google.com/transcoder/docs/concepts/frame-rate).
7268        Downsample,
7269        /// Drop or duplicate frames to match the specified frame rate.
7270        DropDuplicate,
7271        /// If set, the enum was initialized with an unknown value.
7272        ///
7273        /// Applications can examine the value using [FrameRateConversionStrategy::value] or
7274        /// [FrameRateConversionStrategy::name].
7275        UnknownValue(frame_rate_conversion_strategy::UnknownValue),
7276    }
7277
7278    #[doc(hidden)]
7279    pub mod frame_rate_conversion_strategy {
7280        #[allow(unused_imports)]
7281        use super::*;
7282        #[derive(Clone, Debug, PartialEq)]
7283        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7284    }
7285
7286    impl FrameRateConversionStrategy {
7287        /// Gets the enum value.
7288        ///
7289        /// Returns `None` if the enum contains an unknown value deserialized from
7290        /// the string representation of enums.
7291        pub fn value(&self) -> std::option::Option<i32> {
7292            match self {
7293                Self::Unspecified => std::option::Option::Some(0),
7294                Self::Downsample => std::option::Option::Some(1),
7295                Self::DropDuplicate => std::option::Option::Some(2),
7296                Self::UnknownValue(u) => u.0.value(),
7297            }
7298        }
7299
7300        /// Gets the enum value as a string.
7301        ///
7302        /// Returns `None` if the enum contains an unknown value deserialized from
7303        /// the integer representation of enums.
7304        pub fn name(&self) -> std::option::Option<&str> {
7305            match self {
7306                Self::Unspecified => {
7307                    std::option::Option::Some("FRAME_RATE_CONVERSION_STRATEGY_UNSPECIFIED")
7308                }
7309                Self::Downsample => std::option::Option::Some("DOWNSAMPLE"),
7310                Self::DropDuplicate => std::option::Option::Some("DROP_DUPLICATE"),
7311                Self::UnknownValue(u) => u.0.name(),
7312            }
7313        }
7314    }
7315
7316    impl std::default::Default for FrameRateConversionStrategy {
7317        fn default() -> Self {
7318            use std::convert::From;
7319            Self::from(0)
7320        }
7321    }
7322
7323    impl std::fmt::Display for FrameRateConversionStrategy {
7324        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7325            wkt::internal::display_enum(f, self.name(), self.value())
7326        }
7327    }
7328
7329    impl std::convert::From<i32> for FrameRateConversionStrategy {
7330        fn from(value: i32) -> Self {
7331            match value {
7332                0 => Self::Unspecified,
7333                1 => Self::Downsample,
7334                2 => Self::DropDuplicate,
7335                _ => Self::UnknownValue(frame_rate_conversion_strategy::UnknownValue(
7336                    wkt::internal::UnknownEnumValue::Integer(value),
7337                )),
7338            }
7339        }
7340    }
7341
7342    impl std::convert::From<&str> for FrameRateConversionStrategy {
7343        fn from(value: &str) -> Self {
7344            use std::string::ToString;
7345            match value {
7346                "FRAME_RATE_CONVERSION_STRATEGY_UNSPECIFIED" => Self::Unspecified,
7347                "DOWNSAMPLE" => Self::Downsample,
7348                "DROP_DUPLICATE" => Self::DropDuplicate,
7349                _ => Self::UnknownValue(frame_rate_conversion_strategy::UnknownValue(
7350                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7351                )),
7352            }
7353        }
7354    }
7355
7356    impl serde::ser::Serialize for FrameRateConversionStrategy {
7357        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7358        where
7359            S: serde::Serializer,
7360        {
7361            match self {
7362                Self::Unspecified => serializer.serialize_i32(0),
7363                Self::Downsample => serializer.serialize_i32(1),
7364                Self::DropDuplicate => serializer.serialize_i32(2),
7365                Self::UnknownValue(u) => u.0.serialize(serializer),
7366            }
7367        }
7368    }
7369
7370    impl<'de> serde::de::Deserialize<'de> for FrameRateConversionStrategy {
7371        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7372        where
7373            D: serde::Deserializer<'de>,
7374        {
7375            deserializer.deserialize_any(
7376                wkt::internal::EnumVisitor::<FrameRateConversionStrategy>::new(
7377                    ".google.cloud.video.transcoder.v1.VideoStream.FrameRateConversionStrategy",
7378                ),
7379            )
7380        }
7381    }
7382
7383    /// Codec settings can be h264, h265, or vp9.
7384    #[derive(Clone, Debug, PartialEq)]
7385    #[non_exhaustive]
7386    pub enum CodecSettings {
7387        /// H264 codec settings.
7388        H264(std::boxed::Box<crate::model::video_stream::H264CodecSettings>),
7389        /// H265 codec settings.
7390        H265(std::boxed::Box<crate::model::video_stream::H265CodecSettings>),
7391        /// VP9 codec settings.
7392        Vp9(std::boxed::Box<crate::model::video_stream::Vp9CodecSettings>),
7393    }
7394}
7395
7396/// Audio stream resource.
7397#[derive(Clone, Default, PartialEq)]
7398#[non_exhaustive]
7399pub struct AudioStream {
7400    /// The codec for this audio stream. The default is `aac`.
7401    ///
7402    /// Supported audio codecs:
7403    ///
7404    /// - `aac`
7405    /// - `aac-he`
7406    /// - `aac-he-v2`
7407    /// - `mp3`
7408    /// - `ac3`
7409    /// - `eac3`
7410    /// - `vorbis`
7411    pub codec: std::string::String,
7412
7413    /// Required. Audio bitrate in bits per second. Must be between 1 and
7414    /// 10,000,000.
7415    pub bitrate_bps: i32,
7416
7417    /// Number of audio channels. Must be between 1 and 6. The default is 2.
7418    pub channel_count: i32,
7419
7420    /// A list of channel names specifying layout of the audio channels.
7421    /// This only affects the metadata embedded in the container headers, if
7422    /// supported by the specified format. The default is `["fl", "fr"]`.
7423    ///
7424    /// Supported channel names:
7425    ///
7426    /// - `fl` - Front left channel
7427    /// - `fr` - Front right channel
7428    /// - `sl` - Side left channel
7429    /// - `sr` - Side right channel
7430    /// - `fc` - Front center channel
7431    /// - `lfe` - Low frequency
7432    pub channel_layout: std::vec::Vec<std::string::String>,
7433
7434    /// The mapping for the
7435    /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list]
7436    /// atoms with audio
7437    /// [EditAtom.inputs][google.cloud.video.transcoder.v1.EditAtom.inputs].
7438    ///
7439    /// [google.cloud.video.transcoder.v1.EditAtom.inputs]: crate::model::EditAtom::inputs
7440    /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
7441    pub mapping: std::vec::Vec<crate::model::audio_stream::AudioMapping>,
7442
7443    /// The audio sample rate in Hertz. The default is 48000 Hertz.
7444    pub sample_rate_hertz: i32,
7445
7446    /// The BCP-47 language code, such as `en-US` or `sr-Latn`. For more
7447    /// information, see
7448    /// <https://www.unicode.org/reports/tr35/#Unicode_locale_identifier>. Not
7449    /// supported in MP4 files.
7450    pub language_code: std::string::String,
7451
7452    /// The name for this particular audio stream that
7453    /// will be added to the HLS/DASH manifest. Not supported in MP4 files.
7454    pub display_name: std::string::String,
7455
7456    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7457}
7458
7459impl AudioStream {
7460    /// Creates a new default instance.
7461    pub fn new() -> Self {
7462        std::default::Default::default()
7463    }
7464
7465    /// Sets the value of [codec][crate::model::AudioStream::codec].
7466    ///
7467    /// # Example
7468    /// ```ignore,no_run
7469    /// # use google_cloud_video_transcoder_v1::model::AudioStream;
7470    /// let x = AudioStream::new().set_codec("example");
7471    /// ```
7472    pub fn set_codec<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7473        self.codec = v.into();
7474        self
7475    }
7476
7477    /// Sets the value of [bitrate_bps][crate::model::AudioStream::bitrate_bps].
7478    ///
7479    /// # Example
7480    /// ```ignore,no_run
7481    /// # use google_cloud_video_transcoder_v1::model::AudioStream;
7482    /// let x = AudioStream::new().set_bitrate_bps(42);
7483    /// ```
7484    pub fn set_bitrate_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7485        self.bitrate_bps = v.into();
7486        self
7487    }
7488
7489    /// Sets the value of [channel_count][crate::model::AudioStream::channel_count].
7490    ///
7491    /// # Example
7492    /// ```ignore,no_run
7493    /// # use google_cloud_video_transcoder_v1::model::AudioStream;
7494    /// let x = AudioStream::new().set_channel_count(42);
7495    /// ```
7496    pub fn set_channel_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7497        self.channel_count = v.into();
7498        self
7499    }
7500
7501    /// Sets the value of [channel_layout][crate::model::AudioStream::channel_layout].
7502    ///
7503    /// # Example
7504    /// ```ignore,no_run
7505    /// # use google_cloud_video_transcoder_v1::model::AudioStream;
7506    /// let x = AudioStream::new().set_channel_layout(["a", "b", "c"]);
7507    /// ```
7508    pub fn set_channel_layout<T, V>(mut self, v: T) -> Self
7509    where
7510        T: std::iter::IntoIterator<Item = V>,
7511        V: std::convert::Into<std::string::String>,
7512    {
7513        use std::iter::Iterator;
7514        self.channel_layout = v.into_iter().map(|i| i.into()).collect();
7515        self
7516    }
7517
7518    /// Sets the value of [mapping][crate::model::AudioStream::mapping].
7519    ///
7520    /// # Example
7521    /// ```ignore,no_run
7522    /// # use google_cloud_video_transcoder_v1::model::AudioStream;
7523    /// use google_cloud_video_transcoder_v1::model::audio_stream::AudioMapping;
7524    /// let x = AudioStream::new()
7525    ///     .set_mapping([
7526    ///         AudioMapping::default()/* use setters */,
7527    ///         AudioMapping::default()/* use (different) setters */,
7528    ///     ]);
7529    /// ```
7530    pub fn set_mapping<T, V>(mut self, v: T) -> Self
7531    where
7532        T: std::iter::IntoIterator<Item = V>,
7533        V: std::convert::Into<crate::model::audio_stream::AudioMapping>,
7534    {
7535        use std::iter::Iterator;
7536        self.mapping = v.into_iter().map(|i| i.into()).collect();
7537        self
7538    }
7539
7540    /// Sets the value of [sample_rate_hertz][crate::model::AudioStream::sample_rate_hertz].
7541    ///
7542    /// # Example
7543    /// ```ignore,no_run
7544    /// # use google_cloud_video_transcoder_v1::model::AudioStream;
7545    /// let x = AudioStream::new().set_sample_rate_hertz(42);
7546    /// ```
7547    pub fn set_sample_rate_hertz<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7548        self.sample_rate_hertz = v.into();
7549        self
7550    }
7551
7552    /// Sets the value of [language_code][crate::model::AudioStream::language_code].
7553    ///
7554    /// # Example
7555    /// ```ignore,no_run
7556    /// # use google_cloud_video_transcoder_v1::model::AudioStream;
7557    /// let x = AudioStream::new().set_language_code("example");
7558    /// ```
7559    pub fn set_language_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7560        self.language_code = v.into();
7561        self
7562    }
7563
7564    /// Sets the value of [display_name][crate::model::AudioStream::display_name].
7565    ///
7566    /// # Example
7567    /// ```ignore,no_run
7568    /// # use google_cloud_video_transcoder_v1::model::AudioStream;
7569    /// let x = AudioStream::new().set_display_name("example");
7570    /// ```
7571    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7572        self.display_name = v.into();
7573        self
7574    }
7575}
7576
7577impl wkt::message::Message for AudioStream {
7578    fn typename() -> &'static str {
7579        "type.googleapis.com/google.cloud.video.transcoder.v1.AudioStream"
7580    }
7581}
7582
7583/// Defines additional types related to [AudioStream].
7584pub mod audio_stream {
7585    #[allow(unused_imports)]
7586    use super::*;
7587
7588    /// The mapping for the
7589    /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list]
7590    /// atoms with audio
7591    /// [EditAtom.inputs][google.cloud.video.transcoder.v1.EditAtom.inputs].
7592    ///
7593    /// [google.cloud.video.transcoder.v1.EditAtom.inputs]: crate::model::EditAtom::inputs
7594    /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
7595    #[derive(Clone, Default, PartialEq)]
7596    #[non_exhaustive]
7597    pub struct AudioMapping {
7598        /// Required. The
7599        /// [EditAtom.key][google.cloud.video.transcoder.v1.EditAtom.key] that
7600        /// references the atom with audio inputs in the
7601        /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list].
7602        ///
7603        /// [google.cloud.video.transcoder.v1.EditAtom.key]: crate::model::EditAtom::key
7604        /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
7605        pub atom_key: std::string::String,
7606
7607        /// Required. The [Input.key][google.cloud.video.transcoder.v1.Input.key]
7608        /// that identifies the input file.
7609        ///
7610        /// [google.cloud.video.transcoder.v1.Input.key]: crate::model::Input::key
7611        pub input_key: std::string::String,
7612
7613        /// Required. The zero-based index of the track in the input file.
7614        pub input_track: i32,
7615
7616        /// Required. The zero-based index of the channel in the input audio stream.
7617        pub input_channel: i32,
7618
7619        /// Required. The zero-based index of the channel in the output audio stream.
7620        pub output_channel: i32,
7621
7622        /// Audio volume control in dB. Negative values decrease volume,
7623        /// positive values increase. The default is 0.
7624        pub gain_db: f64,
7625
7626        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7627    }
7628
7629    impl AudioMapping {
7630        /// Creates a new default instance.
7631        pub fn new() -> Self {
7632            std::default::Default::default()
7633        }
7634
7635        /// Sets the value of [atom_key][crate::model::audio_stream::AudioMapping::atom_key].
7636        ///
7637        /// # Example
7638        /// ```ignore,no_run
7639        /// # use google_cloud_video_transcoder_v1::model::audio_stream::AudioMapping;
7640        /// let x = AudioMapping::new().set_atom_key("example");
7641        /// ```
7642        pub fn set_atom_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7643            self.atom_key = v.into();
7644            self
7645        }
7646
7647        /// Sets the value of [input_key][crate::model::audio_stream::AudioMapping::input_key].
7648        ///
7649        /// # Example
7650        /// ```ignore,no_run
7651        /// # use google_cloud_video_transcoder_v1::model::audio_stream::AudioMapping;
7652        /// let x = AudioMapping::new().set_input_key("example");
7653        /// ```
7654        pub fn set_input_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7655            self.input_key = v.into();
7656            self
7657        }
7658
7659        /// Sets the value of [input_track][crate::model::audio_stream::AudioMapping::input_track].
7660        ///
7661        /// # Example
7662        /// ```ignore,no_run
7663        /// # use google_cloud_video_transcoder_v1::model::audio_stream::AudioMapping;
7664        /// let x = AudioMapping::new().set_input_track(42);
7665        /// ```
7666        pub fn set_input_track<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7667            self.input_track = v.into();
7668            self
7669        }
7670
7671        /// Sets the value of [input_channel][crate::model::audio_stream::AudioMapping::input_channel].
7672        ///
7673        /// # Example
7674        /// ```ignore,no_run
7675        /// # use google_cloud_video_transcoder_v1::model::audio_stream::AudioMapping;
7676        /// let x = AudioMapping::new().set_input_channel(42);
7677        /// ```
7678        pub fn set_input_channel<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7679            self.input_channel = v.into();
7680            self
7681        }
7682
7683        /// Sets the value of [output_channel][crate::model::audio_stream::AudioMapping::output_channel].
7684        ///
7685        /// # Example
7686        /// ```ignore,no_run
7687        /// # use google_cloud_video_transcoder_v1::model::audio_stream::AudioMapping;
7688        /// let x = AudioMapping::new().set_output_channel(42);
7689        /// ```
7690        pub fn set_output_channel<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7691            self.output_channel = v.into();
7692            self
7693        }
7694
7695        /// Sets the value of [gain_db][crate::model::audio_stream::AudioMapping::gain_db].
7696        ///
7697        /// # Example
7698        /// ```ignore,no_run
7699        /// # use google_cloud_video_transcoder_v1::model::audio_stream::AudioMapping;
7700        /// let x = AudioMapping::new().set_gain_db(42.0);
7701        /// ```
7702        pub fn set_gain_db<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
7703            self.gain_db = v.into();
7704            self
7705        }
7706    }
7707
7708    impl wkt::message::Message for AudioMapping {
7709        fn typename() -> &'static str {
7710            "type.googleapis.com/google.cloud.video.transcoder.v1.AudioStream.AudioMapping"
7711        }
7712    }
7713}
7714
7715/// Encoding of a text stream. For example, closed captions or subtitles.
7716#[derive(Clone, Default, PartialEq)]
7717#[non_exhaustive]
7718pub struct TextStream {
7719    /// The codec for this text stream. The default is `webvtt`.
7720    ///
7721    /// Supported text codecs:
7722    ///
7723    /// - `srt`
7724    /// - `ttml`
7725    /// - `cea608`
7726    /// - `cea708`
7727    /// - `webvtt`
7728    pub codec: std::string::String,
7729
7730    /// The BCP-47 language code, such as `en-US` or `sr-Latn`. For more
7731    /// information, see
7732    /// <https://www.unicode.org/reports/tr35/#Unicode_locale_identifier>. Not
7733    /// supported in MP4 files.
7734    pub language_code: std::string::String,
7735
7736    /// The mapping for the
7737    /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list]
7738    /// atoms with text
7739    /// [EditAtom.inputs][google.cloud.video.transcoder.v1.EditAtom.inputs].
7740    ///
7741    /// [google.cloud.video.transcoder.v1.EditAtom.inputs]: crate::model::EditAtom::inputs
7742    /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
7743    pub mapping: std::vec::Vec<crate::model::text_stream::TextMapping>,
7744
7745    /// The name for this particular text stream that
7746    /// will be added to the HLS/DASH manifest. Not supported in MP4 files.
7747    pub display_name: std::string::String,
7748
7749    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7750}
7751
7752impl TextStream {
7753    /// Creates a new default instance.
7754    pub fn new() -> Self {
7755        std::default::Default::default()
7756    }
7757
7758    /// Sets the value of [codec][crate::model::TextStream::codec].
7759    ///
7760    /// # Example
7761    /// ```ignore,no_run
7762    /// # use google_cloud_video_transcoder_v1::model::TextStream;
7763    /// let x = TextStream::new().set_codec("example");
7764    /// ```
7765    pub fn set_codec<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7766        self.codec = v.into();
7767        self
7768    }
7769
7770    /// Sets the value of [language_code][crate::model::TextStream::language_code].
7771    ///
7772    /// # Example
7773    /// ```ignore,no_run
7774    /// # use google_cloud_video_transcoder_v1::model::TextStream;
7775    /// let x = TextStream::new().set_language_code("example");
7776    /// ```
7777    pub fn set_language_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7778        self.language_code = v.into();
7779        self
7780    }
7781
7782    /// Sets the value of [mapping][crate::model::TextStream::mapping].
7783    ///
7784    /// # Example
7785    /// ```ignore,no_run
7786    /// # use google_cloud_video_transcoder_v1::model::TextStream;
7787    /// use google_cloud_video_transcoder_v1::model::text_stream::TextMapping;
7788    /// let x = TextStream::new()
7789    ///     .set_mapping([
7790    ///         TextMapping::default()/* use setters */,
7791    ///         TextMapping::default()/* use (different) setters */,
7792    ///     ]);
7793    /// ```
7794    pub fn set_mapping<T, V>(mut self, v: T) -> Self
7795    where
7796        T: std::iter::IntoIterator<Item = V>,
7797        V: std::convert::Into<crate::model::text_stream::TextMapping>,
7798    {
7799        use std::iter::Iterator;
7800        self.mapping = v.into_iter().map(|i| i.into()).collect();
7801        self
7802    }
7803
7804    /// Sets the value of [display_name][crate::model::TextStream::display_name].
7805    ///
7806    /// # Example
7807    /// ```ignore,no_run
7808    /// # use google_cloud_video_transcoder_v1::model::TextStream;
7809    /// let x = TextStream::new().set_display_name("example");
7810    /// ```
7811    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7812        self.display_name = v.into();
7813        self
7814    }
7815}
7816
7817impl wkt::message::Message for TextStream {
7818    fn typename() -> &'static str {
7819        "type.googleapis.com/google.cloud.video.transcoder.v1.TextStream"
7820    }
7821}
7822
7823/// Defines additional types related to [TextStream].
7824pub mod text_stream {
7825    #[allow(unused_imports)]
7826    use super::*;
7827
7828    /// The mapping for the
7829    /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list]
7830    /// atoms with text
7831    /// [EditAtom.inputs][google.cloud.video.transcoder.v1.EditAtom.inputs].
7832    ///
7833    /// [google.cloud.video.transcoder.v1.EditAtom.inputs]: crate::model::EditAtom::inputs
7834    /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
7835    #[derive(Clone, Default, PartialEq)]
7836    #[non_exhaustive]
7837    pub struct TextMapping {
7838        /// Required. The
7839        /// [EditAtom.key][google.cloud.video.transcoder.v1.EditAtom.key] that
7840        /// references atom with text inputs in the
7841        /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list].
7842        ///
7843        /// [google.cloud.video.transcoder.v1.EditAtom.key]: crate::model::EditAtom::key
7844        /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
7845        pub atom_key: std::string::String,
7846
7847        /// Required. The [Input.key][google.cloud.video.transcoder.v1.Input.key]
7848        /// that identifies the input file.
7849        ///
7850        /// [google.cloud.video.transcoder.v1.Input.key]: crate::model::Input::key
7851        pub input_key: std::string::String,
7852
7853        /// Required. The zero-based index of the track in the input file.
7854        pub input_track: i32,
7855
7856        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7857    }
7858
7859    impl TextMapping {
7860        /// Creates a new default instance.
7861        pub fn new() -> Self {
7862            std::default::Default::default()
7863        }
7864
7865        /// Sets the value of [atom_key][crate::model::text_stream::TextMapping::atom_key].
7866        ///
7867        /// # Example
7868        /// ```ignore,no_run
7869        /// # use google_cloud_video_transcoder_v1::model::text_stream::TextMapping;
7870        /// let x = TextMapping::new().set_atom_key("example");
7871        /// ```
7872        pub fn set_atom_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7873            self.atom_key = v.into();
7874            self
7875        }
7876
7877        /// Sets the value of [input_key][crate::model::text_stream::TextMapping::input_key].
7878        ///
7879        /// # Example
7880        /// ```ignore,no_run
7881        /// # use google_cloud_video_transcoder_v1::model::text_stream::TextMapping;
7882        /// let x = TextMapping::new().set_input_key("example");
7883        /// ```
7884        pub fn set_input_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7885            self.input_key = v.into();
7886            self
7887        }
7888
7889        /// Sets the value of [input_track][crate::model::text_stream::TextMapping::input_track].
7890        ///
7891        /// # Example
7892        /// ```ignore,no_run
7893        /// # use google_cloud_video_transcoder_v1::model::text_stream::TextMapping;
7894        /// let x = TextMapping::new().set_input_track(42);
7895        /// ```
7896        pub fn set_input_track<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7897            self.input_track = v.into();
7898            self
7899        }
7900    }
7901
7902    impl wkt::message::Message for TextMapping {
7903        fn typename() -> &'static str {
7904            "type.googleapis.com/google.cloud.video.transcoder.v1.TextStream.TextMapping"
7905        }
7906    }
7907}
7908
7909/// Segment settings for `ts`, `fmp4` and `vtt`.
7910#[derive(Clone, Default, PartialEq)]
7911#[non_exhaustive]
7912pub struct SegmentSettings {
7913    /// Duration of the segments in seconds. The default is `6.0s`. Note that
7914    /// `segmentDuration` must be greater than or equal to
7915    /// [`gopDuration`](#videostream), and `segmentDuration` must be divisible by
7916    /// [`gopDuration`](#videostream).
7917    pub segment_duration: std::option::Option<wkt::Duration>,
7918
7919    /// Required. Create an individual segment file. The default is `false`.
7920    pub individual_segments: bool,
7921
7922    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7923}
7924
7925impl SegmentSettings {
7926    /// Creates a new default instance.
7927    pub fn new() -> Self {
7928        std::default::Default::default()
7929    }
7930
7931    /// Sets the value of [segment_duration][crate::model::SegmentSettings::segment_duration].
7932    ///
7933    /// # Example
7934    /// ```ignore,no_run
7935    /// # use google_cloud_video_transcoder_v1::model::SegmentSettings;
7936    /// use wkt::Duration;
7937    /// let x = SegmentSettings::new().set_segment_duration(Duration::default()/* use setters */);
7938    /// ```
7939    pub fn set_segment_duration<T>(mut self, v: T) -> Self
7940    where
7941        T: std::convert::Into<wkt::Duration>,
7942    {
7943        self.segment_duration = std::option::Option::Some(v.into());
7944        self
7945    }
7946
7947    /// Sets or clears the value of [segment_duration][crate::model::SegmentSettings::segment_duration].
7948    ///
7949    /// # Example
7950    /// ```ignore,no_run
7951    /// # use google_cloud_video_transcoder_v1::model::SegmentSettings;
7952    /// use wkt::Duration;
7953    /// let x = SegmentSettings::new().set_or_clear_segment_duration(Some(Duration::default()/* use setters */));
7954    /// let x = SegmentSettings::new().set_or_clear_segment_duration(None::<Duration>);
7955    /// ```
7956    pub fn set_or_clear_segment_duration<T>(mut self, v: std::option::Option<T>) -> Self
7957    where
7958        T: std::convert::Into<wkt::Duration>,
7959    {
7960        self.segment_duration = v.map(|x| x.into());
7961        self
7962    }
7963
7964    /// Sets the value of [individual_segments][crate::model::SegmentSettings::individual_segments].
7965    ///
7966    /// # Example
7967    /// ```ignore,no_run
7968    /// # use google_cloud_video_transcoder_v1::model::SegmentSettings;
7969    /// let x = SegmentSettings::new().set_individual_segments(true);
7970    /// ```
7971    pub fn set_individual_segments<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7972        self.individual_segments = v.into();
7973        self
7974    }
7975}
7976
7977impl wkt::message::Message for SegmentSettings {
7978    fn typename() -> &'static str {
7979        "type.googleapis.com/google.cloud.video.transcoder.v1.SegmentSettings"
7980    }
7981}
7982
7983/// Encryption settings.
7984#[derive(Clone, Default, PartialEq)]
7985#[non_exhaustive]
7986pub struct Encryption {
7987    /// Required. Identifier for this set of encryption options.
7988    pub id: std::string::String,
7989
7990    /// Required. DRM system(s) to use; at least one must be specified. If a
7991    /// DRM system is omitted, it is considered disabled.
7992    pub drm_systems: std::option::Option<crate::model::encryption::DrmSystems>,
7993
7994    /// Encryption mode can be either `aes` or `cenc`.
7995    pub encryption_mode: std::option::Option<crate::model::encryption::EncryptionMode>,
7996
7997    /// Defines where content keys are stored.
7998    pub secret_source: std::option::Option<crate::model::encryption::SecretSource>,
7999
8000    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8001}
8002
8003impl Encryption {
8004    /// Creates a new default instance.
8005    pub fn new() -> Self {
8006        std::default::Default::default()
8007    }
8008
8009    /// Sets the value of [id][crate::model::Encryption::id].
8010    ///
8011    /// # Example
8012    /// ```ignore,no_run
8013    /// # use google_cloud_video_transcoder_v1::model::Encryption;
8014    /// let x = Encryption::new().set_id("example");
8015    /// ```
8016    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8017        self.id = v.into();
8018        self
8019    }
8020
8021    /// Sets the value of [drm_systems][crate::model::Encryption::drm_systems].
8022    ///
8023    /// # Example
8024    /// ```ignore,no_run
8025    /// # use google_cloud_video_transcoder_v1::model::Encryption;
8026    /// use google_cloud_video_transcoder_v1::model::encryption::DrmSystems;
8027    /// let x = Encryption::new().set_drm_systems(DrmSystems::default()/* use setters */);
8028    /// ```
8029    pub fn set_drm_systems<T>(mut self, v: T) -> Self
8030    where
8031        T: std::convert::Into<crate::model::encryption::DrmSystems>,
8032    {
8033        self.drm_systems = std::option::Option::Some(v.into());
8034        self
8035    }
8036
8037    /// Sets or clears the value of [drm_systems][crate::model::Encryption::drm_systems].
8038    ///
8039    /// # Example
8040    /// ```ignore,no_run
8041    /// # use google_cloud_video_transcoder_v1::model::Encryption;
8042    /// use google_cloud_video_transcoder_v1::model::encryption::DrmSystems;
8043    /// let x = Encryption::new().set_or_clear_drm_systems(Some(DrmSystems::default()/* use setters */));
8044    /// let x = Encryption::new().set_or_clear_drm_systems(None::<DrmSystems>);
8045    /// ```
8046    pub fn set_or_clear_drm_systems<T>(mut self, v: std::option::Option<T>) -> Self
8047    where
8048        T: std::convert::Into<crate::model::encryption::DrmSystems>,
8049    {
8050        self.drm_systems = v.map(|x| x.into());
8051        self
8052    }
8053
8054    /// Sets the value of [encryption_mode][crate::model::Encryption::encryption_mode].
8055    ///
8056    /// Note that all the setters affecting `encryption_mode` are mutually
8057    /// exclusive.
8058    ///
8059    /// # Example
8060    /// ```ignore,no_run
8061    /// # use google_cloud_video_transcoder_v1::model::Encryption;
8062    /// use google_cloud_video_transcoder_v1::model::encryption::Aes128Encryption;
8063    /// let x = Encryption::new().set_encryption_mode(Some(
8064    ///     google_cloud_video_transcoder_v1::model::encryption::EncryptionMode::Aes128(Aes128Encryption::default().into())));
8065    /// ```
8066    pub fn set_encryption_mode<
8067        T: std::convert::Into<std::option::Option<crate::model::encryption::EncryptionMode>>,
8068    >(
8069        mut self,
8070        v: T,
8071    ) -> Self {
8072        self.encryption_mode = v.into();
8073        self
8074    }
8075
8076    /// The value of [encryption_mode][crate::model::Encryption::encryption_mode]
8077    /// if it holds a `Aes128`, `None` if the field is not set or
8078    /// holds a different branch.
8079    pub fn aes_128(
8080        &self,
8081    ) -> std::option::Option<&std::boxed::Box<crate::model::encryption::Aes128Encryption>> {
8082        #[allow(unreachable_patterns)]
8083        self.encryption_mode.as_ref().and_then(|v| match v {
8084            crate::model::encryption::EncryptionMode::Aes128(v) => std::option::Option::Some(v),
8085            _ => std::option::Option::None,
8086        })
8087    }
8088
8089    /// Sets the value of [encryption_mode][crate::model::Encryption::encryption_mode]
8090    /// to hold a `Aes128`.
8091    ///
8092    /// Note that all the setters affecting `encryption_mode` are
8093    /// mutually exclusive.
8094    ///
8095    /// # Example
8096    /// ```ignore,no_run
8097    /// # use google_cloud_video_transcoder_v1::model::Encryption;
8098    /// use google_cloud_video_transcoder_v1::model::encryption::Aes128Encryption;
8099    /// let x = Encryption::new().set_aes_128(Aes128Encryption::default()/* use setters */);
8100    /// assert!(x.aes_128().is_some());
8101    /// assert!(x.sample_aes().is_none());
8102    /// assert!(x.mpeg_cenc().is_none());
8103    /// ```
8104    pub fn set_aes_128<
8105        T: std::convert::Into<std::boxed::Box<crate::model::encryption::Aes128Encryption>>,
8106    >(
8107        mut self,
8108        v: T,
8109    ) -> Self {
8110        self.encryption_mode =
8111            std::option::Option::Some(crate::model::encryption::EncryptionMode::Aes128(v.into()));
8112        self
8113    }
8114
8115    /// The value of [encryption_mode][crate::model::Encryption::encryption_mode]
8116    /// if it holds a `SampleAes`, `None` if the field is not set or
8117    /// holds a different branch.
8118    pub fn sample_aes(
8119        &self,
8120    ) -> std::option::Option<&std::boxed::Box<crate::model::encryption::SampleAesEncryption>> {
8121        #[allow(unreachable_patterns)]
8122        self.encryption_mode.as_ref().and_then(|v| match v {
8123            crate::model::encryption::EncryptionMode::SampleAes(v) => std::option::Option::Some(v),
8124            _ => std::option::Option::None,
8125        })
8126    }
8127
8128    /// Sets the value of [encryption_mode][crate::model::Encryption::encryption_mode]
8129    /// to hold a `SampleAes`.
8130    ///
8131    /// Note that all the setters affecting `encryption_mode` are
8132    /// mutually exclusive.
8133    ///
8134    /// # Example
8135    /// ```ignore,no_run
8136    /// # use google_cloud_video_transcoder_v1::model::Encryption;
8137    /// use google_cloud_video_transcoder_v1::model::encryption::SampleAesEncryption;
8138    /// let x = Encryption::new().set_sample_aes(SampleAesEncryption::default()/* use setters */);
8139    /// assert!(x.sample_aes().is_some());
8140    /// assert!(x.aes_128().is_none());
8141    /// assert!(x.mpeg_cenc().is_none());
8142    /// ```
8143    pub fn set_sample_aes<
8144        T: std::convert::Into<std::boxed::Box<crate::model::encryption::SampleAesEncryption>>,
8145    >(
8146        mut self,
8147        v: T,
8148    ) -> Self {
8149        self.encryption_mode = std::option::Option::Some(
8150            crate::model::encryption::EncryptionMode::SampleAes(v.into()),
8151        );
8152        self
8153    }
8154
8155    /// The value of [encryption_mode][crate::model::Encryption::encryption_mode]
8156    /// if it holds a `MpegCenc`, `None` if the field is not set or
8157    /// holds a different branch.
8158    pub fn mpeg_cenc(
8159        &self,
8160    ) -> std::option::Option<&std::boxed::Box<crate::model::encryption::MpegCommonEncryption>> {
8161        #[allow(unreachable_patterns)]
8162        self.encryption_mode.as_ref().and_then(|v| match v {
8163            crate::model::encryption::EncryptionMode::MpegCenc(v) => std::option::Option::Some(v),
8164            _ => std::option::Option::None,
8165        })
8166    }
8167
8168    /// Sets the value of [encryption_mode][crate::model::Encryption::encryption_mode]
8169    /// to hold a `MpegCenc`.
8170    ///
8171    /// Note that all the setters affecting `encryption_mode` are
8172    /// mutually exclusive.
8173    ///
8174    /// # Example
8175    /// ```ignore,no_run
8176    /// # use google_cloud_video_transcoder_v1::model::Encryption;
8177    /// use google_cloud_video_transcoder_v1::model::encryption::MpegCommonEncryption;
8178    /// let x = Encryption::new().set_mpeg_cenc(MpegCommonEncryption::default()/* use setters */);
8179    /// assert!(x.mpeg_cenc().is_some());
8180    /// assert!(x.aes_128().is_none());
8181    /// assert!(x.sample_aes().is_none());
8182    /// ```
8183    pub fn set_mpeg_cenc<
8184        T: std::convert::Into<std::boxed::Box<crate::model::encryption::MpegCommonEncryption>>,
8185    >(
8186        mut self,
8187        v: T,
8188    ) -> Self {
8189        self.encryption_mode =
8190            std::option::Option::Some(crate::model::encryption::EncryptionMode::MpegCenc(v.into()));
8191        self
8192    }
8193
8194    /// Sets the value of [secret_source][crate::model::Encryption::secret_source].
8195    ///
8196    /// Note that all the setters affecting `secret_source` are mutually
8197    /// exclusive.
8198    ///
8199    /// # Example
8200    /// ```ignore,no_run
8201    /// # use google_cloud_video_transcoder_v1::model::Encryption;
8202    /// use google_cloud_video_transcoder_v1::model::encryption::SecretManagerSource;
8203    /// let x = Encryption::new().set_secret_source(Some(
8204    ///     google_cloud_video_transcoder_v1::model::encryption::SecretSource::SecretManagerKeySource(SecretManagerSource::default().into())));
8205    /// ```
8206    pub fn set_secret_source<
8207        T: std::convert::Into<std::option::Option<crate::model::encryption::SecretSource>>,
8208    >(
8209        mut self,
8210        v: T,
8211    ) -> Self {
8212        self.secret_source = v.into();
8213        self
8214    }
8215
8216    /// The value of [secret_source][crate::model::Encryption::secret_source]
8217    /// if it holds a `SecretManagerKeySource`, `None` if the field is not set or
8218    /// holds a different branch.
8219    pub fn secret_manager_key_source(
8220        &self,
8221    ) -> std::option::Option<&std::boxed::Box<crate::model::encryption::SecretManagerSource>> {
8222        #[allow(unreachable_patterns)]
8223        self.secret_source.as_ref().and_then(|v| match v {
8224            crate::model::encryption::SecretSource::SecretManagerKeySource(v) => {
8225                std::option::Option::Some(v)
8226            }
8227            _ => std::option::Option::None,
8228        })
8229    }
8230
8231    /// Sets the value of [secret_source][crate::model::Encryption::secret_source]
8232    /// to hold a `SecretManagerKeySource`.
8233    ///
8234    /// Note that all the setters affecting `secret_source` are
8235    /// mutually exclusive.
8236    ///
8237    /// # Example
8238    /// ```ignore,no_run
8239    /// # use google_cloud_video_transcoder_v1::model::Encryption;
8240    /// use google_cloud_video_transcoder_v1::model::encryption::SecretManagerSource;
8241    /// let x = Encryption::new().set_secret_manager_key_source(SecretManagerSource::default()/* use setters */);
8242    /// assert!(x.secret_manager_key_source().is_some());
8243    /// ```
8244    pub fn set_secret_manager_key_source<
8245        T: std::convert::Into<std::boxed::Box<crate::model::encryption::SecretManagerSource>>,
8246    >(
8247        mut self,
8248        v: T,
8249    ) -> Self {
8250        self.secret_source = std::option::Option::Some(
8251            crate::model::encryption::SecretSource::SecretManagerKeySource(v.into()),
8252        );
8253        self
8254    }
8255}
8256
8257impl wkt::message::Message for Encryption {
8258    fn typename() -> &'static str {
8259        "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption"
8260    }
8261}
8262
8263/// Defines additional types related to [Encryption].
8264pub mod encryption {
8265    #[allow(unused_imports)]
8266    use super::*;
8267
8268    /// Configuration for AES-128 encryption.
8269    #[derive(Clone, Default, PartialEq)]
8270    #[non_exhaustive]
8271    pub struct Aes128Encryption {
8272        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8273    }
8274
8275    impl Aes128Encryption {
8276        /// Creates a new default instance.
8277        pub fn new() -> Self {
8278            std::default::Default::default()
8279        }
8280    }
8281
8282    impl wkt::message::Message for Aes128Encryption {
8283        fn typename() -> &'static str {
8284            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Aes128Encryption"
8285        }
8286    }
8287
8288    /// Configuration for SAMPLE-AES encryption.
8289    #[derive(Clone, Default, PartialEq)]
8290    #[non_exhaustive]
8291    pub struct SampleAesEncryption {
8292        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8293    }
8294
8295    impl SampleAesEncryption {
8296        /// Creates a new default instance.
8297        pub fn new() -> Self {
8298            std::default::Default::default()
8299        }
8300    }
8301
8302    impl wkt::message::Message for SampleAesEncryption {
8303        fn typename() -> &'static str {
8304            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.SampleAesEncryption"
8305        }
8306    }
8307
8308    /// Configuration for MPEG Common Encryption (MPEG-CENC).
8309    #[derive(Clone, Default, PartialEq)]
8310    #[non_exhaustive]
8311    pub struct MpegCommonEncryption {
8312        /// Required. Specify the encryption scheme.
8313        ///
8314        /// Supported encryption schemes:
8315        ///
8316        /// - `cenc`
8317        /// - `cbcs`
8318        pub scheme: std::string::String,
8319
8320        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8321    }
8322
8323    impl MpegCommonEncryption {
8324        /// Creates a new default instance.
8325        pub fn new() -> Self {
8326            std::default::Default::default()
8327        }
8328
8329        /// Sets the value of [scheme][crate::model::encryption::MpegCommonEncryption::scheme].
8330        ///
8331        /// # Example
8332        /// ```ignore,no_run
8333        /// # use google_cloud_video_transcoder_v1::model::encryption::MpegCommonEncryption;
8334        /// let x = MpegCommonEncryption::new().set_scheme("example");
8335        /// ```
8336        pub fn set_scheme<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8337            self.scheme = v.into();
8338            self
8339        }
8340    }
8341
8342    impl wkt::message::Message for MpegCommonEncryption {
8343        fn typename() -> &'static str {
8344            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.MpegCommonEncryption"
8345        }
8346    }
8347
8348    /// Configuration for secrets stored in Google Secret Manager.
8349    #[derive(Clone, Default, PartialEq)]
8350    #[non_exhaustive]
8351    pub struct SecretManagerSource {
8352        /// Required. The name of the Secret Version containing the encryption key in
8353        /// the following format:
8354        /// `projects/{project}/secrets/{secret_id}/versions/{version_number}`
8355        ///
8356        /// Note that only numbered versions are supported. Aliases like "latest" are
8357        /// not supported.
8358        pub secret_version: std::string::String,
8359
8360        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8361    }
8362
8363    impl SecretManagerSource {
8364        /// Creates a new default instance.
8365        pub fn new() -> Self {
8366            std::default::Default::default()
8367        }
8368
8369        /// Sets the value of [secret_version][crate::model::encryption::SecretManagerSource::secret_version].
8370        ///
8371        /// # Example
8372        /// ```ignore,no_run
8373        /// # use google_cloud_video_transcoder_v1::model::encryption::SecretManagerSource;
8374        /// let x = SecretManagerSource::new().set_secret_version("example");
8375        /// ```
8376        pub fn set_secret_version<T: std::convert::Into<std::string::String>>(
8377            mut self,
8378            v: T,
8379        ) -> Self {
8380            self.secret_version = v.into();
8381            self
8382        }
8383    }
8384
8385    impl wkt::message::Message for SecretManagerSource {
8386        fn typename() -> &'static str {
8387            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.SecretManagerSource"
8388        }
8389    }
8390
8391    /// Widevine configuration.
8392    #[derive(Clone, Default, PartialEq)]
8393    #[non_exhaustive]
8394    pub struct Widevine {
8395        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8396    }
8397
8398    impl Widevine {
8399        /// Creates a new default instance.
8400        pub fn new() -> Self {
8401            std::default::Default::default()
8402        }
8403    }
8404
8405    impl wkt::message::Message for Widevine {
8406        fn typename() -> &'static str {
8407            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Widevine"
8408        }
8409    }
8410
8411    /// Fairplay configuration.
8412    #[derive(Clone, Default, PartialEq)]
8413    #[non_exhaustive]
8414    pub struct Fairplay {
8415        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8416    }
8417
8418    impl Fairplay {
8419        /// Creates a new default instance.
8420        pub fn new() -> Self {
8421            std::default::Default::default()
8422        }
8423    }
8424
8425    impl wkt::message::Message for Fairplay {
8426        fn typename() -> &'static str {
8427            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Fairplay"
8428        }
8429    }
8430
8431    /// Playready configuration.
8432    #[derive(Clone, Default, PartialEq)]
8433    #[non_exhaustive]
8434    pub struct Playready {
8435        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8436    }
8437
8438    impl Playready {
8439        /// Creates a new default instance.
8440        pub fn new() -> Self {
8441            std::default::Default::default()
8442        }
8443    }
8444
8445    impl wkt::message::Message for Playready {
8446        fn typename() -> &'static str {
8447            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Playready"
8448        }
8449    }
8450
8451    /// Clearkey configuration.
8452    #[derive(Clone, Default, PartialEq)]
8453    #[non_exhaustive]
8454    pub struct Clearkey {
8455        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8456    }
8457
8458    impl Clearkey {
8459        /// Creates a new default instance.
8460        pub fn new() -> Self {
8461            std::default::Default::default()
8462        }
8463    }
8464
8465    impl wkt::message::Message for Clearkey {
8466        fn typename() -> &'static str {
8467            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Clearkey"
8468        }
8469    }
8470
8471    /// Defines configuration for DRM systems in use.
8472    #[derive(Clone, Default, PartialEq)]
8473    #[non_exhaustive]
8474    pub struct DrmSystems {
8475        /// Widevine configuration.
8476        pub widevine: std::option::Option<crate::model::encryption::Widevine>,
8477
8478        /// Fairplay configuration.
8479        pub fairplay: std::option::Option<crate::model::encryption::Fairplay>,
8480
8481        /// Playready configuration.
8482        pub playready: std::option::Option<crate::model::encryption::Playready>,
8483
8484        /// Clearkey configuration.
8485        pub clearkey: std::option::Option<crate::model::encryption::Clearkey>,
8486
8487        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8488    }
8489
8490    impl DrmSystems {
8491        /// Creates a new default instance.
8492        pub fn new() -> Self {
8493            std::default::Default::default()
8494        }
8495
8496        /// Sets the value of [widevine][crate::model::encryption::DrmSystems::widevine].
8497        ///
8498        /// # Example
8499        /// ```ignore,no_run
8500        /// # use google_cloud_video_transcoder_v1::model::encryption::DrmSystems;
8501        /// use google_cloud_video_transcoder_v1::model::encryption::Widevine;
8502        /// let x = DrmSystems::new().set_widevine(Widevine::default()/* use setters */);
8503        /// ```
8504        pub fn set_widevine<T>(mut self, v: T) -> Self
8505        where
8506            T: std::convert::Into<crate::model::encryption::Widevine>,
8507        {
8508            self.widevine = std::option::Option::Some(v.into());
8509            self
8510        }
8511
8512        /// Sets or clears the value of [widevine][crate::model::encryption::DrmSystems::widevine].
8513        ///
8514        /// # Example
8515        /// ```ignore,no_run
8516        /// # use google_cloud_video_transcoder_v1::model::encryption::DrmSystems;
8517        /// use google_cloud_video_transcoder_v1::model::encryption::Widevine;
8518        /// let x = DrmSystems::new().set_or_clear_widevine(Some(Widevine::default()/* use setters */));
8519        /// let x = DrmSystems::new().set_or_clear_widevine(None::<Widevine>);
8520        /// ```
8521        pub fn set_or_clear_widevine<T>(mut self, v: std::option::Option<T>) -> Self
8522        where
8523            T: std::convert::Into<crate::model::encryption::Widevine>,
8524        {
8525            self.widevine = v.map(|x| x.into());
8526            self
8527        }
8528
8529        /// Sets the value of [fairplay][crate::model::encryption::DrmSystems::fairplay].
8530        ///
8531        /// # Example
8532        /// ```ignore,no_run
8533        /// # use google_cloud_video_transcoder_v1::model::encryption::DrmSystems;
8534        /// use google_cloud_video_transcoder_v1::model::encryption::Fairplay;
8535        /// let x = DrmSystems::new().set_fairplay(Fairplay::default()/* use setters */);
8536        /// ```
8537        pub fn set_fairplay<T>(mut self, v: T) -> Self
8538        where
8539            T: std::convert::Into<crate::model::encryption::Fairplay>,
8540        {
8541            self.fairplay = std::option::Option::Some(v.into());
8542            self
8543        }
8544
8545        /// Sets or clears the value of [fairplay][crate::model::encryption::DrmSystems::fairplay].
8546        ///
8547        /// # Example
8548        /// ```ignore,no_run
8549        /// # use google_cloud_video_transcoder_v1::model::encryption::DrmSystems;
8550        /// use google_cloud_video_transcoder_v1::model::encryption::Fairplay;
8551        /// let x = DrmSystems::new().set_or_clear_fairplay(Some(Fairplay::default()/* use setters */));
8552        /// let x = DrmSystems::new().set_or_clear_fairplay(None::<Fairplay>);
8553        /// ```
8554        pub fn set_or_clear_fairplay<T>(mut self, v: std::option::Option<T>) -> Self
8555        where
8556            T: std::convert::Into<crate::model::encryption::Fairplay>,
8557        {
8558            self.fairplay = v.map(|x| x.into());
8559            self
8560        }
8561
8562        /// Sets the value of [playready][crate::model::encryption::DrmSystems::playready].
8563        ///
8564        /// # Example
8565        /// ```ignore,no_run
8566        /// # use google_cloud_video_transcoder_v1::model::encryption::DrmSystems;
8567        /// use google_cloud_video_transcoder_v1::model::encryption::Playready;
8568        /// let x = DrmSystems::new().set_playready(Playready::default()/* use setters */);
8569        /// ```
8570        pub fn set_playready<T>(mut self, v: T) -> Self
8571        where
8572            T: std::convert::Into<crate::model::encryption::Playready>,
8573        {
8574            self.playready = std::option::Option::Some(v.into());
8575            self
8576        }
8577
8578        /// Sets or clears the value of [playready][crate::model::encryption::DrmSystems::playready].
8579        ///
8580        /// # Example
8581        /// ```ignore,no_run
8582        /// # use google_cloud_video_transcoder_v1::model::encryption::DrmSystems;
8583        /// use google_cloud_video_transcoder_v1::model::encryption::Playready;
8584        /// let x = DrmSystems::new().set_or_clear_playready(Some(Playready::default()/* use setters */));
8585        /// let x = DrmSystems::new().set_or_clear_playready(None::<Playready>);
8586        /// ```
8587        pub fn set_or_clear_playready<T>(mut self, v: std::option::Option<T>) -> Self
8588        where
8589            T: std::convert::Into<crate::model::encryption::Playready>,
8590        {
8591            self.playready = v.map(|x| x.into());
8592            self
8593        }
8594
8595        /// Sets the value of [clearkey][crate::model::encryption::DrmSystems::clearkey].
8596        ///
8597        /// # Example
8598        /// ```ignore,no_run
8599        /// # use google_cloud_video_transcoder_v1::model::encryption::DrmSystems;
8600        /// use google_cloud_video_transcoder_v1::model::encryption::Clearkey;
8601        /// let x = DrmSystems::new().set_clearkey(Clearkey::default()/* use setters */);
8602        /// ```
8603        pub fn set_clearkey<T>(mut self, v: T) -> Self
8604        where
8605            T: std::convert::Into<crate::model::encryption::Clearkey>,
8606        {
8607            self.clearkey = std::option::Option::Some(v.into());
8608            self
8609        }
8610
8611        /// Sets or clears the value of [clearkey][crate::model::encryption::DrmSystems::clearkey].
8612        ///
8613        /// # Example
8614        /// ```ignore,no_run
8615        /// # use google_cloud_video_transcoder_v1::model::encryption::DrmSystems;
8616        /// use google_cloud_video_transcoder_v1::model::encryption::Clearkey;
8617        /// let x = DrmSystems::new().set_or_clear_clearkey(Some(Clearkey::default()/* use setters */));
8618        /// let x = DrmSystems::new().set_or_clear_clearkey(None::<Clearkey>);
8619        /// ```
8620        pub fn set_or_clear_clearkey<T>(mut self, v: std::option::Option<T>) -> Self
8621        where
8622            T: std::convert::Into<crate::model::encryption::Clearkey>,
8623        {
8624            self.clearkey = v.map(|x| x.into());
8625            self
8626        }
8627    }
8628
8629    impl wkt::message::Message for DrmSystems {
8630        fn typename() -> &'static str {
8631            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.DrmSystems"
8632        }
8633    }
8634
8635    /// Encryption mode can be either `aes` or `cenc`.
8636    #[derive(Clone, Debug, PartialEq)]
8637    #[non_exhaustive]
8638    pub enum EncryptionMode {
8639        /// Configuration for AES-128 encryption.
8640        Aes128(std::boxed::Box<crate::model::encryption::Aes128Encryption>),
8641        /// Configuration for SAMPLE-AES encryption.
8642        SampleAes(std::boxed::Box<crate::model::encryption::SampleAesEncryption>),
8643        /// Configuration for MPEG Common Encryption (MPEG-CENC).
8644        MpegCenc(std::boxed::Box<crate::model::encryption::MpegCommonEncryption>),
8645    }
8646
8647    /// Defines where content keys are stored.
8648    #[derive(Clone, Debug, PartialEq)]
8649    #[non_exhaustive]
8650    pub enum SecretSource {
8651        /// Keys are stored in Google Secret Manager.
8652        SecretManagerKeySource(std::boxed::Box<crate::model::encryption::SecretManagerSource>),
8653    }
8654}
8655
8656/// Request message for `TranscoderService.CreateJob`.
8657#[derive(Clone, Default, PartialEq)]
8658#[non_exhaustive]
8659pub struct CreateJobRequest {
8660    /// Required. The parent location to create and process this job.
8661    /// Format: `projects/{project}/locations/{location}`
8662    pub parent: std::string::String,
8663
8664    /// Required. Parameters for creating transcoding job.
8665    pub job: std::option::Option<crate::model::Job>,
8666
8667    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8668}
8669
8670impl CreateJobRequest {
8671    /// Creates a new default instance.
8672    pub fn new() -> Self {
8673        std::default::Default::default()
8674    }
8675
8676    /// Sets the value of [parent][crate::model::CreateJobRequest::parent].
8677    ///
8678    /// # Example
8679    /// ```ignore,no_run
8680    /// # use google_cloud_video_transcoder_v1::model::CreateJobRequest;
8681    /// let x = CreateJobRequest::new().set_parent("example");
8682    /// ```
8683    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8684        self.parent = v.into();
8685        self
8686    }
8687
8688    /// Sets the value of [job][crate::model::CreateJobRequest::job].
8689    ///
8690    /// # Example
8691    /// ```ignore,no_run
8692    /// # use google_cloud_video_transcoder_v1::model::CreateJobRequest;
8693    /// use google_cloud_video_transcoder_v1::model::Job;
8694    /// let x = CreateJobRequest::new().set_job(Job::default()/* use setters */);
8695    /// ```
8696    pub fn set_job<T>(mut self, v: T) -> Self
8697    where
8698        T: std::convert::Into<crate::model::Job>,
8699    {
8700        self.job = std::option::Option::Some(v.into());
8701        self
8702    }
8703
8704    /// Sets or clears the value of [job][crate::model::CreateJobRequest::job].
8705    ///
8706    /// # Example
8707    /// ```ignore,no_run
8708    /// # use google_cloud_video_transcoder_v1::model::CreateJobRequest;
8709    /// use google_cloud_video_transcoder_v1::model::Job;
8710    /// let x = CreateJobRequest::new().set_or_clear_job(Some(Job::default()/* use setters */));
8711    /// let x = CreateJobRequest::new().set_or_clear_job(None::<Job>);
8712    /// ```
8713    pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
8714    where
8715        T: std::convert::Into<crate::model::Job>,
8716    {
8717        self.job = v.map(|x| x.into());
8718        self
8719    }
8720}
8721
8722impl wkt::message::Message for CreateJobRequest {
8723    fn typename() -> &'static str {
8724        "type.googleapis.com/google.cloud.video.transcoder.v1.CreateJobRequest"
8725    }
8726}
8727
8728/// Request message for `TranscoderService.ListJobs`.
8729/// The parent location from which to retrieve the collection of jobs.
8730#[derive(Clone, Default, PartialEq)]
8731#[non_exhaustive]
8732pub struct ListJobsRequest {
8733    /// Required. Format: `projects/{project}/locations/{location}`
8734    pub parent: std::string::String,
8735
8736    /// The maximum number of items to return.
8737    pub page_size: i32,
8738
8739    /// The `next_page_token` value returned from a previous List request, if
8740    /// any.
8741    pub page_token: std::string::String,
8742
8743    /// The filter expression, following the syntax outlined in
8744    /// <https://google.aip.dev/160>.
8745    pub filter: std::string::String,
8746
8747    /// One or more fields to compare and use to sort the output.
8748    /// See <https://google.aip.dev/132#ordering>.
8749    pub order_by: std::string::String,
8750
8751    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8752}
8753
8754impl ListJobsRequest {
8755    /// Creates a new default instance.
8756    pub fn new() -> Self {
8757        std::default::Default::default()
8758    }
8759
8760    /// Sets the value of [parent][crate::model::ListJobsRequest::parent].
8761    ///
8762    /// # Example
8763    /// ```ignore,no_run
8764    /// # use google_cloud_video_transcoder_v1::model::ListJobsRequest;
8765    /// let x = ListJobsRequest::new().set_parent("example");
8766    /// ```
8767    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8768        self.parent = v.into();
8769        self
8770    }
8771
8772    /// Sets the value of [page_size][crate::model::ListJobsRequest::page_size].
8773    ///
8774    /// # Example
8775    /// ```ignore,no_run
8776    /// # use google_cloud_video_transcoder_v1::model::ListJobsRequest;
8777    /// let x = ListJobsRequest::new().set_page_size(42);
8778    /// ```
8779    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8780        self.page_size = v.into();
8781        self
8782    }
8783
8784    /// Sets the value of [page_token][crate::model::ListJobsRequest::page_token].
8785    ///
8786    /// # Example
8787    /// ```ignore,no_run
8788    /// # use google_cloud_video_transcoder_v1::model::ListJobsRequest;
8789    /// let x = ListJobsRequest::new().set_page_token("example");
8790    /// ```
8791    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8792        self.page_token = v.into();
8793        self
8794    }
8795
8796    /// Sets the value of [filter][crate::model::ListJobsRequest::filter].
8797    ///
8798    /// # Example
8799    /// ```ignore,no_run
8800    /// # use google_cloud_video_transcoder_v1::model::ListJobsRequest;
8801    /// let x = ListJobsRequest::new().set_filter("example");
8802    /// ```
8803    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8804        self.filter = v.into();
8805        self
8806    }
8807
8808    /// Sets the value of [order_by][crate::model::ListJobsRequest::order_by].
8809    ///
8810    /// # Example
8811    /// ```ignore,no_run
8812    /// # use google_cloud_video_transcoder_v1::model::ListJobsRequest;
8813    /// let x = ListJobsRequest::new().set_order_by("example");
8814    /// ```
8815    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8816        self.order_by = v.into();
8817        self
8818    }
8819}
8820
8821impl wkt::message::Message for ListJobsRequest {
8822    fn typename() -> &'static str {
8823        "type.googleapis.com/google.cloud.video.transcoder.v1.ListJobsRequest"
8824    }
8825}
8826
8827/// Request message for `TranscoderService.GetJob`.
8828#[derive(Clone, Default, PartialEq)]
8829#[non_exhaustive]
8830pub struct GetJobRequest {
8831    /// Required. The name of the job to retrieve.
8832    /// Format: `projects/{project}/locations/{location}/jobs/{job}`
8833    pub name: std::string::String,
8834
8835    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8836}
8837
8838impl GetJobRequest {
8839    /// Creates a new default instance.
8840    pub fn new() -> Self {
8841        std::default::Default::default()
8842    }
8843
8844    /// Sets the value of [name][crate::model::GetJobRequest::name].
8845    ///
8846    /// # Example
8847    /// ```ignore,no_run
8848    /// # use google_cloud_video_transcoder_v1::model::GetJobRequest;
8849    /// # let project_id = "project_id";
8850    /// # let location_id = "location_id";
8851    /// # let job_id = "job_id";
8852    /// let x = GetJobRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/jobs/{job_id}"));
8853    /// ```
8854    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8855        self.name = v.into();
8856        self
8857    }
8858}
8859
8860impl wkt::message::Message for GetJobRequest {
8861    fn typename() -> &'static str {
8862        "type.googleapis.com/google.cloud.video.transcoder.v1.GetJobRequest"
8863    }
8864}
8865
8866/// Request message for `TranscoderService.DeleteJob`.
8867#[derive(Clone, Default, PartialEq)]
8868#[non_exhaustive]
8869pub struct DeleteJobRequest {
8870    /// Required. The name of the job to delete.
8871    /// Format: `projects/{project}/locations/{location}/jobs/{job}`
8872    pub name: std::string::String,
8873
8874    /// If set to true, and the job is not found, the request will succeed but no
8875    /// action will be taken on the server.
8876    pub allow_missing: bool,
8877
8878    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8879}
8880
8881impl DeleteJobRequest {
8882    /// Creates a new default instance.
8883    pub fn new() -> Self {
8884        std::default::Default::default()
8885    }
8886
8887    /// Sets the value of [name][crate::model::DeleteJobRequest::name].
8888    ///
8889    /// # Example
8890    /// ```ignore,no_run
8891    /// # use google_cloud_video_transcoder_v1::model::DeleteJobRequest;
8892    /// # let project_id = "project_id";
8893    /// # let location_id = "location_id";
8894    /// # let job_id = "job_id";
8895    /// let x = DeleteJobRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/jobs/{job_id}"));
8896    /// ```
8897    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8898        self.name = v.into();
8899        self
8900    }
8901
8902    /// Sets the value of [allow_missing][crate::model::DeleteJobRequest::allow_missing].
8903    ///
8904    /// # Example
8905    /// ```ignore,no_run
8906    /// # use google_cloud_video_transcoder_v1::model::DeleteJobRequest;
8907    /// let x = DeleteJobRequest::new().set_allow_missing(true);
8908    /// ```
8909    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8910        self.allow_missing = v.into();
8911        self
8912    }
8913}
8914
8915impl wkt::message::Message for DeleteJobRequest {
8916    fn typename() -> &'static str {
8917        "type.googleapis.com/google.cloud.video.transcoder.v1.DeleteJobRequest"
8918    }
8919}
8920
8921/// Response message for `TranscoderService.ListJobs`.
8922#[derive(Clone, Default, PartialEq)]
8923#[non_exhaustive]
8924pub struct ListJobsResponse {
8925    /// List of jobs in the specified region.
8926    pub jobs: std::vec::Vec<crate::model::Job>,
8927
8928    /// The pagination token.
8929    pub next_page_token: std::string::String,
8930
8931    /// List of regions that could not be reached.
8932    pub unreachable: std::vec::Vec<std::string::String>,
8933
8934    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8935}
8936
8937impl ListJobsResponse {
8938    /// Creates a new default instance.
8939    pub fn new() -> Self {
8940        std::default::Default::default()
8941    }
8942
8943    /// Sets the value of [jobs][crate::model::ListJobsResponse::jobs].
8944    ///
8945    /// # Example
8946    /// ```ignore,no_run
8947    /// # use google_cloud_video_transcoder_v1::model::ListJobsResponse;
8948    /// use google_cloud_video_transcoder_v1::model::Job;
8949    /// let x = ListJobsResponse::new()
8950    ///     .set_jobs([
8951    ///         Job::default()/* use setters */,
8952    ///         Job::default()/* use (different) setters */,
8953    ///     ]);
8954    /// ```
8955    pub fn set_jobs<T, V>(mut self, v: T) -> Self
8956    where
8957        T: std::iter::IntoIterator<Item = V>,
8958        V: std::convert::Into<crate::model::Job>,
8959    {
8960        use std::iter::Iterator;
8961        self.jobs = v.into_iter().map(|i| i.into()).collect();
8962        self
8963    }
8964
8965    /// Sets the value of [next_page_token][crate::model::ListJobsResponse::next_page_token].
8966    ///
8967    /// # Example
8968    /// ```ignore,no_run
8969    /// # use google_cloud_video_transcoder_v1::model::ListJobsResponse;
8970    /// let x = ListJobsResponse::new().set_next_page_token("example");
8971    /// ```
8972    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8973        self.next_page_token = v.into();
8974        self
8975    }
8976
8977    /// Sets the value of [unreachable][crate::model::ListJobsResponse::unreachable].
8978    ///
8979    /// # Example
8980    /// ```ignore,no_run
8981    /// # use google_cloud_video_transcoder_v1::model::ListJobsResponse;
8982    /// let x = ListJobsResponse::new().set_unreachable(["a", "b", "c"]);
8983    /// ```
8984    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
8985    where
8986        T: std::iter::IntoIterator<Item = V>,
8987        V: std::convert::Into<std::string::String>,
8988    {
8989        use std::iter::Iterator;
8990        self.unreachable = v.into_iter().map(|i| i.into()).collect();
8991        self
8992    }
8993}
8994
8995impl wkt::message::Message for ListJobsResponse {
8996    fn typename() -> &'static str {
8997        "type.googleapis.com/google.cloud.video.transcoder.v1.ListJobsResponse"
8998    }
8999}
9000
9001#[doc(hidden)]
9002impl google_cloud_gax::paginator::internal::PageableResponse for ListJobsResponse {
9003    type PageItem = crate::model::Job;
9004
9005    fn items(self) -> std::vec::Vec<Self::PageItem> {
9006        self.jobs
9007    }
9008
9009    fn next_page_token(&self) -> std::string::String {
9010        use std::clone::Clone;
9011        self.next_page_token.clone()
9012    }
9013}
9014
9015/// Request message for `TranscoderService.CreateJobTemplate`.
9016#[derive(Clone, Default, PartialEq)]
9017#[non_exhaustive]
9018pub struct CreateJobTemplateRequest {
9019    /// Required. The parent location to create this job template.
9020    /// Format: `projects/{project}/locations/{location}`
9021    pub parent: std::string::String,
9022
9023    /// Required. Parameters for creating job template.
9024    pub job_template: std::option::Option<crate::model::JobTemplate>,
9025
9026    /// Required. The ID to use for the job template, which will become the final
9027    /// component of the job template's resource name.
9028    ///
9029    /// This value should be 4-63 characters, and valid characters must match the
9030    /// regular expression `[a-zA-Z][a-zA-Z0-9_-]*`.
9031    pub job_template_id: std::string::String,
9032
9033    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9034}
9035
9036impl CreateJobTemplateRequest {
9037    /// Creates a new default instance.
9038    pub fn new() -> Self {
9039        std::default::Default::default()
9040    }
9041
9042    /// Sets the value of [parent][crate::model::CreateJobTemplateRequest::parent].
9043    ///
9044    /// # Example
9045    /// ```ignore,no_run
9046    /// # use google_cloud_video_transcoder_v1::model::CreateJobTemplateRequest;
9047    /// let x = CreateJobTemplateRequest::new().set_parent("example");
9048    /// ```
9049    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9050        self.parent = v.into();
9051        self
9052    }
9053
9054    /// Sets the value of [job_template][crate::model::CreateJobTemplateRequest::job_template].
9055    ///
9056    /// # Example
9057    /// ```ignore,no_run
9058    /// # use google_cloud_video_transcoder_v1::model::CreateJobTemplateRequest;
9059    /// use google_cloud_video_transcoder_v1::model::JobTemplate;
9060    /// let x = CreateJobTemplateRequest::new().set_job_template(JobTemplate::default()/* use setters */);
9061    /// ```
9062    pub fn set_job_template<T>(mut self, v: T) -> Self
9063    where
9064        T: std::convert::Into<crate::model::JobTemplate>,
9065    {
9066        self.job_template = std::option::Option::Some(v.into());
9067        self
9068    }
9069
9070    /// Sets or clears the value of [job_template][crate::model::CreateJobTemplateRequest::job_template].
9071    ///
9072    /// # Example
9073    /// ```ignore,no_run
9074    /// # use google_cloud_video_transcoder_v1::model::CreateJobTemplateRequest;
9075    /// use google_cloud_video_transcoder_v1::model::JobTemplate;
9076    /// let x = CreateJobTemplateRequest::new().set_or_clear_job_template(Some(JobTemplate::default()/* use setters */));
9077    /// let x = CreateJobTemplateRequest::new().set_or_clear_job_template(None::<JobTemplate>);
9078    /// ```
9079    pub fn set_or_clear_job_template<T>(mut self, v: std::option::Option<T>) -> Self
9080    where
9081        T: std::convert::Into<crate::model::JobTemplate>,
9082    {
9083        self.job_template = v.map(|x| x.into());
9084        self
9085    }
9086
9087    /// Sets the value of [job_template_id][crate::model::CreateJobTemplateRequest::job_template_id].
9088    ///
9089    /// # Example
9090    /// ```ignore,no_run
9091    /// # use google_cloud_video_transcoder_v1::model::CreateJobTemplateRequest;
9092    /// let x = CreateJobTemplateRequest::new().set_job_template_id("example");
9093    /// ```
9094    pub fn set_job_template_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9095        self.job_template_id = v.into();
9096        self
9097    }
9098}
9099
9100impl wkt::message::Message for CreateJobTemplateRequest {
9101    fn typename() -> &'static str {
9102        "type.googleapis.com/google.cloud.video.transcoder.v1.CreateJobTemplateRequest"
9103    }
9104}
9105
9106/// Request message for `TranscoderService.ListJobTemplates`.
9107#[derive(Clone, Default, PartialEq)]
9108#[non_exhaustive]
9109pub struct ListJobTemplatesRequest {
9110    /// Required. The parent location from which to retrieve the collection of job
9111    /// templates. Format: `projects/{project}/locations/{location}`
9112    pub parent: std::string::String,
9113
9114    /// The maximum number of items to return.
9115    pub page_size: i32,
9116
9117    /// The `next_page_token` value returned from a previous List request, if
9118    /// any.
9119    pub page_token: std::string::String,
9120
9121    /// The filter expression, following the syntax outlined in
9122    /// <https://google.aip.dev/160>.
9123    pub filter: std::string::String,
9124
9125    /// One or more fields to compare and use to sort the output.
9126    /// See <https://google.aip.dev/132#ordering>.
9127    pub order_by: std::string::String,
9128
9129    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9130}
9131
9132impl ListJobTemplatesRequest {
9133    /// Creates a new default instance.
9134    pub fn new() -> Self {
9135        std::default::Default::default()
9136    }
9137
9138    /// Sets the value of [parent][crate::model::ListJobTemplatesRequest::parent].
9139    ///
9140    /// # Example
9141    /// ```ignore,no_run
9142    /// # use google_cloud_video_transcoder_v1::model::ListJobTemplatesRequest;
9143    /// let x = ListJobTemplatesRequest::new().set_parent("example");
9144    /// ```
9145    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9146        self.parent = v.into();
9147        self
9148    }
9149
9150    /// Sets the value of [page_size][crate::model::ListJobTemplatesRequest::page_size].
9151    ///
9152    /// # Example
9153    /// ```ignore,no_run
9154    /// # use google_cloud_video_transcoder_v1::model::ListJobTemplatesRequest;
9155    /// let x = ListJobTemplatesRequest::new().set_page_size(42);
9156    /// ```
9157    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9158        self.page_size = v.into();
9159        self
9160    }
9161
9162    /// Sets the value of [page_token][crate::model::ListJobTemplatesRequest::page_token].
9163    ///
9164    /// # Example
9165    /// ```ignore,no_run
9166    /// # use google_cloud_video_transcoder_v1::model::ListJobTemplatesRequest;
9167    /// let x = ListJobTemplatesRequest::new().set_page_token("example");
9168    /// ```
9169    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9170        self.page_token = v.into();
9171        self
9172    }
9173
9174    /// Sets the value of [filter][crate::model::ListJobTemplatesRequest::filter].
9175    ///
9176    /// # Example
9177    /// ```ignore,no_run
9178    /// # use google_cloud_video_transcoder_v1::model::ListJobTemplatesRequest;
9179    /// let x = ListJobTemplatesRequest::new().set_filter("example");
9180    /// ```
9181    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9182        self.filter = v.into();
9183        self
9184    }
9185
9186    /// Sets the value of [order_by][crate::model::ListJobTemplatesRequest::order_by].
9187    ///
9188    /// # Example
9189    /// ```ignore,no_run
9190    /// # use google_cloud_video_transcoder_v1::model::ListJobTemplatesRequest;
9191    /// let x = ListJobTemplatesRequest::new().set_order_by("example");
9192    /// ```
9193    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9194        self.order_by = v.into();
9195        self
9196    }
9197}
9198
9199impl wkt::message::Message for ListJobTemplatesRequest {
9200    fn typename() -> &'static str {
9201        "type.googleapis.com/google.cloud.video.transcoder.v1.ListJobTemplatesRequest"
9202    }
9203}
9204
9205/// Request message for `TranscoderService.GetJobTemplate`.
9206#[derive(Clone, Default, PartialEq)]
9207#[non_exhaustive]
9208pub struct GetJobTemplateRequest {
9209    /// Required. The name of the job template to retrieve.
9210    /// Format:
9211    /// `projects/{project}/locations/{location}/jobTemplates/{job_template}`
9212    pub name: std::string::String,
9213
9214    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9215}
9216
9217impl GetJobTemplateRequest {
9218    /// Creates a new default instance.
9219    pub fn new() -> Self {
9220        std::default::Default::default()
9221    }
9222
9223    /// Sets the value of [name][crate::model::GetJobTemplateRequest::name].
9224    ///
9225    /// # Example
9226    /// ```ignore,no_run
9227    /// # use google_cloud_video_transcoder_v1::model::GetJobTemplateRequest;
9228    /// # let project_id = "project_id";
9229    /// # let location_id = "location_id";
9230    /// # let job_template_id = "job_template_id";
9231    /// let x = GetJobTemplateRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/jobTemplates/{job_template_id}"));
9232    /// ```
9233    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9234        self.name = v.into();
9235        self
9236    }
9237}
9238
9239impl wkt::message::Message for GetJobTemplateRequest {
9240    fn typename() -> &'static str {
9241        "type.googleapis.com/google.cloud.video.transcoder.v1.GetJobTemplateRequest"
9242    }
9243}
9244
9245/// Request message for `TranscoderService.DeleteJobTemplate`.
9246#[derive(Clone, Default, PartialEq)]
9247#[non_exhaustive]
9248pub struct DeleteJobTemplateRequest {
9249    /// Required. The name of the job template to delete.
9250    /// `projects/{project}/locations/{location}/jobTemplates/{job_template}`
9251    pub name: std::string::String,
9252
9253    /// If set to true, and the job template is not found, the request will succeed
9254    /// but no action will be taken on the server.
9255    pub allow_missing: bool,
9256
9257    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9258}
9259
9260impl DeleteJobTemplateRequest {
9261    /// Creates a new default instance.
9262    pub fn new() -> Self {
9263        std::default::Default::default()
9264    }
9265
9266    /// Sets the value of [name][crate::model::DeleteJobTemplateRequest::name].
9267    ///
9268    /// # Example
9269    /// ```ignore,no_run
9270    /// # use google_cloud_video_transcoder_v1::model::DeleteJobTemplateRequest;
9271    /// # let project_id = "project_id";
9272    /// # let location_id = "location_id";
9273    /// # let job_template_id = "job_template_id";
9274    /// let x = DeleteJobTemplateRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/jobTemplates/{job_template_id}"));
9275    /// ```
9276    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9277        self.name = v.into();
9278        self
9279    }
9280
9281    /// Sets the value of [allow_missing][crate::model::DeleteJobTemplateRequest::allow_missing].
9282    ///
9283    /// # Example
9284    /// ```ignore,no_run
9285    /// # use google_cloud_video_transcoder_v1::model::DeleteJobTemplateRequest;
9286    /// let x = DeleteJobTemplateRequest::new().set_allow_missing(true);
9287    /// ```
9288    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9289        self.allow_missing = v.into();
9290        self
9291    }
9292}
9293
9294impl wkt::message::Message for DeleteJobTemplateRequest {
9295    fn typename() -> &'static str {
9296        "type.googleapis.com/google.cloud.video.transcoder.v1.DeleteJobTemplateRequest"
9297    }
9298}
9299
9300/// Response message for `TranscoderService.ListJobTemplates`.
9301#[derive(Clone, Default, PartialEq)]
9302#[non_exhaustive]
9303pub struct ListJobTemplatesResponse {
9304    /// List of job templates in the specified region.
9305    pub job_templates: std::vec::Vec<crate::model::JobTemplate>,
9306
9307    /// The pagination token.
9308    pub next_page_token: std::string::String,
9309
9310    /// List of regions that could not be reached.
9311    pub unreachable: std::vec::Vec<std::string::String>,
9312
9313    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9314}
9315
9316impl ListJobTemplatesResponse {
9317    /// Creates a new default instance.
9318    pub fn new() -> Self {
9319        std::default::Default::default()
9320    }
9321
9322    /// Sets the value of [job_templates][crate::model::ListJobTemplatesResponse::job_templates].
9323    ///
9324    /// # Example
9325    /// ```ignore,no_run
9326    /// # use google_cloud_video_transcoder_v1::model::ListJobTemplatesResponse;
9327    /// use google_cloud_video_transcoder_v1::model::JobTemplate;
9328    /// let x = ListJobTemplatesResponse::new()
9329    ///     .set_job_templates([
9330    ///         JobTemplate::default()/* use setters */,
9331    ///         JobTemplate::default()/* use (different) setters */,
9332    ///     ]);
9333    /// ```
9334    pub fn set_job_templates<T, V>(mut self, v: T) -> Self
9335    where
9336        T: std::iter::IntoIterator<Item = V>,
9337        V: std::convert::Into<crate::model::JobTemplate>,
9338    {
9339        use std::iter::Iterator;
9340        self.job_templates = v.into_iter().map(|i| i.into()).collect();
9341        self
9342    }
9343
9344    /// Sets the value of [next_page_token][crate::model::ListJobTemplatesResponse::next_page_token].
9345    ///
9346    /// # Example
9347    /// ```ignore,no_run
9348    /// # use google_cloud_video_transcoder_v1::model::ListJobTemplatesResponse;
9349    /// let x = ListJobTemplatesResponse::new().set_next_page_token("example");
9350    /// ```
9351    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9352        self.next_page_token = v.into();
9353        self
9354    }
9355
9356    /// Sets the value of [unreachable][crate::model::ListJobTemplatesResponse::unreachable].
9357    ///
9358    /// # Example
9359    /// ```ignore,no_run
9360    /// # use google_cloud_video_transcoder_v1::model::ListJobTemplatesResponse;
9361    /// let x = ListJobTemplatesResponse::new().set_unreachable(["a", "b", "c"]);
9362    /// ```
9363    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9364    where
9365        T: std::iter::IntoIterator<Item = V>,
9366        V: std::convert::Into<std::string::String>,
9367    {
9368        use std::iter::Iterator;
9369        self.unreachable = v.into_iter().map(|i| i.into()).collect();
9370        self
9371    }
9372}
9373
9374impl wkt::message::Message for ListJobTemplatesResponse {
9375    fn typename() -> &'static str {
9376        "type.googleapis.com/google.cloud.video.transcoder.v1.ListJobTemplatesResponse"
9377    }
9378}
9379
9380#[doc(hidden)]
9381impl google_cloud_gax::paginator::internal::PageableResponse for ListJobTemplatesResponse {
9382    type PageItem = crate::model::JobTemplate;
9383
9384    fn items(self) -> std::vec::Vec<Self::PageItem> {
9385        self.job_templates
9386    }
9387
9388    fn next_page_token(&self) -> std::string::String {
9389        use std::clone::Clone;
9390        self.next_page_token.clone()
9391    }
9392}