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