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
34/// Transcoding job resource.
35#[derive(Clone, Default, PartialEq)]
36#[non_exhaustive]
37pub struct Job {
38    /// The resource name of the job.
39    /// Format: `projects/{project_number}/locations/{location}/jobs/{job}`
40    pub name: std::string::String,
41
42    /// Input only. Specify the `input_uri` to populate empty `uri` fields in each
43    /// element of `Job.config.inputs` or `JobTemplate.config.inputs` when using
44    /// template. URI of the media. Input files must be at least 5 seconds in
45    /// duration and stored in Cloud Storage (for example,
46    /// `gs://bucket/inputs/file.mp4`). See [Supported input and output
47    /// formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats).
48    pub input_uri: std::string::String,
49
50    /// Input only. Specify the `output_uri` to populate an empty
51    /// `Job.config.output.uri` or `JobTemplate.config.output.uri` when using
52    /// template. URI for the output file(s). For example,
53    /// `gs://my-bucket/outputs/`. See [Supported input and output
54    /// formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats).
55    pub output_uri: std::string::String,
56
57    /// Output only. The current state of the job.
58    pub state: crate::model::job::ProcessingState,
59
60    /// Output only. The time the job was created.
61    pub create_time: std::option::Option<wkt::Timestamp>,
62
63    /// Output only. The time the transcoding started.
64    pub start_time: std::option::Option<wkt::Timestamp>,
65
66    /// Output only. The time the transcoding finished.
67    pub end_time: std::option::Option<wkt::Timestamp>,
68
69    /// Job time to live value in days, which will be effective after job
70    /// completion. Job should be deleted automatically after the given TTL. Enter
71    /// a value between 1 and 90. The default is 30.
72    pub ttl_after_completion_days: i32,
73
74    /// The labels associated with this job. You can use these to organize and
75    /// group your jobs.
76    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
77
78    /// Output only. An error object that describes the reason for the failure.
79    /// This property is always present when
80    /// [ProcessingState][google.cloud.video.transcoder.v1.Job.ProcessingState] is
81    /// `FAILED`.
82    ///
83    /// [google.cloud.video.transcoder.v1.Job.ProcessingState]: crate::model::job::ProcessingState
84    pub error: std::option::Option<rpc::model::Status>,
85
86    /// The processing mode of the job.
87    /// The default is `PROCESSING_MODE_INTERACTIVE`.
88    pub mode: crate::model::job::ProcessingMode,
89
90    /// The processing priority of a batch job.
91    /// This field can only be set for batch mode jobs. The default value is 0.
92    /// This value cannot be negative. Higher values correspond to higher
93    /// priorities for the job.
94    pub batch_mode_priority: i32,
95
96    /// Optional. The optimization strategy of the job. The default is
97    /// `AUTODETECT`.
98    pub optimization: crate::model::job::OptimizationStrategy,
99
100    /// Optional. Insert silence and duplicate frames when timestamp gaps are
101    /// detected in a given stream.
102    pub fill_content_gaps: bool,
103
104    /// Specify the config for the transcoding job. If you don't specify the
105    /// `job_config`, the API selects `templateId`; this template ID is set to
106    /// `preset/web-hd` by default. When you use a `template_id` to create a job,
107    /// the `Job.config` is populated by the `JobTemplate.config`.\<br\>
108    pub job_config: std::option::Option<crate::model::job::JobConfig>,
109
110    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
111}
112
113impl Job {
114    pub fn new() -> Self {
115        std::default::Default::default()
116    }
117
118    /// Sets the value of [name][crate::model::Job::name].
119    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
120        self.name = v.into();
121        self
122    }
123
124    /// Sets the value of [input_uri][crate::model::Job::input_uri].
125    pub fn set_input_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
126        self.input_uri = v.into();
127        self
128    }
129
130    /// Sets the value of [output_uri][crate::model::Job::output_uri].
131    pub fn set_output_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
132        self.output_uri = v.into();
133        self
134    }
135
136    /// Sets the value of [state][crate::model::Job::state].
137    pub fn set_state<T: std::convert::Into<crate::model::job::ProcessingState>>(
138        mut self,
139        v: T,
140    ) -> Self {
141        self.state = v.into();
142        self
143    }
144
145    /// Sets the value of [create_time][crate::model::Job::create_time].
146    pub fn set_create_time<T>(mut self, v: T) -> Self
147    where
148        T: std::convert::Into<wkt::Timestamp>,
149    {
150        self.create_time = std::option::Option::Some(v.into());
151        self
152    }
153
154    /// Sets or clears the value of [create_time][crate::model::Job::create_time].
155    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
156    where
157        T: std::convert::Into<wkt::Timestamp>,
158    {
159        self.create_time = v.map(|x| x.into());
160        self
161    }
162
163    /// Sets the value of [start_time][crate::model::Job::start_time].
164    pub fn set_start_time<T>(mut self, v: T) -> Self
165    where
166        T: std::convert::Into<wkt::Timestamp>,
167    {
168        self.start_time = std::option::Option::Some(v.into());
169        self
170    }
171
172    /// Sets or clears the value of [start_time][crate::model::Job::start_time].
173    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
174    where
175        T: std::convert::Into<wkt::Timestamp>,
176    {
177        self.start_time = v.map(|x| x.into());
178        self
179    }
180
181    /// Sets the value of [end_time][crate::model::Job::end_time].
182    pub fn set_end_time<T>(mut self, v: T) -> Self
183    where
184        T: std::convert::Into<wkt::Timestamp>,
185    {
186        self.end_time = std::option::Option::Some(v.into());
187        self
188    }
189
190    /// Sets or clears the value of [end_time][crate::model::Job::end_time].
191    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
192    where
193        T: std::convert::Into<wkt::Timestamp>,
194    {
195        self.end_time = v.map(|x| x.into());
196        self
197    }
198
199    /// Sets the value of [ttl_after_completion_days][crate::model::Job::ttl_after_completion_days].
200    pub fn set_ttl_after_completion_days<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
201        self.ttl_after_completion_days = v.into();
202        self
203    }
204
205    /// Sets the value of [labels][crate::model::Job::labels].
206    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
207    where
208        T: std::iter::IntoIterator<Item = (K, V)>,
209        K: std::convert::Into<std::string::String>,
210        V: std::convert::Into<std::string::String>,
211    {
212        use std::iter::Iterator;
213        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
214        self
215    }
216
217    /// Sets the value of [error][crate::model::Job::error].
218    pub fn set_error<T>(mut self, v: T) -> Self
219    where
220        T: std::convert::Into<rpc::model::Status>,
221    {
222        self.error = std::option::Option::Some(v.into());
223        self
224    }
225
226    /// Sets or clears the value of [error][crate::model::Job::error].
227    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
228    where
229        T: std::convert::Into<rpc::model::Status>,
230    {
231        self.error = v.map(|x| x.into());
232        self
233    }
234
235    /// Sets the value of [mode][crate::model::Job::mode].
236    pub fn set_mode<T: std::convert::Into<crate::model::job::ProcessingMode>>(
237        mut self,
238        v: T,
239    ) -> Self {
240        self.mode = v.into();
241        self
242    }
243
244    /// Sets the value of [batch_mode_priority][crate::model::Job::batch_mode_priority].
245    pub fn set_batch_mode_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
246        self.batch_mode_priority = v.into();
247        self
248    }
249
250    /// Sets the value of [optimization][crate::model::Job::optimization].
251    pub fn set_optimization<T: std::convert::Into<crate::model::job::OptimizationStrategy>>(
252        mut self,
253        v: T,
254    ) -> Self {
255        self.optimization = v.into();
256        self
257    }
258
259    /// Sets the value of [fill_content_gaps][crate::model::Job::fill_content_gaps].
260    pub fn set_fill_content_gaps<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
261        self.fill_content_gaps = v.into();
262        self
263    }
264
265    /// Sets the value of [job_config][crate::model::Job::job_config].
266    ///
267    /// Note that all the setters affecting `job_config` are mutually
268    /// exclusive.
269    pub fn set_job_config<
270        T: std::convert::Into<std::option::Option<crate::model::job::JobConfig>>,
271    >(
272        mut self,
273        v: T,
274    ) -> Self {
275        self.job_config = v.into();
276        self
277    }
278
279    /// The value of [job_config][crate::model::Job::job_config]
280    /// if it holds a `TemplateId`, `None` if the field is not set or
281    /// holds a different branch.
282    pub fn template_id(&self) -> std::option::Option<&std::string::String> {
283        #[allow(unreachable_patterns)]
284        self.job_config.as_ref().and_then(|v| match v {
285            crate::model::job::JobConfig::TemplateId(v) => std::option::Option::Some(v),
286            _ => std::option::Option::None,
287        })
288    }
289
290    /// Sets the value of [job_config][crate::model::Job::job_config]
291    /// to hold a `TemplateId`.
292    ///
293    /// Note that all the setters affecting `job_config` are
294    /// mutually exclusive.
295    pub fn set_template_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
296        self.job_config =
297            std::option::Option::Some(crate::model::job::JobConfig::TemplateId(v.into()));
298        self
299    }
300
301    /// The value of [job_config][crate::model::Job::job_config]
302    /// if it holds a `Config`, `None` if the field is not set or
303    /// holds a different branch.
304    pub fn config(&self) -> std::option::Option<&std::boxed::Box<crate::model::JobConfig>> {
305        #[allow(unreachable_patterns)]
306        self.job_config.as_ref().and_then(|v| match v {
307            crate::model::job::JobConfig::Config(v) => std::option::Option::Some(v),
308            _ => std::option::Option::None,
309        })
310    }
311
312    /// Sets the value of [job_config][crate::model::Job::job_config]
313    /// to hold a `Config`.
314    ///
315    /// Note that all the setters affecting `job_config` are
316    /// mutually exclusive.
317    pub fn set_config<T: std::convert::Into<std::boxed::Box<crate::model::JobConfig>>>(
318        mut self,
319        v: T,
320    ) -> Self {
321        self.job_config = std::option::Option::Some(crate::model::job::JobConfig::Config(v.into()));
322        self
323    }
324}
325
326impl wkt::message::Message for Job {
327    fn typename() -> &'static str {
328        "type.googleapis.com/google.cloud.video.transcoder.v1.Job"
329    }
330}
331
332#[doc(hidden)]
333impl<'de> serde::de::Deserialize<'de> for Job {
334    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
335    where
336        D: serde::Deserializer<'de>,
337    {
338        #[allow(non_camel_case_types)]
339        #[doc(hidden)]
340        #[derive(PartialEq, Eq, Hash)]
341        enum __FieldTag {
342            __name,
343            __input_uri,
344            __output_uri,
345            __template_id,
346            __config,
347            __state,
348            __create_time,
349            __start_time,
350            __end_time,
351            __ttl_after_completion_days,
352            __labels,
353            __error,
354            __mode,
355            __batch_mode_priority,
356            __optimization,
357            __fill_content_gaps,
358            Unknown(std::string::String),
359        }
360        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
361            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
362            where
363                D: serde::Deserializer<'de>,
364            {
365                struct Visitor;
366                impl<'de> serde::de::Visitor<'de> for Visitor {
367                    type Value = __FieldTag;
368                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
369                        formatter.write_str("a field name for Job")
370                    }
371                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
372                    where
373                        E: serde::de::Error,
374                    {
375                        use std::result::Result::Ok;
376                        use std::string::ToString;
377                        match value {
378                            "name" => Ok(__FieldTag::__name),
379                            "inputUri" => Ok(__FieldTag::__input_uri),
380                            "input_uri" => Ok(__FieldTag::__input_uri),
381                            "outputUri" => Ok(__FieldTag::__output_uri),
382                            "output_uri" => Ok(__FieldTag::__output_uri),
383                            "templateId" => Ok(__FieldTag::__template_id),
384                            "template_id" => Ok(__FieldTag::__template_id),
385                            "config" => Ok(__FieldTag::__config),
386                            "state" => Ok(__FieldTag::__state),
387                            "createTime" => Ok(__FieldTag::__create_time),
388                            "create_time" => Ok(__FieldTag::__create_time),
389                            "startTime" => Ok(__FieldTag::__start_time),
390                            "start_time" => Ok(__FieldTag::__start_time),
391                            "endTime" => Ok(__FieldTag::__end_time),
392                            "end_time" => Ok(__FieldTag::__end_time),
393                            "ttlAfterCompletionDays" => Ok(__FieldTag::__ttl_after_completion_days),
394                            "ttl_after_completion_days" => {
395                                Ok(__FieldTag::__ttl_after_completion_days)
396                            }
397                            "labels" => Ok(__FieldTag::__labels),
398                            "error" => Ok(__FieldTag::__error),
399                            "mode" => Ok(__FieldTag::__mode),
400                            "batchModePriority" => Ok(__FieldTag::__batch_mode_priority),
401                            "batch_mode_priority" => Ok(__FieldTag::__batch_mode_priority),
402                            "optimization" => Ok(__FieldTag::__optimization),
403                            "fillContentGaps" => Ok(__FieldTag::__fill_content_gaps),
404                            "fill_content_gaps" => Ok(__FieldTag::__fill_content_gaps),
405                            _ => Ok(__FieldTag::Unknown(value.to_string())),
406                        }
407                    }
408                }
409                deserializer.deserialize_identifier(Visitor)
410            }
411        }
412        struct Visitor;
413        impl<'de> serde::de::Visitor<'de> for Visitor {
414            type Value = Job;
415            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
416                formatter.write_str("struct Job")
417            }
418            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
419            where
420                A: serde::de::MapAccess<'de>,
421            {
422                #[allow(unused_imports)]
423                use serde::de::Error;
424                use std::option::Option::Some;
425                let mut fields = std::collections::HashSet::new();
426                let mut result = Self::Value::new();
427                while let Some(tag) = map.next_key::<__FieldTag>()? {
428                    #[allow(clippy::match_single_binding)]
429                    match tag {
430                        __FieldTag::__name => {
431                            if !fields.insert(__FieldTag::__name) {
432                                return std::result::Result::Err(A::Error::duplicate_field(
433                                    "multiple values for name",
434                                ));
435                            }
436                            result.name = map
437                                .next_value::<std::option::Option<std::string::String>>()?
438                                .unwrap_or_default();
439                        }
440                        __FieldTag::__input_uri => {
441                            if !fields.insert(__FieldTag::__input_uri) {
442                                return std::result::Result::Err(A::Error::duplicate_field(
443                                    "multiple values for input_uri",
444                                ));
445                            }
446                            result.input_uri = map
447                                .next_value::<std::option::Option<std::string::String>>()?
448                                .unwrap_or_default();
449                        }
450                        __FieldTag::__output_uri => {
451                            if !fields.insert(__FieldTag::__output_uri) {
452                                return std::result::Result::Err(A::Error::duplicate_field(
453                                    "multiple values for output_uri",
454                                ));
455                            }
456                            result.output_uri = map
457                                .next_value::<std::option::Option<std::string::String>>()?
458                                .unwrap_or_default();
459                        }
460                        __FieldTag::__template_id => {
461                            if !fields.insert(__FieldTag::__template_id) {
462                                return std::result::Result::Err(A::Error::duplicate_field(
463                                    "multiple values for template_id",
464                                ));
465                            }
466                            if result.job_config.is_some() {
467                                return std::result::Result::Err(A::Error::duplicate_field(
468                                    "multiple values for `job_config`, a oneof with full ID .google.cloud.video.transcoder.v1.Job.template_id, latest field was templateId",
469                                ));
470                            }
471                            result.job_config = std::option::Option::Some(
472                                crate::model::job::JobConfig::TemplateId(
473                                    map.next_value::<std::option::Option<std::string::String>>()?
474                                        .unwrap_or_default(),
475                                ),
476                            );
477                        }
478                        __FieldTag::__config => {
479                            if !fields.insert(__FieldTag::__config) {
480                                return std::result::Result::Err(A::Error::duplicate_field(
481                                    "multiple values for config",
482                                ));
483                            }
484                            if result.job_config.is_some() {
485                                return std::result::Result::Err(A::Error::duplicate_field(
486                                    "multiple values for `job_config`, a oneof with full ID .google.cloud.video.transcoder.v1.Job.config, latest field was config",
487                                ));
488                            }
489                            result.job_config =
490                                std::option::Option::Some(crate::model::job::JobConfig::Config(
491                                    map.next_value::<std::option::Option<
492                                        std::boxed::Box<crate::model::JobConfig>,
493                                    >>()?
494                                    .unwrap_or_default(),
495                                ));
496                        }
497                        __FieldTag::__state => {
498                            if !fields.insert(__FieldTag::__state) {
499                                return std::result::Result::Err(A::Error::duplicate_field(
500                                    "multiple values for state",
501                                ));
502                            }
503                            result.state = map.next_value::<std::option::Option<crate::model::job::ProcessingState>>()?.unwrap_or_default();
504                        }
505                        __FieldTag::__create_time => {
506                            if !fields.insert(__FieldTag::__create_time) {
507                                return std::result::Result::Err(A::Error::duplicate_field(
508                                    "multiple values for create_time",
509                                ));
510                            }
511                            result.create_time =
512                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
513                        }
514                        __FieldTag::__start_time => {
515                            if !fields.insert(__FieldTag::__start_time) {
516                                return std::result::Result::Err(A::Error::duplicate_field(
517                                    "multiple values for start_time",
518                                ));
519                            }
520                            result.start_time =
521                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
522                        }
523                        __FieldTag::__end_time => {
524                            if !fields.insert(__FieldTag::__end_time) {
525                                return std::result::Result::Err(A::Error::duplicate_field(
526                                    "multiple values for end_time",
527                                ));
528                            }
529                            result.end_time =
530                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
531                        }
532                        __FieldTag::__ttl_after_completion_days => {
533                            if !fields.insert(__FieldTag::__ttl_after_completion_days) {
534                                return std::result::Result::Err(A::Error::duplicate_field(
535                                    "multiple values for ttl_after_completion_days",
536                                ));
537                            }
538                            struct __With(std::option::Option<i32>);
539                            impl<'de> serde::de::Deserialize<'de> for __With {
540                                fn deserialize<D>(
541                                    deserializer: D,
542                                ) -> std::result::Result<Self, D::Error>
543                                where
544                                    D: serde::de::Deserializer<'de>,
545                                {
546                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
547                                }
548                            }
549                            result.ttl_after_completion_days =
550                                map.next_value::<__With>()?.0.unwrap_or_default();
551                        }
552                        __FieldTag::__labels => {
553                            if !fields.insert(__FieldTag::__labels) {
554                                return std::result::Result::Err(A::Error::duplicate_field(
555                                    "multiple values for labels",
556                                ));
557                            }
558                            result.labels = map
559                                .next_value::<std::option::Option<
560                                    std::collections::HashMap<
561                                        std::string::String,
562                                        std::string::String,
563                                    >,
564                                >>()?
565                                .unwrap_or_default();
566                        }
567                        __FieldTag::__error => {
568                            if !fields.insert(__FieldTag::__error) {
569                                return std::result::Result::Err(A::Error::duplicate_field(
570                                    "multiple values for error",
571                                ));
572                            }
573                            result.error =
574                                map.next_value::<std::option::Option<rpc::model::Status>>()?;
575                        }
576                        __FieldTag::__mode => {
577                            if !fields.insert(__FieldTag::__mode) {
578                                return std::result::Result::Err(A::Error::duplicate_field(
579                                    "multiple values for mode",
580                                ));
581                            }
582                            result.mode = map.next_value::<std::option::Option<crate::model::job::ProcessingMode>>()?.unwrap_or_default();
583                        }
584                        __FieldTag::__batch_mode_priority => {
585                            if !fields.insert(__FieldTag::__batch_mode_priority) {
586                                return std::result::Result::Err(A::Error::duplicate_field(
587                                    "multiple values for batch_mode_priority",
588                                ));
589                            }
590                            struct __With(std::option::Option<i32>);
591                            impl<'de> serde::de::Deserialize<'de> for __With {
592                                fn deserialize<D>(
593                                    deserializer: D,
594                                ) -> std::result::Result<Self, D::Error>
595                                where
596                                    D: serde::de::Deserializer<'de>,
597                                {
598                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
599                                }
600                            }
601                            result.batch_mode_priority =
602                                map.next_value::<__With>()?.0.unwrap_or_default();
603                        }
604                        __FieldTag::__optimization => {
605                            if !fields.insert(__FieldTag::__optimization) {
606                                return std::result::Result::Err(A::Error::duplicate_field(
607                                    "multiple values for optimization",
608                                ));
609                            }
610                            result.optimization = map.next_value::<std::option::Option<crate::model::job::OptimizationStrategy>>()?.unwrap_or_default();
611                        }
612                        __FieldTag::__fill_content_gaps => {
613                            if !fields.insert(__FieldTag::__fill_content_gaps) {
614                                return std::result::Result::Err(A::Error::duplicate_field(
615                                    "multiple values for fill_content_gaps",
616                                ));
617                            }
618                            result.fill_content_gaps = map
619                                .next_value::<std::option::Option<bool>>()?
620                                .unwrap_or_default();
621                        }
622                        __FieldTag::Unknown(key) => {
623                            let value = map.next_value::<serde_json::Value>()?;
624                            result._unknown_fields.insert(key, value);
625                        }
626                    }
627                }
628                std::result::Result::Ok(result)
629            }
630        }
631        deserializer.deserialize_any(Visitor)
632    }
633}
634
635#[doc(hidden)]
636impl serde::ser::Serialize for Job {
637    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
638    where
639        S: serde::ser::Serializer,
640    {
641        use serde::ser::SerializeMap;
642        #[allow(unused_imports)]
643        use std::option::Option::Some;
644        let mut state = serializer.serialize_map(std::option::Option::None)?;
645        if !self.name.is_empty() {
646            state.serialize_entry("name", &self.name)?;
647        }
648        if !self.input_uri.is_empty() {
649            state.serialize_entry("inputUri", &self.input_uri)?;
650        }
651        if !self.output_uri.is_empty() {
652            state.serialize_entry("outputUri", &self.output_uri)?;
653        }
654        if let Some(value) = self.template_id() {
655            state.serialize_entry("templateId", value)?;
656        }
657        if let Some(value) = self.config() {
658            state.serialize_entry("config", value)?;
659        }
660        if !wkt::internal::is_default(&self.state) {
661            state.serialize_entry("state", &self.state)?;
662        }
663        if self.create_time.is_some() {
664            state.serialize_entry("createTime", &self.create_time)?;
665        }
666        if self.start_time.is_some() {
667            state.serialize_entry("startTime", &self.start_time)?;
668        }
669        if self.end_time.is_some() {
670            state.serialize_entry("endTime", &self.end_time)?;
671        }
672        if !wkt::internal::is_default(&self.ttl_after_completion_days) {
673            struct __With<'a>(&'a i32);
674            impl<'a> serde::ser::Serialize for __With<'a> {
675                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
676                where
677                    S: serde::ser::Serializer,
678                {
679                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
680                }
681            }
682            state.serialize_entry(
683                "ttlAfterCompletionDays",
684                &__With(&self.ttl_after_completion_days),
685            )?;
686        }
687        if !self.labels.is_empty() {
688            state.serialize_entry("labels", &self.labels)?;
689        }
690        if self.error.is_some() {
691            state.serialize_entry("error", &self.error)?;
692        }
693        if !wkt::internal::is_default(&self.mode) {
694            state.serialize_entry("mode", &self.mode)?;
695        }
696        if !wkt::internal::is_default(&self.batch_mode_priority) {
697            struct __With<'a>(&'a i32);
698            impl<'a> serde::ser::Serialize for __With<'a> {
699                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
700                where
701                    S: serde::ser::Serializer,
702                {
703                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
704                }
705            }
706            state.serialize_entry("batchModePriority", &__With(&self.batch_mode_priority))?;
707        }
708        if !wkt::internal::is_default(&self.optimization) {
709            state.serialize_entry("optimization", &self.optimization)?;
710        }
711        if !wkt::internal::is_default(&self.fill_content_gaps) {
712            state.serialize_entry("fillContentGaps", &self.fill_content_gaps)?;
713        }
714        if !self._unknown_fields.is_empty() {
715            for (key, value) in self._unknown_fields.iter() {
716                state.serialize_entry(key, &value)?;
717            }
718        }
719        state.end()
720    }
721}
722
723impl std::fmt::Debug for Job {
724    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
725        let mut debug_struct = f.debug_struct("Job");
726        debug_struct.field("name", &self.name);
727        debug_struct.field("input_uri", &self.input_uri);
728        debug_struct.field("output_uri", &self.output_uri);
729        debug_struct.field("state", &self.state);
730        debug_struct.field("create_time", &self.create_time);
731        debug_struct.field("start_time", &self.start_time);
732        debug_struct.field("end_time", &self.end_time);
733        debug_struct.field("ttl_after_completion_days", &self.ttl_after_completion_days);
734        debug_struct.field("labels", &self.labels);
735        debug_struct.field("error", &self.error);
736        debug_struct.field("mode", &self.mode);
737        debug_struct.field("batch_mode_priority", &self.batch_mode_priority);
738        debug_struct.field("optimization", &self.optimization);
739        debug_struct.field("fill_content_gaps", &self.fill_content_gaps);
740        debug_struct.field("job_config", &self.job_config);
741        if !self._unknown_fields.is_empty() {
742            debug_struct.field("_unknown_fields", &self._unknown_fields);
743        }
744        debug_struct.finish()
745    }
746}
747
748/// Defines additional types related to [Job].
749pub mod job {
750    #[allow(unused_imports)]
751    use super::*;
752
753    /// The current state of the job.
754    ///
755    /// # Working with unknown values
756    ///
757    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
758    /// additional enum variants at any time. Adding new variants is not considered
759    /// a breaking change. Applications should write their code in anticipation of:
760    ///
761    /// - New values appearing in future releases of the client library, **and**
762    /// - New values received dynamically, without application changes.
763    ///
764    /// Please consult the [Working with enums] section in the user guide for some
765    /// guidelines.
766    ///
767    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
768    #[derive(Clone, Debug, PartialEq)]
769    #[non_exhaustive]
770    pub enum ProcessingState {
771        /// The processing state is not specified.
772        Unspecified,
773        /// The job is enqueued and will be picked up for processing soon.
774        Pending,
775        /// The job is being processed.
776        Running,
777        /// The job has been completed successfully.
778        Succeeded,
779        /// The job has failed. For additional information, see
780        /// [Troubleshooting](https://cloud.google.com/transcoder/docs/troubleshooting).
781        Failed,
782        /// If set, the enum was initialized with an unknown value.
783        ///
784        /// Applications can examine the value using [ProcessingState::value] or
785        /// [ProcessingState::name].
786        UnknownValue(processing_state::UnknownValue),
787    }
788
789    #[doc(hidden)]
790    pub mod processing_state {
791        #[allow(unused_imports)]
792        use super::*;
793        #[derive(Clone, Debug, PartialEq)]
794        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
795    }
796
797    impl ProcessingState {
798        /// Gets the enum value.
799        ///
800        /// Returns `None` if the enum contains an unknown value deserialized from
801        /// the string representation of enums.
802        pub fn value(&self) -> std::option::Option<i32> {
803            match self {
804                Self::Unspecified => std::option::Option::Some(0),
805                Self::Pending => std::option::Option::Some(1),
806                Self::Running => std::option::Option::Some(2),
807                Self::Succeeded => std::option::Option::Some(3),
808                Self::Failed => std::option::Option::Some(4),
809                Self::UnknownValue(u) => u.0.value(),
810            }
811        }
812
813        /// Gets the enum value as a string.
814        ///
815        /// Returns `None` if the enum contains an unknown value deserialized from
816        /// the integer representation of enums.
817        pub fn name(&self) -> std::option::Option<&str> {
818            match self {
819                Self::Unspecified => std::option::Option::Some("PROCESSING_STATE_UNSPECIFIED"),
820                Self::Pending => std::option::Option::Some("PENDING"),
821                Self::Running => std::option::Option::Some("RUNNING"),
822                Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
823                Self::Failed => std::option::Option::Some("FAILED"),
824                Self::UnknownValue(u) => u.0.name(),
825            }
826        }
827    }
828
829    impl std::default::Default for ProcessingState {
830        fn default() -> Self {
831            use std::convert::From;
832            Self::from(0)
833        }
834    }
835
836    impl std::fmt::Display for ProcessingState {
837        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
838            wkt::internal::display_enum(f, self.name(), self.value())
839        }
840    }
841
842    impl std::convert::From<i32> for ProcessingState {
843        fn from(value: i32) -> Self {
844            match value {
845                0 => Self::Unspecified,
846                1 => Self::Pending,
847                2 => Self::Running,
848                3 => Self::Succeeded,
849                4 => Self::Failed,
850                _ => Self::UnknownValue(processing_state::UnknownValue(
851                    wkt::internal::UnknownEnumValue::Integer(value),
852                )),
853            }
854        }
855    }
856
857    impl std::convert::From<&str> for ProcessingState {
858        fn from(value: &str) -> Self {
859            use std::string::ToString;
860            match value {
861                "PROCESSING_STATE_UNSPECIFIED" => Self::Unspecified,
862                "PENDING" => Self::Pending,
863                "RUNNING" => Self::Running,
864                "SUCCEEDED" => Self::Succeeded,
865                "FAILED" => Self::Failed,
866                _ => Self::UnknownValue(processing_state::UnknownValue(
867                    wkt::internal::UnknownEnumValue::String(value.to_string()),
868                )),
869            }
870        }
871    }
872
873    impl serde::ser::Serialize for ProcessingState {
874        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
875        where
876            S: serde::Serializer,
877        {
878            match self {
879                Self::Unspecified => serializer.serialize_i32(0),
880                Self::Pending => serializer.serialize_i32(1),
881                Self::Running => serializer.serialize_i32(2),
882                Self::Succeeded => serializer.serialize_i32(3),
883                Self::Failed => serializer.serialize_i32(4),
884                Self::UnknownValue(u) => u.0.serialize(serializer),
885            }
886        }
887    }
888
889    impl<'de> serde::de::Deserialize<'de> for ProcessingState {
890        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
891        where
892            D: serde::Deserializer<'de>,
893        {
894            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProcessingState>::new(
895                ".google.cloud.video.transcoder.v1.Job.ProcessingState",
896            ))
897        }
898    }
899
900    /// The processing mode of the job.
901    ///
902    /// # Working with unknown values
903    ///
904    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
905    /// additional enum variants at any time. Adding new variants is not considered
906    /// a breaking change. Applications should write their code in anticipation of:
907    ///
908    /// - New values appearing in future releases of the client library, **and**
909    /// - New values received dynamically, without application changes.
910    ///
911    /// Please consult the [Working with enums] section in the user guide for some
912    /// guidelines.
913    ///
914    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
915    #[derive(Clone, Debug, PartialEq)]
916    #[non_exhaustive]
917    pub enum ProcessingMode {
918        /// The job processing mode is not specified.
919        Unspecified,
920        /// The job processing mode is interactive mode.
921        /// Interactive job will either be ran or rejected if quota does not allow
922        /// for it.
923        Interactive,
924        /// The job processing mode is batch mode.
925        /// Batch mode allows queuing of jobs.
926        Batch,
927        /// If set, the enum was initialized with an unknown value.
928        ///
929        /// Applications can examine the value using [ProcessingMode::value] or
930        /// [ProcessingMode::name].
931        UnknownValue(processing_mode::UnknownValue),
932    }
933
934    #[doc(hidden)]
935    pub mod processing_mode {
936        #[allow(unused_imports)]
937        use super::*;
938        #[derive(Clone, Debug, PartialEq)]
939        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
940    }
941
942    impl ProcessingMode {
943        /// Gets the enum value.
944        ///
945        /// Returns `None` if the enum contains an unknown value deserialized from
946        /// the string representation of enums.
947        pub fn value(&self) -> std::option::Option<i32> {
948            match self {
949                Self::Unspecified => std::option::Option::Some(0),
950                Self::Interactive => std::option::Option::Some(1),
951                Self::Batch => std::option::Option::Some(2),
952                Self::UnknownValue(u) => u.0.value(),
953            }
954        }
955
956        /// Gets the enum value as a string.
957        ///
958        /// Returns `None` if the enum contains an unknown value deserialized from
959        /// the integer representation of enums.
960        pub fn name(&self) -> std::option::Option<&str> {
961            match self {
962                Self::Unspecified => std::option::Option::Some("PROCESSING_MODE_UNSPECIFIED"),
963                Self::Interactive => std::option::Option::Some("PROCESSING_MODE_INTERACTIVE"),
964                Self::Batch => std::option::Option::Some("PROCESSING_MODE_BATCH"),
965                Self::UnknownValue(u) => u.0.name(),
966            }
967        }
968    }
969
970    impl std::default::Default for ProcessingMode {
971        fn default() -> Self {
972            use std::convert::From;
973            Self::from(0)
974        }
975    }
976
977    impl std::fmt::Display for ProcessingMode {
978        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
979            wkt::internal::display_enum(f, self.name(), self.value())
980        }
981    }
982
983    impl std::convert::From<i32> for ProcessingMode {
984        fn from(value: i32) -> Self {
985            match value {
986                0 => Self::Unspecified,
987                1 => Self::Interactive,
988                2 => Self::Batch,
989                _ => Self::UnknownValue(processing_mode::UnknownValue(
990                    wkt::internal::UnknownEnumValue::Integer(value),
991                )),
992            }
993        }
994    }
995
996    impl std::convert::From<&str> for ProcessingMode {
997        fn from(value: &str) -> Self {
998            use std::string::ToString;
999            match value {
1000                "PROCESSING_MODE_UNSPECIFIED" => Self::Unspecified,
1001                "PROCESSING_MODE_INTERACTIVE" => Self::Interactive,
1002                "PROCESSING_MODE_BATCH" => Self::Batch,
1003                _ => Self::UnknownValue(processing_mode::UnknownValue(
1004                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1005                )),
1006            }
1007        }
1008    }
1009
1010    impl serde::ser::Serialize for ProcessingMode {
1011        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1012        where
1013            S: serde::Serializer,
1014        {
1015            match self {
1016                Self::Unspecified => serializer.serialize_i32(0),
1017                Self::Interactive => serializer.serialize_i32(1),
1018                Self::Batch => serializer.serialize_i32(2),
1019                Self::UnknownValue(u) => u.0.serialize(serializer),
1020            }
1021        }
1022    }
1023
1024    impl<'de> serde::de::Deserialize<'de> for ProcessingMode {
1025        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1026        where
1027            D: serde::Deserializer<'de>,
1028        {
1029            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProcessingMode>::new(
1030                ".google.cloud.video.transcoder.v1.Job.ProcessingMode",
1031            ))
1032        }
1033    }
1034
1035    /// The optimization strategy of the job. The default is `AUTODETECT`.
1036    ///
1037    /// # Working with unknown values
1038    ///
1039    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1040    /// additional enum variants at any time. Adding new variants is not considered
1041    /// a breaking change. Applications should write their code in anticipation of:
1042    ///
1043    /// - New values appearing in future releases of the client library, **and**
1044    /// - New values received dynamically, without application changes.
1045    ///
1046    /// Please consult the [Working with enums] section in the user guide for some
1047    /// guidelines.
1048    ///
1049    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1050    #[derive(Clone, Debug, PartialEq)]
1051    #[non_exhaustive]
1052    pub enum OptimizationStrategy {
1053        /// The optimization strategy is not specified.
1054        Unspecified,
1055        /// Prioritize job processing speed.
1056        Autodetect,
1057        /// Disable all optimizations.
1058        Disabled,
1059        /// If set, the enum was initialized with an unknown value.
1060        ///
1061        /// Applications can examine the value using [OptimizationStrategy::value] or
1062        /// [OptimizationStrategy::name].
1063        UnknownValue(optimization_strategy::UnknownValue),
1064    }
1065
1066    #[doc(hidden)]
1067    pub mod optimization_strategy {
1068        #[allow(unused_imports)]
1069        use super::*;
1070        #[derive(Clone, Debug, PartialEq)]
1071        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1072    }
1073
1074    impl OptimizationStrategy {
1075        /// Gets the enum value.
1076        ///
1077        /// Returns `None` if the enum contains an unknown value deserialized from
1078        /// the string representation of enums.
1079        pub fn value(&self) -> std::option::Option<i32> {
1080            match self {
1081                Self::Unspecified => std::option::Option::Some(0),
1082                Self::Autodetect => std::option::Option::Some(1),
1083                Self::Disabled => std::option::Option::Some(2),
1084                Self::UnknownValue(u) => u.0.value(),
1085            }
1086        }
1087
1088        /// Gets the enum value as a string.
1089        ///
1090        /// Returns `None` if the enum contains an unknown value deserialized from
1091        /// the integer representation of enums.
1092        pub fn name(&self) -> std::option::Option<&str> {
1093            match self {
1094                Self::Unspecified => std::option::Option::Some("OPTIMIZATION_STRATEGY_UNSPECIFIED"),
1095                Self::Autodetect => std::option::Option::Some("AUTODETECT"),
1096                Self::Disabled => std::option::Option::Some("DISABLED"),
1097                Self::UnknownValue(u) => u.0.name(),
1098            }
1099        }
1100    }
1101
1102    impl std::default::Default for OptimizationStrategy {
1103        fn default() -> Self {
1104            use std::convert::From;
1105            Self::from(0)
1106        }
1107    }
1108
1109    impl std::fmt::Display for OptimizationStrategy {
1110        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1111            wkt::internal::display_enum(f, self.name(), self.value())
1112        }
1113    }
1114
1115    impl std::convert::From<i32> for OptimizationStrategy {
1116        fn from(value: i32) -> Self {
1117            match value {
1118                0 => Self::Unspecified,
1119                1 => Self::Autodetect,
1120                2 => Self::Disabled,
1121                _ => Self::UnknownValue(optimization_strategy::UnknownValue(
1122                    wkt::internal::UnknownEnumValue::Integer(value),
1123                )),
1124            }
1125        }
1126    }
1127
1128    impl std::convert::From<&str> for OptimizationStrategy {
1129        fn from(value: &str) -> Self {
1130            use std::string::ToString;
1131            match value {
1132                "OPTIMIZATION_STRATEGY_UNSPECIFIED" => Self::Unspecified,
1133                "AUTODETECT" => Self::Autodetect,
1134                "DISABLED" => Self::Disabled,
1135                _ => Self::UnknownValue(optimization_strategy::UnknownValue(
1136                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1137                )),
1138            }
1139        }
1140    }
1141
1142    impl serde::ser::Serialize for OptimizationStrategy {
1143        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1144        where
1145            S: serde::Serializer,
1146        {
1147            match self {
1148                Self::Unspecified => serializer.serialize_i32(0),
1149                Self::Autodetect => serializer.serialize_i32(1),
1150                Self::Disabled => serializer.serialize_i32(2),
1151                Self::UnknownValue(u) => u.0.serialize(serializer),
1152            }
1153        }
1154    }
1155
1156    impl<'de> serde::de::Deserialize<'de> for OptimizationStrategy {
1157        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1158        where
1159            D: serde::Deserializer<'de>,
1160        {
1161            deserializer.deserialize_any(wkt::internal::EnumVisitor::<OptimizationStrategy>::new(
1162                ".google.cloud.video.transcoder.v1.Job.OptimizationStrategy",
1163            ))
1164        }
1165    }
1166
1167    /// Specify the config for the transcoding job. If you don't specify the
1168    /// `job_config`, the API selects `templateId`; this template ID is set to
1169    /// `preset/web-hd` by default. When you use a `template_id` to create a job,
1170    /// the `Job.config` is populated by the `JobTemplate.config`.\<br\>
1171    #[derive(Clone, Debug, PartialEq)]
1172    #[non_exhaustive]
1173    pub enum JobConfig {
1174        /// Input only. Specify the `template_id` to use for populating `Job.config`.
1175        /// The default is `preset/web-hd`, which is the only supported preset.
1176        ///
1177        /// User defined JobTemplate: `{job_template_id}`
1178        TemplateId(std::string::String),
1179        /// The configuration for this job.
1180        Config(std::boxed::Box<crate::model::JobConfig>),
1181    }
1182}
1183
1184/// Transcoding job template resource.
1185#[derive(Clone, Default, PartialEq)]
1186#[non_exhaustive]
1187pub struct JobTemplate {
1188    /// The resource name of the job template.
1189    /// Format:
1190    /// `projects/{project_number}/locations/{location}/jobTemplates/{job_template}`
1191    pub name: std::string::String,
1192
1193    /// The configuration for this template.
1194    pub config: std::option::Option<crate::model::JobConfig>,
1195
1196    /// The labels associated with this job template. You can use these to organize
1197    /// and group your job templates.
1198    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1199
1200    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1201}
1202
1203impl JobTemplate {
1204    pub fn new() -> Self {
1205        std::default::Default::default()
1206    }
1207
1208    /// Sets the value of [name][crate::model::JobTemplate::name].
1209    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1210        self.name = v.into();
1211        self
1212    }
1213
1214    /// Sets the value of [config][crate::model::JobTemplate::config].
1215    pub fn set_config<T>(mut self, v: T) -> Self
1216    where
1217        T: std::convert::Into<crate::model::JobConfig>,
1218    {
1219        self.config = std::option::Option::Some(v.into());
1220        self
1221    }
1222
1223    /// Sets or clears the value of [config][crate::model::JobTemplate::config].
1224    pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
1225    where
1226        T: std::convert::Into<crate::model::JobConfig>,
1227    {
1228        self.config = v.map(|x| x.into());
1229        self
1230    }
1231
1232    /// Sets the value of [labels][crate::model::JobTemplate::labels].
1233    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1234    where
1235        T: std::iter::IntoIterator<Item = (K, V)>,
1236        K: std::convert::Into<std::string::String>,
1237        V: std::convert::Into<std::string::String>,
1238    {
1239        use std::iter::Iterator;
1240        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1241        self
1242    }
1243}
1244
1245impl wkt::message::Message for JobTemplate {
1246    fn typename() -> &'static str {
1247        "type.googleapis.com/google.cloud.video.transcoder.v1.JobTemplate"
1248    }
1249}
1250
1251#[doc(hidden)]
1252impl<'de> serde::de::Deserialize<'de> for JobTemplate {
1253    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1254    where
1255        D: serde::Deserializer<'de>,
1256    {
1257        #[allow(non_camel_case_types)]
1258        #[doc(hidden)]
1259        #[derive(PartialEq, Eq, Hash)]
1260        enum __FieldTag {
1261            __name,
1262            __config,
1263            __labels,
1264            Unknown(std::string::String),
1265        }
1266        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1267            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1268            where
1269                D: serde::Deserializer<'de>,
1270            {
1271                struct Visitor;
1272                impl<'de> serde::de::Visitor<'de> for Visitor {
1273                    type Value = __FieldTag;
1274                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1275                        formatter.write_str("a field name for JobTemplate")
1276                    }
1277                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1278                    where
1279                        E: serde::de::Error,
1280                    {
1281                        use std::result::Result::Ok;
1282                        use std::string::ToString;
1283                        match value {
1284                            "name" => Ok(__FieldTag::__name),
1285                            "config" => Ok(__FieldTag::__config),
1286                            "labels" => Ok(__FieldTag::__labels),
1287                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1288                        }
1289                    }
1290                }
1291                deserializer.deserialize_identifier(Visitor)
1292            }
1293        }
1294        struct Visitor;
1295        impl<'de> serde::de::Visitor<'de> for Visitor {
1296            type Value = JobTemplate;
1297            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1298                formatter.write_str("struct JobTemplate")
1299            }
1300            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1301            where
1302                A: serde::de::MapAccess<'de>,
1303            {
1304                #[allow(unused_imports)]
1305                use serde::de::Error;
1306                use std::option::Option::Some;
1307                let mut fields = std::collections::HashSet::new();
1308                let mut result = Self::Value::new();
1309                while let Some(tag) = map.next_key::<__FieldTag>()? {
1310                    #[allow(clippy::match_single_binding)]
1311                    match tag {
1312                        __FieldTag::__name => {
1313                            if !fields.insert(__FieldTag::__name) {
1314                                return std::result::Result::Err(A::Error::duplicate_field(
1315                                    "multiple values for name",
1316                                ));
1317                            }
1318                            result.name = map
1319                                .next_value::<std::option::Option<std::string::String>>()?
1320                                .unwrap_or_default();
1321                        }
1322                        __FieldTag::__config => {
1323                            if !fields.insert(__FieldTag::__config) {
1324                                return std::result::Result::Err(A::Error::duplicate_field(
1325                                    "multiple values for config",
1326                                ));
1327                            }
1328                            result.config =
1329                                map.next_value::<std::option::Option<crate::model::JobConfig>>()?;
1330                        }
1331                        __FieldTag::__labels => {
1332                            if !fields.insert(__FieldTag::__labels) {
1333                                return std::result::Result::Err(A::Error::duplicate_field(
1334                                    "multiple values for labels",
1335                                ));
1336                            }
1337                            result.labels = map
1338                                .next_value::<std::option::Option<
1339                                    std::collections::HashMap<
1340                                        std::string::String,
1341                                        std::string::String,
1342                                    >,
1343                                >>()?
1344                                .unwrap_or_default();
1345                        }
1346                        __FieldTag::Unknown(key) => {
1347                            let value = map.next_value::<serde_json::Value>()?;
1348                            result._unknown_fields.insert(key, value);
1349                        }
1350                    }
1351                }
1352                std::result::Result::Ok(result)
1353            }
1354        }
1355        deserializer.deserialize_any(Visitor)
1356    }
1357}
1358
1359#[doc(hidden)]
1360impl serde::ser::Serialize for JobTemplate {
1361    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1362    where
1363        S: serde::ser::Serializer,
1364    {
1365        use serde::ser::SerializeMap;
1366        #[allow(unused_imports)]
1367        use std::option::Option::Some;
1368        let mut state = serializer.serialize_map(std::option::Option::None)?;
1369        if !self.name.is_empty() {
1370            state.serialize_entry("name", &self.name)?;
1371        }
1372        if self.config.is_some() {
1373            state.serialize_entry("config", &self.config)?;
1374        }
1375        if !self.labels.is_empty() {
1376            state.serialize_entry("labels", &self.labels)?;
1377        }
1378        if !self._unknown_fields.is_empty() {
1379            for (key, value) in self._unknown_fields.iter() {
1380                state.serialize_entry(key, &value)?;
1381            }
1382        }
1383        state.end()
1384    }
1385}
1386
1387impl std::fmt::Debug for JobTemplate {
1388    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1389        let mut debug_struct = f.debug_struct("JobTemplate");
1390        debug_struct.field("name", &self.name);
1391        debug_struct.field("config", &self.config);
1392        debug_struct.field("labels", &self.labels);
1393        if !self._unknown_fields.is_empty() {
1394            debug_struct.field("_unknown_fields", &self._unknown_fields);
1395        }
1396        debug_struct.finish()
1397    }
1398}
1399
1400/// Job configuration
1401#[derive(Clone, Default, PartialEq)]
1402#[non_exhaustive]
1403pub struct JobConfig {
1404    /// List of input assets stored in Cloud Storage.
1405    pub inputs: std::vec::Vec<crate::model::Input>,
1406
1407    /// List of edit atoms. Defines the ultimate timeline of the resulting
1408    /// file or manifest.
1409    pub edit_list: std::vec::Vec<crate::model::EditAtom>,
1410
1411    /// List of elementary streams.
1412    pub elementary_streams: std::vec::Vec<crate::model::ElementaryStream>,
1413
1414    /// List of multiplexing settings for output streams.
1415    pub mux_streams: std::vec::Vec<crate::model::MuxStream>,
1416
1417    /// List of output manifests.
1418    pub manifests: std::vec::Vec<crate::model::Manifest>,
1419
1420    /// Output configuration.
1421    pub output: std::option::Option<crate::model::Output>,
1422
1423    /// List of ad breaks. Specifies where to insert ad break tags in the output
1424    /// manifests.
1425    pub ad_breaks: std::vec::Vec<crate::model::AdBreak>,
1426
1427    /// Destination on Pub/Sub.
1428    pub pubsub_destination: std::option::Option<crate::model::PubsubDestination>,
1429
1430    /// List of output sprite sheets.
1431    /// Spritesheets require at least one VideoStream in the Jobconfig.
1432    pub sprite_sheets: std::vec::Vec<crate::model::SpriteSheet>,
1433
1434    /// List of overlays on the output video, in descending Z-order.
1435    pub overlays: std::vec::Vec<crate::model::Overlay>,
1436
1437    /// List of encryption configurations for the content.
1438    /// Each configuration has an ID. Specify this ID in the
1439    /// [MuxStream.encryption_id][google.cloud.video.transcoder.v1.MuxStream.encryption_id]
1440    /// field to indicate the configuration to use for that `MuxStream` output.
1441    ///
1442    /// [google.cloud.video.transcoder.v1.MuxStream.encryption_id]: crate::model::MuxStream::encryption_id
1443    pub encryptions: std::vec::Vec<crate::model::Encryption>,
1444
1445    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1446}
1447
1448impl JobConfig {
1449    pub fn new() -> Self {
1450        std::default::Default::default()
1451    }
1452
1453    /// Sets the value of [inputs][crate::model::JobConfig::inputs].
1454    pub fn set_inputs<T, V>(mut self, v: T) -> Self
1455    where
1456        T: std::iter::IntoIterator<Item = V>,
1457        V: std::convert::Into<crate::model::Input>,
1458    {
1459        use std::iter::Iterator;
1460        self.inputs = v.into_iter().map(|i| i.into()).collect();
1461        self
1462    }
1463
1464    /// Sets the value of [edit_list][crate::model::JobConfig::edit_list].
1465    pub fn set_edit_list<T, V>(mut self, v: T) -> Self
1466    where
1467        T: std::iter::IntoIterator<Item = V>,
1468        V: std::convert::Into<crate::model::EditAtom>,
1469    {
1470        use std::iter::Iterator;
1471        self.edit_list = v.into_iter().map(|i| i.into()).collect();
1472        self
1473    }
1474
1475    /// Sets the value of [elementary_streams][crate::model::JobConfig::elementary_streams].
1476    pub fn set_elementary_streams<T, V>(mut self, v: T) -> Self
1477    where
1478        T: std::iter::IntoIterator<Item = V>,
1479        V: std::convert::Into<crate::model::ElementaryStream>,
1480    {
1481        use std::iter::Iterator;
1482        self.elementary_streams = v.into_iter().map(|i| i.into()).collect();
1483        self
1484    }
1485
1486    /// Sets the value of [mux_streams][crate::model::JobConfig::mux_streams].
1487    pub fn set_mux_streams<T, V>(mut self, v: T) -> Self
1488    where
1489        T: std::iter::IntoIterator<Item = V>,
1490        V: std::convert::Into<crate::model::MuxStream>,
1491    {
1492        use std::iter::Iterator;
1493        self.mux_streams = v.into_iter().map(|i| i.into()).collect();
1494        self
1495    }
1496
1497    /// Sets the value of [manifests][crate::model::JobConfig::manifests].
1498    pub fn set_manifests<T, V>(mut self, v: T) -> Self
1499    where
1500        T: std::iter::IntoIterator<Item = V>,
1501        V: std::convert::Into<crate::model::Manifest>,
1502    {
1503        use std::iter::Iterator;
1504        self.manifests = v.into_iter().map(|i| i.into()).collect();
1505        self
1506    }
1507
1508    /// Sets the value of [output][crate::model::JobConfig::output].
1509    pub fn set_output<T>(mut self, v: T) -> Self
1510    where
1511        T: std::convert::Into<crate::model::Output>,
1512    {
1513        self.output = std::option::Option::Some(v.into());
1514        self
1515    }
1516
1517    /// Sets or clears the value of [output][crate::model::JobConfig::output].
1518    pub fn set_or_clear_output<T>(mut self, v: std::option::Option<T>) -> Self
1519    where
1520        T: std::convert::Into<crate::model::Output>,
1521    {
1522        self.output = v.map(|x| x.into());
1523        self
1524    }
1525
1526    /// Sets the value of [ad_breaks][crate::model::JobConfig::ad_breaks].
1527    pub fn set_ad_breaks<T, V>(mut self, v: T) -> Self
1528    where
1529        T: std::iter::IntoIterator<Item = V>,
1530        V: std::convert::Into<crate::model::AdBreak>,
1531    {
1532        use std::iter::Iterator;
1533        self.ad_breaks = v.into_iter().map(|i| i.into()).collect();
1534        self
1535    }
1536
1537    /// Sets the value of [pubsub_destination][crate::model::JobConfig::pubsub_destination].
1538    pub fn set_pubsub_destination<T>(mut self, v: T) -> Self
1539    where
1540        T: std::convert::Into<crate::model::PubsubDestination>,
1541    {
1542        self.pubsub_destination = std::option::Option::Some(v.into());
1543        self
1544    }
1545
1546    /// Sets or clears the value of [pubsub_destination][crate::model::JobConfig::pubsub_destination].
1547    pub fn set_or_clear_pubsub_destination<T>(mut self, v: std::option::Option<T>) -> Self
1548    where
1549        T: std::convert::Into<crate::model::PubsubDestination>,
1550    {
1551        self.pubsub_destination = v.map(|x| x.into());
1552        self
1553    }
1554
1555    /// Sets the value of [sprite_sheets][crate::model::JobConfig::sprite_sheets].
1556    pub fn set_sprite_sheets<T, V>(mut self, v: T) -> Self
1557    where
1558        T: std::iter::IntoIterator<Item = V>,
1559        V: std::convert::Into<crate::model::SpriteSheet>,
1560    {
1561        use std::iter::Iterator;
1562        self.sprite_sheets = v.into_iter().map(|i| i.into()).collect();
1563        self
1564    }
1565
1566    /// Sets the value of [overlays][crate::model::JobConfig::overlays].
1567    pub fn set_overlays<T, V>(mut self, v: T) -> Self
1568    where
1569        T: std::iter::IntoIterator<Item = V>,
1570        V: std::convert::Into<crate::model::Overlay>,
1571    {
1572        use std::iter::Iterator;
1573        self.overlays = v.into_iter().map(|i| i.into()).collect();
1574        self
1575    }
1576
1577    /// Sets the value of [encryptions][crate::model::JobConfig::encryptions].
1578    pub fn set_encryptions<T, V>(mut self, v: T) -> Self
1579    where
1580        T: std::iter::IntoIterator<Item = V>,
1581        V: std::convert::Into<crate::model::Encryption>,
1582    {
1583        use std::iter::Iterator;
1584        self.encryptions = v.into_iter().map(|i| i.into()).collect();
1585        self
1586    }
1587}
1588
1589impl wkt::message::Message for JobConfig {
1590    fn typename() -> &'static str {
1591        "type.googleapis.com/google.cloud.video.transcoder.v1.JobConfig"
1592    }
1593}
1594
1595#[doc(hidden)]
1596impl<'de> serde::de::Deserialize<'de> for JobConfig {
1597    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1598    where
1599        D: serde::Deserializer<'de>,
1600    {
1601        #[allow(non_camel_case_types)]
1602        #[doc(hidden)]
1603        #[derive(PartialEq, Eq, Hash)]
1604        enum __FieldTag {
1605            __inputs,
1606            __edit_list,
1607            __elementary_streams,
1608            __mux_streams,
1609            __manifests,
1610            __output,
1611            __ad_breaks,
1612            __pubsub_destination,
1613            __sprite_sheets,
1614            __overlays,
1615            __encryptions,
1616            Unknown(std::string::String),
1617        }
1618        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1619            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1620            where
1621                D: serde::Deserializer<'de>,
1622            {
1623                struct Visitor;
1624                impl<'de> serde::de::Visitor<'de> for Visitor {
1625                    type Value = __FieldTag;
1626                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1627                        formatter.write_str("a field name for JobConfig")
1628                    }
1629                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1630                    where
1631                        E: serde::de::Error,
1632                    {
1633                        use std::result::Result::Ok;
1634                        use std::string::ToString;
1635                        match value {
1636                            "inputs" => Ok(__FieldTag::__inputs),
1637                            "editList" => Ok(__FieldTag::__edit_list),
1638                            "edit_list" => Ok(__FieldTag::__edit_list),
1639                            "elementaryStreams" => Ok(__FieldTag::__elementary_streams),
1640                            "elementary_streams" => Ok(__FieldTag::__elementary_streams),
1641                            "muxStreams" => Ok(__FieldTag::__mux_streams),
1642                            "mux_streams" => Ok(__FieldTag::__mux_streams),
1643                            "manifests" => Ok(__FieldTag::__manifests),
1644                            "output" => Ok(__FieldTag::__output),
1645                            "adBreaks" => Ok(__FieldTag::__ad_breaks),
1646                            "ad_breaks" => Ok(__FieldTag::__ad_breaks),
1647                            "pubsubDestination" => Ok(__FieldTag::__pubsub_destination),
1648                            "pubsub_destination" => Ok(__FieldTag::__pubsub_destination),
1649                            "spriteSheets" => Ok(__FieldTag::__sprite_sheets),
1650                            "sprite_sheets" => Ok(__FieldTag::__sprite_sheets),
1651                            "overlays" => Ok(__FieldTag::__overlays),
1652                            "encryptions" => Ok(__FieldTag::__encryptions),
1653                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1654                        }
1655                    }
1656                }
1657                deserializer.deserialize_identifier(Visitor)
1658            }
1659        }
1660        struct Visitor;
1661        impl<'de> serde::de::Visitor<'de> for Visitor {
1662            type Value = JobConfig;
1663            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1664                formatter.write_str("struct JobConfig")
1665            }
1666            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1667            where
1668                A: serde::de::MapAccess<'de>,
1669            {
1670                #[allow(unused_imports)]
1671                use serde::de::Error;
1672                use std::option::Option::Some;
1673                let mut fields = std::collections::HashSet::new();
1674                let mut result = Self::Value::new();
1675                while let Some(tag) = map.next_key::<__FieldTag>()? {
1676                    #[allow(clippy::match_single_binding)]
1677                    match tag {
1678                        __FieldTag::__inputs => {
1679                            if !fields.insert(__FieldTag::__inputs) {
1680                                return std::result::Result::Err(A::Error::duplicate_field(
1681                                    "multiple values for inputs",
1682                                ));
1683                            }
1684                            result.inputs = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Input>>>()?.unwrap_or_default();
1685                        }
1686                        __FieldTag::__edit_list => {
1687                            if !fields.insert(__FieldTag::__edit_list) {
1688                                return std::result::Result::Err(A::Error::duplicate_field(
1689                                    "multiple values for edit_list",
1690                                ));
1691                            }
1692                            result.edit_list = map.next_value::<std::option::Option<std::vec::Vec<crate::model::EditAtom>>>()?.unwrap_or_default();
1693                        }
1694                        __FieldTag::__elementary_streams => {
1695                            if !fields.insert(__FieldTag::__elementary_streams) {
1696                                return std::result::Result::Err(A::Error::duplicate_field(
1697                                    "multiple values for elementary_streams",
1698                                ));
1699                            }
1700                            result.elementary_streams =
1701                                map.next_value::<std::option::Option<
1702                                    std::vec::Vec<crate::model::ElementaryStream>,
1703                                >>()?
1704                                .unwrap_or_default();
1705                        }
1706                        __FieldTag::__mux_streams => {
1707                            if !fields.insert(__FieldTag::__mux_streams) {
1708                                return std::result::Result::Err(A::Error::duplicate_field(
1709                                    "multiple values for mux_streams",
1710                                ));
1711                            }
1712                            result.mux_streams = map.next_value::<std::option::Option<std::vec::Vec<crate::model::MuxStream>>>()?.unwrap_or_default();
1713                        }
1714                        __FieldTag::__manifests => {
1715                            if !fields.insert(__FieldTag::__manifests) {
1716                                return std::result::Result::Err(A::Error::duplicate_field(
1717                                    "multiple values for manifests",
1718                                ));
1719                            }
1720                            result.manifests = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Manifest>>>()?.unwrap_or_default();
1721                        }
1722                        __FieldTag::__output => {
1723                            if !fields.insert(__FieldTag::__output) {
1724                                return std::result::Result::Err(A::Error::duplicate_field(
1725                                    "multiple values for output",
1726                                ));
1727                            }
1728                            result.output =
1729                                map.next_value::<std::option::Option<crate::model::Output>>()?;
1730                        }
1731                        __FieldTag::__ad_breaks => {
1732                            if !fields.insert(__FieldTag::__ad_breaks) {
1733                                return std::result::Result::Err(A::Error::duplicate_field(
1734                                    "multiple values for ad_breaks",
1735                                ));
1736                            }
1737                            result.ad_breaks = map.next_value::<std::option::Option<std::vec::Vec<crate::model::AdBreak>>>()?.unwrap_or_default();
1738                        }
1739                        __FieldTag::__pubsub_destination => {
1740                            if !fields.insert(__FieldTag::__pubsub_destination) {
1741                                return std::result::Result::Err(A::Error::duplicate_field(
1742                                    "multiple values for pubsub_destination",
1743                                ));
1744                            }
1745                            result.pubsub_destination = map
1746                                .next_value::<std::option::Option<crate::model::PubsubDestination>>(
1747                                )?;
1748                        }
1749                        __FieldTag::__sprite_sheets => {
1750                            if !fields.insert(__FieldTag::__sprite_sheets) {
1751                                return std::result::Result::Err(A::Error::duplicate_field(
1752                                    "multiple values for sprite_sheets",
1753                                ));
1754                            }
1755                            result.sprite_sheets = map.next_value::<std::option::Option<std::vec::Vec<crate::model::SpriteSheet>>>()?.unwrap_or_default();
1756                        }
1757                        __FieldTag::__overlays => {
1758                            if !fields.insert(__FieldTag::__overlays) {
1759                                return std::result::Result::Err(A::Error::duplicate_field(
1760                                    "multiple values for overlays",
1761                                ));
1762                            }
1763                            result.overlays = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Overlay>>>()?.unwrap_or_default();
1764                        }
1765                        __FieldTag::__encryptions => {
1766                            if !fields.insert(__FieldTag::__encryptions) {
1767                                return std::result::Result::Err(A::Error::duplicate_field(
1768                                    "multiple values for encryptions",
1769                                ));
1770                            }
1771                            result.encryptions = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Encryption>>>()?.unwrap_or_default();
1772                        }
1773                        __FieldTag::Unknown(key) => {
1774                            let value = map.next_value::<serde_json::Value>()?;
1775                            result._unknown_fields.insert(key, value);
1776                        }
1777                    }
1778                }
1779                std::result::Result::Ok(result)
1780            }
1781        }
1782        deserializer.deserialize_any(Visitor)
1783    }
1784}
1785
1786#[doc(hidden)]
1787impl serde::ser::Serialize for JobConfig {
1788    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1789    where
1790        S: serde::ser::Serializer,
1791    {
1792        use serde::ser::SerializeMap;
1793        #[allow(unused_imports)]
1794        use std::option::Option::Some;
1795        let mut state = serializer.serialize_map(std::option::Option::None)?;
1796        if !self.inputs.is_empty() {
1797            state.serialize_entry("inputs", &self.inputs)?;
1798        }
1799        if !self.edit_list.is_empty() {
1800            state.serialize_entry("editList", &self.edit_list)?;
1801        }
1802        if !self.elementary_streams.is_empty() {
1803            state.serialize_entry("elementaryStreams", &self.elementary_streams)?;
1804        }
1805        if !self.mux_streams.is_empty() {
1806            state.serialize_entry("muxStreams", &self.mux_streams)?;
1807        }
1808        if !self.manifests.is_empty() {
1809            state.serialize_entry("manifests", &self.manifests)?;
1810        }
1811        if self.output.is_some() {
1812            state.serialize_entry("output", &self.output)?;
1813        }
1814        if !self.ad_breaks.is_empty() {
1815            state.serialize_entry("adBreaks", &self.ad_breaks)?;
1816        }
1817        if self.pubsub_destination.is_some() {
1818            state.serialize_entry("pubsubDestination", &self.pubsub_destination)?;
1819        }
1820        if !self.sprite_sheets.is_empty() {
1821            state.serialize_entry("spriteSheets", &self.sprite_sheets)?;
1822        }
1823        if !self.overlays.is_empty() {
1824            state.serialize_entry("overlays", &self.overlays)?;
1825        }
1826        if !self.encryptions.is_empty() {
1827            state.serialize_entry("encryptions", &self.encryptions)?;
1828        }
1829        if !self._unknown_fields.is_empty() {
1830            for (key, value) in self._unknown_fields.iter() {
1831                state.serialize_entry(key, &value)?;
1832            }
1833        }
1834        state.end()
1835    }
1836}
1837
1838impl std::fmt::Debug for JobConfig {
1839    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1840        let mut debug_struct = f.debug_struct("JobConfig");
1841        debug_struct.field("inputs", &self.inputs);
1842        debug_struct.field("edit_list", &self.edit_list);
1843        debug_struct.field("elementary_streams", &self.elementary_streams);
1844        debug_struct.field("mux_streams", &self.mux_streams);
1845        debug_struct.field("manifests", &self.manifests);
1846        debug_struct.field("output", &self.output);
1847        debug_struct.field("ad_breaks", &self.ad_breaks);
1848        debug_struct.field("pubsub_destination", &self.pubsub_destination);
1849        debug_struct.field("sprite_sheets", &self.sprite_sheets);
1850        debug_struct.field("overlays", &self.overlays);
1851        debug_struct.field("encryptions", &self.encryptions);
1852        if !self._unknown_fields.is_empty() {
1853            debug_struct.field("_unknown_fields", &self._unknown_fields);
1854        }
1855        debug_struct.finish()
1856    }
1857}
1858
1859/// Input asset.
1860#[derive(Clone, Default, PartialEq)]
1861#[non_exhaustive]
1862pub struct Input {
1863    /// A unique key for this input. Must be specified when using advanced
1864    /// mapping and edit lists.
1865    pub key: std::string::String,
1866
1867    /// URI of the media. Input files must be at least 5 seconds in duration and
1868    /// stored in Cloud Storage (for example, `gs://bucket/inputs/file.mp4`).
1869    /// If empty, the value is populated from
1870    /// [Job.input_uri][google.cloud.video.transcoder.v1.Job.input_uri]. See
1871    /// [Supported input and output
1872    /// formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats).
1873    ///
1874    /// [google.cloud.video.transcoder.v1.Job.input_uri]: crate::model::Job::input_uri
1875    pub uri: std::string::String,
1876
1877    /// Preprocessing configurations.
1878    pub preprocessing_config: std::option::Option<crate::model::PreprocessingConfig>,
1879
1880    /// Optional. Input Attributes.
1881    pub attributes: std::option::Option<crate::model::InputAttributes>,
1882
1883    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1884}
1885
1886impl Input {
1887    pub fn new() -> Self {
1888        std::default::Default::default()
1889    }
1890
1891    /// Sets the value of [key][crate::model::Input::key].
1892    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1893        self.key = v.into();
1894        self
1895    }
1896
1897    /// Sets the value of [uri][crate::model::Input::uri].
1898    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1899        self.uri = v.into();
1900        self
1901    }
1902
1903    /// Sets the value of [preprocessing_config][crate::model::Input::preprocessing_config].
1904    pub fn set_preprocessing_config<T>(mut self, v: T) -> Self
1905    where
1906        T: std::convert::Into<crate::model::PreprocessingConfig>,
1907    {
1908        self.preprocessing_config = std::option::Option::Some(v.into());
1909        self
1910    }
1911
1912    /// Sets or clears the value of [preprocessing_config][crate::model::Input::preprocessing_config].
1913    pub fn set_or_clear_preprocessing_config<T>(mut self, v: std::option::Option<T>) -> Self
1914    where
1915        T: std::convert::Into<crate::model::PreprocessingConfig>,
1916    {
1917        self.preprocessing_config = v.map(|x| x.into());
1918        self
1919    }
1920
1921    /// Sets the value of [attributes][crate::model::Input::attributes].
1922    pub fn set_attributes<T>(mut self, v: T) -> Self
1923    where
1924        T: std::convert::Into<crate::model::InputAttributes>,
1925    {
1926        self.attributes = std::option::Option::Some(v.into());
1927        self
1928    }
1929
1930    /// Sets or clears the value of [attributes][crate::model::Input::attributes].
1931    pub fn set_or_clear_attributes<T>(mut self, v: std::option::Option<T>) -> Self
1932    where
1933        T: std::convert::Into<crate::model::InputAttributes>,
1934    {
1935        self.attributes = v.map(|x| x.into());
1936        self
1937    }
1938}
1939
1940impl wkt::message::Message for Input {
1941    fn typename() -> &'static str {
1942        "type.googleapis.com/google.cloud.video.transcoder.v1.Input"
1943    }
1944}
1945
1946#[doc(hidden)]
1947impl<'de> serde::de::Deserialize<'de> for Input {
1948    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1949    where
1950        D: serde::Deserializer<'de>,
1951    {
1952        #[allow(non_camel_case_types)]
1953        #[doc(hidden)]
1954        #[derive(PartialEq, Eq, Hash)]
1955        enum __FieldTag {
1956            __key,
1957            __uri,
1958            __preprocessing_config,
1959            __attributes,
1960            Unknown(std::string::String),
1961        }
1962        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1963            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1964            where
1965                D: serde::Deserializer<'de>,
1966            {
1967                struct Visitor;
1968                impl<'de> serde::de::Visitor<'de> for Visitor {
1969                    type Value = __FieldTag;
1970                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1971                        formatter.write_str("a field name for Input")
1972                    }
1973                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1974                    where
1975                        E: serde::de::Error,
1976                    {
1977                        use std::result::Result::Ok;
1978                        use std::string::ToString;
1979                        match value {
1980                            "key" => Ok(__FieldTag::__key),
1981                            "uri" => Ok(__FieldTag::__uri),
1982                            "preprocessingConfig" => Ok(__FieldTag::__preprocessing_config),
1983                            "preprocessing_config" => Ok(__FieldTag::__preprocessing_config),
1984                            "attributes" => Ok(__FieldTag::__attributes),
1985                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1986                        }
1987                    }
1988                }
1989                deserializer.deserialize_identifier(Visitor)
1990            }
1991        }
1992        struct Visitor;
1993        impl<'de> serde::de::Visitor<'de> for Visitor {
1994            type Value = Input;
1995            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1996                formatter.write_str("struct Input")
1997            }
1998            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1999            where
2000                A: serde::de::MapAccess<'de>,
2001            {
2002                #[allow(unused_imports)]
2003                use serde::de::Error;
2004                use std::option::Option::Some;
2005                let mut fields = std::collections::HashSet::new();
2006                let mut result = Self::Value::new();
2007                while let Some(tag) = map.next_key::<__FieldTag>()? {
2008                    #[allow(clippy::match_single_binding)]
2009                    match tag {
2010                        __FieldTag::__key => {
2011                            if !fields.insert(__FieldTag::__key) {
2012                                return std::result::Result::Err(A::Error::duplicate_field(
2013                                    "multiple values for key",
2014                                ));
2015                            }
2016                            result.key = map
2017                                .next_value::<std::option::Option<std::string::String>>()?
2018                                .unwrap_or_default();
2019                        }
2020                        __FieldTag::__uri => {
2021                            if !fields.insert(__FieldTag::__uri) {
2022                                return std::result::Result::Err(A::Error::duplicate_field(
2023                                    "multiple values for uri",
2024                                ));
2025                            }
2026                            result.uri = map
2027                                .next_value::<std::option::Option<std::string::String>>()?
2028                                .unwrap_or_default();
2029                        }
2030                        __FieldTag::__preprocessing_config => {
2031                            if !fields.insert(__FieldTag::__preprocessing_config) {
2032                                return std::result::Result::Err(A::Error::duplicate_field(
2033                                    "multiple values for preprocessing_config",
2034                                ));
2035                            }
2036                            result.preprocessing_config = map.next_value::<std::option::Option<crate::model::PreprocessingConfig>>()?
2037                                ;
2038                        }
2039                        __FieldTag::__attributes => {
2040                            if !fields.insert(__FieldTag::__attributes) {
2041                                return std::result::Result::Err(A::Error::duplicate_field(
2042                                    "multiple values for attributes",
2043                                ));
2044                            }
2045                            result.attributes = map
2046                                .next_value::<std::option::Option<crate::model::InputAttributes>>(
2047                                )?;
2048                        }
2049                        __FieldTag::Unknown(key) => {
2050                            let value = map.next_value::<serde_json::Value>()?;
2051                            result._unknown_fields.insert(key, value);
2052                        }
2053                    }
2054                }
2055                std::result::Result::Ok(result)
2056            }
2057        }
2058        deserializer.deserialize_any(Visitor)
2059    }
2060}
2061
2062#[doc(hidden)]
2063impl serde::ser::Serialize for Input {
2064    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2065    where
2066        S: serde::ser::Serializer,
2067    {
2068        use serde::ser::SerializeMap;
2069        #[allow(unused_imports)]
2070        use std::option::Option::Some;
2071        let mut state = serializer.serialize_map(std::option::Option::None)?;
2072        if !self.key.is_empty() {
2073            state.serialize_entry("key", &self.key)?;
2074        }
2075        if !self.uri.is_empty() {
2076            state.serialize_entry("uri", &self.uri)?;
2077        }
2078        if self.preprocessing_config.is_some() {
2079            state.serialize_entry("preprocessingConfig", &self.preprocessing_config)?;
2080        }
2081        if self.attributes.is_some() {
2082            state.serialize_entry("attributes", &self.attributes)?;
2083        }
2084        if !self._unknown_fields.is_empty() {
2085            for (key, value) in self._unknown_fields.iter() {
2086                state.serialize_entry(key, &value)?;
2087            }
2088        }
2089        state.end()
2090    }
2091}
2092
2093impl std::fmt::Debug for Input {
2094    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2095        let mut debug_struct = f.debug_struct("Input");
2096        debug_struct.field("key", &self.key);
2097        debug_struct.field("uri", &self.uri);
2098        debug_struct.field("preprocessing_config", &self.preprocessing_config);
2099        debug_struct.field("attributes", &self.attributes);
2100        if !self._unknown_fields.is_empty() {
2101            debug_struct.field("_unknown_fields", &self._unknown_fields);
2102        }
2103        debug_struct.finish()
2104    }
2105}
2106
2107/// Location of output file(s) in a Cloud Storage bucket.
2108#[derive(Clone, Default, PartialEq)]
2109#[non_exhaustive]
2110pub struct Output {
2111    /// URI for the output file(s). For example, `gs://my-bucket/outputs/`. Must be
2112    /// a directory and not a top-level bucket. If empty, the value is populated
2113    /// from [Job.output_uri][google.cloud.video.transcoder.v1.Job.output_uri]. See
2114    /// [Supported input and output
2115    /// formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats).
2116    ///
2117    /// [google.cloud.video.transcoder.v1.Job.output_uri]: crate::model::Job::output_uri
2118    pub uri: std::string::String,
2119
2120    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2121}
2122
2123impl Output {
2124    pub fn new() -> Self {
2125        std::default::Default::default()
2126    }
2127
2128    /// Sets the value of [uri][crate::model::Output::uri].
2129    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2130        self.uri = v.into();
2131        self
2132    }
2133}
2134
2135impl wkt::message::Message for Output {
2136    fn typename() -> &'static str {
2137        "type.googleapis.com/google.cloud.video.transcoder.v1.Output"
2138    }
2139}
2140
2141#[doc(hidden)]
2142impl<'de> serde::de::Deserialize<'de> for Output {
2143    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2144    where
2145        D: serde::Deserializer<'de>,
2146    {
2147        #[allow(non_camel_case_types)]
2148        #[doc(hidden)]
2149        #[derive(PartialEq, Eq, Hash)]
2150        enum __FieldTag {
2151            __uri,
2152            Unknown(std::string::String),
2153        }
2154        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2155            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2156            where
2157                D: serde::Deserializer<'de>,
2158            {
2159                struct Visitor;
2160                impl<'de> serde::de::Visitor<'de> for Visitor {
2161                    type Value = __FieldTag;
2162                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2163                        formatter.write_str("a field name for Output")
2164                    }
2165                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2166                    where
2167                        E: serde::de::Error,
2168                    {
2169                        use std::result::Result::Ok;
2170                        use std::string::ToString;
2171                        match value {
2172                            "uri" => Ok(__FieldTag::__uri),
2173                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2174                        }
2175                    }
2176                }
2177                deserializer.deserialize_identifier(Visitor)
2178            }
2179        }
2180        struct Visitor;
2181        impl<'de> serde::de::Visitor<'de> for Visitor {
2182            type Value = Output;
2183            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2184                formatter.write_str("struct Output")
2185            }
2186            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2187            where
2188                A: serde::de::MapAccess<'de>,
2189            {
2190                #[allow(unused_imports)]
2191                use serde::de::Error;
2192                use std::option::Option::Some;
2193                let mut fields = std::collections::HashSet::new();
2194                let mut result = Self::Value::new();
2195                while let Some(tag) = map.next_key::<__FieldTag>()? {
2196                    #[allow(clippy::match_single_binding)]
2197                    match tag {
2198                        __FieldTag::__uri => {
2199                            if !fields.insert(__FieldTag::__uri) {
2200                                return std::result::Result::Err(A::Error::duplicate_field(
2201                                    "multiple values for uri",
2202                                ));
2203                            }
2204                            result.uri = map
2205                                .next_value::<std::option::Option<std::string::String>>()?
2206                                .unwrap_or_default();
2207                        }
2208                        __FieldTag::Unknown(key) => {
2209                            let value = map.next_value::<serde_json::Value>()?;
2210                            result._unknown_fields.insert(key, value);
2211                        }
2212                    }
2213                }
2214                std::result::Result::Ok(result)
2215            }
2216        }
2217        deserializer.deserialize_any(Visitor)
2218    }
2219}
2220
2221#[doc(hidden)]
2222impl serde::ser::Serialize for Output {
2223    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2224    where
2225        S: serde::ser::Serializer,
2226    {
2227        use serde::ser::SerializeMap;
2228        #[allow(unused_imports)]
2229        use std::option::Option::Some;
2230        let mut state = serializer.serialize_map(std::option::Option::None)?;
2231        if !self.uri.is_empty() {
2232            state.serialize_entry("uri", &self.uri)?;
2233        }
2234        if !self._unknown_fields.is_empty() {
2235            for (key, value) in self._unknown_fields.iter() {
2236                state.serialize_entry(key, &value)?;
2237            }
2238        }
2239        state.end()
2240    }
2241}
2242
2243impl std::fmt::Debug for Output {
2244    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2245        let mut debug_struct = f.debug_struct("Output");
2246        debug_struct.field("uri", &self.uri);
2247        if !self._unknown_fields.is_empty() {
2248            debug_struct.field("_unknown_fields", &self._unknown_fields);
2249        }
2250        debug_struct.finish()
2251    }
2252}
2253
2254/// Edit atom.
2255#[derive(Clone, Default, PartialEq)]
2256#[non_exhaustive]
2257pub struct EditAtom {
2258    /// A unique key for this atom. Must be specified when using advanced
2259    /// mapping.
2260    pub key: std::string::String,
2261
2262    /// List of [Input.key][google.cloud.video.transcoder.v1.Input.key] values
2263    /// identifying files that should be used in this atom. The listed `inputs`
2264    /// must have the same timeline.
2265    ///
2266    /// [google.cloud.video.transcoder.v1.Input.key]: crate::model::Input::key
2267    pub inputs: std::vec::Vec<std::string::String>,
2268
2269    /// End time in seconds for the atom, relative to the input file timeline.
2270    /// When `end_time_offset` is not specified, the `inputs` are used until
2271    /// the end of the atom.
2272    pub end_time_offset: std::option::Option<wkt::Duration>,
2273
2274    /// Start time in seconds for the atom, relative to the input file timeline.
2275    /// The default is `0s`.
2276    pub start_time_offset: std::option::Option<wkt::Duration>,
2277
2278    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2279}
2280
2281impl EditAtom {
2282    pub fn new() -> Self {
2283        std::default::Default::default()
2284    }
2285
2286    /// Sets the value of [key][crate::model::EditAtom::key].
2287    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2288        self.key = v.into();
2289        self
2290    }
2291
2292    /// Sets the value of [inputs][crate::model::EditAtom::inputs].
2293    pub fn set_inputs<T, V>(mut self, v: T) -> Self
2294    where
2295        T: std::iter::IntoIterator<Item = V>,
2296        V: std::convert::Into<std::string::String>,
2297    {
2298        use std::iter::Iterator;
2299        self.inputs = v.into_iter().map(|i| i.into()).collect();
2300        self
2301    }
2302
2303    /// Sets the value of [end_time_offset][crate::model::EditAtom::end_time_offset].
2304    pub fn set_end_time_offset<T>(mut self, v: T) -> Self
2305    where
2306        T: std::convert::Into<wkt::Duration>,
2307    {
2308        self.end_time_offset = std::option::Option::Some(v.into());
2309        self
2310    }
2311
2312    /// Sets or clears the value of [end_time_offset][crate::model::EditAtom::end_time_offset].
2313    pub fn set_or_clear_end_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
2314    where
2315        T: std::convert::Into<wkt::Duration>,
2316    {
2317        self.end_time_offset = v.map(|x| x.into());
2318        self
2319    }
2320
2321    /// Sets the value of [start_time_offset][crate::model::EditAtom::start_time_offset].
2322    pub fn set_start_time_offset<T>(mut self, v: T) -> Self
2323    where
2324        T: std::convert::Into<wkt::Duration>,
2325    {
2326        self.start_time_offset = std::option::Option::Some(v.into());
2327        self
2328    }
2329
2330    /// Sets or clears the value of [start_time_offset][crate::model::EditAtom::start_time_offset].
2331    pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
2332    where
2333        T: std::convert::Into<wkt::Duration>,
2334    {
2335        self.start_time_offset = v.map(|x| x.into());
2336        self
2337    }
2338}
2339
2340impl wkt::message::Message for EditAtom {
2341    fn typename() -> &'static str {
2342        "type.googleapis.com/google.cloud.video.transcoder.v1.EditAtom"
2343    }
2344}
2345
2346#[doc(hidden)]
2347impl<'de> serde::de::Deserialize<'de> for EditAtom {
2348    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2349    where
2350        D: serde::Deserializer<'de>,
2351    {
2352        #[allow(non_camel_case_types)]
2353        #[doc(hidden)]
2354        #[derive(PartialEq, Eq, Hash)]
2355        enum __FieldTag {
2356            __key,
2357            __inputs,
2358            __end_time_offset,
2359            __start_time_offset,
2360            Unknown(std::string::String),
2361        }
2362        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2363            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2364            where
2365                D: serde::Deserializer<'de>,
2366            {
2367                struct Visitor;
2368                impl<'de> serde::de::Visitor<'de> for Visitor {
2369                    type Value = __FieldTag;
2370                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2371                        formatter.write_str("a field name for EditAtom")
2372                    }
2373                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2374                    where
2375                        E: serde::de::Error,
2376                    {
2377                        use std::result::Result::Ok;
2378                        use std::string::ToString;
2379                        match value {
2380                            "key" => Ok(__FieldTag::__key),
2381                            "inputs" => Ok(__FieldTag::__inputs),
2382                            "endTimeOffset" => Ok(__FieldTag::__end_time_offset),
2383                            "end_time_offset" => Ok(__FieldTag::__end_time_offset),
2384                            "startTimeOffset" => Ok(__FieldTag::__start_time_offset),
2385                            "start_time_offset" => Ok(__FieldTag::__start_time_offset),
2386                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2387                        }
2388                    }
2389                }
2390                deserializer.deserialize_identifier(Visitor)
2391            }
2392        }
2393        struct Visitor;
2394        impl<'de> serde::de::Visitor<'de> for Visitor {
2395            type Value = EditAtom;
2396            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2397                formatter.write_str("struct EditAtom")
2398            }
2399            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2400            where
2401                A: serde::de::MapAccess<'de>,
2402            {
2403                #[allow(unused_imports)]
2404                use serde::de::Error;
2405                use std::option::Option::Some;
2406                let mut fields = std::collections::HashSet::new();
2407                let mut result = Self::Value::new();
2408                while let Some(tag) = map.next_key::<__FieldTag>()? {
2409                    #[allow(clippy::match_single_binding)]
2410                    match tag {
2411                        __FieldTag::__key => {
2412                            if !fields.insert(__FieldTag::__key) {
2413                                return std::result::Result::Err(A::Error::duplicate_field(
2414                                    "multiple values for key",
2415                                ));
2416                            }
2417                            result.key = map
2418                                .next_value::<std::option::Option<std::string::String>>()?
2419                                .unwrap_or_default();
2420                        }
2421                        __FieldTag::__inputs => {
2422                            if !fields.insert(__FieldTag::__inputs) {
2423                                return std::result::Result::Err(A::Error::duplicate_field(
2424                                    "multiple values for inputs",
2425                                ));
2426                            }
2427                            result.inputs = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
2428                        }
2429                        __FieldTag::__end_time_offset => {
2430                            if !fields.insert(__FieldTag::__end_time_offset) {
2431                                return std::result::Result::Err(A::Error::duplicate_field(
2432                                    "multiple values for end_time_offset",
2433                                ));
2434                            }
2435                            result.end_time_offset =
2436                                map.next_value::<std::option::Option<wkt::Duration>>()?;
2437                        }
2438                        __FieldTag::__start_time_offset => {
2439                            if !fields.insert(__FieldTag::__start_time_offset) {
2440                                return std::result::Result::Err(A::Error::duplicate_field(
2441                                    "multiple values for start_time_offset",
2442                                ));
2443                            }
2444                            result.start_time_offset =
2445                                map.next_value::<std::option::Option<wkt::Duration>>()?;
2446                        }
2447                        __FieldTag::Unknown(key) => {
2448                            let value = map.next_value::<serde_json::Value>()?;
2449                            result._unknown_fields.insert(key, value);
2450                        }
2451                    }
2452                }
2453                std::result::Result::Ok(result)
2454            }
2455        }
2456        deserializer.deserialize_any(Visitor)
2457    }
2458}
2459
2460#[doc(hidden)]
2461impl serde::ser::Serialize for EditAtom {
2462    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2463    where
2464        S: serde::ser::Serializer,
2465    {
2466        use serde::ser::SerializeMap;
2467        #[allow(unused_imports)]
2468        use std::option::Option::Some;
2469        let mut state = serializer.serialize_map(std::option::Option::None)?;
2470        if !self.key.is_empty() {
2471            state.serialize_entry("key", &self.key)?;
2472        }
2473        if !self.inputs.is_empty() {
2474            state.serialize_entry("inputs", &self.inputs)?;
2475        }
2476        if self.end_time_offset.is_some() {
2477            state.serialize_entry("endTimeOffset", &self.end_time_offset)?;
2478        }
2479        if self.start_time_offset.is_some() {
2480            state.serialize_entry("startTimeOffset", &self.start_time_offset)?;
2481        }
2482        if !self._unknown_fields.is_empty() {
2483            for (key, value) in self._unknown_fields.iter() {
2484                state.serialize_entry(key, &value)?;
2485            }
2486        }
2487        state.end()
2488    }
2489}
2490
2491impl std::fmt::Debug for EditAtom {
2492    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2493        let mut debug_struct = f.debug_struct("EditAtom");
2494        debug_struct.field("key", &self.key);
2495        debug_struct.field("inputs", &self.inputs);
2496        debug_struct.field("end_time_offset", &self.end_time_offset);
2497        debug_struct.field("start_time_offset", &self.start_time_offset);
2498        if !self._unknown_fields.is_empty() {
2499            debug_struct.field("_unknown_fields", &self._unknown_fields);
2500        }
2501        debug_struct.finish()
2502    }
2503}
2504
2505/// Ad break.
2506#[derive(Clone, Default, PartialEq)]
2507#[non_exhaustive]
2508pub struct AdBreak {
2509    /// Start time in seconds for the ad break, relative to the output file
2510    /// timeline. The default is `0s`.
2511    pub start_time_offset: std::option::Option<wkt::Duration>,
2512
2513    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2514}
2515
2516impl AdBreak {
2517    pub fn new() -> Self {
2518        std::default::Default::default()
2519    }
2520
2521    /// Sets the value of [start_time_offset][crate::model::AdBreak::start_time_offset].
2522    pub fn set_start_time_offset<T>(mut self, v: T) -> Self
2523    where
2524        T: std::convert::Into<wkt::Duration>,
2525    {
2526        self.start_time_offset = std::option::Option::Some(v.into());
2527        self
2528    }
2529
2530    /// Sets or clears the value of [start_time_offset][crate::model::AdBreak::start_time_offset].
2531    pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
2532    where
2533        T: std::convert::Into<wkt::Duration>,
2534    {
2535        self.start_time_offset = v.map(|x| x.into());
2536        self
2537    }
2538}
2539
2540impl wkt::message::Message for AdBreak {
2541    fn typename() -> &'static str {
2542        "type.googleapis.com/google.cloud.video.transcoder.v1.AdBreak"
2543    }
2544}
2545
2546#[doc(hidden)]
2547impl<'de> serde::de::Deserialize<'de> for AdBreak {
2548    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2549    where
2550        D: serde::Deserializer<'de>,
2551    {
2552        #[allow(non_camel_case_types)]
2553        #[doc(hidden)]
2554        #[derive(PartialEq, Eq, Hash)]
2555        enum __FieldTag {
2556            __start_time_offset,
2557            Unknown(std::string::String),
2558        }
2559        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2560            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2561            where
2562                D: serde::Deserializer<'de>,
2563            {
2564                struct Visitor;
2565                impl<'de> serde::de::Visitor<'de> for Visitor {
2566                    type Value = __FieldTag;
2567                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2568                        formatter.write_str("a field name for AdBreak")
2569                    }
2570                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2571                    where
2572                        E: serde::de::Error,
2573                    {
2574                        use std::result::Result::Ok;
2575                        use std::string::ToString;
2576                        match value {
2577                            "startTimeOffset" => Ok(__FieldTag::__start_time_offset),
2578                            "start_time_offset" => Ok(__FieldTag::__start_time_offset),
2579                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2580                        }
2581                    }
2582                }
2583                deserializer.deserialize_identifier(Visitor)
2584            }
2585        }
2586        struct Visitor;
2587        impl<'de> serde::de::Visitor<'de> for Visitor {
2588            type Value = AdBreak;
2589            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2590                formatter.write_str("struct AdBreak")
2591            }
2592            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2593            where
2594                A: serde::de::MapAccess<'de>,
2595            {
2596                #[allow(unused_imports)]
2597                use serde::de::Error;
2598                use std::option::Option::Some;
2599                let mut fields = std::collections::HashSet::new();
2600                let mut result = Self::Value::new();
2601                while let Some(tag) = map.next_key::<__FieldTag>()? {
2602                    #[allow(clippy::match_single_binding)]
2603                    match tag {
2604                        __FieldTag::__start_time_offset => {
2605                            if !fields.insert(__FieldTag::__start_time_offset) {
2606                                return std::result::Result::Err(A::Error::duplicate_field(
2607                                    "multiple values for start_time_offset",
2608                                ));
2609                            }
2610                            result.start_time_offset =
2611                                map.next_value::<std::option::Option<wkt::Duration>>()?;
2612                        }
2613                        __FieldTag::Unknown(key) => {
2614                            let value = map.next_value::<serde_json::Value>()?;
2615                            result._unknown_fields.insert(key, value);
2616                        }
2617                    }
2618                }
2619                std::result::Result::Ok(result)
2620            }
2621        }
2622        deserializer.deserialize_any(Visitor)
2623    }
2624}
2625
2626#[doc(hidden)]
2627impl serde::ser::Serialize for AdBreak {
2628    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2629    where
2630        S: serde::ser::Serializer,
2631    {
2632        use serde::ser::SerializeMap;
2633        #[allow(unused_imports)]
2634        use std::option::Option::Some;
2635        let mut state = serializer.serialize_map(std::option::Option::None)?;
2636        if self.start_time_offset.is_some() {
2637            state.serialize_entry("startTimeOffset", &self.start_time_offset)?;
2638        }
2639        if !self._unknown_fields.is_empty() {
2640            for (key, value) in self._unknown_fields.iter() {
2641                state.serialize_entry(key, &value)?;
2642            }
2643        }
2644        state.end()
2645    }
2646}
2647
2648impl std::fmt::Debug for AdBreak {
2649    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2650        let mut debug_struct = f.debug_struct("AdBreak");
2651        debug_struct.field("start_time_offset", &self.start_time_offset);
2652        if !self._unknown_fields.is_empty() {
2653            debug_struct.field("_unknown_fields", &self._unknown_fields);
2654        }
2655        debug_struct.finish()
2656    }
2657}
2658
2659/// Encoding of an input file such as an audio, video, or text track.
2660/// Elementary streams must be packaged before
2661/// mapping and sharing between different output formats.
2662#[derive(Clone, Default, PartialEq)]
2663#[non_exhaustive]
2664pub struct ElementaryStream {
2665    /// A unique key for this elementary stream.
2666    pub key: std::string::String,
2667
2668    /// Encoding of an audio, video, or text track.
2669    pub elementary_stream: std::option::Option<crate::model::elementary_stream::ElementaryStream>,
2670
2671    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2672}
2673
2674impl ElementaryStream {
2675    pub fn new() -> Self {
2676        std::default::Default::default()
2677    }
2678
2679    /// Sets the value of [key][crate::model::ElementaryStream::key].
2680    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2681        self.key = v.into();
2682        self
2683    }
2684
2685    /// Sets the value of [elementary_stream][crate::model::ElementaryStream::elementary_stream].
2686    ///
2687    /// Note that all the setters affecting `elementary_stream` are mutually
2688    /// exclusive.
2689    pub fn set_elementary_stream<
2690        T: std::convert::Into<std::option::Option<crate::model::elementary_stream::ElementaryStream>>,
2691    >(
2692        mut self,
2693        v: T,
2694    ) -> Self {
2695        self.elementary_stream = v.into();
2696        self
2697    }
2698
2699    /// The value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
2700    /// if it holds a `VideoStream`, `None` if the field is not set or
2701    /// holds a different branch.
2702    pub fn video_stream(&self) -> std::option::Option<&std::boxed::Box<crate::model::VideoStream>> {
2703        #[allow(unreachable_patterns)]
2704        self.elementary_stream.as_ref().and_then(|v| match v {
2705            crate::model::elementary_stream::ElementaryStream::VideoStream(v) => {
2706                std::option::Option::Some(v)
2707            }
2708            _ => std::option::Option::None,
2709        })
2710    }
2711
2712    /// Sets the value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
2713    /// to hold a `VideoStream`.
2714    ///
2715    /// Note that all the setters affecting `elementary_stream` are
2716    /// mutually exclusive.
2717    pub fn set_video_stream<T: std::convert::Into<std::boxed::Box<crate::model::VideoStream>>>(
2718        mut self,
2719        v: T,
2720    ) -> Self {
2721        self.elementary_stream = std::option::Option::Some(
2722            crate::model::elementary_stream::ElementaryStream::VideoStream(v.into()),
2723        );
2724        self
2725    }
2726
2727    /// The value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
2728    /// if it holds a `AudioStream`, `None` if the field is not set or
2729    /// holds a different branch.
2730    pub fn audio_stream(&self) -> std::option::Option<&std::boxed::Box<crate::model::AudioStream>> {
2731        #[allow(unreachable_patterns)]
2732        self.elementary_stream.as_ref().and_then(|v| match v {
2733            crate::model::elementary_stream::ElementaryStream::AudioStream(v) => {
2734                std::option::Option::Some(v)
2735            }
2736            _ => std::option::Option::None,
2737        })
2738    }
2739
2740    /// Sets the value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
2741    /// to hold a `AudioStream`.
2742    ///
2743    /// Note that all the setters affecting `elementary_stream` are
2744    /// mutually exclusive.
2745    pub fn set_audio_stream<T: std::convert::Into<std::boxed::Box<crate::model::AudioStream>>>(
2746        mut self,
2747        v: T,
2748    ) -> Self {
2749        self.elementary_stream = std::option::Option::Some(
2750            crate::model::elementary_stream::ElementaryStream::AudioStream(v.into()),
2751        );
2752        self
2753    }
2754
2755    /// The value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
2756    /// if it holds a `TextStream`, `None` if the field is not set or
2757    /// holds a different branch.
2758    pub fn text_stream(&self) -> std::option::Option<&std::boxed::Box<crate::model::TextStream>> {
2759        #[allow(unreachable_patterns)]
2760        self.elementary_stream.as_ref().and_then(|v| match v {
2761            crate::model::elementary_stream::ElementaryStream::TextStream(v) => {
2762                std::option::Option::Some(v)
2763            }
2764            _ => std::option::Option::None,
2765        })
2766    }
2767
2768    /// Sets the value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
2769    /// to hold a `TextStream`.
2770    ///
2771    /// Note that all the setters affecting `elementary_stream` are
2772    /// mutually exclusive.
2773    pub fn set_text_stream<T: std::convert::Into<std::boxed::Box<crate::model::TextStream>>>(
2774        mut self,
2775        v: T,
2776    ) -> Self {
2777        self.elementary_stream = std::option::Option::Some(
2778            crate::model::elementary_stream::ElementaryStream::TextStream(v.into()),
2779        );
2780        self
2781    }
2782}
2783
2784impl wkt::message::Message for ElementaryStream {
2785    fn typename() -> &'static str {
2786        "type.googleapis.com/google.cloud.video.transcoder.v1.ElementaryStream"
2787    }
2788}
2789
2790#[doc(hidden)]
2791impl<'de> serde::de::Deserialize<'de> for ElementaryStream {
2792    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2793    where
2794        D: serde::Deserializer<'de>,
2795    {
2796        #[allow(non_camel_case_types)]
2797        #[doc(hidden)]
2798        #[derive(PartialEq, Eq, Hash)]
2799        enum __FieldTag {
2800            __key,
2801            __video_stream,
2802            __audio_stream,
2803            __text_stream,
2804            Unknown(std::string::String),
2805        }
2806        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2807            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2808            where
2809                D: serde::Deserializer<'de>,
2810            {
2811                struct Visitor;
2812                impl<'de> serde::de::Visitor<'de> for Visitor {
2813                    type Value = __FieldTag;
2814                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2815                        formatter.write_str("a field name for ElementaryStream")
2816                    }
2817                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2818                    where
2819                        E: serde::de::Error,
2820                    {
2821                        use std::result::Result::Ok;
2822                        use std::string::ToString;
2823                        match value {
2824                            "key" => Ok(__FieldTag::__key),
2825                            "videoStream" => Ok(__FieldTag::__video_stream),
2826                            "video_stream" => Ok(__FieldTag::__video_stream),
2827                            "audioStream" => Ok(__FieldTag::__audio_stream),
2828                            "audio_stream" => Ok(__FieldTag::__audio_stream),
2829                            "textStream" => Ok(__FieldTag::__text_stream),
2830                            "text_stream" => Ok(__FieldTag::__text_stream),
2831                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2832                        }
2833                    }
2834                }
2835                deserializer.deserialize_identifier(Visitor)
2836            }
2837        }
2838        struct Visitor;
2839        impl<'de> serde::de::Visitor<'de> for Visitor {
2840            type Value = ElementaryStream;
2841            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2842                formatter.write_str("struct ElementaryStream")
2843            }
2844            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2845            where
2846                A: serde::de::MapAccess<'de>,
2847            {
2848                #[allow(unused_imports)]
2849                use serde::de::Error;
2850                use std::option::Option::Some;
2851                let mut fields = std::collections::HashSet::new();
2852                let mut result = Self::Value::new();
2853                while let Some(tag) = map.next_key::<__FieldTag>()? {
2854                    #[allow(clippy::match_single_binding)]
2855                    match tag {
2856                        __FieldTag::__key => {
2857                            if !fields.insert(__FieldTag::__key) {
2858                                return std::result::Result::Err(A::Error::duplicate_field(
2859                                    "multiple values for key",
2860                                ));
2861                            }
2862                            result.key = map
2863                                .next_value::<std::option::Option<std::string::String>>()?
2864                                .unwrap_or_default();
2865                        }
2866                        __FieldTag::__video_stream => {
2867                            if !fields.insert(__FieldTag::__video_stream) {
2868                                return std::result::Result::Err(A::Error::duplicate_field(
2869                                    "multiple values for video_stream",
2870                                ));
2871                            }
2872                            if result.elementary_stream.is_some() {
2873                                return std::result::Result::Err(A::Error::duplicate_field(
2874                                    "multiple values for `elementary_stream`, a oneof with full ID .google.cloud.video.transcoder.v1.ElementaryStream.video_stream, latest field was videoStream",
2875                                ));
2876                            }
2877                            result.elementary_stream = std::option::Option::Some(
2878                                crate::model::elementary_stream::ElementaryStream::VideoStream(
2879                                    map.next_value::<std::option::Option<
2880                                        std::boxed::Box<crate::model::VideoStream>,
2881                                    >>()?
2882                                    .unwrap_or_default(),
2883                                ),
2884                            );
2885                        }
2886                        __FieldTag::__audio_stream => {
2887                            if !fields.insert(__FieldTag::__audio_stream) {
2888                                return std::result::Result::Err(A::Error::duplicate_field(
2889                                    "multiple values for audio_stream",
2890                                ));
2891                            }
2892                            if result.elementary_stream.is_some() {
2893                                return std::result::Result::Err(A::Error::duplicate_field(
2894                                    "multiple values for `elementary_stream`, a oneof with full ID .google.cloud.video.transcoder.v1.ElementaryStream.audio_stream, latest field was audioStream",
2895                                ));
2896                            }
2897                            result.elementary_stream = std::option::Option::Some(
2898                                crate::model::elementary_stream::ElementaryStream::AudioStream(
2899                                    map.next_value::<std::option::Option<
2900                                        std::boxed::Box<crate::model::AudioStream>,
2901                                    >>()?
2902                                    .unwrap_or_default(),
2903                                ),
2904                            );
2905                        }
2906                        __FieldTag::__text_stream => {
2907                            if !fields.insert(__FieldTag::__text_stream) {
2908                                return std::result::Result::Err(A::Error::duplicate_field(
2909                                    "multiple values for text_stream",
2910                                ));
2911                            }
2912                            if result.elementary_stream.is_some() {
2913                                return std::result::Result::Err(A::Error::duplicate_field(
2914                                    "multiple values for `elementary_stream`, a oneof with full ID .google.cloud.video.transcoder.v1.ElementaryStream.text_stream, latest field was textStream",
2915                                ));
2916                            }
2917                            result.elementary_stream = std::option::Option::Some(
2918                                crate::model::elementary_stream::ElementaryStream::TextStream(
2919                                    map.next_value::<std::option::Option<
2920                                        std::boxed::Box<crate::model::TextStream>,
2921                                    >>()?
2922                                    .unwrap_or_default(),
2923                                ),
2924                            );
2925                        }
2926                        __FieldTag::Unknown(key) => {
2927                            let value = map.next_value::<serde_json::Value>()?;
2928                            result._unknown_fields.insert(key, value);
2929                        }
2930                    }
2931                }
2932                std::result::Result::Ok(result)
2933            }
2934        }
2935        deserializer.deserialize_any(Visitor)
2936    }
2937}
2938
2939#[doc(hidden)]
2940impl serde::ser::Serialize for ElementaryStream {
2941    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2942    where
2943        S: serde::ser::Serializer,
2944    {
2945        use serde::ser::SerializeMap;
2946        #[allow(unused_imports)]
2947        use std::option::Option::Some;
2948        let mut state = serializer.serialize_map(std::option::Option::None)?;
2949        if !self.key.is_empty() {
2950            state.serialize_entry("key", &self.key)?;
2951        }
2952        if let Some(value) = self.video_stream() {
2953            state.serialize_entry("videoStream", value)?;
2954        }
2955        if let Some(value) = self.audio_stream() {
2956            state.serialize_entry("audioStream", value)?;
2957        }
2958        if let Some(value) = self.text_stream() {
2959            state.serialize_entry("textStream", value)?;
2960        }
2961        if !self._unknown_fields.is_empty() {
2962            for (key, value) in self._unknown_fields.iter() {
2963                state.serialize_entry(key, &value)?;
2964            }
2965        }
2966        state.end()
2967    }
2968}
2969
2970impl std::fmt::Debug for ElementaryStream {
2971    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2972        let mut debug_struct = f.debug_struct("ElementaryStream");
2973        debug_struct.field("key", &self.key);
2974        debug_struct.field("elementary_stream", &self.elementary_stream);
2975        if !self._unknown_fields.is_empty() {
2976            debug_struct.field("_unknown_fields", &self._unknown_fields);
2977        }
2978        debug_struct.finish()
2979    }
2980}
2981
2982/// Defines additional types related to [ElementaryStream].
2983pub mod elementary_stream {
2984    #[allow(unused_imports)]
2985    use super::*;
2986
2987    /// Encoding of an audio, video, or text track.
2988    #[derive(Clone, Debug, PartialEq)]
2989    #[non_exhaustive]
2990    pub enum ElementaryStream {
2991        /// Encoding of a video stream.
2992        VideoStream(std::boxed::Box<crate::model::VideoStream>),
2993        /// Encoding of an audio stream.
2994        AudioStream(std::boxed::Box<crate::model::AudioStream>),
2995        /// Encoding of a text stream. For example, closed captions or subtitles.
2996        TextStream(std::boxed::Box<crate::model::TextStream>),
2997    }
2998}
2999
3000/// Multiplexing settings for output stream.
3001#[derive(Clone, Default, PartialEq)]
3002#[non_exhaustive]
3003pub struct MuxStream {
3004    /// A unique key for this multiplexed stream.
3005    pub key: std::string::String,
3006
3007    /// The name of the generated file. The default is
3008    /// [MuxStream.key][google.cloud.video.transcoder.v1.MuxStream.key] with the
3009    /// extension suffix corresponding to the
3010    /// [MuxStream.container][google.cloud.video.transcoder.v1.MuxStream.container].
3011    ///
3012    /// Individual segments also have an incremental 10-digit zero-padded suffix
3013    /// starting from 0 before the extension, such as `mux_stream0000000123.ts`.
3014    ///
3015    /// [google.cloud.video.transcoder.v1.MuxStream.container]: crate::model::MuxStream::container
3016    /// [google.cloud.video.transcoder.v1.MuxStream.key]: crate::model::MuxStream::key
3017    pub file_name: std::string::String,
3018
3019    /// The container format. The default is `mp4`
3020    ///
3021    /// Supported streaming formats:
3022    ///
3023    /// - `ts`
3024    /// - `fmp4`- the corresponding file extension is `.m4s`
3025    ///
3026    /// Supported standalone file formats:
3027    ///
3028    /// - `mp4`
3029    /// - `mp3`
3030    /// - `ogg`
3031    /// - `vtt`
3032    ///
3033    /// See also:
3034    /// [Supported input and output
3035    /// formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats)
3036    pub container: std::string::String,
3037
3038    /// List of
3039    /// [ElementaryStream.key][google.cloud.video.transcoder.v1.ElementaryStream.key]
3040    /// values multiplexed in this stream.
3041    ///
3042    /// [google.cloud.video.transcoder.v1.ElementaryStream.key]: crate::model::ElementaryStream::key
3043    pub elementary_streams: std::vec::Vec<std::string::String>,
3044
3045    /// Segment settings for `ts`, `fmp4` and `vtt`.
3046    pub segment_settings: std::option::Option<crate::model::SegmentSettings>,
3047
3048    /// Identifier of the encryption configuration to use. If omitted, output will
3049    /// be unencrypted.
3050    pub encryption_id: std::string::String,
3051
3052    /// Specifies the container configuration.
3053    pub container_config: std::option::Option<crate::model::mux_stream::ContainerConfig>,
3054
3055    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3056}
3057
3058impl MuxStream {
3059    pub fn new() -> Self {
3060        std::default::Default::default()
3061    }
3062
3063    /// Sets the value of [key][crate::model::MuxStream::key].
3064    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3065        self.key = v.into();
3066        self
3067    }
3068
3069    /// Sets the value of [file_name][crate::model::MuxStream::file_name].
3070    pub fn set_file_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3071        self.file_name = v.into();
3072        self
3073    }
3074
3075    /// Sets the value of [container][crate::model::MuxStream::container].
3076    pub fn set_container<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3077        self.container = v.into();
3078        self
3079    }
3080
3081    /// Sets the value of [elementary_streams][crate::model::MuxStream::elementary_streams].
3082    pub fn set_elementary_streams<T, V>(mut self, v: T) -> Self
3083    where
3084        T: std::iter::IntoIterator<Item = V>,
3085        V: std::convert::Into<std::string::String>,
3086    {
3087        use std::iter::Iterator;
3088        self.elementary_streams = v.into_iter().map(|i| i.into()).collect();
3089        self
3090    }
3091
3092    /// Sets the value of [segment_settings][crate::model::MuxStream::segment_settings].
3093    pub fn set_segment_settings<T>(mut self, v: T) -> Self
3094    where
3095        T: std::convert::Into<crate::model::SegmentSettings>,
3096    {
3097        self.segment_settings = std::option::Option::Some(v.into());
3098        self
3099    }
3100
3101    /// Sets or clears the value of [segment_settings][crate::model::MuxStream::segment_settings].
3102    pub fn set_or_clear_segment_settings<T>(mut self, v: std::option::Option<T>) -> Self
3103    where
3104        T: std::convert::Into<crate::model::SegmentSettings>,
3105    {
3106        self.segment_settings = v.map(|x| x.into());
3107        self
3108    }
3109
3110    /// Sets the value of [encryption_id][crate::model::MuxStream::encryption_id].
3111    pub fn set_encryption_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3112        self.encryption_id = v.into();
3113        self
3114    }
3115
3116    /// Sets the value of [container_config][crate::model::MuxStream::container_config].
3117    ///
3118    /// Note that all the setters affecting `container_config` are mutually
3119    /// exclusive.
3120    pub fn set_container_config<
3121        T: std::convert::Into<std::option::Option<crate::model::mux_stream::ContainerConfig>>,
3122    >(
3123        mut self,
3124        v: T,
3125    ) -> Self {
3126        self.container_config = v.into();
3127        self
3128    }
3129
3130    /// The value of [container_config][crate::model::MuxStream::container_config]
3131    /// if it holds a `Fmp4`, `None` if the field is not set or
3132    /// holds a different branch.
3133    pub fn fmp4(
3134        &self,
3135    ) -> std::option::Option<&std::boxed::Box<crate::model::mux_stream::Fmp4Config>> {
3136        #[allow(unreachable_patterns)]
3137        self.container_config.as_ref().and_then(|v| match v {
3138            crate::model::mux_stream::ContainerConfig::Fmp4(v) => std::option::Option::Some(v),
3139            _ => std::option::Option::None,
3140        })
3141    }
3142
3143    /// Sets the value of [container_config][crate::model::MuxStream::container_config]
3144    /// to hold a `Fmp4`.
3145    ///
3146    /// Note that all the setters affecting `container_config` are
3147    /// mutually exclusive.
3148    pub fn set_fmp4<
3149        T: std::convert::Into<std::boxed::Box<crate::model::mux_stream::Fmp4Config>>,
3150    >(
3151        mut self,
3152        v: T,
3153    ) -> Self {
3154        self.container_config =
3155            std::option::Option::Some(crate::model::mux_stream::ContainerConfig::Fmp4(v.into()));
3156        self
3157    }
3158}
3159
3160impl wkt::message::Message for MuxStream {
3161    fn typename() -> &'static str {
3162        "type.googleapis.com/google.cloud.video.transcoder.v1.MuxStream"
3163    }
3164}
3165
3166#[doc(hidden)]
3167impl<'de> serde::de::Deserialize<'de> for MuxStream {
3168    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3169    where
3170        D: serde::Deserializer<'de>,
3171    {
3172        #[allow(non_camel_case_types)]
3173        #[doc(hidden)]
3174        #[derive(PartialEq, Eq, Hash)]
3175        enum __FieldTag {
3176            __key,
3177            __file_name,
3178            __container,
3179            __elementary_streams,
3180            __segment_settings,
3181            __encryption_id,
3182            __fmp4,
3183            Unknown(std::string::String),
3184        }
3185        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3186            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3187            where
3188                D: serde::Deserializer<'de>,
3189            {
3190                struct Visitor;
3191                impl<'de> serde::de::Visitor<'de> for Visitor {
3192                    type Value = __FieldTag;
3193                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3194                        formatter.write_str("a field name for MuxStream")
3195                    }
3196                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3197                    where
3198                        E: serde::de::Error,
3199                    {
3200                        use std::result::Result::Ok;
3201                        use std::string::ToString;
3202                        match value {
3203                            "key" => Ok(__FieldTag::__key),
3204                            "fileName" => Ok(__FieldTag::__file_name),
3205                            "file_name" => Ok(__FieldTag::__file_name),
3206                            "container" => Ok(__FieldTag::__container),
3207                            "elementaryStreams" => Ok(__FieldTag::__elementary_streams),
3208                            "elementary_streams" => Ok(__FieldTag::__elementary_streams),
3209                            "segmentSettings" => Ok(__FieldTag::__segment_settings),
3210                            "segment_settings" => Ok(__FieldTag::__segment_settings),
3211                            "encryptionId" => Ok(__FieldTag::__encryption_id),
3212                            "encryption_id" => Ok(__FieldTag::__encryption_id),
3213                            "fmp4" => Ok(__FieldTag::__fmp4),
3214                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3215                        }
3216                    }
3217                }
3218                deserializer.deserialize_identifier(Visitor)
3219            }
3220        }
3221        struct Visitor;
3222        impl<'de> serde::de::Visitor<'de> for Visitor {
3223            type Value = MuxStream;
3224            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3225                formatter.write_str("struct MuxStream")
3226            }
3227            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3228            where
3229                A: serde::de::MapAccess<'de>,
3230            {
3231                #[allow(unused_imports)]
3232                use serde::de::Error;
3233                use std::option::Option::Some;
3234                let mut fields = std::collections::HashSet::new();
3235                let mut result = Self::Value::new();
3236                while let Some(tag) = map.next_key::<__FieldTag>()? {
3237                    #[allow(clippy::match_single_binding)]
3238                    match tag {
3239                        __FieldTag::__key => {
3240                            if !fields.insert(__FieldTag::__key) {
3241                                return std::result::Result::Err(A::Error::duplicate_field(
3242                                    "multiple values for key",
3243                                ));
3244                            }
3245                            result.key = map
3246                                .next_value::<std::option::Option<std::string::String>>()?
3247                                .unwrap_or_default();
3248                        }
3249                        __FieldTag::__file_name => {
3250                            if !fields.insert(__FieldTag::__file_name) {
3251                                return std::result::Result::Err(A::Error::duplicate_field(
3252                                    "multiple values for file_name",
3253                                ));
3254                            }
3255                            result.file_name = map
3256                                .next_value::<std::option::Option<std::string::String>>()?
3257                                .unwrap_or_default();
3258                        }
3259                        __FieldTag::__container => {
3260                            if !fields.insert(__FieldTag::__container) {
3261                                return std::result::Result::Err(A::Error::duplicate_field(
3262                                    "multiple values for container",
3263                                ));
3264                            }
3265                            result.container = map
3266                                .next_value::<std::option::Option<std::string::String>>()?
3267                                .unwrap_or_default();
3268                        }
3269                        __FieldTag::__elementary_streams => {
3270                            if !fields.insert(__FieldTag::__elementary_streams) {
3271                                return std::result::Result::Err(A::Error::duplicate_field(
3272                                    "multiple values for elementary_streams",
3273                                ));
3274                            }
3275                            result.elementary_streams = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
3276                        }
3277                        __FieldTag::__segment_settings => {
3278                            if !fields.insert(__FieldTag::__segment_settings) {
3279                                return std::result::Result::Err(A::Error::duplicate_field(
3280                                    "multiple values for segment_settings",
3281                                ));
3282                            }
3283                            result.segment_settings = map
3284                                .next_value::<std::option::Option<crate::model::SegmentSettings>>(
3285                                )?;
3286                        }
3287                        __FieldTag::__encryption_id => {
3288                            if !fields.insert(__FieldTag::__encryption_id) {
3289                                return std::result::Result::Err(A::Error::duplicate_field(
3290                                    "multiple values for encryption_id",
3291                                ));
3292                            }
3293                            result.encryption_id = map
3294                                .next_value::<std::option::Option<std::string::String>>()?
3295                                .unwrap_or_default();
3296                        }
3297                        __FieldTag::__fmp4 => {
3298                            if !fields.insert(__FieldTag::__fmp4) {
3299                                return std::result::Result::Err(A::Error::duplicate_field(
3300                                    "multiple values for fmp4",
3301                                ));
3302                            }
3303                            if result.container_config.is_some() {
3304                                return std::result::Result::Err(A::Error::duplicate_field(
3305                                    "multiple values for `container_config`, a oneof with full ID .google.cloud.video.transcoder.v1.MuxStream.fmp4, latest field was fmp4",
3306                                ));
3307                            }
3308                            result.container_config = std::option::Option::Some(
3309                                crate::model::mux_stream::ContainerConfig::Fmp4(
3310                                    map.next_value::<std::option::Option<
3311                                        std::boxed::Box<crate::model::mux_stream::Fmp4Config>,
3312                                    >>()?
3313                                    .unwrap_or_default(),
3314                                ),
3315                            );
3316                        }
3317                        __FieldTag::Unknown(key) => {
3318                            let value = map.next_value::<serde_json::Value>()?;
3319                            result._unknown_fields.insert(key, value);
3320                        }
3321                    }
3322                }
3323                std::result::Result::Ok(result)
3324            }
3325        }
3326        deserializer.deserialize_any(Visitor)
3327    }
3328}
3329
3330#[doc(hidden)]
3331impl serde::ser::Serialize for MuxStream {
3332    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3333    where
3334        S: serde::ser::Serializer,
3335    {
3336        use serde::ser::SerializeMap;
3337        #[allow(unused_imports)]
3338        use std::option::Option::Some;
3339        let mut state = serializer.serialize_map(std::option::Option::None)?;
3340        if !self.key.is_empty() {
3341            state.serialize_entry("key", &self.key)?;
3342        }
3343        if !self.file_name.is_empty() {
3344            state.serialize_entry("fileName", &self.file_name)?;
3345        }
3346        if !self.container.is_empty() {
3347            state.serialize_entry("container", &self.container)?;
3348        }
3349        if !self.elementary_streams.is_empty() {
3350            state.serialize_entry("elementaryStreams", &self.elementary_streams)?;
3351        }
3352        if self.segment_settings.is_some() {
3353            state.serialize_entry("segmentSettings", &self.segment_settings)?;
3354        }
3355        if !self.encryption_id.is_empty() {
3356            state.serialize_entry("encryptionId", &self.encryption_id)?;
3357        }
3358        if let Some(value) = self.fmp4() {
3359            state.serialize_entry("fmp4", value)?;
3360        }
3361        if !self._unknown_fields.is_empty() {
3362            for (key, value) in self._unknown_fields.iter() {
3363                state.serialize_entry(key, &value)?;
3364            }
3365        }
3366        state.end()
3367    }
3368}
3369
3370impl std::fmt::Debug for MuxStream {
3371    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3372        let mut debug_struct = f.debug_struct("MuxStream");
3373        debug_struct.field("key", &self.key);
3374        debug_struct.field("file_name", &self.file_name);
3375        debug_struct.field("container", &self.container);
3376        debug_struct.field("elementary_streams", &self.elementary_streams);
3377        debug_struct.field("segment_settings", &self.segment_settings);
3378        debug_struct.field("encryption_id", &self.encryption_id);
3379        debug_struct.field("container_config", &self.container_config);
3380        if !self._unknown_fields.is_empty() {
3381            debug_struct.field("_unknown_fields", &self._unknown_fields);
3382        }
3383        debug_struct.finish()
3384    }
3385}
3386
3387/// Defines additional types related to [MuxStream].
3388pub mod mux_stream {
3389    #[allow(unused_imports)]
3390    use super::*;
3391
3392    /// `fmp4` container configuration.
3393    #[derive(Clone, Default, PartialEq)]
3394    #[non_exhaustive]
3395    pub struct Fmp4Config {
3396        /// Optional. Specify the codec tag string that will be used in the media
3397        /// bitstream. When not specified, the codec appropriate value is used.
3398        ///
3399        /// Supported H265 codec tags:
3400        ///
3401        /// - `hvc1` (default)
3402        /// - `hev1`
3403        pub codec_tag: std::string::String,
3404
3405        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3406    }
3407
3408    impl Fmp4Config {
3409        pub fn new() -> Self {
3410            std::default::Default::default()
3411        }
3412
3413        /// Sets the value of [codec_tag][crate::model::mux_stream::Fmp4Config::codec_tag].
3414        pub fn set_codec_tag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3415            self.codec_tag = v.into();
3416            self
3417        }
3418    }
3419
3420    impl wkt::message::Message for Fmp4Config {
3421        fn typename() -> &'static str {
3422            "type.googleapis.com/google.cloud.video.transcoder.v1.MuxStream.Fmp4Config"
3423        }
3424    }
3425
3426    #[doc(hidden)]
3427    impl<'de> serde::de::Deserialize<'de> for Fmp4Config {
3428        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3429        where
3430            D: serde::Deserializer<'de>,
3431        {
3432            #[allow(non_camel_case_types)]
3433            #[doc(hidden)]
3434            #[derive(PartialEq, Eq, Hash)]
3435            enum __FieldTag {
3436                __codec_tag,
3437                Unknown(std::string::String),
3438            }
3439            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3440                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3441                where
3442                    D: serde::Deserializer<'de>,
3443                {
3444                    struct Visitor;
3445                    impl<'de> serde::de::Visitor<'de> for Visitor {
3446                        type Value = __FieldTag;
3447                        fn expecting(
3448                            &self,
3449                            formatter: &mut std::fmt::Formatter,
3450                        ) -> std::fmt::Result {
3451                            formatter.write_str("a field name for Fmp4Config")
3452                        }
3453                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3454                        where
3455                            E: serde::de::Error,
3456                        {
3457                            use std::result::Result::Ok;
3458                            use std::string::ToString;
3459                            match value {
3460                                "codecTag" => Ok(__FieldTag::__codec_tag),
3461                                "codec_tag" => Ok(__FieldTag::__codec_tag),
3462                                _ => Ok(__FieldTag::Unknown(value.to_string())),
3463                            }
3464                        }
3465                    }
3466                    deserializer.deserialize_identifier(Visitor)
3467                }
3468            }
3469            struct Visitor;
3470            impl<'de> serde::de::Visitor<'de> for Visitor {
3471                type Value = Fmp4Config;
3472                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3473                    formatter.write_str("struct Fmp4Config")
3474                }
3475                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3476                where
3477                    A: serde::de::MapAccess<'de>,
3478                {
3479                    #[allow(unused_imports)]
3480                    use serde::de::Error;
3481                    use std::option::Option::Some;
3482                    let mut fields = std::collections::HashSet::new();
3483                    let mut result = Self::Value::new();
3484                    while let Some(tag) = map.next_key::<__FieldTag>()? {
3485                        #[allow(clippy::match_single_binding)]
3486                        match tag {
3487                            __FieldTag::__codec_tag => {
3488                                if !fields.insert(__FieldTag::__codec_tag) {
3489                                    return std::result::Result::Err(A::Error::duplicate_field(
3490                                        "multiple values for codec_tag",
3491                                    ));
3492                                }
3493                                result.codec_tag = map
3494                                    .next_value::<std::option::Option<std::string::String>>()?
3495                                    .unwrap_or_default();
3496                            }
3497                            __FieldTag::Unknown(key) => {
3498                                let value = map.next_value::<serde_json::Value>()?;
3499                                result._unknown_fields.insert(key, value);
3500                            }
3501                        }
3502                    }
3503                    std::result::Result::Ok(result)
3504                }
3505            }
3506            deserializer.deserialize_any(Visitor)
3507        }
3508    }
3509
3510    #[doc(hidden)]
3511    impl serde::ser::Serialize for Fmp4Config {
3512        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3513        where
3514            S: serde::ser::Serializer,
3515        {
3516            use serde::ser::SerializeMap;
3517            #[allow(unused_imports)]
3518            use std::option::Option::Some;
3519            let mut state = serializer.serialize_map(std::option::Option::None)?;
3520            if !self.codec_tag.is_empty() {
3521                state.serialize_entry("codecTag", &self.codec_tag)?;
3522            }
3523            if !self._unknown_fields.is_empty() {
3524                for (key, value) in self._unknown_fields.iter() {
3525                    state.serialize_entry(key, &value)?;
3526                }
3527            }
3528            state.end()
3529        }
3530    }
3531
3532    impl std::fmt::Debug for Fmp4Config {
3533        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3534            let mut debug_struct = f.debug_struct("Fmp4Config");
3535            debug_struct.field("codec_tag", &self.codec_tag);
3536            if !self._unknown_fields.is_empty() {
3537                debug_struct.field("_unknown_fields", &self._unknown_fields);
3538            }
3539            debug_struct.finish()
3540        }
3541    }
3542
3543    /// Specifies the container configuration.
3544    #[derive(Clone, Debug, PartialEq)]
3545    #[non_exhaustive]
3546    pub enum ContainerConfig {
3547        /// Optional. `fmp4` container configuration.
3548        Fmp4(std::boxed::Box<crate::model::mux_stream::Fmp4Config>),
3549    }
3550}
3551
3552/// Manifest configuration.
3553#[derive(Clone, Default, PartialEq)]
3554#[non_exhaustive]
3555pub struct Manifest {
3556    /// The name of the generated file. The default is `manifest` with the
3557    /// extension suffix corresponding to the
3558    /// [Manifest.type][google.cloud.video.transcoder.v1.Manifest.type].
3559    ///
3560    /// [google.cloud.video.transcoder.v1.Manifest.type]: crate::model::Manifest::type
3561    pub file_name: std::string::String,
3562
3563    /// Required. Type of the manifest.
3564    pub r#type: crate::model::manifest::ManifestType,
3565
3566    /// Required. List of user supplied
3567    /// [MuxStream.key][google.cloud.video.transcoder.v1.MuxStream.key] values that
3568    /// should appear in this manifest.
3569    ///
3570    /// When [Manifest.type][google.cloud.video.transcoder.v1.Manifest.type] is
3571    /// `HLS`, a media manifest with name
3572    /// [MuxStream.key][google.cloud.video.transcoder.v1.MuxStream.key] and `.m3u8`
3573    /// extension is generated for each element in this list.
3574    ///
3575    /// [google.cloud.video.transcoder.v1.Manifest.type]: crate::model::Manifest::type
3576    /// [google.cloud.video.transcoder.v1.MuxStream.key]: crate::model::MuxStream::key
3577    pub mux_streams: std::vec::Vec<std::string::String>,
3578
3579    /// Specifies the manifest configuration.
3580    pub manifest_config: std::option::Option<crate::model::manifest::ManifestConfig>,
3581
3582    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3583}
3584
3585impl Manifest {
3586    pub fn new() -> Self {
3587        std::default::Default::default()
3588    }
3589
3590    /// Sets the value of [file_name][crate::model::Manifest::file_name].
3591    pub fn set_file_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3592        self.file_name = v.into();
3593        self
3594    }
3595
3596    /// Sets the value of [r#type][crate::model::Manifest::type].
3597    pub fn set_type<T: std::convert::Into<crate::model::manifest::ManifestType>>(
3598        mut self,
3599        v: T,
3600    ) -> Self {
3601        self.r#type = v.into();
3602        self
3603    }
3604
3605    /// Sets the value of [mux_streams][crate::model::Manifest::mux_streams].
3606    pub fn set_mux_streams<T, V>(mut self, v: T) -> Self
3607    where
3608        T: std::iter::IntoIterator<Item = V>,
3609        V: std::convert::Into<std::string::String>,
3610    {
3611        use std::iter::Iterator;
3612        self.mux_streams = v.into_iter().map(|i| i.into()).collect();
3613        self
3614    }
3615
3616    /// Sets the value of [manifest_config][crate::model::Manifest::manifest_config].
3617    ///
3618    /// Note that all the setters affecting `manifest_config` are mutually
3619    /// exclusive.
3620    pub fn set_manifest_config<
3621        T: std::convert::Into<std::option::Option<crate::model::manifest::ManifestConfig>>,
3622    >(
3623        mut self,
3624        v: T,
3625    ) -> Self {
3626        self.manifest_config = v.into();
3627        self
3628    }
3629
3630    /// The value of [manifest_config][crate::model::Manifest::manifest_config]
3631    /// if it holds a `Dash`, `None` if the field is not set or
3632    /// holds a different branch.
3633    pub fn dash(
3634        &self,
3635    ) -> std::option::Option<&std::boxed::Box<crate::model::manifest::DashConfig>> {
3636        #[allow(unreachable_patterns)]
3637        self.manifest_config.as_ref().and_then(|v| match v {
3638            crate::model::manifest::ManifestConfig::Dash(v) => std::option::Option::Some(v),
3639            _ => std::option::Option::None,
3640        })
3641    }
3642
3643    /// Sets the value of [manifest_config][crate::model::Manifest::manifest_config]
3644    /// to hold a `Dash`.
3645    ///
3646    /// Note that all the setters affecting `manifest_config` are
3647    /// mutually exclusive.
3648    pub fn set_dash<T: std::convert::Into<std::boxed::Box<crate::model::manifest::DashConfig>>>(
3649        mut self,
3650        v: T,
3651    ) -> Self {
3652        self.manifest_config =
3653            std::option::Option::Some(crate::model::manifest::ManifestConfig::Dash(v.into()));
3654        self
3655    }
3656}
3657
3658impl wkt::message::Message for Manifest {
3659    fn typename() -> &'static str {
3660        "type.googleapis.com/google.cloud.video.transcoder.v1.Manifest"
3661    }
3662}
3663
3664#[doc(hidden)]
3665impl<'de> serde::de::Deserialize<'de> for Manifest {
3666    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3667    where
3668        D: serde::Deserializer<'de>,
3669    {
3670        #[allow(non_camel_case_types)]
3671        #[doc(hidden)]
3672        #[derive(PartialEq, Eq, Hash)]
3673        enum __FieldTag {
3674            __file_name,
3675            __type,
3676            __mux_streams,
3677            __dash,
3678            Unknown(std::string::String),
3679        }
3680        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3681            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3682            where
3683                D: serde::Deserializer<'de>,
3684            {
3685                struct Visitor;
3686                impl<'de> serde::de::Visitor<'de> for Visitor {
3687                    type Value = __FieldTag;
3688                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3689                        formatter.write_str("a field name for Manifest")
3690                    }
3691                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3692                    where
3693                        E: serde::de::Error,
3694                    {
3695                        use std::result::Result::Ok;
3696                        use std::string::ToString;
3697                        match value {
3698                            "fileName" => Ok(__FieldTag::__file_name),
3699                            "file_name" => Ok(__FieldTag::__file_name),
3700                            "type" => Ok(__FieldTag::__type),
3701                            "muxStreams" => Ok(__FieldTag::__mux_streams),
3702                            "mux_streams" => Ok(__FieldTag::__mux_streams),
3703                            "dash" => Ok(__FieldTag::__dash),
3704                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3705                        }
3706                    }
3707                }
3708                deserializer.deserialize_identifier(Visitor)
3709            }
3710        }
3711        struct Visitor;
3712        impl<'de> serde::de::Visitor<'de> for Visitor {
3713            type Value = Manifest;
3714            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3715                formatter.write_str("struct Manifest")
3716            }
3717            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3718            where
3719                A: serde::de::MapAccess<'de>,
3720            {
3721                #[allow(unused_imports)]
3722                use serde::de::Error;
3723                use std::option::Option::Some;
3724                let mut fields = std::collections::HashSet::new();
3725                let mut result = Self::Value::new();
3726                while let Some(tag) = map.next_key::<__FieldTag>()? {
3727                    #[allow(clippy::match_single_binding)]
3728                    match tag {
3729                        __FieldTag::__file_name => {
3730                            if !fields.insert(__FieldTag::__file_name) {
3731                                return std::result::Result::Err(A::Error::duplicate_field(
3732                                    "multiple values for file_name",
3733                                ));
3734                            }
3735                            result.file_name = map
3736                                .next_value::<std::option::Option<std::string::String>>()?
3737                                .unwrap_or_default();
3738                        }
3739                        __FieldTag::__type => {
3740                            if !fields.insert(__FieldTag::__type) {
3741                                return std::result::Result::Err(A::Error::duplicate_field(
3742                                    "multiple values for type",
3743                                ));
3744                            }
3745                            result.r#type = map.next_value::<std::option::Option<crate::model::manifest::ManifestType>>()?.unwrap_or_default();
3746                        }
3747                        __FieldTag::__mux_streams => {
3748                            if !fields.insert(__FieldTag::__mux_streams) {
3749                                return std::result::Result::Err(A::Error::duplicate_field(
3750                                    "multiple values for mux_streams",
3751                                ));
3752                            }
3753                            result.mux_streams = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
3754                        }
3755                        __FieldTag::__dash => {
3756                            if !fields.insert(__FieldTag::__dash) {
3757                                return std::result::Result::Err(A::Error::duplicate_field(
3758                                    "multiple values for dash",
3759                                ));
3760                            }
3761                            if result.manifest_config.is_some() {
3762                                return std::result::Result::Err(A::Error::duplicate_field(
3763                                    "multiple values for `manifest_config`, a oneof with full ID .google.cloud.video.transcoder.v1.Manifest.dash, latest field was dash",
3764                                ));
3765                            }
3766                            result.manifest_config = std::option::Option::Some(
3767                                crate::model::manifest::ManifestConfig::Dash(
3768                                    map.next_value::<std::option::Option<
3769                                        std::boxed::Box<crate::model::manifest::DashConfig>,
3770                                    >>()?
3771                                    .unwrap_or_default(),
3772                                ),
3773                            );
3774                        }
3775                        __FieldTag::Unknown(key) => {
3776                            let value = map.next_value::<serde_json::Value>()?;
3777                            result._unknown_fields.insert(key, value);
3778                        }
3779                    }
3780                }
3781                std::result::Result::Ok(result)
3782            }
3783        }
3784        deserializer.deserialize_any(Visitor)
3785    }
3786}
3787
3788#[doc(hidden)]
3789impl serde::ser::Serialize for Manifest {
3790    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3791    where
3792        S: serde::ser::Serializer,
3793    {
3794        use serde::ser::SerializeMap;
3795        #[allow(unused_imports)]
3796        use std::option::Option::Some;
3797        let mut state = serializer.serialize_map(std::option::Option::None)?;
3798        if !self.file_name.is_empty() {
3799            state.serialize_entry("fileName", &self.file_name)?;
3800        }
3801        if !wkt::internal::is_default(&self.r#type) {
3802            state.serialize_entry("type", &self.r#type)?;
3803        }
3804        if !self.mux_streams.is_empty() {
3805            state.serialize_entry("muxStreams", &self.mux_streams)?;
3806        }
3807        if let Some(value) = self.dash() {
3808            state.serialize_entry("dash", value)?;
3809        }
3810        if !self._unknown_fields.is_empty() {
3811            for (key, value) in self._unknown_fields.iter() {
3812                state.serialize_entry(key, &value)?;
3813            }
3814        }
3815        state.end()
3816    }
3817}
3818
3819impl std::fmt::Debug for Manifest {
3820    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3821        let mut debug_struct = f.debug_struct("Manifest");
3822        debug_struct.field("file_name", &self.file_name);
3823        debug_struct.field("r#type", &self.r#type);
3824        debug_struct.field("mux_streams", &self.mux_streams);
3825        debug_struct.field("manifest_config", &self.manifest_config);
3826        if !self._unknown_fields.is_empty() {
3827            debug_struct.field("_unknown_fields", &self._unknown_fields);
3828        }
3829        debug_struct.finish()
3830    }
3831}
3832
3833/// Defines additional types related to [Manifest].
3834pub mod manifest {
3835    #[allow(unused_imports)]
3836    use super::*;
3837
3838    /// `DASH` manifest configuration.
3839    #[derive(Clone, Default, PartialEq)]
3840    #[non_exhaustive]
3841    pub struct DashConfig {
3842        /// The segment reference scheme for a `DASH` manifest. The default is
3843        /// `SEGMENT_LIST`.
3844        pub segment_reference_scheme: crate::model::manifest::dash_config::SegmentReferenceScheme,
3845
3846        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3847    }
3848
3849    impl DashConfig {
3850        pub fn new() -> Self {
3851            std::default::Default::default()
3852        }
3853
3854        /// Sets the value of [segment_reference_scheme][crate::model::manifest::DashConfig::segment_reference_scheme].
3855        pub fn set_segment_reference_scheme<
3856            T: std::convert::Into<crate::model::manifest::dash_config::SegmentReferenceScheme>,
3857        >(
3858            mut self,
3859            v: T,
3860        ) -> Self {
3861            self.segment_reference_scheme = v.into();
3862            self
3863        }
3864    }
3865
3866    impl wkt::message::Message for DashConfig {
3867        fn typename() -> &'static str {
3868            "type.googleapis.com/google.cloud.video.transcoder.v1.Manifest.DashConfig"
3869        }
3870    }
3871
3872    #[doc(hidden)]
3873    impl<'de> serde::de::Deserialize<'de> for DashConfig {
3874        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3875        where
3876            D: serde::Deserializer<'de>,
3877        {
3878            #[allow(non_camel_case_types)]
3879            #[doc(hidden)]
3880            #[derive(PartialEq, Eq, Hash)]
3881            enum __FieldTag {
3882                __segment_reference_scheme,
3883                Unknown(std::string::String),
3884            }
3885            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3886                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3887                where
3888                    D: serde::Deserializer<'de>,
3889                {
3890                    struct Visitor;
3891                    impl<'de> serde::de::Visitor<'de> for Visitor {
3892                        type Value = __FieldTag;
3893                        fn expecting(
3894                            &self,
3895                            formatter: &mut std::fmt::Formatter,
3896                        ) -> std::fmt::Result {
3897                            formatter.write_str("a field name for DashConfig")
3898                        }
3899                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3900                        where
3901                            E: serde::de::Error,
3902                        {
3903                            use std::result::Result::Ok;
3904                            use std::string::ToString;
3905                            match value {
3906                                "segmentReferenceScheme" => {
3907                                    Ok(__FieldTag::__segment_reference_scheme)
3908                                }
3909                                "segment_reference_scheme" => {
3910                                    Ok(__FieldTag::__segment_reference_scheme)
3911                                }
3912                                _ => Ok(__FieldTag::Unknown(value.to_string())),
3913                            }
3914                        }
3915                    }
3916                    deserializer.deserialize_identifier(Visitor)
3917                }
3918            }
3919            struct Visitor;
3920            impl<'de> serde::de::Visitor<'de> for Visitor {
3921                type Value = DashConfig;
3922                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3923                    formatter.write_str("struct DashConfig")
3924                }
3925                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3926                where
3927                    A: serde::de::MapAccess<'de>,
3928                {
3929                    #[allow(unused_imports)]
3930                    use serde::de::Error;
3931                    use std::option::Option::Some;
3932                    let mut fields = std::collections::HashSet::new();
3933                    let mut result = Self::Value::new();
3934                    while let Some(tag) = map.next_key::<__FieldTag>()? {
3935                        #[allow(clippy::match_single_binding)]
3936                        match tag {
3937                            __FieldTag::__segment_reference_scheme => {
3938                                if !fields.insert(__FieldTag::__segment_reference_scheme) {
3939                                    return std::result::Result::Err(A::Error::duplicate_field(
3940                                        "multiple values for segment_reference_scheme",
3941                                    ));
3942                                }
3943                                result.segment_reference_scheme = map
3944                                    .next_value::<std::option::Option<
3945                                        crate::model::manifest::dash_config::SegmentReferenceScheme,
3946                                    >>()?
3947                                    .unwrap_or_default();
3948                            }
3949                            __FieldTag::Unknown(key) => {
3950                                let value = map.next_value::<serde_json::Value>()?;
3951                                result._unknown_fields.insert(key, value);
3952                            }
3953                        }
3954                    }
3955                    std::result::Result::Ok(result)
3956                }
3957            }
3958            deserializer.deserialize_any(Visitor)
3959        }
3960    }
3961
3962    #[doc(hidden)]
3963    impl serde::ser::Serialize for DashConfig {
3964        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3965        where
3966            S: serde::ser::Serializer,
3967        {
3968            use serde::ser::SerializeMap;
3969            #[allow(unused_imports)]
3970            use std::option::Option::Some;
3971            let mut state = serializer.serialize_map(std::option::Option::None)?;
3972            if !wkt::internal::is_default(&self.segment_reference_scheme) {
3973                state.serialize_entry("segmentReferenceScheme", &self.segment_reference_scheme)?;
3974            }
3975            if !self._unknown_fields.is_empty() {
3976                for (key, value) in self._unknown_fields.iter() {
3977                    state.serialize_entry(key, &value)?;
3978                }
3979            }
3980            state.end()
3981        }
3982    }
3983
3984    impl std::fmt::Debug for DashConfig {
3985        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3986            let mut debug_struct = f.debug_struct("DashConfig");
3987            debug_struct.field("segment_reference_scheme", &self.segment_reference_scheme);
3988            if !self._unknown_fields.is_empty() {
3989                debug_struct.field("_unknown_fields", &self._unknown_fields);
3990            }
3991            debug_struct.finish()
3992        }
3993    }
3994
3995    /// Defines additional types related to [DashConfig].
3996    pub mod dash_config {
3997        #[allow(unused_imports)]
3998        use super::*;
3999
4000        /// The segment reference scheme for a `DASH` manifest.
4001        ///
4002        /// # Working with unknown values
4003        ///
4004        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4005        /// additional enum variants at any time. Adding new variants is not considered
4006        /// a breaking change. Applications should write their code in anticipation of:
4007        ///
4008        /// - New values appearing in future releases of the client library, **and**
4009        /// - New values received dynamically, without application changes.
4010        ///
4011        /// Please consult the [Working with enums] section in the user guide for some
4012        /// guidelines.
4013        ///
4014        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4015        #[derive(Clone, Debug, PartialEq)]
4016        #[non_exhaustive]
4017        pub enum SegmentReferenceScheme {
4018            /// The segment reference scheme is not specified.
4019            Unspecified,
4020            /// Explicitly lists the URLs of media files for each segment. For example,
4021            /// if
4022            /// [SegmentSettings.individual_segments][google.cloud.video.transcoder.v1.SegmentSettings.individual_segments]
4023            /// is `true`, then the manifest contains fields similar to the following:
4024            ///
4025            /// ```norust
4026            /// <Initialization sourceURL="my-hd-stream-init.m4s"/>
4027            ///   <SegmentList presentationTimeOffset="0" duration="1000"
4028            ///   timescale="10000">
4029            ///     <SegmentURL media="hd-stream0000000000.m4s"/>
4030            ///     <SegmentURL media="hd-stream0000000001.m4s"/>
4031            ///     ...
4032            /// ```
4033            ///
4034            /// [google.cloud.video.transcoder.v1.SegmentSettings.individual_segments]: crate::model::SegmentSettings::individual_segments
4035            SegmentList,
4036            /// [SegmentSettings.individual_segments][google.cloud.video.transcoder.v1.SegmentSettings.individual_segments]
4037            /// must be set to `true` to use this segment reference scheme. Uses the
4038            /// DASH specification
4039            /// `<SegmentTemplate>` tag to determine the URLs of media files for each
4040            /// segment. For example:
4041            ///
4042            /// ```norust
4043            /// <SegmentTemplate presentationTimeOffset="0" timescale="10000"
4044            ///       initialization="my-hd-stream-init.m4s"
4045            ///       media="hd-stream$Number%010d$.m4s" startNumber="0">
4046            ///   ...
4047            /// ```
4048            ///
4049            /// [google.cloud.video.transcoder.v1.SegmentSettings.individual_segments]: crate::model::SegmentSettings::individual_segments
4050            SegmentTemplateNumber,
4051            /// If set, the enum was initialized with an unknown value.
4052            ///
4053            /// Applications can examine the value using [SegmentReferenceScheme::value] or
4054            /// [SegmentReferenceScheme::name].
4055            UnknownValue(segment_reference_scheme::UnknownValue),
4056        }
4057
4058        #[doc(hidden)]
4059        pub mod segment_reference_scheme {
4060            #[allow(unused_imports)]
4061            use super::*;
4062            #[derive(Clone, Debug, PartialEq)]
4063            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4064        }
4065
4066        impl SegmentReferenceScheme {
4067            /// Gets the enum value.
4068            ///
4069            /// Returns `None` if the enum contains an unknown value deserialized from
4070            /// the string representation of enums.
4071            pub fn value(&self) -> std::option::Option<i32> {
4072                match self {
4073                    Self::Unspecified => std::option::Option::Some(0),
4074                    Self::SegmentList => std::option::Option::Some(1),
4075                    Self::SegmentTemplateNumber => std::option::Option::Some(2),
4076                    Self::UnknownValue(u) => u.0.value(),
4077                }
4078            }
4079
4080            /// Gets the enum value as a string.
4081            ///
4082            /// Returns `None` if the enum contains an unknown value deserialized from
4083            /// the integer representation of enums.
4084            pub fn name(&self) -> std::option::Option<&str> {
4085                match self {
4086                    Self::Unspecified => {
4087                        std::option::Option::Some("SEGMENT_REFERENCE_SCHEME_UNSPECIFIED")
4088                    }
4089                    Self::SegmentList => std::option::Option::Some("SEGMENT_LIST"),
4090                    Self::SegmentTemplateNumber => {
4091                        std::option::Option::Some("SEGMENT_TEMPLATE_NUMBER")
4092                    }
4093                    Self::UnknownValue(u) => u.0.name(),
4094                }
4095            }
4096        }
4097
4098        impl std::default::Default for SegmentReferenceScheme {
4099            fn default() -> Self {
4100                use std::convert::From;
4101                Self::from(0)
4102            }
4103        }
4104
4105        impl std::fmt::Display for SegmentReferenceScheme {
4106            fn fmt(
4107                &self,
4108                f: &mut std::fmt::Formatter<'_>,
4109            ) -> std::result::Result<(), std::fmt::Error> {
4110                wkt::internal::display_enum(f, self.name(), self.value())
4111            }
4112        }
4113
4114        impl std::convert::From<i32> for SegmentReferenceScheme {
4115            fn from(value: i32) -> Self {
4116                match value {
4117                    0 => Self::Unspecified,
4118                    1 => Self::SegmentList,
4119                    2 => Self::SegmentTemplateNumber,
4120                    _ => Self::UnknownValue(segment_reference_scheme::UnknownValue(
4121                        wkt::internal::UnknownEnumValue::Integer(value),
4122                    )),
4123                }
4124            }
4125        }
4126
4127        impl std::convert::From<&str> for SegmentReferenceScheme {
4128            fn from(value: &str) -> Self {
4129                use std::string::ToString;
4130                match value {
4131                    "SEGMENT_REFERENCE_SCHEME_UNSPECIFIED" => Self::Unspecified,
4132                    "SEGMENT_LIST" => Self::SegmentList,
4133                    "SEGMENT_TEMPLATE_NUMBER" => Self::SegmentTemplateNumber,
4134                    _ => Self::UnknownValue(segment_reference_scheme::UnknownValue(
4135                        wkt::internal::UnknownEnumValue::String(value.to_string()),
4136                    )),
4137                }
4138            }
4139        }
4140
4141        impl serde::ser::Serialize for SegmentReferenceScheme {
4142            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4143            where
4144                S: serde::Serializer,
4145            {
4146                match self {
4147                    Self::Unspecified => serializer.serialize_i32(0),
4148                    Self::SegmentList => serializer.serialize_i32(1),
4149                    Self::SegmentTemplateNumber => serializer.serialize_i32(2),
4150                    Self::UnknownValue(u) => u.0.serialize(serializer),
4151                }
4152            }
4153        }
4154
4155        impl<'de> serde::de::Deserialize<'de> for SegmentReferenceScheme {
4156            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4157            where
4158                D: serde::Deserializer<'de>,
4159            {
4160                deserializer.deserialize_any(wkt::internal::EnumVisitor::<SegmentReferenceScheme>::new(
4161                    ".google.cloud.video.transcoder.v1.Manifest.DashConfig.SegmentReferenceScheme"))
4162            }
4163        }
4164    }
4165
4166    /// The manifest type, which corresponds to the adaptive streaming format used.
4167    ///
4168    /// # Working with unknown values
4169    ///
4170    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4171    /// additional enum variants at any time. Adding new variants is not considered
4172    /// a breaking change. Applications should write their code in anticipation of:
4173    ///
4174    /// - New values appearing in future releases of the client library, **and**
4175    /// - New values received dynamically, without application changes.
4176    ///
4177    /// Please consult the [Working with enums] section in the user guide for some
4178    /// guidelines.
4179    ///
4180    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4181    #[derive(Clone, Debug, PartialEq)]
4182    #[non_exhaustive]
4183    pub enum ManifestType {
4184        /// The manifest type is not specified.
4185        Unspecified,
4186        /// Create an HLS manifest. The corresponding file extension is `.m3u8`.
4187        Hls,
4188        /// Create an MPEG-DASH manifest. The corresponding file extension is `.mpd`.
4189        Dash,
4190        /// If set, the enum was initialized with an unknown value.
4191        ///
4192        /// Applications can examine the value using [ManifestType::value] or
4193        /// [ManifestType::name].
4194        UnknownValue(manifest_type::UnknownValue),
4195    }
4196
4197    #[doc(hidden)]
4198    pub mod manifest_type {
4199        #[allow(unused_imports)]
4200        use super::*;
4201        #[derive(Clone, Debug, PartialEq)]
4202        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4203    }
4204
4205    impl ManifestType {
4206        /// Gets the enum value.
4207        ///
4208        /// Returns `None` if the enum contains an unknown value deserialized from
4209        /// the string representation of enums.
4210        pub fn value(&self) -> std::option::Option<i32> {
4211            match self {
4212                Self::Unspecified => std::option::Option::Some(0),
4213                Self::Hls => std::option::Option::Some(1),
4214                Self::Dash => std::option::Option::Some(2),
4215                Self::UnknownValue(u) => u.0.value(),
4216            }
4217        }
4218
4219        /// Gets the enum value as a string.
4220        ///
4221        /// Returns `None` if the enum contains an unknown value deserialized from
4222        /// the integer representation of enums.
4223        pub fn name(&self) -> std::option::Option<&str> {
4224            match self {
4225                Self::Unspecified => std::option::Option::Some("MANIFEST_TYPE_UNSPECIFIED"),
4226                Self::Hls => std::option::Option::Some("HLS"),
4227                Self::Dash => std::option::Option::Some("DASH"),
4228                Self::UnknownValue(u) => u.0.name(),
4229            }
4230        }
4231    }
4232
4233    impl std::default::Default for ManifestType {
4234        fn default() -> Self {
4235            use std::convert::From;
4236            Self::from(0)
4237        }
4238    }
4239
4240    impl std::fmt::Display for ManifestType {
4241        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4242            wkt::internal::display_enum(f, self.name(), self.value())
4243        }
4244    }
4245
4246    impl std::convert::From<i32> for ManifestType {
4247        fn from(value: i32) -> Self {
4248            match value {
4249                0 => Self::Unspecified,
4250                1 => Self::Hls,
4251                2 => Self::Dash,
4252                _ => Self::UnknownValue(manifest_type::UnknownValue(
4253                    wkt::internal::UnknownEnumValue::Integer(value),
4254                )),
4255            }
4256        }
4257    }
4258
4259    impl std::convert::From<&str> for ManifestType {
4260        fn from(value: &str) -> Self {
4261            use std::string::ToString;
4262            match value {
4263                "MANIFEST_TYPE_UNSPECIFIED" => Self::Unspecified,
4264                "HLS" => Self::Hls,
4265                "DASH" => Self::Dash,
4266                _ => Self::UnknownValue(manifest_type::UnknownValue(
4267                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4268                )),
4269            }
4270        }
4271    }
4272
4273    impl serde::ser::Serialize for ManifestType {
4274        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4275        where
4276            S: serde::Serializer,
4277        {
4278            match self {
4279                Self::Unspecified => serializer.serialize_i32(0),
4280                Self::Hls => serializer.serialize_i32(1),
4281                Self::Dash => serializer.serialize_i32(2),
4282                Self::UnknownValue(u) => u.0.serialize(serializer),
4283            }
4284        }
4285    }
4286
4287    impl<'de> serde::de::Deserialize<'de> for ManifestType {
4288        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4289        where
4290            D: serde::Deserializer<'de>,
4291        {
4292            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ManifestType>::new(
4293                ".google.cloud.video.transcoder.v1.Manifest.ManifestType",
4294            ))
4295        }
4296    }
4297
4298    /// Specifies the manifest configuration.
4299    #[derive(Clone, Debug, PartialEq)]
4300    #[non_exhaustive]
4301    pub enum ManifestConfig {
4302        /// `DASH` manifest configuration.
4303        Dash(std::boxed::Box<crate::model::manifest::DashConfig>),
4304    }
4305}
4306
4307/// A Pub/Sub destination.
4308#[derive(Clone, Default, PartialEq)]
4309#[non_exhaustive]
4310pub struct PubsubDestination {
4311    /// The name of the Pub/Sub topic to publish job completion notification
4312    /// to. For example: `projects/{project}/topics/{topic}`.
4313    pub topic: std::string::String,
4314
4315    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4316}
4317
4318impl PubsubDestination {
4319    pub fn new() -> Self {
4320        std::default::Default::default()
4321    }
4322
4323    /// Sets the value of [topic][crate::model::PubsubDestination::topic].
4324    pub fn set_topic<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4325        self.topic = v.into();
4326        self
4327    }
4328}
4329
4330impl wkt::message::Message for PubsubDestination {
4331    fn typename() -> &'static str {
4332        "type.googleapis.com/google.cloud.video.transcoder.v1.PubsubDestination"
4333    }
4334}
4335
4336#[doc(hidden)]
4337impl<'de> serde::de::Deserialize<'de> for PubsubDestination {
4338    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4339    where
4340        D: serde::Deserializer<'de>,
4341    {
4342        #[allow(non_camel_case_types)]
4343        #[doc(hidden)]
4344        #[derive(PartialEq, Eq, Hash)]
4345        enum __FieldTag {
4346            __topic,
4347            Unknown(std::string::String),
4348        }
4349        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4350            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4351            where
4352                D: serde::Deserializer<'de>,
4353            {
4354                struct Visitor;
4355                impl<'de> serde::de::Visitor<'de> for Visitor {
4356                    type Value = __FieldTag;
4357                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4358                        formatter.write_str("a field name for PubsubDestination")
4359                    }
4360                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4361                    where
4362                        E: serde::de::Error,
4363                    {
4364                        use std::result::Result::Ok;
4365                        use std::string::ToString;
4366                        match value {
4367                            "topic" => Ok(__FieldTag::__topic),
4368                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4369                        }
4370                    }
4371                }
4372                deserializer.deserialize_identifier(Visitor)
4373            }
4374        }
4375        struct Visitor;
4376        impl<'de> serde::de::Visitor<'de> for Visitor {
4377            type Value = PubsubDestination;
4378            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4379                formatter.write_str("struct PubsubDestination")
4380            }
4381            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4382            where
4383                A: serde::de::MapAccess<'de>,
4384            {
4385                #[allow(unused_imports)]
4386                use serde::de::Error;
4387                use std::option::Option::Some;
4388                let mut fields = std::collections::HashSet::new();
4389                let mut result = Self::Value::new();
4390                while let Some(tag) = map.next_key::<__FieldTag>()? {
4391                    #[allow(clippy::match_single_binding)]
4392                    match tag {
4393                        __FieldTag::__topic => {
4394                            if !fields.insert(__FieldTag::__topic) {
4395                                return std::result::Result::Err(A::Error::duplicate_field(
4396                                    "multiple values for topic",
4397                                ));
4398                            }
4399                            result.topic = map
4400                                .next_value::<std::option::Option<std::string::String>>()?
4401                                .unwrap_or_default();
4402                        }
4403                        __FieldTag::Unknown(key) => {
4404                            let value = map.next_value::<serde_json::Value>()?;
4405                            result._unknown_fields.insert(key, value);
4406                        }
4407                    }
4408                }
4409                std::result::Result::Ok(result)
4410            }
4411        }
4412        deserializer.deserialize_any(Visitor)
4413    }
4414}
4415
4416#[doc(hidden)]
4417impl serde::ser::Serialize for PubsubDestination {
4418    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4419    where
4420        S: serde::ser::Serializer,
4421    {
4422        use serde::ser::SerializeMap;
4423        #[allow(unused_imports)]
4424        use std::option::Option::Some;
4425        let mut state = serializer.serialize_map(std::option::Option::None)?;
4426        if !self.topic.is_empty() {
4427            state.serialize_entry("topic", &self.topic)?;
4428        }
4429        if !self._unknown_fields.is_empty() {
4430            for (key, value) in self._unknown_fields.iter() {
4431                state.serialize_entry(key, &value)?;
4432            }
4433        }
4434        state.end()
4435    }
4436}
4437
4438impl std::fmt::Debug for PubsubDestination {
4439    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4440        let mut debug_struct = f.debug_struct("PubsubDestination");
4441        debug_struct.field("topic", &self.topic);
4442        if !self._unknown_fields.is_empty() {
4443            debug_struct.field("_unknown_fields", &self._unknown_fields);
4444        }
4445        debug_struct.finish()
4446    }
4447}
4448
4449/// Sprite sheet configuration.
4450#[derive(Clone, Default, PartialEq)]
4451#[non_exhaustive]
4452pub struct SpriteSheet {
4453    /// Format type. The default is `jpeg`.
4454    ///
4455    /// Supported formats:
4456    ///
4457    /// - `jpeg`
4458    pub format: std::string::String,
4459
4460    /// Required. File name prefix for the generated sprite sheets.
4461    ///
4462    /// Each sprite sheet has an incremental 10-digit zero-padded suffix starting
4463    /// from 0 before the extension, such as `sprite_sheet0000000123.jpeg`.
4464    pub file_prefix: std::string::String,
4465
4466    /// Required. The width of sprite in pixels. Must be an even integer. To
4467    /// preserve the source aspect ratio, set the
4468    /// [SpriteSheet.sprite_width_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_width_pixels]
4469    /// field or the
4470    /// [SpriteSheet.sprite_height_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_height_pixels]
4471    /// field, but not both (the API will automatically calculate the missing
4472    /// field).
4473    ///
4474    /// For portrait videos that contain horizontal ASR and rotation metadata,
4475    /// provide the width, in pixels, per the horizontal ASR. The API calculates
4476    /// the height per the horizontal ASR. The API detects any rotation metadata
4477    /// and swaps the requested height and width for the output.
4478    ///
4479    /// [google.cloud.video.transcoder.v1.SpriteSheet.sprite_height_pixels]: crate::model::SpriteSheet::sprite_height_pixels
4480    /// [google.cloud.video.transcoder.v1.SpriteSheet.sprite_width_pixels]: crate::model::SpriteSheet::sprite_width_pixels
4481    pub sprite_width_pixels: i32,
4482
4483    /// Required. The height of sprite in pixels. Must be an even integer. To
4484    /// preserve the source aspect ratio, set the
4485    /// [SpriteSheet.sprite_height_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_height_pixels]
4486    /// field or the
4487    /// [SpriteSheet.sprite_width_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_width_pixels]
4488    /// field, but not both (the API will automatically calculate the missing
4489    /// field).
4490    ///
4491    /// For portrait videos that contain horizontal ASR and rotation metadata,
4492    /// provide the height, in pixels, per the horizontal ASR. The API calculates
4493    /// the width per the horizontal ASR. The API detects any rotation metadata
4494    /// and swaps the requested height and width for the output.
4495    ///
4496    /// [google.cloud.video.transcoder.v1.SpriteSheet.sprite_height_pixels]: crate::model::SpriteSheet::sprite_height_pixels
4497    /// [google.cloud.video.transcoder.v1.SpriteSheet.sprite_width_pixels]: crate::model::SpriteSheet::sprite_width_pixels
4498    pub sprite_height_pixels: i32,
4499
4500    /// The maximum number of sprites per row in a sprite sheet. The default is 0,
4501    /// which indicates no maximum limit.
4502    pub column_count: i32,
4503
4504    /// The maximum number of rows per sprite sheet. When the sprite sheet is full,
4505    /// a new sprite sheet is created. The default is 0, which indicates no maximum
4506    /// limit.
4507    pub row_count: i32,
4508
4509    /// Start time in seconds, relative to the output file timeline. Determines the
4510    /// first sprite to pick. The default is `0s`.
4511    pub start_time_offset: std::option::Option<wkt::Duration>,
4512
4513    /// End time in seconds, relative to the output file timeline. When
4514    /// `end_time_offset` is not specified, the sprites are generated until the end
4515    /// of the output file.
4516    pub end_time_offset: std::option::Option<wkt::Duration>,
4517
4518    /// The quality of the generated sprite sheet. Enter a value between 1
4519    /// and 100, where 1 is the lowest quality and 100 is the highest quality.
4520    /// The default is 100. A high quality value corresponds to a low image data
4521    /// compression ratio.
4522    pub quality: i32,
4523
4524    /// Specify either total number of sprites or interval to create sprites.
4525    pub extraction_strategy: std::option::Option<crate::model::sprite_sheet::ExtractionStrategy>,
4526
4527    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4528}
4529
4530impl SpriteSheet {
4531    pub fn new() -> Self {
4532        std::default::Default::default()
4533    }
4534
4535    /// Sets the value of [format][crate::model::SpriteSheet::format].
4536    pub fn set_format<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4537        self.format = v.into();
4538        self
4539    }
4540
4541    /// Sets the value of [file_prefix][crate::model::SpriteSheet::file_prefix].
4542    pub fn set_file_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4543        self.file_prefix = v.into();
4544        self
4545    }
4546
4547    /// Sets the value of [sprite_width_pixels][crate::model::SpriteSheet::sprite_width_pixels].
4548    pub fn set_sprite_width_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4549        self.sprite_width_pixels = v.into();
4550        self
4551    }
4552
4553    /// Sets the value of [sprite_height_pixels][crate::model::SpriteSheet::sprite_height_pixels].
4554    pub fn set_sprite_height_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4555        self.sprite_height_pixels = v.into();
4556        self
4557    }
4558
4559    /// Sets the value of [column_count][crate::model::SpriteSheet::column_count].
4560    pub fn set_column_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4561        self.column_count = v.into();
4562        self
4563    }
4564
4565    /// Sets the value of [row_count][crate::model::SpriteSheet::row_count].
4566    pub fn set_row_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4567        self.row_count = v.into();
4568        self
4569    }
4570
4571    /// Sets the value of [start_time_offset][crate::model::SpriteSheet::start_time_offset].
4572    pub fn set_start_time_offset<T>(mut self, v: T) -> Self
4573    where
4574        T: std::convert::Into<wkt::Duration>,
4575    {
4576        self.start_time_offset = std::option::Option::Some(v.into());
4577        self
4578    }
4579
4580    /// Sets or clears the value of [start_time_offset][crate::model::SpriteSheet::start_time_offset].
4581    pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
4582    where
4583        T: std::convert::Into<wkt::Duration>,
4584    {
4585        self.start_time_offset = v.map(|x| x.into());
4586        self
4587    }
4588
4589    /// Sets the value of [end_time_offset][crate::model::SpriteSheet::end_time_offset].
4590    pub fn set_end_time_offset<T>(mut self, v: T) -> Self
4591    where
4592        T: std::convert::Into<wkt::Duration>,
4593    {
4594        self.end_time_offset = std::option::Option::Some(v.into());
4595        self
4596    }
4597
4598    /// Sets or clears the value of [end_time_offset][crate::model::SpriteSheet::end_time_offset].
4599    pub fn set_or_clear_end_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
4600    where
4601        T: std::convert::Into<wkt::Duration>,
4602    {
4603        self.end_time_offset = v.map(|x| x.into());
4604        self
4605    }
4606
4607    /// Sets the value of [quality][crate::model::SpriteSheet::quality].
4608    pub fn set_quality<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4609        self.quality = v.into();
4610        self
4611    }
4612
4613    /// Sets the value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy].
4614    ///
4615    /// Note that all the setters affecting `extraction_strategy` are mutually
4616    /// exclusive.
4617    pub fn set_extraction_strategy<
4618        T: std::convert::Into<std::option::Option<crate::model::sprite_sheet::ExtractionStrategy>>,
4619    >(
4620        mut self,
4621        v: T,
4622    ) -> Self {
4623        self.extraction_strategy = v.into();
4624        self
4625    }
4626
4627    /// The value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy]
4628    /// if it holds a `TotalCount`, `None` if the field is not set or
4629    /// holds a different branch.
4630    pub fn total_count(&self) -> std::option::Option<&i32> {
4631        #[allow(unreachable_patterns)]
4632        self.extraction_strategy.as_ref().and_then(|v| match v {
4633            crate::model::sprite_sheet::ExtractionStrategy::TotalCount(v) => {
4634                std::option::Option::Some(v)
4635            }
4636            _ => std::option::Option::None,
4637        })
4638    }
4639
4640    /// Sets the value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy]
4641    /// to hold a `TotalCount`.
4642    ///
4643    /// Note that all the setters affecting `extraction_strategy` are
4644    /// mutually exclusive.
4645    pub fn set_total_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4646        self.extraction_strategy = std::option::Option::Some(
4647            crate::model::sprite_sheet::ExtractionStrategy::TotalCount(v.into()),
4648        );
4649        self
4650    }
4651
4652    /// The value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy]
4653    /// if it holds a `Interval`, `None` if the field is not set or
4654    /// holds a different branch.
4655    pub fn interval(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
4656        #[allow(unreachable_patterns)]
4657        self.extraction_strategy.as_ref().and_then(|v| match v {
4658            crate::model::sprite_sheet::ExtractionStrategy::Interval(v) => {
4659                std::option::Option::Some(v)
4660            }
4661            _ => std::option::Option::None,
4662        })
4663    }
4664
4665    /// Sets the value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy]
4666    /// to hold a `Interval`.
4667    ///
4668    /// Note that all the setters affecting `extraction_strategy` are
4669    /// mutually exclusive.
4670    pub fn set_interval<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
4671        mut self,
4672        v: T,
4673    ) -> Self {
4674        self.extraction_strategy = std::option::Option::Some(
4675            crate::model::sprite_sheet::ExtractionStrategy::Interval(v.into()),
4676        );
4677        self
4678    }
4679}
4680
4681impl wkt::message::Message for SpriteSheet {
4682    fn typename() -> &'static str {
4683        "type.googleapis.com/google.cloud.video.transcoder.v1.SpriteSheet"
4684    }
4685}
4686
4687#[doc(hidden)]
4688impl<'de> serde::de::Deserialize<'de> for SpriteSheet {
4689    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4690    where
4691        D: serde::Deserializer<'de>,
4692    {
4693        #[allow(non_camel_case_types)]
4694        #[doc(hidden)]
4695        #[derive(PartialEq, Eq, Hash)]
4696        enum __FieldTag {
4697            __format,
4698            __file_prefix,
4699            __sprite_width_pixels,
4700            __sprite_height_pixels,
4701            __column_count,
4702            __row_count,
4703            __start_time_offset,
4704            __end_time_offset,
4705            __total_count,
4706            __interval,
4707            __quality,
4708            Unknown(std::string::String),
4709        }
4710        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4711            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4712            where
4713                D: serde::Deserializer<'de>,
4714            {
4715                struct Visitor;
4716                impl<'de> serde::de::Visitor<'de> for Visitor {
4717                    type Value = __FieldTag;
4718                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4719                        formatter.write_str("a field name for SpriteSheet")
4720                    }
4721                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4722                    where
4723                        E: serde::de::Error,
4724                    {
4725                        use std::result::Result::Ok;
4726                        use std::string::ToString;
4727                        match value {
4728                            "format" => Ok(__FieldTag::__format),
4729                            "filePrefix" => Ok(__FieldTag::__file_prefix),
4730                            "file_prefix" => Ok(__FieldTag::__file_prefix),
4731                            "spriteWidthPixels" => Ok(__FieldTag::__sprite_width_pixels),
4732                            "sprite_width_pixels" => Ok(__FieldTag::__sprite_width_pixels),
4733                            "spriteHeightPixels" => Ok(__FieldTag::__sprite_height_pixels),
4734                            "sprite_height_pixels" => Ok(__FieldTag::__sprite_height_pixels),
4735                            "columnCount" => Ok(__FieldTag::__column_count),
4736                            "column_count" => Ok(__FieldTag::__column_count),
4737                            "rowCount" => Ok(__FieldTag::__row_count),
4738                            "row_count" => Ok(__FieldTag::__row_count),
4739                            "startTimeOffset" => Ok(__FieldTag::__start_time_offset),
4740                            "start_time_offset" => Ok(__FieldTag::__start_time_offset),
4741                            "endTimeOffset" => Ok(__FieldTag::__end_time_offset),
4742                            "end_time_offset" => Ok(__FieldTag::__end_time_offset),
4743                            "totalCount" => Ok(__FieldTag::__total_count),
4744                            "total_count" => Ok(__FieldTag::__total_count),
4745                            "interval" => Ok(__FieldTag::__interval),
4746                            "quality" => Ok(__FieldTag::__quality),
4747                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4748                        }
4749                    }
4750                }
4751                deserializer.deserialize_identifier(Visitor)
4752            }
4753        }
4754        struct Visitor;
4755        impl<'de> serde::de::Visitor<'de> for Visitor {
4756            type Value = SpriteSheet;
4757            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4758                formatter.write_str("struct SpriteSheet")
4759            }
4760            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4761            where
4762                A: serde::de::MapAccess<'de>,
4763            {
4764                #[allow(unused_imports)]
4765                use serde::de::Error;
4766                use std::option::Option::Some;
4767                let mut fields = std::collections::HashSet::new();
4768                let mut result = Self::Value::new();
4769                while let Some(tag) = map.next_key::<__FieldTag>()? {
4770                    #[allow(clippy::match_single_binding)]
4771                    match tag {
4772                        __FieldTag::__format => {
4773                            if !fields.insert(__FieldTag::__format) {
4774                                return std::result::Result::Err(A::Error::duplicate_field(
4775                                    "multiple values for format",
4776                                ));
4777                            }
4778                            result.format = map
4779                                .next_value::<std::option::Option<std::string::String>>()?
4780                                .unwrap_or_default();
4781                        }
4782                        __FieldTag::__file_prefix => {
4783                            if !fields.insert(__FieldTag::__file_prefix) {
4784                                return std::result::Result::Err(A::Error::duplicate_field(
4785                                    "multiple values for file_prefix",
4786                                ));
4787                            }
4788                            result.file_prefix = map
4789                                .next_value::<std::option::Option<std::string::String>>()?
4790                                .unwrap_or_default();
4791                        }
4792                        __FieldTag::__sprite_width_pixels => {
4793                            if !fields.insert(__FieldTag::__sprite_width_pixels) {
4794                                return std::result::Result::Err(A::Error::duplicate_field(
4795                                    "multiple values for sprite_width_pixels",
4796                                ));
4797                            }
4798                            struct __With(std::option::Option<i32>);
4799                            impl<'de> serde::de::Deserialize<'de> for __With {
4800                                fn deserialize<D>(
4801                                    deserializer: D,
4802                                ) -> std::result::Result<Self, D::Error>
4803                                where
4804                                    D: serde::de::Deserializer<'de>,
4805                                {
4806                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
4807                                }
4808                            }
4809                            result.sprite_width_pixels =
4810                                map.next_value::<__With>()?.0.unwrap_or_default();
4811                        }
4812                        __FieldTag::__sprite_height_pixels => {
4813                            if !fields.insert(__FieldTag::__sprite_height_pixels) {
4814                                return std::result::Result::Err(A::Error::duplicate_field(
4815                                    "multiple values for sprite_height_pixels",
4816                                ));
4817                            }
4818                            struct __With(std::option::Option<i32>);
4819                            impl<'de> serde::de::Deserialize<'de> for __With {
4820                                fn deserialize<D>(
4821                                    deserializer: D,
4822                                ) -> std::result::Result<Self, D::Error>
4823                                where
4824                                    D: serde::de::Deserializer<'de>,
4825                                {
4826                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
4827                                }
4828                            }
4829                            result.sprite_height_pixels =
4830                                map.next_value::<__With>()?.0.unwrap_or_default();
4831                        }
4832                        __FieldTag::__column_count => {
4833                            if !fields.insert(__FieldTag::__column_count) {
4834                                return std::result::Result::Err(A::Error::duplicate_field(
4835                                    "multiple values for column_count",
4836                                ));
4837                            }
4838                            struct __With(std::option::Option<i32>);
4839                            impl<'de> serde::de::Deserialize<'de> for __With {
4840                                fn deserialize<D>(
4841                                    deserializer: D,
4842                                ) -> std::result::Result<Self, D::Error>
4843                                where
4844                                    D: serde::de::Deserializer<'de>,
4845                                {
4846                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
4847                                }
4848                            }
4849                            result.column_count = map.next_value::<__With>()?.0.unwrap_or_default();
4850                        }
4851                        __FieldTag::__row_count => {
4852                            if !fields.insert(__FieldTag::__row_count) {
4853                                return std::result::Result::Err(A::Error::duplicate_field(
4854                                    "multiple values for row_count",
4855                                ));
4856                            }
4857                            struct __With(std::option::Option<i32>);
4858                            impl<'de> serde::de::Deserialize<'de> for __With {
4859                                fn deserialize<D>(
4860                                    deserializer: D,
4861                                ) -> std::result::Result<Self, D::Error>
4862                                where
4863                                    D: serde::de::Deserializer<'de>,
4864                                {
4865                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
4866                                }
4867                            }
4868                            result.row_count = map.next_value::<__With>()?.0.unwrap_or_default();
4869                        }
4870                        __FieldTag::__start_time_offset => {
4871                            if !fields.insert(__FieldTag::__start_time_offset) {
4872                                return std::result::Result::Err(A::Error::duplicate_field(
4873                                    "multiple values for start_time_offset",
4874                                ));
4875                            }
4876                            result.start_time_offset =
4877                                map.next_value::<std::option::Option<wkt::Duration>>()?;
4878                        }
4879                        __FieldTag::__end_time_offset => {
4880                            if !fields.insert(__FieldTag::__end_time_offset) {
4881                                return std::result::Result::Err(A::Error::duplicate_field(
4882                                    "multiple values for end_time_offset",
4883                                ));
4884                            }
4885                            result.end_time_offset =
4886                                map.next_value::<std::option::Option<wkt::Duration>>()?;
4887                        }
4888                        __FieldTag::__total_count => {
4889                            if !fields.insert(__FieldTag::__total_count) {
4890                                return std::result::Result::Err(A::Error::duplicate_field(
4891                                    "multiple values for total_count",
4892                                ));
4893                            }
4894                            struct __With(std::option::Option<i32>);
4895                            impl<'de> serde::de::Deserialize<'de> for __With {
4896                                fn deserialize<D>(
4897                                    deserializer: D,
4898                                ) -> std::result::Result<Self, D::Error>
4899                                where
4900                                    D: serde::de::Deserializer<'de>,
4901                                {
4902                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
4903                                }
4904                            }
4905                            if result.extraction_strategy.is_some() {
4906                                return std::result::Result::Err(A::Error::duplicate_field(
4907                                    "multiple values for `extraction_strategy`, a oneof with full ID .google.cloud.video.transcoder.v1.SpriteSheet.total_count, latest field was totalCount",
4908                                ));
4909                            }
4910                            result.extraction_strategy = std::option::Option::Some(
4911                                crate::model::sprite_sheet::ExtractionStrategy::TotalCount(
4912                                    map.next_value::<__With>()?.0.unwrap_or_default(),
4913                                ),
4914                            );
4915                        }
4916                        __FieldTag::__interval => {
4917                            if !fields.insert(__FieldTag::__interval) {
4918                                return std::result::Result::Err(A::Error::duplicate_field(
4919                                    "multiple values for interval",
4920                                ));
4921                            }
4922                            if result.extraction_strategy.is_some() {
4923                                return std::result::Result::Err(A::Error::duplicate_field(
4924                                    "multiple values for `extraction_strategy`, a oneof with full ID .google.cloud.video.transcoder.v1.SpriteSheet.interval, latest field was interval",
4925                                ));
4926                            }
4927                            result.extraction_strategy = std::option::Option::Some(
4928                                crate::model::sprite_sheet::ExtractionStrategy::Interval(
4929                                    map.next_value::<std::option::Option<std::boxed::Box<wkt::Duration>>>()?.unwrap_or_default()
4930                                ),
4931                            );
4932                        }
4933                        __FieldTag::__quality => {
4934                            if !fields.insert(__FieldTag::__quality) {
4935                                return std::result::Result::Err(A::Error::duplicate_field(
4936                                    "multiple values for quality",
4937                                ));
4938                            }
4939                            struct __With(std::option::Option<i32>);
4940                            impl<'de> serde::de::Deserialize<'de> for __With {
4941                                fn deserialize<D>(
4942                                    deserializer: D,
4943                                ) -> std::result::Result<Self, D::Error>
4944                                where
4945                                    D: serde::de::Deserializer<'de>,
4946                                {
4947                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
4948                                }
4949                            }
4950                            result.quality = map.next_value::<__With>()?.0.unwrap_or_default();
4951                        }
4952                        __FieldTag::Unknown(key) => {
4953                            let value = map.next_value::<serde_json::Value>()?;
4954                            result._unknown_fields.insert(key, value);
4955                        }
4956                    }
4957                }
4958                std::result::Result::Ok(result)
4959            }
4960        }
4961        deserializer.deserialize_any(Visitor)
4962    }
4963}
4964
4965#[doc(hidden)]
4966impl serde::ser::Serialize for SpriteSheet {
4967    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4968    where
4969        S: serde::ser::Serializer,
4970    {
4971        use serde::ser::SerializeMap;
4972        #[allow(unused_imports)]
4973        use std::option::Option::Some;
4974        let mut state = serializer.serialize_map(std::option::Option::None)?;
4975        if !self.format.is_empty() {
4976            state.serialize_entry("format", &self.format)?;
4977        }
4978        if !self.file_prefix.is_empty() {
4979            state.serialize_entry("filePrefix", &self.file_prefix)?;
4980        }
4981        if !wkt::internal::is_default(&self.sprite_width_pixels) {
4982            struct __With<'a>(&'a i32);
4983            impl<'a> serde::ser::Serialize for __With<'a> {
4984                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4985                where
4986                    S: serde::ser::Serializer,
4987                {
4988                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
4989                }
4990            }
4991            state.serialize_entry("spriteWidthPixels", &__With(&self.sprite_width_pixels))?;
4992        }
4993        if !wkt::internal::is_default(&self.sprite_height_pixels) {
4994            struct __With<'a>(&'a i32);
4995            impl<'a> serde::ser::Serialize for __With<'a> {
4996                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4997                where
4998                    S: serde::ser::Serializer,
4999                {
5000                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
5001                }
5002            }
5003            state.serialize_entry("spriteHeightPixels", &__With(&self.sprite_height_pixels))?;
5004        }
5005        if !wkt::internal::is_default(&self.column_count) {
5006            struct __With<'a>(&'a i32);
5007            impl<'a> serde::ser::Serialize for __With<'a> {
5008                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5009                where
5010                    S: serde::ser::Serializer,
5011                {
5012                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
5013                }
5014            }
5015            state.serialize_entry("columnCount", &__With(&self.column_count))?;
5016        }
5017        if !wkt::internal::is_default(&self.row_count) {
5018            struct __With<'a>(&'a i32);
5019            impl<'a> serde::ser::Serialize for __With<'a> {
5020                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5021                where
5022                    S: serde::ser::Serializer,
5023                {
5024                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
5025                }
5026            }
5027            state.serialize_entry("rowCount", &__With(&self.row_count))?;
5028        }
5029        if self.start_time_offset.is_some() {
5030            state.serialize_entry("startTimeOffset", &self.start_time_offset)?;
5031        }
5032        if self.end_time_offset.is_some() {
5033            state.serialize_entry("endTimeOffset", &self.end_time_offset)?;
5034        }
5035        if let Some(value) = self.total_count() {
5036            struct __With<'a>(&'a i32);
5037            impl<'a> serde::ser::Serialize for __With<'a> {
5038                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5039                where
5040                    S: serde::ser::Serializer,
5041                {
5042                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
5043                }
5044            }
5045            state.serialize_entry("totalCount", &__With(value))?;
5046        }
5047        if let Some(value) = self.interval() {
5048            state.serialize_entry("interval", value)?;
5049        }
5050        if !wkt::internal::is_default(&self.quality) {
5051            struct __With<'a>(&'a i32);
5052            impl<'a> serde::ser::Serialize for __With<'a> {
5053                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5054                where
5055                    S: serde::ser::Serializer,
5056                {
5057                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
5058                }
5059            }
5060            state.serialize_entry("quality", &__With(&self.quality))?;
5061        }
5062        if !self._unknown_fields.is_empty() {
5063            for (key, value) in self._unknown_fields.iter() {
5064                state.serialize_entry(key, &value)?;
5065            }
5066        }
5067        state.end()
5068    }
5069}
5070
5071impl std::fmt::Debug for SpriteSheet {
5072    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5073        let mut debug_struct = f.debug_struct("SpriteSheet");
5074        debug_struct.field("format", &self.format);
5075        debug_struct.field("file_prefix", &self.file_prefix);
5076        debug_struct.field("sprite_width_pixels", &self.sprite_width_pixels);
5077        debug_struct.field("sprite_height_pixels", &self.sprite_height_pixels);
5078        debug_struct.field("column_count", &self.column_count);
5079        debug_struct.field("row_count", &self.row_count);
5080        debug_struct.field("start_time_offset", &self.start_time_offset);
5081        debug_struct.field("end_time_offset", &self.end_time_offset);
5082        debug_struct.field("quality", &self.quality);
5083        debug_struct.field("extraction_strategy", &self.extraction_strategy);
5084        if !self._unknown_fields.is_empty() {
5085            debug_struct.field("_unknown_fields", &self._unknown_fields);
5086        }
5087        debug_struct.finish()
5088    }
5089}
5090
5091/// Defines additional types related to [SpriteSheet].
5092pub mod sprite_sheet {
5093    #[allow(unused_imports)]
5094    use super::*;
5095
5096    /// Specify either total number of sprites or interval to create sprites.
5097    #[derive(Clone, Debug, PartialEq)]
5098    #[non_exhaustive]
5099    pub enum ExtractionStrategy {
5100        /// Total number of sprites. Create the specified number of sprites
5101        /// distributed evenly across the timeline of the output media. The default
5102        /// is 100.
5103        TotalCount(i32),
5104        /// Starting from `0s`, create sprites at regular intervals. Specify the
5105        /// interval value in seconds.
5106        Interval(std::boxed::Box<wkt::Duration>),
5107    }
5108}
5109
5110/// Overlay configuration.
5111#[derive(Clone, Default, PartialEq)]
5112#[non_exhaustive]
5113pub struct Overlay {
5114    /// Image overlay.
5115    pub image: std::option::Option<crate::model::overlay::Image>,
5116
5117    /// List of animations. The list should be chronological, without any time
5118    /// overlap.
5119    pub animations: std::vec::Vec<crate::model::overlay::Animation>,
5120
5121    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5122}
5123
5124impl Overlay {
5125    pub fn new() -> Self {
5126        std::default::Default::default()
5127    }
5128
5129    /// Sets the value of [image][crate::model::Overlay::image].
5130    pub fn set_image<T>(mut self, v: T) -> Self
5131    where
5132        T: std::convert::Into<crate::model::overlay::Image>,
5133    {
5134        self.image = std::option::Option::Some(v.into());
5135        self
5136    }
5137
5138    /// Sets or clears the value of [image][crate::model::Overlay::image].
5139    pub fn set_or_clear_image<T>(mut self, v: std::option::Option<T>) -> Self
5140    where
5141        T: std::convert::Into<crate::model::overlay::Image>,
5142    {
5143        self.image = v.map(|x| x.into());
5144        self
5145    }
5146
5147    /// Sets the value of [animations][crate::model::Overlay::animations].
5148    pub fn set_animations<T, V>(mut self, v: T) -> Self
5149    where
5150        T: std::iter::IntoIterator<Item = V>,
5151        V: std::convert::Into<crate::model::overlay::Animation>,
5152    {
5153        use std::iter::Iterator;
5154        self.animations = v.into_iter().map(|i| i.into()).collect();
5155        self
5156    }
5157}
5158
5159impl wkt::message::Message for Overlay {
5160    fn typename() -> &'static str {
5161        "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay"
5162    }
5163}
5164
5165#[doc(hidden)]
5166impl<'de> serde::de::Deserialize<'de> for Overlay {
5167    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5168    where
5169        D: serde::Deserializer<'de>,
5170    {
5171        #[allow(non_camel_case_types)]
5172        #[doc(hidden)]
5173        #[derive(PartialEq, Eq, Hash)]
5174        enum __FieldTag {
5175            __image,
5176            __animations,
5177            Unknown(std::string::String),
5178        }
5179        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5180            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5181            where
5182                D: serde::Deserializer<'de>,
5183            {
5184                struct Visitor;
5185                impl<'de> serde::de::Visitor<'de> for Visitor {
5186                    type Value = __FieldTag;
5187                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5188                        formatter.write_str("a field name for Overlay")
5189                    }
5190                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5191                    where
5192                        E: serde::de::Error,
5193                    {
5194                        use std::result::Result::Ok;
5195                        use std::string::ToString;
5196                        match value {
5197                            "image" => Ok(__FieldTag::__image),
5198                            "animations" => Ok(__FieldTag::__animations),
5199                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5200                        }
5201                    }
5202                }
5203                deserializer.deserialize_identifier(Visitor)
5204            }
5205        }
5206        struct Visitor;
5207        impl<'de> serde::de::Visitor<'de> for Visitor {
5208            type Value = Overlay;
5209            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5210                formatter.write_str("struct Overlay")
5211            }
5212            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5213            where
5214                A: serde::de::MapAccess<'de>,
5215            {
5216                #[allow(unused_imports)]
5217                use serde::de::Error;
5218                use std::option::Option::Some;
5219                let mut fields = std::collections::HashSet::new();
5220                let mut result = Self::Value::new();
5221                while let Some(tag) = map.next_key::<__FieldTag>()? {
5222                    #[allow(clippy::match_single_binding)]
5223                    match tag {
5224                        __FieldTag::__image => {
5225                            if !fields.insert(__FieldTag::__image) {
5226                                return std::result::Result::Err(A::Error::duplicate_field(
5227                                    "multiple values for image",
5228                                ));
5229                            }
5230                            result.image = map
5231                                .next_value::<std::option::Option<crate::model::overlay::Image>>(
5232                                )?;
5233                        }
5234                        __FieldTag::__animations => {
5235                            if !fields.insert(__FieldTag::__animations) {
5236                                return std::result::Result::Err(A::Error::duplicate_field(
5237                                    "multiple values for animations",
5238                                ));
5239                            }
5240                            result.animations = map
5241                                .next_value::<std::option::Option<
5242                                    std::vec::Vec<crate::model::overlay::Animation>,
5243                                >>()?
5244                                .unwrap_or_default();
5245                        }
5246                        __FieldTag::Unknown(key) => {
5247                            let value = map.next_value::<serde_json::Value>()?;
5248                            result._unknown_fields.insert(key, value);
5249                        }
5250                    }
5251                }
5252                std::result::Result::Ok(result)
5253            }
5254        }
5255        deserializer.deserialize_any(Visitor)
5256    }
5257}
5258
5259#[doc(hidden)]
5260impl serde::ser::Serialize for Overlay {
5261    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5262    where
5263        S: serde::ser::Serializer,
5264    {
5265        use serde::ser::SerializeMap;
5266        #[allow(unused_imports)]
5267        use std::option::Option::Some;
5268        let mut state = serializer.serialize_map(std::option::Option::None)?;
5269        if self.image.is_some() {
5270            state.serialize_entry("image", &self.image)?;
5271        }
5272        if !self.animations.is_empty() {
5273            state.serialize_entry("animations", &self.animations)?;
5274        }
5275        if !self._unknown_fields.is_empty() {
5276            for (key, value) in self._unknown_fields.iter() {
5277                state.serialize_entry(key, &value)?;
5278            }
5279        }
5280        state.end()
5281    }
5282}
5283
5284impl std::fmt::Debug for Overlay {
5285    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5286        let mut debug_struct = f.debug_struct("Overlay");
5287        debug_struct.field("image", &self.image);
5288        debug_struct.field("animations", &self.animations);
5289        if !self._unknown_fields.is_empty() {
5290            debug_struct.field("_unknown_fields", &self._unknown_fields);
5291        }
5292        debug_struct.finish()
5293    }
5294}
5295
5296/// Defines additional types related to [Overlay].
5297pub mod overlay {
5298    #[allow(unused_imports)]
5299    use super::*;
5300
5301    /// 2D normalized coordinates. Default: `{0.0, 0.0}`
5302    #[derive(Clone, Default, PartialEq)]
5303    #[non_exhaustive]
5304    pub struct NormalizedCoordinate {
5305        /// Normalized x coordinate.
5306        pub x: f64,
5307
5308        /// Normalized y coordinate.
5309        pub y: f64,
5310
5311        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5312    }
5313
5314    impl NormalizedCoordinate {
5315        pub fn new() -> Self {
5316            std::default::Default::default()
5317        }
5318
5319        /// Sets the value of [x][crate::model::overlay::NormalizedCoordinate::x].
5320        pub fn set_x<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
5321            self.x = v.into();
5322            self
5323        }
5324
5325        /// Sets the value of [y][crate::model::overlay::NormalizedCoordinate::y].
5326        pub fn set_y<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
5327            self.y = v.into();
5328            self
5329        }
5330    }
5331
5332    impl wkt::message::Message for NormalizedCoordinate {
5333        fn typename() -> &'static str {
5334            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate"
5335        }
5336    }
5337
5338    #[doc(hidden)]
5339    impl<'de> serde::de::Deserialize<'de> for NormalizedCoordinate {
5340        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5341        where
5342            D: serde::Deserializer<'de>,
5343        {
5344            #[allow(non_camel_case_types)]
5345            #[doc(hidden)]
5346            #[derive(PartialEq, Eq, Hash)]
5347            enum __FieldTag {
5348                __x,
5349                __y,
5350                Unknown(std::string::String),
5351            }
5352            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5353                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5354                where
5355                    D: serde::Deserializer<'de>,
5356                {
5357                    struct Visitor;
5358                    impl<'de> serde::de::Visitor<'de> for Visitor {
5359                        type Value = __FieldTag;
5360                        fn expecting(
5361                            &self,
5362                            formatter: &mut std::fmt::Formatter,
5363                        ) -> std::fmt::Result {
5364                            formatter.write_str("a field name for NormalizedCoordinate")
5365                        }
5366                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5367                        where
5368                            E: serde::de::Error,
5369                        {
5370                            use std::result::Result::Ok;
5371                            use std::string::ToString;
5372                            match value {
5373                                "x" => Ok(__FieldTag::__x),
5374                                "y" => Ok(__FieldTag::__y),
5375                                _ => Ok(__FieldTag::Unknown(value.to_string())),
5376                            }
5377                        }
5378                    }
5379                    deserializer.deserialize_identifier(Visitor)
5380                }
5381            }
5382            struct Visitor;
5383            impl<'de> serde::de::Visitor<'de> for Visitor {
5384                type Value = NormalizedCoordinate;
5385                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5386                    formatter.write_str("struct NormalizedCoordinate")
5387                }
5388                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5389                where
5390                    A: serde::de::MapAccess<'de>,
5391                {
5392                    #[allow(unused_imports)]
5393                    use serde::de::Error;
5394                    use std::option::Option::Some;
5395                    let mut fields = std::collections::HashSet::new();
5396                    let mut result = Self::Value::new();
5397                    while let Some(tag) = map.next_key::<__FieldTag>()? {
5398                        #[allow(clippy::match_single_binding)]
5399                        match tag {
5400                            __FieldTag::__x => {
5401                                if !fields.insert(__FieldTag::__x) {
5402                                    return std::result::Result::Err(A::Error::duplicate_field(
5403                                        "multiple values for x",
5404                                    ));
5405                                }
5406                                struct __With(std::option::Option<f64>);
5407                                impl<'de> serde::de::Deserialize<'de> for __With {
5408                                    fn deserialize<D>(
5409                                        deserializer: D,
5410                                    ) -> std::result::Result<Self, D::Error>
5411                                    where
5412                                        D: serde::de::Deserializer<'de>,
5413                                    {
5414                                        serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
5415                                    }
5416                                }
5417                                result.x = map.next_value::<__With>()?.0.unwrap_or_default();
5418                            }
5419                            __FieldTag::__y => {
5420                                if !fields.insert(__FieldTag::__y) {
5421                                    return std::result::Result::Err(A::Error::duplicate_field(
5422                                        "multiple values for y",
5423                                    ));
5424                                }
5425                                struct __With(std::option::Option<f64>);
5426                                impl<'de> serde::de::Deserialize<'de> for __With {
5427                                    fn deserialize<D>(
5428                                        deserializer: D,
5429                                    ) -> std::result::Result<Self, D::Error>
5430                                    where
5431                                        D: serde::de::Deserializer<'de>,
5432                                    {
5433                                        serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
5434                                    }
5435                                }
5436                                result.y = map.next_value::<__With>()?.0.unwrap_or_default();
5437                            }
5438                            __FieldTag::Unknown(key) => {
5439                                let value = map.next_value::<serde_json::Value>()?;
5440                                result._unknown_fields.insert(key, value);
5441                            }
5442                        }
5443                    }
5444                    std::result::Result::Ok(result)
5445                }
5446            }
5447            deserializer.deserialize_any(Visitor)
5448        }
5449    }
5450
5451    #[doc(hidden)]
5452    impl serde::ser::Serialize for NormalizedCoordinate {
5453        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5454        where
5455            S: serde::ser::Serializer,
5456        {
5457            use serde::ser::SerializeMap;
5458            #[allow(unused_imports)]
5459            use std::option::Option::Some;
5460            let mut state = serializer.serialize_map(std::option::Option::None)?;
5461            if !wkt::internal::is_default(&self.x) {
5462                struct __With<'a>(&'a f64);
5463                impl<'a> serde::ser::Serialize for __With<'a> {
5464                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5465                    where
5466                        S: serde::ser::Serializer,
5467                    {
5468                        serde_with::As::<wkt::internal::F64>::serialize(self.0, serializer)
5469                    }
5470                }
5471                state.serialize_entry("x", &__With(&self.x))?;
5472            }
5473            if !wkt::internal::is_default(&self.y) {
5474                struct __With<'a>(&'a f64);
5475                impl<'a> serde::ser::Serialize for __With<'a> {
5476                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5477                    where
5478                        S: serde::ser::Serializer,
5479                    {
5480                        serde_with::As::<wkt::internal::F64>::serialize(self.0, serializer)
5481                    }
5482                }
5483                state.serialize_entry("y", &__With(&self.y))?;
5484            }
5485            if !self._unknown_fields.is_empty() {
5486                for (key, value) in self._unknown_fields.iter() {
5487                    state.serialize_entry(key, &value)?;
5488                }
5489            }
5490            state.end()
5491        }
5492    }
5493
5494    impl std::fmt::Debug for NormalizedCoordinate {
5495        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5496            let mut debug_struct = f.debug_struct("NormalizedCoordinate");
5497            debug_struct.field("x", &self.x);
5498            debug_struct.field("y", &self.y);
5499            if !self._unknown_fields.is_empty() {
5500                debug_struct.field("_unknown_fields", &self._unknown_fields);
5501            }
5502            debug_struct.finish()
5503        }
5504    }
5505
5506    /// Overlaid image.
5507    #[derive(Clone, Default, PartialEq)]
5508    #[non_exhaustive]
5509    pub struct Image {
5510        /// Required. URI of the image in Cloud Storage. For example,
5511        /// `gs://bucket/inputs/image.png`. Only PNG and JPEG images are supported.
5512        pub uri: std::string::String,
5513
5514        /// Normalized image resolution, based on output video resolution. Valid
5515        /// values: `0.0`–`1.0`. To respect the original image aspect ratio, set
5516        /// either `x` or `y` to `0.0`. To use the original image resolution, set
5517        /// both `x` and `y` to `0.0`.
5518        pub resolution: std::option::Option<crate::model::overlay::NormalizedCoordinate>,
5519
5520        /// Target image opacity. Valid values are from  `1.0` (solid, default) to
5521        /// `0.0` (transparent), exclusive. Set this to a value greater than `0.0`.
5522        pub alpha: f64,
5523
5524        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5525    }
5526
5527    impl Image {
5528        pub fn new() -> Self {
5529            std::default::Default::default()
5530        }
5531
5532        /// Sets the value of [uri][crate::model::overlay::Image::uri].
5533        pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5534            self.uri = v.into();
5535            self
5536        }
5537
5538        /// Sets the value of [resolution][crate::model::overlay::Image::resolution].
5539        pub fn set_resolution<T>(mut self, v: T) -> Self
5540        where
5541            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
5542        {
5543            self.resolution = std::option::Option::Some(v.into());
5544            self
5545        }
5546
5547        /// Sets or clears the value of [resolution][crate::model::overlay::Image::resolution].
5548        pub fn set_or_clear_resolution<T>(mut self, v: std::option::Option<T>) -> Self
5549        where
5550            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
5551        {
5552            self.resolution = v.map(|x| x.into());
5553            self
5554        }
5555
5556        /// Sets the value of [alpha][crate::model::overlay::Image::alpha].
5557        pub fn set_alpha<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
5558            self.alpha = v.into();
5559            self
5560        }
5561    }
5562
5563    impl wkt::message::Message for Image {
5564        fn typename() -> &'static str {
5565            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.Image"
5566        }
5567    }
5568
5569    #[doc(hidden)]
5570    impl<'de> serde::de::Deserialize<'de> for Image {
5571        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5572        where
5573            D: serde::Deserializer<'de>,
5574        {
5575            #[allow(non_camel_case_types)]
5576            #[doc(hidden)]
5577            #[derive(PartialEq, Eq, Hash)]
5578            enum __FieldTag {
5579                __uri,
5580                __resolution,
5581                __alpha,
5582                Unknown(std::string::String),
5583            }
5584            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5585                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5586                where
5587                    D: serde::Deserializer<'de>,
5588                {
5589                    struct Visitor;
5590                    impl<'de> serde::de::Visitor<'de> for Visitor {
5591                        type Value = __FieldTag;
5592                        fn expecting(
5593                            &self,
5594                            formatter: &mut std::fmt::Formatter,
5595                        ) -> std::fmt::Result {
5596                            formatter.write_str("a field name for Image")
5597                        }
5598                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5599                        where
5600                            E: serde::de::Error,
5601                        {
5602                            use std::result::Result::Ok;
5603                            use std::string::ToString;
5604                            match value {
5605                                "uri" => Ok(__FieldTag::__uri),
5606                                "resolution" => Ok(__FieldTag::__resolution),
5607                                "alpha" => Ok(__FieldTag::__alpha),
5608                                _ => Ok(__FieldTag::Unknown(value.to_string())),
5609                            }
5610                        }
5611                    }
5612                    deserializer.deserialize_identifier(Visitor)
5613                }
5614            }
5615            struct Visitor;
5616            impl<'de> serde::de::Visitor<'de> for Visitor {
5617                type Value = Image;
5618                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5619                    formatter.write_str("struct Image")
5620                }
5621                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5622                where
5623                    A: serde::de::MapAccess<'de>,
5624                {
5625                    #[allow(unused_imports)]
5626                    use serde::de::Error;
5627                    use std::option::Option::Some;
5628                    let mut fields = std::collections::HashSet::new();
5629                    let mut result = Self::Value::new();
5630                    while let Some(tag) = map.next_key::<__FieldTag>()? {
5631                        #[allow(clippy::match_single_binding)]
5632                        match tag {
5633                            __FieldTag::__uri => {
5634                                if !fields.insert(__FieldTag::__uri) {
5635                                    return std::result::Result::Err(A::Error::duplicate_field(
5636                                        "multiple values for uri",
5637                                    ));
5638                                }
5639                                result.uri = map
5640                                    .next_value::<std::option::Option<std::string::String>>()?
5641                                    .unwrap_or_default();
5642                            }
5643                            __FieldTag::__resolution => {
5644                                if !fields.insert(__FieldTag::__resolution) {
5645                                    return std::result::Result::Err(A::Error::duplicate_field(
5646                                        "multiple values for resolution",
5647                                    ));
5648                                }
5649                                result.resolution = map.next_value::<std::option::Option<
5650                                    crate::model::overlay::NormalizedCoordinate,
5651                                >>()?;
5652                            }
5653                            __FieldTag::__alpha => {
5654                                if !fields.insert(__FieldTag::__alpha) {
5655                                    return std::result::Result::Err(A::Error::duplicate_field(
5656                                        "multiple values for alpha",
5657                                    ));
5658                                }
5659                                struct __With(std::option::Option<f64>);
5660                                impl<'de> serde::de::Deserialize<'de> for __With {
5661                                    fn deserialize<D>(
5662                                        deserializer: D,
5663                                    ) -> std::result::Result<Self, D::Error>
5664                                    where
5665                                        D: serde::de::Deserializer<'de>,
5666                                    {
5667                                        serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
5668                                    }
5669                                }
5670                                result.alpha = map.next_value::<__With>()?.0.unwrap_or_default();
5671                            }
5672                            __FieldTag::Unknown(key) => {
5673                                let value = map.next_value::<serde_json::Value>()?;
5674                                result._unknown_fields.insert(key, value);
5675                            }
5676                        }
5677                    }
5678                    std::result::Result::Ok(result)
5679                }
5680            }
5681            deserializer.deserialize_any(Visitor)
5682        }
5683    }
5684
5685    #[doc(hidden)]
5686    impl serde::ser::Serialize for Image {
5687        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5688        where
5689            S: serde::ser::Serializer,
5690        {
5691            use serde::ser::SerializeMap;
5692            #[allow(unused_imports)]
5693            use std::option::Option::Some;
5694            let mut state = serializer.serialize_map(std::option::Option::None)?;
5695            if !self.uri.is_empty() {
5696                state.serialize_entry("uri", &self.uri)?;
5697            }
5698            if self.resolution.is_some() {
5699                state.serialize_entry("resolution", &self.resolution)?;
5700            }
5701            if !wkt::internal::is_default(&self.alpha) {
5702                struct __With<'a>(&'a f64);
5703                impl<'a> serde::ser::Serialize for __With<'a> {
5704                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5705                    where
5706                        S: serde::ser::Serializer,
5707                    {
5708                        serde_with::As::<wkt::internal::F64>::serialize(self.0, serializer)
5709                    }
5710                }
5711                state.serialize_entry("alpha", &__With(&self.alpha))?;
5712            }
5713            if !self._unknown_fields.is_empty() {
5714                for (key, value) in self._unknown_fields.iter() {
5715                    state.serialize_entry(key, &value)?;
5716                }
5717            }
5718            state.end()
5719        }
5720    }
5721
5722    impl std::fmt::Debug for Image {
5723        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5724            let mut debug_struct = f.debug_struct("Image");
5725            debug_struct.field("uri", &self.uri);
5726            debug_struct.field("resolution", &self.resolution);
5727            debug_struct.field("alpha", &self.alpha);
5728            if !self._unknown_fields.is_empty() {
5729                debug_struct.field("_unknown_fields", &self._unknown_fields);
5730            }
5731            debug_struct.finish()
5732        }
5733    }
5734
5735    /// Display static overlay object.
5736    #[derive(Clone, Default, PartialEq)]
5737    #[non_exhaustive]
5738    pub struct AnimationStatic {
5739        /// Normalized coordinates based on output video resolution. Valid
5740        /// values: `0.0`–`1.0`. `xy` is the upper-left coordinate of the overlay
5741        /// object. For example, use the x and y coordinates {0,0} to position the
5742        /// top-left corner of the overlay animation in the top-left corner of the
5743        /// output video.
5744        pub xy: std::option::Option<crate::model::overlay::NormalizedCoordinate>,
5745
5746        /// The time to start displaying the overlay object, in seconds. Default: 0
5747        pub start_time_offset: std::option::Option<wkt::Duration>,
5748
5749        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5750    }
5751
5752    impl AnimationStatic {
5753        pub fn new() -> Self {
5754            std::default::Default::default()
5755        }
5756
5757        /// Sets the value of [xy][crate::model::overlay::AnimationStatic::xy].
5758        pub fn set_xy<T>(mut self, v: T) -> Self
5759        where
5760            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
5761        {
5762            self.xy = std::option::Option::Some(v.into());
5763            self
5764        }
5765
5766        /// Sets or clears the value of [xy][crate::model::overlay::AnimationStatic::xy].
5767        pub fn set_or_clear_xy<T>(mut self, v: std::option::Option<T>) -> Self
5768        where
5769            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
5770        {
5771            self.xy = v.map(|x| x.into());
5772            self
5773        }
5774
5775        /// Sets the value of [start_time_offset][crate::model::overlay::AnimationStatic::start_time_offset].
5776        pub fn set_start_time_offset<T>(mut self, v: T) -> Self
5777        where
5778            T: std::convert::Into<wkt::Duration>,
5779        {
5780            self.start_time_offset = std::option::Option::Some(v.into());
5781            self
5782        }
5783
5784        /// Sets or clears the value of [start_time_offset][crate::model::overlay::AnimationStatic::start_time_offset].
5785        pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
5786        where
5787            T: std::convert::Into<wkt::Duration>,
5788        {
5789            self.start_time_offset = v.map(|x| x.into());
5790            self
5791        }
5792    }
5793
5794    impl wkt::message::Message for AnimationStatic {
5795        fn typename() -> &'static str {
5796            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.AnimationStatic"
5797        }
5798    }
5799
5800    #[doc(hidden)]
5801    impl<'de> serde::de::Deserialize<'de> for AnimationStatic {
5802        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5803        where
5804            D: serde::Deserializer<'de>,
5805        {
5806            #[allow(non_camel_case_types)]
5807            #[doc(hidden)]
5808            #[derive(PartialEq, Eq, Hash)]
5809            enum __FieldTag {
5810                __xy,
5811                __start_time_offset,
5812                Unknown(std::string::String),
5813            }
5814            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5815                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5816                where
5817                    D: serde::Deserializer<'de>,
5818                {
5819                    struct Visitor;
5820                    impl<'de> serde::de::Visitor<'de> for Visitor {
5821                        type Value = __FieldTag;
5822                        fn expecting(
5823                            &self,
5824                            formatter: &mut std::fmt::Formatter,
5825                        ) -> std::fmt::Result {
5826                            formatter.write_str("a field name for AnimationStatic")
5827                        }
5828                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5829                        where
5830                            E: serde::de::Error,
5831                        {
5832                            use std::result::Result::Ok;
5833                            use std::string::ToString;
5834                            match value {
5835                                "xy" => Ok(__FieldTag::__xy),
5836                                "startTimeOffset" => Ok(__FieldTag::__start_time_offset),
5837                                "start_time_offset" => Ok(__FieldTag::__start_time_offset),
5838                                _ => Ok(__FieldTag::Unknown(value.to_string())),
5839                            }
5840                        }
5841                    }
5842                    deserializer.deserialize_identifier(Visitor)
5843                }
5844            }
5845            struct Visitor;
5846            impl<'de> serde::de::Visitor<'de> for Visitor {
5847                type Value = AnimationStatic;
5848                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5849                    formatter.write_str("struct AnimationStatic")
5850                }
5851                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5852                where
5853                    A: serde::de::MapAccess<'de>,
5854                {
5855                    #[allow(unused_imports)]
5856                    use serde::de::Error;
5857                    use std::option::Option::Some;
5858                    let mut fields = std::collections::HashSet::new();
5859                    let mut result = Self::Value::new();
5860                    while let Some(tag) = map.next_key::<__FieldTag>()? {
5861                        #[allow(clippy::match_single_binding)]
5862                        match tag {
5863                            __FieldTag::__xy => {
5864                                if !fields.insert(__FieldTag::__xy) {
5865                                    return std::result::Result::Err(A::Error::duplicate_field(
5866                                        "multiple values for xy",
5867                                    ));
5868                                }
5869                                result.xy = map.next_value::<std::option::Option<
5870                                    crate::model::overlay::NormalizedCoordinate,
5871                                >>()?;
5872                            }
5873                            __FieldTag::__start_time_offset => {
5874                                if !fields.insert(__FieldTag::__start_time_offset) {
5875                                    return std::result::Result::Err(A::Error::duplicate_field(
5876                                        "multiple values for start_time_offset",
5877                                    ));
5878                                }
5879                                result.start_time_offset =
5880                                    map.next_value::<std::option::Option<wkt::Duration>>()?;
5881                            }
5882                            __FieldTag::Unknown(key) => {
5883                                let value = map.next_value::<serde_json::Value>()?;
5884                                result._unknown_fields.insert(key, value);
5885                            }
5886                        }
5887                    }
5888                    std::result::Result::Ok(result)
5889                }
5890            }
5891            deserializer.deserialize_any(Visitor)
5892        }
5893    }
5894
5895    #[doc(hidden)]
5896    impl serde::ser::Serialize for AnimationStatic {
5897        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5898        where
5899            S: serde::ser::Serializer,
5900        {
5901            use serde::ser::SerializeMap;
5902            #[allow(unused_imports)]
5903            use std::option::Option::Some;
5904            let mut state = serializer.serialize_map(std::option::Option::None)?;
5905            if self.xy.is_some() {
5906                state.serialize_entry("xy", &self.xy)?;
5907            }
5908            if self.start_time_offset.is_some() {
5909                state.serialize_entry("startTimeOffset", &self.start_time_offset)?;
5910            }
5911            if !self._unknown_fields.is_empty() {
5912                for (key, value) in self._unknown_fields.iter() {
5913                    state.serialize_entry(key, &value)?;
5914                }
5915            }
5916            state.end()
5917        }
5918    }
5919
5920    impl std::fmt::Debug for AnimationStatic {
5921        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5922            let mut debug_struct = f.debug_struct("AnimationStatic");
5923            debug_struct.field("xy", &self.xy);
5924            debug_struct.field("start_time_offset", &self.start_time_offset);
5925            if !self._unknown_fields.is_empty() {
5926                debug_struct.field("_unknown_fields", &self._unknown_fields);
5927            }
5928            debug_struct.finish()
5929        }
5930    }
5931
5932    /// Display overlay object with fade animation.
5933    #[derive(Clone, Default, PartialEq)]
5934    #[non_exhaustive]
5935    pub struct AnimationFade {
5936        /// Required. Type of fade animation: `FADE_IN` or `FADE_OUT`.
5937        pub fade_type: crate::model::overlay::FadeType,
5938
5939        /// Normalized coordinates based on output video resolution. Valid
5940        /// values: `0.0`–`1.0`. `xy` is the upper-left coordinate of the overlay
5941        /// object. For example, use the x and y coordinates {0,0} to position the
5942        /// top-left corner of the overlay animation in the top-left corner of the
5943        /// output video.
5944        pub xy: std::option::Option<crate::model::overlay::NormalizedCoordinate>,
5945
5946        /// The time to start the fade animation, in seconds. Default: 0
5947        pub start_time_offset: std::option::Option<wkt::Duration>,
5948
5949        /// The time to end the fade animation, in seconds. Default:
5950        /// `start_time_offset` + 1s
5951        pub end_time_offset: std::option::Option<wkt::Duration>,
5952
5953        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5954    }
5955
5956    impl AnimationFade {
5957        pub fn new() -> Self {
5958            std::default::Default::default()
5959        }
5960
5961        /// Sets the value of [fade_type][crate::model::overlay::AnimationFade::fade_type].
5962        pub fn set_fade_type<T: std::convert::Into<crate::model::overlay::FadeType>>(
5963            mut self,
5964            v: T,
5965        ) -> Self {
5966            self.fade_type = v.into();
5967            self
5968        }
5969
5970        /// Sets the value of [xy][crate::model::overlay::AnimationFade::xy].
5971        pub fn set_xy<T>(mut self, v: T) -> Self
5972        where
5973            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
5974        {
5975            self.xy = std::option::Option::Some(v.into());
5976            self
5977        }
5978
5979        /// Sets or clears the value of [xy][crate::model::overlay::AnimationFade::xy].
5980        pub fn set_or_clear_xy<T>(mut self, v: std::option::Option<T>) -> Self
5981        where
5982            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
5983        {
5984            self.xy = v.map(|x| x.into());
5985            self
5986        }
5987
5988        /// Sets the value of [start_time_offset][crate::model::overlay::AnimationFade::start_time_offset].
5989        pub fn set_start_time_offset<T>(mut self, v: T) -> Self
5990        where
5991            T: std::convert::Into<wkt::Duration>,
5992        {
5993            self.start_time_offset = std::option::Option::Some(v.into());
5994            self
5995        }
5996
5997        /// Sets or clears the value of [start_time_offset][crate::model::overlay::AnimationFade::start_time_offset].
5998        pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
5999        where
6000            T: std::convert::Into<wkt::Duration>,
6001        {
6002            self.start_time_offset = v.map(|x| x.into());
6003            self
6004        }
6005
6006        /// Sets the value of [end_time_offset][crate::model::overlay::AnimationFade::end_time_offset].
6007        pub fn set_end_time_offset<T>(mut self, v: T) -> Self
6008        where
6009            T: std::convert::Into<wkt::Duration>,
6010        {
6011            self.end_time_offset = std::option::Option::Some(v.into());
6012            self
6013        }
6014
6015        /// Sets or clears the value of [end_time_offset][crate::model::overlay::AnimationFade::end_time_offset].
6016        pub fn set_or_clear_end_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
6017        where
6018            T: std::convert::Into<wkt::Duration>,
6019        {
6020            self.end_time_offset = v.map(|x| x.into());
6021            self
6022        }
6023    }
6024
6025    impl wkt::message::Message for AnimationFade {
6026        fn typename() -> &'static str {
6027            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.AnimationFade"
6028        }
6029    }
6030
6031    #[doc(hidden)]
6032    impl<'de> serde::de::Deserialize<'de> for AnimationFade {
6033        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6034        where
6035            D: serde::Deserializer<'de>,
6036        {
6037            #[allow(non_camel_case_types)]
6038            #[doc(hidden)]
6039            #[derive(PartialEq, Eq, Hash)]
6040            enum __FieldTag {
6041                __fade_type,
6042                __xy,
6043                __start_time_offset,
6044                __end_time_offset,
6045                Unknown(std::string::String),
6046            }
6047            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6048                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6049                where
6050                    D: serde::Deserializer<'de>,
6051                {
6052                    struct Visitor;
6053                    impl<'de> serde::de::Visitor<'de> for Visitor {
6054                        type Value = __FieldTag;
6055                        fn expecting(
6056                            &self,
6057                            formatter: &mut std::fmt::Formatter,
6058                        ) -> std::fmt::Result {
6059                            formatter.write_str("a field name for AnimationFade")
6060                        }
6061                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6062                        where
6063                            E: serde::de::Error,
6064                        {
6065                            use std::result::Result::Ok;
6066                            use std::string::ToString;
6067                            match value {
6068                                "fadeType" => Ok(__FieldTag::__fade_type),
6069                                "fade_type" => Ok(__FieldTag::__fade_type),
6070                                "xy" => Ok(__FieldTag::__xy),
6071                                "startTimeOffset" => Ok(__FieldTag::__start_time_offset),
6072                                "start_time_offset" => Ok(__FieldTag::__start_time_offset),
6073                                "endTimeOffset" => Ok(__FieldTag::__end_time_offset),
6074                                "end_time_offset" => Ok(__FieldTag::__end_time_offset),
6075                                _ => Ok(__FieldTag::Unknown(value.to_string())),
6076                            }
6077                        }
6078                    }
6079                    deserializer.deserialize_identifier(Visitor)
6080                }
6081            }
6082            struct Visitor;
6083            impl<'de> serde::de::Visitor<'de> for Visitor {
6084                type Value = AnimationFade;
6085                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6086                    formatter.write_str("struct AnimationFade")
6087                }
6088                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6089                where
6090                    A: serde::de::MapAccess<'de>,
6091                {
6092                    #[allow(unused_imports)]
6093                    use serde::de::Error;
6094                    use std::option::Option::Some;
6095                    let mut fields = std::collections::HashSet::new();
6096                    let mut result = Self::Value::new();
6097                    while let Some(tag) = map.next_key::<__FieldTag>()? {
6098                        #[allow(clippy::match_single_binding)]
6099                        match tag {
6100                            __FieldTag::__fade_type => {
6101                                if !fields.insert(__FieldTag::__fade_type) {
6102                                    return std::result::Result::Err(A::Error::duplicate_field(
6103                                        "multiple values for fade_type",
6104                                    ));
6105                                }
6106                                result.fade_type = map.next_value::<std::option::Option<crate::model::overlay::FadeType>>()?.unwrap_or_default();
6107                            }
6108                            __FieldTag::__xy => {
6109                                if !fields.insert(__FieldTag::__xy) {
6110                                    return std::result::Result::Err(A::Error::duplicate_field(
6111                                        "multiple values for xy",
6112                                    ));
6113                                }
6114                                result.xy = map.next_value::<std::option::Option<
6115                                    crate::model::overlay::NormalizedCoordinate,
6116                                >>()?;
6117                            }
6118                            __FieldTag::__start_time_offset => {
6119                                if !fields.insert(__FieldTag::__start_time_offset) {
6120                                    return std::result::Result::Err(A::Error::duplicate_field(
6121                                        "multiple values for start_time_offset",
6122                                    ));
6123                                }
6124                                result.start_time_offset =
6125                                    map.next_value::<std::option::Option<wkt::Duration>>()?;
6126                            }
6127                            __FieldTag::__end_time_offset => {
6128                                if !fields.insert(__FieldTag::__end_time_offset) {
6129                                    return std::result::Result::Err(A::Error::duplicate_field(
6130                                        "multiple values for end_time_offset",
6131                                    ));
6132                                }
6133                                result.end_time_offset =
6134                                    map.next_value::<std::option::Option<wkt::Duration>>()?;
6135                            }
6136                            __FieldTag::Unknown(key) => {
6137                                let value = map.next_value::<serde_json::Value>()?;
6138                                result._unknown_fields.insert(key, value);
6139                            }
6140                        }
6141                    }
6142                    std::result::Result::Ok(result)
6143                }
6144            }
6145            deserializer.deserialize_any(Visitor)
6146        }
6147    }
6148
6149    #[doc(hidden)]
6150    impl serde::ser::Serialize for AnimationFade {
6151        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6152        where
6153            S: serde::ser::Serializer,
6154        {
6155            use serde::ser::SerializeMap;
6156            #[allow(unused_imports)]
6157            use std::option::Option::Some;
6158            let mut state = serializer.serialize_map(std::option::Option::None)?;
6159            if !wkt::internal::is_default(&self.fade_type) {
6160                state.serialize_entry("fadeType", &self.fade_type)?;
6161            }
6162            if self.xy.is_some() {
6163                state.serialize_entry("xy", &self.xy)?;
6164            }
6165            if self.start_time_offset.is_some() {
6166                state.serialize_entry("startTimeOffset", &self.start_time_offset)?;
6167            }
6168            if self.end_time_offset.is_some() {
6169                state.serialize_entry("endTimeOffset", &self.end_time_offset)?;
6170            }
6171            if !self._unknown_fields.is_empty() {
6172                for (key, value) in self._unknown_fields.iter() {
6173                    state.serialize_entry(key, &value)?;
6174                }
6175            }
6176            state.end()
6177        }
6178    }
6179
6180    impl std::fmt::Debug for AnimationFade {
6181        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6182            let mut debug_struct = f.debug_struct("AnimationFade");
6183            debug_struct.field("fade_type", &self.fade_type);
6184            debug_struct.field("xy", &self.xy);
6185            debug_struct.field("start_time_offset", &self.start_time_offset);
6186            debug_struct.field("end_time_offset", &self.end_time_offset);
6187            if !self._unknown_fields.is_empty() {
6188                debug_struct.field("_unknown_fields", &self._unknown_fields);
6189            }
6190            debug_struct.finish()
6191        }
6192    }
6193
6194    /// End previous overlay animation from the video. Without `AnimationEnd`, the
6195    /// overlay object will keep the state of previous animation until the end of
6196    /// the video.
6197    #[derive(Clone, Default, PartialEq)]
6198    #[non_exhaustive]
6199    pub struct AnimationEnd {
6200        /// The time to end overlay object, in seconds. Default: 0
6201        pub start_time_offset: std::option::Option<wkt::Duration>,
6202
6203        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6204    }
6205
6206    impl AnimationEnd {
6207        pub fn new() -> Self {
6208            std::default::Default::default()
6209        }
6210
6211        /// Sets the value of [start_time_offset][crate::model::overlay::AnimationEnd::start_time_offset].
6212        pub fn set_start_time_offset<T>(mut self, v: T) -> Self
6213        where
6214            T: std::convert::Into<wkt::Duration>,
6215        {
6216            self.start_time_offset = std::option::Option::Some(v.into());
6217            self
6218        }
6219
6220        /// Sets or clears the value of [start_time_offset][crate::model::overlay::AnimationEnd::start_time_offset].
6221        pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
6222        where
6223            T: std::convert::Into<wkt::Duration>,
6224        {
6225            self.start_time_offset = v.map(|x| x.into());
6226            self
6227        }
6228    }
6229
6230    impl wkt::message::Message for AnimationEnd {
6231        fn typename() -> &'static str {
6232            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.AnimationEnd"
6233        }
6234    }
6235
6236    #[doc(hidden)]
6237    impl<'de> serde::de::Deserialize<'de> for AnimationEnd {
6238        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6239        where
6240            D: serde::Deserializer<'de>,
6241        {
6242            #[allow(non_camel_case_types)]
6243            #[doc(hidden)]
6244            #[derive(PartialEq, Eq, Hash)]
6245            enum __FieldTag {
6246                __start_time_offset,
6247                Unknown(std::string::String),
6248            }
6249            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6250                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6251                where
6252                    D: serde::Deserializer<'de>,
6253                {
6254                    struct Visitor;
6255                    impl<'de> serde::de::Visitor<'de> for Visitor {
6256                        type Value = __FieldTag;
6257                        fn expecting(
6258                            &self,
6259                            formatter: &mut std::fmt::Formatter,
6260                        ) -> std::fmt::Result {
6261                            formatter.write_str("a field name for AnimationEnd")
6262                        }
6263                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6264                        where
6265                            E: serde::de::Error,
6266                        {
6267                            use std::result::Result::Ok;
6268                            use std::string::ToString;
6269                            match value {
6270                                "startTimeOffset" => Ok(__FieldTag::__start_time_offset),
6271                                "start_time_offset" => Ok(__FieldTag::__start_time_offset),
6272                                _ => Ok(__FieldTag::Unknown(value.to_string())),
6273                            }
6274                        }
6275                    }
6276                    deserializer.deserialize_identifier(Visitor)
6277                }
6278            }
6279            struct Visitor;
6280            impl<'de> serde::de::Visitor<'de> for Visitor {
6281                type Value = AnimationEnd;
6282                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6283                    formatter.write_str("struct AnimationEnd")
6284                }
6285                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6286                where
6287                    A: serde::de::MapAccess<'de>,
6288                {
6289                    #[allow(unused_imports)]
6290                    use serde::de::Error;
6291                    use std::option::Option::Some;
6292                    let mut fields = std::collections::HashSet::new();
6293                    let mut result = Self::Value::new();
6294                    while let Some(tag) = map.next_key::<__FieldTag>()? {
6295                        #[allow(clippy::match_single_binding)]
6296                        match tag {
6297                            __FieldTag::__start_time_offset => {
6298                                if !fields.insert(__FieldTag::__start_time_offset) {
6299                                    return std::result::Result::Err(A::Error::duplicate_field(
6300                                        "multiple values for start_time_offset",
6301                                    ));
6302                                }
6303                                result.start_time_offset =
6304                                    map.next_value::<std::option::Option<wkt::Duration>>()?;
6305                            }
6306                            __FieldTag::Unknown(key) => {
6307                                let value = map.next_value::<serde_json::Value>()?;
6308                                result._unknown_fields.insert(key, value);
6309                            }
6310                        }
6311                    }
6312                    std::result::Result::Ok(result)
6313                }
6314            }
6315            deserializer.deserialize_any(Visitor)
6316        }
6317    }
6318
6319    #[doc(hidden)]
6320    impl serde::ser::Serialize for AnimationEnd {
6321        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6322        where
6323            S: serde::ser::Serializer,
6324        {
6325            use serde::ser::SerializeMap;
6326            #[allow(unused_imports)]
6327            use std::option::Option::Some;
6328            let mut state = serializer.serialize_map(std::option::Option::None)?;
6329            if self.start_time_offset.is_some() {
6330                state.serialize_entry("startTimeOffset", &self.start_time_offset)?;
6331            }
6332            if !self._unknown_fields.is_empty() {
6333                for (key, value) in self._unknown_fields.iter() {
6334                    state.serialize_entry(key, &value)?;
6335                }
6336            }
6337            state.end()
6338        }
6339    }
6340
6341    impl std::fmt::Debug for AnimationEnd {
6342        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6343            let mut debug_struct = f.debug_struct("AnimationEnd");
6344            debug_struct.field("start_time_offset", &self.start_time_offset);
6345            if !self._unknown_fields.is_empty() {
6346                debug_struct.field("_unknown_fields", &self._unknown_fields);
6347            }
6348            debug_struct.finish()
6349        }
6350    }
6351
6352    /// Animation types.
6353    #[derive(Clone, Default, PartialEq)]
6354    #[non_exhaustive]
6355    pub struct Animation {
6356        /// Animations can be static or fade, or they can end the previous animation.
6357        pub animation_type: std::option::Option<crate::model::overlay::animation::AnimationType>,
6358
6359        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6360    }
6361
6362    impl Animation {
6363        pub fn new() -> Self {
6364            std::default::Default::default()
6365        }
6366
6367        /// Sets the value of [animation_type][crate::model::overlay::Animation::animation_type].
6368        ///
6369        /// Note that all the setters affecting `animation_type` are mutually
6370        /// exclusive.
6371        pub fn set_animation_type<
6372            T: std::convert::Into<
6373                    std::option::Option<crate::model::overlay::animation::AnimationType>,
6374                >,
6375        >(
6376            mut self,
6377            v: T,
6378        ) -> Self {
6379            self.animation_type = v.into();
6380            self
6381        }
6382
6383        /// The value of [animation_type][crate::model::overlay::Animation::animation_type]
6384        /// if it holds a `AnimationStatic`, `None` if the field is not set or
6385        /// holds a different branch.
6386        pub fn animation_static(
6387            &self,
6388        ) -> std::option::Option<&std::boxed::Box<crate::model::overlay::AnimationStatic>> {
6389            #[allow(unreachable_patterns)]
6390            self.animation_type.as_ref().and_then(|v| match v {
6391                crate::model::overlay::animation::AnimationType::AnimationStatic(v) => {
6392                    std::option::Option::Some(v)
6393                }
6394                _ => std::option::Option::None,
6395            })
6396        }
6397
6398        /// Sets the value of [animation_type][crate::model::overlay::Animation::animation_type]
6399        /// to hold a `AnimationStatic`.
6400        ///
6401        /// Note that all the setters affecting `animation_type` are
6402        /// mutually exclusive.
6403        pub fn set_animation_static<
6404            T: std::convert::Into<std::boxed::Box<crate::model::overlay::AnimationStatic>>,
6405        >(
6406            mut self,
6407            v: T,
6408        ) -> Self {
6409            self.animation_type = std::option::Option::Some(
6410                crate::model::overlay::animation::AnimationType::AnimationStatic(v.into()),
6411            );
6412            self
6413        }
6414
6415        /// The value of [animation_type][crate::model::overlay::Animation::animation_type]
6416        /// if it holds a `AnimationFade`, `None` if the field is not set or
6417        /// holds a different branch.
6418        pub fn animation_fade(
6419            &self,
6420        ) -> std::option::Option<&std::boxed::Box<crate::model::overlay::AnimationFade>> {
6421            #[allow(unreachable_patterns)]
6422            self.animation_type.as_ref().and_then(|v| match v {
6423                crate::model::overlay::animation::AnimationType::AnimationFade(v) => {
6424                    std::option::Option::Some(v)
6425                }
6426                _ => std::option::Option::None,
6427            })
6428        }
6429
6430        /// Sets the value of [animation_type][crate::model::overlay::Animation::animation_type]
6431        /// to hold a `AnimationFade`.
6432        ///
6433        /// Note that all the setters affecting `animation_type` are
6434        /// mutually exclusive.
6435        pub fn set_animation_fade<
6436            T: std::convert::Into<std::boxed::Box<crate::model::overlay::AnimationFade>>,
6437        >(
6438            mut self,
6439            v: T,
6440        ) -> Self {
6441            self.animation_type = std::option::Option::Some(
6442                crate::model::overlay::animation::AnimationType::AnimationFade(v.into()),
6443            );
6444            self
6445        }
6446
6447        /// The value of [animation_type][crate::model::overlay::Animation::animation_type]
6448        /// if it holds a `AnimationEnd`, `None` if the field is not set or
6449        /// holds a different branch.
6450        pub fn animation_end(
6451            &self,
6452        ) -> std::option::Option<&std::boxed::Box<crate::model::overlay::AnimationEnd>> {
6453            #[allow(unreachable_patterns)]
6454            self.animation_type.as_ref().and_then(|v| match v {
6455                crate::model::overlay::animation::AnimationType::AnimationEnd(v) => {
6456                    std::option::Option::Some(v)
6457                }
6458                _ => std::option::Option::None,
6459            })
6460        }
6461
6462        /// Sets the value of [animation_type][crate::model::overlay::Animation::animation_type]
6463        /// to hold a `AnimationEnd`.
6464        ///
6465        /// Note that all the setters affecting `animation_type` are
6466        /// mutually exclusive.
6467        pub fn set_animation_end<
6468            T: std::convert::Into<std::boxed::Box<crate::model::overlay::AnimationEnd>>,
6469        >(
6470            mut self,
6471            v: T,
6472        ) -> Self {
6473            self.animation_type = std::option::Option::Some(
6474                crate::model::overlay::animation::AnimationType::AnimationEnd(v.into()),
6475            );
6476            self
6477        }
6478    }
6479
6480    impl wkt::message::Message for Animation {
6481        fn typename() -> &'static str {
6482            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.Animation"
6483        }
6484    }
6485
6486    #[doc(hidden)]
6487    impl<'de> serde::de::Deserialize<'de> for Animation {
6488        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6489        where
6490            D: serde::Deserializer<'de>,
6491        {
6492            #[allow(non_camel_case_types)]
6493            #[doc(hidden)]
6494            #[derive(PartialEq, Eq, Hash)]
6495            enum __FieldTag {
6496                __animation_static,
6497                __animation_fade,
6498                __animation_end,
6499                Unknown(std::string::String),
6500            }
6501            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6502                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6503                where
6504                    D: serde::Deserializer<'de>,
6505                {
6506                    struct Visitor;
6507                    impl<'de> serde::de::Visitor<'de> for Visitor {
6508                        type Value = __FieldTag;
6509                        fn expecting(
6510                            &self,
6511                            formatter: &mut std::fmt::Formatter,
6512                        ) -> std::fmt::Result {
6513                            formatter.write_str("a field name for Animation")
6514                        }
6515                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6516                        where
6517                            E: serde::de::Error,
6518                        {
6519                            use std::result::Result::Ok;
6520                            use std::string::ToString;
6521                            match value {
6522                                "animationStatic" => Ok(__FieldTag::__animation_static),
6523                                "animation_static" => Ok(__FieldTag::__animation_static),
6524                                "animationFade" => Ok(__FieldTag::__animation_fade),
6525                                "animation_fade" => Ok(__FieldTag::__animation_fade),
6526                                "animationEnd" => Ok(__FieldTag::__animation_end),
6527                                "animation_end" => Ok(__FieldTag::__animation_end),
6528                                _ => Ok(__FieldTag::Unknown(value.to_string())),
6529                            }
6530                        }
6531                    }
6532                    deserializer.deserialize_identifier(Visitor)
6533                }
6534            }
6535            struct Visitor;
6536            impl<'de> serde::de::Visitor<'de> for Visitor {
6537                type Value = Animation;
6538                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6539                    formatter.write_str("struct Animation")
6540                }
6541                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6542                where
6543                    A: serde::de::MapAccess<'de>,
6544                {
6545                    #[allow(unused_imports)]
6546                    use serde::de::Error;
6547                    use std::option::Option::Some;
6548                    let mut fields = std::collections::HashSet::new();
6549                    let mut result = Self::Value::new();
6550                    while let Some(tag) = map.next_key::<__FieldTag>()? {
6551                        #[allow(clippy::match_single_binding)]
6552                        match tag {
6553                            __FieldTag::__animation_static => {
6554                                if !fields.insert(__FieldTag::__animation_static) {
6555                                    return std::result::Result::Err(A::Error::duplicate_field(
6556                                        "multiple values for animation_static",
6557                                    ));
6558                                }
6559                                if result.animation_type.is_some() {
6560                                    return std::result::Result::Err(A::Error::duplicate_field(
6561                                        "multiple values for `animation_type`, a oneof with full ID .google.cloud.video.transcoder.v1.Overlay.Animation.animation_static, latest field was animationStatic",
6562                                    ));
6563                                }
6564                                result.animation_type = std::option::Option::Some(
6565                                    crate::model::overlay::animation::AnimationType::AnimationStatic(
6566                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::overlay::AnimationStatic>>>()?.unwrap_or_default()
6567                                    ),
6568                                );
6569                            }
6570                            __FieldTag::__animation_fade => {
6571                                if !fields.insert(__FieldTag::__animation_fade) {
6572                                    return std::result::Result::Err(A::Error::duplicate_field(
6573                                        "multiple values for animation_fade",
6574                                    ));
6575                                }
6576                                if result.animation_type.is_some() {
6577                                    return std::result::Result::Err(A::Error::duplicate_field(
6578                                        "multiple values for `animation_type`, a oneof with full ID .google.cloud.video.transcoder.v1.Overlay.Animation.animation_fade, latest field was animationFade",
6579                                    ));
6580                                }
6581                                result.animation_type = std::option::Option::Some(
6582                                    crate::model::overlay::animation::AnimationType::AnimationFade(
6583                                        map.next_value::<std::option::Option<
6584                                            std::boxed::Box<crate::model::overlay::AnimationFade>,
6585                                        >>()?
6586                                        .unwrap_or_default(),
6587                                    ),
6588                                );
6589                            }
6590                            __FieldTag::__animation_end => {
6591                                if !fields.insert(__FieldTag::__animation_end) {
6592                                    return std::result::Result::Err(A::Error::duplicate_field(
6593                                        "multiple values for animation_end",
6594                                    ));
6595                                }
6596                                if result.animation_type.is_some() {
6597                                    return std::result::Result::Err(A::Error::duplicate_field(
6598                                        "multiple values for `animation_type`, a oneof with full ID .google.cloud.video.transcoder.v1.Overlay.Animation.animation_end, latest field was animationEnd",
6599                                    ));
6600                                }
6601                                result.animation_type = std::option::Option::Some(
6602                                    crate::model::overlay::animation::AnimationType::AnimationEnd(
6603                                        map.next_value::<std::option::Option<
6604                                            std::boxed::Box<crate::model::overlay::AnimationEnd>,
6605                                        >>()?
6606                                        .unwrap_or_default(),
6607                                    ),
6608                                );
6609                            }
6610                            __FieldTag::Unknown(key) => {
6611                                let value = map.next_value::<serde_json::Value>()?;
6612                                result._unknown_fields.insert(key, value);
6613                            }
6614                        }
6615                    }
6616                    std::result::Result::Ok(result)
6617                }
6618            }
6619            deserializer.deserialize_any(Visitor)
6620        }
6621    }
6622
6623    #[doc(hidden)]
6624    impl serde::ser::Serialize for Animation {
6625        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6626        where
6627            S: serde::ser::Serializer,
6628        {
6629            use serde::ser::SerializeMap;
6630            #[allow(unused_imports)]
6631            use std::option::Option::Some;
6632            let mut state = serializer.serialize_map(std::option::Option::None)?;
6633            if let Some(value) = self.animation_static() {
6634                state.serialize_entry("animationStatic", value)?;
6635            }
6636            if let Some(value) = self.animation_fade() {
6637                state.serialize_entry("animationFade", value)?;
6638            }
6639            if let Some(value) = self.animation_end() {
6640                state.serialize_entry("animationEnd", value)?;
6641            }
6642            if !self._unknown_fields.is_empty() {
6643                for (key, value) in self._unknown_fields.iter() {
6644                    state.serialize_entry(key, &value)?;
6645                }
6646            }
6647            state.end()
6648        }
6649    }
6650
6651    impl std::fmt::Debug for Animation {
6652        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6653            let mut debug_struct = f.debug_struct("Animation");
6654            debug_struct.field("animation_type", &self.animation_type);
6655            if !self._unknown_fields.is_empty() {
6656                debug_struct.field("_unknown_fields", &self._unknown_fields);
6657            }
6658            debug_struct.finish()
6659        }
6660    }
6661
6662    /// Defines additional types related to [Animation].
6663    pub mod animation {
6664        #[allow(unused_imports)]
6665        use super::*;
6666
6667        /// Animations can be static or fade, or they can end the previous animation.
6668        #[derive(Clone, Debug, PartialEq)]
6669        #[non_exhaustive]
6670        pub enum AnimationType {
6671            /// Display static overlay object.
6672            AnimationStatic(std::boxed::Box<crate::model::overlay::AnimationStatic>),
6673            /// Display overlay object with fade animation.
6674            AnimationFade(std::boxed::Box<crate::model::overlay::AnimationFade>),
6675            /// End previous animation.
6676            AnimationEnd(std::boxed::Box<crate::model::overlay::AnimationEnd>),
6677        }
6678    }
6679
6680    /// Fade type for the overlay: `FADE_IN` or `FADE_OUT`.
6681    ///
6682    /// # Working with unknown values
6683    ///
6684    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6685    /// additional enum variants at any time. Adding new variants is not considered
6686    /// a breaking change. Applications should write their code in anticipation of:
6687    ///
6688    /// - New values appearing in future releases of the client library, **and**
6689    /// - New values received dynamically, without application changes.
6690    ///
6691    /// Please consult the [Working with enums] section in the user guide for some
6692    /// guidelines.
6693    ///
6694    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6695    #[derive(Clone, Debug, PartialEq)]
6696    #[non_exhaustive]
6697    pub enum FadeType {
6698        /// The fade type is not specified.
6699        Unspecified,
6700        /// Fade the overlay object into view.
6701        FadeIn,
6702        /// Fade the overlay object out of view.
6703        FadeOut,
6704        /// If set, the enum was initialized with an unknown value.
6705        ///
6706        /// Applications can examine the value using [FadeType::value] or
6707        /// [FadeType::name].
6708        UnknownValue(fade_type::UnknownValue),
6709    }
6710
6711    #[doc(hidden)]
6712    pub mod fade_type {
6713        #[allow(unused_imports)]
6714        use super::*;
6715        #[derive(Clone, Debug, PartialEq)]
6716        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6717    }
6718
6719    impl FadeType {
6720        /// Gets the enum value.
6721        ///
6722        /// Returns `None` if the enum contains an unknown value deserialized from
6723        /// the string representation of enums.
6724        pub fn value(&self) -> std::option::Option<i32> {
6725            match self {
6726                Self::Unspecified => std::option::Option::Some(0),
6727                Self::FadeIn => std::option::Option::Some(1),
6728                Self::FadeOut => std::option::Option::Some(2),
6729                Self::UnknownValue(u) => u.0.value(),
6730            }
6731        }
6732
6733        /// Gets the enum value as a string.
6734        ///
6735        /// Returns `None` if the enum contains an unknown value deserialized from
6736        /// the integer representation of enums.
6737        pub fn name(&self) -> std::option::Option<&str> {
6738            match self {
6739                Self::Unspecified => std::option::Option::Some("FADE_TYPE_UNSPECIFIED"),
6740                Self::FadeIn => std::option::Option::Some("FADE_IN"),
6741                Self::FadeOut => std::option::Option::Some("FADE_OUT"),
6742                Self::UnknownValue(u) => u.0.name(),
6743            }
6744        }
6745    }
6746
6747    impl std::default::Default for FadeType {
6748        fn default() -> Self {
6749            use std::convert::From;
6750            Self::from(0)
6751        }
6752    }
6753
6754    impl std::fmt::Display for FadeType {
6755        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6756            wkt::internal::display_enum(f, self.name(), self.value())
6757        }
6758    }
6759
6760    impl std::convert::From<i32> for FadeType {
6761        fn from(value: i32) -> Self {
6762            match value {
6763                0 => Self::Unspecified,
6764                1 => Self::FadeIn,
6765                2 => Self::FadeOut,
6766                _ => Self::UnknownValue(fade_type::UnknownValue(
6767                    wkt::internal::UnknownEnumValue::Integer(value),
6768                )),
6769            }
6770        }
6771    }
6772
6773    impl std::convert::From<&str> for FadeType {
6774        fn from(value: &str) -> Self {
6775            use std::string::ToString;
6776            match value {
6777                "FADE_TYPE_UNSPECIFIED" => Self::Unspecified,
6778                "FADE_IN" => Self::FadeIn,
6779                "FADE_OUT" => Self::FadeOut,
6780                _ => Self::UnknownValue(fade_type::UnknownValue(
6781                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6782                )),
6783            }
6784        }
6785    }
6786
6787    impl serde::ser::Serialize for FadeType {
6788        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6789        where
6790            S: serde::Serializer,
6791        {
6792            match self {
6793                Self::Unspecified => serializer.serialize_i32(0),
6794                Self::FadeIn => serializer.serialize_i32(1),
6795                Self::FadeOut => serializer.serialize_i32(2),
6796                Self::UnknownValue(u) => u.0.serialize(serializer),
6797            }
6798        }
6799    }
6800
6801    impl<'de> serde::de::Deserialize<'de> for FadeType {
6802        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6803        where
6804            D: serde::Deserializer<'de>,
6805        {
6806            deserializer.deserialize_any(wkt::internal::EnumVisitor::<FadeType>::new(
6807                ".google.cloud.video.transcoder.v1.Overlay.FadeType",
6808            ))
6809        }
6810    }
6811}
6812
6813/// Preprocessing configurations.
6814#[derive(Clone, Default, PartialEq)]
6815#[non_exhaustive]
6816pub struct PreprocessingConfig {
6817    /// Color preprocessing configuration.
6818    pub color: std::option::Option<crate::model::preprocessing_config::Color>,
6819
6820    /// Denoise preprocessing configuration.
6821    pub denoise: std::option::Option<crate::model::preprocessing_config::Denoise>,
6822
6823    /// Deblock preprocessing configuration.
6824    pub deblock: std::option::Option<crate::model::preprocessing_config::Deblock>,
6825
6826    /// Audio preprocessing configuration.
6827    pub audio: std::option::Option<crate::model::preprocessing_config::Audio>,
6828
6829    /// Specify the video cropping configuration.
6830    pub crop: std::option::Option<crate::model::preprocessing_config::Crop>,
6831
6832    /// Specify the video pad filter configuration.
6833    pub pad: std::option::Option<crate::model::preprocessing_config::Pad>,
6834
6835    /// Specify the video deinterlace configuration.
6836    pub deinterlace: std::option::Option<crate::model::preprocessing_config::Deinterlace>,
6837
6838    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6839}
6840
6841impl PreprocessingConfig {
6842    pub fn new() -> Self {
6843        std::default::Default::default()
6844    }
6845
6846    /// Sets the value of [color][crate::model::PreprocessingConfig::color].
6847    pub fn set_color<T>(mut self, v: T) -> Self
6848    where
6849        T: std::convert::Into<crate::model::preprocessing_config::Color>,
6850    {
6851        self.color = std::option::Option::Some(v.into());
6852        self
6853    }
6854
6855    /// Sets or clears the value of [color][crate::model::PreprocessingConfig::color].
6856    pub fn set_or_clear_color<T>(mut self, v: std::option::Option<T>) -> Self
6857    where
6858        T: std::convert::Into<crate::model::preprocessing_config::Color>,
6859    {
6860        self.color = v.map(|x| x.into());
6861        self
6862    }
6863
6864    /// Sets the value of [denoise][crate::model::PreprocessingConfig::denoise].
6865    pub fn set_denoise<T>(mut self, v: T) -> Self
6866    where
6867        T: std::convert::Into<crate::model::preprocessing_config::Denoise>,
6868    {
6869        self.denoise = std::option::Option::Some(v.into());
6870        self
6871    }
6872
6873    /// Sets or clears the value of [denoise][crate::model::PreprocessingConfig::denoise].
6874    pub fn set_or_clear_denoise<T>(mut self, v: std::option::Option<T>) -> Self
6875    where
6876        T: std::convert::Into<crate::model::preprocessing_config::Denoise>,
6877    {
6878        self.denoise = v.map(|x| x.into());
6879        self
6880    }
6881
6882    /// Sets the value of [deblock][crate::model::PreprocessingConfig::deblock].
6883    pub fn set_deblock<T>(mut self, v: T) -> Self
6884    where
6885        T: std::convert::Into<crate::model::preprocessing_config::Deblock>,
6886    {
6887        self.deblock = std::option::Option::Some(v.into());
6888        self
6889    }
6890
6891    /// Sets or clears the value of [deblock][crate::model::PreprocessingConfig::deblock].
6892    pub fn set_or_clear_deblock<T>(mut self, v: std::option::Option<T>) -> Self
6893    where
6894        T: std::convert::Into<crate::model::preprocessing_config::Deblock>,
6895    {
6896        self.deblock = v.map(|x| x.into());
6897        self
6898    }
6899
6900    /// Sets the value of [audio][crate::model::PreprocessingConfig::audio].
6901    pub fn set_audio<T>(mut self, v: T) -> Self
6902    where
6903        T: std::convert::Into<crate::model::preprocessing_config::Audio>,
6904    {
6905        self.audio = std::option::Option::Some(v.into());
6906        self
6907    }
6908
6909    /// Sets or clears the value of [audio][crate::model::PreprocessingConfig::audio].
6910    pub fn set_or_clear_audio<T>(mut self, v: std::option::Option<T>) -> Self
6911    where
6912        T: std::convert::Into<crate::model::preprocessing_config::Audio>,
6913    {
6914        self.audio = v.map(|x| x.into());
6915        self
6916    }
6917
6918    /// Sets the value of [crop][crate::model::PreprocessingConfig::crop].
6919    pub fn set_crop<T>(mut self, v: T) -> Self
6920    where
6921        T: std::convert::Into<crate::model::preprocessing_config::Crop>,
6922    {
6923        self.crop = std::option::Option::Some(v.into());
6924        self
6925    }
6926
6927    /// Sets or clears the value of [crop][crate::model::PreprocessingConfig::crop].
6928    pub fn set_or_clear_crop<T>(mut self, v: std::option::Option<T>) -> Self
6929    where
6930        T: std::convert::Into<crate::model::preprocessing_config::Crop>,
6931    {
6932        self.crop = v.map(|x| x.into());
6933        self
6934    }
6935
6936    /// Sets the value of [pad][crate::model::PreprocessingConfig::pad].
6937    pub fn set_pad<T>(mut self, v: T) -> Self
6938    where
6939        T: std::convert::Into<crate::model::preprocessing_config::Pad>,
6940    {
6941        self.pad = std::option::Option::Some(v.into());
6942        self
6943    }
6944
6945    /// Sets or clears the value of [pad][crate::model::PreprocessingConfig::pad].
6946    pub fn set_or_clear_pad<T>(mut self, v: std::option::Option<T>) -> Self
6947    where
6948        T: std::convert::Into<crate::model::preprocessing_config::Pad>,
6949    {
6950        self.pad = v.map(|x| x.into());
6951        self
6952    }
6953
6954    /// Sets the value of [deinterlace][crate::model::PreprocessingConfig::deinterlace].
6955    pub fn set_deinterlace<T>(mut self, v: T) -> Self
6956    where
6957        T: std::convert::Into<crate::model::preprocessing_config::Deinterlace>,
6958    {
6959        self.deinterlace = std::option::Option::Some(v.into());
6960        self
6961    }
6962
6963    /// Sets or clears the value of [deinterlace][crate::model::PreprocessingConfig::deinterlace].
6964    pub fn set_or_clear_deinterlace<T>(mut self, v: std::option::Option<T>) -> Self
6965    where
6966        T: std::convert::Into<crate::model::preprocessing_config::Deinterlace>,
6967    {
6968        self.deinterlace = v.map(|x| x.into());
6969        self
6970    }
6971}
6972
6973impl wkt::message::Message for PreprocessingConfig {
6974    fn typename() -> &'static str {
6975        "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig"
6976    }
6977}
6978
6979#[doc(hidden)]
6980impl<'de> serde::de::Deserialize<'de> for PreprocessingConfig {
6981    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6982    where
6983        D: serde::Deserializer<'de>,
6984    {
6985        #[allow(non_camel_case_types)]
6986        #[doc(hidden)]
6987        #[derive(PartialEq, Eq, Hash)]
6988        enum __FieldTag {
6989            __color,
6990            __denoise,
6991            __deblock,
6992            __audio,
6993            __crop,
6994            __pad,
6995            __deinterlace,
6996            Unknown(std::string::String),
6997        }
6998        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6999            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7000            where
7001                D: serde::Deserializer<'de>,
7002            {
7003                struct Visitor;
7004                impl<'de> serde::de::Visitor<'de> for Visitor {
7005                    type Value = __FieldTag;
7006                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7007                        formatter.write_str("a field name for PreprocessingConfig")
7008                    }
7009                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7010                    where
7011                        E: serde::de::Error,
7012                    {
7013                        use std::result::Result::Ok;
7014                        use std::string::ToString;
7015                        match value {
7016                            "color" => Ok(__FieldTag::__color),
7017                            "denoise" => Ok(__FieldTag::__denoise),
7018                            "deblock" => Ok(__FieldTag::__deblock),
7019                            "audio" => Ok(__FieldTag::__audio),
7020                            "crop" => Ok(__FieldTag::__crop),
7021                            "pad" => Ok(__FieldTag::__pad),
7022                            "deinterlace" => Ok(__FieldTag::__deinterlace),
7023                            _ => Ok(__FieldTag::Unknown(value.to_string())),
7024                        }
7025                    }
7026                }
7027                deserializer.deserialize_identifier(Visitor)
7028            }
7029        }
7030        struct Visitor;
7031        impl<'de> serde::de::Visitor<'de> for Visitor {
7032            type Value = PreprocessingConfig;
7033            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7034                formatter.write_str("struct PreprocessingConfig")
7035            }
7036            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7037            where
7038                A: serde::de::MapAccess<'de>,
7039            {
7040                #[allow(unused_imports)]
7041                use serde::de::Error;
7042                use std::option::Option::Some;
7043                let mut fields = std::collections::HashSet::new();
7044                let mut result = Self::Value::new();
7045                while let Some(tag) = map.next_key::<__FieldTag>()? {
7046                    #[allow(clippy::match_single_binding)]
7047                    match tag {
7048                        __FieldTag::__color => {
7049                            if !fields.insert(__FieldTag::__color) {
7050                                return std::result::Result::Err(A::Error::duplicate_field(
7051                                    "multiple values for color",
7052                                ));
7053                            }
7054                            result.color = map.next_value::<std::option::Option<crate::model::preprocessing_config::Color>>()?
7055                                ;
7056                        }
7057                        __FieldTag::__denoise => {
7058                            if !fields.insert(__FieldTag::__denoise) {
7059                                return std::result::Result::Err(A::Error::duplicate_field(
7060                                    "multiple values for denoise",
7061                                ));
7062                            }
7063                            result.denoise =
7064                                map.next_value::<std::option::Option<
7065                                    crate::model::preprocessing_config::Denoise,
7066                                >>()?;
7067                        }
7068                        __FieldTag::__deblock => {
7069                            if !fields.insert(__FieldTag::__deblock) {
7070                                return std::result::Result::Err(A::Error::duplicate_field(
7071                                    "multiple values for deblock",
7072                                ));
7073                            }
7074                            result.deblock =
7075                                map.next_value::<std::option::Option<
7076                                    crate::model::preprocessing_config::Deblock,
7077                                >>()?;
7078                        }
7079                        __FieldTag::__audio => {
7080                            if !fields.insert(__FieldTag::__audio) {
7081                                return std::result::Result::Err(A::Error::duplicate_field(
7082                                    "multiple values for audio",
7083                                ));
7084                            }
7085                            result.audio = map.next_value::<std::option::Option<crate::model::preprocessing_config::Audio>>()?
7086                                ;
7087                        }
7088                        __FieldTag::__crop => {
7089                            if !fields.insert(__FieldTag::__crop) {
7090                                return std::result::Result::Err(A::Error::duplicate_field(
7091                                    "multiple values for crop",
7092                                ));
7093                            }
7094                            result.crop = map.next_value::<std::option::Option<crate::model::preprocessing_config::Crop>>()?
7095                                ;
7096                        }
7097                        __FieldTag::__pad => {
7098                            if !fields.insert(__FieldTag::__pad) {
7099                                return std::result::Result::Err(A::Error::duplicate_field(
7100                                    "multiple values for pad",
7101                                ));
7102                            }
7103                            result.pad = map.next_value::<std::option::Option<crate::model::preprocessing_config::Pad>>()?
7104                                ;
7105                        }
7106                        __FieldTag::__deinterlace => {
7107                            if !fields.insert(__FieldTag::__deinterlace) {
7108                                return std::result::Result::Err(A::Error::duplicate_field(
7109                                    "multiple values for deinterlace",
7110                                ));
7111                            }
7112                            result.deinterlace = map.next_value::<std::option::Option<
7113                                crate::model::preprocessing_config::Deinterlace,
7114                            >>()?;
7115                        }
7116                        __FieldTag::Unknown(key) => {
7117                            let value = map.next_value::<serde_json::Value>()?;
7118                            result._unknown_fields.insert(key, value);
7119                        }
7120                    }
7121                }
7122                std::result::Result::Ok(result)
7123            }
7124        }
7125        deserializer.deserialize_any(Visitor)
7126    }
7127}
7128
7129#[doc(hidden)]
7130impl serde::ser::Serialize for PreprocessingConfig {
7131    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7132    where
7133        S: serde::ser::Serializer,
7134    {
7135        use serde::ser::SerializeMap;
7136        #[allow(unused_imports)]
7137        use std::option::Option::Some;
7138        let mut state = serializer.serialize_map(std::option::Option::None)?;
7139        if self.color.is_some() {
7140            state.serialize_entry("color", &self.color)?;
7141        }
7142        if self.denoise.is_some() {
7143            state.serialize_entry("denoise", &self.denoise)?;
7144        }
7145        if self.deblock.is_some() {
7146            state.serialize_entry("deblock", &self.deblock)?;
7147        }
7148        if self.audio.is_some() {
7149            state.serialize_entry("audio", &self.audio)?;
7150        }
7151        if self.crop.is_some() {
7152            state.serialize_entry("crop", &self.crop)?;
7153        }
7154        if self.pad.is_some() {
7155            state.serialize_entry("pad", &self.pad)?;
7156        }
7157        if self.deinterlace.is_some() {
7158            state.serialize_entry("deinterlace", &self.deinterlace)?;
7159        }
7160        if !self._unknown_fields.is_empty() {
7161            for (key, value) in self._unknown_fields.iter() {
7162                state.serialize_entry(key, &value)?;
7163            }
7164        }
7165        state.end()
7166    }
7167}
7168
7169impl std::fmt::Debug for PreprocessingConfig {
7170    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7171        let mut debug_struct = f.debug_struct("PreprocessingConfig");
7172        debug_struct.field("color", &self.color);
7173        debug_struct.field("denoise", &self.denoise);
7174        debug_struct.field("deblock", &self.deblock);
7175        debug_struct.field("audio", &self.audio);
7176        debug_struct.field("crop", &self.crop);
7177        debug_struct.field("pad", &self.pad);
7178        debug_struct.field("deinterlace", &self.deinterlace);
7179        if !self._unknown_fields.is_empty() {
7180            debug_struct.field("_unknown_fields", &self._unknown_fields);
7181        }
7182        debug_struct.finish()
7183    }
7184}
7185
7186/// Defines additional types related to [PreprocessingConfig].
7187pub mod preprocessing_config {
7188    #[allow(unused_imports)]
7189    use super::*;
7190
7191    /// Color preprocessing configuration.
7192    ///
7193    /// **Note:** This configuration is not supported.
7194    #[derive(Clone, Default, PartialEq)]
7195    #[non_exhaustive]
7196    pub struct Color {
7197        /// Control color saturation of the video. Enter a value between -1 and 1,
7198        /// where -1 is fully desaturated and 1 is maximum saturation. 0 is no
7199        /// change. The default is 0.
7200        pub saturation: f64,
7201
7202        /// Control black and white contrast of the video. Enter a value between -1
7203        /// and 1, where -1 is minimum contrast and 1 is maximum contrast. 0 is no
7204        /// change. The default is 0.
7205        pub contrast: f64,
7206
7207        /// Control brightness of the video. Enter a value between -1 and 1, where -1
7208        /// is minimum brightness and 1 is maximum brightness. 0 is no change. The
7209        /// default is 0.
7210        pub brightness: f64,
7211
7212        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7213    }
7214
7215    impl Color {
7216        pub fn new() -> Self {
7217            std::default::Default::default()
7218        }
7219
7220        /// Sets the value of [saturation][crate::model::preprocessing_config::Color::saturation].
7221        pub fn set_saturation<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
7222            self.saturation = v.into();
7223            self
7224        }
7225
7226        /// Sets the value of [contrast][crate::model::preprocessing_config::Color::contrast].
7227        pub fn set_contrast<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
7228            self.contrast = v.into();
7229            self
7230        }
7231
7232        /// Sets the value of [brightness][crate::model::preprocessing_config::Color::brightness].
7233        pub fn set_brightness<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
7234            self.brightness = v.into();
7235            self
7236        }
7237    }
7238
7239    impl wkt::message::Message for Color {
7240        fn typename() -> &'static str {
7241            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Color"
7242        }
7243    }
7244
7245    #[doc(hidden)]
7246    impl<'de> serde::de::Deserialize<'de> for Color {
7247        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7248        where
7249            D: serde::Deserializer<'de>,
7250        {
7251            #[allow(non_camel_case_types)]
7252            #[doc(hidden)]
7253            #[derive(PartialEq, Eq, Hash)]
7254            enum __FieldTag {
7255                __saturation,
7256                __contrast,
7257                __brightness,
7258                Unknown(std::string::String),
7259            }
7260            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7261                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7262                where
7263                    D: serde::Deserializer<'de>,
7264                {
7265                    struct Visitor;
7266                    impl<'de> serde::de::Visitor<'de> for Visitor {
7267                        type Value = __FieldTag;
7268                        fn expecting(
7269                            &self,
7270                            formatter: &mut std::fmt::Formatter,
7271                        ) -> std::fmt::Result {
7272                            formatter.write_str("a field name for Color")
7273                        }
7274                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7275                        where
7276                            E: serde::de::Error,
7277                        {
7278                            use std::result::Result::Ok;
7279                            use std::string::ToString;
7280                            match value {
7281                                "saturation" => Ok(__FieldTag::__saturation),
7282                                "contrast" => Ok(__FieldTag::__contrast),
7283                                "brightness" => Ok(__FieldTag::__brightness),
7284                                _ => Ok(__FieldTag::Unknown(value.to_string())),
7285                            }
7286                        }
7287                    }
7288                    deserializer.deserialize_identifier(Visitor)
7289                }
7290            }
7291            struct Visitor;
7292            impl<'de> serde::de::Visitor<'de> for Visitor {
7293                type Value = Color;
7294                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7295                    formatter.write_str("struct Color")
7296                }
7297                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7298                where
7299                    A: serde::de::MapAccess<'de>,
7300                {
7301                    #[allow(unused_imports)]
7302                    use serde::de::Error;
7303                    use std::option::Option::Some;
7304                    let mut fields = std::collections::HashSet::new();
7305                    let mut result = Self::Value::new();
7306                    while let Some(tag) = map.next_key::<__FieldTag>()? {
7307                        #[allow(clippy::match_single_binding)]
7308                        match tag {
7309                            __FieldTag::__saturation => {
7310                                if !fields.insert(__FieldTag::__saturation) {
7311                                    return std::result::Result::Err(A::Error::duplicate_field(
7312                                        "multiple values for saturation",
7313                                    ));
7314                                }
7315                                struct __With(std::option::Option<f64>);
7316                                impl<'de> serde::de::Deserialize<'de> for __With {
7317                                    fn deserialize<D>(
7318                                        deserializer: D,
7319                                    ) -> std::result::Result<Self, D::Error>
7320                                    where
7321                                        D: serde::de::Deserializer<'de>,
7322                                    {
7323                                        serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
7324                                    }
7325                                }
7326                                result.saturation =
7327                                    map.next_value::<__With>()?.0.unwrap_or_default();
7328                            }
7329                            __FieldTag::__contrast => {
7330                                if !fields.insert(__FieldTag::__contrast) {
7331                                    return std::result::Result::Err(A::Error::duplicate_field(
7332                                        "multiple values for contrast",
7333                                    ));
7334                                }
7335                                struct __With(std::option::Option<f64>);
7336                                impl<'de> serde::de::Deserialize<'de> for __With {
7337                                    fn deserialize<D>(
7338                                        deserializer: D,
7339                                    ) -> std::result::Result<Self, D::Error>
7340                                    where
7341                                        D: serde::de::Deserializer<'de>,
7342                                    {
7343                                        serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
7344                                    }
7345                                }
7346                                result.contrast = map.next_value::<__With>()?.0.unwrap_or_default();
7347                            }
7348                            __FieldTag::__brightness => {
7349                                if !fields.insert(__FieldTag::__brightness) {
7350                                    return std::result::Result::Err(A::Error::duplicate_field(
7351                                        "multiple values for brightness",
7352                                    ));
7353                                }
7354                                struct __With(std::option::Option<f64>);
7355                                impl<'de> serde::de::Deserialize<'de> for __With {
7356                                    fn deserialize<D>(
7357                                        deserializer: D,
7358                                    ) -> std::result::Result<Self, D::Error>
7359                                    where
7360                                        D: serde::de::Deserializer<'de>,
7361                                    {
7362                                        serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
7363                                    }
7364                                }
7365                                result.brightness =
7366                                    map.next_value::<__With>()?.0.unwrap_or_default();
7367                            }
7368                            __FieldTag::Unknown(key) => {
7369                                let value = map.next_value::<serde_json::Value>()?;
7370                                result._unknown_fields.insert(key, value);
7371                            }
7372                        }
7373                    }
7374                    std::result::Result::Ok(result)
7375                }
7376            }
7377            deserializer.deserialize_any(Visitor)
7378        }
7379    }
7380
7381    #[doc(hidden)]
7382    impl serde::ser::Serialize for Color {
7383        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7384        where
7385            S: serde::ser::Serializer,
7386        {
7387            use serde::ser::SerializeMap;
7388            #[allow(unused_imports)]
7389            use std::option::Option::Some;
7390            let mut state = serializer.serialize_map(std::option::Option::None)?;
7391            if !wkt::internal::is_default(&self.saturation) {
7392                struct __With<'a>(&'a f64);
7393                impl<'a> serde::ser::Serialize for __With<'a> {
7394                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7395                    where
7396                        S: serde::ser::Serializer,
7397                    {
7398                        serde_with::As::<wkt::internal::F64>::serialize(self.0, serializer)
7399                    }
7400                }
7401                state.serialize_entry("saturation", &__With(&self.saturation))?;
7402            }
7403            if !wkt::internal::is_default(&self.contrast) {
7404                struct __With<'a>(&'a f64);
7405                impl<'a> serde::ser::Serialize for __With<'a> {
7406                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7407                    where
7408                        S: serde::ser::Serializer,
7409                    {
7410                        serde_with::As::<wkt::internal::F64>::serialize(self.0, serializer)
7411                    }
7412                }
7413                state.serialize_entry("contrast", &__With(&self.contrast))?;
7414            }
7415            if !wkt::internal::is_default(&self.brightness) {
7416                struct __With<'a>(&'a f64);
7417                impl<'a> serde::ser::Serialize for __With<'a> {
7418                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7419                    where
7420                        S: serde::ser::Serializer,
7421                    {
7422                        serde_with::As::<wkt::internal::F64>::serialize(self.0, serializer)
7423                    }
7424                }
7425                state.serialize_entry("brightness", &__With(&self.brightness))?;
7426            }
7427            if !self._unknown_fields.is_empty() {
7428                for (key, value) in self._unknown_fields.iter() {
7429                    state.serialize_entry(key, &value)?;
7430                }
7431            }
7432            state.end()
7433        }
7434    }
7435
7436    impl std::fmt::Debug for Color {
7437        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7438            let mut debug_struct = f.debug_struct("Color");
7439            debug_struct.field("saturation", &self.saturation);
7440            debug_struct.field("contrast", &self.contrast);
7441            debug_struct.field("brightness", &self.brightness);
7442            if !self._unknown_fields.is_empty() {
7443                debug_struct.field("_unknown_fields", &self._unknown_fields);
7444            }
7445            debug_struct.finish()
7446        }
7447    }
7448
7449    /// Denoise preprocessing configuration.
7450    ///
7451    /// **Note:** This configuration is not supported.
7452    #[derive(Clone, Default, PartialEq)]
7453    #[non_exhaustive]
7454    pub struct Denoise {
7455        /// Set strength of the denoise. Enter a value between 0 and 1. The higher
7456        /// the value, the smoother the image. 0 is no denoising. The default is 0.
7457        pub strength: f64,
7458
7459        /// Set the denoiser mode. The default is `standard`.
7460        ///
7461        /// Supported denoiser modes:
7462        ///
7463        /// - `standard`
7464        /// - `grain`
7465        pub tune: std::string::String,
7466
7467        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7468    }
7469
7470    impl Denoise {
7471        pub fn new() -> Self {
7472            std::default::Default::default()
7473        }
7474
7475        /// Sets the value of [strength][crate::model::preprocessing_config::Denoise::strength].
7476        pub fn set_strength<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
7477            self.strength = v.into();
7478            self
7479        }
7480
7481        /// Sets the value of [tune][crate::model::preprocessing_config::Denoise::tune].
7482        pub fn set_tune<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7483            self.tune = v.into();
7484            self
7485        }
7486    }
7487
7488    impl wkt::message::Message for Denoise {
7489        fn typename() -> &'static str {
7490            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise"
7491        }
7492    }
7493
7494    #[doc(hidden)]
7495    impl<'de> serde::de::Deserialize<'de> for Denoise {
7496        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7497        where
7498            D: serde::Deserializer<'de>,
7499        {
7500            #[allow(non_camel_case_types)]
7501            #[doc(hidden)]
7502            #[derive(PartialEq, Eq, Hash)]
7503            enum __FieldTag {
7504                __strength,
7505                __tune,
7506                Unknown(std::string::String),
7507            }
7508            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7509                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7510                where
7511                    D: serde::Deserializer<'de>,
7512                {
7513                    struct Visitor;
7514                    impl<'de> serde::de::Visitor<'de> for Visitor {
7515                        type Value = __FieldTag;
7516                        fn expecting(
7517                            &self,
7518                            formatter: &mut std::fmt::Formatter,
7519                        ) -> std::fmt::Result {
7520                            formatter.write_str("a field name for Denoise")
7521                        }
7522                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7523                        where
7524                            E: serde::de::Error,
7525                        {
7526                            use std::result::Result::Ok;
7527                            use std::string::ToString;
7528                            match value {
7529                                "strength" => Ok(__FieldTag::__strength),
7530                                "tune" => Ok(__FieldTag::__tune),
7531                                _ => Ok(__FieldTag::Unknown(value.to_string())),
7532                            }
7533                        }
7534                    }
7535                    deserializer.deserialize_identifier(Visitor)
7536                }
7537            }
7538            struct Visitor;
7539            impl<'de> serde::de::Visitor<'de> for Visitor {
7540                type Value = Denoise;
7541                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7542                    formatter.write_str("struct Denoise")
7543                }
7544                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7545                where
7546                    A: serde::de::MapAccess<'de>,
7547                {
7548                    #[allow(unused_imports)]
7549                    use serde::de::Error;
7550                    use std::option::Option::Some;
7551                    let mut fields = std::collections::HashSet::new();
7552                    let mut result = Self::Value::new();
7553                    while let Some(tag) = map.next_key::<__FieldTag>()? {
7554                        #[allow(clippy::match_single_binding)]
7555                        match tag {
7556                            __FieldTag::__strength => {
7557                                if !fields.insert(__FieldTag::__strength) {
7558                                    return std::result::Result::Err(A::Error::duplicate_field(
7559                                        "multiple values for strength",
7560                                    ));
7561                                }
7562                                struct __With(std::option::Option<f64>);
7563                                impl<'de> serde::de::Deserialize<'de> for __With {
7564                                    fn deserialize<D>(
7565                                        deserializer: D,
7566                                    ) -> std::result::Result<Self, D::Error>
7567                                    where
7568                                        D: serde::de::Deserializer<'de>,
7569                                    {
7570                                        serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
7571                                    }
7572                                }
7573                                result.strength = map.next_value::<__With>()?.0.unwrap_or_default();
7574                            }
7575                            __FieldTag::__tune => {
7576                                if !fields.insert(__FieldTag::__tune) {
7577                                    return std::result::Result::Err(A::Error::duplicate_field(
7578                                        "multiple values for tune",
7579                                    ));
7580                                }
7581                                result.tune = map
7582                                    .next_value::<std::option::Option<std::string::String>>()?
7583                                    .unwrap_or_default();
7584                            }
7585                            __FieldTag::Unknown(key) => {
7586                                let value = map.next_value::<serde_json::Value>()?;
7587                                result._unknown_fields.insert(key, value);
7588                            }
7589                        }
7590                    }
7591                    std::result::Result::Ok(result)
7592                }
7593            }
7594            deserializer.deserialize_any(Visitor)
7595        }
7596    }
7597
7598    #[doc(hidden)]
7599    impl serde::ser::Serialize for Denoise {
7600        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7601        where
7602            S: serde::ser::Serializer,
7603        {
7604            use serde::ser::SerializeMap;
7605            #[allow(unused_imports)]
7606            use std::option::Option::Some;
7607            let mut state = serializer.serialize_map(std::option::Option::None)?;
7608            if !wkt::internal::is_default(&self.strength) {
7609                struct __With<'a>(&'a f64);
7610                impl<'a> serde::ser::Serialize for __With<'a> {
7611                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7612                    where
7613                        S: serde::ser::Serializer,
7614                    {
7615                        serde_with::As::<wkt::internal::F64>::serialize(self.0, serializer)
7616                    }
7617                }
7618                state.serialize_entry("strength", &__With(&self.strength))?;
7619            }
7620            if !self.tune.is_empty() {
7621                state.serialize_entry("tune", &self.tune)?;
7622            }
7623            if !self._unknown_fields.is_empty() {
7624                for (key, value) in self._unknown_fields.iter() {
7625                    state.serialize_entry(key, &value)?;
7626                }
7627            }
7628            state.end()
7629        }
7630    }
7631
7632    impl std::fmt::Debug for Denoise {
7633        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7634            let mut debug_struct = f.debug_struct("Denoise");
7635            debug_struct.field("strength", &self.strength);
7636            debug_struct.field("tune", &self.tune);
7637            if !self._unknown_fields.is_empty() {
7638                debug_struct.field("_unknown_fields", &self._unknown_fields);
7639            }
7640            debug_struct.finish()
7641        }
7642    }
7643
7644    /// Deblock preprocessing configuration.
7645    ///
7646    /// **Note:** This configuration is not supported.
7647    #[derive(Clone, Default, PartialEq)]
7648    #[non_exhaustive]
7649    pub struct Deblock {
7650        /// Set strength of the deblocker. Enter a value between 0 and 1. The higher
7651        /// the value, the stronger the block removal. 0 is no deblocking. The
7652        /// default is 0.
7653        pub strength: f64,
7654
7655        /// Enable deblocker. The default is `false`.
7656        pub enabled: bool,
7657
7658        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7659    }
7660
7661    impl Deblock {
7662        pub fn new() -> Self {
7663            std::default::Default::default()
7664        }
7665
7666        /// Sets the value of [strength][crate::model::preprocessing_config::Deblock::strength].
7667        pub fn set_strength<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
7668            self.strength = v.into();
7669            self
7670        }
7671
7672        /// Sets the value of [enabled][crate::model::preprocessing_config::Deblock::enabled].
7673        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7674            self.enabled = v.into();
7675            self
7676        }
7677    }
7678
7679    impl wkt::message::Message for Deblock {
7680        fn typename() -> &'static str {
7681            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock"
7682        }
7683    }
7684
7685    #[doc(hidden)]
7686    impl<'de> serde::de::Deserialize<'de> for Deblock {
7687        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7688        where
7689            D: serde::Deserializer<'de>,
7690        {
7691            #[allow(non_camel_case_types)]
7692            #[doc(hidden)]
7693            #[derive(PartialEq, Eq, Hash)]
7694            enum __FieldTag {
7695                __strength,
7696                __enabled,
7697                Unknown(std::string::String),
7698            }
7699            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7700                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7701                where
7702                    D: serde::Deserializer<'de>,
7703                {
7704                    struct Visitor;
7705                    impl<'de> serde::de::Visitor<'de> for Visitor {
7706                        type Value = __FieldTag;
7707                        fn expecting(
7708                            &self,
7709                            formatter: &mut std::fmt::Formatter,
7710                        ) -> std::fmt::Result {
7711                            formatter.write_str("a field name for Deblock")
7712                        }
7713                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7714                        where
7715                            E: serde::de::Error,
7716                        {
7717                            use std::result::Result::Ok;
7718                            use std::string::ToString;
7719                            match value {
7720                                "strength" => Ok(__FieldTag::__strength),
7721                                "enabled" => Ok(__FieldTag::__enabled),
7722                                _ => Ok(__FieldTag::Unknown(value.to_string())),
7723                            }
7724                        }
7725                    }
7726                    deserializer.deserialize_identifier(Visitor)
7727                }
7728            }
7729            struct Visitor;
7730            impl<'de> serde::de::Visitor<'de> for Visitor {
7731                type Value = Deblock;
7732                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7733                    formatter.write_str("struct Deblock")
7734                }
7735                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7736                where
7737                    A: serde::de::MapAccess<'de>,
7738                {
7739                    #[allow(unused_imports)]
7740                    use serde::de::Error;
7741                    use std::option::Option::Some;
7742                    let mut fields = std::collections::HashSet::new();
7743                    let mut result = Self::Value::new();
7744                    while let Some(tag) = map.next_key::<__FieldTag>()? {
7745                        #[allow(clippy::match_single_binding)]
7746                        match tag {
7747                            __FieldTag::__strength => {
7748                                if !fields.insert(__FieldTag::__strength) {
7749                                    return std::result::Result::Err(A::Error::duplicate_field(
7750                                        "multiple values for strength",
7751                                    ));
7752                                }
7753                                struct __With(std::option::Option<f64>);
7754                                impl<'de> serde::de::Deserialize<'de> for __With {
7755                                    fn deserialize<D>(
7756                                        deserializer: D,
7757                                    ) -> std::result::Result<Self, D::Error>
7758                                    where
7759                                        D: serde::de::Deserializer<'de>,
7760                                    {
7761                                        serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
7762                                    }
7763                                }
7764                                result.strength = map.next_value::<__With>()?.0.unwrap_or_default();
7765                            }
7766                            __FieldTag::__enabled => {
7767                                if !fields.insert(__FieldTag::__enabled) {
7768                                    return std::result::Result::Err(A::Error::duplicate_field(
7769                                        "multiple values for enabled",
7770                                    ));
7771                                }
7772                                result.enabled = map
7773                                    .next_value::<std::option::Option<bool>>()?
7774                                    .unwrap_or_default();
7775                            }
7776                            __FieldTag::Unknown(key) => {
7777                                let value = map.next_value::<serde_json::Value>()?;
7778                                result._unknown_fields.insert(key, value);
7779                            }
7780                        }
7781                    }
7782                    std::result::Result::Ok(result)
7783                }
7784            }
7785            deserializer.deserialize_any(Visitor)
7786        }
7787    }
7788
7789    #[doc(hidden)]
7790    impl serde::ser::Serialize for Deblock {
7791        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7792        where
7793            S: serde::ser::Serializer,
7794        {
7795            use serde::ser::SerializeMap;
7796            #[allow(unused_imports)]
7797            use std::option::Option::Some;
7798            let mut state = serializer.serialize_map(std::option::Option::None)?;
7799            if !wkt::internal::is_default(&self.strength) {
7800                struct __With<'a>(&'a f64);
7801                impl<'a> serde::ser::Serialize for __With<'a> {
7802                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7803                    where
7804                        S: serde::ser::Serializer,
7805                    {
7806                        serde_with::As::<wkt::internal::F64>::serialize(self.0, serializer)
7807                    }
7808                }
7809                state.serialize_entry("strength", &__With(&self.strength))?;
7810            }
7811            if !wkt::internal::is_default(&self.enabled) {
7812                state.serialize_entry("enabled", &self.enabled)?;
7813            }
7814            if !self._unknown_fields.is_empty() {
7815                for (key, value) in self._unknown_fields.iter() {
7816                    state.serialize_entry(key, &value)?;
7817                }
7818            }
7819            state.end()
7820        }
7821    }
7822
7823    impl std::fmt::Debug for Deblock {
7824        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7825            let mut debug_struct = f.debug_struct("Deblock");
7826            debug_struct.field("strength", &self.strength);
7827            debug_struct.field("enabled", &self.enabled);
7828            if !self._unknown_fields.is_empty() {
7829                debug_struct.field("_unknown_fields", &self._unknown_fields);
7830            }
7831            debug_struct.finish()
7832        }
7833    }
7834
7835    /// Audio preprocessing configuration.
7836    #[derive(Clone, Default, PartialEq)]
7837    #[non_exhaustive]
7838    pub struct Audio {
7839        /// Specify audio loudness normalization in loudness units relative to full
7840        /// scale (LUFS). Enter a value between -24 and 0 (the default), where:
7841        ///
7842        /// * -24 is the Advanced Television Systems Committee (ATSC A/85) standard
7843        /// * -23 is the EU R128 broadcast standard
7844        /// * -19 is the prior standard for online mono audio
7845        /// * -18 is the ReplayGain standard
7846        /// * -16 is the prior standard for stereo audio
7847        /// * -14 is the new online audio standard recommended by Spotify, as well
7848        ///   as Amazon Echo
7849        /// * 0 disables normalization
7850        pub lufs: f64,
7851
7852        /// Enable boosting high frequency components. The default is `false`.
7853        ///
7854        /// **Note:** This field is not supported.
7855        pub high_boost: bool,
7856
7857        /// Enable boosting low frequency components. The default is `false`.
7858        ///
7859        /// **Note:** This field is not supported.
7860        pub low_boost: bool,
7861
7862        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7863    }
7864
7865    impl Audio {
7866        pub fn new() -> Self {
7867            std::default::Default::default()
7868        }
7869
7870        /// Sets the value of [lufs][crate::model::preprocessing_config::Audio::lufs].
7871        pub fn set_lufs<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
7872            self.lufs = v.into();
7873            self
7874        }
7875
7876        /// Sets the value of [high_boost][crate::model::preprocessing_config::Audio::high_boost].
7877        pub fn set_high_boost<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7878            self.high_boost = v.into();
7879            self
7880        }
7881
7882        /// Sets the value of [low_boost][crate::model::preprocessing_config::Audio::low_boost].
7883        pub fn set_low_boost<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7884            self.low_boost = v.into();
7885            self
7886        }
7887    }
7888
7889    impl wkt::message::Message for Audio {
7890        fn typename() -> &'static str {
7891            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Audio"
7892        }
7893    }
7894
7895    #[doc(hidden)]
7896    impl<'de> serde::de::Deserialize<'de> for Audio {
7897        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7898        where
7899            D: serde::Deserializer<'de>,
7900        {
7901            #[allow(non_camel_case_types)]
7902            #[doc(hidden)]
7903            #[derive(PartialEq, Eq, Hash)]
7904            enum __FieldTag {
7905                __lufs,
7906                __high_boost,
7907                __low_boost,
7908                Unknown(std::string::String),
7909            }
7910            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7911                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7912                where
7913                    D: serde::Deserializer<'de>,
7914                {
7915                    struct Visitor;
7916                    impl<'de> serde::de::Visitor<'de> for Visitor {
7917                        type Value = __FieldTag;
7918                        fn expecting(
7919                            &self,
7920                            formatter: &mut std::fmt::Formatter,
7921                        ) -> std::fmt::Result {
7922                            formatter.write_str("a field name for Audio")
7923                        }
7924                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7925                        where
7926                            E: serde::de::Error,
7927                        {
7928                            use std::result::Result::Ok;
7929                            use std::string::ToString;
7930                            match value {
7931                                "lufs" => Ok(__FieldTag::__lufs),
7932                                "highBoost" => Ok(__FieldTag::__high_boost),
7933                                "high_boost" => Ok(__FieldTag::__high_boost),
7934                                "lowBoost" => Ok(__FieldTag::__low_boost),
7935                                "low_boost" => Ok(__FieldTag::__low_boost),
7936                                _ => Ok(__FieldTag::Unknown(value.to_string())),
7937                            }
7938                        }
7939                    }
7940                    deserializer.deserialize_identifier(Visitor)
7941                }
7942            }
7943            struct Visitor;
7944            impl<'de> serde::de::Visitor<'de> for Visitor {
7945                type Value = Audio;
7946                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7947                    formatter.write_str("struct Audio")
7948                }
7949                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7950                where
7951                    A: serde::de::MapAccess<'de>,
7952                {
7953                    #[allow(unused_imports)]
7954                    use serde::de::Error;
7955                    use std::option::Option::Some;
7956                    let mut fields = std::collections::HashSet::new();
7957                    let mut result = Self::Value::new();
7958                    while let Some(tag) = map.next_key::<__FieldTag>()? {
7959                        #[allow(clippy::match_single_binding)]
7960                        match tag {
7961                            __FieldTag::__lufs => {
7962                                if !fields.insert(__FieldTag::__lufs) {
7963                                    return std::result::Result::Err(A::Error::duplicate_field(
7964                                        "multiple values for lufs",
7965                                    ));
7966                                }
7967                                struct __With(std::option::Option<f64>);
7968                                impl<'de> serde::de::Deserialize<'de> for __With {
7969                                    fn deserialize<D>(
7970                                        deserializer: D,
7971                                    ) -> std::result::Result<Self, D::Error>
7972                                    where
7973                                        D: serde::de::Deserializer<'de>,
7974                                    {
7975                                        serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
7976                                    }
7977                                }
7978                                result.lufs = map.next_value::<__With>()?.0.unwrap_or_default();
7979                            }
7980                            __FieldTag::__high_boost => {
7981                                if !fields.insert(__FieldTag::__high_boost) {
7982                                    return std::result::Result::Err(A::Error::duplicate_field(
7983                                        "multiple values for high_boost",
7984                                    ));
7985                                }
7986                                result.high_boost = map
7987                                    .next_value::<std::option::Option<bool>>()?
7988                                    .unwrap_or_default();
7989                            }
7990                            __FieldTag::__low_boost => {
7991                                if !fields.insert(__FieldTag::__low_boost) {
7992                                    return std::result::Result::Err(A::Error::duplicate_field(
7993                                        "multiple values for low_boost",
7994                                    ));
7995                                }
7996                                result.low_boost = map
7997                                    .next_value::<std::option::Option<bool>>()?
7998                                    .unwrap_or_default();
7999                            }
8000                            __FieldTag::Unknown(key) => {
8001                                let value = map.next_value::<serde_json::Value>()?;
8002                                result._unknown_fields.insert(key, value);
8003                            }
8004                        }
8005                    }
8006                    std::result::Result::Ok(result)
8007                }
8008            }
8009            deserializer.deserialize_any(Visitor)
8010        }
8011    }
8012
8013    #[doc(hidden)]
8014    impl serde::ser::Serialize for Audio {
8015        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8016        where
8017            S: serde::ser::Serializer,
8018        {
8019            use serde::ser::SerializeMap;
8020            #[allow(unused_imports)]
8021            use std::option::Option::Some;
8022            let mut state = serializer.serialize_map(std::option::Option::None)?;
8023            if !wkt::internal::is_default(&self.lufs) {
8024                struct __With<'a>(&'a f64);
8025                impl<'a> serde::ser::Serialize for __With<'a> {
8026                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8027                    where
8028                        S: serde::ser::Serializer,
8029                    {
8030                        serde_with::As::<wkt::internal::F64>::serialize(self.0, serializer)
8031                    }
8032                }
8033                state.serialize_entry("lufs", &__With(&self.lufs))?;
8034            }
8035            if !wkt::internal::is_default(&self.high_boost) {
8036                state.serialize_entry("highBoost", &self.high_boost)?;
8037            }
8038            if !wkt::internal::is_default(&self.low_boost) {
8039                state.serialize_entry("lowBoost", &self.low_boost)?;
8040            }
8041            if !self._unknown_fields.is_empty() {
8042                for (key, value) in self._unknown_fields.iter() {
8043                    state.serialize_entry(key, &value)?;
8044                }
8045            }
8046            state.end()
8047        }
8048    }
8049
8050    impl std::fmt::Debug for Audio {
8051        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8052            let mut debug_struct = f.debug_struct("Audio");
8053            debug_struct.field("lufs", &self.lufs);
8054            debug_struct.field("high_boost", &self.high_boost);
8055            debug_struct.field("low_boost", &self.low_boost);
8056            if !self._unknown_fields.is_empty() {
8057                debug_struct.field("_unknown_fields", &self._unknown_fields);
8058            }
8059            debug_struct.finish()
8060        }
8061    }
8062
8063    /// Video cropping configuration for the input video. The cropped input video
8064    /// is scaled to match the output resolution.
8065    #[derive(Clone, Default, PartialEq)]
8066    #[non_exhaustive]
8067    pub struct Crop {
8068        /// The number of pixels to crop from the top. The default is 0.
8069        pub top_pixels: i32,
8070
8071        /// The number of pixels to crop from the bottom. The default is 0.
8072        pub bottom_pixels: i32,
8073
8074        /// The number of pixels to crop from the left. The default is 0.
8075        pub left_pixels: i32,
8076
8077        /// The number of pixels to crop from the right. The default is 0.
8078        pub right_pixels: i32,
8079
8080        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8081    }
8082
8083    impl Crop {
8084        pub fn new() -> Self {
8085            std::default::Default::default()
8086        }
8087
8088        /// Sets the value of [top_pixels][crate::model::preprocessing_config::Crop::top_pixels].
8089        pub fn set_top_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8090            self.top_pixels = v.into();
8091            self
8092        }
8093
8094        /// Sets the value of [bottom_pixels][crate::model::preprocessing_config::Crop::bottom_pixels].
8095        pub fn set_bottom_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8096            self.bottom_pixels = v.into();
8097            self
8098        }
8099
8100        /// Sets the value of [left_pixels][crate::model::preprocessing_config::Crop::left_pixels].
8101        pub fn set_left_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8102            self.left_pixels = v.into();
8103            self
8104        }
8105
8106        /// Sets the value of [right_pixels][crate::model::preprocessing_config::Crop::right_pixels].
8107        pub fn set_right_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8108            self.right_pixels = v.into();
8109            self
8110        }
8111    }
8112
8113    impl wkt::message::Message for Crop {
8114        fn typename() -> &'static str {
8115            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Crop"
8116        }
8117    }
8118
8119    #[doc(hidden)]
8120    impl<'de> serde::de::Deserialize<'de> for Crop {
8121        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8122        where
8123            D: serde::Deserializer<'de>,
8124        {
8125            #[allow(non_camel_case_types)]
8126            #[doc(hidden)]
8127            #[derive(PartialEq, Eq, Hash)]
8128            enum __FieldTag {
8129                __top_pixels,
8130                __bottom_pixels,
8131                __left_pixels,
8132                __right_pixels,
8133                Unknown(std::string::String),
8134            }
8135            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8136                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8137                where
8138                    D: serde::Deserializer<'de>,
8139                {
8140                    struct Visitor;
8141                    impl<'de> serde::de::Visitor<'de> for Visitor {
8142                        type Value = __FieldTag;
8143                        fn expecting(
8144                            &self,
8145                            formatter: &mut std::fmt::Formatter,
8146                        ) -> std::fmt::Result {
8147                            formatter.write_str("a field name for Crop")
8148                        }
8149                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8150                        where
8151                            E: serde::de::Error,
8152                        {
8153                            use std::result::Result::Ok;
8154                            use std::string::ToString;
8155                            match value {
8156                                "topPixels" => Ok(__FieldTag::__top_pixels),
8157                                "top_pixels" => Ok(__FieldTag::__top_pixels),
8158                                "bottomPixels" => Ok(__FieldTag::__bottom_pixels),
8159                                "bottom_pixels" => Ok(__FieldTag::__bottom_pixels),
8160                                "leftPixels" => Ok(__FieldTag::__left_pixels),
8161                                "left_pixels" => Ok(__FieldTag::__left_pixels),
8162                                "rightPixels" => Ok(__FieldTag::__right_pixels),
8163                                "right_pixels" => Ok(__FieldTag::__right_pixels),
8164                                _ => Ok(__FieldTag::Unknown(value.to_string())),
8165                            }
8166                        }
8167                    }
8168                    deserializer.deserialize_identifier(Visitor)
8169                }
8170            }
8171            struct Visitor;
8172            impl<'de> serde::de::Visitor<'de> for Visitor {
8173                type Value = Crop;
8174                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8175                    formatter.write_str("struct Crop")
8176                }
8177                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8178                where
8179                    A: serde::de::MapAccess<'de>,
8180                {
8181                    #[allow(unused_imports)]
8182                    use serde::de::Error;
8183                    use std::option::Option::Some;
8184                    let mut fields = std::collections::HashSet::new();
8185                    let mut result = Self::Value::new();
8186                    while let Some(tag) = map.next_key::<__FieldTag>()? {
8187                        #[allow(clippy::match_single_binding)]
8188                        match tag {
8189                            __FieldTag::__top_pixels => {
8190                                if !fields.insert(__FieldTag::__top_pixels) {
8191                                    return std::result::Result::Err(A::Error::duplicate_field(
8192                                        "multiple values for top_pixels",
8193                                    ));
8194                                }
8195                                struct __With(std::option::Option<i32>);
8196                                impl<'de> serde::de::Deserialize<'de> for __With {
8197                                    fn deserialize<D>(
8198                                        deserializer: D,
8199                                    ) -> std::result::Result<Self, D::Error>
8200                                    where
8201                                        D: serde::de::Deserializer<'de>,
8202                                    {
8203                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
8204                                    }
8205                                }
8206                                result.top_pixels =
8207                                    map.next_value::<__With>()?.0.unwrap_or_default();
8208                            }
8209                            __FieldTag::__bottom_pixels => {
8210                                if !fields.insert(__FieldTag::__bottom_pixels) {
8211                                    return std::result::Result::Err(A::Error::duplicate_field(
8212                                        "multiple values for bottom_pixels",
8213                                    ));
8214                                }
8215                                struct __With(std::option::Option<i32>);
8216                                impl<'de> serde::de::Deserialize<'de> for __With {
8217                                    fn deserialize<D>(
8218                                        deserializer: D,
8219                                    ) -> std::result::Result<Self, D::Error>
8220                                    where
8221                                        D: serde::de::Deserializer<'de>,
8222                                    {
8223                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
8224                                    }
8225                                }
8226                                result.bottom_pixels =
8227                                    map.next_value::<__With>()?.0.unwrap_or_default();
8228                            }
8229                            __FieldTag::__left_pixels => {
8230                                if !fields.insert(__FieldTag::__left_pixels) {
8231                                    return std::result::Result::Err(A::Error::duplicate_field(
8232                                        "multiple values for left_pixels",
8233                                    ));
8234                                }
8235                                struct __With(std::option::Option<i32>);
8236                                impl<'de> serde::de::Deserialize<'de> for __With {
8237                                    fn deserialize<D>(
8238                                        deserializer: D,
8239                                    ) -> std::result::Result<Self, D::Error>
8240                                    where
8241                                        D: serde::de::Deserializer<'de>,
8242                                    {
8243                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
8244                                    }
8245                                }
8246                                result.left_pixels =
8247                                    map.next_value::<__With>()?.0.unwrap_or_default();
8248                            }
8249                            __FieldTag::__right_pixels => {
8250                                if !fields.insert(__FieldTag::__right_pixels) {
8251                                    return std::result::Result::Err(A::Error::duplicate_field(
8252                                        "multiple values for right_pixels",
8253                                    ));
8254                                }
8255                                struct __With(std::option::Option<i32>);
8256                                impl<'de> serde::de::Deserialize<'de> for __With {
8257                                    fn deserialize<D>(
8258                                        deserializer: D,
8259                                    ) -> std::result::Result<Self, D::Error>
8260                                    where
8261                                        D: serde::de::Deserializer<'de>,
8262                                    {
8263                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
8264                                    }
8265                                }
8266                                result.right_pixels =
8267                                    map.next_value::<__With>()?.0.unwrap_or_default();
8268                            }
8269                            __FieldTag::Unknown(key) => {
8270                                let value = map.next_value::<serde_json::Value>()?;
8271                                result._unknown_fields.insert(key, value);
8272                            }
8273                        }
8274                    }
8275                    std::result::Result::Ok(result)
8276                }
8277            }
8278            deserializer.deserialize_any(Visitor)
8279        }
8280    }
8281
8282    #[doc(hidden)]
8283    impl serde::ser::Serialize for Crop {
8284        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8285        where
8286            S: serde::ser::Serializer,
8287        {
8288            use serde::ser::SerializeMap;
8289            #[allow(unused_imports)]
8290            use std::option::Option::Some;
8291            let mut state = serializer.serialize_map(std::option::Option::None)?;
8292            if !wkt::internal::is_default(&self.top_pixels) {
8293                struct __With<'a>(&'a i32);
8294                impl<'a> serde::ser::Serialize for __With<'a> {
8295                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8296                    where
8297                        S: serde::ser::Serializer,
8298                    {
8299                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
8300                    }
8301                }
8302                state.serialize_entry("topPixels", &__With(&self.top_pixels))?;
8303            }
8304            if !wkt::internal::is_default(&self.bottom_pixels) {
8305                struct __With<'a>(&'a i32);
8306                impl<'a> serde::ser::Serialize for __With<'a> {
8307                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8308                    where
8309                        S: serde::ser::Serializer,
8310                    {
8311                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
8312                    }
8313                }
8314                state.serialize_entry("bottomPixels", &__With(&self.bottom_pixels))?;
8315            }
8316            if !wkt::internal::is_default(&self.left_pixels) {
8317                struct __With<'a>(&'a i32);
8318                impl<'a> serde::ser::Serialize for __With<'a> {
8319                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8320                    where
8321                        S: serde::ser::Serializer,
8322                    {
8323                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
8324                    }
8325                }
8326                state.serialize_entry("leftPixels", &__With(&self.left_pixels))?;
8327            }
8328            if !wkt::internal::is_default(&self.right_pixels) {
8329                struct __With<'a>(&'a i32);
8330                impl<'a> serde::ser::Serialize for __With<'a> {
8331                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8332                    where
8333                        S: serde::ser::Serializer,
8334                    {
8335                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
8336                    }
8337                }
8338                state.serialize_entry("rightPixels", &__With(&self.right_pixels))?;
8339            }
8340            if !self._unknown_fields.is_empty() {
8341                for (key, value) in self._unknown_fields.iter() {
8342                    state.serialize_entry(key, &value)?;
8343                }
8344            }
8345            state.end()
8346        }
8347    }
8348
8349    impl std::fmt::Debug for Crop {
8350        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8351            let mut debug_struct = f.debug_struct("Crop");
8352            debug_struct.field("top_pixels", &self.top_pixels);
8353            debug_struct.field("bottom_pixels", &self.bottom_pixels);
8354            debug_struct.field("left_pixels", &self.left_pixels);
8355            debug_struct.field("right_pixels", &self.right_pixels);
8356            if !self._unknown_fields.is_empty() {
8357                debug_struct.field("_unknown_fields", &self._unknown_fields);
8358            }
8359            debug_struct.finish()
8360        }
8361    }
8362
8363    /// Pad filter configuration for the input video. The padded input video
8364    /// is scaled after padding with black to match the output resolution.
8365    #[derive(Clone, Default, PartialEq)]
8366    #[non_exhaustive]
8367    pub struct Pad {
8368        /// The number of pixels to add to the top. The default is 0.
8369        pub top_pixels: i32,
8370
8371        /// The number of pixels to add to the bottom. The default is 0.
8372        pub bottom_pixels: i32,
8373
8374        /// The number of pixels to add to the left. The default is 0.
8375        pub left_pixels: i32,
8376
8377        /// The number of pixels to add to the right. The default is 0.
8378        pub right_pixels: i32,
8379
8380        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8381    }
8382
8383    impl Pad {
8384        pub fn new() -> Self {
8385            std::default::Default::default()
8386        }
8387
8388        /// Sets the value of [top_pixels][crate::model::preprocessing_config::Pad::top_pixels].
8389        pub fn set_top_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8390            self.top_pixels = v.into();
8391            self
8392        }
8393
8394        /// Sets the value of [bottom_pixels][crate::model::preprocessing_config::Pad::bottom_pixels].
8395        pub fn set_bottom_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8396            self.bottom_pixels = v.into();
8397            self
8398        }
8399
8400        /// Sets the value of [left_pixels][crate::model::preprocessing_config::Pad::left_pixels].
8401        pub fn set_left_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8402            self.left_pixels = v.into();
8403            self
8404        }
8405
8406        /// Sets the value of [right_pixels][crate::model::preprocessing_config::Pad::right_pixels].
8407        pub fn set_right_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8408            self.right_pixels = v.into();
8409            self
8410        }
8411    }
8412
8413    impl wkt::message::Message for Pad {
8414        fn typename() -> &'static str {
8415            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Pad"
8416        }
8417    }
8418
8419    #[doc(hidden)]
8420    impl<'de> serde::de::Deserialize<'de> for Pad {
8421        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8422        where
8423            D: serde::Deserializer<'de>,
8424        {
8425            #[allow(non_camel_case_types)]
8426            #[doc(hidden)]
8427            #[derive(PartialEq, Eq, Hash)]
8428            enum __FieldTag {
8429                __top_pixels,
8430                __bottom_pixels,
8431                __left_pixels,
8432                __right_pixels,
8433                Unknown(std::string::String),
8434            }
8435            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8436                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8437                where
8438                    D: serde::Deserializer<'de>,
8439                {
8440                    struct Visitor;
8441                    impl<'de> serde::de::Visitor<'de> for Visitor {
8442                        type Value = __FieldTag;
8443                        fn expecting(
8444                            &self,
8445                            formatter: &mut std::fmt::Formatter,
8446                        ) -> std::fmt::Result {
8447                            formatter.write_str("a field name for Pad")
8448                        }
8449                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8450                        where
8451                            E: serde::de::Error,
8452                        {
8453                            use std::result::Result::Ok;
8454                            use std::string::ToString;
8455                            match value {
8456                                "topPixels" => Ok(__FieldTag::__top_pixels),
8457                                "top_pixels" => Ok(__FieldTag::__top_pixels),
8458                                "bottomPixels" => Ok(__FieldTag::__bottom_pixels),
8459                                "bottom_pixels" => Ok(__FieldTag::__bottom_pixels),
8460                                "leftPixels" => Ok(__FieldTag::__left_pixels),
8461                                "left_pixels" => Ok(__FieldTag::__left_pixels),
8462                                "rightPixels" => Ok(__FieldTag::__right_pixels),
8463                                "right_pixels" => Ok(__FieldTag::__right_pixels),
8464                                _ => Ok(__FieldTag::Unknown(value.to_string())),
8465                            }
8466                        }
8467                    }
8468                    deserializer.deserialize_identifier(Visitor)
8469                }
8470            }
8471            struct Visitor;
8472            impl<'de> serde::de::Visitor<'de> for Visitor {
8473                type Value = Pad;
8474                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8475                    formatter.write_str("struct Pad")
8476                }
8477                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8478                where
8479                    A: serde::de::MapAccess<'de>,
8480                {
8481                    #[allow(unused_imports)]
8482                    use serde::de::Error;
8483                    use std::option::Option::Some;
8484                    let mut fields = std::collections::HashSet::new();
8485                    let mut result = Self::Value::new();
8486                    while let Some(tag) = map.next_key::<__FieldTag>()? {
8487                        #[allow(clippy::match_single_binding)]
8488                        match tag {
8489                            __FieldTag::__top_pixels => {
8490                                if !fields.insert(__FieldTag::__top_pixels) {
8491                                    return std::result::Result::Err(A::Error::duplicate_field(
8492                                        "multiple values for top_pixels",
8493                                    ));
8494                                }
8495                                struct __With(std::option::Option<i32>);
8496                                impl<'de> serde::de::Deserialize<'de> for __With {
8497                                    fn deserialize<D>(
8498                                        deserializer: D,
8499                                    ) -> std::result::Result<Self, D::Error>
8500                                    where
8501                                        D: serde::de::Deserializer<'de>,
8502                                    {
8503                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
8504                                    }
8505                                }
8506                                result.top_pixels =
8507                                    map.next_value::<__With>()?.0.unwrap_or_default();
8508                            }
8509                            __FieldTag::__bottom_pixels => {
8510                                if !fields.insert(__FieldTag::__bottom_pixels) {
8511                                    return std::result::Result::Err(A::Error::duplicate_field(
8512                                        "multiple values for bottom_pixels",
8513                                    ));
8514                                }
8515                                struct __With(std::option::Option<i32>);
8516                                impl<'de> serde::de::Deserialize<'de> for __With {
8517                                    fn deserialize<D>(
8518                                        deserializer: D,
8519                                    ) -> std::result::Result<Self, D::Error>
8520                                    where
8521                                        D: serde::de::Deserializer<'de>,
8522                                    {
8523                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
8524                                    }
8525                                }
8526                                result.bottom_pixels =
8527                                    map.next_value::<__With>()?.0.unwrap_or_default();
8528                            }
8529                            __FieldTag::__left_pixels => {
8530                                if !fields.insert(__FieldTag::__left_pixels) {
8531                                    return std::result::Result::Err(A::Error::duplicate_field(
8532                                        "multiple values for left_pixels",
8533                                    ));
8534                                }
8535                                struct __With(std::option::Option<i32>);
8536                                impl<'de> serde::de::Deserialize<'de> for __With {
8537                                    fn deserialize<D>(
8538                                        deserializer: D,
8539                                    ) -> std::result::Result<Self, D::Error>
8540                                    where
8541                                        D: serde::de::Deserializer<'de>,
8542                                    {
8543                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
8544                                    }
8545                                }
8546                                result.left_pixels =
8547                                    map.next_value::<__With>()?.0.unwrap_or_default();
8548                            }
8549                            __FieldTag::__right_pixels => {
8550                                if !fields.insert(__FieldTag::__right_pixels) {
8551                                    return std::result::Result::Err(A::Error::duplicate_field(
8552                                        "multiple values for right_pixels",
8553                                    ));
8554                                }
8555                                struct __With(std::option::Option<i32>);
8556                                impl<'de> serde::de::Deserialize<'de> for __With {
8557                                    fn deserialize<D>(
8558                                        deserializer: D,
8559                                    ) -> std::result::Result<Self, D::Error>
8560                                    where
8561                                        D: serde::de::Deserializer<'de>,
8562                                    {
8563                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
8564                                    }
8565                                }
8566                                result.right_pixels =
8567                                    map.next_value::<__With>()?.0.unwrap_or_default();
8568                            }
8569                            __FieldTag::Unknown(key) => {
8570                                let value = map.next_value::<serde_json::Value>()?;
8571                                result._unknown_fields.insert(key, value);
8572                            }
8573                        }
8574                    }
8575                    std::result::Result::Ok(result)
8576                }
8577            }
8578            deserializer.deserialize_any(Visitor)
8579        }
8580    }
8581
8582    #[doc(hidden)]
8583    impl serde::ser::Serialize for Pad {
8584        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8585        where
8586            S: serde::ser::Serializer,
8587        {
8588            use serde::ser::SerializeMap;
8589            #[allow(unused_imports)]
8590            use std::option::Option::Some;
8591            let mut state = serializer.serialize_map(std::option::Option::None)?;
8592            if !wkt::internal::is_default(&self.top_pixels) {
8593                struct __With<'a>(&'a i32);
8594                impl<'a> serde::ser::Serialize for __With<'a> {
8595                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8596                    where
8597                        S: serde::ser::Serializer,
8598                    {
8599                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
8600                    }
8601                }
8602                state.serialize_entry("topPixels", &__With(&self.top_pixels))?;
8603            }
8604            if !wkt::internal::is_default(&self.bottom_pixels) {
8605                struct __With<'a>(&'a i32);
8606                impl<'a> serde::ser::Serialize for __With<'a> {
8607                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8608                    where
8609                        S: serde::ser::Serializer,
8610                    {
8611                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
8612                    }
8613                }
8614                state.serialize_entry("bottomPixels", &__With(&self.bottom_pixels))?;
8615            }
8616            if !wkt::internal::is_default(&self.left_pixels) {
8617                struct __With<'a>(&'a i32);
8618                impl<'a> serde::ser::Serialize for __With<'a> {
8619                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8620                    where
8621                        S: serde::ser::Serializer,
8622                    {
8623                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
8624                    }
8625                }
8626                state.serialize_entry("leftPixels", &__With(&self.left_pixels))?;
8627            }
8628            if !wkt::internal::is_default(&self.right_pixels) {
8629                struct __With<'a>(&'a i32);
8630                impl<'a> serde::ser::Serialize for __With<'a> {
8631                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8632                    where
8633                        S: serde::ser::Serializer,
8634                    {
8635                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
8636                    }
8637                }
8638                state.serialize_entry("rightPixels", &__With(&self.right_pixels))?;
8639            }
8640            if !self._unknown_fields.is_empty() {
8641                for (key, value) in self._unknown_fields.iter() {
8642                    state.serialize_entry(key, &value)?;
8643                }
8644            }
8645            state.end()
8646        }
8647    }
8648
8649    impl std::fmt::Debug for Pad {
8650        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8651            let mut debug_struct = f.debug_struct("Pad");
8652            debug_struct.field("top_pixels", &self.top_pixels);
8653            debug_struct.field("bottom_pixels", &self.bottom_pixels);
8654            debug_struct.field("left_pixels", &self.left_pixels);
8655            debug_struct.field("right_pixels", &self.right_pixels);
8656            if !self._unknown_fields.is_empty() {
8657                debug_struct.field("_unknown_fields", &self._unknown_fields);
8658            }
8659            debug_struct.finish()
8660        }
8661    }
8662
8663    /// Deinterlace configuration for input video.
8664    #[derive(Clone, Default, PartialEq)]
8665    #[non_exhaustive]
8666    pub struct Deinterlace {
8667        /// Specify the video deinterlacing filter. The default is `yadif`.
8668        pub deinterlacing_filter: std::option::Option<
8669            crate::model::preprocessing_config::deinterlace::DeinterlacingFilter,
8670        >,
8671
8672        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8673    }
8674
8675    impl Deinterlace {
8676        pub fn new() -> Self {
8677            std::default::Default::default()
8678        }
8679
8680        /// Sets the value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter].
8681        ///
8682        /// Note that all the setters affecting `deinterlacing_filter` are mutually
8683        /// exclusive.
8684        pub fn set_deinterlacing_filter<
8685            T: std::convert::Into<
8686                    std::option::Option<
8687                        crate::model::preprocessing_config::deinterlace::DeinterlacingFilter,
8688                    >,
8689                >,
8690        >(
8691            mut self,
8692            v: T,
8693        ) -> Self {
8694            self.deinterlacing_filter = v.into();
8695            self
8696        }
8697
8698        /// The value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter]
8699        /// if it holds a `Yadif`, `None` if the field is not set or
8700        /// holds a different branch.
8701        pub fn yadif(
8702            &self,
8703        ) -> std::option::Option<
8704            &std::boxed::Box<crate::model::preprocessing_config::deinterlace::YadifConfig>,
8705        > {
8706            #[allow(unreachable_patterns)]
8707            self.deinterlacing_filter.as_ref().and_then(|v| match v {
8708                crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Yadif(v) => {
8709                    std::option::Option::Some(v)
8710                }
8711                _ => std::option::Option::None,
8712            })
8713        }
8714
8715        /// Sets the value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter]
8716        /// to hold a `Yadif`.
8717        ///
8718        /// Note that all the setters affecting `deinterlacing_filter` are
8719        /// mutually exclusive.
8720        pub fn set_yadif<
8721            T: std::convert::Into<
8722                    std::boxed::Box<crate::model::preprocessing_config::deinterlace::YadifConfig>,
8723                >,
8724        >(
8725            mut self,
8726            v: T,
8727        ) -> Self {
8728            self.deinterlacing_filter = std::option::Option::Some(
8729                crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Yadif(
8730                    v.into(),
8731                ),
8732            );
8733            self
8734        }
8735
8736        /// The value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter]
8737        /// if it holds a `Bwdif`, `None` if the field is not set or
8738        /// holds a different branch.
8739        pub fn bwdif(
8740            &self,
8741        ) -> std::option::Option<
8742            &std::boxed::Box<crate::model::preprocessing_config::deinterlace::BwdifConfig>,
8743        > {
8744            #[allow(unreachable_patterns)]
8745            self.deinterlacing_filter.as_ref().and_then(|v| match v {
8746                crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Bwdif(v) => {
8747                    std::option::Option::Some(v)
8748                }
8749                _ => std::option::Option::None,
8750            })
8751        }
8752
8753        /// Sets the value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter]
8754        /// to hold a `Bwdif`.
8755        ///
8756        /// Note that all the setters affecting `deinterlacing_filter` are
8757        /// mutually exclusive.
8758        pub fn set_bwdif<
8759            T: std::convert::Into<
8760                    std::boxed::Box<crate::model::preprocessing_config::deinterlace::BwdifConfig>,
8761                >,
8762        >(
8763            mut self,
8764            v: T,
8765        ) -> Self {
8766            self.deinterlacing_filter = std::option::Option::Some(
8767                crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Bwdif(
8768                    v.into(),
8769                ),
8770            );
8771            self
8772        }
8773    }
8774
8775    impl wkt::message::Message for Deinterlace {
8776        fn typename() -> &'static str {
8777            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace"
8778        }
8779    }
8780
8781    #[doc(hidden)]
8782    impl<'de> serde::de::Deserialize<'de> for Deinterlace {
8783        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8784        where
8785            D: serde::Deserializer<'de>,
8786        {
8787            #[allow(non_camel_case_types)]
8788            #[doc(hidden)]
8789            #[derive(PartialEq, Eq, Hash)]
8790            enum __FieldTag {
8791                __yadif,
8792                __bwdif,
8793                Unknown(std::string::String),
8794            }
8795            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8796                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8797                where
8798                    D: serde::Deserializer<'de>,
8799                {
8800                    struct Visitor;
8801                    impl<'de> serde::de::Visitor<'de> for Visitor {
8802                        type Value = __FieldTag;
8803                        fn expecting(
8804                            &self,
8805                            formatter: &mut std::fmt::Formatter,
8806                        ) -> std::fmt::Result {
8807                            formatter.write_str("a field name for Deinterlace")
8808                        }
8809                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8810                        where
8811                            E: serde::de::Error,
8812                        {
8813                            use std::result::Result::Ok;
8814                            use std::string::ToString;
8815                            match value {
8816                                "yadif" => Ok(__FieldTag::__yadif),
8817                                "bwdif" => Ok(__FieldTag::__bwdif),
8818                                _ => Ok(__FieldTag::Unknown(value.to_string())),
8819                            }
8820                        }
8821                    }
8822                    deserializer.deserialize_identifier(Visitor)
8823                }
8824            }
8825            struct Visitor;
8826            impl<'de> serde::de::Visitor<'de> for Visitor {
8827                type Value = Deinterlace;
8828                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8829                    formatter.write_str("struct Deinterlace")
8830                }
8831                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8832                where
8833                    A: serde::de::MapAccess<'de>,
8834                {
8835                    #[allow(unused_imports)]
8836                    use serde::de::Error;
8837                    use std::option::Option::Some;
8838                    let mut fields = std::collections::HashSet::new();
8839                    let mut result = Self::Value::new();
8840                    while let Some(tag) = map.next_key::<__FieldTag>()? {
8841                        #[allow(clippy::match_single_binding)]
8842                        match tag {
8843                            __FieldTag::__yadif => {
8844                                if !fields.insert(__FieldTag::__yadif) {
8845                                    return std::result::Result::Err(A::Error::duplicate_field(
8846                                        "multiple values for yadif",
8847                                    ));
8848                                }
8849                                if result.deinterlacing_filter.is_some() {
8850                                    return std::result::Result::Err(A::Error::duplicate_field(
8851                                        "multiple values for `deinterlacing_filter`, a oneof with full ID .google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace.yadif, latest field was yadif",
8852                                    ));
8853                                }
8854                                result.deinterlacing_filter = std::option::Option::Some(
8855                                    crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Yadif(
8856                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::preprocessing_config::deinterlace::YadifConfig>>>()?.unwrap_or_default()
8857                                    ),
8858                                );
8859                            }
8860                            __FieldTag::__bwdif => {
8861                                if !fields.insert(__FieldTag::__bwdif) {
8862                                    return std::result::Result::Err(A::Error::duplicate_field(
8863                                        "multiple values for bwdif",
8864                                    ));
8865                                }
8866                                if result.deinterlacing_filter.is_some() {
8867                                    return std::result::Result::Err(A::Error::duplicate_field(
8868                                        "multiple values for `deinterlacing_filter`, a oneof with full ID .google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace.bwdif, latest field was bwdif",
8869                                    ));
8870                                }
8871                                result.deinterlacing_filter = std::option::Option::Some(
8872                                    crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Bwdif(
8873                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::preprocessing_config::deinterlace::BwdifConfig>>>()?.unwrap_or_default()
8874                                    ),
8875                                );
8876                            }
8877                            __FieldTag::Unknown(key) => {
8878                                let value = map.next_value::<serde_json::Value>()?;
8879                                result._unknown_fields.insert(key, value);
8880                            }
8881                        }
8882                    }
8883                    std::result::Result::Ok(result)
8884                }
8885            }
8886            deserializer.deserialize_any(Visitor)
8887        }
8888    }
8889
8890    #[doc(hidden)]
8891    impl serde::ser::Serialize for Deinterlace {
8892        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8893        where
8894            S: serde::ser::Serializer,
8895        {
8896            use serde::ser::SerializeMap;
8897            #[allow(unused_imports)]
8898            use std::option::Option::Some;
8899            let mut state = serializer.serialize_map(std::option::Option::None)?;
8900            if let Some(value) = self.yadif() {
8901                state.serialize_entry("yadif", value)?;
8902            }
8903            if let Some(value) = self.bwdif() {
8904                state.serialize_entry("bwdif", value)?;
8905            }
8906            if !self._unknown_fields.is_empty() {
8907                for (key, value) in self._unknown_fields.iter() {
8908                    state.serialize_entry(key, &value)?;
8909                }
8910            }
8911            state.end()
8912        }
8913    }
8914
8915    impl std::fmt::Debug for Deinterlace {
8916        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8917            let mut debug_struct = f.debug_struct("Deinterlace");
8918            debug_struct.field("deinterlacing_filter", &self.deinterlacing_filter);
8919            if !self._unknown_fields.is_empty() {
8920                debug_struct.field("_unknown_fields", &self._unknown_fields);
8921            }
8922            debug_struct.finish()
8923        }
8924    }
8925
8926    /// Defines additional types related to [Deinterlace].
8927    pub mod deinterlace {
8928        #[allow(unused_imports)]
8929        use super::*;
8930
8931        /// Yet Another Deinterlacing Filter Configuration.
8932        #[derive(Clone, Default, PartialEq)]
8933        #[non_exhaustive]
8934        pub struct YadifConfig {
8935            /// Specifies the deinterlacing mode to adopt.
8936            /// The default is `send_frame`.
8937            /// Supported values:
8938            ///
8939            /// - `send_frame`: Output one frame for each frame
8940            /// - `send_field`: Output one frame for each field
8941            pub mode: std::string::String,
8942
8943            /// Disable spacial interlacing.
8944            /// The default is `false`.
8945            pub disable_spatial_interlacing: bool,
8946
8947            /// The picture field parity assumed for the input interlaced video.
8948            /// The default is `auto`.
8949            /// Supported values:
8950            ///
8951            /// - `tff`: Assume the top field is first
8952            /// - `bff`: Assume the bottom field is first
8953            /// - `auto`: Enable automatic detection of field parity
8954            pub parity: std::string::String,
8955
8956            /// Deinterlace all frames rather than just the frames identified as
8957            /// interlaced. The default is `false`.
8958            pub deinterlace_all_frames: bool,
8959
8960            _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8961        }
8962
8963        impl YadifConfig {
8964            pub fn new() -> Self {
8965                std::default::Default::default()
8966            }
8967
8968            /// Sets the value of [mode][crate::model::preprocessing_config::deinterlace::YadifConfig::mode].
8969            pub fn set_mode<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8970                self.mode = v.into();
8971                self
8972            }
8973
8974            /// Sets the value of [disable_spatial_interlacing][crate::model::preprocessing_config::deinterlace::YadifConfig::disable_spatial_interlacing].
8975            pub fn set_disable_spatial_interlacing<T: std::convert::Into<bool>>(
8976                mut self,
8977                v: T,
8978            ) -> Self {
8979                self.disable_spatial_interlacing = v.into();
8980                self
8981            }
8982
8983            /// Sets the value of [parity][crate::model::preprocessing_config::deinterlace::YadifConfig::parity].
8984            pub fn set_parity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8985                self.parity = v.into();
8986                self
8987            }
8988
8989            /// Sets the value of [deinterlace_all_frames][crate::model::preprocessing_config::deinterlace::YadifConfig::deinterlace_all_frames].
8990            pub fn set_deinterlace_all_frames<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8991                self.deinterlace_all_frames = v.into();
8992                self
8993            }
8994        }
8995
8996        impl wkt::message::Message for YadifConfig {
8997            fn typename() -> &'static str {
8998                "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace.YadifConfig"
8999            }
9000        }
9001
9002        #[doc(hidden)]
9003        impl<'de> serde::de::Deserialize<'de> for YadifConfig {
9004            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9005            where
9006                D: serde::Deserializer<'de>,
9007            {
9008                #[allow(non_camel_case_types)]
9009                #[doc(hidden)]
9010                #[derive(PartialEq, Eq, Hash)]
9011                enum __FieldTag {
9012                    __mode,
9013                    __disable_spatial_interlacing,
9014                    __parity,
9015                    __deinterlace_all_frames,
9016                    Unknown(std::string::String),
9017                }
9018                impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9019                    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9020                    where
9021                        D: serde::Deserializer<'de>,
9022                    {
9023                        struct Visitor;
9024                        impl<'de> serde::de::Visitor<'de> for Visitor {
9025                            type Value = __FieldTag;
9026                            fn expecting(
9027                                &self,
9028                                formatter: &mut std::fmt::Formatter,
9029                            ) -> std::fmt::Result {
9030                                formatter.write_str("a field name for YadifConfig")
9031                            }
9032                            fn visit_str<E>(
9033                                self,
9034                                value: &str,
9035                            ) -> std::result::Result<Self::Value, E>
9036                            where
9037                                E: serde::de::Error,
9038                            {
9039                                use std::result::Result::Ok;
9040                                use std::string::ToString;
9041                                match value {
9042                                    "mode" => Ok(__FieldTag::__mode),
9043                                    "disableSpatialInterlacing" => {
9044                                        Ok(__FieldTag::__disable_spatial_interlacing)
9045                                    }
9046                                    "disable_spatial_interlacing" => {
9047                                        Ok(__FieldTag::__disable_spatial_interlacing)
9048                                    }
9049                                    "parity" => Ok(__FieldTag::__parity),
9050                                    "deinterlaceAllFrames" => {
9051                                        Ok(__FieldTag::__deinterlace_all_frames)
9052                                    }
9053                                    "deinterlace_all_frames" => {
9054                                        Ok(__FieldTag::__deinterlace_all_frames)
9055                                    }
9056                                    _ => Ok(__FieldTag::Unknown(value.to_string())),
9057                                }
9058                            }
9059                        }
9060                        deserializer.deserialize_identifier(Visitor)
9061                    }
9062                }
9063                struct Visitor;
9064                impl<'de> serde::de::Visitor<'de> for Visitor {
9065                    type Value = YadifConfig;
9066                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9067                        formatter.write_str("struct YadifConfig")
9068                    }
9069                    fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9070                    where
9071                        A: serde::de::MapAccess<'de>,
9072                    {
9073                        #[allow(unused_imports)]
9074                        use serde::de::Error;
9075                        use std::option::Option::Some;
9076                        let mut fields = std::collections::HashSet::new();
9077                        let mut result = Self::Value::new();
9078                        while let Some(tag) = map.next_key::<__FieldTag>()? {
9079                            #[allow(clippy::match_single_binding)]
9080                            match tag {
9081                                __FieldTag::__mode => {
9082                                    if !fields.insert(__FieldTag::__mode) {
9083                                        return std::result::Result::Err(
9084                                            A::Error::duplicate_field("multiple values for mode"),
9085                                        );
9086                                    }
9087                                    result.mode = map
9088                                        .next_value::<std::option::Option<std::string::String>>()?
9089                                        .unwrap_or_default();
9090                                }
9091                                __FieldTag::__disable_spatial_interlacing => {
9092                                    if !fields.insert(__FieldTag::__disable_spatial_interlacing) {
9093                                        return std::result::Result::Err(
9094                                            A::Error::duplicate_field(
9095                                                "multiple values for disable_spatial_interlacing",
9096                                            ),
9097                                        );
9098                                    }
9099                                    result.disable_spatial_interlacing = map
9100                                        .next_value::<std::option::Option<bool>>()?
9101                                        .unwrap_or_default();
9102                                }
9103                                __FieldTag::__parity => {
9104                                    if !fields.insert(__FieldTag::__parity) {
9105                                        return std::result::Result::Err(
9106                                            A::Error::duplicate_field("multiple values for parity"),
9107                                        );
9108                                    }
9109                                    result.parity = map
9110                                        .next_value::<std::option::Option<std::string::String>>()?
9111                                        .unwrap_or_default();
9112                                }
9113                                __FieldTag::__deinterlace_all_frames => {
9114                                    if !fields.insert(__FieldTag::__deinterlace_all_frames) {
9115                                        return std::result::Result::Err(
9116                                            A::Error::duplicate_field(
9117                                                "multiple values for deinterlace_all_frames",
9118                                            ),
9119                                        );
9120                                    }
9121                                    result.deinterlace_all_frames = map
9122                                        .next_value::<std::option::Option<bool>>()?
9123                                        .unwrap_or_default();
9124                                }
9125                                __FieldTag::Unknown(key) => {
9126                                    let value = map.next_value::<serde_json::Value>()?;
9127                                    result._unknown_fields.insert(key, value);
9128                                }
9129                            }
9130                        }
9131                        std::result::Result::Ok(result)
9132                    }
9133                }
9134                deserializer.deserialize_any(Visitor)
9135            }
9136        }
9137
9138        #[doc(hidden)]
9139        impl serde::ser::Serialize for YadifConfig {
9140            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9141            where
9142                S: serde::ser::Serializer,
9143            {
9144                use serde::ser::SerializeMap;
9145                #[allow(unused_imports)]
9146                use std::option::Option::Some;
9147                let mut state = serializer.serialize_map(std::option::Option::None)?;
9148                if !self.mode.is_empty() {
9149                    state.serialize_entry("mode", &self.mode)?;
9150                }
9151                if !wkt::internal::is_default(&self.disable_spatial_interlacing) {
9152                    state.serialize_entry(
9153                        "disableSpatialInterlacing",
9154                        &self.disable_spatial_interlacing,
9155                    )?;
9156                }
9157                if !self.parity.is_empty() {
9158                    state.serialize_entry("parity", &self.parity)?;
9159                }
9160                if !wkt::internal::is_default(&self.deinterlace_all_frames) {
9161                    state.serialize_entry("deinterlaceAllFrames", &self.deinterlace_all_frames)?;
9162                }
9163                if !self._unknown_fields.is_empty() {
9164                    for (key, value) in self._unknown_fields.iter() {
9165                        state.serialize_entry(key, &value)?;
9166                    }
9167                }
9168                state.end()
9169            }
9170        }
9171
9172        impl std::fmt::Debug for YadifConfig {
9173            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9174                let mut debug_struct = f.debug_struct("YadifConfig");
9175                debug_struct.field("mode", &self.mode);
9176                debug_struct.field(
9177                    "disable_spatial_interlacing",
9178                    &self.disable_spatial_interlacing,
9179                );
9180                debug_struct.field("parity", &self.parity);
9181                debug_struct.field("deinterlace_all_frames", &self.deinterlace_all_frames);
9182                if !self._unknown_fields.is_empty() {
9183                    debug_struct.field("_unknown_fields", &self._unknown_fields);
9184                }
9185                debug_struct.finish()
9186            }
9187        }
9188
9189        /// Bob Weaver Deinterlacing Filter Configuration.
9190        #[derive(Clone, Default, PartialEq)]
9191        #[non_exhaustive]
9192        pub struct BwdifConfig {
9193            /// Specifies the deinterlacing mode to adopt.
9194            /// The default is `send_frame`.
9195            /// Supported values:
9196            ///
9197            /// - `send_frame`: Output one frame for each frame
9198            /// - `send_field`: Output one frame for each field
9199            pub mode: std::string::String,
9200
9201            /// The picture field parity assumed for the input interlaced video.
9202            /// The default is `auto`.
9203            /// Supported values:
9204            ///
9205            /// - `tff`: Assume the top field is first
9206            /// - `bff`: Assume the bottom field is first
9207            /// - `auto`: Enable automatic detection of field parity
9208            pub parity: std::string::String,
9209
9210            /// Deinterlace all frames rather than just the frames identified as
9211            /// interlaced. The default is `false`.
9212            pub deinterlace_all_frames: bool,
9213
9214            _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9215        }
9216
9217        impl BwdifConfig {
9218            pub fn new() -> Self {
9219                std::default::Default::default()
9220            }
9221
9222            /// Sets the value of [mode][crate::model::preprocessing_config::deinterlace::BwdifConfig::mode].
9223            pub fn set_mode<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9224                self.mode = v.into();
9225                self
9226            }
9227
9228            /// Sets the value of [parity][crate::model::preprocessing_config::deinterlace::BwdifConfig::parity].
9229            pub fn set_parity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9230                self.parity = v.into();
9231                self
9232            }
9233
9234            /// Sets the value of [deinterlace_all_frames][crate::model::preprocessing_config::deinterlace::BwdifConfig::deinterlace_all_frames].
9235            pub fn set_deinterlace_all_frames<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9236                self.deinterlace_all_frames = v.into();
9237                self
9238            }
9239        }
9240
9241        impl wkt::message::Message for BwdifConfig {
9242            fn typename() -> &'static str {
9243                "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace.BwdifConfig"
9244            }
9245        }
9246
9247        #[doc(hidden)]
9248        impl<'de> serde::de::Deserialize<'de> for BwdifConfig {
9249            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9250            where
9251                D: serde::Deserializer<'de>,
9252            {
9253                #[allow(non_camel_case_types)]
9254                #[doc(hidden)]
9255                #[derive(PartialEq, Eq, Hash)]
9256                enum __FieldTag {
9257                    __mode,
9258                    __parity,
9259                    __deinterlace_all_frames,
9260                    Unknown(std::string::String),
9261                }
9262                impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9263                    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9264                    where
9265                        D: serde::Deserializer<'de>,
9266                    {
9267                        struct Visitor;
9268                        impl<'de> serde::de::Visitor<'de> for Visitor {
9269                            type Value = __FieldTag;
9270                            fn expecting(
9271                                &self,
9272                                formatter: &mut std::fmt::Formatter,
9273                            ) -> std::fmt::Result {
9274                                formatter.write_str("a field name for BwdifConfig")
9275                            }
9276                            fn visit_str<E>(
9277                                self,
9278                                value: &str,
9279                            ) -> std::result::Result<Self::Value, E>
9280                            where
9281                                E: serde::de::Error,
9282                            {
9283                                use std::result::Result::Ok;
9284                                use std::string::ToString;
9285                                match value {
9286                                    "mode" => Ok(__FieldTag::__mode),
9287                                    "parity" => Ok(__FieldTag::__parity),
9288                                    "deinterlaceAllFrames" => {
9289                                        Ok(__FieldTag::__deinterlace_all_frames)
9290                                    }
9291                                    "deinterlace_all_frames" => {
9292                                        Ok(__FieldTag::__deinterlace_all_frames)
9293                                    }
9294                                    _ => Ok(__FieldTag::Unknown(value.to_string())),
9295                                }
9296                            }
9297                        }
9298                        deserializer.deserialize_identifier(Visitor)
9299                    }
9300                }
9301                struct Visitor;
9302                impl<'de> serde::de::Visitor<'de> for Visitor {
9303                    type Value = BwdifConfig;
9304                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9305                        formatter.write_str("struct BwdifConfig")
9306                    }
9307                    fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9308                    where
9309                        A: serde::de::MapAccess<'de>,
9310                    {
9311                        #[allow(unused_imports)]
9312                        use serde::de::Error;
9313                        use std::option::Option::Some;
9314                        let mut fields = std::collections::HashSet::new();
9315                        let mut result = Self::Value::new();
9316                        while let Some(tag) = map.next_key::<__FieldTag>()? {
9317                            #[allow(clippy::match_single_binding)]
9318                            match tag {
9319                                __FieldTag::__mode => {
9320                                    if !fields.insert(__FieldTag::__mode) {
9321                                        return std::result::Result::Err(
9322                                            A::Error::duplicate_field("multiple values for mode"),
9323                                        );
9324                                    }
9325                                    result.mode = map
9326                                        .next_value::<std::option::Option<std::string::String>>()?
9327                                        .unwrap_or_default();
9328                                }
9329                                __FieldTag::__parity => {
9330                                    if !fields.insert(__FieldTag::__parity) {
9331                                        return std::result::Result::Err(
9332                                            A::Error::duplicate_field("multiple values for parity"),
9333                                        );
9334                                    }
9335                                    result.parity = map
9336                                        .next_value::<std::option::Option<std::string::String>>()?
9337                                        .unwrap_or_default();
9338                                }
9339                                __FieldTag::__deinterlace_all_frames => {
9340                                    if !fields.insert(__FieldTag::__deinterlace_all_frames) {
9341                                        return std::result::Result::Err(
9342                                            A::Error::duplicate_field(
9343                                                "multiple values for deinterlace_all_frames",
9344                                            ),
9345                                        );
9346                                    }
9347                                    result.deinterlace_all_frames = map
9348                                        .next_value::<std::option::Option<bool>>()?
9349                                        .unwrap_or_default();
9350                                }
9351                                __FieldTag::Unknown(key) => {
9352                                    let value = map.next_value::<serde_json::Value>()?;
9353                                    result._unknown_fields.insert(key, value);
9354                                }
9355                            }
9356                        }
9357                        std::result::Result::Ok(result)
9358                    }
9359                }
9360                deserializer.deserialize_any(Visitor)
9361            }
9362        }
9363
9364        #[doc(hidden)]
9365        impl serde::ser::Serialize for BwdifConfig {
9366            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9367            where
9368                S: serde::ser::Serializer,
9369            {
9370                use serde::ser::SerializeMap;
9371                #[allow(unused_imports)]
9372                use std::option::Option::Some;
9373                let mut state = serializer.serialize_map(std::option::Option::None)?;
9374                if !self.mode.is_empty() {
9375                    state.serialize_entry("mode", &self.mode)?;
9376                }
9377                if !self.parity.is_empty() {
9378                    state.serialize_entry("parity", &self.parity)?;
9379                }
9380                if !wkt::internal::is_default(&self.deinterlace_all_frames) {
9381                    state.serialize_entry("deinterlaceAllFrames", &self.deinterlace_all_frames)?;
9382                }
9383                if !self._unknown_fields.is_empty() {
9384                    for (key, value) in self._unknown_fields.iter() {
9385                        state.serialize_entry(key, &value)?;
9386                    }
9387                }
9388                state.end()
9389            }
9390        }
9391
9392        impl std::fmt::Debug for BwdifConfig {
9393            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9394                let mut debug_struct = f.debug_struct("BwdifConfig");
9395                debug_struct.field("mode", &self.mode);
9396                debug_struct.field("parity", &self.parity);
9397                debug_struct.field("deinterlace_all_frames", &self.deinterlace_all_frames);
9398                if !self._unknown_fields.is_empty() {
9399                    debug_struct.field("_unknown_fields", &self._unknown_fields);
9400                }
9401                debug_struct.finish()
9402            }
9403        }
9404
9405        /// Specify the video deinterlacing filter. The default is `yadif`.
9406        #[derive(Clone, Debug, PartialEq)]
9407        #[non_exhaustive]
9408        pub enum DeinterlacingFilter {
9409            /// Specifies the Yet Another Deinterlacing Filter Configuration.
9410            Yadif(std::boxed::Box<crate::model::preprocessing_config::deinterlace::YadifConfig>),
9411            /// Specifies the Bob Weaver Deinterlacing Filter Configuration.
9412            Bwdif(std::boxed::Box<crate::model::preprocessing_config::deinterlace::BwdifConfig>),
9413        }
9414    }
9415}
9416
9417/// Track definition for the input asset.
9418#[derive(Clone, Default, PartialEq)]
9419#[non_exhaustive]
9420pub struct TrackDefinition {
9421    /// The input track.
9422    pub input_track: std::option::Option<i32>,
9423
9424    /// Optional. A list of languages spoken in the input asset, represented by a
9425    /// BCP 47 language code, such as "en-US" or "sr-Latn". For more information,
9426    /// see <https://www.unicode.org/reports/tr35/#Unicode_locale_identifier>.
9427    pub languages: std::vec::Vec<std::string::String>,
9428
9429    /// Optional. Whether to automatically detect the languages present in the
9430    /// track. If true, the system will attempt to identify all the languages
9431    /// present in the track and populate the languages field.
9432    pub detect_languages: bool,
9433
9434    /// Output only. A list of languages detected in the input asset, represented
9435    /// by a BCP 47 language code, such as "en-US" or "sr-Latn". For more
9436    /// information, see
9437    /// <https://www.unicode.org/reports/tr35/#Unicode_locale_identifier>.
9438    /// This field is only populated if the detect_languages field is set to true.
9439    pub detected_languages: std::vec::Vec<std::string::String>,
9440
9441    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9442}
9443
9444impl TrackDefinition {
9445    pub fn new() -> Self {
9446        std::default::Default::default()
9447    }
9448
9449    /// Sets the value of [input_track][crate::model::TrackDefinition::input_track].
9450    pub fn set_input_track<T>(mut self, v: T) -> Self
9451    where
9452        T: std::convert::Into<i32>,
9453    {
9454        self.input_track = std::option::Option::Some(v.into());
9455        self
9456    }
9457
9458    /// Sets or clears the value of [input_track][crate::model::TrackDefinition::input_track].
9459    pub fn set_or_clear_input_track<T>(mut self, v: std::option::Option<T>) -> Self
9460    where
9461        T: std::convert::Into<i32>,
9462    {
9463        self.input_track = v.map(|x| x.into());
9464        self
9465    }
9466
9467    /// Sets the value of [languages][crate::model::TrackDefinition::languages].
9468    pub fn set_languages<T, V>(mut self, v: T) -> Self
9469    where
9470        T: std::iter::IntoIterator<Item = V>,
9471        V: std::convert::Into<std::string::String>,
9472    {
9473        use std::iter::Iterator;
9474        self.languages = v.into_iter().map(|i| i.into()).collect();
9475        self
9476    }
9477
9478    /// Sets the value of [detect_languages][crate::model::TrackDefinition::detect_languages].
9479    pub fn set_detect_languages<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9480        self.detect_languages = v.into();
9481        self
9482    }
9483
9484    /// Sets the value of [detected_languages][crate::model::TrackDefinition::detected_languages].
9485    pub fn set_detected_languages<T, V>(mut self, v: T) -> Self
9486    where
9487        T: std::iter::IntoIterator<Item = V>,
9488        V: std::convert::Into<std::string::String>,
9489    {
9490        use std::iter::Iterator;
9491        self.detected_languages = v.into_iter().map(|i| i.into()).collect();
9492        self
9493    }
9494}
9495
9496impl wkt::message::Message for TrackDefinition {
9497    fn typename() -> &'static str {
9498        "type.googleapis.com/google.cloud.video.transcoder.v1.TrackDefinition"
9499    }
9500}
9501
9502#[doc(hidden)]
9503impl<'de> serde::de::Deserialize<'de> for TrackDefinition {
9504    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9505    where
9506        D: serde::Deserializer<'de>,
9507    {
9508        #[allow(non_camel_case_types)]
9509        #[doc(hidden)]
9510        #[derive(PartialEq, Eq, Hash)]
9511        enum __FieldTag {
9512            __input_track,
9513            __languages,
9514            __detect_languages,
9515            __detected_languages,
9516            Unknown(std::string::String),
9517        }
9518        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9519            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9520            where
9521                D: serde::Deserializer<'de>,
9522            {
9523                struct Visitor;
9524                impl<'de> serde::de::Visitor<'de> for Visitor {
9525                    type Value = __FieldTag;
9526                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9527                        formatter.write_str("a field name for TrackDefinition")
9528                    }
9529                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9530                    where
9531                        E: serde::de::Error,
9532                    {
9533                        use std::result::Result::Ok;
9534                        use std::string::ToString;
9535                        match value {
9536                            "inputTrack" => Ok(__FieldTag::__input_track),
9537                            "input_track" => Ok(__FieldTag::__input_track),
9538                            "languages" => Ok(__FieldTag::__languages),
9539                            "detectLanguages" => Ok(__FieldTag::__detect_languages),
9540                            "detect_languages" => Ok(__FieldTag::__detect_languages),
9541                            "detectedLanguages" => Ok(__FieldTag::__detected_languages),
9542                            "detected_languages" => Ok(__FieldTag::__detected_languages),
9543                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9544                        }
9545                    }
9546                }
9547                deserializer.deserialize_identifier(Visitor)
9548            }
9549        }
9550        struct Visitor;
9551        impl<'de> serde::de::Visitor<'de> for Visitor {
9552            type Value = TrackDefinition;
9553            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9554                formatter.write_str("struct TrackDefinition")
9555            }
9556            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9557            where
9558                A: serde::de::MapAccess<'de>,
9559            {
9560                #[allow(unused_imports)]
9561                use serde::de::Error;
9562                use std::option::Option::Some;
9563                let mut fields = std::collections::HashSet::new();
9564                let mut result = Self::Value::new();
9565                while let Some(tag) = map.next_key::<__FieldTag>()? {
9566                    #[allow(clippy::match_single_binding)]
9567                    match tag {
9568                        __FieldTag::__input_track => {
9569                            if !fields.insert(__FieldTag::__input_track) {
9570                                return std::result::Result::Err(A::Error::duplicate_field(
9571                                    "multiple values for input_track",
9572                                ));
9573                            }
9574                            struct __With(std::option::Option<i32>);
9575                            impl<'de> serde::de::Deserialize<'de> for __With {
9576                                fn deserialize<D>(
9577                                    deserializer: D,
9578                                ) -> std::result::Result<Self, D::Error>
9579                                where
9580                                    D: serde::de::Deserializer<'de>,
9581                                {
9582                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
9583                                }
9584                            }
9585                            result.input_track = map.next_value::<__With>()?.0;
9586                        }
9587                        __FieldTag::__languages => {
9588                            if !fields.insert(__FieldTag::__languages) {
9589                                return std::result::Result::Err(A::Error::duplicate_field(
9590                                    "multiple values for languages",
9591                                ));
9592                            }
9593                            result.languages = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
9594                        }
9595                        __FieldTag::__detect_languages => {
9596                            if !fields.insert(__FieldTag::__detect_languages) {
9597                                return std::result::Result::Err(A::Error::duplicate_field(
9598                                    "multiple values for detect_languages",
9599                                ));
9600                            }
9601                            result.detect_languages = map
9602                                .next_value::<std::option::Option<bool>>()?
9603                                .unwrap_or_default();
9604                        }
9605                        __FieldTag::__detected_languages => {
9606                            if !fields.insert(__FieldTag::__detected_languages) {
9607                                return std::result::Result::Err(A::Error::duplicate_field(
9608                                    "multiple values for detected_languages",
9609                                ));
9610                            }
9611                            result.detected_languages = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
9612                        }
9613                        __FieldTag::Unknown(key) => {
9614                            let value = map.next_value::<serde_json::Value>()?;
9615                            result._unknown_fields.insert(key, value);
9616                        }
9617                    }
9618                }
9619                std::result::Result::Ok(result)
9620            }
9621        }
9622        deserializer.deserialize_any(Visitor)
9623    }
9624}
9625
9626#[doc(hidden)]
9627impl serde::ser::Serialize for TrackDefinition {
9628    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9629    where
9630        S: serde::ser::Serializer,
9631    {
9632        use serde::ser::SerializeMap;
9633        #[allow(unused_imports)]
9634        use std::option::Option::Some;
9635        let mut state = serializer.serialize_map(std::option::Option::None)?;
9636        if self.input_track.is_some() {
9637            struct __With<'a>(&'a std::option::Option<i32>);
9638            impl<'a> serde::ser::Serialize for __With<'a> {
9639                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9640                where
9641                    S: serde::ser::Serializer,
9642                {
9643                    serde_with::As::<std::option::Option<wkt::internal::I32>>::serialize(
9644                        self.0, serializer,
9645                    )
9646                }
9647            }
9648            state.serialize_entry("inputTrack", &__With(&self.input_track))?;
9649        }
9650        if !self.languages.is_empty() {
9651            state.serialize_entry("languages", &self.languages)?;
9652        }
9653        if !wkt::internal::is_default(&self.detect_languages) {
9654            state.serialize_entry("detectLanguages", &self.detect_languages)?;
9655        }
9656        if !self.detected_languages.is_empty() {
9657            state.serialize_entry("detectedLanguages", &self.detected_languages)?;
9658        }
9659        if !self._unknown_fields.is_empty() {
9660            for (key, value) in self._unknown_fields.iter() {
9661                state.serialize_entry(key, &value)?;
9662            }
9663        }
9664        state.end()
9665    }
9666}
9667
9668impl std::fmt::Debug for TrackDefinition {
9669    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9670        let mut debug_struct = f.debug_struct("TrackDefinition");
9671        debug_struct.field("input_track", &self.input_track);
9672        debug_struct.field("languages", &self.languages);
9673        debug_struct.field("detect_languages", &self.detect_languages);
9674        debug_struct.field("detected_languages", &self.detected_languages);
9675        if !self._unknown_fields.is_empty() {
9676            debug_struct.field("_unknown_fields", &self._unknown_fields);
9677        }
9678        debug_struct.finish()
9679    }
9680}
9681
9682/// Input attributes that provide additional information about the input asset.
9683#[derive(Clone, Default, PartialEq)]
9684#[non_exhaustive]
9685pub struct InputAttributes {
9686    /// Optional. A list of track definitions for the input asset.
9687    pub track_definitions: std::vec::Vec<crate::model::TrackDefinition>,
9688
9689    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9690}
9691
9692impl InputAttributes {
9693    pub fn new() -> Self {
9694        std::default::Default::default()
9695    }
9696
9697    /// Sets the value of [track_definitions][crate::model::InputAttributes::track_definitions].
9698    pub fn set_track_definitions<T, V>(mut self, v: T) -> Self
9699    where
9700        T: std::iter::IntoIterator<Item = V>,
9701        V: std::convert::Into<crate::model::TrackDefinition>,
9702    {
9703        use std::iter::Iterator;
9704        self.track_definitions = v.into_iter().map(|i| i.into()).collect();
9705        self
9706    }
9707}
9708
9709impl wkt::message::Message for InputAttributes {
9710    fn typename() -> &'static str {
9711        "type.googleapis.com/google.cloud.video.transcoder.v1.InputAttributes"
9712    }
9713}
9714
9715#[doc(hidden)]
9716impl<'de> serde::de::Deserialize<'de> for InputAttributes {
9717    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9718    where
9719        D: serde::Deserializer<'de>,
9720    {
9721        #[allow(non_camel_case_types)]
9722        #[doc(hidden)]
9723        #[derive(PartialEq, Eq, Hash)]
9724        enum __FieldTag {
9725            __track_definitions,
9726            Unknown(std::string::String),
9727        }
9728        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9729            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9730            where
9731                D: serde::Deserializer<'de>,
9732            {
9733                struct Visitor;
9734                impl<'de> serde::de::Visitor<'de> for Visitor {
9735                    type Value = __FieldTag;
9736                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9737                        formatter.write_str("a field name for InputAttributes")
9738                    }
9739                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9740                    where
9741                        E: serde::de::Error,
9742                    {
9743                        use std::result::Result::Ok;
9744                        use std::string::ToString;
9745                        match value {
9746                            "trackDefinitions" => Ok(__FieldTag::__track_definitions),
9747                            "track_definitions" => Ok(__FieldTag::__track_definitions),
9748                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9749                        }
9750                    }
9751                }
9752                deserializer.deserialize_identifier(Visitor)
9753            }
9754        }
9755        struct Visitor;
9756        impl<'de> serde::de::Visitor<'de> for Visitor {
9757            type Value = InputAttributes;
9758            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9759                formatter.write_str("struct InputAttributes")
9760            }
9761            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9762            where
9763                A: serde::de::MapAccess<'de>,
9764            {
9765                #[allow(unused_imports)]
9766                use serde::de::Error;
9767                use std::option::Option::Some;
9768                let mut fields = std::collections::HashSet::new();
9769                let mut result = Self::Value::new();
9770                while let Some(tag) = map.next_key::<__FieldTag>()? {
9771                    #[allow(clippy::match_single_binding)]
9772                    match tag {
9773                        __FieldTag::__track_definitions => {
9774                            if !fields.insert(__FieldTag::__track_definitions) {
9775                                return std::result::Result::Err(A::Error::duplicate_field(
9776                                    "multiple values for track_definitions",
9777                                ));
9778                            }
9779                            result.track_definitions =
9780                                map.next_value::<std::option::Option<
9781                                    std::vec::Vec<crate::model::TrackDefinition>,
9782                                >>()?
9783                                .unwrap_or_default();
9784                        }
9785                        __FieldTag::Unknown(key) => {
9786                            let value = map.next_value::<serde_json::Value>()?;
9787                            result._unknown_fields.insert(key, value);
9788                        }
9789                    }
9790                }
9791                std::result::Result::Ok(result)
9792            }
9793        }
9794        deserializer.deserialize_any(Visitor)
9795    }
9796}
9797
9798#[doc(hidden)]
9799impl serde::ser::Serialize for InputAttributes {
9800    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9801    where
9802        S: serde::ser::Serializer,
9803    {
9804        use serde::ser::SerializeMap;
9805        #[allow(unused_imports)]
9806        use std::option::Option::Some;
9807        let mut state = serializer.serialize_map(std::option::Option::None)?;
9808        if !self.track_definitions.is_empty() {
9809            state.serialize_entry("trackDefinitions", &self.track_definitions)?;
9810        }
9811        if !self._unknown_fields.is_empty() {
9812            for (key, value) in self._unknown_fields.iter() {
9813                state.serialize_entry(key, &value)?;
9814            }
9815        }
9816        state.end()
9817    }
9818}
9819
9820impl std::fmt::Debug for InputAttributes {
9821    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9822        let mut debug_struct = f.debug_struct("InputAttributes");
9823        debug_struct.field("track_definitions", &self.track_definitions);
9824        if !self._unknown_fields.is_empty() {
9825            debug_struct.field("_unknown_fields", &self._unknown_fields);
9826        }
9827        debug_struct.finish()
9828    }
9829}
9830
9831/// Video stream resource.
9832#[derive(Clone, Default, PartialEq)]
9833#[non_exhaustive]
9834pub struct VideoStream {
9835    /// Codec settings can be h264, h265, or vp9.
9836    pub codec_settings: std::option::Option<crate::model::video_stream::CodecSettings>,
9837
9838    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9839}
9840
9841impl VideoStream {
9842    pub fn new() -> Self {
9843        std::default::Default::default()
9844    }
9845
9846    /// Sets the value of [codec_settings][crate::model::VideoStream::codec_settings].
9847    ///
9848    /// Note that all the setters affecting `codec_settings` are mutually
9849    /// exclusive.
9850    pub fn set_codec_settings<
9851        T: std::convert::Into<std::option::Option<crate::model::video_stream::CodecSettings>>,
9852    >(
9853        mut self,
9854        v: T,
9855    ) -> Self {
9856        self.codec_settings = v.into();
9857        self
9858    }
9859
9860    /// The value of [codec_settings][crate::model::VideoStream::codec_settings]
9861    /// if it holds a `H264`, `None` if the field is not set or
9862    /// holds a different branch.
9863    pub fn h264(
9864        &self,
9865    ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H264CodecSettings>> {
9866        #[allow(unreachable_patterns)]
9867        self.codec_settings.as_ref().and_then(|v| match v {
9868            crate::model::video_stream::CodecSettings::H264(v) => std::option::Option::Some(v),
9869            _ => std::option::Option::None,
9870        })
9871    }
9872
9873    /// Sets the value of [codec_settings][crate::model::VideoStream::codec_settings]
9874    /// to hold a `H264`.
9875    ///
9876    /// Note that all the setters affecting `codec_settings` are
9877    /// mutually exclusive.
9878    pub fn set_h264<
9879        T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H264CodecSettings>>,
9880    >(
9881        mut self,
9882        v: T,
9883    ) -> Self {
9884        self.codec_settings =
9885            std::option::Option::Some(crate::model::video_stream::CodecSettings::H264(v.into()));
9886        self
9887    }
9888
9889    /// The value of [codec_settings][crate::model::VideoStream::codec_settings]
9890    /// if it holds a `H265`, `None` if the field is not set or
9891    /// holds a different branch.
9892    pub fn h265(
9893        &self,
9894    ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H265CodecSettings>> {
9895        #[allow(unreachable_patterns)]
9896        self.codec_settings.as_ref().and_then(|v| match v {
9897            crate::model::video_stream::CodecSettings::H265(v) => std::option::Option::Some(v),
9898            _ => std::option::Option::None,
9899        })
9900    }
9901
9902    /// Sets the value of [codec_settings][crate::model::VideoStream::codec_settings]
9903    /// to hold a `H265`.
9904    ///
9905    /// Note that all the setters affecting `codec_settings` are
9906    /// mutually exclusive.
9907    pub fn set_h265<
9908        T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H265CodecSettings>>,
9909    >(
9910        mut self,
9911        v: T,
9912    ) -> Self {
9913        self.codec_settings =
9914            std::option::Option::Some(crate::model::video_stream::CodecSettings::H265(v.into()));
9915        self
9916    }
9917
9918    /// The value of [codec_settings][crate::model::VideoStream::codec_settings]
9919    /// if it holds a `Vp9`, `None` if the field is not set or
9920    /// holds a different branch.
9921    pub fn vp9(
9922        &self,
9923    ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::Vp9CodecSettings>> {
9924        #[allow(unreachable_patterns)]
9925        self.codec_settings.as_ref().and_then(|v| match v {
9926            crate::model::video_stream::CodecSettings::Vp9(v) => std::option::Option::Some(v),
9927            _ => std::option::Option::None,
9928        })
9929    }
9930
9931    /// Sets the value of [codec_settings][crate::model::VideoStream::codec_settings]
9932    /// to hold a `Vp9`.
9933    ///
9934    /// Note that all the setters affecting `codec_settings` are
9935    /// mutually exclusive.
9936    pub fn set_vp9<
9937        T: std::convert::Into<std::boxed::Box<crate::model::video_stream::Vp9CodecSettings>>,
9938    >(
9939        mut self,
9940        v: T,
9941    ) -> Self {
9942        self.codec_settings =
9943            std::option::Option::Some(crate::model::video_stream::CodecSettings::Vp9(v.into()));
9944        self
9945    }
9946}
9947
9948impl wkt::message::Message for VideoStream {
9949    fn typename() -> &'static str {
9950        "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream"
9951    }
9952}
9953
9954#[doc(hidden)]
9955impl<'de> serde::de::Deserialize<'de> for VideoStream {
9956    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9957    where
9958        D: serde::Deserializer<'de>,
9959    {
9960        #[allow(non_camel_case_types)]
9961        #[doc(hidden)]
9962        #[derive(PartialEq, Eq, Hash)]
9963        enum __FieldTag {
9964            __h264,
9965            __h265,
9966            __vp9,
9967            Unknown(std::string::String),
9968        }
9969        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9970            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9971            where
9972                D: serde::Deserializer<'de>,
9973            {
9974                struct Visitor;
9975                impl<'de> serde::de::Visitor<'de> for Visitor {
9976                    type Value = __FieldTag;
9977                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9978                        formatter.write_str("a field name for VideoStream")
9979                    }
9980                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9981                    where
9982                        E: serde::de::Error,
9983                    {
9984                        use std::result::Result::Ok;
9985                        use std::string::ToString;
9986                        match value {
9987                            "h264" => Ok(__FieldTag::__h264),
9988                            "h265" => Ok(__FieldTag::__h265),
9989                            "vp9" => Ok(__FieldTag::__vp9),
9990                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9991                        }
9992                    }
9993                }
9994                deserializer.deserialize_identifier(Visitor)
9995            }
9996        }
9997        struct Visitor;
9998        impl<'de> serde::de::Visitor<'de> for Visitor {
9999            type Value = VideoStream;
10000            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10001                formatter.write_str("struct VideoStream")
10002            }
10003            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10004            where
10005                A: serde::de::MapAccess<'de>,
10006            {
10007                #[allow(unused_imports)]
10008                use serde::de::Error;
10009                use std::option::Option::Some;
10010                let mut fields = std::collections::HashSet::new();
10011                let mut result = Self::Value::new();
10012                while let Some(tag) = map.next_key::<__FieldTag>()? {
10013                    #[allow(clippy::match_single_binding)]
10014                    match tag {
10015                        __FieldTag::__h264 => {
10016                            if !fields.insert(__FieldTag::__h264) {
10017                                return std::result::Result::Err(A::Error::duplicate_field(
10018                                    "multiple values for h264",
10019                                ));
10020                            }
10021                            if result.codec_settings.is_some() {
10022                                return std::result::Result::Err(A::Error::duplicate_field(
10023                                    "multiple values for `codec_settings`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.h264, latest field was h264",
10024                                ));
10025                            }
10026                            result.codec_settings = std::option::Option::Some(
10027                                crate::model::video_stream::CodecSettings::H264(
10028                                    map.next_value::<std::option::Option<
10029                                        std::boxed::Box<
10030                                            crate::model::video_stream::H264CodecSettings,
10031                                        >,
10032                                    >>()?
10033                                    .unwrap_or_default(),
10034                                ),
10035                            );
10036                        }
10037                        __FieldTag::__h265 => {
10038                            if !fields.insert(__FieldTag::__h265) {
10039                                return std::result::Result::Err(A::Error::duplicate_field(
10040                                    "multiple values for h265",
10041                                ));
10042                            }
10043                            if result.codec_settings.is_some() {
10044                                return std::result::Result::Err(A::Error::duplicate_field(
10045                                    "multiple values for `codec_settings`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.h265, latest field was h265",
10046                                ));
10047                            }
10048                            result.codec_settings = std::option::Option::Some(
10049                                crate::model::video_stream::CodecSettings::H265(
10050                                    map.next_value::<std::option::Option<
10051                                        std::boxed::Box<
10052                                            crate::model::video_stream::H265CodecSettings,
10053                                        >,
10054                                    >>()?
10055                                    .unwrap_or_default(),
10056                                ),
10057                            );
10058                        }
10059                        __FieldTag::__vp9 => {
10060                            if !fields.insert(__FieldTag::__vp9) {
10061                                return std::result::Result::Err(A::Error::duplicate_field(
10062                                    "multiple values for vp9",
10063                                ));
10064                            }
10065                            if result.codec_settings.is_some() {
10066                                return std::result::Result::Err(A::Error::duplicate_field(
10067                                    "multiple values for `codec_settings`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.vp9, latest field was vp9",
10068                                ));
10069                            }
10070                            result.codec_settings = std::option::Option::Some(
10071                                crate::model::video_stream::CodecSettings::Vp9(
10072                                    map.next_value::<std::option::Option<
10073                                        std::boxed::Box<
10074                                            crate::model::video_stream::Vp9CodecSettings,
10075                                        >,
10076                                    >>()?
10077                                    .unwrap_or_default(),
10078                                ),
10079                            );
10080                        }
10081                        __FieldTag::Unknown(key) => {
10082                            let value = map.next_value::<serde_json::Value>()?;
10083                            result._unknown_fields.insert(key, value);
10084                        }
10085                    }
10086                }
10087                std::result::Result::Ok(result)
10088            }
10089        }
10090        deserializer.deserialize_any(Visitor)
10091    }
10092}
10093
10094#[doc(hidden)]
10095impl serde::ser::Serialize for VideoStream {
10096    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10097    where
10098        S: serde::ser::Serializer,
10099    {
10100        use serde::ser::SerializeMap;
10101        #[allow(unused_imports)]
10102        use std::option::Option::Some;
10103        let mut state = serializer.serialize_map(std::option::Option::None)?;
10104        if let Some(value) = self.h264() {
10105            state.serialize_entry("h264", value)?;
10106        }
10107        if let Some(value) = self.h265() {
10108            state.serialize_entry("h265", value)?;
10109        }
10110        if let Some(value) = self.vp9() {
10111            state.serialize_entry("vp9", value)?;
10112        }
10113        if !self._unknown_fields.is_empty() {
10114            for (key, value) in self._unknown_fields.iter() {
10115                state.serialize_entry(key, &value)?;
10116            }
10117        }
10118        state.end()
10119    }
10120}
10121
10122impl std::fmt::Debug for VideoStream {
10123    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10124        let mut debug_struct = f.debug_struct("VideoStream");
10125        debug_struct.field("codec_settings", &self.codec_settings);
10126        if !self._unknown_fields.is_empty() {
10127            debug_struct.field("_unknown_fields", &self._unknown_fields);
10128        }
10129        debug_struct.finish()
10130    }
10131}
10132
10133/// Defines additional types related to [VideoStream].
10134pub mod video_stream {
10135    #[allow(unused_imports)]
10136    use super::*;
10137
10138    /// Convert the input video to a Standard Dynamic Range (SDR) video.
10139    #[derive(Clone, Default, PartialEq)]
10140    #[non_exhaustive]
10141    pub struct H264ColorFormatSDR {
10142        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10143    }
10144
10145    impl H264ColorFormatSDR {
10146        pub fn new() -> Self {
10147            std::default::Default::default()
10148        }
10149    }
10150
10151    impl wkt::message::Message for H264ColorFormatSDR {
10152        fn typename() -> &'static str {
10153            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H264ColorFormatSDR"
10154        }
10155    }
10156
10157    #[doc(hidden)]
10158    impl<'de> serde::de::Deserialize<'de> for H264ColorFormatSDR {
10159        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10160        where
10161            D: serde::Deserializer<'de>,
10162        {
10163            #[allow(non_camel_case_types)]
10164            #[doc(hidden)]
10165            #[derive(PartialEq, Eq, Hash)]
10166            enum __FieldTag {
10167                Unknown(std::string::String),
10168            }
10169            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10170                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10171                where
10172                    D: serde::Deserializer<'de>,
10173                {
10174                    struct Visitor;
10175                    impl<'de> serde::de::Visitor<'de> for Visitor {
10176                        type Value = __FieldTag;
10177                        fn expecting(
10178                            &self,
10179                            formatter: &mut std::fmt::Formatter,
10180                        ) -> std::fmt::Result {
10181                            formatter.write_str("a field name for H264ColorFormatSDR")
10182                        }
10183                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10184                        where
10185                            E: serde::de::Error,
10186                        {
10187                            use std::result::Result::Ok;
10188                            use std::string::ToString;
10189                            Ok(__FieldTag::Unknown(value.to_string()))
10190                        }
10191                    }
10192                    deserializer.deserialize_identifier(Visitor)
10193                }
10194            }
10195            struct Visitor;
10196            impl<'de> serde::de::Visitor<'de> for Visitor {
10197                type Value = H264ColorFormatSDR;
10198                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10199                    formatter.write_str("struct H264ColorFormatSDR")
10200                }
10201                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10202                where
10203                    A: serde::de::MapAccess<'de>,
10204                {
10205                    #[allow(unused_imports)]
10206                    use serde::de::Error;
10207                    use std::option::Option::Some;
10208                    let mut result = Self::Value::new();
10209                    while let Some(tag) = map.next_key::<__FieldTag>()? {
10210                        #[allow(clippy::match_single_binding)]
10211                        match tag {
10212                            __FieldTag::Unknown(key) => {
10213                                let value = map.next_value::<serde_json::Value>()?;
10214                                result._unknown_fields.insert(key, value);
10215                            }
10216                        }
10217                    }
10218                    std::result::Result::Ok(result)
10219                }
10220            }
10221            deserializer.deserialize_any(Visitor)
10222        }
10223    }
10224
10225    #[doc(hidden)]
10226    impl serde::ser::Serialize for H264ColorFormatSDR {
10227        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10228        where
10229            S: serde::ser::Serializer,
10230        {
10231            use serde::ser::SerializeMap;
10232            #[allow(unused_imports)]
10233            use std::option::Option::Some;
10234            let mut state = serializer.serialize_map(std::option::Option::None)?;
10235            if !self._unknown_fields.is_empty() {
10236                for (key, value) in self._unknown_fields.iter() {
10237                    state.serialize_entry(key, &value)?;
10238                }
10239            }
10240            state.end()
10241        }
10242    }
10243
10244    impl std::fmt::Debug for H264ColorFormatSDR {
10245        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10246            let mut debug_struct = f.debug_struct("H264ColorFormatSDR");
10247            if !self._unknown_fields.is_empty() {
10248                debug_struct.field("_unknown_fields", &self._unknown_fields);
10249            }
10250            debug_struct.finish()
10251        }
10252    }
10253
10254    /// Convert the input video to a Hybrid Log Gamma (HLG) video.
10255    #[derive(Clone, Default, PartialEq)]
10256    #[non_exhaustive]
10257    pub struct H264ColorFormatHLG {
10258        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10259    }
10260
10261    impl H264ColorFormatHLG {
10262        pub fn new() -> Self {
10263            std::default::Default::default()
10264        }
10265    }
10266
10267    impl wkt::message::Message for H264ColorFormatHLG {
10268        fn typename() -> &'static str {
10269            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H264ColorFormatHLG"
10270        }
10271    }
10272
10273    #[doc(hidden)]
10274    impl<'de> serde::de::Deserialize<'de> for H264ColorFormatHLG {
10275        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10276        where
10277            D: serde::Deserializer<'de>,
10278        {
10279            #[allow(non_camel_case_types)]
10280            #[doc(hidden)]
10281            #[derive(PartialEq, Eq, Hash)]
10282            enum __FieldTag {
10283                Unknown(std::string::String),
10284            }
10285            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10286                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10287                where
10288                    D: serde::Deserializer<'de>,
10289                {
10290                    struct Visitor;
10291                    impl<'de> serde::de::Visitor<'de> for Visitor {
10292                        type Value = __FieldTag;
10293                        fn expecting(
10294                            &self,
10295                            formatter: &mut std::fmt::Formatter,
10296                        ) -> std::fmt::Result {
10297                            formatter.write_str("a field name for H264ColorFormatHLG")
10298                        }
10299                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10300                        where
10301                            E: serde::de::Error,
10302                        {
10303                            use std::result::Result::Ok;
10304                            use std::string::ToString;
10305                            Ok(__FieldTag::Unknown(value.to_string()))
10306                        }
10307                    }
10308                    deserializer.deserialize_identifier(Visitor)
10309                }
10310            }
10311            struct Visitor;
10312            impl<'de> serde::de::Visitor<'de> for Visitor {
10313                type Value = H264ColorFormatHLG;
10314                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10315                    formatter.write_str("struct H264ColorFormatHLG")
10316                }
10317                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10318                where
10319                    A: serde::de::MapAccess<'de>,
10320                {
10321                    #[allow(unused_imports)]
10322                    use serde::de::Error;
10323                    use std::option::Option::Some;
10324                    let mut result = Self::Value::new();
10325                    while let Some(tag) = map.next_key::<__FieldTag>()? {
10326                        #[allow(clippy::match_single_binding)]
10327                        match tag {
10328                            __FieldTag::Unknown(key) => {
10329                                let value = map.next_value::<serde_json::Value>()?;
10330                                result._unknown_fields.insert(key, value);
10331                            }
10332                        }
10333                    }
10334                    std::result::Result::Ok(result)
10335                }
10336            }
10337            deserializer.deserialize_any(Visitor)
10338        }
10339    }
10340
10341    #[doc(hidden)]
10342    impl serde::ser::Serialize for H264ColorFormatHLG {
10343        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10344        where
10345            S: serde::ser::Serializer,
10346        {
10347            use serde::ser::SerializeMap;
10348            #[allow(unused_imports)]
10349            use std::option::Option::Some;
10350            let mut state = serializer.serialize_map(std::option::Option::None)?;
10351            if !self._unknown_fields.is_empty() {
10352                for (key, value) in self._unknown_fields.iter() {
10353                    state.serialize_entry(key, &value)?;
10354                }
10355            }
10356            state.end()
10357        }
10358    }
10359
10360    impl std::fmt::Debug for H264ColorFormatHLG {
10361        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10362            let mut debug_struct = f.debug_struct("H264ColorFormatHLG");
10363            if !self._unknown_fields.is_empty() {
10364                debug_struct.field("_unknown_fields", &self._unknown_fields);
10365            }
10366            debug_struct.finish()
10367        }
10368    }
10369
10370    /// H264 codec settings.
10371    #[derive(Clone, Default, PartialEq)]
10372    #[non_exhaustive]
10373    pub struct H264CodecSettings {
10374        /// The width of the video in pixels. Must be an even integer.
10375        /// When not specified, the width is adjusted to match the specified height
10376        /// and input aspect ratio. If both are omitted, the input width is used.
10377        ///
10378        /// For portrait videos that contain horizontal ASR and rotation metadata,
10379        /// provide the width, in pixels, per the horizontal ASR. The API calculates
10380        /// the height per the horizontal ASR. The API detects any rotation metadata
10381        /// and swaps the requested height and width for the output.
10382        pub width_pixels: i32,
10383
10384        /// The height of the video in pixels. Must be an even integer.
10385        /// When not specified, the height is adjusted to match the specified width
10386        /// and input aspect ratio. If both are omitted, the input height is used.
10387        ///
10388        /// For portrait videos that contain horizontal ASR and rotation metadata,
10389        /// provide the height, in pixels, per the horizontal ASR. The API calculates
10390        /// the width per the horizontal ASR. The API detects any rotation metadata
10391        /// and swaps the requested height and width for the output.
10392        pub height_pixels: i32,
10393
10394        /// Required. The target video frame rate in frames per second (FPS). Must be
10395        /// less than or equal to 120.
10396        pub frame_rate: f64,
10397
10398        /// Optional. Frame rate conversion strategy for desired frame rate. The
10399        /// default is `DOWNSAMPLE`.
10400        pub frame_rate_conversion_strategy: crate::model::video_stream::FrameRateConversionStrategy,
10401
10402        /// Required. The video bitrate in bits per second. The minimum value is
10403        /// 1,000. The maximum value is 800,000,000.
10404        pub bitrate_bps: i32,
10405
10406        /// Pixel format to use. The default is `yuv420p`.
10407        ///
10408        /// Supported pixel formats:
10409        ///
10410        /// - `yuv420p` pixel format
10411        /// - `yuv422p` pixel format
10412        /// - `yuv444p` pixel format
10413        /// - `yuv420p10` 10-bit HDR pixel format
10414        /// - `yuv422p10` 10-bit HDR pixel format
10415        /// - `yuv444p10` 10-bit HDR pixel format
10416        /// - `yuv420p12` 12-bit HDR pixel format
10417        /// - `yuv422p12` 12-bit HDR pixel format
10418        /// - `yuv444p12` 12-bit HDR pixel format
10419        pub pixel_format: std::string::String,
10420
10421        /// Specify the mode. The default is `vbr`.
10422        ///
10423        /// Supported rate control modes:
10424        ///
10425        /// - `vbr` - variable bitrate
10426        /// - `crf` - constant rate factor
10427        pub rate_control_mode: std::string::String,
10428
10429        /// Target CRF level. Must be between 10 and 36, where 10 is the highest
10430        /// quality and 36 is the most efficient compression. The default is 21.
10431        pub crf_level: i32,
10432
10433        /// Specifies whether an open Group of Pictures (GOP) structure should be
10434        /// allowed or not. The default is `false`.
10435        pub allow_open_gop: bool,
10436
10437        /// Use two-pass encoding strategy to achieve better video quality.
10438        /// [H264CodecSettings.rate_control_mode][google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.rate_control_mode]
10439        /// must be `vbr`. The default is `false`.
10440        ///
10441        /// [google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.rate_control_mode]: crate::model::video_stream::H264CodecSettings::rate_control_mode
10442        pub enable_two_pass: bool,
10443
10444        /// Size of the Video Buffering Verifier (VBV) buffer in bits. Must be
10445        /// greater than zero. The default is equal to
10446        /// [H264CodecSettings.bitrate_bps][google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.bitrate_bps].
10447        ///
10448        /// [google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.bitrate_bps]: crate::model::video_stream::H264CodecSettings::bitrate_bps
10449        pub vbv_size_bits: i32,
10450
10451        /// Initial fullness of the Video Buffering Verifier (VBV) buffer in bits.
10452        /// Must be greater than zero. The default is equal to 90% of
10453        /// [H264CodecSettings.vbv_size_bits][google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.vbv_size_bits].
10454        ///
10455        /// [google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.vbv_size_bits]: crate::model::video_stream::H264CodecSettings::vbv_size_bits
10456        pub vbv_fullness_bits: i32,
10457
10458        /// The entropy coder to use. The default is `cabac`.
10459        ///
10460        /// Supported entropy coders:
10461        ///
10462        /// - `cavlc`
10463        /// - `cabac`
10464        pub entropy_coder: std::string::String,
10465
10466        /// Allow B-pyramid for reference frame selection. This may not be supported
10467        /// on all decoders. The default is `false`.
10468        pub b_pyramid: bool,
10469
10470        /// The number of consecutive B-frames. Must be greater than or equal to
10471        /// zero. Must be less than
10472        /// [H264CodecSettings.gop_frame_count][google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.gop_frame_count]
10473        /// if set. The default is 0.
10474        ///
10475        /// [google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.gop_frame_count]: crate::model::video_stream::H264CodecSettings::gop_mode
10476        pub b_frame_count: i32,
10477
10478        /// Specify the intensity of the adaptive quantizer (AQ). Must be between 0
10479        /// and 1, where 0 disables the quantizer and 1 maximizes the quantizer. A
10480        /// higher value equals a lower bitrate but smoother image. The default is 0.
10481        pub aq_strength: f64,
10482
10483        /// Enforces the specified codec profile. The following profiles are
10484        /// supported:
10485        ///
10486        /// * `baseline`
10487        /// * `main`
10488        /// * `high` (default)
10489        ///
10490        /// The available options are
10491        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.264#Tune).
10492        /// Note that certain values for this field may cause the
10493        /// transcoder to override other fields you set in the `H264CodecSettings`
10494        /// message.
10495        pub profile: std::string::String,
10496
10497        /// Enforces the specified codec tune. The available options are
10498        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.264#Tune).
10499        /// Note that certain values for this field may cause the
10500        /// transcoder to override other fields you set in the `H264CodecSettings`
10501        /// message.
10502        pub tune: std::string::String,
10503
10504        /// Enforces the specified codec preset. The default is `veryfast`. The
10505        /// available options are
10506        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.264#Preset).
10507        /// Note that certain values for this field may cause the
10508        /// transcoder to override other fields you set in the `H264CodecSettings`
10509        /// message.
10510        pub preset: std::string::String,
10511
10512        /// GOP mode can be either by frame count or duration.
10513        pub gop_mode:
10514            std::option::Option<crate::model::video_stream::h_264_codec_settings::GopMode>,
10515
10516        /// Color format can be sdr or hlg.
10517        pub color_format:
10518            std::option::Option<crate::model::video_stream::h_264_codec_settings::ColorFormat>,
10519
10520        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10521    }
10522
10523    impl H264CodecSettings {
10524        pub fn new() -> Self {
10525            std::default::Default::default()
10526        }
10527
10528        /// Sets the value of [width_pixels][crate::model::video_stream::H264CodecSettings::width_pixels].
10529        pub fn set_width_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10530            self.width_pixels = v.into();
10531            self
10532        }
10533
10534        /// Sets the value of [height_pixels][crate::model::video_stream::H264CodecSettings::height_pixels].
10535        pub fn set_height_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10536            self.height_pixels = v.into();
10537            self
10538        }
10539
10540        /// Sets the value of [frame_rate][crate::model::video_stream::H264CodecSettings::frame_rate].
10541        pub fn set_frame_rate<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
10542            self.frame_rate = v.into();
10543            self
10544        }
10545
10546        /// Sets the value of [frame_rate_conversion_strategy][crate::model::video_stream::H264CodecSettings::frame_rate_conversion_strategy].
10547        pub fn set_frame_rate_conversion_strategy<
10548            T: std::convert::Into<crate::model::video_stream::FrameRateConversionStrategy>,
10549        >(
10550            mut self,
10551            v: T,
10552        ) -> Self {
10553            self.frame_rate_conversion_strategy = v.into();
10554            self
10555        }
10556
10557        /// Sets the value of [bitrate_bps][crate::model::video_stream::H264CodecSettings::bitrate_bps].
10558        pub fn set_bitrate_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10559            self.bitrate_bps = v.into();
10560            self
10561        }
10562
10563        /// Sets the value of [pixel_format][crate::model::video_stream::H264CodecSettings::pixel_format].
10564        pub fn set_pixel_format<T: std::convert::Into<std::string::String>>(
10565            mut self,
10566            v: T,
10567        ) -> Self {
10568            self.pixel_format = v.into();
10569            self
10570        }
10571
10572        /// Sets the value of [rate_control_mode][crate::model::video_stream::H264CodecSettings::rate_control_mode].
10573        pub fn set_rate_control_mode<T: std::convert::Into<std::string::String>>(
10574            mut self,
10575            v: T,
10576        ) -> Self {
10577            self.rate_control_mode = v.into();
10578            self
10579        }
10580
10581        /// Sets the value of [crf_level][crate::model::video_stream::H264CodecSettings::crf_level].
10582        pub fn set_crf_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10583            self.crf_level = v.into();
10584            self
10585        }
10586
10587        /// Sets the value of [allow_open_gop][crate::model::video_stream::H264CodecSettings::allow_open_gop].
10588        pub fn set_allow_open_gop<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10589            self.allow_open_gop = v.into();
10590            self
10591        }
10592
10593        /// Sets the value of [enable_two_pass][crate::model::video_stream::H264CodecSettings::enable_two_pass].
10594        pub fn set_enable_two_pass<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10595            self.enable_two_pass = v.into();
10596            self
10597        }
10598
10599        /// Sets the value of [vbv_size_bits][crate::model::video_stream::H264CodecSettings::vbv_size_bits].
10600        pub fn set_vbv_size_bits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10601            self.vbv_size_bits = v.into();
10602            self
10603        }
10604
10605        /// Sets the value of [vbv_fullness_bits][crate::model::video_stream::H264CodecSettings::vbv_fullness_bits].
10606        pub fn set_vbv_fullness_bits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10607            self.vbv_fullness_bits = v.into();
10608            self
10609        }
10610
10611        /// Sets the value of [entropy_coder][crate::model::video_stream::H264CodecSettings::entropy_coder].
10612        pub fn set_entropy_coder<T: std::convert::Into<std::string::String>>(
10613            mut self,
10614            v: T,
10615        ) -> Self {
10616            self.entropy_coder = v.into();
10617            self
10618        }
10619
10620        /// Sets the value of [b_pyramid][crate::model::video_stream::H264CodecSettings::b_pyramid].
10621        pub fn set_b_pyramid<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10622            self.b_pyramid = v.into();
10623            self
10624        }
10625
10626        /// Sets the value of [b_frame_count][crate::model::video_stream::H264CodecSettings::b_frame_count].
10627        pub fn set_b_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10628            self.b_frame_count = v.into();
10629            self
10630        }
10631
10632        /// Sets the value of [aq_strength][crate::model::video_stream::H264CodecSettings::aq_strength].
10633        pub fn set_aq_strength<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
10634            self.aq_strength = v.into();
10635            self
10636        }
10637
10638        /// Sets the value of [profile][crate::model::video_stream::H264CodecSettings::profile].
10639        pub fn set_profile<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10640            self.profile = v.into();
10641            self
10642        }
10643
10644        /// Sets the value of [tune][crate::model::video_stream::H264CodecSettings::tune].
10645        pub fn set_tune<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10646            self.tune = v.into();
10647            self
10648        }
10649
10650        /// Sets the value of [preset][crate::model::video_stream::H264CodecSettings::preset].
10651        pub fn set_preset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10652            self.preset = v.into();
10653            self
10654        }
10655
10656        /// Sets the value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode].
10657        ///
10658        /// Note that all the setters affecting `gop_mode` are mutually
10659        /// exclusive.
10660        pub fn set_gop_mode<
10661            T: std::convert::Into<
10662                    std::option::Option<crate::model::video_stream::h_264_codec_settings::GopMode>,
10663                >,
10664        >(
10665            mut self,
10666            v: T,
10667        ) -> Self {
10668            self.gop_mode = v.into();
10669            self
10670        }
10671
10672        /// The value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode]
10673        /// if it holds a `GopFrameCount`, `None` if the field is not set or
10674        /// holds a different branch.
10675        pub fn gop_frame_count(&self) -> std::option::Option<&i32> {
10676            #[allow(unreachable_patterns)]
10677            self.gop_mode.as_ref().and_then(|v| match v {
10678                crate::model::video_stream::h_264_codec_settings::GopMode::GopFrameCount(v) => {
10679                    std::option::Option::Some(v)
10680                }
10681                _ => std::option::Option::None,
10682            })
10683        }
10684
10685        /// Sets the value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode]
10686        /// to hold a `GopFrameCount`.
10687        ///
10688        /// Note that all the setters affecting `gop_mode` are
10689        /// mutually exclusive.
10690        pub fn set_gop_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10691            self.gop_mode = std::option::Option::Some(
10692                crate::model::video_stream::h_264_codec_settings::GopMode::GopFrameCount(v.into()),
10693            );
10694            self
10695        }
10696
10697        /// The value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode]
10698        /// if it holds a `GopDuration`, `None` if the field is not set or
10699        /// holds a different branch.
10700        pub fn gop_duration(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
10701            #[allow(unreachable_patterns)]
10702            self.gop_mode.as_ref().and_then(|v| match v {
10703                crate::model::video_stream::h_264_codec_settings::GopMode::GopDuration(v) => {
10704                    std::option::Option::Some(v)
10705                }
10706                _ => std::option::Option::None,
10707            })
10708        }
10709
10710        /// Sets the value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode]
10711        /// to hold a `GopDuration`.
10712        ///
10713        /// Note that all the setters affecting `gop_mode` are
10714        /// mutually exclusive.
10715        pub fn set_gop_duration<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
10716            mut self,
10717            v: T,
10718        ) -> Self {
10719            self.gop_mode = std::option::Option::Some(
10720                crate::model::video_stream::h_264_codec_settings::GopMode::GopDuration(v.into()),
10721            );
10722            self
10723        }
10724
10725        /// Sets the value of [color_format][crate::model::video_stream::H264CodecSettings::color_format].
10726        ///
10727        /// Note that all the setters affecting `color_format` are mutually
10728        /// exclusive.
10729        pub fn set_color_format<
10730            T: std::convert::Into<
10731                    std::option::Option<
10732                        crate::model::video_stream::h_264_codec_settings::ColorFormat,
10733                    >,
10734                >,
10735        >(
10736            mut self,
10737            v: T,
10738        ) -> Self {
10739            self.color_format = v.into();
10740            self
10741        }
10742
10743        /// The value of [color_format][crate::model::video_stream::H264CodecSettings::color_format]
10744        /// if it holds a `Sdr`, `None` if the field is not set or
10745        /// holds a different branch.
10746        pub fn sdr(
10747            &self,
10748        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H264ColorFormatSDR>>
10749        {
10750            #[allow(unreachable_patterns)]
10751            self.color_format.as_ref().and_then(|v| match v {
10752                crate::model::video_stream::h_264_codec_settings::ColorFormat::Sdr(v) => {
10753                    std::option::Option::Some(v)
10754                }
10755                _ => std::option::Option::None,
10756            })
10757        }
10758
10759        /// Sets the value of [color_format][crate::model::video_stream::H264CodecSettings::color_format]
10760        /// to hold a `Sdr`.
10761        ///
10762        /// Note that all the setters affecting `color_format` are
10763        /// mutually exclusive.
10764        pub fn set_sdr<
10765            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H264ColorFormatSDR>>,
10766        >(
10767            mut self,
10768            v: T,
10769        ) -> Self {
10770            self.color_format = std::option::Option::Some(
10771                crate::model::video_stream::h_264_codec_settings::ColorFormat::Sdr(v.into()),
10772            );
10773            self
10774        }
10775
10776        /// The value of [color_format][crate::model::video_stream::H264CodecSettings::color_format]
10777        /// if it holds a `Hlg`, `None` if the field is not set or
10778        /// holds a different branch.
10779        pub fn hlg(
10780            &self,
10781        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H264ColorFormatHLG>>
10782        {
10783            #[allow(unreachable_patterns)]
10784            self.color_format.as_ref().and_then(|v| match v {
10785                crate::model::video_stream::h_264_codec_settings::ColorFormat::Hlg(v) => {
10786                    std::option::Option::Some(v)
10787                }
10788                _ => std::option::Option::None,
10789            })
10790        }
10791
10792        /// Sets the value of [color_format][crate::model::video_stream::H264CodecSettings::color_format]
10793        /// to hold a `Hlg`.
10794        ///
10795        /// Note that all the setters affecting `color_format` are
10796        /// mutually exclusive.
10797        pub fn set_hlg<
10798            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H264ColorFormatHLG>>,
10799        >(
10800            mut self,
10801            v: T,
10802        ) -> Self {
10803            self.color_format = std::option::Option::Some(
10804                crate::model::video_stream::h_264_codec_settings::ColorFormat::Hlg(v.into()),
10805            );
10806            self
10807        }
10808    }
10809
10810    impl wkt::message::Message for H264CodecSettings {
10811        fn typename() -> &'static str {
10812            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings"
10813        }
10814    }
10815
10816    #[doc(hidden)]
10817    impl<'de> serde::de::Deserialize<'de> for H264CodecSettings {
10818        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10819        where
10820            D: serde::Deserializer<'de>,
10821        {
10822            #[allow(non_camel_case_types)]
10823            #[doc(hidden)]
10824            #[derive(PartialEq, Eq, Hash)]
10825            enum __FieldTag {
10826                __width_pixels,
10827                __height_pixels,
10828                __frame_rate,
10829                __frame_rate_conversion_strategy,
10830                __bitrate_bps,
10831                __pixel_format,
10832                __rate_control_mode,
10833                __crf_level,
10834                __allow_open_gop,
10835                __gop_frame_count,
10836                __gop_duration,
10837                __enable_two_pass,
10838                __vbv_size_bits,
10839                __vbv_fullness_bits,
10840                __entropy_coder,
10841                __b_pyramid,
10842                __b_frame_count,
10843                __aq_strength,
10844                __profile,
10845                __tune,
10846                __preset,
10847                __sdr,
10848                __hlg,
10849                Unknown(std::string::String),
10850            }
10851            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10852                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10853                where
10854                    D: serde::Deserializer<'de>,
10855                {
10856                    struct Visitor;
10857                    impl<'de> serde::de::Visitor<'de> for Visitor {
10858                        type Value = __FieldTag;
10859                        fn expecting(
10860                            &self,
10861                            formatter: &mut std::fmt::Formatter,
10862                        ) -> std::fmt::Result {
10863                            formatter.write_str("a field name for H264CodecSettings")
10864                        }
10865                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10866                        where
10867                            E: serde::de::Error,
10868                        {
10869                            use std::result::Result::Ok;
10870                            use std::string::ToString;
10871                            match value {
10872                                "widthPixels" => Ok(__FieldTag::__width_pixels),
10873                                "width_pixels" => Ok(__FieldTag::__width_pixels),
10874                                "heightPixels" => Ok(__FieldTag::__height_pixels),
10875                                "height_pixels" => Ok(__FieldTag::__height_pixels),
10876                                "frameRate" => Ok(__FieldTag::__frame_rate),
10877                                "frame_rate" => Ok(__FieldTag::__frame_rate),
10878                                "frameRateConversionStrategy" => {
10879                                    Ok(__FieldTag::__frame_rate_conversion_strategy)
10880                                }
10881                                "frame_rate_conversion_strategy" => {
10882                                    Ok(__FieldTag::__frame_rate_conversion_strategy)
10883                                }
10884                                "bitrateBps" => Ok(__FieldTag::__bitrate_bps),
10885                                "bitrate_bps" => Ok(__FieldTag::__bitrate_bps),
10886                                "pixelFormat" => Ok(__FieldTag::__pixel_format),
10887                                "pixel_format" => Ok(__FieldTag::__pixel_format),
10888                                "rateControlMode" => Ok(__FieldTag::__rate_control_mode),
10889                                "rate_control_mode" => Ok(__FieldTag::__rate_control_mode),
10890                                "crfLevel" => Ok(__FieldTag::__crf_level),
10891                                "crf_level" => Ok(__FieldTag::__crf_level),
10892                                "allowOpenGop" => Ok(__FieldTag::__allow_open_gop),
10893                                "allow_open_gop" => Ok(__FieldTag::__allow_open_gop),
10894                                "gopFrameCount" => Ok(__FieldTag::__gop_frame_count),
10895                                "gop_frame_count" => Ok(__FieldTag::__gop_frame_count),
10896                                "gopDuration" => Ok(__FieldTag::__gop_duration),
10897                                "gop_duration" => Ok(__FieldTag::__gop_duration),
10898                                "enableTwoPass" => Ok(__FieldTag::__enable_two_pass),
10899                                "enable_two_pass" => Ok(__FieldTag::__enable_two_pass),
10900                                "vbvSizeBits" => Ok(__FieldTag::__vbv_size_bits),
10901                                "vbv_size_bits" => Ok(__FieldTag::__vbv_size_bits),
10902                                "vbvFullnessBits" => Ok(__FieldTag::__vbv_fullness_bits),
10903                                "vbv_fullness_bits" => Ok(__FieldTag::__vbv_fullness_bits),
10904                                "entropyCoder" => Ok(__FieldTag::__entropy_coder),
10905                                "entropy_coder" => Ok(__FieldTag::__entropy_coder),
10906                                "bPyramid" => Ok(__FieldTag::__b_pyramid),
10907                                "b_pyramid" => Ok(__FieldTag::__b_pyramid),
10908                                "bFrameCount" => Ok(__FieldTag::__b_frame_count),
10909                                "b_frame_count" => Ok(__FieldTag::__b_frame_count),
10910                                "aqStrength" => Ok(__FieldTag::__aq_strength),
10911                                "aq_strength" => Ok(__FieldTag::__aq_strength),
10912                                "profile" => Ok(__FieldTag::__profile),
10913                                "tune" => Ok(__FieldTag::__tune),
10914                                "preset" => Ok(__FieldTag::__preset),
10915                                "sdr" => Ok(__FieldTag::__sdr),
10916                                "hlg" => Ok(__FieldTag::__hlg),
10917                                _ => Ok(__FieldTag::Unknown(value.to_string())),
10918                            }
10919                        }
10920                    }
10921                    deserializer.deserialize_identifier(Visitor)
10922                }
10923            }
10924            struct Visitor;
10925            impl<'de> serde::de::Visitor<'de> for Visitor {
10926                type Value = H264CodecSettings;
10927                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10928                    formatter.write_str("struct H264CodecSettings")
10929                }
10930                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10931                where
10932                    A: serde::de::MapAccess<'de>,
10933                {
10934                    #[allow(unused_imports)]
10935                    use serde::de::Error;
10936                    use std::option::Option::Some;
10937                    let mut fields = std::collections::HashSet::new();
10938                    let mut result = Self::Value::new();
10939                    while let Some(tag) = map.next_key::<__FieldTag>()? {
10940                        #[allow(clippy::match_single_binding)]
10941                        match tag {
10942                            __FieldTag::__width_pixels => {
10943                                if !fields.insert(__FieldTag::__width_pixels) {
10944                                    return std::result::Result::Err(A::Error::duplicate_field(
10945                                        "multiple values for width_pixels",
10946                                    ));
10947                                }
10948                                struct __With(std::option::Option<i32>);
10949                                impl<'de> serde::de::Deserialize<'de> for __With {
10950                                    fn deserialize<D>(
10951                                        deserializer: D,
10952                                    ) -> std::result::Result<Self, D::Error>
10953                                    where
10954                                        D: serde::de::Deserializer<'de>,
10955                                    {
10956                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
10957                                    }
10958                                }
10959                                result.width_pixels =
10960                                    map.next_value::<__With>()?.0.unwrap_or_default();
10961                            }
10962                            __FieldTag::__height_pixels => {
10963                                if !fields.insert(__FieldTag::__height_pixels) {
10964                                    return std::result::Result::Err(A::Error::duplicate_field(
10965                                        "multiple values for height_pixels",
10966                                    ));
10967                                }
10968                                struct __With(std::option::Option<i32>);
10969                                impl<'de> serde::de::Deserialize<'de> for __With {
10970                                    fn deserialize<D>(
10971                                        deserializer: D,
10972                                    ) -> std::result::Result<Self, D::Error>
10973                                    where
10974                                        D: serde::de::Deserializer<'de>,
10975                                    {
10976                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
10977                                    }
10978                                }
10979                                result.height_pixels =
10980                                    map.next_value::<__With>()?.0.unwrap_or_default();
10981                            }
10982                            __FieldTag::__frame_rate => {
10983                                if !fields.insert(__FieldTag::__frame_rate) {
10984                                    return std::result::Result::Err(A::Error::duplicate_field(
10985                                        "multiple values for frame_rate",
10986                                    ));
10987                                }
10988                                struct __With(std::option::Option<f64>);
10989                                impl<'de> serde::de::Deserialize<'de> for __With {
10990                                    fn deserialize<D>(
10991                                        deserializer: D,
10992                                    ) -> std::result::Result<Self, D::Error>
10993                                    where
10994                                        D: serde::de::Deserializer<'de>,
10995                                    {
10996                                        serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
10997                                    }
10998                                }
10999                                result.frame_rate =
11000                                    map.next_value::<__With>()?.0.unwrap_or_default();
11001                            }
11002                            __FieldTag::__frame_rate_conversion_strategy => {
11003                                if !fields.insert(__FieldTag::__frame_rate_conversion_strategy) {
11004                                    return std::result::Result::Err(A::Error::duplicate_field(
11005                                        "multiple values for frame_rate_conversion_strategy",
11006                                    ));
11007                                }
11008                                result.frame_rate_conversion_strategy = map
11009                                    .next_value::<std::option::Option<
11010                                        crate::model::video_stream::FrameRateConversionStrategy,
11011                                    >>()?
11012                                    .unwrap_or_default();
11013                            }
11014                            __FieldTag::__bitrate_bps => {
11015                                if !fields.insert(__FieldTag::__bitrate_bps) {
11016                                    return std::result::Result::Err(A::Error::duplicate_field(
11017                                        "multiple values for bitrate_bps",
11018                                    ));
11019                                }
11020                                struct __With(std::option::Option<i32>);
11021                                impl<'de> serde::de::Deserialize<'de> for __With {
11022                                    fn deserialize<D>(
11023                                        deserializer: D,
11024                                    ) -> std::result::Result<Self, D::Error>
11025                                    where
11026                                        D: serde::de::Deserializer<'de>,
11027                                    {
11028                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
11029                                    }
11030                                }
11031                                result.bitrate_bps =
11032                                    map.next_value::<__With>()?.0.unwrap_or_default();
11033                            }
11034                            __FieldTag::__pixel_format => {
11035                                if !fields.insert(__FieldTag::__pixel_format) {
11036                                    return std::result::Result::Err(A::Error::duplicate_field(
11037                                        "multiple values for pixel_format",
11038                                    ));
11039                                }
11040                                result.pixel_format = map
11041                                    .next_value::<std::option::Option<std::string::String>>()?
11042                                    .unwrap_or_default();
11043                            }
11044                            __FieldTag::__rate_control_mode => {
11045                                if !fields.insert(__FieldTag::__rate_control_mode) {
11046                                    return std::result::Result::Err(A::Error::duplicate_field(
11047                                        "multiple values for rate_control_mode",
11048                                    ));
11049                                }
11050                                result.rate_control_mode = map
11051                                    .next_value::<std::option::Option<std::string::String>>()?
11052                                    .unwrap_or_default();
11053                            }
11054                            __FieldTag::__crf_level => {
11055                                if !fields.insert(__FieldTag::__crf_level) {
11056                                    return std::result::Result::Err(A::Error::duplicate_field(
11057                                        "multiple values for crf_level",
11058                                    ));
11059                                }
11060                                struct __With(std::option::Option<i32>);
11061                                impl<'de> serde::de::Deserialize<'de> for __With {
11062                                    fn deserialize<D>(
11063                                        deserializer: D,
11064                                    ) -> std::result::Result<Self, D::Error>
11065                                    where
11066                                        D: serde::de::Deserializer<'de>,
11067                                    {
11068                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
11069                                    }
11070                                }
11071                                result.crf_level =
11072                                    map.next_value::<__With>()?.0.unwrap_or_default();
11073                            }
11074                            __FieldTag::__allow_open_gop => {
11075                                if !fields.insert(__FieldTag::__allow_open_gop) {
11076                                    return std::result::Result::Err(A::Error::duplicate_field(
11077                                        "multiple values for allow_open_gop",
11078                                    ));
11079                                }
11080                                result.allow_open_gop = map
11081                                    .next_value::<std::option::Option<bool>>()?
11082                                    .unwrap_or_default();
11083                            }
11084                            __FieldTag::__gop_frame_count => {
11085                                if !fields.insert(__FieldTag::__gop_frame_count) {
11086                                    return std::result::Result::Err(A::Error::duplicate_field(
11087                                        "multiple values for gop_frame_count",
11088                                    ));
11089                                }
11090                                struct __With(std::option::Option<i32>);
11091                                impl<'de> serde::de::Deserialize<'de> for __With {
11092                                    fn deserialize<D>(
11093                                        deserializer: D,
11094                                    ) -> std::result::Result<Self, D::Error>
11095                                    where
11096                                        D: serde::de::Deserializer<'de>,
11097                                    {
11098                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
11099                                    }
11100                                }
11101                                if result.gop_mode.is_some() {
11102                                    return std::result::Result::Err(A::Error::duplicate_field(
11103                                        "multiple values for `gop_mode`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.gop_frame_count, latest field was gopFrameCount",
11104                                    ));
11105                                }
11106                                result.gop_mode = std::option::Option::Some(
11107                                    crate::model::video_stream::h_264_codec_settings::GopMode::GopFrameCount(
11108                                        map.next_value::<__With>()?.0.unwrap_or_default()
11109                                    ),
11110                                );
11111                            }
11112                            __FieldTag::__gop_duration => {
11113                                if !fields.insert(__FieldTag::__gop_duration) {
11114                                    return std::result::Result::Err(A::Error::duplicate_field(
11115                                        "multiple values for gop_duration",
11116                                    ));
11117                                }
11118                                if result.gop_mode.is_some() {
11119                                    return std::result::Result::Err(A::Error::duplicate_field(
11120                                        "multiple values for `gop_mode`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.gop_duration, latest field was gopDuration",
11121                                    ));
11122                                }
11123                                result.gop_mode = std::option::Option::Some(
11124                                    crate::model::video_stream::h_264_codec_settings::GopMode::GopDuration(
11125                                        map.next_value::<std::option::Option<std::boxed::Box<wkt::Duration>>>()?.unwrap_or_default()
11126                                    ),
11127                                );
11128                            }
11129                            __FieldTag::__enable_two_pass => {
11130                                if !fields.insert(__FieldTag::__enable_two_pass) {
11131                                    return std::result::Result::Err(A::Error::duplicate_field(
11132                                        "multiple values for enable_two_pass",
11133                                    ));
11134                                }
11135                                result.enable_two_pass = map
11136                                    .next_value::<std::option::Option<bool>>()?
11137                                    .unwrap_or_default();
11138                            }
11139                            __FieldTag::__vbv_size_bits => {
11140                                if !fields.insert(__FieldTag::__vbv_size_bits) {
11141                                    return std::result::Result::Err(A::Error::duplicate_field(
11142                                        "multiple values for vbv_size_bits",
11143                                    ));
11144                                }
11145                                struct __With(std::option::Option<i32>);
11146                                impl<'de> serde::de::Deserialize<'de> for __With {
11147                                    fn deserialize<D>(
11148                                        deserializer: D,
11149                                    ) -> std::result::Result<Self, D::Error>
11150                                    where
11151                                        D: serde::de::Deserializer<'de>,
11152                                    {
11153                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
11154                                    }
11155                                }
11156                                result.vbv_size_bits =
11157                                    map.next_value::<__With>()?.0.unwrap_or_default();
11158                            }
11159                            __FieldTag::__vbv_fullness_bits => {
11160                                if !fields.insert(__FieldTag::__vbv_fullness_bits) {
11161                                    return std::result::Result::Err(A::Error::duplicate_field(
11162                                        "multiple values for vbv_fullness_bits",
11163                                    ));
11164                                }
11165                                struct __With(std::option::Option<i32>);
11166                                impl<'de> serde::de::Deserialize<'de> for __With {
11167                                    fn deserialize<D>(
11168                                        deserializer: D,
11169                                    ) -> std::result::Result<Self, D::Error>
11170                                    where
11171                                        D: serde::de::Deserializer<'de>,
11172                                    {
11173                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
11174                                    }
11175                                }
11176                                result.vbv_fullness_bits =
11177                                    map.next_value::<__With>()?.0.unwrap_or_default();
11178                            }
11179                            __FieldTag::__entropy_coder => {
11180                                if !fields.insert(__FieldTag::__entropy_coder) {
11181                                    return std::result::Result::Err(A::Error::duplicate_field(
11182                                        "multiple values for entropy_coder",
11183                                    ));
11184                                }
11185                                result.entropy_coder = map
11186                                    .next_value::<std::option::Option<std::string::String>>()?
11187                                    .unwrap_or_default();
11188                            }
11189                            __FieldTag::__b_pyramid => {
11190                                if !fields.insert(__FieldTag::__b_pyramid) {
11191                                    return std::result::Result::Err(A::Error::duplicate_field(
11192                                        "multiple values for b_pyramid",
11193                                    ));
11194                                }
11195                                result.b_pyramid = map
11196                                    .next_value::<std::option::Option<bool>>()?
11197                                    .unwrap_or_default();
11198                            }
11199                            __FieldTag::__b_frame_count => {
11200                                if !fields.insert(__FieldTag::__b_frame_count) {
11201                                    return std::result::Result::Err(A::Error::duplicate_field(
11202                                        "multiple values for b_frame_count",
11203                                    ));
11204                                }
11205                                struct __With(std::option::Option<i32>);
11206                                impl<'de> serde::de::Deserialize<'de> for __With {
11207                                    fn deserialize<D>(
11208                                        deserializer: D,
11209                                    ) -> std::result::Result<Self, D::Error>
11210                                    where
11211                                        D: serde::de::Deserializer<'de>,
11212                                    {
11213                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
11214                                    }
11215                                }
11216                                result.b_frame_count =
11217                                    map.next_value::<__With>()?.0.unwrap_or_default();
11218                            }
11219                            __FieldTag::__aq_strength => {
11220                                if !fields.insert(__FieldTag::__aq_strength) {
11221                                    return std::result::Result::Err(A::Error::duplicate_field(
11222                                        "multiple values for aq_strength",
11223                                    ));
11224                                }
11225                                struct __With(std::option::Option<f64>);
11226                                impl<'de> serde::de::Deserialize<'de> for __With {
11227                                    fn deserialize<D>(
11228                                        deserializer: D,
11229                                    ) -> std::result::Result<Self, D::Error>
11230                                    where
11231                                        D: serde::de::Deserializer<'de>,
11232                                    {
11233                                        serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
11234                                    }
11235                                }
11236                                result.aq_strength =
11237                                    map.next_value::<__With>()?.0.unwrap_or_default();
11238                            }
11239                            __FieldTag::__profile => {
11240                                if !fields.insert(__FieldTag::__profile) {
11241                                    return std::result::Result::Err(A::Error::duplicate_field(
11242                                        "multiple values for profile",
11243                                    ));
11244                                }
11245                                result.profile = map
11246                                    .next_value::<std::option::Option<std::string::String>>()?
11247                                    .unwrap_or_default();
11248                            }
11249                            __FieldTag::__tune => {
11250                                if !fields.insert(__FieldTag::__tune) {
11251                                    return std::result::Result::Err(A::Error::duplicate_field(
11252                                        "multiple values for tune",
11253                                    ));
11254                                }
11255                                result.tune = map
11256                                    .next_value::<std::option::Option<std::string::String>>()?
11257                                    .unwrap_or_default();
11258                            }
11259                            __FieldTag::__preset => {
11260                                if !fields.insert(__FieldTag::__preset) {
11261                                    return std::result::Result::Err(A::Error::duplicate_field(
11262                                        "multiple values for preset",
11263                                    ));
11264                                }
11265                                result.preset = map
11266                                    .next_value::<std::option::Option<std::string::String>>()?
11267                                    .unwrap_or_default();
11268                            }
11269                            __FieldTag::__sdr => {
11270                                if !fields.insert(__FieldTag::__sdr) {
11271                                    return std::result::Result::Err(A::Error::duplicate_field(
11272                                        "multiple values for sdr",
11273                                    ));
11274                                }
11275                                if result.color_format.is_some() {
11276                                    return std::result::Result::Err(A::Error::duplicate_field(
11277                                        "multiple values for `color_format`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.sdr, latest field was sdr",
11278                                    ));
11279                                }
11280                                result.color_format = std::option::Option::Some(
11281                                    crate::model::video_stream::h_264_codec_settings::ColorFormat::Sdr(
11282                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::video_stream::H264ColorFormatSDR>>>()?.unwrap_or_default()
11283                                    ),
11284                                );
11285                            }
11286                            __FieldTag::__hlg => {
11287                                if !fields.insert(__FieldTag::__hlg) {
11288                                    return std::result::Result::Err(A::Error::duplicate_field(
11289                                        "multiple values for hlg",
11290                                    ));
11291                                }
11292                                if result.color_format.is_some() {
11293                                    return std::result::Result::Err(A::Error::duplicate_field(
11294                                        "multiple values for `color_format`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.hlg, latest field was hlg",
11295                                    ));
11296                                }
11297                                result.color_format = std::option::Option::Some(
11298                                    crate::model::video_stream::h_264_codec_settings::ColorFormat::Hlg(
11299                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::video_stream::H264ColorFormatHLG>>>()?.unwrap_or_default()
11300                                    ),
11301                                );
11302                            }
11303                            __FieldTag::Unknown(key) => {
11304                                let value = map.next_value::<serde_json::Value>()?;
11305                                result._unknown_fields.insert(key, value);
11306                            }
11307                        }
11308                    }
11309                    std::result::Result::Ok(result)
11310                }
11311            }
11312            deserializer.deserialize_any(Visitor)
11313        }
11314    }
11315
11316    #[doc(hidden)]
11317    impl serde::ser::Serialize for H264CodecSettings {
11318        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11319        where
11320            S: serde::ser::Serializer,
11321        {
11322            use serde::ser::SerializeMap;
11323            #[allow(unused_imports)]
11324            use std::option::Option::Some;
11325            let mut state = serializer.serialize_map(std::option::Option::None)?;
11326            if !wkt::internal::is_default(&self.width_pixels) {
11327                struct __With<'a>(&'a i32);
11328                impl<'a> serde::ser::Serialize for __With<'a> {
11329                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11330                    where
11331                        S: serde::ser::Serializer,
11332                    {
11333                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
11334                    }
11335                }
11336                state.serialize_entry("widthPixels", &__With(&self.width_pixels))?;
11337            }
11338            if !wkt::internal::is_default(&self.height_pixels) {
11339                struct __With<'a>(&'a i32);
11340                impl<'a> serde::ser::Serialize for __With<'a> {
11341                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11342                    where
11343                        S: serde::ser::Serializer,
11344                    {
11345                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
11346                    }
11347                }
11348                state.serialize_entry("heightPixels", &__With(&self.height_pixels))?;
11349            }
11350            if !wkt::internal::is_default(&self.frame_rate) {
11351                struct __With<'a>(&'a f64);
11352                impl<'a> serde::ser::Serialize for __With<'a> {
11353                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11354                    where
11355                        S: serde::ser::Serializer,
11356                    {
11357                        serde_with::As::<wkt::internal::F64>::serialize(self.0, serializer)
11358                    }
11359                }
11360                state.serialize_entry("frameRate", &__With(&self.frame_rate))?;
11361            }
11362            if !wkt::internal::is_default(&self.frame_rate_conversion_strategy) {
11363                state.serialize_entry(
11364                    "frameRateConversionStrategy",
11365                    &self.frame_rate_conversion_strategy,
11366                )?;
11367            }
11368            if !wkt::internal::is_default(&self.bitrate_bps) {
11369                struct __With<'a>(&'a i32);
11370                impl<'a> serde::ser::Serialize for __With<'a> {
11371                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11372                    where
11373                        S: serde::ser::Serializer,
11374                    {
11375                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
11376                    }
11377                }
11378                state.serialize_entry("bitrateBps", &__With(&self.bitrate_bps))?;
11379            }
11380            if !self.pixel_format.is_empty() {
11381                state.serialize_entry("pixelFormat", &self.pixel_format)?;
11382            }
11383            if !self.rate_control_mode.is_empty() {
11384                state.serialize_entry("rateControlMode", &self.rate_control_mode)?;
11385            }
11386            if !wkt::internal::is_default(&self.crf_level) {
11387                struct __With<'a>(&'a i32);
11388                impl<'a> serde::ser::Serialize for __With<'a> {
11389                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11390                    where
11391                        S: serde::ser::Serializer,
11392                    {
11393                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
11394                    }
11395                }
11396                state.serialize_entry("crfLevel", &__With(&self.crf_level))?;
11397            }
11398            if !wkt::internal::is_default(&self.allow_open_gop) {
11399                state.serialize_entry("allowOpenGop", &self.allow_open_gop)?;
11400            }
11401            if let Some(value) = self.gop_frame_count() {
11402                struct __With<'a>(&'a i32);
11403                impl<'a> serde::ser::Serialize for __With<'a> {
11404                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11405                    where
11406                        S: serde::ser::Serializer,
11407                    {
11408                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
11409                    }
11410                }
11411                state.serialize_entry("gopFrameCount", &__With(value))?;
11412            }
11413            if let Some(value) = self.gop_duration() {
11414                state.serialize_entry("gopDuration", value)?;
11415            }
11416            if !wkt::internal::is_default(&self.enable_two_pass) {
11417                state.serialize_entry("enableTwoPass", &self.enable_two_pass)?;
11418            }
11419            if !wkt::internal::is_default(&self.vbv_size_bits) {
11420                struct __With<'a>(&'a i32);
11421                impl<'a> serde::ser::Serialize for __With<'a> {
11422                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11423                    where
11424                        S: serde::ser::Serializer,
11425                    {
11426                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
11427                    }
11428                }
11429                state.serialize_entry("vbvSizeBits", &__With(&self.vbv_size_bits))?;
11430            }
11431            if !wkt::internal::is_default(&self.vbv_fullness_bits) {
11432                struct __With<'a>(&'a i32);
11433                impl<'a> serde::ser::Serialize for __With<'a> {
11434                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11435                    where
11436                        S: serde::ser::Serializer,
11437                    {
11438                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
11439                    }
11440                }
11441                state.serialize_entry("vbvFullnessBits", &__With(&self.vbv_fullness_bits))?;
11442            }
11443            if !self.entropy_coder.is_empty() {
11444                state.serialize_entry("entropyCoder", &self.entropy_coder)?;
11445            }
11446            if !wkt::internal::is_default(&self.b_pyramid) {
11447                state.serialize_entry("bPyramid", &self.b_pyramid)?;
11448            }
11449            if !wkt::internal::is_default(&self.b_frame_count) {
11450                struct __With<'a>(&'a i32);
11451                impl<'a> serde::ser::Serialize for __With<'a> {
11452                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11453                    where
11454                        S: serde::ser::Serializer,
11455                    {
11456                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
11457                    }
11458                }
11459                state.serialize_entry("bFrameCount", &__With(&self.b_frame_count))?;
11460            }
11461            if !wkt::internal::is_default(&self.aq_strength) {
11462                struct __With<'a>(&'a f64);
11463                impl<'a> serde::ser::Serialize for __With<'a> {
11464                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11465                    where
11466                        S: serde::ser::Serializer,
11467                    {
11468                        serde_with::As::<wkt::internal::F64>::serialize(self.0, serializer)
11469                    }
11470                }
11471                state.serialize_entry("aqStrength", &__With(&self.aq_strength))?;
11472            }
11473            if !self.profile.is_empty() {
11474                state.serialize_entry("profile", &self.profile)?;
11475            }
11476            if !self.tune.is_empty() {
11477                state.serialize_entry("tune", &self.tune)?;
11478            }
11479            if !self.preset.is_empty() {
11480                state.serialize_entry("preset", &self.preset)?;
11481            }
11482            if let Some(value) = self.sdr() {
11483                state.serialize_entry("sdr", value)?;
11484            }
11485            if let Some(value) = self.hlg() {
11486                state.serialize_entry("hlg", value)?;
11487            }
11488            if !self._unknown_fields.is_empty() {
11489                for (key, value) in self._unknown_fields.iter() {
11490                    state.serialize_entry(key, &value)?;
11491                }
11492            }
11493            state.end()
11494        }
11495    }
11496
11497    impl std::fmt::Debug for H264CodecSettings {
11498        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11499            let mut debug_struct = f.debug_struct("H264CodecSettings");
11500            debug_struct.field("width_pixels", &self.width_pixels);
11501            debug_struct.field("height_pixels", &self.height_pixels);
11502            debug_struct.field("frame_rate", &self.frame_rate);
11503            debug_struct.field(
11504                "frame_rate_conversion_strategy",
11505                &self.frame_rate_conversion_strategy,
11506            );
11507            debug_struct.field("bitrate_bps", &self.bitrate_bps);
11508            debug_struct.field("pixel_format", &self.pixel_format);
11509            debug_struct.field("rate_control_mode", &self.rate_control_mode);
11510            debug_struct.field("crf_level", &self.crf_level);
11511            debug_struct.field("allow_open_gop", &self.allow_open_gop);
11512            debug_struct.field("enable_two_pass", &self.enable_two_pass);
11513            debug_struct.field("vbv_size_bits", &self.vbv_size_bits);
11514            debug_struct.field("vbv_fullness_bits", &self.vbv_fullness_bits);
11515            debug_struct.field("entropy_coder", &self.entropy_coder);
11516            debug_struct.field("b_pyramid", &self.b_pyramid);
11517            debug_struct.field("b_frame_count", &self.b_frame_count);
11518            debug_struct.field("aq_strength", &self.aq_strength);
11519            debug_struct.field("profile", &self.profile);
11520            debug_struct.field("tune", &self.tune);
11521            debug_struct.field("preset", &self.preset);
11522            debug_struct.field("gop_mode", &self.gop_mode);
11523            debug_struct.field("color_format", &self.color_format);
11524            if !self._unknown_fields.is_empty() {
11525                debug_struct.field("_unknown_fields", &self._unknown_fields);
11526            }
11527            debug_struct.finish()
11528        }
11529    }
11530
11531    /// Defines additional types related to [H264CodecSettings].
11532    pub mod h_264_codec_settings {
11533        #[allow(unused_imports)]
11534        use super::*;
11535
11536        /// GOP mode can be either by frame count or duration.
11537        #[derive(Clone, Debug, PartialEq)]
11538        #[non_exhaustive]
11539        pub enum GopMode {
11540            /// Select the GOP size based on the specified frame count. Must be greater
11541            /// than zero.
11542            GopFrameCount(i32),
11543            /// Select the GOP size based on the specified duration. The default is
11544            /// `3s`. Note that `gopDuration` must be less than or equal to
11545            /// [`segmentDuration`](#SegmentSettings), and
11546            /// [`segmentDuration`](#SegmentSettings) must be divisible by
11547            /// `gopDuration`.
11548            GopDuration(std::boxed::Box<wkt::Duration>),
11549        }
11550
11551        /// Color format can be sdr or hlg.
11552        #[derive(Clone, Debug, PartialEq)]
11553        #[non_exhaustive]
11554        pub enum ColorFormat {
11555            /// Optional. SDR color format setting for H264.
11556            Sdr(std::boxed::Box<crate::model::video_stream::H264ColorFormatSDR>),
11557            /// Optional. HLG color format setting for H264.
11558            Hlg(std::boxed::Box<crate::model::video_stream::H264ColorFormatHLG>),
11559        }
11560    }
11561
11562    /// Convert the input video to a Standard Dynamic Range (SDR) video.
11563    #[derive(Clone, Default, PartialEq)]
11564    #[non_exhaustive]
11565    pub struct H265ColorFormatSDR {
11566        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11567    }
11568
11569    impl H265ColorFormatSDR {
11570        pub fn new() -> Self {
11571            std::default::Default::default()
11572        }
11573    }
11574
11575    impl wkt::message::Message for H265ColorFormatSDR {
11576        fn typename() -> &'static str {
11577            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H265ColorFormatSDR"
11578        }
11579    }
11580
11581    #[doc(hidden)]
11582    impl<'de> serde::de::Deserialize<'de> for H265ColorFormatSDR {
11583        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11584        where
11585            D: serde::Deserializer<'de>,
11586        {
11587            #[allow(non_camel_case_types)]
11588            #[doc(hidden)]
11589            #[derive(PartialEq, Eq, Hash)]
11590            enum __FieldTag {
11591                Unknown(std::string::String),
11592            }
11593            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11594                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11595                where
11596                    D: serde::Deserializer<'de>,
11597                {
11598                    struct Visitor;
11599                    impl<'de> serde::de::Visitor<'de> for Visitor {
11600                        type Value = __FieldTag;
11601                        fn expecting(
11602                            &self,
11603                            formatter: &mut std::fmt::Formatter,
11604                        ) -> std::fmt::Result {
11605                            formatter.write_str("a field name for H265ColorFormatSDR")
11606                        }
11607                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11608                        where
11609                            E: serde::de::Error,
11610                        {
11611                            use std::result::Result::Ok;
11612                            use std::string::ToString;
11613                            Ok(__FieldTag::Unknown(value.to_string()))
11614                        }
11615                    }
11616                    deserializer.deserialize_identifier(Visitor)
11617                }
11618            }
11619            struct Visitor;
11620            impl<'de> serde::de::Visitor<'de> for Visitor {
11621                type Value = H265ColorFormatSDR;
11622                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11623                    formatter.write_str("struct H265ColorFormatSDR")
11624                }
11625                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11626                where
11627                    A: serde::de::MapAccess<'de>,
11628                {
11629                    #[allow(unused_imports)]
11630                    use serde::de::Error;
11631                    use std::option::Option::Some;
11632                    let mut result = Self::Value::new();
11633                    while let Some(tag) = map.next_key::<__FieldTag>()? {
11634                        #[allow(clippy::match_single_binding)]
11635                        match tag {
11636                            __FieldTag::Unknown(key) => {
11637                                let value = map.next_value::<serde_json::Value>()?;
11638                                result._unknown_fields.insert(key, value);
11639                            }
11640                        }
11641                    }
11642                    std::result::Result::Ok(result)
11643                }
11644            }
11645            deserializer.deserialize_any(Visitor)
11646        }
11647    }
11648
11649    #[doc(hidden)]
11650    impl serde::ser::Serialize for H265ColorFormatSDR {
11651        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11652        where
11653            S: serde::ser::Serializer,
11654        {
11655            use serde::ser::SerializeMap;
11656            #[allow(unused_imports)]
11657            use std::option::Option::Some;
11658            let mut state = serializer.serialize_map(std::option::Option::None)?;
11659            if !self._unknown_fields.is_empty() {
11660                for (key, value) in self._unknown_fields.iter() {
11661                    state.serialize_entry(key, &value)?;
11662                }
11663            }
11664            state.end()
11665        }
11666    }
11667
11668    impl std::fmt::Debug for H265ColorFormatSDR {
11669        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11670            let mut debug_struct = f.debug_struct("H265ColorFormatSDR");
11671            if !self._unknown_fields.is_empty() {
11672                debug_struct.field("_unknown_fields", &self._unknown_fields);
11673            }
11674            debug_struct.finish()
11675        }
11676    }
11677
11678    /// Convert the input video to a Hybrid Log Gamma (HLG) video.
11679    #[derive(Clone, Default, PartialEq)]
11680    #[non_exhaustive]
11681    pub struct H265ColorFormatHLG {
11682        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11683    }
11684
11685    impl H265ColorFormatHLG {
11686        pub fn new() -> Self {
11687            std::default::Default::default()
11688        }
11689    }
11690
11691    impl wkt::message::Message for H265ColorFormatHLG {
11692        fn typename() -> &'static str {
11693            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H265ColorFormatHLG"
11694        }
11695    }
11696
11697    #[doc(hidden)]
11698    impl<'de> serde::de::Deserialize<'de> for H265ColorFormatHLG {
11699        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11700        where
11701            D: serde::Deserializer<'de>,
11702        {
11703            #[allow(non_camel_case_types)]
11704            #[doc(hidden)]
11705            #[derive(PartialEq, Eq, Hash)]
11706            enum __FieldTag {
11707                Unknown(std::string::String),
11708            }
11709            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11710                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11711                where
11712                    D: serde::Deserializer<'de>,
11713                {
11714                    struct Visitor;
11715                    impl<'de> serde::de::Visitor<'de> for Visitor {
11716                        type Value = __FieldTag;
11717                        fn expecting(
11718                            &self,
11719                            formatter: &mut std::fmt::Formatter,
11720                        ) -> std::fmt::Result {
11721                            formatter.write_str("a field name for H265ColorFormatHLG")
11722                        }
11723                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11724                        where
11725                            E: serde::de::Error,
11726                        {
11727                            use std::result::Result::Ok;
11728                            use std::string::ToString;
11729                            Ok(__FieldTag::Unknown(value.to_string()))
11730                        }
11731                    }
11732                    deserializer.deserialize_identifier(Visitor)
11733                }
11734            }
11735            struct Visitor;
11736            impl<'de> serde::de::Visitor<'de> for Visitor {
11737                type Value = H265ColorFormatHLG;
11738                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11739                    formatter.write_str("struct H265ColorFormatHLG")
11740                }
11741                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11742                where
11743                    A: serde::de::MapAccess<'de>,
11744                {
11745                    #[allow(unused_imports)]
11746                    use serde::de::Error;
11747                    use std::option::Option::Some;
11748                    let mut result = Self::Value::new();
11749                    while let Some(tag) = map.next_key::<__FieldTag>()? {
11750                        #[allow(clippy::match_single_binding)]
11751                        match tag {
11752                            __FieldTag::Unknown(key) => {
11753                                let value = map.next_value::<serde_json::Value>()?;
11754                                result._unknown_fields.insert(key, value);
11755                            }
11756                        }
11757                    }
11758                    std::result::Result::Ok(result)
11759                }
11760            }
11761            deserializer.deserialize_any(Visitor)
11762        }
11763    }
11764
11765    #[doc(hidden)]
11766    impl serde::ser::Serialize for H265ColorFormatHLG {
11767        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11768        where
11769            S: serde::ser::Serializer,
11770        {
11771            use serde::ser::SerializeMap;
11772            #[allow(unused_imports)]
11773            use std::option::Option::Some;
11774            let mut state = serializer.serialize_map(std::option::Option::None)?;
11775            if !self._unknown_fields.is_empty() {
11776                for (key, value) in self._unknown_fields.iter() {
11777                    state.serialize_entry(key, &value)?;
11778                }
11779            }
11780            state.end()
11781        }
11782    }
11783
11784    impl std::fmt::Debug for H265ColorFormatHLG {
11785        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11786            let mut debug_struct = f.debug_struct("H265ColorFormatHLG");
11787            if !self._unknown_fields.is_empty() {
11788                debug_struct.field("_unknown_fields", &self._unknown_fields);
11789            }
11790            debug_struct.finish()
11791        }
11792    }
11793
11794    /// Convert the input video to a High Dynamic Range 10 (HDR10) video.
11795    #[derive(Clone, Default, PartialEq)]
11796    #[non_exhaustive]
11797    pub struct H265ColorFormatHDR10 {
11798        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11799    }
11800
11801    impl H265ColorFormatHDR10 {
11802        pub fn new() -> Self {
11803            std::default::Default::default()
11804        }
11805    }
11806
11807    impl wkt::message::Message for H265ColorFormatHDR10 {
11808        fn typename() -> &'static str {
11809            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H265ColorFormatHDR10"
11810        }
11811    }
11812
11813    #[doc(hidden)]
11814    impl<'de> serde::de::Deserialize<'de> for H265ColorFormatHDR10 {
11815        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11816        where
11817            D: serde::Deserializer<'de>,
11818        {
11819            #[allow(non_camel_case_types)]
11820            #[doc(hidden)]
11821            #[derive(PartialEq, Eq, Hash)]
11822            enum __FieldTag {
11823                Unknown(std::string::String),
11824            }
11825            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11826                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11827                where
11828                    D: serde::Deserializer<'de>,
11829                {
11830                    struct Visitor;
11831                    impl<'de> serde::de::Visitor<'de> for Visitor {
11832                        type Value = __FieldTag;
11833                        fn expecting(
11834                            &self,
11835                            formatter: &mut std::fmt::Formatter,
11836                        ) -> std::fmt::Result {
11837                            formatter.write_str("a field name for H265ColorFormatHDR10")
11838                        }
11839                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11840                        where
11841                            E: serde::de::Error,
11842                        {
11843                            use std::result::Result::Ok;
11844                            use std::string::ToString;
11845                            Ok(__FieldTag::Unknown(value.to_string()))
11846                        }
11847                    }
11848                    deserializer.deserialize_identifier(Visitor)
11849                }
11850            }
11851            struct Visitor;
11852            impl<'de> serde::de::Visitor<'de> for Visitor {
11853                type Value = H265ColorFormatHDR10;
11854                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11855                    formatter.write_str("struct H265ColorFormatHDR10")
11856                }
11857                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11858                where
11859                    A: serde::de::MapAccess<'de>,
11860                {
11861                    #[allow(unused_imports)]
11862                    use serde::de::Error;
11863                    use std::option::Option::Some;
11864                    let mut result = Self::Value::new();
11865                    while let Some(tag) = map.next_key::<__FieldTag>()? {
11866                        #[allow(clippy::match_single_binding)]
11867                        match tag {
11868                            __FieldTag::Unknown(key) => {
11869                                let value = map.next_value::<serde_json::Value>()?;
11870                                result._unknown_fields.insert(key, value);
11871                            }
11872                        }
11873                    }
11874                    std::result::Result::Ok(result)
11875                }
11876            }
11877            deserializer.deserialize_any(Visitor)
11878        }
11879    }
11880
11881    #[doc(hidden)]
11882    impl serde::ser::Serialize for H265ColorFormatHDR10 {
11883        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11884        where
11885            S: serde::ser::Serializer,
11886        {
11887            use serde::ser::SerializeMap;
11888            #[allow(unused_imports)]
11889            use std::option::Option::Some;
11890            let mut state = serializer.serialize_map(std::option::Option::None)?;
11891            if !self._unknown_fields.is_empty() {
11892                for (key, value) in self._unknown_fields.iter() {
11893                    state.serialize_entry(key, &value)?;
11894                }
11895            }
11896            state.end()
11897        }
11898    }
11899
11900    impl std::fmt::Debug for H265ColorFormatHDR10 {
11901        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11902            let mut debug_struct = f.debug_struct("H265ColorFormatHDR10");
11903            if !self._unknown_fields.is_empty() {
11904                debug_struct.field("_unknown_fields", &self._unknown_fields);
11905            }
11906            debug_struct.finish()
11907        }
11908    }
11909
11910    /// H265 codec settings.
11911    #[derive(Clone, Default, PartialEq)]
11912    #[non_exhaustive]
11913    pub struct H265CodecSettings {
11914        /// The width of the video in pixels. Must be an even integer.
11915        /// When not specified, the width is adjusted to match the specified height
11916        /// and input aspect ratio. If both are omitted, the input width is used.
11917        ///
11918        /// For portrait videos that contain horizontal ASR and rotation metadata,
11919        /// provide the width, in pixels, per the horizontal ASR. The API calculates
11920        /// the height per the horizontal ASR. The API detects any rotation metadata
11921        /// and swaps the requested height and width for the output.
11922        pub width_pixels: i32,
11923
11924        /// The height of the video in pixels. Must be an even integer.
11925        /// When not specified, the height is adjusted to match the specified width
11926        /// and input aspect ratio. If both are omitted, the input height is used.
11927        ///
11928        /// For portrait videos that contain horizontal ASR and rotation metadata,
11929        /// provide the height, in pixels, per the horizontal ASR. The API calculates
11930        /// the width per the horizontal ASR. The API detects any rotation metadata
11931        /// and swaps the requested height and width for the output.
11932        pub height_pixels: i32,
11933
11934        /// Required. The target video frame rate in frames per second (FPS). Must be
11935        /// less than or equal to 120.
11936        pub frame_rate: f64,
11937
11938        /// Optional. Frame rate conversion strategy for desired frame rate. The
11939        /// default is `DOWNSAMPLE`.
11940        pub frame_rate_conversion_strategy: crate::model::video_stream::FrameRateConversionStrategy,
11941
11942        /// Required. The video bitrate in bits per second. The minimum value is
11943        /// 1,000. The maximum value is 800,000,000.
11944        pub bitrate_bps: i32,
11945
11946        /// Pixel format to use. The default is `yuv420p`.
11947        ///
11948        /// Supported pixel formats:
11949        ///
11950        /// - `yuv420p` pixel format
11951        /// - `yuv422p` pixel format
11952        /// - `yuv444p` pixel format
11953        /// - `yuv420p10` 10-bit HDR pixel format
11954        /// - `yuv422p10` 10-bit HDR pixel format
11955        /// - `yuv444p10` 10-bit HDR pixel format
11956        /// - `yuv420p12` 12-bit HDR pixel format
11957        /// - `yuv422p12` 12-bit HDR pixel format
11958        /// - `yuv444p12` 12-bit HDR pixel format
11959        pub pixel_format: std::string::String,
11960
11961        /// Specify the mode. The default is `vbr`.
11962        ///
11963        /// Supported rate control modes:
11964        ///
11965        /// - `vbr` - variable bitrate
11966        /// - `crf` - constant rate factor
11967        pub rate_control_mode: std::string::String,
11968
11969        /// Target CRF level. Must be between 10 and 36, where 10 is the highest
11970        /// quality and 36 is the most efficient compression. The default is 21.
11971        pub crf_level: i32,
11972
11973        /// Specifies whether an open Group of Pictures (GOP) structure should be
11974        /// allowed or not. The default is `false`.
11975        pub allow_open_gop: bool,
11976
11977        /// Use two-pass encoding strategy to achieve better video quality.
11978        /// [H265CodecSettings.rate_control_mode][google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.rate_control_mode]
11979        /// must be `vbr`. The default is `false`.
11980        ///
11981        /// [google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.rate_control_mode]: crate::model::video_stream::H265CodecSettings::rate_control_mode
11982        pub enable_two_pass: bool,
11983
11984        /// Size of the Video Buffering Verifier (VBV) buffer in bits. Must be
11985        /// greater than zero. The default is equal to `VideoStream.bitrate_bps`.
11986        pub vbv_size_bits: i32,
11987
11988        /// Initial fullness of the Video Buffering Verifier (VBV) buffer in bits.
11989        /// Must be greater than zero. The default is equal to 90% of
11990        /// [H265CodecSettings.vbv_size_bits][google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.vbv_size_bits].
11991        ///
11992        /// [google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.vbv_size_bits]: crate::model::video_stream::H265CodecSettings::vbv_size_bits
11993        pub vbv_fullness_bits: i32,
11994
11995        /// Allow B-pyramid for reference frame selection. This may not be supported
11996        /// on all decoders. The default is `false`.
11997        pub b_pyramid: bool,
11998
11999        /// The number of consecutive B-frames. Must be greater than or equal to
12000        /// zero. Must be less than
12001        /// [H265CodecSettings.gop_frame_count][google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.gop_frame_count]
12002        /// if set. The default is 0.
12003        ///
12004        /// [google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.gop_frame_count]: crate::model::video_stream::H265CodecSettings::gop_mode
12005        pub b_frame_count: i32,
12006
12007        /// Specify the intensity of the adaptive quantizer (AQ). Must be between 0
12008        /// and 1, where 0 disables the quantizer and 1 maximizes the quantizer. A
12009        /// higher value equals a lower bitrate but smoother image. The default is 0.
12010        pub aq_strength: f64,
12011
12012        /// Enforces the specified codec profile. The following profiles are
12013        /// supported:
12014        ///
12015        /// * 8-bit profiles
12016        ///   * `main` (default)
12017        ///   * `main-intra`
12018        ///   * `mainstillpicture`
12019        /// * 10-bit profiles
12020        ///   * `main10` (default)
12021        ///   * `main10-intra`
12022        ///   * `main422-10`
12023        ///   * `main422-10-intra`
12024        ///   * `main444-10`
12025        ///   * `main444-10-intra`
12026        /// * 12-bit profiles
12027        ///   * `main12` (default)
12028        ///   * `main12-intra`
12029        ///   * `main422-12`
12030        ///   * `main422-12-intra`
12031        ///   * `main444-12`
12032        ///   * `main444-12-intra`
12033        ///
12034        /// The available options are
12035        /// [FFmpeg-compatible](https://x265.readthedocs.io/).
12036        /// Note that certain values for this field may cause the
12037        /// transcoder to override other fields you set in the `H265CodecSettings`
12038        /// message.
12039        pub profile: std::string::String,
12040
12041        /// Enforces the specified codec tune. The available options are
12042        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.265).
12043        /// Note that certain values for this field may cause the
12044        /// transcoder to override other fields you set in the `H265CodecSettings`
12045        /// message.
12046        pub tune: std::string::String,
12047
12048        /// Enforces the specified codec preset. The default is `veryfast`. The
12049        /// available options are
12050        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.265).
12051        /// Note that certain values for this field may cause the
12052        /// transcoder to override other fields you set in the `H265CodecSettings`
12053        /// message.
12054        pub preset: std::string::String,
12055
12056        /// GOP mode can be either by frame count or duration.
12057        pub gop_mode:
12058            std::option::Option<crate::model::video_stream::h_265_codec_settings::GopMode>,
12059
12060        /// Color format can be sdr, hlg, hdr10.
12061        pub color_format:
12062            std::option::Option<crate::model::video_stream::h_265_codec_settings::ColorFormat>,
12063
12064        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12065    }
12066
12067    impl H265CodecSettings {
12068        pub fn new() -> Self {
12069            std::default::Default::default()
12070        }
12071
12072        /// Sets the value of [width_pixels][crate::model::video_stream::H265CodecSettings::width_pixels].
12073        pub fn set_width_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12074            self.width_pixels = v.into();
12075            self
12076        }
12077
12078        /// Sets the value of [height_pixels][crate::model::video_stream::H265CodecSettings::height_pixels].
12079        pub fn set_height_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12080            self.height_pixels = v.into();
12081            self
12082        }
12083
12084        /// Sets the value of [frame_rate][crate::model::video_stream::H265CodecSettings::frame_rate].
12085        pub fn set_frame_rate<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
12086            self.frame_rate = v.into();
12087            self
12088        }
12089
12090        /// Sets the value of [frame_rate_conversion_strategy][crate::model::video_stream::H265CodecSettings::frame_rate_conversion_strategy].
12091        pub fn set_frame_rate_conversion_strategy<
12092            T: std::convert::Into<crate::model::video_stream::FrameRateConversionStrategy>,
12093        >(
12094            mut self,
12095            v: T,
12096        ) -> Self {
12097            self.frame_rate_conversion_strategy = v.into();
12098            self
12099        }
12100
12101        /// Sets the value of [bitrate_bps][crate::model::video_stream::H265CodecSettings::bitrate_bps].
12102        pub fn set_bitrate_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12103            self.bitrate_bps = v.into();
12104            self
12105        }
12106
12107        /// Sets the value of [pixel_format][crate::model::video_stream::H265CodecSettings::pixel_format].
12108        pub fn set_pixel_format<T: std::convert::Into<std::string::String>>(
12109            mut self,
12110            v: T,
12111        ) -> Self {
12112            self.pixel_format = v.into();
12113            self
12114        }
12115
12116        /// Sets the value of [rate_control_mode][crate::model::video_stream::H265CodecSettings::rate_control_mode].
12117        pub fn set_rate_control_mode<T: std::convert::Into<std::string::String>>(
12118            mut self,
12119            v: T,
12120        ) -> Self {
12121            self.rate_control_mode = v.into();
12122            self
12123        }
12124
12125        /// Sets the value of [crf_level][crate::model::video_stream::H265CodecSettings::crf_level].
12126        pub fn set_crf_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12127            self.crf_level = v.into();
12128            self
12129        }
12130
12131        /// Sets the value of [allow_open_gop][crate::model::video_stream::H265CodecSettings::allow_open_gop].
12132        pub fn set_allow_open_gop<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12133            self.allow_open_gop = v.into();
12134            self
12135        }
12136
12137        /// Sets the value of [enable_two_pass][crate::model::video_stream::H265CodecSettings::enable_two_pass].
12138        pub fn set_enable_two_pass<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12139            self.enable_two_pass = v.into();
12140            self
12141        }
12142
12143        /// Sets the value of [vbv_size_bits][crate::model::video_stream::H265CodecSettings::vbv_size_bits].
12144        pub fn set_vbv_size_bits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12145            self.vbv_size_bits = v.into();
12146            self
12147        }
12148
12149        /// Sets the value of [vbv_fullness_bits][crate::model::video_stream::H265CodecSettings::vbv_fullness_bits].
12150        pub fn set_vbv_fullness_bits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12151            self.vbv_fullness_bits = v.into();
12152            self
12153        }
12154
12155        /// Sets the value of [b_pyramid][crate::model::video_stream::H265CodecSettings::b_pyramid].
12156        pub fn set_b_pyramid<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12157            self.b_pyramid = v.into();
12158            self
12159        }
12160
12161        /// Sets the value of [b_frame_count][crate::model::video_stream::H265CodecSettings::b_frame_count].
12162        pub fn set_b_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12163            self.b_frame_count = v.into();
12164            self
12165        }
12166
12167        /// Sets the value of [aq_strength][crate::model::video_stream::H265CodecSettings::aq_strength].
12168        pub fn set_aq_strength<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
12169            self.aq_strength = v.into();
12170            self
12171        }
12172
12173        /// Sets the value of [profile][crate::model::video_stream::H265CodecSettings::profile].
12174        pub fn set_profile<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12175            self.profile = v.into();
12176            self
12177        }
12178
12179        /// Sets the value of [tune][crate::model::video_stream::H265CodecSettings::tune].
12180        pub fn set_tune<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12181            self.tune = v.into();
12182            self
12183        }
12184
12185        /// Sets the value of [preset][crate::model::video_stream::H265CodecSettings::preset].
12186        pub fn set_preset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12187            self.preset = v.into();
12188            self
12189        }
12190
12191        /// Sets the value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode].
12192        ///
12193        /// Note that all the setters affecting `gop_mode` are mutually
12194        /// exclusive.
12195        pub fn set_gop_mode<
12196            T: std::convert::Into<
12197                    std::option::Option<crate::model::video_stream::h_265_codec_settings::GopMode>,
12198                >,
12199        >(
12200            mut self,
12201            v: T,
12202        ) -> Self {
12203            self.gop_mode = v.into();
12204            self
12205        }
12206
12207        /// The value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode]
12208        /// if it holds a `GopFrameCount`, `None` if the field is not set or
12209        /// holds a different branch.
12210        pub fn gop_frame_count(&self) -> std::option::Option<&i32> {
12211            #[allow(unreachable_patterns)]
12212            self.gop_mode.as_ref().and_then(|v| match v {
12213                crate::model::video_stream::h_265_codec_settings::GopMode::GopFrameCount(v) => {
12214                    std::option::Option::Some(v)
12215                }
12216                _ => std::option::Option::None,
12217            })
12218        }
12219
12220        /// Sets the value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode]
12221        /// to hold a `GopFrameCount`.
12222        ///
12223        /// Note that all the setters affecting `gop_mode` are
12224        /// mutually exclusive.
12225        pub fn set_gop_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12226            self.gop_mode = std::option::Option::Some(
12227                crate::model::video_stream::h_265_codec_settings::GopMode::GopFrameCount(v.into()),
12228            );
12229            self
12230        }
12231
12232        /// The value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode]
12233        /// if it holds a `GopDuration`, `None` if the field is not set or
12234        /// holds a different branch.
12235        pub fn gop_duration(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
12236            #[allow(unreachable_patterns)]
12237            self.gop_mode.as_ref().and_then(|v| match v {
12238                crate::model::video_stream::h_265_codec_settings::GopMode::GopDuration(v) => {
12239                    std::option::Option::Some(v)
12240                }
12241                _ => std::option::Option::None,
12242            })
12243        }
12244
12245        /// Sets the value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode]
12246        /// to hold a `GopDuration`.
12247        ///
12248        /// Note that all the setters affecting `gop_mode` are
12249        /// mutually exclusive.
12250        pub fn set_gop_duration<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
12251            mut self,
12252            v: T,
12253        ) -> Self {
12254            self.gop_mode = std::option::Option::Some(
12255                crate::model::video_stream::h_265_codec_settings::GopMode::GopDuration(v.into()),
12256            );
12257            self
12258        }
12259
12260        /// Sets the value of [color_format][crate::model::video_stream::H265CodecSettings::color_format].
12261        ///
12262        /// Note that all the setters affecting `color_format` are mutually
12263        /// exclusive.
12264        pub fn set_color_format<
12265            T: std::convert::Into<
12266                    std::option::Option<
12267                        crate::model::video_stream::h_265_codec_settings::ColorFormat,
12268                    >,
12269                >,
12270        >(
12271            mut self,
12272            v: T,
12273        ) -> Self {
12274            self.color_format = v.into();
12275            self
12276        }
12277
12278        /// The value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
12279        /// if it holds a `Sdr`, `None` if the field is not set or
12280        /// holds a different branch.
12281        pub fn sdr(
12282            &self,
12283        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H265ColorFormatSDR>>
12284        {
12285            #[allow(unreachable_patterns)]
12286            self.color_format.as_ref().and_then(|v| match v {
12287                crate::model::video_stream::h_265_codec_settings::ColorFormat::Sdr(v) => {
12288                    std::option::Option::Some(v)
12289                }
12290                _ => std::option::Option::None,
12291            })
12292        }
12293
12294        /// Sets the value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
12295        /// to hold a `Sdr`.
12296        ///
12297        /// Note that all the setters affecting `color_format` are
12298        /// mutually exclusive.
12299        pub fn set_sdr<
12300            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H265ColorFormatSDR>>,
12301        >(
12302            mut self,
12303            v: T,
12304        ) -> Self {
12305            self.color_format = std::option::Option::Some(
12306                crate::model::video_stream::h_265_codec_settings::ColorFormat::Sdr(v.into()),
12307            );
12308            self
12309        }
12310
12311        /// The value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
12312        /// if it holds a `Hlg`, `None` if the field is not set or
12313        /// holds a different branch.
12314        pub fn hlg(
12315            &self,
12316        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H265ColorFormatHLG>>
12317        {
12318            #[allow(unreachable_patterns)]
12319            self.color_format.as_ref().and_then(|v| match v {
12320                crate::model::video_stream::h_265_codec_settings::ColorFormat::Hlg(v) => {
12321                    std::option::Option::Some(v)
12322                }
12323                _ => std::option::Option::None,
12324            })
12325        }
12326
12327        /// Sets the value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
12328        /// to hold a `Hlg`.
12329        ///
12330        /// Note that all the setters affecting `color_format` are
12331        /// mutually exclusive.
12332        pub fn set_hlg<
12333            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H265ColorFormatHLG>>,
12334        >(
12335            mut self,
12336            v: T,
12337        ) -> Self {
12338            self.color_format = std::option::Option::Some(
12339                crate::model::video_stream::h_265_codec_settings::ColorFormat::Hlg(v.into()),
12340            );
12341            self
12342        }
12343
12344        /// The value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
12345        /// if it holds a `Hdr10`, `None` if the field is not set or
12346        /// holds a different branch.
12347        pub fn hdr10(
12348            &self,
12349        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H265ColorFormatHDR10>>
12350        {
12351            #[allow(unreachable_patterns)]
12352            self.color_format.as_ref().and_then(|v| match v {
12353                crate::model::video_stream::h_265_codec_settings::ColorFormat::Hdr10(v) => {
12354                    std::option::Option::Some(v)
12355                }
12356                _ => std::option::Option::None,
12357            })
12358        }
12359
12360        /// Sets the value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
12361        /// to hold a `Hdr10`.
12362        ///
12363        /// Note that all the setters affecting `color_format` are
12364        /// mutually exclusive.
12365        pub fn set_hdr10<
12366            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H265ColorFormatHDR10>>,
12367        >(
12368            mut self,
12369            v: T,
12370        ) -> Self {
12371            self.color_format = std::option::Option::Some(
12372                crate::model::video_stream::h_265_codec_settings::ColorFormat::Hdr10(v.into()),
12373            );
12374            self
12375        }
12376    }
12377
12378    impl wkt::message::Message for H265CodecSettings {
12379        fn typename() -> &'static str {
12380            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings"
12381        }
12382    }
12383
12384    #[doc(hidden)]
12385    impl<'de> serde::de::Deserialize<'de> for H265CodecSettings {
12386        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12387        where
12388            D: serde::Deserializer<'de>,
12389        {
12390            #[allow(non_camel_case_types)]
12391            #[doc(hidden)]
12392            #[derive(PartialEq, Eq, Hash)]
12393            enum __FieldTag {
12394                __width_pixels,
12395                __height_pixels,
12396                __frame_rate,
12397                __frame_rate_conversion_strategy,
12398                __bitrate_bps,
12399                __pixel_format,
12400                __rate_control_mode,
12401                __crf_level,
12402                __allow_open_gop,
12403                __gop_frame_count,
12404                __gop_duration,
12405                __enable_two_pass,
12406                __vbv_size_bits,
12407                __vbv_fullness_bits,
12408                __b_pyramid,
12409                __b_frame_count,
12410                __aq_strength,
12411                __profile,
12412                __tune,
12413                __preset,
12414                __sdr,
12415                __hlg,
12416                __hdr10,
12417                Unknown(std::string::String),
12418            }
12419            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
12420                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12421                where
12422                    D: serde::Deserializer<'de>,
12423                {
12424                    struct Visitor;
12425                    impl<'de> serde::de::Visitor<'de> for Visitor {
12426                        type Value = __FieldTag;
12427                        fn expecting(
12428                            &self,
12429                            formatter: &mut std::fmt::Formatter,
12430                        ) -> std::fmt::Result {
12431                            formatter.write_str("a field name for H265CodecSettings")
12432                        }
12433                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
12434                        where
12435                            E: serde::de::Error,
12436                        {
12437                            use std::result::Result::Ok;
12438                            use std::string::ToString;
12439                            match value {
12440                                "widthPixels" => Ok(__FieldTag::__width_pixels),
12441                                "width_pixels" => Ok(__FieldTag::__width_pixels),
12442                                "heightPixels" => Ok(__FieldTag::__height_pixels),
12443                                "height_pixels" => Ok(__FieldTag::__height_pixels),
12444                                "frameRate" => Ok(__FieldTag::__frame_rate),
12445                                "frame_rate" => Ok(__FieldTag::__frame_rate),
12446                                "frameRateConversionStrategy" => {
12447                                    Ok(__FieldTag::__frame_rate_conversion_strategy)
12448                                }
12449                                "frame_rate_conversion_strategy" => {
12450                                    Ok(__FieldTag::__frame_rate_conversion_strategy)
12451                                }
12452                                "bitrateBps" => Ok(__FieldTag::__bitrate_bps),
12453                                "bitrate_bps" => Ok(__FieldTag::__bitrate_bps),
12454                                "pixelFormat" => Ok(__FieldTag::__pixel_format),
12455                                "pixel_format" => Ok(__FieldTag::__pixel_format),
12456                                "rateControlMode" => Ok(__FieldTag::__rate_control_mode),
12457                                "rate_control_mode" => Ok(__FieldTag::__rate_control_mode),
12458                                "crfLevel" => Ok(__FieldTag::__crf_level),
12459                                "crf_level" => Ok(__FieldTag::__crf_level),
12460                                "allowOpenGop" => Ok(__FieldTag::__allow_open_gop),
12461                                "allow_open_gop" => Ok(__FieldTag::__allow_open_gop),
12462                                "gopFrameCount" => Ok(__FieldTag::__gop_frame_count),
12463                                "gop_frame_count" => Ok(__FieldTag::__gop_frame_count),
12464                                "gopDuration" => Ok(__FieldTag::__gop_duration),
12465                                "gop_duration" => Ok(__FieldTag::__gop_duration),
12466                                "enableTwoPass" => Ok(__FieldTag::__enable_two_pass),
12467                                "enable_two_pass" => Ok(__FieldTag::__enable_two_pass),
12468                                "vbvSizeBits" => Ok(__FieldTag::__vbv_size_bits),
12469                                "vbv_size_bits" => Ok(__FieldTag::__vbv_size_bits),
12470                                "vbvFullnessBits" => Ok(__FieldTag::__vbv_fullness_bits),
12471                                "vbv_fullness_bits" => Ok(__FieldTag::__vbv_fullness_bits),
12472                                "bPyramid" => Ok(__FieldTag::__b_pyramid),
12473                                "b_pyramid" => Ok(__FieldTag::__b_pyramid),
12474                                "bFrameCount" => Ok(__FieldTag::__b_frame_count),
12475                                "b_frame_count" => Ok(__FieldTag::__b_frame_count),
12476                                "aqStrength" => Ok(__FieldTag::__aq_strength),
12477                                "aq_strength" => Ok(__FieldTag::__aq_strength),
12478                                "profile" => Ok(__FieldTag::__profile),
12479                                "tune" => Ok(__FieldTag::__tune),
12480                                "preset" => Ok(__FieldTag::__preset),
12481                                "sdr" => Ok(__FieldTag::__sdr),
12482                                "hlg" => Ok(__FieldTag::__hlg),
12483                                "hdr10" => Ok(__FieldTag::__hdr10),
12484                                _ => Ok(__FieldTag::Unknown(value.to_string())),
12485                            }
12486                        }
12487                    }
12488                    deserializer.deserialize_identifier(Visitor)
12489                }
12490            }
12491            struct Visitor;
12492            impl<'de> serde::de::Visitor<'de> for Visitor {
12493                type Value = H265CodecSettings;
12494                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12495                    formatter.write_str("struct H265CodecSettings")
12496                }
12497                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
12498                where
12499                    A: serde::de::MapAccess<'de>,
12500                {
12501                    #[allow(unused_imports)]
12502                    use serde::de::Error;
12503                    use std::option::Option::Some;
12504                    let mut fields = std::collections::HashSet::new();
12505                    let mut result = Self::Value::new();
12506                    while let Some(tag) = map.next_key::<__FieldTag>()? {
12507                        #[allow(clippy::match_single_binding)]
12508                        match tag {
12509                            __FieldTag::__width_pixels => {
12510                                if !fields.insert(__FieldTag::__width_pixels) {
12511                                    return std::result::Result::Err(A::Error::duplicate_field(
12512                                        "multiple values for width_pixels",
12513                                    ));
12514                                }
12515                                struct __With(std::option::Option<i32>);
12516                                impl<'de> serde::de::Deserialize<'de> for __With {
12517                                    fn deserialize<D>(
12518                                        deserializer: D,
12519                                    ) -> std::result::Result<Self, D::Error>
12520                                    where
12521                                        D: serde::de::Deserializer<'de>,
12522                                    {
12523                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
12524                                    }
12525                                }
12526                                result.width_pixels =
12527                                    map.next_value::<__With>()?.0.unwrap_or_default();
12528                            }
12529                            __FieldTag::__height_pixels => {
12530                                if !fields.insert(__FieldTag::__height_pixels) {
12531                                    return std::result::Result::Err(A::Error::duplicate_field(
12532                                        "multiple values for height_pixels",
12533                                    ));
12534                                }
12535                                struct __With(std::option::Option<i32>);
12536                                impl<'de> serde::de::Deserialize<'de> for __With {
12537                                    fn deserialize<D>(
12538                                        deserializer: D,
12539                                    ) -> std::result::Result<Self, D::Error>
12540                                    where
12541                                        D: serde::de::Deserializer<'de>,
12542                                    {
12543                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
12544                                    }
12545                                }
12546                                result.height_pixels =
12547                                    map.next_value::<__With>()?.0.unwrap_or_default();
12548                            }
12549                            __FieldTag::__frame_rate => {
12550                                if !fields.insert(__FieldTag::__frame_rate) {
12551                                    return std::result::Result::Err(A::Error::duplicate_field(
12552                                        "multiple values for frame_rate",
12553                                    ));
12554                                }
12555                                struct __With(std::option::Option<f64>);
12556                                impl<'de> serde::de::Deserialize<'de> for __With {
12557                                    fn deserialize<D>(
12558                                        deserializer: D,
12559                                    ) -> std::result::Result<Self, D::Error>
12560                                    where
12561                                        D: serde::de::Deserializer<'de>,
12562                                    {
12563                                        serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
12564                                    }
12565                                }
12566                                result.frame_rate =
12567                                    map.next_value::<__With>()?.0.unwrap_or_default();
12568                            }
12569                            __FieldTag::__frame_rate_conversion_strategy => {
12570                                if !fields.insert(__FieldTag::__frame_rate_conversion_strategy) {
12571                                    return std::result::Result::Err(A::Error::duplicate_field(
12572                                        "multiple values for frame_rate_conversion_strategy",
12573                                    ));
12574                                }
12575                                result.frame_rate_conversion_strategy = map
12576                                    .next_value::<std::option::Option<
12577                                        crate::model::video_stream::FrameRateConversionStrategy,
12578                                    >>()?
12579                                    .unwrap_or_default();
12580                            }
12581                            __FieldTag::__bitrate_bps => {
12582                                if !fields.insert(__FieldTag::__bitrate_bps) {
12583                                    return std::result::Result::Err(A::Error::duplicate_field(
12584                                        "multiple values for bitrate_bps",
12585                                    ));
12586                                }
12587                                struct __With(std::option::Option<i32>);
12588                                impl<'de> serde::de::Deserialize<'de> for __With {
12589                                    fn deserialize<D>(
12590                                        deserializer: D,
12591                                    ) -> std::result::Result<Self, D::Error>
12592                                    where
12593                                        D: serde::de::Deserializer<'de>,
12594                                    {
12595                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
12596                                    }
12597                                }
12598                                result.bitrate_bps =
12599                                    map.next_value::<__With>()?.0.unwrap_or_default();
12600                            }
12601                            __FieldTag::__pixel_format => {
12602                                if !fields.insert(__FieldTag::__pixel_format) {
12603                                    return std::result::Result::Err(A::Error::duplicate_field(
12604                                        "multiple values for pixel_format",
12605                                    ));
12606                                }
12607                                result.pixel_format = map
12608                                    .next_value::<std::option::Option<std::string::String>>()?
12609                                    .unwrap_or_default();
12610                            }
12611                            __FieldTag::__rate_control_mode => {
12612                                if !fields.insert(__FieldTag::__rate_control_mode) {
12613                                    return std::result::Result::Err(A::Error::duplicate_field(
12614                                        "multiple values for rate_control_mode",
12615                                    ));
12616                                }
12617                                result.rate_control_mode = map
12618                                    .next_value::<std::option::Option<std::string::String>>()?
12619                                    .unwrap_or_default();
12620                            }
12621                            __FieldTag::__crf_level => {
12622                                if !fields.insert(__FieldTag::__crf_level) {
12623                                    return std::result::Result::Err(A::Error::duplicate_field(
12624                                        "multiple values for crf_level",
12625                                    ));
12626                                }
12627                                struct __With(std::option::Option<i32>);
12628                                impl<'de> serde::de::Deserialize<'de> for __With {
12629                                    fn deserialize<D>(
12630                                        deserializer: D,
12631                                    ) -> std::result::Result<Self, D::Error>
12632                                    where
12633                                        D: serde::de::Deserializer<'de>,
12634                                    {
12635                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
12636                                    }
12637                                }
12638                                result.crf_level =
12639                                    map.next_value::<__With>()?.0.unwrap_or_default();
12640                            }
12641                            __FieldTag::__allow_open_gop => {
12642                                if !fields.insert(__FieldTag::__allow_open_gop) {
12643                                    return std::result::Result::Err(A::Error::duplicate_field(
12644                                        "multiple values for allow_open_gop",
12645                                    ));
12646                                }
12647                                result.allow_open_gop = map
12648                                    .next_value::<std::option::Option<bool>>()?
12649                                    .unwrap_or_default();
12650                            }
12651                            __FieldTag::__gop_frame_count => {
12652                                if !fields.insert(__FieldTag::__gop_frame_count) {
12653                                    return std::result::Result::Err(A::Error::duplicate_field(
12654                                        "multiple values for gop_frame_count",
12655                                    ));
12656                                }
12657                                struct __With(std::option::Option<i32>);
12658                                impl<'de> serde::de::Deserialize<'de> for __With {
12659                                    fn deserialize<D>(
12660                                        deserializer: D,
12661                                    ) -> std::result::Result<Self, D::Error>
12662                                    where
12663                                        D: serde::de::Deserializer<'de>,
12664                                    {
12665                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
12666                                    }
12667                                }
12668                                if result.gop_mode.is_some() {
12669                                    return std::result::Result::Err(A::Error::duplicate_field(
12670                                        "multiple values for `gop_mode`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.gop_frame_count, latest field was gopFrameCount",
12671                                    ));
12672                                }
12673                                result.gop_mode = std::option::Option::Some(
12674                                    crate::model::video_stream::h_265_codec_settings::GopMode::GopFrameCount(
12675                                        map.next_value::<__With>()?.0.unwrap_or_default()
12676                                    ),
12677                                );
12678                            }
12679                            __FieldTag::__gop_duration => {
12680                                if !fields.insert(__FieldTag::__gop_duration) {
12681                                    return std::result::Result::Err(A::Error::duplicate_field(
12682                                        "multiple values for gop_duration",
12683                                    ));
12684                                }
12685                                if result.gop_mode.is_some() {
12686                                    return std::result::Result::Err(A::Error::duplicate_field(
12687                                        "multiple values for `gop_mode`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.gop_duration, latest field was gopDuration",
12688                                    ));
12689                                }
12690                                result.gop_mode = std::option::Option::Some(
12691                                    crate::model::video_stream::h_265_codec_settings::GopMode::GopDuration(
12692                                        map.next_value::<std::option::Option<std::boxed::Box<wkt::Duration>>>()?.unwrap_or_default()
12693                                    ),
12694                                );
12695                            }
12696                            __FieldTag::__enable_two_pass => {
12697                                if !fields.insert(__FieldTag::__enable_two_pass) {
12698                                    return std::result::Result::Err(A::Error::duplicate_field(
12699                                        "multiple values for enable_two_pass",
12700                                    ));
12701                                }
12702                                result.enable_two_pass = map
12703                                    .next_value::<std::option::Option<bool>>()?
12704                                    .unwrap_or_default();
12705                            }
12706                            __FieldTag::__vbv_size_bits => {
12707                                if !fields.insert(__FieldTag::__vbv_size_bits) {
12708                                    return std::result::Result::Err(A::Error::duplicate_field(
12709                                        "multiple values for vbv_size_bits",
12710                                    ));
12711                                }
12712                                struct __With(std::option::Option<i32>);
12713                                impl<'de> serde::de::Deserialize<'de> for __With {
12714                                    fn deserialize<D>(
12715                                        deserializer: D,
12716                                    ) -> std::result::Result<Self, D::Error>
12717                                    where
12718                                        D: serde::de::Deserializer<'de>,
12719                                    {
12720                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
12721                                    }
12722                                }
12723                                result.vbv_size_bits =
12724                                    map.next_value::<__With>()?.0.unwrap_or_default();
12725                            }
12726                            __FieldTag::__vbv_fullness_bits => {
12727                                if !fields.insert(__FieldTag::__vbv_fullness_bits) {
12728                                    return std::result::Result::Err(A::Error::duplicate_field(
12729                                        "multiple values for vbv_fullness_bits",
12730                                    ));
12731                                }
12732                                struct __With(std::option::Option<i32>);
12733                                impl<'de> serde::de::Deserialize<'de> for __With {
12734                                    fn deserialize<D>(
12735                                        deserializer: D,
12736                                    ) -> std::result::Result<Self, D::Error>
12737                                    where
12738                                        D: serde::de::Deserializer<'de>,
12739                                    {
12740                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
12741                                    }
12742                                }
12743                                result.vbv_fullness_bits =
12744                                    map.next_value::<__With>()?.0.unwrap_or_default();
12745                            }
12746                            __FieldTag::__b_pyramid => {
12747                                if !fields.insert(__FieldTag::__b_pyramid) {
12748                                    return std::result::Result::Err(A::Error::duplicate_field(
12749                                        "multiple values for b_pyramid",
12750                                    ));
12751                                }
12752                                result.b_pyramid = map
12753                                    .next_value::<std::option::Option<bool>>()?
12754                                    .unwrap_or_default();
12755                            }
12756                            __FieldTag::__b_frame_count => {
12757                                if !fields.insert(__FieldTag::__b_frame_count) {
12758                                    return std::result::Result::Err(A::Error::duplicate_field(
12759                                        "multiple values for b_frame_count",
12760                                    ));
12761                                }
12762                                struct __With(std::option::Option<i32>);
12763                                impl<'de> serde::de::Deserialize<'de> for __With {
12764                                    fn deserialize<D>(
12765                                        deserializer: D,
12766                                    ) -> std::result::Result<Self, D::Error>
12767                                    where
12768                                        D: serde::de::Deserializer<'de>,
12769                                    {
12770                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
12771                                    }
12772                                }
12773                                result.b_frame_count =
12774                                    map.next_value::<__With>()?.0.unwrap_or_default();
12775                            }
12776                            __FieldTag::__aq_strength => {
12777                                if !fields.insert(__FieldTag::__aq_strength) {
12778                                    return std::result::Result::Err(A::Error::duplicate_field(
12779                                        "multiple values for aq_strength",
12780                                    ));
12781                                }
12782                                struct __With(std::option::Option<f64>);
12783                                impl<'de> serde::de::Deserialize<'de> for __With {
12784                                    fn deserialize<D>(
12785                                        deserializer: D,
12786                                    ) -> std::result::Result<Self, D::Error>
12787                                    where
12788                                        D: serde::de::Deserializer<'de>,
12789                                    {
12790                                        serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
12791                                    }
12792                                }
12793                                result.aq_strength =
12794                                    map.next_value::<__With>()?.0.unwrap_or_default();
12795                            }
12796                            __FieldTag::__profile => {
12797                                if !fields.insert(__FieldTag::__profile) {
12798                                    return std::result::Result::Err(A::Error::duplicate_field(
12799                                        "multiple values for profile",
12800                                    ));
12801                                }
12802                                result.profile = map
12803                                    .next_value::<std::option::Option<std::string::String>>()?
12804                                    .unwrap_or_default();
12805                            }
12806                            __FieldTag::__tune => {
12807                                if !fields.insert(__FieldTag::__tune) {
12808                                    return std::result::Result::Err(A::Error::duplicate_field(
12809                                        "multiple values for tune",
12810                                    ));
12811                                }
12812                                result.tune = map
12813                                    .next_value::<std::option::Option<std::string::String>>()?
12814                                    .unwrap_or_default();
12815                            }
12816                            __FieldTag::__preset => {
12817                                if !fields.insert(__FieldTag::__preset) {
12818                                    return std::result::Result::Err(A::Error::duplicate_field(
12819                                        "multiple values for preset",
12820                                    ));
12821                                }
12822                                result.preset = map
12823                                    .next_value::<std::option::Option<std::string::String>>()?
12824                                    .unwrap_or_default();
12825                            }
12826                            __FieldTag::__sdr => {
12827                                if !fields.insert(__FieldTag::__sdr) {
12828                                    return std::result::Result::Err(A::Error::duplicate_field(
12829                                        "multiple values for sdr",
12830                                    ));
12831                                }
12832                                if result.color_format.is_some() {
12833                                    return std::result::Result::Err(A::Error::duplicate_field(
12834                                        "multiple values for `color_format`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.sdr, latest field was sdr",
12835                                    ));
12836                                }
12837                                result.color_format = std::option::Option::Some(
12838                                    crate::model::video_stream::h_265_codec_settings::ColorFormat::Sdr(
12839                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::video_stream::H265ColorFormatSDR>>>()?.unwrap_or_default()
12840                                    ),
12841                                );
12842                            }
12843                            __FieldTag::__hlg => {
12844                                if !fields.insert(__FieldTag::__hlg) {
12845                                    return std::result::Result::Err(A::Error::duplicate_field(
12846                                        "multiple values for hlg",
12847                                    ));
12848                                }
12849                                if result.color_format.is_some() {
12850                                    return std::result::Result::Err(A::Error::duplicate_field(
12851                                        "multiple values for `color_format`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.hlg, latest field was hlg",
12852                                    ));
12853                                }
12854                                result.color_format = std::option::Option::Some(
12855                                    crate::model::video_stream::h_265_codec_settings::ColorFormat::Hlg(
12856                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::video_stream::H265ColorFormatHLG>>>()?.unwrap_or_default()
12857                                    ),
12858                                );
12859                            }
12860                            __FieldTag::__hdr10 => {
12861                                if !fields.insert(__FieldTag::__hdr10) {
12862                                    return std::result::Result::Err(A::Error::duplicate_field(
12863                                        "multiple values for hdr10",
12864                                    ));
12865                                }
12866                                if result.color_format.is_some() {
12867                                    return std::result::Result::Err(A::Error::duplicate_field(
12868                                        "multiple values for `color_format`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.hdr10, latest field was hdr10",
12869                                    ));
12870                                }
12871                                result.color_format = std::option::Option::Some(
12872                                    crate::model::video_stream::h_265_codec_settings::ColorFormat::Hdr10(
12873                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::video_stream::H265ColorFormatHDR10>>>()?.unwrap_or_default()
12874                                    ),
12875                                );
12876                            }
12877                            __FieldTag::Unknown(key) => {
12878                                let value = map.next_value::<serde_json::Value>()?;
12879                                result._unknown_fields.insert(key, value);
12880                            }
12881                        }
12882                    }
12883                    std::result::Result::Ok(result)
12884                }
12885            }
12886            deserializer.deserialize_any(Visitor)
12887        }
12888    }
12889
12890    #[doc(hidden)]
12891    impl serde::ser::Serialize for H265CodecSettings {
12892        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12893        where
12894            S: serde::ser::Serializer,
12895        {
12896            use serde::ser::SerializeMap;
12897            #[allow(unused_imports)]
12898            use std::option::Option::Some;
12899            let mut state = serializer.serialize_map(std::option::Option::None)?;
12900            if !wkt::internal::is_default(&self.width_pixels) {
12901                struct __With<'a>(&'a i32);
12902                impl<'a> serde::ser::Serialize for __With<'a> {
12903                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12904                    where
12905                        S: serde::ser::Serializer,
12906                    {
12907                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
12908                    }
12909                }
12910                state.serialize_entry("widthPixels", &__With(&self.width_pixels))?;
12911            }
12912            if !wkt::internal::is_default(&self.height_pixels) {
12913                struct __With<'a>(&'a i32);
12914                impl<'a> serde::ser::Serialize for __With<'a> {
12915                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12916                    where
12917                        S: serde::ser::Serializer,
12918                    {
12919                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
12920                    }
12921                }
12922                state.serialize_entry("heightPixels", &__With(&self.height_pixels))?;
12923            }
12924            if !wkt::internal::is_default(&self.frame_rate) {
12925                struct __With<'a>(&'a f64);
12926                impl<'a> serde::ser::Serialize for __With<'a> {
12927                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12928                    where
12929                        S: serde::ser::Serializer,
12930                    {
12931                        serde_with::As::<wkt::internal::F64>::serialize(self.0, serializer)
12932                    }
12933                }
12934                state.serialize_entry("frameRate", &__With(&self.frame_rate))?;
12935            }
12936            if !wkt::internal::is_default(&self.frame_rate_conversion_strategy) {
12937                state.serialize_entry(
12938                    "frameRateConversionStrategy",
12939                    &self.frame_rate_conversion_strategy,
12940                )?;
12941            }
12942            if !wkt::internal::is_default(&self.bitrate_bps) {
12943                struct __With<'a>(&'a i32);
12944                impl<'a> serde::ser::Serialize for __With<'a> {
12945                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12946                    where
12947                        S: serde::ser::Serializer,
12948                    {
12949                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
12950                    }
12951                }
12952                state.serialize_entry("bitrateBps", &__With(&self.bitrate_bps))?;
12953            }
12954            if !self.pixel_format.is_empty() {
12955                state.serialize_entry("pixelFormat", &self.pixel_format)?;
12956            }
12957            if !self.rate_control_mode.is_empty() {
12958                state.serialize_entry("rateControlMode", &self.rate_control_mode)?;
12959            }
12960            if !wkt::internal::is_default(&self.crf_level) {
12961                struct __With<'a>(&'a i32);
12962                impl<'a> serde::ser::Serialize for __With<'a> {
12963                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12964                    where
12965                        S: serde::ser::Serializer,
12966                    {
12967                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
12968                    }
12969                }
12970                state.serialize_entry("crfLevel", &__With(&self.crf_level))?;
12971            }
12972            if !wkt::internal::is_default(&self.allow_open_gop) {
12973                state.serialize_entry("allowOpenGop", &self.allow_open_gop)?;
12974            }
12975            if let Some(value) = self.gop_frame_count() {
12976                struct __With<'a>(&'a i32);
12977                impl<'a> serde::ser::Serialize for __With<'a> {
12978                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12979                    where
12980                        S: serde::ser::Serializer,
12981                    {
12982                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
12983                    }
12984                }
12985                state.serialize_entry("gopFrameCount", &__With(value))?;
12986            }
12987            if let Some(value) = self.gop_duration() {
12988                state.serialize_entry("gopDuration", value)?;
12989            }
12990            if !wkt::internal::is_default(&self.enable_two_pass) {
12991                state.serialize_entry("enableTwoPass", &self.enable_two_pass)?;
12992            }
12993            if !wkt::internal::is_default(&self.vbv_size_bits) {
12994                struct __With<'a>(&'a i32);
12995                impl<'a> serde::ser::Serialize for __With<'a> {
12996                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12997                    where
12998                        S: serde::ser::Serializer,
12999                    {
13000                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
13001                    }
13002                }
13003                state.serialize_entry("vbvSizeBits", &__With(&self.vbv_size_bits))?;
13004            }
13005            if !wkt::internal::is_default(&self.vbv_fullness_bits) {
13006                struct __With<'a>(&'a i32);
13007                impl<'a> serde::ser::Serialize for __With<'a> {
13008                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13009                    where
13010                        S: serde::ser::Serializer,
13011                    {
13012                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
13013                    }
13014                }
13015                state.serialize_entry("vbvFullnessBits", &__With(&self.vbv_fullness_bits))?;
13016            }
13017            if !wkt::internal::is_default(&self.b_pyramid) {
13018                state.serialize_entry("bPyramid", &self.b_pyramid)?;
13019            }
13020            if !wkt::internal::is_default(&self.b_frame_count) {
13021                struct __With<'a>(&'a i32);
13022                impl<'a> serde::ser::Serialize for __With<'a> {
13023                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13024                    where
13025                        S: serde::ser::Serializer,
13026                    {
13027                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
13028                    }
13029                }
13030                state.serialize_entry("bFrameCount", &__With(&self.b_frame_count))?;
13031            }
13032            if !wkt::internal::is_default(&self.aq_strength) {
13033                struct __With<'a>(&'a f64);
13034                impl<'a> serde::ser::Serialize for __With<'a> {
13035                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13036                    where
13037                        S: serde::ser::Serializer,
13038                    {
13039                        serde_with::As::<wkt::internal::F64>::serialize(self.0, serializer)
13040                    }
13041                }
13042                state.serialize_entry("aqStrength", &__With(&self.aq_strength))?;
13043            }
13044            if !self.profile.is_empty() {
13045                state.serialize_entry("profile", &self.profile)?;
13046            }
13047            if !self.tune.is_empty() {
13048                state.serialize_entry("tune", &self.tune)?;
13049            }
13050            if !self.preset.is_empty() {
13051                state.serialize_entry("preset", &self.preset)?;
13052            }
13053            if let Some(value) = self.sdr() {
13054                state.serialize_entry("sdr", value)?;
13055            }
13056            if let Some(value) = self.hlg() {
13057                state.serialize_entry("hlg", value)?;
13058            }
13059            if let Some(value) = self.hdr10() {
13060                state.serialize_entry("hdr10", value)?;
13061            }
13062            if !self._unknown_fields.is_empty() {
13063                for (key, value) in self._unknown_fields.iter() {
13064                    state.serialize_entry(key, &value)?;
13065                }
13066            }
13067            state.end()
13068        }
13069    }
13070
13071    impl std::fmt::Debug for H265CodecSettings {
13072        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13073            let mut debug_struct = f.debug_struct("H265CodecSettings");
13074            debug_struct.field("width_pixels", &self.width_pixels);
13075            debug_struct.field("height_pixels", &self.height_pixels);
13076            debug_struct.field("frame_rate", &self.frame_rate);
13077            debug_struct.field(
13078                "frame_rate_conversion_strategy",
13079                &self.frame_rate_conversion_strategy,
13080            );
13081            debug_struct.field("bitrate_bps", &self.bitrate_bps);
13082            debug_struct.field("pixel_format", &self.pixel_format);
13083            debug_struct.field("rate_control_mode", &self.rate_control_mode);
13084            debug_struct.field("crf_level", &self.crf_level);
13085            debug_struct.field("allow_open_gop", &self.allow_open_gop);
13086            debug_struct.field("enable_two_pass", &self.enable_two_pass);
13087            debug_struct.field("vbv_size_bits", &self.vbv_size_bits);
13088            debug_struct.field("vbv_fullness_bits", &self.vbv_fullness_bits);
13089            debug_struct.field("b_pyramid", &self.b_pyramid);
13090            debug_struct.field("b_frame_count", &self.b_frame_count);
13091            debug_struct.field("aq_strength", &self.aq_strength);
13092            debug_struct.field("profile", &self.profile);
13093            debug_struct.field("tune", &self.tune);
13094            debug_struct.field("preset", &self.preset);
13095            debug_struct.field("gop_mode", &self.gop_mode);
13096            debug_struct.field("color_format", &self.color_format);
13097            if !self._unknown_fields.is_empty() {
13098                debug_struct.field("_unknown_fields", &self._unknown_fields);
13099            }
13100            debug_struct.finish()
13101        }
13102    }
13103
13104    /// Defines additional types related to [H265CodecSettings].
13105    pub mod h_265_codec_settings {
13106        #[allow(unused_imports)]
13107        use super::*;
13108
13109        /// GOP mode can be either by frame count or duration.
13110        #[derive(Clone, Debug, PartialEq)]
13111        #[non_exhaustive]
13112        pub enum GopMode {
13113            /// Select the GOP size based on the specified frame count. Must be greater
13114            /// than zero.
13115            GopFrameCount(i32),
13116            /// Select the GOP size based on the specified duration. The default is
13117            /// `3s`. Note that `gopDuration` must be less than or equal to
13118            /// [`segmentDuration`](#SegmentSettings), and
13119            /// [`segmentDuration`](#SegmentSettings) must be divisible by
13120            /// `gopDuration`.
13121            GopDuration(std::boxed::Box<wkt::Duration>),
13122        }
13123
13124        /// Color format can be sdr, hlg, hdr10.
13125        #[derive(Clone, Debug, PartialEq)]
13126        #[non_exhaustive]
13127        pub enum ColorFormat {
13128            /// Optional. SDR color format setting for H265.
13129            Sdr(std::boxed::Box<crate::model::video_stream::H265ColorFormatSDR>),
13130            /// Optional. HLG color format setting for H265.
13131            Hlg(std::boxed::Box<crate::model::video_stream::H265ColorFormatHLG>),
13132            /// Optional. HDR10 color format setting for H265.
13133            Hdr10(std::boxed::Box<crate::model::video_stream::H265ColorFormatHDR10>),
13134        }
13135    }
13136
13137    /// Convert the input video to a Standard Dynamic Range (SDR) video.
13138    #[derive(Clone, Default, PartialEq)]
13139    #[non_exhaustive]
13140    pub struct Vp9ColorFormatSDR {
13141        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13142    }
13143
13144    impl Vp9ColorFormatSDR {
13145        pub fn new() -> Self {
13146            std::default::Default::default()
13147        }
13148    }
13149
13150    impl wkt::message::Message for Vp9ColorFormatSDR {
13151        fn typename() -> &'static str {
13152            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.Vp9ColorFormatSDR"
13153        }
13154    }
13155
13156    #[doc(hidden)]
13157    impl<'de> serde::de::Deserialize<'de> for Vp9ColorFormatSDR {
13158        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13159        where
13160            D: serde::Deserializer<'de>,
13161        {
13162            #[allow(non_camel_case_types)]
13163            #[doc(hidden)]
13164            #[derive(PartialEq, Eq, Hash)]
13165            enum __FieldTag {
13166                Unknown(std::string::String),
13167            }
13168            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
13169                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13170                where
13171                    D: serde::Deserializer<'de>,
13172                {
13173                    struct Visitor;
13174                    impl<'de> serde::de::Visitor<'de> for Visitor {
13175                        type Value = __FieldTag;
13176                        fn expecting(
13177                            &self,
13178                            formatter: &mut std::fmt::Formatter,
13179                        ) -> std::fmt::Result {
13180                            formatter.write_str("a field name for Vp9ColorFormatSDR")
13181                        }
13182                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
13183                        where
13184                            E: serde::de::Error,
13185                        {
13186                            use std::result::Result::Ok;
13187                            use std::string::ToString;
13188                            Ok(__FieldTag::Unknown(value.to_string()))
13189                        }
13190                    }
13191                    deserializer.deserialize_identifier(Visitor)
13192                }
13193            }
13194            struct Visitor;
13195            impl<'de> serde::de::Visitor<'de> for Visitor {
13196                type Value = Vp9ColorFormatSDR;
13197                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13198                    formatter.write_str("struct Vp9ColorFormatSDR")
13199                }
13200                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
13201                where
13202                    A: serde::de::MapAccess<'de>,
13203                {
13204                    #[allow(unused_imports)]
13205                    use serde::de::Error;
13206                    use std::option::Option::Some;
13207                    let mut result = Self::Value::new();
13208                    while let Some(tag) = map.next_key::<__FieldTag>()? {
13209                        #[allow(clippy::match_single_binding)]
13210                        match tag {
13211                            __FieldTag::Unknown(key) => {
13212                                let value = map.next_value::<serde_json::Value>()?;
13213                                result._unknown_fields.insert(key, value);
13214                            }
13215                        }
13216                    }
13217                    std::result::Result::Ok(result)
13218                }
13219            }
13220            deserializer.deserialize_any(Visitor)
13221        }
13222    }
13223
13224    #[doc(hidden)]
13225    impl serde::ser::Serialize for Vp9ColorFormatSDR {
13226        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13227        where
13228            S: serde::ser::Serializer,
13229        {
13230            use serde::ser::SerializeMap;
13231            #[allow(unused_imports)]
13232            use std::option::Option::Some;
13233            let mut state = serializer.serialize_map(std::option::Option::None)?;
13234            if !self._unknown_fields.is_empty() {
13235                for (key, value) in self._unknown_fields.iter() {
13236                    state.serialize_entry(key, &value)?;
13237                }
13238            }
13239            state.end()
13240        }
13241    }
13242
13243    impl std::fmt::Debug for Vp9ColorFormatSDR {
13244        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13245            let mut debug_struct = f.debug_struct("Vp9ColorFormatSDR");
13246            if !self._unknown_fields.is_empty() {
13247                debug_struct.field("_unknown_fields", &self._unknown_fields);
13248            }
13249            debug_struct.finish()
13250        }
13251    }
13252
13253    /// Convert the input video to a Hybrid Log Gamma (HLG) video.
13254    #[derive(Clone, Default, PartialEq)]
13255    #[non_exhaustive]
13256    pub struct Vp9ColorFormatHLG {
13257        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13258    }
13259
13260    impl Vp9ColorFormatHLG {
13261        pub fn new() -> Self {
13262            std::default::Default::default()
13263        }
13264    }
13265
13266    impl wkt::message::Message for Vp9ColorFormatHLG {
13267        fn typename() -> &'static str {
13268            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.Vp9ColorFormatHLG"
13269        }
13270    }
13271
13272    #[doc(hidden)]
13273    impl<'de> serde::de::Deserialize<'de> for Vp9ColorFormatHLG {
13274        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13275        where
13276            D: serde::Deserializer<'de>,
13277        {
13278            #[allow(non_camel_case_types)]
13279            #[doc(hidden)]
13280            #[derive(PartialEq, Eq, Hash)]
13281            enum __FieldTag {
13282                Unknown(std::string::String),
13283            }
13284            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
13285                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13286                where
13287                    D: serde::Deserializer<'de>,
13288                {
13289                    struct Visitor;
13290                    impl<'de> serde::de::Visitor<'de> for Visitor {
13291                        type Value = __FieldTag;
13292                        fn expecting(
13293                            &self,
13294                            formatter: &mut std::fmt::Formatter,
13295                        ) -> std::fmt::Result {
13296                            formatter.write_str("a field name for Vp9ColorFormatHLG")
13297                        }
13298                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
13299                        where
13300                            E: serde::de::Error,
13301                        {
13302                            use std::result::Result::Ok;
13303                            use std::string::ToString;
13304                            Ok(__FieldTag::Unknown(value.to_string()))
13305                        }
13306                    }
13307                    deserializer.deserialize_identifier(Visitor)
13308                }
13309            }
13310            struct Visitor;
13311            impl<'de> serde::de::Visitor<'de> for Visitor {
13312                type Value = Vp9ColorFormatHLG;
13313                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13314                    formatter.write_str("struct Vp9ColorFormatHLG")
13315                }
13316                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
13317                where
13318                    A: serde::de::MapAccess<'de>,
13319                {
13320                    #[allow(unused_imports)]
13321                    use serde::de::Error;
13322                    use std::option::Option::Some;
13323                    let mut result = Self::Value::new();
13324                    while let Some(tag) = map.next_key::<__FieldTag>()? {
13325                        #[allow(clippy::match_single_binding)]
13326                        match tag {
13327                            __FieldTag::Unknown(key) => {
13328                                let value = map.next_value::<serde_json::Value>()?;
13329                                result._unknown_fields.insert(key, value);
13330                            }
13331                        }
13332                    }
13333                    std::result::Result::Ok(result)
13334                }
13335            }
13336            deserializer.deserialize_any(Visitor)
13337        }
13338    }
13339
13340    #[doc(hidden)]
13341    impl serde::ser::Serialize for Vp9ColorFormatHLG {
13342        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13343        where
13344            S: serde::ser::Serializer,
13345        {
13346            use serde::ser::SerializeMap;
13347            #[allow(unused_imports)]
13348            use std::option::Option::Some;
13349            let mut state = serializer.serialize_map(std::option::Option::None)?;
13350            if !self._unknown_fields.is_empty() {
13351                for (key, value) in self._unknown_fields.iter() {
13352                    state.serialize_entry(key, &value)?;
13353                }
13354            }
13355            state.end()
13356        }
13357    }
13358
13359    impl std::fmt::Debug for Vp9ColorFormatHLG {
13360        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13361            let mut debug_struct = f.debug_struct("Vp9ColorFormatHLG");
13362            if !self._unknown_fields.is_empty() {
13363                debug_struct.field("_unknown_fields", &self._unknown_fields);
13364            }
13365            debug_struct.finish()
13366        }
13367    }
13368
13369    /// VP9 codec settings.
13370    #[derive(Clone, Default, PartialEq)]
13371    #[non_exhaustive]
13372    pub struct Vp9CodecSettings {
13373        /// The width of the video in pixels. Must be an even integer.
13374        /// When not specified, the width is adjusted to match the specified height
13375        /// and input aspect ratio. If both are omitted, the input width is used.
13376        ///
13377        /// For portrait videos that contain horizontal ASR and rotation metadata,
13378        /// provide the width, in pixels, per the horizontal ASR. The API calculates
13379        /// the height per the horizontal ASR. The API detects any rotation metadata
13380        /// and swaps the requested height and width for the output.
13381        pub width_pixels: i32,
13382
13383        /// The height of the video in pixels. Must be an even integer.
13384        /// When not specified, the height is adjusted to match the specified width
13385        /// and input aspect ratio. If both are omitted, the input height is used.
13386        ///
13387        /// For portrait videos that contain horizontal ASR and rotation metadata,
13388        /// provide the height, in pixels, per the horizontal ASR. The API calculates
13389        /// the width per the horizontal ASR. The API detects any rotation metadata
13390        /// and swaps the requested height and width for the output.
13391        pub height_pixels: i32,
13392
13393        /// Required. The target video frame rate in frames per second (FPS). Must be
13394        /// less than or equal to 120.
13395        pub frame_rate: f64,
13396
13397        /// Optional. Frame rate conversion strategy for desired frame rate. The
13398        /// default is `DOWNSAMPLE`.
13399        pub frame_rate_conversion_strategy: crate::model::video_stream::FrameRateConversionStrategy,
13400
13401        /// Required. The video bitrate in bits per second. The minimum value is
13402        /// 1,000. The maximum value is 480,000,000.
13403        pub bitrate_bps: i32,
13404
13405        /// Pixel format to use. The default is `yuv420p`.
13406        ///
13407        /// Supported pixel formats:
13408        ///
13409        /// - `yuv420p` pixel format
13410        /// - `yuv422p` pixel format
13411        /// - `yuv444p` pixel format
13412        /// - `yuv420p10` 10-bit HDR pixel format
13413        /// - `yuv422p10` 10-bit HDR pixel format
13414        /// - `yuv444p10` 10-bit HDR pixel format
13415        /// - `yuv420p12` 12-bit HDR pixel format
13416        /// - `yuv422p12` 12-bit HDR pixel format
13417        /// - `yuv444p12` 12-bit HDR pixel format
13418        pub pixel_format: std::string::String,
13419
13420        /// Specify the mode. The default is `vbr`.
13421        ///
13422        /// Supported rate control modes:
13423        ///
13424        /// - `vbr` - variable bitrate
13425        pub rate_control_mode: std::string::String,
13426
13427        /// Target CRF level. Must be between 10 and 36, where 10 is the highest
13428        /// quality and 36 is the most efficient compression. The default is 21.
13429        ///
13430        /// **Note:** This field is not supported.
13431        pub crf_level: i32,
13432
13433        /// Enforces the specified codec profile. The following profiles are
13434        /// supported:
13435        ///
13436        /// * `profile0` (default)
13437        /// * `profile1`
13438        /// * `profile2`
13439        /// * `profile3`
13440        ///
13441        /// The available options are
13442        /// [WebM-compatible](https://www.webmproject.org/vp9/profiles/).
13443        /// Note that certain values for this field may cause the
13444        /// transcoder to override other fields you set in the `Vp9CodecSettings`
13445        /// message.
13446        pub profile: std::string::String,
13447
13448        /// GOP mode can be either by frame count or duration.
13449        pub gop_mode: std::option::Option<crate::model::video_stream::vp_9_codec_settings::GopMode>,
13450
13451        /// Color format can be sdr or hlg.
13452        pub color_format:
13453            std::option::Option<crate::model::video_stream::vp_9_codec_settings::ColorFormat>,
13454
13455        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13456    }
13457
13458    impl Vp9CodecSettings {
13459        pub fn new() -> Self {
13460            std::default::Default::default()
13461        }
13462
13463        /// Sets the value of [width_pixels][crate::model::video_stream::Vp9CodecSettings::width_pixels].
13464        pub fn set_width_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13465            self.width_pixels = v.into();
13466            self
13467        }
13468
13469        /// Sets the value of [height_pixels][crate::model::video_stream::Vp9CodecSettings::height_pixels].
13470        pub fn set_height_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13471            self.height_pixels = v.into();
13472            self
13473        }
13474
13475        /// Sets the value of [frame_rate][crate::model::video_stream::Vp9CodecSettings::frame_rate].
13476        pub fn set_frame_rate<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
13477            self.frame_rate = v.into();
13478            self
13479        }
13480
13481        /// Sets the value of [frame_rate_conversion_strategy][crate::model::video_stream::Vp9CodecSettings::frame_rate_conversion_strategy].
13482        pub fn set_frame_rate_conversion_strategy<
13483            T: std::convert::Into<crate::model::video_stream::FrameRateConversionStrategy>,
13484        >(
13485            mut self,
13486            v: T,
13487        ) -> Self {
13488            self.frame_rate_conversion_strategy = v.into();
13489            self
13490        }
13491
13492        /// Sets the value of [bitrate_bps][crate::model::video_stream::Vp9CodecSettings::bitrate_bps].
13493        pub fn set_bitrate_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13494            self.bitrate_bps = v.into();
13495            self
13496        }
13497
13498        /// Sets the value of [pixel_format][crate::model::video_stream::Vp9CodecSettings::pixel_format].
13499        pub fn set_pixel_format<T: std::convert::Into<std::string::String>>(
13500            mut self,
13501            v: T,
13502        ) -> Self {
13503            self.pixel_format = v.into();
13504            self
13505        }
13506
13507        /// Sets the value of [rate_control_mode][crate::model::video_stream::Vp9CodecSettings::rate_control_mode].
13508        pub fn set_rate_control_mode<T: std::convert::Into<std::string::String>>(
13509            mut self,
13510            v: T,
13511        ) -> Self {
13512            self.rate_control_mode = v.into();
13513            self
13514        }
13515
13516        /// Sets the value of [crf_level][crate::model::video_stream::Vp9CodecSettings::crf_level].
13517        pub fn set_crf_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13518            self.crf_level = v.into();
13519            self
13520        }
13521
13522        /// Sets the value of [profile][crate::model::video_stream::Vp9CodecSettings::profile].
13523        pub fn set_profile<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13524            self.profile = v.into();
13525            self
13526        }
13527
13528        /// Sets the value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode].
13529        ///
13530        /// Note that all the setters affecting `gop_mode` are mutually
13531        /// exclusive.
13532        pub fn set_gop_mode<
13533            T: std::convert::Into<
13534                    std::option::Option<crate::model::video_stream::vp_9_codec_settings::GopMode>,
13535                >,
13536        >(
13537            mut self,
13538            v: T,
13539        ) -> Self {
13540            self.gop_mode = v.into();
13541            self
13542        }
13543
13544        /// The value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode]
13545        /// if it holds a `GopFrameCount`, `None` if the field is not set or
13546        /// holds a different branch.
13547        pub fn gop_frame_count(&self) -> std::option::Option<&i32> {
13548            #[allow(unreachable_patterns)]
13549            self.gop_mode.as_ref().and_then(|v| match v {
13550                crate::model::video_stream::vp_9_codec_settings::GopMode::GopFrameCount(v) => {
13551                    std::option::Option::Some(v)
13552                }
13553                _ => std::option::Option::None,
13554            })
13555        }
13556
13557        /// Sets the value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode]
13558        /// to hold a `GopFrameCount`.
13559        ///
13560        /// Note that all the setters affecting `gop_mode` are
13561        /// mutually exclusive.
13562        pub fn set_gop_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13563            self.gop_mode = std::option::Option::Some(
13564                crate::model::video_stream::vp_9_codec_settings::GopMode::GopFrameCount(v.into()),
13565            );
13566            self
13567        }
13568
13569        /// The value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode]
13570        /// if it holds a `GopDuration`, `None` if the field is not set or
13571        /// holds a different branch.
13572        pub fn gop_duration(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
13573            #[allow(unreachable_patterns)]
13574            self.gop_mode.as_ref().and_then(|v| match v {
13575                crate::model::video_stream::vp_9_codec_settings::GopMode::GopDuration(v) => {
13576                    std::option::Option::Some(v)
13577                }
13578                _ => std::option::Option::None,
13579            })
13580        }
13581
13582        /// Sets the value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode]
13583        /// to hold a `GopDuration`.
13584        ///
13585        /// Note that all the setters affecting `gop_mode` are
13586        /// mutually exclusive.
13587        pub fn set_gop_duration<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
13588            mut self,
13589            v: T,
13590        ) -> Self {
13591            self.gop_mode = std::option::Option::Some(
13592                crate::model::video_stream::vp_9_codec_settings::GopMode::GopDuration(v.into()),
13593            );
13594            self
13595        }
13596
13597        /// Sets the value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format].
13598        ///
13599        /// Note that all the setters affecting `color_format` are mutually
13600        /// exclusive.
13601        pub fn set_color_format<
13602            T: std::convert::Into<
13603                    std::option::Option<
13604                        crate::model::video_stream::vp_9_codec_settings::ColorFormat,
13605                    >,
13606                >,
13607        >(
13608            mut self,
13609            v: T,
13610        ) -> Self {
13611            self.color_format = v.into();
13612            self
13613        }
13614
13615        /// The value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format]
13616        /// if it holds a `Sdr`, `None` if the field is not set or
13617        /// holds a different branch.
13618        pub fn sdr(
13619            &self,
13620        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::Vp9ColorFormatSDR>>
13621        {
13622            #[allow(unreachable_patterns)]
13623            self.color_format.as_ref().and_then(|v| match v {
13624                crate::model::video_stream::vp_9_codec_settings::ColorFormat::Sdr(v) => {
13625                    std::option::Option::Some(v)
13626                }
13627                _ => std::option::Option::None,
13628            })
13629        }
13630
13631        /// Sets the value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format]
13632        /// to hold a `Sdr`.
13633        ///
13634        /// Note that all the setters affecting `color_format` are
13635        /// mutually exclusive.
13636        pub fn set_sdr<
13637            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::Vp9ColorFormatSDR>>,
13638        >(
13639            mut self,
13640            v: T,
13641        ) -> Self {
13642            self.color_format = std::option::Option::Some(
13643                crate::model::video_stream::vp_9_codec_settings::ColorFormat::Sdr(v.into()),
13644            );
13645            self
13646        }
13647
13648        /// The value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format]
13649        /// if it holds a `Hlg`, `None` if the field is not set or
13650        /// holds a different branch.
13651        pub fn hlg(
13652            &self,
13653        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::Vp9ColorFormatHLG>>
13654        {
13655            #[allow(unreachable_patterns)]
13656            self.color_format.as_ref().and_then(|v| match v {
13657                crate::model::video_stream::vp_9_codec_settings::ColorFormat::Hlg(v) => {
13658                    std::option::Option::Some(v)
13659                }
13660                _ => std::option::Option::None,
13661            })
13662        }
13663
13664        /// Sets the value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format]
13665        /// to hold a `Hlg`.
13666        ///
13667        /// Note that all the setters affecting `color_format` are
13668        /// mutually exclusive.
13669        pub fn set_hlg<
13670            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::Vp9ColorFormatHLG>>,
13671        >(
13672            mut self,
13673            v: T,
13674        ) -> Self {
13675            self.color_format = std::option::Option::Some(
13676                crate::model::video_stream::vp_9_codec_settings::ColorFormat::Hlg(v.into()),
13677            );
13678            self
13679        }
13680    }
13681
13682    impl wkt::message::Message for Vp9CodecSettings {
13683        fn typename() -> &'static str {
13684            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings"
13685        }
13686    }
13687
13688    #[doc(hidden)]
13689    impl<'de> serde::de::Deserialize<'de> for Vp9CodecSettings {
13690        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13691        where
13692            D: serde::Deserializer<'de>,
13693        {
13694            #[allow(non_camel_case_types)]
13695            #[doc(hidden)]
13696            #[derive(PartialEq, Eq, Hash)]
13697            enum __FieldTag {
13698                __width_pixels,
13699                __height_pixels,
13700                __frame_rate,
13701                __frame_rate_conversion_strategy,
13702                __bitrate_bps,
13703                __pixel_format,
13704                __rate_control_mode,
13705                __crf_level,
13706                __gop_frame_count,
13707                __gop_duration,
13708                __profile,
13709                __sdr,
13710                __hlg,
13711                Unknown(std::string::String),
13712            }
13713            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
13714                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13715                where
13716                    D: serde::Deserializer<'de>,
13717                {
13718                    struct Visitor;
13719                    impl<'de> serde::de::Visitor<'de> for Visitor {
13720                        type Value = __FieldTag;
13721                        fn expecting(
13722                            &self,
13723                            formatter: &mut std::fmt::Formatter,
13724                        ) -> std::fmt::Result {
13725                            formatter.write_str("a field name for Vp9CodecSettings")
13726                        }
13727                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
13728                        where
13729                            E: serde::de::Error,
13730                        {
13731                            use std::result::Result::Ok;
13732                            use std::string::ToString;
13733                            match value {
13734                                "widthPixels" => Ok(__FieldTag::__width_pixels),
13735                                "width_pixels" => Ok(__FieldTag::__width_pixels),
13736                                "heightPixels" => Ok(__FieldTag::__height_pixels),
13737                                "height_pixels" => Ok(__FieldTag::__height_pixels),
13738                                "frameRate" => Ok(__FieldTag::__frame_rate),
13739                                "frame_rate" => Ok(__FieldTag::__frame_rate),
13740                                "frameRateConversionStrategy" => {
13741                                    Ok(__FieldTag::__frame_rate_conversion_strategy)
13742                                }
13743                                "frame_rate_conversion_strategy" => {
13744                                    Ok(__FieldTag::__frame_rate_conversion_strategy)
13745                                }
13746                                "bitrateBps" => Ok(__FieldTag::__bitrate_bps),
13747                                "bitrate_bps" => Ok(__FieldTag::__bitrate_bps),
13748                                "pixelFormat" => Ok(__FieldTag::__pixel_format),
13749                                "pixel_format" => Ok(__FieldTag::__pixel_format),
13750                                "rateControlMode" => Ok(__FieldTag::__rate_control_mode),
13751                                "rate_control_mode" => Ok(__FieldTag::__rate_control_mode),
13752                                "crfLevel" => Ok(__FieldTag::__crf_level),
13753                                "crf_level" => Ok(__FieldTag::__crf_level),
13754                                "gopFrameCount" => Ok(__FieldTag::__gop_frame_count),
13755                                "gop_frame_count" => Ok(__FieldTag::__gop_frame_count),
13756                                "gopDuration" => Ok(__FieldTag::__gop_duration),
13757                                "gop_duration" => Ok(__FieldTag::__gop_duration),
13758                                "profile" => Ok(__FieldTag::__profile),
13759                                "sdr" => Ok(__FieldTag::__sdr),
13760                                "hlg" => Ok(__FieldTag::__hlg),
13761                                _ => Ok(__FieldTag::Unknown(value.to_string())),
13762                            }
13763                        }
13764                    }
13765                    deserializer.deserialize_identifier(Visitor)
13766                }
13767            }
13768            struct Visitor;
13769            impl<'de> serde::de::Visitor<'de> for Visitor {
13770                type Value = Vp9CodecSettings;
13771                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13772                    formatter.write_str("struct Vp9CodecSettings")
13773                }
13774                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
13775                where
13776                    A: serde::de::MapAccess<'de>,
13777                {
13778                    #[allow(unused_imports)]
13779                    use serde::de::Error;
13780                    use std::option::Option::Some;
13781                    let mut fields = std::collections::HashSet::new();
13782                    let mut result = Self::Value::new();
13783                    while let Some(tag) = map.next_key::<__FieldTag>()? {
13784                        #[allow(clippy::match_single_binding)]
13785                        match tag {
13786                            __FieldTag::__width_pixels => {
13787                                if !fields.insert(__FieldTag::__width_pixels) {
13788                                    return std::result::Result::Err(A::Error::duplicate_field(
13789                                        "multiple values for width_pixels",
13790                                    ));
13791                                }
13792                                struct __With(std::option::Option<i32>);
13793                                impl<'de> serde::de::Deserialize<'de> for __With {
13794                                    fn deserialize<D>(
13795                                        deserializer: D,
13796                                    ) -> std::result::Result<Self, D::Error>
13797                                    where
13798                                        D: serde::de::Deserializer<'de>,
13799                                    {
13800                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
13801                                    }
13802                                }
13803                                result.width_pixels =
13804                                    map.next_value::<__With>()?.0.unwrap_or_default();
13805                            }
13806                            __FieldTag::__height_pixels => {
13807                                if !fields.insert(__FieldTag::__height_pixels) {
13808                                    return std::result::Result::Err(A::Error::duplicate_field(
13809                                        "multiple values for height_pixels",
13810                                    ));
13811                                }
13812                                struct __With(std::option::Option<i32>);
13813                                impl<'de> serde::de::Deserialize<'de> for __With {
13814                                    fn deserialize<D>(
13815                                        deserializer: D,
13816                                    ) -> std::result::Result<Self, D::Error>
13817                                    where
13818                                        D: serde::de::Deserializer<'de>,
13819                                    {
13820                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
13821                                    }
13822                                }
13823                                result.height_pixels =
13824                                    map.next_value::<__With>()?.0.unwrap_or_default();
13825                            }
13826                            __FieldTag::__frame_rate => {
13827                                if !fields.insert(__FieldTag::__frame_rate) {
13828                                    return std::result::Result::Err(A::Error::duplicate_field(
13829                                        "multiple values for frame_rate",
13830                                    ));
13831                                }
13832                                struct __With(std::option::Option<f64>);
13833                                impl<'de> serde::de::Deserialize<'de> for __With {
13834                                    fn deserialize<D>(
13835                                        deserializer: D,
13836                                    ) -> std::result::Result<Self, D::Error>
13837                                    where
13838                                        D: serde::de::Deserializer<'de>,
13839                                    {
13840                                        serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
13841                                    }
13842                                }
13843                                result.frame_rate =
13844                                    map.next_value::<__With>()?.0.unwrap_or_default();
13845                            }
13846                            __FieldTag::__frame_rate_conversion_strategy => {
13847                                if !fields.insert(__FieldTag::__frame_rate_conversion_strategy) {
13848                                    return std::result::Result::Err(A::Error::duplicate_field(
13849                                        "multiple values for frame_rate_conversion_strategy",
13850                                    ));
13851                                }
13852                                result.frame_rate_conversion_strategy = map
13853                                    .next_value::<std::option::Option<
13854                                        crate::model::video_stream::FrameRateConversionStrategy,
13855                                    >>()?
13856                                    .unwrap_or_default();
13857                            }
13858                            __FieldTag::__bitrate_bps => {
13859                                if !fields.insert(__FieldTag::__bitrate_bps) {
13860                                    return std::result::Result::Err(A::Error::duplicate_field(
13861                                        "multiple values for bitrate_bps",
13862                                    ));
13863                                }
13864                                struct __With(std::option::Option<i32>);
13865                                impl<'de> serde::de::Deserialize<'de> for __With {
13866                                    fn deserialize<D>(
13867                                        deserializer: D,
13868                                    ) -> std::result::Result<Self, D::Error>
13869                                    where
13870                                        D: serde::de::Deserializer<'de>,
13871                                    {
13872                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
13873                                    }
13874                                }
13875                                result.bitrate_bps =
13876                                    map.next_value::<__With>()?.0.unwrap_or_default();
13877                            }
13878                            __FieldTag::__pixel_format => {
13879                                if !fields.insert(__FieldTag::__pixel_format) {
13880                                    return std::result::Result::Err(A::Error::duplicate_field(
13881                                        "multiple values for pixel_format",
13882                                    ));
13883                                }
13884                                result.pixel_format = map
13885                                    .next_value::<std::option::Option<std::string::String>>()?
13886                                    .unwrap_or_default();
13887                            }
13888                            __FieldTag::__rate_control_mode => {
13889                                if !fields.insert(__FieldTag::__rate_control_mode) {
13890                                    return std::result::Result::Err(A::Error::duplicate_field(
13891                                        "multiple values for rate_control_mode",
13892                                    ));
13893                                }
13894                                result.rate_control_mode = map
13895                                    .next_value::<std::option::Option<std::string::String>>()?
13896                                    .unwrap_or_default();
13897                            }
13898                            __FieldTag::__crf_level => {
13899                                if !fields.insert(__FieldTag::__crf_level) {
13900                                    return std::result::Result::Err(A::Error::duplicate_field(
13901                                        "multiple values for crf_level",
13902                                    ));
13903                                }
13904                                struct __With(std::option::Option<i32>);
13905                                impl<'de> serde::de::Deserialize<'de> for __With {
13906                                    fn deserialize<D>(
13907                                        deserializer: D,
13908                                    ) -> std::result::Result<Self, D::Error>
13909                                    where
13910                                        D: serde::de::Deserializer<'de>,
13911                                    {
13912                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
13913                                    }
13914                                }
13915                                result.crf_level =
13916                                    map.next_value::<__With>()?.0.unwrap_or_default();
13917                            }
13918                            __FieldTag::__gop_frame_count => {
13919                                if !fields.insert(__FieldTag::__gop_frame_count) {
13920                                    return std::result::Result::Err(A::Error::duplicate_field(
13921                                        "multiple values for gop_frame_count",
13922                                    ));
13923                                }
13924                                struct __With(std::option::Option<i32>);
13925                                impl<'de> serde::de::Deserialize<'de> for __With {
13926                                    fn deserialize<D>(
13927                                        deserializer: D,
13928                                    ) -> std::result::Result<Self, D::Error>
13929                                    where
13930                                        D: serde::de::Deserializer<'de>,
13931                                    {
13932                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
13933                                    }
13934                                }
13935                                if result.gop_mode.is_some() {
13936                                    return std::result::Result::Err(A::Error::duplicate_field(
13937                                        "multiple values for `gop_mode`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings.gop_frame_count, latest field was gopFrameCount",
13938                                    ));
13939                                }
13940                                result.gop_mode = std::option::Option::Some(
13941                                    crate::model::video_stream::vp_9_codec_settings::GopMode::GopFrameCount(
13942                                        map.next_value::<__With>()?.0.unwrap_or_default()
13943                                    ),
13944                                );
13945                            }
13946                            __FieldTag::__gop_duration => {
13947                                if !fields.insert(__FieldTag::__gop_duration) {
13948                                    return std::result::Result::Err(A::Error::duplicate_field(
13949                                        "multiple values for gop_duration",
13950                                    ));
13951                                }
13952                                if result.gop_mode.is_some() {
13953                                    return std::result::Result::Err(A::Error::duplicate_field(
13954                                        "multiple values for `gop_mode`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings.gop_duration, latest field was gopDuration",
13955                                    ));
13956                                }
13957                                result.gop_mode = std::option::Option::Some(
13958                                    crate::model::video_stream::vp_9_codec_settings::GopMode::GopDuration(
13959                                        map.next_value::<std::option::Option<std::boxed::Box<wkt::Duration>>>()?.unwrap_or_default()
13960                                    ),
13961                                );
13962                            }
13963                            __FieldTag::__profile => {
13964                                if !fields.insert(__FieldTag::__profile) {
13965                                    return std::result::Result::Err(A::Error::duplicate_field(
13966                                        "multiple values for profile",
13967                                    ));
13968                                }
13969                                result.profile = map
13970                                    .next_value::<std::option::Option<std::string::String>>()?
13971                                    .unwrap_or_default();
13972                            }
13973                            __FieldTag::__sdr => {
13974                                if !fields.insert(__FieldTag::__sdr) {
13975                                    return std::result::Result::Err(A::Error::duplicate_field(
13976                                        "multiple values for sdr",
13977                                    ));
13978                                }
13979                                if result.color_format.is_some() {
13980                                    return std::result::Result::Err(A::Error::duplicate_field(
13981                                        "multiple values for `color_format`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings.sdr, latest field was sdr",
13982                                    ));
13983                                }
13984                                result.color_format = std::option::Option::Some(
13985                                    crate::model::video_stream::vp_9_codec_settings::ColorFormat::Sdr(
13986                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::video_stream::Vp9ColorFormatSDR>>>()?.unwrap_or_default()
13987                                    ),
13988                                );
13989                            }
13990                            __FieldTag::__hlg => {
13991                                if !fields.insert(__FieldTag::__hlg) {
13992                                    return std::result::Result::Err(A::Error::duplicate_field(
13993                                        "multiple values for hlg",
13994                                    ));
13995                                }
13996                                if result.color_format.is_some() {
13997                                    return std::result::Result::Err(A::Error::duplicate_field(
13998                                        "multiple values for `color_format`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings.hlg, latest field was hlg",
13999                                    ));
14000                                }
14001                                result.color_format = std::option::Option::Some(
14002                                    crate::model::video_stream::vp_9_codec_settings::ColorFormat::Hlg(
14003                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::video_stream::Vp9ColorFormatHLG>>>()?.unwrap_or_default()
14004                                    ),
14005                                );
14006                            }
14007                            __FieldTag::Unknown(key) => {
14008                                let value = map.next_value::<serde_json::Value>()?;
14009                                result._unknown_fields.insert(key, value);
14010                            }
14011                        }
14012                    }
14013                    std::result::Result::Ok(result)
14014                }
14015            }
14016            deserializer.deserialize_any(Visitor)
14017        }
14018    }
14019
14020    #[doc(hidden)]
14021    impl serde::ser::Serialize for Vp9CodecSettings {
14022        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14023        where
14024            S: serde::ser::Serializer,
14025        {
14026            use serde::ser::SerializeMap;
14027            #[allow(unused_imports)]
14028            use std::option::Option::Some;
14029            let mut state = serializer.serialize_map(std::option::Option::None)?;
14030            if !wkt::internal::is_default(&self.width_pixels) {
14031                struct __With<'a>(&'a i32);
14032                impl<'a> serde::ser::Serialize for __With<'a> {
14033                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14034                    where
14035                        S: serde::ser::Serializer,
14036                    {
14037                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
14038                    }
14039                }
14040                state.serialize_entry("widthPixels", &__With(&self.width_pixels))?;
14041            }
14042            if !wkt::internal::is_default(&self.height_pixels) {
14043                struct __With<'a>(&'a i32);
14044                impl<'a> serde::ser::Serialize for __With<'a> {
14045                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14046                    where
14047                        S: serde::ser::Serializer,
14048                    {
14049                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
14050                    }
14051                }
14052                state.serialize_entry("heightPixels", &__With(&self.height_pixels))?;
14053            }
14054            if !wkt::internal::is_default(&self.frame_rate) {
14055                struct __With<'a>(&'a f64);
14056                impl<'a> serde::ser::Serialize for __With<'a> {
14057                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14058                    where
14059                        S: serde::ser::Serializer,
14060                    {
14061                        serde_with::As::<wkt::internal::F64>::serialize(self.0, serializer)
14062                    }
14063                }
14064                state.serialize_entry("frameRate", &__With(&self.frame_rate))?;
14065            }
14066            if !wkt::internal::is_default(&self.frame_rate_conversion_strategy) {
14067                state.serialize_entry(
14068                    "frameRateConversionStrategy",
14069                    &self.frame_rate_conversion_strategy,
14070                )?;
14071            }
14072            if !wkt::internal::is_default(&self.bitrate_bps) {
14073                struct __With<'a>(&'a i32);
14074                impl<'a> serde::ser::Serialize for __With<'a> {
14075                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14076                    where
14077                        S: serde::ser::Serializer,
14078                    {
14079                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
14080                    }
14081                }
14082                state.serialize_entry("bitrateBps", &__With(&self.bitrate_bps))?;
14083            }
14084            if !self.pixel_format.is_empty() {
14085                state.serialize_entry("pixelFormat", &self.pixel_format)?;
14086            }
14087            if !self.rate_control_mode.is_empty() {
14088                state.serialize_entry("rateControlMode", &self.rate_control_mode)?;
14089            }
14090            if !wkt::internal::is_default(&self.crf_level) {
14091                struct __With<'a>(&'a i32);
14092                impl<'a> serde::ser::Serialize for __With<'a> {
14093                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14094                    where
14095                        S: serde::ser::Serializer,
14096                    {
14097                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
14098                    }
14099                }
14100                state.serialize_entry("crfLevel", &__With(&self.crf_level))?;
14101            }
14102            if let Some(value) = self.gop_frame_count() {
14103                struct __With<'a>(&'a i32);
14104                impl<'a> serde::ser::Serialize for __With<'a> {
14105                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14106                    where
14107                        S: serde::ser::Serializer,
14108                    {
14109                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
14110                    }
14111                }
14112                state.serialize_entry("gopFrameCount", &__With(value))?;
14113            }
14114            if let Some(value) = self.gop_duration() {
14115                state.serialize_entry("gopDuration", value)?;
14116            }
14117            if !self.profile.is_empty() {
14118                state.serialize_entry("profile", &self.profile)?;
14119            }
14120            if let Some(value) = self.sdr() {
14121                state.serialize_entry("sdr", value)?;
14122            }
14123            if let Some(value) = self.hlg() {
14124                state.serialize_entry("hlg", value)?;
14125            }
14126            if !self._unknown_fields.is_empty() {
14127                for (key, value) in self._unknown_fields.iter() {
14128                    state.serialize_entry(key, &value)?;
14129                }
14130            }
14131            state.end()
14132        }
14133    }
14134
14135    impl std::fmt::Debug for Vp9CodecSettings {
14136        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14137            let mut debug_struct = f.debug_struct("Vp9CodecSettings");
14138            debug_struct.field("width_pixels", &self.width_pixels);
14139            debug_struct.field("height_pixels", &self.height_pixels);
14140            debug_struct.field("frame_rate", &self.frame_rate);
14141            debug_struct.field(
14142                "frame_rate_conversion_strategy",
14143                &self.frame_rate_conversion_strategy,
14144            );
14145            debug_struct.field("bitrate_bps", &self.bitrate_bps);
14146            debug_struct.field("pixel_format", &self.pixel_format);
14147            debug_struct.field("rate_control_mode", &self.rate_control_mode);
14148            debug_struct.field("crf_level", &self.crf_level);
14149            debug_struct.field("profile", &self.profile);
14150            debug_struct.field("gop_mode", &self.gop_mode);
14151            debug_struct.field("color_format", &self.color_format);
14152            if !self._unknown_fields.is_empty() {
14153                debug_struct.field("_unknown_fields", &self._unknown_fields);
14154            }
14155            debug_struct.finish()
14156        }
14157    }
14158
14159    /// Defines additional types related to [Vp9CodecSettings].
14160    pub mod vp_9_codec_settings {
14161        #[allow(unused_imports)]
14162        use super::*;
14163
14164        /// GOP mode can be either by frame count or duration.
14165        #[derive(Clone, Debug, PartialEq)]
14166        #[non_exhaustive]
14167        pub enum GopMode {
14168            /// Select the GOP size based on the specified frame count. Must be greater
14169            /// than zero.
14170            GopFrameCount(i32),
14171            /// Select the GOP size based on the specified duration. The default is
14172            /// `3s`. Note that `gopDuration` must be less than or equal to
14173            /// [`segmentDuration`](#SegmentSettings), and
14174            /// [`segmentDuration`](#SegmentSettings) must be divisible by
14175            /// `gopDuration`.
14176            GopDuration(std::boxed::Box<wkt::Duration>),
14177        }
14178
14179        /// Color format can be sdr or hlg.
14180        #[derive(Clone, Debug, PartialEq)]
14181        #[non_exhaustive]
14182        pub enum ColorFormat {
14183            /// Optional. SDR color format setting for VP9.
14184            Sdr(std::boxed::Box<crate::model::video_stream::Vp9ColorFormatSDR>),
14185            /// Optional. HLG color format setting for VP9.
14186            Hlg(std::boxed::Box<crate::model::video_stream::Vp9ColorFormatHLG>),
14187        }
14188    }
14189
14190    /// The conversion strategy for desired frame rate.
14191    ///
14192    /// # Working with unknown values
14193    ///
14194    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14195    /// additional enum variants at any time. Adding new variants is not considered
14196    /// a breaking change. Applications should write their code in anticipation of:
14197    ///
14198    /// - New values appearing in future releases of the client library, **and**
14199    /// - New values received dynamically, without application changes.
14200    ///
14201    /// Please consult the [Working with enums] section in the user guide for some
14202    /// guidelines.
14203    ///
14204    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14205    #[derive(Clone, Debug, PartialEq)]
14206    #[non_exhaustive]
14207    pub enum FrameRateConversionStrategy {
14208        /// Unspecified frame rate conversion strategy.
14209        Unspecified,
14210        /// Selectively retain frames to reduce the output frame rate.
14211        /// Every _n_ th frame is kept, where `n = ceil(input frame rate / target
14212        /// frame rate)`. When _n_ = 1 (that is, the target frame rate is greater
14213        /// than the input frame rate), the output frame rate matches the input frame
14214        /// rate. When _n_ > 1, frames are dropped and the output frame rate is
14215        /// equal to `(input frame rate / n)`. For more information, see
14216        /// [Calculate frame
14217        /// rate](https://cloud.google.com/transcoder/docs/concepts/frame-rate).
14218        Downsample,
14219        /// Drop or duplicate frames to match the specified frame rate.
14220        DropDuplicate,
14221        /// If set, the enum was initialized with an unknown value.
14222        ///
14223        /// Applications can examine the value using [FrameRateConversionStrategy::value] or
14224        /// [FrameRateConversionStrategy::name].
14225        UnknownValue(frame_rate_conversion_strategy::UnknownValue),
14226    }
14227
14228    #[doc(hidden)]
14229    pub mod frame_rate_conversion_strategy {
14230        #[allow(unused_imports)]
14231        use super::*;
14232        #[derive(Clone, Debug, PartialEq)]
14233        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14234    }
14235
14236    impl FrameRateConversionStrategy {
14237        /// Gets the enum value.
14238        ///
14239        /// Returns `None` if the enum contains an unknown value deserialized from
14240        /// the string representation of enums.
14241        pub fn value(&self) -> std::option::Option<i32> {
14242            match self {
14243                Self::Unspecified => std::option::Option::Some(0),
14244                Self::Downsample => std::option::Option::Some(1),
14245                Self::DropDuplicate => std::option::Option::Some(2),
14246                Self::UnknownValue(u) => u.0.value(),
14247            }
14248        }
14249
14250        /// Gets the enum value as a string.
14251        ///
14252        /// Returns `None` if the enum contains an unknown value deserialized from
14253        /// the integer representation of enums.
14254        pub fn name(&self) -> std::option::Option<&str> {
14255            match self {
14256                Self::Unspecified => {
14257                    std::option::Option::Some("FRAME_RATE_CONVERSION_STRATEGY_UNSPECIFIED")
14258                }
14259                Self::Downsample => std::option::Option::Some("DOWNSAMPLE"),
14260                Self::DropDuplicate => std::option::Option::Some("DROP_DUPLICATE"),
14261                Self::UnknownValue(u) => u.0.name(),
14262            }
14263        }
14264    }
14265
14266    impl std::default::Default for FrameRateConversionStrategy {
14267        fn default() -> Self {
14268            use std::convert::From;
14269            Self::from(0)
14270        }
14271    }
14272
14273    impl std::fmt::Display for FrameRateConversionStrategy {
14274        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14275            wkt::internal::display_enum(f, self.name(), self.value())
14276        }
14277    }
14278
14279    impl std::convert::From<i32> for FrameRateConversionStrategy {
14280        fn from(value: i32) -> Self {
14281            match value {
14282                0 => Self::Unspecified,
14283                1 => Self::Downsample,
14284                2 => Self::DropDuplicate,
14285                _ => Self::UnknownValue(frame_rate_conversion_strategy::UnknownValue(
14286                    wkt::internal::UnknownEnumValue::Integer(value),
14287                )),
14288            }
14289        }
14290    }
14291
14292    impl std::convert::From<&str> for FrameRateConversionStrategy {
14293        fn from(value: &str) -> Self {
14294            use std::string::ToString;
14295            match value {
14296                "FRAME_RATE_CONVERSION_STRATEGY_UNSPECIFIED" => Self::Unspecified,
14297                "DOWNSAMPLE" => Self::Downsample,
14298                "DROP_DUPLICATE" => Self::DropDuplicate,
14299                _ => Self::UnknownValue(frame_rate_conversion_strategy::UnknownValue(
14300                    wkt::internal::UnknownEnumValue::String(value.to_string()),
14301                )),
14302            }
14303        }
14304    }
14305
14306    impl serde::ser::Serialize for FrameRateConversionStrategy {
14307        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14308        where
14309            S: serde::Serializer,
14310        {
14311            match self {
14312                Self::Unspecified => serializer.serialize_i32(0),
14313                Self::Downsample => serializer.serialize_i32(1),
14314                Self::DropDuplicate => serializer.serialize_i32(2),
14315                Self::UnknownValue(u) => u.0.serialize(serializer),
14316            }
14317        }
14318    }
14319
14320    impl<'de> serde::de::Deserialize<'de> for FrameRateConversionStrategy {
14321        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14322        where
14323            D: serde::Deserializer<'de>,
14324        {
14325            deserializer.deserialize_any(
14326                wkt::internal::EnumVisitor::<FrameRateConversionStrategy>::new(
14327                    ".google.cloud.video.transcoder.v1.VideoStream.FrameRateConversionStrategy",
14328                ),
14329            )
14330        }
14331    }
14332
14333    /// Codec settings can be h264, h265, or vp9.
14334    #[derive(Clone, Debug, PartialEq)]
14335    #[non_exhaustive]
14336    pub enum CodecSettings {
14337        /// H264 codec settings.
14338        H264(std::boxed::Box<crate::model::video_stream::H264CodecSettings>),
14339        /// H265 codec settings.
14340        H265(std::boxed::Box<crate::model::video_stream::H265CodecSettings>),
14341        /// VP9 codec settings.
14342        Vp9(std::boxed::Box<crate::model::video_stream::Vp9CodecSettings>),
14343    }
14344}
14345
14346/// Audio stream resource.
14347#[derive(Clone, Default, PartialEq)]
14348#[non_exhaustive]
14349pub struct AudioStream {
14350    /// The codec for this audio stream. The default is `aac`.
14351    ///
14352    /// Supported audio codecs:
14353    ///
14354    /// - `aac`
14355    /// - `aac-he`
14356    /// - `aac-he-v2`
14357    /// - `mp3`
14358    /// - `ac3`
14359    /// - `eac3`
14360    /// - `vorbis`
14361    pub codec: std::string::String,
14362
14363    /// Required. Audio bitrate in bits per second. Must be between 1 and
14364    /// 10,000,000.
14365    pub bitrate_bps: i32,
14366
14367    /// Number of audio channels. Must be between 1 and 6. The default is 2.
14368    pub channel_count: i32,
14369
14370    /// A list of channel names specifying layout of the audio channels.
14371    /// This only affects the metadata embedded in the container headers, if
14372    /// supported by the specified format. The default is `["fl", "fr"]`.
14373    ///
14374    /// Supported channel names:
14375    ///
14376    /// - `fl` - Front left channel
14377    /// - `fr` - Front right channel
14378    /// - `sl` - Side left channel
14379    /// - `sr` - Side right channel
14380    /// - `fc` - Front center channel
14381    /// - `lfe` - Low frequency
14382    pub channel_layout: std::vec::Vec<std::string::String>,
14383
14384    /// The mapping for the
14385    /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list]
14386    /// atoms with audio
14387    /// [EditAtom.inputs][google.cloud.video.transcoder.v1.EditAtom.inputs].
14388    ///
14389    /// [google.cloud.video.transcoder.v1.EditAtom.inputs]: crate::model::EditAtom::inputs
14390    /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
14391    pub mapping: std::vec::Vec<crate::model::audio_stream::AudioMapping>,
14392
14393    /// The audio sample rate in Hertz. The default is 48000 Hertz.
14394    pub sample_rate_hertz: i32,
14395
14396    /// The BCP-47 language code, such as `en-US` or `sr-Latn`. For more
14397    /// information, see
14398    /// <https://www.unicode.org/reports/tr35/#Unicode_locale_identifier>. Not
14399    /// supported in MP4 files.
14400    pub language_code: std::string::String,
14401
14402    /// The name for this particular audio stream that
14403    /// will be added to the HLS/DASH manifest. Not supported in MP4 files.
14404    pub display_name: std::string::String,
14405
14406    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14407}
14408
14409impl AudioStream {
14410    pub fn new() -> Self {
14411        std::default::Default::default()
14412    }
14413
14414    /// Sets the value of [codec][crate::model::AudioStream::codec].
14415    pub fn set_codec<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14416        self.codec = v.into();
14417        self
14418    }
14419
14420    /// Sets the value of [bitrate_bps][crate::model::AudioStream::bitrate_bps].
14421    pub fn set_bitrate_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14422        self.bitrate_bps = v.into();
14423        self
14424    }
14425
14426    /// Sets the value of [channel_count][crate::model::AudioStream::channel_count].
14427    pub fn set_channel_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14428        self.channel_count = v.into();
14429        self
14430    }
14431
14432    /// Sets the value of [channel_layout][crate::model::AudioStream::channel_layout].
14433    pub fn set_channel_layout<T, V>(mut self, v: T) -> Self
14434    where
14435        T: std::iter::IntoIterator<Item = V>,
14436        V: std::convert::Into<std::string::String>,
14437    {
14438        use std::iter::Iterator;
14439        self.channel_layout = v.into_iter().map(|i| i.into()).collect();
14440        self
14441    }
14442
14443    /// Sets the value of [mapping][crate::model::AudioStream::mapping].
14444    pub fn set_mapping<T, V>(mut self, v: T) -> Self
14445    where
14446        T: std::iter::IntoIterator<Item = V>,
14447        V: std::convert::Into<crate::model::audio_stream::AudioMapping>,
14448    {
14449        use std::iter::Iterator;
14450        self.mapping = v.into_iter().map(|i| i.into()).collect();
14451        self
14452    }
14453
14454    /// Sets the value of [sample_rate_hertz][crate::model::AudioStream::sample_rate_hertz].
14455    pub fn set_sample_rate_hertz<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14456        self.sample_rate_hertz = v.into();
14457        self
14458    }
14459
14460    /// Sets the value of [language_code][crate::model::AudioStream::language_code].
14461    pub fn set_language_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14462        self.language_code = v.into();
14463        self
14464    }
14465
14466    /// Sets the value of [display_name][crate::model::AudioStream::display_name].
14467    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14468        self.display_name = v.into();
14469        self
14470    }
14471}
14472
14473impl wkt::message::Message for AudioStream {
14474    fn typename() -> &'static str {
14475        "type.googleapis.com/google.cloud.video.transcoder.v1.AudioStream"
14476    }
14477}
14478
14479#[doc(hidden)]
14480impl<'de> serde::de::Deserialize<'de> for AudioStream {
14481    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14482    where
14483        D: serde::Deserializer<'de>,
14484    {
14485        #[allow(non_camel_case_types)]
14486        #[doc(hidden)]
14487        #[derive(PartialEq, Eq, Hash)]
14488        enum __FieldTag {
14489            __codec,
14490            __bitrate_bps,
14491            __channel_count,
14492            __channel_layout,
14493            __mapping,
14494            __sample_rate_hertz,
14495            __language_code,
14496            __display_name,
14497            Unknown(std::string::String),
14498        }
14499        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
14500            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14501            where
14502                D: serde::Deserializer<'de>,
14503            {
14504                struct Visitor;
14505                impl<'de> serde::de::Visitor<'de> for Visitor {
14506                    type Value = __FieldTag;
14507                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14508                        formatter.write_str("a field name for AudioStream")
14509                    }
14510                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
14511                    where
14512                        E: serde::de::Error,
14513                    {
14514                        use std::result::Result::Ok;
14515                        use std::string::ToString;
14516                        match value {
14517                            "codec" => Ok(__FieldTag::__codec),
14518                            "bitrateBps" => Ok(__FieldTag::__bitrate_bps),
14519                            "bitrate_bps" => Ok(__FieldTag::__bitrate_bps),
14520                            "channelCount" => Ok(__FieldTag::__channel_count),
14521                            "channel_count" => Ok(__FieldTag::__channel_count),
14522                            "channelLayout" => Ok(__FieldTag::__channel_layout),
14523                            "channel_layout" => Ok(__FieldTag::__channel_layout),
14524                            "mapping" => Ok(__FieldTag::__mapping),
14525                            "sampleRateHertz" => Ok(__FieldTag::__sample_rate_hertz),
14526                            "sample_rate_hertz" => Ok(__FieldTag::__sample_rate_hertz),
14527                            "languageCode" => Ok(__FieldTag::__language_code),
14528                            "language_code" => Ok(__FieldTag::__language_code),
14529                            "displayName" => Ok(__FieldTag::__display_name),
14530                            "display_name" => Ok(__FieldTag::__display_name),
14531                            _ => Ok(__FieldTag::Unknown(value.to_string())),
14532                        }
14533                    }
14534                }
14535                deserializer.deserialize_identifier(Visitor)
14536            }
14537        }
14538        struct Visitor;
14539        impl<'de> serde::de::Visitor<'de> for Visitor {
14540            type Value = AudioStream;
14541            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14542                formatter.write_str("struct AudioStream")
14543            }
14544            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
14545            where
14546                A: serde::de::MapAccess<'de>,
14547            {
14548                #[allow(unused_imports)]
14549                use serde::de::Error;
14550                use std::option::Option::Some;
14551                let mut fields = std::collections::HashSet::new();
14552                let mut result = Self::Value::new();
14553                while let Some(tag) = map.next_key::<__FieldTag>()? {
14554                    #[allow(clippy::match_single_binding)]
14555                    match tag {
14556                        __FieldTag::__codec => {
14557                            if !fields.insert(__FieldTag::__codec) {
14558                                return std::result::Result::Err(A::Error::duplicate_field(
14559                                    "multiple values for codec",
14560                                ));
14561                            }
14562                            result.codec = map
14563                                .next_value::<std::option::Option<std::string::String>>()?
14564                                .unwrap_or_default();
14565                        }
14566                        __FieldTag::__bitrate_bps => {
14567                            if !fields.insert(__FieldTag::__bitrate_bps) {
14568                                return std::result::Result::Err(A::Error::duplicate_field(
14569                                    "multiple values for bitrate_bps",
14570                                ));
14571                            }
14572                            struct __With(std::option::Option<i32>);
14573                            impl<'de> serde::de::Deserialize<'de> for __With {
14574                                fn deserialize<D>(
14575                                    deserializer: D,
14576                                ) -> std::result::Result<Self, D::Error>
14577                                where
14578                                    D: serde::de::Deserializer<'de>,
14579                                {
14580                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
14581                                }
14582                            }
14583                            result.bitrate_bps = map.next_value::<__With>()?.0.unwrap_or_default();
14584                        }
14585                        __FieldTag::__channel_count => {
14586                            if !fields.insert(__FieldTag::__channel_count) {
14587                                return std::result::Result::Err(A::Error::duplicate_field(
14588                                    "multiple values for channel_count",
14589                                ));
14590                            }
14591                            struct __With(std::option::Option<i32>);
14592                            impl<'de> serde::de::Deserialize<'de> for __With {
14593                                fn deserialize<D>(
14594                                    deserializer: D,
14595                                ) -> std::result::Result<Self, D::Error>
14596                                where
14597                                    D: serde::de::Deserializer<'de>,
14598                                {
14599                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
14600                                }
14601                            }
14602                            result.channel_count =
14603                                map.next_value::<__With>()?.0.unwrap_or_default();
14604                        }
14605                        __FieldTag::__channel_layout => {
14606                            if !fields.insert(__FieldTag::__channel_layout) {
14607                                return std::result::Result::Err(A::Error::duplicate_field(
14608                                    "multiple values for channel_layout",
14609                                ));
14610                            }
14611                            result.channel_layout = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
14612                        }
14613                        __FieldTag::__mapping => {
14614                            if !fields.insert(__FieldTag::__mapping) {
14615                                return std::result::Result::Err(A::Error::duplicate_field(
14616                                    "multiple values for mapping",
14617                                ));
14618                            }
14619                            result.mapping = map
14620                                .next_value::<std::option::Option<
14621                                    std::vec::Vec<crate::model::audio_stream::AudioMapping>,
14622                                >>()?
14623                                .unwrap_or_default();
14624                        }
14625                        __FieldTag::__sample_rate_hertz => {
14626                            if !fields.insert(__FieldTag::__sample_rate_hertz) {
14627                                return std::result::Result::Err(A::Error::duplicate_field(
14628                                    "multiple values for sample_rate_hertz",
14629                                ));
14630                            }
14631                            struct __With(std::option::Option<i32>);
14632                            impl<'de> serde::de::Deserialize<'de> for __With {
14633                                fn deserialize<D>(
14634                                    deserializer: D,
14635                                ) -> std::result::Result<Self, D::Error>
14636                                where
14637                                    D: serde::de::Deserializer<'de>,
14638                                {
14639                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
14640                                }
14641                            }
14642                            result.sample_rate_hertz =
14643                                map.next_value::<__With>()?.0.unwrap_or_default();
14644                        }
14645                        __FieldTag::__language_code => {
14646                            if !fields.insert(__FieldTag::__language_code) {
14647                                return std::result::Result::Err(A::Error::duplicate_field(
14648                                    "multiple values for language_code",
14649                                ));
14650                            }
14651                            result.language_code = map
14652                                .next_value::<std::option::Option<std::string::String>>()?
14653                                .unwrap_or_default();
14654                        }
14655                        __FieldTag::__display_name => {
14656                            if !fields.insert(__FieldTag::__display_name) {
14657                                return std::result::Result::Err(A::Error::duplicate_field(
14658                                    "multiple values for display_name",
14659                                ));
14660                            }
14661                            result.display_name = map
14662                                .next_value::<std::option::Option<std::string::String>>()?
14663                                .unwrap_or_default();
14664                        }
14665                        __FieldTag::Unknown(key) => {
14666                            let value = map.next_value::<serde_json::Value>()?;
14667                            result._unknown_fields.insert(key, value);
14668                        }
14669                    }
14670                }
14671                std::result::Result::Ok(result)
14672            }
14673        }
14674        deserializer.deserialize_any(Visitor)
14675    }
14676}
14677
14678#[doc(hidden)]
14679impl serde::ser::Serialize for AudioStream {
14680    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14681    where
14682        S: serde::ser::Serializer,
14683    {
14684        use serde::ser::SerializeMap;
14685        #[allow(unused_imports)]
14686        use std::option::Option::Some;
14687        let mut state = serializer.serialize_map(std::option::Option::None)?;
14688        if !self.codec.is_empty() {
14689            state.serialize_entry("codec", &self.codec)?;
14690        }
14691        if !wkt::internal::is_default(&self.bitrate_bps) {
14692            struct __With<'a>(&'a i32);
14693            impl<'a> serde::ser::Serialize for __With<'a> {
14694                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14695                where
14696                    S: serde::ser::Serializer,
14697                {
14698                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
14699                }
14700            }
14701            state.serialize_entry("bitrateBps", &__With(&self.bitrate_bps))?;
14702        }
14703        if !wkt::internal::is_default(&self.channel_count) {
14704            struct __With<'a>(&'a i32);
14705            impl<'a> serde::ser::Serialize for __With<'a> {
14706                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14707                where
14708                    S: serde::ser::Serializer,
14709                {
14710                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
14711                }
14712            }
14713            state.serialize_entry("channelCount", &__With(&self.channel_count))?;
14714        }
14715        if !self.channel_layout.is_empty() {
14716            state.serialize_entry("channelLayout", &self.channel_layout)?;
14717        }
14718        if !self.mapping.is_empty() {
14719            state.serialize_entry("mapping", &self.mapping)?;
14720        }
14721        if !wkt::internal::is_default(&self.sample_rate_hertz) {
14722            struct __With<'a>(&'a i32);
14723            impl<'a> serde::ser::Serialize for __With<'a> {
14724                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14725                where
14726                    S: serde::ser::Serializer,
14727                {
14728                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
14729                }
14730            }
14731            state.serialize_entry("sampleRateHertz", &__With(&self.sample_rate_hertz))?;
14732        }
14733        if !self.language_code.is_empty() {
14734            state.serialize_entry("languageCode", &self.language_code)?;
14735        }
14736        if !self.display_name.is_empty() {
14737            state.serialize_entry("displayName", &self.display_name)?;
14738        }
14739        if !self._unknown_fields.is_empty() {
14740            for (key, value) in self._unknown_fields.iter() {
14741                state.serialize_entry(key, &value)?;
14742            }
14743        }
14744        state.end()
14745    }
14746}
14747
14748impl std::fmt::Debug for AudioStream {
14749    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14750        let mut debug_struct = f.debug_struct("AudioStream");
14751        debug_struct.field("codec", &self.codec);
14752        debug_struct.field("bitrate_bps", &self.bitrate_bps);
14753        debug_struct.field("channel_count", &self.channel_count);
14754        debug_struct.field("channel_layout", &self.channel_layout);
14755        debug_struct.field("mapping", &self.mapping);
14756        debug_struct.field("sample_rate_hertz", &self.sample_rate_hertz);
14757        debug_struct.field("language_code", &self.language_code);
14758        debug_struct.field("display_name", &self.display_name);
14759        if !self._unknown_fields.is_empty() {
14760            debug_struct.field("_unknown_fields", &self._unknown_fields);
14761        }
14762        debug_struct.finish()
14763    }
14764}
14765
14766/// Defines additional types related to [AudioStream].
14767pub mod audio_stream {
14768    #[allow(unused_imports)]
14769    use super::*;
14770
14771    /// The mapping for the
14772    /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list]
14773    /// atoms with audio
14774    /// [EditAtom.inputs][google.cloud.video.transcoder.v1.EditAtom.inputs].
14775    ///
14776    /// [google.cloud.video.transcoder.v1.EditAtom.inputs]: crate::model::EditAtom::inputs
14777    /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
14778    #[derive(Clone, Default, PartialEq)]
14779    #[non_exhaustive]
14780    pub struct AudioMapping {
14781        /// Required. The
14782        /// [EditAtom.key][google.cloud.video.transcoder.v1.EditAtom.key] that
14783        /// references the atom with audio inputs in the
14784        /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list].
14785        ///
14786        /// [google.cloud.video.transcoder.v1.EditAtom.key]: crate::model::EditAtom::key
14787        /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
14788        pub atom_key: std::string::String,
14789
14790        /// Required. The [Input.key][google.cloud.video.transcoder.v1.Input.key]
14791        /// that identifies the input file.
14792        ///
14793        /// [google.cloud.video.transcoder.v1.Input.key]: crate::model::Input::key
14794        pub input_key: std::string::String,
14795
14796        /// Required. The zero-based index of the track in the input file.
14797        pub input_track: i32,
14798
14799        /// Required. The zero-based index of the channel in the input audio stream.
14800        pub input_channel: i32,
14801
14802        /// Required. The zero-based index of the channel in the output audio stream.
14803        pub output_channel: i32,
14804
14805        /// Audio volume control in dB. Negative values decrease volume,
14806        /// positive values increase. The default is 0.
14807        pub gain_db: f64,
14808
14809        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14810    }
14811
14812    impl AudioMapping {
14813        pub fn new() -> Self {
14814            std::default::Default::default()
14815        }
14816
14817        /// Sets the value of [atom_key][crate::model::audio_stream::AudioMapping::atom_key].
14818        pub fn set_atom_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14819            self.atom_key = v.into();
14820            self
14821        }
14822
14823        /// Sets the value of [input_key][crate::model::audio_stream::AudioMapping::input_key].
14824        pub fn set_input_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14825            self.input_key = v.into();
14826            self
14827        }
14828
14829        /// Sets the value of [input_track][crate::model::audio_stream::AudioMapping::input_track].
14830        pub fn set_input_track<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14831            self.input_track = v.into();
14832            self
14833        }
14834
14835        /// Sets the value of [input_channel][crate::model::audio_stream::AudioMapping::input_channel].
14836        pub fn set_input_channel<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14837            self.input_channel = v.into();
14838            self
14839        }
14840
14841        /// Sets the value of [output_channel][crate::model::audio_stream::AudioMapping::output_channel].
14842        pub fn set_output_channel<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14843            self.output_channel = v.into();
14844            self
14845        }
14846
14847        /// Sets the value of [gain_db][crate::model::audio_stream::AudioMapping::gain_db].
14848        pub fn set_gain_db<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
14849            self.gain_db = v.into();
14850            self
14851        }
14852    }
14853
14854    impl wkt::message::Message for AudioMapping {
14855        fn typename() -> &'static str {
14856            "type.googleapis.com/google.cloud.video.transcoder.v1.AudioStream.AudioMapping"
14857        }
14858    }
14859
14860    #[doc(hidden)]
14861    impl<'de> serde::de::Deserialize<'de> for AudioMapping {
14862        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14863        where
14864            D: serde::Deserializer<'de>,
14865        {
14866            #[allow(non_camel_case_types)]
14867            #[doc(hidden)]
14868            #[derive(PartialEq, Eq, Hash)]
14869            enum __FieldTag {
14870                __atom_key,
14871                __input_key,
14872                __input_track,
14873                __input_channel,
14874                __output_channel,
14875                __gain_db,
14876                Unknown(std::string::String),
14877            }
14878            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
14879                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14880                where
14881                    D: serde::Deserializer<'de>,
14882                {
14883                    struct Visitor;
14884                    impl<'de> serde::de::Visitor<'de> for Visitor {
14885                        type Value = __FieldTag;
14886                        fn expecting(
14887                            &self,
14888                            formatter: &mut std::fmt::Formatter,
14889                        ) -> std::fmt::Result {
14890                            formatter.write_str("a field name for AudioMapping")
14891                        }
14892                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
14893                        where
14894                            E: serde::de::Error,
14895                        {
14896                            use std::result::Result::Ok;
14897                            use std::string::ToString;
14898                            match value {
14899                                "atomKey" => Ok(__FieldTag::__atom_key),
14900                                "atom_key" => Ok(__FieldTag::__atom_key),
14901                                "inputKey" => Ok(__FieldTag::__input_key),
14902                                "input_key" => Ok(__FieldTag::__input_key),
14903                                "inputTrack" => Ok(__FieldTag::__input_track),
14904                                "input_track" => Ok(__FieldTag::__input_track),
14905                                "inputChannel" => Ok(__FieldTag::__input_channel),
14906                                "input_channel" => Ok(__FieldTag::__input_channel),
14907                                "outputChannel" => Ok(__FieldTag::__output_channel),
14908                                "output_channel" => Ok(__FieldTag::__output_channel),
14909                                "gainDb" => Ok(__FieldTag::__gain_db),
14910                                "gain_db" => Ok(__FieldTag::__gain_db),
14911                                _ => Ok(__FieldTag::Unknown(value.to_string())),
14912                            }
14913                        }
14914                    }
14915                    deserializer.deserialize_identifier(Visitor)
14916                }
14917            }
14918            struct Visitor;
14919            impl<'de> serde::de::Visitor<'de> for Visitor {
14920                type Value = AudioMapping;
14921                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14922                    formatter.write_str("struct AudioMapping")
14923                }
14924                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
14925                where
14926                    A: serde::de::MapAccess<'de>,
14927                {
14928                    #[allow(unused_imports)]
14929                    use serde::de::Error;
14930                    use std::option::Option::Some;
14931                    let mut fields = std::collections::HashSet::new();
14932                    let mut result = Self::Value::new();
14933                    while let Some(tag) = map.next_key::<__FieldTag>()? {
14934                        #[allow(clippy::match_single_binding)]
14935                        match tag {
14936                            __FieldTag::__atom_key => {
14937                                if !fields.insert(__FieldTag::__atom_key) {
14938                                    return std::result::Result::Err(A::Error::duplicate_field(
14939                                        "multiple values for atom_key",
14940                                    ));
14941                                }
14942                                result.atom_key = map
14943                                    .next_value::<std::option::Option<std::string::String>>()?
14944                                    .unwrap_or_default();
14945                            }
14946                            __FieldTag::__input_key => {
14947                                if !fields.insert(__FieldTag::__input_key) {
14948                                    return std::result::Result::Err(A::Error::duplicate_field(
14949                                        "multiple values for input_key",
14950                                    ));
14951                                }
14952                                result.input_key = map
14953                                    .next_value::<std::option::Option<std::string::String>>()?
14954                                    .unwrap_or_default();
14955                            }
14956                            __FieldTag::__input_track => {
14957                                if !fields.insert(__FieldTag::__input_track) {
14958                                    return std::result::Result::Err(A::Error::duplicate_field(
14959                                        "multiple values for input_track",
14960                                    ));
14961                                }
14962                                struct __With(std::option::Option<i32>);
14963                                impl<'de> serde::de::Deserialize<'de> for __With {
14964                                    fn deserialize<D>(
14965                                        deserializer: D,
14966                                    ) -> std::result::Result<Self, D::Error>
14967                                    where
14968                                        D: serde::de::Deserializer<'de>,
14969                                    {
14970                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
14971                                    }
14972                                }
14973                                result.input_track =
14974                                    map.next_value::<__With>()?.0.unwrap_or_default();
14975                            }
14976                            __FieldTag::__input_channel => {
14977                                if !fields.insert(__FieldTag::__input_channel) {
14978                                    return std::result::Result::Err(A::Error::duplicate_field(
14979                                        "multiple values for input_channel",
14980                                    ));
14981                                }
14982                                struct __With(std::option::Option<i32>);
14983                                impl<'de> serde::de::Deserialize<'de> for __With {
14984                                    fn deserialize<D>(
14985                                        deserializer: D,
14986                                    ) -> std::result::Result<Self, D::Error>
14987                                    where
14988                                        D: serde::de::Deserializer<'de>,
14989                                    {
14990                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
14991                                    }
14992                                }
14993                                result.input_channel =
14994                                    map.next_value::<__With>()?.0.unwrap_or_default();
14995                            }
14996                            __FieldTag::__output_channel => {
14997                                if !fields.insert(__FieldTag::__output_channel) {
14998                                    return std::result::Result::Err(A::Error::duplicate_field(
14999                                        "multiple values for output_channel",
15000                                    ));
15001                                }
15002                                struct __With(std::option::Option<i32>);
15003                                impl<'de> serde::de::Deserialize<'de> for __With {
15004                                    fn deserialize<D>(
15005                                        deserializer: D,
15006                                    ) -> std::result::Result<Self, D::Error>
15007                                    where
15008                                        D: serde::de::Deserializer<'de>,
15009                                    {
15010                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
15011                                    }
15012                                }
15013                                result.output_channel =
15014                                    map.next_value::<__With>()?.0.unwrap_or_default();
15015                            }
15016                            __FieldTag::__gain_db => {
15017                                if !fields.insert(__FieldTag::__gain_db) {
15018                                    return std::result::Result::Err(A::Error::duplicate_field(
15019                                        "multiple values for gain_db",
15020                                    ));
15021                                }
15022                                struct __With(std::option::Option<f64>);
15023                                impl<'de> serde::de::Deserialize<'de> for __With {
15024                                    fn deserialize<D>(
15025                                        deserializer: D,
15026                                    ) -> std::result::Result<Self, D::Error>
15027                                    where
15028                                        D: serde::de::Deserializer<'de>,
15029                                    {
15030                                        serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
15031                                    }
15032                                }
15033                                result.gain_db = map.next_value::<__With>()?.0.unwrap_or_default();
15034                            }
15035                            __FieldTag::Unknown(key) => {
15036                                let value = map.next_value::<serde_json::Value>()?;
15037                                result._unknown_fields.insert(key, value);
15038                            }
15039                        }
15040                    }
15041                    std::result::Result::Ok(result)
15042                }
15043            }
15044            deserializer.deserialize_any(Visitor)
15045        }
15046    }
15047
15048    #[doc(hidden)]
15049    impl serde::ser::Serialize for AudioMapping {
15050        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15051        where
15052            S: serde::ser::Serializer,
15053        {
15054            use serde::ser::SerializeMap;
15055            #[allow(unused_imports)]
15056            use std::option::Option::Some;
15057            let mut state = serializer.serialize_map(std::option::Option::None)?;
15058            if !self.atom_key.is_empty() {
15059                state.serialize_entry("atomKey", &self.atom_key)?;
15060            }
15061            if !self.input_key.is_empty() {
15062                state.serialize_entry("inputKey", &self.input_key)?;
15063            }
15064            if !wkt::internal::is_default(&self.input_track) {
15065                struct __With<'a>(&'a i32);
15066                impl<'a> serde::ser::Serialize for __With<'a> {
15067                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15068                    where
15069                        S: serde::ser::Serializer,
15070                    {
15071                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
15072                    }
15073                }
15074                state.serialize_entry("inputTrack", &__With(&self.input_track))?;
15075            }
15076            if !wkt::internal::is_default(&self.input_channel) {
15077                struct __With<'a>(&'a i32);
15078                impl<'a> serde::ser::Serialize for __With<'a> {
15079                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15080                    where
15081                        S: serde::ser::Serializer,
15082                    {
15083                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
15084                    }
15085                }
15086                state.serialize_entry("inputChannel", &__With(&self.input_channel))?;
15087            }
15088            if !wkt::internal::is_default(&self.output_channel) {
15089                struct __With<'a>(&'a i32);
15090                impl<'a> serde::ser::Serialize for __With<'a> {
15091                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15092                    where
15093                        S: serde::ser::Serializer,
15094                    {
15095                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
15096                    }
15097                }
15098                state.serialize_entry("outputChannel", &__With(&self.output_channel))?;
15099            }
15100            if !wkt::internal::is_default(&self.gain_db) {
15101                struct __With<'a>(&'a f64);
15102                impl<'a> serde::ser::Serialize for __With<'a> {
15103                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15104                    where
15105                        S: serde::ser::Serializer,
15106                    {
15107                        serde_with::As::<wkt::internal::F64>::serialize(self.0, serializer)
15108                    }
15109                }
15110                state.serialize_entry("gainDb", &__With(&self.gain_db))?;
15111            }
15112            if !self._unknown_fields.is_empty() {
15113                for (key, value) in self._unknown_fields.iter() {
15114                    state.serialize_entry(key, &value)?;
15115                }
15116            }
15117            state.end()
15118        }
15119    }
15120
15121    impl std::fmt::Debug for AudioMapping {
15122        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15123            let mut debug_struct = f.debug_struct("AudioMapping");
15124            debug_struct.field("atom_key", &self.atom_key);
15125            debug_struct.field("input_key", &self.input_key);
15126            debug_struct.field("input_track", &self.input_track);
15127            debug_struct.field("input_channel", &self.input_channel);
15128            debug_struct.field("output_channel", &self.output_channel);
15129            debug_struct.field("gain_db", &self.gain_db);
15130            if !self._unknown_fields.is_empty() {
15131                debug_struct.field("_unknown_fields", &self._unknown_fields);
15132            }
15133            debug_struct.finish()
15134        }
15135    }
15136}
15137
15138/// Encoding of a text stream. For example, closed captions or subtitles.
15139#[derive(Clone, Default, PartialEq)]
15140#[non_exhaustive]
15141pub struct TextStream {
15142    /// The codec for this text stream. The default is `webvtt`.
15143    ///
15144    /// Supported text codecs:
15145    ///
15146    /// - `srt`
15147    /// - `ttml`
15148    /// - `cea608`
15149    /// - `cea708`
15150    /// - `webvtt`
15151    pub codec: std::string::String,
15152
15153    /// The BCP-47 language code, such as `en-US` or `sr-Latn`. For more
15154    /// information, see
15155    /// <https://www.unicode.org/reports/tr35/#Unicode_locale_identifier>. Not
15156    /// supported in MP4 files.
15157    pub language_code: std::string::String,
15158
15159    /// The mapping for the
15160    /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list]
15161    /// atoms with text
15162    /// [EditAtom.inputs][google.cloud.video.transcoder.v1.EditAtom.inputs].
15163    ///
15164    /// [google.cloud.video.transcoder.v1.EditAtom.inputs]: crate::model::EditAtom::inputs
15165    /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
15166    pub mapping: std::vec::Vec<crate::model::text_stream::TextMapping>,
15167
15168    /// The name for this particular text stream that
15169    /// will be added to the HLS/DASH manifest. Not supported in MP4 files.
15170    pub display_name: std::string::String,
15171
15172    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15173}
15174
15175impl TextStream {
15176    pub fn new() -> Self {
15177        std::default::Default::default()
15178    }
15179
15180    /// Sets the value of [codec][crate::model::TextStream::codec].
15181    pub fn set_codec<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15182        self.codec = v.into();
15183        self
15184    }
15185
15186    /// Sets the value of [language_code][crate::model::TextStream::language_code].
15187    pub fn set_language_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15188        self.language_code = v.into();
15189        self
15190    }
15191
15192    /// Sets the value of [mapping][crate::model::TextStream::mapping].
15193    pub fn set_mapping<T, V>(mut self, v: T) -> Self
15194    where
15195        T: std::iter::IntoIterator<Item = V>,
15196        V: std::convert::Into<crate::model::text_stream::TextMapping>,
15197    {
15198        use std::iter::Iterator;
15199        self.mapping = v.into_iter().map(|i| i.into()).collect();
15200        self
15201    }
15202
15203    /// Sets the value of [display_name][crate::model::TextStream::display_name].
15204    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15205        self.display_name = v.into();
15206        self
15207    }
15208}
15209
15210impl wkt::message::Message for TextStream {
15211    fn typename() -> &'static str {
15212        "type.googleapis.com/google.cloud.video.transcoder.v1.TextStream"
15213    }
15214}
15215
15216#[doc(hidden)]
15217impl<'de> serde::de::Deserialize<'de> for TextStream {
15218    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15219    where
15220        D: serde::Deserializer<'de>,
15221    {
15222        #[allow(non_camel_case_types)]
15223        #[doc(hidden)]
15224        #[derive(PartialEq, Eq, Hash)]
15225        enum __FieldTag {
15226            __codec,
15227            __language_code,
15228            __mapping,
15229            __display_name,
15230            Unknown(std::string::String),
15231        }
15232        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
15233            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15234            where
15235                D: serde::Deserializer<'de>,
15236            {
15237                struct Visitor;
15238                impl<'de> serde::de::Visitor<'de> for Visitor {
15239                    type Value = __FieldTag;
15240                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15241                        formatter.write_str("a field name for TextStream")
15242                    }
15243                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
15244                    where
15245                        E: serde::de::Error,
15246                    {
15247                        use std::result::Result::Ok;
15248                        use std::string::ToString;
15249                        match value {
15250                            "codec" => Ok(__FieldTag::__codec),
15251                            "languageCode" => Ok(__FieldTag::__language_code),
15252                            "language_code" => Ok(__FieldTag::__language_code),
15253                            "mapping" => Ok(__FieldTag::__mapping),
15254                            "displayName" => Ok(__FieldTag::__display_name),
15255                            "display_name" => Ok(__FieldTag::__display_name),
15256                            _ => Ok(__FieldTag::Unknown(value.to_string())),
15257                        }
15258                    }
15259                }
15260                deserializer.deserialize_identifier(Visitor)
15261            }
15262        }
15263        struct Visitor;
15264        impl<'de> serde::de::Visitor<'de> for Visitor {
15265            type Value = TextStream;
15266            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15267                formatter.write_str("struct TextStream")
15268            }
15269            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
15270            where
15271                A: serde::de::MapAccess<'de>,
15272            {
15273                #[allow(unused_imports)]
15274                use serde::de::Error;
15275                use std::option::Option::Some;
15276                let mut fields = std::collections::HashSet::new();
15277                let mut result = Self::Value::new();
15278                while let Some(tag) = map.next_key::<__FieldTag>()? {
15279                    #[allow(clippy::match_single_binding)]
15280                    match tag {
15281                        __FieldTag::__codec => {
15282                            if !fields.insert(__FieldTag::__codec) {
15283                                return std::result::Result::Err(A::Error::duplicate_field(
15284                                    "multiple values for codec",
15285                                ));
15286                            }
15287                            result.codec = map
15288                                .next_value::<std::option::Option<std::string::String>>()?
15289                                .unwrap_or_default();
15290                        }
15291                        __FieldTag::__language_code => {
15292                            if !fields.insert(__FieldTag::__language_code) {
15293                                return std::result::Result::Err(A::Error::duplicate_field(
15294                                    "multiple values for language_code",
15295                                ));
15296                            }
15297                            result.language_code = map
15298                                .next_value::<std::option::Option<std::string::String>>()?
15299                                .unwrap_or_default();
15300                        }
15301                        __FieldTag::__mapping => {
15302                            if !fields.insert(__FieldTag::__mapping) {
15303                                return std::result::Result::Err(A::Error::duplicate_field(
15304                                    "multiple values for mapping",
15305                                ));
15306                            }
15307                            result.mapping = map
15308                                .next_value::<std::option::Option<
15309                                    std::vec::Vec<crate::model::text_stream::TextMapping>,
15310                                >>()?
15311                                .unwrap_or_default();
15312                        }
15313                        __FieldTag::__display_name => {
15314                            if !fields.insert(__FieldTag::__display_name) {
15315                                return std::result::Result::Err(A::Error::duplicate_field(
15316                                    "multiple values for display_name",
15317                                ));
15318                            }
15319                            result.display_name = map
15320                                .next_value::<std::option::Option<std::string::String>>()?
15321                                .unwrap_or_default();
15322                        }
15323                        __FieldTag::Unknown(key) => {
15324                            let value = map.next_value::<serde_json::Value>()?;
15325                            result._unknown_fields.insert(key, value);
15326                        }
15327                    }
15328                }
15329                std::result::Result::Ok(result)
15330            }
15331        }
15332        deserializer.deserialize_any(Visitor)
15333    }
15334}
15335
15336#[doc(hidden)]
15337impl serde::ser::Serialize for TextStream {
15338    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15339    where
15340        S: serde::ser::Serializer,
15341    {
15342        use serde::ser::SerializeMap;
15343        #[allow(unused_imports)]
15344        use std::option::Option::Some;
15345        let mut state = serializer.serialize_map(std::option::Option::None)?;
15346        if !self.codec.is_empty() {
15347            state.serialize_entry("codec", &self.codec)?;
15348        }
15349        if !self.language_code.is_empty() {
15350            state.serialize_entry("languageCode", &self.language_code)?;
15351        }
15352        if !self.mapping.is_empty() {
15353            state.serialize_entry("mapping", &self.mapping)?;
15354        }
15355        if !self.display_name.is_empty() {
15356            state.serialize_entry("displayName", &self.display_name)?;
15357        }
15358        if !self._unknown_fields.is_empty() {
15359            for (key, value) in self._unknown_fields.iter() {
15360                state.serialize_entry(key, &value)?;
15361            }
15362        }
15363        state.end()
15364    }
15365}
15366
15367impl std::fmt::Debug for TextStream {
15368    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15369        let mut debug_struct = f.debug_struct("TextStream");
15370        debug_struct.field("codec", &self.codec);
15371        debug_struct.field("language_code", &self.language_code);
15372        debug_struct.field("mapping", &self.mapping);
15373        debug_struct.field("display_name", &self.display_name);
15374        if !self._unknown_fields.is_empty() {
15375            debug_struct.field("_unknown_fields", &self._unknown_fields);
15376        }
15377        debug_struct.finish()
15378    }
15379}
15380
15381/// Defines additional types related to [TextStream].
15382pub mod text_stream {
15383    #[allow(unused_imports)]
15384    use super::*;
15385
15386    /// The mapping for the
15387    /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list]
15388    /// atoms with text
15389    /// [EditAtom.inputs][google.cloud.video.transcoder.v1.EditAtom.inputs].
15390    ///
15391    /// [google.cloud.video.transcoder.v1.EditAtom.inputs]: crate::model::EditAtom::inputs
15392    /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
15393    #[derive(Clone, Default, PartialEq)]
15394    #[non_exhaustive]
15395    pub struct TextMapping {
15396        /// Required. The
15397        /// [EditAtom.key][google.cloud.video.transcoder.v1.EditAtom.key] that
15398        /// references atom with text inputs in the
15399        /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list].
15400        ///
15401        /// [google.cloud.video.transcoder.v1.EditAtom.key]: crate::model::EditAtom::key
15402        /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
15403        pub atom_key: std::string::String,
15404
15405        /// Required. The [Input.key][google.cloud.video.transcoder.v1.Input.key]
15406        /// that identifies the input file.
15407        ///
15408        /// [google.cloud.video.transcoder.v1.Input.key]: crate::model::Input::key
15409        pub input_key: std::string::String,
15410
15411        /// Required. The zero-based index of the track in the input file.
15412        pub input_track: i32,
15413
15414        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15415    }
15416
15417    impl TextMapping {
15418        pub fn new() -> Self {
15419            std::default::Default::default()
15420        }
15421
15422        /// Sets the value of [atom_key][crate::model::text_stream::TextMapping::atom_key].
15423        pub fn set_atom_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15424            self.atom_key = v.into();
15425            self
15426        }
15427
15428        /// Sets the value of [input_key][crate::model::text_stream::TextMapping::input_key].
15429        pub fn set_input_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15430            self.input_key = v.into();
15431            self
15432        }
15433
15434        /// Sets the value of [input_track][crate::model::text_stream::TextMapping::input_track].
15435        pub fn set_input_track<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15436            self.input_track = v.into();
15437            self
15438        }
15439    }
15440
15441    impl wkt::message::Message for TextMapping {
15442        fn typename() -> &'static str {
15443            "type.googleapis.com/google.cloud.video.transcoder.v1.TextStream.TextMapping"
15444        }
15445    }
15446
15447    #[doc(hidden)]
15448    impl<'de> serde::de::Deserialize<'de> for TextMapping {
15449        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15450        where
15451            D: serde::Deserializer<'de>,
15452        {
15453            #[allow(non_camel_case_types)]
15454            #[doc(hidden)]
15455            #[derive(PartialEq, Eq, Hash)]
15456            enum __FieldTag {
15457                __atom_key,
15458                __input_key,
15459                __input_track,
15460                Unknown(std::string::String),
15461            }
15462            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
15463                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15464                where
15465                    D: serde::Deserializer<'de>,
15466                {
15467                    struct Visitor;
15468                    impl<'de> serde::de::Visitor<'de> for Visitor {
15469                        type Value = __FieldTag;
15470                        fn expecting(
15471                            &self,
15472                            formatter: &mut std::fmt::Formatter,
15473                        ) -> std::fmt::Result {
15474                            formatter.write_str("a field name for TextMapping")
15475                        }
15476                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
15477                        where
15478                            E: serde::de::Error,
15479                        {
15480                            use std::result::Result::Ok;
15481                            use std::string::ToString;
15482                            match value {
15483                                "atomKey" => Ok(__FieldTag::__atom_key),
15484                                "atom_key" => Ok(__FieldTag::__atom_key),
15485                                "inputKey" => Ok(__FieldTag::__input_key),
15486                                "input_key" => Ok(__FieldTag::__input_key),
15487                                "inputTrack" => Ok(__FieldTag::__input_track),
15488                                "input_track" => Ok(__FieldTag::__input_track),
15489                                _ => Ok(__FieldTag::Unknown(value.to_string())),
15490                            }
15491                        }
15492                    }
15493                    deserializer.deserialize_identifier(Visitor)
15494                }
15495            }
15496            struct Visitor;
15497            impl<'de> serde::de::Visitor<'de> for Visitor {
15498                type Value = TextMapping;
15499                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15500                    formatter.write_str("struct TextMapping")
15501                }
15502                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
15503                where
15504                    A: serde::de::MapAccess<'de>,
15505                {
15506                    #[allow(unused_imports)]
15507                    use serde::de::Error;
15508                    use std::option::Option::Some;
15509                    let mut fields = std::collections::HashSet::new();
15510                    let mut result = Self::Value::new();
15511                    while let Some(tag) = map.next_key::<__FieldTag>()? {
15512                        #[allow(clippy::match_single_binding)]
15513                        match tag {
15514                            __FieldTag::__atom_key => {
15515                                if !fields.insert(__FieldTag::__atom_key) {
15516                                    return std::result::Result::Err(A::Error::duplicate_field(
15517                                        "multiple values for atom_key",
15518                                    ));
15519                                }
15520                                result.atom_key = map
15521                                    .next_value::<std::option::Option<std::string::String>>()?
15522                                    .unwrap_or_default();
15523                            }
15524                            __FieldTag::__input_key => {
15525                                if !fields.insert(__FieldTag::__input_key) {
15526                                    return std::result::Result::Err(A::Error::duplicate_field(
15527                                        "multiple values for input_key",
15528                                    ));
15529                                }
15530                                result.input_key = map
15531                                    .next_value::<std::option::Option<std::string::String>>()?
15532                                    .unwrap_or_default();
15533                            }
15534                            __FieldTag::__input_track => {
15535                                if !fields.insert(__FieldTag::__input_track) {
15536                                    return std::result::Result::Err(A::Error::duplicate_field(
15537                                        "multiple values for input_track",
15538                                    ));
15539                                }
15540                                struct __With(std::option::Option<i32>);
15541                                impl<'de> serde::de::Deserialize<'de> for __With {
15542                                    fn deserialize<D>(
15543                                        deserializer: D,
15544                                    ) -> std::result::Result<Self, D::Error>
15545                                    where
15546                                        D: serde::de::Deserializer<'de>,
15547                                    {
15548                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
15549                                    }
15550                                }
15551                                result.input_track =
15552                                    map.next_value::<__With>()?.0.unwrap_or_default();
15553                            }
15554                            __FieldTag::Unknown(key) => {
15555                                let value = map.next_value::<serde_json::Value>()?;
15556                                result._unknown_fields.insert(key, value);
15557                            }
15558                        }
15559                    }
15560                    std::result::Result::Ok(result)
15561                }
15562            }
15563            deserializer.deserialize_any(Visitor)
15564        }
15565    }
15566
15567    #[doc(hidden)]
15568    impl serde::ser::Serialize for TextMapping {
15569        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15570        where
15571            S: serde::ser::Serializer,
15572        {
15573            use serde::ser::SerializeMap;
15574            #[allow(unused_imports)]
15575            use std::option::Option::Some;
15576            let mut state = serializer.serialize_map(std::option::Option::None)?;
15577            if !self.atom_key.is_empty() {
15578                state.serialize_entry("atomKey", &self.atom_key)?;
15579            }
15580            if !self.input_key.is_empty() {
15581                state.serialize_entry("inputKey", &self.input_key)?;
15582            }
15583            if !wkt::internal::is_default(&self.input_track) {
15584                struct __With<'a>(&'a i32);
15585                impl<'a> serde::ser::Serialize for __With<'a> {
15586                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15587                    where
15588                        S: serde::ser::Serializer,
15589                    {
15590                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
15591                    }
15592                }
15593                state.serialize_entry("inputTrack", &__With(&self.input_track))?;
15594            }
15595            if !self._unknown_fields.is_empty() {
15596                for (key, value) in self._unknown_fields.iter() {
15597                    state.serialize_entry(key, &value)?;
15598                }
15599            }
15600            state.end()
15601        }
15602    }
15603
15604    impl std::fmt::Debug for TextMapping {
15605        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15606            let mut debug_struct = f.debug_struct("TextMapping");
15607            debug_struct.field("atom_key", &self.atom_key);
15608            debug_struct.field("input_key", &self.input_key);
15609            debug_struct.field("input_track", &self.input_track);
15610            if !self._unknown_fields.is_empty() {
15611                debug_struct.field("_unknown_fields", &self._unknown_fields);
15612            }
15613            debug_struct.finish()
15614        }
15615    }
15616}
15617
15618/// Segment settings for `ts`, `fmp4` and `vtt`.
15619#[derive(Clone, Default, PartialEq)]
15620#[non_exhaustive]
15621pub struct SegmentSettings {
15622    /// Duration of the segments in seconds. The default is `6.0s`. Note that
15623    /// `segmentDuration` must be greater than or equal to
15624    /// [`gopDuration`](#videostream), and `segmentDuration` must be divisible by
15625    /// [`gopDuration`](#videostream).
15626    pub segment_duration: std::option::Option<wkt::Duration>,
15627
15628    /// Required. Create an individual segment file. The default is `false`.
15629    pub individual_segments: bool,
15630
15631    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15632}
15633
15634impl SegmentSettings {
15635    pub fn new() -> Self {
15636        std::default::Default::default()
15637    }
15638
15639    /// Sets the value of [segment_duration][crate::model::SegmentSettings::segment_duration].
15640    pub fn set_segment_duration<T>(mut self, v: T) -> Self
15641    where
15642        T: std::convert::Into<wkt::Duration>,
15643    {
15644        self.segment_duration = std::option::Option::Some(v.into());
15645        self
15646    }
15647
15648    /// Sets or clears the value of [segment_duration][crate::model::SegmentSettings::segment_duration].
15649    pub fn set_or_clear_segment_duration<T>(mut self, v: std::option::Option<T>) -> Self
15650    where
15651        T: std::convert::Into<wkt::Duration>,
15652    {
15653        self.segment_duration = v.map(|x| x.into());
15654        self
15655    }
15656
15657    /// Sets the value of [individual_segments][crate::model::SegmentSettings::individual_segments].
15658    pub fn set_individual_segments<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15659        self.individual_segments = v.into();
15660        self
15661    }
15662}
15663
15664impl wkt::message::Message for SegmentSettings {
15665    fn typename() -> &'static str {
15666        "type.googleapis.com/google.cloud.video.transcoder.v1.SegmentSettings"
15667    }
15668}
15669
15670#[doc(hidden)]
15671impl<'de> serde::de::Deserialize<'de> for SegmentSettings {
15672    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15673    where
15674        D: serde::Deserializer<'de>,
15675    {
15676        #[allow(non_camel_case_types)]
15677        #[doc(hidden)]
15678        #[derive(PartialEq, Eq, Hash)]
15679        enum __FieldTag {
15680            __segment_duration,
15681            __individual_segments,
15682            Unknown(std::string::String),
15683        }
15684        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
15685            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15686            where
15687                D: serde::Deserializer<'de>,
15688            {
15689                struct Visitor;
15690                impl<'de> serde::de::Visitor<'de> for Visitor {
15691                    type Value = __FieldTag;
15692                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15693                        formatter.write_str("a field name for SegmentSettings")
15694                    }
15695                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
15696                    where
15697                        E: serde::de::Error,
15698                    {
15699                        use std::result::Result::Ok;
15700                        use std::string::ToString;
15701                        match value {
15702                            "segmentDuration" => Ok(__FieldTag::__segment_duration),
15703                            "segment_duration" => Ok(__FieldTag::__segment_duration),
15704                            "individualSegments" => Ok(__FieldTag::__individual_segments),
15705                            "individual_segments" => Ok(__FieldTag::__individual_segments),
15706                            _ => Ok(__FieldTag::Unknown(value.to_string())),
15707                        }
15708                    }
15709                }
15710                deserializer.deserialize_identifier(Visitor)
15711            }
15712        }
15713        struct Visitor;
15714        impl<'de> serde::de::Visitor<'de> for Visitor {
15715            type Value = SegmentSettings;
15716            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15717                formatter.write_str("struct SegmentSettings")
15718            }
15719            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
15720            where
15721                A: serde::de::MapAccess<'de>,
15722            {
15723                #[allow(unused_imports)]
15724                use serde::de::Error;
15725                use std::option::Option::Some;
15726                let mut fields = std::collections::HashSet::new();
15727                let mut result = Self::Value::new();
15728                while let Some(tag) = map.next_key::<__FieldTag>()? {
15729                    #[allow(clippy::match_single_binding)]
15730                    match tag {
15731                        __FieldTag::__segment_duration => {
15732                            if !fields.insert(__FieldTag::__segment_duration) {
15733                                return std::result::Result::Err(A::Error::duplicate_field(
15734                                    "multiple values for segment_duration",
15735                                ));
15736                            }
15737                            result.segment_duration =
15738                                map.next_value::<std::option::Option<wkt::Duration>>()?;
15739                        }
15740                        __FieldTag::__individual_segments => {
15741                            if !fields.insert(__FieldTag::__individual_segments) {
15742                                return std::result::Result::Err(A::Error::duplicate_field(
15743                                    "multiple values for individual_segments",
15744                                ));
15745                            }
15746                            result.individual_segments = map
15747                                .next_value::<std::option::Option<bool>>()?
15748                                .unwrap_or_default();
15749                        }
15750                        __FieldTag::Unknown(key) => {
15751                            let value = map.next_value::<serde_json::Value>()?;
15752                            result._unknown_fields.insert(key, value);
15753                        }
15754                    }
15755                }
15756                std::result::Result::Ok(result)
15757            }
15758        }
15759        deserializer.deserialize_any(Visitor)
15760    }
15761}
15762
15763#[doc(hidden)]
15764impl serde::ser::Serialize for SegmentSettings {
15765    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15766    where
15767        S: serde::ser::Serializer,
15768    {
15769        use serde::ser::SerializeMap;
15770        #[allow(unused_imports)]
15771        use std::option::Option::Some;
15772        let mut state = serializer.serialize_map(std::option::Option::None)?;
15773        if self.segment_duration.is_some() {
15774            state.serialize_entry("segmentDuration", &self.segment_duration)?;
15775        }
15776        if !wkt::internal::is_default(&self.individual_segments) {
15777            state.serialize_entry("individualSegments", &self.individual_segments)?;
15778        }
15779        if !self._unknown_fields.is_empty() {
15780            for (key, value) in self._unknown_fields.iter() {
15781                state.serialize_entry(key, &value)?;
15782            }
15783        }
15784        state.end()
15785    }
15786}
15787
15788impl std::fmt::Debug for SegmentSettings {
15789    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15790        let mut debug_struct = f.debug_struct("SegmentSettings");
15791        debug_struct.field("segment_duration", &self.segment_duration);
15792        debug_struct.field("individual_segments", &self.individual_segments);
15793        if !self._unknown_fields.is_empty() {
15794            debug_struct.field("_unknown_fields", &self._unknown_fields);
15795        }
15796        debug_struct.finish()
15797    }
15798}
15799
15800/// Encryption settings.
15801#[derive(Clone, Default, PartialEq)]
15802#[non_exhaustive]
15803pub struct Encryption {
15804    /// Required. Identifier for this set of encryption options.
15805    pub id: std::string::String,
15806
15807    /// Required. DRM system(s) to use; at least one must be specified. If a
15808    /// DRM system is omitted, it is considered disabled.
15809    pub drm_systems: std::option::Option<crate::model::encryption::DrmSystems>,
15810
15811    /// Encryption mode can be either `aes` or `cenc`.
15812    pub encryption_mode: std::option::Option<crate::model::encryption::EncryptionMode>,
15813
15814    /// Defines where content keys are stored.
15815    pub secret_source: std::option::Option<crate::model::encryption::SecretSource>,
15816
15817    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15818}
15819
15820impl Encryption {
15821    pub fn new() -> Self {
15822        std::default::Default::default()
15823    }
15824
15825    /// Sets the value of [id][crate::model::Encryption::id].
15826    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15827        self.id = v.into();
15828        self
15829    }
15830
15831    /// Sets the value of [drm_systems][crate::model::Encryption::drm_systems].
15832    pub fn set_drm_systems<T>(mut self, v: T) -> Self
15833    where
15834        T: std::convert::Into<crate::model::encryption::DrmSystems>,
15835    {
15836        self.drm_systems = std::option::Option::Some(v.into());
15837        self
15838    }
15839
15840    /// Sets or clears the value of [drm_systems][crate::model::Encryption::drm_systems].
15841    pub fn set_or_clear_drm_systems<T>(mut self, v: std::option::Option<T>) -> Self
15842    where
15843        T: std::convert::Into<crate::model::encryption::DrmSystems>,
15844    {
15845        self.drm_systems = v.map(|x| x.into());
15846        self
15847    }
15848
15849    /// Sets the value of [encryption_mode][crate::model::Encryption::encryption_mode].
15850    ///
15851    /// Note that all the setters affecting `encryption_mode` are mutually
15852    /// exclusive.
15853    pub fn set_encryption_mode<
15854        T: std::convert::Into<std::option::Option<crate::model::encryption::EncryptionMode>>,
15855    >(
15856        mut self,
15857        v: T,
15858    ) -> Self {
15859        self.encryption_mode = v.into();
15860        self
15861    }
15862
15863    /// The value of [encryption_mode][crate::model::Encryption::encryption_mode]
15864    /// if it holds a `Aes128`, `None` if the field is not set or
15865    /// holds a different branch.
15866    pub fn aes_128(
15867        &self,
15868    ) -> std::option::Option<&std::boxed::Box<crate::model::encryption::Aes128Encryption>> {
15869        #[allow(unreachable_patterns)]
15870        self.encryption_mode.as_ref().and_then(|v| match v {
15871            crate::model::encryption::EncryptionMode::Aes128(v) => std::option::Option::Some(v),
15872            _ => std::option::Option::None,
15873        })
15874    }
15875
15876    /// Sets the value of [encryption_mode][crate::model::Encryption::encryption_mode]
15877    /// to hold a `Aes128`.
15878    ///
15879    /// Note that all the setters affecting `encryption_mode` are
15880    /// mutually exclusive.
15881    pub fn set_aes_128<
15882        T: std::convert::Into<std::boxed::Box<crate::model::encryption::Aes128Encryption>>,
15883    >(
15884        mut self,
15885        v: T,
15886    ) -> Self {
15887        self.encryption_mode =
15888            std::option::Option::Some(crate::model::encryption::EncryptionMode::Aes128(v.into()));
15889        self
15890    }
15891
15892    /// The value of [encryption_mode][crate::model::Encryption::encryption_mode]
15893    /// if it holds a `SampleAes`, `None` if the field is not set or
15894    /// holds a different branch.
15895    pub fn sample_aes(
15896        &self,
15897    ) -> std::option::Option<&std::boxed::Box<crate::model::encryption::SampleAesEncryption>> {
15898        #[allow(unreachable_patterns)]
15899        self.encryption_mode.as_ref().and_then(|v| match v {
15900            crate::model::encryption::EncryptionMode::SampleAes(v) => std::option::Option::Some(v),
15901            _ => std::option::Option::None,
15902        })
15903    }
15904
15905    /// Sets the value of [encryption_mode][crate::model::Encryption::encryption_mode]
15906    /// to hold a `SampleAes`.
15907    ///
15908    /// Note that all the setters affecting `encryption_mode` are
15909    /// mutually exclusive.
15910    pub fn set_sample_aes<
15911        T: std::convert::Into<std::boxed::Box<crate::model::encryption::SampleAesEncryption>>,
15912    >(
15913        mut self,
15914        v: T,
15915    ) -> Self {
15916        self.encryption_mode = std::option::Option::Some(
15917            crate::model::encryption::EncryptionMode::SampleAes(v.into()),
15918        );
15919        self
15920    }
15921
15922    /// The value of [encryption_mode][crate::model::Encryption::encryption_mode]
15923    /// if it holds a `MpegCenc`, `None` if the field is not set or
15924    /// holds a different branch.
15925    pub fn mpeg_cenc(
15926        &self,
15927    ) -> std::option::Option<&std::boxed::Box<crate::model::encryption::MpegCommonEncryption>> {
15928        #[allow(unreachable_patterns)]
15929        self.encryption_mode.as_ref().and_then(|v| match v {
15930            crate::model::encryption::EncryptionMode::MpegCenc(v) => std::option::Option::Some(v),
15931            _ => std::option::Option::None,
15932        })
15933    }
15934
15935    /// Sets the value of [encryption_mode][crate::model::Encryption::encryption_mode]
15936    /// to hold a `MpegCenc`.
15937    ///
15938    /// Note that all the setters affecting `encryption_mode` are
15939    /// mutually exclusive.
15940    pub fn set_mpeg_cenc<
15941        T: std::convert::Into<std::boxed::Box<crate::model::encryption::MpegCommonEncryption>>,
15942    >(
15943        mut self,
15944        v: T,
15945    ) -> Self {
15946        self.encryption_mode =
15947            std::option::Option::Some(crate::model::encryption::EncryptionMode::MpegCenc(v.into()));
15948        self
15949    }
15950
15951    /// Sets the value of [secret_source][crate::model::Encryption::secret_source].
15952    ///
15953    /// Note that all the setters affecting `secret_source` are mutually
15954    /// exclusive.
15955    pub fn set_secret_source<
15956        T: std::convert::Into<std::option::Option<crate::model::encryption::SecretSource>>,
15957    >(
15958        mut self,
15959        v: T,
15960    ) -> Self {
15961        self.secret_source = v.into();
15962        self
15963    }
15964
15965    /// The value of [secret_source][crate::model::Encryption::secret_source]
15966    /// if it holds a `SecretManagerKeySource`, `None` if the field is not set or
15967    /// holds a different branch.
15968    pub fn secret_manager_key_source(
15969        &self,
15970    ) -> std::option::Option<&std::boxed::Box<crate::model::encryption::SecretManagerSource>> {
15971        #[allow(unreachable_patterns)]
15972        self.secret_source.as_ref().and_then(|v| match v {
15973            crate::model::encryption::SecretSource::SecretManagerKeySource(v) => {
15974                std::option::Option::Some(v)
15975            }
15976            _ => std::option::Option::None,
15977        })
15978    }
15979
15980    /// Sets the value of [secret_source][crate::model::Encryption::secret_source]
15981    /// to hold a `SecretManagerKeySource`.
15982    ///
15983    /// Note that all the setters affecting `secret_source` are
15984    /// mutually exclusive.
15985    pub fn set_secret_manager_key_source<
15986        T: std::convert::Into<std::boxed::Box<crate::model::encryption::SecretManagerSource>>,
15987    >(
15988        mut self,
15989        v: T,
15990    ) -> Self {
15991        self.secret_source = std::option::Option::Some(
15992            crate::model::encryption::SecretSource::SecretManagerKeySource(v.into()),
15993        );
15994        self
15995    }
15996}
15997
15998impl wkt::message::Message for Encryption {
15999    fn typename() -> &'static str {
16000        "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption"
16001    }
16002}
16003
16004#[doc(hidden)]
16005impl<'de> serde::de::Deserialize<'de> for Encryption {
16006    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16007    where
16008        D: serde::Deserializer<'de>,
16009    {
16010        #[allow(non_camel_case_types)]
16011        #[doc(hidden)]
16012        #[derive(PartialEq, Eq, Hash)]
16013        enum __FieldTag {
16014            __id,
16015            __aes_128,
16016            __sample_aes,
16017            __mpeg_cenc,
16018            __secret_manager_key_source,
16019            __drm_systems,
16020            Unknown(std::string::String),
16021        }
16022        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
16023            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16024            where
16025                D: serde::Deserializer<'de>,
16026            {
16027                struct Visitor;
16028                impl<'de> serde::de::Visitor<'de> for Visitor {
16029                    type Value = __FieldTag;
16030                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16031                        formatter.write_str("a field name for Encryption")
16032                    }
16033                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
16034                    where
16035                        E: serde::de::Error,
16036                    {
16037                        use std::result::Result::Ok;
16038                        use std::string::ToString;
16039                        match value {
16040                            "id" => Ok(__FieldTag::__id),
16041                            "aes128" => Ok(__FieldTag::__aes_128),
16042                            "aes_128" => Ok(__FieldTag::__aes_128),
16043                            "sampleAes" => Ok(__FieldTag::__sample_aes),
16044                            "sample_aes" => Ok(__FieldTag::__sample_aes),
16045                            "mpegCenc" => Ok(__FieldTag::__mpeg_cenc),
16046                            "mpeg_cenc" => Ok(__FieldTag::__mpeg_cenc),
16047                            "secretManagerKeySource" => Ok(__FieldTag::__secret_manager_key_source),
16048                            "secret_manager_key_source" => {
16049                                Ok(__FieldTag::__secret_manager_key_source)
16050                            }
16051                            "drmSystems" => Ok(__FieldTag::__drm_systems),
16052                            "drm_systems" => Ok(__FieldTag::__drm_systems),
16053                            _ => Ok(__FieldTag::Unknown(value.to_string())),
16054                        }
16055                    }
16056                }
16057                deserializer.deserialize_identifier(Visitor)
16058            }
16059        }
16060        struct Visitor;
16061        impl<'de> serde::de::Visitor<'de> for Visitor {
16062            type Value = Encryption;
16063            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16064                formatter.write_str("struct Encryption")
16065            }
16066            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
16067            where
16068                A: serde::de::MapAccess<'de>,
16069            {
16070                #[allow(unused_imports)]
16071                use serde::de::Error;
16072                use std::option::Option::Some;
16073                let mut fields = std::collections::HashSet::new();
16074                let mut result = Self::Value::new();
16075                while let Some(tag) = map.next_key::<__FieldTag>()? {
16076                    #[allow(clippy::match_single_binding)]
16077                    match tag {
16078                        __FieldTag::__id => {
16079                            if !fields.insert(__FieldTag::__id) {
16080                                return std::result::Result::Err(A::Error::duplicate_field(
16081                                    "multiple values for id",
16082                                ));
16083                            }
16084                            result.id = map
16085                                .next_value::<std::option::Option<std::string::String>>()?
16086                                .unwrap_or_default();
16087                        }
16088                        __FieldTag::__aes_128 => {
16089                            if !fields.insert(__FieldTag::__aes_128) {
16090                                return std::result::Result::Err(A::Error::duplicate_field(
16091                                    "multiple values for aes_128",
16092                                ));
16093                            }
16094                            if result.encryption_mode.is_some() {
16095                                return std::result::Result::Err(A::Error::duplicate_field(
16096                                    "multiple values for `encryption_mode`, a oneof with full ID .google.cloud.video.transcoder.v1.Encryption.aes_128, latest field was aes128",
16097                                ));
16098                            }
16099                            result.encryption_mode = std::option::Option::Some(
16100                                crate::model::encryption::EncryptionMode::Aes128(
16101                                    map.next_value::<std::option::Option<
16102                                        std::boxed::Box<crate::model::encryption::Aes128Encryption>,
16103                                    >>()?
16104                                    .unwrap_or_default(),
16105                                ),
16106                            );
16107                        }
16108                        __FieldTag::__sample_aes => {
16109                            if !fields.insert(__FieldTag::__sample_aes) {
16110                                return std::result::Result::Err(A::Error::duplicate_field(
16111                                    "multiple values for sample_aes",
16112                                ));
16113                            }
16114                            if result.encryption_mode.is_some() {
16115                                return std::result::Result::Err(A::Error::duplicate_field(
16116                                    "multiple values for `encryption_mode`, a oneof with full ID .google.cloud.video.transcoder.v1.Encryption.sample_aes, latest field was sampleAes",
16117                                ));
16118                            }
16119                            result.encryption_mode = std::option::Option::Some(
16120                                crate::model::encryption::EncryptionMode::SampleAes(
16121                                    map.next_value::<std::option::Option<
16122                                        std::boxed::Box<
16123                                            crate::model::encryption::SampleAesEncryption,
16124                                        >,
16125                                    >>()?
16126                                    .unwrap_or_default(),
16127                                ),
16128                            );
16129                        }
16130                        __FieldTag::__mpeg_cenc => {
16131                            if !fields.insert(__FieldTag::__mpeg_cenc) {
16132                                return std::result::Result::Err(A::Error::duplicate_field(
16133                                    "multiple values for mpeg_cenc",
16134                                ));
16135                            }
16136                            if result.encryption_mode.is_some() {
16137                                return std::result::Result::Err(A::Error::duplicate_field(
16138                                    "multiple values for `encryption_mode`, a oneof with full ID .google.cloud.video.transcoder.v1.Encryption.mpeg_cenc, latest field was mpegCenc",
16139                                ));
16140                            }
16141                            result.encryption_mode = std::option::Option::Some(
16142                                crate::model::encryption::EncryptionMode::MpegCenc(
16143                                    map.next_value::<std::option::Option<
16144                                        std::boxed::Box<
16145                                            crate::model::encryption::MpegCommonEncryption,
16146                                        >,
16147                                    >>()?
16148                                    .unwrap_or_default(),
16149                                ),
16150                            );
16151                        }
16152                        __FieldTag::__secret_manager_key_source => {
16153                            if !fields.insert(__FieldTag::__secret_manager_key_source) {
16154                                return std::result::Result::Err(A::Error::duplicate_field(
16155                                    "multiple values for secret_manager_key_source",
16156                                ));
16157                            }
16158                            if result.secret_source.is_some() {
16159                                return std::result::Result::Err(A::Error::duplicate_field(
16160                                    "multiple values for `secret_source`, a oneof with full ID .google.cloud.video.transcoder.v1.Encryption.secret_manager_key_source, latest field was secretManagerKeySource",
16161                                ));
16162                            }
16163                            result.secret_source = std::option::Option::Some(
16164                                crate::model::encryption::SecretSource::SecretManagerKeySource(
16165                                    map.next_value::<std::option::Option<
16166                                        std::boxed::Box<
16167                                            crate::model::encryption::SecretManagerSource,
16168                                        >,
16169                                    >>()?
16170                                    .unwrap_or_default(),
16171                                ),
16172                            );
16173                        }
16174                        __FieldTag::__drm_systems => {
16175                            if !fields.insert(__FieldTag::__drm_systems) {
16176                                return std::result::Result::Err(A::Error::duplicate_field(
16177                                    "multiple values for drm_systems",
16178                                ));
16179                            }
16180                            result.drm_systems = map.next_value::<std::option::Option<crate::model::encryption::DrmSystems>>()?
16181                                ;
16182                        }
16183                        __FieldTag::Unknown(key) => {
16184                            let value = map.next_value::<serde_json::Value>()?;
16185                            result._unknown_fields.insert(key, value);
16186                        }
16187                    }
16188                }
16189                std::result::Result::Ok(result)
16190            }
16191        }
16192        deserializer.deserialize_any(Visitor)
16193    }
16194}
16195
16196#[doc(hidden)]
16197impl serde::ser::Serialize for Encryption {
16198    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16199    where
16200        S: serde::ser::Serializer,
16201    {
16202        use serde::ser::SerializeMap;
16203        #[allow(unused_imports)]
16204        use std::option::Option::Some;
16205        let mut state = serializer.serialize_map(std::option::Option::None)?;
16206        if !self.id.is_empty() {
16207            state.serialize_entry("id", &self.id)?;
16208        }
16209        if let Some(value) = self.aes_128() {
16210            state.serialize_entry("aes128", value)?;
16211        }
16212        if let Some(value) = self.sample_aes() {
16213            state.serialize_entry("sampleAes", value)?;
16214        }
16215        if let Some(value) = self.mpeg_cenc() {
16216            state.serialize_entry("mpegCenc", value)?;
16217        }
16218        if let Some(value) = self.secret_manager_key_source() {
16219            state.serialize_entry("secretManagerKeySource", value)?;
16220        }
16221        if self.drm_systems.is_some() {
16222            state.serialize_entry("drmSystems", &self.drm_systems)?;
16223        }
16224        if !self._unknown_fields.is_empty() {
16225            for (key, value) in self._unknown_fields.iter() {
16226                state.serialize_entry(key, &value)?;
16227            }
16228        }
16229        state.end()
16230    }
16231}
16232
16233impl std::fmt::Debug for Encryption {
16234    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16235        let mut debug_struct = f.debug_struct("Encryption");
16236        debug_struct.field("id", &self.id);
16237        debug_struct.field("drm_systems", &self.drm_systems);
16238        debug_struct.field("encryption_mode", &self.encryption_mode);
16239        debug_struct.field("secret_source", &self.secret_source);
16240        if !self._unknown_fields.is_empty() {
16241            debug_struct.field("_unknown_fields", &self._unknown_fields);
16242        }
16243        debug_struct.finish()
16244    }
16245}
16246
16247/// Defines additional types related to [Encryption].
16248pub mod encryption {
16249    #[allow(unused_imports)]
16250    use super::*;
16251
16252    /// Configuration for AES-128 encryption.
16253    #[derive(Clone, Default, PartialEq)]
16254    #[non_exhaustive]
16255    pub struct Aes128Encryption {
16256        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16257    }
16258
16259    impl Aes128Encryption {
16260        pub fn new() -> Self {
16261            std::default::Default::default()
16262        }
16263    }
16264
16265    impl wkt::message::Message for Aes128Encryption {
16266        fn typename() -> &'static str {
16267            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Aes128Encryption"
16268        }
16269    }
16270
16271    #[doc(hidden)]
16272    impl<'de> serde::de::Deserialize<'de> for Aes128Encryption {
16273        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16274        where
16275            D: serde::Deserializer<'de>,
16276        {
16277            #[allow(non_camel_case_types)]
16278            #[doc(hidden)]
16279            #[derive(PartialEq, Eq, Hash)]
16280            enum __FieldTag {
16281                Unknown(std::string::String),
16282            }
16283            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
16284                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16285                where
16286                    D: serde::Deserializer<'de>,
16287                {
16288                    struct Visitor;
16289                    impl<'de> serde::de::Visitor<'de> for Visitor {
16290                        type Value = __FieldTag;
16291                        fn expecting(
16292                            &self,
16293                            formatter: &mut std::fmt::Formatter,
16294                        ) -> std::fmt::Result {
16295                            formatter.write_str("a field name for Aes128Encryption")
16296                        }
16297                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
16298                        where
16299                            E: serde::de::Error,
16300                        {
16301                            use std::result::Result::Ok;
16302                            use std::string::ToString;
16303                            Ok(__FieldTag::Unknown(value.to_string()))
16304                        }
16305                    }
16306                    deserializer.deserialize_identifier(Visitor)
16307                }
16308            }
16309            struct Visitor;
16310            impl<'de> serde::de::Visitor<'de> for Visitor {
16311                type Value = Aes128Encryption;
16312                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16313                    formatter.write_str("struct Aes128Encryption")
16314                }
16315                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
16316                where
16317                    A: serde::de::MapAccess<'de>,
16318                {
16319                    #[allow(unused_imports)]
16320                    use serde::de::Error;
16321                    use std::option::Option::Some;
16322                    let mut result = Self::Value::new();
16323                    while let Some(tag) = map.next_key::<__FieldTag>()? {
16324                        #[allow(clippy::match_single_binding)]
16325                        match tag {
16326                            __FieldTag::Unknown(key) => {
16327                                let value = map.next_value::<serde_json::Value>()?;
16328                                result._unknown_fields.insert(key, value);
16329                            }
16330                        }
16331                    }
16332                    std::result::Result::Ok(result)
16333                }
16334            }
16335            deserializer.deserialize_any(Visitor)
16336        }
16337    }
16338
16339    #[doc(hidden)]
16340    impl serde::ser::Serialize for Aes128Encryption {
16341        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16342        where
16343            S: serde::ser::Serializer,
16344        {
16345            use serde::ser::SerializeMap;
16346            #[allow(unused_imports)]
16347            use std::option::Option::Some;
16348            let mut state = serializer.serialize_map(std::option::Option::None)?;
16349            if !self._unknown_fields.is_empty() {
16350                for (key, value) in self._unknown_fields.iter() {
16351                    state.serialize_entry(key, &value)?;
16352                }
16353            }
16354            state.end()
16355        }
16356    }
16357
16358    impl std::fmt::Debug for Aes128Encryption {
16359        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16360            let mut debug_struct = f.debug_struct("Aes128Encryption");
16361            if !self._unknown_fields.is_empty() {
16362                debug_struct.field("_unknown_fields", &self._unknown_fields);
16363            }
16364            debug_struct.finish()
16365        }
16366    }
16367
16368    /// Configuration for SAMPLE-AES encryption.
16369    #[derive(Clone, Default, PartialEq)]
16370    #[non_exhaustive]
16371    pub struct SampleAesEncryption {
16372        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16373    }
16374
16375    impl SampleAesEncryption {
16376        pub fn new() -> Self {
16377            std::default::Default::default()
16378        }
16379    }
16380
16381    impl wkt::message::Message for SampleAesEncryption {
16382        fn typename() -> &'static str {
16383            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.SampleAesEncryption"
16384        }
16385    }
16386
16387    #[doc(hidden)]
16388    impl<'de> serde::de::Deserialize<'de> for SampleAesEncryption {
16389        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16390        where
16391            D: serde::Deserializer<'de>,
16392        {
16393            #[allow(non_camel_case_types)]
16394            #[doc(hidden)]
16395            #[derive(PartialEq, Eq, Hash)]
16396            enum __FieldTag {
16397                Unknown(std::string::String),
16398            }
16399            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
16400                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16401                where
16402                    D: serde::Deserializer<'de>,
16403                {
16404                    struct Visitor;
16405                    impl<'de> serde::de::Visitor<'de> for Visitor {
16406                        type Value = __FieldTag;
16407                        fn expecting(
16408                            &self,
16409                            formatter: &mut std::fmt::Formatter,
16410                        ) -> std::fmt::Result {
16411                            formatter.write_str("a field name for SampleAesEncryption")
16412                        }
16413                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
16414                        where
16415                            E: serde::de::Error,
16416                        {
16417                            use std::result::Result::Ok;
16418                            use std::string::ToString;
16419                            Ok(__FieldTag::Unknown(value.to_string()))
16420                        }
16421                    }
16422                    deserializer.deserialize_identifier(Visitor)
16423                }
16424            }
16425            struct Visitor;
16426            impl<'de> serde::de::Visitor<'de> for Visitor {
16427                type Value = SampleAesEncryption;
16428                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16429                    formatter.write_str("struct SampleAesEncryption")
16430                }
16431                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
16432                where
16433                    A: serde::de::MapAccess<'de>,
16434                {
16435                    #[allow(unused_imports)]
16436                    use serde::de::Error;
16437                    use std::option::Option::Some;
16438                    let mut result = Self::Value::new();
16439                    while let Some(tag) = map.next_key::<__FieldTag>()? {
16440                        #[allow(clippy::match_single_binding)]
16441                        match tag {
16442                            __FieldTag::Unknown(key) => {
16443                                let value = map.next_value::<serde_json::Value>()?;
16444                                result._unknown_fields.insert(key, value);
16445                            }
16446                        }
16447                    }
16448                    std::result::Result::Ok(result)
16449                }
16450            }
16451            deserializer.deserialize_any(Visitor)
16452        }
16453    }
16454
16455    #[doc(hidden)]
16456    impl serde::ser::Serialize for SampleAesEncryption {
16457        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16458        where
16459            S: serde::ser::Serializer,
16460        {
16461            use serde::ser::SerializeMap;
16462            #[allow(unused_imports)]
16463            use std::option::Option::Some;
16464            let mut state = serializer.serialize_map(std::option::Option::None)?;
16465            if !self._unknown_fields.is_empty() {
16466                for (key, value) in self._unknown_fields.iter() {
16467                    state.serialize_entry(key, &value)?;
16468                }
16469            }
16470            state.end()
16471        }
16472    }
16473
16474    impl std::fmt::Debug for SampleAesEncryption {
16475        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16476            let mut debug_struct = f.debug_struct("SampleAesEncryption");
16477            if !self._unknown_fields.is_empty() {
16478                debug_struct.field("_unknown_fields", &self._unknown_fields);
16479            }
16480            debug_struct.finish()
16481        }
16482    }
16483
16484    /// Configuration for MPEG Common Encryption (MPEG-CENC).
16485    #[derive(Clone, Default, PartialEq)]
16486    #[non_exhaustive]
16487    pub struct MpegCommonEncryption {
16488        /// Required. Specify the encryption scheme.
16489        ///
16490        /// Supported encryption schemes:
16491        ///
16492        /// - `cenc`
16493        /// - `cbcs`
16494        pub scheme: std::string::String,
16495
16496        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16497    }
16498
16499    impl MpegCommonEncryption {
16500        pub fn new() -> Self {
16501            std::default::Default::default()
16502        }
16503
16504        /// Sets the value of [scheme][crate::model::encryption::MpegCommonEncryption::scheme].
16505        pub fn set_scheme<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16506            self.scheme = v.into();
16507            self
16508        }
16509    }
16510
16511    impl wkt::message::Message for MpegCommonEncryption {
16512        fn typename() -> &'static str {
16513            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.MpegCommonEncryption"
16514        }
16515    }
16516
16517    #[doc(hidden)]
16518    impl<'de> serde::de::Deserialize<'de> for MpegCommonEncryption {
16519        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16520        where
16521            D: serde::Deserializer<'de>,
16522        {
16523            #[allow(non_camel_case_types)]
16524            #[doc(hidden)]
16525            #[derive(PartialEq, Eq, Hash)]
16526            enum __FieldTag {
16527                __scheme,
16528                Unknown(std::string::String),
16529            }
16530            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
16531                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16532                where
16533                    D: serde::Deserializer<'de>,
16534                {
16535                    struct Visitor;
16536                    impl<'de> serde::de::Visitor<'de> for Visitor {
16537                        type Value = __FieldTag;
16538                        fn expecting(
16539                            &self,
16540                            formatter: &mut std::fmt::Formatter,
16541                        ) -> std::fmt::Result {
16542                            formatter.write_str("a field name for MpegCommonEncryption")
16543                        }
16544                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
16545                        where
16546                            E: serde::de::Error,
16547                        {
16548                            use std::result::Result::Ok;
16549                            use std::string::ToString;
16550                            match value {
16551                                "scheme" => Ok(__FieldTag::__scheme),
16552                                _ => Ok(__FieldTag::Unknown(value.to_string())),
16553                            }
16554                        }
16555                    }
16556                    deserializer.deserialize_identifier(Visitor)
16557                }
16558            }
16559            struct Visitor;
16560            impl<'de> serde::de::Visitor<'de> for Visitor {
16561                type Value = MpegCommonEncryption;
16562                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16563                    formatter.write_str("struct MpegCommonEncryption")
16564                }
16565                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
16566                where
16567                    A: serde::de::MapAccess<'de>,
16568                {
16569                    #[allow(unused_imports)]
16570                    use serde::de::Error;
16571                    use std::option::Option::Some;
16572                    let mut fields = std::collections::HashSet::new();
16573                    let mut result = Self::Value::new();
16574                    while let Some(tag) = map.next_key::<__FieldTag>()? {
16575                        #[allow(clippy::match_single_binding)]
16576                        match tag {
16577                            __FieldTag::__scheme => {
16578                                if !fields.insert(__FieldTag::__scheme) {
16579                                    return std::result::Result::Err(A::Error::duplicate_field(
16580                                        "multiple values for scheme",
16581                                    ));
16582                                }
16583                                result.scheme = map
16584                                    .next_value::<std::option::Option<std::string::String>>()?
16585                                    .unwrap_or_default();
16586                            }
16587                            __FieldTag::Unknown(key) => {
16588                                let value = map.next_value::<serde_json::Value>()?;
16589                                result._unknown_fields.insert(key, value);
16590                            }
16591                        }
16592                    }
16593                    std::result::Result::Ok(result)
16594                }
16595            }
16596            deserializer.deserialize_any(Visitor)
16597        }
16598    }
16599
16600    #[doc(hidden)]
16601    impl serde::ser::Serialize for MpegCommonEncryption {
16602        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16603        where
16604            S: serde::ser::Serializer,
16605        {
16606            use serde::ser::SerializeMap;
16607            #[allow(unused_imports)]
16608            use std::option::Option::Some;
16609            let mut state = serializer.serialize_map(std::option::Option::None)?;
16610            if !self.scheme.is_empty() {
16611                state.serialize_entry("scheme", &self.scheme)?;
16612            }
16613            if !self._unknown_fields.is_empty() {
16614                for (key, value) in self._unknown_fields.iter() {
16615                    state.serialize_entry(key, &value)?;
16616                }
16617            }
16618            state.end()
16619        }
16620    }
16621
16622    impl std::fmt::Debug for MpegCommonEncryption {
16623        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16624            let mut debug_struct = f.debug_struct("MpegCommonEncryption");
16625            debug_struct.field("scheme", &self.scheme);
16626            if !self._unknown_fields.is_empty() {
16627                debug_struct.field("_unknown_fields", &self._unknown_fields);
16628            }
16629            debug_struct.finish()
16630        }
16631    }
16632
16633    /// Configuration for secrets stored in Google Secret Manager.
16634    #[derive(Clone, Default, PartialEq)]
16635    #[non_exhaustive]
16636    pub struct SecretManagerSource {
16637        /// Required. The name of the Secret Version containing the encryption key in
16638        /// the following format:
16639        /// `projects/{project}/secrets/{secret_id}/versions/{version_number}`
16640        ///
16641        /// Note that only numbered versions are supported. Aliases like "latest" are
16642        /// not supported.
16643        pub secret_version: std::string::String,
16644
16645        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16646    }
16647
16648    impl SecretManagerSource {
16649        pub fn new() -> Self {
16650            std::default::Default::default()
16651        }
16652
16653        /// Sets the value of [secret_version][crate::model::encryption::SecretManagerSource::secret_version].
16654        pub fn set_secret_version<T: std::convert::Into<std::string::String>>(
16655            mut self,
16656            v: T,
16657        ) -> Self {
16658            self.secret_version = v.into();
16659            self
16660        }
16661    }
16662
16663    impl wkt::message::Message for SecretManagerSource {
16664        fn typename() -> &'static str {
16665            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.SecretManagerSource"
16666        }
16667    }
16668
16669    #[doc(hidden)]
16670    impl<'de> serde::de::Deserialize<'de> for SecretManagerSource {
16671        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16672        where
16673            D: serde::Deserializer<'de>,
16674        {
16675            #[allow(non_camel_case_types)]
16676            #[doc(hidden)]
16677            #[derive(PartialEq, Eq, Hash)]
16678            enum __FieldTag {
16679                __secret_version,
16680                Unknown(std::string::String),
16681            }
16682            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
16683                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16684                where
16685                    D: serde::Deserializer<'de>,
16686                {
16687                    struct Visitor;
16688                    impl<'de> serde::de::Visitor<'de> for Visitor {
16689                        type Value = __FieldTag;
16690                        fn expecting(
16691                            &self,
16692                            formatter: &mut std::fmt::Formatter,
16693                        ) -> std::fmt::Result {
16694                            formatter.write_str("a field name for SecretManagerSource")
16695                        }
16696                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
16697                        where
16698                            E: serde::de::Error,
16699                        {
16700                            use std::result::Result::Ok;
16701                            use std::string::ToString;
16702                            match value {
16703                                "secretVersion" => Ok(__FieldTag::__secret_version),
16704                                "secret_version" => Ok(__FieldTag::__secret_version),
16705                                _ => Ok(__FieldTag::Unknown(value.to_string())),
16706                            }
16707                        }
16708                    }
16709                    deserializer.deserialize_identifier(Visitor)
16710                }
16711            }
16712            struct Visitor;
16713            impl<'de> serde::de::Visitor<'de> for Visitor {
16714                type Value = SecretManagerSource;
16715                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16716                    formatter.write_str("struct SecretManagerSource")
16717                }
16718                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
16719                where
16720                    A: serde::de::MapAccess<'de>,
16721                {
16722                    #[allow(unused_imports)]
16723                    use serde::de::Error;
16724                    use std::option::Option::Some;
16725                    let mut fields = std::collections::HashSet::new();
16726                    let mut result = Self::Value::new();
16727                    while let Some(tag) = map.next_key::<__FieldTag>()? {
16728                        #[allow(clippy::match_single_binding)]
16729                        match tag {
16730                            __FieldTag::__secret_version => {
16731                                if !fields.insert(__FieldTag::__secret_version) {
16732                                    return std::result::Result::Err(A::Error::duplicate_field(
16733                                        "multiple values for secret_version",
16734                                    ));
16735                                }
16736                                result.secret_version = map
16737                                    .next_value::<std::option::Option<std::string::String>>()?
16738                                    .unwrap_or_default();
16739                            }
16740                            __FieldTag::Unknown(key) => {
16741                                let value = map.next_value::<serde_json::Value>()?;
16742                                result._unknown_fields.insert(key, value);
16743                            }
16744                        }
16745                    }
16746                    std::result::Result::Ok(result)
16747                }
16748            }
16749            deserializer.deserialize_any(Visitor)
16750        }
16751    }
16752
16753    #[doc(hidden)]
16754    impl serde::ser::Serialize for SecretManagerSource {
16755        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16756        where
16757            S: serde::ser::Serializer,
16758        {
16759            use serde::ser::SerializeMap;
16760            #[allow(unused_imports)]
16761            use std::option::Option::Some;
16762            let mut state = serializer.serialize_map(std::option::Option::None)?;
16763            if !self.secret_version.is_empty() {
16764                state.serialize_entry("secretVersion", &self.secret_version)?;
16765            }
16766            if !self._unknown_fields.is_empty() {
16767                for (key, value) in self._unknown_fields.iter() {
16768                    state.serialize_entry(key, &value)?;
16769                }
16770            }
16771            state.end()
16772        }
16773    }
16774
16775    impl std::fmt::Debug for SecretManagerSource {
16776        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16777            let mut debug_struct = f.debug_struct("SecretManagerSource");
16778            debug_struct.field("secret_version", &self.secret_version);
16779            if !self._unknown_fields.is_empty() {
16780                debug_struct.field("_unknown_fields", &self._unknown_fields);
16781            }
16782            debug_struct.finish()
16783        }
16784    }
16785
16786    /// Widevine configuration.
16787    #[derive(Clone, Default, PartialEq)]
16788    #[non_exhaustive]
16789    pub struct Widevine {
16790        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16791    }
16792
16793    impl Widevine {
16794        pub fn new() -> Self {
16795            std::default::Default::default()
16796        }
16797    }
16798
16799    impl wkt::message::Message for Widevine {
16800        fn typename() -> &'static str {
16801            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Widevine"
16802        }
16803    }
16804
16805    #[doc(hidden)]
16806    impl<'de> serde::de::Deserialize<'de> for Widevine {
16807        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16808        where
16809            D: serde::Deserializer<'de>,
16810        {
16811            #[allow(non_camel_case_types)]
16812            #[doc(hidden)]
16813            #[derive(PartialEq, Eq, Hash)]
16814            enum __FieldTag {
16815                Unknown(std::string::String),
16816            }
16817            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
16818                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16819                where
16820                    D: serde::Deserializer<'de>,
16821                {
16822                    struct Visitor;
16823                    impl<'de> serde::de::Visitor<'de> for Visitor {
16824                        type Value = __FieldTag;
16825                        fn expecting(
16826                            &self,
16827                            formatter: &mut std::fmt::Formatter,
16828                        ) -> std::fmt::Result {
16829                            formatter.write_str("a field name for Widevine")
16830                        }
16831                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
16832                        where
16833                            E: serde::de::Error,
16834                        {
16835                            use std::result::Result::Ok;
16836                            use std::string::ToString;
16837                            Ok(__FieldTag::Unknown(value.to_string()))
16838                        }
16839                    }
16840                    deserializer.deserialize_identifier(Visitor)
16841                }
16842            }
16843            struct Visitor;
16844            impl<'de> serde::de::Visitor<'de> for Visitor {
16845                type Value = Widevine;
16846                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16847                    formatter.write_str("struct Widevine")
16848                }
16849                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
16850                where
16851                    A: serde::de::MapAccess<'de>,
16852                {
16853                    #[allow(unused_imports)]
16854                    use serde::de::Error;
16855                    use std::option::Option::Some;
16856                    let mut result = Self::Value::new();
16857                    while let Some(tag) = map.next_key::<__FieldTag>()? {
16858                        #[allow(clippy::match_single_binding)]
16859                        match tag {
16860                            __FieldTag::Unknown(key) => {
16861                                let value = map.next_value::<serde_json::Value>()?;
16862                                result._unknown_fields.insert(key, value);
16863                            }
16864                        }
16865                    }
16866                    std::result::Result::Ok(result)
16867                }
16868            }
16869            deserializer.deserialize_any(Visitor)
16870        }
16871    }
16872
16873    #[doc(hidden)]
16874    impl serde::ser::Serialize for Widevine {
16875        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16876        where
16877            S: serde::ser::Serializer,
16878        {
16879            use serde::ser::SerializeMap;
16880            #[allow(unused_imports)]
16881            use std::option::Option::Some;
16882            let mut state = serializer.serialize_map(std::option::Option::None)?;
16883            if !self._unknown_fields.is_empty() {
16884                for (key, value) in self._unknown_fields.iter() {
16885                    state.serialize_entry(key, &value)?;
16886                }
16887            }
16888            state.end()
16889        }
16890    }
16891
16892    impl std::fmt::Debug for Widevine {
16893        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16894            let mut debug_struct = f.debug_struct("Widevine");
16895            if !self._unknown_fields.is_empty() {
16896                debug_struct.field("_unknown_fields", &self._unknown_fields);
16897            }
16898            debug_struct.finish()
16899        }
16900    }
16901
16902    /// Fairplay configuration.
16903    #[derive(Clone, Default, PartialEq)]
16904    #[non_exhaustive]
16905    pub struct Fairplay {
16906        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16907    }
16908
16909    impl Fairplay {
16910        pub fn new() -> Self {
16911            std::default::Default::default()
16912        }
16913    }
16914
16915    impl wkt::message::Message for Fairplay {
16916        fn typename() -> &'static str {
16917            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Fairplay"
16918        }
16919    }
16920
16921    #[doc(hidden)]
16922    impl<'de> serde::de::Deserialize<'de> for Fairplay {
16923        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16924        where
16925            D: serde::Deserializer<'de>,
16926        {
16927            #[allow(non_camel_case_types)]
16928            #[doc(hidden)]
16929            #[derive(PartialEq, Eq, Hash)]
16930            enum __FieldTag {
16931                Unknown(std::string::String),
16932            }
16933            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
16934                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16935                where
16936                    D: serde::Deserializer<'de>,
16937                {
16938                    struct Visitor;
16939                    impl<'de> serde::de::Visitor<'de> for Visitor {
16940                        type Value = __FieldTag;
16941                        fn expecting(
16942                            &self,
16943                            formatter: &mut std::fmt::Formatter,
16944                        ) -> std::fmt::Result {
16945                            formatter.write_str("a field name for Fairplay")
16946                        }
16947                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
16948                        where
16949                            E: serde::de::Error,
16950                        {
16951                            use std::result::Result::Ok;
16952                            use std::string::ToString;
16953                            Ok(__FieldTag::Unknown(value.to_string()))
16954                        }
16955                    }
16956                    deserializer.deserialize_identifier(Visitor)
16957                }
16958            }
16959            struct Visitor;
16960            impl<'de> serde::de::Visitor<'de> for Visitor {
16961                type Value = Fairplay;
16962                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16963                    formatter.write_str("struct Fairplay")
16964                }
16965                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
16966                where
16967                    A: serde::de::MapAccess<'de>,
16968                {
16969                    #[allow(unused_imports)]
16970                    use serde::de::Error;
16971                    use std::option::Option::Some;
16972                    let mut result = Self::Value::new();
16973                    while let Some(tag) = map.next_key::<__FieldTag>()? {
16974                        #[allow(clippy::match_single_binding)]
16975                        match tag {
16976                            __FieldTag::Unknown(key) => {
16977                                let value = map.next_value::<serde_json::Value>()?;
16978                                result._unknown_fields.insert(key, value);
16979                            }
16980                        }
16981                    }
16982                    std::result::Result::Ok(result)
16983                }
16984            }
16985            deserializer.deserialize_any(Visitor)
16986        }
16987    }
16988
16989    #[doc(hidden)]
16990    impl serde::ser::Serialize for Fairplay {
16991        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16992        where
16993            S: serde::ser::Serializer,
16994        {
16995            use serde::ser::SerializeMap;
16996            #[allow(unused_imports)]
16997            use std::option::Option::Some;
16998            let mut state = serializer.serialize_map(std::option::Option::None)?;
16999            if !self._unknown_fields.is_empty() {
17000                for (key, value) in self._unknown_fields.iter() {
17001                    state.serialize_entry(key, &value)?;
17002                }
17003            }
17004            state.end()
17005        }
17006    }
17007
17008    impl std::fmt::Debug for Fairplay {
17009        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17010            let mut debug_struct = f.debug_struct("Fairplay");
17011            if !self._unknown_fields.is_empty() {
17012                debug_struct.field("_unknown_fields", &self._unknown_fields);
17013            }
17014            debug_struct.finish()
17015        }
17016    }
17017
17018    /// Playready configuration.
17019    #[derive(Clone, Default, PartialEq)]
17020    #[non_exhaustive]
17021    pub struct Playready {
17022        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17023    }
17024
17025    impl Playready {
17026        pub fn new() -> Self {
17027            std::default::Default::default()
17028        }
17029    }
17030
17031    impl wkt::message::Message for Playready {
17032        fn typename() -> &'static str {
17033            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Playready"
17034        }
17035    }
17036
17037    #[doc(hidden)]
17038    impl<'de> serde::de::Deserialize<'de> for Playready {
17039        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17040        where
17041            D: serde::Deserializer<'de>,
17042        {
17043            #[allow(non_camel_case_types)]
17044            #[doc(hidden)]
17045            #[derive(PartialEq, Eq, Hash)]
17046            enum __FieldTag {
17047                Unknown(std::string::String),
17048            }
17049            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
17050                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17051                where
17052                    D: serde::Deserializer<'de>,
17053                {
17054                    struct Visitor;
17055                    impl<'de> serde::de::Visitor<'de> for Visitor {
17056                        type Value = __FieldTag;
17057                        fn expecting(
17058                            &self,
17059                            formatter: &mut std::fmt::Formatter,
17060                        ) -> std::fmt::Result {
17061                            formatter.write_str("a field name for Playready")
17062                        }
17063                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
17064                        where
17065                            E: serde::de::Error,
17066                        {
17067                            use std::result::Result::Ok;
17068                            use std::string::ToString;
17069                            Ok(__FieldTag::Unknown(value.to_string()))
17070                        }
17071                    }
17072                    deserializer.deserialize_identifier(Visitor)
17073                }
17074            }
17075            struct Visitor;
17076            impl<'de> serde::de::Visitor<'de> for Visitor {
17077                type Value = Playready;
17078                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17079                    formatter.write_str("struct Playready")
17080                }
17081                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
17082                where
17083                    A: serde::de::MapAccess<'de>,
17084                {
17085                    #[allow(unused_imports)]
17086                    use serde::de::Error;
17087                    use std::option::Option::Some;
17088                    let mut result = Self::Value::new();
17089                    while let Some(tag) = map.next_key::<__FieldTag>()? {
17090                        #[allow(clippy::match_single_binding)]
17091                        match tag {
17092                            __FieldTag::Unknown(key) => {
17093                                let value = map.next_value::<serde_json::Value>()?;
17094                                result._unknown_fields.insert(key, value);
17095                            }
17096                        }
17097                    }
17098                    std::result::Result::Ok(result)
17099                }
17100            }
17101            deserializer.deserialize_any(Visitor)
17102        }
17103    }
17104
17105    #[doc(hidden)]
17106    impl serde::ser::Serialize for Playready {
17107        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17108        where
17109            S: serde::ser::Serializer,
17110        {
17111            use serde::ser::SerializeMap;
17112            #[allow(unused_imports)]
17113            use std::option::Option::Some;
17114            let mut state = serializer.serialize_map(std::option::Option::None)?;
17115            if !self._unknown_fields.is_empty() {
17116                for (key, value) in self._unknown_fields.iter() {
17117                    state.serialize_entry(key, &value)?;
17118                }
17119            }
17120            state.end()
17121        }
17122    }
17123
17124    impl std::fmt::Debug for Playready {
17125        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17126            let mut debug_struct = f.debug_struct("Playready");
17127            if !self._unknown_fields.is_empty() {
17128                debug_struct.field("_unknown_fields", &self._unknown_fields);
17129            }
17130            debug_struct.finish()
17131        }
17132    }
17133
17134    /// Clearkey configuration.
17135    #[derive(Clone, Default, PartialEq)]
17136    #[non_exhaustive]
17137    pub struct Clearkey {
17138        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17139    }
17140
17141    impl Clearkey {
17142        pub fn new() -> Self {
17143            std::default::Default::default()
17144        }
17145    }
17146
17147    impl wkt::message::Message for Clearkey {
17148        fn typename() -> &'static str {
17149            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Clearkey"
17150        }
17151    }
17152
17153    #[doc(hidden)]
17154    impl<'de> serde::de::Deserialize<'de> for Clearkey {
17155        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17156        where
17157            D: serde::Deserializer<'de>,
17158        {
17159            #[allow(non_camel_case_types)]
17160            #[doc(hidden)]
17161            #[derive(PartialEq, Eq, Hash)]
17162            enum __FieldTag {
17163                Unknown(std::string::String),
17164            }
17165            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
17166                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17167                where
17168                    D: serde::Deserializer<'de>,
17169                {
17170                    struct Visitor;
17171                    impl<'de> serde::de::Visitor<'de> for Visitor {
17172                        type Value = __FieldTag;
17173                        fn expecting(
17174                            &self,
17175                            formatter: &mut std::fmt::Formatter,
17176                        ) -> std::fmt::Result {
17177                            formatter.write_str("a field name for Clearkey")
17178                        }
17179                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
17180                        where
17181                            E: serde::de::Error,
17182                        {
17183                            use std::result::Result::Ok;
17184                            use std::string::ToString;
17185                            Ok(__FieldTag::Unknown(value.to_string()))
17186                        }
17187                    }
17188                    deserializer.deserialize_identifier(Visitor)
17189                }
17190            }
17191            struct Visitor;
17192            impl<'de> serde::de::Visitor<'de> for Visitor {
17193                type Value = Clearkey;
17194                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17195                    formatter.write_str("struct Clearkey")
17196                }
17197                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
17198                where
17199                    A: serde::de::MapAccess<'de>,
17200                {
17201                    #[allow(unused_imports)]
17202                    use serde::de::Error;
17203                    use std::option::Option::Some;
17204                    let mut result = Self::Value::new();
17205                    while let Some(tag) = map.next_key::<__FieldTag>()? {
17206                        #[allow(clippy::match_single_binding)]
17207                        match tag {
17208                            __FieldTag::Unknown(key) => {
17209                                let value = map.next_value::<serde_json::Value>()?;
17210                                result._unknown_fields.insert(key, value);
17211                            }
17212                        }
17213                    }
17214                    std::result::Result::Ok(result)
17215                }
17216            }
17217            deserializer.deserialize_any(Visitor)
17218        }
17219    }
17220
17221    #[doc(hidden)]
17222    impl serde::ser::Serialize for Clearkey {
17223        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17224        where
17225            S: serde::ser::Serializer,
17226        {
17227            use serde::ser::SerializeMap;
17228            #[allow(unused_imports)]
17229            use std::option::Option::Some;
17230            let mut state = serializer.serialize_map(std::option::Option::None)?;
17231            if !self._unknown_fields.is_empty() {
17232                for (key, value) in self._unknown_fields.iter() {
17233                    state.serialize_entry(key, &value)?;
17234                }
17235            }
17236            state.end()
17237        }
17238    }
17239
17240    impl std::fmt::Debug for Clearkey {
17241        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17242            let mut debug_struct = f.debug_struct("Clearkey");
17243            if !self._unknown_fields.is_empty() {
17244                debug_struct.field("_unknown_fields", &self._unknown_fields);
17245            }
17246            debug_struct.finish()
17247        }
17248    }
17249
17250    /// Defines configuration for DRM systems in use.
17251    #[derive(Clone, Default, PartialEq)]
17252    #[non_exhaustive]
17253    pub struct DrmSystems {
17254        /// Widevine configuration.
17255        pub widevine: std::option::Option<crate::model::encryption::Widevine>,
17256
17257        /// Fairplay configuration.
17258        pub fairplay: std::option::Option<crate::model::encryption::Fairplay>,
17259
17260        /// Playready configuration.
17261        pub playready: std::option::Option<crate::model::encryption::Playready>,
17262
17263        /// Clearkey configuration.
17264        pub clearkey: std::option::Option<crate::model::encryption::Clearkey>,
17265
17266        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17267    }
17268
17269    impl DrmSystems {
17270        pub fn new() -> Self {
17271            std::default::Default::default()
17272        }
17273
17274        /// Sets the value of [widevine][crate::model::encryption::DrmSystems::widevine].
17275        pub fn set_widevine<T>(mut self, v: T) -> Self
17276        where
17277            T: std::convert::Into<crate::model::encryption::Widevine>,
17278        {
17279            self.widevine = std::option::Option::Some(v.into());
17280            self
17281        }
17282
17283        /// Sets or clears the value of [widevine][crate::model::encryption::DrmSystems::widevine].
17284        pub fn set_or_clear_widevine<T>(mut self, v: std::option::Option<T>) -> Self
17285        where
17286            T: std::convert::Into<crate::model::encryption::Widevine>,
17287        {
17288            self.widevine = v.map(|x| x.into());
17289            self
17290        }
17291
17292        /// Sets the value of [fairplay][crate::model::encryption::DrmSystems::fairplay].
17293        pub fn set_fairplay<T>(mut self, v: T) -> Self
17294        where
17295            T: std::convert::Into<crate::model::encryption::Fairplay>,
17296        {
17297            self.fairplay = std::option::Option::Some(v.into());
17298            self
17299        }
17300
17301        /// Sets or clears the value of [fairplay][crate::model::encryption::DrmSystems::fairplay].
17302        pub fn set_or_clear_fairplay<T>(mut self, v: std::option::Option<T>) -> Self
17303        where
17304            T: std::convert::Into<crate::model::encryption::Fairplay>,
17305        {
17306            self.fairplay = v.map(|x| x.into());
17307            self
17308        }
17309
17310        /// Sets the value of [playready][crate::model::encryption::DrmSystems::playready].
17311        pub fn set_playready<T>(mut self, v: T) -> Self
17312        where
17313            T: std::convert::Into<crate::model::encryption::Playready>,
17314        {
17315            self.playready = std::option::Option::Some(v.into());
17316            self
17317        }
17318
17319        /// Sets or clears the value of [playready][crate::model::encryption::DrmSystems::playready].
17320        pub fn set_or_clear_playready<T>(mut self, v: std::option::Option<T>) -> Self
17321        where
17322            T: std::convert::Into<crate::model::encryption::Playready>,
17323        {
17324            self.playready = v.map(|x| x.into());
17325            self
17326        }
17327
17328        /// Sets the value of [clearkey][crate::model::encryption::DrmSystems::clearkey].
17329        pub fn set_clearkey<T>(mut self, v: T) -> Self
17330        where
17331            T: std::convert::Into<crate::model::encryption::Clearkey>,
17332        {
17333            self.clearkey = std::option::Option::Some(v.into());
17334            self
17335        }
17336
17337        /// Sets or clears the value of [clearkey][crate::model::encryption::DrmSystems::clearkey].
17338        pub fn set_or_clear_clearkey<T>(mut self, v: std::option::Option<T>) -> Self
17339        where
17340            T: std::convert::Into<crate::model::encryption::Clearkey>,
17341        {
17342            self.clearkey = v.map(|x| x.into());
17343            self
17344        }
17345    }
17346
17347    impl wkt::message::Message for DrmSystems {
17348        fn typename() -> &'static str {
17349            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.DrmSystems"
17350        }
17351    }
17352
17353    #[doc(hidden)]
17354    impl<'de> serde::de::Deserialize<'de> for DrmSystems {
17355        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17356        where
17357            D: serde::Deserializer<'de>,
17358        {
17359            #[allow(non_camel_case_types)]
17360            #[doc(hidden)]
17361            #[derive(PartialEq, Eq, Hash)]
17362            enum __FieldTag {
17363                __widevine,
17364                __fairplay,
17365                __playready,
17366                __clearkey,
17367                Unknown(std::string::String),
17368            }
17369            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
17370                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17371                where
17372                    D: serde::Deserializer<'de>,
17373                {
17374                    struct Visitor;
17375                    impl<'de> serde::de::Visitor<'de> for Visitor {
17376                        type Value = __FieldTag;
17377                        fn expecting(
17378                            &self,
17379                            formatter: &mut std::fmt::Formatter,
17380                        ) -> std::fmt::Result {
17381                            formatter.write_str("a field name for DrmSystems")
17382                        }
17383                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
17384                        where
17385                            E: serde::de::Error,
17386                        {
17387                            use std::result::Result::Ok;
17388                            use std::string::ToString;
17389                            match value {
17390                                "widevine" => Ok(__FieldTag::__widevine),
17391                                "fairplay" => Ok(__FieldTag::__fairplay),
17392                                "playready" => Ok(__FieldTag::__playready),
17393                                "clearkey" => Ok(__FieldTag::__clearkey),
17394                                _ => Ok(__FieldTag::Unknown(value.to_string())),
17395                            }
17396                        }
17397                    }
17398                    deserializer.deserialize_identifier(Visitor)
17399                }
17400            }
17401            struct Visitor;
17402            impl<'de> serde::de::Visitor<'de> for Visitor {
17403                type Value = DrmSystems;
17404                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17405                    formatter.write_str("struct DrmSystems")
17406                }
17407                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
17408                where
17409                    A: serde::de::MapAccess<'de>,
17410                {
17411                    #[allow(unused_imports)]
17412                    use serde::de::Error;
17413                    use std::option::Option::Some;
17414                    let mut fields = std::collections::HashSet::new();
17415                    let mut result = Self::Value::new();
17416                    while let Some(tag) = map.next_key::<__FieldTag>()? {
17417                        #[allow(clippy::match_single_binding)]
17418                        match tag {
17419                            __FieldTag::__widevine => {
17420                                if !fields.insert(__FieldTag::__widevine) {
17421                                    return std::result::Result::Err(A::Error::duplicate_field(
17422                                        "multiple values for widevine",
17423                                    ));
17424                                }
17425                                result.widevine = map.next_value::<std::option::Option<crate::model::encryption::Widevine>>()?
17426                                    ;
17427                            }
17428                            __FieldTag::__fairplay => {
17429                                if !fields.insert(__FieldTag::__fairplay) {
17430                                    return std::result::Result::Err(A::Error::duplicate_field(
17431                                        "multiple values for fairplay",
17432                                    ));
17433                                }
17434                                result.fairplay = map.next_value::<std::option::Option<crate::model::encryption::Fairplay>>()?
17435                                    ;
17436                            }
17437                            __FieldTag::__playready => {
17438                                if !fields.insert(__FieldTag::__playready) {
17439                                    return std::result::Result::Err(A::Error::duplicate_field(
17440                                        "multiple values for playready",
17441                                    ));
17442                                }
17443                                result.playready = map.next_value::<std::option::Option<crate::model::encryption::Playready>>()?
17444                                    ;
17445                            }
17446                            __FieldTag::__clearkey => {
17447                                if !fields.insert(__FieldTag::__clearkey) {
17448                                    return std::result::Result::Err(A::Error::duplicate_field(
17449                                        "multiple values for clearkey",
17450                                    ));
17451                                }
17452                                result.clearkey = map.next_value::<std::option::Option<crate::model::encryption::Clearkey>>()?
17453                                    ;
17454                            }
17455                            __FieldTag::Unknown(key) => {
17456                                let value = map.next_value::<serde_json::Value>()?;
17457                                result._unknown_fields.insert(key, value);
17458                            }
17459                        }
17460                    }
17461                    std::result::Result::Ok(result)
17462                }
17463            }
17464            deserializer.deserialize_any(Visitor)
17465        }
17466    }
17467
17468    #[doc(hidden)]
17469    impl serde::ser::Serialize for DrmSystems {
17470        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17471        where
17472            S: serde::ser::Serializer,
17473        {
17474            use serde::ser::SerializeMap;
17475            #[allow(unused_imports)]
17476            use std::option::Option::Some;
17477            let mut state = serializer.serialize_map(std::option::Option::None)?;
17478            if self.widevine.is_some() {
17479                state.serialize_entry("widevine", &self.widevine)?;
17480            }
17481            if self.fairplay.is_some() {
17482                state.serialize_entry("fairplay", &self.fairplay)?;
17483            }
17484            if self.playready.is_some() {
17485                state.serialize_entry("playready", &self.playready)?;
17486            }
17487            if self.clearkey.is_some() {
17488                state.serialize_entry("clearkey", &self.clearkey)?;
17489            }
17490            if !self._unknown_fields.is_empty() {
17491                for (key, value) in self._unknown_fields.iter() {
17492                    state.serialize_entry(key, &value)?;
17493                }
17494            }
17495            state.end()
17496        }
17497    }
17498
17499    impl std::fmt::Debug for DrmSystems {
17500        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17501            let mut debug_struct = f.debug_struct("DrmSystems");
17502            debug_struct.field("widevine", &self.widevine);
17503            debug_struct.field("fairplay", &self.fairplay);
17504            debug_struct.field("playready", &self.playready);
17505            debug_struct.field("clearkey", &self.clearkey);
17506            if !self._unknown_fields.is_empty() {
17507                debug_struct.field("_unknown_fields", &self._unknown_fields);
17508            }
17509            debug_struct.finish()
17510        }
17511    }
17512
17513    /// Encryption mode can be either `aes` or `cenc`.
17514    #[derive(Clone, Debug, PartialEq)]
17515    #[non_exhaustive]
17516    pub enum EncryptionMode {
17517        /// Configuration for AES-128 encryption.
17518        Aes128(std::boxed::Box<crate::model::encryption::Aes128Encryption>),
17519        /// Configuration for SAMPLE-AES encryption.
17520        SampleAes(std::boxed::Box<crate::model::encryption::SampleAesEncryption>),
17521        /// Configuration for MPEG Common Encryption (MPEG-CENC).
17522        MpegCenc(std::boxed::Box<crate::model::encryption::MpegCommonEncryption>),
17523    }
17524
17525    /// Defines where content keys are stored.
17526    #[derive(Clone, Debug, PartialEq)]
17527    #[non_exhaustive]
17528    pub enum SecretSource {
17529        /// Keys are stored in Google Secret Manager.
17530        SecretManagerKeySource(std::boxed::Box<crate::model::encryption::SecretManagerSource>),
17531    }
17532}
17533
17534/// Request message for `TranscoderService.CreateJob`.
17535#[derive(Clone, Default, PartialEq)]
17536#[non_exhaustive]
17537pub struct CreateJobRequest {
17538    /// Required. The parent location to create and process this job.
17539    /// Format: `projects/{project}/locations/{location}`
17540    pub parent: std::string::String,
17541
17542    /// Required. Parameters for creating transcoding job.
17543    pub job: std::option::Option<crate::model::Job>,
17544
17545    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17546}
17547
17548impl CreateJobRequest {
17549    pub fn new() -> Self {
17550        std::default::Default::default()
17551    }
17552
17553    /// Sets the value of [parent][crate::model::CreateJobRequest::parent].
17554    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17555        self.parent = v.into();
17556        self
17557    }
17558
17559    /// Sets the value of [job][crate::model::CreateJobRequest::job].
17560    pub fn set_job<T>(mut self, v: T) -> Self
17561    where
17562        T: std::convert::Into<crate::model::Job>,
17563    {
17564        self.job = std::option::Option::Some(v.into());
17565        self
17566    }
17567
17568    /// Sets or clears the value of [job][crate::model::CreateJobRequest::job].
17569    pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
17570    where
17571        T: std::convert::Into<crate::model::Job>,
17572    {
17573        self.job = v.map(|x| x.into());
17574        self
17575    }
17576}
17577
17578impl wkt::message::Message for CreateJobRequest {
17579    fn typename() -> &'static str {
17580        "type.googleapis.com/google.cloud.video.transcoder.v1.CreateJobRequest"
17581    }
17582}
17583
17584#[doc(hidden)]
17585impl<'de> serde::de::Deserialize<'de> for CreateJobRequest {
17586    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17587    where
17588        D: serde::Deserializer<'de>,
17589    {
17590        #[allow(non_camel_case_types)]
17591        #[doc(hidden)]
17592        #[derive(PartialEq, Eq, Hash)]
17593        enum __FieldTag {
17594            __parent,
17595            __job,
17596            Unknown(std::string::String),
17597        }
17598        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
17599            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17600            where
17601                D: serde::Deserializer<'de>,
17602            {
17603                struct Visitor;
17604                impl<'de> serde::de::Visitor<'de> for Visitor {
17605                    type Value = __FieldTag;
17606                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17607                        formatter.write_str("a field name for CreateJobRequest")
17608                    }
17609                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
17610                    where
17611                        E: serde::de::Error,
17612                    {
17613                        use std::result::Result::Ok;
17614                        use std::string::ToString;
17615                        match value {
17616                            "parent" => Ok(__FieldTag::__parent),
17617                            "job" => Ok(__FieldTag::__job),
17618                            _ => Ok(__FieldTag::Unknown(value.to_string())),
17619                        }
17620                    }
17621                }
17622                deserializer.deserialize_identifier(Visitor)
17623            }
17624        }
17625        struct Visitor;
17626        impl<'de> serde::de::Visitor<'de> for Visitor {
17627            type Value = CreateJobRequest;
17628            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17629                formatter.write_str("struct CreateJobRequest")
17630            }
17631            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
17632            where
17633                A: serde::de::MapAccess<'de>,
17634            {
17635                #[allow(unused_imports)]
17636                use serde::de::Error;
17637                use std::option::Option::Some;
17638                let mut fields = std::collections::HashSet::new();
17639                let mut result = Self::Value::new();
17640                while let Some(tag) = map.next_key::<__FieldTag>()? {
17641                    #[allow(clippy::match_single_binding)]
17642                    match tag {
17643                        __FieldTag::__parent => {
17644                            if !fields.insert(__FieldTag::__parent) {
17645                                return std::result::Result::Err(A::Error::duplicate_field(
17646                                    "multiple values for parent",
17647                                ));
17648                            }
17649                            result.parent = map
17650                                .next_value::<std::option::Option<std::string::String>>()?
17651                                .unwrap_or_default();
17652                        }
17653                        __FieldTag::__job => {
17654                            if !fields.insert(__FieldTag::__job) {
17655                                return std::result::Result::Err(A::Error::duplicate_field(
17656                                    "multiple values for job",
17657                                ));
17658                            }
17659                            result.job =
17660                                map.next_value::<std::option::Option<crate::model::Job>>()?;
17661                        }
17662                        __FieldTag::Unknown(key) => {
17663                            let value = map.next_value::<serde_json::Value>()?;
17664                            result._unknown_fields.insert(key, value);
17665                        }
17666                    }
17667                }
17668                std::result::Result::Ok(result)
17669            }
17670        }
17671        deserializer.deserialize_any(Visitor)
17672    }
17673}
17674
17675#[doc(hidden)]
17676impl serde::ser::Serialize for CreateJobRequest {
17677    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17678    where
17679        S: serde::ser::Serializer,
17680    {
17681        use serde::ser::SerializeMap;
17682        #[allow(unused_imports)]
17683        use std::option::Option::Some;
17684        let mut state = serializer.serialize_map(std::option::Option::None)?;
17685        if !self.parent.is_empty() {
17686            state.serialize_entry("parent", &self.parent)?;
17687        }
17688        if self.job.is_some() {
17689            state.serialize_entry("job", &self.job)?;
17690        }
17691        if !self._unknown_fields.is_empty() {
17692            for (key, value) in self._unknown_fields.iter() {
17693                state.serialize_entry(key, &value)?;
17694            }
17695        }
17696        state.end()
17697    }
17698}
17699
17700impl std::fmt::Debug for CreateJobRequest {
17701    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17702        let mut debug_struct = f.debug_struct("CreateJobRequest");
17703        debug_struct.field("parent", &self.parent);
17704        debug_struct.field("job", &self.job);
17705        if !self._unknown_fields.is_empty() {
17706            debug_struct.field("_unknown_fields", &self._unknown_fields);
17707        }
17708        debug_struct.finish()
17709    }
17710}
17711
17712/// Request message for `TranscoderService.ListJobs`.
17713/// The parent location from which to retrieve the collection of jobs.
17714#[derive(Clone, Default, PartialEq)]
17715#[non_exhaustive]
17716pub struct ListJobsRequest {
17717    /// Required. Format: `projects/{project}/locations/{location}`
17718    pub parent: std::string::String,
17719
17720    /// The maximum number of items to return.
17721    pub page_size: i32,
17722
17723    /// The `next_page_token` value returned from a previous List request, if
17724    /// any.
17725    pub page_token: std::string::String,
17726
17727    /// The filter expression, following the syntax outlined in
17728    /// <https://google.aip.dev/160>.
17729    pub filter: std::string::String,
17730
17731    /// One or more fields to compare and use to sort the output.
17732    /// See <https://google.aip.dev/132#ordering>.
17733    pub order_by: std::string::String,
17734
17735    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17736}
17737
17738impl ListJobsRequest {
17739    pub fn new() -> Self {
17740        std::default::Default::default()
17741    }
17742
17743    /// Sets the value of [parent][crate::model::ListJobsRequest::parent].
17744    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17745        self.parent = v.into();
17746        self
17747    }
17748
17749    /// Sets the value of [page_size][crate::model::ListJobsRequest::page_size].
17750    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17751        self.page_size = v.into();
17752        self
17753    }
17754
17755    /// Sets the value of [page_token][crate::model::ListJobsRequest::page_token].
17756    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17757        self.page_token = v.into();
17758        self
17759    }
17760
17761    /// Sets the value of [filter][crate::model::ListJobsRequest::filter].
17762    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17763        self.filter = v.into();
17764        self
17765    }
17766
17767    /// Sets the value of [order_by][crate::model::ListJobsRequest::order_by].
17768    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17769        self.order_by = v.into();
17770        self
17771    }
17772}
17773
17774impl wkt::message::Message for ListJobsRequest {
17775    fn typename() -> &'static str {
17776        "type.googleapis.com/google.cloud.video.transcoder.v1.ListJobsRequest"
17777    }
17778}
17779
17780#[doc(hidden)]
17781impl<'de> serde::de::Deserialize<'de> for ListJobsRequest {
17782    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17783    where
17784        D: serde::Deserializer<'de>,
17785    {
17786        #[allow(non_camel_case_types)]
17787        #[doc(hidden)]
17788        #[derive(PartialEq, Eq, Hash)]
17789        enum __FieldTag {
17790            __parent,
17791            __page_size,
17792            __page_token,
17793            __filter,
17794            __order_by,
17795            Unknown(std::string::String),
17796        }
17797        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
17798            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17799            where
17800                D: serde::Deserializer<'de>,
17801            {
17802                struct Visitor;
17803                impl<'de> serde::de::Visitor<'de> for Visitor {
17804                    type Value = __FieldTag;
17805                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17806                        formatter.write_str("a field name for ListJobsRequest")
17807                    }
17808                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
17809                    where
17810                        E: serde::de::Error,
17811                    {
17812                        use std::result::Result::Ok;
17813                        use std::string::ToString;
17814                        match value {
17815                            "parent" => Ok(__FieldTag::__parent),
17816                            "pageSize" => Ok(__FieldTag::__page_size),
17817                            "page_size" => Ok(__FieldTag::__page_size),
17818                            "pageToken" => Ok(__FieldTag::__page_token),
17819                            "page_token" => Ok(__FieldTag::__page_token),
17820                            "filter" => Ok(__FieldTag::__filter),
17821                            "orderBy" => Ok(__FieldTag::__order_by),
17822                            "order_by" => Ok(__FieldTag::__order_by),
17823                            _ => Ok(__FieldTag::Unknown(value.to_string())),
17824                        }
17825                    }
17826                }
17827                deserializer.deserialize_identifier(Visitor)
17828            }
17829        }
17830        struct Visitor;
17831        impl<'de> serde::de::Visitor<'de> for Visitor {
17832            type Value = ListJobsRequest;
17833            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17834                formatter.write_str("struct ListJobsRequest")
17835            }
17836            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
17837            where
17838                A: serde::de::MapAccess<'de>,
17839            {
17840                #[allow(unused_imports)]
17841                use serde::de::Error;
17842                use std::option::Option::Some;
17843                let mut fields = std::collections::HashSet::new();
17844                let mut result = Self::Value::new();
17845                while let Some(tag) = map.next_key::<__FieldTag>()? {
17846                    #[allow(clippy::match_single_binding)]
17847                    match tag {
17848                        __FieldTag::__parent => {
17849                            if !fields.insert(__FieldTag::__parent) {
17850                                return std::result::Result::Err(A::Error::duplicate_field(
17851                                    "multiple values for parent",
17852                                ));
17853                            }
17854                            result.parent = map
17855                                .next_value::<std::option::Option<std::string::String>>()?
17856                                .unwrap_or_default();
17857                        }
17858                        __FieldTag::__page_size => {
17859                            if !fields.insert(__FieldTag::__page_size) {
17860                                return std::result::Result::Err(A::Error::duplicate_field(
17861                                    "multiple values for page_size",
17862                                ));
17863                            }
17864                            struct __With(std::option::Option<i32>);
17865                            impl<'de> serde::de::Deserialize<'de> for __With {
17866                                fn deserialize<D>(
17867                                    deserializer: D,
17868                                ) -> std::result::Result<Self, D::Error>
17869                                where
17870                                    D: serde::de::Deserializer<'de>,
17871                                {
17872                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
17873                                }
17874                            }
17875                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
17876                        }
17877                        __FieldTag::__page_token => {
17878                            if !fields.insert(__FieldTag::__page_token) {
17879                                return std::result::Result::Err(A::Error::duplicate_field(
17880                                    "multiple values for page_token",
17881                                ));
17882                            }
17883                            result.page_token = map
17884                                .next_value::<std::option::Option<std::string::String>>()?
17885                                .unwrap_or_default();
17886                        }
17887                        __FieldTag::__filter => {
17888                            if !fields.insert(__FieldTag::__filter) {
17889                                return std::result::Result::Err(A::Error::duplicate_field(
17890                                    "multiple values for filter",
17891                                ));
17892                            }
17893                            result.filter = map
17894                                .next_value::<std::option::Option<std::string::String>>()?
17895                                .unwrap_or_default();
17896                        }
17897                        __FieldTag::__order_by => {
17898                            if !fields.insert(__FieldTag::__order_by) {
17899                                return std::result::Result::Err(A::Error::duplicate_field(
17900                                    "multiple values for order_by",
17901                                ));
17902                            }
17903                            result.order_by = map
17904                                .next_value::<std::option::Option<std::string::String>>()?
17905                                .unwrap_or_default();
17906                        }
17907                        __FieldTag::Unknown(key) => {
17908                            let value = map.next_value::<serde_json::Value>()?;
17909                            result._unknown_fields.insert(key, value);
17910                        }
17911                    }
17912                }
17913                std::result::Result::Ok(result)
17914            }
17915        }
17916        deserializer.deserialize_any(Visitor)
17917    }
17918}
17919
17920#[doc(hidden)]
17921impl serde::ser::Serialize for ListJobsRequest {
17922    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17923    where
17924        S: serde::ser::Serializer,
17925    {
17926        use serde::ser::SerializeMap;
17927        #[allow(unused_imports)]
17928        use std::option::Option::Some;
17929        let mut state = serializer.serialize_map(std::option::Option::None)?;
17930        if !self.parent.is_empty() {
17931            state.serialize_entry("parent", &self.parent)?;
17932        }
17933        if !wkt::internal::is_default(&self.page_size) {
17934            struct __With<'a>(&'a i32);
17935            impl<'a> serde::ser::Serialize for __With<'a> {
17936                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17937                where
17938                    S: serde::ser::Serializer,
17939                {
17940                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
17941                }
17942            }
17943            state.serialize_entry("pageSize", &__With(&self.page_size))?;
17944        }
17945        if !self.page_token.is_empty() {
17946            state.serialize_entry("pageToken", &self.page_token)?;
17947        }
17948        if !self.filter.is_empty() {
17949            state.serialize_entry("filter", &self.filter)?;
17950        }
17951        if !self.order_by.is_empty() {
17952            state.serialize_entry("orderBy", &self.order_by)?;
17953        }
17954        if !self._unknown_fields.is_empty() {
17955            for (key, value) in self._unknown_fields.iter() {
17956                state.serialize_entry(key, &value)?;
17957            }
17958        }
17959        state.end()
17960    }
17961}
17962
17963impl std::fmt::Debug for ListJobsRequest {
17964    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17965        let mut debug_struct = f.debug_struct("ListJobsRequest");
17966        debug_struct.field("parent", &self.parent);
17967        debug_struct.field("page_size", &self.page_size);
17968        debug_struct.field("page_token", &self.page_token);
17969        debug_struct.field("filter", &self.filter);
17970        debug_struct.field("order_by", &self.order_by);
17971        if !self._unknown_fields.is_empty() {
17972            debug_struct.field("_unknown_fields", &self._unknown_fields);
17973        }
17974        debug_struct.finish()
17975    }
17976}
17977
17978/// Request message for `TranscoderService.GetJob`.
17979#[derive(Clone, Default, PartialEq)]
17980#[non_exhaustive]
17981pub struct GetJobRequest {
17982    /// Required. The name of the job to retrieve.
17983    /// Format: `projects/{project}/locations/{location}/jobs/{job}`
17984    pub name: std::string::String,
17985
17986    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17987}
17988
17989impl GetJobRequest {
17990    pub fn new() -> Self {
17991        std::default::Default::default()
17992    }
17993
17994    /// Sets the value of [name][crate::model::GetJobRequest::name].
17995    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17996        self.name = v.into();
17997        self
17998    }
17999}
18000
18001impl wkt::message::Message for GetJobRequest {
18002    fn typename() -> &'static str {
18003        "type.googleapis.com/google.cloud.video.transcoder.v1.GetJobRequest"
18004    }
18005}
18006
18007#[doc(hidden)]
18008impl<'de> serde::de::Deserialize<'de> for GetJobRequest {
18009    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18010    where
18011        D: serde::Deserializer<'de>,
18012    {
18013        #[allow(non_camel_case_types)]
18014        #[doc(hidden)]
18015        #[derive(PartialEq, Eq, Hash)]
18016        enum __FieldTag {
18017            __name,
18018            Unknown(std::string::String),
18019        }
18020        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
18021            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18022            where
18023                D: serde::Deserializer<'de>,
18024            {
18025                struct Visitor;
18026                impl<'de> serde::de::Visitor<'de> for Visitor {
18027                    type Value = __FieldTag;
18028                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18029                        formatter.write_str("a field name for GetJobRequest")
18030                    }
18031                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
18032                    where
18033                        E: serde::de::Error,
18034                    {
18035                        use std::result::Result::Ok;
18036                        use std::string::ToString;
18037                        match value {
18038                            "name" => Ok(__FieldTag::__name),
18039                            _ => Ok(__FieldTag::Unknown(value.to_string())),
18040                        }
18041                    }
18042                }
18043                deserializer.deserialize_identifier(Visitor)
18044            }
18045        }
18046        struct Visitor;
18047        impl<'de> serde::de::Visitor<'de> for Visitor {
18048            type Value = GetJobRequest;
18049            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18050                formatter.write_str("struct GetJobRequest")
18051            }
18052            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
18053            where
18054                A: serde::de::MapAccess<'de>,
18055            {
18056                #[allow(unused_imports)]
18057                use serde::de::Error;
18058                use std::option::Option::Some;
18059                let mut fields = std::collections::HashSet::new();
18060                let mut result = Self::Value::new();
18061                while let Some(tag) = map.next_key::<__FieldTag>()? {
18062                    #[allow(clippy::match_single_binding)]
18063                    match tag {
18064                        __FieldTag::__name => {
18065                            if !fields.insert(__FieldTag::__name) {
18066                                return std::result::Result::Err(A::Error::duplicate_field(
18067                                    "multiple values for name",
18068                                ));
18069                            }
18070                            result.name = map
18071                                .next_value::<std::option::Option<std::string::String>>()?
18072                                .unwrap_or_default();
18073                        }
18074                        __FieldTag::Unknown(key) => {
18075                            let value = map.next_value::<serde_json::Value>()?;
18076                            result._unknown_fields.insert(key, value);
18077                        }
18078                    }
18079                }
18080                std::result::Result::Ok(result)
18081            }
18082        }
18083        deserializer.deserialize_any(Visitor)
18084    }
18085}
18086
18087#[doc(hidden)]
18088impl serde::ser::Serialize for GetJobRequest {
18089    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18090    where
18091        S: serde::ser::Serializer,
18092    {
18093        use serde::ser::SerializeMap;
18094        #[allow(unused_imports)]
18095        use std::option::Option::Some;
18096        let mut state = serializer.serialize_map(std::option::Option::None)?;
18097        if !self.name.is_empty() {
18098            state.serialize_entry("name", &self.name)?;
18099        }
18100        if !self._unknown_fields.is_empty() {
18101            for (key, value) in self._unknown_fields.iter() {
18102                state.serialize_entry(key, &value)?;
18103            }
18104        }
18105        state.end()
18106    }
18107}
18108
18109impl std::fmt::Debug for GetJobRequest {
18110    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18111        let mut debug_struct = f.debug_struct("GetJobRequest");
18112        debug_struct.field("name", &self.name);
18113        if !self._unknown_fields.is_empty() {
18114            debug_struct.field("_unknown_fields", &self._unknown_fields);
18115        }
18116        debug_struct.finish()
18117    }
18118}
18119
18120/// Request message for `TranscoderService.DeleteJob`.
18121#[derive(Clone, Default, PartialEq)]
18122#[non_exhaustive]
18123pub struct DeleteJobRequest {
18124    /// Required. The name of the job to delete.
18125    /// Format: `projects/{project}/locations/{location}/jobs/{job}`
18126    pub name: std::string::String,
18127
18128    /// If set to true, and the job is not found, the request will succeed but no
18129    /// action will be taken on the server.
18130    pub allow_missing: bool,
18131
18132    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18133}
18134
18135impl DeleteJobRequest {
18136    pub fn new() -> Self {
18137        std::default::Default::default()
18138    }
18139
18140    /// Sets the value of [name][crate::model::DeleteJobRequest::name].
18141    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18142        self.name = v.into();
18143        self
18144    }
18145
18146    /// Sets the value of [allow_missing][crate::model::DeleteJobRequest::allow_missing].
18147    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
18148        self.allow_missing = v.into();
18149        self
18150    }
18151}
18152
18153impl wkt::message::Message for DeleteJobRequest {
18154    fn typename() -> &'static str {
18155        "type.googleapis.com/google.cloud.video.transcoder.v1.DeleteJobRequest"
18156    }
18157}
18158
18159#[doc(hidden)]
18160impl<'de> serde::de::Deserialize<'de> for DeleteJobRequest {
18161    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18162    where
18163        D: serde::Deserializer<'de>,
18164    {
18165        #[allow(non_camel_case_types)]
18166        #[doc(hidden)]
18167        #[derive(PartialEq, Eq, Hash)]
18168        enum __FieldTag {
18169            __name,
18170            __allow_missing,
18171            Unknown(std::string::String),
18172        }
18173        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
18174            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18175            where
18176                D: serde::Deserializer<'de>,
18177            {
18178                struct Visitor;
18179                impl<'de> serde::de::Visitor<'de> for Visitor {
18180                    type Value = __FieldTag;
18181                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18182                        formatter.write_str("a field name for DeleteJobRequest")
18183                    }
18184                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
18185                    where
18186                        E: serde::de::Error,
18187                    {
18188                        use std::result::Result::Ok;
18189                        use std::string::ToString;
18190                        match value {
18191                            "name" => Ok(__FieldTag::__name),
18192                            "allowMissing" => Ok(__FieldTag::__allow_missing),
18193                            "allow_missing" => Ok(__FieldTag::__allow_missing),
18194                            _ => Ok(__FieldTag::Unknown(value.to_string())),
18195                        }
18196                    }
18197                }
18198                deserializer.deserialize_identifier(Visitor)
18199            }
18200        }
18201        struct Visitor;
18202        impl<'de> serde::de::Visitor<'de> for Visitor {
18203            type Value = DeleteJobRequest;
18204            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18205                formatter.write_str("struct DeleteJobRequest")
18206            }
18207            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
18208            where
18209                A: serde::de::MapAccess<'de>,
18210            {
18211                #[allow(unused_imports)]
18212                use serde::de::Error;
18213                use std::option::Option::Some;
18214                let mut fields = std::collections::HashSet::new();
18215                let mut result = Self::Value::new();
18216                while let Some(tag) = map.next_key::<__FieldTag>()? {
18217                    #[allow(clippy::match_single_binding)]
18218                    match tag {
18219                        __FieldTag::__name => {
18220                            if !fields.insert(__FieldTag::__name) {
18221                                return std::result::Result::Err(A::Error::duplicate_field(
18222                                    "multiple values for name",
18223                                ));
18224                            }
18225                            result.name = map
18226                                .next_value::<std::option::Option<std::string::String>>()?
18227                                .unwrap_or_default();
18228                        }
18229                        __FieldTag::__allow_missing => {
18230                            if !fields.insert(__FieldTag::__allow_missing) {
18231                                return std::result::Result::Err(A::Error::duplicate_field(
18232                                    "multiple values for allow_missing",
18233                                ));
18234                            }
18235                            result.allow_missing = map
18236                                .next_value::<std::option::Option<bool>>()?
18237                                .unwrap_or_default();
18238                        }
18239                        __FieldTag::Unknown(key) => {
18240                            let value = map.next_value::<serde_json::Value>()?;
18241                            result._unknown_fields.insert(key, value);
18242                        }
18243                    }
18244                }
18245                std::result::Result::Ok(result)
18246            }
18247        }
18248        deserializer.deserialize_any(Visitor)
18249    }
18250}
18251
18252#[doc(hidden)]
18253impl serde::ser::Serialize for DeleteJobRequest {
18254    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18255    where
18256        S: serde::ser::Serializer,
18257    {
18258        use serde::ser::SerializeMap;
18259        #[allow(unused_imports)]
18260        use std::option::Option::Some;
18261        let mut state = serializer.serialize_map(std::option::Option::None)?;
18262        if !self.name.is_empty() {
18263            state.serialize_entry("name", &self.name)?;
18264        }
18265        if !wkt::internal::is_default(&self.allow_missing) {
18266            state.serialize_entry("allowMissing", &self.allow_missing)?;
18267        }
18268        if !self._unknown_fields.is_empty() {
18269            for (key, value) in self._unknown_fields.iter() {
18270                state.serialize_entry(key, &value)?;
18271            }
18272        }
18273        state.end()
18274    }
18275}
18276
18277impl std::fmt::Debug for DeleteJobRequest {
18278    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18279        let mut debug_struct = f.debug_struct("DeleteJobRequest");
18280        debug_struct.field("name", &self.name);
18281        debug_struct.field("allow_missing", &self.allow_missing);
18282        if !self._unknown_fields.is_empty() {
18283            debug_struct.field("_unknown_fields", &self._unknown_fields);
18284        }
18285        debug_struct.finish()
18286    }
18287}
18288
18289/// Response message for `TranscoderService.ListJobs`.
18290#[derive(Clone, Default, PartialEq)]
18291#[non_exhaustive]
18292pub struct ListJobsResponse {
18293    /// List of jobs in the specified region.
18294    pub jobs: std::vec::Vec<crate::model::Job>,
18295
18296    /// The pagination token.
18297    pub next_page_token: std::string::String,
18298
18299    /// List of regions that could not be reached.
18300    pub unreachable: std::vec::Vec<std::string::String>,
18301
18302    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18303}
18304
18305impl ListJobsResponse {
18306    pub fn new() -> Self {
18307        std::default::Default::default()
18308    }
18309
18310    /// Sets the value of [jobs][crate::model::ListJobsResponse::jobs].
18311    pub fn set_jobs<T, V>(mut self, v: T) -> Self
18312    where
18313        T: std::iter::IntoIterator<Item = V>,
18314        V: std::convert::Into<crate::model::Job>,
18315    {
18316        use std::iter::Iterator;
18317        self.jobs = v.into_iter().map(|i| i.into()).collect();
18318        self
18319    }
18320
18321    /// Sets the value of [next_page_token][crate::model::ListJobsResponse::next_page_token].
18322    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18323        self.next_page_token = v.into();
18324        self
18325    }
18326
18327    /// Sets the value of [unreachable][crate::model::ListJobsResponse::unreachable].
18328    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
18329    where
18330        T: std::iter::IntoIterator<Item = V>,
18331        V: std::convert::Into<std::string::String>,
18332    {
18333        use std::iter::Iterator;
18334        self.unreachable = v.into_iter().map(|i| i.into()).collect();
18335        self
18336    }
18337}
18338
18339impl wkt::message::Message for ListJobsResponse {
18340    fn typename() -> &'static str {
18341        "type.googleapis.com/google.cloud.video.transcoder.v1.ListJobsResponse"
18342    }
18343}
18344
18345#[doc(hidden)]
18346impl gax::paginator::internal::PageableResponse for ListJobsResponse {
18347    type PageItem = crate::model::Job;
18348
18349    fn items(self) -> std::vec::Vec<Self::PageItem> {
18350        self.jobs
18351    }
18352
18353    fn next_page_token(&self) -> std::string::String {
18354        use std::clone::Clone;
18355        self.next_page_token.clone()
18356    }
18357}
18358
18359#[doc(hidden)]
18360impl<'de> serde::de::Deserialize<'de> for ListJobsResponse {
18361    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18362    where
18363        D: serde::Deserializer<'de>,
18364    {
18365        #[allow(non_camel_case_types)]
18366        #[doc(hidden)]
18367        #[derive(PartialEq, Eq, Hash)]
18368        enum __FieldTag {
18369            __jobs,
18370            __next_page_token,
18371            __unreachable,
18372            Unknown(std::string::String),
18373        }
18374        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
18375            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18376            where
18377                D: serde::Deserializer<'de>,
18378            {
18379                struct Visitor;
18380                impl<'de> serde::de::Visitor<'de> for Visitor {
18381                    type Value = __FieldTag;
18382                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18383                        formatter.write_str("a field name for ListJobsResponse")
18384                    }
18385                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
18386                    where
18387                        E: serde::de::Error,
18388                    {
18389                        use std::result::Result::Ok;
18390                        use std::string::ToString;
18391                        match value {
18392                            "jobs" => Ok(__FieldTag::__jobs),
18393                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
18394                            "next_page_token" => Ok(__FieldTag::__next_page_token),
18395                            "unreachable" => Ok(__FieldTag::__unreachable),
18396                            _ => Ok(__FieldTag::Unknown(value.to_string())),
18397                        }
18398                    }
18399                }
18400                deserializer.deserialize_identifier(Visitor)
18401            }
18402        }
18403        struct Visitor;
18404        impl<'de> serde::de::Visitor<'de> for Visitor {
18405            type Value = ListJobsResponse;
18406            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18407                formatter.write_str("struct ListJobsResponse")
18408            }
18409            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
18410            where
18411                A: serde::de::MapAccess<'de>,
18412            {
18413                #[allow(unused_imports)]
18414                use serde::de::Error;
18415                use std::option::Option::Some;
18416                let mut fields = std::collections::HashSet::new();
18417                let mut result = Self::Value::new();
18418                while let Some(tag) = map.next_key::<__FieldTag>()? {
18419                    #[allow(clippy::match_single_binding)]
18420                    match tag {
18421                        __FieldTag::__jobs => {
18422                            if !fields.insert(__FieldTag::__jobs) {
18423                                return std::result::Result::Err(A::Error::duplicate_field(
18424                                    "multiple values for jobs",
18425                                ));
18426                            }
18427                            result.jobs = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Job>>>()?.unwrap_or_default();
18428                        }
18429                        __FieldTag::__next_page_token => {
18430                            if !fields.insert(__FieldTag::__next_page_token) {
18431                                return std::result::Result::Err(A::Error::duplicate_field(
18432                                    "multiple values for next_page_token",
18433                                ));
18434                            }
18435                            result.next_page_token = map
18436                                .next_value::<std::option::Option<std::string::String>>()?
18437                                .unwrap_or_default();
18438                        }
18439                        __FieldTag::__unreachable => {
18440                            if !fields.insert(__FieldTag::__unreachable) {
18441                                return std::result::Result::Err(A::Error::duplicate_field(
18442                                    "multiple values for unreachable",
18443                                ));
18444                            }
18445                            result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
18446                        }
18447                        __FieldTag::Unknown(key) => {
18448                            let value = map.next_value::<serde_json::Value>()?;
18449                            result._unknown_fields.insert(key, value);
18450                        }
18451                    }
18452                }
18453                std::result::Result::Ok(result)
18454            }
18455        }
18456        deserializer.deserialize_any(Visitor)
18457    }
18458}
18459
18460#[doc(hidden)]
18461impl serde::ser::Serialize for ListJobsResponse {
18462    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18463    where
18464        S: serde::ser::Serializer,
18465    {
18466        use serde::ser::SerializeMap;
18467        #[allow(unused_imports)]
18468        use std::option::Option::Some;
18469        let mut state = serializer.serialize_map(std::option::Option::None)?;
18470        if !self.jobs.is_empty() {
18471            state.serialize_entry("jobs", &self.jobs)?;
18472        }
18473        if !self.next_page_token.is_empty() {
18474            state.serialize_entry("nextPageToken", &self.next_page_token)?;
18475        }
18476        if !self.unreachable.is_empty() {
18477            state.serialize_entry("unreachable", &self.unreachable)?;
18478        }
18479        if !self._unknown_fields.is_empty() {
18480            for (key, value) in self._unknown_fields.iter() {
18481                state.serialize_entry(key, &value)?;
18482            }
18483        }
18484        state.end()
18485    }
18486}
18487
18488impl std::fmt::Debug for ListJobsResponse {
18489    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18490        let mut debug_struct = f.debug_struct("ListJobsResponse");
18491        debug_struct.field("jobs", &self.jobs);
18492        debug_struct.field("next_page_token", &self.next_page_token);
18493        debug_struct.field("unreachable", &self.unreachable);
18494        if !self._unknown_fields.is_empty() {
18495            debug_struct.field("_unknown_fields", &self._unknown_fields);
18496        }
18497        debug_struct.finish()
18498    }
18499}
18500
18501/// Request message for `TranscoderService.CreateJobTemplate`.
18502#[derive(Clone, Default, PartialEq)]
18503#[non_exhaustive]
18504pub struct CreateJobTemplateRequest {
18505    /// Required. The parent location to create this job template.
18506    /// Format: `projects/{project}/locations/{location}`
18507    pub parent: std::string::String,
18508
18509    /// Required. Parameters for creating job template.
18510    pub job_template: std::option::Option<crate::model::JobTemplate>,
18511
18512    /// Required. The ID to use for the job template, which will become the final
18513    /// component of the job template's resource name.
18514    ///
18515    /// This value should be 4-63 characters, and valid characters must match the
18516    /// regular expression `[a-zA-Z][a-zA-Z0-9_-]*`.
18517    pub job_template_id: std::string::String,
18518
18519    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18520}
18521
18522impl CreateJobTemplateRequest {
18523    pub fn new() -> Self {
18524        std::default::Default::default()
18525    }
18526
18527    /// Sets the value of [parent][crate::model::CreateJobTemplateRequest::parent].
18528    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18529        self.parent = v.into();
18530        self
18531    }
18532
18533    /// Sets the value of [job_template][crate::model::CreateJobTemplateRequest::job_template].
18534    pub fn set_job_template<T>(mut self, v: T) -> Self
18535    where
18536        T: std::convert::Into<crate::model::JobTemplate>,
18537    {
18538        self.job_template = std::option::Option::Some(v.into());
18539        self
18540    }
18541
18542    /// Sets or clears the value of [job_template][crate::model::CreateJobTemplateRequest::job_template].
18543    pub fn set_or_clear_job_template<T>(mut self, v: std::option::Option<T>) -> Self
18544    where
18545        T: std::convert::Into<crate::model::JobTemplate>,
18546    {
18547        self.job_template = v.map(|x| x.into());
18548        self
18549    }
18550
18551    /// Sets the value of [job_template_id][crate::model::CreateJobTemplateRequest::job_template_id].
18552    pub fn set_job_template_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18553        self.job_template_id = v.into();
18554        self
18555    }
18556}
18557
18558impl wkt::message::Message for CreateJobTemplateRequest {
18559    fn typename() -> &'static str {
18560        "type.googleapis.com/google.cloud.video.transcoder.v1.CreateJobTemplateRequest"
18561    }
18562}
18563
18564#[doc(hidden)]
18565impl<'de> serde::de::Deserialize<'de> for CreateJobTemplateRequest {
18566    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18567    where
18568        D: serde::Deserializer<'de>,
18569    {
18570        #[allow(non_camel_case_types)]
18571        #[doc(hidden)]
18572        #[derive(PartialEq, Eq, Hash)]
18573        enum __FieldTag {
18574            __parent,
18575            __job_template,
18576            __job_template_id,
18577            Unknown(std::string::String),
18578        }
18579        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
18580            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18581            where
18582                D: serde::Deserializer<'de>,
18583            {
18584                struct Visitor;
18585                impl<'de> serde::de::Visitor<'de> for Visitor {
18586                    type Value = __FieldTag;
18587                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18588                        formatter.write_str("a field name for CreateJobTemplateRequest")
18589                    }
18590                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
18591                    where
18592                        E: serde::de::Error,
18593                    {
18594                        use std::result::Result::Ok;
18595                        use std::string::ToString;
18596                        match value {
18597                            "parent" => Ok(__FieldTag::__parent),
18598                            "jobTemplate" => Ok(__FieldTag::__job_template),
18599                            "job_template" => Ok(__FieldTag::__job_template),
18600                            "jobTemplateId" => Ok(__FieldTag::__job_template_id),
18601                            "job_template_id" => Ok(__FieldTag::__job_template_id),
18602                            _ => Ok(__FieldTag::Unknown(value.to_string())),
18603                        }
18604                    }
18605                }
18606                deserializer.deserialize_identifier(Visitor)
18607            }
18608        }
18609        struct Visitor;
18610        impl<'de> serde::de::Visitor<'de> for Visitor {
18611            type Value = CreateJobTemplateRequest;
18612            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18613                formatter.write_str("struct CreateJobTemplateRequest")
18614            }
18615            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
18616            where
18617                A: serde::de::MapAccess<'de>,
18618            {
18619                #[allow(unused_imports)]
18620                use serde::de::Error;
18621                use std::option::Option::Some;
18622                let mut fields = std::collections::HashSet::new();
18623                let mut result = Self::Value::new();
18624                while let Some(tag) = map.next_key::<__FieldTag>()? {
18625                    #[allow(clippy::match_single_binding)]
18626                    match tag {
18627                        __FieldTag::__parent => {
18628                            if !fields.insert(__FieldTag::__parent) {
18629                                return std::result::Result::Err(A::Error::duplicate_field(
18630                                    "multiple values for parent",
18631                                ));
18632                            }
18633                            result.parent = map
18634                                .next_value::<std::option::Option<std::string::String>>()?
18635                                .unwrap_or_default();
18636                        }
18637                        __FieldTag::__job_template => {
18638                            if !fields.insert(__FieldTag::__job_template) {
18639                                return std::result::Result::Err(A::Error::duplicate_field(
18640                                    "multiple values for job_template",
18641                                ));
18642                            }
18643                            result.job_template =
18644                                map.next_value::<std::option::Option<crate::model::JobTemplate>>()?;
18645                        }
18646                        __FieldTag::__job_template_id => {
18647                            if !fields.insert(__FieldTag::__job_template_id) {
18648                                return std::result::Result::Err(A::Error::duplicate_field(
18649                                    "multiple values for job_template_id",
18650                                ));
18651                            }
18652                            result.job_template_id = map
18653                                .next_value::<std::option::Option<std::string::String>>()?
18654                                .unwrap_or_default();
18655                        }
18656                        __FieldTag::Unknown(key) => {
18657                            let value = map.next_value::<serde_json::Value>()?;
18658                            result._unknown_fields.insert(key, value);
18659                        }
18660                    }
18661                }
18662                std::result::Result::Ok(result)
18663            }
18664        }
18665        deserializer.deserialize_any(Visitor)
18666    }
18667}
18668
18669#[doc(hidden)]
18670impl serde::ser::Serialize for CreateJobTemplateRequest {
18671    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18672    where
18673        S: serde::ser::Serializer,
18674    {
18675        use serde::ser::SerializeMap;
18676        #[allow(unused_imports)]
18677        use std::option::Option::Some;
18678        let mut state = serializer.serialize_map(std::option::Option::None)?;
18679        if !self.parent.is_empty() {
18680            state.serialize_entry("parent", &self.parent)?;
18681        }
18682        if self.job_template.is_some() {
18683            state.serialize_entry("jobTemplate", &self.job_template)?;
18684        }
18685        if !self.job_template_id.is_empty() {
18686            state.serialize_entry("jobTemplateId", &self.job_template_id)?;
18687        }
18688        if !self._unknown_fields.is_empty() {
18689            for (key, value) in self._unknown_fields.iter() {
18690                state.serialize_entry(key, &value)?;
18691            }
18692        }
18693        state.end()
18694    }
18695}
18696
18697impl std::fmt::Debug for CreateJobTemplateRequest {
18698    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18699        let mut debug_struct = f.debug_struct("CreateJobTemplateRequest");
18700        debug_struct.field("parent", &self.parent);
18701        debug_struct.field("job_template", &self.job_template);
18702        debug_struct.field("job_template_id", &self.job_template_id);
18703        if !self._unknown_fields.is_empty() {
18704            debug_struct.field("_unknown_fields", &self._unknown_fields);
18705        }
18706        debug_struct.finish()
18707    }
18708}
18709
18710/// Request message for `TranscoderService.ListJobTemplates`.
18711#[derive(Clone, Default, PartialEq)]
18712#[non_exhaustive]
18713pub struct ListJobTemplatesRequest {
18714    /// Required. The parent location from which to retrieve the collection of job
18715    /// templates. Format: `projects/{project}/locations/{location}`
18716    pub parent: std::string::String,
18717
18718    /// The maximum number of items to return.
18719    pub page_size: i32,
18720
18721    /// The `next_page_token` value returned from a previous List request, if
18722    /// any.
18723    pub page_token: std::string::String,
18724
18725    /// The filter expression, following the syntax outlined in
18726    /// <https://google.aip.dev/160>.
18727    pub filter: std::string::String,
18728
18729    /// One or more fields to compare and use to sort the output.
18730    /// See <https://google.aip.dev/132#ordering>.
18731    pub order_by: std::string::String,
18732
18733    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18734}
18735
18736impl ListJobTemplatesRequest {
18737    pub fn new() -> Self {
18738        std::default::Default::default()
18739    }
18740
18741    /// Sets the value of [parent][crate::model::ListJobTemplatesRequest::parent].
18742    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18743        self.parent = v.into();
18744        self
18745    }
18746
18747    /// Sets the value of [page_size][crate::model::ListJobTemplatesRequest::page_size].
18748    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18749        self.page_size = v.into();
18750        self
18751    }
18752
18753    /// Sets the value of [page_token][crate::model::ListJobTemplatesRequest::page_token].
18754    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18755        self.page_token = v.into();
18756        self
18757    }
18758
18759    /// Sets the value of [filter][crate::model::ListJobTemplatesRequest::filter].
18760    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18761        self.filter = v.into();
18762        self
18763    }
18764
18765    /// Sets the value of [order_by][crate::model::ListJobTemplatesRequest::order_by].
18766    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18767        self.order_by = v.into();
18768        self
18769    }
18770}
18771
18772impl wkt::message::Message for ListJobTemplatesRequest {
18773    fn typename() -> &'static str {
18774        "type.googleapis.com/google.cloud.video.transcoder.v1.ListJobTemplatesRequest"
18775    }
18776}
18777
18778#[doc(hidden)]
18779impl<'de> serde::de::Deserialize<'de> for ListJobTemplatesRequest {
18780    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18781    where
18782        D: serde::Deserializer<'de>,
18783    {
18784        #[allow(non_camel_case_types)]
18785        #[doc(hidden)]
18786        #[derive(PartialEq, Eq, Hash)]
18787        enum __FieldTag {
18788            __parent,
18789            __page_size,
18790            __page_token,
18791            __filter,
18792            __order_by,
18793            Unknown(std::string::String),
18794        }
18795        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
18796            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18797            where
18798                D: serde::Deserializer<'de>,
18799            {
18800                struct Visitor;
18801                impl<'de> serde::de::Visitor<'de> for Visitor {
18802                    type Value = __FieldTag;
18803                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18804                        formatter.write_str("a field name for ListJobTemplatesRequest")
18805                    }
18806                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
18807                    where
18808                        E: serde::de::Error,
18809                    {
18810                        use std::result::Result::Ok;
18811                        use std::string::ToString;
18812                        match value {
18813                            "parent" => Ok(__FieldTag::__parent),
18814                            "pageSize" => Ok(__FieldTag::__page_size),
18815                            "page_size" => Ok(__FieldTag::__page_size),
18816                            "pageToken" => Ok(__FieldTag::__page_token),
18817                            "page_token" => Ok(__FieldTag::__page_token),
18818                            "filter" => Ok(__FieldTag::__filter),
18819                            "orderBy" => Ok(__FieldTag::__order_by),
18820                            "order_by" => Ok(__FieldTag::__order_by),
18821                            _ => Ok(__FieldTag::Unknown(value.to_string())),
18822                        }
18823                    }
18824                }
18825                deserializer.deserialize_identifier(Visitor)
18826            }
18827        }
18828        struct Visitor;
18829        impl<'de> serde::de::Visitor<'de> for Visitor {
18830            type Value = ListJobTemplatesRequest;
18831            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18832                formatter.write_str("struct ListJobTemplatesRequest")
18833            }
18834            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
18835            where
18836                A: serde::de::MapAccess<'de>,
18837            {
18838                #[allow(unused_imports)]
18839                use serde::de::Error;
18840                use std::option::Option::Some;
18841                let mut fields = std::collections::HashSet::new();
18842                let mut result = Self::Value::new();
18843                while let Some(tag) = map.next_key::<__FieldTag>()? {
18844                    #[allow(clippy::match_single_binding)]
18845                    match tag {
18846                        __FieldTag::__parent => {
18847                            if !fields.insert(__FieldTag::__parent) {
18848                                return std::result::Result::Err(A::Error::duplicate_field(
18849                                    "multiple values for parent",
18850                                ));
18851                            }
18852                            result.parent = map
18853                                .next_value::<std::option::Option<std::string::String>>()?
18854                                .unwrap_or_default();
18855                        }
18856                        __FieldTag::__page_size => {
18857                            if !fields.insert(__FieldTag::__page_size) {
18858                                return std::result::Result::Err(A::Error::duplicate_field(
18859                                    "multiple values for page_size",
18860                                ));
18861                            }
18862                            struct __With(std::option::Option<i32>);
18863                            impl<'de> serde::de::Deserialize<'de> for __With {
18864                                fn deserialize<D>(
18865                                    deserializer: D,
18866                                ) -> std::result::Result<Self, D::Error>
18867                                where
18868                                    D: serde::de::Deserializer<'de>,
18869                                {
18870                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
18871                                }
18872                            }
18873                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
18874                        }
18875                        __FieldTag::__page_token => {
18876                            if !fields.insert(__FieldTag::__page_token) {
18877                                return std::result::Result::Err(A::Error::duplicate_field(
18878                                    "multiple values for page_token",
18879                                ));
18880                            }
18881                            result.page_token = map
18882                                .next_value::<std::option::Option<std::string::String>>()?
18883                                .unwrap_or_default();
18884                        }
18885                        __FieldTag::__filter => {
18886                            if !fields.insert(__FieldTag::__filter) {
18887                                return std::result::Result::Err(A::Error::duplicate_field(
18888                                    "multiple values for filter",
18889                                ));
18890                            }
18891                            result.filter = map
18892                                .next_value::<std::option::Option<std::string::String>>()?
18893                                .unwrap_or_default();
18894                        }
18895                        __FieldTag::__order_by => {
18896                            if !fields.insert(__FieldTag::__order_by) {
18897                                return std::result::Result::Err(A::Error::duplicate_field(
18898                                    "multiple values for order_by",
18899                                ));
18900                            }
18901                            result.order_by = map
18902                                .next_value::<std::option::Option<std::string::String>>()?
18903                                .unwrap_or_default();
18904                        }
18905                        __FieldTag::Unknown(key) => {
18906                            let value = map.next_value::<serde_json::Value>()?;
18907                            result._unknown_fields.insert(key, value);
18908                        }
18909                    }
18910                }
18911                std::result::Result::Ok(result)
18912            }
18913        }
18914        deserializer.deserialize_any(Visitor)
18915    }
18916}
18917
18918#[doc(hidden)]
18919impl serde::ser::Serialize for ListJobTemplatesRequest {
18920    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18921    where
18922        S: serde::ser::Serializer,
18923    {
18924        use serde::ser::SerializeMap;
18925        #[allow(unused_imports)]
18926        use std::option::Option::Some;
18927        let mut state = serializer.serialize_map(std::option::Option::None)?;
18928        if !self.parent.is_empty() {
18929            state.serialize_entry("parent", &self.parent)?;
18930        }
18931        if !wkt::internal::is_default(&self.page_size) {
18932            struct __With<'a>(&'a i32);
18933            impl<'a> serde::ser::Serialize for __With<'a> {
18934                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18935                where
18936                    S: serde::ser::Serializer,
18937                {
18938                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
18939                }
18940            }
18941            state.serialize_entry("pageSize", &__With(&self.page_size))?;
18942        }
18943        if !self.page_token.is_empty() {
18944            state.serialize_entry("pageToken", &self.page_token)?;
18945        }
18946        if !self.filter.is_empty() {
18947            state.serialize_entry("filter", &self.filter)?;
18948        }
18949        if !self.order_by.is_empty() {
18950            state.serialize_entry("orderBy", &self.order_by)?;
18951        }
18952        if !self._unknown_fields.is_empty() {
18953            for (key, value) in self._unknown_fields.iter() {
18954                state.serialize_entry(key, &value)?;
18955            }
18956        }
18957        state.end()
18958    }
18959}
18960
18961impl std::fmt::Debug for ListJobTemplatesRequest {
18962    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18963        let mut debug_struct = f.debug_struct("ListJobTemplatesRequest");
18964        debug_struct.field("parent", &self.parent);
18965        debug_struct.field("page_size", &self.page_size);
18966        debug_struct.field("page_token", &self.page_token);
18967        debug_struct.field("filter", &self.filter);
18968        debug_struct.field("order_by", &self.order_by);
18969        if !self._unknown_fields.is_empty() {
18970            debug_struct.field("_unknown_fields", &self._unknown_fields);
18971        }
18972        debug_struct.finish()
18973    }
18974}
18975
18976/// Request message for `TranscoderService.GetJobTemplate`.
18977#[derive(Clone, Default, PartialEq)]
18978#[non_exhaustive]
18979pub struct GetJobTemplateRequest {
18980    /// Required. The name of the job template to retrieve.
18981    /// Format:
18982    /// `projects/{project}/locations/{location}/jobTemplates/{job_template}`
18983    pub name: std::string::String,
18984
18985    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18986}
18987
18988impl GetJobTemplateRequest {
18989    pub fn new() -> Self {
18990        std::default::Default::default()
18991    }
18992
18993    /// Sets the value of [name][crate::model::GetJobTemplateRequest::name].
18994    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18995        self.name = v.into();
18996        self
18997    }
18998}
18999
19000impl wkt::message::Message for GetJobTemplateRequest {
19001    fn typename() -> &'static str {
19002        "type.googleapis.com/google.cloud.video.transcoder.v1.GetJobTemplateRequest"
19003    }
19004}
19005
19006#[doc(hidden)]
19007impl<'de> serde::de::Deserialize<'de> for GetJobTemplateRequest {
19008    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19009    where
19010        D: serde::Deserializer<'de>,
19011    {
19012        #[allow(non_camel_case_types)]
19013        #[doc(hidden)]
19014        #[derive(PartialEq, Eq, Hash)]
19015        enum __FieldTag {
19016            __name,
19017            Unknown(std::string::String),
19018        }
19019        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
19020            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19021            where
19022                D: serde::Deserializer<'de>,
19023            {
19024                struct Visitor;
19025                impl<'de> serde::de::Visitor<'de> for Visitor {
19026                    type Value = __FieldTag;
19027                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
19028                        formatter.write_str("a field name for GetJobTemplateRequest")
19029                    }
19030                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
19031                    where
19032                        E: serde::de::Error,
19033                    {
19034                        use std::result::Result::Ok;
19035                        use std::string::ToString;
19036                        match value {
19037                            "name" => Ok(__FieldTag::__name),
19038                            _ => Ok(__FieldTag::Unknown(value.to_string())),
19039                        }
19040                    }
19041                }
19042                deserializer.deserialize_identifier(Visitor)
19043            }
19044        }
19045        struct Visitor;
19046        impl<'de> serde::de::Visitor<'de> for Visitor {
19047            type Value = GetJobTemplateRequest;
19048            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
19049                formatter.write_str("struct GetJobTemplateRequest")
19050            }
19051            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
19052            where
19053                A: serde::de::MapAccess<'de>,
19054            {
19055                #[allow(unused_imports)]
19056                use serde::de::Error;
19057                use std::option::Option::Some;
19058                let mut fields = std::collections::HashSet::new();
19059                let mut result = Self::Value::new();
19060                while let Some(tag) = map.next_key::<__FieldTag>()? {
19061                    #[allow(clippy::match_single_binding)]
19062                    match tag {
19063                        __FieldTag::__name => {
19064                            if !fields.insert(__FieldTag::__name) {
19065                                return std::result::Result::Err(A::Error::duplicate_field(
19066                                    "multiple values for name",
19067                                ));
19068                            }
19069                            result.name = map
19070                                .next_value::<std::option::Option<std::string::String>>()?
19071                                .unwrap_or_default();
19072                        }
19073                        __FieldTag::Unknown(key) => {
19074                            let value = map.next_value::<serde_json::Value>()?;
19075                            result._unknown_fields.insert(key, value);
19076                        }
19077                    }
19078                }
19079                std::result::Result::Ok(result)
19080            }
19081        }
19082        deserializer.deserialize_any(Visitor)
19083    }
19084}
19085
19086#[doc(hidden)]
19087impl serde::ser::Serialize for GetJobTemplateRequest {
19088    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19089    where
19090        S: serde::ser::Serializer,
19091    {
19092        use serde::ser::SerializeMap;
19093        #[allow(unused_imports)]
19094        use std::option::Option::Some;
19095        let mut state = serializer.serialize_map(std::option::Option::None)?;
19096        if !self.name.is_empty() {
19097            state.serialize_entry("name", &self.name)?;
19098        }
19099        if !self._unknown_fields.is_empty() {
19100            for (key, value) in self._unknown_fields.iter() {
19101                state.serialize_entry(key, &value)?;
19102            }
19103        }
19104        state.end()
19105    }
19106}
19107
19108impl std::fmt::Debug for GetJobTemplateRequest {
19109    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19110        let mut debug_struct = f.debug_struct("GetJobTemplateRequest");
19111        debug_struct.field("name", &self.name);
19112        if !self._unknown_fields.is_empty() {
19113            debug_struct.field("_unknown_fields", &self._unknown_fields);
19114        }
19115        debug_struct.finish()
19116    }
19117}
19118
19119/// Request message for `TranscoderService.DeleteJobTemplate`.
19120#[derive(Clone, Default, PartialEq)]
19121#[non_exhaustive]
19122pub struct DeleteJobTemplateRequest {
19123    /// Required. The name of the job template to delete.
19124    /// `projects/{project}/locations/{location}/jobTemplates/{job_template}`
19125    pub name: std::string::String,
19126
19127    /// If set to true, and the job template is not found, the request will succeed
19128    /// but no action will be taken on the server.
19129    pub allow_missing: bool,
19130
19131    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19132}
19133
19134impl DeleteJobTemplateRequest {
19135    pub fn new() -> Self {
19136        std::default::Default::default()
19137    }
19138
19139    /// Sets the value of [name][crate::model::DeleteJobTemplateRequest::name].
19140    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19141        self.name = v.into();
19142        self
19143    }
19144
19145    /// Sets the value of [allow_missing][crate::model::DeleteJobTemplateRequest::allow_missing].
19146    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
19147        self.allow_missing = v.into();
19148        self
19149    }
19150}
19151
19152impl wkt::message::Message for DeleteJobTemplateRequest {
19153    fn typename() -> &'static str {
19154        "type.googleapis.com/google.cloud.video.transcoder.v1.DeleteJobTemplateRequest"
19155    }
19156}
19157
19158#[doc(hidden)]
19159impl<'de> serde::de::Deserialize<'de> for DeleteJobTemplateRequest {
19160    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19161    where
19162        D: serde::Deserializer<'de>,
19163    {
19164        #[allow(non_camel_case_types)]
19165        #[doc(hidden)]
19166        #[derive(PartialEq, Eq, Hash)]
19167        enum __FieldTag {
19168            __name,
19169            __allow_missing,
19170            Unknown(std::string::String),
19171        }
19172        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
19173            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19174            where
19175                D: serde::Deserializer<'de>,
19176            {
19177                struct Visitor;
19178                impl<'de> serde::de::Visitor<'de> for Visitor {
19179                    type Value = __FieldTag;
19180                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
19181                        formatter.write_str("a field name for DeleteJobTemplateRequest")
19182                    }
19183                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
19184                    where
19185                        E: serde::de::Error,
19186                    {
19187                        use std::result::Result::Ok;
19188                        use std::string::ToString;
19189                        match value {
19190                            "name" => Ok(__FieldTag::__name),
19191                            "allowMissing" => Ok(__FieldTag::__allow_missing),
19192                            "allow_missing" => Ok(__FieldTag::__allow_missing),
19193                            _ => Ok(__FieldTag::Unknown(value.to_string())),
19194                        }
19195                    }
19196                }
19197                deserializer.deserialize_identifier(Visitor)
19198            }
19199        }
19200        struct Visitor;
19201        impl<'de> serde::de::Visitor<'de> for Visitor {
19202            type Value = DeleteJobTemplateRequest;
19203            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
19204                formatter.write_str("struct DeleteJobTemplateRequest")
19205            }
19206            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
19207            where
19208                A: serde::de::MapAccess<'de>,
19209            {
19210                #[allow(unused_imports)]
19211                use serde::de::Error;
19212                use std::option::Option::Some;
19213                let mut fields = std::collections::HashSet::new();
19214                let mut result = Self::Value::new();
19215                while let Some(tag) = map.next_key::<__FieldTag>()? {
19216                    #[allow(clippy::match_single_binding)]
19217                    match tag {
19218                        __FieldTag::__name => {
19219                            if !fields.insert(__FieldTag::__name) {
19220                                return std::result::Result::Err(A::Error::duplicate_field(
19221                                    "multiple values for name",
19222                                ));
19223                            }
19224                            result.name = map
19225                                .next_value::<std::option::Option<std::string::String>>()?
19226                                .unwrap_or_default();
19227                        }
19228                        __FieldTag::__allow_missing => {
19229                            if !fields.insert(__FieldTag::__allow_missing) {
19230                                return std::result::Result::Err(A::Error::duplicate_field(
19231                                    "multiple values for allow_missing",
19232                                ));
19233                            }
19234                            result.allow_missing = map
19235                                .next_value::<std::option::Option<bool>>()?
19236                                .unwrap_or_default();
19237                        }
19238                        __FieldTag::Unknown(key) => {
19239                            let value = map.next_value::<serde_json::Value>()?;
19240                            result._unknown_fields.insert(key, value);
19241                        }
19242                    }
19243                }
19244                std::result::Result::Ok(result)
19245            }
19246        }
19247        deserializer.deserialize_any(Visitor)
19248    }
19249}
19250
19251#[doc(hidden)]
19252impl serde::ser::Serialize for DeleteJobTemplateRequest {
19253    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19254    where
19255        S: serde::ser::Serializer,
19256    {
19257        use serde::ser::SerializeMap;
19258        #[allow(unused_imports)]
19259        use std::option::Option::Some;
19260        let mut state = serializer.serialize_map(std::option::Option::None)?;
19261        if !self.name.is_empty() {
19262            state.serialize_entry("name", &self.name)?;
19263        }
19264        if !wkt::internal::is_default(&self.allow_missing) {
19265            state.serialize_entry("allowMissing", &self.allow_missing)?;
19266        }
19267        if !self._unknown_fields.is_empty() {
19268            for (key, value) in self._unknown_fields.iter() {
19269                state.serialize_entry(key, &value)?;
19270            }
19271        }
19272        state.end()
19273    }
19274}
19275
19276impl std::fmt::Debug for DeleteJobTemplateRequest {
19277    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19278        let mut debug_struct = f.debug_struct("DeleteJobTemplateRequest");
19279        debug_struct.field("name", &self.name);
19280        debug_struct.field("allow_missing", &self.allow_missing);
19281        if !self._unknown_fields.is_empty() {
19282            debug_struct.field("_unknown_fields", &self._unknown_fields);
19283        }
19284        debug_struct.finish()
19285    }
19286}
19287
19288/// Response message for `TranscoderService.ListJobTemplates`.
19289#[derive(Clone, Default, PartialEq)]
19290#[non_exhaustive]
19291pub struct ListJobTemplatesResponse {
19292    /// List of job templates in the specified region.
19293    pub job_templates: std::vec::Vec<crate::model::JobTemplate>,
19294
19295    /// The pagination token.
19296    pub next_page_token: std::string::String,
19297
19298    /// List of regions that could not be reached.
19299    pub unreachable: std::vec::Vec<std::string::String>,
19300
19301    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19302}
19303
19304impl ListJobTemplatesResponse {
19305    pub fn new() -> Self {
19306        std::default::Default::default()
19307    }
19308
19309    /// Sets the value of [job_templates][crate::model::ListJobTemplatesResponse::job_templates].
19310    pub fn set_job_templates<T, V>(mut self, v: T) -> Self
19311    where
19312        T: std::iter::IntoIterator<Item = V>,
19313        V: std::convert::Into<crate::model::JobTemplate>,
19314    {
19315        use std::iter::Iterator;
19316        self.job_templates = v.into_iter().map(|i| i.into()).collect();
19317        self
19318    }
19319
19320    /// Sets the value of [next_page_token][crate::model::ListJobTemplatesResponse::next_page_token].
19321    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19322        self.next_page_token = v.into();
19323        self
19324    }
19325
19326    /// Sets the value of [unreachable][crate::model::ListJobTemplatesResponse::unreachable].
19327    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
19328    where
19329        T: std::iter::IntoIterator<Item = V>,
19330        V: std::convert::Into<std::string::String>,
19331    {
19332        use std::iter::Iterator;
19333        self.unreachable = v.into_iter().map(|i| i.into()).collect();
19334        self
19335    }
19336}
19337
19338impl wkt::message::Message for ListJobTemplatesResponse {
19339    fn typename() -> &'static str {
19340        "type.googleapis.com/google.cloud.video.transcoder.v1.ListJobTemplatesResponse"
19341    }
19342}
19343
19344#[doc(hidden)]
19345impl gax::paginator::internal::PageableResponse for ListJobTemplatesResponse {
19346    type PageItem = crate::model::JobTemplate;
19347
19348    fn items(self) -> std::vec::Vec<Self::PageItem> {
19349        self.job_templates
19350    }
19351
19352    fn next_page_token(&self) -> std::string::String {
19353        use std::clone::Clone;
19354        self.next_page_token.clone()
19355    }
19356}
19357
19358#[doc(hidden)]
19359impl<'de> serde::de::Deserialize<'de> for ListJobTemplatesResponse {
19360    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19361    where
19362        D: serde::Deserializer<'de>,
19363    {
19364        #[allow(non_camel_case_types)]
19365        #[doc(hidden)]
19366        #[derive(PartialEq, Eq, Hash)]
19367        enum __FieldTag {
19368            __job_templates,
19369            __next_page_token,
19370            __unreachable,
19371            Unknown(std::string::String),
19372        }
19373        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
19374            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19375            where
19376                D: serde::Deserializer<'de>,
19377            {
19378                struct Visitor;
19379                impl<'de> serde::de::Visitor<'de> for Visitor {
19380                    type Value = __FieldTag;
19381                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
19382                        formatter.write_str("a field name for ListJobTemplatesResponse")
19383                    }
19384                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
19385                    where
19386                        E: serde::de::Error,
19387                    {
19388                        use std::result::Result::Ok;
19389                        use std::string::ToString;
19390                        match value {
19391                            "jobTemplates" => Ok(__FieldTag::__job_templates),
19392                            "job_templates" => Ok(__FieldTag::__job_templates),
19393                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
19394                            "next_page_token" => Ok(__FieldTag::__next_page_token),
19395                            "unreachable" => Ok(__FieldTag::__unreachable),
19396                            _ => Ok(__FieldTag::Unknown(value.to_string())),
19397                        }
19398                    }
19399                }
19400                deserializer.deserialize_identifier(Visitor)
19401            }
19402        }
19403        struct Visitor;
19404        impl<'de> serde::de::Visitor<'de> for Visitor {
19405            type Value = ListJobTemplatesResponse;
19406            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
19407                formatter.write_str("struct ListJobTemplatesResponse")
19408            }
19409            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
19410            where
19411                A: serde::de::MapAccess<'de>,
19412            {
19413                #[allow(unused_imports)]
19414                use serde::de::Error;
19415                use std::option::Option::Some;
19416                let mut fields = std::collections::HashSet::new();
19417                let mut result = Self::Value::new();
19418                while let Some(tag) = map.next_key::<__FieldTag>()? {
19419                    #[allow(clippy::match_single_binding)]
19420                    match tag {
19421                        __FieldTag::__job_templates => {
19422                            if !fields.insert(__FieldTag::__job_templates) {
19423                                return std::result::Result::Err(A::Error::duplicate_field(
19424                                    "multiple values for job_templates",
19425                                ));
19426                            }
19427                            result.job_templates = map.next_value::<std::option::Option<std::vec::Vec<crate::model::JobTemplate>>>()?.unwrap_or_default();
19428                        }
19429                        __FieldTag::__next_page_token => {
19430                            if !fields.insert(__FieldTag::__next_page_token) {
19431                                return std::result::Result::Err(A::Error::duplicate_field(
19432                                    "multiple values for next_page_token",
19433                                ));
19434                            }
19435                            result.next_page_token = map
19436                                .next_value::<std::option::Option<std::string::String>>()?
19437                                .unwrap_or_default();
19438                        }
19439                        __FieldTag::__unreachable => {
19440                            if !fields.insert(__FieldTag::__unreachable) {
19441                                return std::result::Result::Err(A::Error::duplicate_field(
19442                                    "multiple values for unreachable",
19443                                ));
19444                            }
19445                            result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
19446                        }
19447                        __FieldTag::Unknown(key) => {
19448                            let value = map.next_value::<serde_json::Value>()?;
19449                            result._unknown_fields.insert(key, value);
19450                        }
19451                    }
19452                }
19453                std::result::Result::Ok(result)
19454            }
19455        }
19456        deserializer.deserialize_any(Visitor)
19457    }
19458}
19459
19460#[doc(hidden)]
19461impl serde::ser::Serialize for ListJobTemplatesResponse {
19462    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19463    where
19464        S: serde::ser::Serializer,
19465    {
19466        use serde::ser::SerializeMap;
19467        #[allow(unused_imports)]
19468        use std::option::Option::Some;
19469        let mut state = serializer.serialize_map(std::option::Option::None)?;
19470        if !self.job_templates.is_empty() {
19471            state.serialize_entry("jobTemplates", &self.job_templates)?;
19472        }
19473        if !self.next_page_token.is_empty() {
19474            state.serialize_entry("nextPageToken", &self.next_page_token)?;
19475        }
19476        if !self.unreachable.is_empty() {
19477            state.serialize_entry("unreachable", &self.unreachable)?;
19478        }
19479        if !self._unknown_fields.is_empty() {
19480            for (key, value) in self._unknown_fields.iter() {
19481                state.serialize_entry(key, &value)?;
19482            }
19483        }
19484        state.end()
19485    }
19486}
19487
19488impl std::fmt::Debug for ListJobTemplatesResponse {
19489    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19490        let mut debug_struct = f.debug_struct("ListJobTemplatesResponse");
19491        debug_struct.field("job_templates", &self.job_templates);
19492        debug_struct.field("next_page_token", &self.next_page_token);
19493        debug_struct.field("unreachable", &self.unreachable);
19494        if !self._unknown_fields.is_empty() {
19495            debug_struct.field("_unknown_fields", &self._unknown_fields);
19496        }
19497        debug_struct.finish()
19498    }
19499}