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