google_cloud_video_transcoder_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate lazy_static;
25extern crate reqwest;
26extern crate rpc;
27extern crate serde;
28extern crate serde_json;
29extern crate serde_with;
30extern crate std;
31extern crate tracing;
32extern crate wkt;
33
34mod debug;
35mod deserialize;
36mod serialize;
37
38/// Transcoding job resource.
39#[derive(Clone, Default, PartialEq)]
40#[non_exhaustive]
41pub struct Job {
42    /// The resource name of the job.
43    /// Format: `projects/{project_number}/locations/{location}/jobs/{job}`
44    pub name: std::string::String,
45
46    /// Input only. Specify the `input_uri` to populate empty `uri` fields in each
47    /// element of `Job.config.inputs` or `JobTemplate.config.inputs` when using
48    /// template. URI of the media. Input files must be at least 5 seconds in
49    /// duration and stored in Cloud Storage (for example,
50    /// `gs://bucket/inputs/file.mp4`). See [Supported input and output
51    /// formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats).
52    pub input_uri: std::string::String,
53
54    /// Input only. Specify the `output_uri` to populate an empty
55    /// `Job.config.output.uri` or `JobTemplate.config.output.uri` when using
56    /// template. URI for the output file(s). For example,
57    /// `gs://my-bucket/outputs/`. See [Supported input and output
58    /// formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats).
59    pub output_uri: std::string::String,
60
61    /// Output only. The current state of the job.
62    pub state: crate::model::job::ProcessingState,
63
64    /// Output only. The time the job was created.
65    pub create_time: std::option::Option<wkt::Timestamp>,
66
67    /// Output only. The time the transcoding started.
68    pub start_time: std::option::Option<wkt::Timestamp>,
69
70    /// Output only. The time the transcoding finished.
71    pub end_time: std::option::Option<wkt::Timestamp>,
72
73    /// Job time to live value in days, which will be effective after job
74    /// completion. Job should be deleted automatically after the given TTL. Enter
75    /// a value between 1 and 90. The default is 30.
76    pub ttl_after_completion_days: i32,
77
78    /// The labels associated with this job. You can use these to organize and
79    /// group your jobs.
80    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
81
82    /// Output only. An error object that describes the reason for the failure.
83    /// This property is always present when
84    /// [ProcessingState][google.cloud.video.transcoder.v1.Job.ProcessingState] is
85    /// `FAILED`.
86    ///
87    /// [google.cloud.video.transcoder.v1.Job.ProcessingState]: crate::model::job::ProcessingState
88    pub error: std::option::Option<rpc::model::Status>,
89
90    /// The processing mode of the job.
91    /// The default is `PROCESSING_MODE_INTERACTIVE`.
92    pub mode: crate::model::job::ProcessingMode,
93
94    /// The processing priority of a batch job.
95    /// This field can only be set for batch mode jobs. The default value is 0.
96    /// This value cannot be negative. Higher values correspond to higher
97    /// priorities for the job.
98    pub batch_mode_priority: i32,
99
100    /// Optional. The optimization strategy of the job. The default is
101    /// `AUTODETECT`.
102    pub optimization: crate::model::job::OptimizationStrategy,
103
104    /// Optional. Insert silence and duplicate frames when timestamp gaps are
105    /// detected in a given stream.
106    pub fill_content_gaps: bool,
107
108    /// Specify the config for the transcoding job. If you don't specify the
109    /// `job_config`, the API selects `templateId`; this template ID is set to
110    /// `preset/web-hd` by default. When you use a `template_id` to create a job,
111    /// the `Job.config` is populated by the `JobTemplate.config`.\<br\>
112    pub job_config: std::option::Option<crate::model::job::JobConfig>,
113
114    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
115}
116
117impl Job {
118    pub fn new() -> Self {
119        std::default::Default::default()
120    }
121
122    /// Sets the value of [name][crate::model::Job::name].
123    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
124        self.name = v.into();
125        self
126    }
127
128    /// Sets the value of [input_uri][crate::model::Job::input_uri].
129    pub fn set_input_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
130        self.input_uri = v.into();
131        self
132    }
133
134    /// Sets the value of [output_uri][crate::model::Job::output_uri].
135    pub fn set_output_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
136        self.output_uri = v.into();
137        self
138    }
139
140    /// Sets the value of [state][crate::model::Job::state].
141    pub fn set_state<T: std::convert::Into<crate::model::job::ProcessingState>>(
142        mut self,
143        v: T,
144    ) -> Self {
145        self.state = v.into();
146        self
147    }
148
149    /// Sets the value of [create_time][crate::model::Job::create_time].
150    pub fn set_create_time<T>(mut self, v: T) -> Self
151    where
152        T: std::convert::Into<wkt::Timestamp>,
153    {
154        self.create_time = std::option::Option::Some(v.into());
155        self
156    }
157
158    /// Sets or clears the value of [create_time][crate::model::Job::create_time].
159    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
160    where
161        T: std::convert::Into<wkt::Timestamp>,
162    {
163        self.create_time = v.map(|x| x.into());
164        self
165    }
166
167    /// Sets the value of [start_time][crate::model::Job::start_time].
168    pub fn set_start_time<T>(mut self, v: T) -> Self
169    where
170        T: std::convert::Into<wkt::Timestamp>,
171    {
172        self.start_time = std::option::Option::Some(v.into());
173        self
174    }
175
176    /// Sets or clears the value of [start_time][crate::model::Job::start_time].
177    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
178    where
179        T: std::convert::Into<wkt::Timestamp>,
180    {
181        self.start_time = v.map(|x| x.into());
182        self
183    }
184
185    /// Sets the value of [end_time][crate::model::Job::end_time].
186    pub fn set_end_time<T>(mut self, v: T) -> Self
187    where
188        T: std::convert::Into<wkt::Timestamp>,
189    {
190        self.end_time = std::option::Option::Some(v.into());
191        self
192    }
193
194    /// Sets or clears the value of [end_time][crate::model::Job::end_time].
195    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
196    where
197        T: std::convert::Into<wkt::Timestamp>,
198    {
199        self.end_time = v.map(|x| x.into());
200        self
201    }
202
203    /// Sets the value of [ttl_after_completion_days][crate::model::Job::ttl_after_completion_days].
204    pub fn set_ttl_after_completion_days<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
205        self.ttl_after_completion_days = v.into();
206        self
207    }
208
209    /// Sets the value of [labels][crate::model::Job::labels].
210    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
211    where
212        T: std::iter::IntoIterator<Item = (K, V)>,
213        K: std::convert::Into<std::string::String>,
214        V: std::convert::Into<std::string::String>,
215    {
216        use std::iter::Iterator;
217        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
218        self
219    }
220
221    /// Sets the value of [error][crate::model::Job::error].
222    pub fn set_error<T>(mut self, v: T) -> Self
223    where
224        T: std::convert::Into<rpc::model::Status>,
225    {
226        self.error = std::option::Option::Some(v.into());
227        self
228    }
229
230    /// Sets or clears the value of [error][crate::model::Job::error].
231    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
232    where
233        T: std::convert::Into<rpc::model::Status>,
234    {
235        self.error = v.map(|x| x.into());
236        self
237    }
238
239    /// Sets the value of [mode][crate::model::Job::mode].
240    pub fn set_mode<T: std::convert::Into<crate::model::job::ProcessingMode>>(
241        mut self,
242        v: T,
243    ) -> Self {
244        self.mode = v.into();
245        self
246    }
247
248    /// Sets the value of [batch_mode_priority][crate::model::Job::batch_mode_priority].
249    pub fn set_batch_mode_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
250        self.batch_mode_priority = v.into();
251        self
252    }
253
254    /// Sets the value of [optimization][crate::model::Job::optimization].
255    pub fn set_optimization<T: std::convert::Into<crate::model::job::OptimizationStrategy>>(
256        mut self,
257        v: T,
258    ) -> Self {
259        self.optimization = v.into();
260        self
261    }
262
263    /// Sets the value of [fill_content_gaps][crate::model::Job::fill_content_gaps].
264    pub fn set_fill_content_gaps<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
265        self.fill_content_gaps = v.into();
266        self
267    }
268
269    /// Sets the value of [job_config][crate::model::Job::job_config].
270    ///
271    /// Note that all the setters affecting `job_config` are mutually
272    /// exclusive.
273    pub fn set_job_config<
274        T: std::convert::Into<std::option::Option<crate::model::job::JobConfig>>,
275    >(
276        mut self,
277        v: T,
278    ) -> Self {
279        self.job_config = v.into();
280        self
281    }
282
283    /// The value of [job_config][crate::model::Job::job_config]
284    /// if it holds a `TemplateId`, `None` if the field is not set or
285    /// holds a different branch.
286    pub fn template_id(&self) -> std::option::Option<&std::string::String> {
287        #[allow(unreachable_patterns)]
288        self.job_config.as_ref().and_then(|v| match v {
289            crate::model::job::JobConfig::TemplateId(v) => std::option::Option::Some(v),
290            _ => std::option::Option::None,
291        })
292    }
293
294    /// Sets the value of [job_config][crate::model::Job::job_config]
295    /// to hold a `TemplateId`.
296    ///
297    /// Note that all the setters affecting `job_config` are
298    /// mutually exclusive.
299    pub fn set_template_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
300        self.job_config =
301            std::option::Option::Some(crate::model::job::JobConfig::TemplateId(v.into()));
302        self
303    }
304
305    /// The value of [job_config][crate::model::Job::job_config]
306    /// if it holds a `Config`, `None` if the field is not set or
307    /// holds a different branch.
308    pub fn config(&self) -> std::option::Option<&std::boxed::Box<crate::model::JobConfig>> {
309        #[allow(unreachable_patterns)]
310        self.job_config.as_ref().and_then(|v| match v {
311            crate::model::job::JobConfig::Config(v) => std::option::Option::Some(v),
312            _ => std::option::Option::None,
313        })
314    }
315
316    /// Sets the value of [job_config][crate::model::Job::job_config]
317    /// to hold a `Config`.
318    ///
319    /// Note that all the setters affecting `job_config` are
320    /// mutually exclusive.
321    pub fn set_config<T: std::convert::Into<std::boxed::Box<crate::model::JobConfig>>>(
322        mut self,
323        v: T,
324    ) -> Self {
325        self.job_config = std::option::Option::Some(crate::model::job::JobConfig::Config(v.into()));
326        self
327    }
328}
329
330impl wkt::message::Message for Job {
331    fn typename() -> &'static str {
332        "type.googleapis.com/google.cloud.video.transcoder.v1.Job"
333    }
334}
335
336/// Defines additional types related to [Job].
337pub mod job {
338    #[allow(unused_imports)]
339    use super::*;
340
341    /// The current state of the job.
342    ///
343    /// # Working with unknown values
344    ///
345    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
346    /// additional enum variants at any time. Adding new variants is not considered
347    /// a breaking change. Applications should write their code in anticipation of:
348    ///
349    /// - New values appearing in future releases of the client library, **and**
350    /// - New values received dynamically, without application changes.
351    ///
352    /// Please consult the [Working with enums] section in the user guide for some
353    /// guidelines.
354    ///
355    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
356    #[derive(Clone, Debug, PartialEq)]
357    #[non_exhaustive]
358    pub enum ProcessingState {
359        /// The processing state is not specified.
360        Unspecified,
361        /// The job is enqueued and will be picked up for processing soon.
362        Pending,
363        /// The job is being processed.
364        Running,
365        /// The job has been completed successfully.
366        Succeeded,
367        /// The job has failed. For additional information, see
368        /// [Troubleshooting](https://cloud.google.com/transcoder/docs/troubleshooting).
369        Failed,
370        /// If set, the enum was initialized with an unknown value.
371        ///
372        /// Applications can examine the value using [ProcessingState::value] or
373        /// [ProcessingState::name].
374        UnknownValue(processing_state::UnknownValue),
375    }
376
377    #[doc(hidden)]
378    pub mod processing_state {
379        #[allow(unused_imports)]
380        use super::*;
381        #[derive(Clone, Debug, PartialEq)]
382        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
383    }
384
385    impl ProcessingState {
386        /// Gets the enum value.
387        ///
388        /// Returns `None` if the enum contains an unknown value deserialized from
389        /// the string representation of enums.
390        pub fn value(&self) -> std::option::Option<i32> {
391            match self {
392                Self::Unspecified => std::option::Option::Some(0),
393                Self::Pending => std::option::Option::Some(1),
394                Self::Running => std::option::Option::Some(2),
395                Self::Succeeded => std::option::Option::Some(3),
396                Self::Failed => std::option::Option::Some(4),
397                Self::UnknownValue(u) => u.0.value(),
398            }
399        }
400
401        /// Gets the enum value as a string.
402        ///
403        /// Returns `None` if the enum contains an unknown value deserialized from
404        /// the integer representation of enums.
405        pub fn name(&self) -> std::option::Option<&str> {
406            match self {
407                Self::Unspecified => std::option::Option::Some("PROCESSING_STATE_UNSPECIFIED"),
408                Self::Pending => std::option::Option::Some("PENDING"),
409                Self::Running => std::option::Option::Some("RUNNING"),
410                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
411                Self::Failed => std::option::Option::Some("FAILED"),
412                Self::UnknownValue(u) => u.0.name(),
413            }
414        }
415    }
416
417    impl std::default::Default for ProcessingState {
418        fn default() -> Self {
419            use std::convert::From;
420            Self::from(0)
421        }
422    }
423
424    impl std::fmt::Display for ProcessingState {
425        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
426            wkt::internal::display_enum(f, self.name(), self.value())
427        }
428    }
429
430    impl std::convert::From<i32> for ProcessingState {
431        fn from(value: i32) -> Self {
432            match value {
433                0 => Self::Unspecified,
434                1 => Self::Pending,
435                2 => Self::Running,
436                3 => Self::Succeeded,
437                4 => Self::Failed,
438                _ => Self::UnknownValue(processing_state::UnknownValue(
439                    wkt::internal::UnknownEnumValue::Integer(value),
440                )),
441            }
442        }
443    }
444
445    impl std::convert::From<&str> for ProcessingState {
446        fn from(value: &str) -> Self {
447            use std::string::ToString;
448            match value {
449                "PROCESSING_STATE_UNSPECIFIED" => Self::Unspecified,
450                "PENDING" => Self::Pending,
451                "RUNNING" => Self::Running,
452                "SUCCEEDED" => Self::Succeeded,
453                "FAILED" => Self::Failed,
454                _ => Self::UnknownValue(processing_state::UnknownValue(
455                    wkt::internal::UnknownEnumValue::String(value.to_string()),
456                )),
457            }
458        }
459    }
460
461    impl serde::ser::Serialize for ProcessingState {
462        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
463        where
464            S: serde::Serializer,
465        {
466            match self {
467                Self::Unspecified => serializer.serialize_i32(0),
468                Self::Pending => serializer.serialize_i32(1),
469                Self::Running => serializer.serialize_i32(2),
470                Self::Succeeded => serializer.serialize_i32(3),
471                Self::Failed => serializer.serialize_i32(4),
472                Self::UnknownValue(u) => u.0.serialize(serializer),
473            }
474        }
475    }
476
477    impl<'de> serde::de::Deserialize<'de> for ProcessingState {
478        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
479        where
480            D: serde::Deserializer<'de>,
481        {
482            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProcessingState>::new(
483                ".google.cloud.video.transcoder.v1.Job.ProcessingState",
484            ))
485        }
486    }
487
488    /// The processing mode of the job.
489    ///
490    /// # Working with unknown values
491    ///
492    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
493    /// additional enum variants at any time. Adding new variants is not considered
494    /// a breaking change. Applications should write their code in anticipation of:
495    ///
496    /// - New values appearing in future releases of the client library, **and**
497    /// - New values received dynamically, without application changes.
498    ///
499    /// Please consult the [Working with enums] section in the user guide for some
500    /// guidelines.
501    ///
502    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
503    #[derive(Clone, Debug, PartialEq)]
504    #[non_exhaustive]
505    pub enum ProcessingMode {
506        /// The job processing mode is not specified.
507        Unspecified,
508        /// The job processing mode is interactive mode.
509        /// Interactive job will either be ran or rejected if quota does not allow
510        /// for it.
511        Interactive,
512        /// The job processing mode is batch mode.
513        /// Batch mode allows queuing of jobs.
514        Batch,
515        /// If set, the enum was initialized with an unknown value.
516        ///
517        /// Applications can examine the value using [ProcessingMode::value] or
518        /// [ProcessingMode::name].
519        UnknownValue(processing_mode::UnknownValue),
520    }
521
522    #[doc(hidden)]
523    pub mod processing_mode {
524        #[allow(unused_imports)]
525        use super::*;
526        #[derive(Clone, Debug, PartialEq)]
527        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
528    }
529
530    impl ProcessingMode {
531        /// Gets the enum value.
532        ///
533        /// Returns `None` if the enum contains an unknown value deserialized from
534        /// the string representation of enums.
535        pub fn value(&self) -> std::option::Option<i32> {
536            match self {
537                Self::Unspecified => std::option::Option::Some(0),
538                Self::Interactive => std::option::Option::Some(1),
539                Self::Batch => std::option::Option::Some(2),
540                Self::UnknownValue(u) => u.0.value(),
541            }
542        }
543
544        /// Gets the enum value as a string.
545        ///
546        /// Returns `None` if the enum contains an unknown value deserialized from
547        /// the integer representation of enums.
548        pub fn name(&self) -> std::option::Option<&str> {
549            match self {
550                Self::Unspecified => std::option::Option::Some("PROCESSING_MODE_UNSPECIFIED"),
551                Self::Interactive => std::option::Option::Some("PROCESSING_MODE_INTERACTIVE"),
552                Self::Batch => std::option::Option::Some("PROCESSING_MODE_BATCH"),
553                Self::UnknownValue(u) => u.0.name(),
554            }
555        }
556    }
557
558    impl std::default::Default for ProcessingMode {
559        fn default() -> Self {
560            use std::convert::From;
561            Self::from(0)
562        }
563    }
564
565    impl std::fmt::Display for ProcessingMode {
566        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
567            wkt::internal::display_enum(f, self.name(), self.value())
568        }
569    }
570
571    impl std::convert::From<i32> for ProcessingMode {
572        fn from(value: i32) -> Self {
573            match value {
574                0 => Self::Unspecified,
575                1 => Self::Interactive,
576                2 => Self::Batch,
577                _ => Self::UnknownValue(processing_mode::UnknownValue(
578                    wkt::internal::UnknownEnumValue::Integer(value),
579                )),
580            }
581        }
582    }
583
584    impl std::convert::From<&str> for ProcessingMode {
585        fn from(value: &str) -> Self {
586            use std::string::ToString;
587            match value {
588                "PROCESSING_MODE_UNSPECIFIED" => Self::Unspecified,
589                "PROCESSING_MODE_INTERACTIVE" => Self::Interactive,
590                "PROCESSING_MODE_BATCH" => Self::Batch,
591                _ => Self::UnknownValue(processing_mode::UnknownValue(
592                    wkt::internal::UnknownEnumValue::String(value.to_string()),
593                )),
594            }
595        }
596    }
597
598    impl serde::ser::Serialize for ProcessingMode {
599        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
600        where
601            S: serde::Serializer,
602        {
603            match self {
604                Self::Unspecified => serializer.serialize_i32(0),
605                Self::Interactive => serializer.serialize_i32(1),
606                Self::Batch => serializer.serialize_i32(2),
607                Self::UnknownValue(u) => u.0.serialize(serializer),
608            }
609        }
610    }
611
612    impl<'de> serde::de::Deserialize<'de> for ProcessingMode {
613        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
614        where
615            D: serde::Deserializer<'de>,
616        {
617            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProcessingMode>::new(
618                ".google.cloud.video.transcoder.v1.Job.ProcessingMode",
619            ))
620        }
621    }
622
623    /// The optimization strategy of the job. The default is `AUTODETECT`.
624    ///
625    /// # Working with unknown values
626    ///
627    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
628    /// additional enum variants at any time. Adding new variants is not considered
629    /// a breaking change. Applications should write their code in anticipation of:
630    ///
631    /// - New values appearing in future releases of the client library, **and**
632    /// - New values received dynamically, without application changes.
633    ///
634    /// Please consult the [Working with enums] section in the user guide for some
635    /// guidelines.
636    ///
637    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
638    #[derive(Clone, Debug, PartialEq)]
639    #[non_exhaustive]
640    pub enum OptimizationStrategy {
641        /// The optimization strategy is not specified.
642        Unspecified,
643        /// Prioritize job processing speed.
644        Autodetect,
645        /// Disable all optimizations.
646        Disabled,
647        /// If set, the enum was initialized with an unknown value.
648        ///
649        /// Applications can examine the value using [OptimizationStrategy::value] or
650        /// [OptimizationStrategy::name].
651        UnknownValue(optimization_strategy::UnknownValue),
652    }
653
654    #[doc(hidden)]
655    pub mod optimization_strategy {
656        #[allow(unused_imports)]
657        use super::*;
658        #[derive(Clone, Debug, PartialEq)]
659        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
660    }
661
662    impl OptimizationStrategy {
663        /// Gets the enum value.
664        ///
665        /// Returns `None` if the enum contains an unknown value deserialized from
666        /// the string representation of enums.
667        pub fn value(&self) -> std::option::Option<i32> {
668            match self {
669                Self::Unspecified => std::option::Option::Some(0),
670                Self::Autodetect => std::option::Option::Some(1),
671                Self::Disabled => std::option::Option::Some(2),
672                Self::UnknownValue(u) => u.0.value(),
673            }
674        }
675
676        /// Gets the enum value as a string.
677        ///
678        /// Returns `None` if the enum contains an unknown value deserialized from
679        /// the integer representation of enums.
680        pub fn name(&self) -> std::option::Option<&str> {
681            match self {
682                Self::Unspecified => std::option::Option::Some("OPTIMIZATION_STRATEGY_UNSPECIFIED"),
683                Self::Autodetect => std::option::Option::Some("AUTODETECT"),
684                Self::Disabled => std::option::Option::Some("DISABLED"),
685                Self::UnknownValue(u) => u.0.name(),
686            }
687        }
688    }
689
690    impl std::default::Default for OptimizationStrategy {
691        fn default() -> Self {
692            use std::convert::From;
693            Self::from(0)
694        }
695    }
696
697    impl std::fmt::Display for OptimizationStrategy {
698        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
699            wkt::internal::display_enum(f, self.name(), self.value())
700        }
701    }
702
703    impl std::convert::From<i32> for OptimizationStrategy {
704        fn from(value: i32) -> Self {
705            match value {
706                0 => Self::Unspecified,
707                1 => Self::Autodetect,
708                2 => Self::Disabled,
709                _ => Self::UnknownValue(optimization_strategy::UnknownValue(
710                    wkt::internal::UnknownEnumValue::Integer(value),
711                )),
712            }
713        }
714    }
715
716    impl std::convert::From<&str> for OptimizationStrategy {
717        fn from(value: &str) -> Self {
718            use std::string::ToString;
719            match value {
720                "OPTIMIZATION_STRATEGY_UNSPECIFIED" => Self::Unspecified,
721                "AUTODETECT" => Self::Autodetect,
722                "DISABLED" => Self::Disabled,
723                _ => Self::UnknownValue(optimization_strategy::UnknownValue(
724                    wkt::internal::UnknownEnumValue::String(value.to_string()),
725                )),
726            }
727        }
728    }
729
730    impl serde::ser::Serialize for OptimizationStrategy {
731        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
732        where
733            S: serde::Serializer,
734        {
735            match self {
736                Self::Unspecified => serializer.serialize_i32(0),
737                Self::Autodetect => serializer.serialize_i32(1),
738                Self::Disabled => serializer.serialize_i32(2),
739                Self::UnknownValue(u) => u.0.serialize(serializer),
740            }
741        }
742    }
743
744    impl<'de> serde::de::Deserialize<'de> for OptimizationStrategy {
745        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
746        where
747            D: serde::Deserializer<'de>,
748        {
749            deserializer.deserialize_any(wkt::internal::EnumVisitor::<OptimizationStrategy>::new(
750                ".google.cloud.video.transcoder.v1.Job.OptimizationStrategy",
751            ))
752        }
753    }
754
755    /// Specify the config for the transcoding job. If you don't specify the
756    /// `job_config`, the API selects `templateId`; this template ID is set to
757    /// `preset/web-hd` by default. When you use a `template_id` to create a job,
758    /// the `Job.config` is populated by the `JobTemplate.config`.\<br\>
759    #[derive(Clone, Debug, PartialEq)]
760    #[non_exhaustive]
761    pub enum JobConfig {
762        /// Input only. Specify the `template_id` to use for populating `Job.config`.
763        /// The default is `preset/web-hd`, which is the only supported preset.
764        ///
765        /// User defined JobTemplate: `{job_template_id}`
766        TemplateId(std::string::String),
767        /// The configuration for this job.
768        Config(std::boxed::Box<crate::model::JobConfig>),
769    }
770}
771
772/// Transcoding job template resource.
773#[derive(Clone, Default, PartialEq)]
774#[non_exhaustive]
775pub struct JobTemplate {
776    /// The resource name of the job template.
777    /// Format:
778    /// `projects/{project_number}/locations/{location}/jobTemplates/{job_template}`
779    pub name: std::string::String,
780
781    /// The configuration for this template.
782    pub config: std::option::Option<crate::model::JobConfig>,
783
784    /// The labels associated with this job template. You can use these to organize
785    /// and group your job templates.
786    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
787
788    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
789}
790
791impl JobTemplate {
792    pub fn new() -> Self {
793        std::default::Default::default()
794    }
795
796    /// Sets the value of [name][crate::model::JobTemplate::name].
797    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
798        self.name = v.into();
799        self
800    }
801
802    /// Sets the value of [config][crate::model::JobTemplate::config].
803    pub fn set_config<T>(mut self, v: T) -> Self
804    where
805        T: std::convert::Into<crate::model::JobConfig>,
806    {
807        self.config = std::option::Option::Some(v.into());
808        self
809    }
810
811    /// Sets or clears the value of [config][crate::model::JobTemplate::config].
812    pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
813    where
814        T: std::convert::Into<crate::model::JobConfig>,
815    {
816        self.config = v.map(|x| x.into());
817        self
818    }
819
820    /// Sets the value of [labels][crate::model::JobTemplate::labels].
821    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
822    where
823        T: std::iter::IntoIterator<Item = (K, V)>,
824        K: std::convert::Into<std::string::String>,
825        V: std::convert::Into<std::string::String>,
826    {
827        use std::iter::Iterator;
828        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
829        self
830    }
831}
832
833impl wkt::message::Message for JobTemplate {
834    fn typename() -> &'static str {
835        "type.googleapis.com/google.cloud.video.transcoder.v1.JobTemplate"
836    }
837}
838
839/// Job configuration
840#[derive(Clone, Default, PartialEq)]
841#[non_exhaustive]
842pub struct JobConfig {
843    /// List of input assets stored in Cloud Storage.
844    pub inputs: std::vec::Vec<crate::model::Input>,
845
846    /// List of edit atoms. Defines the ultimate timeline of the resulting
847    /// file or manifest.
848    pub edit_list: std::vec::Vec<crate::model::EditAtom>,
849
850    /// List of elementary streams.
851    pub elementary_streams: std::vec::Vec<crate::model::ElementaryStream>,
852
853    /// List of multiplexing settings for output streams.
854    pub mux_streams: std::vec::Vec<crate::model::MuxStream>,
855
856    /// List of output manifests.
857    pub manifests: std::vec::Vec<crate::model::Manifest>,
858
859    /// Output configuration.
860    pub output: std::option::Option<crate::model::Output>,
861
862    /// List of ad breaks. Specifies where to insert ad break tags in the output
863    /// manifests.
864    pub ad_breaks: std::vec::Vec<crate::model::AdBreak>,
865
866    /// Destination on Pub/Sub.
867    pub pubsub_destination: std::option::Option<crate::model::PubsubDestination>,
868
869    /// List of output sprite sheets.
870    /// Spritesheets require at least one VideoStream in the Jobconfig.
871    pub sprite_sheets: std::vec::Vec<crate::model::SpriteSheet>,
872
873    /// List of overlays on the output video, in descending Z-order.
874    pub overlays: std::vec::Vec<crate::model::Overlay>,
875
876    /// List of encryption configurations for the content.
877    /// Each configuration has an ID. Specify this ID in the
878    /// [MuxStream.encryption_id][google.cloud.video.transcoder.v1.MuxStream.encryption_id]
879    /// field to indicate the configuration to use for that `MuxStream` output.
880    ///
881    /// [google.cloud.video.transcoder.v1.MuxStream.encryption_id]: crate::model::MuxStream::encryption_id
882    pub encryptions: std::vec::Vec<crate::model::Encryption>,
883
884    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
885}
886
887impl JobConfig {
888    pub fn new() -> Self {
889        std::default::Default::default()
890    }
891
892    /// Sets the value of [inputs][crate::model::JobConfig::inputs].
893    pub fn set_inputs<T, V>(mut self, v: T) -> Self
894    where
895        T: std::iter::IntoIterator<Item = V>,
896        V: std::convert::Into<crate::model::Input>,
897    {
898        use std::iter::Iterator;
899        self.inputs = v.into_iter().map(|i| i.into()).collect();
900        self
901    }
902
903    /// Sets the value of [edit_list][crate::model::JobConfig::edit_list].
904    pub fn set_edit_list<T, V>(mut self, v: T) -> Self
905    where
906        T: std::iter::IntoIterator<Item = V>,
907        V: std::convert::Into<crate::model::EditAtom>,
908    {
909        use std::iter::Iterator;
910        self.edit_list = v.into_iter().map(|i| i.into()).collect();
911        self
912    }
913
914    /// Sets the value of [elementary_streams][crate::model::JobConfig::elementary_streams].
915    pub fn set_elementary_streams<T, V>(mut self, v: T) -> Self
916    where
917        T: std::iter::IntoIterator<Item = V>,
918        V: std::convert::Into<crate::model::ElementaryStream>,
919    {
920        use std::iter::Iterator;
921        self.elementary_streams = v.into_iter().map(|i| i.into()).collect();
922        self
923    }
924
925    /// Sets the value of [mux_streams][crate::model::JobConfig::mux_streams].
926    pub fn set_mux_streams<T, V>(mut self, v: T) -> Self
927    where
928        T: std::iter::IntoIterator<Item = V>,
929        V: std::convert::Into<crate::model::MuxStream>,
930    {
931        use std::iter::Iterator;
932        self.mux_streams = v.into_iter().map(|i| i.into()).collect();
933        self
934    }
935
936    /// Sets the value of [manifests][crate::model::JobConfig::manifests].
937    pub fn set_manifests<T, V>(mut self, v: T) -> Self
938    where
939        T: std::iter::IntoIterator<Item = V>,
940        V: std::convert::Into<crate::model::Manifest>,
941    {
942        use std::iter::Iterator;
943        self.manifests = v.into_iter().map(|i| i.into()).collect();
944        self
945    }
946
947    /// Sets the value of [output][crate::model::JobConfig::output].
948    pub fn set_output<T>(mut self, v: T) -> Self
949    where
950        T: std::convert::Into<crate::model::Output>,
951    {
952        self.output = std::option::Option::Some(v.into());
953        self
954    }
955
956    /// Sets or clears the value of [output][crate::model::JobConfig::output].
957    pub fn set_or_clear_output<T>(mut self, v: std::option::Option<T>) -> Self
958    where
959        T: std::convert::Into<crate::model::Output>,
960    {
961        self.output = v.map(|x| x.into());
962        self
963    }
964
965    /// Sets the value of [ad_breaks][crate::model::JobConfig::ad_breaks].
966    pub fn set_ad_breaks<T, V>(mut self, v: T) -> Self
967    where
968        T: std::iter::IntoIterator<Item = V>,
969        V: std::convert::Into<crate::model::AdBreak>,
970    {
971        use std::iter::Iterator;
972        self.ad_breaks = v.into_iter().map(|i| i.into()).collect();
973        self
974    }
975
976    /// Sets the value of [pubsub_destination][crate::model::JobConfig::pubsub_destination].
977    pub fn set_pubsub_destination<T>(mut self, v: T) -> Self
978    where
979        T: std::convert::Into<crate::model::PubsubDestination>,
980    {
981        self.pubsub_destination = std::option::Option::Some(v.into());
982        self
983    }
984
985    /// Sets or clears the value of [pubsub_destination][crate::model::JobConfig::pubsub_destination].
986    pub fn set_or_clear_pubsub_destination<T>(mut self, v: std::option::Option<T>) -> Self
987    where
988        T: std::convert::Into<crate::model::PubsubDestination>,
989    {
990        self.pubsub_destination = v.map(|x| x.into());
991        self
992    }
993
994    /// Sets the value of [sprite_sheets][crate::model::JobConfig::sprite_sheets].
995    pub fn set_sprite_sheets<T, V>(mut self, v: T) -> Self
996    where
997        T: std::iter::IntoIterator<Item = V>,
998        V: std::convert::Into<crate::model::SpriteSheet>,
999    {
1000        use std::iter::Iterator;
1001        self.sprite_sheets = v.into_iter().map(|i| i.into()).collect();
1002        self
1003    }
1004
1005    /// Sets the value of [overlays][crate::model::JobConfig::overlays].
1006    pub fn set_overlays<T, V>(mut self, v: T) -> Self
1007    where
1008        T: std::iter::IntoIterator<Item = V>,
1009        V: std::convert::Into<crate::model::Overlay>,
1010    {
1011        use std::iter::Iterator;
1012        self.overlays = v.into_iter().map(|i| i.into()).collect();
1013        self
1014    }
1015
1016    /// Sets the value of [encryptions][crate::model::JobConfig::encryptions].
1017    pub fn set_encryptions<T, V>(mut self, v: T) -> Self
1018    where
1019        T: std::iter::IntoIterator<Item = V>,
1020        V: std::convert::Into<crate::model::Encryption>,
1021    {
1022        use std::iter::Iterator;
1023        self.encryptions = v.into_iter().map(|i| i.into()).collect();
1024        self
1025    }
1026}
1027
1028impl wkt::message::Message for JobConfig {
1029    fn typename() -> &'static str {
1030        "type.googleapis.com/google.cloud.video.transcoder.v1.JobConfig"
1031    }
1032}
1033
1034/// Input asset.
1035#[derive(Clone, Default, PartialEq)]
1036#[non_exhaustive]
1037pub struct Input {
1038    /// A unique key for this input. Must be specified when using advanced
1039    /// mapping and edit lists.
1040    pub key: std::string::String,
1041
1042    /// URI of the media. Input files must be at least 5 seconds in duration and
1043    /// stored in Cloud Storage (for example, `gs://bucket/inputs/file.mp4`).
1044    /// If empty, the value is populated from
1045    /// [Job.input_uri][google.cloud.video.transcoder.v1.Job.input_uri]. See
1046    /// [Supported input and output
1047    /// formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats).
1048    ///
1049    /// [google.cloud.video.transcoder.v1.Job.input_uri]: crate::model::Job::input_uri
1050    pub uri: std::string::String,
1051
1052    /// Preprocessing configurations.
1053    pub preprocessing_config: std::option::Option<crate::model::PreprocessingConfig>,
1054
1055    /// Optional. Input Attributes.
1056    pub attributes: std::option::Option<crate::model::InputAttributes>,
1057
1058    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1059}
1060
1061impl Input {
1062    pub fn new() -> Self {
1063        std::default::Default::default()
1064    }
1065
1066    /// Sets the value of [key][crate::model::Input::key].
1067    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1068        self.key = v.into();
1069        self
1070    }
1071
1072    /// Sets the value of [uri][crate::model::Input::uri].
1073    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1074        self.uri = v.into();
1075        self
1076    }
1077
1078    /// Sets the value of [preprocessing_config][crate::model::Input::preprocessing_config].
1079    pub fn set_preprocessing_config<T>(mut self, v: T) -> Self
1080    where
1081        T: std::convert::Into<crate::model::PreprocessingConfig>,
1082    {
1083        self.preprocessing_config = std::option::Option::Some(v.into());
1084        self
1085    }
1086
1087    /// Sets or clears the value of [preprocessing_config][crate::model::Input::preprocessing_config].
1088    pub fn set_or_clear_preprocessing_config<T>(mut self, v: std::option::Option<T>) -> Self
1089    where
1090        T: std::convert::Into<crate::model::PreprocessingConfig>,
1091    {
1092        self.preprocessing_config = v.map(|x| x.into());
1093        self
1094    }
1095
1096    /// Sets the value of [attributes][crate::model::Input::attributes].
1097    pub fn set_attributes<T>(mut self, v: T) -> Self
1098    where
1099        T: std::convert::Into<crate::model::InputAttributes>,
1100    {
1101        self.attributes = std::option::Option::Some(v.into());
1102        self
1103    }
1104
1105    /// Sets or clears the value of [attributes][crate::model::Input::attributes].
1106    pub fn set_or_clear_attributes<T>(mut self, v: std::option::Option<T>) -> Self
1107    where
1108        T: std::convert::Into<crate::model::InputAttributes>,
1109    {
1110        self.attributes = v.map(|x| x.into());
1111        self
1112    }
1113}
1114
1115impl wkt::message::Message for Input {
1116    fn typename() -> &'static str {
1117        "type.googleapis.com/google.cloud.video.transcoder.v1.Input"
1118    }
1119}
1120
1121/// Location of output file(s) in a Cloud Storage bucket.
1122#[derive(Clone, Default, PartialEq)]
1123#[non_exhaustive]
1124pub struct Output {
1125    /// URI for the output file(s). For example, `gs://my-bucket/outputs/`. Must be
1126    /// a directory and not a top-level bucket. If empty, the value is populated
1127    /// from [Job.output_uri][google.cloud.video.transcoder.v1.Job.output_uri]. See
1128    /// [Supported input and output
1129    /// formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats).
1130    ///
1131    /// [google.cloud.video.transcoder.v1.Job.output_uri]: crate::model::Job::output_uri
1132    pub uri: std::string::String,
1133
1134    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1135}
1136
1137impl Output {
1138    pub fn new() -> Self {
1139        std::default::Default::default()
1140    }
1141
1142    /// Sets the value of [uri][crate::model::Output::uri].
1143    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1144        self.uri = v.into();
1145        self
1146    }
1147}
1148
1149impl wkt::message::Message for Output {
1150    fn typename() -> &'static str {
1151        "type.googleapis.com/google.cloud.video.transcoder.v1.Output"
1152    }
1153}
1154
1155/// Edit atom.
1156#[derive(Clone, Default, PartialEq)]
1157#[non_exhaustive]
1158pub struct EditAtom {
1159    /// A unique key for this atom. Must be specified when using advanced
1160    /// mapping.
1161    pub key: std::string::String,
1162
1163    /// List of [Input.key][google.cloud.video.transcoder.v1.Input.key] values
1164    /// identifying files that should be used in this atom. The listed `inputs`
1165    /// must have the same timeline.
1166    ///
1167    /// [google.cloud.video.transcoder.v1.Input.key]: crate::model::Input::key
1168    pub inputs: std::vec::Vec<std::string::String>,
1169
1170    /// End time in seconds for the atom, relative to the input file timeline.
1171    /// When `end_time_offset` is not specified, the `inputs` are used until
1172    /// the end of the atom.
1173    pub end_time_offset: std::option::Option<wkt::Duration>,
1174
1175    /// Start time in seconds for the atom, relative to the input file timeline.
1176    /// The default is `0s`.
1177    pub start_time_offset: std::option::Option<wkt::Duration>,
1178
1179    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1180}
1181
1182impl EditAtom {
1183    pub fn new() -> Self {
1184        std::default::Default::default()
1185    }
1186
1187    /// Sets the value of [key][crate::model::EditAtom::key].
1188    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1189        self.key = v.into();
1190        self
1191    }
1192
1193    /// Sets the value of [inputs][crate::model::EditAtom::inputs].
1194    pub fn set_inputs<T, V>(mut self, v: T) -> Self
1195    where
1196        T: std::iter::IntoIterator<Item = V>,
1197        V: std::convert::Into<std::string::String>,
1198    {
1199        use std::iter::Iterator;
1200        self.inputs = v.into_iter().map(|i| i.into()).collect();
1201        self
1202    }
1203
1204    /// Sets the value of [end_time_offset][crate::model::EditAtom::end_time_offset].
1205    pub fn set_end_time_offset<T>(mut self, v: T) -> Self
1206    where
1207        T: std::convert::Into<wkt::Duration>,
1208    {
1209        self.end_time_offset = std::option::Option::Some(v.into());
1210        self
1211    }
1212
1213    /// Sets or clears the value of [end_time_offset][crate::model::EditAtom::end_time_offset].
1214    pub fn set_or_clear_end_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
1215    where
1216        T: std::convert::Into<wkt::Duration>,
1217    {
1218        self.end_time_offset = v.map(|x| x.into());
1219        self
1220    }
1221
1222    /// Sets the value of [start_time_offset][crate::model::EditAtom::start_time_offset].
1223    pub fn set_start_time_offset<T>(mut self, v: T) -> Self
1224    where
1225        T: std::convert::Into<wkt::Duration>,
1226    {
1227        self.start_time_offset = std::option::Option::Some(v.into());
1228        self
1229    }
1230
1231    /// Sets or clears the value of [start_time_offset][crate::model::EditAtom::start_time_offset].
1232    pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
1233    where
1234        T: std::convert::Into<wkt::Duration>,
1235    {
1236        self.start_time_offset = v.map(|x| x.into());
1237        self
1238    }
1239}
1240
1241impl wkt::message::Message for EditAtom {
1242    fn typename() -> &'static str {
1243        "type.googleapis.com/google.cloud.video.transcoder.v1.EditAtom"
1244    }
1245}
1246
1247/// Ad break.
1248#[derive(Clone, Default, PartialEq)]
1249#[non_exhaustive]
1250pub struct AdBreak {
1251    /// Start time in seconds for the ad break, relative to the output file
1252    /// timeline. The default is `0s`.
1253    pub start_time_offset: std::option::Option<wkt::Duration>,
1254
1255    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1256}
1257
1258impl AdBreak {
1259    pub fn new() -> Self {
1260        std::default::Default::default()
1261    }
1262
1263    /// Sets the value of [start_time_offset][crate::model::AdBreak::start_time_offset].
1264    pub fn set_start_time_offset<T>(mut self, v: T) -> Self
1265    where
1266        T: std::convert::Into<wkt::Duration>,
1267    {
1268        self.start_time_offset = std::option::Option::Some(v.into());
1269        self
1270    }
1271
1272    /// Sets or clears the value of [start_time_offset][crate::model::AdBreak::start_time_offset].
1273    pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
1274    where
1275        T: std::convert::Into<wkt::Duration>,
1276    {
1277        self.start_time_offset = v.map(|x| x.into());
1278        self
1279    }
1280}
1281
1282impl wkt::message::Message for AdBreak {
1283    fn typename() -> &'static str {
1284        "type.googleapis.com/google.cloud.video.transcoder.v1.AdBreak"
1285    }
1286}
1287
1288/// Encoding of an input file such as an audio, video, or text track.
1289/// Elementary streams must be packaged before
1290/// mapping and sharing between different output formats.
1291#[derive(Clone, Default, PartialEq)]
1292#[non_exhaustive]
1293pub struct ElementaryStream {
1294    /// A unique key for this elementary stream.
1295    pub key: std::string::String,
1296
1297    /// Encoding of an audio, video, or text track.
1298    pub elementary_stream: std::option::Option<crate::model::elementary_stream::ElementaryStream>,
1299
1300    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1301}
1302
1303impl ElementaryStream {
1304    pub fn new() -> Self {
1305        std::default::Default::default()
1306    }
1307
1308    /// Sets the value of [key][crate::model::ElementaryStream::key].
1309    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1310        self.key = v.into();
1311        self
1312    }
1313
1314    /// Sets the value of [elementary_stream][crate::model::ElementaryStream::elementary_stream].
1315    ///
1316    /// Note that all the setters affecting `elementary_stream` are mutually
1317    /// exclusive.
1318    pub fn set_elementary_stream<
1319        T: std::convert::Into<std::option::Option<crate::model::elementary_stream::ElementaryStream>>,
1320    >(
1321        mut self,
1322        v: T,
1323    ) -> Self {
1324        self.elementary_stream = v.into();
1325        self
1326    }
1327
1328    /// The value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
1329    /// if it holds a `VideoStream`, `None` if the field is not set or
1330    /// holds a different branch.
1331    pub fn video_stream(&self) -> std::option::Option<&std::boxed::Box<crate::model::VideoStream>> {
1332        #[allow(unreachable_patterns)]
1333        self.elementary_stream.as_ref().and_then(|v| match v {
1334            crate::model::elementary_stream::ElementaryStream::VideoStream(v) => {
1335                std::option::Option::Some(v)
1336            }
1337            _ => std::option::Option::None,
1338        })
1339    }
1340
1341    /// Sets the value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
1342    /// to hold a `VideoStream`.
1343    ///
1344    /// Note that all the setters affecting `elementary_stream` are
1345    /// mutually exclusive.
1346    pub fn set_video_stream<T: std::convert::Into<std::boxed::Box<crate::model::VideoStream>>>(
1347        mut self,
1348        v: T,
1349    ) -> Self {
1350        self.elementary_stream = std::option::Option::Some(
1351            crate::model::elementary_stream::ElementaryStream::VideoStream(v.into()),
1352        );
1353        self
1354    }
1355
1356    /// The value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
1357    /// if it holds a `AudioStream`, `None` if the field is not set or
1358    /// holds a different branch.
1359    pub fn audio_stream(&self) -> std::option::Option<&std::boxed::Box<crate::model::AudioStream>> {
1360        #[allow(unreachable_patterns)]
1361        self.elementary_stream.as_ref().and_then(|v| match v {
1362            crate::model::elementary_stream::ElementaryStream::AudioStream(v) => {
1363                std::option::Option::Some(v)
1364            }
1365            _ => std::option::Option::None,
1366        })
1367    }
1368
1369    /// Sets the value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
1370    /// to hold a `AudioStream`.
1371    ///
1372    /// Note that all the setters affecting `elementary_stream` are
1373    /// mutually exclusive.
1374    pub fn set_audio_stream<T: std::convert::Into<std::boxed::Box<crate::model::AudioStream>>>(
1375        mut self,
1376        v: T,
1377    ) -> Self {
1378        self.elementary_stream = std::option::Option::Some(
1379            crate::model::elementary_stream::ElementaryStream::AudioStream(v.into()),
1380        );
1381        self
1382    }
1383
1384    /// The value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
1385    /// if it holds a `TextStream`, `None` if the field is not set or
1386    /// holds a different branch.
1387    pub fn text_stream(&self) -> std::option::Option<&std::boxed::Box<crate::model::TextStream>> {
1388        #[allow(unreachable_patterns)]
1389        self.elementary_stream.as_ref().and_then(|v| match v {
1390            crate::model::elementary_stream::ElementaryStream::TextStream(v) => {
1391                std::option::Option::Some(v)
1392            }
1393            _ => std::option::Option::None,
1394        })
1395    }
1396
1397    /// Sets the value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
1398    /// to hold a `TextStream`.
1399    ///
1400    /// Note that all the setters affecting `elementary_stream` are
1401    /// mutually exclusive.
1402    pub fn set_text_stream<T: std::convert::Into<std::boxed::Box<crate::model::TextStream>>>(
1403        mut self,
1404        v: T,
1405    ) -> Self {
1406        self.elementary_stream = std::option::Option::Some(
1407            crate::model::elementary_stream::ElementaryStream::TextStream(v.into()),
1408        );
1409        self
1410    }
1411}
1412
1413impl wkt::message::Message for ElementaryStream {
1414    fn typename() -> &'static str {
1415        "type.googleapis.com/google.cloud.video.transcoder.v1.ElementaryStream"
1416    }
1417}
1418
1419/// Defines additional types related to [ElementaryStream].
1420pub mod elementary_stream {
1421    #[allow(unused_imports)]
1422    use super::*;
1423
1424    /// Encoding of an audio, video, or text track.
1425    #[derive(Clone, Debug, PartialEq)]
1426    #[non_exhaustive]
1427    pub enum ElementaryStream {
1428        /// Encoding of a video stream.
1429        VideoStream(std::boxed::Box<crate::model::VideoStream>),
1430        /// Encoding of an audio stream.
1431        AudioStream(std::boxed::Box<crate::model::AudioStream>),
1432        /// Encoding of a text stream. For example, closed captions or subtitles.
1433        TextStream(std::boxed::Box<crate::model::TextStream>),
1434    }
1435}
1436
1437/// Multiplexing settings for output stream.
1438#[derive(Clone, Default, PartialEq)]
1439#[non_exhaustive]
1440pub struct MuxStream {
1441    /// A unique key for this multiplexed stream.
1442    pub key: std::string::String,
1443
1444    /// The name of the generated file. The default is
1445    /// [MuxStream.key][google.cloud.video.transcoder.v1.MuxStream.key] with the
1446    /// extension suffix corresponding to the
1447    /// [MuxStream.container][google.cloud.video.transcoder.v1.MuxStream.container].
1448    ///
1449    /// Individual segments also have an incremental 10-digit zero-padded suffix
1450    /// starting from 0 before the extension, such as `mux_stream0000000123.ts`.
1451    ///
1452    /// [google.cloud.video.transcoder.v1.MuxStream.container]: crate::model::MuxStream::container
1453    /// [google.cloud.video.transcoder.v1.MuxStream.key]: crate::model::MuxStream::key
1454    pub file_name: std::string::String,
1455
1456    /// The container format. The default is `mp4`
1457    ///
1458    /// Supported streaming formats:
1459    ///
1460    /// - `ts`
1461    /// - `fmp4`- the corresponding file extension is `.m4s`
1462    ///
1463    /// Supported standalone file formats:
1464    ///
1465    /// - `mp4`
1466    /// - `mp3`
1467    /// - `ogg`
1468    /// - `vtt`
1469    ///
1470    /// See also:
1471    /// [Supported input and output
1472    /// formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats)
1473    pub container: std::string::String,
1474
1475    /// List of
1476    /// [ElementaryStream.key][google.cloud.video.transcoder.v1.ElementaryStream.key]
1477    /// values multiplexed in this stream.
1478    ///
1479    /// [google.cloud.video.transcoder.v1.ElementaryStream.key]: crate::model::ElementaryStream::key
1480    pub elementary_streams: std::vec::Vec<std::string::String>,
1481
1482    /// Segment settings for `ts`, `fmp4` and `vtt`.
1483    pub segment_settings: std::option::Option<crate::model::SegmentSettings>,
1484
1485    /// Identifier of the encryption configuration to use. If omitted, output will
1486    /// be unencrypted.
1487    pub encryption_id: std::string::String,
1488
1489    /// Specifies the container configuration.
1490    pub container_config: std::option::Option<crate::model::mux_stream::ContainerConfig>,
1491
1492    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1493}
1494
1495impl MuxStream {
1496    pub fn new() -> Self {
1497        std::default::Default::default()
1498    }
1499
1500    /// Sets the value of [key][crate::model::MuxStream::key].
1501    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1502        self.key = v.into();
1503        self
1504    }
1505
1506    /// Sets the value of [file_name][crate::model::MuxStream::file_name].
1507    pub fn set_file_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1508        self.file_name = v.into();
1509        self
1510    }
1511
1512    /// Sets the value of [container][crate::model::MuxStream::container].
1513    pub fn set_container<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1514        self.container = v.into();
1515        self
1516    }
1517
1518    /// Sets the value of [elementary_streams][crate::model::MuxStream::elementary_streams].
1519    pub fn set_elementary_streams<T, V>(mut self, v: T) -> Self
1520    where
1521        T: std::iter::IntoIterator<Item = V>,
1522        V: std::convert::Into<std::string::String>,
1523    {
1524        use std::iter::Iterator;
1525        self.elementary_streams = v.into_iter().map(|i| i.into()).collect();
1526        self
1527    }
1528
1529    /// Sets the value of [segment_settings][crate::model::MuxStream::segment_settings].
1530    pub fn set_segment_settings<T>(mut self, v: T) -> Self
1531    where
1532        T: std::convert::Into<crate::model::SegmentSettings>,
1533    {
1534        self.segment_settings = std::option::Option::Some(v.into());
1535        self
1536    }
1537
1538    /// Sets or clears the value of [segment_settings][crate::model::MuxStream::segment_settings].
1539    pub fn set_or_clear_segment_settings<T>(mut self, v: std::option::Option<T>) -> Self
1540    where
1541        T: std::convert::Into<crate::model::SegmentSettings>,
1542    {
1543        self.segment_settings = v.map(|x| x.into());
1544        self
1545    }
1546
1547    /// Sets the value of [encryption_id][crate::model::MuxStream::encryption_id].
1548    pub fn set_encryption_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1549        self.encryption_id = v.into();
1550        self
1551    }
1552
1553    /// Sets the value of [container_config][crate::model::MuxStream::container_config].
1554    ///
1555    /// Note that all the setters affecting `container_config` are mutually
1556    /// exclusive.
1557    pub fn set_container_config<
1558        T: std::convert::Into<std::option::Option<crate::model::mux_stream::ContainerConfig>>,
1559    >(
1560        mut self,
1561        v: T,
1562    ) -> Self {
1563        self.container_config = v.into();
1564        self
1565    }
1566
1567    /// The value of [container_config][crate::model::MuxStream::container_config]
1568    /// if it holds a `Fmp4`, `None` if the field is not set or
1569    /// holds a different branch.
1570    pub fn fmp4(
1571        &self,
1572    ) -> std::option::Option<&std::boxed::Box<crate::model::mux_stream::Fmp4Config>> {
1573        #[allow(unreachable_patterns)]
1574        self.container_config.as_ref().and_then(|v| match v {
1575            crate::model::mux_stream::ContainerConfig::Fmp4(v) => std::option::Option::Some(v),
1576            _ => std::option::Option::None,
1577        })
1578    }
1579
1580    /// Sets the value of [container_config][crate::model::MuxStream::container_config]
1581    /// to hold a `Fmp4`.
1582    ///
1583    /// Note that all the setters affecting `container_config` are
1584    /// mutually exclusive.
1585    pub fn set_fmp4<
1586        T: std::convert::Into<std::boxed::Box<crate::model::mux_stream::Fmp4Config>>,
1587    >(
1588        mut self,
1589        v: T,
1590    ) -> Self {
1591        self.container_config =
1592            std::option::Option::Some(crate::model::mux_stream::ContainerConfig::Fmp4(v.into()));
1593        self
1594    }
1595}
1596
1597impl wkt::message::Message for MuxStream {
1598    fn typename() -> &'static str {
1599        "type.googleapis.com/google.cloud.video.transcoder.v1.MuxStream"
1600    }
1601}
1602
1603/// Defines additional types related to [MuxStream].
1604pub mod mux_stream {
1605    #[allow(unused_imports)]
1606    use super::*;
1607
1608    /// `fmp4` container configuration.
1609    #[derive(Clone, Default, PartialEq)]
1610    #[non_exhaustive]
1611    pub struct Fmp4Config {
1612        /// Optional. Specify the codec tag string that will be used in the media
1613        /// bitstream. When not specified, the codec appropriate value is used.
1614        ///
1615        /// Supported H265 codec tags:
1616        ///
1617        /// - `hvc1` (default)
1618        /// - `hev1`
1619        pub codec_tag: std::string::String,
1620
1621        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1622    }
1623
1624    impl Fmp4Config {
1625        pub fn new() -> Self {
1626            std::default::Default::default()
1627        }
1628
1629        /// Sets the value of [codec_tag][crate::model::mux_stream::Fmp4Config::codec_tag].
1630        pub fn set_codec_tag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1631            self.codec_tag = v.into();
1632            self
1633        }
1634    }
1635
1636    impl wkt::message::Message for Fmp4Config {
1637        fn typename() -> &'static str {
1638            "type.googleapis.com/google.cloud.video.transcoder.v1.MuxStream.Fmp4Config"
1639        }
1640    }
1641
1642    /// Specifies the container configuration.
1643    #[derive(Clone, Debug, PartialEq)]
1644    #[non_exhaustive]
1645    pub enum ContainerConfig {
1646        /// Optional. `fmp4` container configuration.
1647        Fmp4(std::boxed::Box<crate::model::mux_stream::Fmp4Config>),
1648    }
1649}
1650
1651/// Manifest configuration.
1652#[derive(Clone, Default, PartialEq)]
1653#[non_exhaustive]
1654pub struct Manifest {
1655    /// The name of the generated file. The default is `manifest` with the
1656    /// extension suffix corresponding to the
1657    /// [Manifest.type][google.cloud.video.transcoder.v1.Manifest.type].
1658    ///
1659    /// [google.cloud.video.transcoder.v1.Manifest.type]: crate::model::Manifest::type
1660    pub file_name: std::string::String,
1661
1662    /// Required. Type of the manifest.
1663    pub r#type: crate::model::manifest::ManifestType,
1664
1665    /// Required. List of user supplied
1666    /// [MuxStream.key][google.cloud.video.transcoder.v1.MuxStream.key] values that
1667    /// should appear in this manifest.
1668    ///
1669    /// When [Manifest.type][google.cloud.video.transcoder.v1.Manifest.type] is
1670    /// `HLS`, a media manifest with name
1671    /// [MuxStream.key][google.cloud.video.transcoder.v1.MuxStream.key] and `.m3u8`
1672    /// extension is generated for each element in this list.
1673    ///
1674    /// [google.cloud.video.transcoder.v1.Manifest.type]: crate::model::Manifest::type
1675    /// [google.cloud.video.transcoder.v1.MuxStream.key]: crate::model::MuxStream::key
1676    pub mux_streams: std::vec::Vec<std::string::String>,
1677
1678    /// Specifies the manifest configuration.
1679    pub manifest_config: std::option::Option<crate::model::manifest::ManifestConfig>,
1680
1681    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1682}
1683
1684impl Manifest {
1685    pub fn new() -> Self {
1686        std::default::Default::default()
1687    }
1688
1689    /// Sets the value of [file_name][crate::model::Manifest::file_name].
1690    pub fn set_file_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1691        self.file_name = v.into();
1692        self
1693    }
1694
1695    /// Sets the value of [r#type][crate::model::Manifest::type].
1696    pub fn set_type<T: std::convert::Into<crate::model::manifest::ManifestType>>(
1697        mut self,
1698        v: T,
1699    ) -> Self {
1700        self.r#type = v.into();
1701        self
1702    }
1703
1704    /// Sets the value of [mux_streams][crate::model::Manifest::mux_streams].
1705    pub fn set_mux_streams<T, V>(mut self, v: T) -> Self
1706    where
1707        T: std::iter::IntoIterator<Item = V>,
1708        V: std::convert::Into<std::string::String>,
1709    {
1710        use std::iter::Iterator;
1711        self.mux_streams = v.into_iter().map(|i| i.into()).collect();
1712        self
1713    }
1714
1715    /// Sets the value of [manifest_config][crate::model::Manifest::manifest_config].
1716    ///
1717    /// Note that all the setters affecting `manifest_config` are mutually
1718    /// exclusive.
1719    pub fn set_manifest_config<
1720        T: std::convert::Into<std::option::Option<crate::model::manifest::ManifestConfig>>,
1721    >(
1722        mut self,
1723        v: T,
1724    ) -> Self {
1725        self.manifest_config = v.into();
1726        self
1727    }
1728
1729    /// The value of [manifest_config][crate::model::Manifest::manifest_config]
1730    /// if it holds a `Dash`, `None` if the field is not set or
1731    /// holds a different branch.
1732    pub fn dash(
1733        &self,
1734    ) -> std::option::Option<&std::boxed::Box<crate::model::manifest::DashConfig>> {
1735        #[allow(unreachable_patterns)]
1736        self.manifest_config.as_ref().and_then(|v| match v {
1737            crate::model::manifest::ManifestConfig::Dash(v) => std::option::Option::Some(v),
1738            _ => std::option::Option::None,
1739        })
1740    }
1741
1742    /// Sets the value of [manifest_config][crate::model::Manifest::manifest_config]
1743    /// to hold a `Dash`.
1744    ///
1745    /// Note that all the setters affecting `manifest_config` are
1746    /// mutually exclusive.
1747    pub fn set_dash<T: std::convert::Into<std::boxed::Box<crate::model::manifest::DashConfig>>>(
1748        mut self,
1749        v: T,
1750    ) -> Self {
1751        self.manifest_config =
1752            std::option::Option::Some(crate::model::manifest::ManifestConfig::Dash(v.into()));
1753        self
1754    }
1755}
1756
1757impl wkt::message::Message for Manifest {
1758    fn typename() -> &'static str {
1759        "type.googleapis.com/google.cloud.video.transcoder.v1.Manifest"
1760    }
1761}
1762
1763/// Defines additional types related to [Manifest].
1764pub mod manifest {
1765    #[allow(unused_imports)]
1766    use super::*;
1767
1768    /// `DASH` manifest configuration.
1769    #[derive(Clone, Default, PartialEq)]
1770    #[non_exhaustive]
1771    pub struct DashConfig {
1772        /// The segment reference scheme for a `DASH` manifest. The default is
1773        /// `SEGMENT_LIST`.
1774        pub segment_reference_scheme: crate::model::manifest::dash_config::SegmentReferenceScheme,
1775
1776        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1777    }
1778
1779    impl DashConfig {
1780        pub fn new() -> Self {
1781            std::default::Default::default()
1782        }
1783
1784        /// Sets the value of [segment_reference_scheme][crate::model::manifest::DashConfig::segment_reference_scheme].
1785        pub fn set_segment_reference_scheme<
1786            T: std::convert::Into<crate::model::manifest::dash_config::SegmentReferenceScheme>,
1787        >(
1788            mut self,
1789            v: T,
1790        ) -> Self {
1791            self.segment_reference_scheme = v.into();
1792            self
1793        }
1794    }
1795
1796    impl wkt::message::Message for DashConfig {
1797        fn typename() -> &'static str {
1798            "type.googleapis.com/google.cloud.video.transcoder.v1.Manifest.DashConfig"
1799        }
1800    }
1801
1802    /// Defines additional types related to [DashConfig].
1803    pub mod dash_config {
1804        #[allow(unused_imports)]
1805        use super::*;
1806
1807        /// The segment reference scheme for a `DASH` manifest.
1808        ///
1809        /// # Working with unknown values
1810        ///
1811        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1812        /// additional enum variants at any time. Adding new variants is not considered
1813        /// a breaking change. Applications should write their code in anticipation of:
1814        ///
1815        /// - New values appearing in future releases of the client library, **and**
1816        /// - New values received dynamically, without application changes.
1817        ///
1818        /// Please consult the [Working with enums] section in the user guide for some
1819        /// guidelines.
1820        ///
1821        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1822        #[derive(Clone, Debug, PartialEq)]
1823        #[non_exhaustive]
1824        pub enum SegmentReferenceScheme {
1825            /// The segment reference scheme is not specified.
1826            Unspecified,
1827            /// Explicitly lists the URLs of media files for each segment. For example,
1828            /// if
1829            /// [SegmentSettings.individual_segments][google.cloud.video.transcoder.v1.SegmentSettings.individual_segments]
1830            /// is `true`, then the manifest contains fields similar to the following:
1831            ///
1832            /// ```norust
1833            /// <Initialization sourceURL="my-hd-stream-init.m4s"/>
1834            ///   <SegmentList presentationTimeOffset="0" duration="1000"
1835            ///   timescale="10000">
1836            ///     <SegmentURL media="hd-stream0000000000.m4s"/>
1837            ///     <SegmentURL media="hd-stream0000000001.m4s"/>
1838            ///     ...
1839            /// ```
1840            ///
1841            /// [google.cloud.video.transcoder.v1.SegmentSettings.individual_segments]: crate::model::SegmentSettings::individual_segments
1842            SegmentList,
1843            /// [SegmentSettings.individual_segments][google.cloud.video.transcoder.v1.SegmentSettings.individual_segments]
1844            /// must be set to `true` to use this segment reference scheme. Uses the
1845            /// DASH specification
1846            /// `<SegmentTemplate>` tag to determine the URLs of media files for each
1847            /// segment. For example:
1848            ///
1849            /// ```norust
1850            /// <SegmentTemplate presentationTimeOffset="0" timescale="10000"
1851            ///       initialization="my-hd-stream-init.m4s"
1852            ///       media="hd-stream$Number%010d$.m4s" startNumber="0">
1853            ///   ...
1854            /// ```
1855            ///
1856            /// [google.cloud.video.transcoder.v1.SegmentSettings.individual_segments]: crate::model::SegmentSettings::individual_segments
1857            SegmentTemplateNumber,
1858            /// If set, the enum was initialized with an unknown value.
1859            ///
1860            /// Applications can examine the value using [SegmentReferenceScheme::value] or
1861            /// [SegmentReferenceScheme::name].
1862            UnknownValue(segment_reference_scheme::UnknownValue),
1863        }
1864
1865        #[doc(hidden)]
1866        pub mod segment_reference_scheme {
1867            #[allow(unused_imports)]
1868            use super::*;
1869            #[derive(Clone, Debug, PartialEq)]
1870            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1871        }
1872
1873        impl SegmentReferenceScheme {
1874            /// Gets the enum value.
1875            ///
1876            /// Returns `None` if the enum contains an unknown value deserialized from
1877            /// the string representation of enums.
1878            pub fn value(&self) -> std::option::Option<i32> {
1879                match self {
1880                    Self::Unspecified => std::option::Option::Some(0),
1881                    Self::SegmentList => std::option::Option::Some(1),
1882                    Self::SegmentTemplateNumber => std::option::Option::Some(2),
1883                    Self::UnknownValue(u) => u.0.value(),
1884                }
1885            }
1886
1887            /// Gets the enum value as a string.
1888            ///
1889            /// Returns `None` if the enum contains an unknown value deserialized from
1890            /// the integer representation of enums.
1891            pub fn name(&self) -> std::option::Option<&str> {
1892                match self {
1893                    Self::Unspecified => {
1894                        std::option::Option::Some("SEGMENT_REFERENCE_SCHEME_UNSPECIFIED")
1895                    }
1896                    Self::SegmentList => std::option::Option::Some("SEGMENT_LIST"),
1897                    Self::SegmentTemplateNumber => {
1898                        std::option::Option::Some("SEGMENT_TEMPLATE_NUMBER")
1899                    }
1900                    Self::UnknownValue(u) => u.0.name(),
1901                }
1902            }
1903        }
1904
1905        impl std::default::Default for SegmentReferenceScheme {
1906            fn default() -> Self {
1907                use std::convert::From;
1908                Self::from(0)
1909            }
1910        }
1911
1912        impl std::fmt::Display for SegmentReferenceScheme {
1913            fn fmt(
1914                &self,
1915                f: &mut std::fmt::Formatter<'_>,
1916            ) -> std::result::Result<(), std::fmt::Error> {
1917                wkt::internal::display_enum(f, self.name(), self.value())
1918            }
1919        }
1920
1921        impl std::convert::From<i32> for SegmentReferenceScheme {
1922            fn from(value: i32) -> Self {
1923                match value {
1924                    0 => Self::Unspecified,
1925                    1 => Self::SegmentList,
1926                    2 => Self::SegmentTemplateNumber,
1927                    _ => Self::UnknownValue(segment_reference_scheme::UnknownValue(
1928                        wkt::internal::UnknownEnumValue::Integer(value),
1929                    )),
1930                }
1931            }
1932        }
1933
1934        impl std::convert::From<&str> for SegmentReferenceScheme {
1935            fn from(value: &str) -> Self {
1936                use std::string::ToString;
1937                match value {
1938                    "SEGMENT_REFERENCE_SCHEME_UNSPECIFIED" => Self::Unspecified,
1939                    "SEGMENT_LIST" => Self::SegmentList,
1940                    "SEGMENT_TEMPLATE_NUMBER" => Self::SegmentTemplateNumber,
1941                    _ => Self::UnknownValue(segment_reference_scheme::UnknownValue(
1942                        wkt::internal::UnknownEnumValue::String(value.to_string()),
1943                    )),
1944                }
1945            }
1946        }
1947
1948        impl serde::ser::Serialize for SegmentReferenceScheme {
1949            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1950            where
1951                S: serde::Serializer,
1952            {
1953                match self {
1954                    Self::Unspecified => serializer.serialize_i32(0),
1955                    Self::SegmentList => serializer.serialize_i32(1),
1956                    Self::SegmentTemplateNumber => serializer.serialize_i32(2),
1957                    Self::UnknownValue(u) => u.0.serialize(serializer),
1958                }
1959            }
1960        }
1961
1962        impl<'de> serde::de::Deserialize<'de> for SegmentReferenceScheme {
1963            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1964            where
1965                D: serde::Deserializer<'de>,
1966            {
1967                deserializer.deserialize_any(wkt::internal::EnumVisitor::<SegmentReferenceScheme>::new(
1968                    ".google.cloud.video.transcoder.v1.Manifest.DashConfig.SegmentReferenceScheme"))
1969            }
1970        }
1971    }
1972
1973    /// The manifest type, which corresponds to the adaptive streaming format used.
1974    ///
1975    /// # Working with unknown values
1976    ///
1977    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1978    /// additional enum variants at any time. Adding new variants is not considered
1979    /// a breaking change. Applications should write their code in anticipation of:
1980    ///
1981    /// - New values appearing in future releases of the client library, **and**
1982    /// - New values received dynamically, without application changes.
1983    ///
1984    /// Please consult the [Working with enums] section in the user guide for some
1985    /// guidelines.
1986    ///
1987    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1988    #[derive(Clone, Debug, PartialEq)]
1989    #[non_exhaustive]
1990    pub enum ManifestType {
1991        /// The manifest type is not specified.
1992        Unspecified,
1993        /// Create an HLS manifest. The corresponding file extension is `.m3u8`.
1994        Hls,
1995        /// Create an MPEG-DASH manifest. The corresponding file extension is `.mpd`.
1996        Dash,
1997        /// If set, the enum was initialized with an unknown value.
1998        ///
1999        /// Applications can examine the value using [ManifestType::value] or
2000        /// [ManifestType::name].
2001        UnknownValue(manifest_type::UnknownValue),
2002    }
2003
2004    #[doc(hidden)]
2005    pub mod manifest_type {
2006        #[allow(unused_imports)]
2007        use super::*;
2008        #[derive(Clone, Debug, PartialEq)]
2009        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2010    }
2011
2012    impl ManifestType {
2013        /// Gets the enum value.
2014        ///
2015        /// Returns `None` if the enum contains an unknown value deserialized from
2016        /// the string representation of enums.
2017        pub fn value(&self) -> std::option::Option<i32> {
2018            match self {
2019                Self::Unspecified => std::option::Option::Some(0),
2020                Self::Hls => std::option::Option::Some(1),
2021                Self::Dash => std::option::Option::Some(2),
2022                Self::UnknownValue(u) => u.0.value(),
2023            }
2024        }
2025
2026        /// Gets the enum value as a string.
2027        ///
2028        /// Returns `None` if the enum contains an unknown value deserialized from
2029        /// the integer representation of enums.
2030        pub fn name(&self) -> std::option::Option<&str> {
2031            match self {
2032                Self::Unspecified => std::option::Option::Some("MANIFEST_TYPE_UNSPECIFIED"),
2033                Self::Hls => std::option::Option::Some("HLS"),
2034                Self::Dash => std::option::Option::Some("DASH"),
2035                Self::UnknownValue(u) => u.0.name(),
2036            }
2037        }
2038    }
2039
2040    impl std::default::Default for ManifestType {
2041        fn default() -> Self {
2042            use std::convert::From;
2043            Self::from(0)
2044        }
2045    }
2046
2047    impl std::fmt::Display for ManifestType {
2048        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2049            wkt::internal::display_enum(f, self.name(), self.value())
2050        }
2051    }
2052
2053    impl std::convert::From<i32> for ManifestType {
2054        fn from(value: i32) -> Self {
2055            match value {
2056                0 => Self::Unspecified,
2057                1 => Self::Hls,
2058                2 => Self::Dash,
2059                _ => Self::UnknownValue(manifest_type::UnknownValue(
2060                    wkt::internal::UnknownEnumValue::Integer(value),
2061                )),
2062            }
2063        }
2064    }
2065
2066    impl std::convert::From<&str> for ManifestType {
2067        fn from(value: &str) -> Self {
2068            use std::string::ToString;
2069            match value {
2070                "MANIFEST_TYPE_UNSPECIFIED" => Self::Unspecified,
2071                "HLS" => Self::Hls,
2072                "DASH" => Self::Dash,
2073                _ => Self::UnknownValue(manifest_type::UnknownValue(
2074                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2075                )),
2076            }
2077        }
2078    }
2079
2080    impl serde::ser::Serialize for ManifestType {
2081        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2082        where
2083            S: serde::Serializer,
2084        {
2085            match self {
2086                Self::Unspecified => serializer.serialize_i32(0),
2087                Self::Hls => serializer.serialize_i32(1),
2088                Self::Dash => serializer.serialize_i32(2),
2089                Self::UnknownValue(u) => u.0.serialize(serializer),
2090            }
2091        }
2092    }
2093
2094    impl<'de> serde::de::Deserialize<'de> for ManifestType {
2095        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2096        where
2097            D: serde::Deserializer<'de>,
2098        {
2099            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ManifestType>::new(
2100                ".google.cloud.video.transcoder.v1.Manifest.ManifestType",
2101            ))
2102        }
2103    }
2104
2105    /// Specifies the manifest configuration.
2106    #[derive(Clone, Debug, PartialEq)]
2107    #[non_exhaustive]
2108    pub enum ManifestConfig {
2109        /// `DASH` manifest configuration.
2110        Dash(std::boxed::Box<crate::model::manifest::DashConfig>),
2111    }
2112}
2113
2114/// A Pub/Sub destination.
2115#[derive(Clone, Default, PartialEq)]
2116#[non_exhaustive]
2117pub struct PubsubDestination {
2118    /// The name of the Pub/Sub topic to publish job completion notification
2119    /// to. For example: `projects/{project}/topics/{topic}`.
2120    pub topic: std::string::String,
2121
2122    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2123}
2124
2125impl PubsubDestination {
2126    pub fn new() -> Self {
2127        std::default::Default::default()
2128    }
2129
2130    /// Sets the value of [topic][crate::model::PubsubDestination::topic].
2131    pub fn set_topic<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2132        self.topic = v.into();
2133        self
2134    }
2135}
2136
2137impl wkt::message::Message for PubsubDestination {
2138    fn typename() -> &'static str {
2139        "type.googleapis.com/google.cloud.video.transcoder.v1.PubsubDestination"
2140    }
2141}
2142
2143/// Sprite sheet configuration.
2144#[derive(Clone, Default, PartialEq)]
2145#[non_exhaustive]
2146pub struct SpriteSheet {
2147    /// Format type. The default is `jpeg`.
2148    ///
2149    /// Supported formats:
2150    ///
2151    /// - `jpeg`
2152    pub format: std::string::String,
2153
2154    /// Required. File name prefix for the generated sprite sheets.
2155    ///
2156    /// Each sprite sheet has an incremental 10-digit zero-padded suffix starting
2157    /// from 0 before the extension, such as `sprite_sheet0000000123.jpeg`.
2158    pub file_prefix: std::string::String,
2159
2160    /// Required. The width of sprite in pixels. Must be an even integer. To
2161    /// preserve the source aspect ratio, set the
2162    /// [SpriteSheet.sprite_width_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_width_pixels]
2163    /// field or the
2164    /// [SpriteSheet.sprite_height_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_height_pixels]
2165    /// field, but not both (the API will automatically calculate the missing
2166    /// field).
2167    ///
2168    /// For portrait videos that contain horizontal ASR and rotation metadata,
2169    /// provide the width, in pixels, per the horizontal ASR. The API calculates
2170    /// the height per the horizontal ASR. The API detects any rotation metadata
2171    /// and swaps the requested height and width for the output.
2172    ///
2173    /// [google.cloud.video.transcoder.v1.SpriteSheet.sprite_height_pixels]: crate::model::SpriteSheet::sprite_height_pixels
2174    /// [google.cloud.video.transcoder.v1.SpriteSheet.sprite_width_pixels]: crate::model::SpriteSheet::sprite_width_pixels
2175    pub sprite_width_pixels: i32,
2176
2177    /// Required. The height of sprite in pixels. Must be an even integer. To
2178    /// preserve the source aspect ratio, set the
2179    /// [SpriteSheet.sprite_height_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_height_pixels]
2180    /// field or the
2181    /// [SpriteSheet.sprite_width_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_width_pixels]
2182    /// field, but not both (the API will automatically calculate the missing
2183    /// field).
2184    ///
2185    /// For portrait videos that contain horizontal ASR and rotation metadata,
2186    /// provide the height, in pixels, per the horizontal ASR. The API calculates
2187    /// the width per the horizontal ASR. The API detects any rotation metadata
2188    /// and swaps the requested height and width for the output.
2189    ///
2190    /// [google.cloud.video.transcoder.v1.SpriteSheet.sprite_height_pixels]: crate::model::SpriteSheet::sprite_height_pixels
2191    /// [google.cloud.video.transcoder.v1.SpriteSheet.sprite_width_pixels]: crate::model::SpriteSheet::sprite_width_pixels
2192    pub sprite_height_pixels: i32,
2193
2194    /// The maximum number of sprites per row in a sprite sheet. The default is 0,
2195    /// which indicates no maximum limit.
2196    pub column_count: i32,
2197
2198    /// The maximum number of rows per sprite sheet. When the sprite sheet is full,
2199    /// a new sprite sheet is created. The default is 0, which indicates no maximum
2200    /// limit.
2201    pub row_count: i32,
2202
2203    /// Start time in seconds, relative to the output file timeline. Determines the
2204    /// first sprite to pick. The default is `0s`.
2205    pub start_time_offset: std::option::Option<wkt::Duration>,
2206
2207    /// End time in seconds, relative to the output file timeline. When
2208    /// `end_time_offset` is not specified, the sprites are generated until the end
2209    /// of the output file.
2210    pub end_time_offset: std::option::Option<wkt::Duration>,
2211
2212    /// The quality of the generated sprite sheet. Enter a value between 1
2213    /// and 100, where 1 is the lowest quality and 100 is the highest quality.
2214    /// The default is 100. A high quality value corresponds to a low image data
2215    /// compression ratio.
2216    pub quality: i32,
2217
2218    /// Specify either total number of sprites or interval to create sprites.
2219    pub extraction_strategy: std::option::Option<crate::model::sprite_sheet::ExtractionStrategy>,
2220
2221    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2222}
2223
2224impl SpriteSheet {
2225    pub fn new() -> Self {
2226        std::default::Default::default()
2227    }
2228
2229    /// Sets the value of [format][crate::model::SpriteSheet::format].
2230    pub fn set_format<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2231        self.format = v.into();
2232        self
2233    }
2234
2235    /// Sets the value of [file_prefix][crate::model::SpriteSheet::file_prefix].
2236    pub fn set_file_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2237        self.file_prefix = v.into();
2238        self
2239    }
2240
2241    /// Sets the value of [sprite_width_pixels][crate::model::SpriteSheet::sprite_width_pixels].
2242    pub fn set_sprite_width_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2243        self.sprite_width_pixels = v.into();
2244        self
2245    }
2246
2247    /// Sets the value of [sprite_height_pixels][crate::model::SpriteSheet::sprite_height_pixels].
2248    pub fn set_sprite_height_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2249        self.sprite_height_pixels = v.into();
2250        self
2251    }
2252
2253    /// Sets the value of [column_count][crate::model::SpriteSheet::column_count].
2254    pub fn set_column_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2255        self.column_count = v.into();
2256        self
2257    }
2258
2259    /// Sets the value of [row_count][crate::model::SpriteSheet::row_count].
2260    pub fn set_row_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2261        self.row_count = v.into();
2262        self
2263    }
2264
2265    /// Sets the value of [start_time_offset][crate::model::SpriteSheet::start_time_offset].
2266    pub fn set_start_time_offset<T>(mut self, v: T) -> Self
2267    where
2268        T: std::convert::Into<wkt::Duration>,
2269    {
2270        self.start_time_offset = std::option::Option::Some(v.into());
2271        self
2272    }
2273
2274    /// Sets or clears the value of [start_time_offset][crate::model::SpriteSheet::start_time_offset].
2275    pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
2276    where
2277        T: std::convert::Into<wkt::Duration>,
2278    {
2279        self.start_time_offset = v.map(|x| x.into());
2280        self
2281    }
2282
2283    /// Sets the value of [end_time_offset][crate::model::SpriteSheet::end_time_offset].
2284    pub fn set_end_time_offset<T>(mut self, v: T) -> Self
2285    where
2286        T: std::convert::Into<wkt::Duration>,
2287    {
2288        self.end_time_offset = std::option::Option::Some(v.into());
2289        self
2290    }
2291
2292    /// Sets or clears the value of [end_time_offset][crate::model::SpriteSheet::end_time_offset].
2293    pub fn set_or_clear_end_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
2294    where
2295        T: std::convert::Into<wkt::Duration>,
2296    {
2297        self.end_time_offset = v.map(|x| x.into());
2298        self
2299    }
2300
2301    /// Sets the value of [quality][crate::model::SpriteSheet::quality].
2302    pub fn set_quality<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2303        self.quality = v.into();
2304        self
2305    }
2306
2307    /// Sets the value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy].
2308    ///
2309    /// Note that all the setters affecting `extraction_strategy` are mutually
2310    /// exclusive.
2311    pub fn set_extraction_strategy<
2312        T: std::convert::Into<std::option::Option<crate::model::sprite_sheet::ExtractionStrategy>>,
2313    >(
2314        mut self,
2315        v: T,
2316    ) -> Self {
2317        self.extraction_strategy = v.into();
2318        self
2319    }
2320
2321    /// The value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy]
2322    /// if it holds a `TotalCount`, `None` if the field is not set or
2323    /// holds a different branch.
2324    pub fn total_count(&self) -> std::option::Option<&i32> {
2325        #[allow(unreachable_patterns)]
2326        self.extraction_strategy.as_ref().and_then(|v| match v {
2327            crate::model::sprite_sheet::ExtractionStrategy::TotalCount(v) => {
2328                std::option::Option::Some(v)
2329            }
2330            _ => std::option::Option::None,
2331        })
2332    }
2333
2334    /// Sets the value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy]
2335    /// to hold a `TotalCount`.
2336    ///
2337    /// Note that all the setters affecting `extraction_strategy` are
2338    /// mutually exclusive.
2339    pub fn set_total_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2340        self.extraction_strategy = std::option::Option::Some(
2341            crate::model::sprite_sheet::ExtractionStrategy::TotalCount(v.into()),
2342        );
2343        self
2344    }
2345
2346    /// The value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy]
2347    /// if it holds a `Interval`, `None` if the field is not set or
2348    /// holds a different branch.
2349    pub fn interval(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
2350        #[allow(unreachable_patterns)]
2351        self.extraction_strategy.as_ref().and_then(|v| match v {
2352            crate::model::sprite_sheet::ExtractionStrategy::Interval(v) => {
2353                std::option::Option::Some(v)
2354            }
2355            _ => std::option::Option::None,
2356        })
2357    }
2358
2359    /// Sets the value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy]
2360    /// to hold a `Interval`.
2361    ///
2362    /// Note that all the setters affecting `extraction_strategy` are
2363    /// mutually exclusive.
2364    pub fn set_interval<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
2365        mut self,
2366        v: T,
2367    ) -> Self {
2368        self.extraction_strategy = std::option::Option::Some(
2369            crate::model::sprite_sheet::ExtractionStrategy::Interval(v.into()),
2370        );
2371        self
2372    }
2373}
2374
2375impl wkt::message::Message for SpriteSheet {
2376    fn typename() -> &'static str {
2377        "type.googleapis.com/google.cloud.video.transcoder.v1.SpriteSheet"
2378    }
2379}
2380
2381/// Defines additional types related to [SpriteSheet].
2382pub mod sprite_sheet {
2383    #[allow(unused_imports)]
2384    use super::*;
2385
2386    /// Specify either total number of sprites or interval to create sprites.
2387    #[derive(Clone, Debug, PartialEq)]
2388    #[non_exhaustive]
2389    pub enum ExtractionStrategy {
2390        /// Total number of sprites. Create the specified number of sprites
2391        /// distributed evenly across the timeline of the output media. The default
2392        /// is 100.
2393        TotalCount(i32),
2394        /// Starting from `0s`, create sprites at regular intervals. Specify the
2395        /// interval value in seconds.
2396        Interval(std::boxed::Box<wkt::Duration>),
2397    }
2398}
2399
2400/// Overlay configuration.
2401#[derive(Clone, Default, PartialEq)]
2402#[non_exhaustive]
2403pub struct Overlay {
2404    /// Image overlay.
2405    pub image: std::option::Option<crate::model::overlay::Image>,
2406
2407    /// List of animations. The list should be chronological, without any time
2408    /// overlap.
2409    pub animations: std::vec::Vec<crate::model::overlay::Animation>,
2410
2411    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2412}
2413
2414impl Overlay {
2415    pub fn new() -> Self {
2416        std::default::Default::default()
2417    }
2418
2419    /// Sets the value of [image][crate::model::Overlay::image].
2420    pub fn set_image<T>(mut self, v: T) -> Self
2421    where
2422        T: std::convert::Into<crate::model::overlay::Image>,
2423    {
2424        self.image = std::option::Option::Some(v.into());
2425        self
2426    }
2427
2428    /// Sets or clears the value of [image][crate::model::Overlay::image].
2429    pub fn set_or_clear_image<T>(mut self, v: std::option::Option<T>) -> Self
2430    where
2431        T: std::convert::Into<crate::model::overlay::Image>,
2432    {
2433        self.image = v.map(|x| x.into());
2434        self
2435    }
2436
2437    /// Sets the value of [animations][crate::model::Overlay::animations].
2438    pub fn set_animations<T, V>(mut self, v: T) -> Self
2439    where
2440        T: std::iter::IntoIterator<Item = V>,
2441        V: std::convert::Into<crate::model::overlay::Animation>,
2442    {
2443        use std::iter::Iterator;
2444        self.animations = v.into_iter().map(|i| i.into()).collect();
2445        self
2446    }
2447}
2448
2449impl wkt::message::Message for Overlay {
2450    fn typename() -> &'static str {
2451        "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay"
2452    }
2453}
2454
2455/// Defines additional types related to [Overlay].
2456pub mod overlay {
2457    #[allow(unused_imports)]
2458    use super::*;
2459
2460    /// 2D normalized coordinates. Default: `{0.0, 0.0}`
2461    #[derive(Clone, Default, PartialEq)]
2462    #[non_exhaustive]
2463    pub struct NormalizedCoordinate {
2464        /// Normalized x coordinate.
2465        pub x: f64,
2466
2467        /// Normalized y coordinate.
2468        pub y: f64,
2469
2470        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2471    }
2472
2473    impl NormalizedCoordinate {
2474        pub fn new() -> Self {
2475            std::default::Default::default()
2476        }
2477
2478        /// Sets the value of [x][crate::model::overlay::NormalizedCoordinate::x].
2479        pub fn set_x<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
2480            self.x = v.into();
2481            self
2482        }
2483
2484        /// Sets the value of [y][crate::model::overlay::NormalizedCoordinate::y].
2485        pub fn set_y<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
2486            self.y = v.into();
2487            self
2488        }
2489    }
2490
2491    impl wkt::message::Message for NormalizedCoordinate {
2492        fn typename() -> &'static str {
2493            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate"
2494        }
2495    }
2496
2497    /// Overlaid image.
2498    #[derive(Clone, Default, PartialEq)]
2499    #[non_exhaustive]
2500    pub struct Image {
2501        /// Required. URI of the image in Cloud Storage. For example,
2502        /// `gs://bucket/inputs/image.png`. Only PNG and JPEG images are supported.
2503        pub uri: std::string::String,
2504
2505        /// Normalized image resolution, based on output video resolution. Valid
2506        /// values: `0.0`–`1.0`. To respect the original image aspect ratio, set
2507        /// either `x` or `y` to `0.0`. To use the original image resolution, set
2508        /// both `x` and `y` to `0.0`.
2509        pub resolution: std::option::Option<crate::model::overlay::NormalizedCoordinate>,
2510
2511        /// Target image opacity. Valid values are from  `1.0` (solid, default) to
2512        /// `0.0` (transparent), exclusive. Set this to a value greater than `0.0`.
2513        pub alpha: f64,
2514
2515        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2516    }
2517
2518    impl Image {
2519        pub fn new() -> Self {
2520            std::default::Default::default()
2521        }
2522
2523        /// Sets the value of [uri][crate::model::overlay::Image::uri].
2524        pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2525            self.uri = v.into();
2526            self
2527        }
2528
2529        /// Sets the value of [resolution][crate::model::overlay::Image::resolution].
2530        pub fn set_resolution<T>(mut self, v: T) -> Self
2531        where
2532            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
2533        {
2534            self.resolution = std::option::Option::Some(v.into());
2535            self
2536        }
2537
2538        /// Sets or clears the value of [resolution][crate::model::overlay::Image::resolution].
2539        pub fn set_or_clear_resolution<T>(mut self, v: std::option::Option<T>) -> Self
2540        where
2541            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
2542        {
2543            self.resolution = v.map(|x| x.into());
2544            self
2545        }
2546
2547        /// Sets the value of [alpha][crate::model::overlay::Image::alpha].
2548        pub fn set_alpha<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
2549            self.alpha = v.into();
2550            self
2551        }
2552    }
2553
2554    impl wkt::message::Message for Image {
2555        fn typename() -> &'static str {
2556            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.Image"
2557        }
2558    }
2559
2560    /// Display static overlay object.
2561    #[derive(Clone, Default, PartialEq)]
2562    #[non_exhaustive]
2563    pub struct AnimationStatic {
2564        /// Normalized coordinates based on output video resolution. Valid
2565        /// values: `0.0`–`1.0`. `xy` is the upper-left coordinate of the overlay
2566        /// object. For example, use the x and y coordinates {0,0} to position the
2567        /// top-left corner of the overlay animation in the top-left corner of the
2568        /// output video.
2569        pub xy: std::option::Option<crate::model::overlay::NormalizedCoordinate>,
2570
2571        /// The time to start displaying the overlay object, in seconds. Default: 0
2572        pub start_time_offset: std::option::Option<wkt::Duration>,
2573
2574        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2575    }
2576
2577    impl AnimationStatic {
2578        pub fn new() -> Self {
2579            std::default::Default::default()
2580        }
2581
2582        /// Sets the value of [xy][crate::model::overlay::AnimationStatic::xy].
2583        pub fn set_xy<T>(mut self, v: T) -> Self
2584        where
2585            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
2586        {
2587            self.xy = std::option::Option::Some(v.into());
2588            self
2589        }
2590
2591        /// Sets or clears the value of [xy][crate::model::overlay::AnimationStatic::xy].
2592        pub fn set_or_clear_xy<T>(mut self, v: std::option::Option<T>) -> Self
2593        where
2594            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
2595        {
2596            self.xy = v.map(|x| x.into());
2597            self
2598        }
2599
2600        /// Sets the value of [start_time_offset][crate::model::overlay::AnimationStatic::start_time_offset].
2601        pub fn set_start_time_offset<T>(mut self, v: T) -> Self
2602        where
2603            T: std::convert::Into<wkt::Duration>,
2604        {
2605            self.start_time_offset = std::option::Option::Some(v.into());
2606            self
2607        }
2608
2609        /// Sets or clears the value of [start_time_offset][crate::model::overlay::AnimationStatic::start_time_offset].
2610        pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
2611        where
2612            T: std::convert::Into<wkt::Duration>,
2613        {
2614            self.start_time_offset = v.map(|x| x.into());
2615            self
2616        }
2617    }
2618
2619    impl wkt::message::Message for AnimationStatic {
2620        fn typename() -> &'static str {
2621            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.AnimationStatic"
2622        }
2623    }
2624
2625    /// Display overlay object with fade animation.
2626    #[derive(Clone, Default, PartialEq)]
2627    #[non_exhaustive]
2628    pub struct AnimationFade {
2629        /// Required. Type of fade animation: `FADE_IN` or `FADE_OUT`.
2630        pub fade_type: crate::model::overlay::FadeType,
2631
2632        /// Normalized coordinates based on output video resolution. Valid
2633        /// values: `0.0`–`1.0`. `xy` is the upper-left coordinate of the overlay
2634        /// object. For example, use the x and y coordinates {0,0} to position the
2635        /// top-left corner of the overlay animation in the top-left corner of the
2636        /// output video.
2637        pub xy: std::option::Option<crate::model::overlay::NormalizedCoordinate>,
2638
2639        /// The time to start the fade animation, in seconds. Default: 0
2640        pub start_time_offset: std::option::Option<wkt::Duration>,
2641
2642        /// The time to end the fade animation, in seconds. Default:
2643        /// `start_time_offset` + 1s
2644        pub end_time_offset: std::option::Option<wkt::Duration>,
2645
2646        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2647    }
2648
2649    impl AnimationFade {
2650        pub fn new() -> Self {
2651            std::default::Default::default()
2652        }
2653
2654        /// Sets the value of [fade_type][crate::model::overlay::AnimationFade::fade_type].
2655        pub fn set_fade_type<T: std::convert::Into<crate::model::overlay::FadeType>>(
2656            mut self,
2657            v: T,
2658        ) -> Self {
2659            self.fade_type = v.into();
2660            self
2661        }
2662
2663        /// Sets the value of [xy][crate::model::overlay::AnimationFade::xy].
2664        pub fn set_xy<T>(mut self, v: T) -> Self
2665        where
2666            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
2667        {
2668            self.xy = std::option::Option::Some(v.into());
2669            self
2670        }
2671
2672        /// Sets or clears the value of [xy][crate::model::overlay::AnimationFade::xy].
2673        pub fn set_or_clear_xy<T>(mut self, v: std::option::Option<T>) -> Self
2674        where
2675            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
2676        {
2677            self.xy = v.map(|x| x.into());
2678            self
2679        }
2680
2681        /// Sets the value of [start_time_offset][crate::model::overlay::AnimationFade::start_time_offset].
2682        pub fn set_start_time_offset<T>(mut self, v: T) -> Self
2683        where
2684            T: std::convert::Into<wkt::Duration>,
2685        {
2686            self.start_time_offset = std::option::Option::Some(v.into());
2687            self
2688        }
2689
2690        /// Sets or clears the value of [start_time_offset][crate::model::overlay::AnimationFade::start_time_offset].
2691        pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
2692        where
2693            T: std::convert::Into<wkt::Duration>,
2694        {
2695            self.start_time_offset = v.map(|x| x.into());
2696            self
2697        }
2698
2699        /// Sets the value of [end_time_offset][crate::model::overlay::AnimationFade::end_time_offset].
2700        pub fn set_end_time_offset<T>(mut self, v: T) -> Self
2701        where
2702            T: std::convert::Into<wkt::Duration>,
2703        {
2704            self.end_time_offset = std::option::Option::Some(v.into());
2705            self
2706        }
2707
2708        /// Sets or clears the value of [end_time_offset][crate::model::overlay::AnimationFade::end_time_offset].
2709        pub fn set_or_clear_end_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
2710        where
2711            T: std::convert::Into<wkt::Duration>,
2712        {
2713            self.end_time_offset = v.map(|x| x.into());
2714            self
2715        }
2716    }
2717
2718    impl wkt::message::Message for AnimationFade {
2719        fn typename() -> &'static str {
2720            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.AnimationFade"
2721        }
2722    }
2723
2724    /// End previous overlay animation from the video. Without `AnimationEnd`, the
2725    /// overlay object will keep the state of previous animation until the end of
2726    /// the video.
2727    #[derive(Clone, Default, PartialEq)]
2728    #[non_exhaustive]
2729    pub struct AnimationEnd {
2730        /// The time to end overlay object, in seconds. Default: 0
2731        pub start_time_offset: std::option::Option<wkt::Duration>,
2732
2733        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2734    }
2735
2736    impl AnimationEnd {
2737        pub fn new() -> Self {
2738            std::default::Default::default()
2739        }
2740
2741        /// Sets the value of [start_time_offset][crate::model::overlay::AnimationEnd::start_time_offset].
2742        pub fn set_start_time_offset<T>(mut self, v: T) -> Self
2743        where
2744            T: std::convert::Into<wkt::Duration>,
2745        {
2746            self.start_time_offset = std::option::Option::Some(v.into());
2747            self
2748        }
2749
2750        /// Sets or clears the value of [start_time_offset][crate::model::overlay::AnimationEnd::start_time_offset].
2751        pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
2752        where
2753            T: std::convert::Into<wkt::Duration>,
2754        {
2755            self.start_time_offset = v.map(|x| x.into());
2756            self
2757        }
2758    }
2759
2760    impl wkt::message::Message for AnimationEnd {
2761        fn typename() -> &'static str {
2762            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.AnimationEnd"
2763        }
2764    }
2765
2766    /// Animation types.
2767    #[derive(Clone, Default, PartialEq)]
2768    #[non_exhaustive]
2769    pub struct Animation {
2770        /// Animations can be static or fade, or they can end the previous animation.
2771        pub animation_type: std::option::Option<crate::model::overlay::animation::AnimationType>,
2772
2773        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2774    }
2775
2776    impl Animation {
2777        pub fn new() -> Self {
2778            std::default::Default::default()
2779        }
2780
2781        /// Sets the value of [animation_type][crate::model::overlay::Animation::animation_type].
2782        ///
2783        /// Note that all the setters affecting `animation_type` are mutually
2784        /// exclusive.
2785        pub fn set_animation_type<
2786            T: std::convert::Into<
2787                    std::option::Option<crate::model::overlay::animation::AnimationType>,
2788                >,
2789        >(
2790            mut self,
2791            v: T,
2792        ) -> Self {
2793            self.animation_type = v.into();
2794            self
2795        }
2796
2797        /// The value of [animation_type][crate::model::overlay::Animation::animation_type]
2798        /// if it holds a `AnimationStatic`, `None` if the field is not set or
2799        /// holds a different branch.
2800        pub fn animation_static(
2801            &self,
2802        ) -> std::option::Option<&std::boxed::Box<crate::model::overlay::AnimationStatic>> {
2803            #[allow(unreachable_patterns)]
2804            self.animation_type.as_ref().and_then(|v| match v {
2805                crate::model::overlay::animation::AnimationType::AnimationStatic(v) => {
2806                    std::option::Option::Some(v)
2807                }
2808                _ => std::option::Option::None,
2809            })
2810        }
2811
2812        /// Sets the value of [animation_type][crate::model::overlay::Animation::animation_type]
2813        /// to hold a `AnimationStatic`.
2814        ///
2815        /// Note that all the setters affecting `animation_type` are
2816        /// mutually exclusive.
2817        pub fn set_animation_static<
2818            T: std::convert::Into<std::boxed::Box<crate::model::overlay::AnimationStatic>>,
2819        >(
2820            mut self,
2821            v: T,
2822        ) -> Self {
2823            self.animation_type = std::option::Option::Some(
2824                crate::model::overlay::animation::AnimationType::AnimationStatic(v.into()),
2825            );
2826            self
2827        }
2828
2829        /// The value of [animation_type][crate::model::overlay::Animation::animation_type]
2830        /// if it holds a `AnimationFade`, `None` if the field is not set or
2831        /// holds a different branch.
2832        pub fn animation_fade(
2833            &self,
2834        ) -> std::option::Option<&std::boxed::Box<crate::model::overlay::AnimationFade>> {
2835            #[allow(unreachable_patterns)]
2836            self.animation_type.as_ref().and_then(|v| match v {
2837                crate::model::overlay::animation::AnimationType::AnimationFade(v) => {
2838                    std::option::Option::Some(v)
2839                }
2840                _ => std::option::Option::None,
2841            })
2842        }
2843
2844        /// Sets the value of [animation_type][crate::model::overlay::Animation::animation_type]
2845        /// to hold a `AnimationFade`.
2846        ///
2847        /// Note that all the setters affecting `animation_type` are
2848        /// mutually exclusive.
2849        pub fn set_animation_fade<
2850            T: std::convert::Into<std::boxed::Box<crate::model::overlay::AnimationFade>>,
2851        >(
2852            mut self,
2853            v: T,
2854        ) -> Self {
2855            self.animation_type = std::option::Option::Some(
2856                crate::model::overlay::animation::AnimationType::AnimationFade(v.into()),
2857            );
2858            self
2859        }
2860
2861        /// The value of [animation_type][crate::model::overlay::Animation::animation_type]
2862        /// if it holds a `AnimationEnd`, `None` if the field is not set or
2863        /// holds a different branch.
2864        pub fn animation_end(
2865            &self,
2866        ) -> std::option::Option<&std::boxed::Box<crate::model::overlay::AnimationEnd>> {
2867            #[allow(unreachable_patterns)]
2868            self.animation_type.as_ref().and_then(|v| match v {
2869                crate::model::overlay::animation::AnimationType::AnimationEnd(v) => {
2870                    std::option::Option::Some(v)
2871                }
2872                _ => std::option::Option::None,
2873            })
2874        }
2875
2876        /// Sets the value of [animation_type][crate::model::overlay::Animation::animation_type]
2877        /// to hold a `AnimationEnd`.
2878        ///
2879        /// Note that all the setters affecting `animation_type` are
2880        /// mutually exclusive.
2881        pub fn set_animation_end<
2882            T: std::convert::Into<std::boxed::Box<crate::model::overlay::AnimationEnd>>,
2883        >(
2884            mut self,
2885            v: T,
2886        ) -> Self {
2887            self.animation_type = std::option::Option::Some(
2888                crate::model::overlay::animation::AnimationType::AnimationEnd(v.into()),
2889            );
2890            self
2891        }
2892    }
2893
2894    impl wkt::message::Message for Animation {
2895        fn typename() -> &'static str {
2896            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.Animation"
2897        }
2898    }
2899
2900    /// Defines additional types related to [Animation].
2901    pub mod animation {
2902        #[allow(unused_imports)]
2903        use super::*;
2904
2905        /// Animations can be static or fade, or they can end the previous animation.
2906        #[derive(Clone, Debug, PartialEq)]
2907        #[non_exhaustive]
2908        pub enum AnimationType {
2909            /// Display static overlay object.
2910            AnimationStatic(std::boxed::Box<crate::model::overlay::AnimationStatic>),
2911            /// Display overlay object with fade animation.
2912            AnimationFade(std::boxed::Box<crate::model::overlay::AnimationFade>),
2913            /// End previous animation.
2914            AnimationEnd(std::boxed::Box<crate::model::overlay::AnimationEnd>),
2915        }
2916    }
2917
2918    /// Fade type for the overlay: `FADE_IN` or `FADE_OUT`.
2919    ///
2920    /// # Working with unknown values
2921    ///
2922    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2923    /// additional enum variants at any time. Adding new variants is not considered
2924    /// a breaking change. Applications should write their code in anticipation of:
2925    ///
2926    /// - New values appearing in future releases of the client library, **and**
2927    /// - New values received dynamically, without application changes.
2928    ///
2929    /// Please consult the [Working with enums] section in the user guide for some
2930    /// guidelines.
2931    ///
2932    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2933    #[derive(Clone, Debug, PartialEq)]
2934    #[non_exhaustive]
2935    pub enum FadeType {
2936        /// The fade type is not specified.
2937        Unspecified,
2938        /// Fade the overlay object into view.
2939        FadeIn,
2940        /// Fade the overlay object out of view.
2941        FadeOut,
2942        /// If set, the enum was initialized with an unknown value.
2943        ///
2944        /// Applications can examine the value using [FadeType::value] or
2945        /// [FadeType::name].
2946        UnknownValue(fade_type::UnknownValue),
2947    }
2948
2949    #[doc(hidden)]
2950    pub mod fade_type {
2951        #[allow(unused_imports)]
2952        use super::*;
2953        #[derive(Clone, Debug, PartialEq)]
2954        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2955    }
2956
2957    impl FadeType {
2958        /// Gets the enum value.
2959        ///
2960        /// Returns `None` if the enum contains an unknown value deserialized from
2961        /// the string representation of enums.
2962        pub fn value(&self) -> std::option::Option<i32> {
2963            match self {
2964                Self::Unspecified => std::option::Option::Some(0),
2965                Self::FadeIn => std::option::Option::Some(1),
2966                Self::FadeOut => std::option::Option::Some(2),
2967                Self::UnknownValue(u) => u.0.value(),
2968            }
2969        }
2970
2971        /// Gets the enum value as a string.
2972        ///
2973        /// Returns `None` if the enum contains an unknown value deserialized from
2974        /// the integer representation of enums.
2975        pub fn name(&self) -> std::option::Option<&str> {
2976            match self {
2977                Self::Unspecified => std::option::Option::Some("FADE_TYPE_UNSPECIFIED"),
2978                Self::FadeIn => std::option::Option::Some("FADE_IN"),
2979                Self::FadeOut => std::option::Option::Some("FADE_OUT"),
2980                Self::UnknownValue(u) => u.0.name(),
2981            }
2982        }
2983    }
2984
2985    impl std::default::Default for FadeType {
2986        fn default() -> Self {
2987            use std::convert::From;
2988            Self::from(0)
2989        }
2990    }
2991
2992    impl std::fmt::Display for FadeType {
2993        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2994            wkt::internal::display_enum(f, self.name(), self.value())
2995        }
2996    }
2997
2998    impl std::convert::From<i32> for FadeType {
2999        fn from(value: i32) -> Self {
3000            match value {
3001                0 => Self::Unspecified,
3002                1 => Self::FadeIn,
3003                2 => Self::FadeOut,
3004                _ => Self::UnknownValue(fade_type::UnknownValue(
3005                    wkt::internal::UnknownEnumValue::Integer(value),
3006                )),
3007            }
3008        }
3009    }
3010
3011    impl std::convert::From<&str> for FadeType {
3012        fn from(value: &str) -> Self {
3013            use std::string::ToString;
3014            match value {
3015                "FADE_TYPE_UNSPECIFIED" => Self::Unspecified,
3016                "FADE_IN" => Self::FadeIn,
3017                "FADE_OUT" => Self::FadeOut,
3018                _ => Self::UnknownValue(fade_type::UnknownValue(
3019                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3020                )),
3021            }
3022        }
3023    }
3024
3025    impl serde::ser::Serialize for FadeType {
3026        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3027        where
3028            S: serde::Serializer,
3029        {
3030            match self {
3031                Self::Unspecified => serializer.serialize_i32(0),
3032                Self::FadeIn => serializer.serialize_i32(1),
3033                Self::FadeOut => serializer.serialize_i32(2),
3034                Self::UnknownValue(u) => u.0.serialize(serializer),
3035            }
3036        }
3037    }
3038
3039    impl<'de> serde::de::Deserialize<'de> for FadeType {
3040        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3041        where
3042            D: serde::Deserializer<'de>,
3043        {
3044            deserializer.deserialize_any(wkt::internal::EnumVisitor::<FadeType>::new(
3045                ".google.cloud.video.transcoder.v1.Overlay.FadeType",
3046            ))
3047        }
3048    }
3049}
3050
3051/// Preprocessing configurations.
3052#[derive(Clone, Default, PartialEq)]
3053#[non_exhaustive]
3054pub struct PreprocessingConfig {
3055    /// Color preprocessing configuration.
3056    pub color: std::option::Option<crate::model::preprocessing_config::Color>,
3057
3058    /// Denoise preprocessing configuration.
3059    pub denoise: std::option::Option<crate::model::preprocessing_config::Denoise>,
3060
3061    /// Deblock preprocessing configuration.
3062    pub deblock: std::option::Option<crate::model::preprocessing_config::Deblock>,
3063
3064    /// Audio preprocessing configuration.
3065    pub audio: std::option::Option<crate::model::preprocessing_config::Audio>,
3066
3067    /// Specify the video cropping configuration.
3068    pub crop: std::option::Option<crate::model::preprocessing_config::Crop>,
3069
3070    /// Specify the video pad filter configuration.
3071    pub pad: std::option::Option<crate::model::preprocessing_config::Pad>,
3072
3073    /// Specify the video deinterlace configuration.
3074    pub deinterlace: std::option::Option<crate::model::preprocessing_config::Deinterlace>,
3075
3076    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3077}
3078
3079impl PreprocessingConfig {
3080    pub fn new() -> Self {
3081        std::default::Default::default()
3082    }
3083
3084    /// Sets the value of [color][crate::model::PreprocessingConfig::color].
3085    pub fn set_color<T>(mut self, v: T) -> Self
3086    where
3087        T: std::convert::Into<crate::model::preprocessing_config::Color>,
3088    {
3089        self.color = std::option::Option::Some(v.into());
3090        self
3091    }
3092
3093    /// Sets or clears the value of [color][crate::model::PreprocessingConfig::color].
3094    pub fn set_or_clear_color<T>(mut self, v: std::option::Option<T>) -> Self
3095    where
3096        T: std::convert::Into<crate::model::preprocessing_config::Color>,
3097    {
3098        self.color = v.map(|x| x.into());
3099        self
3100    }
3101
3102    /// Sets the value of [denoise][crate::model::PreprocessingConfig::denoise].
3103    pub fn set_denoise<T>(mut self, v: T) -> Self
3104    where
3105        T: std::convert::Into<crate::model::preprocessing_config::Denoise>,
3106    {
3107        self.denoise = std::option::Option::Some(v.into());
3108        self
3109    }
3110
3111    /// Sets or clears the value of [denoise][crate::model::PreprocessingConfig::denoise].
3112    pub fn set_or_clear_denoise<T>(mut self, v: std::option::Option<T>) -> Self
3113    where
3114        T: std::convert::Into<crate::model::preprocessing_config::Denoise>,
3115    {
3116        self.denoise = v.map(|x| x.into());
3117        self
3118    }
3119
3120    /// Sets the value of [deblock][crate::model::PreprocessingConfig::deblock].
3121    pub fn set_deblock<T>(mut self, v: T) -> Self
3122    where
3123        T: std::convert::Into<crate::model::preprocessing_config::Deblock>,
3124    {
3125        self.deblock = std::option::Option::Some(v.into());
3126        self
3127    }
3128
3129    /// Sets or clears the value of [deblock][crate::model::PreprocessingConfig::deblock].
3130    pub fn set_or_clear_deblock<T>(mut self, v: std::option::Option<T>) -> Self
3131    where
3132        T: std::convert::Into<crate::model::preprocessing_config::Deblock>,
3133    {
3134        self.deblock = v.map(|x| x.into());
3135        self
3136    }
3137
3138    /// Sets the value of [audio][crate::model::PreprocessingConfig::audio].
3139    pub fn set_audio<T>(mut self, v: T) -> Self
3140    where
3141        T: std::convert::Into<crate::model::preprocessing_config::Audio>,
3142    {
3143        self.audio = std::option::Option::Some(v.into());
3144        self
3145    }
3146
3147    /// Sets or clears the value of [audio][crate::model::PreprocessingConfig::audio].
3148    pub fn set_or_clear_audio<T>(mut self, v: std::option::Option<T>) -> Self
3149    where
3150        T: std::convert::Into<crate::model::preprocessing_config::Audio>,
3151    {
3152        self.audio = v.map(|x| x.into());
3153        self
3154    }
3155
3156    /// Sets the value of [crop][crate::model::PreprocessingConfig::crop].
3157    pub fn set_crop<T>(mut self, v: T) -> Self
3158    where
3159        T: std::convert::Into<crate::model::preprocessing_config::Crop>,
3160    {
3161        self.crop = std::option::Option::Some(v.into());
3162        self
3163    }
3164
3165    /// Sets or clears the value of [crop][crate::model::PreprocessingConfig::crop].
3166    pub fn set_or_clear_crop<T>(mut self, v: std::option::Option<T>) -> Self
3167    where
3168        T: std::convert::Into<crate::model::preprocessing_config::Crop>,
3169    {
3170        self.crop = v.map(|x| x.into());
3171        self
3172    }
3173
3174    /// Sets the value of [pad][crate::model::PreprocessingConfig::pad].
3175    pub fn set_pad<T>(mut self, v: T) -> Self
3176    where
3177        T: std::convert::Into<crate::model::preprocessing_config::Pad>,
3178    {
3179        self.pad = std::option::Option::Some(v.into());
3180        self
3181    }
3182
3183    /// Sets or clears the value of [pad][crate::model::PreprocessingConfig::pad].
3184    pub fn set_or_clear_pad<T>(mut self, v: std::option::Option<T>) -> Self
3185    where
3186        T: std::convert::Into<crate::model::preprocessing_config::Pad>,
3187    {
3188        self.pad = v.map(|x| x.into());
3189        self
3190    }
3191
3192    /// Sets the value of [deinterlace][crate::model::PreprocessingConfig::deinterlace].
3193    pub fn set_deinterlace<T>(mut self, v: T) -> Self
3194    where
3195        T: std::convert::Into<crate::model::preprocessing_config::Deinterlace>,
3196    {
3197        self.deinterlace = std::option::Option::Some(v.into());
3198        self
3199    }
3200
3201    /// Sets or clears the value of [deinterlace][crate::model::PreprocessingConfig::deinterlace].
3202    pub fn set_or_clear_deinterlace<T>(mut self, v: std::option::Option<T>) -> Self
3203    where
3204        T: std::convert::Into<crate::model::preprocessing_config::Deinterlace>,
3205    {
3206        self.deinterlace = v.map(|x| x.into());
3207        self
3208    }
3209}
3210
3211impl wkt::message::Message for PreprocessingConfig {
3212    fn typename() -> &'static str {
3213        "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig"
3214    }
3215}
3216
3217/// Defines additional types related to [PreprocessingConfig].
3218pub mod preprocessing_config {
3219    #[allow(unused_imports)]
3220    use super::*;
3221
3222    /// Color preprocessing configuration.
3223    ///
3224    /// **Note:** This configuration is not supported.
3225    #[derive(Clone, Default, PartialEq)]
3226    #[non_exhaustive]
3227    pub struct Color {
3228        /// Control color saturation of the video. Enter a value between -1 and 1,
3229        /// where -1 is fully desaturated and 1 is maximum saturation. 0 is no
3230        /// change. The default is 0.
3231        pub saturation: f64,
3232
3233        /// Control black and white contrast of the video. Enter a value between -1
3234        /// and 1, where -1 is minimum contrast and 1 is maximum contrast. 0 is no
3235        /// change. The default is 0.
3236        pub contrast: f64,
3237
3238        /// Control brightness of the video. Enter a value between -1 and 1, where -1
3239        /// is minimum brightness and 1 is maximum brightness. 0 is no change. The
3240        /// default is 0.
3241        pub brightness: f64,
3242
3243        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3244    }
3245
3246    impl Color {
3247        pub fn new() -> Self {
3248            std::default::Default::default()
3249        }
3250
3251        /// Sets the value of [saturation][crate::model::preprocessing_config::Color::saturation].
3252        pub fn set_saturation<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
3253            self.saturation = v.into();
3254            self
3255        }
3256
3257        /// Sets the value of [contrast][crate::model::preprocessing_config::Color::contrast].
3258        pub fn set_contrast<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
3259            self.contrast = v.into();
3260            self
3261        }
3262
3263        /// Sets the value of [brightness][crate::model::preprocessing_config::Color::brightness].
3264        pub fn set_brightness<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
3265            self.brightness = v.into();
3266            self
3267        }
3268    }
3269
3270    impl wkt::message::Message for Color {
3271        fn typename() -> &'static str {
3272            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Color"
3273        }
3274    }
3275
3276    /// Denoise preprocessing configuration.
3277    ///
3278    /// **Note:** This configuration is not supported.
3279    #[derive(Clone, Default, PartialEq)]
3280    #[non_exhaustive]
3281    pub struct Denoise {
3282        /// Set strength of the denoise. Enter a value between 0 and 1. The higher
3283        /// the value, the smoother the image. 0 is no denoising. The default is 0.
3284        pub strength: f64,
3285
3286        /// Set the denoiser mode. The default is `standard`.
3287        ///
3288        /// Supported denoiser modes:
3289        ///
3290        /// - `standard`
3291        /// - `grain`
3292        pub tune: std::string::String,
3293
3294        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3295    }
3296
3297    impl Denoise {
3298        pub fn new() -> Self {
3299            std::default::Default::default()
3300        }
3301
3302        /// Sets the value of [strength][crate::model::preprocessing_config::Denoise::strength].
3303        pub fn set_strength<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
3304            self.strength = v.into();
3305            self
3306        }
3307
3308        /// Sets the value of [tune][crate::model::preprocessing_config::Denoise::tune].
3309        pub fn set_tune<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3310            self.tune = v.into();
3311            self
3312        }
3313    }
3314
3315    impl wkt::message::Message for Denoise {
3316        fn typename() -> &'static str {
3317            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise"
3318        }
3319    }
3320
3321    /// Deblock preprocessing configuration.
3322    ///
3323    /// **Note:** This configuration is not supported.
3324    #[derive(Clone, Default, PartialEq)]
3325    #[non_exhaustive]
3326    pub struct Deblock {
3327        /// Set strength of the deblocker. Enter a value between 0 and 1. The higher
3328        /// the value, the stronger the block removal. 0 is no deblocking. The
3329        /// default is 0.
3330        pub strength: f64,
3331
3332        /// Enable deblocker. The default is `false`.
3333        pub enabled: bool,
3334
3335        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3336    }
3337
3338    impl Deblock {
3339        pub fn new() -> Self {
3340            std::default::Default::default()
3341        }
3342
3343        /// Sets the value of [strength][crate::model::preprocessing_config::Deblock::strength].
3344        pub fn set_strength<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
3345            self.strength = v.into();
3346            self
3347        }
3348
3349        /// Sets the value of [enabled][crate::model::preprocessing_config::Deblock::enabled].
3350        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3351            self.enabled = v.into();
3352            self
3353        }
3354    }
3355
3356    impl wkt::message::Message for Deblock {
3357        fn typename() -> &'static str {
3358            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock"
3359        }
3360    }
3361
3362    /// Audio preprocessing configuration.
3363    #[derive(Clone, Default, PartialEq)]
3364    #[non_exhaustive]
3365    pub struct Audio {
3366        /// Specify audio loudness normalization in loudness units relative to full
3367        /// scale (LUFS). Enter a value between -24 and 0 (the default), where:
3368        ///
3369        /// * -24 is the Advanced Television Systems Committee (ATSC A/85) standard
3370        /// * -23 is the EU R128 broadcast standard
3371        /// * -19 is the prior standard for online mono audio
3372        /// * -18 is the ReplayGain standard
3373        /// * -16 is the prior standard for stereo audio
3374        /// * -14 is the new online audio standard recommended by Spotify, as well
3375        ///   as Amazon Echo
3376        /// * 0 disables normalization
3377        pub lufs: f64,
3378
3379        /// Enable boosting high frequency components. The default is `false`.
3380        ///
3381        /// **Note:** This field is not supported.
3382        pub high_boost: bool,
3383
3384        /// Enable boosting low frequency components. The default is `false`.
3385        ///
3386        /// **Note:** This field is not supported.
3387        pub low_boost: bool,
3388
3389        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3390    }
3391
3392    impl Audio {
3393        pub fn new() -> Self {
3394            std::default::Default::default()
3395        }
3396
3397        /// Sets the value of [lufs][crate::model::preprocessing_config::Audio::lufs].
3398        pub fn set_lufs<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
3399            self.lufs = v.into();
3400            self
3401        }
3402
3403        /// Sets the value of [high_boost][crate::model::preprocessing_config::Audio::high_boost].
3404        pub fn set_high_boost<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3405            self.high_boost = v.into();
3406            self
3407        }
3408
3409        /// Sets the value of [low_boost][crate::model::preprocessing_config::Audio::low_boost].
3410        pub fn set_low_boost<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3411            self.low_boost = v.into();
3412            self
3413        }
3414    }
3415
3416    impl wkt::message::Message for Audio {
3417        fn typename() -> &'static str {
3418            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Audio"
3419        }
3420    }
3421
3422    /// Video cropping configuration for the input video. The cropped input video
3423    /// is scaled to match the output resolution.
3424    #[derive(Clone, Default, PartialEq)]
3425    #[non_exhaustive]
3426    pub struct Crop {
3427        /// The number of pixels to crop from the top. The default is 0.
3428        pub top_pixels: i32,
3429
3430        /// The number of pixels to crop from the bottom. The default is 0.
3431        pub bottom_pixels: i32,
3432
3433        /// The number of pixels to crop from the left. The default is 0.
3434        pub left_pixels: i32,
3435
3436        /// The number of pixels to crop from the right. The default is 0.
3437        pub right_pixels: i32,
3438
3439        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3440    }
3441
3442    impl Crop {
3443        pub fn new() -> Self {
3444            std::default::Default::default()
3445        }
3446
3447        /// Sets the value of [top_pixels][crate::model::preprocessing_config::Crop::top_pixels].
3448        pub fn set_top_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3449            self.top_pixels = v.into();
3450            self
3451        }
3452
3453        /// Sets the value of [bottom_pixels][crate::model::preprocessing_config::Crop::bottom_pixels].
3454        pub fn set_bottom_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3455            self.bottom_pixels = v.into();
3456            self
3457        }
3458
3459        /// Sets the value of [left_pixels][crate::model::preprocessing_config::Crop::left_pixels].
3460        pub fn set_left_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3461            self.left_pixels = v.into();
3462            self
3463        }
3464
3465        /// Sets the value of [right_pixels][crate::model::preprocessing_config::Crop::right_pixels].
3466        pub fn set_right_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3467            self.right_pixels = v.into();
3468            self
3469        }
3470    }
3471
3472    impl wkt::message::Message for Crop {
3473        fn typename() -> &'static str {
3474            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Crop"
3475        }
3476    }
3477
3478    /// Pad filter configuration for the input video. The padded input video
3479    /// is scaled after padding with black to match the output resolution.
3480    #[derive(Clone, Default, PartialEq)]
3481    #[non_exhaustive]
3482    pub struct Pad {
3483        /// The number of pixels to add to the top. The default is 0.
3484        pub top_pixels: i32,
3485
3486        /// The number of pixels to add to the bottom. The default is 0.
3487        pub bottom_pixels: i32,
3488
3489        /// The number of pixels to add to the left. The default is 0.
3490        pub left_pixels: i32,
3491
3492        /// The number of pixels to add to the right. The default is 0.
3493        pub right_pixels: i32,
3494
3495        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3496    }
3497
3498    impl Pad {
3499        pub fn new() -> Self {
3500            std::default::Default::default()
3501        }
3502
3503        /// Sets the value of [top_pixels][crate::model::preprocessing_config::Pad::top_pixels].
3504        pub fn set_top_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3505            self.top_pixels = v.into();
3506            self
3507        }
3508
3509        /// Sets the value of [bottom_pixels][crate::model::preprocessing_config::Pad::bottom_pixels].
3510        pub fn set_bottom_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3511            self.bottom_pixels = v.into();
3512            self
3513        }
3514
3515        /// Sets the value of [left_pixels][crate::model::preprocessing_config::Pad::left_pixels].
3516        pub fn set_left_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3517            self.left_pixels = v.into();
3518            self
3519        }
3520
3521        /// Sets the value of [right_pixels][crate::model::preprocessing_config::Pad::right_pixels].
3522        pub fn set_right_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3523            self.right_pixels = v.into();
3524            self
3525        }
3526    }
3527
3528    impl wkt::message::Message for Pad {
3529        fn typename() -> &'static str {
3530            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Pad"
3531        }
3532    }
3533
3534    /// Deinterlace configuration for input video.
3535    #[derive(Clone, Default, PartialEq)]
3536    #[non_exhaustive]
3537    pub struct Deinterlace {
3538        /// Specify the video deinterlacing filter. The default is `yadif`.
3539        pub deinterlacing_filter: std::option::Option<
3540            crate::model::preprocessing_config::deinterlace::DeinterlacingFilter,
3541        >,
3542
3543        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3544    }
3545
3546    impl Deinterlace {
3547        pub fn new() -> Self {
3548            std::default::Default::default()
3549        }
3550
3551        /// Sets the value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter].
3552        ///
3553        /// Note that all the setters affecting `deinterlacing_filter` are mutually
3554        /// exclusive.
3555        pub fn set_deinterlacing_filter<
3556            T: std::convert::Into<
3557                    std::option::Option<
3558                        crate::model::preprocessing_config::deinterlace::DeinterlacingFilter,
3559                    >,
3560                >,
3561        >(
3562            mut self,
3563            v: T,
3564        ) -> Self {
3565            self.deinterlacing_filter = v.into();
3566            self
3567        }
3568
3569        /// The value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter]
3570        /// if it holds a `Yadif`, `None` if the field is not set or
3571        /// holds a different branch.
3572        pub fn yadif(
3573            &self,
3574        ) -> std::option::Option<
3575            &std::boxed::Box<crate::model::preprocessing_config::deinterlace::YadifConfig>,
3576        > {
3577            #[allow(unreachable_patterns)]
3578            self.deinterlacing_filter.as_ref().and_then(|v| match v {
3579                crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Yadif(v) => {
3580                    std::option::Option::Some(v)
3581                }
3582                _ => std::option::Option::None,
3583            })
3584        }
3585
3586        /// Sets the value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter]
3587        /// to hold a `Yadif`.
3588        ///
3589        /// Note that all the setters affecting `deinterlacing_filter` are
3590        /// mutually exclusive.
3591        pub fn set_yadif<
3592            T: std::convert::Into<
3593                    std::boxed::Box<crate::model::preprocessing_config::deinterlace::YadifConfig>,
3594                >,
3595        >(
3596            mut self,
3597            v: T,
3598        ) -> Self {
3599            self.deinterlacing_filter = std::option::Option::Some(
3600                crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Yadif(
3601                    v.into(),
3602                ),
3603            );
3604            self
3605        }
3606
3607        /// The value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter]
3608        /// if it holds a `Bwdif`, `None` if the field is not set or
3609        /// holds a different branch.
3610        pub fn bwdif(
3611            &self,
3612        ) -> std::option::Option<
3613            &std::boxed::Box<crate::model::preprocessing_config::deinterlace::BwdifConfig>,
3614        > {
3615            #[allow(unreachable_patterns)]
3616            self.deinterlacing_filter.as_ref().and_then(|v| match v {
3617                crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Bwdif(v) => {
3618                    std::option::Option::Some(v)
3619                }
3620                _ => std::option::Option::None,
3621            })
3622        }
3623
3624        /// Sets the value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter]
3625        /// to hold a `Bwdif`.
3626        ///
3627        /// Note that all the setters affecting `deinterlacing_filter` are
3628        /// mutually exclusive.
3629        pub fn set_bwdif<
3630            T: std::convert::Into<
3631                    std::boxed::Box<crate::model::preprocessing_config::deinterlace::BwdifConfig>,
3632                >,
3633        >(
3634            mut self,
3635            v: T,
3636        ) -> Self {
3637            self.deinterlacing_filter = std::option::Option::Some(
3638                crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Bwdif(
3639                    v.into(),
3640                ),
3641            );
3642            self
3643        }
3644    }
3645
3646    impl wkt::message::Message for Deinterlace {
3647        fn typename() -> &'static str {
3648            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace"
3649        }
3650    }
3651
3652    /// Defines additional types related to [Deinterlace].
3653    pub mod deinterlace {
3654        #[allow(unused_imports)]
3655        use super::*;
3656
3657        /// Yet Another Deinterlacing Filter Configuration.
3658        #[derive(Clone, Default, PartialEq)]
3659        #[non_exhaustive]
3660        pub struct YadifConfig {
3661            /// Specifies the deinterlacing mode to adopt.
3662            /// The default is `send_frame`.
3663            /// Supported values:
3664            ///
3665            /// - `send_frame`: Output one frame for each frame
3666            /// - `send_field`: Output one frame for each field
3667            pub mode: std::string::String,
3668
3669            /// Disable spacial interlacing.
3670            /// The default is `false`.
3671            pub disable_spatial_interlacing: bool,
3672
3673            /// The picture field parity assumed for the input interlaced video.
3674            /// The default is `auto`.
3675            /// Supported values:
3676            ///
3677            /// - `tff`: Assume the top field is first
3678            /// - `bff`: Assume the bottom field is first
3679            /// - `auto`: Enable automatic detection of field parity
3680            pub parity: std::string::String,
3681
3682            /// Deinterlace all frames rather than just the frames identified as
3683            /// interlaced. The default is `false`.
3684            pub deinterlace_all_frames: bool,
3685
3686            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3687        }
3688
3689        impl YadifConfig {
3690            pub fn new() -> Self {
3691                std::default::Default::default()
3692            }
3693
3694            /// Sets the value of [mode][crate::model::preprocessing_config::deinterlace::YadifConfig::mode].
3695            pub fn set_mode<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3696                self.mode = v.into();
3697                self
3698            }
3699
3700            /// Sets the value of [disable_spatial_interlacing][crate::model::preprocessing_config::deinterlace::YadifConfig::disable_spatial_interlacing].
3701            pub fn set_disable_spatial_interlacing<T: std::convert::Into<bool>>(
3702                mut self,
3703                v: T,
3704            ) -> Self {
3705                self.disable_spatial_interlacing = v.into();
3706                self
3707            }
3708
3709            /// Sets the value of [parity][crate::model::preprocessing_config::deinterlace::YadifConfig::parity].
3710            pub fn set_parity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3711                self.parity = v.into();
3712                self
3713            }
3714
3715            /// Sets the value of [deinterlace_all_frames][crate::model::preprocessing_config::deinterlace::YadifConfig::deinterlace_all_frames].
3716            pub fn set_deinterlace_all_frames<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3717                self.deinterlace_all_frames = v.into();
3718                self
3719            }
3720        }
3721
3722        impl wkt::message::Message for YadifConfig {
3723            fn typename() -> &'static str {
3724                "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace.YadifConfig"
3725            }
3726        }
3727
3728        /// Bob Weaver Deinterlacing Filter Configuration.
3729        #[derive(Clone, Default, PartialEq)]
3730        #[non_exhaustive]
3731        pub struct BwdifConfig {
3732            /// Specifies the deinterlacing mode to adopt.
3733            /// The default is `send_frame`.
3734            /// Supported values:
3735            ///
3736            /// - `send_frame`: Output one frame for each frame
3737            /// - `send_field`: Output one frame for each field
3738            pub mode: std::string::String,
3739
3740            /// The picture field parity assumed for the input interlaced video.
3741            /// The default is `auto`.
3742            /// Supported values:
3743            ///
3744            /// - `tff`: Assume the top field is first
3745            /// - `bff`: Assume the bottom field is first
3746            /// - `auto`: Enable automatic detection of field parity
3747            pub parity: std::string::String,
3748
3749            /// Deinterlace all frames rather than just the frames identified as
3750            /// interlaced. The default is `false`.
3751            pub deinterlace_all_frames: bool,
3752
3753            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3754        }
3755
3756        impl BwdifConfig {
3757            pub fn new() -> Self {
3758                std::default::Default::default()
3759            }
3760
3761            /// Sets the value of [mode][crate::model::preprocessing_config::deinterlace::BwdifConfig::mode].
3762            pub fn set_mode<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3763                self.mode = v.into();
3764                self
3765            }
3766
3767            /// Sets the value of [parity][crate::model::preprocessing_config::deinterlace::BwdifConfig::parity].
3768            pub fn set_parity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3769                self.parity = v.into();
3770                self
3771            }
3772
3773            /// Sets the value of [deinterlace_all_frames][crate::model::preprocessing_config::deinterlace::BwdifConfig::deinterlace_all_frames].
3774            pub fn set_deinterlace_all_frames<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3775                self.deinterlace_all_frames = v.into();
3776                self
3777            }
3778        }
3779
3780        impl wkt::message::Message for BwdifConfig {
3781            fn typename() -> &'static str {
3782                "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace.BwdifConfig"
3783            }
3784        }
3785
3786        /// Specify the video deinterlacing filter. The default is `yadif`.
3787        #[derive(Clone, Debug, PartialEq)]
3788        #[non_exhaustive]
3789        pub enum DeinterlacingFilter {
3790            /// Specifies the Yet Another Deinterlacing Filter Configuration.
3791            Yadif(std::boxed::Box<crate::model::preprocessing_config::deinterlace::YadifConfig>),
3792            /// Specifies the Bob Weaver Deinterlacing Filter Configuration.
3793            Bwdif(std::boxed::Box<crate::model::preprocessing_config::deinterlace::BwdifConfig>),
3794        }
3795    }
3796}
3797
3798/// Track definition for the input asset.
3799#[derive(Clone, Default, PartialEq)]
3800#[non_exhaustive]
3801pub struct TrackDefinition {
3802    /// The input track.
3803    pub input_track: std::option::Option<i32>,
3804
3805    /// Optional. A list of languages spoken in the input asset, represented by a
3806    /// BCP 47 language code, such as "en-US" or "sr-Latn". For more information,
3807    /// see <https://www.unicode.org/reports/tr35/#Unicode_locale_identifier>.
3808    pub languages: std::vec::Vec<std::string::String>,
3809
3810    /// Optional. Whether to automatically detect the languages present in the
3811    /// track. If true, the system will attempt to identify all the languages
3812    /// present in the track and populate the languages field.
3813    pub detect_languages: bool,
3814
3815    /// Output only. A list of languages detected in the input asset, represented
3816    /// by a BCP 47 language code, such as "en-US" or "sr-Latn". For more
3817    /// information, see
3818    /// <https://www.unicode.org/reports/tr35/#Unicode_locale_identifier>.
3819    /// This field is only populated if the detect_languages field is set to true.
3820    pub detected_languages: std::vec::Vec<std::string::String>,
3821
3822    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3823}
3824
3825impl TrackDefinition {
3826    pub fn new() -> Self {
3827        std::default::Default::default()
3828    }
3829
3830    /// Sets the value of [input_track][crate::model::TrackDefinition::input_track].
3831    pub fn set_input_track<T>(mut self, v: T) -> Self
3832    where
3833        T: std::convert::Into<i32>,
3834    {
3835        self.input_track = std::option::Option::Some(v.into());
3836        self
3837    }
3838
3839    /// Sets or clears the value of [input_track][crate::model::TrackDefinition::input_track].
3840    pub fn set_or_clear_input_track<T>(mut self, v: std::option::Option<T>) -> Self
3841    where
3842        T: std::convert::Into<i32>,
3843    {
3844        self.input_track = v.map(|x| x.into());
3845        self
3846    }
3847
3848    /// Sets the value of [languages][crate::model::TrackDefinition::languages].
3849    pub fn set_languages<T, V>(mut self, v: T) -> Self
3850    where
3851        T: std::iter::IntoIterator<Item = V>,
3852        V: std::convert::Into<std::string::String>,
3853    {
3854        use std::iter::Iterator;
3855        self.languages = v.into_iter().map(|i| i.into()).collect();
3856        self
3857    }
3858
3859    /// Sets the value of [detect_languages][crate::model::TrackDefinition::detect_languages].
3860    pub fn set_detect_languages<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3861        self.detect_languages = v.into();
3862        self
3863    }
3864
3865    /// Sets the value of [detected_languages][crate::model::TrackDefinition::detected_languages].
3866    pub fn set_detected_languages<T, V>(mut self, v: T) -> Self
3867    where
3868        T: std::iter::IntoIterator<Item = V>,
3869        V: std::convert::Into<std::string::String>,
3870    {
3871        use std::iter::Iterator;
3872        self.detected_languages = v.into_iter().map(|i| i.into()).collect();
3873        self
3874    }
3875}
3876
3877impl wkt::message::Message for TrackDefinition {
3878    fn typename() -> &'static str {
3879        "type.googleapis.com/google.cloud.video.transcoder.v1.TrackDefinition"
3880    }
3881}
3882
3883/// Input attributes that provide additional information about the input asset.
3884#[derive(Clone, Default, PartialEq)]
3885#[non_exhaustive]
3886pub struct InputAttributes {
3887    /// Optional. A list of track definitions for the input asset.
3888    pub track_definitions: std::vec::Vec<crate::model::TrackDefinition>,
3889
3890    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3891}
3892
3893impl InputAttributes {
3894    pub fn new() -> Self {
3895        std::default::Default::default()
3896    }
3897
3898    /// Sets the value of [track_definitions][crate::model::InputAttributes::track_definitions].
3899    pub fn set_track_definitions<T, V>(mut self, v: T) -> Self
3900    where
3901        T: std::iter::IntoIterator<Item = V>,
3902        V: std::convert::Into<crate::model::TrackDefinition>,
3903    {
3904        use std::iter::Iterator;
3905        self.track_definitions = v.into_iter().map(|i| i.into()).collect();
3906        self
3907    }
3908}
3909
3910impl wkt::message::Message for InputAttributes {
3911    fn typename() -> &'static str {
3912        "type.googleapis.com/google.cloud.video.transcoder.v1.InputAttributes"
3913    }
3914}
3915
3916/// Video stream resource.
3917#[derive(Clone, Default, PartialEq)]
3918#[non_exhaustive]
3919pub struct VideoStream {
3920    /// Codec settings can be h264, h265, or vp9.
3921    pub codec_settings: std::option::Option<crate::model::video_stream::CodecSettings>,
3922
3923    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3924}
3925
3926impl VideoStream {
3927    pub fn new() -> Self {
3928        std::default::Default::default()
3929    }
3930
3931    /// Sets the value of [codec_settings][crate::model::VideoStream::codec_settings].
3932    ///
3933    /// Note that all the setters affecting `codec_settings` are mutually
3934    /// exclusive.
3935    pub fn set_codec_settings<
3936        T: std::convert::Into<std::option::Option<crate::model::video_stream::CodecSettings>>,
3937    >(
3938        mut self,
3939        v: T,
3940    ) -> Self {
3941        self.codec_settings = v.into();
3942        self
3943    }
3944
3945    /// The value of [codec_settings][crate::model::VideoStream::codec_settings]
3946    /// if it holds a `H264`, `None` if the field is not set or
3947    /// holds a different branch.
3948    pub fn h264(
3949        &self,
3950    ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H264CodecSettings>> {
3951        #[allow(unreachable_patterns)]
3952        self.codec_settings.as_ref().and_then(|v| match v {
3953            crate::model::video_stream::CodecSettings::H264(v) => std::option::Option::Some(v),
3954            _ => std::option::Option::None,
3955        })
3956    }
3957
3958    /// Sets the value of [codec_settings][crate::model::VideoStream::codec_settings]
3959    /// to hold a `H264`.
3960    ///
3961    /// Note that all the setters affecting `codec_settings` are
3962    /// mutually exclusive.
3963    pub fn set_h264<
3964        T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H264CodecSettings>>,
3965    >(
3966        mut self,
3967        v: T,
3968    ) -> Self {
3969        self.codec_settings =
3970            std::option::Option::Some(crate::model::video_stream::CodecSettings::H264(v.into()));
3971        self
3972    }
3973
3974    /// The value of [codec_settings][crate::model::VideoStream::codec_settings]
3975    /// if it holds a `H265`, `None` if the field is not set or
3976    /// holds a different branch.
3977    pub fn h265(
3978        &self,
3979    ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H265CodecSettings>> {
3980        #[allow(unreachable_patterns)]
3981        self.codec_settings.as_ref().and_then(|v| match v {
3982            crate::model::video_stream::CodecSettings::H265(v) => std::option::Option::Some(v),
3983            _ => std::option::Option::None,
3984        })
3985    }
3986
3987    /// Sets the value of [codec_settings][crate::model::VideoStream::codec_settings]
3988    /// to hold a `H265`.
3989    ///
3990    /// Note that all the setters affecting `codec_settings` are
3991    /// mutually exclusive.
3992    pub fn set_h265<
3993        T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H265CodecSettings>>,
3994    >(
3995        mut self,
3996        v: T,
3997    ) -> Self {
3998        self.codec_settings =
3999            std::option::Option::Some(crate::model::video_stream::CodecSettings::H265(v.into()));
4000        self
4001    }
4002
4003    /// The value of [codec_settings][crate::model::VideoStream::codec_settings]
4004    /// if it holds a `Vp9`, `None` if the field is not set or
4005    /// holds a different branch.
4006    pub fn vp9(
4007        &self,
4008    ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::Vp9CodecSettings>> {
4009        #[allow(unreachable_patterns)]
4010        self.codec_settings.as_ref().and_then(|v| match v {
4011            crate::model::video_stream::CodecSettings::Vp9(v) => std::option::Option::Some(v),
4012            _ => std::option::Option::None,
4013        })
4014    }
4015
4016    /// Sets the value of [codec_settings][crate::model::VideoStream::codec_settings]
4017    /// to hold a `Vp9`.
4018    ///
4019    /// Note that all the setters affecting `codec_settings` are
4020    /// mutually exclusive.
4021    pub fn set_vp9<
4022        T: std::convert::Into<std::boxed::Box<crate::model::video_stream::Vp9CodecSettings>>,
4023    >(
4024        mut self,
4025        v: T,
4026    ) -> Self {
4027        self.codec_settings =
4028            std::option::Option::Some(crate::model::video_stream::CodecSettings::Vp9(v.into()));
4029        self
4030    }
4031}
4032
4033impl wkt::message::Message for VideoStream {
4034    fn typename() -> &'static str {
4035        "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream"
4036    }
4037}
4038
4039/// Defines additional types related to [VideoStream].
4040pub mod video_stream {
4041    #[allow(unused_imports)]
4042    use super::*;
4043
4044    /// Convert the input video to a Standard Dynamic Range (SDR) video.
4045    #[derive(Clone, Default, PartialEq)]
4046    #[non_exhaustive]
4047    pub struct H264ColorFormatSDR {
4048        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4049    }
4050
4051    impl H264ColorFormatSDR {
4052        pub fn new() -> Self {
4053            std::default::Default::default()
4054        }
4055    }
4056
4057    impl wkt::message::Message for H264ColorFormatSDR {
4058        fn typename() -> &'static str {
4059            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H264ColorFormatSDR"
4060        }
4061    }
4062
4063    /// Convert the input video to a Hybrid Log Gamma (HLG) video.
4064    #[derive(Clone, Default, PartialEq)]
4065    #[non_exhaustive]
4066    pub struct H264ColorFormatHLG {
4067        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4068    }
4069
4070    impl H264ColorFormatHLG {
4071        pub fn new() -> Self {
4072            std::default::Default::default()
4073        }
4074    }
4075
4076    impl wkt::message::Message for H264ColorFormatHLG {
4077        fn typename() -> &'static str {
4078            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H264ColorFormatHLG"
4079        }
4080    }
4081
4082    /// H264 codec settings.
4083    #[derive(Clone, Default, PartialEq)]
4084    #[non_exhaustive]
4085    pub struct H264CodecSettings {
4086        /// The width of the video in pixels. Must be an even integer.
4087        /// When not specified, the width is adjusted to match the specified height
4088        /// and input aspect ratio. If both are omitted, the input width is used.
4089        ///
4090        /// For portrait videos that contain horizontal ASR and rotation metadata,
4091        /// provide the width, in pixels, per the horizontal ASR. The API calculates
4092        /// the height per the horizontal ASR. The API detects any rotation metadata
4093        /// and swaps the requested height and width for the output.
4094        pub width_pixels: i32,
4095
4096        /// The height of the video in pixels. Must be an even integer.
4097        /// When not specified, the height is adjusted to match the specified width
4098        /// and input aspect ratio. If both are omitted, the input height is used.
4099        ///
4100        /// For portrait videos that contain horizontal ASR and rotation metadata,
4101        /// provide the height, in pixels, per the horizontal ASR. The API calculates
4102        /// the width per the horizontal ASR. The API detects any rotation metadata
4103        /// and swaps the requested height and width for the output.
4104        pub height_pixels: i32,
4105
4106        /// Required. The target video frame rate in frames per second (FPS). Must be
4107        /// less than or equal to 120.
4108        pub frame_rate: f64,
4109
4110        /// Optional. Frame rate conversion strategy for desired frame rate. The
4111        /// default is `DOWNSAMPLE`.
4112        pub frame_rate_conversion_strategy: crate::model::video_stream::FrameRateConversionStrategy,
4113
4114        /// Required. The video bitrate in bits per second. The minimum value is
4115        /// 1,000. The maximum value is 800,000,000.
4116        pub bitrate_bps: i32,
4117
4118        /// Pixel format to use. The default is `yuv420p`.
4119        ///
4120        /// Supported pixel formats:
4121        ///
4122        /// - `yuv420p` pixel format
4123        /// - `yuv422p` pixel format
4124        /// - `yuv444p` pixel format
4125        /// - `yuv420p10` 10-bit HDR pixel format
4126        /// - `yuv422p10` 10-bit HDR pixel format
4127        /// - `yuv444p10` 10-bit HDR pixel format
4128        /// - `yuv420p12` 12-bit HDR pixel format
4129        /// - `yuv422p12` 12-bit HDR pixel format
4130        /// - `yuv444p12` 12-bit HDR pixel format
4131        pub pixel_format: std::string::String,
4132
4133        /// Specify the mode. The default is `vbr`.
4134        ///
4135        /// Supported rate control modes:
4136        ///
4137        /// - `vbr` - variable bitrate
4138        /// - `crf` - constant rate factor
4139        pub rate_control_mode: std::string::String,
4140
4141        /// Target CRF level. Must be between 10 and 36, where 10 is the highest
4142        /// quality and 36 is the most efficient compression. The default is 21.
4143        pub crf_level: i32,
4144
4145        /// Specifies whether an open Group of Pictures (GOP) structure should be
4146        /// allowed or not. The default is `false`.
4147        pub allow_open_gop: bool,
4148
4149        /// Use two-pass encoding strategy to achieve better video quality.
4150        /// [H264CodecSettings.rate_control_mode][google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.rate_control_mode]
4151        /// must be `vbr`. The default is `false`.
4152        ///
4153        /// [google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.rate_control_mode]: crate::model::video_stream::H264CodecSettings::rate_control_mode
4154        pub enable_two_pass: bool,
4155
4156        /// Size of the Video Buffering Verifier (VBV) buffer in bits. Must be
4157        /// greater than zero. The default is equal to
4158        /// [H264CodecSettings.bitrate_bps][google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.bitrate_bps].
4159        ///
4160        /// [google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.bitrate_bps]: crate::model::video_stream::H264CodecSettings::bitrate_bps
4161        pub vbv_size_bits: i32,
4162
4163        /// Initial fullness of the Video Buffering Verifier (VBV) buffer in bits.
4164        /// Must be greater than zero. The default is equal to 90% of
4165        /// [H264CodecSettings.vbv_size_bits][google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.vbv_size_bits].
4166        ///
4167        /// [google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.vbv_size_bits]: crate::model::video_stream::H264CodecSettings::vbv_size_bits
4168        pub vbv_fullness_bits: i32,
4169
4170        /// The entropy coder to use. The default is `cabac`.
4171        ///
4172        /// Supported entropy coders:
4173        ///
4174        /// - `cavlc`
4175        /// - `cabac`
4176        pub entropy_coder: std::string::String,
4177
4178        /// Allow B-pyramid for reference frame selection. This may not be supported
4179        /// on all decoders. The default is `false`.
4180        pub b_pyramid: bool,
4181
4182        /// The number of consecutive B-frames. Must be greater than or equal to
4183        /// zero. Must be less than
4184        /// [H264CodecSettings.gop_frame_count][google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.gop_frame_count]
4185        /// if set. The default is 0.
4186        ///
4187        /// [google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.gop_frame_count]: crate::model::video_stream::H264CodecSettings::gop_mode
4188        pub b_frame_count: i32,
4189
4190        /// Specify the intensity of the adaptive quantizer (AQ). Must be between 0
4191        /// and 1, where 0 disables the quantizer and 1 maximizes the quantizer. A
4192        /// higher value equals a lower bitrate but smoother image. The default is 0.
4193        pub aq_strength: f64,
4194
4195        /// Enforces the specified codec profile. The following profiles are
4196        /// supported:
4197        ///
4198        /// * `baseline`
4199        /// * `main`
4200        /// * `high` (default)
4201        ///
4202        /// The available options are
4203        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.264#Tune).
4204        /// Note that certain values for this field may cause the
4205        /// transcoder to override other fields you set in the `H264CodecSettings`
4206        /// message.
4207        pub profile: std::string::String,
4208
4209        /// Enforces the specified codec tune. The available options are
4210        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.264#Tune).
4211        /// Note that certain values for this field may cause the
4212        /// transcoder to override other fields you set in the `H264CodecSettings`
4213        /// message.
4214        pub tune: std::string::String,
4215
4216        /// Enforces the specified codec preset. The default is `veryfast`. The
4217        /// available options are
4218        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.264#Preset).
4219        /// Note that certain values for this field may cause the
4220        /// transcoder to override other fields you set in the `H264CodecSettings`
4221        /// message.
4222        pub preset: std::string::String,
4223
4224        /// GOP mode can be either by frame count or duration.
4225        pub gop_mode:
4226            std::option::Option<crate::model::video_stream::h_264_codec_settings::GopMode>,
4227
4228        /// Color format can be sdr or hlg.
4229        pub color_format:
4230            std::option::Option<crate::model::video_stream::h_264_codec_settings::ColorFormat>,
4231
4232        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4233    }
4234
4235    impl H264CodecSettings {
4236        pub fn new() -> Self {
4237            std::default::Default::default()
4238        }
4239
4240        /// Sets the value of [width_pixels][crate::model::video_stream::H264CodecSettings::width_pixels].
4241        pub fn set_width_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4242            self.width_pixels = v.into();
4243            self
4244        }
4245
4246        /// Sets the value of [height_pixels][crate::model::video_stream::H264CodecSettings::height_pixels].
4247        pub fn set_height_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4248            self.height_pixels = v.into();
4249            self
4250        }
4251
4252        /// Sets the value of [frame_rate][crate::model::video_stream::H264CodecSettings::frame_rate].
4253        pub fn set_frame_rate<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
4254            self.frame_rate = v.into();
4255            self
4256        }
4257
4258        /// Sets the value of [frame_rate_conversion_strategy][crate::model::video_stream::H264CodecSettings::frame_rate_conversion_strategy].
4259        pub fn set_frame_rate_conversion_strategy<
4260            T: std::convert::Into<crate::model::video_stream::FrameRateConversionStrategy>,
4261        >(
4262            mut self,
4263            v: T,
4264        ) -> Self {
4265            self.frame_rate_conversion_strategy = v.into();
4266            self
4267        }
4268
4269        /// Sets the value of [bitrate_bps][crate::model::video_stream::H264CodecSettings::bitrate_bps].
4270        pub fn set_bitrate_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4271            self.bitrate_bps = v.into();
4272            self
4273        }
4274
4275        /// Sets the value of [pixel_format][crate::model::video_stream::H264CodecSettings::pixel_format].
4276        pub fn set_pixel_format<T: std::convert::Into<std::string::String>>(
4277            mut self,
4278            v: T,
4279        ) -> Self {
4280            self.pixel_format = v.into();
4281            self
4282        }
4283
4284        /// Sets the value of [rate_control_mode][crate::model::video_stream::H264CodecSettings::rate_control_mode].
4285        pub fn set_rate_control_mode<T: std::convert::Into<std::string::String>>(
4286            mut self,
4287            v: T,
4288        ) -> Self {
4289            self.rate_control_mode = v.into();
4290            self
4291        }
4292
4293        /// Sets the value of [crf_level][crate::model::video_stream::H264CodecSettings::crf_level].
4294        pub fn set_crf_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4295            self.crf_level = v.into();
4296            self
4297        }
4298
4299        /// Sets the value of [allow_open_gop][crate::model::video_stream::H264CodecSettings::allow_open_gop].
4300        pub fn set_allow_open_gop<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4301            self.allow_open_gop = v.into();
4302            self
4303        }
4304
4305        /// Sets the value of [enable_two_pass][crate::model::video_stream::H264CodecSettings::enable_two_pass].
4306        pub fn set_enable_two_pass<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4307            self.enable_two_pass = v.into();
4308            self
4309        }
4310
4311        /// Sets the value of [vbv_size_bits][crate::model::video_stream::H264CodecSettings::vbv_size_bits].
4312        pub fn set_vbv_size_bits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4313            self.vbv_size_bits = v.into();
4314            self
4315        }
4316
4317        /// Sets the value of [vbv_fullness_bits][crate::model::video_stream::H264CodecSettings::vbv_fullness_bits].
4318        pub fn set_vbv_fullness_bits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4319            self.vbv_fullness_bits = v.into();
4320            self
4321        }
4322
4323        /// Sets the value of [entropy_coder][crate::model::video_stream::H264CodecSettings::entropy_coder].
4324        pub fn set_entropy_coder<T: std::convert::Into<std::string::String>>(
4325            mut self,
4326            v: T,
4327        ) -> Self {
4328            self.entropy_coder = v.into();
4329            self
4330        }
4331
4332        /// Sets the value of [b_pyramid][crate::model::video_stream::H264CodecSettings::b_pyramid].
4333        pub fn set_b_pyramid<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4334            self.b_pyramid = v.into();
4335            self
4336        }
4337
4338        /// Sets the value of [b_frame_count][crate::model::video_stream::H264CodecSettings::b_frame_count].
4339        pub fn set_b_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4340            self.b_frame_count = v.into();
4341            self
4342        }
4343
4344        /// Sets the value of [aq_strength][crate::model::video_stream::H264CodecSettings::aq_strength].
4345        pub fn set_aq_strength<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
4346            self.aq_strength = v.into();
4347            self
4348        }
4349
4350        /// Sets the value of [profile][crate::model::video_stream::H264CodecSettings::profile].
4351        pub fn set_profile<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4352            self.profile = v.into();
4353            self
4354        }
4355
4356        /// Sets the value of [tune][crate::model::video_stream::H264CodecSettings::tune].
4357        pub fn set_tune<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4358            self.tune = v.into();
4359            self
4360        }
4361
4362        /// Sets the value of [preset][crate::model::video_stream::H264CodecSettings::preset].
4363        pub fn set_preset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4364            self.preset = v.into();
4365            self
4366        }
4367
4368        /// Sets the value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode].
4369        ///
4370        /// Note that all the setters affecting `gop_mode` are mutually
4371        /// exclusive.
4372        pub fn set_gop_mode<
4373            T: std::convert::Into<
4374                    std::option::Option<crate::model::video_stream::h_264_codec_settings::GopMode>,
4375                >,
4376        >(
4377            mut self,
4378            v: T,
4379        ) -> Self {
4380            self.gop_mode = v.into();
4381            self
4382        }
4383
4384        /// The value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode]
4385        /// if it holds a `GopFrameCount`, `None` if the field is not set or
4386        /// holds a different branch.
4387        pub fn gop_frame_count(&self) -> std::option::Option<&i32> {
4388            #[allow(unreachable_patterns)]
4389            self.gop_mode.as_ref().and_then(|v| match v {
4390                crate::model::video_stream::h_264_codec_settings::GopMode::GopFrameCount(v) => {
4391                    std::option::Option::Some(v)
4392                }
4393                _ => std::option::Option::None,
4394            })
4395        }
4396
4397        /// Sets the value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode]
4398        /// to hold a `GopFrameCount`.
4399        ///
4400        /// Note that all the setters affecting `gop_mode` are
4401        /// mutually exclusive.
4402        pub fn set_gop_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4403            self.gop_mode = std::option::Option::Some(
4404                crate::model::video_stream::h_264_codec_settings::GopMode::GopFrameCount(v.into()),
4405            );
4406            self
4407        }
4408
4409        /// The value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode]
4410        /// if it holds a `GopDuration`, `None` if the field is not set or
4411        /// holds a different branch.
4412        pub fn gop_duration(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
4413            #[allow(unreachable_patterns)]
4414            self.gop_mode.as_ref().and_then(|v| match v {
4415                crate::model::video_stream::h_264_codec_settings::GopMode::GopDuration(v) => {
4416                    std::option::Option::Some(v)
4417                }
4418                _ => std::option::Option::None,
4419            })
4420        }
4421
4422        /// Sets the value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode]
4423        /// to hold a `GopDuration`.
4424        ///
4425        /// Note that all the setters affecting `gop_mode` are
4426        /// mutually exclusive.
4427        pub fn set_gop_duration<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
4428            mut self,
4429            v: T,
4430        ) -> Self {
4431            self.gop_mode = std::option::Option::Some(
4432                crate::model::video_stream::h_264_codec_settings::GopMode::GopDuration(v.into()),
4433            );
4434            self
4435        }
4436
4437        /// Sets the value of [color_format][crate::model::video_stream::H264CodecSettings::color_format].
4438        ///
4439        /// Note that all the setters affecting `color_format` are mutually
4440        /// exclusive.
4441        pub fn set_color_format<
4442            T: std::convert::Into<
4443                    std::option::Option<
4444                        crate::model::video_stream::h_264_codec_settings::ColorFormat,
4445                    >,
4446                >,
4447        >(
4448            mut self,
4449            v: T,
4450        ) -> Self {
4451            self.color_format = v.into();
4452            self
4453        }
4454
4455        /// The value of [color_format][crate::model::video_stream::H264CodecSettings::color_format]
4456        /// if it holds a `Sdr`, `None` if the field is not set or
4457        /// holds a different branch.
4458        pub fn sdr(
4459            &self,
4460        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H264ColorFormatSDR>>
4461        {
4462            #[allow(unreachable_patterns)]
4463            self.color_format.as_ref().and_then(|v| match v {
4464                crate::model::video_stream::h_264_codec_settings::ColorFormat::Sdr(v) => {
4465                    std::option::Option::Some(v)
4466                }
4467                _ => std::option::Option::None,
4468            })
4469        }
4470
4471        /// Sets the value of [color_format][crate::model::video_stream::H264CodecSettings::color_format]
4472        /// to hold a `Sdr`.
4473        ///
4474        /// Note that all the setters affecting `color_format` are
4475        /// mutually exclusive.
4476        pub fn set_sdr<
4477            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H264ColorFormatSDR>>,
4478        >(
4479            mut self,
4480            v: T,
4481        ) -> Self {
4482            self.color_format = std::option::Option::Some(
4483                crate::model::video_stream::h_264_codec_settings::ColorFormat::Sdr(v.into()),
4484            );
4485            self
4486        }
4487
4488        /// The value of [color_format][crate::model::video_stream::H264CodecSettings::color_format]
4489        /// if it holds a `Hlg`, `None` if the field is not set or
4490        /// holds a different branch.
4491        pub fn hlg(
4492            &self,
4493        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H264ColorFormatHLG>>
4494        {
4495            #[allow(unreachable_patterns)]
4496            self.color_format.as_ref().and_then(|v| match v {
4497                crate::model::video_stream::h_264_codec_settings::ColorFormat::Hlg(v) => {
4498                    std::option::Option::Some(v)
4499                }
4500                _ => std::option::Option::None,
4501            })
4502        }
4503
4504        /// Sets the value of [color_format][crate::model::video_stream::H264CodecSettings::color_format]
4505        /// to hold a `Hlg`.
4506        ///
4507        /// Note that all the setters affecting `color_format` are
4508        /// mutually exclusive.
4509        pub fn set_hlg<
4510            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H264ColorFormatHLG>>,
4511        >(
4512            mut self,
4513            v: T,
4514        ) -> Self {
4515            self.color_format = std::option::Option::Some(
4516                crate::model::video_stream::h_264_codec_settings::ColorFormat::Hlg(v.into()),
4517            );
4518            self
4519        }
4520    }
4521
4522    impl wkt::message::Message for H264CodecSettings {
4523        fn typename() -> &'static str {
4524            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings"
4525        }
4526    }
4527
4528    /// Defines additional types related to [H264CodecSettings].
4529    pub mod h_264_codec_settings {
4530        #[allow(unused_imports)]
4531        use super::*;
4532
4533        /// GOP mode can be either by frame count or duration.
4534        #[derive(Clone, Debug, PartialEq)]
4535        #[non_exhaustive]
4536        pub enum GopMode {
4537            /// Select the GOP size based on the specified frame count. Must be greater
4538            /// than zero.
4539            GopFrameCount(i32),
4540            /// Select the GOP size based on the specified duration. The default is
4541            /// `3s`. Note that `gopDuration` must be less than or equal to
4542            /// [`segmentDuration`](#SegmentSettings), and
4543            /// [`segmentDuration`](#SegmentSettings) must be divisible by
4544            /// `gopDuration`.
4545            GopDuration(std::boxed::Box<wkt::Duration>),
4546        }
4547
4548        /// Color format can be sdr or hlg.
4549        #[derive(Clone, Debug, PartialEq)]
4550        #[non_exhaustive]
4551        pub enum ColorFormat {
4552            /// Optional. SDR color format setting for H264.
4553            Sdr(std::boxed::Box<crate::model::video_stream::H264ColorFormatSDR>),
4554            /// Optional. HLG color format setting for H264.
4555            Hlg(std::boxed::Box<crate::model::video_stream::H264ColorFormatHLG>),
4556        }
4557    }
4558
4559    /// Convert the input video to a Standard Dynamic Range (SDR) video.
4560    #[derive(Clone, Default, PartialEq)]
4561    #[non_exhaustive]
4562    pub struct H265ColorFormatSDR {
4563        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4564    }
4565
4566    impl H265ColorFormatSDR {
4567        pub fn new() -> Self {
4568            std::default::Default::default()
4569        }
4570    }
4571
4572    impl wkt::message::Message for H265ColorFormatSDR {
4573        fn typename() -> &'static str {
4574            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H265ColorFormatSDR"
4575        }
4576    }
4577
4578    /// Convert the input video to a Hybrid Log Gamma (HLG) video.
4579    #[derive(Clone, Default, PartialEq)]
4580    #[non_exhaustive]
4581    pub struct H265ColorFormatHLG {
4582        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4583    }
4584
4585    impl H265ColorFormatHLG {
4586        pub fn new() -> Self {
4587            std::default::Default::default()
4588        }
4589    }
4590
4591    impl wkt::message::Message for H265ColorFormatHLG {
4592        fn typename() -> &'static str {
4593            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H265ColorFormatHLG"
4594        }
4595    }
4596
4597    /// Convert the input video to a High Dynamic Range 10 (HDR10) video.
4598    #[derive(Clone, Default, PartialEq)]
4599    #[non_exhaustive]
4600    pub struct H265ColorFormatHDR10 {
4601        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4602    }
4603
4604    impl H265ColorFormatHDR10 {
4605        pub fn new() -> Self {
4606            std::default::Default::default()
4607        }
4608    }
4609
4610    impl wkt::message::Message for H265ColorFormatHDR10 {
4611        fn typename() -> &'static str {
4612            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H265ColorFormatHDR10"
4613        }
4614    }
4615
4616    /// H265 codec settings.
4617    #[derive(Clone, Default, PartialEq)]
4618    #[non_exhaustive]
4619    pub struct H265CodecSettings {
4620        /// The width of the video in pixels. Must be an even integer.
4621        /// When not specified, the width is adjusted to match the specified height
4622        /// and input aspect ratio. If both are omitted, the input width is used.
4623        ///
4624        /// For portrait videos that contain horizontal ASR and rotation metadata,
4625        /// provide the width, in pixels, per the horizontal ASR. The API calculates
4626        /// the height per the horizontal ASR. The API detects any rotation metadata
4627        /// and swaps the requested height and width for the output.
4628        pub width_pixels: i32,
4629
4630        /// The height of the video in pixels. Must be an even integer.
4631        /// When not specified, the height is adjusted to match the specified width
4632        /// and input aspect ratio. If both are omitted, the input height is used.
4633        ///
4634        /// For portrait videos that contain horizontal ASR and rotation metadata,
4635        /// provide the height, in pixels, per the horizontal ASR. The API calculates
4636        /// the width per the horizontal ASR. The API detects any rotation metadata
4637        /// and swaps the requested height and width for the output.
4638        pub height_pixels: i32,
4639
4640        /// Required. The target video frame rate in frames per second (FPS). Must be
4641        /// less than or equal to 120.
4642        pub frame_rate: f64,
4643
4644        /// Optional. Frame rate conversion strategy for desired frame rate. The
4645        /// default is `DOWNSAMPLE`.
4646        pub frame_rate_conversion_strategy: crate::model::video_stream::FrameRateConversionStrategy,
4647
4648        /// Required. The video bitrate in bits per second. The minimum value is
4649        /// 1,000. The maximum value is 800,000,000.
4650        pub bitrate_bps: i32,
4651
4652        /// Pixel format to use. The default is `yuv420p`.
4653        ///
4654        /// Supported pixel formats:
4655        ///
4656        /// - `yuv420p` pixel format
4657        /// - `yuv422p` pixel format
4658        /// - `yuv444p` pixel format
4659        /// - `yuv420p10` 10-bit HDR pixel format
4660        /// - `yuv422p10` 10-bit HDR pixel format
4661        /// - `yuv444p10` 10-bit HDR pixel format
4662        /// - `yuv420p12` 12-bit HDR pixel format
4663        /// - `yuv422p12` 12-bit HDR pixel format
4664        /// - `yuv444p12` 12-bit HDR pixel format
4665        pub pixel_format: std::string::String,
4666
4667        /// Specify the mode. The default is `vbr`.
4668        ///
4669        /// Supported rate control modes:
4670        ///
4671        /// - `vbr` - variable bitrate
4672        /// - `crf` - constant rate factor
4673        pub rate_control_mode: std::string::String,
4674
4675        /// Target CRF level. Must be between 10 and 36, where 10 is the highest
4676        /// quality and 36 is the most efficient compression. The default is 21.
4677        pub crf_level: i32,
4678
4679        /// Specifies whether an open Group of Pictures (GOP) structure should be
4680        /// allowed or not. The default is `false`.
4681        pub allow_open_gop: bool,
4682
4683        /// Use two-pass encoding strategy to achieve better video quality.
4684        /// [H265CodecSettings.rate_control_mode][google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.rate_control_mode]
4685        /// must be `vbr`. The default is `false`.
4686        ///
4687        /// [google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.rate_control_mode]: crate::model::video_stream::H265CodecSettings::rate_control_mode
4688        pub enable_two_pass: bool,
4689
4690        /// Size of the Video Buffering Verifier (VBV) buffer in bits. Must be
4691        /// greater than zero. The default is equal to `VideoStream.bitrate_bps`.
4692        pub vbv_size_bits: i32,
4693
4694        /// Initial fullness of the Video Buffering Verifier (VBV) buffer in bits.
4695        /// Must be greater than zero. The default is equal to 90% of
4696        /// [H265CodecSettings.vbv_size_bits][google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.vbv_size_bits].
4697        ///
4698        /// [google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.vbv_size_bits]: crate::model::video_stream::H265CodecSettings::vbv_size_bits
4699        pub vbv_fullness_bits: i32,
4700
4701        /// Allow B-pyramid for reference frame selection. This may not be supported
4702        /// on all decoders. The default is `false`.
4703        pub b_pyramid: bool,
4704
4705        /// The number of consecutive B-frames. Must be greater than or equal to
4706        /// zero. Must be less than
4707        /// [H265CodecSettings.gop_frame_count][google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.gop_frame_count]
4708        /// if set. The default is 0.
4709        ///
4710        /// [google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.gop_frame_count]: crate::model::video_stream::H265CodecSettings::gop_mode
4711        pub b_frame_count: i32,
4712
4713        /// Specify the intensity of the adaptive quantizer (AQ). Must be between 0
4714        /// and 1, where 0 disables the quantizer and 1 maximizes the quantizer. A
4715        /// higher value equals a lower bitrate but smoother image. The default is 0.
4716        pub aq_strength: f64,
4717
4718        /// Enforces the specified codec profile. The following profiles are
4719        /// supported:
4720        ///
4721        /// * 8-bit profiles
4722        ///   * `main` (default)
4723        ///   * `main-intra`
4724        ///   * `mainstillpicture`
4725        /// * 10-bit profiles
4726        ///   * `main10` (default)
4727        ///   * `main10-intra`
4728        ///   * `main422-10`
4729        ///   * `main422-10-intra`
4730        ///   * `main444-10`
4731        ///   * `main444-10-intra`
4732        /// * 12-bit profiles
4733        ///   * `main12` (default)
4734        ///   * `main12-intra`
4735        ///   * `main422-12`
4736        ///   * `main422-12-intra`
4737        ///   * `main444-12`
4738        ///   * `main444-12-intra`
4739        ///
4740        /// The available options are
4741        /// [FFmpeg-compatible](https://x265.readthedocs.io/).
4742        /// Note that certain values for this field may cause the
4743        /// transcoder to override other fields you set in the `H265CodecSettings`
4744        /// message.
4745        pub profile: std::string::String,
4746
4747        /// Enforces the specified codec tune. The available options are
4748        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.265).
4749        /// Note that certain values for this field may cause the
4750        /// transcoder to override other fields you set in the `H265CodecSettings`
4751        /// message.
4752        pub tune: std::string::String,
4753
4754        /// Enforces the specified codec preset. The default is `veryfast`. The
4755        /// available options are
4756        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.265).
4757        /// Note that certain values for this field may cause the
4758        /// transcoder to override other fields you set in the `H265CodecSettings`
4759        /// message.
4760        pub preset: std::string::String,
4761
4762        /// GOP mode can be either by frame count or duration.
4763        pub gop_mode:
4764            std::option::Option<crate::model::video_stream::h_265_codec_settings::GopMode>,
4765
4766        /// Color format can be sdr, hlg, hdr10.
4767        pub color_format:
4768            std::option::Option<crate::model::video_stream::h_265_codec_settings::ColorFormat>,
4769
4770        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4771    }
4772
4773    impl H265CodecSettings {
4774        pub fn new() -> Self {
4775            std::default::Default::default()
4776        }
4777
4778        /// Sets the value of [width_pixels][crate::model::video_stream::H265CodecSettings::width_pixels].
4779        pub fn set_width_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4780            self.width_pixels = v.into();
4781            self
4782        }
4783
4784        /// Sets the value of [height_pixels][crate::model::video_stream::H265CodecSettings::height_pixels].
4785        pub fn set_height_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4786            self.height_pixels = v.into();
4787            self
4788        }
4789
4790        /// Sets the value of [frame_rate][crate::model::video_stream::H265CodecSettings::frame_rate].
4791        pub fn set_frame_rate<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
4792            self.frame_rate = v.into();
4793            self
4794        }
4795
4796        /// Sets the value of [frame_rate_conversion_strategy][crate::model::video_stream::H265CodecSettings::frame_rate_conversion_strategy].
4797        pub fn set_frame_rate_conversion_strategy<
4798            T: std::convert::Into<crate::model::video_stream::FrameRateConversionStrategy>,
4799        >(
4800            mut self,
4801            v: T,
4802        ) -> Self {
4803            self.frame_rate_conversion_strategy = v.into();
4804            self
4805        }
4806
4807        /// Sets the value of [bitrate_bps][crate::model::video_stream::H265CodecSettings::bitrate_bps].
4808        pub fn set_bitrate_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4809            self.bitrate_bps = v.into();
4810            self
4811        }
4812
4813        /// Sets the value of [pixel_format][crate::model::video_stream::H265CodecSettings::pixel_format].
4814        pub fn set_pixel_format<T: std::convert::Into<std::string::String>>(
4815            mut self,
4816            v: T,
4817        ) -> Self {
4818            self.pixel_format = v.into();
4819            self
4820        }
4821
4822        /// Sets the value of [rate_control_mode][crate::model::video_stream::H265CodecSettings::rate_control_mode].
4823        pub fn set_rate_control_mode<T: std::convert::Into<std::string::String>>(
4824            mut self,
4825            v: T,
4826        ) -> Self {
4827            self.rate_control_mode = v.into();
4828            self
4829        }
4830
4831        /// Sets the value of [crf_level][crate::model::video_stream::H265CodecSettings::crf_level].
4832        pub fn set_crf_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4833            self.crf_level = v.into();
4834            self
4835        }
4836
4837        /// Sets the value of [allow_open_gop][crate::model::video_stream::H265CodecSettings::allow_open_gop].
4838        pub fn set_allow_open_gop<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4839            self.allow_open_gop = v.into();
4840            self
4841        }
4842
4843        /// Sets the value of [enable_two_pass][crate::model::video_stream::H265CodecSettings::enable_two_pass].
4844        pub fn set_enable_two_pass<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4845            self.enable_two_pass = v.into();
4846            self
4847        }
4848
4849        /// Sets the value of [vbv_size_bits][crate::model::video_stream::H265CodecSettings::vbv_size_bits].
4850        pub fn set_vbv_size_bits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4851            self.vbv_size_bits = v.into();
4852            self
4853        }
4854
4855        /// Sets the value of [vbv_fullness_bits][crate::model::video_stream::H265CodecSettings::vbv_fullness_bits].
4856        pub fn set_vbv_fullness_bits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4857            self.vbv_fullness_bits = v.into();
4858            self
4859        }
4860
4861        /// Sets the value of [b_pyramid][crate::model::video_stream::H265CodecSettings::b_pyramid].
4862        pub fn set_b_pyramid<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4863            self.b_pyramid = v.into();
4864            self
4865        }
4866
4867        /// Sets the value of [b_frame_count][crate::model::video_stream::H265CodecSettings::b_frame_count].
4868        pub fn set_b_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4869            self.b_frame_count = v.into();
4870            self
4871        }
4872
4873        /// Sets the value of [aq_strength][crate::model::video_stream::H265CodecSettings::aq_strength].
4874        pub fn set_aq_strength<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
4875            self.aq_strength = v.into();
4876            self
4877        }
4878
4879        /// Sets the value of [profile][crate::model::video_stream::H265CodecSettings::profile].
4880        pub fn set_profile<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4881            self.profile = v.into();
4882            self
4883        }
4884
4885        /// Sets the value of [tune][crate::model::video_stream::H265CodecSettings::tune].
4886        pub fn set_tune<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4887            self.tune = v.into();
4888            self
4889        }
4890
4891        /// Sets the value of [preset][crate::model::video_stream::H265CodecSettings::preset].
4892        pub fn set_preset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4893            self.preset = v.into();
4894            self
4895        }
4896
4897        /// Sets the value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode].
4898        ///
4899        /// Note that all the setters affecting `gop_mode` are mutually
4900        /// exclusive.
4901        pub fn set_gop_mode<
4902            T: std::convert::Into<
4903                    std::option::Option<crate::model::video_stream::h_265_codec_settings::GopMode>,
4904                >,
4905        >(
4906            mut self,
4907            v: T,
4908        ) -> Self {
4909            self.gop_mode = v.into();
4910            self
4911        }
4912
4913        /// The value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode]
4914        /// if it holds a `GopFrameCount`, `None` if the field is not set or
4915        /// holds a different branch.
4916        pub fn gop_frame_count(&self) -> std::option::Option<&i32> {
4917            #[allow(unreachable_patterns)]
4918            self.gop_mode.as_ref().and_then(|v| match v {
4919                crate::model::video_stream::h_265_codec_settings::GopMode::GopFrameCount(v) => {
4920                    std::option::Option::Some(v)
4921                }
4922                _ => std::option::Option::None,
4923            })
4924        }
4925
4926        /// Sets the value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode]
4927        /// to hold a `GopFrameCount`.
4928        ///
4929        /// Note that all the setters affecting `gop_mode` are
4930        /// mutually exclusive.
4931        pub fn set_gop_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4932            self.gop_mode = std::option::Option::Some(
4933                crate::model::video_stream::h_265_codec_settings::GopMode::GopFrameCount(v.into()),
4934            );
4935            self
4936        }
4937
4938        /// The value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode]
4939        /// if it holds a `GopDuration`, `None` if the field is not set or
4940        /// holds a different branch.
4941        pub fn gop_duration(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
4942            #[allow(unreachable_patterns)]
4943            self.gop_mode.as_ref().and_then(|v| match v {
4944                crate::model::video_stream::h_265_codec_settings::GopMode::GopDuration(v) => {
4945                    std::option::Option::Some(v)
4946                }
4947                _ => std::option::Option::None,
4948            })
4949        }
4950
4951        /// Sets the value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode]
4952        /// to hold a `GopDuration`.
4953        ///
4954        /// Note that all the setters affecting `gop_mode` are
4955        /// mutually exclusive.
4956        pub fn set_gop_duration<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
4957            mut self,
4958            v: T,
4959        ) -> Self {
4960            self.gop_mode = std::option::Option::Some(
4961                crate::model::video_stream::h_265_codec_settings::GopMode::GopDuration(v.into()),
4962            );
4963            self
4964        }
4965
4966        /// Sets the value of [color_format][crate::model::video_stream::H265CodecSettings::color_format].
4967        ///
4968        /// Note that all the setters affecting `color_format` are mutually
4969        /// exclusive.
4970        pub fn set_color_format<
4971            T: std::convert::Into<
4972                    std::option::Option<
4973                        crate::model::video_stream::h_265_codec_settings::ColorFormat,
4974                    >,
4975                >,
4976        >(
4977            mut self,
4978            v: T,
4979        ) -> Self {
4980            self.color_format = v.into();
4981            self
4982        }
4983
4984        /// The value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
4985        /// if it holds a `Sdr`, `None` if the field is not set or
4986        /// holds a different branch.
4987        pub fn sdr(
4988            &self,
4989        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H265ColorFormatSDR>>
4990        {
4991            #[allow(unreachable_patterns)]
4992            self.color_format.as_ref().and_then(|v| match v {
4993                crate::model::video_stream::h_265_codec_settings::ColorFormat::Sdr(v) => {
4994                    std::option::Option::Some(v)
4995                }
4996                _ => std::option::Option::None,
4997            })
4998        }
4999
5000        /// Sets the value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
5001        /// to hold a `Sdr`.
5002        ///
5003        /// Note that all the setters affecting `color_format` are
5004        /// mutually exclusive.
5005        pub fn set_sdr<
5006            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H265ColorFormatSDR>>,
5007        >(
5008            mut self,
5009            v: T,
5010        ) -> Self {
5011            self.color_format = std::option::Option::Some(
5012                crate::model::video_stream::h_265_codec_settings::ColorFormat::Sdr(v.into()),
5013            );
5014            self
5015        }
5016
5017        /// The value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
5018        /// if it holds a `Hlg`, `None` if the field is not set or
5019        /// holds a different branch.
5020        pub fn hlg(
5021            &self,
5022        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H265ColorFormatHLG>>
5023        {
5024            #[allow(unreachable_patterns)]
5025            self.color_format.as_ref().and_then(|v| match v {
5026                crate::model::video_stream::h_265_codec_settings::ColorFormat::Hlg(v) => {
5027                    std::option::Option::Some(v)
5028                }
5029                _ => std::option::Option::None,
5030            })
5031        }
5032
5033        /// Sets the value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
5034        /// to hold a `Hlg`.
5035        ///
5036        /// Note that all the setters affecting `color_format` are
5037        /// mutually exclusive.
5038        pub fn set_hlg<
5039            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H265ColorFormatHLG>>,
5040        >(
5041            mut self,
5042            v: T,
5043        ) -> Self {
5044            self.color_format = std::option::Option::Some(
5045                crate::model::video_stream::h_265_codec_settings::ColorFormat::Hlg(v.into()),
5046            );
5047            self
5048        }
5049
5050        /// The value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
5051        /// if it holds a `Hdr10`, `None` if the field is not set or
5052        /// holds a different branch.
5053        pub fn hdr10(
5054            &self,
5055        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H265ColorFormatHDR10>>
5056        {
5057            #[allow(unreachable_patterns)]
5058            self.color_format.as_ref().and_then(|v| match v {
5059                crate::model::video_stream::h_265_codec_settings::ColorFormat::Hdr10(v) => {
5060                    std::option::Option::Some(v)
5061                }
5062                _ => std::option::Option::None,
5063            })
5064        }
5065
5066        /// Sets the value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
5067        /// to hold a `Hdr10`.
5068        ///
5069        /// Note that all the setters affecting `color_format` are
5070        /// mutually exclusive.
5071        pub fn set_hdr10<
5072            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H265ColorFormatHDR10>>,
5073        >(
5074            mut self,
5075            v: T,
5076        ) -> Self {
5077            self.color_format = std::option::Option::Some(
5078                crate::model::video_stream::h_265_codec_settings::ColorFormat::Hdr10(v.into()),
5079            );
5080            self
5081        }
5082    }
5083
5084    impl wkt::message::Message for H265CodecSettings {
5085        fn typename() -> &'static str {
5086            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings"
5087        }
5088    }
5089
5090    /// Defines additional types related to [H265CodecSettings].
5091    pub mod h_265_codec_settings {
5092        #[allow(unused_imports)]
5093        use super::*;
5094
5095        /// GOP mode can be either by frame count or duration.
5096        #[derive(Clone, Debug, PartialEq)]
5097        #[non_exhaustive]
5098        pub enum GopMode {
5099            /// Select the GOP size based on the specified frame count. Must be greater
5100            /// than zero.
5101            GopFrameCount(i32),
5102            /// Select the GOP size based on the specified duration. The default is
5103            /// `3s`. Note that `gopDuration` must be less than or equal to
5104            /// [`segmentDuration`](#SegmentSettings), and
5105            /// [`segmentDuration`](#SegmentSettings) must be divisible by
5106            /// `gopDuration`.
5107            GopDuration(std::boxed::Box<wkt::Duration>),
5108        }
5109
5110        /// Color format can be sdr, hlg, hdr10.
5111        #[derive(Clone, Debug, PartialEq)]
5112        #[non_exhaustive]
5113        pub enum ColorFormat {
5114            /// Optional. SDR color format setting for H265.
5115            Sdr(std::boxed::Box<crate::model::video_stream::H265ColorFormatSDR>),
5116            /// Optional. HLG color format setting for H265.
5117            Hlg(std::boxed::Box<crate::model::video_stream::H265ColorFormatHLG>),
5118            /// Optional. HDR10 color format setting for H265.
5119            Hdr10(std::boxed::Box<crate::model::video_stream::H265ColorFormatHDR10>),
5120        }
5121    }
5122
5123    /// Convert the input video to a Standard Dynamic Range (SDR) video.
5124    #[derive(Clone, Default, PartialEq)]
5125    #[non_exhaustive]
5126    pub struct Vp9ColorFormatSDR {
5127        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5128    }
5129
5130    impl Vp9ColorFormatSDR {
5131        pub fn new() -> Self {
5132            std::default::Default::default()
5133        }
5134    }
5135
5136    impl wkt::message::Message for Vp9ColorFormatSDR {
5137        fn typename() -> &'static str {
5138            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.Vp9ColorFormatSDR"
5139        }
5140    }
5141
5142    /// Convert the input video to a Hybrid Log Gamma (HLG) video.
5143    #[derive(Clone, Default, PartialEq)]
5144    #[non_exhaustive]
5145    pub struct Vp9ColorFormatHLG {
5146        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5147    }
5148
5149    impl Vp9ColorFormatHLG {
5150        pub fn new() -> Self {
5151            std::default::Default::default()
5152        }
5153    }
5154
5155    impl wkt::message::Message for Vp9ColorFormatHLG {
5156        fn typename() -> &'static str {
5157            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.Vp9ColorFormatHLG"
5158        }
5159    }
5160
5161    /// VP9 codec settings.
5162    #[derive(Clone, Default, PartialEq)]
5163    #[non_exhaustive]
5164    pub struct Vp9CodecSettings {
5165        /// The width of the video in pixels. Must be an even integer.
5166        /// When not specified, the width is adjusted to match the specified height
5167        /// and input aspect ratio. If both are omitted, the input width is used.
5168        ///
5169        /// For portrait videos that contain horizontal ASR and rotation metadata,
5170        /// provide the width, in pixels, per the horizontal ASR. The API calculates
5171        /// the height per the horizontal ASR. The API detects any rotation metadata
5172        /// and swaps the requested height and width for the output.
5173        pub width_pixels: i32,
5174
5175        /// The height of the video in pixels. Must be an even integer.
5176        /// When not specified, the height is adjusted to match the specified width
5177        /// and input aspect ratio. If both are omitted, the input height is used.
5178        ///
5179        /// For portrait videos that contain horizontal ASR and rotation metadata,
5180        /// provide the height, in pixels, per the horizontal ASR. The API calculates
5181        /// the width per the horizontal ASR. The API detects any rotation metadata
5182        /// and swaps the requested height and width for the output.
5183        pub height_pixels: i32,
5184
5185        /// Required. The target video frame rate in frames per second (FPS). Must be
5186        /// less than or equal to 120.
5187        pub frame_rate: f64,
5188
5189        /// Optional. Frame rate conversion strategy for desired frame rate. The
5190        /// default is `DOWNSAMPLE`.
5191        pub frame_rate_conversion_strategy: crate::model::video_stream::FrameRateConversionStrategy,
5192
5193        /// Required. The video bitrate in bits per second. The minimum value is
5194        /// 1,000. The maximum value is 480,000,000.
5195        pub bitrate_bps: i32,
5196
5197        /// Pixel format to use. The default is `yuv420p`.
5198        ///
5199        /// Supported pixel formats:
5200        ///
5201        /// - `yuv420p` pixel format
5202        /// - `yuv422p` pixel format
5203        /// - `yuv444p` pixel format
5204        /// - `yuv420p10` 10-bit HDR pixel format
5205        /// - `yuv422p10` 10-bit HDR pixel format
5206        /// - `yuv444p10` 10-bit HDR pixel format
5207        /// - `yuv420p12` 12-bit HDR pixel format
5208        /// - `yuv422p12` 12-bit HDR pixel format
5209        /// - `yuv444p12` 12-bit HDR pixel format
5210        pub pixel_format: std::string::String,
5211
5212        /// Specify the mode. The default is `vbr`.
5213        ///
5214        /// Supported rate control modes:
5215        ///
5216        /// - `vbr` - variable bitrate
5217        pub rate_control_mode: std::string::String,
5218
5219        /// Target CRF level. Must be between 10 and 36, where 10 is the highest
5220        /// quality and 36 is the most efficient compression. The default is 21.
5221        ///
5222        /// **Note:** This field is not supported.
5223        pub crf_level: i32,
5224
5225        /// Enforces the specified codec profile. The following profiles are
5226        /// supported:
5227        ///
5228        /// * `profile0` (default)
5229        /// * `profile1`
5230        /// * `profile2`
5231        /// * `profile3`
5232        ///
5233        /// The available options are
5234        /// [WebM-compatible](https://www.webmproject.org/vp9/profiles/).
5235        /// Note that certain values for this field may cause the
5236        /// transcoder to override other fields you set in the `Vp9CodecSettings`
5237        /// message.
5238        pub profile: std::string::String,
5239
5240        /// GOP mode can be either by frame count or duration.
5241        pub gop_mode: std::option::Option<crate::model::video_stream::vp_9_codec_settings::GopMode>,
5242
5243        /// Color format can be sdr or hlg.
5244        pub color_format:
5245            std::option::Option<crate::model::video_stream::vp_9_codec_settings::ColorFormat>,
5246
5247        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5248    }
5249
5250    impl Vp9CodecSettings {
5251        pub fn new() -> Self {
5252            std::default::Default::default()
5253        }
5254
5255        /// Sets the value of [width_pixels][crate::model::video_stream::Vp9CodecSettings::width_pixels].
5256        pub fn set_width_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5257            self.width_pixels = v.into();
5258            self
5259        }
5260
5261        /// Sets the value of [height_pixels][crate::model::video_stream::Vp9CodecSettings::height_pixels].
5262        pub fn set_height_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5263            self.height_pixels = v.into();
5264            self
5265        }
5266
5267        /// Sets the value of [frame_rate][crate::model::video_stream::Vp9CodecSettings::frame_rate].
5268        pub fn set_frame_rate<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
5269            self.frame_rate = v.into();
5270            self
5271        }
5272
5273        /// Sets the value of [frame_rate_conversion_strategy][crate::model::video_stream::Vp9CodecSettings::frame_rate_conversion_strategy].
5274        pub fn set_frame_rate_conversion_strategy<
5275            T: std::convert::Into<crate::model::video_stream::FrameRateConversionStrategy>,
5276        >(
5277            mut self,
5278            v: T,
5279        ) -> Self {
5280            self.frame_rate_conversion_strategy = v.into();
5281            self
5282        }
5283
5284        /// Sets the value of [bitrate_bps][crate::model::video_stream::Vp9CodecSettings::bitrate_bps].
5285        pub fn set_bitrate_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5286            self.bitrate_bps = v.into();
5287            self
5288        }
5289
5290        /// Sets the value of [pixel_format][crate::model::video_stream::Vp9CodecSettings::pixel_format].
5291        pub fn set_pixel_format<T: std::convert::Into<std::string::String>>(
5292            mut self,
5293            v: T,
5294        ) -> Self {
5295            self.pixel_format = v.into();
5296            self
5297        }
5298
5299        /// Sets the value of [rate_control_mode][crate::model::video_stream::Vp9CodecSettings::rate_control_mode].
5300        pub fn set_rate_control_mode<T: std::convert::Into<std::string::String>>(
5301            mut self,
5302            v: T,
5303        ) -> Self {
5304            self.rate_control_mode = v.into();
5305            self
5306        }
5307
5308        /// Sets the value of [crf_level][crate::model::video_stream::Vp9CodecSettings::crf_level].
5309        pub fn set_crf_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5310            self.crf_level = v.into();
5311            self
5312        }
5313
5314        /// Sets the value of [profile][crate::model::video_stream::Vp9CodecSettings::profile].
5315        pub fn set_profile<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5316            self.profile = v.into();
5317            self
5318        }
5319
5320        /// Sets the value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode].
5321        ///
5322        /// Note that all the setters affecting `gop_mode` are mutually
5323        /// exclusive.
5324        pub fn set_gop_mode<
5325            T: std::convert::Into<
5326                    std::option::Option<crate::model::video_stream::vp_9_codec_settings::GopMode>,
5327                >,
5328        >(
5329            mut self,
5330            v: T,
5331        ) -> Self {
5332            self.gop_mode = v.into();
5333            self
5334        }
5335
5336        /// The value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode]
5337        /// if it holds a `GopFrameCount`, `None` if the field is not set or
5338        /// holds a different branch.
5339        pub fn gop_frame_count(&self) -> std::option::Option<&i32> {
5340            #[allow(unreachable_patterns)]
5341            self.gop_mode.as_ref().and_then(|v| match v {
5342                crate::model::video_stream::vp_9_codec_settings::GopMode::GopFrameCount(v) => {
5343                    std::option::Option::Some(v)
5344                }
5345                _ => std::option::Option::None,
5346            })
5347        }
5348
5349        /// Sets the value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode]
5350        /// to hold a `GopFrameCount`.
5351        ///
5352        /// Note that all the setters affecting `gop_mode` are
5353        /// mutually exclusive.
5354        pub fn set_gop_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5355            self.gop_mode = std::option::Option::Some(
5356                crate::model::video_stream::vp_9_codec_settings::GopMode::GopFrameCount(v.into()),
5357            );
5358            self
5359        }
5360
5361        /// The value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode]
5362        /// if it holds a `GopDuration`, `None` if the field is not set or
5363        /// holds a different branch.
5364        pub fn gop_duration(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
5365            #[allow(unreachable_patterns)]
5366            self.gop_mode.as_ref().and_then(|v| match v {
5367                crate::model::video_stream::vp_9_codec_settings::GopMode::GopDuration(v) => {
5368                    std::option::Option::Some(v)
5369                }
5370                _ => std::option::Option::None,
5371            })
5372        }
5373
5374        /// Sets the value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode]
5375        /// to hold a `GopDuration`.
5376        ///
5377        /// Note that all the setters affecting `gop_mode` are
5378        /// mutually exclusive.
5379        pub fn set_gop_duration<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
5380            mut self,
5381            v: T,
5382        ) -> Self {
5383            self.gop_mode = std::option::Option::Some(
5384                crate::model::video_stream::vp_9_codec_settings::GopMode::GopDuration(v.into()),
5385            );
5386            self
5387        }
5388
5389        /// Sets the value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format].
5390        ///
5391        /// Note that all the setters affecting `color_format` are mutually
5392        /// exclusive.
5393        pub fn set_color_format<
5394            T: std::convert::Into<
5395                    std::option::Option<
5396                        crate::model::video_stream::vp_9_codec_settings::ColorFormat,
5397                    >,
5398                >,
5399        >(
5400            mut self,
5401            v: T,
5402        ) -> Self {
5403            self.color_format = v.into();
5404            self
5405        }
5406
5407        /// The value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format]
5408        /// if it holds a `Sdr`, `None` if the field is not set or
5409        /// holds a different branch.
5410        pub fn sdr(
5411            &self,
5412        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::Vp9ColorFormatSDR>>
5413        {
5414            #[allow(unreachable_patterns)]
5415            self.color_format.as_ref().and_then(|v| match v {
5416                crate::model::video_stream::vp_9_codec_settings::ColorFormat::Sdr(v) => {
5417                    std::option::Option::Some(v)
5418                }
5419                _ => std::option::Option::None,
5420            })
5421        }
5422
5423        /// Sets the value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format]
5424        /// to hold a `Sdr`.
5425        ///
5426        /// Note that all the setters affecting `color_format` are
5427        /// mutually exclusive.
5428        pub fn set_sdr<
5429            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::Vp9ColorFormatSDR>>,
5430        >(
5431            mut self,
5432            v: T,
5433        ) -> Self {
5434            self.color_format = std::option::Option::Some(
5435                crate::model::video_stream::vp_9_codec_settings::ColorFormat::Sdr(v.into()),
5436            );
5437            self
5438        }
5439
5440        /// The value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format]
5441        /// if it holds a `Hlg`, `None` if the field is not set or
5442        /// holds a different branch.
5443        pub fn hlg(
5444            &self,
5445        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::Vp9ColorFormatHLG>>
5446        {
5447            #[allow(unreachable_patterns)]
5448            self.color_format.as_ref().and_then(|v| match v {
5449                crate::model::video_stream::vp_9_codec_settings::ColorFormat::Hlg(v) => {
5450                    std::option::Option::Some(v)
5451                }
5452                _ => std::option::Option::None,
5453            })
5454        }
5455
5456        /// Sets the value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format]
5457        /// to hold a `Hlg`.
5458        ///
5459        /// Note that all the setters affecting `color_format` are
5460        /// mutually exclusive.
5461        pub fn set_hlg<
5462            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::Vp9ColorFormatHLG>>,
5463        >(
5464            mut self,
5465            v: T,
5466        ) -> Self {
5467            self.color_format = std::option::Option::Some(
5468                crate::model::video_stream::vp_9_codec_settings::ColorFormat::Hlg(v.into()),
5469            );
5470            self
5471        }
5472    }
5473
5474    impl wkt::message::Message for Vp9CodecSettings {
5475        fn typename() -> &'static str {
5476            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings"
5477        }
5478    }
5479
5480    /// Defines additional types related to [Vp9CodecSettings].
5481    pub mod vp_9_codec_settings {
5482        #[allow(unused_imports)]
5483        use super::*;
5484
5485        /// GOP mode can be either by frame count or duration.
5486        #[derive(Clone, Debug, PartialEq)]
5487        #[non_exhaustive]
5488        pub enum GopMode {
5489            /// Select the GOP size based on the specified frame count. Must be greater
5490            /// than zero.
5491            GopFrameCount(i32),
5492            /// Select the GOP size based on the specified duration. The default is
5493            /// `3s`. Note that `gopDuration` must be less than or equal to
5494            /// [`segmentDuration`](#SegmentSettings), and
5495            /// [`segmentDuration`](#SegmentSettings) must be divisible by
5496            /// `gopDuration`.
5497            GopDuration(std::boxed::Box<wkt::Duration>),
5498        }
5499
5500        /// Color format can be sdr or hlg.
5501        #[derive(Clone, Debug, PartialEq)]
5502        #[non_exhaustive]
5503        pub enum ColorFormat {
5504            /// Optional. SDR color format setting for VP9.
5505            Sdr(std::boxed::Box<crate::model::video_stream::Vp9ColorFormatSDR>),
5506            /// Optional. HLG color format setting for VP9.
5507            Hlg(std::boxed::Box<crate::model::video_stream::Vp9ColorFormatHLG>),
5508        }
5509    }
5510
5511    /// The conversion strategy for desired frame rate.
5512    ///
5513    /// # Working with unknown values
5514    ///
5515    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5516    /// additional enum variants at any time. Adding new variants is not considered
5517    /// a breaking change. Applications should write their code in anticipation of:
5518    ///
5519    /// - New values appearing in future releases of the client library, **and**
5520    /// - New values received dynamically, without application changes.
5521    ///
5522    /// Please consult the [Working with enums] section in the user guide for some
5523    /// guidelines.
5524    ///
5525    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5526    #[derive(Clone, Debug, PartialEq)]
5527    #[non_exhaustive]
5528    pub enum FrameRateConversionStrategy {
5529        /// Unspecified frame rate conversion strategy.
5530        Unspecified,
5531        /// Selectively retain frames to reduce the output frame rate.
5532        /// Every _n_ th frame is kept, where `n = ceil(input frame rate / target
5533        /// frame rate)`. When _n_ = 1 (that is, the target frame rate is greater
5534        /// than the input frame rate), the output frame rate matches the input frame
5535        /// rate. When _n_ > 1, frames are dropped and the output frame rate is
5536        /// equal to `(input frame rate / n)`. For more information, see
5537        /// [Calculate frame
5538        /// rate](https://cloud.google.com/transcoder/docs/concepts/frame-rate).
5539        Downsample,
5540        /// Drop or duplicate frames to match the specified frame rate.
5541        DropDuplicate,
5542        /// If set, the enum was initialized with an unknown value.
5543        ///
5544        /// Applications can examine the value using [FrameRateConversionStrategy::value] or
5545        /// [FrameRateConversionStrategy::name].
5546        UnknownValue(frame_rate_conversion_strategy::UnknownValue),
5547    }
5548
5549    #[doc(hidden)]
5550    pub mod frame_rate_conversion_strategy {
5551        #[allow(unused_imports)]
5552        use super::*;
5553        #[derive(Clone, Debug, PartialEq)]
5554        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5555    }
5556
5557    impl FrameRateConversionStrategy {
5558        /// Gets the enum value.
5559        ///
5560        /// Returns `None` if the enum contains an unknown value deserialized from
5561        /// the string representation of enums.
5562        pub fn value(&self) -> std::option::Option<i32> {
5563            match self {
5564                Self::Unspecified => std::option::Option::Some(0),
5565                Self::Downsample => std::option::Option::Some(1),
5566                Self::DropDuplicate => std::option::Option::Some(2),
5567                Self::UnknownValue(u) => u.0.value(),
5568            }
5569        }
5570
5571        /// Gets the enum value as a string.
5572        ///
5573        /// Returns `None` if the enum contains an unknown value deserialized from
5574        /// the integer representation of enums.
5575        pub fn name(&self) -> std::option::Option<&str> {
5576            match self {
5577                Self::Unspecified => {
5578                    std::option::Option::Some("FRAME_RATE_CONVERSION_STRATEGY_UNSPECIFIED")
5579                }
5580                Self::Downsample => std::option::Option::Some("DOWNSAMPLE"),
5581                Self::DropDuplicate => std::option::Option::Some("DROP_DUPLICATE"),
5582                Self::UnknownValue(u) => u.0.name(),
5583            }
5584        }
5585    }
5586
5587    impl std::default::Default for FrameRateConversionStrategy {
5588        fn default() -> Self {
5589            use std::convert::From;
5590            Self::from(0)
5591        }
5592    }
5593
5594    impl std::fmt::Display for FrameRateConversionStrategy {
5595        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5596            wkt::internal::display_enum(f, self.name(), self.value())
5597        }
5598    }
5599
5600    impl std::convert::From<i32> for FrameRateConversionStrategy {
5601        fn from(value: i32) -> Self {
5602            match value {
5603                0 => Self::Unspecified,
5604                1 => Self::Downsample,
5605                2 => Self::DropDuplicate,
5606                _ => Self::UnknownValue(frame_rate_conversion_strategy::UnknownValue(
5607                    wkt::internal::UnknownEnumValue::Integer(value),
5608                )),
5609            }
5610        }
5611    }
5612
5613    impl std::convert::From<&str> for FrameRateConversionStrategy {
5614        fn from(value: &str) -> Self {
5615            use std::string::ToString;
5616            match value {
5617                "FRAME_RATE_CONVERSION_STRATEGY_UNSPECIFIED" => Self::Unspecified,
5618                "DOWNSAMPLE" => Self::Downsample,
5619                "DROP_DUPLICATE" => Self::DropDuplicate,
5620                _ => Self::UnknownValue(frame_rate_conversion_strategy::UnknownValue(
5621                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5622                )),
5623            }
5624        }
5625    }
5626
5627    impl serde::ser::Serialize for FrameRateConversionStrategy {
5628        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5629        where
5630            S: serde::Serializer,
5631        {
5632            match self {
5633                Self::Unspecified => serializer.serialize_i32(0),
5634                Self::Downsample => serializer.serialize_i32(1),
5635                Self::DropDuplicate => serializer.serialize_i32(2),
5636                Self::UnknownValue(u) => u.0.serialize(serializer),
5637            }
5638        }
5639    }
5640
5641    impl<'de> serde::de::Deserialize<'de> for FrameRateConversionStrategy {
5642        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5643        where
5644            D: serde::Deserializer<'de>,
5645        {
5646            deserializer.deserialize_any(
5647                wkt::internal::EnumVisitor::<FrameRateConversionStrategy>::new(
5648                    ".google.cloud.video.transcoder.v1.VideoStream.FrameRateConversionStrategy",
5649                ),
5650            )
5651        }
5652    }
5653
5654    /// Codec settings can be h264, h265, or vp9.
5655    #[derive(Clone, Debug, PartialEq)]
5656    #[non_exhaustive]
5657    pub enum CodecSettings {
5658        /// H264 codec settings.
5659        H264(std::boxed::Box<crate::model::video_stream::H264CodecSettings>),
5660        /// H265 codec settings.
5661        H265(std::boxed::Box<crate::model::video_stream::H265CodecSettings>),
5662        /// VP9 codec settings.
5663        Vp9(std::boxed::Box<crate::model::video_stream::Vp9CodecSettings>),
5664    }
5665}
5666
5667/// Audio stream resource.
5668#[derive(Clone, Default, PartialEq)]
5669#[non_exhaustive]
5670pub struct AudioStream {
5671    /// The codec for this audio stream. The default is `aac`.
5672    ///
5673    /// Supported audio codecs:
5674    ///
5675    /// - `aac`
5676    /// - `aac-he`
5677    /// - `aac-he-v2`
5678    /// - `mp3`
5679    /// - `ac3`
5680    /// - `eac3`
5681    /// - `vorbis`
5682    pub codec: std::string::String,
5683
5684    /// Required. Audio bitrate in bits per second. Must be between 1 and
5685    /// 10,000,000.
5686    pub bitrate_bps: i32,
5687
5688    /// Number of audio channels. Must be between 1 and 6. The default is 2.
5689    pub channel_count: i32,
5690
5691    /// A list of channel names specifying layout of the audio channels.
5692    /// This only affects the metadata embedded in the container headers, if
5693    /// supported by the specified format. The default is `["fl", "fr"]`.
5694    ///
5695    /// Supported channel names:
5696    ///
5697    /// - `fl` - Front left channel
5698    /// - `fr` - Front right channel
5699    /// - `sl` - Side left channel
5700    /// - `sr` - Side right channel
5701    /// - `fc` - Front center channel
5702    /// - `lfe` - Low frequency
5703    pub channel_layout: std::vec::Vec<std::string::String>,
5704
5705    /// The mapping for the
5706    /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list]
5707    /// atoms with audio
5708    /// [EditAtom.inputs][google.cloud.video.transcoder.v1.EditAtom.inputs].
5709    ///
5710    /// [google.cloud.video.transcoder.v1.EditAtom.inputs]: crate::model::EditAtom::inputs
5711    /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
5712    pub mapping: std::vec::Vec<crate::model::audio_stream::AudioMapping>,
5713
5714    /// The audio sample rate in Hertz. The default is 48000 Hertz.
5715    pub sample_rate_hertz: i32,
5716
5717    /// The BCP-47 language code, such as `en-US` or `sr-Latn`. For more
5718    /// information, see
5719    /// <https://www.unicode.org/reports/tr35/#Unicode_locale_identifier>. Not
5720    /// supported in MP4 files.
5721    pub language_code: std::string::String,
5722
5723    /// The name for this particular audio stream that
5724    /// will be added to the HLS/DASH manifest. Not supported in MP4 files.
5725    pub display_name: std::string::String,
5726
5727    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5728}
5729
5730impl AudioStream {
5731    pub fn new() -> Self {
5732        std::default::Default::default()
5733    }
5734
5735    /// Sets the value of [codec][crate::model::AudioStream::codec].
5736    pub fn set_codec<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5737        self.codec = v.into();
5738        self
5739    }
5740
5741    /// Sets the value of [bitrate_bps][crate::model::AudioStream::bitrate_bps].
5742    pub fn set_bitrate_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5743        self.bitrate_bps = v.into();
5744        self
5745    }
5746
5747    /// Sets the value of [channel_count][crate::model::AudioStream::channel_count].
5748    pub fn set_channel_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5749        self.channel_count = v.into();
5750        self
5751    }
5752
5753    /// Sets the value of [channel_layout][crate::model::AudioStream::channel_layout].
5754    pub fn set_channel_layout<T, V>(mut self, v: T) -> Self
5755    where
5756        T: std::iter::IntoIterator<Item = V>,
5757        V: std::convert::Into<std::string::String>,
5758    {
5759        use std::iter::Iterator;
5760        self.channel_layout = v.into_iter().map(|i| i.into()).collect();
5761        self
5762    }
5763
5764    /// Sets the value of [mapping][crate::model::AudioStream::mapping].
5765    pub fn set_mapping<T, V>(mut self, v: T) -> Self
5766    where
5767        T: std::iter::IntoIterator<Item = V>,
5768        V: std::convert::Into<crate::model::audio_stream::AudioMapping>,
5769    {
5770        use std::iter::Iterator;
5771        self.mapping = v.into_iter().map(|i| i.into()).collect();
5772        self
5773    }
5774
5775    /// Sets the value of [sample_rate_hertz][crate::model::AudioStream::sample_rate_hertz].
5776    pub fn set_sample_rate_hertz<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5777        self.sample_rate_hertz = v.into();
5778        self
5779    }
5780
5781    /// Sets the value of [language_code][crate::model::AudioStream::language_code].
5782    pub fn set_language_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5783        self.language_code = v.into();
5784        self
5785    }
5786
5787    /// Sets the value of [display_name][crate::model::AudioStream::display_name].
5788    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5789        self.display_name = v.into();
5790        self
5791    }
5792}
5793
5794impl wkt::message::Message for AudioStream {
5795    fn typename() -> &'static str {
5796        "type.googleapis.com/google.cloud.video.transcoder.v1.AudioStream"
5797    }
5798}
5799
5800/// Defines additional types related to [AudioStream].
5801pub mod audio_stream {
5802    #[allow(unused_imports)]
5803    use super::*;
5804
5805    /// The mapping for the
5806    /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list]
5807    /// atoms with audio
5808    /// [EditAtom.inputs][google.cloud.video.transcoder.v1.EditAtom.inputs].
5809    ///
5810    /// [google.cloud.video.transcoder.v1.EditAtom.inputs]: crate::model::EditAtom::inputs
5811    /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
5812    #[derive(Clone, Default, PartialEq)]
5813    #[non_exhaustive]
5814    pub struct AudioMapping {
5815        /// Required. The
5816        /// [EditAtom.key][google.cloud.video.transcoder.v1.EditAtom.key] that
5817        /// references the atom with audio inputs in the
5818        /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list].
5819        ///
5820        /// [google.cloud.video.transcoder.v1.EditAtom.key]: crate::model::EditAtom::key
5821        /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
5822        pub atom_key: std::string::String,
5823
5824        /// Required. The [Input.key][google.cloud.video.transcoder.v1.Input.key]
5825        /// that identifies the input file.
5826        ///
5827        /// [google.cloud.video.transcoder.v1.Input.key]: crate::model::Input::key
5828        pub input_key: std::string::String,
5829
5830        /// Required. The zero-based index of the track in the input file.
5831        pub input_track: i32,
5832
5833        /// Required. The zero-based index of the channel in the input audio stream.
5834        pub input_channel: i32,
5835
5836        /// Required. The zero-based index of the channel in the output audio stream.
5837        pub output_channel: i32,
5838
5839        /// Audio volume control in dB. Negative values decrease volume,
5840        /// positive values increase. The default is 0.
5841        pub gain_db: f64,
5842
5843        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5844    }
5845
5846    impl AudioMapping {
5847        pub fn new() -> Self {
5848            std::default::Default::default()
5849        }
5850
5851        /// Sets the value of [atom_key][crate::model::audio_stream::AudioMapping::atom_key].
5852        pub fn set_atom_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5853            self.atom_key = v.into();
5854            self
5855        }
5856
5857        /// Sets the value of [input_key][crate::model::audio_stream::AudioMapping::input_key].
5858        pub fn set_input_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5859            self.input_key = v.into();
5860            self
5861        }
5862
5863        /// Sets the value of [input_track][crate::model::audio_stream::AudioMapping::input_track].
5864        pub fn set_input_track<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5865            self.input_track = v.into();
5866            self
5867        }
5868
5869        /// Sets the value of [input_channel][crate::model::audio_stream::AudioMapping::input_channel].
5870        pub fn set_input_channel<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5871            self.input_channel = v.into();
5872            self
5873        }
5874
5875        /// Sets the value of [output_channel][crate::model::audio_stream::AudioMapping::output_channel].
5876        pub fn set_output_channel<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5877            self.output_channel = v.into();
5878            self
5879        }
5880
5881        /// Sets the value of [gain_db][crate::model::audio_stream::AudioMapping::gain_db].
5882        pub fn set_gain_db<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
5883            self.gain_db = v.into();
5884            self
5885        }
5886    }
5887
5888    impl wkt::message::Message for AudioMapping {
5889        fn typename() -> &'static str {
5890            "type.googleapis.com/google.cloud.video.transcoder.v1.AudioStream.AudioMapping"
5891        }
5892    }
5893}
5894
5895/// Encoding of a text stream. For example, closed captions or subtitles.
5896#[derive(Clone, Default, PartialEq)]
5897#[non_exhaustive]
5898pub struct TextStream {
5899    /// The codec for this text stream. The default is `webvtt`.
5900    ///
5901    /// Supported text codecs:
5902    ///
5903    /// - `srt`
5904    /// - `ttml`
5905    /// - `cea608`
5906    /// - `cea708`
5907    /// - `webvtt`
5908    pub codec: std::string::String,
5909
5910    /// The BCP-47 language code, such as `en-US` or `sr-Latn`. For more
5911    /// information, see
5912    /// <https://www.unicode.org/reports/tr35/#Unicode_locale_identifier>. Not
5913    /// supported in MP4 files.
5914    pub language_code: std::string::String,
5915
5916    /// The mapping for the
5917    /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list]
5918    /// atoms with text
5919    /// [EditAtom.inputs][google.cloud.video.transcoder.v1.EditAtom.inputs].
5920    ///
5921    /// [google.cloud.video.transcoder.v1.EditAtom.inputs]: crate::model::EditAtom::inputs
5922    /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
5923    pub mapping: std::vec::Vec<crate::model::text_stream::TextMapping>,
5924
5925    /// The name for this particular text stream that
5926    /// will be added to the HLS/DASH manifest. Not supported in MP4 files.
5927    pub display_name: std::string::String,
5928
5929    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5930}
5931
5932impl TextStream {
5933    pub fn new() -> Self {
5934        std::default::Default::default()
5935    }
5936
5937    /// Sets the value of [codec][crate::model::TextStream::codec].
5938    pub fn set_codec<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5939        self.codec = v.into();
5940        self
5941    }
5942
5943    /// Sets the value of [language_code][crate::model::TextStream::language_code].
5944    pub fn set_language_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5945        self.language_code = v.into();
5946        self
5947    }
5948
5949    /// Sets the value of [mapping][crate::model::TextStream::mapping].
5950    pub fn set_mapping<T, V>(mut self, v: T) -> Self
5951    where
5952        T: std::iter::IntoIterator<Item = V>,
5953        V: std::convert::Into<crate::model::text_stream::TextMapping>,
5954    {
5955        use std::iter::Iterator;
5956        self.mapping = v.into_iter().map(|i| i.into()).collect();
5957        self
5958    }
5959
5960    /// Sets the value of [display_name][crate::model::TextStream::display_name].
5961    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5962        self.display_name = v.into();
5963        self
5964    }
5965}
5966
5967impl wkt::message::Message for TextStream {
5968    fn typename() -> &'static str {
5969        "type.googleapis.com/google.cloud.video.transcoder.v1.TextStream"
5970    }
5971}
5972
5973/// Defines additional types related to [TextStream].
5974pub mod text_stream {
5975    #[allow(unused_imports)]
5976    use super::*;
5977
5978    /// The mapping for the
5979    /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list]
5980    /// atoms with text
5981    /// [EditAtom.inputs][google.cloud.video.transcoder.v1.EditAtom.inputs].
5982    ///
5983    /// [google.cloud.video.transcoder.v1.EditAtom.inputs]: crate::model::EditAtom::inputs
5984    /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
5985    #[derive(Clone, Default, PartialEq)]
5986    #[non_exhaustive]
5987    pub struct TextMapping {
5988        /// Required. The
5989        /// [EditAtom.key][google.cloud.video.transcoder.v1.EditAtom.key] that
5990        /// references atom with text inputs in the
5991        /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list].
5992        ///
5993        /// [google.cloud.video.transcoder.v1.EditAtom.key]: crate::model::EditAtom::key
5994        /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
5995        pub atom_key: std::string::String,
5996
5997        /// Required. The [Input.key][google.cloud.video.transcoder.v1.Input.key]
5998        /// that identifies the input file.
5999        ///
6000        /// [google.cloud.video.transcoder.v1.Input.key]: crate::model::Input::key
6001        pub input_key: std::string::String,
6002
6003        /// Required. The zero-based index of the track in the input file.
6004        pub input_track: i32,
6005
6006        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6007    }
6008
6009    impl TextMapping {
6010        pub fn new() -> Self {
6011            std::default::Default::default()
6012        }
6013
6014        /// Sets the value of [atom_key][crate::model::text_stream::TextMapping::atom_key].
6015        pub fn set_atom_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6016            self.atom_key = v.into();
6017            self
6018        }
6019
6020        /// Sets the value of [input_key][crate::model::text_stream::TextMapping::input_key].
6021        pub fn set_input_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6022            self.input_key = v.into();
6023            self
6024        }
6025
6026        /// Sets the value of [input_track][crate::model::text_stream::TextMapping::input_track].
6027        pub fn set_input_track<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6028            self.input_track = v.into();
6029            self
6030        }
6031    }
6032
6033    impl wkt::message::Message for TextMapping {
6034        fn typename() -> &'static str {
6035            "type.googleapis.com/google.cloud.video.transcoder.v1.TextStream.TextMapping"
6036        }
6037    }
6038}
6039
6040/// Segment settings for `ts`, `fmp4` and `vtt`.
6041#[derive(Clone, Default, PartialEq)]
6042#[non_exhaustive]
6043pub struct SegmentSettings {
6044    /// Duration of the segments in seconds. The default is `6.0s`. Note that
6045    /// `segmentDuration` must be greater than or equal to
6046    /// [`gopDuration`](#videostream), and `segmentDuration` must be divisible by
6047    /// [`gopDuration`](#videostream).
6048    pub segment_duration: std::option::Option<wkt::Duration>,
6049
6050    /// Required. Create an individual segment file. The default is `false`.
6051    pub individual_segments: bool,
6052
6053    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6054}
6055
6056impl SegmentSettings {
6057    pub fn new() -> Self {
6058        std::default::Default::default()
6059    }
6060
6061    /// Sets the value of [segment_duration][crate::model::SegmentSettings::segment_duration].
6062    pub fn set_segment_duration<T>(mut self, v: T) -> Self
6063    where
6064        T: std::convert::Into<wkt::Duration>,
6065    {
6066        self.segment_duration = std::option::Option::Some(v.into());
6067        self
6068    }
6069
6070    /// Sets or clears the value of [segment_duration][crate::model::SegmentSettings::segment_duration].
6071    pub fn set_or_clear_segment_duration<T>(mut self, v: std::option::Option<T>) -> Self
6072    where
6073        T: std::convert::Into<wkt::Duration>,
6074    {
6075        self.segment_duration = v.map(|x| x.into());
6076        self
6077    }
6078
6079    /// Sets the value of [individual_segments][crate::model::SegmentSettings::individual_segments].
6080    pub fn set_individual_segments<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6081        self.individual_segments = v.into();
6082        self
6083    }
6084}
6085
6086impl wkt::message::Message for SegmentSettings {
6087    fn typename() -> &'static str {
6088        "type.googleapis.com/google.cloud.video.transcoder.v1.SegmentSettings"
6089    }
6090}
6091
6092/// Encryption settings.
6093#[derive(Clone, Default, PartialEq)]
6094#[non_exhaustive]
6095pub struct Encryption {
6096    /// Required. Identifier for this set of encryption options.
6097    pub id: std::string::String,
6098
6099    /// Required. DRM system(s) to use; at least one must be specified. If a
6100    /// DRM system is omitted, it is considered disabled.
6101    pub drm_systems: std::option::Option<crate::model::encryption::DrmSystems>,
6102
6103    /// Encryption mode can be either `aes` or `cenc`.
6104    pub encryption_mode: std::option::Option<crate::model::encryption::EncryptionMode>,
6105
6106    /// Defines where content keys are stored.
6107    pub secret_source: std::option::Option<crate::model::encryption::SecretSource>,
6108
6109    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6110}
6111
6112impl Encryption {
6113    pub fn new() -> Self {
6114        std::default::Default::default()
6115    }
6116
6117    /// Sets the value of [id][crate::model::Encryption::id].
6118    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6119        self.id = v.into();
6120        self
6121    }
6122
6123    /// Sets the value of [drm_systems][crate::model::Encryption::drm_systems].
6124    pub fn set_drm_systems<T>(mut self, v: T) -> Self
6125    where
6126        T: std::convert::Into<crate::model::encryption::DrmSystems>,
6127    {
6128        self.drm_systems = std::option::Option::Some(v.into());
6129        self
6130    }
6131
6132    /// Sets or clears the value of [drm_systems][crate::model::Encryption::drm_systems].
6133    pub fn set_or_clear_drm_systems<T>(mut self, v: std::option::Option<T>) -> Self
6134    where
6135        T: std::convert::Into<crate::model::encryption::DrmSystems>,
6136    {
6137        self.drm_systems = v.map(|x| x.into());
6138        self
6139    }
6140
6141    /// Sets the value of [encryption_mode][crate::model::Encryption::encryption_mode].
6142    ///
6143    /// Note that all the setters affecting `encryption_mode` are mutually
6144    /// exclusive.
6145    pub fn set_encryption_mode<
6146        T: std::convert::Into<std::option::Option<crate::model::encryption::EncryptionMode>>,
6147    >(
6148        mut self,
6149        v: T,
6150    ) -> Self {
6151        self.encryption_mode = v.into();
6152        self
6153    }
6154
6155    /// The value of [encryption_mode][crate::model::Encryption::encryption_mode]
6156    /// if it holds a `Aes128`, `None` if the field is not set or
6157    /// holds a different branch.
6158    pub fn aes_128(
6159        &self,
6160    ) -> std::option::Option<&std::boxed::Box<crate::model::encryption::Aes128Encryption>> {
6161        #[allow(unreachable_patterns)]
6162        self.encryption_mode.as_ref().and_then(|v| match v {
6163            crate::model::encryption::EncryptionMode::Aes128(v) => std::option::Option::Some(v),
6164            _ => std::option::Option::None,
6165        })
6166    }
6167
6168    /// Sets the value of [encryption_mode][crate::model::Encryption::encryption_mode]
6169    /// to hold a `Aes128`.
6170    ///
6171    /// Note that all the setters affecting `encryption_mode` are
6172    /// mutually exclusive.
6173    pub fn set_aes_128<
6174        T: std::convert::Into<std::boxed::Box<crate::model::encryption::Aes128Encryption>>,
6175    >(
6176        mut self,
6177        v: T,
6178    ) -> Self {
6179        self.encryption_mode =
6180            std::option::Option::Some(crate::model::encryption::EncryptionMode::Aes128(v.into()));
6181        self
6182    }
6183
6184    /// The value of [encryption_mode][crate::model::Encryption::encryption_mode]
6185    /// if it holds a `SampleAes`, `None` if the field is not set or
6186    /// holds a different branch.
6187    pub fn sample_aes(
6188        &self,
6189    ) -> std::option::Option<&std::boxed::Box<crate::model::encryption::SampleAesEncryption>> {
6190        #[allow(unreachable_patterns)]
6191        self.encryption_mode.as_ref().and_then(|v| match v {
6192            crate::model::encryption::EncryptionMode::SampleAes(v) => std::option::Option::Some(v),
6193            _ => std::option::Option::None,
6194        })
6195    }
6196
6197    /// Sets the value of [encryption_mode][crate::model::Encryption::encryption_mode]
6198    /// to hold a `SampleAes`.
6199    ///
6200    /// Note that all the setters affecting `encryption_mode` are
6201    /// mutually exclusive.
6202    pub fn set_sample_aes<
6203        T: std::convert::Into<std::boxed::Box<crate::model::encryption::SampleAesEncryption>>,
6204    >(
6205        mut self,
6206        v: T,
6207    ) -> Self {
6208        self.encryption_mode = std::option::Option::Some(
6209            crate::model::encryption::EncryptionMode::SampleAes(v.into()),
6210        );
6211        self
6212    }
6213
6214    /// The value of [encryption_mode][crate::model::Encryption::encryption_mode]
6215    /// if it holds a `MpegCenc`, `None` if the field is not set or
6216    /// holds a different branch.
6217    pub fn mpeg_cenc(
6218        &self,
6219    ) -> std::option::Option<&std::boxed::Box<crate::model::encryption::MpegCommonEncryption>> {
6220        #[allow(unreachable_patterns)]
6221        self.encryption_mode.as_ref().and_then(|v| match v {
6222            crate::model::encryption::EncryptionMode::MpegCenc(v) => std::option::Option::Some(v),
6223            _ => std::option::Option::None,
6224        })
6225    }
6226
6227    /// Sets the value of [encryption_mode][crate::model::Encryption::encryption_mode]
6228    /// to hold a `MpegCenc`.
6229    ///
6230    /// Note that all the setters affecting `encryption_mode` are
6231    /// mutually exclusive.
6232    pub fn set_mpeg_cenc<
6233        T: std::convert::Into<std::boxed::Box<crate::model::encryption::MpegCommonEncryption>>,
6234    >(
6235        mut self,
6236        v: T,
6237    ) -> Self {
6238        self.encryption_mode =
6239            std::option::Option::Some(crate::model::encryption::EncryptionMode::MpegCenc(v.into()));
6240        self
6241    }
6242
6243    /// Sets the value of [secret_source][crate::model::Encryption::secret_source].
6244    ///
6245    /// Note that all the setters affecting `secret_source` are mutually
6246    /// exclusive.
6247    pub fn set_secret_source<
6248        T: std::convert::Into<std::option::Option<crate::model::encryption::SecretSource>>,
6249    >(
6250        mut self,
6251        v: T,
6252    ) -> Self {
6253        self.secret_source = v.into();
6254        self
6255    }
6256
6257    /// The value of [secret_source][crate::model::Encryption::secret_source]
6258    /// if it holds a `SecretManagerKeySource`, `None` if the field is not set or
6259    /// holds a different branch.
6260    pub fn secret_manager_key_source(
6261        &self,
6262    ) -> std::option::Option<&std::boxed::Box<crate::model::encryption::SecretManagerSource>> {
6263        #[allow(unreachable_patterns)]
6264        self.secret_source.as_ref().and_then(|v| match v {
6265            crate::model::encryption::SecretSource::SecretManagerKeySource(v) => {
6266                std::option::Option::Some(v)
6267            }
6268            _ => std::option::Option::None,
6269        })
6270    }
6271
6272    /// Sets the value of [secret_source][crate::model::Encryption::secret_source]
6273    /// to hold a `SecretManagerKeySource`.
6274    ///
6275    /// Note that all the setters affecting `secret_source` are
6276    /// mutually exclusive.
6277    pub fn set_secret_manager_key_source<
6278        T: std::convert::Into<std::boxed::Box<crate::model::encryption::SecretManagerSource>>,
6279    >(
6280        mut self,
6281        v: T,
6282    ) -> Self {
6283        self.secret_source = std::option::Option::Some(
6284            crate::model::encryption::SecretSource::SecretManagerKeySource(v.into()),
6285        );
6286        self
6287    }
6288}
6289
6290impl wkt::message::Message for Encryption {
6291    fn typename() -> &'static str {
6292        "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption"
6293    }
6294}
6295
6296/// Defines additional types related to [Encryption].
6297pub mod encryption {
6298    #[allow(unused_imports)]
6299    use super::*;
6300
6301    /// Configuration for AES-128 encryption.
6302    #[derive(Clone, Default, PartialEq)]
6303    #[non_exhaustive]
6304    pub struct Aes128Encryption {
6305        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6306    }
6307
6308    impl Aes128Encryption {
6309        pub fn new() -> Self {
6310            std::default::Default::default()
6311        }
6312    }
6313
6314    impl wkt::message::Message for Aes128Encryption {
6315        fn typename() -> &'static str {
6316            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Aes128Encryption"
6317        }
6318    }
6319
6320    /// Configuration for SAMPLE-AES encryption.
6321    #[derive(Clone, Default, PartialEq)]
6322    #[non_exhaustive]
6323    pub struct SampleAesEncryption {
6324        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6325    }
6326
6327    impl SampleAesEncryption {
6328        pub fn new() -> Self {
6329            std::default::Default::default()
6330        }
6331    }
6332
6333    impl wkt::message::Message for SampleAesEncryption {
6334        fn typename() -> &'static str {
6335            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.SampleAesEncryption"
6336        }
6337    }
6338
6339    /// Configuration for MPEG Common Encryption (MPEG-CENC).
6340    #[derive(Clone, Default, PartialEq)]
6341    #[non_exhaustive]
6342    pub struct MpegCommonEncryption {
6343        /// Required. Specify the encryption scheme.
6344        ///
6345        /// Supported encryption schemes:
6346        ///
6347        /// - `cenc`
6348        /// - `cbcs`
6349        pub scheme: std::string::String,
6350
6351        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6352    }
6353
6354    impl MpegCommonEncryption {
6355        pub fn new() -> Self {
6356            std::default::Default::default()
6357        }
6358
6359        /// Sets the value of [scheme][crate::model::encryption::MpegCommonEncryption::scheme].
6360        pub fn set_scheme<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6361            self.scheme = v.into();
6362            self
6363        }
6364    }
6365
6366    impl wkt::message::Message for MpegCommonEncryption {
6367        fn typename() -> &'static str {
6368            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.MpegCommonEncryption"
6369        }
6370    }
6371
6372    /// Configuration for secrets stored in Google Secret Manager.
6373    #[derive(Clone, Default, PartialEq)]
6374    #[non_exhaustive]
6375    pub struct SecretManagerSource {
6376        /// Required. The name of the Secret Version containing the encryption key in
6377        /// the following format:
6378        /// `projects/{project}/secrets/{secret_id}/versions/{version_number}`
6379        ///
6380        /// Note that only numbered versions are supported. Aliases like "latest" are
6381        /// not supported.
6382        pub secret_version: std::string::String,
6383
6384        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6385    }
6386
6387    impl SecretManagerSource {
6388        pub fn new() -> Self {
6389            std::default::Default::default()
6390        }
6391
6392        /// Sets the value of [secret_version][crate::model::encryption::SecretManagerSource::secret_version].
6393        pub fn set_secret_version<T: std::convert::Into<std::string::String>>(
6394            mut self,
6395            v: T,
6396        ) -> Self {
6397            self.secret_version = v.into();
6398            self
6399        }
6400    }
6401
6402    impl wkt::message::Message for SecretManagerSource {
6403        fn typename() -> &'static str {
6404            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.SecretManagerSource"
6405        }
6406    }
6407
6408    /// Widevine configuration.
6409    #[derive(Clone, Default, PartialEq)]
6410    #[non_exhaustive]
6411    pub struct Widevine {
6412        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6413    }
6414
6415    impl Widevine {
6416        pub fn new() -> Self {
6417            std::default::Default::default()
6418        }
6419    }
6420
6421    impl wkt::message::Message for Widevine {
6422        fn typename() -> &'static str {
6423            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Widevine"
6424        }
6425    }
6426
6427    /// Fairplay configuration.
6428    #[derive(Clone, Default, PartialEq)]
6429    #[non_exhaustive]
6430    pub struct Fairplay {
6431        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6432    }
6433
6434    impl Fairplay {
6435        pub fn new() -> Self {
6436            std::default::Default::default()
6437        }
6438    }
6439
6440    impl wkt::message::Message for Fairplay {
6441        fn typename() -> &'static str {
6442            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Fairplay"
6443        }
6444    }
6445
6446    /// Playready configuration.
6447    #[derive(Clone, Default, PartialEq)]
6448    #[non_exhaustive]
6449    pub struct Playready {
6450        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6451    }
6452
6453    impl Playready {
6454        pub fn new() -> Self {
6455            std::default::Default::default()
6456        }
6457    }
6458
6459    impl wkt::message::Message for Playready {
6460        fn typename() -> &'static str {
6461            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Playready"
6462        }
6463    }
6464
6465    /// Clearkey configuration.
6466    #[derive(Clone, Default, PartialEq)]
6467    #[non_exhaustive]
6468    pub struct Clearkey {
6469        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6470    }
6471
6472    impl Clearkey {
6473        pub fn new() -> Self {
6474            std::default::Default::default()
6475        }
6476    }
6477
6478    impl wkt::message::Message for Clearkey {
6479        fn typename() -> &'static str {
6480            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Clearkey"
6481        }
6482    }
6483
6484    /// Defines configuration for DRM systems in use.
6485    #[derive(Clone, Default, PartialEq)]
6486    #[non_exhaustive]
6487    pub struct DrmSystems {
6488        /// Widevine configuration.
6489        pub widevine: std::option::Option<crate::model::encryption::Widevine>,
6490
6491        /// Fairplay configuration.
6492        pub fairplay: std::option::Option<crate::model::encryption::Fairplay>,
6493
6494        /// Playready configuration.
6495        pub playready: std::option::Option<crate::model::encryption::Playready>,
6496
6497        /// Clearkey configuration.
6498        pub clearkey: std::option::Option<crate::model::encryption::Clearkey>,
6499
6500        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6501    }
6502
6503    impl DrmSystems {
6504        pub fn new() -> Self {
6505            std::default::Default::default()
6506        }
6507
6508        /// Sets the value of [widevine][crate::model::encryption::DrmSystems::widevine].
6509        pub fn set_widevine<T>(mut self, v: T) -> Self
6510        where
6511            T: std::convert::Into<crate::model::encryption::Widevine>,
6512        {
6513            self.widevine = std::option::Option::Some(v.into());
6514            self
6515        }
6516
6517        /// Sets or clears the value of [widevine][crate::model::encryption::DrmSystems::widevine].
6518        pub fn set_or_clear_widevine<T>(mut self, v: std::option::Option<T>) -> Self
6519        where
6520            T: std::convert::Into<crate::model::encryption::Widevine>,
6521        {
6522            self.widevine = v.map(|x| x.into());
6523            self
6524        }
6525
6526        /// Sets the value of [fairplay][crate::model::encryption::DrmSystems::fairplay].
6527        pub fn set_fairplay<T>(mut self, v: T) -> Self
6528        where
6529            T: std::convert::Into<crate::model::encryption::Fairplay>,
6530        {
6531            self.fairplay = std::option::Option::Some(v.into());
6532            self
6533        }
6534
6535        /// Sets or clears the value of [fairplay][crate::model::encryption::DrmSystems::fairplay].
6536        pub fn set_or_clear_fairplay<T>(mut self, v: std::option::Option<T>) -> Self
6537        where
6538            T: std::convert::Into<crate::model::encryption::Fairplay>,
6539        {
6540            self.fairplay = v.map(|x| x.into());
6541            self
6542        }
6543
6544        /// Sets the value of [playready][crate::model::encryption::DrmSystems::playready].
6545        pub fn set_playready<T>(mut self, v: T) -> Self
6546        where
6547            T: std::convert::Into<crate::model::encryption::Playready>,
6548        {
6549            self.playready = std::option::Option::Some(v.into());
6550            self
6551        }
6552
6553        /// Sets or clears the value of [playready][crate::model::encryption::DrmSystems::playready].
6554        pub fn set_or_clear_playready<T>(mut self, v: std::option::Option<T>) -> Self
6555        where
6556            T: std::convert::Into<crate::model::encryption::Playready>,
6557        {
6558            self.playready = v.map(|x| x.into());
6559            self
6560        }
6561
6562        /// Sets the value of [clearkey][crate::model::encryption::DrmSystems::clearkey].
6563        pub fn set_clearkey<T>(mut self, v: T) -> Self
6564        where
6565            T: std::convert::Into<crate::model::encryption::Clearkey>,
6566        {
6567            self.clearkey = std::option::Option::Some(v.into());
6568            self
6569        }
6570
6571        /// Sets or clears the value of [clearkey][crate::model::encryption::DrmSystems::clearkey].
6572        pub fn set_or_clear_clearkey<T>(mut self, v: std::option::Option<T>) -> Self
6573        where
6574            T: std::convert::Into<crate::model::encryption::Clearkey>,
6575        {
6576            self.clearkey = v.map(|x| x.into());
6577            self
6578        }
6579    }
6580
6581    impl wkt::message::Message for DrmSystems {
6582        fn typename() -> &'static str {
6583            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.DrmSystems"
6584        }
6585    }
6586
6587    /// Encryption mode can be either `aes` or `cenc`.
6588    #[derive(Clone, Debug, PartialEq)]
6589    #[non_exhaustive]
6590    pub enum EncryptionMode {
6591        /// Configuration for AES-128 encryption.
6592        Aes128(std::boxed::Box<crate::model::encryption::Aes128Encryption>),
6593        /// Configuration for SAMPLE-AES encryption.
6594        SampleAes(std::boxed::Box<crate::model::encryption::SampleAesEncryption>),
6595        /// Configuration for MPEG Common Encryption (MPEG-CENC).
6596        MpegCenc(std::boxed::Box<crate::model::encryption::MpegCommonEncryption>),
6597    }
6598
6599    /// Defines where content keys are stored.
6600    #[derive(Clone, Debug, PartialEq)]
6601    #[non_exhaustive]
6602    pub enum SecretSource {
6603        /// Keys are stored in Google Secret Manager.
6604        SecretManagerKeySource(std::boxed::Box<crate::model::encryption::SecretManagerSource>),
6605    }
6606}
6607
6608/// Request message for `TranscoderService.CreateJob`.
6609#[derive(Clone, Default, PartialEq)]
6610#[non_exhaustive]
6611pub struct CreateJobRequest {
6612    /// Required. The parent location to create and process this job.
6613    /// Format: `projects/{project}/locations/{location}`
6614    pub parent: std::string::String,
6615
6616    /// Required. Parameters for creating transcoding job.
6617    pub job: std::option::Option<crate::model::Job>,
6618
6619    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6620}
6621
6622impl CreateJobRequest {
6623    pub fn new() -> Self {
6624        std::default::Default::default()
6625    }
6626
6627    /// Sets the value of [parent][crate::model::CreateJobRequest::parent].
6628    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6629        self.parent = v.into();
6630        self
6631    }
6632
6633    /// Sets the value of [job][crate::model::CreateJobRequest::job].
6634    pub fn set_job<T>(mut self, v: T) -> Self
6635    where
6636        T: std::convert::Into<crate::model::Job>,
6637    {
6638        self.job = std::option::Option::Some(v.into());
6639        self
6640    }
6641
6642    /// Sets or clears the value of [job][crate::model::CreateJobRequest::job].
6643    pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
6644    where
6645        T: std::convert::Into<crate::model::Job>,
6646    {
6647        self.job = v.map(|x| x.into());
6648        self
6649    }
6650}
6651
6652impl wkt::message::Message for CreateJobRequest {
6653    fn typename() -> &'static str {
6654        "type.googleapis.com/google.cloud.video.transcoder.v1.CreateJobRequest"
6655    }
6656}
6657
6658/// Request message for `TranscoderService.ListJobs`.
6659/// The parent location from which to retrieve the collection of jobs.
6660#[derive(Clone, Default, PartialEq)]
6661#[non_exhaustive]
6662pub struct ListJobsRequest {
6663    /// Required. Format: `projects/{project}/locations/{location}`
6664    pub parent: std::string::String,
6665
6666    /// The maximum number of items to return.
6667    pub page_size: i32,
6668
6669    /// The `next_page_token` value returned from a previous List request, if
6670    /// any.
6671    pub page_token: std::string::String,
6672
6673    /// The filter expression, following the syntax outlined in
6674    /// <https://google.aip.dev/160>.
6675    pub filter: std::string::String,
6676
6677    /// One or more fields to compare and use to sort the output.
6678    /// See <https://google.aip.dev/132#ordering>.
6679    pub order_by: std::string::String,
6680
6681    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6682}
6683
6684impl ListJobsRequest {
6685    pub fn new() -> Self {
6686        std::default::Default::default()
6687    }
6688
6689    /// Sets the value of [parent][crate::model::ListJobsRequest::parent].
6690    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6691        self.parent = v.into();
6692        self
6693    }
6694
6695    /// Sets the value of [page_size][crate::model::ListJobsRequest::page_size].
6696    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6697        self.page_size = v.into();
6698        self
6699    }
6700
6701    /// Sets the value of [page_token][crate::model::ListJobsRequest::page_token].
6702    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6703        self.page_token = v.into();
6704        self
6705    }
6706
6707    /// Sets the value of [filter][crate::model::ListJobsRequest::filter].
6708    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6709        self.filter = v.into();
6710        self
6711    }
6712
6713    /// Sets the value of [order_by][crate::model::ListJobsRequest::order_by].
6714    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6715        self.order_by = v.into();
6716        self
6717    }
6718}
6719
6720impl wkt::message::Message for ListJobsRequest {
6721    fn typename() -> &'static str {
6722        "type.googleapis.com/google.cloud.video.transcoder.v1.ListJobsRequest"
6723    }
6724}
6725
6726/// Request message for `TranscoderService.GetJob`.
6727#[derive(Clone, Default, PartialEq)]
6728#[non_exhaustive]
6729pub struct GetJobRequest {
6730    /// Required. The name of the job to retrieve.
6731    /// Format: `projects/{project}/locations/{location}/jobs/{job}`
6732    pub name: std::string::String,
6733
6734    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6735}
6736
6737impl GetJobRequest {
6738    pub fn new() -> Self {
6739        std::default::Default::default()
6740    }
6741
6742    /// Sets the value of [name][crate::model::GetJobRequest::name].
6743    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6744        self.name = v.into();
6745        self
6746    }
6747}
6748
6749impl wkt::message::Message for GetJobRequest {
6750    fn typename() -> &'static str {
6751        "type.googleapis.com/google.cloud.video.transcoder.v1.GetJobRequest"
6752    }
6753}
6754
6755/// Request message for `TranscoderService.DeleteJob`.
6756#[derive(Clone, Default, PartialEq)]
6757#[non_exhaustive]
6758pub struct DeleteJobRequest {
6759    /// Required. The name of the job to delete.
6760    /// Format: `projects/{project}/locations/{location}/jobs/{job}`
6761    pub name: std::string::String,
6762
6763    /// If set to true, and the job is not found, the request will succeed but no
6764    /// action will be taken on the server.
6765    pub allow_missing: bool,
6766
6767    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6768}
6769
6770impl DeleteJobRequest {
6771    pub fn new() -> Self {
6772        std::default::Default::default()
6773    }
6774
6775    /// Sets the value of [name][crate::model::DeleteJobRequest::name].
6776    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6777        self.name = v.into();
6778        self
6779    }
6780
6781    /// Sets the value of [allow_missing][crate::model::DeleteJobRequest::allow_missing].
6782    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6783        self.allow_missing = v.into();
6784        self
6785    }
6786}
6787
6788impl wkt::message::Message for DeleteJobRequest {
6789    fn typename() -> &'static str {
6790        "type.googleapis.com/google.cloud.video.transcoder.v1.DeleteJobRequest"
6791    }
6792}
6793
6794/// Response message for `TranscoderService.ListJobs`.
6795#[derive(Clone, Default, PartialEq)]
6796#[non_exhaustive]
6797pub struct ListJobsResponse {
6798    /// List of jobs in the specified region.
6799    pub jobs: std::vec::Vec<crate::model::Job>,
6800
6801    /// The pagination token.
6802    pub next_page_token: std::string::String,
6803
6804    /// List of regions that could not be reached.
6805    pub unreachable: std::vec::Vec<std::string::String>,
6806
6807    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6808}
6809
6810impl ListJobsResponse {
6811    pub fn new() -> Self {
6812        std::default::Default::default()
6813    }
6814
6815    /// Sets the value of [jobs][crate::model::ListJobsResponse::jobs].
6816    pub fn set_jobs<T, V>(mut self, v: T) -> Self
6817    where
6818        T: std::iter::IntoIterator<Item = V>,
6819        V: std::convert::Into<crate::model::Job>,
6820    {
6821        use std::iter::Iterator;
6822        self.jobs = v.into_iter().map(|i| i.into()).collect();
6823        self
6824    }
6825
6826    /// Sets the value of [next_page_token][crate::model::ListJobsResponse::next_page_token].
6827    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6828        self.next_page_token = v.into();
6829        self
6830    }
6831
6832    /// Sets the value of [unreachable][crate::model::ListJobsResponse::unreachable].
6833    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6834    where
6835        T: std::iter::IntoIterator<Item = V>,
6836        V: std::convert::Into<std::string::String>,
6837    {
6838        use std::iter::Iterator;
6839        self.unreachable = v.into_iter().map(|i| i.into()).collect();
6840        self
6841    }
6842}
6843
6844impl wkt::message::Message for ListJobsResponse {
6845    fn typename() -> &'static str {
6846        "type.googleapis.com/google.cloud.video.transcoder.v1.ListJobsResponse"
6847    }
6848}
6849
6850#[doc(hidden)]
6851impl gax::paginator::internal::PageableResponse for ListJobsResponse {
6852    type PageItem = crate::model::Job;
6853
6854    fn items(self) -> std::vec::Vec<Self::PageItem> {
6855        self.jobs
6856    }
6857
6858    fn next_page_token(&self) -> std::string::String {
6859        use std::clone::Clone;
6860        self.next_page_token.clone()
6861    }
6862}
6863
6864/// Request message for `TranscoderService.CreateJobTemplate`.
6865#[derive(Clone, Default, PartialEq)]
6866#[non_exhaustive]
6867pub struct CreateJobTemplateRequest {
6868    /// Required. The parent location to create this job template.
6869    /// Format: `projects/{project}/locations/{location}`
6870    pub parent: std::string::String,
6871
6872    /// Required. Parameters for creating job template.
6873    pub job_template: std::option::Option<crate::model::JobTemplate>,
6874
6875    /// Required. The ID to use for the job template, which will become the final
6876    /// component of the job template's resource name.
6877    ///
6878    /// This value should be 4-63 characters, and valid characters must match the
6879    /// regular expression `[a-zA-Z][a-zA-Z0-9_-]*`.
6880    pub job_template_id: std::string::String,
6881
6882    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6883}
6884
6885impl CreateJobTemplateRequest {
6886    pub fn new() -> Self {
6887        std::default::Default::default()
6888    }
6889
6890    /// Sets the value of [parent][crate::model::CreateJobTemplateRequest::parent].
6891    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6892        self.parent = v.into();
6893        self
6894    }
6895
6896    /// Sets the value of [job_template][crate::model::CreateJobTemplateRequest::job_template].
6897    pub fn set_job_template<T>(mut self, v: T) -> Self
6898    where
6899        T: std::convert::Into<crate::model::JobTemplate>,
6900    {
6901        self.job_template = std::option::Option::Some(v.into());
6902        self
6903    }
6904
6905    /// Sets or clears the value of [job_template][crate::model::CreateJobTemplateRequest::job_template].
6906    pub fn set_or_clear_job_template<T>(mut self, v: std::option::Option<T>) -> Self
6907    where
6908        T: std::convert::Into<crate::model::JobTemplate>,
6909    {
6910        self.job_template = v.map(|x| x.into());
6911        self
6912    }
6913
6914    /// Sets the value of [job_template_id][crate::model::CreateJobTemplateRequest::job_template_id].
6915    pub fn set_job_template_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6916        self.job_template_id = v.into();
6917        self
6918    }
6919}
6920
6921impl wkt::message::Message for CreateJobTemplateRequest {
6922    fn typename() -> &'static str {
6923        "type.googleapis.com/google.cloud.video.transcoder.v1.CreateJobTemplateRequest"
6924    }
6925}
6926
6927/// Request message for `TranscoderService.ListJobTemplates`.
6928#[derive(Clone, Default, PartialEq)]
6929#[non_exhaustive]
6930pub struct ListJobTemplatesRequest {
6931    /// Required. The parent location from which to retrieve the collection of job
6932    /// templates. Format: `projects/{project}/locations/{location}`
6933    pub parent: std::string::String,
6934
6935    /// The maximum number of items to return.
6936    pub page_size: i32,
6937
6938    /// The `next_page_token` value returned from a previous List request, if
6939    /// any.
6940    pub page_token: std::string::String,
6941
6942    /// The filter expression, following the syntax outlined in
6943    /// <https://google.aip.dev/160>.
6944    pub filter: std::string::String,
6945
6946    /// One or more fields to compare and use to sort the output.
6947    /// See <https://google.aip.dev/132#ordering>.
6948    pub order_by: std::string::String,
6949
6950    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6951}
6952
6953impl ListJobTemplatesRequest {
6954    pub fn new() -> Self {
6955        std::default::Default::default()
6956    }
6957
6958    /// Sets the value of [parent][crate::model::ListJobTemplatesRequest::parent].
6959    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6960        self.parent = v.into();
6961        self
6962    }
6963
6964    /// Sets the value of [page_size][crate::model::ListJobTemplatesRequest::page_size].
6965    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6966        self.page_size = v.into();
6967        self
6968    }
6969
6970    /// Sets the value of [page_token][crate::model::ListJobTemplatesRequest::page_token].
6971    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6972        self.page_token = v.into();
6973        self
6974    }
6975
6976    /// Sets the value of [filter][crate::model::ListJobTemplatesRequest::filter].
6977    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6978        self.filter = v.into();
6979        self
6980    }
6981
6982    /// Sets the value of [order_by][crate::model::ListJobTemplatesRequest::order_by].
6983    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6984        self.order_by = v.into();
6985        self
6986    }
6987}
6988
6989impl wkt::message::Message for ListJobTemplatesRequest {
6990    fn typename() -> &'static str {
6991        "type.googleapis.com/google.cloud.video.transcoder.v1.ListJobTemplatesRequest"
6992    }
6993}
6994
6995/// Request message for `TranscoderService.GetJobTemplate`.
6996#[derive(Clone, Default, PartialEq)]
6997#[non_exhaustive]
6998pub struct GetJobTemplateRequest {
6999    /// Required. The name of the job template to retrieve.
7000    /// Format:
7001    /// `projects/{project}/locations/{location}/jobTemplates/{job_template}`
7002    pub name: std::string::String,
7003
7004    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7005}
7006
7007impl GetJobTemplateRequest {
7008    pub fn new() -> Self {
7009        std::default::Default::default()
7010    }
7011
7012    /// Sets the value of [name][crate::model::GetJobTemplateRequest::name].
7013    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7014        self.name = v.into();
7015        self
7016    }
7017}
7018
7019impl wkt::message::Message for GetJobTemplateRequest {
7020    fn typename() -> &'static str {
7021        "type.googleapis.com/google.cloud.video.transcoder.v1.GetJobTemplateRequest"
7022    }
7023}
7024
7025/// Request message for `TranscoderService.DeleteJobTemplate`.
7026#[derive(Clone, Default, PartialEq)]
7027#[non_exhaustive]
7028pub struct DeleteJobTemplateRequest {
7029    /// Required. The name of the job template to delete.
7030    /// `projects/{project}/locations/{location}/jobTemplates/{job_template}`
7031    pub name: std::string::String,
7032
7033    /// If set to true, and the job template is not found, the request will succeed
7034    /// but no action will be taken on the server.
7035    pub allow_missing: bool,
7036
7037    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7038}
7039
7040impl DeleteJobTemplateRequest {
7041    pub fn new() -> Self {
7042        std::default::Default::default()
7043    }
7044
7045    /// Sets the value of [name][crate::model::DeleteJobTemplateRequest::name].
7046    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7047        self.name = v.into();
7048        self
7049    }
7050
7051    /// Sets the value of [allow_missing][crate::model::DeleteJobTemplateRequest::allow_missing].
7052    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7053        self.allow_missing = v.into();
7054        self
7055    }
7056}
7057
7058impl wkt::message::Message for DeleteJobTemplateRequest {
7059    fn typename() -> &'static str {
7060        "type.googleapis.com/google.cloud.video.transcoder.v1.DeleteJobTemplateRequest"
7061    }
7062}
7063
7064/// Response message for `TranscoderService.ListJobTemplates`.
7065#[derive(Clone, Default, PartialEq)]
7066#[non_exhaustive]
7067pub struct ListJobTemplatesResponse {
7068    /// List of job templates in the specified region.
7069    pub job_templates: std::vec::Vec<crate::model::JobTemplate>,
7070
7071    /// The pagination token.
7072    pub next_page_token: std::string::String,
7073
7074    /// List of regions that could not be reached.
7075    pub unreachable: std::vec::Vec<std::string::String>,
7076
7077    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7078}
7079
7080impl ListJobTemplatesResponse {
7081    pub fn new() -> Self {
7082        std::default::Default::default()
7083    }
7084
7085    /// Sets the value of [job_templates][crate::model::ListJobTemplatesResponse::job_templates].
7086    pub fn set_job_templates<T, V>(mut self, v: T) -> Self
7087    where
7088        T: std::iter::IntoIterator<Item = V>,
7089        V: std::convert::Into<crate::model::JobTemplate>,
7090    {
7091        use std::iter::Iterator;
7092        self.job_templates = v.into_iter().map(|i| i.into()).collect();
7093        self
7094    }
7095
7096    /// Sets the value of [next_page_token][crate::model::ListJobTemplatesResponse::next_page_token].
7097    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7098        self.next_page_token = v.into();
7099        self
7100    }
7101
7102    /// Sets the value of [unreachable][crate::model::ListJobTemplatesResponse::unreachable].
7103    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7104    where
7105        T: std::iter::IntoIterator<Item = V>,
7106        V: std::convert::Into<std::string::String>,
7107    {
7108        use std::iter::Iterator;
7109        self.unreachable = v.into_iter().map(|i| i.into()).collect();
7110        self
7111    }
7112}
7113
7114impl wkt::message::Message for ListJobTemplatesResponse {
7115    fn typename() -> &'static str {
7116        "type.googleapis.com/google.cloud.video.transcoder.v1.ListJobTemplatesResponse"
7117    }
7118}
7119
7120#[doc(hidden)]
7121impl gax::paginator::internal::PageableResponse for ListJobTemplatesResponse {
7122    type PageItem = crate::model::JobTemplate;
7123
7124    fn items(self) -> std::vec::Vec<Self::PageItem> {
7125        self.job_templates
7126    }
7127
7128    fn next_page_token(&self) -> std::string::String {
7129        use std::clone::Clone;
7130        self.next_page_token.clone()
7131    }
7132}