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::bare_urls)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![allow(rustdoc::invalid_html_tags)]
20#![allow(rustdoc::redundant_explicit_links)]
21#![no_implicit_prelude]
22extern crate async_trait;
23extern crate bytes;
24extern crate gaxi;
25extern crate google_cloud_gax;
26extern crate google_cloud_rpc;
27extern crate serde;
28extern crate serde_json;
29extern crate serde_with;
30extern crate std;
31extern crate tracing;
32extern crate wkt;
33
34mod debug;
35mod deserialize;
36mod serialize;
37
38/// Transcoding job resource.
39#[derive(Clone, Default, PartialEq)]
40#[non_exhaustive]
41pub struct Job {
42    /// The resource name of the job.
43    /// Format: `projects/{project_number}/locations/{location}/jobs/{job}`
44    pub name: std::string::String,
45
46    /// Input only. Specify the `input_uri` to populate empty `uri` fields in each
47    /// element of `Job.config.inputs` or `JobTemplate.config.inputs` when using
48    /// template. URI of the media. Input files must be at least 5 seconds in
49    /// duration and stored in Cloud Storage (for example,
50    /// `gs://bucket/inputs/file.mp4`). See [Supported input and output
51    /// formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats).
52    pub input_uri: std::string::String,
53
54    /// Input only. Specify the `output_uri` to populate an empty
55    /// `Job.config.output.uri` or `JobTemplate.config.output.uri` when using
56    /// template. URI for the output file(s). For example,
57    /// `gs://my-bucket/outputs/`. See [Supported input and output
58    /// formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats).
59    pub output_uri: std::string::String,
60
61    /// Output only. The current state of the job.
62    pub state: crate::model::job::ProcessingState,
63
64    /// Output only. The time the job was created.
65    pub create_time: std::option::Option<wkt::Timestamp>,
66
67    /// Output only. The time the transcoding started.
68    pub start_time: std::option::Option<wkt::Timestamp>,
69
70    /// Output only. The time the transcoding finished.
71    pub end_time: std::option::Option<wkt::Timestamp>,
72
73    /// Job time to live value in days, which will be effective after job
74    /// completion. Job should be deleted automatically after the given TTL. Enter
75    /// a value between 1 and 90. The default is 30.
76    pub ttl_after_completion_days: i32,
77
78    /// The labels associated with this job. You can use these to organize and
79    /// group your jobs.
80    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
81
82    /// Output only. An error object that describes the reason for the failure.
83    /// This property is always present when
84    /// [ProcessingState][google.cloud.video.transcoder.v1.Job.ProcessingState] is
85    /// `FAILED`.
86    ///
87    /// [google.cloud.video.transcoder.v1.Job.ProcessingState]: crate::model::job::ProcessingState
88    pub error: std::option::Option<google_cloud_rpc::model::Status>,
89
90    /// The processing mode of the job.
91    /// The default is `PROCESSING_MODE_INTERACTIVE`.
92    pub mode: crate::model::job::ProcessingMode,
93
94    /// The processing priority of a batch job.
95    /// This field can only be set for batch mode jobs. The default value is 0.
96    /// This value cannot be negative. Higher values correspond to higher
97    /// priorities for the job.
98    pub batch_mode_priority: i32,
99
100    /// Optional. The optimization strategy of the job. The default is
101    /// `AUTODETECT`.
102    pub optimization: crate::model::job::OptimizationStrategy,
103
104    /// Optional. Insert silence and duplicate frames when timestamp gaps are
105    /// detected in a given stream.
106    pub fill_content_gaps: bool,
107
108    /// Specify the config for the transcoding job. If you don't specify the
109    /// `job_config`, the API selects `templateId`; this template ID is set to
110    /// `preset/web-hd` by default. When you use a `template_id` to create a job,
111    /// the `Job.config` is populated by the `JobTemplate.config`.\<br\>
112    pub job_config: std::option::Option<crate::model::job::JobConfig>,
113
114    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
115}
116
117impl Job {
118    /// Creates a new default instance.
119    pub fn new() -> Self {
120        std::default::Default::default()
121    }
122
123    /// Sets the value of [name][crate::model::Job::name].
124    ///
125    /// # Example
126    /// ```ignore,no_run
127    /// # use google_cloud_video_transcoder_v1::model::Job;
128    /// # let project_id = "project_id";
129    /// # let location_id = "location_id";
130    /// # let job_id = "job_id";
131    /// let x = Job::new().set_name(format!("projects/{project_id}/locations/{location_id}/jobs/{job_id}"));
132    /// ```
133    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
134        self.name = v.into();
135        self
136    }
137
138    /// Sets the value of [input_uri][crate::model::Job::input_uri].
139    ///
140    /// # Example
141    /// ```ignore,no_run
142    /// # use google_cloud_video_transcoder_v1::model::Job;
143    /// let x = Job::new().set_input_uri("example");
144    /// ```
145    pub fn set_input_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
146        self.input_uri = v.into();
147        self
148    }
149
150    /// Sets the value of [output_uri][crate::model::Job::output_uri].
151    ///
152    /// # Example
153    /// ```ignore,no_run
154    /// # use google_cloud_video_transcoder_v1::model::Job;
155    /// let x = Job::new().set_output_uri("example");
156    /// ```
157    pub fn set_output_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
158        self.output_uri = v.into();
159        self
160    }
161
162    /// Sets the value of [state][crate::model::Job::state].
163    ///
164    /// # Example
165    /// ```ignore,no_run
166    /// # use google_cloud_video_transcoder_v1::model::Job;
167    /// use google_cloud_video_transcoder_v1::model::job::ProcessingState;
168    /// let x0 = Job::new().set_state(ProcessingState::Pending);
169    /// let x1 = Job::new().set_state(ProcessingState::Running);
170    /// let x2 = Job::new().set_state(ProcessingState::Succeeded);
171    /// ```
172    pub fn set_state<T: std::convert::Into<crate::model::job::ProcessingState>>(
173        mut self,
174        v: T,
175    ) -> Self {
176        self.state = v.into();
177        self
178    }
179
180    /// Sets the value of [create_time][crate::model::Job::create_time].
181    ///
182    /// # Example
183    /// ```ignore,no_run
184    /// # use google_cloud_video_transcoder_v1::model::Job;
185    /// use wkt::Timestamp;
186    /// let x = Job::new().set_create_time(Timestamp::default()/* use setters */);
187    /// ```
188    pub fn set_create_time<T>(mut self, v: T) -> Self
189    where
190        T: std::convert::Into<wkt::Timestamp>,
191    {
192        self.create_time = std::option::Option::Some(v.into());
193        self
194    }
195
196    /// Sets or clears the value of [create_time][crate::model::Job::create_time].
197    ///
198    /// # Example
199    /// ```ignore,no_run
200    /// # use google_cloud_video_transcoder_v1::model::Job;
201    /// use wkt::Timestamp;
202    /// let x = Job::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
203    /// let x = Job::new().set_or_clear_create_time(None::<Timestamp>);
204    /// ```
205    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
206    where
207        T: std::convert::Into<wkt::Timestamp>,
208    {
209        self.create_time = v.map(|x| x.into());
210        self
211    }
212
213    /// Sets the value of [start_time][crate::model::Job::start_time].
214    ///
215    /// # Example
216    /// ```ignore,no_run
217    /// # use google_cloud_video_transcoder_v1::model::Job;
218    /// use wkt::Timestamp;
219    /// let x = Job::new().set_start_time(Timestamp::default()/* use setters */);
220    /// ```
221    pub fn set_start_time<T>(mut self, v: T) -> Self
222    where
223        T: std::convert::Into<wkt::Timestamp>,
224    {
225        self.start_time = std::option::Option::Some(v.into());
226        self
227    }
228
229    /// Sets or clears the value of [start_time][crate::model::Job::start_time].
230    ///
231    /// # Example
232    /// ```ignore,no_run
233    /// # use google_cloud_video_transcoder_v1::model::Job;
234    /// use wkt::Timestamp;
235    /// let x = Job::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
236    /// let x = Job::new().set_or_clear_start_time(None::<Timestamp>);
237    /// ```
238    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
239    where
240        T: std::convert::Into<wkt::Timestamp>,
241    {
242        self.start_time = v.map(|x| x.into());
243        self
244    }
245
246    /// Sets the value of [end_time][crate::model::Job::end_time].
247    ///
248    /// # Example
249    /// ```ignore,no_run
250    /// # use google_cloud_video_transcoder_v1::model::Job;
251    /// use wkt::Timestamp;
252    /// let x = Job::new().set_end_time(Timestamp::default()/* use setters */);
253    /// ```
254    pub fn set_end_time<T>(mut self, v: T) -> Self
255    where
256        T: std::convert::Into<wkt::Timestamp>,
257    {
258        self.end_time = std::option::Option::Some(v.into());
259        self
260    }
261
262    /// Sets or clears the value of [end_time][crate::model::Job::end_time].
263    ///
264    /// # Example
265    /// ```ignore,no_run
266    /// # use google_cloud_video_transcoder_v1::model::Job;
267    /// use wkt::Timestamp;
268    /// let x = Job::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
269    /// let x = Job::new().set_or_clear_end_time(None::<Timestamp>);
270    /// ```
271    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
272    where
273        T: std::convert::Into<wkt::Timestamp>,
274    {
275        self.end_time = v.map(|x| x.into());
276        self
277    }
278
279    /// Sets the value of [ttl_after_completion_days][crate::model::Job::ttl_after_completion_days].
280    ///
281    /// # Example
282    /// ```ignore,no_run
283    /// # use google_cloud_video_transcoder_v1::model::Job;
284    /// let x = Job::new().set_ttl_after_completion_days(42);
285    /// ```
286    pub fn set_ttl_after_completion_days<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
287        self.ttl_after_completion_days = v.into();
288        self
289    }
290
291    /// Sets the value of [labels][crate::model::Job::labels].
292    ///
293    /// # Example
294    /// ```ignore,no_run
295    /// # use google_cloud_video_transcoder_v1::model::Job;
296    /// let x = Job::new().set_labels([
297    ///     ("key0", "abc"),
298    ///     ("key1", "xyz"),
299    /// ]);
300    /// ```
301    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
302    where
303        T: std::iter::IntoIterator<Item = (K, V)>,
304        K: std::convert::Into<std::string::String>,
305        V: std::convert::Into<std::string::String>,
306    {
307        use std::iter::Iterator;
308        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
309        self
310    }
311
312    /// Sets the value of [error][crate::model::Job::error].
313    ///
314    /// # Example
315    /// ```ignore,no_run
316    /// # use google_cloud_video_transcoder_v1::model::Job;
317    /// use google_cloud_rpc::model::Status;
318    /// let x = Job::new().set_error(Status::default()/* use setters */);
319    /// ```
320    pub fn set_error<T>(mut self, v: T) -> Self
321    where
322        T: std::convert::Into<google_cloud_rpc::model::Status>,
323    {
324        self.error = std::option::Option::Some(v.into());
325        self
326    }
327
328    /// Sets or clears the value of [error][crate::model::Job::error].
329    ///
330    /// # Example
331    /// ```ignore,no_run
332    /// # use google_cloud_video_transcoder_v1::model::Job;
333    /// use google_cloud_rpc::model::Status;
334    /// let x = Job::new().set_or_clear_error(Some(Status::default()/* use setters */));
335    /// let x = Job::new().set_or_clear_error(None::<Status>);
336    /// ```
337    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
338    where
339        T: std::convert::Into<google_cloud_rpc::model::Status>,
340    {
341        self.error = v.map(|x| x.into());
342        self
343    }
344
345    /// Sets the value of [mode][crate::model::Job::mode].
346    ///
347    /// # Example
348    /// ```ignore,no_run
349    /// # use google_cloud_video_transcoder_v1::model::Job;
350    /// use google_cloud_video_transcoder_v1::model::job::ProcessingMode;
351    /// let x0 = Job::new().set_mode(ProcessingMode::Interactive);
352    /// let x1 = Job::new().set_mode(ProcessingMode::Batch);
353    /// ```
354    pub fn set_mode<T: std::convert::Into<crate::model::job::ProcessingMode>>(
355        mut self,
356        v: T,
357    ) -> Self {
358        self.mode = v.into();
359        self
360    }
361
362    /// Sets the value of [batch_mode_priority][crate::model::Job::batch_mode_priority].
363    ///
364    /// # Example
365    /// ```ignore,no_run
366    /// # use google_cloud_video_transcoder_v1::model::Job;
367    /// let x = Job::new().set_batch_mode_priority(42);
368    /// ```
369    pub fn set_batch_mode_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
370        self.batch_mode_priority = v.into();
371        self
372    }
373
374    /// Sets the value of [optimization][crate::model::Job::optimization].
375    ///
376    /// # Example
377    /// ```ignore,no_run
378    /// # use google_cloud_video_transcoder_v1::model::Job;
379    /// use google_cloud_video_transcoder_v1::model::job::OptimizationStrategy;
380    /// let x0 = Job::new().set_optimization(OptimizationStrategy::Autodetect);
381    /// let x1 = Job::new().set_optimization(OptimizationStrategy::Disabled);
382    /// ```
383    pub fn set_optimization<T: std::convert::Into<crate::model::job::OptimizationStrategy>>(
384        mut self,
385        v: T,
386    ) -> Self {
387        self.optimization = v.into();
388        self
389    }
390
391    /// Sets the value of [fill_content_gaps][crate::model::Job::fill_content_gaps].
392    ///
393    /// # Example
394    /// ```ignore,no_run
395    /// # use google_cloud_video_transcoder_v1::model::Job;
396    /// let x = Job::new().set_fill_content_gaps(true);
397    /// ```
398    pub fn set_fill_content_gaps<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
399        self.fill_content_gaps = v.into();
400        self
401    }
402
403    /// Sets the value of [job_config][crate::model::Job::job_config].
404    ///
405    /// Note that all the setters affecting `job_config` are mutually
406    /// exclusive.
407    ///
408    /// # Example
409    /// ```ignore,no_run
410    /// # use google_cloud_video_transcoder_v1::model::Job;
411    /// use google_cloud_video_transcoder_v1::model::job::JobConfig;
412    /// let x = Job::new().set_job_config(Some(JobConfig::TemplateId("example".to_string())));
413    /// ```
414    pub fn set_job_config<
415        T: std::convert::Into<std::option::Option<crate::model::job::JobConfig>>,
416    >(
417        mut self,
418        v: T,
419    ) -> Self {
420        self.job_config = v.into();
421        self
422    }
423
424    /// The value of [job_config][crate::model::Job::job_config]
425    /// if it holds a `TemplateId`, `None` if the field is not set or
426    /// holds a different branch.
427    pub fn template_id(&self) -> std::option::Option<&std::string::String> {
428        #[allow(unreachable_patterns)]
429        self.job_config.as_ref().and_then(|v| match v {
430            crate::model::job::JobConfig::TemplateId(v) => std::option::Option::Some(v),
431            _ => std::option::Option::None,
432        })
433    }
434
435    /// Sets the value of [job_config][crate::model::Job::job_config]
436    /// to hold a `TemplateId`.
437    ///
438    /// Note that all the setters affecting `job_config` are
439    /// mutually exclusive.
440    ///
441    /// # Example
442    /// ```ignore,no_run
443    /// # use google_cloud_video_transcoder_v1::model::Job;
444    /// let x = Job::new().set_template_id("example");
445    /// assert!(x.template_id().is_some());
446    /// assert!(x.config().is_none());
447    /// ```
448    pub fn set_template_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
449        self.job_config =
450            std::option::Option::Some(crate::model::job::JobConfig::TemplateId(v.into()));
451        self
452    }
453
454    /// The value of [job_config][crate::model::Job::job_config]
455    /// if it holds a `Config`, `None` if the field is not set or
456    /// holds a different branch.
457    pub fn config(&self) -> std::option::Option<&std::boxed::Box<crate::model::JobConfig>> {
458        #[allow(unreachable_patterns)]
459        self.job_config.as_ref().and_then(|v| match v {
460            crate::model::job::JobConfig::Config(v) => std::option::Option::Some(v),
461            _ => std::option::Option::None,
462        })
463    }
464
465    /// Sets the value of [job_config][crate::model::Job::job_config]
466    /// to hold a `Config`.
467    ///
468    /// Note that all the setters affecting `job_config` are
469    /// mutually exclusive.
470    ///
471    /// # Example
472    /// ```ignore,no_run
473    /// # use google_cloud_video_transcoder_v1::model::Job;
474    /// use google_cloud_video_transcoder_v1::model::JobConfig;
475    /// let x = Job::new().set_config(JobConfig::default()/* use setters */);
476    /// assert!(x.config().is_some());
477    /// assert!(x.template_id().is_none());
478    /// ```
479    pub fn set_config<T: std::convert::Into<std::boxed::Box<crate::model::JobConfig>>>(
480        mut self,
481        v: T,
482    ) -> Self {
483        self.job_config = std::option::Option::Some(crate::model::job::JobConfig::Config(v.into()));
484        self
485    }
486}
487
488impl wkt::message::Message for Job {
489    fn typename() -> &'static str {
490        "type.googleapis.com/google.cloud.video.transcoder.v1.Job"
491    }
492}
493
494/// Defines additional types related to [Job].
495pub mod job {
496    #[allow(unused_imports)]
497    use super::*;
498
499    /// The current state of the job.
500    ///
501    /// # Working with unknown values
502    ///
503    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
504    /// additional enum variants at any time. Adding new variants is not considered
505    /// a breaking change. Applications should write their code in anticipation of:
506    ///
507    /// - New values appearing in future releases of the client library, **and**
508    /// - New values received dynamically, without application changes.
509    ///
510    /// Please consult the [Working with enums] section in the user guide for some
511    /// guidelines.
512    ///
513    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
514    #[derive(Clone, Debug, PartialEq)]
515    #[non_exhaustive]
516    pub enum ProcessingState {
517        /// The processing state is not specified.
518        Unspecified,
519        /// The job is enqueued and will be picked up for processing soon.
520        Pending,
521        /// The job is being processed.
522        Running,
523        /// The job has been completed successfully.
524        Succeeded,
525        /// The job has failed. For additional information, see
526        /// [Troubleshooting](https://cloud.google.com/transcoder/docs/troubleshooting).
527        Failed,
528        /// If set, the enum was initialized with an unknown value.
529        ///
530        /// Applications can examine the value using [ProcessingState::value] or
531        /// [ProcessingState::name].
532        UnknownValue(processing_state::UnknownValue),
533    }
534
535    #[doc(hidden)]
536    pub mod processing_state {
537        #[allow(unused_imports)]
538        use super::*;
539        #[derive(Clone, Debug, PartialEq)]
540        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
541    }
542
543    impl ProcessingState {
544        /// Gets the enum value.
545        ///
546        /// Returns `None` if the enum contains an unknown value deserialized from
547        /// the string representation of enums.
548        pub fn value(&self) -> std::option::Option<i32> {
549            match self {
550                Self::Unspecified => std::option::Option::Some(0),
551                Self::Pending => std::option::Option::Some(1),
552                Self::Running => std::option::Option::Some(2),
553                Self::Succeeded => std::option::Option::Some(3),
554                Self::Failed => std::option::Option::Some(4),
555                Self::UnknownValue(u) => u.0.value(),
556            }
557        }
558
559        /// Gets the enum value as a string.
560        ///
561        /// Returns `None` if the enum contains an unknown value deserialized from
562        /// the integer representation of enums.
563        pub fn name(&self) -> std::option::Option<&str> {
564            match self {
565                Self::Unspecified => std::option::Option::Some("PROCESSING_STATE_UNSPECIFIED"),
566                Self::Pending => std::option::Option::Some("PENDING"),
567                Self::Running => std::option::Option::Some("RUNNING"),
568                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
569                Self::Failed => std::option::Option::Some("FAILED"),
570                Self::UnknownValue(u) => u.0.name(),
571            }
572        }
573    }
574
575    impl std::default::Default for ProcessingState {
576        fn default() -> Self {
577            use std::convert::From;
578            Self::from(0)
579        }
580    }
581
582    impl std::fmt::Display for ProcessingState {
583        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
584            wkt::internal::display_enum(f, self.name(), self.value())
585        }
586    }
587
588    impl std::convert::From<i32> for ProcessingState {
589        fn from(value: i32) -> Self {
590            match value {
591                0 => Self::Unspecified,
592                1 => Self::Pending,
593                2 => Self::Running,
594                3 => Self::Succeeded,
595                4 => Self::Failed,
596                _ => Self::UnknownValue(processing_state::UnknownValue(
597                    wkt::internal::UnknownEnumValue::Integer(value),
598                )),
599            }
600        }
601    }
602
603    impl std::convert::From<&str> for ProcessingState {
604        fn from(value: &str) -> Self {
605            use std::string::ToString;
606            match value {
607                "PROCESSING_STATE_UNSPECIFIED" => Self::Unspecified,
608                "PENDING" => Self::Pending,
609                "RUNNING" => Self::Running,
610                "SUCCEEDED" => Self::Succeeded,
611                "FAILED" => Self::Failed,
612                _ => Self::UnknownValue(processing_state::UnknownValue(
613                    wkt::internal::UnknownEnumValue::String(value.to_string()),
614                )),
615            }
616        }
617    }
618
619    impl serde::ser::Serialize for ProcessingState {
620        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
621        where
622            S: serde::Serializer,
623        {
624            match self {
625                Self::Unspecified => serializer.serialize_i32(0),
626                Self::Pending => serializer.serialize_i32(1),
627                Self::Running => serializer.serialize_i32(2),
628                Self::Succeeded => serializer.serialize_i32(3),
629                Self::Failed => serializer.serialize_i32(4),
630                Self::UnknownValue(u) => u.0.serialize(serializer),
631            }
632        }
633    }
634
635    impl<'de> serde::de::Deserialize<'de> for ProcessingState {
636        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
637        where
638            D: serde::Deserializer<'de>,
639        {
640            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProcessingState>::new(
641                ".google.cloud.video.transcoder.v1.Job.ProcessingState",
642            ))
643        }
644    }
645
646    /// The processing mode of the job.
647    ///
648    /// # Working with unknown values
649    ///
650    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
651    /// additional enum variants at any time. Adding new variants is not considered
652    /// a breaking change. Applications should write their code in anticipation of:
653    ///
654    /// - New values appearing in future releases of the client library, **and**
655    /// - New values received dynamically, without application changes.
656    ///
657    /// Please consult the [Working with enums] section in the user guide for some
658    /// guidelines.
659    ///
660    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
661    #[derive(Clone, Debug, PartialEq)]
662    #[non_exhaustive]
663    pub enum ProcessingMode {
664        /// The job processing mode is not specified.
665        Unspecified,
666        /// The job processing mode is interactive mode.
667        /// Interactive job will either be ran or rejected if quota does not allow
668        /// for it.
669        Interactive,
670        /// The job processing mode is batch mode.
671        /// Batch mode allows queuing of jobs.
672        Batch,
673        /// If set, the enum was initialized with an unknown value.
674        ///
675        /// Applications can examine the value using [ProcessingMode::value] or
676        /// [ProcessingMode::name].
677        UnknownValue(processing_mode::UnknownValue),
678    }
679
680    #[doc(hidden)]
681    pub mod processing_mode {
682        #[allow(unused_imports)]
683        use super::*;
684        #[derive(Clone, Debug, PartialEq)]
685        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
686    }
687
688    impl ProcessingMode {
689        /// Gets the enum value.
690        ///
691        /// Returns `None` if the enum contains an unknown value deserialized from
692        /// the string representation of enums.
693        pub fn value(&self) -> std::option::Option<i32> {
694            match self {
695                Self::Unspecified => std::option::Option::Some(0),
696                Self::Interactive => std::option::Option::Some(1),
697                Self::Batch => std::option::Option::Some(2),
698                Self::UnknownValue(u) => u.0.value(),
699            }
700        }
701
702        /// Gets the enum value as a string.
703        ///
704        /// Returns `None` if the enum contains an unknown value deserialized from
705        /// the integer representation of enums.
706        pub fn name(&self) -> std::option::Option<&str> {
707            match self {
708                Self::Unspecified => std::option::Option::Some("PROCESSING_MODE_UNSPECIFIED"),
709                Self::Interactive => std::option::Option::Some("PROCESSING_MODE_INTERACTIVE"),
710                Self::Batch => std::option::Option::Some("PROCESSING_MODE_BATCH"),
711                Self::UnknownValue(u) => u.0.name(),
712            }
713        }
714    }
715
716    impl std::default::Default for ProcessingMode {
717        fn default() -> Self {
718            use std::convert::From;
719            Self::from(0)
720        }
721    }
722
723    impl std::fmt::Display for ProcessingMode {
724        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
725            wkt::internal::display_enum(f, self.name(), self.value())
726        }
727    }
728
729    impl std::convert::From<i32> for ProcessingMode {
730        fn from(value: i32) -> Self {
731            match value {
732                0 => Self::Unspecified,
733                1 => Self::Interactive,
734                2 => Self::Batch,
735                _ => Self::UnknownValue(processing_mode::UnknownValue(
736                    wkt::internal::UnknownEnumValue::Integer(value),
737                )),
738            }
739        }
740    }
741
742    impl std::convert::From<&str> for ProcessingMode {
743        fn from(value: &str) -> Self {
744            use std::string::ToString;
745            match value {
746                "PROCESSING_MODE_UNSPECIFIED" => Self::Unspecified,
747                "PROCESSING_MODE_INTERACTIVE" => Self::Interactive,
748                "PROCESSING_MODE_BATCH" => Self::Batch,
749                _ => Self::UnknownValue(processing_mode::UnknownValue(
750                    wkt::internal::UnknownEnumValue::String(value.to_string()),
751                )),
752            }
753        }
754    }
755
756    impl serde::ser::Serialize for ProcessingMode {
757        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
758        where
759            S: serde::Serializer,
760        {
761            match self {
762                Self::Unspecified => serializer.serialize_i32(0),
763                Self::Interactive => serializer.serialize_i32(1),
764                Self::Batch => serializer.serialize_i32(2),
765                Self::UnknownValue(u) => u.0.serialize(serializer),
766            }
767        }
768    }
769
770    impl<'de> serde::de::Deserialize<'de> for ProcessingMode {
771        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
772        where
773            D: serde::Deserializer<'de>,
774        {
775            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProcessingMode>::new(
776                ".google.cloud.video.transcoder.v1.Job.ProcessingMode",
777            ))
778        }
779    }
780
781    /// The optimization strategy of the job. The default is `AUTODETECT`.
782    ///
783    /// # Working with unknown values
784    ///
785    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
786    /// additional enum variants at any time. Adding new variants is not considered
787    /// a breaking change. Applications should write their code in anticipation of:
788    ///
789    /// - New values appearing in future releases of the client library, **and**
790    /// - New values received dynamically, without application changes.
791    ///
792    /// Please consult the [Working with enums] section in the user guide for some
793    /// guidelines.
794    ///
795    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
796    #[derive(Clone, Debug, PartialEq)]
797    #[non_exhaustive]
798    pub enum OptimizationStrategy {
799        /// The optimization strategy is not specified.
800        Unspecified,
801        /// Prioritize job processing speed.
802        Autodetect,
803        /// Disable all optimizations.
804        Disabled,
805        /// If set, the enum was initialized with an unknown value.
806        ///
807        /// Applications can examine the value using [OptimizationStrategy::value] or
808        /// [OptimizationStrategy::name].
809        UnknownValue(optimization_strategy::UnknownValue),
810    }
811
812    #[doc(hidden)]
813    pub mod optimization_strategy {
814        #[allow(unused_imports)]
815        use super::*;
816        #[derive(Clone, Debug, PartialEq)]
817        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
818    }
819
820    impl OptimizationStrategy {
821        /// Gets the enum value.
822        ///
823        /// Returns `None` if the enum contains an unknown value deserialized from
824        /// the string representation of enums.
825        pub fn value(&self) -> std::option::Option<i32> {
826            match self {
827                Self::Unspecified => std::option::Option::Some(0),
828                Self::Autodetect => std::option::Option::Some(1),
829                Self::Disabled => std::option::Option::Some(2),
830                Self::UnknownValue(u) => u.0.value(),
831            }
832        }
833
834        /// Gets the enum value as a string.
835        ///
836        /// Returns `None` if the enum contains an unknown value deserialized from
837        /// the integer representation of enums.
838        pub fn name(&self) -> std::option::Option<&str> {
839            match self {
840                Self::Unspecified => std::option::Option::Some("OPTIMIZATION_STRATEGY_UNSPECIFIED"),
841                Self::Autodetect => std::option::Option::Some("AUTODETECT"),
842                Self::Disabled => std::option::Option::Some("DISABLED"),
843                Self::UnknownValue(u) => u.0.name(),
844            }
845        }
846    }
847
848    impl std::default::Default for OptimizationStrategy {
849        fn default() -> Self {
850            use std::convert::From;
851            Self::from(0)
852        }
853    }
854
855    impl std::fmt::Display for OptimizationStrategy {
856        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
857            wkt::internal::display_enum(f, self.name(), self.value())
858        }
859    }
860
861    impl std::convert::From<i32> for OptimizationStrategy {
862        fn from(value: i32) -> Self {
863            match value {
864                0 => Self::Unspecified,
865                1 => Self::Autodetect,
866                2 => Self::Disabled,
867                _ => Self::UnknownValue(optimization_strategy::UnknownValue(
868                    wkt::internal::UnknownEnumValue::Integer(value),
869                )),
870            }
871        }
872    }
873
874    impl std::convert::From<&str> for OptimizationStrategy {
875        fn from(value: &str) -> Self {
876            use std::string::ToString;
877            match value {
878                "OPTIMIZATION_STRATEGY_UNSPECIFIED" => Self::Unspecified,
879                "AUTODETECT" => Self::Autodetect,
880                "DISABLED" => Self::Disabled,
881                _ => Self::UnknownValue(optimization_strategy::UnknownValue(
882                    wkt::internal::UnknownEnumValue::String(value.to_string()),
883                )),
884            }
885        }
886    }
887
888    impl serde::ser::Serialize for OptimizationStrategy {
889        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
890        where
891            S: serde::Serializer,
892        {
893            match self {
894                Self::Unspecified => serializer.serialize_i32(0),
895                Self::Autodetect => serializer.serialize_i32(1),
896                Self::Disabled => serializer.serialize_i32(2),
897                Self::UnknownValue(u) => u.0.serialize(serializer),
898            }
899        }
900    }
901
902    impl<'de> serde::de::Deserialize<'de> for OptimizationStrategy {
903        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
904        where
905            D: serde::Deserializer<'de>,
906        {
907            deserializer.deserialize_any(wkt::internal::EnumVisitor::<OptimizationStrategy>::new(
908                ".google.cloud.video.transcoder.v1.Job.OptimizationStrategy",
909            ))
910        }
911    }
912
913    /// Specify the config for the transcoding job. If you don't specify the
914    /// `job_config`, the API selects `templateId`; this template ID is set to
915    /// `preset/web-hd` by default. When you use a `template_id` to create a job,
916    /// the `Job.config` is populated by the `JobTemplate.config`.\<br\>
917    #[derive(Clone, Debug, PartialEq)]
918    #[non_exhaustive]
919    pub enum JobConfig {
920        /// Input only. Specify the `template_id` to use for populating `Job.config`.
921        /// The default is `preset/web-hd`, which is the only supported preset.
922        ///
923        /// User defined JobTemplate: `{job_template_id}`
924        TemplateId(std::string::String),
925        /// The configuration for this job.
926        Config(std::boxed::Box<crate::model::JobConfig>),
927    }
928}
929
930/// Transcoding job template resource.
931#[derive(Clone, Default, PartialEq)]
932#[non_exhaustive]
933pub struct JobTemplate {
934    /// The resource name of the job template.
935    /// Format:
936    /// `projects/{project_number}/locations/{location}/jobTemplates/{job_template}`
937    pub name: std::string::String,
938
939    /// The configuration for this template.
940    pub config: std::option::Option<crate::model::JobConfig>,
941
942    /// The labels associated with this job template. You can use these to organize
943    /// and group your job templates.
944    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
945
946    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
947}
948
949impl JobTemplate {
950    /// Creates a new default instance.
951    pub fn new() -> Self {
952        std::default::Default::default()
953    }
954
955    /// Sets the value of [name][crate::model::JobTemplate::name].
956    ///
957    /// # Example
958    /// ```ignore,no_run
959    /// # use google_cloud_video_transcoder_v1::model::JobTemplate;
960    /// # let project_id = "project_id";
961    /// # let location_id = "location_id";
962    /// # let job_template_id = "job_template_id";
963    /// let x = JobTemplate::new().set_name(format!("projects/{project_id}/locations/{location_id}/jobTemplates/{job_template_id}"));
964    /// ```
965    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
966        self.name = v.into();
967        self
968    }
969
970    /// Sets the value of [config][crate::model::JobTemplate::config].
971    ///
972    /// # Example
973    /// ```ignore,no_run
974    /// # use google_cloud_video_transcoder_v1::model::JobTemplate;
975    /// use google_cloud_video_transcoder_v1::model::JobConfig;
976    /// let x = JobTemplate::new().set_config(JobConfig::default()/* use setters */);
977    /// ```
978    pub fn set_config<T>(mut self, v: T) -> Self
979    where
980        T: std::convert::Into<crate::model::JobConfig>,
981    {
982        self.config = std::option::Option::Some(v.into());
983        self
984    }
985
986    /// Sets or clears the value of [config][crate::model::JobTemplate::config].
987    ///
988    /// # Example
989    /// ```ignore,no_run
990    /// # use google_cloud_video_transcoder_v1::model::JobTemplate;
991    /// use google_cloud_video_transcoder_v1::model::JobConfig;
992    /// let x = JobTemplate::new().set_or_clear_config(Some(JobConfig::default()/* use setters */));
993    /// let x = JobTemplate::new().set_or_clear_config(None::<JobConfig>);
994    /// ```
995    pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
996    where
997        T: std::convert::Into<crate::model::JobConfig>,
998    {
999        self.config = v.map(|x| x.into());
1000        self
1001    }
1002
1003    /// Sets the value of [labels][crate::model::JobTemplate::labels].
1004    ///
1005    /// # Example
1006    /// ```ignore,no_run
1007    /// # use google_cloud_video_transcoder_v1::model::JobTemplate;
1008    /// let x = JobTemplate::new().set_labels([
1009    ///     ("key0", "abc"),
1010    ///     ("key1", "xyz"),
1011    /// ]);
1012    /// ```
1013    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1014    where
1015        T: std::iter::IntoIterator<Item = (K, V)>,
1016        K: std::convert::Into<std::string::String>,
1017        V: std::convert::Into<std::string::String>,
1018    {
1019        use std::iter::Iterator;
1020        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1021        self
1022    }
1023}
1024
1025impl wkt::message::Message for JobTemplate {
1026    fn typename() -> &'static str {
1027        "type.googleapis.com/google.cloud.video.transcoder.v1.JobTemplate"
1028    }
1029}
1030
1031/// Job configuration
1032#[derive(Clone, Default, PartialEq)]
1033#[non_exhaustive]
1034pub struct JobConfig {
1035    /// List of input assets stored in Cloud Storage.
1036    pub inputs: std::vec::Vec<crate::model::Input>,
1037
1038    /// List of edit atoms. Defines the ultimate timeline of the resulting
1039    /// file or manifest.
1040    pub edit_list: std::vec::Vec<crate::model::EditAtom>,
1041
1042    /// List of elementary streams.
1043    pub elementary_streams: std::vec::Vec<crate::model::ElementaryStream>,
1044
1045    /// List of multiplexing settings for output streams.
1046    pub mux_streams: std::vec::Vec<crate::model::MuxStream>,
1047
1048    /// List of output manifests.
1049    pub manifests: std::vec::Vec<crate::model::Manifest>,
1050
1051    /// Output configuration.
1052    pub output: std::option::Option<crate::model::Output>,
1053
1054    /// List of ad breaks. Specifies where to insert ad break tags in the output
1055    /// manifests.
1056    pub ad_breaks: std::vec::Vec<crate::model::AdBreak>,
1057
1058    /// Destination on Pub/Sub.
1059    pub pubsub_destination: std::option::Option<crate::model::PubsubDestination>,
1060
1061    /// List of output sprite sheets.
1062    /// Spritesheets require at least one VideoStream in the Jobconfig.
1063    pub sprite_sheets: std::vec::Vec<crate::model::SpriteSheet>,
1064
1065    /// List of overlays on the output video, in descending Z-order.
1066    pub overlays: std::vec::Vec<crate::model::Overlay>,
1067
1068    /// List of encryption configurations for the content.
1069    /// Each configuration has an ID. Specify this ID in the
1070    /// [MuxStream.encryption_id][google.cloud.video.transcoder.v1.MuxStream.encryption_id]
1071    /// field to indicate the configuration to use for that `MuxStream` output.
1072    ///
1073    /// [google.cloud.video.transcoder.v1.MuxStream.encryption_id]: crate::model::MuxStream::encryption_id
1074    pub encryptions: std::vec::Vec<crate::model::Encryption>,
1075
1076    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1077}
1078
1079impl JobConfig {
1080    /// Creates a new default instance.
1081    pub fn new() -> Self {
1082        std::default::Default::default()
1083    }
1084
1085    /// Sets the value of [inputs][crate::model::JobConfig::inputs].
1086    ///
1087    /// # Example
1088    /// ```ignore,no_run
1089    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1090    /// use google_cloud_video_transcoder_v1::model::Input;
1091    /// let x = JobConfig::new()
1092    ///     .set_inputs([
1093    ///         Input::default()/* use setters */,
1094    ///         Input::default()/* use (different) setters */,
1095    ///     ]);
1096    /// ```
1097    pub fn set_inputs<T, V>(mut self, v: T) -> Self
1098    where
1099        T: std::iter::IntoIterator<Item = V>,
1100        V: std::convert::Into<crate::model::Input>,
1101    {
1102        use std::iter::Iterator;
1103        self.inputs = v.into_iter().map(|i| i.into()).collect();
1104        self
1105    }
1106
1107    /// Sets the value of [edit_list][crate::model::JobConfig::edit_list].
1108    ///
1109    /// # Example
1110    /// ```ignore,no_run
1111    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1112    /// use google_cloud_video_transcoder_v1::model::EditAtom;
1113    /// let x = JobConfig::new()
1114    ///     .set_edit_list([
1115    ///         EditAtom::default()/* use setters */,
1116    ///         EditAtom::default()/* use (different) setters */,
1117    ///     ]);
1118    /// ```
1119    pub fn set_edit_list<T, V>(mut self, v: T) -> Self
1120    where
1121        T: std::iter::IntoIterator<Item = V>,
1122        V: std::convert::Into<crate::model::EditAtom>,
1123    {
1124        use std::iter::Iterator;
1125        self.edit_list = v.into_iter().map(|i| i.into()).collect();
1126        self
1127    }
1128
1129    /// Sets the value of [elementary_streams][crate::model::JobConfig::elementary_streams].
1130    ///
1131    /// # Example
1132    /// ```ignore,no_run
1133    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1134    /// use google_cloud_video_transcoder_v1::model::ElementaryStream;
1135    /// let x = JobConfig::new()
1136    ///     .set_elementary_streams([
1137    ///         ElementaryStream::default()/* use setters */,
1138    ///         ElementaryStream::default()/* use (different) setters */,
1139    ///     ]);
1140    /// ```
1141    pub fn set_elementary_streams<T, V>(mut self, v: T) -> Self
1142    where
1143        T: std::iter::IntoIterator<Item = V>,
1144        V: std::convert::Into<crate::model::ElementaryStream>,
1145    {
1146        use std::iter::Iterator;
1147        self.elementary_streams = v.into_iter().map(|i| i.into()).collect();
1148        self
1149    }
1150
1151    /// Sets the value of [mux_streams][crate::model::JobConfig::mux_streams].
1152    ///
1153    /// # Example
1154    /// ```ignore,no_run
1155    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1156    /// use google_cloud_video_transcoder_v1::model::MuxStream;
1157    /// let x = JobConfig::new()
1158    ///     .set_mux_streams([
1159    ///         MuxStream::default()/* use setters */,
1160    ///         MuxStream::default()/* use (different) setters */,
1161    ///     ]);
1162    /// ```
1163    pub fn set_mux_streams<T, V>(mut self, v: T) -> Self
1164    where
1165        T: std::iter::IntoIterator<Item = V>,
1166        V: std::convert::Into<crate::model::MuxStream>,
1167    {
1168        use std::iter::Iterator;
1169        self.mux_streams = v.into_iter().map(|i| i.into()).collect();
1170        self
1171    }
1172
1173    /// Sets the value of [manifests][crate::model::JobConfig::manifests].
1174    ///
1175    /// # Example
1176    /// ```ignore,no_run
1177    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1178    /// use google_cloud_video_transcoder_v1::model::Manifest;
1179    /// let x = JobConfig::new()
1180    ///     .set_manifests([
1181    ///         Manifest::default()/* use setters */,
1182    ///         Manifest::default()/* use (different) setters */,
1183    ///     ]);
1184    /// ```
1185    pub fn set_manifests<T, V>(mut self, v: T) -> Self
1186    where
1187        T: std::iter::IntoIterator<Item = V>,
1188        V: std::convert::Into<crate::model::Manifest>,
1189    {
1190        use std::iter::Iterator;
1191        self.manifests = v.into_iter().map(|i| i.into()).collect();
1192        self
1193    }
1194
1195    /// Sets the value of [output][crate::model::JobConfig::output].
1196    ///
1197    /// # Example
1198    /// ```ignore,no_run
1199    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1200    /// use google_cloud_video_transcoder_v1::model::Output;
1201    /// let x = JobConfig::new().set_output(Output::default()/* use setters */);
1202    /// ```
1203    pub fn set_output<T>(mut self, v: T) -> Self
1204    where
1205        T: std::convert::Into<crate::model::Output>,
1206    {
1207        self.output = std::option::Option::Some(v.into());
1208        self
1209    }
1210
1211    /// Sets or clears the value of [output][crate::model::JobConfig::output].
1212    ///
1213    /// # Example
1214    /// ```ignore,no_run
1215    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1216    /// use google_cloud_video_transcoder_v1::model::Output;
1217    /// let x = JobConfig::new().set_or_clear_output(Some(Output::default()/* use setters */));
1218    /// let x = JobConfig::new().set_or_clear_output(None::<Output>);
1219    /// ```
1220    pub fn set_or_clear_output<T>(mut self, v: std::option::Option<T>) -> Self
1221    where
1222        T: std::convert::Into<crate::model::Output>,
1223    {
1224        self.output = v.map(|x| x.into());
1225        self
1226    }
1227
1228    /// Sets the value of [ad_breaks][crate::model::JobConfig::ad_breaks].
1229    ///
1230    /// # Example
1231    /// ```ignore,no_run
1232    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1233    /// use google_cloud_video_transcoder_v1::model::AdBreak;
1234    /// let x = JobConfig::new()
1235    ///     .set_ad_breaks([
1236    ///         AdBreak::default()/* use setters */,
1237    ///         AdBreak::default()/* use (different) setters */,
1238    ///     ]);
1239    /// ```
1240    pub fn set_ad_breaks<T, V>(mut self, v: T) -> Self
1241    where
1242        T: std::iter::IntoIterator<Item = V>,
1243        V: std::convert::Into<crate::model::AdBreak>,
1244    {
1245        use std::iter::Iterator;
1246        self.ad_breaks = v.into_iter().map(|i| i.into()).collect();
1247        self
1248    }
1249
1250    /// Sets the value of [pubsub_destination][crate::model::JobConfig::pubsub_destination].
1251    ///
1252    /// # Example
1253    /// ```ignore,no_run
1254    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1255    /// use google_cloud_video_transcoder_v1::model::PubsubDestination;
1256    /// let x = JobConfig::new().set_pubsub_destination(PubsubDestination::default()/* use setters */);
1257    /// ```
1258    pub fn set_pubsub_destination<T>(mut self, v: T) -> Self
1259    where
1260        T: std::convert::Into<crate::model::PubsubDestination>,
1261    {
1262        self.pubsub_destination = std::option::Option::Some(v.into());
1263        self
1264    }
1265
1266    /// Sets or clears the value of [pubsub_destination][crate::model::JobConfig::pubsub_destination].
1267    ///
1268    /// # Example
1269    /// ```ignore,no_run
1270    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1271    /// use google_cloud_video_transcoder_v1::model::PubsubDestination;
1272    /// let x = JobConfig::new().set_or_clear_pubsub_destination(Some(PubsubDestination::default()/* use setters */));
1273    /// let x = JobConfig::new().set_or_clear_pubsub_destination(None::<PubsubDestination>);
1274    /// ```
1275    pub fn set_or_clear_pubsub_destination<T>(mut self, v: std::option::Option<T>) -> Self
1276    where
1277        T: std::convert::Into<crate::model::PubsubDestination>,
1278    {
1279        self.pubsub_destination = v.map(|x| x.into());
1280        self
1281    }
1282
1283    /// Sets the value of [sprite_sheets][crate::model::JobConfig::sprite_sheets].
1284    ///
1285    /// # Example
1286    /// ```ignore,no_run
1287    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1288    /// use google_cloud_video_transcoder_v1::model::SpriteSheet;
1289    /// let x = JobConfig::new()
1290    ///     .set_sprite_sheets([
1291    ///         SpriteSheet::default()/* use setters */,
1292    ///         SpriteSheet::default()/* use (different) setters */,
1293    ///     ]);
1294    /// ```
1295    pub fn set_sprite_sheets<T, V>(mut self, v: T) -> Self
1296    where
1297        T: std::iter::IntoIterator<Item = V>,
1298        V: std::convert::Into<crate::model::SpriteSheet>,
1299    {
1300        use std::iter::Iterator;
1301        self.sprite_sheets = v.into_iter().map(|i| i.into()).collect();
1302        self
1303    }
1304
1305    /// Sets the value of [overlays][crate::model::JobConfig::overlays].
1306    ///
1307    /// # Example
1308    /// ```ignore,no_run
1309    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1310    /// use google_cloud_video_transcoder_v1::model::Overlay;
1311    /// let x = JobConfig::new()
1312    ///     .set_overlays([
1313    ///         Overlay::default()/* use setters */,
1314    ///         Overlay::default()/* use (different) setters */,
1315    ///     ]);
1316    /// ```
1317    pub fn set_overlays<T, V>(mut self, v: T) -> Self
1318    where
1319        T: std::iter::IntoIterator<Item = V>,
1320        V: std::convert::Into<crate::model::Overlay>,
1321    {
1322        use std::iter::Iterator;
1323        self.overlays = v.into_iter().map(|i| i.into()).collect();
1324        self
1325    }
1326
1327    /// Sets the value of [encryptions][crate::model::JobConfig::encryptions].
1328    ///
1329    /// # Example
1330    /// ```ignore,no_run
1331    /// # use google_cloud_video_transcoder_v1::model::JobConfig;
1332    /// use google_cloud_video_transcoder_v1::model::Encryption;
1333    /// let x = JobConfig::new()
1334    ///     .set_encryptions([
1335    ///         Encryption::default()/* use setters */,
1336    ///         Encryption::default()/* use (different) setters */,
1337    ///     ]);
1338    /// ```
1339    pub fn set_encryptions<T, V>(mut self, v: T) -> Self
1340    where
1341        T: std::iter::IntoIterator<Item = V>,
1342        V: std::convert::Into<crate::model::Encryption>,
1343    {
1344        use std::iter::Iterator;
1345        self.encryptions = v.into_iter().map(|i| i.into()).collect();
1346        self
1347    }
1348}
1349
1350impl wkt::message::Message for JobConfig {
1351    fn typename() -> &'static str {
1352        "type.googleapis.com/google.cloud.video.transcoder.v1.JobConfig"
1353    }
1354}
1355
1356/// Input asset.
1357#[derive(Clone, Default, PartialEq)]
1358#[non_exhaustive]
1359pub struct Input {
1360    /// A unique key for this input. Must be specified when using advanced
1361    /// mapping and edit lists.
1362    pub key: std::string::String,
1363
1364    /// URI of the media. Input files must be at least 5 seconds in duration and
1365    /// stored in Cloud Storage (for example, `gs://bucket/inputs/file.mp4`).
1366    /// If empty, the value is populated from
1367    /// [Job.input_uri][google.cloud.video.transcoder.v1.Job.input_uri]. See
1368    /// [Supported input and output
1369    /// formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats).
1370    ///
1371    /// [google.cloud.video.transcoder.v1.Job.input_uri]: crate::model::Job::input_uri
1372    pub uri: std::string::String,
1373
1374    /// Preprocessing configurations.
1375    pub preprocessing_config: std::option::Option<crate::model::PreprocessingConfig>,
1376
1377    /// Optional. Input Attributes.
1378    pub attributes: std::option::Option<crate::model::InputAttributes>,
1379
1380    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1381}
1382
1383impl Input {
1384    /// Creates a new default instance.
1385    pub fn new() -> Self {
1386        std::default::Default::default()
1387    }
1388
1389    /// Sets the value of [key][crate::model::Input::key].
1390    ///
1391    /// # Example
1392    /// ```ignore,no_run
1393    /// # use google_cloud_video_transcoder_v1::model::Input;
1394    /// let x = Input::new().set_key("example");
1395    /// ```
1396    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1397        self.key = v.into();
1398        self
1399    }
1400
1401    /// Sets the value of [uri][crate::model::Input::uri].
1402    ///
1403    /// # Example
1404    /// ```ignore,no_run
1405    /// # use google_cloud_video_transcoder_v1::model::Input;
1406    /// let x = Input::new().set_uri("example");
1407    /// ```
1408    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1409        self.uri = v.into();
1410        self
1411    }
1412
1413    /// Sets the value of [preprocessing_config][crate::model::Input::preprocessing_config].
1414    ///
1415    /// # Example
1416    /// ```ignore,no_run
1417    /// # use google_cloud_video_transcoder_v1::model::Input;
1418    /// use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
1419    /// let x = Input::new().set_preprocessing_config(PreprocessingConfig::default()/* use setters */);
1420    /// ```
1421    pub fn set_preprocessing_config<T>(mut self, v: T) -> Self
1422    where
1423        T: std::convert::Into<crate::model::PreprocessingConfig>,
1424    {
1425        self.preprocessing_config = std::option::Option::Some(v.into());
1426        self
1427    }
1428
1429    /// Sets or clears the value of [preprocessing_config][crate::model::Input::preprocessing_config].
1430    ///
1431    /// # Example
1432    /// ```ignore,no_run
1433    /// # use google_cloud_video_transcoder_v1::model::Input;
1434    /// use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
1435    /// let x = Input::new().set_or_clear_preprocessing_config(Some(PreprocessingConfig::default()/* use setters */));
1436    /// let x = Input::new().set_or_clear_preprocessing_config(None::<PreprocessingConfig>);
1437    /// ```
1438    pub fn set_or_clear_preprocessing_config<T>(mut self, v: std::option::Option<T>) -> Self
1439    where
1440        T: std::convert::Into<crate::model::PreprocessingConfig>,
1441    {
1442        self.preprocessing_config = v.map(|x| x.into());
1443        self
1444    }
1445
1446    /// Sets the value of [attributes][crate::model::Input::attributes].
1447    ///
1448    /// # Example
1449    /// ```ignore,no_run
1450    /// # use google_cloud_video_transcoder_v1::model::Input;
1451    /// use google_cloud_video_transcoder_v1::model::InputAttributes;
1452    /// let x = Input::new().set_attributes(InputAttributes::default()/* use setters */);
1453    /// ```
1454    pub fn set_attributes<T>(mut self, v: T) -> Self
1455    where
1456        T: std::convert::Into<crate::model::InputAttributes>,
1457    {
1458        self.attributes = std::option::Option::Some(v.into());
1459        self
1460    }
1461
1462    /// Sets or clears the value of [attributes][crate::model::Input::attributes].
1463    ///
1464    /// # Example
1465    /// ```ignore,no_run
1466    /// # use google_cloud_video_transcoder_v1::model::Input;
1467    /// use google_cloud_video_transcoder_v1::model::InputAttributes;
1468    /// let x = Input::new().set_or_clear_attributes(Some(InputAttributes::default()/* use setters */));
1469    /// let x = Input::new().set_or_clear_attributes(None::<InputAttributes>);
1470    /// ```
1471    pub fn set_or_clear_attributes<T>(mut self, v: std::option::Option<T>) -> Self
1472    where
1473        T: std::convert::Into<crate::model::InputAttributes>,
1474    {
1475        self.attributes = v.map(|x| x.into());
1476        self
1477    }
1478}
1479
1480impl wkt::message::Message for Input {
1481    fn typename() -> &'static str {
1482        "type.googleapis.com/google.cloud.video.transcoder.v1.Input"
1483    }
1484}
1485
1486/// Location of output file(s) in a Cloud Storage bucket.
1487#[derive(Clone, Default, PartialEq)]
1488#[non_exhaustive]
1489pub struct Output {
1490    /// URI for the output file(s). For example, `gs://my-bucket/outputs/`. Must be
1491    /// a directory and not a top-level bucket. If empty, the value is populated
1492    /// from [Job.output_uri][google.cloud.video.transcoder.v1.Job.output_uri]. See
1493    /// [Supported input and output
1494    /// formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats).
1495    ///
1496    /// [google.cloud.video.transcoder.v1.Job.output_uri]: crate::model::Job::output_uri
1497    pub uri: std::string::String,
1498
1499    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1500}
1501
1502impl Output {
1503    /// Creates a new default instance.
1504    pub fn new() -> Self {
1505        std::default::Default::default()
1506    }
1507
1508    /// Sets the value of [uri][crate::model::Output::uri].
1509    ///
1510    /// # Example
1511    /// ```ignore,no_run
1512    /// # use google_cloud_video_transcoder_v1::model::Output;
1513    /// let x = Output::new().set_uri("example");
1514    /// ```
1515    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1516        self.uri = v.into();
1517        self
1518    }
1519}
1520
1521impl wkt::message::Message for Output {
1522    fn typename() -> &'static str {
1523        "type.googleapis.com/google.cloud.video.transcoder.v1.Output"
1524    }
1525}
1526
1527/// Edit atom.
1528#[derive(Clone, Default, PartialEq)]
1529#[non_exhaustive]
1530pub struct EditAtom {
1531    /// A unique key for this atom. Must be specified when using advanced
1532    /// mapping.
1533    pub key: std::string::String,
1534
1535    /// List of [Input.key][google.cloud.video.transcoder.v1.Input.key] values
1536    /// identifying files that should be used in this atom. The listed `inputs`
1537    /// must have the same timeline.
1538    ///
1539    /// [google.cloud.video.transcoder.v1.Input.key]: crate::model::Input::key
1540    pub inputs: std::vec::Vec<std::string::String>,
1541
1542    /// End time in seconds for the atom, relative to the input file timeline.
1543    /// When `end_time_offset` is not specified, the `inputs` are used until
1544    /// the end of the atom.
1545    pub end_time_offset: std::option::Option<wkt::Duration>,
1546
1547    /// Start time in seconds for the atom, relative to the input file timeline.
1548    /// The default is `0s`.
1549    pub start_time_offset: std::option::Option<wkt::Duration>,
1550
1551    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1552}
1553
1554impl EditAtom {
1555    /// Creates a new default instance.
1556    pub fn new() -> Self {
1557        std::default::Default::default()
1558    }
1559
1560    /// Sets the value of [key][crate::model::EditAtom::key].
1561    ///
1562    /// # Example
1563    /// ```ignore,no_run
1564    /// # use google_cloud_video_transcoder_v1::model::EditAtom;
1565    /// let x = EditAtom::new().set_key("example");
1566    /// ```
1567    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1568        self.key = v.into();
1569        self
1570    }
1571
1572    /// Sets the value of [inputs][crate::model::EditAtom::inputs].
1573    ///
1574    /// # Example
1575    /// ```ignore,no_run
1576    /// # use google_cloud_video_transcoder_v1::model::EditAtom;
1577    /// let x = EditAtom::new().set_inputs(["a", "b", "c"]);
1578    /// ```
1579    pub fn set_inputs<T, V>(mut self, v: T) -> Self
1580    where
1581        T: std::iter::IntoIterator<Item = V>,
1582        V: std::convert::Into<std::string::String>,
1583    {
1584        use std::iter::Iterator;
1585        self.inputs = v.into_iter().map(|i| i.into()).collect();
1586        self
1587    }
1588
1589    /// Sets the value of [end_time_offset][crate::model::EditAtom::end_time_offset].
1590    ///
1591    /// # Example
1592    /// ```ignore,no_run
1593    /// # use google_cloud_video_transcoder_v1::model::EditAtom;
1594    /// use wkt::Duration;
1595    /// let x = EditAtom::new().set_end_time_offset(Duration::default()/* use setters */);
1596    /// ```
1597    pub fn set_end_time_offset<T>(mut self, v: T) -> Self
1598    where
1599        T: std::convert::Into<wkt::Duration>,
1600    {
1601        self.end_time_offset = std::option::Option::Some(v.into());
1602        self
1603    }
1604
1605    /// Sets or clears the value of [end_time_offset][crate::model::EditAtom::end_time_offset].
1606    ///
1607    /// # Example
1608    /// ```ignore,no_run
1609    /// # use google_cloud_video_transcoder_v1::model::EditAtom;
1610    /// use wkt::Duration;
1611    /// let x = EditAtom::new().set_or_clear_end_time_offset(Some(Duration::default()/* use setters */));
1612    /// let x = EditAtom::new().set_or_clear_end_time_offset(None::<Duration>);
1613    /// ```
1614    pub fn set_or_clear_end_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
1615    where
1616        T: std::convert::Into<wkt::Duration>,
1617    {
1618        self.end_time_offset = v.map(|x| x.into());
1619        self
1620    }
1621
1622    /// Sets the value of [start_time_offset][crate::model::EditAtom::start_time_offset].
1623    ///
1624    /// # Example
1625    /// ```ignore,no_run
1626    /// # use google_cloud_video_transcoder_v1::model::EditAtom;
1627    /// use wkt::Duration;
1628    /// let x = EditAtom::new().set_start_time_offset(Duration::default()/* use setters */);
1629    /// ```
1630    pub fn set_start_time_offset<T>(mut self, v: T) -> Self
1631    where
1632        T: std::convert::Into<wkt::Duration>,
1633    {
1634        self.start_time_offset = std::option::Option::Some(v.into());
1635        self
1636    }
1637
1638    /// Sets or clears the value of [start_time_offset][crate::model::EditAtom::start_time_offset].
1639    ///
1640    /// # Example
1641    /// ```ignore,no_run
1642    /// # use google_cloud_video_transcoder_v1::model::EditAtom;
1643    /// use wkt::Duration;
1644    /// let x = EditAtom::new().set_or_clear_start_time_offset(Some(Duration::default()/* use setters */));
1645    /// let x = EditAtom::new().set_or_clear_start_time_offset(None::<Duration>);
1646    /// ```
1647    pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
1648    where
1649        T: std::convert::Into<wkt::Duration>,
1650    {
1651        self.start_time_offset = v.map(|x| x.into());
1652        self
1653    }
1654}
1655
1656impl wkt::message::Message for EditAtom {
1657    fn typename() -> &'static str {
1658        "type.googleapis.com/google.cloud.video.transcoder.v1.EditAtom"
1659    }
1660}
1661
1662/// Ad break.
1663#[derive(Clone, Default, PartialEq)]
1664#[non_exhaustive]
1665pub struct AdBreak {
1666    /// Start time in seconds for the ad break, relative to the output file
1667    /// timeline. The default is `0s`.
1668    pub start_time_offset: std::option::Option<wkt::Duration>,
1669
1670    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1671}
1672
1673impl AdBreak {
1674    /// Creates a new default instance.
1675    pub fn new() -> Self {
1676        std::default::Default::default()
1677    }
1678
1679    /// Sets the value of [start_time_offset][crate::model::AdBreak::start_time_offset].
1680    ///
1681    /// # Example
1682    /// ```ignore,no_run
1683    /// # use google_cloud_video_transcoder_v1::model::AdBreak;
1684    /// use wkt::Duration;
1685    /// let x = AdBreak::new().set_start_time_offset(Duration::default()/* use setters */);
1686    /// ```
1687    pub fn set_start_time_offset<T>(mut self, v: T) -> Self
1688    where
1689        T: std::convert::Into<wkt::Duration>,
1690    {
1691        self.start_time_offset = std::option::Option::Some(v.into());
1692        self
1693    }
1694
1695    /// Sets or clears the value of [start_time_offset][crate::model::AdBreak::start_time_offset].
1696    ///
1697    /// # Example
1698    /// ```ignore,no_run
1699    /// # use google_cloud_video_transcoder_v1::model::AdBreak;
1700    /// use wkt::Duration;
1701    /// let x = AdBreak::new().set_or_clear_start_time_offset(Some(Duration::default()/* use setters */));
1702    /// let x = AdBreak::new().set_or_clear_start_time_offset(None::<Duration>);
1703    /// ```
1704    pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
1705    where
1706        T: std::convert::Into<wkt::Duration>,
1707    {
1708        self.start_time_offset = v.map(|x| x.into());
1709        self
1710    }
1711}
1712
1713impl wkt::message::Message for AdBreak {
1714    fn typename() -> &'static str {
1715        "type.googleapis.com/google.cloud.video.transcoder.v1.AdBreak"
1716    }
1717}
1718
1719/// Encoding of an input file such as an audio, video, or text track.
1720/// Elementary streams must be packaged before
1721/// mapping and sharing between different output formats.
1722#[derive(Clone, Default, PartialEq)]
1723#[non_exhaustive]
1724pub struct ElementaryStream {
1725    /// A unique key for this elementary stream.
1726    pub key: std::string::String,
1727
1728    /// Encoding of an audio, video, or text track.
1729    pub elementary_stream: std::option::Option<crate::model::elementary_stream::ElementaryStream>,
1730
1731    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1732}
1733
1734impl ElementaryStream {
1735    /// Creates a new default instance.
1736    pub fn new() -> Self {
1737        std::default::Default::default()
1738    }
1739
1740    /// Sets the value of [key][crate::model::ElementaryStream::key].
1741    ///
1742    /// # Example
1743    /// ```ignore,no_run
1744    /// # use google_cloud_video_transcoder_v1::model::ElementaryStream;
1745    /// let x = ElementaryStream::new().set_key("example");
1746    /// ```
1747    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1748        self.key = v.into();
1749        self
1750    }
1751
1752    /// Sets the value of [elementary_stream][crate::model::ElementaryStream::elementary_stream].
1753    ///
1754    /// Note that all the setters affecting `elementary_stream` are mutually
1755    /// exclusive.
1756    ///
1757    /// # Example
1758    /// ```ignore,no_run
1759    /// # use google_cloud_video_transcoder_v1::model::ElementaryStream;
1760    /// use google_cloud_video_transcoder_v1::model::VideoStream;
1761    /// let x = ElementaryStream::new().set_elementary_stream(Some(
1762    ///     google_cloud_video_transcoder_v1::model::elementary_stream::ElementaryStream::VideoStream(VideoStream::default().into())));
1763    /// ```
1764    pub fn set_elementary_stream<
1765        T: std::convert::Into<std::option::Option<crate::model::elementary_stream::ElementaryStream>>,
1766    >(
1767        mut self,
1768        v: T,
1769    ) -> Self {
1770        self.elementary_stream = v.into();
1771        self
1772    }
1773
1774    /// The value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
1775    /// if it holds a `VideoStream`, `None` if the field is not set or
1776    /// holds a different branch.
1777    pub fn video_stream(&self) -> std::option::Option<&std::boxed::Box<crate::model::VideoStream>> {
1778        #[allow(unreachable_patterns)]
1779        self.elementary_stream.as_ref().and_then(|v| match v {
1780            crate::model::elementary_stream::ElementaryStream::VideoStream(v) => {
1781                std::option::Option::Some(v)
1782            }
1783            _ => std::option::Option::None,
1784        })
1785    }
1786
1787    /// Sets the value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
1788    /// to hold a `VideoStream`.
1789    ///
1790    /// Note that all the setters affecting `elementary_stream` are
1791    /// mutually exclusive.
1792    ///
1793    /// # Example
1794    /// ```ignore,no_run
1795    /// # use google_cloud_video_transcoder_v1::model::ElementaryStream;
1796    /// use google_cloud_video_transcoder_v1::model::VideoStream;
1797    /// let x = ElementaryStream::new().set_video_stream(VideoStream::default()/* use setters */);
1798    /// assert!(x.video_stream().is_some());
1799    /// assert!(x.audio_stream().is_none());
1800    /// assert!(x.text_stream().is_none());
1801    /// ```
1802    pub fn set_video_stream<T: std::convert::Into<std::boxed::Box<crate::model::VideoStream>>>(
1803        mut self,
1804        v: T,
1805    ) -> Self {
1806        self.elementary_stream = std::option::Option::Some(
1807            crate::model::elementary_stream::ElementaryStream::VideoStream(v.into()),
1808        );
1809        self
1810    }
1811
1812    /// The value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
1813    /// if it holds a `AudioStream`, `None` if the field is not set or
1814    /// holds a different branch.
1815    pub fn audio_stream(&self) -> std::option::Option<&std::boxed::Box<crate::model::AudioStream>> {
1816        #[allow(unreachable_patterns)]
1817        self.elementary_stream.as_ref().and_then(|v| match v {
1818            crate::model::elementary_stream::ElementaryStream::AudioStream(v) => {
1819                std::option::Option::Some(v)
1820            }
1821            _ => std::option::Option::None,
1822        })
1823    }
1824
1825    /// Sets the value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
1826    /// to hold a `AudioStream`.
1827    ///
1828    /// Note that all the setters affecting `elementary_stream` are
1829    /// mutually exclusive.
1830    ///
1831    /// # Example
1832    /// ```ignore,no_run
1833    /// # use google_cloud_video_transcoder_v1::model::ElementaryStream;
1834    /// use google_cloud_video_transcoder_v1::model::AudioStream;
1835    /// let x = ElementaryStream::new().set_audio_stream(AudioStream::default()/* use setters */);
1836    /// assert!(x.audio_stream().is_some());
1837    /// assert!(x.video_stream().is_none());
1838    /// assert!(x.text_stream().is_none());
1839    /// ```
1840    pub fn set_audio_stream<T: std::convert::Into<std::boxed::Box<crate::model::AudioStream>>>(
1841        mut self,
1842        v: T,
1843    ) -> Self {
1844        self.elementary_stream = std::option::Option::Some(
1845            crate::model::elementary_stream::ElementaryStream::AudioStream(v.into()),
1846        );
1847        self
1848    }
1849
1850    /// The value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
1851    /// if it holds a `TextStream`, `None` if the field is not set or
1852    /// holds a different branch.
1853    pub fn text_stream(&self) -> std::option::Option<&std::boxed::Box<crate::model::TextStream>> {
1854        #[allow(unreachable_patterns)]
1855        self.elementary_stream.as_ref().and_then(|v| match v {
1856            crate::model::elementary_stream::ElementaryStream::TextStream(v) => {
1857                std::option::Option::Some(v)
1858            }
1859            _ => std::option::Option::None,
1860        })
1861    }
1862
1863    /// Sets the value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
1864    /// to hold a `TextStream`.
1865    ///
1866    /// Note that all the setters affecting `elementary_stream` are
1867    /// mutually exclusive.
1868    ///
1869    /// # Example
1870    /// ```ignore,no_run
1871    /// # use google_cloud_video_transcoder_v1::model::ElementaryStream;
1872    /// use google_cloud_video_transcoder_v1::model::TextStream;
1873    /// let x = ElementaryStream::new().set_text_stream(TextStream::default()/* use setters */);
1874    /// assert!(x.text_stream().is_some());
1875    /// assert!(x.video_stream().is_none());
1876    /// assert!(x.audio_stream().is_none());
1877    /// ```
1878    pub fn set_text_stream<T: std::convert::Into<std::boxed::Box<crate::model::TextStream>>>(
1879        mut self,
1880        v: T,
1881    ) -> Self {
1882        self.elementary_stream = std::option::Option::Some(
1883            crate::model::elementary_stream::ElementaryStream::TextStream(v.into()),
1884        );
1885        self
1886    }
1887}
1888
1889impl wkt::message::Message for ElementaryStream {
1890    fn typename() -> &'static str {
1891        "type.googleapis.com/google.cloud.video.transcoder.v1.ElementaryStream"
1892    }
1893}
1894
1895/// Defines additional types related to [ElementaryStream].
1896pub mod elementary_stream {
1897    #[allow(unused_imports)]
1898    use super::*;
1899
1900    /// Encoding of an audio, video, or text track.
1901    #[derive(Clone, Debug, PartialEq)]
1902    #[non_exhaustive]
1903    pub enum ElementaryStream {
1904        /// Encoding of a video stream.
1905        VideoStream(std::boxed::Box<crate::model::VideoStream>),
1906        /// Encoding of an audio stream.
1907        AudioStream(std::boxed::Box<crate::model::AudioStream>),
1908        /// Encoding of a text stream. For example, closed captions or subtitles.
1909        TextStream(std::boxed::Box<crate::model::TextStream>),
1910    }
1911}
1912
1913/// Multiplexing settings for output stream.
1914#[derive(Clone, Default, PartialEq)]
1915#[non_exhaustive]
1916pub struct MuxStream {
1917    /// A unique key for this multiplexed stream.
1918    pub key: std::string::String,
1919
1920    /// The name of the generated file. The default is
1921    /// [MuxStream.key][google.cloud.video.transcoder.v1.MuxStream.key] with the
1922    /// extension suffix corresponding to the
1923    /// [MuxStream.container][google.cloud.video.transcoder.v1.MuxStream.container].
1924    ///
1925    /// Individual segments also have an incremental 10-digit zero-padded suffix
1926    /// starting from 0 before the extension, such as `mux_stream0000000123.ts`.
1927    ///
1928    /// [google.cloud.video.transcoder.v1.MuxStream.container]: crate::model::MuxStream::container
1929    /// [google.cloud.video.transcoder.v1.MuxStream.key]: crate::model::MuxStream::key
1930    pub file_name: std::string::String,
1931
1932    /// The container format. The default is `mp4`
1933    ///
1934    /// Supported streaming formats:
1935    ///
1936    /// - `ts`
1937    /// - `fmp4`- the corresponding file extension is `.m4s`
1938    ///
1939    /// Supported standalone file formats:
1940    ///
1941    /// - `mp4`
1942    /// - `mp3`
1943    /// - `ogg`
1944    /// - `vtt`
1945    ///
1946    /// See also:
1947    /// [Supported input and output
1948    /// formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats)
1949    pub container: std::string::String,
1950
1951    /// List of
1952    /// [ElementaryStream.key][google.cloud.video.transcoder.v1.ElementaryStream.key]
1953    /// values multiplexed in this stream.
1954    ///
1955    /// [google.cloud.video.transcoder.v1.ElementaryStream.key]: crate::model::ElementaryStream::key
1956    pub elementary_streams: std::vec::Vec<std::string::String>,
1957
1958    /// Segment settings for `ts`, `fmp4` and `vtt`.
1959    pub segment_settings: std::option::Option<crate::model::SegmentSettings>,
1960
1961    /// Identifier of the encryption configuration to use. If omitted, output will
1962    /// be unencrypted.
1963    pub encryption_id: std::string::String,
1964
1965    /// Specifies the container configuration.
1966    pub container_config: std::option::Option<crate::model::mux_stream::ContainerConfig>,
1967
1968    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1969}
1970
1971impl MuxStream {
1972    /// Creates a new default instance.
1973    pub fn new() -> Self {
1974        std::default::Default::default()
1975    }
1976
1977    /// Sets the value of [key][crate::model::MuxStream::key].
1978    ///
1979    /// # Example
1980    /// ```ignore,no_run
1981    /// # use google_cloud_video_transcoder_v1::model::MuxStream;
1982    /// let x = MuxStream::new().set_key("example");
1983    /// ```
1984    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1985        self.key = v.into();
1986        self
1987    }
1988
1989    /// Sets the value of [file_name][crate::model::MuxStream::file_name].
1990    ///
1991    /// # Example
1992    /// ```ignore,no_run
1993    /// # use google_cloud_video_transcoder_v1::model::MuxStream;
1994    /// let x = MuxStream::new().set_file_name("example");
1995    /// ```
1996    pub fn set_file_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1997        self.file_name = v.into();
1998        self
1999    }
2000
2001    /// Sets the value of [container][crate::model::MuxStream::container].
2002    ///
2003    /// # Example
2004    /// ```ignore,no_run
2005    /// # use google_cloud_video_transcoder_v1::model::MuxStream;
2006    /// let x = MuxStream::new().set_container("example");
2007    /// ```
2008    pub fn set_container<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2009        self.container = v.into();
2010        self
2011    }
2012
2013    /// Sets the value of [elementary_streams][crate::model::MuxStream::elementary_streams].
2014    ///
2015    /// # Example
2016    /// ```ignore,no_run
2017    /// # use google_cloud_video_transcoder_v1::model::MuxStream;
2018    /// let x = MuxStream::new().set_elementary_streams(["a", "b", "c"]);
2019    /// ```
2020    pub fn set_elementary_streams<T, V>(mut self, v: T) -> Self
2021    where
2022        T: std::iter::IntoIterator<Item = V>,
2023        V: std::convert::Into<std::string::String>,
2024    {
2025        use std::iter::Iterator;
2026        self.elementary_streams = v.into_iter().map(|i| i.into()).collect();
2027        self
2028    }
2029
2030    /// Sets 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_segment_settings(SegmentSettings::default()/* use setters */);
2037    /// ```
2038    pub fn set_segment_settings<T>(mut self, v: T) -> Self
2039    where
2040        T: std::convert::Into<crate::model::SegmentSettings>,
2041    {
2042        self.segment_settings = std::option::Option::Some(v.into());
2043        self
2044    }
2045
2046    /// Sets or clears the value of [segment_settings][crate::model::MuxStream::segment_settings].
2047    ///
2048    /// # Example
2049    /// ```ignore,no_run
2050    /// # use google_cloud_video_transcoder_v1::model::MuxStream;
2051    /// use google_cloud_video_transcoder_v1::model::SegmentSettings;
2052    /// let x = MuxStream::new().set_or_clear_segment_settings(Some(SegmentSettings::default()/* use setters */));
2053    /// let x = MuxStream::new().set_or_clear_segment_settings(None::<SegmentSettings>);
2054    /// ```
2055    pub fn set_or_clear_segment_settings<T>(mut self, v: std::option::Option<T>) -> Self
2056    where
2057        T: std::convert::Into<crate::model::SegmentSettings>,
2058    {
2059        self.segment_settings = v.map(|x| x.into());
2060        self
2061    }
2062
2063    /// Sets the value of [encryption_id][crate::model::MuxStream::encryption_id].
2064    ///
2065    /// # Example
2066    /// ```ignore,no_run
2067    /// # use google_cloud_video_transcoder_v1::model::MuxStream;
2068    /// let x = MuxStream::new().set_encryption_id("example");
2069    /// ```
2070    pub fn set_encryption_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2071        self.encryption_id = v.into();
2072        self
2073    }
2074
2075    /// Sets the value of [container_config][crate::model::MuxStream::container_config].
2076    ///
2077    /// Note that all the setters affecting `container_config` are mutually
2078    /// exclusive.
2079    ///
2080    /// # Example
2081    /// ```ignore,no_run
2082    /// # use google_cloud_video_transcoder_v1::model::MuxStream;
2083    /// use google_cloud_video_transcoder_v1::model::mux_stream::Fmp4Config;
2084    /// let x = MuxStream::new().set_container_config(Some(
2085    ///     google_cloud_video_transcoder_v1::model::mux_stream::ContainerConfig::Fmp4(Fmp4Config::default().into())));
2086    /// ```
2087    pub fn set_container_config<
2088        T: std::convert::Into<std::option::Option<crate::model::mux_stream::ContainerConfig>>,
2089    >(
2090        mut self,
2091        v: T,
2092    ) -> Self {
2093        self.container_config = v.into();
2094        self
2095    }
2096
2097    /// The value of [container_config][crate::model::MuxStream::container_config]
2098    /// if it holds a `Fmp4`, `None` if the field is not set or
2099    /// holds a different branch.
2100    pub fn fmp4(
2101        &self,
2102    ) -> std::option::Option<&std::boxed::Box<crate::model::mux_stream::Fmp4Config>> {
2103        #[allow(unreachable_patterns)]
2104        self.container_config.as_ref().and_then(|v| match v {
2105            crate::model::mux_stream::ContainerConfig::Fmp4(v) => std::option::Option::Some(v),
2106            _ => std::option::Option::None,
2107        })
2108    }
2109
2110    /// Sets the value of [container_config][crate::model::MuxStream::container_config]
2111    /// to hold a `Fmp4`.
2112    ///
2113    /// Note that all the setters affecting `container_config` are
2114    /// mutually exclusive.
2115    ///
2116    /// # Example
2117    /// ```ignore,no_run
2118    /// # use google_cloud_video_transcoder_v1::model::MuxStream;
2119    /// use google_cloud_video_transcoder_v1::model::mux_stream::Fmp4Config;
2120    /// let x = MuxStream::new().set_fmp4(Fmp4Config::default()/* use setters */);
2121    /// assert!(x.fmp4().is_some());
2122    /// ```
2123    pub fn set_fmp4<
2124        T: std::convert::Into<std::boxed::Box<crate::model::mux_stream::Fmp4Config>>,
2125    >(
2126        mut self,
2127        v: T,
2128    ) -> Self {
2129        self.container_config =
2130            std::option::Option::Some(crate::model::mux_stream::ContainerConfig::Fmp4(v.into()));
2131        self
2132    }
2133}
2134
2135impl wkt::message::Message for MuxStream {
2136    fn typename() -> &'static str {
2137        "type.googleapis.com/google.cloud.video.transcoder.v1.MuxStream"
2138    }
2139}
2140
2141/// Defines additional types related to [MuxStream].
2142pub mod mux_stream {
2143    #[allow(unused_imports)]
2144    use super::*;
2145
2146    /// `fmp4` container configuration.
2147    #[derive(Clone, Default, PartialEq)]
2148    #[non_exhaustive]
2149    pub struct Fmp4Config {
2150        /// Optional. Specify the codec tag string that will be used in the media
2151        /// bitstream. When not specified, the codec appropriate value is used.
2152        ///
2153        /// Supported H265 codec tags:
2154        ///
2155        /// - `hvc1` (default)
2156        /// - `hev1`
2157        pub codec_tag: std::string::String,
2158
2159        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2160    }
2161
2162    impl Fmp4Config {
2163        /// Creates a new default instance.
2164        pub fn new() -> Self {
2165            std::default::Default::default()
2166        }
2167
2168        /// Sets the value of [codec_tag][crate::model::mux_stream::Fmp4Config::codec_tag].
2169        ///
2170        /// # Example
2171        /// ```ignore,no_run
2172        /// # use google_cloud_video_transcoder_v1::model::mux_stream::Fmp4Config;
2173        /// let x = Fmp4Config::new().set_codec_tag("example");
2174        /// ```
2175        pub fn set_codec_tag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2176            self.codec_tag = v.into();
2177            self
2178        }
2179    }
2180
2181    impl wkt::message::Message for Fmp4Config {
2182        fn typename() -> &'static str {
2183            "type.googleapis.com/google.cloud.video.transcoder.v1.MuxStream.Fmp4Config"
2184        }
2185    }
2186
2187    /// Specifies the container configuration.
2188    #[derive(Clone, Debug, PartialEq)]
2189    #[non_exhaustive]
2190    pub enum ContainerConfig {
2191        /// Optional. `fmp4` container configuration.
2192        Fmp4(std::boxed::Box<crate::model::mux_stream::Fmp4Config>),
2193    }
2194}
2195
2196/// Manifest configuration.
2197#[derive(Clone, Default, PartialEq)]
2198#[non_exhaustive]
2199pub struct Manifest {
2200    /// The name of the generated file. The default is `manifest` with the
2201    /// extension suffix corresponding to the
2202    /// [Manifest.type][google.cloud.video.transcoder.v1.Manifest.type].
2203    ///
2204    /// [google.cloud.video.transcoder.v1.Manifest.type]: crate::model::Manifest::type
2205    pub file_name: std::string::String,
2206
2207    /// Required. Type of the manifest.
2208    pub r#type: crate::model::manifest::ManifestType,
2209
2210    /// Required. List of user supplied
2211    /// [MuxStream.key][google.cloud.video.transcoder.v1.MuxStream.key] values that
2212    /// should appear in this manifest.
2213    ///
2214    /// When [Manifest.type][google.cloud.video.transcoder.v1.Manifest.type] is
2215    /// `HLS`, a media manifest with name
2216    /// [MuxStream.key][google.cloud.video.transcoder.v1.MuxStream.key] and `.m3u8`
2217    /// extension is generated for each element in this list.
2218    ///
2219    /// [google.cloud.video.transcoder.v1.Manifest.type]: crate::model::Manifest::type
2220    /// [google.cloud.video.transcoder.v1.MuxStream.key]: crate::model::MuxStream::key
2221    pub mux_streams: std::vec::Vec<std::string::String>,
2222
2223    /// Specifies the manifest configuration.
2224    pub manifest_config: std::option::Option<crate::model::manifest::ManifestConfig>,
2225
2226    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2227}
2228
2229impl Manifest {
2230    /// Creates a new default instance.
2231    pub fn new() -> Self {
2232        std::default::Default::default()
2233    }
2234
2235    /// Sets the value of [file_name][crate::model::Manifest::file_name].
2236    ///
2237    /// # Example
2238    /// ```ignore,no_run
2239    /// # use google_cloud_video_transcoder_v1::model::Manifest;
2240    /// let x = Manifest::new().set_file_name("example");
2241    /// ```
2242    pub fn set_file_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2243        self.file_name = v.into();
2244        self
2245    }
2246
2247    /// Sets the value of [r#type][crate::model::Manifest::type].
2248    ///
2249    /// # Example
2250    /// ```ignore,no_run
2251    /// # use google_cloud_video_transcoder_v1::model::Manifest;
2252    /// use google_cloud_video_transcoder_v1::model::manifest::ManifestType;
2253    /// let x0 = Manifest::new().set_type(ManifestType::Hls);
2254    /// let x1 = Manifest::new().set_type(ManifestType::Dash);
2255    /// ```
2256    pub fn set_type<T: std::convert::Into<crate::model::manifest::ManifestType>>(
2257        mut self,
2258        v: T,
2259    ) -> Self {
2260        self.r#type = v.into();
2261        self
2262    }
2263
2264    /// Sets the value of [mux_streams][crate::model::Manifest::mux_streams].
2265    ///
2266    /// # Example
2267    /// ```ignore,no_run
2268    /// # use google_cloud_video_transcoder_v1::model::Manifest;
2269    /// let x = Manifest::new().set_mux_streams(["a", "b", "c"]);
2270    /// ```
2271    pub fn set_mux_streams<T, V>(mut self, v: T) -> Self
2272    where
2273        T: std::iter::IntoIterator<Item = V>,
2274        V: std::convert::Into<std::string::String>,
2275    {
2276        use std::iter::Iterator;
2277        self.mux_streams = v.into_iter().map(|i| i.into()).collect();
2278        self
2279    }
2280
2281    /// Sets the value of [manifest_config][crate::model::Manifest::manifest_config].
2282    ///
2283    /// Note that all the setters affecting `manifest_config` are mutually
2284    /// exclusive.
2285    ///
2286    /// # Example
2287    /// ```ignore,no_run
2288    /// # use google_cloud_video_transcoder_v1::model::Manifest;
2289    /// use google_cloud_video_transcoder_v1::model::manifest::DashConfig;
2290    /// let x = Manifest::new().set_manifest_config(Some(
2291    ///     google_cloud_video_transcoder_v1::model::manifest::ManifestConfig::Dash(DashConfig::default().into())));
2292    /// ```
2293    pub fn set_manifest_config<
2294        T: std::convert::Into<std::option::Option<crate::model::manifest::ManifestConfig>>,
2295    >(
2296        mut self,
2297        v: T,
2298    ) -> Self {
2299        self.manifest_config = v.into();
2300        self
2301    }
2302
2303    /// The value of [manifest_config][crate::model::Manifest::manifest_config]
2304    /// if it holds a `Dash`, `None` if the field is not set or
2305    /// holds a different branch.
2306    pub fn dash(
2307        &self,
2308    ) -> std::option::Option<&std::boxed::Box<crate::model::manifest::DashConfig>> {
2309        #[allow(unreachable_patterns)]
2310        self.manifest_config.as_ref().and_then(|v| match v {
2311            crate::model::manifest::ManifestConfig::Dash(v) => std::option::Option::Some(v),
2312            _ => std::option::Option::None,
2313        })
2314    }
2315
2316    /// Sets the value of [manifest_config][crate::model::Manifest::manifest_config]
2317    /// to hold a `Dash`.
2318    ///
2319    /// Note that all the setters affecting `manifest_config` are
2320    /// mutually exclusive.
2321    ///
2322    /// # Example
2323    /// ```ignore,no_run
2324    /// # use google_cloud_video_transcoder_v1::model::Manifest;
2325    /// use google_cloud_video_transcoder_v1::model::manifest::DashConfig;
2326    /// let x = Manifest::new().set_dash(DashConfig::default()/* use setters */);
2327    /// assert!(x.dash().is_some());
2328    /// ```
2329    pub fn set_dash<T: std::convert::Into<std::boxed::Box<crate::model::manifest::DashConfig>>>(
2330        mut self,
2331        v: T,
2332    ) -> Self {
2333        self.manifest_config =
2334            std::option::Option::Some(crate::model::manifest::ManifestConfig::Dash(v.into()));
2335        self
2336    }
2337}
2338
2339impl wkt::message::Message for Manifest {
2340    fn typename() -> &'static str {
2341        "type.googleapis.com/google.cloud.video.transcoder.v1.Manifest"
2342    }
2343}
2344
2345/// Defines additional types related to [Manifest].
2346pub mod manifest {
2347    #[allow(unused_imports)]
2348    use super::*;
2349
2350    /// `DASH` manifest configuration.
2351    #[derive(Clone, Default, PartialEq)]
2352    #[non_exhaustive]
2353    pub struct DashConfig {
2354        /// The segment reference scheme for a `DASH` manifest. The default is
2355        /// `SEGMENT_LIST`.
2356        pub segment_reference_scheme: crate::model::manifest::dash_config::SegmentReferenceScheme,
2357
2358        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2359    }
2360
2361    impl DashConfig {
2362        /// Creates a new default instance.
2363        pub fn new() -> Self {
2364            std::default::Default::default()
2365        }
2366
2367        /// Sets the value of [segment_reference_scheme][crate::model::manifest::DashConfig::segment_reference_scheme].
2368        ///
2369        /// # Example
2370        /// ```ignore,no_run
2371        /// # use google_cloud_video_transcoder_v1::model::manifest::DashConfig;
2372        /// use google_cloud_video_transcoder_v1::model::manifest::dash_config::SegmentReferenceScheme;
2373        /// let x0 = DashConfig::new().set_segment_reference_scheme(SegmentReferenceScheme::SegmentList);
2374        /// let x1 = DashConfig::new().set_segment_reference_scheme(SegmentReferenceScheme::SegmentTemplateNumber);
2375        /// ```
2376        pub fn set_segment_reference_scheme<
2377            T: std::convert::Into<crate::model::manifest::dash_config::SegmentReferenceScheme>,
2378        >(
2379            mut self,
2380            v: T,
2381        ) -> Self {
2382            self.segment_reference_scheme = v.into();
2383            self
2384        }
2385    }
2386
2387    impl wkt::message::Message for DashConfig {
2388        fn typename() -> &'static str {
2389            "type.googleapis.com/google.cloud.video.transcoder.v1.Manifest.DashConfig"
2390        }
2391    }
2392
2393    /// Defines additional types related to [DashConfig].
2394    pub mod dash_config {
2395        #[allow(unused_imports)]
2396        use super::*;
2397
2398        /// The segment reference scheme for a `DASH` manifest.
2399        ///
2400        /// # Working with unknown values
2401        ///
2402        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2403        /// additional enum variants at any time. Adding new variants is not considered
2404        /// a breaking change. Applications should write their code in anticipation of:
2405        ///
2406        /// - New values appearing in future releases of the client library, **and**
2407        /// - New values received dynamically, without application changes.
2408        ///
2409        /// Please consult the [Working with enums] section in the user guide for some
2410        /// guidelines.
2411        ///
2412        /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2413        #[derive(Clone, Debug, PartialEq)]
2414        #[non_exhaustive]
2415        pub enum SegmentReferenceScheme {
2416            /// The segment reference scheme is not specified.
2417            Unspecified,
2418            /// Explicitly lists the URLs of media files for each segment. For example,
2419            /// if
2420            /// [SegmentSettings.individual_segments][google.cloud.video.transcoder.v1.SegmentSettings.individual_segments]
2421            /// is `true`, then the manifest contains fields similar to the following:
2422            ///
2423            /// ```norust
2424            /// <Initialization sourceURL="my-hd-stream-init.m4s"/>
2425            ///   <SegmentList presentationTimeOffset="0" duration="1000"
2426            ///   timescale="10000">
2427            ///     <SegmentURL media="hd-stream0000000000.m4s"/>
2428            ///     <SegmentURL media="hd-stream0000000001.m4s"/>
2429            ///     ...
2430            /// ```
2431            ///
2432            /// [google.cloud.video.transcoder.v1.SegmentSettings.individual_segments]: crate::model::SegmentSettings::individual_segments
2433            SegmentList,
2434            /// [SegmentSettings.individual_segments][google.cloud.video.transcoder.v1.SegmentSettings.individual_segments]
2435            /// must be set to `true` to use this segment reference scheme. Uses the
2436            /// DASH specification
2437            /// `<SegmentTemplate>` tag to determine the URLs of media files for each
2438            /// segment. For example:
2439            ///
2440            /// ```norust
2441            /// <SegmentTemplate presentationTimeOffset="0" timescale="10000"
2442            ///       initialization="my-hd-stream-init.m4s"
2443            ///       media="hd-stream$Number%010d$.m4s" startNumber="0">
2444            ///   ...
2445            /// ```
2446            ///
2447            /// [google.cloud.video.transcoder.v1.SegmentSettings.individual_segments]: crate::model::SegmentSettings::individual_segments
2448            SegmentTemplateNumber,
2449            /// If set, the enum was initialized with an unknown value.
2450            ///
2451            /// Applications can examine the value using [SegmentReferenceScheme::value] or
2452            /// [SegmentReferenceScheme::name].
2453            UnknownValue(segment_reference_scheme::UnknownValue),
2454        }
2455
2456        #[doc(hidden)]
2457        pub mod segment_reference_scheme {
2458            #[allow(unused_imports)]
2459            use super::*;
2460            #[derive(Clone, Debug, PartialEq)]
2461            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2462        }
2463
2464        impl SegmentReferenceScheme {
2465            /// Gets the enum value.
2466            ///
2467            /// Returns `None` if the enum contains an unknown value deserialized from
2468            /// the string representation of enums.
2469            pub fn value(&self) -> std::option::Option<i32> {
2470                match self {
2471                    Self::Unspecified => std::option::Option::Some(0),
2472                    Self::SegmentList => std::option::Option::Some(1),
2473                    Self::SegmentTemplateNumber => std::option::Option::Some(2),
2474                    Self::UnknownValue(u) => u.0.value(),
2475                }
2476            }
2477
2478            /// Gets the enum value as a string.
2479            ///
2480            /// Returns `None` if the enum contains an unknown value deserialized from
2481            /// the integer representation of enums.
2482            pub fn name(&self) -> std::option::Option<&str> {
2483                match self {
2484                    Self::Unspecified => {
2485                        std::option::Option::Some("SEGMENT_REFERENCE_SCHEME_UNSPECIFIED")
2486                    }
2487                    Self::SegmentList => std::option::Option::Some("SEGMENT_LIST"),
2488                    Self::SegmentTemplateNumber => {
2489                        std::option::Option::Some("SEGMENT_TEMPLATE_NUMBER")
2490                    }
2491                    Self::UnknownValue(u) => u.0.name(),
2492                }
2493            }
2494        }
2495
2496        impl std::default::Default for SegmentReferenceScheme {
2497            fn default() -> Self {
2498                use std::convert::From;
2499                Self::from(0)
2500            }
2501        }
2502
2503        impl std::fmt::Display for SegmentReferenceScheme {
2504            fn fmt(
2505                &self,
2506                f: &mut std::fmt::Formatter<'_>,
2507            ) -> std::result::Result<(), std::fmt::Error> {
2508                wkt::internal::display_enum(f, self.name(), self.value())
2509            }
2510        }
2511
2512        impl std::convert::From<i32> for SegmentReferenceScheme {
2513            fn from(value: i32) -> Self {
2514                match value {
2515                    0 => Self::Unspecified,
2516                    1 => Self::SegmentList,
2517                    2 => Self::SegmentTemplateNumber,
2518                    _ => Self::UnknownValue(segment_reference_scheme::UnknownValue(
2519                        wkt::internal::UnknownEnumValue::Integer(value),
2520                    )),
2521                }
2522            }
2523        }
2524
2525        impl std::convert::From<&str> for SegmentReferenceScheme {
2526            fn from(value: &str) -> Self {
2527                use std::string::ToString;
2528                match value {
2529                    "SEGMENT_REFERENCE_SCHEME_UNSPECIFIED" => Self::Unspecified,
2530                    "SEGMENT_LIST" => Self::SegmentList,
2531                    "SEGMENT_TEMPLATE_NUMBER" => Self::SegmentTemplateNumber,
2532                    _ => Self::UnknownValue(segment_reference_scheme::UnknownValue(
2533                        wkt::internal::UnknownEnumValue::String(value.to_string()),
2534                    )),
2535                }
2536            }
2537        }
2538
2539        impl serde::ser::Serialize for SegmentReferenceScheme {
2540            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2541            where
2542                S: serde::Serializer,
2543            {
2544                match self {
2545                    Self::Unspecified => serializer.serialize_i32(0),
2546                    Self::SegmentList => serializer.serialize_i32(1),
2547                    Self::SegmentTemplateNumber => serializer.serialize_i32(2),
2548                    Self::UnknownValue(u) => u.0.serialize(serializer),
2549                }
2550            }
2551        }
2552
2553        impl<'de> serde::de::Deserialize<'de> for SegmentReferenceScheme {
2554            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2555            where
2556                D: serde::Deserializer<'de>,
2557            {
2558                deserializer.deserialize_any(wkt::internal::EnumVisitor::<SegmentReferenceScheme>::new(
2559                    ".google.cloud.video.transcoder.v1.Manifest.DashConfig.SegmentReferenceScheme"))
2560            }
2561        }
2562    }
2563
2564    /// The manifest type, which corresponds to the adaptive streaming format used.
2565    ///
2566    /// # Working with unknown values
2567    ///
2568    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2569    /// additional enum variants at any time. Adding new variants is not considered
2570    /// a breaking change. Applications should write their code in anticipation of:
2571    ///
2572    /// - New values appearing in future releases of the client library, **and**
2573    /// - New values received dynamically, without application changes.
2574    ///
2575    /// Please consult the [Working with enums] section in the user guide for some
2576    /// guidelines.
2577    ///
2578    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2579    #[derive(Clone, Debug, PartialEq)]
2580    #[non_exhaustive]
2581    pub enum ManifestType {
2582        /// The manifest type is not specified.
2583        Unspecified,
2584        /// Create an HLS manifest. The corresponding file extension is `.m3u8`.
2585        Hls,
2586        /// Create an MPEG-DASH manifest. The corresponding file extension is `.mpd`.
2587        Dash,
2588        /// If set, the enum was initialized with an unknown value.
2589        ///
2590        /// Applications can examine the value using [ManifestType::value] or
2591        /// [ManifestType::name].
2592        UnknownValue(manifest_type::UnknownValue),
2593    }
2594
2595    #[doc(hidden)]
2596    pub mod manifest_type {
2597        #[allow(unused_imports)]
2598        use super::*;
2599        #[derive(Clone, Debug, PartialEq)]
2600        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2601    }
2602
2603    impl ManifestType {
2604        /// Gets the enum value.
2605        ///
2606        /// Returns `None` if the enum contains an unknown value deserialized from
2607        /// the string representation of enums.
2608        pub fn value(&self) -> std::option::Option<i32> {
2609            match self {
2610                Self::Unspecified => std::option::Option::Some(0),
2611                Self::Hls => std::option::Option::Some(1),
2612                Self::Dash => std::option::Option::Some(2),
2613                Self::UnknownValue(u) => u.0.value(),
2614            }
2615        }
2616
2617        /// Gets the enum value as a string.
2618        ///
2619        /// Returns `None` if the enum contains an unknown value deserialized from
2620        /// the integer representation of enums.
2621        pub fn name(&self) -> std::option::Option<&str> {
2622            match self {
2623                Self::Unspecified => std::option::Option::Some("MANIFEST_TYPE_UNSPECIFIED"),
2624                Self::Hls => std::option::Option::Some("HLS"),
2625                Self::Dash => std::option::Option::Some("DASH"),
2626                Self::UnknownValue(u) => u.0.name(),
2627            }
2628        }
2629    }
2630
2631    impl std::default::Default for ManifestType {
2632        fn default() -> Self {
2633            use std::convert::From;
2634            Self::from(0)
2635        }
2636    }
2637
2638    impl std::fmt::Display for ManifestType {
2639        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2640            wkt::internal::display_enum(f, self.name(), self.value())
2641        }
2642    }
2643
2644    impl std::convert::From<i32> for ManifestType {
2645        fn from(value: i32) -> Self {
2646            match value {
2647                0 => Self::Unspecified,
2648                1 => Self::Hls,
2649                2 => Self::Dash,
2650                _ => Self::UnknownValue(manifest_type::UnknownValue(
2651                    wkt::internal::UnknownEnumValue::Integer(value),
2652                )),
2653            }
2654        }
2655    }
2656
2657    impl std::convert::From<&str> for ManifestType {
2658        fn from(value: &str) -> Self {
2659            use std::string::ToString;
2660            match value {
2661                "MANIFEST_TYPE_UNSPECIFIED" => Self::Unspecified,
2662                "HLS" => Self::Hls,
2663                "DASH" => Self::Dash,
2664                _ => Self::UnknownValue(manifest_type::UnknownValue(
2665                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2666                )),
2667            }
2668        }
2669    }
2670
2671    impl serde::ser::Serialize for ManifestType {
2672        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2673        where
2674            S: serde::Serializer,
2675        {
2676            match self {
2677                Self::Unspecified => serializer.serialize_i32(0),
2678                Self::Hls => serializer.serialize_i32(1),
2679                Self::Dash => serializer.serialize_i32(2),
2680                Self::UnknownValue(u) => u.0.serialize(serializer),
2681            }
2682        }
2683    }
2684
2685    impl<'de> serde::de::Deserialize<'de> for ManifestType {
2686        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2687        where
2688            D: serde::Deserializer<'de>,
2689        {
2690            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ManifestType>::new(
2691                ".google.cloud.video.transcoder.v1.Manifest.ManifestType",
2692            ))
2693        }
2694    }
2695
2696    /// Specifies the manifest configuration.
2697    #[derive(Clone, Debug, PartialEq)]
2698    #[non_exhaustive]
2699    pub enum ManifestConfig {
2700        /// `DASH` manifest configuration.
2701        Dash(std::boxed::Box<crate::model::manifest::DashConfig>),
2702    }
2703}
2704
2705/// A Pub/Sub destination.
2706#[derive(Clone, Default, PartialEq)]
2707#[non_exhaustive]
2708pub struct PubsubDestination {
2709    /// The name of the Pub/Sub topic to publish job completion notification
2710    /// to. For example: `projects/{project}/topics/{topic}`.
2711    pub topic: std::string::String,
2712
2713    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2714}
2715
2716impl PubsubDestination {
2717    /// Creates a new default instance.
2718    pub fn new() -> Self {
2719        std::default::Default::default()
2720    }
2721
2722    /// Sets the value of [topic][crate::model::PubsubDestination::topic].
2723    ///
2724    /// # Example
2725    /// ```ignore,no_run
2726    /// # use google_cloud_video_transcoder_v1::model::PubsubDestination;
2727    /// let x = PubsubDestination::new().set_topic("example");
2728    /// ```
2729    pub fn set_topic<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2730        self.topic = v.into();
2731        self
2732    }
2733}
2734
2735impl wkt::message::Message for PubsubDestination {
2736    fn typename() -> &'static str {
2737        "type.googleapis.com/google.cloud.video.transcoder.v1.PubsubDestination"
2738    }
2739}
2740
2741/// Sprite sheet configuration.
2742#[derive(Clone, Default, PartialEq)]
2743#[non_exhaustive]
2744pub struct SpriteSheet {
2745    /// Format type. The default is `jpeg`.
2746    ///
2747    /// Supported formats:
2748    ///
2749    /// - `jpeg`
2750    pub format: std::string::String,
2751
2752    /// Required. File name prefix for the generated sprite sheets.
2753    ///
2754    /// Each sprite sheet has an incremental 10-digit zero-padded suffix starting
2755    /// from 0 before the extension, such as `sprite_sheet0000000123.jpeg`.
2756    pub file_prefix: std::string::String,
2757
2758    /// Required. The width of sprite in pixels. Must be an even integer. To
2759    /// preserve the source aspect ratio, set the
2760    /// [SpriteSheet.sprite_width_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_width_pixels]
2761    /// field or the
2762    /// [SpriteSheet.sprite_height_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_height_pixels]
2763    /// field, but not both (the API will automatically calculate the missing
2764    /// field).
2765    ///
2766    /// For portrait videos that contain horizontal ASR and rotation metadata,
2767    /// provide the width, in pixels, per the horizontal ASR. The API calculates
2768    /// the height per the horizontal ASR. The API detects any rotation metadata
2769    /// and swaps the requested height and width for the output.
2770    ///
2771    /// [google.cloud.video.transcoder.v1.SpriteSheet.sprite_height_pixels]: crate::model::SpriteSheet::sprite_height_pixels
2772    /// [google.cloud.video.transcoder.v1.SpriteSheet.sprite_width_pixels]: crate::model::SpriteSheet::sprite_width_pixels
2773    pub sprite_width_pixels: i32,
2774
2775    /// Required. The height of sprite in pixels. Must be an even integer. To
2776    /// preserve the source aspect ratio, set the
2777    /// [SpriteSheet.sprite_height_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_height_pixels]
2778    /// field or the
2779    /// [SpriteSheet.sprite_width_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_width_pixels]
2780    /// field, but not both (the API will automatically calculate the missing
2781    /// field).
2782    ///
2783    /// For portrait videos that contain horizontal ASR and rotation metadata,
2784    /// provide the height, in pixels, per the horizontal ASR. The API calculates
2785    /// the width per the horizontal ASR. The API detects any rotation metadata
2786    /// and swaps the requested height and width for the output.
2787    ///
2788    /// [google.cloud.video.transcoder.v1.SpriteSheet.sprite_height_pixels]: crate::model::SpriteSheet::sprite_height_pixels
2789    /// [google.cloud.video.transcoder.v1.SpriteSheet.sprite_width_pixels]: crate::model::SpriteSheet::sprite_width_pixels
2790    pub sprite_height_pixels: i32,
2791
2792    /// The maximum number of sprites per row in a sprite sheet. The default is 0,
2793    /// which indicates no maximum limit.
2794    pub column_count: i32,
2795
2796    /// The maximum number of rows per sprite sheet. When the sprite sheet is full,
2797    /// a new sprite sheet is created. The default is 0, which indicates no maximum
2798    /// limit.
2799    pub row_count: i32,
2800
2801    /// Start time in seconds, relative to the output file timeline. Determines the
2802    /// first sprite to pick. The default is `0s`.
2803    pub start_time_offset: std::option::Option<wkt::Duration>,
2804
2805    /// End time in seconds, relative to the output file timeline. When
2806    /// `end_time_offset` is not specified, the sprites are generated until the end
2807    /// of the output file.
2808    pub end_time_offset: std::option::Option<wkt::Duration>,
2809
2810    /// The quality of the generated sprite sheet. Enter a value between 1
2811    /// and 100, where 1 is the lowest quality and 100 is the highest quality.
2812    /// The default is 100. A high quality value corresponds to a low image data
2813    /// compression ratio.
2814    pub quality: i32,
2815
2816    /// Specify either total number of sprites or interval to create sprites.
2817    pub extraction_strategy: std::option::Option<crate::model::sprite_sheet::ExtractionStrategy>,
2818
2819    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2820}
2821
2822impl SpriteSheet {
2823    /// Creates a new default instance.
2824    pub fn new() -> Self {
2825        std::default::Default::default()
2826    }
2827
2828    /// Sets the value of [format][crate::model::SpriteSheet::format].
2829    ///
2830    /// # Example
2831    /// ```ignore,no_run
2832    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2833    /// let x = SpriteSheet::new().set_format("example");
2834    /// ```
2835    pub fn set_format<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2836        self.format = v.into();
2837        self
2838    }
2839
2840    /// Sets the value of [file_prefix][crate::model::SpriteSheet::file_prefix].
2841    ///
2842    /// # Example
2843    /// ```ignore,no_run
2844    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2845    /// let x = SpriteSheet::new().set_file_prefix("example");
2846    /// ```
2847    pub fn set_file_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2848        self.file_prefix = v.into();
2849        self
2850    }
2851
2852    /// Sets the value of [sprite_width_pixels][crate::model::SpriteSheet::sprite_width_pixels].
2853    ///
2854    /// # Example
2855    /// ```ignore,no_run
2856    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2857    /// let x = SpriteSheet::new().set_sprite_width_pixels(42);
2858    /// ```
2859    pub fn set_sprite_width_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2860        self.sprite_width_pixels = v.into();
2861        self
2862    }
2863
2864    /// Sets the value of [sprite_height_pixels][crate::model::SpriteSheet::sprite_height_pixels].
2865    ///
2866    /// # Example
2867    /// ```ignore,no_run
2868    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2869    /// let x = SpriteSheet::new().set_sprite_height_pixels(42);
2870    /// ```
2871    pub fn set_sprite_height_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2872        self.sprite_height_pixels = v.into();
2873        self
2874    }
2875
2876    /// Sets the value of [column_count][crate::model::SpriteSheet::column_count].
2877    ///
2878    /// # Example
2879    /// ```ignore,no_run
2880    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2881    /// let x = SpriteSheet::new().set_column_count(42);
2882    /// ```
2883    pub fn set_column_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2884        self.column_count = v.into();
2885        self
2886    }
2887
2888    /// Sets the value of [row_count][crate::model::SpriteSheet::row_count].
2889    ///
2890    /// # Example
2891    /// ```ignore,no_run
2892    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2893    /// let x = SpriteSheet::new().set_row_count(42);
2894    /// ```
2895    pub fn set_row_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2896        self.row_count = v.into();
2897        self
2898    }
2899
2900    /// Sets the value of [start_time_offset][crate::model::SpriteSheet::start_time_offset].
2901    ///
2902    /// # Example
2903    /// ```ignore,no_run
2904    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2905    /// use wkt::Duration;
2906    /// let x = SpriteSheet::new().set_start_time_offset(Duration::default()/* use setters */);
2907    /// ```
2908    pub fn set_start_time_offset<T>(mut self, v: T) -> Self
2909    where
2910        T: std::convert::Into<wkt::Duration>,
2911    {
2912        self.start_time_offset = std::option::Option::Some(v.into());
2913        self
2914    }
2915
2916    /// Sets or clears the value of [start_time_offset][crate::model::SpriteSheet::start_time_offset].
2917    ///
2918    /// # Example
2919    /// ```ignore,no_run
2920    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2921    /// use wkt::Duration;
2922    /// let x = SpriteSheet::new().set_or_clear_start_time_offset(Some(Duration::default()/* use setters */));
2923    /// let x = SpriteSheet::new().set_or_clear_start_time_offset(None::<Duration>);
2924    /// ```
2925    pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
2926    where
2927        T: std::convert::Into<wkt::Duration>,
2928    {
2929        self.start_time_offset = v.map(|x| x.into());
2930        self
2931    }
2932
2933    /// Sets the value of [end_time_offset][crate::model::SpriteSheet::end_time_offset].
2934    ///
2935    /// # Example
2936    /// ```ignore,no_run
2937    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2938    /// use wkt::Duration;
2939    /// let x = SpriteSheet::new().set_end_time_offset(Duration::default()/* use setters */);
2940    /// ```
2941    pub fn set_end_time_offset<T>(mut self, v: T) -> Self
2942    where
2943        T: std::convert::Into<wkt::Duration>,
2944    {
2945        self.end_time_offset = std::option::Option::Some(v.into());
2946        self
2947    }
2948
2949    /// Sets or clears the value of [end_time_offset][crate::model::SpriteSheet::end_time_offset].
2950    ///
2951    /// # Example
2952    /// ```ignore,no_run
2953    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2954    /// use wkt::Duration;
2955    /// let x = SpriteSheet::new().set_or_clear_end_time_offset(Some(Duration::default()/* use setters */));
2956    /// let x = SpriteSheet::new().set_or_clear_end_time_offset(None::<Duration>);
2957    /// ```
2958    pub fn set_or_clear_end_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
2959    where
2960        T: std::convert::Into<wkt::Duration>,
2961    {
2962        self.end_time_offset = v.map(|x| x.into());
2963        self
2964    }
2965
2966    /// Sets the value of [quality][crate::model::SpriteSheet::quality].
2967    ///
2968    /// # Example
2969    /// ```ignore,no_run
2970    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2971    /// let x = SpriteSheet::new().set_quality(42);
2972    /// ```
2973    pub fn set_quality<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2974        self.quality = v.into();
2975        self
2976    }
2977
2978    /// Sets the value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy].
2979    ///
2980    /// Note that all the setters affecting `extraction_strategy` are mutually
2981    /// exclusive.
2982    ///
2983    /// # Example
2984    /// ```ignore,no_run
2985    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
2986    /// use google_cloud_video_transcoder_v1::model::sprite_sheet::ExtractionStrategy;
2987    /// let x = SpriteSheet::new().set_extraction_strategy(Some(ExtractionStrategy::TotalCount(42)));
2988    /// ```
2989    pub fn set_extraction_strategy<
2990        T: std::convert::Into<std::option::Option<crate::model::sprite_sheet::ExtractionStrategy>>,
2991    >(
2992        mut self,
2993        v: T,
2994    ) -> Self {
2995        self.extraction_strategy = v.into();
2996        self
2997    }
2998
2999    /// The value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy]
3000    /// if it holds a `TotalCount`, `None` if the field is not set or
3001    /// holds a different branch.
3002    pub fn total_count(&self) -> std::option::Option<&i32> {
3003        #[allow(unreachable_patterns)]
3004        self.extraction_strategy.as_ref().and_then(|v| match v {
3005            crate::model::sprite_sheet::ExtractionStrategy::TotalCount(v) => {
3006                std::option::Option::Some(v)
3007            }
3008            _ => std::option::Option::None,
3009        })
3010    }
3011
3012    /// Sets the value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy]
3013    /// to hold a `TotalCount`.
3014    ///
3015    /// Note that all the setters affecting `extraction_strategy` are
3016    /// mutually exclusive.
3017    ///
3018    /// # Example
3019    /// ```ignore,no_run
3020    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
3021    /// let x = SpriteSheet::new().set_total_count(42);
3022    /// assert!(x.total_count().is_some());
3023    /// assert!(x.interval().is_none());
3024    /// ```
3025    pub fn set_total_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3026        self.extraction_strategy = std::option::Option::Some(
3027            crate::model::sprite_sheet::ExtractionStrategy::TotalCount(v.into()),
3028        );
3029        self
3030    }
3031
3032    /// The value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy]
3033    /// if it holds a `Interval`, `None` if the field is not set or
3034    /// holds a different branch.
3035    pub fn interval(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
3036        #[allow(unreachable_patterns)]
3037        self.extraction_strategy.as_ref().and_then(|v| match v {
3038            crate::model::sprite_sheet::ExtractionStrategy::Interval(v) => {
3039                std::option::Option::Some(v)
3040            }
3041            _ => std::option::Option::None,
3042        })
3043    }
3044
3045    /// Sets the value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy]
3046    /// to hold a `Interval`.
3047    ///
3048    /// Note that all the setters affecting `extraction_strategy` are
3049    /// mutually exclusive.
3050    ///
3051    /// # Example
3052    /// ```ignore,no_run
3053    /// # use google_cloud_video_transcoder_v1::model::SpriteSheet;
3054    /// use wkt::Duration;
3055    /// let x = SpriteSheet::new().set_interval(Duration::default()/* use setters */);
3056    /// assert!(x.interval().is_some());
3057    /// assert!(x.total_count().is_none());
3058    /// ```
3059    pub fn set_interval<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
3060        mut self,
3061        v: T,
3062    ) -> Self {
3063        self.extraction_strategy = std::option::Option::Some(
3064            crate::model::sprite_sheet::ExtractionStrategy::Interval(v.into()),
3065        );
3066        self
3067    }
3068}
3069
3070impl wkt::message::Message for SpriteSheet {
3071    fn typename() -> &'static str {
3072        "type.googleapis.com/google.cloud.video.transcoder.v1.SpriteSheet"
3073    }
3074}
3075
3076/// Defines additional types related to [SpriteSheet].
3077pub mod sprite_sheet {
3078    #[allow(unused_imports)]
3079    use super::*;
3080
3081    /// Specify either total number of sprites or interval to create sprites.
3082    #[derive(Clone, Debug, PartialEq)]
3083    #[non_exhaustive]
3084    pub enum ExtractionStrategy {
3085        /// Total number of sprites. Create the specified number of sprites
3086        /// distributed evenly across the timeline of the output media. The default
3087        /// is 100.
3088        TotalCount(i32),
3089        /// Starting from `0s`, create sprites at regular intervals. Specify the
3090        /// interval value in seconds.
3091        Interval(std::boxed::Box<wkt::Duration>),
3092    }
3093}
3094
3095/// Overlay configuration.
3096#[derive(Clone, Default, PartialEq)]
3097#[non_exhaustive]
3098pub struct Overlay {
3099    /// Image overlay.
3100    pub image: std::option::Option<crate::model::overlay::Image>,
3101
3102    /// List of animations. The list should be chronological, without any time
3103    /// overlap.
3104    pub animations: std::vec::Vec<crate::model::overlay::Animation>,
3105
3106    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3107}
3108
3109impl Overlay {
3110    /// Creates a new default instance.
3111    pub fn new() -> Self {
3112        std::default::Default::default()
3113    }
3114
3115    /// Sets the value of [image][crate::model::Overlay::image].
3116    ///
3117    /// # Example
3118    /// ```ignore,no_run
3119    /// # use google_cloud_video_transcoder_v1::model::Overlay;
3120    /// use google_cloud_video_transcoder_v1::model::overlay::Image;
3121    /// let x = Overlay::new().set_image(Image::default()/* use setters */);
3122    /// ```
3123    pub fn set_image<T>(mut self, v: T) -> Self
3124    where
3125        T: std::convert::Into<crate::model::overlay::Image>,
3126    {
3127        self.image = std::option::Option::Some(v.into());
3128        self
3129    }
3130
3131    /// Sets or clears the value of [image][crate::model::Overlay::image].
3132    ///
3133    /// # Example
3134    /// ```ignore,no_run
3135    /// # use google_cloud_video_transcoder_v1::model::Overlay;
3136    /// use google_cloud_video_transcoder_v1::model::overlay::Image;
3137    /// let x = Overlay::new().set_or_clear_image(Some(Image::default()/* use setters */));
3138    /// let x = Overlay::new().set_or_clear_image(None::<Image>);
3139    /// ```
3140    pub fn set_or_clear_image<T>(mut self, v: std::option::Option<T>) -> Self
3141    where
3142        T: std::convert::Into<crate::model::overlay::Image>,
3143    {
3144        self.image = v.map(|x| x.into());
3145        self
3146    }
3147
3148    /// Sets the value of [animations][crate::model::Overlay::animations].
3149    ///
3150    /// # Example
3151    /// ```ignore,no_run
3152    /// # use google_cloud_video_transcoder_v1::model::Overlay;
3153    /// use google_cloud_video_transcoder_v1::model::overlay::Animation;
3154    /// let x = Overlay::new()
3155    ///     .set_animations([
3156    ///         Animation::default()/* use setters */,
3157    ///         Animation::default()/* use (different) setters */,
3158    ///     ]);
3159    /// ```
3160    pub fn set_animations<T, V>(mut self, v: T) -> Self
3161    where
3162        T: std::iter::IntoIterator<Item = V>,
3163        V: std::convert::Into<crate::model::overlay::Animation>,
3164    {
3165        use std::iter::Iterator;
3166        self.animations = v.into_iter().map(|i| i.into()).collect();
3167        self
3168    }
3169}
3170
3171impl wkt::message::Message for Overlay {
3172    fn typename() -> &'static str {
3173        "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay"
3174    }
3175}
3176
3177/// Defines additional types related to [Overlay].
3178pub mod overlay {
3179    #[allow(unused_imports)]
3180    use super::*;
3181
3182    /// 2D normalized coordinates. Default: `{0.0, 0.0}`
3183    #[derive(Clone, Default, PartialEq)]
3184    #[non_exhaustive]
3185    pub struct NormalizedCoordinate {
3186        /// Normalized x coordinate.
3187        pub x: f64,
3188
3189        /// Normalized y coordinate.
3190        pub y: f64,
3191
3192        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3193    }
3194
3195    impl NormalizedCoordinate {
3196        /// Creates a new default instance.
3197        pub fn new() -> Self {
3198            std::default::Default::default()
3199        }
3200
3201        /// Sets the value of [x][crate::model::overlay::NormalizedCoordinate::x].
3202        ///
3203        /// # Example
3204        /// ```ignore,no_run
3205        /// # use google_cloud_video_transcoder_v1::model::overlay::NormalizedCoordinate;
3206        /// let x = NormalizedCoordinate::new().set_x(42.0);
3207        /// ```
3208        pub fn set_x<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
3209            self.x = v.into();
3210            self
3211        }
3212
3213        /// Sets the value of [y][crate::model::overlay::NormalizedCoordinate::y].
3214        ///
3215        /// # Example
3216        /// ```ignore,no_run
3217        /// # use google_cloud_video_transcoder_v1::model::overlay::NormalizedCoordinate;
3218        /// let x = NormalizedCoordinate::new().set_y(42.0);
3219        /// ```
3220        pub fn set_y<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
3221            self.y = v.into();
3222            self
3223        }
3224    }
3225
3226    impl wkt::message::Message for NormalizedCoordinate {
3227        fn typename() -> &'static str {
3228            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate"
3229        }
3230    }
3231
3232    /// Overlaid image.
3233    #[derive(Clone, Default, PartialEq)]
3234    #[non_exhaustive]
3235    pub struct Image {
3236        /// Required. URI of the image in Cloud Storage. For example,
3237        /// `gs://bucket/inputs/image.png`. Only PNG and JPEG images are supported.
3238        pub uri: std::string::String,
3239
3240        /// Normalized image resolution, based on output video resolution. Valid
3241        /// values: `0.0`–`1.0`. To respect the original image aspect ratio, set
3242        /// either `x` or `y` to `0.0`. To use the original image resolution, set
3243        /// both `x` and `y` to `0.0`.
3244        pub resolution: std::option::Option<crate::model::overlay::NormalizedCoordinate>,
3245
3246        /// Target image opacity. Valid values are from  `1.0` (solid, default) to
3247        /// `0.0` (transparent), exclusive. Set this to a value greater than `0.0`.
3248        pub alpha: f64,
3249
3250        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3251    }
3252
3253    impl Image {
3254        /// Creates a new default instance.
3255        pub fn new() -> Self {
3256            std::default::Default::default()
3257        }
3258
3259        /// Sets the value of [uri][crate::model::overlay::Image::uri].
3260        ///
3261        /// # Example
3262        /// ```ignore,no_run
3263        /// # use google_cloud_video_transcoder_v1::model::overlay::Image;
3264        /// let x = Image::new().set_uri("example");
3265        /// ```
3266        pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3267            self.uri = v.into();
3268            self
3269        }
3270
3271        /// Sets the value of [resolution][crate::model::overlay::Image::resolution].
3272        ///
3273        /// # Example
3274        /// ```ignore,no_run
3275        /// # use google_cloud_video_transcoder_v1::model::overlay::Image;
3276        /// use google_cloud_video_transcoder_v1::model::overlay::NormalizedCoordinate;
3277        /// let x = Image::new().set_resolution(NormalizedCoordinate::default()/* use setters */);
3278        /// ```
3279        pub fn set_resolution<T>(mut self, v: T) -> Self
3280        where
3281            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
3282        {
3283            self.resolution = std::option::Option::Some(v.into());
3284            self
3285        }
3286
3287        /// Sets or clears the value of [resolution][crate::model::overlay::Image::resolution].
3288        ///
3289        /// # Example
3290        /// ```ignore,no_run
3291        /// # use google_cloud_video_transcoder_v1::model::overlay::Image;
3292        /// use google_cloud_video_transcoder_v1::model::overlay::NormalizedCoordinate;
3293        /// let x = Image::new().set_or_clear_resolution(Some(NormalizedCoordinate::default()/* use setters */));
3294        /// let x = Image::new().set_or_clear_resolution(None::<NormalizedCoordinate>);
3295        /// ```
3296        pub fn set_or_clear_resolution<T>(mut self, v: std::option::Option<T>) -> Self
3297        where
3298            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
3299        {
3300            self.resolution = v.map(|x| x.into());
3301            self
3302        }
3303
3304        /// Sets the value of [alpha][crate::model::overlay::Image::alpha].
3305        ///
3306        /// # Example
3307        /// ```ignore,no_run
3308        /// # use google_cloud_video_transcoder_v1::model::overlay::Image;
3309        /// let x = Image::new().set_alpha(42.0);
3310        /// ```
3311        pub fn set_alpha<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
3312            self.alpha = v.into();
3313            self
3314        }
3315    }
3316
3317    impl wkt::message::Message for Image {
3318        fn typename() -> &'static str {
3319            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.Image"
3320        }
3321    }
3322
3323    /// Display static overlay object.
3324    #[derive(Clone, Default, PartialEq)]
3325    #[non_exhaustive]
3326    pub struct AnimationStatic {
3327        /// Normalized coordinates based on output video resolution. Valid
3328        /// values: `0.0`–`1.0`. `xy` is the upper-left coordinate of the overlay
3329        /// object. For example, use the x and y coordinates {0,0} to position the
3330        /// top-left corner of the overlay animation in the top-left corner of the
3331        /// output video.
3332        pub xy: std::option::Option<crate::model::overlay::NormalizedCoordinate>,
3333
3334        /// The time to start displaying the overlay object, in seconds. Default: 0
3335        pub start_time_offset: std::option::Option<wkt::Duration>,
3336
3337        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3338    }
3339
3340    impl AnimationStatic {
3341        /// Creates a new default instance.
3342        pub fn new() -> Self {
3343            std::default::Default::default()
3344        }
3345
3346        /// Sets the value of [xy][crate::model::overlay::AnimationStatic::xy].
3347        ///
3348        /// # Example
3349        /// ```ignore,no_run
3350        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationStatic;
3351        /// use google_cloud_video_transcoder_v1::model::overlay::NormalizedCoordinate;
3352        /// let x = AnimationStatic::new().set_xy(NormalizedCoordinate::default()/* use setters */);
3353        /// ```
3354        pub fn set_xy<T>(mut self, v: T) -> Self
3355        where
3356            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
3357        {
3358            self.xy = std::option::Option::Some(v.into());
3359            self
3360        }
3361
3362        /// Sets or clears the value of [xy][crate::model::overlay::AnimationStatic::xy].
3363        ///
3364        /// # Example
3365        /// ```ignore,no_run
3366        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationStatic;
3367        /// use google_cloud_video_transcoder_v1::model::overlay::NormalizedCoordinate;
3368        /// let x = AnimationStatic::new().set_or_clear_xy(Some(NormalizedCoordinate::default()/* use setters */));
3369        /// let x = AnimationStatic::new().set_or_clear_xy(None::<NormalizedCoordinate>);
3370        /// ```
3371        pub fn set_or_clear_xy<T>(mut self, v: std::option::Option<T>) -> Self
3372        where
3373            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
3374        {
3375            self.xy = v.map(|x| x.into());
3376            self
3377        }
3378
3379        /// Sets the value of [start_time_offset][crate::model::overlay::AnimationStatic::start_time_offset].
3380        ///
3381        /// # Example
3382        /// ```ignore,no_run
3383        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationStatic;
3384        /// use wkt::Duration;
3385        /// let x = AnimationStatic::new().set_start_time_offset(Duration::default()/* use setters */);
3386        /// ```
3387        pub fn set_start_time_offset<T>(mut self, v: T) -> Self
3388        where
3389            T: std::convert::Into<wkt::Duration>,
3390        {
3391            self.start_time_offset = std::option::Option::Some(v.into());
3392            self
3393        }
3394
3395        /// Sets or clears the value of [start_time_offset][crate::model::overlay::AnimationStatic::start_time_offset].
3396        ///
3397        /// # Example
3398        /// ```ignore,no_run
3399        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationStatic;
3400        /// use wkt::Duration;
3401        /// let x = AnimationStatic::new().set_or_clear_start_time_offset(Some(Duration::default()/* use setters */));
3402        /// let x = AnimationStatic::new().set_or_clear_start_time_offset(None::<Duration>);
3403        /// ```
3404        pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
3405        where
3406            T: std::convert::Into<wkt::Duration>,
3407        {
3408            self.start_time_offset = v.map(|x| x.into());
3409            self
3410        }
3411    }
3412
3413    impl wkt::message::Message for AnimationStatic {
3414        fn typename() -> &'static str {
3415            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.AnimationStatic"
3416        }
3417    }
3418
3419    /// Display overlay object with fade animation.
3420    #[derive(Clone, Default, PartialEq)]
3421    #[non_exhaustive]
3422    pub struct AnimationFade {
3423        /// Required. Type of fade animation: `FADE_IN` or `FADE_OUT`.
3424        pub fade_type: crate::model::overlay::FadeType,
3425
3426        /// Normalized coordinates based on output video resolution. Valid
3427        /// values: `0.0`–`1.0`. `xy` is the upper-left coordinate of the overlay
3428        /// object. For example, use the x and y coordinates {0,0} to position the
3429        /// top-left corner of the overlay animation in the top-left corner of the
3430        /// output video.
3431        pub xy: std::option::Option<crate::model::overlay::NormalizedCoordinate>,
3432
3433        /// The time to start the fade animation, in seconds. Default: 0
3434        pub start_time_offset: std::option::Option<wkt::Duration>,
3435
3436        /// The time to end the fade animation, in seconds. Default:
3437        /// `start_time_offset` + 1s
3438        pub end_time_offset: std::option::Option<wkt::Duration>,
3439
3440        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3441    }
3442
3443    impl AnimationFade {
3444        /// Creates a new default instance.
3445        pub fn new() -> Self {
3446            std::default::Default::default()
3447        }
3448
3449        /// Sets the value of [fade_type][crate::model::overlay::AnimationFade::fade_type].
3450        ///
3451        /// # Example
3452        /// ```ignore,no_run
3453        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationFade;
3454        /// use google_cloud_video_transcoder_v1::model::overlay::FadeType;
3455        /// let x0 = AnimationFade::new().set_fade_type(FadeType::FadeIn);
3456        /// let x1 = AnimationFade::new().set_fade_type(FadeType::FadeOut);
3457        /// ```
3458        pub fn set_fade_type<T: std::convert::Into<crate::model::overlay::FadeType>>(
3459            mut self,
3460            v: T,
3461        ) -> Self {
3462            self.fade_type = v.into();
3463            self
3464        }
3465
3466        /// Sets the value of [xy][crate::model::overlay::AnimationFade::xy].
3467        ///
3468        /// # Example
3469        /// ```ignore,no_run
3470        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationFade;
3471        /// use google_cloud_video_transcoder_v1::model::overlay::NormalizedCoordinate;
3472        /// let x = AnimationFade::new().set_xy(NormalizedCoordinate::default()/* use setters */);
3473        /// ```
3474        pub fn set_xy<T>(mut self, v: T) -> Self
3475        where
3476            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
3477        {
3478            self.xy = std::option::Option::Some(v.into());
3479            self
3480        }
3481
3482        /// Sets or clears the value of [xy][crate::model::overlay::AnimationFade::xy].
3483        ///
3484        /// # Example
3485        /// ```ignore,no_run
3486        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationFade;
3487        /// use google_cloud_video_transcoder_v1::model::overlay::NormalizedCoordinate;
3488        /// let x = AnimationFade::new().set_or_clear_xy(Some(NormalizedCoordinate::default()/* use setters */));
3489        /// let x = AnimationFade::new().set_or_clear_xy(None::<NormalizedCoordinate>);
3490        /// ```
3491        pub fn set_or_clear_xy<T>(mut self, v: std::option::Option<T>) -> Self
3492        where
3493            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
3494        {
3495            self.xy = v.map(|x| x.into());
3496            self
3497        }
3498
3499        /// Sets the value of [start_time_offset][crate::model::overlay::AnimationFade::start_time_offset].
3500        ///
3501        /// # Example
3502        /// ```ignore,no_run
3503        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationFade;
3504        /// use wkt::Duration;
3505        /// let x = AnimationFade::new().set_start_time_offset(Duration::default()/* use setters */);
3506        /// ```
3507        pub fn set_start_time_offset<T>(mut self, v: T) -> Self
3508        where
3509            T: std::convert::Into<wkt::Duration>,
3510        {
3511            self.start_time_offset = std::option::Option::Some(v.into());
3512            self
3513        }
3514
3515        /// Sets or clears the value of [start_time_offset][crate::model::overlay::AnimationFade::start_time_offset].
3516        ///
3517        /// # Example
3518        /// ```ignore,no_run
3519        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationFade;
3520        /// use wkt::Duration;
3521        /// let x = AnimationFade::new().set_or_clear_start_time_offset(Some(Duration::default()/* use setters */));
3522        /// let x = AnimationFade::new().set_or_clear_start_time_offset(None::<Duration>);
3523        /// ```
3524        pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
3525        where
3526            T: std::convert::Into<wkt::Duration>,
3527        {
3528            self.start_time_offset = v.map(|x| x.into());
3529            self
3530        }
3531
3532        /// Sets the value of [end_time_offset][crate::model::overlay::AnimationFade::end_time_offset].
3533        ///
3534        /// # Example
3535        /// ```ignore,no_run
3536        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationFade;
3537        /// use wkt::Duration;
3538        /// let x = AnimationFade::new().set_end_time_offset(Duration::default()/* use setters */);
3539        /// ```
3540        pub fn set_end_time_offset<T>(mut self, v: T) -> Self
3541        where
3542            T: std::convert::Into<wkt::Duration>,
3543        {
3544            self.end_time_offset = std::option::Option::Some(v.into());
3545            self
3546        }
3547
3548        /// Sets or clears the value of [end_time_offset][crate::model::overlay::AnimationFade::end_time_offset].
3549        ///
3550        /// # Example
3551        /// ```ignore,no_run
3552        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationFade;
3553        /// use wkt::Duration;
3554        /// let x = AnimationFade::new().set_or_clear_end_time_offset(Some(Duration::default()/* use setters */));
3555        /// let x = AnimationFade::new().set_or_clear_end_time_offset(None::<Duration>);
3556        /// ```
3557        pub fn set_or_clear_end_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
3558        where
3559            T: std::convert::Into<wkt::Duration>,
3560        {
3561            self.end_time_offset = v.map(|x| x.into());
3562            self
3563        }
3564    }
3565
3566    impl wkt::message::Message for AnimationFade {
3567        fn typename() -> &'static str {
3568            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.AnimationFade"
3569        }
3570    }
3571
3572    /// End previous overlay animation from the video. Without `AnimationEnd`, the
3573    /// overlay object will keep the state of previous animation until the end of
3574    /// the video.
3575    #[derive(Clone, Default, PartialEq)]
3576    #[non_exhaustive]
3577    pub struct AnimationEnd {
3578        /// The time to end overlay object, in seconds. Default: 0
3579        pub start_time_offset: std::option::Option<wkt::Duration>,
3580
3581        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3582    }
3583
3584    impl AnimationEnd {
3585        /// Creates a new default instance.
3586        pub fn new() -> Self {
3587            std::default::Default::default()
3588        }
3589
3590        /// Sets the value of [start_time_offset][crate::model::overlay::AnimationEnd::start_time_offset].
3591        ///
3592        /// # Example
3593        /// ```ignore,no_run
3594        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationEnd;
3595        /// use wkt::Duration;
3596        /// let x = AnimationEnd::new().set_start_time_offset(Duration::default()/* use setters */);
3597        /// ```
3598        pub fn set_start_time_offset<T>(mut self, v: T) -> Self
3599        where
3600            T: std::convert::Into<wkt::Duration>,
3601        {
3602            self.start_time_offset = std::option::Option::Some(v.into());
3603            self
3604        }
3605
3606        /// Sets or clears the value of [start_time_offset][crate::model::overlay::AnimationEnd::start_time_offset].
3607        ///
3608        /// # Example
3609        /// ```ignore,no_run
3610        /// # use google_cloud_video_transcoder_v1::model::overlay::AnimationEnd;
3611        /// use wkt::Duration;
3612        /// let x = AnimationEnd::new().set_or_clear_start_time_offset(Some(Duration::default()/* use setters */));
3613        /// let x = AnimationEnd::new().set_or_clear_start_time_offset(None::<Duration>);
3614        /// ```
3615        pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
3616        where
3617            T: std::convert::Into<wkt::Duration>,
3618        {
3619            self.start_time_offset = v.map(|x| x.into());
3620            self
3621        }
3622    }
3623
3624    impl wkt::message::Message for AnimationEnd {
3625        fn typename() -> &'static str {
3626            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.AnimationEnd"
3627        }
3628    }
3629
3630    /// Animation types.
3631    #[derive(Clone, Default, PartialEq)]
3632    #[non_exhaustive]
3633    pub struct Animation {
3634        /// Animations can be static or fade, or they can end the previous animation.
3635        pub animation_type: std::option::Option<crate::model::overlay::animation::AnimationType>,
3636
3637        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3638    }
3639
3640    impl Animation {
3641        /// Creates a new default instance.
3642        pub fn new() -> Self {
3643            std::default::Default::default()
3644        }
3645
3646        /// Sets the value of [animation_type][crate::model::overlay::Animation::animation_type].
3647        ///
3648        /// Note that all the setters affecting `animation_type` are mutually
3649        /// exclusive.
3650        ///
3651        /// # Example
3652        /// ```ignore,no_run
3653        /// # use google_cloud_video_transcoder_v1::model::overlay::Animation;
3654        /// use google_cloud_video_transcoder_v1::model::overlay::AnimationStatic;
3655        /// let x = Animation::new().set_animation_type(Some(
3656        ///     google_cloud_video_transcoder_v1::model::overlay::animation::AnimationType::AnimationStatic(AnimationStatic::default().into())));
3657        /// ```
3658        pub fn set_animation_type<
3659            T: std::convert::Into<
3660                    std::option::Option<crate::model::overlay::animation::AnimationType>,
3661                >,
3662        >(
3663            mut self,
3664            v: T,
3665        ) -> Self {
3666            self.animation_type = v.into();
3667            self
3668        }
3669
3670        /// The value of [animation_type][crate::model::overlay::Animation::animation_type]
3671        /// if it holds a `AnimationStatic`, `None` if the field is not set or
3672        /// holds a different branch.
3673        pub fn animation_static(
3674            &self,
3675        ) -> std::option::Option<&std::boxed::Box<crate::model::overlay::AnimationStatic>> {
3676            #[allow(unreachable_patterns)]
3677            self.animation_type.as_ref().and_then(|v| match v {
3678                crate::model::overlay::animation::AnimationType::AnimationStatic(v) => {
3679                    std::option::Option::Some(v)
3680                }
3681                _ => std::option::Option::None,
3682            })
3683        }
3684
3685        /// Sets the value of [animation_type][crate::model::overlay::Animation::animation_type]
3686        /// to hold a `AnimationStatic`.
3687        ///
3688        /// Note that all the setters affecting `animation_type` are
3689        /// mutually exclusive.
3690        ///
3691        /// # Example
3692        /// ```ignore,no_run
3693        /// # use google_cloud_video_transcoder_v1::model::overlay::Animation;
3694        /// use google_cloud_video_transcoder_v1::model::overlay::AnimationStatic;
3695        /// let x = Animation::new().set_animation_static(AnimationStatic::default()/* use setters */);
3696        /// assert!(x.animation_static().is_some());
3697        /// assert!(x.animation_fade().is_none());
3698        /// assert!(x.animation_end().is_none());
3699        /// ```
3700        pub fn set_animation_static<
3701            T: std::convert::Into<std::boxed::Box<crate::model::overlay::AnimationStatic>>,
3702        >(
3703            mut self,
3704            v: T,
3705        ) -> Self {
3706            self.animation_type = std::option::Option::Some(
3707                crate::model::overlay::animation::AnimationType::AnimationStatic(v.into()),
3708            );
3709            self
3710        }
3711
3712        /// The value of [animation_type][crate::model::overlay::Animation::animation_type]
3713        /// if it holds a `AnimationFade`, `None` if the field is not set or
3714        /// holds a different branch.
3715        pub fn animation_fade(
3716            &self,
3717        ) -> std::option::Option<&std::boxed::Box<crate::model::overlay::AnimationFade>> {
3718            #[allow(unreachable_patterns)]
3719            self.animation_type.as_ref().and_then(|v| match v {
3720                crate::model::overlay::animation::AnimationType::AnimationFade(v) => {
3721                    std::option::Option::Some(v)
3722                }
3723                _ => std::option::Option::None,
3724            })
3725        }
3726
3727        /// Sets the value of [animation_type][crate::model::overlay::Animation::animation_type]
3728        /// to hold a `AnimationFade`.
3729        ///
3730        /// Note that all the setters affecting `animation_type` are
3731        /// mutually exclusive.
3732        ///
3733        /// # Example
3734        /// ```ignore,no_run
3735        /// # use google_cloud_video_transcoder_v1::model::overlay::Animation;
3736        /// use google_cloud_video_transcoder_v1::model::overlay::AnimationFade;
3737        /// let x = Animation::new().set_animation_fade(AnimationFade::default()/* use setters */);
3738        /// assert!(x.animation_fade().is_some());
3739        /// assert!(x.animation_static().is_none());
3740        /// assert!(x.animation_end().is_none());
3741        /// ```
3742        pub fn set_animation_fade<
3743            T: std::convert::Into<std::boxed::Box<crate::model::overlay::AnimationFade>>,
3744        >(
3745            mut self,
3746            v: T,
3747        ) -> Self {
3748            self.animation_type = std::option::Option::Some(
3749                crate::model::overlay::animation::AnimationType::AnimationFade(v.into()),
3750            );
3751            self
3752        }
3753
3754        /// The value of [animation_type][crate::model::overlay::Animation::animation_type]
3755        /// if it holds a `AnimationEnd`, `None` if the field is not set or
3756        /// holds a different branch.
3757        pub fn animation_end(
3758            &self,
3759        ) -> std::option::Option<&std::boxed::Box<crate::model::overlay::AnimationEnd>> {
3760            #[allow(unreachable_patterns)]
3761            self.animation_type.as_ref().and_then(|v| match v {
3762                crate::model::overlay::animation::AnimationType::AnimationEnd(v) => {
3763                    std::option::Option::Some(v)
3764                }
3765                _ => std::option::Option::None,
3766            })
3767        }
3768
3769        /// Sets the value of [animation_type][crate::model::overlay::Animation::animation_type]
3770        /// to hold a `AnimationEnd`.
3771        ///
3772        /// Note that all the setters affecting `animation_type` are
3773        /// mutually exclusive.
3774        ///
3775        /// # Example
3776        /// ```ignore,no_run
3777        /// # use google_cloud_video_transcoder_v1::model::overlay::Animation;
3778        /// use google_cloud_video_transcoder_v1::model::overlay::AnimationEnd;
3779        /// let x = Animation::new().set_animation_end(AnimationEnd::default()/* use setters */);
3780        /// assert!(x.animation_end().is_some());
3781        /// assert!(x.animation_static().is_none());
3782        /// assert!(x.animation_fade().is_none());
3783        /// ```
3784        pub fn set_animation_end<
3785            T: std::convert::Into<std::boxed::Box<crate::model::overlay::AnimationEnd>>,
3786        >(
3787            mut self,
3788            v: T,
3789        ) -> Self {
3790            self.animation_type = std::option::Option::Some(
3791                crate::model::overlay::animation::AnimationType::AnimationEnd(v.into()),
3792            );
3793            self
3794        }
3795    }
3796
3797    impl wkt::message::Message for Animation {
3798        fn typename() -> &'static str {
3799            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.Animation"
3800        }
3801    }
3802
3803    /// Defines additional types related to [Animation].
3804    pub mod animation {
3805        #[allow(unused_imports)]
3806        use super::*;
3807
3808        /// Animations can be static or fade, or they can end the previous animation.
3809        #[derive(Clone, Debug, PartialEq)]
3810        #[non_exhaustive]
3811        pub enum AnimationType {
3812            /// Display static overlay object.
3813            AnimationStatic(std::boxed::Box<crate::model::overlay::AnimationStatic>),
3814            /// Display overlay object with fade animation.
3815            AnimationFade(std::boxed::Box<crate::model::overlay::AnimationFade>),
3816            /// End previous animation.
3817            AnimationEnd(std::boxed::Box<crate::model::overlay::AnimationEnd>),
3818        }
3819    }
3820
3821    /// Fade type for the overlay: `FADE_IN` or `FADE_OUT`.
3822    ///
3823    /// # Working with unknown values
3824    ///
3825    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3826    /// additional enum variants at any time. Adding new variants is not considered
3827    /// a breaking change. Applications should write their code in anticipation of:
3828    ///
3829    /// - New values appearing in future releases of the client library, **and**
3830    /// - New values received dynamically, without application changes.
3831    ///
3832    /// Please consult the [Working with enums] section in the user guide for some
3833    /// guidelines.
3834    ///
3835    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3836    #[derive(Clone, Debug, PartialEq)]
3837    #[non_exhaustive]
3838    pub enum FadeType {
3839        /// The fade type is not specified.
3840        Unspecified,
3841        /// Fade the overlay object into view.
3842        FadeIn,
3843        /// Fade the overlay object out of view.
3844        FadeOut,
3845        /// If set, the enum was initialized with an unknown value.
3846        ///
3847        /// Applications can examine the value using [FadeType::value] or
3848        /// [FadeType::name].
3849        UnknownValue(fade_type::UnknownValue),
3850    }
3851
3852    #[doc(hidden)]
3853    pub mod fade_type {
3854        #[allow(unused_imports)]
3855        use super::*;
3856        #[derive(Clone, Debug, PartialEq)]
3857        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3858    }
3859
3860    impl FadeType {
3861        /// Gets the enum value.
3862        ///
3863        /// Returns `None` if the enum contains an unknown value deserialized from
3864        /// the string representation of enums.
3865        pub fn value(&self) -> std::option::Option<i32> {
3866            match self {
3867                Self::Unspecified => std::option::Option::Some(0),
3868                Self::FadeIn => std::option::Option::Some(1),
3869                Self::FadeOut => std::option::Option::Some(2),
3870                Self::UnknownValue(u) => u.0.value(),
3871            }
3872        }
3873
3874        /// Gets the enum value as a string.
3875        ///
3876        /// Returns `None` if the enum contains an unknown value deserialized from
3877        /// the integer representation of enums.
3878        pub fn name(&self) -> std::option::Option<&str> {
3879            match self {
3880                Self::Unspecified => std::option::Option::Some("FADE_TYPE_UNSPECIFIED"),
3881                Self::FadeIn => std::option::Option::Some("FADE_IN"),
3882                Self::FadeOut => std::option::Option::Some("FADE_OUT"),
3883                Self::UnknownValue(u) => u.0.name(),
3884            }
3885        }
3886    }
3887
3888    impl std::default::Default for FadeType {
3889        fn default() -> Self {
3890            use std::convert::From;
3891            Self::from(0)
3892        }
3893    }
3894
3895    impl std::fmt::Display for FadeType {
3896        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3897            wkt::internal::display_enum(f, self.name(), self.value())
3898        }
3899    }
3900
3901    impl std::convert::From<i32> for FadeType {
3902        fn from(value: i32) -> Self {
3903            match value {
3904                0 => Self::Unspecified,
3905                1 => Self::FadeIn,
3906                2 => Self::FadeOut,
3907                _ => Self::UnknownValue(fade_type::UnknownValue(
3908                    wkt::internal::UnknownEnumValue::Integer(value),
3909                )),
3910            }
3911        }
3912    }
3913
3914    impl std::convert::From<&str> for FadeType {
3915        fn from(value: &str) -> Self {
3916            use std::string::ToString;
3917            match value {
3918                "FADE_TYPE_UNSPECIFIED" => Self::Unspecified,
3919                "FADE_IN" => Self::FadeIn,
3920                "FADE_OUT" => Self::FadeOut,
3921                _ => Self::UnknownValue(fade_type::UnknownValue(
3922                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3923                )),
3924            }
3925        }
3926    }
3927
3928    impl serde::ser::Serialize for FadeType {
3929        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3930        where
3931            S: serde::Serializer,
3932        {
3933            match self {
3934                Self::Unspecified => serializer.serialize_i32(0),
3935                Self::FadeIn => serializer.serialize_i32(1),
3936                Self::FadeOut => serializer.serialize_i32(2),
3937                Self::UnknownValue(u) => u.0.serialize(serializer),
3938            }
3939        }
3940    }
3941
3942    impl<'de> serde::de::Deserialize<'de> for FadeType {
3943        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3944        where
3945            D: serde::Deserializer<'de>,
3946        {
3947            deserializer.deserialize_any(wkt::internal::EnumVisitor::<FadeType>::new(
3948                ".google.cloud.video.transcoder.v1.Overlay.FadeType",
3949            ))
3950        }
3951    }
3952}
3953
3954/// Preprocessing configurations.
3955#[derive(Clone, Default, PartialEq)]
3956#[non_exhaustive]
3957pub struct PreprocessingConfig {
3958    /// Color preprocessing configuration.
3959    pub color: std::option::Option<crate::model::preprocessing_config::Color>,
3960
3961    /// Denoise preprocessing configuration.
3962    pub denoise: std::option::Option<crate::model::preprocessing_config::Denoise>,
3963
3964    /// Deblock preprocessing configuration.
3965    pub deblock: std::option::Option<crate::model::preprocessing_config::Deblock>,
3966
3967    /// Audio preprocessing configuration.
3968    pub audio: std::option::Option<crate::model::preprocessing_config::Audio>,
3969
3970    /// Specify the video cropping configuration.
3971    pub crop: std::option::Option<crate::model::preprocessing_config::Crop>,
3972
3973    /// Specify the video pad filter configuration.
3974    pub pad: std::option::Option<crate::model::preprocessing_config::Pad>,
3975
3976    /// Specify the video deinterlace configuration.
3977    pub deinterlace: std::option::Option<crate::model::preprocessing_config::Deinterlace>,
3978
3979    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3980}
3981
3982impl PreprocessingConfig {
3983    /// Creates a new default instance.
3984    pub fn new() -> Self {
3985        std::default::Default::default()
3986    }
3987
3988    /// Sets the value of [color][crate::model::PreprocessingConfig::color].
3989    ///
3990    /// # Example
3991    /// ```ignore,no_run
3992    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
3993    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Color;
3994    /// let x = PreprocessingConfig::new().set_color(Color::default()/* use setters */);
3995    /// ```
3996    pub fn set_color<T>(mut self, v: T) -> Self
3997    where
3998        T: std::convert::Into<crate::model::preprocessing_config::Color>,
3999    {
4000        self.color = std::option::Option::Some(v.into());
4001        self
4002    }
4003
4004    /// Sets or clears the value of [color][crate::model::PreprocessingConfig::color].
4005    ///
4006    /// # Example
4007    /// ```ignore,no_run
4008    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4009    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Color;
4010    /// let x = PreprocessingConfig::new().set_or_clear_color(Some(Color::default()/* use setters */));
4011    /// let x = PreprocessingConfig::new().set_or_clear_color(None::<Color>);
4012    /// ```
4013    pub fn set_or_clear_color<T>(mut self, v: std::option::Option<T>) -> Self
4014    where
4015        T: std::convert::Into<crate::model::preprocessing_config::Color>,
4016    {
4017        self.color = v.map(|x| x.into());
4018        self
4019    }
4020
4021    /// Sets the value of [denoise][crate::model::PreprocessingConfig::denoise].
4022    ///
4023    /// # Example
4024    /// ```ignore,no_run
4025    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4026    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Denoise;
4027    /// let x = PreprocessingConfig::new().set_denoise(Denoise::default()/* use setters */);
4028    /// ```
4029    pub fn set_denoise<T>(mut self, v: T) -> Self
4030    where
4031        T: std::convert::Into<crate::model::preprocessing_config::Denoise>,
4032    {
4033        self.denoise = std::option::Option::Some(v.into());
4034        self
4035    }
4036
4037    /// Sets or clears the value of [denoise][crate::model::PreprocessingConfig::denoise].
4038    ///
4039    /// # Example
4040    /// ```ignore,no_run
4041    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4042    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Denoise;
4043    /// let x = PreprocessingConfig::new().set_or_clear_denoise(Some(Denoise::default()/* use setters */));
4044    /// let x = PreprocessingConfig::new().set_or_clear_denoise(None::<Denoise>);
4045    /// ```
4046    pub fn set_or_clear_denoise<T>(mut self, v: std::option::Option<T>) -> Self
4047    where
4048        T: std::convert::Into<crate::model::preprocessing_config::Denoise>,
4049    {
4050        self.denoise = v.map(|x| x.into());
4051        self
4052    }
4053
4054    /// Sets the value of [deblock][crate::model::PreprocessingConfig::deblock].
4055    ///
4056    /// # Example
4057    /// ```ignore,no_run
4058    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4059    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Deblock;
4060    /// let x = PreprocessingConfig::new().set_deblock(Deblock::default()/* use setters */);
4061    /// ```
4062    pub fn set_deblock<T>(mut self, v: T) -> Self
4063    where
4064        T: std::convert::Into<crate::model::preprocessing_config::Deblock>,
4065    {
4066        self.deblock = std::option::Option::Some(v.into());
4067        self
4068    }
4069
4070    /// Sets or clears the value of [deblock][crate::model::PreprocessingConfig::deblock].
4071    ///
4072    /// # Example
4073    /// ```ignore,no_run
4074    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4075    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Deblock;
4076    /// let x = PreprocessingConfig::new().set_or_clear_deblock(Some(Deblock::default()/* use setters */));
4077    /// let x = PreprocessingConfig::new().set_or_clear_deblock(None::<Deblock>);
4078    /// ```
4079    pub fn set_or_clear_deblock<T>(mut self, v: std::option::Option<T>) -> Self
4080    where
4081        T: std::convert::Into<crate::model::preprocessing_config::Deblock>,
4082    {
4083        self.deblock = v.map(|x| x.into());
4084        self
4085    }
4086
4087    /// Sets the value of [audio][crate::model::PreprocessingConfig::audio].
4088    ///
4089    /// # Example
4090    /// ```ignore,no_run
4091    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4092    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Audio;
4093    /// let x = PreprocessingConfig::new().set_audio(Audio::default()/* use setters */);
4094    /// ```
4095    pub fn set_audio<T>(mut self, v: T) -> Self
4096    where
4097        T: std::convert::Into<crate::model::preprocessing_config::Audio>,
4098    {
4099        self.audio = std::option::Option::Some(v.into());
4100        self
4101    }
4102
4103    /// Sets or clears the value of [audio][crate::model::PreprocessingConfig::audio].
4104    ///
4105    /// # Example
4106    /// ```ignore,no_run
4107    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4108    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Audio;
4109    /// let x = PreprocessingConfig::new().set_or_clear_audio(Some(Audio::default()/* use setters */));
4110    /// let x = PreprocessingConfig::new().set_or_clear_audio(None::<Audio>);
4111    /// ```
4112    pub fn set_or_clear_audio<T>(mut self, v: std::option::Option<T>) -> Self
4113    where
4114        T: std::convert::Into<crate::model::preprocessing_config::Audio>,
4115    {
4116        self.audio = v.map(|x| x.into());
4117        self
4118    }
4119
4120    /// Sets the value of [crop][crate::model::PreprocessingConfig::crop].
4121    ///
4122    /// # Example
4123    /// ```ignore,no_run
4124    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4125    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Crop;
4126    /// let x = PreprocessingConfig::new().set_crop(Crop::default()/* use setters */);
4127    /// ```
4128    pub fn set_crop<T>(mut self, v: T) -> Self
4129    where
4130        T: std::convert::Into<crate::model::preprocessing_config::Crop>,
4131    {
4132        self.crop = std::option::Option::Some(v.into());
4133        self
4134    }
4135
4136    /// Sets or clears the value of [crop][crate::model::PreprocessingConfig::crop].
4137    ///
4138    /// # Example
4139    /// ```ignore,no_run
4140    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4141    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Crop;
4142    /// let x = PreprocessingConfig::new().set_or_clear_crop(Some(Crop::default()/* use setters */));
4143    /// let x = PreprocessingConfig::new().set_or_clear_crop(None::<Crop>);
4144    /// ```
4145    pub fn set_or_clear_crop<T>(mut self, v: std::option::Option<T>) -> Self
4146    where
4147        T: std::convert::Into<crate::model::preprocessing_config::Crop>,
4148    {
4149        self.crop = v.map(|x| x.into());
4150        self
4151    }
4152
4153    /// Sets the value of [pad][crate::model::PreprocessingConfig::pad].
4154    ///
4155    /// # Example
4156    /// ```ignore,no_run
4157    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4158    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Pad;
4159    /// let x = PreprocessingConfig::new().set_pad(Pad::default()/* use setters */);
4160    /// ```
4161    pub fn set_pad<T>(mut self, v: T) -> Self
4162    where
4163        T: std::convert::Into<crate::model::preprocessing_config::Pad>,
4164    {
4165        self.pad = std::option::Option::Some(v.into());
4166        self
4167    }
4168
4169    /// Sets or clears the value of [pad][crate::model::PreprocessingConfig::pad].
4170    ///
4171    /// # Example
4172    /// ```ignore,no_run
4173    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4174    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Pad;
4175    /// let x = PreprocessingConfig::new().set_or_clear_pad(Some(Pad::default()/* use setters */));
4176    /// let x = PreprocessingConfig::new().set_or_clear_pad(None::<Pad>);
4177    /// ```
4178    pub fn set_or_clear_pad<T>(mut self, v: std::option::Option<T>) -> Self
4179    where
4180        T: std::convert::Into<crate::model::preprocessing_config::Pad>,
4181    {
4182        self.pad = v.map(|x| x.into());
4183        self
4184    }
4185
4186    /// Sets the value of [deinterlace][crate::model::PreprocessingConfig::deinterlace].
4187    ///
4188    /// # Example
4189    /// ```ignore,no_run
4190    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4191    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Deinterlace;
4192    /// let x = PreprocessingConfig::new().set_deinterlace(Deinterlace::default()/* use setters */);
4193    /// ```
4194    pub fn set_deinterlace<T>(mut self, v: T) -> Self
4195    where
4196        T: std::convert::Into<crate::model::preprocessing_config::Deinterlace>,
4197    {
4198        self.deinterlace = std::option::Option::Some(v.into());
4199        self
4200    }
4201
4202    /// Sets or clears the value of [deinterlace][crate::model::PreprocessingConfig::deinterlace].
4203    ///
4204    /// # Example
4205    /// ```ignore,no_run
4206    /// # use google_cloud_video_transcoder_v1::model::PreprocessingConfig;
4207    /// use google_cloud_video_transcoder_v1::model::preprocessing_config::Deinterlace;
4208    /// let x = PreprocessingConfig::new().set_or_clear_deinterlace(Some(Deinterlace::default()/* use setters */));
4209    /// let x = PreprocessingConfig::new().set_or_clear_deinterlace(None::<Deinterlace>);
4210    /// ```
4211    pub fn set_or_clear_deinterlace<T>(mut self, v: std::option::Option<T>) -> Self
4212    where
4213        T: std::convert::Into<crate::model::preprocessing_config::Deinterlace>,
4214    {
4215        self.deinterlace = v.map(|x| x.into());
4216        self
4217    }
4218}
4219
4220impl wkt::message::Message for PreprocessingConfig {
4221    fn typename() -> &'static str {
4222        "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig"
4223    }
4224}
4225
4226/// Defines additional types related to [PreprocessingConfig].
4227pub mod preprocessing_config {
4228    #[allow(unused_imports)]
4229    use super::*;
4230
4231    /// Color preprocessing configuration.
4232    ///
4233    /// **Note:** This configuration is not supported.
4234    #[derive(Clone, Default, PartialEq)]
4235    #[non_exhaustive]
4236    pub struct Color {
4237        /// Control color saturation of the video. Enter a value between -1 and 1,
4238        /// where -1 is fully desaturated and 1 is maximum saturation. 0 is no
4239        /// change. The default is 0.
4240        pub saturation: f64,
4241
4242        /// Control black and white contrast of the video. Enter a value between -1
4243        /// and 1, where -1 is minimum contrast and 1 is maximum contrast. 0 is no
4244        /// change. The default is 0.
4245        pub contrast: f64,
4246
4247        /// Control brightness of the video. Enter a value between -1 and 1, where -1
4248        /// is minimum brightness and 1 is maximum brightness. 0 is no change. The
4249        /// default is 0.
4250        pub brightness: f64,
4251
4252        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4253    }
4254
4255    impl Color {
4256        /// Creates a new default instance.
4257        pub fn new() -> Self {
4258            std::default::Default::default()
4259        }
4260
4261        /// Sets the value of [saturation][crate::model::preprocessing_config::Color::saturation].
4262        ///
4263        /// # Example
4264        /// ```ignore,no_run
4265        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Color;
4266        /// let x = Color::new().set_saturation(42.0);
4267        /// ```
4268        pub fn set_saturation<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
4269            self.saturation = v.into();
4270            self
4271        }
4272
4273        /// Sets the value of [contrast][crate::model::preprocessing_config::Color::contrast].
4274        ///
4275        /// # Example
4276        /// ```ignore,no_run
4277        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Color;
4278        /// let x = Color::new().set_contrast(42.0);
4279        /// ```
4280        pub fn set_contrast<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
4281            self.contrast = v.into();
4282            self
4283        }
4284
4285        /// Sets the value of [brightness][crate::model::preprocessing_config::Color::brightness].
4286        ///
4287        /// # Example
4288        /// ```ignore,no_run
4289        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Color;
4290        /// let x = Color::new().set_brightness(42.0);
4291        /// ```
4292        pub fn set_brightness<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
4293            self.brightness = v.into();
4294            self
4295        }
4296    }
4297
4298    impl wkt::message::Message for Color {
4299        fn typename() -> &'static str {
4300            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Color"
4301        }
4302    }
4303
4304    /// Denoise preprocessing configuration.
4305    ///
4306    /// **Note:** This configuration is not supported.
4307    #[derive(Clone, Default, PartialEq)]
4308    #[non_exhaustive]
4309    pub struct Denoise {
4310        /// Set strength of the denoise. Enter a value between 0 and 1. The higher
4311        /// the value, the smoother the image. 0 is no denoising. The default is 0.
4312        pub strength: f64,
4313
4314        /// Set the denoiser mode. The default is `standard`.
4315        ///
4316        /// Supported denoiser modes:
4317        ///
4318        /// - `standard`
4319        /// - `grain`
4320        pub tune: std::string::String,
4321
4322        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4323    }
4324
4325    impl Denoise {
4326        /// Creates a new default instance.
4327        pub fn new() -> Self {
4328            std::default::Default::default()
4329        }
4330
4331        /// Sets the value of [strength][crate::model::preprocessing_config::Denoise::strength].
4332        ///
4333        /// # Example
4334        /// ```ignore,no_run
4335        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Denoise;
4336        /// let x = Denoise::new().set_strength(42.0);
4337        /// ```
4338        pub fn set_strength<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
4339            self.strength = v.into();
4340            self
4341        }
4342
4343        /// Sets the value of [tune][crate::model::preprocessing_config::Denoise::tune].
4344        ///
4345        /// # Example
4346        /// ```ignore,no_run
4347        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Denoise;
4348        /// let x = Denoise::new().set_tune("example");
4349        /// ```
4350        pub fn set_tune<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4351            self.tune = v.into();
4352            self
4353        }
4354    }
4355
4356    impl wkt::message::Message for Denoise {
4357        fn typename() -> &'static str {
4358            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise"
4359        }
4360    }
4361
4362    /// Deblock preprocessing configuration.
4363    ///
4364    /// **Note:** This configuration is not supported.
4365    #[derive(Clone, Default, PartialEq)]
4366    #[non_exhaustive]
4367    pub struct Deblock {
4368        /// Set strength of the deblocker. Enter a value between 0 and 1. The higher
4369        /// the value, the stronger the block removal. 0 is no deblocking. The
4370        /// default is 0.
4371        pub strength: f64,
4372
4373        /// Enable deblocker. The default is `false`.
4374        pub enabled: bool,
4375
4376        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4377    }
4378
4379    impl Deblock {
4380        /// Creates a new default instance.
4381        pub fn new() -> Self {
4382            std::default::Default::default()
4383        }
4384
4385        /// Sets the value of [strength][crate::model::preprocessing_config::Deblock::strength].
4386        ///
4387        /// # Example
4388        /// ```ignore,no_run
4389        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Deblock;
4390        /// let x = Deblock::new().set_strength(42.0);
4391        /// ```
4392        pub fn set_strength<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
4393            self.strength = v.into();
4394            self
4395        }
4396
4397        /// Sets the value of [enabled][crate::model::preprocessing_config::Deblock::enabled].
4398        ///
4399        /// # Example
4400        /// ```ignore,no_run
4401        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Deblock;
4402        /// let x = Deblock::new().set_enabled(true);
4403        /// ```
4404        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4405            self.enabled = v.into();
4406            self
4407        }
4408    }
4409
4410    impl wkt::message::Message for Deblock {
4411        fn typename() -> &'static str {
4412            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock"
4413        }
4414    }
4415
4416    /// Audio preprocessing configuration.
4417    #[derive(Clone, Default, PartialEq)]
4418    #[non_exhaustive]
4419    pub struct Audio {
4420        /// Specify audio loudness normalization in loudness units relative to full
4421        /// scale (LUFS). Enter a value between -24 and 0 (the default), where:
4422        ///
4423        /// * -24 is the Advanced Television Systems Committee (ATSC A/85) standard
4424        /// * -23 is the EU R128 broadcast standard
4425        /// * -19 is the prior standard for online mono audio
4426        /// * -18 is the ReplayGain standard
4427        /// * -16 is the prior standard for stereo audio
4428        /// * -14 is the new online audio standard recommended by Spotify, as well
4429        ///   as Amazon Echo
4430        /// * 0 disables normalization
4431        pub lufs: f64,
4432
4433        /// Enable boosting high frequency components. The default is `false`.
4434        ///
4435        /// **Note:** This field is not supported.
4436        pub high_boost: bool,
4437
4438        /// Enable boosting low frequency components. The default is `false`.
4439        ///
4440        /// **Note:** This field is not supported.
4441        pub low_boost: bool,
4442
4443        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4444    }
4445
4446    impl Audio {
4447        /// Creates a new default instance.
4448        pub fn new() -> Self {
4449            std::default::Default::default()
4450        }
4451
4452        /// Sets the value of [lufs][crate::model::preprocessing_config::Audio::lufs].
4453        ///
4454        /// # Example
4455        /// ```ignore,no_run
4456        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Audio;
4457        /// let x = Audio::new().set_lufs(42.0);
4458        /// ```
4459        pub fn set_lufs<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
4460            self.lufs = v.into();
4461            self
4462        }
4463
4464        /// Sets the value of [high_boost][crate::model::preprocessing_config::Audio::high_boost].
4465        ///
4466        /// # Example
4467        /// ```ignore,no_run
4468        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Audio;
4469        /// let x = Audio::new().set_high_boost(true);
4470        /// ```
4471        pub fn set_high_boost<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4472            self.high_boost = v.into();
4473            self
4474        }
4475
4476        /// Sets the value of [low_boost][crate::model::preprocessing_config::Audio::low_boost].
4477        ///
4478        /// # Example
4479        /// ```ignore,no_run
4480        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Audio;
4481        /// let x = Audio::new().set_low_boost(true);
4482        /// ```
4483        pub fn set_low_boost<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4484            self.low_boost = v.into();
4485            self
4486        }
4487    }
4488
4489    impl wkt::message::Message for Audio {
4490        fn typename() -> &'static str {
4491            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Audio"
4492        }
4493    }
4494
4495    /// Video cropping configuration for the input video. The cropped input video
4496    /// is scaled to match the output resolution.
4497    #[derive(Clone, Default, PartialEq)]
4498    #[non_exhaustive]
4499    pub struct Crop {
4500        /// The number of pixels to crop from the top. The default is 0.
4501        pub top_pixels: i32,
4502
4503        /// The number of pixels to crop from the bottom. The default is 0.
4504        pub bottom_pixels: i32,
4505
4506        /// The number of pixels to crop from the left. The default is 0.
4507        pub left_pixels: i32,
4508
4509        /// The number of pixels to crop from the right. The default is 0.
4510        pub right_pixels: i32,
4511
4512        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4513    }
4514
4515    impl Crop {
4516        /// Creates a new default instance.
4517        pub fn new() -> Self {
4518            std::default::Default::default()
4519        }
4520
4521        /// Sets the value of [top_pixels][crate::model::preprocessing_config::Crop::top_pixels].
4522        ///
4523        /// # Example
4524        /// ```ignore,no_run
4525        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Crop;
4526        /// let x = Crop::new().set_top_pixels(42);
4527        /// ```
4528        pub fn set_top_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4529            self.top_pixels = v.into();
4530            self
4531        }
4532
4533        /// Sets the value of [bottom_pixels][crate::model::preprocessing_config::Crop::bottom_pixels].
4534        ///
4535        /// # Example
4536        /// ```ignore,no_run
4537        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Crop;
4538        /// let x = Crop::new().set_bottom_pixels(42);
4539        /// ```
4540        pub fn set_bottom_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4541            self.bottom_pixels = v.into();
4542            self
4543        }
4544
4545        /// Sets the value of [left_pixels][crate::model::preprocessing_config::Crop::left_pixels].
4546        ///
4547        /// # Example
4548        /// ```ignore,no_run
4549        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Crop;
4550        /// let x = Crop::new().set_left_pixels(42);
4551        /// ```
4552        pub fn set_left_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4553            self.left_pixels = v.into();
4554            self
4555        }
4556
4557        /// Sets the value of [right_pixels][crate::model::preprocessing_config::Crop::right_pixels].
4558        ///
4559        /// # Example
4560        /// ```ignore,no_run
4561        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Crop;
4562        /// let x = Crop::new().set_right_pixels(42);
4563        /// ```
4564        pub fn set_right_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4565            self.right_pixels = v.into();
4566            self
4567        }
4568    }
4569
4570    impl wkt::message::Message for Crop {
4571        fn typename() -> &'static str {
4572            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Crop"
4573        }
4574    }
4575
4576    /// Pad filter configuration for the input video. The padded input video
4577    /// is scaled after padding with black to match the output resolution.
4578    #[derive(Clone, Default, PartialEq)]
4579    #[non_exhaustive]
4580    pub struct Pad {
4581        /// The number of pixels to add to the top. The default is 0.
4582        pub top_pixels: i32,
4583
4584        /// The number of pixels to add to the bottom. The default is 0.
4585        pub bottom_pixels: i32,
4586
4587        /// The number of pixels to add to the left. The default is 0.
4588        pub left_pixels: i32,
4589
4590        /// The number of pixels to add to the right. The default is 0.
4591        pub right_pixels: i32,
4592
4593        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4594    }
4595
4596    impl Pad {
4597        /// Creates a new default instance.
4598        pub fn new() -> Self {
4599            std::default::Default::default()
4600        }
4601
4602        /// Sets the value of [top_pixels][crate::model::preprocessing_config::Pad::top_pixels].
4603        ///
4604        /// # Example
4605        /// ```ignore,no_run
4606        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Pad;
4607        /// let x = Pad::new().set_top_pixels(42);
4608        /// ```
4609        pub fn set_top_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4610            self.top_pixels = v.into();
4611            self
4612        }
4613
4614        /// Sets the value of [bottom_pixels][crate::model::preprocessing_config::Pad::bottom_pixels].
4615        ///
4616        /// # Example
4617        /// ```ignore,no_run
4618        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Pad;
4619        /// let x = Pad::new().set_bottom_pixels(42);
4620        /// ```
4621        pub fn set_bottom_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4622            self.bottom_pixels = v.into();
4623            self
4624        }
4625
4626        /// Sets the value of [left_pixels][crate::model::preprocessing_config::Pad::left_pixels].
4627        ///
4628        /// # Example
4629        /// ```ignore,no_run
4630        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Pad;
4631        /// let x = Pad::new().set_left_pixels(42);
4632        /// ```
4633        pub fn set_left_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4634            self.left_pixels = v.into();
4635            self
4636        }
4637
4638        /// Sets the value of [right_pixels][crate::model::preprocessing_config::Pad::right_pixels].
4639        ///
4640        /// # Example
4641        /// ```ignore,no_run
4642        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Pad;
4643        /// let x = Pad::new().set_right_pixels(42);
4644        /// ```
4645        pub fn set_right_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4646            self.right_pixels = v.into();
4647            self
4648        }
4649    }
4650
4651    impl wkt::message::Message for Pad {
4652        fn typename() -> &'static str {
4653            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Pad"
4654        }
4655    }
4656
4657    /// Deinterlace configuration for input video.
4658    #[derive(Clone, Default, PartialEq)]
4659    #[non_exhaustive]
4660    pub struct Deinterlace {
4661        /// Specify the video deinterlacing filter. The default is `yadif`.
4662        pub deinterlacing_filter: std::option::Option<
4663            crate::model::preprocessing_config::deinterlace::DeinterlacingFilter,
4664        >,
4665
4666        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4667    }
4668
4669    impl Deinterlace {
4670        /// Creates a new default instance.
4671        pub fn new() -> Self {
4672            std::default::Default::default()
4673        }
4674
4675        /// Sets the value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter].
4676        ///
4677        /// Note that all the setters affecting `deinterlacing_filter` are mutually
4678        /// exclusive.
4679        ///
4680        /// # Example
4681        /// ```ignore,no_run
4682        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Deinterlace;
4683        /// use google_cloud_video_transcoder_v1::model::preprocessing_config::deinterlace::YadifConfig;
4684        /// let x = Deinterlace::new().set_deinterlacing_filter(Some(
4685        ///     google_cloud_video_transcoder_v1::model::preprocessing_config::deinterlace::DeinterlacingFilter::Yadif(YadifConfig::default().into())));
4686        /// ```
4687        pub fn set_deinterlacing_filter<
4688            T: std::convert::Into<
4689                    std::option::Option<
4690                        crate::model::preprocessing_config::deinterlace::DeinterlacingFilter,
4691                    >,
4692                >,
4693        >(
4694            mut self,
4695            v: T,
4696        ) -> Self {
4697            self.deinterlacing_filter = v.into();
4698            self
4699        }
4700
4701        /// The value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter]
4702        /// if it holds a `Yadif`, `None` if the field is not set or
4703        /// holds a different branch.
4704        pub fn yadif(
4705            &self,
4706        ) -> std::option::Option<
4707            &std::boxed::Box<crate::model::preprocessing_config::deinterlace::YadifConfig>,
4708        > {
4709            #[allow(unreachable_patterns)]
4710            self.deinterlacing_filter.as_ref().and_then(|v| match v {
4711                crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Yadif(v) => {
4712                    std::option::Option::Some(v)
4713                }
4714                _ => std::option::Option::None,
4715            })
4716        }
4717
4718        /// Sets the value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter]
4719        /// to hold a `Yadif`.
4720        ///
4721        /// Note that all the setters affecting `deinterlacing_filter` are
4722        /// mutually exclusive.
4723        ///
4724        /// # Example
4725        /// ```ignore,no_run
4726        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Deinterlace;
4727        /// use google_cloud_video_transcoder_v1::model::preprocessing_config::deinterlace::YadifConfig;
4728        /// let x = Deinterlace::new().set_yadif(YadifConfig::default()/* use setters */);
4729        /// assert!(x.yadif().is_some());
4730        /// assert!(x.bwdif().is_none());
4731        /// ```
4732        pub fn set_yadif<
4733            T: std::convert::Into<
4734                    std::boxed::Box<crate::model::preprocessing_config::deinterlace::YadifConfig>,
4735                >,
4736        >(
4737            mut self,
4738            v: T,
4739        ) -> Self {
4740            self.deinterlacing_filter = std::option::Option::Some(
4741                crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Yadif(
4742                    v.into(),
4743                ),
4744            );
4745            self
4746        }
4747
4748        /// The value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter]
4749        /// if it holds a `Bwdif`, `None` if the field is not set or
4750        /// holds a different branch.
4751        pub fn bwdif(
4752            &self,
4753        ) -> std::option::Option<
4754            &std::boxed::Box<crate::model::preprocessing_config::deinterlace::BwdifConfig>,
4755        > {
4756            #[allow(unreachable_patterns)]
4757            self.deinterlacing_filter.as_ref().and_then(|v| match v {
4758                crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Bwdif(v) => {
4759                    std::option::Option::Some(v)
4760                }
4761                _ => std::option::Option::None,
4762            })
4763        }
4764
4765        /// Sets the value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter]
4766        /// to hold a `Bwdif`.
4767        ///
4768        /// Note that all the setters affecting `deinterlacing_filter` are
4769        /// mutually exclusive.
4770        ///
4771        /// # Example
4772        /// ```ignore,no_run
4773        /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::Deinterlace;
4774        /// use google_cloud_video_transcoder_v1::model::preprocessing_config::deinterlace::BwdifConfig;
4775        /// let x = Deinterlace::new().set_bwdif(BwdifConfig::default()/* use setters */);
4776        /// assert!(x.bwdif().is_some());
4777        /// assert!(x.yadif().is_none());
4778        /// ```
4779        pub fn set_bwdif<
4780            T: std::convert::Into<
4781                    std::boxed::Box<crate::model::preprocessing_config::deinterlace::BwdifConfig>,
4782                >,
4783        >(
4784            mut self,
4785            v: T,
4786        ) -> Self {
4787            self.deinterlacing_filter = std::option::Option::Some(
4788                crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Bwdif(
4789                    v.into(),
4790                ),
4791            );
4792            self
4793        }
4794    }
4795
4796    impl wkt::message::Message for Deinterlace {
4797        fn typename() -> &'static str {
4798            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace"
4799        }
4800    }
4801
4802    /// Defines additional types related to [Deinterlace].
4803    pub mod deinterlace {
4804        #[allow(unused_imports)]
4805        use super::*;
4806
4807        /// Yet Another Deinterlacing Filter Configuration.
4808        #[derive(Clone, Default, PartialEq)]
4809        #[non_exhaustive]
4810        pub struct YadifConfig {
4811            /// Specifies the deinterlacing mode to adopt.
4812            /// The default is `send_frame`.
4813            /// Supported values:
4814            ///
4815            /// - `send_frame`: Output one frame for each frame
4816            /// - `send_field`: Output one frame for each field
4817            pub mode: std::string::String,
4818
4819            /// Disable spacial interlacing.
4820            /// The default is `false`.
4821            pub disable_spatial_interlacing: bool,
4822
4823            /// The picture field parity assumed for the input interlaced video.
4824            /// The default is `auto`.
4825            /// Supported values:
4826            ///
4827            /// - `tff`: Assume the top field is first
4828            /// - `bff`: Assume the bottom field is first
4829            /// - `auto`: Enable automatic detection of field parity
4830            pub parity: std::string::String,
4831
4832            /// Deinterlace all frames rather than just the frames identified as
4833            /// interlaced. The default is `false`.
4834            pub deinterlace_all_frames: bool,
4835
4836            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4837        }
4838
4839        impl YadifConfig {
4840            /// Creates a new default instance.
4841            pub fn new() -> Self {
4842                std::default::Default::default()
4843            }
4844
4845            /// Sets the value of [mode][crate::model::preprocessing_config::deinterlace::YadifConfig::mode].
4846            ///
4847            /// # Example
4848            /// ```ignore,no_run
4849            /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::deinterlace::YadifConfig;
4850            /// let x = YadifConfig::new().set_mode("example");
4851            /// ```
4852            pub fn set_mode<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4853                self.mode = v.into();
4854                self
4855            }
4856
4857            /// Sets the value of [disable_spatial_interlacing][crate::model::preprocessing_config::deinterlace::YadifConfig::disable_spatial_interlacing].
4858            ///
4859            /// # Example
4860            /// ```ignore,no_run
4861            /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::deinterlace::YadifConfig;
4862            /// let x = YadifConfig::new().set_disable_spatial_interlacing(true);
4863            /// ```
4864            pub fn set_disable_spatial_interlacing<T: std::convert::Into<bool>>(
4865                mut self,
4866                v: T,
4867            ) -> Self {
4868                self.disable_spatial_interlacing = v.into();
4869                self
4870            }
4871
4872            /// Sets the value of [parity][crate::model::preprocessing_config::deinterlace::YadifConfig::parity].
4873            ///
4874            /// # Example
4875            /// ```ignore,no_run
4876            /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::deinterlace::YadifConfig;
4877            /// let x = YadifConfig::new().set_parity("example");
4878            /// ```
4879            pub fn set_parity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4880                self.parity = v.into();
4881                self
4882            }
4883
4884            /// Sets the value of [deinterlace_all_frames][crate::model::preprocessing_config::deinterlace::YadifConfig::deinterlace_all_frames].
4885            ///
4886            /// # Example
4887            /// ```ignore,no_run
4888            /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::deinterlace::YadifConfig;
4889            /// let x = YadifConfig::new().set_deinterlace_all_frames(true);
4890            /// ```
4891            pub fn set_deinterlace_all_frames<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4892                self.deinterlace_all_frames = v.into();
4893                self
4894            }
4895        }
4896
4897        impl wkt::message::Message for YadifConfig {
4898            fn typename() -> &'static str {
4899                "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace.YadifConfig"
4900            }
4901        }
4902
4903        /// Bob Weaver Deinterlacing Filter Configuration.
4904        #[derive(Clone, Default, PartialEq)]
4905        #[non_exhaustive]
4906        pub struct BwdifConfig {
4907            /// Specifies the deinterlacing mode to adopt.
4908            /// The default is `send_frame`.
4909            /// Supported values:
4910            ///
4911            /// - `send_frame`: Output one frame for each frame
4912            /// - `send_field`: Output one frame for each field
4913            pub mode: std::string::String,
4914
4915            /// The picture field parity assumed for the input interlaced video.
4916            /// The default is `auto`.
4917            /// Supported values:
4918            ///
4919            /// - `tff`: Assume the top field is first
4920            /// - `bff`: Assume the bottom field is first
4921            /// - `auto`: Enable automatic detection of field parity
4922            pub parity: std::string::String,
4923
4924            /// Deinterlace all frames rather than just the frames identified as
4925            /// interlaced. The default is `false`.
4926            pub deinterlace_all_frames: bool,
4927
4928            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4929        }
4930
4931        impl BwdifConfig {
4932            /// Creates a new default instance.
4933            pub fn new() -> Self {
4934                std::default::Default::default()
4935            }
4936
4937            /// Sets the value of [mode][crate::model::preprocessing_config::deinterlace::BwdifConfig::mode].
4938            ///
4939            /// # Example
4940            /// ```ignore,no_run
4941            /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::deinterlace::BwdifConfig;
4942            /// let x = BwdifConfig::new().set_mode("example");
4943            /// ```
4944            pub fn set_mode<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4945                self.mode = v.into();
4946                self
4947            }
4948
4949            /// Sets the value of [parity][crate::model::preprocessing_config::deinterlace::BwdifConfig::parity].
4950            ///
4951            /// # Example
4952            /// ```ignore,no_run
4953            /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::deinterlace::BwdifConfig;
4954            /// let x = BwdifConfig::new().set_parity("example");
4955            /// ```
4956            pub fn set_parity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4957                self.parity = v.into();
4958                self
4959            }
4960
4961            /// Sets the value of [deinterlace_all_frames][crate::model::preprocessing_config::deinterlace::BwdifConfig::deinterlace_all_frames].
4962            ///
4963            /// # Example
4964            /// ```ignore,no_run
4965            /// # use google_cloud_video_transcoder_v1::model::preprocessing_config::deinterlace::BwdifConfig;
4966            /// let x = BwdifConfig::new().set_deinterlace_all_frames(true);
4967            /// ```
4968            pub fn set_deinterlace_all_frames<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4969                self.deinterlace_all_frames = v.into();
4970                self
4971            }
4972        }
4973
4974        impl wkt::message::Message for BwdifConfig {
4975            fn typename() -> &'static str {
4976                "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace.BwdifConfig"
4977            }
4978        }
4979
4980        /// Specify the video deinterlacing filter. The default is `yadif`.
4981        #[derive(Clone, Debug, PartialEq)]
4982        #[non_exhaustive]
4983        pub enum DeinterlacingFilter {
4984            /// Specifies the Yet Another Deinterlacing Filter Configuration.
4985            Yadif(std::boxed::Box<crate::model::preprocessing_config::deinterlace::YadifConfig>),
4986            /// Specifies the Bob Weaver Deinterlacing Filter Configuration.
4987            Bwdif(std::boxed::Box<crate::model::preprocessing_config::deinterlace::BwdifConfig>),
4988        }
4989    }
4990}
4991
4992/// Track definition for the input asset.
4993#[derive(Clone, Default, PartialEq)]
4994#[non_exhaustive]
4995pub struct TrackDefinition {
4996    /// The input track.
4997    pub input_track: std::option::Option<i32>,
4998
4999    /// Optional. A list of languages spoken in the input asset, represented by a
5000    /// BCP 47 language code, such as "en-US" or "sr-Latn". For more information,
5001    /// see <https://www.unicode.org/reports/tr35/#Unicode_locale_identifier>.
5002    pub languages: std::vec::Vec<std::string::String>,
5003
5004    /// Optional. Whether to automatically detect the languages present in the
5005    /// track. If true, the system will attempt to identify all the languages
5006    /// present in the track and populate the languages field.
5007    pub detect_languages: bool,
5008
5009    /// Output only. A list of languages detected in the input asset, represented
5010    /// by a BCP 47 language code, such as "en-US" or "sr-Latn". For more
5011    /// information, see
5012    /// <https://www.unicode.org/reports/tr35/#Unicode_locale_identifier>.
5013    /// This field is only populated if the detect_languages field is set to true.
5014    pub detected_languages: std::vec::Vec<std::string::String>,
5015
5016    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5017}
5018
5019impl TrackDefinition {
5020    /// Creates a new default instance.
5021    pub fn new() -> Self {
5022        std::default::Default::default()
5023    }
5024
5025    /// Sets the value of [input_track][crate::model::TrackDefinition::input_track].
5026    ///
5027    /// # Example
5028    /// ```ignore,no_run
5029    /// # use google_cloud_video_transcoder_v1::model::TrackDefinition;
5030    /// let x = TrackDefinition::new().set_input_track(42);
5031    /// ```
5032    pub fn set_input_track<T>(mut self, v: T) -> Self
5033    where
5034        T: std::convert::Into<i32>,
5035    {
5036        self.input_track = std::option::Option::Some(v.into());
5037        self
5038    }
5039
5040    /// Sets or clears the value of [input_track][crate::model::TrackDefinition::input_track].
5041    ///
5042    /// # Example
5043    /// ```ignore,no_run
5044    /// # use google_cloud_video_transcoder_v1::model::TrackDefinition;
5045    /// let x = TrackDefinition::new().set_or_clear_input_track(Some(42));
5046    /// let x = TrackDefinition::new().set_or_clear_input_track(None::<i32>);
5047    /// ```
5048    pub fn set_or_clear_input_track<T>(mut self, v: std::option::Option<T>) -> Self
5049    where
5050        T: std::convert::Into<i32>,
5051    {
5052        self.input_track = v.map(|x| x.into());
5053        self
5054    }
5055
5056    /// Sets the value of [languages][crate::model::TrackDefinition::languages].
5057    ///
5058    /// # Example
5059    /// ```ignore,no_run
5060    /// # use google_cloud_video_transcoder_v1::model::TrackDefinition;
5061    /// let x = TrackDefinition::new().set_languages(["a", "b", "c"]);
5062    /// ```
5063    pub fn set_languages<T, V>(mut self, v: T) -> Self
5064    where
5065        T: std::iter::IntoIterator<Item = V>,
5066        V: std::convert::Into<std::string::String>,
5067    {
5068        use std::iter::Iterator;
5069        self.languages = v.into_iter().map(|i| i.into()).collect();
5070        self
5071    }
5072
5073    /// Sets the value of [detect_languages][crate::model::TrackDefinition::detect_languages].
5074    ///
5075    /// # Example
5076    /// ```ignore,no_run
5077    /// # use google_cloud_video_transcoder_v1::model::TrackDefinition;
5078    /// let x = TrackDefinition::new().set_detect_languages(true);
5079    /// ```
5080    pub fn set_detect_languages<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5081        self.detect_languages = v.into();
5082        self
5083    }
5084
5085    /// Sets the value of [detected_languages][crate::model::TrackDefinition::detected_languages].
5086    ///
5087    /// # Example
5088    /// ```ignore,no_run
5089    /// # use google_cloud_video_transcoder_v1::model::TrackDefinition;
5090    /// let x = TrackDefinition::new().set_detected_languages(["a", "b", "c"]);
5091    /// ```
5092    pub fn set_detected_languages<T, V>(mut self, v: T) -> Self
5093    where
5094        T: std::iter::IntoIterator<Item = V>,
5095        V: std::convert::Into<std::string::String>,
5096    {
5097        use std::iter::Iterator;
5098        self.detected_languages = v.into_iter().map(|i| i.into()).collect();
5099        self
5100    }
5101}
5102
5103impl wkt::message::Message for TrackDefinition {
5104    fn typename() -> &'static str {
5105        "type.googleapis.com/google.cloud.video.transcoder.v1.TrackDefinition"
5106    }
5107}
5108
5109/// Input attributes that provide additional information about the input asset.
5110#[derive(Clone, Default, PartialEq)]
5111#[non_exhaustive]
5112pub struct InputAttributes {
5113    /// Optional. A list of track definitions for the input asset.
5114    pub track_definitions: std::vec::Vec<crate::model::TrackDefinition>,
5115
5116    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5117}
5118
5119impl InputAttributes {
5120    /// Creates a new default instance.
5121    pub fn new() -> Self {
5122        std::default::Default::default()
5123    }
5124
5125    /// Sets the value of [track_definitions][crate::model::InputAttributes::track_definitions].
5126    ///
5127    /// # Example
5128    /// ```ignore,no_run
5129    /// # use google_cloud_video_transcoder_v1::model::InputAttributes;
5130    /// use google_cloud_video_transcoder_v1::model::TrackDefinition;
5131    /// let x = InputAttributes::new()
5132    ///     .set_track_definitions([
5133    ///         TrackDefinition::default()/* use setters */,
5134    ///         TrackDefinition::default()/* use (different) setters */,
5135    ///     ]);
5136    /// ```
5137    pub fn set_track_definitions<T, V>(mut self, v: T) -> Self
5138    where
5139        T: std::iter::IntoIterator<Item = V>,
5140        V: std::convert::Into<crate::model::TrackDefinition>,
5141    {
5142        use std::iter::Iterator;
5143        self.track_definitions = v.into_iter().map(|i| i.into()).collect();
5144        self
5145    }
5146}
5147
5148impl wkt::message::Message for InputAttributes {
5149    fn typename() -> &'static str {
5150        "type.googleapis.com/google.cloud.video.transcoder.v1.InputAttributes"
5151    }
5152}
5153
5154/// Video stream resource.
5155#[derive(Clone, Default, PartialEq)]
5156#[non_exhaustive]
5157pub struct VideoStream {
5158    /// Codec settings can be h264, h265, or vp9.
5159    pub codec_settings: std::option::Option<crate::model::video_stream::CodecSettings>,
5160
5161    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5162}
5163
5164impl VideoStream {
5165    /// Creates a new default instance.
5166    pub fn new() -> Self {
5167        std::default::Default::default()
5168    }
5169
5170    /// Sets the value of [codec_settings][crate::model::VideoStream::codec_settings].
5171    ///
5172    /// Note that all the setters affecting `codec_settings` are mutually
5173    /// exclusive.
5174    ///
5175    /// # Example
5176    /// ```ignore,no_run
5177    /// # use google_cloud_video_transcoder_v1::model::VideoStream;
5178    /// use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5179    /// let x = VideoStream::new().set_codec_settings(Some(
5180    ///     google_cloud_video_transcoder_v1::model::video_stream::CodecSettings::H264(H264CodecSettings::default().into())));
5181    /// ```
5182    pub fn set_codec_settings<
5183        T: std::convert::Into<std::option::Option<crate::model::video_stream::CodecSettings>>,
5184    >(
5185        mut self,
5186        v: T,
5187    ) -> Self {
5188        self.codec_settings = v.into();
5189        self
5190    }
5191
5192    /// The value of [codec_settings][crate::model::VideoStream::codec_settings]
5193    /// if it holds a `H264`, `None` if the field is not set or
5194    /// holds a different branch.
5195    pub fn h264(
5196        &self,
5197    ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H264CodecSettings>> {
5198        #[allow(unreachable_patterns)]
5199        self.codec_settings.as_ref().and_then(|v| match v {
5200            crate::model::video_stream::CodecSettings::H264(v) => std::option::Option::Some(v),
5201            _ => std::option::Option::None,
5202        })
5203    }
5204
5205    /// Sets the value of [codec_settings][crate::model::VideoStream::codec_settings]
5206    /// to hold a `H264`.
5207    ///
5208    /// Note that all the setters affecting `codec_settings` are
5209    /// mutually exclusive.
5210    ///
5211    /// # Example
5212    /// ```ignore,no_run
5213    /// # use google_cloud_video_transcoder_v1::model::VideoStream;
5214    /// use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5215    /// let x = VideoStream::new().set_h264(H264CodecSettings::default()/* use setters */);
5216    /// assert!(x.h264().is_some());
5217    /// assert!(x.h265().is_none());
5218    /// assert!(x.vp9().is_none());
5219    /// ```
5220    pub fn set_h264<
5221        T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H264CodecSettings>>,
5222    >(
5223        mut self,
5224        v: T,
5225    ) -> Self {
5226        self.codec_settings =
5227            std::option::Option::Some(crate::model::video_stream::CodecSettings::H264(v.into()));
5228        self
5229    }
5230
5231    /// The value of [codec_settings][crate::model::VideoStream::codec_settings]
5232    /// if it holds a `H265`, `None` if the field is not set or
5233    /// holds a different branch.
5234    pub fn h265(
5235        &self,
5236    ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H265CodecSettings>> {
5237        #[allow(unreachable_patterns)]
5238        self.codec_settings.as_ref().and_then(|v| match v {
5239            crate::model::video_stream::CodecSettings::H265(v) => std::option::Option::Some(v),
5240            _ => std::option::Option::None,
5241        })
5242    }
5243
5244    /// Sets the value of [codec_settings][crate::model::VideoStream::codec_settings]
5245    /// to hold a `H265`.
5246    ///
5247    /// Note that all the setters affecting `codec_settings` are
5248    /// mutually exclusive.
5249    ///
5250    /// # Example
5251    /// ```ignore,no_run
5252    /// # use google_cloud_video_transcoder_v1::model::VideoStream;
5253    /// use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
5254    /// let x = VideoStream::new().set_h265(H265CodecSettings::default()/* use setters */);
5255    /// assert!(x.h265().is_some());
5256    /// assert!(x.h264().is_none());
5257    /// assert!(x.vp9().is_none());
5258    /// ```
5259    pub fn set_h265<
5260        T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H265CodecSettings>>,
5261    >(
5262        mut self,
5263        v: T,
5264    ) -> Self {
5265        self.codec_settings =
5266            std::option::Option::Some(crate::model::video_stream::CodecSettings::H265(v.into()));
5267        self
5268    }
5269
5270    /// The value of [codec_settings][crate::model::VideoStream::codec_settings]
5271    /// if it holds a `Vp9`, `None` if the field is not set or
5272    /// holds a different branch.
5273    pub fn vp9(
5274        &self,
5275    ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::Vp9CodecSettings>> {
5276        #[allow(unreachable_patterns)]
5277        self.codec_settings.as_ref().and_then(|v| match v {
5278            crate::model::video_stream::CodecSettings::Vp9(v) => std::option::Option::Some(v),
5279            _ => std::option::Option::None,
5280        })
5281    }
5282
5283    /// Sets the value of [codec_settings][crate::model::VideoStream::codec_settings]
5284    /// to hold a `Vp9`.
5285    ///
5286    /// Note that all the setters affecting `codec_settings` are
5287    /// mutually exclusive.
5288    ///
5289    /// # Example
5290    /// ```ignore,no_run
5291    /// # use google_cloud_video_transcoder_v1::model::VideoStream;
5292    /// use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
5293    /// let x = VideoStream::new().set_vp9(Vp9CodecSettings::default()/* use setters */);
5294    /// assert!(x.vp9().is_some());
5295    /// assert!(x.h264().is_none());
5296    /// assert!(x.h265().is_none());
5297    /// ```
5298    pub fn set_vp9<
5299        T: std::convert::Into<std::boxed::Box<crate::model::video_stream::Vp9CodecSettings>>,
5300    >(
5301        mut self,
5302        v: T,
5303    ) -> Self {
5304        self.codec_settings =
5305            std::option::Option::Some(crate::model::video_stream::CodecSettings::Vp9(v.into()));
5306        self
5307    }
5308}
5309
5310impl wkt::message::Message for VideoStream {
5311    fn typename() -> &'static str {
5312        "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream"
5313    }
5314}
5315
5316/// Defines additional types related to [VideoStream].
5317pub mod video_stream {
5318    #[allow(unused_imports)]
5319    use super::*;
5320
5321    /// Convert the input video to a Standard Dynamic Range (SDR) video.
5322    #[derive(Clone, Default, PartialEq)]
5323    #[non_exhaustive]
5324    pub struct H264ColorFormatSDR {
5325        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5326    }
5327
5328    impl H264ColorFormatSDR {
5329        /// Creates a new default instance.
5330        pub fn new() -> Self {
5331            std::default::Default::default()
5332        }
5333    }
5334
5335    impl wkt::message::Message for H264ColorFormatSDR {
5336        fn typename() -> &'static str {
5337            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H264ColorFormatSDR"
5338        }
5339    }
5340
5341    /// Convert the input video to a Hybrid Log Gamma (HLG) video.
5342    #[derive(Clone, Default, PartialEq)]
5343    #[non_exhaustive]
5344    pub struct H264ColorFormatHLG {
5345        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5346    }
5347
5348    impl H264ColorFormatHLG {
5349        /// Creates a new default instance.
5350        pub fn new() -> Self {
5351            std::default::Default::default()
5352        }
5353    }
5354
5355    impl wkt::message::Message for H264ColorFormatHLG {
5356        fn typename() -> &'static str {
5357            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H264ColorFormatHLG"
5358        }
5359    }
5360
5361    /// H264 codec settings.
5362    #[derive(Clone, Default, PartialEq)]
5363    #[non_exhaustive]
5364    pub struct H264CodecSettings {
5365        /// The width of the video in pixels. Must be an even integer.
5366        /// When not specified, the width is adjusted to match the specified height
5367        /// and input aspect ratio. If both are omitted, the input width is used.
5368        ///
5369        /// For portrait videos that contain horizontal ASR and rotation metadata,
5370        /// provide the width, in pixels, per the horizontal ASR. The API calculates
5371        /// the height per the horizontal ASR. The API detects any rotation metadata
5372        /// and swaps the requested height and width for the output.
5373        pub width_pixels: i32,
5374
5375        /// The height of the video in pixels. Must be an even integer.
5376        /// When not specified, the height is adjusted to match the specified width
5377        /// and input aspect ratio. If both are omitted, the input height is used.
5378        ///
5379        /// For portrait videos that contain horizontal ASR and rotation metadata,
5380        /// provide the height, in pixels, per the horizontal ASR. The API calculates
5381        /// the width per the horizontal ASR. The API detects any rotation metadata
5382        /// and swaps the requested height and width for the output.
5383        pub height_pixels: i32,
5384
5385        /// Required. The target video frame rate in frames per second (FPS). Must be
5386        /// less than or equal to 120.
5387        pub frame_rate: f64,
5388
5389        /// Optional. Frame rate conversion strategy for desired frame rate. The
5390        /// default is `DOWNSAMPLE`.
5391        pub frame_rate_conversion_strategy: crate::model::video_stream::FrameRateConversionStrategy,
5392
5393        /// Required. The video bitrate in bits per second. The minimum value is
5394        /// 1,000. The maximum value is 800,000,000.
5395        pub bitrate_bps: i32,
5396
5397        /// Pixel format to use. The default is `yuv420p`.
5398        ///
5399        /// Supported pixel formats:
5400        ///
5401        /// - `yuv420p` pixel format
5402        /// - `yuv422p` pixel format
5403        /// - `yuv444p` pixel format
5404        /// - `yuv420p10` 10-bit HDR pixel format
5405        /// - `yuv422p10` 10-bit HDR pixel format
5406        /// - `yuv444p10` 10-bit HDR pixel format
5407        /// - `yuv420p12` 12-bit HDR pixel format
5408        /// - `yuv422p12` 12-bit HDR pixel format
5409        /// - `yuv444p12` 12-bit HDR pixel format
5410        pub pixel_format: std::string::String,
5411
5412        /// Specify the mode. The default is `vbr`.
5413        ///
5414        /// Supported rate control modes:
5415        ///
5416        /// - `vbr` - variable bitrate
5417        /// - `crf` - constant rate factor
5418        pub rate_control_mode: std::string::String,
5419
5420        /// Target CRF level. Must be between 10 and 36, where 10 is the highest
5421        /// quality and 36 is the most efficient compression. The default is 21.
5422        pub crf_level: i32,
5423
5424        /// Specifies whether an open Group of Pictures (GOP) structure should be
5425        /// allowed or not. The default is `false`.
5426        pub allow_open_gop: bool,
5427
5428        /// Use two-pass encoding strategy to achieve better video quality.
5429        /// [H264CodecSettings.rate_control_mode][google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.rate_control_mode]
5430        /// must be `vbr`. The default is `false`.
5431        ///
5432        /// [google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.rate_control_mode]: crate::model::video_stream::H264CodecSettings::rate_control_mode
5433        pub enable_two_pass: bool,
5434
5435        /// Size of the Video Buffering Verifier (VBV) buffer in bits. Must be
5436        /// greater than zero. The default is equal to
5437        /// [H264CodecSettings.bitrate_bps][google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.bitrate_bps].
5438        ///
5439        /// [google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.bitrate_bps]: crate::model::video_stream::H264CodecSettings::bitrate_bps
5440        pub vbv_size_bits: i32,
5441
5442        /// Initial fullness of the Video Buffering Verifier (VBV) buffer in bits.
5443        /// Must be greater than zero. The default is equal to 90% of
5444        /// [H264CodecSettings.vbv_size_bits][google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.vbv_size_bits].
5445        ///
5446        /// [google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.vbv_size_bits]: crate::model::video_stream::H264CodecSettings::vbv_size_bits
5447        pub vbv_fullness_bits: i32,
5448
5449        /// The entropy coder to use. The default is `cabac`.
5450        ///
5451        /// Supported entropy coders:
5452        ///
5453        /// - `cavlc`
5454        /// - `cabac`
5455        pub entropy_coder: std::string::String,
5456
5457        /// Allow B-pyramid for reference frame selection. This may not be supported
5458        /// on all decoders. The default is `false`.
5459        pub b_pyramid: bool,
5460
5461        /// The number of consecutive B-frames. Must be greater than or equal to
5462        /// zero. Must be less than
5463        /// [H264CodecSettings.gop_frame_count][google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.gop_frame_count]
5464        /// if set. The default is 0.
5465        ///
5466        /// [google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.gop_frame_count]: crate::model::video_stream::H264CodecSettings::gop_mode
5467        pub b_frame_count: i32,
5468
5469        /// Specify the intensity of the adaptive quantizer (AQ). Must be between 0
5470        /// and 1, where 0 disables the quantizer and 1 maximizes the quantizer. A
5471        /// higher value equals a lower bitrate but smoother image. The default is 0.
5472        pub aq_strength: f64,
5473
5474        /// Enforces the specified codec profile. The following profiles are
5475        /// supported:
5476        ///
5477        /// * `baseline`
5478        /// * `main`
5479        /// * `high` (default)
5480        ///
5481        /// The available options are
5482        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.264#Tune).
5483        /// Note that certain values for this field may cause the
5484        /// transcoder to override other fields you set in the `H264CodecSettings`
5485        /// message.
5486        pub profile: std::string::String,
5487
5488        /// Enforces the specified codec tune. The available options are
5489        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.264#Tune).
5490        /// Note that certain values for this field may cause the
5491        /// transcoder to override other fields you set in the `H264CodecSettings`
5492        /// message.
5493        pub tune: std::string::String,
5494
5495        /// Enforces the specified codec preset. The default is `veryfast`. The
5496        /// available options are
5497        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.264#Preset).
5498        /// Note that certain values for this field may cause the
5499        /// transcoder to override other fields you set in the `H264CodecSettings`
5500        /// message.
5501        pub preset: std::string::String,
5502
5503        /// GOP mode can be either by frame count or duration.
5504        pub gop_mode:
5505            std::option::Option<crate::model::video_stream::h_264_codec_settings::GopMode>,
5506
5507        /// Color format can be sdr or hlg.
5508        pub color_format:
5509            std::option::Option<crate::model::video_stream::h_264_codec_settings::ColorFormat>,
5510
5511        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5512    }
5513
5514    impl H264CodecSettings {
5515        /// Creates a new default instance.
5516        pub fn new() -> Self {
5517            std::default::Default::default()
5518        }
5519
5520        /// Sets the value of [width_pixels][crate::model::video_stream::H264CodecSettings::width_pixels].
5521        ///
5522        /// # Example
5523        /// ```ignore,no_run
5524        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5525        /// let x = H264CodecSettings::new().set_width_pixels(42);
5526        /// ```
5527        pub fn set_width_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5528            self.width_pixels = v.into();
5529            self
5530        }
5531
5532        /// Sets the value of [height_pixels][crate::model::video_stream::H264CodecSettings::height_pixels].
5533        ///
5534        /// # Example
5535        /// ```ignore,no_run
5536        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5537        /// let x = H264CodecSettings::new().set_height_pixels(42);
5538        /// ```
5539        pub fn set_height_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5540            self.height_pixels = v.into();
5541            self
5542        }
5543
5544        /// Sets the value of [frame_rate][crate::model::video_stream::H264CodecSettings::frame_rate].
5545        ///
5546        /// # Example
5547        /// ```ignore,no_run
5548        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5549        /// let x = H264CodecSettings::new().set_frame_rate(42.0);
5550        /// ```
5551        pub fn set_frame_rate<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
5552            self.frame_rate = v.into();
5553            self
5554        }
5555
5556        /// Sets the value of [frame_rate_conversion_strategy][crate::model::video_stream::H264CodecSettings::frame_rate_conversion_strategy].
5557        ///
5558        /// # Example
5559        /// ```ignore,no_run
5560        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5561        /// use google_cloud_video_transcoder_v1::model::video_stream::FrameRateConversionStrategy;
5562        /// let x0 = H264CodecSettings::new().set_frame_rate_conversion_strategy(FrameRateConversionStrategy::Downsample);
5563        /// let x1 = H264CodecSettings::new().set_frame_rate_conversion_strategy(FrameRateConversionStrategy::DropDuplicate);
5564        /// ```
5565        pub fn set_frame_rate_conversion_strategy<
5566            T: std::convert::Into<crate::model::video_stream::FrameRateConversionStrategy>,
5567        >(
5568            mut self,
5569            v: T,
5570        ) -> Self {
5571            self.frame_rate_conversion_strategy = v.into();
5572            self
5573        }
5574
5575        /// Sets the value of [bitrate_bps][crate::model::video_stream::H264CodecSettings::bitrate_bps].
5576        ///
5577        /// # Example
5578        /// ```ignore,no_run
5579        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5580        /// let x = H264CodecSettings::new().set_bitrate_bps(42);
5581        /// ```
5582        pub fn set_bitrate_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5583            self.bitrate_bps = v.into();
5584            self
5585        }
5586
5587        /// Sets the value of [pixel_format][crate::model::video_stream::H264CodecSettings::pixel_format].
5588        ///
5589        /// # Example
5590        /// ```ignore,no_run
5591        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5592        /// let x = H264CodecSettings::new().set_pixel_format("example");
5593        /// ```
5594        pub fn set_pixel_format<T: std::convert::Into<std::string::String>>(
5595            mut self,
5596            v: T,
5597        ) -> Self {
5598            self.pixel_format = v.into();
5599            self
5600        }
5601
5602        /// Sets the value of [rate_control_mode][crate::model::video_stream::H264CodecSettings::rate_control_mode].
5603        ///
5604        /// # Example
5605        /// ```ignore,no_run
5606        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5607        /// let x = H264CodecSettings::new().set_rate_control_mode("example");
5608        /// ```
5609        pub fn set_rate_control_mode<T: std::convert::Into<std::string::String>>(
5610            mut self,
5611            v: T,
5612        ) -> Self {
5613            self.rate_control_mode = v.into();
5614            self
5615        }
5616
5617        /// Sets the value of [crf_level][crate::model::video_stream::H264CodecSettings::crf_level].
5618        ///
5619        /// # Example
5620        /// ```ignore,no_run
5621        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5622        /// let x = H264CodecSettings::new().set_crf_level(42);
5623        /// ```
5624        pub fn set_crf_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5625            self.crf_level = v.into();
5626            self
5627        }
5628
5629        /// Sets the value of [allow_open_gop][crate::model::video_stream::H264CodecSettings::allow_open_gop].
5630        ///
5631        /// # Example
5632        /// ```ignore,no_run
5633        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5634        /// let x = H264CodecSettings::new().set_allow_open_gop(true);
5635        /// ```
5636        pub fn set_allow_open_gop<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5637            self.allow_open_gop = v.into();
5638            self
5639        }
5640
5641        /// Sets the value of [enable_two_pass][crate::model::video_stream::H264CodecSettings::enable_two_pass].
5642        ///
5643        /// # Example
5644        /// ```ignore,no_run
5645        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5646        /// let x = H264CodecSettings::new().set_enable_two_pass(true);
5647        /// ```
5648        pub fn set_enable_two_pass<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5649            self.enable_two_pass = v.into();
5650            self
5651        }
5652
5653        /// Sets the value of [vbv_size_bits][crate::model::video_stream::H264CodecSettings::vbv_size_bits].
5654        ///
5655        /// # Example
5656        /// ```ignore,no_run
5657        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5658        /// let x = H264CodecSettings::new().set_vbv_size_bits(42);
5659        /// ```
5660        pub fn set_vbv_size_bits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5661            self.vbv_size_bits = v.into();
5662            self
5663        }
5664
5665        /// Sets the value of [vbv_fullness_bits][crate::model::video_stream::H264CodecSettings::vbv_fullness_bits].
5666        ///
5667        /// # Example
5668        /// ```ignore,no_run
5669        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5670        /// let x = H264CodecSettings::new().set_vbv_fullness_bits(42);
5671        /// ```
5672        pub fn set_vbv_fullness_bits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5673            self.vbv_fullness_bits = v.into();
5674            self
5675        }
5676
5677        /// Sets the value of [entropy_coder][crate::model::video_stream::H264CodecSettings::entropy_coder].
5678        ///
5679        /// # Example
5680        /// ```ignore,no_run
5681        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5682        /// let x = H264CodecSettings::new().set_entropy_coder("example");
5683        /// ```
5684        pub fn set_entropy_coder<T: std::convert::Into<std::string::String>>(
5685            mut self,
5686            v: T,
5687        ) -> Self {
5688            self.entropy_coder = v.into();
5689            self
5690        }
5691
5692        /// Sets the value of [b_pyramid][crate::model::video_stream::H264CodecSettings::b_pyramid].
5693        ///
5694        /// # Example
5695        /// ```ignore,no_run
5696        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5697        /// let x = H264CodecSettings::new().set_b_pyramid(true);
5698        /// ```
5699        pub fn set_b_pyramid<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5700            self.b_pyramid = v.into();
5701            self
5702        }
5703
5704        /// Sets the value of [b_frame_count][crate::model::video_stream::H264CodecSettings::b_frame_count].
5705        ///
5706        /// # Example
5707        /// ```ignore,no_run
5708        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5709        /// let x = H264CodecSettings::new().set_b_frame_count(42);
5710        /// ```
5711        pub fn set_b_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5712            self.b_frame_count = v.into();
5713            self
5714        }
5715
5716        /// Sets the value of [aq_strength][crate::model::video_stream::H264CodecSettings::aq_strength].
5717        ///
5718        /// # Example
5719        /// ```ignore,no_run
5720        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5721        /// let x = H264CodecSettings::new().set_aq_strength(42.0);
5722        /// ```
5723        pub fn set_aq_strength<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
5724            self.aq_strength = v.into();
5725            self
5726        }
5727
5728        /// Sets the value of [profile][crate::model::video_stream::H264CodecSettings::profile].
5729        ///
5730        /// # Example
5731        /// ```ignore,no_run
5732        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5733        /// let x = H264CodecSettings::new().set_profile("example");
5734        /// ```
5735        pub fn set_profile<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5736            self.profile = v.into();
5737            self
5738        }
5739
5740        /// Sets the value of [tune][crate::model::video_stream::H264CodecSettings::tune].
5741        ///
5742        /// # Example
5743        /// ```ignore,no_run
5744        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5745        /// let x = H264CodecSettings::new().set_tune("example");
5746        /// ```
5747        pub fn set_tune<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5748            self.tune = v.into();
5749            self
5750        }
5751
5752        /// Sets the value of [preset][crate::model::video_stream::H264CodecSettings::preset].
5753        ///
5754        /// # Example
5755        /// ```ignore,no_run
5756        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5757        /// let x = H264CodecSettings::new().set_preset("example");
5758        /// ```
5759        pub fn set_preset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5760            self.preset = v.into();
5761            self
5762        }
5763
5764        /// Sets the value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode].
5765        ///
5766        /// Note that all the setters affecting `gop_mode` are mutually
5767        /// exclusive.
5768        ///
5769        /// # Example
5770        /// ```ignore,no_run
5771        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5772        /// use google_cloud_video_transcoder_v1::model::video_stream::h_264_codec_settings::GopMode;
5773        /// let x = H264CodecSettings::new().set_gop_mode(Some(GopMode::GopFrameCount(42)));
5774        /// ```
5775        pub fn set_gop_mode<
5776            T: std::convert::Into<
5777                    std::option::Option<crate::model::video_stream::h_264_codec_settings::GopMode>,
5778                >,
5779        >(
5780            mut self,
5781            v: T,
5782        ) -> Self {
5783            self.gop_mode = v.into();
5784            self
5785        }
5786
5787        /// The value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode]
5788        /// if it holds a `GopFrameCount`, `None` if the field is not set or
5789        /// holds a different branch.
5790        pub fn gop_frame_count(&self) -> std::option::Option<&i32> {
5791            #[allow(unreachable_patterns)]
5792            self.gop_mode.as_ref().and_then(|v| match v {
5793                crate::model::video_stream::h_264_codec_settings::GopMode::GopFrameCount(v) => {
5794                    std::option::Option::Some(v)
5795                }
5796                _ => std::option::Option::None,
5797            })
5798        }
5799
5800        /// Sets the value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode]
5801        /// to hold a `GopFrameCount`.
5802        ///
5803        /// Note that all the setters affecting `gop_mode` are
5804        /// mutually exclusive.
5805        ///
5806        /// # Example
5807        /// ```ignore,no_run
5808        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5809        /// let x = H264CodecSettings::new().set_gop_frame_count(42);
5810        /// assert!(x.gop_frame_count().is_some());
5811        /// assert!(x.gop_duration().is_none());
5812        /// ```
5813        pub fn set_gop_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5814            self.gop_mode = std::option::Option::Some(
5815                crate::model::video_stream::h_264_codec_settings::GopMode::GopFrameCount(v.into()),
5816            );
5817            self
5818        }
5819
5820        /// The value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode]
5821        /// if it holds a `GopDuration`, `None` if the field is not set or
5822        /// holds a different branch.
5823        pub fn gop_duration(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
5824            #[allow(unreachable_patterns)]
5825            self.gop_mode.as_ref().and_then(|v| match v {
5826                crate::model::video_stream::h_264_codec_settings::GopMode::GopDuration(v) => {
5827                    std::option::Option::Some(v)
5828                }
5829                _ => std::option::Option::None,
5830            })
5831        }
5832
5833        /// Sets the value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode]
5834        /// to hold a `GopDuration`.
5835        ///
5836        /// Note that all the setters affecting `gop_mode` are
5837        /// mutually exclusive.
5838        ///
5839        /// # Example
5840        /// ```ignore,no_run
5841        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5842        /// use wkt::Duration;
5843        /// let x = H264CodecSettings::new().set_gop_duration(Duration::default()/* use setters */);
5844        /// assert!(x.gop_duration().is_some());
5845        /// assert!(x.gop_frame_count().is_none());
5846        /// ```
5847        pub fn set_gop_duration<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
5848            mut self,
5849            v: T,
5850        ) -> Self {
5851            self.gop_mode = std::option::Option::Some(
5852                crate::model::video_stream::h_264_codec_settings::GopMode::GopDuration(v.into()),
5853            );
5854            self
5855        }
5856
5857        /// Sets the value of [color_format][crate::model::video_stream::H264CodecSettings::color_format].
5858        ///
5859        /// Note that all the setters affecting `color_format` are mutually
5860        /// exclusive.
5861        ///
5862        /// # Example
5863        /// ```ignore,no_run
5864        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5865        /// use google_cloud_video_transcoder_v1::model::video_stream::H264ColorFormatSDR;
5866        /// let x = H264CodecSettings::new().set_color_format(Some(
5867        ///     google_cloud_video_transcoder_v1::model::video_stream::h_264_codec_settings::ColorFormat::Sdr(H264ColorFormatSDR::default().into())));
5868        /// ```
5869        pub fn set_color_format<
5870            T: std::convert::Into<
5871                    std::option::Option<
5872                        crate::model::video_stream::h_264_codec_settings::ColorFormat,
5873                    >,
5874                >,
5875        >(
5876            mut self,
5877            v: T,
5878        ) -> Self {
5879            self.color_format = v.into();
5880            self
5881        }
5882
5883        /// The value of [color_format][crate::model::video_stream::H264CodecSettings::color_format]
5884        /// if it holds a `Sdr`, `None` if the field is not set or
5885        /// holds a different branch.
5886        pub fn sdr(
5887            &self,
5888        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H264ColorFormatSDR>>
5889        {
5890            #[allow(unreachable_patterns)]
5891            self.color_format.as_ref().and_then(|v| match v {
5892                crate::model::video_stream::h_264_codec_settings::ColorFormat::Sdr(v) => {
5893                    std::option::Option::Some(v)
5894                }
5895                _ => std::option::Option::None,
5896            })
5897        }
5898
5899        /// Sets the value of [color_format][crate::model::video_stream::H264CodecSettings::color_format]
5900        /// to hold a `Sdr`.
5901        ///
5902        /// Note that all the setters affecting `color_format` are
5903        /// mutually exclusive.
5904        ///
5905        /// # Example
5906        /// ```ignore,no_run
5907        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5908        /// use google_cloud_video_transcoder_v1::model::video_stream::H264ColorFormatSDR;
5909        /// let x = H264CodecSettings::new().set_sdr(H264ColorFormatSDR::default()/* use setters */);
5910        /// assert!(x.sdr().is_some());
5911        /// assert!(x.hlg().is_none());
5912        /// ```
5913        pub fn set_sdr<
5914            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H264ColorFormatSDR>>,
5915        >(
5916            mut self,
5917            v: T,
5918        ) -> Self {
5919            self.color_format = std::option::Option::Some(
5920                crate::model::video_stream::h_264_codec_settings::ColorFormat::Sdr(v.into()),
5921            );
5922            self
5923        }
5924
5925        /// The value of [color_format][crate::model::video_stream::H264CodecSettings::color_format]
5926        /// if it holds a `Hlg`, `None` if the field is not set or
5927        /// holds a different branch.
5928        pub fn hlg(
5929            &self,
5930        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H264ColorFormatHLG>>
5931        {
5932            #[allow(unreachable_patterns)]
5933            self.color_format.as_ref().and_then(|v| match v {
5934                crate::model::video_stream::h_264_codec_settings::ColorFormat::Hlg(v) => {
5935                    std::option::Option::Some(v)
5936                }
5937                _ => std::option::Option::None,
5938            })
5939        }
5940
5941        /// Sets the value of [color_format][crate::model::video_stream::H264CodecSettings::color_format]
5942        /// to hold a `Hlg`.
5943        ///
5944        /// Note that all the setters affecting `color_format` are
5945        /// mutually exclusive.
5946        ///
5947        /// # Example
5948        /// ```ignore,no_run
5949        /// # use google_cloud_video_transcoder_v1::model::video_stream::H264CodecSettings;
5950        /// use google_cloud_video_transcoder_v1::model::video_stream::H264ColorFormatHLG;
5951        /// let x = H264CodecSettings::new().set_hlg(H264ColorFormatHLG::default()/* use setters */);
5952        /// assert!(x.hlg().is_some());
5953        /// assert!(x.sdr().is_none());
5954        /// ```
5955        pub fn set_hlg<
5956            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H264ColorFormatHLG>>,
5957        >(
5958            mut self,
5959            v: T,
5960        ) -> Self {
5961            self.color_format = std::option::Option::Some(
5962                crate::model::video_stream::h_264_codec_settings::ColorFormat::Hlg(v.into()),
5963            );
5964            self
5965        }
5966    }
5967
5968    impl wkt::message::Message for H264CodecSettings {
5969        fn typename() -> &'static str {
5970            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings"
5971        }
5972    }
5973
5974    /// Defines additional types related to [H264CodecSettings].
5975    pub mod h_264_codec_settings {
5976        #[allow(unused_imports)]
5977        use super::*;
5978
5979        /// GOP mode can be either by frame count or duration.
5980        #[derive(Clone, Debug, PartialEq)]
5981        #[non_exhaustive]
5982        pub enum GopMode {
5983            /// Select the GOP size based on the specified frame count. Must be greater
5984            /// than zero.
5985            GopFrameCount(i32),
5986            /// Select the GOP size based on the specified duration. The default is
5987            /// `3s`. Note that `gopDuration` must be less than or equal to
5988            /// [`segmentDuration`](#SegmentSettings), and
5989            /// [`segmentDuration`](#SegmentSettings) must be divisible by
5990            /// `gopDuration`.
5991            GopDuration(std::boxed::Box<wkt::Duration>),
5992        }
5993
5994        /// Color format can be sdr or hlg.
5995        #[derive(Clone, Debug, PartialEq)]
5996        #[non_exhaustive]
5997        pub enum ColorFormat {
5998            /// Optional. SDR color format setting for H264.
5999            Sdr(std::boxed::Box<crate::model::video_stream::H264ColorFormatSDR>),
6000            /// Optional. HLG color format setting for H264.
6001            Hlg(std::boxed::Box<crate::model::video_stream::H264ColorFormatHLG>),
6002        }
6003    }
6004
6005    /// Convert the input video to a Standard Dynamic Range (SDR) video.
6006    #[derive(Clone, Default, PartialEq)]
6007    #[non_exhaustive]
6008    pub struct H265ColorFormatSDR {
6009        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6010    }
6011
6012    impl H265ColorFormatSDR {
6013        /// Creates a new default instance.
6014        pub fn new() -> Self {
6015            std::default::Default::default()
6016        }
6017    }
6018
6019    impl wkt::message::Message for H265ColorFormatSDR {
6020        fn typename() -> &'static str {
6021            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H265ColorFormatSDR"
6022        }
6023    }
6024
6025    /// Convert the input video to a Hybrid Log Gamma (HLG) video.
6026    #[derive(Clone, Default, PartialEq)]
6027    #[non_exhaustive]
6028    pub struct H265ColorFormatHLG {
6029        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6030    }
6031
6032    impl H265ColorFormatHLG {
6033        /// Creates a new default instance.
6034        pub fn new() -> Self {
6035            std::default::Default::default()
6036        }
6037    }
6038
6039    impl wkt::message::Message for H265ColorFormatHLG {
6040        fn typename() -> &'static str {
6041            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H265ColorFormatHLG"
6042        }
6043    }
6044
6045    /// Convert the input video to a High Dynamic Range 10 (HDR10) video.
6046    #[derive(Clone, Default, PartialEq)]
6047    #[non_exhaustive]
6048    pub struct H265ColorFormatHDR10 {
6049        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6050    }
6051
6052    impl H265ColorFormatHDR10 {
6053        /// Creates a new default instance.
6054        pub fn new() -> Self {
6055            std::default::Default::default()
6056        }
6057    }
6058
6059    impl wkt::message::Message for H265ColorFormatHDR10 {
6060        fn typename() -> &'static str {
6061            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H265ColorFormatHDR10"
6062        }
6063    }
6064
6065    /// H265 codec settings.
6066    #[derive(Clone, Default, PartialEq)]
6067    #[non_exhaustive]
6068    pub struct H265CodecSettings {
6069        /// The width of the video in pixels. Must be an even integer.
6070        /// When not specified, the width is adjusted to match the specified height
6071        /// and input aspect ratio. If both are omitted, the input width is used.
6072        ///
6073        /// For portrait videos that contain horizontal ASR and rotation metadata,
6074        /// provide the width, in pixels, per the horizontal ASR. The API calculates
6075        /// the height per the horizontal ASR. The API detects any rotation metadata
6076        /// and swaps the requested height and width for the output.
6077        pub width_pixels: i32,
6078
6079        /// The height of the video in pixels. Must be an even integer.
6080        /// When not specified, the height is adjusted to match the specified width
6081        /// and input aspect ratio. If both are omitted, the input height is used.
6082        ///
6083        /// For portrait videos that contain horizontal ASR and rotation metadata,
6084        /// provide the height, in pixels, per the horizontal ASR. The API calculates
6085        /// the width per the horizontal ASR. The API detects any rotation metadata
6086        /// and swaps the requested height and width for the output.
6087        pub height_pixels: i32,
6088
6089        /// Required. The target video frame rate in frames per second (FPS). Must be
6090        /// less than or equal to 120.
6091        pub frame_rate: f64,
6092
6093        /// Optional. Frame rate conversion strategy for desired frame rate. The
6094        /// default is `DOWNSAMPLE`.
6095        pub frame_rate_conversion_strategy: crate::model::video_stream::FrameRateConversionStrategy,
6096
6097        /// Required. The video bitrate in bits per second. The minimum value is
6098        /// 1,000. The maximum value is 800,000,000.
6099        pub bitrate_bps: i32,
6100
6101        /// Pixel format to use. The default is `yuv420p`.
6102        ///
6103        /// Supported pixel formats:
6104        ///
6105        /// - `yuv420p` pixel format
6106        /// - `yuv422p` pixel format
6107        /// - `yuv444p` pixel format
6108        /// - `yuv420p10` 10-bit HDR pixel format
6109        /// - `yuv422p10` 10-bit HDR pixel format
6110        /// - `yuv444p10` 10-bit HDR pixel format
6111        /// - `yuv420p12` 12-bit HDR pixel format
6112        /// - `yuv422p12` 12-bit HDR pixel format
6113        /// - `yuv444p12` 12-bit HDR pixel format
6114        pub pixel_format: std::string::String,
6115
6116        /// Specify the mode. The default is `vbr`.
6117        ///
6118        /// Supported rate control modes:
6119        ///
6120        /// - `vbr` - variable bitrate
6121        /// - `crf` - constant rate factor
6122        pub rate_control_mode: std::string::String,
6123
6124        /// Target CRF level. Must be between 10 and 36, where 10 is the highest
6125        /// quality and 36 is the most efficient compression. The default is 21.
6126        pub crf_level: i32,
6127
6128        /// Specifies whether an open Group of Pictures (GOP) structure should be
6129        /// allowed or not. The default is `false`.
6130        pub allow_open_gop: bool,
6131
6132        /// Use two-pass encoding strategy to achieve better video quality.
6133        /// [H265CodecSettings.rate_control_mode][google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.rate_control_mode]
6134        /// must be `vbr`. The default is `false`.
6135        ///
6136        /// [google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.rate_control_mode]: crate::model::video_stream::H265CodecSettings::rate_control_mode
6137        pub enable_two_pass: bool,
6138
6139        /// Size of the Video Buffering Verifier (VBV) buffer in bits. Must be
6140        /// greater than zero. The default is equal to `VideoStream.bitrate_bps`.
6141        pub vbv_size_bits: i32,
6142
6143        /// Initial fullness of the Video Buffering Verifier (VBV) buffer in bits.
6144        /// Must be greater than zero. The default is equal to 90% of
6145        /// [H265CodecSettings.vbv_size_bits][google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.vbv_size_bits].
6146        ///
6147        /// [google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.vbv_size_bits]: crate::model::video_stream::H265CodecSettings::vbv_size_bits
6148        pub vbv_fullness_bits: i32,
6149
6150        /// Allow B-pyramid for reference frame selection. This may not be supported
6151        /// on all decoders. The default is `false`.
6152        pub b_pyramid: bool,
6153
6154        /// The number of consecutive B-frames. Must be greater than or equal to
6155        /// zero. Must be less than
6156        /// [H265CodecSettings.gop_frame_count][google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.gop_frame_count]
6157        /// if set. The default is 0.
6158        ///
6159        /// [google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.gop_frame_count]: crate::model::video_stream::H265CodecSettings::gop_mode
6160        pub b_frame_count: i32,
6161
6162        /// Specify the intensity of the adaptive quantizer (AQ). Must be between 0
6163        /// and 1, where 0 disables the quantizer and 1 maximizes the quantizer. A
6164        /// higher value equals a lower bitrate but smoother image. The default is 0.
6165        pub aq_strength: f64,
6166
6167        /// Enforces the specified codec profile. The following profiles are
6168        /// supported:
6169        ///
6170        /// * 8-bit profiles
6171        ///   * `main` (default)
6172        ///   * `main-intra`
6173        ///   * `mainstillpicture`
6174        /// * 10-bit profiles
6175        ///   * `main10` (default)
6176        ///   * `main10-intra`
6177        ///   * `main422-10`
6178        ///   * `main422-10-intra`
6179        ///   * `main444-10`
6180        ///   * `main444-10-intra`
6181        /// * 12-bit profiles
6182        ///   * `main12` (default)
6183        ///   * `main12-intra`
6184        ///   * `main422-12`
6185        ///   * `main422-12-intra`
6186        ///   * `main444-12`
6187        ///   * `main444-12-intra`
6188        ///
6189        /// The available options are
6190        /// [FFmpeg-compatible](https://x265.readthedocs.io/).
6191        /// Note that certain values for this field may cause the
6192        /// transcoder to override other fields you set in the `H265CodecSettings`
6193        /// message.
6194        pub profile: std::string::String,
6195
6196        /// Enforces the specified codec tune. The available options are
6197        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.265).
6198        /// Note that certain values for this field may cause the
6199        /// transcoder to override other fields you set in the `H265CodecSettings`
6200        /// message.
6201        pub tune: std::string::String,
6202
6203        /// Enforces the specified codec preset. The default is `veryfast`. The
6204        /// available options are
6205        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.265).
6206        /// Note that certain values for this field may cause the
6207        /// transcoder to override other fields you set in the `H265CodecSettings`
6208        /// message.
6209        pub preset: std::string::String,
6210
6211        /// GOP mode can be either by frame count or duration.
6212        pub gop_mode:
6213            std::option::Option<crate::model::video_stream::h_265_codec_settings::GopMode>,
6214
6215        /// Color format can be sdr, hlg, hdr10.
6216        pub color_format:
6217            std::option::Option<crate::model::video_stream::h_265_codec_settings::ColorFormat>,
6218
6219        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6220    }
6221
6222    impl H265CodecSettings {
6223        /// Creates a new default instance.
6224        pub fn new() -> Self {
6225            std::default::Default::default()
6226        }
6227
6228        /// Sets the value of [width_pixels][crate::model::video_stream::H265CodecSettings::width_pixels].
6229        ///
6230        /// # Example
6231        /// ```ignore,no_run
6232        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6233        /// let x = H265CodecSettings::new().set_width_pixels(42);
6234        /// ```
6235        pub fn set_width_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6236            self.width_pixels = v.into();
6237            self
6238        }
6239
6240        /// Sets the value of [height_pixels][crate::model::video_stream::H265CodecSettings::height_pixels].
6241        ///
6242        /// # Example
6243        /// ```ignore,no_run
6244        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6245        /// let x = H265CodecSettings::new().set_height_pixels(42);
6246        /// ```
6247        pub fn set_height_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6248            self.height_pixels = v.into();
6249            self
6250        }
6251
6252        /// Sets the value of [frame_rate][crate::model::video_stream::H265CodecSettings::frame_rate].
6253        ///
6254        /// # Example
6255        /// ```ignore,no_run
6256        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6257        /// let x = H265CodecSettings::new().set_frame_rate(42.0);
6258        /// ```
6259        pub fn set_frame_rate<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
6260            self.frame_rate = v.into();
6261            self
6262        }
6263
6264        /// Sets the value of [frame_rate_conversion_strategy][crate::model::video_stream::H265CodecSettings::frame_rate_conversion_strategy].
6265        ///
6266        /// # Example
6267        /// ```ignore,no_run
6268        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6269        /// use google_cloud_video_transcoder_v1::model::video_stream::FrameRateConversionStrategy;
6270        /// let x0 = H265CodecSettings::new().set_frame_rate_conversion_strategy(FrameRateConversionStrategy::Downsample);
6271        /// let x1 = H265CodecSettings::new().set_frame_rate_conversion_strategy(FrameRateConversionStrategy::DropDuplicate);
6272        /// ```
6273        pub fn set_frame_rate_conversion_strategy<
6274            T: std::convert::Into<crate::model::video_stream::FrameRateConversionStrategy>,
6275        >(
6276            mut self,
6277            v: T,
6278        ) -> Self {
6279            self.frame_rate_conversion_strategy = v.into();
6280            self
6281        }
6282
6283        /// Sets the value of [bitrate_bps][crate::model::video_stream::H265CodecSettings::bitrate_bps].
6284        ///
6285        /// # Example
6286        /// ```ignore,no_run
6287        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6288        /// let x = H265CodecSettings::new().set_bitrate_bps(42);
6289        /// ```
6290        pub fn set_bitrate_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6291            self.bitrate_bps = v.into();
6292            self
6293        }
6294
6295        /// Sets the value of [pixel_format][crate::model::video_stream::H265CodecSettings::pixel_format].
6296        ///
6297        /// # Example
6298        /// ```ignore,no_run
6299        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6300        /// let x = H265CodecSettings::new().set_pixel_format("example");
6301        /// ```
6302        pub fn set_pixel_format<T: std::convert::Into<std::string::String>>(
6303            mut self,
6304            v: T,
6305        ) -> Self {
6306            self.pixel_format = v.into();
6307            self
6308        }
6309
6310        /// Sets the value of [rate_control_mode][crate::model::video_stream::H265CodecSettings::rate_control_mode].
6311        ///
6312        /// # Example
6313        /// ```ignore,no_run
6314        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6315        /// let x = H265CodecSettings::new().set_rate_control_mode("example");
6316        /// ```
6317        pub fn set_rate_control_mode<T: std::convert::Into<std::string::String>>(
6318            mut self,
6319            v: T,
6320        ) -> Self {
6321            self.rate_control_mode = v.into();
6322            self
6323        }
6324
6325        /// Sets the value of [crf_level][crate::model::video_stream::H265CodecSettings::crf_level].
6326        ///
6327        /// # Example
6328        /// ```ignore,no_run
6329        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6330        /// let x = H265CodecSettings::new().set_crf_level(42);
6331        /// ```
6332        pub fn set_crf_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6333            self.crf_level = v.into();
6334            self
6335        }
6336
6337        /// Sets the value of [allow_open_gop][crate::model::video_stream::H265CodecSettings::allow_open_gop].
6338        ///
6339        /// # Example
6340        /// ```ignore,no_run
6341        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6342        /// let x = H265CodecSettings::new().set_allow_open_gop(true);
6343        /// ```
6344        pub fn set_allow_open_gop<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6345            self.allow_open_gop = v.into();
6346            self
6347        }
6348
6349        /// Sets the value of [enable_two_pass][crate::model::video_stream::H265CodecSettings::enable_two_pass].
6350        ///
6351        /// # Example
6352        /// ```ignore,no_run
6353        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6354        /// let x = H265CodecSettings::new().set_enable_two_pass(true);
6355        /// ```
6356        pub fn set_enable_two_pass<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6357            self.enable_two_pass = v.into();
6358            self
6359        }
6360
6361        /// Sets the value of [vbv_size_bits][crate::model::video_stream::H265CodecSettings::vbv_size_bits].
6362        ///
6363        /// # Example
6364        /// ```ignore,no_run
6365        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6366        /// let x = H265CodecSettings::new().set_vbv_size_bits(42);
6367        /// ```
6368        pub fn set_vbv_size_bits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6369            self.vbv_size_bits = v.into();
6370            self
6371        }
6372
6373        /// Sets the value of [vbv_fullness_bits][crate::model::video_stream::H265CodecSettings::vbv_fullness_bits].
6374        ///
6375        /// # Example
6376        /// ```ignore,no_run
6377        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6378        /// let x = H265CodecSettings::new().set_vbv_fullness_bits(42);
6379        /// ```
6380        pub fn set_vbv_fullness_bits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6381            self.vbv_fullness_bits = v.into();
6382            self
6383        }
6384
6385        /// Sets the value of [b_pyramid][crate::model::video_stream::H265CodecSettings::b_pyramid].
6386        ///
6387        /// # Example
6388        /// ```ignore,no_run
6389        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6390        /// let x = H265CodecSettings::new().set_b_pyramid(true);
6391        /// ```
6392        pub fn set_b_pyramid<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6393            self.b_pyramid = v.into();
6394            self
6395        }
6396
6397        /// Sets the value of [b_frame_count][crate::model::video_stream::H265CodecSettings::b_frame_count].
6398        ///
6399        /// # Example
6400        /// ```ignore,no_run
6401        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6402        /// let x = H265CodecSettings::new().set_b_frame_count(42);
6403        /// ```
6404        pub fn set_b_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6405            self.b_frame_count = v.into();
6406            self
6407        }
6408
6409        /// Sets the value of [aq_strength][crate::model::video_stream::H265CodecSettings::aq_strength].
6410        ///
6411        /// # Example
6412        /// ```ignore,no_run
6413        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6414        /// let x = H265CodecSettings::new().set_aq_strength(42.0);
6415        /// ```
6416        pub fn set_aq_strength<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
6417            self.aq_strength = v.into();
6418            self
6419        }
6420
6421        /// Sets the value of [profile][crate::model::video_stream::H265CodecSettings::profile].
6422        ///
6423        /// # Example
6424        /// ```ignore,no_run
6425        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6426        /// let x = H265CodecSettings::new().set_profile("example");
6427        /// ```
6428        pub fn set_profile<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6429            self.profile = v.into();
6430            self
6431        }
6432
6433        /// Sets the value of [tune][crate::model::video_stream::H265CodecSettings::tune].
6434        ///
6435        /// # Example
6436        /// ```ignore,no_run
6437        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6438        /// let x = H265CodecSettings::new().set_tune("example");
6439        /// ```
6440        pub fn set_tune<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6441            self.tune = v.into();
6442            self
6443        }
6444
6445        /// Sets the value of [preset][crate::model::video_stream::H265CodecSettings::preset].
6446        ///
6447        /// # Example
6448        /// ```ignore,no_run
6449        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6450        /// let x = H265CodecSettings::new().set_preset("example");
6451        /// ```
6452        pub fn set_preset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6453            self.preset = v.into();
6454            self
6455        }
6456
6457        /// Sets the value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode].
6458        ///
6459        /// Note that all the setters affecting `gop_mode` are mutually
6460        /// exclusive.
6461        ///
6462        /// # Example
6463        /// ```ignore,no_run
6464        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6465        /// use google_cloud_video_transcoder_v1::model::video_stream::h_265_codec_settings::GopMode;
6466        /// let x = H265CodecSettings::new().set_gop_mode(Some(GopMode::GopFrameCount(42)));
6467        /// ```
6468        pub fn set_gop_mode<
6469            T: std::convert::Into<
6470                    std::option::Option<crate::model::video_stream::h_265_codec_settings::GopMode>,
6471                >,
6472        >(
6473            mut self,
6474            v: T,
6475        ) -> Self {
6476            self.gop_mode = v.into();
6477            self
6478        }
6479
6480        /// The value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode]
6481        /// if it holds a `GopFrameCount`, `None` if the field is not set or
6482        /// holds a different branch.
6483        pub fn gop_frame_count(&self) -> std::option::Option<&i32> {
6484            #[allow(unreachable_patterns)]
6485            self.gop_mode.as_ref().and_then(|v| match v {
6486                crate::model::video_stream::h_265_codec_settings::GopMode::GopFrameCount(v) => {
6487                    std::option::Option::Some(v)
6488                }
6489                _ => std::option::Option::None,
6490            })
6491        }
6492
6493        /// Sets the value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode]
6494        /// to hold a `GopFrameCount`.
6495        ///
6496        /// Note that all the setters affecting `gop_mode` are
6497        /// mutually exclusive.
6498        ///
6499        /// # Example
6500        /// ```ignore,no_run
6501        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6502        /// let x = H265CodecSettings::new().set_gop_frame_count(42);
6503        /// assert!(x.gop_frame_count().is_some());
6504        /// assert!(x.gop_duration().is_none());
6505        /// ```
6506        pub fn set_gop_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6507            self.gop_mode = std::option::Option::Some(
6508                crate::model::video_stream::h_265_codec_settings::GopMode::GopFrameCount(v.into()),
6509            );
6510            self
6511        }
6512
6513        /// The value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode]
6514        /// if it holds a `GopDuration`, `None` if the field is not set or
6515        /// holds a different branch.
6516        pub fn gop_duration(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
6517            #[allow(unreachable_patterns)]
6518            self.gop_mode.as_ref().and_then(|v| match v {
6519                crate::model::video_stream::h_265_codec_settings::GopMode::GopDuration(v) => {
6520                    std::option::Option::Some(v)
6521                }
6522                _ => std::option::Option::None,
6523            })
6524        }
6525
6526        /// Sets the value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode]
6527        /// to hold a `GopDuration`.
6528        ///
6529        /// Note that all the setters affecting `gop_mode` are
6530        /// mutually exclusive.
6531        ///
6532        /// # Example
6533        /// ```ignore,no_run
6534        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6535        /// use wkt::Duration;
6536        /// let x = H265CodecSettings::new().set_gop_duration(Duration::default()/* use setters */);
6537        /// assert!(x.gop_duration().is_some());
6538        /// assert!(x.gop_frame_count().is_none());
6539        /// ```
6540        pub fn set_gop_duration<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
6541            mut self,
6542            v: T,
6543        ) -> Self {
6544            self.gop_mode = std::option::Option::Some(
6545                crate::model::video_stream::h_265_codec_settings::GopMode::GopDuration(v.into()),
6546            );
6547            self
6548        }
6549
6550        /// Sets the value of [color_format][crate::model::video_stream::H265CodecSettings::color_format].
6551        ///
6552        /// Note that all the setters affecting `color_format` are mutually
6553        /// exclusive.
6554        ///
6555        /// # Example
6556        /// ```ignore,no_run
6557        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6558        /// use google_cloud_video_transcoder_v1::model::video_stream::H265ColorFormatSDR;
6559        /// let x = H265CodecSettings::new().set_color_format(Some(
6560        ///     google_cloud_video_transcoder_v1::model::video_stream::h_265_codec_settings::ColorFormat::Sdr(H265ColorFormatSDR::default().into())));
6561        /// ```
6562        pub fn set_color_format<
6563            T: std::convert::Into<
6564                    std::option::Option<
6565                        crate::model::video_stream::h_265_codec_settings::ColorFormat,
6566                    >,
6567                >,
6568        >(
6569            mut self,
6570            v: T,
6571        ) -> Self {
6572            self.color_format = v.into();
6573            self
6574        }
6575
6576        /// The value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
6577        /// if it holds a `Sdr`, `None` if the field is not set or
6578        /// holds a different branch.
6579        pub fn sdr(
6580            &self,
6581        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H265ColorFormatSDR>>
6582        {
6583            #[allow(unreachable_patterns)]
6584            self.color_format.as_ref().and_then(|v| match v {
6585                crate::model::video_stream::h_265_codec_settings::ColorFormat::Sdr(v) => {
6586                    std::option::Option::Some(v)
6587                }
6588                _ => std::option::Option::None,
6589            })
6590        }
6591
6592        /// Sets the value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
6593        /// to hold a `Sdr`.
6594        ///
6595        /// Note that all the setters affecting `color_format` are
6596        /// mutually exclusive.
6597        ///
6598        /// # Example
6599        /// ```ignore,no_run
6600        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6601        /// use google_cloud_video_transcoder_v1::model::video_stream::H265ColorFormatSDR;
6602        /// let x = H265CodecSettings::new().set_sdr(H265ColorFormatSDR::default()/* use setters */);
6603        /// assert!(x.sdr().is_some());
6604        /// assert!(x.hlg().is_none());
6605        /// assert!(x.hdr10().is_none());
6606        /// ```
6607        pub fn set_sdr<
6608            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H265ColorFormatSDR>>,
6609        >(
6610            mut self,
6611            v: T,
6612        ) -> Self {
6613            self.color_format = std::option::Option::Some(
6614                crate::model::video_stream::h_265_codec_settings::ColorFormat::Sdr(v.into()),
6615            );
6616            self
6617        }
6618
6619        /// The value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
6620        /// if it holds a `Hlg`, `None` if the field is not set or
6621        /// holds a different branch.
6622        pub fn hlg(
6623            &self,
6624        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H265ColorFormatHLG>>
6625        {
6626            #[allow(unreachable_patterns)]
6627            self.color_format.as_ref().and_then(|v| match v {
6628                crate::model::video_stream::h_265_codec_settings::ColorFormat::Hlg(v) => {
6629                    std::option::Option::Some(v)
6630                }
6631                _ => std::option::Option::None,
6632            })
6633        }
6634
6635        /// Sets the value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
6636        /// to hold a `Hlg`.
6637        ///
6638        /// Note that all the setters affecting `color_format` are
6639        /// mutually exclusive.
6640        ///
6641        /// # Example
6642        /// ```ignore,no_run
6643        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6644        /// use google_cloud_video_transcoder_v1::model::video_stream::H265ColorFormatHLG;
6645        /// let x = H265CodecSettings::new().set_hlg(H265ColorFormatHLG::default()/* use setters */);
6646        /// assert!(x.hlg().is_some());
6647        /// assert!(x.sdr().is_none());
6648        /// assert!(x.hdr10().is_none());
6649        /// ```
6650        pub fn set_hlg<
6651            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H265ColorFormatHLG>>,
6652        >(
6653            mut self,
6654            v: T,
6655        ) -> Self {
6656            self.color_format = std::option::Option::Some(
6657                crate::model::video_stream::h_265_codec_settings::ColorFormat::Hlg(v.into()),
6658            );
6659            self
6660        }
6661
6662        /// The value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
6663        /// if it holds a `Hdr10`, `None` if the field is not set or
6664        /// holds a different branch.
6665        pub fn hdr10(
6666            &self,
6667        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H265ColorFormatHDR10>>
6668        {
6669            #[allow(unreachable_patterns)]
6670            self.color_format.as_ref().and_then(|v| match v {
6671                crate::model::video_stream::h_265_codec_settings::ColorFormat::Hdr10(v) => {
6672                    std::option::Option::Some(v)
6673                }
6674                _ => std::option::Option::None,
6675            })
6676        }
6677
6678        /// Sets the value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
6679        /// to hold a `Hdr10`.
6680        ///
6681        /// Note that all the setters affecting `color_format` are
6682        /// mutually exclusive.
6683        ///
6684        /// # Example
6685        /// ```ignore,no_run
6686        /// # use google_cloud_video_transcoder_v1::model::video_stream::H265CodecSettings;
6687        /// use google_cloud_video_transcoder_v1::model::video_stream::H265ColorFormatHDR10;
6688        /// let x = H265CodecSettings::new().set_hdr10(H265ColorFormatHDR10::default()/* use setters */);
6689        /// assert!(x.hdr10().is_some());
6690        /// assert!(x.sdr().is_none());
6691        /// assert!(x.hlg().is_none());
6692        /// ```
6693        pub fn set_hdr10<
6694            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H265ColorFormatHDR10>>,
6695        >(
6696            mut self,
6697            v: T,
6698        ) -> Self {
6699            self.color_format = std::option::Option::Some(
6700                crate::model::video_stream::h_265_codec_settings::ColorFormat::Hdr10(v.into()),
6701            );
6702            self
6703        }
6704    }
6705
6706    impl wkt::message::Message for H265CodecSettings {
6707        fn typename() -> &'static str {
6708            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings"
6709        }
6710    }
6711
6712    /// Defines additional types related to [H265CodecSettings].
6713    pub mod h_265_codec_settings {
6714        #[allow(unused_imports)]
6715        use super::*;
6716
6717        /// GOP mode can be either by frame count or duration.
6718        #[derive(Clone, Debug, PartialEq)]
6719        #[non_exhaustive]
6720        pub enum GopMode {
6721            /// Select the GOP size based on the specified frame count. Must be greater
6722            /// than zero.
6723            GopFrameCount(i32),
6724            /// Select the GOP size based on the specified duration. The default is
6725            /// `3s`. Note that `gopDuration` must be less than or equal to
6726            /// [`segmentDuration`](#SegmentSettings), and
6727            /// [`segmentDuration`](#SegmentSettings) must be divisible by
6728            /// `gopDuration`.
6729            GopDuration(std::boxed::Box<wkt::Duration>),
6730        }
6731
6732        /// Color format can be sdr, hlg, hdr10.
6733        #[derive(Clone, Debug, PartialEq)]
6734        #[non_exhaustive]
6735        pub enum ColorFormat {
6736            /// Optional. SDR color format setting for H265.
6737            Sdr(std::boxed::Box<crate::model::video_stream::H265ColorFormatSDR>),
6738            /// Optional. HLG color format setting for H265.
6739            Hlg(std::boxed::Box<crate::model::video_stream::H265ColorFormatHLG>),
6740            /// Optional. HDR10 color format setting for H265.
6741            Hdr10(std::boxed::Box<crate::model::video_stream::H265ColorFormatHDR10>),
6742        }
6743    }
6744
6745    /// Convert the input video to a Standard Dynamic Range (SDR) video.
6746    #[derive(Clone, Default, PartialEq)]
6747    #[non_exhaustive]
6748    pub struct Vp9ColorFormatSDR {
6749        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6750    }
6751
6752    impl Vp9ColorFormatSDR {
6753        /// Creates a new default instance.
6754        pub fn new() -> Self {
6755            std::default::Default::default()
6756        }
6757    }
6758
6759    impl wkt::message::Message for Vp9ColorFormatSDR {
6760        fn typename() -> &'static str {
6761            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.Vp9ColorFormatSDR"
6762        }
6763    }
6764
6765    /// Convert the input video to a Hybrid Log Gamma (HLG) video.
6766    #[derive(Clone, Default, PartialEq)]
6767    #[non_exhaustive]
6768    pub struct Vp9ColorFormatHLG {
6769        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6770    }
6771
6772    impl Vp9ColorFormatHLG {
6773        /// Creates a new default instance.
6774        pub fn new() -> Self {
6775            std::default::Default::default()
6776        }
6777    }
6778
6779    impl wkt::message::Message for Vp9ColorFormatHLG {
6780        fn typename() -> &'static str {
6781            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.Vp9ColorFormatHLG"
6782        }
6783    }
6784
6785    /// VP9 codec settings.
6786    #[derive(Clone, Default, PartialEq)]
6787    #[non_exhaustive]
6788    pub struct Vp9CodecSettings {
6789        /// The width of the video in pixels. Must be an even integer.
6790        /// When not specified, the width is adjusted to match the specified height
6791        /// and input aspect ratio. If both are omitted, the input width is used.
6792        ///
6793        /// For portrait videos that contain horizontal ASR and rotation metadata,
6794        /// provide the width, in pixels, per the horizontal ASR. The API calculates
6795        /// the height per the horizontal ASR. The API detects any rotation metadata
6796        /// and swaps the requested height and width for the output.
6797        pub width_pixels: i32,
6798
6799        /// The height of the video in pixels. Must be an even integer.
6800        /// When not specified, the height is adjusted to match the specified width
6801        /// and input aspect ratio. If both are omitted, the input height is used.
6802        ///
6803        /// For portrait videos that contain horizontal ASR and rotation metadata,
6804        /// provide the height, in pixels, per the horizontal ASR. The API calculates
6805        /// the width per the horizontal ASR. The API detects any rotation metadata
6806        /// and swaps the requested height and width for the output.
6807        pub height_pixels: i32,
6808
6809        /// Required. The target video frame rate in frames per second (FPS). Must be
6810        /// less than or equal to 120.
6811        pub frame_rate: f64,
6812
6813        /// Optional. Frame rate conversion strategy for desired frame rate. The
6814        /// default is `DOWNSAMPLE`.
6815        pub frame_rate_conversion_strategy: crate::model::video_stream::FrameRateConversionStrategy,
6816
6817        /// Required. The video bitrate in bits per second. The minimum value is
6818        /// 1,000. The maximum value is 480,000,000.
6819        pub bitrate_bps: i32,
6820
6821        /// Pixel format to use. The default is `yuv420p`.
6822        ///
6823        /// Supported pixel formats:
6824        ///
6825        /// - `yuv420p` pixel format
6826        /// - `yuv422p` pixel format
6827        /// - `yuv444p` pixel format
6828        /// - `yuv420p10` 10-bit HDR pixel format
6829        /// - `yuv422p10` 10-bit HDR pixel format
6830        /// - `yuv444p10` 10-bit HDR pixel format
6831        /// - `yuv420p12` 12-bit HDR pixel format
6832        /// - `yuv422p12` 12-bit HDR pixel format
6833        /// - `yuv444p12` 12-bit HDR pixel format
6834        pub pixel_format: std::string::String,
6835
6836        /// Specify the mode. The default is `vbr`.
6837        ///
6838        /// Supported rate control modes:
6839        ///
6840        /// - `vbr` - variable bitrate
6841        pub rate_control_mode: std::string::String,
6842
6843        /// Target CRF level. Must be between 10 and 36, where 10 is the highest
6844        /// quality and 36 is the most efficient compression. The default is 21.
6845        ///
6846        /// **Note:** This field is not supported.
6847        pub crf_level: i32,
6848
6849        /// Enforces the specified codec profile. The following profiles are
6850        /// supported:
6851        ///
6852        /// * `profile0` (default)
6853        /// * `profile1`
6854        /// * `profile2`
6855        /// * `profile3`
6856        ///
6857        /// The available options are
6858        /// [WebM-compatible](https://www.webmproject.org/vp9/profiles/).
6859        /// Note that certain values for this field may cause the
6860        /// transcoder to override other fields you set in the `Vp9CodecSettings`
6861        /// message.
6862        pub profile: std::string::String,
6863
6864        /// GOP mode can be either by frame count or duration.
6865        pub gop_mode: std::option::Option<crate::model::video_stream::vp_9_codec_settings::GopMode>,
6866
6867        /// Color format can be sdr or hlg.
6868        pub color_format:
6869            std::option::Option<crate::model::video_stream::vp_9_codec_settings::ColorFormat>,
6870
6871        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6872    }
6873
6874    impl Vp9CodecSettings {
6875        /// Creates a new default instance.
6876        pub fn new() -> Self {
6877            std::default::Default::default()
6878        }
6879
6880        /// Sets the value of [width_pixels][crate::model::video_stream::Vp9CodecSettings::width_pixels].
6881        ///
6882        /// # Example
6883        /// ```ignore,no_run
6884        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
6885        /// let x = Vp9CodecSettings::new().set_width_pixels(42);
6886        /// ```
6887        pub fn set_width_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6888            self.width_pixels = v.into();
6889            self
6890        }
6891
6892        /// Sets the value of [height_pixels][crate::model::video_stream::Vp9CodecSettings::height_pixels].
6893        ///
6894        /// # Example
6895        /// ```ignore,no_run
6896        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
6897        /// let x = Vp9CodecSettings::new().set_height_pixels(42);
6898        /// ```
6899        pub fn set_height_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6900            self.height_pixels = v.into();
6901            self
6902        }
6903
6904        /// Sets the value of [frame_rate][crate::model::video_stream::Vp9CodecSettings::frame_rate].
6905        ///
6906        /// # Example
6907        /// ```ignore,no_run
6908        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
6909        /// let x = Vp9CodecSettings::new().set_frame_rate(42.0);
6910        /// ```
6911        pub fn set_frame_rate<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
6912            self.frame_rate = v.into();
6913            self
6914        }
6915
6916        /// Sets the value of [frame_rate_conversion_strategy][crate::model::video_stream::Vp9CodecSettings::frame_rate_conversion_strategy].
6917        ///
6918        /// # Example
6919        /// ```ignore,no_run
6920        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
6921        /// use google_cloud_video_transcoder_v1::model::video_stream::FrameRateConversionStrategy;
6922        /// let x0 = Vp9CodecSettings::new().set_frame_rate_conversion_strategy(FrameRateConversionStrategy::Downsample);
6923        /// let x1 = Vp9CodecSettings::new().set_frame_rate_conversion_strategy(FrameRateConversionStrategy::DropDuplicate);
6924        /// ```
6925        pub fn set_frame_rate_conversion_strategy<
6926            T: std::convert::Into<crate::model::video_stream::FrameRateConversionStrategy>,
6927        >(
6928            mut self,
6929            v: T,
6930        ) -> Self {
6931            self.frame_rate_conversion_strategy = v.into();
6932            self
6933        }
6934
6935        /// Sets the value of [bitrate_bps][crate::model::video_stream::Vp9CodecSettings::bitrate_bps].
6936        ///
6937        /// # Example
6938        /// ```ignore,no_run
6939        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
6940        /// let x = Vp9CodecSettings::new().set_bitrate_bps(42);
6941        /// ```
6942        pub fn set_bitrate_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6943            self.bitrate_bps = v.into();
6944            self
6945        }
6946
6947        /// Sets the value of [pixel_format][crate::model::video_stream::Vp9CodecSettings::pixel_format].
6948        ///
6949        /// # Example
6950        /// ```ignore,no_run
6951        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
6952        /// let x = Vp9CodecSettings::new().set_pixel_format("example");
6953        /// ```
6954        pub fn set_pixel_format<T: std::convert::Into<std::string::String>>(
6955            mut self,
6956            v: T,
6957        ) -> Self {
6958            self.pixel_format = v.into();
6959            self
6960        }
6961
6962        /// Sets the value of [rate_control_mode][crate::model::video_stream::Vp9CodecSettings::rate_control_mode].
6963        ///
6964        /// # Example
6965        /// ```ignore,no_run
6966        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
6967        /// let x = Vp9CodecSettings::new().set_rate_control_mode("example");
6968        /// ```
6969        pub fn set_rate_control_mode<T: std::convert::Into<std::string::String>>(
6970            mut self,
6971            v: T,
6972        ) -> Self {
6973            self.rate_control_mode = v.into();
6974            self
6975        }
6976
6977        /// Sets the value of [crf_level][crate::model::video_stream::Vp9CodecSettings::crf_level].
6978        ///
6979        /// # Example
6980        /// ```ignore,no_run
6981        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
6982        /// let x = Vp9CodecSettings::new().set_crf_level(42);
6983        /// ```
6984        pub fn set_crf_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6985            self.crf_level = v.into();
6986            self
6987        }
6988
6989        /// Sets the value of [profile][crate::model::video_stream::Vp9CodecSettings::profile].
6990        ///
6991        /// # Example
6992        /// ```ignore,no_run
6993        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
6994        /// let x = Vp9CodecSettings::new().set_profile("example");
6995        /// ```
6996        pub fn set_profile<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6997            self.profile = v.into();
6998            self
6999        }
7000
7001        /// Sets the value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode].
7002        ///
7003        /// Note that all the setters affecting `gop_mode` are mutually
7004        /// exclusive.
7005        ///
7006        /// # Example
7007        /// ```ignore,no_run
7008        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
7009        /// use google_cloud_video_transcoder_v1::model::video_stream::vp_9_codec_settings::GopMode;
7010        /// let x = Vp9CodecSettings::new().set_gop_mode(Some(GopMode::GopFrameCount(42)));
7011        /// ```
7012        pub fn set_gop_mode<
7013            T: std::convert::Into<
7014                    std::option::Option<crate::model::video_stream::vp_9_codec_settings::GopMode>,
7015                >,
7016        >(
7017            mut self,
7018            v: T,
7019        ) -> Self {
7020            self.gop_mode = v.into();
7021            self
7022        }
7023
7024        /// The value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode]
7025        /// if it holds a `GopFrameCount`, `None` if the field is not set or
7026        /// holds a different branch.
7027        pub fn gop_frame_count(&self) -> std::option::Option<&i32> {
7028            #[allow(unreachable_patterns)]
7029            self.gop_mode.as_ref().and_then(|v| match v {
7030                crate::model::video_stream::vp_9_codec_settings::GopMode::GopFrameCount(v) => {
7031                    std::option::Option::Some(v)
7032                }
7033                _ => std::option::Option::None,
7034            })
7035        }
7036
7037        /// Sets the value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode]
7038        /// to hold a `GopFrameCount`.
7039        ///
7040        /// Note that all the setters affecting `gop_mode` are
7041        /// mutually exclusive.
7042        ///
7043        /// # Example
7044        /// ```ignore,no_run
7045        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
7046        /// let x = Vp9CodecSettings::new().set_gop_frame_count(42);
7047        /// assert!(x.gop_frame_count().is_some());
7048        /// assert!(x.gop_duration().is_none());
7049        /// ```
7050        pub fn set_gop_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7051            self.gop_mode = std::option::Option::Some(
7052                crate::model::video_stream::vp_9_codec_settings::GopMode::GopFrameCount(v.into()),
7053            );
7054            self
7055        }
7056
7057        /// The value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode]
7058        /// if it holds a `GopDuration`, `None` if the field is not set or
7059        /// holds a different branch.
7060        pub fn gop_duration(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
7061            #[allow(unreachable_patterns)]
7062            self.gop_mode.as_ref().and_then(|v| match v {
7063                crate::model::video_stream::vp_9_codec_settings::GopMode::GopDuration(v) => {
7064                    std::option::Option::Some(v)
7065                }
7066                _ => std::option::Option::None,
7067            })
7068        }
7069
7070        /// Sets the value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode]
7071        /// to hold a `GopDuration`.
7072        ///
7073        /// Note that all the setters affecting `gop_mode` are
7074        /// mutually exclusive.
7075        ///
7076        /// # Example
7077        /// ```ignore,no_run
7078        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
7079        /// use wkt::Duration;
7080        /// let x = Vp9CodecSettings::new().set_gop_duration(Duration::default()/* use setters */);
7081        /// assert!(x.gop_duration().is_some());
7082        /// assert!(x.gop_frame_count().is_none());
7083        /// ```
7084        pub fn set_gop_duration<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
7085            mut self,
7086            v: T,
7087        ) -> Self {
7088            self.gop_mode = std::option::Option::Some(
7089                crate::model::video_stream::vp_9_codec_settings::GopMode::GopDuration(v.into()),
7090            );
7091            self
7092        }
7093
7094        /// Sets the value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format].
7095        ///
7096        /// Note that all the setters affecting `color_format` are mutually
7097        /// exclusive.
7098        ///
7099        /// # Example
7100        /// ```ignore,no_run
7101        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
7102        /// use google_cloud_video_transcoder_v1::model::video_stream::Vp9ColorFormatSDR;
7103        /// let x = Vp9CodecSettings::new().set_color_format(Some(
7104        ///     google_cloud_video_transcoder_v1::model::video_stream::vp_9_codec_settings::ColorFormat::Sdr(Vp9ColorFormatSDR::default().into())));
7105        /// ```
7106        pub fn set_color_format<
7107            T: std::convert::Into<
7108                    std::option::Option<
7109                        crate::model::video_stream::vp_9_codec_settings::ColorFormat,
7110                    >,
7111                >,
7112        >(
7113            mut self,
7114            v: T,
7115        ) -> Self {
7116            self.color_format = v.into();
7117            self
7118        }
7119
7120        /// The value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format]
7121        /// if it holds a `Sdr`, `None` if the field is not set or
7122        /// holds a different branch.
7123        pub fn sdr(
7124            &self,
7125        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::Vp9ColorFormatSDR>>
7126        {
7127            #[allow(unreachable_patterns)]
7128            self.color_format.as_ref().and_then(|v| match v {
7129                crate::model::video_stream::vp_9_codec_settings::ColorFormat::Sdr(v) => {
7130                    std::option::Option::Some(v)
7131                }
7132                _ => std::option::Option::None,
7133            })
7134        }
7135
7136        /// Sets the value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format]
7137        /// to hold a `Sdr`.
7138        ///
7139        /// Note that all the setters affecting `color_format` are
7140        /// mutually exclusive.
7141        ///
7142        /// # Example
7143        /// ```ignore,no_run
7144        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
7145        /// use google_cloud_video_transcoder_v1::model::video_stream::Vp9ColorFormatSDR;
7146        /// let x = Vp9CodecSettings::new().set_sdr(Vp9ColorFormatSDR::default()/* use setters */);
7147        /// assert!(x.sdr().is_some());
7148        /// assert!(x.hlg().is_none());
7149        /// ```
7150        pub fn set_sdr<
7151            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::Vp9ColorFormatSDR>>,
7152        >(
7153            mut self,
7154            v: T,
7155        ) -> Self {
7156            self.color_format = std::option::Option::Some(
7157                crate::model::video_stream::vp_9_codec_settings::ColorFormat::Sdr(v.into()),
7158            );
7159            self
7160        }
7161
7162        /// The value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format]
7163        /// if it holds a `Hlg`, `None` if the field is not set or
7164        /// holds a different branch.
7165        pub fn hlg(
7166            &self,
7167        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::Vp9ColorFormatHLG>>
7168        {
7169            #[allow(unreachable_patterns)]
7170            self.color_format.as_ref().and_then(|v| match v {
7171                crate::model::video_stream::vp_9_codec_settings::ColorFormat::Hlg(v) => {
7172                    std::option::Option::Some(v)
7173                }
7174                _ => std::option::Option::None,
7175            })
7176        }
7177
7178        /// Sets the value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format]
7179        /// to hold a `Hlg`.
7180        ///
7181        /// Note that all the setters affecting `color_format` are
7182        /// mutually exclusive.
7183        ///
7184        /// # Example
7185        /// ```ignore,no_run
7186        /// # use google_cloud_video_transcoder_v1::model::video_stream::Vp9CodecSettings;
7187        /// use google_cloud_video_transcoder_v1::model::video_stream::Vp9ColorFormatHLG;
7188        /// let x = Vp9CodecSettings::new().set_hlg(Vp9ColorFormatHLG::default()/* use setters */);
7189        /// assert!(x.hlg().is_some());
7190        /// assert!(x.sdr().is_none());
7191        /// ```
7192        pub fn set_hlg<
7193            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::Vp9ColorFormatHLG>>,
7194        >(
7195            mut self,
7196            v: T,
7197        ) -> Self {
7198            self.color_format = std::option::Option::Some(
7199                crate::model::video_stream::vp_9_codec_settings::ColorFormat::Hlg(v.into()),
7200            );
7201            self
7202        }
7203    }
7204
7205    impl wkt::message::Message for Vp9CodecSettings {
7206        fn typename() -> &'static str {
7207            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings"
7208        }
7209    }
7210
7211    /// Defines additional types related to [Vp9CodecSettings].
7212    pub mod vp_9_codec_settings {
7213        #[allow(unused_imports)]
7214        use super::*;
7215
7216        /// GOP mode can be either by frame count or duration.
7217        #[derive(Clone, Debug, PartialEq)]
7218        #[non_exhaustive]
7219        pub enum GopMode {
7220            /// Select the GOP size based on the specified frame count. Must be greater
7221            /// than zero.
7222            GopFrameCount(i32),
7223            /// Select the GOP size based on the specified duration. The default is
7224            /// `3s`. Note that `gopDuration` must be less than or equal to
7225            /// [`segmentDuration`](#SegmentSettings), and
7226            /// [`segmentDuration`](#SegmentSettings) must be divisible by
7227            /// `gopDuration`.
7228            GopDuration(std::boxed::Box<wkt::Duration>),
7229        }
7230
7231        /// Color format can be sdr or hlg.
7232        #[derive(Clone, Debug, PartialEq)]
7233        #[non_exhaustive]
7234        pub enum ColorFormat {
7235            /// Optional. SDR color format setting for VP9.
7236            Sdr(std::boxed::Box<crate::model::video_stream::Vp9ColorFormatSDR>),
7237            /// Optional. HLG color format setting for VP9.
7238            Hlg(std::boxed::Box<crate::model::video_stream::Vp9ColorFormatHLG>),
7239        }
7240    }
7241
7242    /// The conversion strategy for desired frame rate.
7243    ///
7244    /// # Working with unknown values
7245    ///
7246    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7247    /// additional enum variants at any time. Adding new variants is not considered
7248    /// a breaking change. Applications should write their code in anticipation of:
7249    ///
7250    /// - New values appearing in future releases of the client library, **and**
7251    /// - New values received dynamically, without application changes.
7252    ///
7253    /// Please consult the [Working with enums] section in the user guide for some
7254    /// guidelines.
7255    ///
7256    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7257    #[derive(Clone, Debug, PartialEq)]
7258    #[non_exhaustive]
7259    pub enum FrameRateConversionStrategy {
7260        /// Unspecified frame rate conversion strategy.
7261        Unspecified,
7262        /// Selectively retain frames to reduce the output frame rate.
7263        /// Every _n_ th frame is kept, where `n = ceil(input frame rate / target
7264        /// frame rate)`. When _n_ = 1 (that is, the target frame rate is greater
7265        /// than the input frame rate), the output frame rate matches the input frame
7266        /// rate. When _n_ > 1, frames are dropped and the output frame rate is
7267        /// equal to `(input frame rate / n)`. For more information, see
7268        /// [Calculate frame
7269        /// rate](https://cloud.google.com/transcoder/docs/concepts/frame-rate).
7270        Downsample,
7271        /// Drop or duplicate frames to match the specified frame rate.
7272        DropDuplicate,
7273        /// If set, the enum was initialized with an unknown value.
7274        ///
7275        /// Applications can examine the value using [FrameRateConversionStrategy::value] or
7276        /// [FrameRateConversionStrategy::name].
7277        UnknownValue(frame_rate_conversion_strategy::UnknownValue),
7278    }
7279
7280    #[doc(hidden)]
7281    pub mod frame_rate_conversion_strategy {
7282        #[allow(unused_imports)]
7283        use super::*;
7284        #[derive(Clone, Debug, PartialEq)]
7285        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7286    }
7287
7288    impl FrameRateConversionStrategy {
7289        /// Gets the enum value.
7290        ///
7291        /// Returns `None` if the enum contains an unknown value deserialized from
7292        /// the string representation of enums.
7293        pub fn value(&self) -> std::option::Option<i32> {
7294            match self {
7295                Self::Unspecified => std::option::Option::Some(0),
7296                Self::Downsample => std::option::Option::Some(1),
7297                Self::DropDuplicate => std::option::Option::Some(2),
7298                Self::UnknownValue(u) => u.0.value(),
7299            }
7300        }
7301
7302        /// Gets the enum value as a string.
7303        ///
7304        /// Returns `None` if the enum contains an unknown value deserialized from
7305        /// the integer representation of enums.
7306        pub fn name(&self) -> std::option::Option<&str> {
7307            match self {
7308                Self::Unspecified => {
7309                    std::option::Option::Some("FRAME_RATE_CONVERSION_STRATEGY_UNSPECIFIED")
7310                }
7311                Self::Downsample => std::option::Option::Some("DOWNSAMPLE"),
7312                Self::DropDuplicate => std::option::Option::Some("DROP_DUPLICATE"),
7313                Self::UnknownValue(u) => u.0.name(),
7314            }
7315        }
7316    }
7317
7318    impl std::default::Default for FrameRateConversionStrategy {
7319        fn default() -> Self {
7320            use std::convert::From;
7321            Self::from(0)
7322        }
7323    }
7324
7325    impl std::fmt::Display for FrameRateConversionStrategy {
7326        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7327            wkt::internal::display_enum(f, self.name(), self.value())
7328        }
7329    }
7330
7331    impl std::convert::From<i32> for FrameRateConversionStrategy {
7332        fn from(value: i32) -> Self {
7333            match value {
7334                0 => Self::Unspecified,
7335                1 => Self::Downsample,
7336                2 => Self::DropDuplicate,
7337                _ => Self::UnknownValue(frame_rate_conversion_strategy::UnknownValue(
7338                    wkt::internal::UnknownEnumValue::Integer(value),
7339                )),
7340            }
7341        }
7342    }
7343
7344    impl std::convert::From<&str> for FrameRateConversionStrategy {
7345        fn from(value: &str) -> Self {
7346            use std::string::ToString;
7347            match value {
7348                "FRAME_RATE_CONVERSION_STRATEGY_UNSPECIFIED" => Self::Unspecified,
7349                "DOWNSAMPLE" => Self::Downsample,
7350                "DROP_DUPLICATE" => Self::DropDuplicate,
7351                _ => Self::UnknownValue(frame_rate_conversion_strategy::UnknownValue(
7352                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7353                )),
7354            }
7355        }
7356    }
7357
7358    impl serde::ser::Serialize for FrameRateConversionStrategy {
7359        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7360        where
7361            S: serde::Serializer,
7362        {
7363            match self {
7364                Self::Unspecified => serializer.serialize_i32(0),
7365                Self::Downsample => serializer.serialize_i32(1),
7366                Self::DropDuplicate => serializer.serialize_i32(2),
7367                Self::UnknownValue(u) => u.0.serialize(serializer),
7368            }
7369        }
7370    }
7371
7372    impl<'de> serde::de::Deserialize<'de> for FrameRateConversionStrategy {
7373        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7374        where
7375            D: serde::Deserializer<'de>,
7376        {
7377            deserializer.deserialize_any(
7378                wkt::internal::EnumVisitor::<FrameRateConversionStrategy>::new(
7379                    ".google.cloud.video.transcoder.v1.VideoStream.FrameRateConversionStrategy",
7380                ),
7381            )
7382        }
7383    }
7384
7385    /// Codec settings can be h264, h265, or vp9.
7386    #[derive(Clone, Debug, PartialEq)]
7387    #[non_exhaustive]
7388    pub enum CodecSettings {
7389        /// H264 codec settings.
7390        H264(std::boxed::Box<crate::model::video_stream::H264CodecSettings>),
7391        /// H265 codec settings.
7392        H265(std::boxed::Box<crate::model::video_stream::H265CodecSettings>),
7393        /// VP9 codec settings.
7394        Vp9(std::boxed::Box<crate::model::video_stream::Vp9CodecSettings>),
7395    }
7396}
7397
7398/// Audio stream resource.
7399#[derive(Clone, Default, PartialEq)]
7400#[non_exhaustive]
7401pub struct AudioStream {
7402    /// The codec for this audio stream. The default is `aac`.
7403    ///
7404    /// Supported audio codecs:
7405    ///
7406    /// - `aac`
7407    /// - `aac-he`
7408    /// - `aac-he-v2`
7409    /// - `mp3`
7410    /// - `ac3`
7411    /// - `eac3`
7412    /// - `vorbis`
7413    pub codec: std::string::String,
7414
7415    /// Required. Audio bitrate in bits per second. Must be between 1 and
7416    /// 10,000,000.
7417    pub bitrate_bps: i32,
7418
7419    /// Number of audio channels. Must be between 1 and 6. The default is 2.
7420    pub channel_count: i32,
7421
7422    /// A list of channel names specifying layout of the audio channels.
7423    /// This only affects the metadata embedded in the container headers, if
7424    /// supported by the specified format. The default is `["fl", "fr"]`.
7425    ///
7426    /// Supported channel names:
7427    ///
7428    /// - `fl` - Front left channel
7429    /// - `fr` - Front right channel
7430    /// - `sl` - Side left channel
7431    /// - `sr` - Side right channel
7432    /// - `fc` - Front center channel
7433    /// - `lfe` - Low frequency
7434    pub channel_layout: std::vec::Vec<std::string::String>,
7435
7436    /// The mapping for the
7437    /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list]
7438    /// atoms with audio
7439    /// [EditAtom.inputs][google.cloud.video.transcoder.v1.EditAtom.inputs].
7440    ///
7441    /// [google.cloud.video.transcoder.v1.EditAtom.inputs]: crate::model::EditAtom::inputs
7442    /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
7443    pub mapping: std::vec::Vec<crate::model::audio_stream::AudioMapping>,
7444
7445    /// The audio sample rate in Hertz. The default is 48000 Hertz.
7446    pub sample_rate_hertz: i32,
7447
7448    /// The BCP-47 language code, such as `en-US` or `sr-Latn`. For more
7449    /// information, see
7450    /// <https://www.unicode.org/reports/tr35/#Unicode_locale_identifier>. Not
7451    /// supported in MP4 files.
7452    pub language_code: std::string::String,
7453
7454    /// The name for this particular audio stream that
7455    /// will be added to the HLS/DASH manifest. Not supported in MP4 files.
7456    pub display_name: std::string::String,
7457
7458    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7459}
7460
7461impl AudioStream {
7462    /// Creates a new default instance.
7463    pub fn new() -> Self {
7464        std::default::Default::default()
7465    }
7466
7467    /// Sets the value of [codec][crate::model::AudioStream::codec].
7468    ///
7469    /// # Example
7470    /// ```ignore,no_run
7471    /// # use google_cloud_video_transcoder_v1::model::AudioStream;
7472    /// let x = AudioStream::new().set_codec("example");
7473    /// ```
7474    pub fn set_codec<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7475        self.codec = v.into();
7476        self
7477    }
7478
7479    /// Sets the value of [bitrate_bps][crate::model::AudioStream::bitrate_bps].
7480    ///
7481    /// # Example
7482    /// ```ignore,no_run
7483    /// # use google_cloud_video_transcoder_v1::model::AudioStream;
7484    /// let x = AudioStream::new().set_bitrate_bps(42);
7485    /// ```
7486    pub fn set_bitrate_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7487        self.bitrate_bps = v.into();
7488        self
7489    }
7490
7491    /// Sets the value of [channel_count][crate::model::AudioStream::channel_count].
7492    ///
7493    /// # Example
7494    /// ```ignore,no_run
7495    /// # use google_cloud_video_transcoder_v1::model::AudioStream;
7496    /// let x = AudioStream::new().set_channel_count(42);
7497    /// ```
7498    pub fn set_channel_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7499        self.channel_count = v.into();
7500        self
7501    }
7502
7503    /// Sets the value of [channel_layout][crate::model::AudioStream::channel_layout].
7504    ///
7505    /// # Example
7506    /// ```ignore,no_run
7507    /// # use google_cloud_video_transcoder_v1::model::AudioStream;
7508    /// let x = AudioStream::new().set_channel_layout(["a", "b", "c"]);
7509    /// ```
7510    pub fn set_channel_layout<T, V>(mut self, v: T) -> Self
7511    where
7512        T: std::iter::IntoIterator<Item = V>,
7513        V: std::convert::Into<std::string::String>,
7514    {
7515        use std::iter::Iterator;
7516        self.channel_layout = v.into_iter().map(|i| i.into()).collect();
7517        self
7518    }
7519
7520    /// Sets the value of [mapping][crate::model::AudioStream::mapping].
7521    ///
7522    /// # Example
7523    /// ```ignore,no_run
7524    /// # use google_cloud_video_transcoder_v1::model::AudioStream;
7525    /// use google_cloud_video_transcoder_v1::model::audio_stream::AudioMapping;
7526    /// let x = AudioStream::new()
7527    ///     .set_mapping([
7528    ///         AudioMapping::default()/* use setters */,
7529    ///         AudioMapping::default()/* use (different) setters */,
7530    ///     ]);
7531    /// ```
7532    pub fn set_mapping<T, V>(mut self, v: T) -> Self
7533    where
7534        T: std::iter::IntoIterator<Item = V>,
7535        V: std::convert::Into<crate::model::audio_stream::AudioMapping>,
7536    {
7537        use std::iter::Iterator;
7538        self.mapping = v.into_iter().map(|i| i.into()).collect();
7539        self
7540    }
7541
7542    /// Sets the value of [sample_rate_hertz][crate::model::AudioStream::sample_rate_hertz].
7543    ///
7544    /// # Example
7545    /// ```ignore,no_run
7546    /// # use google_cloud_video_transcoder_v1::model::AudioStream;
7547    /// let x = AudioStream::new().set_sample_rate_hertz(42);
7548    /// ```
7549    pub fn set_sample_rate_hertz<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7550        self.sample_rate_hertz = v.into();
7551        self
7552    }
7553
7554    /// Sets the value of [language_code][crate::model::AudioStream::language_code].
7555    ///
7556    /// # Example
7557    /// ```ignore,no_run
7558    /// # use google_cloud_video_transcoder_v1::model::AudioStream;
7559    /// let x = AudioStream::new().set_language_code("example");
7560    /// ```
7561    pub fn set_language_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7562        self.language_code = v.into();
7563        self
7564    }
7565
7566    /// Sets the value of [display_name][crate::model::AudioStream::display_name].
7567    ///
7568    /// # Example
7569    /// ```ignore,no_run
7570    /// # use google_cloud_video_transcoder_v1::model::AudioStream;
7571    /// let x = AudioStream::new().set_display_name("example");
7572    /// ```
7573    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7574        self.display_name = v.into();
7575        self
7576    }
7577}
7578
7579impl wkt::message::Message for AudioStream {
7580    fn typename() -> &'static str {
7581        "type.googleapis.com/google.cloud.video.transcoder.v1.AudioStream"
7582    }
7583}
7584
7585/// Defines additional types related to [AudioStream].
7586pub mod audio_stream {
7587    #[allow(unused_imports)]
7588    use super::*;
7589
7590    /// The mapping for the
7591    /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list]
7592    /// atoms with audio
7593    /// [EditAtom.inputs][google.cloud.video.transcoder.v1.EditAtom.inputs].
7594    ///
7595    /// [google.cloud.video.transcoder.v1.EditAtom.inputs]: crate::model::EditAtom::inputs
7596    /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
7597    #[derive(Clone, Default, PartialEq)]
7598    #[non_exhaustive]
7599    pub struct AudioMapping {
7600        /// Required. The
7601        /// [EditAtom.key][google.cloud.video.transcoder.v1.EditAtom.key] that
7602        /// references the atom with audio inputs in the
7603        /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list].
7604        ///
7605        /// [google.cloud.video.transcoder.v1.EditAtom.key]: crate::model::EditAtom::key
7606        /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
7607        pub atom_key: std::string::String,
7608
7609        /// Required. The [Input.key][google.cloud.video.transcoder.v1.Input.key]
7610        /// that identifies the input file.
7611        ///
7612        /// [google.cloud.video.transcoder.v1.Input.key]: crate::model::Input::key
7613        pub input_key: std::string::String,
7614
7615        /// Required. The zero-based index of the track in the input file.
7616        pub input_track: i32,
7617
7618        /// Required. The zero-based index of the channel in the input audio stream.
7619        pub input_channel: i32,
7620
7621        /// Required. The zero-based index of the channel in the output audio stream.
7622        pub output_channel: i32,
7623
7624        /// Audio volume control in dB. Negative values decrease volume,
7625        /// positive values increase. The default is 0.
7626        pub gain_db: f64,
7627
7628        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7629    }
7630
7631    impl AudioMapping {
7632        /// Creates a new default instance.
7633        pub fn new() -> Self {
7634            std::default::Default::default()
7635        }
7636
7637        /// Sets the value of [atom_key][crate::model::audio_stream::AudioMapping::atom_key].
7638        ///
7639        /// # Example
7640        /// ```ignore,no_run
7641        /// # use google_cloud_video_transcoder_v1::model::audio_stream::AudioMapping;
7642        /// let x = AudioMapping::new().set_atom_key("example");
7643        /// ```
7644        pub fn set_atom_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7645            self.atom_key = v.into();
7646            self
7647        }
7648
7649        /// Sets the value of [input_key][crate::model::audio_stream::AudioMapping::input_key].
7650        ///
7651        /// # Example
7652        /// ```ignore,no_run
7653        /// # use google_cloud_video_transcoder_v1::model::audio_stream::AudioMapping;
7654        /// let x = AudioMapping::new().set_input_key("example");
7655        /// ```
7656        pub fn set_input_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7657            self.input_key = v.into();
7658            self
7659        }
7660
7661        /// Sets the value of [input_track][crate::model::audio_stream::AudioMapping::input_track].
7662        ///
7663        /// # Example
7664        /// ```ignore,no_run
7665        /// # use google_cloud_video_transcoder_v1::model::audio_stream::AudioMapping;
7666        /// let x = AudioMapping::new().set_input_track(42);
7667        /// ```
7668        pub fn set_input_track<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7669            self.input_track = v.into();
7670            self
7671        }
7672
7673        /// Sets the value of [input_channel][crate::model::audio_stream::AudioMapping::input_channel].
7674        ///
7675        /// # Example
7676        /// ```ignore,no_run
7677        /// # use google_cloud_video_transcoder_v1::model::audio_stream::AudioMapping;
7678        /// let x = AudioMapping::new().set_input_channel(42);
7679        /// ```
7680        pub fn set_input_channel<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7681            self.input_channel = v.into();
7682            self
7683        }
7684
7685        /// Sets the value of [output_channel][crate::model::audio_stream::AudioMapping::output_channel].
7686        ///
7687        /// # Example
7688        /// ```ignore,no_run
7689        /// # use google_cloud_video_transcoder_v1::model::audio_stream::AudioMapping;
7690        /// let x = AudioMapping::new().set_output_channel(42);
7691        /// ```
7692        pub fn set_output_channel<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7693            self.output_channel = v.into();
7694            self
7695        }
7696
7697        /// Sets the value of [gain_db][crate::model::audio_stream::AudioMapping::gain_db].
7698        ///
7699        /// # Example
7700        /// ```ignore,no_run
7701        /// # use google_cloud_video_transcoder_v1::model::audio_stream::AudioMapping;
7702        /// let x = AudioMapping::new().set_gain_db(42.0);
7703        /// ```
7704        pub fn set_gain_db<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
7705            self.gain_db = v.into();
7706            self
7707        }
7708    }
7709
7710    impl wkt::message::Message for AudioMapping {
7711        fn typename() -> &'static str {
7712            "type.googleapis.com/google.cloud.video.transcoder.v1.AudioStream.AudioMapping"
7713        }
7714    }
7715}
7716
7717/// Encoding of a text stream. For example, closed captions or subtitles.
7718#[derive(Clone, Default, PartialEq)]
7719#[non_exhaustive]
7720pub struct TextStream {
7721    /// The codec for this text stream. The default is `webvtt`.
7722    ///
7723    /// Supported text codecs:
7724    ///
7725    /// - `srt`
7726    /// - `ttml`
7727    /// - `cea608`
7728    /// - `cea708`
7729    /// - `webvtt`
7730    pub codec: std::string::String,
7731
7732    /// The BCP-47 language code, such as `en-US` or `sr-Latn`. For more
7733    /// information, see
7734    /// <https://www.unicode.org/reports/tr35/#Unicode_locale_identifier>. Not
7735    /// supported in MP4 files.
7736    pub language_code: std::string::String,
7737
7738    /// The mapping for the
7739    /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list]
7740    /// atoms with text
7741    /// [EditAtom.inputs][google.cloud.video.transcoder.v1.EditAtom.inputs].
7742    ///
7743    /// [google.cloud.video.transcoder.v1.EditAtom.inputs]: crate::model::EditAtom::inputs
7744    /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
7745    pub mapping: std::vec::Vec<crate::model::text_stream::TextMapping>,
7746
7747    /// The name for this particular text stream that
7748    /// will be added to the HLS/DASH manifest. Not supported in MP4 files.
7749    pub display_name: std::string::String,
7750
7751    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7752}
7753
7754impl TextStream {
7755    /// Creates a new default instance.
7756    pub fn new() -> Self {
7757        std::default::Default::default()
7758    }
7759
7760    /// Sets the value of [codec][crate::model::TextStream::codec].
7761    ///
7762    /// # Example
7763    /// ```ignore,no_run
7764    /// # use google_cloud_video_transcoder_v1::model::TextStream;
7765    /// let x = TextStream::new().set_codec("example");
7766    /// ```
7767    pub fn set_codec<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7768        self.codec = v.into();
7769        self
7770    }
7771
7772    /// Sets the value of [language_code][crate::model::TextStream::language_code].
7773    ///
7774    /// # Example
7775    /// ```ignore,no_run
7776    /// # use google_cloud_video_transcoder_v1::model::TextStream;
7777    /// let x = TextStream::new().set_language_code("example");
7778    /// ```
7779    pub fn set_language_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7780        self.language_code = v.into();
7781        self
7782    }
7783
7784    /// Sets the value of [mapping][crate::model::TextStream::mapping].
7785    ///
7786    /// # Example
7787    /// ```ignore,no_run
7788    /// # use google_cloud_video_transcoder_v1::model::TextStream;
7789    /// use google_cloud_video_transcoder_v1::model::text_stream::TextMapping;
7790    /// let x = TextStream::new()
7791    ///     .set_mapping([
7792    ///         TextMapping::default()/* use setters */,
7793    ///         TextMapping::default()/* use (different) setters */,
7794    ///     ]);
7795    /// ```
7796    pub fn set_mapping<T, V>(mut self, v: T) -> Self
7797    where
7798        T: std::iter::IntoIterator<Item = V>,
7799        V: std::convert::Into<crate::model::text_stream::TextMapping>,
7800    {
7801        use std::iter::Iterator;
7802        self.mapping = v.into_iter().map(|i| i.into()).collect();
7803        self
7804    }
7805
7806    /// Sets the value of [display_name][crate::model::TextStream::display_name].
7807    ///
7808    /// # Example
7809    /// ```ignore,no_run
7810    /// # use google_cloud_video_transcoder_v1::model::TextStream;
7811    /// let x = TextStream::new().set_display_name("example");
7812    /// ```
7813    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7814        self.display_name = v.into();
7815        self
7816    }
7817}
7818
7819impl wkt::message::Message for TextStream {
7820    fn typename() -> &'static str {
7821        "type.googleapis.com/google.cloud.video.transcoder.v1.TextStream"
7822    }
7823}
7824
7825/// Defines additional types related to [TextStream].
7826pub mod text_stream {
7827    #[allow(unused_imports)]
7828    use super::*;
7829
7830    /// The mapping for the
7831    /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list]
7832    /// atoms with text
7833    /// [EditAtom.inputs][google.cloud.video.transcoder.v1.EditAtom.inputs].
7834    ///
7835    /// [google.cloud.video.transcoder.v1.EditAtom.inputs]: crate::model::EditAtom::inputs
7836    /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
7837    #[derive(Clone, Default, PartialEq)]
7838    #[non_exhaustive]
7839    pub struct TextMapping {
7840        /// Required. The
7841        /// [EditAtom.key][google.cloud.video.transcoder.v1.EditAtom.key] that
7842        /// references atom with text inputs in the
7843        /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list].
7844        ///
7845        /// [google.cloud.video.transcoder.v1.EditAtom.key]: crate::model::EditAtom::key
7846        /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
7847        pub atom_key: std::string::String,
7848
7849        /// Required. The [Input.key][google.cloud.video.transcoder.v1.Input.key]
7850        /// that identifies the input file.
7851        ///
7852        /// [google.cloud.video.transcoder.v1.Input.key]: crate::model::Input::key
7853        pub input_key: std::string::String,
7854
7855        /// Required. The zero-based index of the track in the input file.
7856        pub input_track: i32,
7857
7858        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7859    }
7860
7861    impl TextMapping {
7862        /// Creates a new default instance.
7863        pub fn new() -> Self {
7864            std::default::Default::default()
7865        }
7866
7867        /// Sets the value of [atom_key][crate::model::text_stream::TextMapping::atom_key].
7868        ///
7869        /// # Example
7870        /// ```ignore,no_run
7871        /// # use google_cloud_video_transcoder_v1::model::text_stream::TextMapping;
7872        /// let x = TextMapping::new().set_atom_key("example");
7873        /// ```
7874        pub fn set_atom_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7875            self.atom_key = v.into();
7876            self
7877        }
7878
7879        /// Sets the value of [input_key][crate::model::text_stream::TextMapping::input_key].
7880        ///
7881        /// # Example
7882        /// ```ignore,no_run
7883        /// # use google_cloud_video_transcoder_v1::model::text_stream::TextMapping;
7884        /// let x = TextMapping::new().set_input_key("example");
7885        /// ```
7886        pub fn set_input_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7887            self.input_key = v.into();
7888            self
7889        }
7890
7891        /// Sets the value of [input_track][crate::model::text_stream::TextMapping::input_track].
7892        ///
7893        /// # Example
7894        /// ```ignore,no_run
7895        /// # use google_cloud_video_transcoder_v1::model::text_stream::TextMapping;
7896        /// let x = TextMapping::new().set_input_track(42);
7897        /// ```
7898        pub fn set_input_track<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7899            self.input_track = v.into();
7900            self
7901        }
7902    }
7903
7904    impl wkt::message::Message for TextMapping {
7905        fn typename() -> &'static str {
7906            "type.googleapis.com/google.cloud.video.transcoder.v1.TextStream.TextMapping"
7907        }
7908    }
7909}
7910
7911/// Segment settings for `ts`, `fmp4` and `vtt`.
7912#[derive(Clone, Default, PartialEq)]
7913#[non_exhaustive]
7914pub struct SegmentSettings {
7915    /// Duration of the segments in seconds. The default is `6.0s`. Note that
7916    /// `segmentDuration` must be greater than or equal to
7917    /// [`gopDuration`](#videostream), and `segmentDuration` must be divisible by
7918    /// [`gopDuration`](#videostream).
7919    pub segment_duration: std::option::Option<wkt::Duration>,
7920
7921    /// Required. Create an individual segment file. The default is `false`.
7922    pub individual_segments: bool,
7923
7924    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7925}
7926
7927impl SegmentSettings {
7928    /// Creates a new default instance.
7929    pub fn new() -> Self {
7930        std::default::Default::default()
7931    }
7932
7933    /// Sets the value of [segment_duration][crate::model::SegmentSettings::segment_duration].
7934    ///
7935    /// # Example
7936    /// ```ignore,no_run
7937    /// # use google_cloud_video_transcoder_v1::model::SegmentSettings;
7938    /// use wkt::Duration;
7939    /// let x = SegmentSettings::new().set_segment_duration(Duration::default()/* use setters */);
7940    /// ```
7941    pub fn set_segment_duration<T>(mut self, v: T) -> Self
7942    where
7943        T: std::convert::Into<wkt::Duration>,
7944    {
7945        self.segment_duration = std::option::Option::Some(v.into());
7946        self
7947    }
7948
7949    /// Sets or clears the value of [segment_duration][crate::model::SegmentSettings::segment_duration].
7950    ///
7951    /// # Example
7952    /// ```ignore,no_run
7953    /// # use google_cloud_video_transcoder_v1::model::SegmentSettings;
7954    /// use wkt::Duration;
7955    /// let x = SegmentSettings::new().set_or_clear_segment_duration(Some(Duration::default()/* use setters */));
7956    /// let x = SegmentSettings::new().set_or_clear_segment_duration(None::<Duration>);
7957    /// ```
7958    pub fn set_or_clear_segment_duration<T>(mut self, v: std::option::Option<T>) -> Self
7959    where
7960        T: std::convert::Into<wkt::Duration>,
7961    {
7962        self.segment_duration = v.map(|x| x.into());
7963        self
7964    }
7965
7966    /// Sets the value of [individual_segments][crate::model::SegmentSettings::individual_segments].
7967    ///
7968    /// # Example
7969    /// ```ignore,no_run
7970    /// # use google_cloud_video_transcoder_v1::model::SegmentSettings;
7971    /// let x = SegmentSettings::new().set_individual_segments(true);
7972    /// ```
7973    pub fn set_individual_segments<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7974        self.individual_segments = v.into();
7975        self
7976    }
7977}
7978
7979impl wkt::message::Message for SegmentSettings {
7980    fn typename() -> &'static str {
7981        "type.googleapis.com/google.cloud.video.transcoder.v1.SegmentSettings"
7982    }
7983}
7984
7985/// Encryption settings.
7986#[derive(Clone, Default, PartialEq)]
7987#[non_exhaustive]
7988pub struct Encryption {
7989    /// Required. Identifier for this set of encryption options.
7990    pub id: std::string::String,
7991
7992    /// Required. DRM system(s) to use; at least one must be specified. If a
7993    /// DRM system is omitted, it is considered disabled.
7994    pub drm_systems: std::option::Option<crate::model::encryption::DrmSystems>,
7995
7996    /// Encryption mode can be either `aes` or `cenc`.
7997    pub encryption_mode: std::option::Option<crate::model::encryption::EncryptionMode>,
7998
7999    /// Defines where content keys are stored.
8000    pub secret_source: std::option::Option<crate::model::encryption::SecretSource>,
8001
8002    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8003}
8004
8005impl Encryption {
8006    /// Creates a new default instance.
8007    pub fn new() -> Self {
8008        std::default::Default::default()
8009    }
8010
8011    /// Sets the value of [id][crate::model::Encryption::id].
8012    ///
8013    /// # Example
8014    /// ```ignore,no_run
8015    /// # use google_cloud_video_transcoder_v1::model::Encryption;
8016    /// let x = Encryption::new().set_id("example");
8017    /// ```
8018    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8019        self.id = v.into();
8020        self
8021    }
8022
8023    /// Sets the value of [drm_systems][crate::model::Encryption::drm_systems].
8024    ///
8025    /// # Example
8026    /// ```ignore,no_run
8027    /// # use google_cloud_video_transcoder_v1::model::Encryption;
8028    /// use google_cloud_video_transcoder_v1::model::encryption::DrmSystems;
8029    /// let x = Encryption::new().set_drm_systems(DrmSystems::default()/* use setters */);
8030    /// ```
8031    pub fn set_drm_systems<T>(mut self, v: T) -> Self
8032    where
8033        T: std::convert::Into<crate::model::encryption::DrmSystems>,
8034    {
8035        self.drm_systems = std::option::Option::Some(v.into());
8036        self
8037    }
8038
8039    /// Sets or clears the value of [drm_systems][crate::model::Encryption::drm_systems].
8040    ///
8041    /// # Example
8042    /// ```ignore,no_run
8043    /// # use google_cloud_video_transcoder_v1::model::Encryption;
8044    /// use google_cloud_video_transcoder_v1::model::encryption::DrmSystems;
8045    /// let x = Encryption::new().set_or_clear_drm_systems(Some(DrmSystems::default()/* use setters */));
8046    /// let x = Encryption::new().set_or_clear_drm_systems(None::<DrmSystems>);
8047    /// ```
8048    pub fn set_or_clear_drm_systems<T>(mut self, v: std::option::Option<T>) -> Self
8049    where
8050        T: std::convert::Into<crate::model::encryption::DrmSystems>,
8051    {
8052        self.drm_systems = v.map(|x| x.into());
8053        self
8054    }
8055
8056    /// Sets the value of [encryption_mode][crate::model::Encryption::encryption_mode].
8057    ///
8058    /// Note that all the setters affecting `encryption_mode` are mutually
8059    /// exclusive.
8060    ///
8061    /// # Example
8062    /// ```ignore,no_run
8063    /// # use google_cloud_video_transcoder_v1::model::Encryption;
8064    /// use google_cloud_video_transcoder_v1::model::encryption::Aes128Encryption;
8065    /// let x = Encryption::new().set_encryption_mode(Some(
8066    ///     google_cloud_video_transcoder_v1::model::encryption::EncryptionMode::Aes128(Aes128Encryption::default().into())));
8067    /// ```
8068    pub fn set_encryption_mode<
8069        T: std::convert::Into<std::option::Option<crate::model::encryption::EncryptionMode>>,
8070    >(
8071        mut self,
8072        v: T,
8073    ) -> Self {
8074        self.encryption_mode = v.into();
8075        self
8076    }
8077
8078    /// The value of [encryption_mode][crate::model::Encryption::encryption_mode]
8079    /// if it holds a `Aes128`, `None` if the field is not set or
8080    /// holds a different branch.
8081    pub fn aes_128(
8082        &self,
8083    ) -> std::option::Option<&std::boxed::Box<crate::model::encryption::Aes128Encryption>> {
8084        #[allow(unreachable_patterns)]
8085        self.encryption_mode.as_ref().and_then(|v| match v {
8086            crate::model::encryption::EncryptionMode::Aes128(v) => std::option::Option::Some(v),
8087            _ => std::option::Option::None,
8088        })
8089    }
8090
8091    /// Sets the value of [encryption_mode][crate::model::Encryption::encryption_mode]
8092    /// to hold a `Aes128`.
8093    ///
8094    /// Note that all the setters affecting `encryption_mode` are
8095    /// mutually exclusive.
8096    ///
8097    /// # Example
8098    /// ```ignore,no_run
8099    /// # use google_cloud_video_transcoder_v1::model::Encryption;
8100    /// use google_cloud_video_transcoder_v1::model::encryption::Aes128Encryption;
8101    /// let x = Encryption::new().set_aes_128(Aes128Encryption::default()/* use setters */);
8102    /// assert!(x.aes_128().is_some());
8103    /// assert!(x.sample_aes().is_none());
8104    /// assert!(x.mpeg_cenc().is_none());
8105    /// ```
8106    pub fn set_aes_128<
8107        T: std::convert::Into<std::boxed::Box<crate::model::encryption::Aes128Encryption>>,
8108    >(
8109        mut self,
8110        v: T,
8111    ) -> Self {
8112        self.encryption_mode =
8113            std::option::Option::Some(crate::model::encryption::EncryptionMode::Aes128(v.into()));
8114        self
8115    }
8116
8117    /// The value of [encryption_mode][crate::model::Encryption::encryption_mode]
8118    /// if it holds a `SampleAes`, `None` if the field is not set or
8119    /// holds a different branch.
8120    pub fn sample_aes(
8121        &self,
8122    ) -> std::option::Option<&std::boxed::Box<crate::model::encryption::SampleAesEncryption>> {
8123        #[allow(unreachable_patterns)]
8124        self.encryption_mode.as_ref().and_then(|v| match v {
8125            crate::model::encryption::EncryptionMode::SampleAes(v) => std::option::Option::Some(v),
8126            _ => std::option::Option::None,
8127        })
8128    }
8129
8130    /// Sets the value of [encryption_mode][crate::model::Encryption::encryption_mode]
8131    /// to hold a `SampleAes`.
8132    ///
8133    /// Note that all the setters affecting `encryption_mode` are
8134    /// mutually exclusive.
8135    ///
8136    /// # Example
8137    /// ```ignore,no_run
8138    /// # use google_cloud_video_transcoder_v1::model::Encryption;
8139    /// use google_cloud_video_transcoder_v1::model::encryption::SampleAesEncryption;
8140    /// let x = Encryption::new().set_sample_aes(SampleAesEncryption::default()/* use setters */);
8141    /// assert!(x.sample_aes().is_some());
8142    /// assert!(x.aes_128().is_none());
8143    /// assert!(x.mpeg_cenc().is_none());
8144    /// ```
8145    pub fn set_sample_aes<
8146        T: std::convert::Into<std::boxed::Box<crate::model::encryption::SampleAesEncryption>>,
8147    >(
8148        mut self,
8149        v: T,
8150    ) -> Self {
8151        self.encryption_mode = std::option::Option::Some(
8152            crate::model::encryption::EncryptionMode::SampleAes(v.into()),
8153        );
8154        self
8155    }
8156
8157    /// The value of [encryption_mode][crate::model::Encryption::encryption_mode]
8158    /// if it holds a `MpegCenc`, `None` if the field is not set or
8159    /// holds a different branch.
8160    pub fn mpeg_cenc(
8161        &self,
8162    ) -> std::option::Option<&std::boxed::Box<crate::model::encryption::MpegCommonEncryption>> {
8163        #[allow(unreachable_patterns)]
8164        self.encryption_mode.as_ref().and_then(|v| match v {
8165            crate::model::encryption::EncryptionMode::MpegCenc(v) => std::option::Option::Some(v),
8166            _ => std::option::Option::None,
8167        })
8168    }
8169
8170    /// Sets the value of [encryption_mode][crate::model::Encryption::encryption_mode]
8171    /// to hold a `MpegCenc`.
8172    ///
8173    /// Note that all the setters affecting `encryption_mode` are
8174    /// mutually exclusive.
8175    ///
8176    /// # Example
8177    /// ```ignore,no_run
8178    /// # use google_cloud_video_transcoder_v1::model::Encryption;
8179    /// use google_cloud_video_transcoder_v1::model::encryption::MpegCommonEncryption;
8180    /// let x = Encryption::new().set_mpeg_cenc(MpegCommonEncryption::default()/* use setters */);
8181    /// assert!(x.mpeg_cenc().is_some());
8182    /// assert!(x.aes_128().is_none());
8183    /// assert!(x.sample_aes().is_none());
8184    /// ```
8185    pub fn set_mpeg_cenc<
8186        T: std::convert::Into<std::boxed::Box<crate::model::encryption::MpegCommonEncryption>>,
8187    >(
8188        mut self,
8189        v: T,
8190    ) -> Self {
8191        self.encryption_mode =
8192            std::option::Option::Some(crate::model::encryption::EncryptionMode::MpegCenc(v.into()));
8193        self
8194    }
8195
8196    /// Sets the value of [secret_source][crate::model::Encryption::secret_source].
8197    ///
8198    /// Note that all the setters affecting `secret_source` are mutually
8199    /// exclusive.
8200    ///
8201    /// # Example
8202    /// ```ignore,no_run
8203    /// # use google_cloud_video_transcoder_v1::model::Encryption;
8204    /// use google_cloud_video_transcoder_v1::model::encryption::SecretManagerSource;
8205    /// let x = Encryption::new().set_secret_source(Some(
8206    ///     google_cloud_video_transcoder_v1::model::encryption::SecretSource::SecretManagerKeySource(SecretManagerSource::default().into())));
8207    /// ```
8208    pub fn set_secret_source<
8209        T: std::convert::Into<std::option::Option<crate::model::encryption::SecretSource>>,
8210    >(
8211        mut self,
8212        v: T,
8213    ) -> Self {
8214        self.secret_source = v.into();
8215        self
8216    }
8217
8218    /// The value of [secret_source][crate::model::Encryption::secret_source]
8219    /// if it holds a `SecretManagerKeySource`, `None` if the field is not set or
8220    /// holds a different branch.
8221    pub fn secret_manager_key_source(
8222        &self,
8223    ) -> std::option::Option<&std::boxed::Box<crate::model::encryption::SecretManagerSource>> {
8224        #[allow(unreachable_patterns)]
8225        self.secret_source.as_ref().and_then(|v| match v {
8226            crate::model::encryption::SecretSource::SecretManagerKeySource(v) => {
8227                std::option::Option::Some(v)
8228            }
8229            _ => std::option::Option::None,
8230        })
8231    }
8232
8233    /// Sets the value of [secret_source][crate::model::Encryption::secret_source]
8234    /// to hold a `SecretManagerKeySource`.
8235    ///
8236    /// Note that all the setters affecting `secret_source` are
8237    /// mutually exclusive.
8238    ///
8239    /// # Example
8240    /// ```ignore,no_run
8241    /// # use google_cloud_video_transcoder_v1::model::Encryption;
8242    /// use google_cloud_video_transcoder_v1::model::encryption::SecretManagerSource;
8243    /// let x = Encryption::new().set_secret_manager_key_source(SecretManagerSource::default()/* use setters */);
8244    /// assert!(x.secret_manager_key_source().is_some());
8245    /// ```
8246    pub fn set_secret_manager_key_source<
8247        T: std::convert::Into<std::boxed::Box<crate::model::encryption::SecretManagerSource>>,
8248    >(
8249        mut self,
8250        v: T,
8251    ) -> Self {
8252        self.secret_source = std::option::Option::Some(
8253            crate::model::encryption::SecretSource::SecretManagerKeySource(v.into()),
8254        );
8255        self
8256    }
8257}
8258
8259impl wkt::message::Message for Encryption {
8260    fn typename() -> &'static str {
8261        "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption"
8262    }
8263}
8264
8265/// Defines additional types related to [Encryption].
8266pub mod encryption {
8267    #[allow(unused_imports)]
8268    use super::*;
8269
8270    /// Configuration for AES-128 encryption.
8271    #[derive(Clone, Default, PartialEq)]
8272    #[non_exhaustive]
8273    pub struct Aes128Encryption {
8274        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8275    }
8276
8277    impl Aes128Encryption {
8278        /// Creates a new default instance.
8279        pub fn new() -> Self {
8280            std::default::Default::default()
8281        }
8282    }
8283
8284    impl wkt::message::Message for Aes128Encryption {
8285        fn typename() -> &'static str {
8286            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Aes128Encryption"
8287        }
8288    }
8289
8290    /// Configuration for SAMPLE-AES encryption.
8291    #[derive(Clone, Default, PartialEq)]
8292    #[non_exhaustive]
8293    pub struct SampleAesEncryption {
8294        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8295    }
8296
8297    impl SampleAesEncryption {
8298        /// Creates a new default instance.
8299        pub fn new() -> Self {
8300            std::default::Default::default()
8301        }
8302    }
8303
8304    impl wkt::message::Message for SampleAesEncryption {
8305        fn typename() -> &'static str {
8306            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.SampleAesEncryption"
8307        }
8308    }
8309
8310    /// Configuration for MPEG Common Encryption (MPEG-CENC).
8311    #[derive(Clone, Default, PartialEq)]
8312    #[non_exhaustive]
8313    pub struct MpegCommonEncryption {
8314        /// Required. Specify the encryption scheme.
8315        ///
8316        /// Supported encryption schemes:
8317        ///
8318        /// - `cenc`
8319        /// - `cbcs`
8320        pub scheme: std::string::String,
8321
8322        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8323    }
8324
8325    impl MpegCommonEncryption {
8326        /// Creates a new default instance.
8327        pub fn new() -> Self {
8328            std::default::Default::default()
8329        }
8330
8331        /// Sets the value of [scheme][crate::model::encryption::MpegCommonEncryption::scheme].
8332        ///
8333        /// # Example
8334        /// ```ignore,no_run
8335        /// # use google_cloud_video_transcoder_v1::model::encryption::MpegCommonEncryption;
8336        /// let x = MpegCommonEncryption::new().set_scheme("example");
8337        /// ```
8338        pub fn set_scheme<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8339            self.scheme = v.into();
8340            self
8341        }
8342    }
8343
8344    impl wkt::message::Message for MpegCommonEncryption {
8345        fn typename() -> &'static str {
8346            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.MpegCommonEncryption"
8347        }
8348    }
8349
8350    /// Configuration for secrets stored in Google Secret Manager.
8351    #[derive(Clone, Default, PartialEq)]
8352    #[non_exhaustive]
8353    pub struct SecretManagerSource {
8354        /// Required. The name of the Secret Version containing the encryption key in
8355        /// the following format:
8356        /// `projects/{project}/secrets/{secret_id}/versions/{version_number}`
8357        ///
8358        /// Note that only numbered versions are supported. Aliases like "latest" are
8359        /// not supported.
8360        pub secret_version: std::string::String,
8361
8362        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8363    }
8364
8365    impl SecretManagerSource {
8366        /// Creates a new default instance.
8367        pub fn new() -> Self {
8368            std::default::Default::default()
8369        }
8370
8371        /// Sets the value of [secret_version][crate::model::encryption::SecretManagerSource::secret_version].
8372        ///
8373        /// # Example
8374        /// ```ignore,no_run
8375        /// # use google_cloud_video_transcoder_v1::model::encryption::SecretManagerSource;
8376        /// let x = SecretManagerSource::new().set_secret_version("example");
8377        /// ```
8378        pub fn set_secret_version<T: std::convert::Into<std::string::String>>(
8379            mut self,
8380            v: T,
8381        ) -> Self {
8382            self.secret_version = v.into();
8383            self
8384        }
8385    }
8386
8387    impl wkt::message::Message for SecretManagerSource {
8388        fn typename() -> &'static str {
8389            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.SecretManagerSource"
8390        }
8391    }
8392
8393    /// Widevine configuration.
8394    #[derive(Clone, Default, PartialEq)]
8395    #[non_exhaustive]
8396    pub struct Widevine {
8397        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8398    }
8399
8400    impl Widevine {
8401        /// Creates a new default instance.
8402        pub fn new() -> Self {
8403            std::default::Default::default()
8404        }
8405    }
8406
8407    impl wkt::message::Message for Widevine {
8408        fn typename() -> &'static str {
8409            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Widevine"
8410        }
8411    }
8412
8413    /// Fairplay configuration.
8414    #[derive(Clone, Default, PartialEq)]
8415    #[non_exhaustive]
8416    pub struct Fairplay {
8417        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8418    }
8419
8420    impl Fairplay {
8421        /// Creates a new default instance.
8422        pub fn new() -> Self {
8423            std::default::Default::default()
8424        }
8425    }
8426
8427    impl wkt::message::Message for Fairplay {
8428        fn typename() -> &'static str {
8429            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Fairplay"
8430        }
8431    }
8432
8433    /// Playready configuration.
8434    #[derive(Clone, Default, PartialEq)]
8435    #[non_exhaustive]
8436    pub struct Playready {
8437        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8438    }
8439
8440    impl Playready {
8441        /// Creates a new default instance.
8442        pub fn new() -> Self {
8443            std::default::Default::default()
8444        }
8445    }
8446
8447    impl wkt::message::Message for Playready {
8448        fn typename() -> &'static str {
8449            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Playready"
8450        }
8451    }
8452
8453    /// Clearkey configuration.
8454    #[derive(Clone, Default, PartialEq)]
8455    #[non_exhaustive]
8456    pub struct Clearkey {
8457        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8458    }
8459
8460    impl Clearkey {
8461        /// Creates a new default instance.
8462        pub fn new() -> Self {
8463            std::default::Default::default()
8464        }
8465    }
8466
8467    impl wkt::message::Message for Clearkey {
8468        fn typename() -> &'static str {
8469            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Clearkey"
8470        }
8471    }
8472
8473    /// Defines configuration for DRM systems in use.
8474    #[derive(Clone, Default, PartialEq)]
8475    #[non_exhaustive]
8476    pub struct DrmSystems {
8477        /// Widevine configuration.
8478        pub widevine: std::option::Option<crate::model::encryption::Widevine>,
8479
8480        /// Fairplay configuration.
8481        pub fairplay: std::option::Option<crate::model::encryption::Fairplay>,
8482
8483        /// Playready configuration.
8484        pub playready: std::option::Option<crate::model::encryption::Playready>,
8485
8486        /// Clearkey configuration.
8487        pub clearkey: std::option::Option<crate::model::encryption::Clearkey>,
8488
8489        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8490    }
8491
8492    impl DrmSystems {
8493        /// Creates a new default instance.
8494        pub fn new() -> Self {
8495            std::default::Default::default()
8496        }
8497
8498        /// Sets the value of [widevine][crate::model::encryption::DrmSystems::widevine].
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::Widevine;
8504        /// let x = DrmSystems::new().set_widevine(Widevine::default()/* use setters */);
8505        /// ```
8506        pub fn set_widevine<T>(mut self, v: T) -> Self
8507        where
8508            T: std::convert::Into<crate::model::encryption::Widevine>,
8509        {
8510            self.widevine = std::option::Option::Some(v.into());
8511            self
8512        }
8513
8514        /// Sets or clears the value of [widevine][crate::model::encryption::DrmSystems::widevine].
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::Widevine;
8520        /// let x = DrmSystems::new().set_or_clear_widevine(Some(Widevine::default()/* use setters */));
8521        /// let x = DrmSystems::new().set_or_clear_widevine(None::<Widevine>);
8522        /// ```
8523        pub fn set_or_clear_widevine<T>(mut self, v: std::option::Option<T>) -> Self
8524        where
8525            T: std::convert::Into<crate::model::encryption::Widevine>,
8526        {
8527            self.widevine = v.map(|x| x.into());
8528            self
8529        }
8530
8531        /// Sets the value of [fairplay][crate::model::encryption::DrmSystems::fairplay].
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::Fairplay;
8537        /// let x = DrmSystems::new().set_fairplay(Fairplay::default()/* use setters */);
8538        /// ```
8539        pub fn set_fairplay<T>(mut self, v: T) -> Self
8540        where
8541            T: std::convert::Into<crate::model::encryption::Fairplay>,
8542        {
8543            self.fairplay = std::option::Option::Some(v.into());
8544            self
8545        }
8546
8547        /// Sets or clears the value of [fairplay][crate::model::encryption::DrmSystems::fairplay].
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::Fairplay;
8553        /// let x = DrmSystems::new().set_or_clear_fairplay(Some(Fairplay::default()/* use setters */));
8554        /// let x = DrmSystems::new().set_or_clear_fairplay(None::<Fairplay>);
8555        /// ```
8556        pub fn set_or_clear_fairplay<T>(mut self, v: std::option::Option<T>) -> Self
8557        where
8558            T: std::convert::Into<crate::model::encryption::Fairplay>,
8559        {
8560            self.fairplay = v.map(|x| x.into());
8561            self
8562        }
8563
8564        /// Sets the value of [playready][crate::model::encryption::DrmSystems::playready].
8565        ///
8566        /// # Example
8567        /// ```ignore,no_run
8568        /// # use google_cloud_video_transcoder_v1::model::encryption::DrmSystems;
8569        /// use google_cloud_video_transcoder_v1::model::encryption::Playready;
8570        /// let x = DrmSystems::new().set_playready(Playready::default()/* use setters */);
8571        /// ```
8572        pub fn set_playready<T>(mut self, v: T) -> Self
8573        where
8574            T: std::convert::Into<crate::model::encryption::Playready>,
8575        {
8576            self.playready = std::option::Option::Some(v.into());
8577            self
8578        }
8579
8580        /// Sets or clears the value of [playready][crate::model::encryption::DrmSystems::playready].
8581        ///
8582        /// # Example
8583        /// ```ignore,no_run
8584        /// # use google_cloud_video_transcoder_v1::model::encryption::DrmSystems;
8585        /// use google_cloud_video_transcoder_v1::model::encryption::Playready;
8586        /// let x = DrmSystems::new().set_or_clear_playready(Some(Playready::default()/* use setters */));
8587        /// let x = DrmSystems::new().set_or_clear_playready(None::<Playready>);
8588        /// ```
8589        pub fn set_or_clear_playready<T>(mut self, v: std::option::Option<T>) -> Self
8590        where
8591            T: std::convert::Into<crate::model::encryption::Playready>,
8592        {
8593            self.playready = v.map(|x| x.into());
8594            self
8595        }
8596
8597        /// Sets the value of [clearkey][crate::model::encryption::DrmSystems::clearkey].
8598        ///
8599        /// # Example
8600        /// ```ignore,no_run
8601        /// # use google_cloud_video_transcoder_v1::model::encryption::DrmSystems;
8602        /// use google_cloud_video_transcoder_v1::model::encryption::Clearkey;
8603        /// let x = DrmSystems::new().set_clearkey(Clearkey::default()/* use setters */);
8604        /// ```
8605        pub fn set_clearkey<T>(mut self, v: T) -> Self
8606        where
8607            T: std::convert::Into<crate::model::encryption::Clearkey>,
8608        {
8609            self.clearkey = std::option::Option::Some(v.into());
8610            self
8611        }
8612
8613        /// Sets or clears the value of [clearkey][crate::model::encryption::DrmSystems::clearkey].
8614        ///
8615        /// # Example
8616        /// ```ignore,no_run
8617        /// # use google_cloud_video_transcoder_v1::model::encryption::DrmSystems;
8618        /// use google_cloud_video_transcoder_v1::model::encryption::Clearkey;
8619        /// let x = DrmSystems::new().set_or_clear_clearkey(Some(Clearkey::default()/* use setters */));
8620        /// let x = DrmSystems::new().set_or_clear_clearkey(None::<Clearkey>);
8621        /// ```
8622        pub fn set_or_clear_clearkey<T>(mut self, v: std::option::Option<T>) -> Self
8623        where
8624            T: std::convert::Into<crate::model::encryption::Clearkey>,
8625        {
8626            self.clearkey = v.map(|x| x.into());
8627            self
8628        }
8629    }
8630
8631    impl wkt::message::Message for DrmSystems {
8632        fn typename() -> &'static str {
8633            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.DrmSystems"
8634        }
8635    }
8636
8637    /// Encryption mode can be either `aes` or `cenc`.
8638    #[derive(Clone, Debug, PartialEq)]
8639    #[non_exhaustive]
8640    pub enum EncryptionMode {
8641        /// Configuration for AES-128 encryption.
8642        Aes128(std::boxed::Box<crate::model::encryption::Aes128Encryption>),
8643        /// Configuration for SAMPLE-AES encryption.
8644        SampleAes(std::boxed::Box<crate::model::encryption::SampleAesEncryption>),
8645        /// Configuration for MPEG Common Encryption (MPEG-CENC).
8646        MpegCenc(std::boxed::Box<crate::model::encryption::MpegCommonEncryption>),
8647    }
8648
8649    /// Defines where content keys are stored.
8650    #[derive(Clone, Debug, PartialEq)]
8651    #[non_exhaustive]
8652    pub enum SecretSource {
8653        /// Keys are stored in Google Secret Manager.
8654        SecretManagerKeySource(std::boxed::Box<crate::model::encryption::SecretManagerSource>),
8655    }
8656}
8657
8658/// Request message for `TranscoderService.CreateJob`.
8659#[derive(Clone, Default, PartialEq)]
8660#[non_exhaustive]
8661pub struct CreateJobRequest {
8662    /// Required. The parent location to create and process this job.
8663    /// Format: `projects/{project}/locations/{location}`
8664    pub parent: std::string::String,
8665
8666    /// Required. Parameters for creating transcoding job.
8667    pub job: std::option::Option<crate::model::Job>,
8668
8669    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8670}
8671
8672impl CreateJobRequest {
8673    /// Creates a new default instance.
8674    pub fn new() -> Self {
8675        std::default::Default::default()
8676    }
8677
8678    /// Sets the value of [parent][crate::model::CreateJobRequest::parent].
8679    ///
8680    /// # Example
8681    /// ```ignore,no_run
8682    /// # use google_cloud_video_transcoder_v1::model::CreateJobRequest;
8683    /// let x = CreateJobRequest::new().set_parent("example");
8684    /// ```
8685    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8686        self.parent = v.into();
8687        self
8688    }
8689
8690    /// Sets the value of [job][crate::model::CreateJobRequest::job].
8691    ///
8692    /// # Example
8693    /// ```ignore,no_run
8694    /// # use google_cloud_video_transcoder_v1::model::CreateJobRequest;
8695    /// use google_cloud_video_transcoder_v1::model::Job;
8696    /// let x = CreateJobRequest::new().set_job(Job::default()/* use setters */);
8697    /// ```
8698    pub fn set_job<T>(mut self, v: T) -> Self
8699    where
8700        T: std::convert::Into<crate::model::Job>,
8701    {
8702        self.job = std::option::Option::Some(v.into());
8703        self
8704    }
8705
8706    /// Sets or clears the value of [job][crate::model::CreateJobRequest::job].
8707    ///
8708    /// # Example
8709    /// ```ignore,no_run
8710    /// # use google_cloud_video_transcoder_v1::model::CreateJobRequest;
8711    /// use google_cloud_video_transcoder_v1::model::Job;
8712    /// let x = CreateJobRequest::new().set_or_clear_job(Some(Job::default()/* use setters */));
8713    /// let x = CreateJobRequest::new().set_or_clear_job(None::<Job>);
8714    /// ```
8715    pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
8716    where
8717        T: std::convert::Into<crate::model::Job>,
8718    {
8719        self.job = v.map(|x| x.into());
8720        self
8721    }
8722}
8723
8724impl wkt::message::Message for CreateJobRequest {
8725    fn typename() -> &'static str {
8726        "type.googleapis.com/google.cloud.video.transcoder.v1.CreateJobRequest"
8727    }
8728}
8729
8730/// Request message for `TranscoderService.ListJobs`.
8731/// The parent location from which to retrieve the collection of jobs.
8732#[derive(Clone, Default, PartialEq)]
8733#[non_exhaustive]
8734pub struct ListJobsRequest {
8735    /// Required. Format: `projects/{project}/locations/{location}`
8736    pub parent: std::string::String,
8737
8738    /// The maximum number of items to return.
8739    pub page_size: i32,
8740
8741    /// The `next_page_token` value returned from a previous List request, if
8742    /// any.
8743    pub page_token: std::string::String,
8744
8745    /// The filter expression, following the syntax outlined in
8746    /// <https://google.aip.dev/160>.
8747    pub filter: std::string::String,
8748
8749    /// One or more fields to compare and use to sort the output.
8750    /// See <https://google.aip.dev/132#ordering>.
8751    pub order_by: std::string::String,
8752
8753    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8754}
8755
8756impl ListJobsRequest {
8757    /// Creates a new default instance.
8758    pub fn new() -> Self {
8759        std::default::Default::default()
8760    }
8761
8762    /// Sets the value of [parent][crate::model::ListJobsRequest::parent].
8763    ///
8764    /// # Example
8765    /// ```ignore,no_run
8766    /// # use google_cloud_video_transcoder_v1::model::ListJobsRequest;
8767    /// let x = ListJobsRequest::new().set_parent("example");
8768    /// ```
8769    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8770        self.parent = v.into();
8771        self
8772    }
8773
8774    /// Sets the value of [page_size][crate::model::ListJobsRequest::page_size].
8775    ///
8776    /// # Example
8777    /// ```ignore,no_run
8778    /// # use google_cloud_video_transcoder_v1::model::ListJobsRequest;
8779    /// let x = ListJobsRequest::new().set_page_size(42);
8780    /// ```
8781    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8782        self.page_size = v.into();
8783        self
8784    }
8785
8786    /// Sets the value of [page_token][crate::model::ListJobsRequest::page_token].
8787    ///
8788    /// # Example
8789    /// ```ignore,no_run
8790    /// # use google_cloud_video_transcoder_v1::model::ListJobsRequest;
8791    /// let x = ListJobsRequest::new().set_page_token("example");
8792    /// ```
8793    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8794        self.page_token = v.into();
8795        self
8796    }
8797
8798    /// Sets the value of [filter][crate::model::ListJobsRequest::filter].
8799    ///
8800    /// # Example
8801    /// ```ignore,no_run
8802    /// # use google_cloud_video_transcoder_v1::model::ListJobsRequest;
8803    /// let x = ListJobsRequest::new().set_filter("example");
8804    /// ```
8805    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8806        self.filter = v.into();
8807        self
8808    }
8809
8810    /// Sets the value of [order_by][crate::model::ListJobsRequest::order_by].
8811    ///
8812    /// # Example
8813    /// ```ignore,no_run
8814    /// # use google_cloud_video_transcoder_v1::model::ListJobsRequest;
8815    /// let x = ListJobsRequest::new().set_order_by("example");
8816    /// ```
8817    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8818        self.order_by = v.into();
8819        self
8820    }
8821}
8822
8823impl wkt::message::Message for ListJobsRequest {
8824    fn typename() -> &'static str {
8825        "type.googleapis.com/google.cloud.video.transcoder.v1.ListJobsRequest"
8826    }
8827}
8828
8829/// Request message for `TranscoderService.GetJob`.
8830#[derive(Clone, Default, PartialEq)]
8831#[non_exhaustive]
8832pub struct GetJobRequest {
8833    /// Required. The name of the job to retrieve.
8834    /// Format: `projects/{project}/locations/{location}/jobs/{job}`
8835    pub name: std::string::String,
8836
8837    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8838}
8839
8840impl GetJobRequest {
8841    /// Creates a new default instance.
8842    pub fn new() -> Self {
8843        std::default::Default::default()
8844    }
8845
8846    /// Sets the value of [name][crate::model::GetJobRequest::name].
8847    ///
8848    /// # Example
8849    /// ```ignore,no_run
8850    /// # use google_cloud_video_transcoder_v1::model::GetJobRequest;
8851    /// # let project_id = "project_id";
8852    /// # let location_id = "location_id";
8853    /// # let job_id = "job_id";
8854    /// let x = GetJobRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/jobs/{job_id}"));
8855    /// ```
8856    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8857        self.name = v.into();
8858        self
8859    }
8860}
8861
8862impl wkt::message::Message for GetJobRequest {
8863    fn typename() -> &'static str {
8864        "type.googleapis.com/google.cloud.video.transcoder.v1.GetJobRequest"
8865    }
8866}
8867
8868/// Request message for `TranscoderService.DeleteJob`.
8869#[derive(Clone, Default, PartialEq)]
8870#[non_exhaustive]
8871pub struct DeleteJobRequest {
8872    /// Required. The name of the job to delete.
8873    /// Format: `projects/{project}/locations/{location}/jobs/{job}`
8874    pub name: std::string::String,
8875
8876    /// If set to true, and the job is not found, the request will succeed but no
8877    /// action will be taken on the server.
8878    pub allow_missing: bool,
8879
8880    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8881}
8882
8883impl DeleteJobRequest {
8884    /// Creates a new default instance.
8885    pub fn new() -> Self {
8886        std::default::Default::default()
8887    }
8888
8889    /// Sets the value of [name][crate::model::DeleteJobRequest::name].
8890    ///
8891    /// # Example
8892    /// ```ignore,no_run
8893    /// # use google_cloud_video_transcoder_v1::model::DeleteJobRequest;
8894    /// # let project_id = "project_id";
8895    /// # let location_id = "location_id";
8896    /// # let job_id = "job_id";
8897    /// let x = DeleteJobRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/jobs/{job_id}"));
8898    /// ```
8899    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8900        self.name = v.into();
8901        self
8902    }
8903
8904    /// Sets the value of [allow_missing][crate::model::DeleteJobRequest::allow_missing].
8905    ///
8906    /// # Example
8907    /// ```ignore,no_run
8908    /// # use google_cloud_video_transcoder_v1::model::DeleteJobRequest;
8909    /// let x = DeleteJobRequest::new().set_allow_missing(true);
8910    /// ```
8911    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8912        self.allow_missing = v.into();
8913        self
8914    }
8915}
8916
8917impl wkt::message::Message for DeleteJobRequest {
8918    fn typename() -> &'static str {
8919        "type.googleapis.com/google.cloud.video.transcoder.v1.DeleteJobRequest"
8920    }
8921}
8922
8923/// Response message for `TranscoderService.ListJobs`.
8924#[derive(Clone, Default, PartialEq)]
8925#[non_exhaustive]
8926pub struct ListJobsResponse {
8927    /// List of jobs in the specified region.
8928    pub jobs: std::vec::Vec<crate::model::Job>,
8929
8930    /// The pagination token.
8931    pub next_page_token: std::string::String,
8932
8933    /// List of regions that could not be reached.
8934    pub unreachable: std::vec::Vec<std::string::String>,
8935
8936    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8937}
8938
8939impl ListJobsResponse {
8940    /// Creates a new default instance.
8941    pub fn new() -> Self {
8942        std::default::Default::default()
8943    }
8944
8945    /// Sets the value of [jobs][crate::model::ListJobsResponse::jobs].
8946    ///
8947    /// # Example
8948    /// ```ignore,no_run
8949    /// # use google_cloud_video_transcoder_v1::model::ListJobsResponse;
8950    /// use google_cloud_video_transcoder_v1::model::Job;
8951    /// let x = ListJobsResponse::new()
8952    ///     .set_jobs([
8953    ///         Job::default()/* use setters */,
8954    ///         Job::default()/* use (different) setters */,
8955    ///     ]);
8956    /// ```
8957    pub fn set_jobs<T, V>(mut self, v: T) -> Self
8958    where
8959        T: std::iter::IntoIterator<Item = V>,
8960        V: std::convert::Into<crate::model::Job>,
8961    {
8962        use std::iter::Iterator;
8963        self.jobs = v.into_iter().map(|i| i.into()).collect();
8964        self
8965    }
8966
8967    /// Sets the value of [next_page_token][crate::model::ListJobsResponse::next_page_token].
8968    ///
8969    /// # Example
8970    /// ```ignore,no_run
8971    /// # use google_cloud_video_transcoder_v1::model::ListJobsResponse;
8972    /// let x = ListJobsResponse::new().set_next_page_token("example");
8973    /// ```
8974    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8975        self.next_page_token = v.into();
8976        self
8977    }
8978
8979    /// Sets the value of [unreachable][crate::model::ListJobsResponse::unreachable].
8980    ///
8981    /// # Example
8982    /// ```ignore,no_run
8983    /// # use google_cloud_video_transcoder_v1::model::ListJobsResponse;
8984    /// let x = ListJobsResponse::new().set_unreachable(["a", "b", "c"]);
8985    /// ```
8986    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
8987    where
8988        T: std::iter::IntoIterator<Item = V>,
8989        V: std::convert::Into<std::string::String>,
8990    {
8991        use std::iter::Iterator;
8992        self.unreachable = v.into_iter().map(|i| i.into()).collect();
8993        self
8994    }
8995}
8996
8997impl wkt::message::Message for ListJobsResponse {
8998    fn typename() -> &'static str {
8999        "type.googleapis.com/google.cloud.video.transcoder.v1.ListJobsResponse"
9000    }
9001}
9002
9003#[doc(hidden)]
9004impl google_cloud_gax::paginator::internal::PageableResponse for ListJobsResponse {
9005    type PageItem = crate::model::Job;
9006
9007    fn items(self) -> std::vec::Vec<Self::PageItem> {
9008        self.jobs
9009    }
9010
9011    fn next_page_token(&self) -> std::string::String {
9012        use std::clone::Clone;
9013        self.next_page_token.clone()
9014    }
9015}
9016
9017/// Request message for `TranscoderService.CreateJobTemplate`.
9018#[derive(Clone, Default, PartialEq)]
9019#[non_exhaustive]
9020pub struct CreateJobTemplateRequest {
9021    /// Required. The parent location to create this job template.
9022    /// Format: `projects/{project}/locations/{location}`
9023    pub parent: std::string::String,
9024
9025    /// Required. Parameters for creating job template.
9026    pub job_template: std::option::Option<crate::model::JobTemplate>,
9027
9028    /// Required. The ID to use for the job template, which will become the final
9029    /// component of the job template's resource name.
9030    ///
9031    /// This value should be 4-63 characters, and valid characters must match the
9032    /// regular expression `[a-zA-Z][a-zA-Z0-9_-]*`.
9033    pub job_template_id: std::string::String,
9034
9035    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9036}
9037
9038impl CreateJobTemplateRequest {
9039    /// Creates a new default instance.
9040    pub fn new() -> Self {
9041        std::default::Default::default()
9042    }
9043
9044    /// Sets the value of [parent][crate::model::CreateJobTemplateRequest::parent].
9045    ///
9046    /// # Example
9047    /// ```ignore,no_run
9048    /// # use google_cloud_video_transcoder_v1::model::CreateJobTemplateRequest;
9049    /// let x = CreateJobTemplateRequest::new().set_parent("example");
9050    /// ```
9051    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9052        self.parent = v.into();
9053        self
9054    }
9055
9056    /// Sets the value of [job_template][crate::model::CreateJobTemplateRequest::job_template].
9057    ///
9058    /// # Example
9059    /// ```ignore,no_run
9060    /// # use google_cloud_video_transcoder_v1::model::CreateJobTemplateRequest;
9061    /// use google_cloud_video_transcoder_v1::model::JobTemplate;
9062    /// let x = CreateJobTemplateRequest::new().set_job_template(JobTemplate::default()/* use setters */);
9063    /// ```
9064    pub fn set_job_template<T>(mut self, v: T) -> Self
9065    where
9066        T: std::convert::Into<crate::model::JobTemplate>,
9067    {
9068        self.job_template = std::option::Option::Some(v.into());
9069        self
9070    }
9071
9072    /// Sets or clears the value of [job_template][crate::model::CreateJobTemplateRequest::job_template].
9073    ///
9074    /// # Example
9075    /// ```ignore,no_run
9076    /// # use google_cloud_video_transcoder_v1::model::CreateJobTemplateRequest;
9077    /// use google_cloud_video_transcoder_v1::model::JobTemplate;
9078    /// let x = CreateJobTemplateRequest::new().set_or_clear_job_template(Some(JobTemplate::default()/* use setters */));
9079    /// let x = CreateJobTemplateRequest::new().set_or_clear_job_template(None::<JobTemplate>);
9080    /// ```
9081    pub fn set_or_clear_job_template<T>(mut self, v: std::option::Option<T>) -> Self
9082    where
9083        T: std::convert::Into<crate::model::JobTemplate>,
9084    {
9085        self.job_template = v.map(|x| x.into());
9086        self
9087    }
9088
9089    /// Sets the value of [job_template_id][crate::model::CreateJobTemplateRequest::job_template_id].
9090    ///
9091    /// # Example
9092    /// ```ignore,no_run
9093    /// # use google_cloud_video_transcoder_v1::model::CreateJobTemplateRequest;
9094    /// let x = CreateJobTemplateRequest::new().set_job_template_id("example");
9095    /// ```
9096    pub fn set_job_template_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9097        self.job_template_id = v.into();
9098        self
9099    }
9100}
9101
9102impl wkt::message::Message for CreateJobTemplateRequest {
9103    fn typename() -> &'static str {
9104        "type.googleapis.com/google.cloud.video.transcoder.v1.CreateJobTemplateRequest"
9105    }
9106}
9107
9108/// Request message for `TranscoderService.ListJobTemplates`.
9109#[derive(Clone, Default, PartialEq)]
9110#[non_exhaustive]
9111pub struct ListJobTemplatesRequest {
9112    /// Required. The parent location from which to retrieve the collection of job
9113    /// templates. Format: `projects/{project}/locations/{location}`
9114    pub parent: std::string::String,
9115
9116    /// The maximum number of items to return.
9117    pub page_size: i32,
9118
9119    /// The `next_page_token` value returned from a previous List request, if
9120    /// any.
9121    pub page_token: std::string::String,
9122
9123    /// The filter expression, following the syntax outlined in
9124    /// <https://google.aip.dev/160>.
9125    pub filter: std::string::String,
9126
9127    /// One or more fields to compare and use to sort the output.
9128    /// See <https://google.aip.dev/132#ordering>.
9129    pub order_by: std::string::String,
9130
9131    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9132}
9133
9134impl ListJobTemplatesRequest {
9135    /// Creates a new default instance.
9136    pub fn new() -> Self {
9137        std::default::Default::default()
9138    }
9139
9140    /// Sets the value of [parent][crate::model::ListJobTemplatesRequest::parent].
9141    ///
9142    /// # Example
9143    /// ```ignore,no_run
9144    /// # use google_cloud_video_transcoder_v1::model::ListJobTemplatesRequest;
9145    /// let x = ListJobTemplatesRequest::new().set_parent("example");
9146    /// ```
9147    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9148        self.parent = v.into();
9149        self
9150    }
9151
9152    /// Sets the value of [page_size][crate::model::ListJobTemplatesRequest::page_size].
9153    ///
9154    /// # Example
9155    /// ```ignore,no_run
9156    /// # use google_cloud_video_transcoder_v1::model::ListJobTemplatesRequest;
9157    /// let x = ListJobTemplatesRequest::new().set_page_size(42);
9158    /// ```
9159    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9160        self.page_size = v.into();
9161        self
9162    }
9163
9164    /// Sets the value of [page_token][crate::model::ListJobTemplatesRequest::page_token].
9165    ///
9166    /// # Example
9167    /// ```ignore,no_run
9168    /// # use google_cloud_video_transcoder_v1::model::ListJobTemplatesRequest;
9169    /// let x = ListJobTemplatesRequest::new().set_page_token("example");
9170    /// ```
9171    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9172        self.page_token = v.into();
9173        self
9174    }
9175
9176    /// Sets the value of [filter][crate::model::ListJobTemplatesRequest::filter].
9177    ///
9178    /// # Example
9179    /// ```ignore,no_run
9180    /// # use google_cloud_video_transcoder_v1::model::ListJobTemplatesRequest;
9181    /// let x = ListJobTemplatesRequest::new().set_filter("example");
9182    /// ```
9183    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9184        self.filter = v.into();
9185        self
9186    }
9187
9188    /// Sets the value of [order_by][crate::model::ListJobTemplatesRequest::order_by].
9189    ///
9190    /// # Example
9191    /// ```ignore,no_run
9192    /// # use google_cloud_video_transcoder_v1::model::ListJobTemplatesRequest;
9193    /// let x = ListJobTemplatesRequest::new().set_order_by("example");
9194    /// ```
9195    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9196        self.order_by = v.into();
9197        self
9198    }
9199}
9200
9201impl wkt::message::Message for ListJobTemplatesRequest {
9202    fn typename() -> &'static str {
9203        "type.googleapis.com/google.cloud.video.transcoder.v1.ListJobTemplatesRequest"
9204    }
9205}
9206
9207/// Request message for `TranscoderService.GetJobTemplate`.
9208#[derive(Clone, Default, PartialEq)]
9209#[non_exhaustive]
9210pub struct GetJobTemplateRequest {
9211    /// Required. The name of the job template to retrieve.
9212    /// Format:
9213    /// `projects/{project}/locations/{location}/jobTemplates/{job_template}`
9214    pub name: std::string::String,
9215
9216    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9217}
9218
9219impl GetJobTemplateRequest {
9220    /// Creates a new default instance.
9221    pub fn new() -> Self {
9222        std::default::Default::default()
9223    }
9224
9225    /// Sets the value of [name][crate::model::GetJobTemplateRequest::name].
9226    ///
9227    /// # Example
9228    /// ```ignore,no_run
9229    /// # use google_cloud_video_transcoder_v1::model::GetJobTemplateRequest;
9230    /// # let project_id = "project_id";
9231    /// # let location_id = "location_id";
9232    /// # let job_template_id = "job_template_id";
9233    /// let x = GetJobTemplateRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/jobTemplates/{job_template_id}"));
9234    /// ```
9235    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9236        self.name = v.into();
9237        self
9238    }
9239}
9240
9241impl wkt::message::Message for GetJobTemplateRequest {
9242    fn typename() -> &'static str {
9243        "type.googleapis.com/google.cloud.video.transcoder.v1.GetJobTemplateRequest"
9244    }
9245}
9246
9247/// Request message for `TranscoderService.DeleteJobTemplate`.
9248#[derive(Clone, Default, PartialEq)]
9249#[non_exhaustive]
9250pub struct DeleteJobTemplateRequest {
9251    /// Required. The name of the job template to delete.
9252    /// `projects/{project}/locations/{location}/jobTemplates/{job_template}`
9253    pub name: std::string::String,
9254
9255    /// If set to true, and the job template is not found, the request will succeed
9256    /// but no action will be taken on the server.
9257    pub allow_missing: bool,
9258
9259    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9260}
9261
9262impl DeleteJobTemplateRequest {
9263    /// Creates a new default instance.
9264    pub fn new() -> Self {
9265        std::default::Default::default()
9266    }
9267
9268    /// Sets the value of [name][crate::model::DeleteJobTemplateRequest::name].
9269    ///
9270    /// # Example
9271    /// ```ignore,no_run
9272    /// # use google_cloud_video_transcoder_v1::model::DeleteJobTemplateRequest;
9273    /// # let project_id = "project_id";
9274    /// # let location_id = "location_id";
9275    /// # let job_template_id = "job_template_id";
9276    /// let x = DeleteJobTemplateRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/jobTemplates/{job_template_id}"));
9277    /// ```
9278    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9279        self.name = v.into();
9280        self
9281    }
9282
9283    /// Sets the value of [allow_missing][crate::model::DeleteJobTemplateRequest::allow_missing].
9284    ///
9285    /// # Example
9286    /// ```ignore,no_run
9287    /// # use google_cloud_video_transcoder_v1::model::DeleteJobTemplateRequest;
9288    /// let x = DeleteJobTemplateRequest::new().set_allow_missing(true);
9289    /// ```
9290    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9291        self.allow_missing = v.into();
9292        self
9293    }
9294}
9295
9296impl wkt::message::Message for DeleteJobTemplateRequest {
9297    fn typename() -> &'static str {
9298        "type.googleapis.com/google.cloud.video.transcoder.v1.DeleteJobTemplateRequest"
9299    }
9300}
9301
9302/// Response message for `TranscoderService.ListJobTemplates`.
9303#[derive(Clone, Default, PartialEq)]
9304#[non_exhaustive]
9305pub struct ListJobTemplatesResponse {
9306    /// List of job templates in the specified region.
9307    pub job_templates: std::vec::Vec<crate::model::JobTemplate>,
9308
9309    /// The pagination token.
9310    pub next_page_token: std::string::String,
9311
9312    /// List of regions that could not be reached.
9313    pub unreachable: std::vec::Vec<std::string::String>,
9314
9315    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9316}
9317
9318impl ListJobTemplatesResponse {
9319    /// Creates a new default instance.
9320    pub fn new() -> Self {
9321        std::default::Default::default()
9322    }
9323
9324    /// Sets the value of [job_templates][crate::model::ListJobTemplatesResponse::job_templates].
9325    ///
9326    /// # Example
9327    /// ```ignore,no_run
9328    /// # use google_cloud_video_transcoder_v1::model::ListJobTemplatesResponse;
9329    /// use google_cloud_video_transcoder_v1::model::JobTemplate;
9330    /// let x = ListJobTemplatesResponse::new()
9331    ///     .set_job_templates([
9332    ///         JobTemplate::default()/* use setters */,
9333    ///         JobTemplate::default()/* use (different) setters */,
9334    ///     ]);
9335    /// ```
9336    pub fn set_job_templates<T, V>(mut self, v: T) -> Self
9337    where
9338        T: std::iter::IntoIterator<Item = V>,
9339        V: std::convert::Into<crate::model::JobTemplate>,
9340    {
9341        use std::iter::Iterator;
9342        self.job_templates = v.into_iter().map(|i| i.into()).collect();
9343        self
9344    }
9345
9346    /// Sets the value of [next_page_token][crate::model::ListJobTemplatesResponse::next_page_token].
9347    ///
9348    /// # Example
9349    /// ```ignore,no_run
9350    /// # use google_cloud_video_transcoder_v1::model::ListJobTemplatesResponse;
9351    /// let x = ListJobTemplatesResponse::new().set_next_page_token("example");
9352    /// ```
9353    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9354        self.next_page_token = v.into();
9355        self
9356    }
9357
9358    /// Sets the value of [unreachable][crate::model::ListJobTemplatesResponse::unreachable].
9359    ///
9360    /// # Example
9361    /// ```ignore,no_run
9362    /// # use google_cloud_video_transcoder_v1::model::ListJobTemplatesResponse;
9363    /// let x = ListJobTemplatesResponse::new().set_unreachable(["a", "b", "c"]);
9364    /// ```
9365    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9366    where
9367        T: std::iter::IntoIterator<Item = V>,
9368        V: std::convert::Into<std::string::String>,
9369    {
9370        use std::iter::Iterator;
9371        self.unreachable = v.into_iter().map(|i| i.into()).collect();
9372        self
9373    }
9374}
9375
9376impl wkt::message::Message for ListJobTemplatesResponse {
9377    fn typename() -> &'static str {
9378        "type.googleapis.com/google.cloud.video.transcoder.v1.ListJobTemplatesResponse"
9379    }
9380}
9381
9382#[doc(hidden)]
9383impl google_cloud_gax::paginator::internal::PageableResponse for ListJobTemplatesResponse {
9384    type PageItem = crate::model::JobTemplate;
9385
9386    fn items(self) -> std::vec::Vec<Self::PageItem> {
9387        self.job_templates
9388    }
9389
9390    fn next_page_token(&self) -> std::string::String {
9391        use std::clone::Clone;
9392        self.next_page_token.clone()
9393    }
9394}