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    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1881}
1882
1883impl Input {
1884    pub fn new() -> Self {
1885        std::default::Default::default()
1886    }
1887
1888    /// Sets the value of [key][crate::model::Input::key].
1889    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1890        self.key = v.into();
1891        self
1892    }
1893
1894    /// Sets the value of [uri][crate::model::Input::uri].
1895    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1896        self.uri = v.into();
1897        self
1898    }
1899
1900    /// Sets the value of [preprocessing_config][crate::model::Input::preprocessing_config].
1901    pub fn set_preprocessing_config<T>(mut self, v: T) -> Self
1902    where
1903        T: std::convert::Into<crate::model::PreprocessingConfig>,
1904    {
1905        self.preprocessing_config = std::option::Option::Some(v.into());
1906        self
1907    }
1908
1909    /// Sets or clears the value of [preprocessing_config][crate::model::Input::preprocessing_config].
1910    pub fn set_or_clear_preprocessing_config<T>(mut self, v: std::option::Option<T>) -> Self
1911    where
1912        T: std::convert::Into<crate::model::PreprocessingConfig>,
1913    {
1914        self.preprocessing_config = v.map(|x| x.into());
1915        self
1916    }
1917}
1918
1919impl wkt::message::Message for Input {
1920    fn typename() -> &'static str {
1921        "type.googleapis.com/google.cloud.video.transcoder.v1.Input"
1922    }
1923}
1924
1925#[doc(hidden)]
1926impl<'de> serde::de::Deserialize<'de> for Input {
1927    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1928    where
1929        D: serde::Deserializer<'de>,
1930    {
1931        #[allow(non_camel_case_types)]
1932        #[doc(hidden)]
1933        #[derive(PartialEq, Eq, Hash)]
1934        enum __FieldTag {
1935            __key,
1936            __uri,
1937            __preprocessing_config,
1938            Unknown(std::string::String),
1939        }
1940        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1941            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1942            where
1943                D: serde::Deserializer<'de>,
1944            {
1945                struct Visitor;
1946                impl<'de> serde::de::Visitor<'de> for Visitor {
1947                    type Value = __FieldTag;
1948                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1949                        formatter.write_str("a field name for Input")
1950                    }
1951                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1952                    where
1953                        E: serde::de::Error,
1954                    {
1955                        use std::result::Result::Ok;
1956                        use std::string::ToString;
1957                        match value {
1958                            "key" => Ok(__FieldTag::__key),
1959                            "uri" => Ok(__FieldTag::__uri),
1960                            "preprocessingConfig" => Ok(__FieldTag::__preprocessing_config),
1961                            "preprocessing_config" => Ok(__FieldTag::__preprocessing_config),
1962                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1963                        }
1964                    }
1965                }
1966                deserializer.deserialize_identifier(Visitor)
1967            }
1968        }
1969        struct Visitor;
1970        impl<'de> serde::de::Visitor<'de> for Visitor {
1971            type Value = Input;
1972            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1973                formatter.write_str("struct Input")
1974            }
1975            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1976            where
1977                A: serde::de::MapAccess<'de>,
1978            {
1979                #[allow(unused_imports)]
1980                use serde::de::Error;
1981                use std::option::Option::Some;
1982                let mut fields = std::collections::HashSet::new();
1983                let mut result = Self::Value::new();
1984                while let Some(tag) = map.next_key::<__FieldTag>()? {
1985                    #[allow(clippy::match_single_binding)]
1986                    match tag {
1987                        __FieldTag::__key => {
1988                            if !fields.insert(__FieldTag::__key) {
1989                                return std::result::Result::Err(A::Error::duplicate_field(
1990                                    "multiple values for key",
1991                                ));
1992                            }
1993                            result.key = map
1994                                .next_value::<std::option::Option<std::string::String>>()?
1995                                .unwrap_or_default();
1996                        }
1997                        __FieldTag::__uri => {
1998                            if !fields.insert(__FieldTag::__uri) {
1999                                return std::result::Result::Err(A::Error::duplicate_field(
2000                                    "multiple values for uri",
2001                                ));
2002                            }
2003                            result.uri = map
2004                                .next_value::<std::option::Option<std::string::String>>()?
2005                                .unwrap_or_default();
2006                        }
2007                        __FieldTag::__preprocessing_config => {
2008                            if !fields.insert(__FieldTag::__preprocessing_config) {
2009                                return std::result::Result::Err(A::Error::duplicate_field(
2010                                    "multiple values for preprocessing_config",
2011                                ));
2012                            }
2013                            result.preprocessing_config = map.next_value::<std::option::Option<crate::model::PreprocessingConfig>>()?
2014                                ;
2015                        }
2016                        __FieldTag::Unknown(key) => {
2017                            let value = map.next_value::<serde_json::Value>()?;
2018                            result._unknown_fields.insert(key, value);
2019                        }
2020                    }
2021                }
2022                std::result::Result::Ok(result)
2023            }
2024        }
2025        deserializer.deserialize_any(Visitor)
2026    }
2027}
2028
2029#[doc(hidden)]
2030impl serde::ser::Serialize for Input {
2031    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2032    where
2033        S: serde::ser::Serializer,
2034    {
2035        use serde::ser::SerializeMap;
2036        #[allow(unused_imports)]
2037        use std::option::Option::Some;
2038        let mut state = serializer.serialize_map(std::option::Option::None)?;
2039        if !self.key.is_empty() {
2040            state.serialize_entry("key", &self.key)?;
2041        }
2042        if !self.uri.is_empty() {
2043            state.serialize_entry("uri", &self.uri)?;
2044        }
2045        if self.preprocessing_config.is_some() {
2046            state.serialize_entry("preprocessingConfig", &self.preprocessing_config)?;
2047        }
2048        if !self._unknown_fields.is_empty() {
2049            for (key, value) in self._unknown_fields.iter() {
2050                state.serialize_entry(key, &value)?;
2051            }
2052        }
2053        state.end()
2054    }
2055}
2056
2057impl std::fmt::Debug for Input {
2058    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2059        let mut debug_struct = f.debug_struct("Input");
2060        debug_struct.field("key", &self.key);
2061        debug_struct.field("uri", &self.uri);
2062        debug_struct.field("preprocessing_config", &self.preprocessing_config);
2063        if !self._unknown_fields.is_empty() {
2064            debug_struct.field("_unknown_fields", &self._unknown_fields);
2065        }
2066        debug_struct.finish()
2067    }
2068}
2069
2070/// Location of output file(s) in a Cloud Storage bucket.
2071#[derive(Clone, Default, PartialEq)]
2072#[non_exhaustive]
2073pub struct Output {
2074    /// URI for the output file(s). For example, `gs://my-bucket/outputs/`. Must be
2075    /// a directory and not a top-level bucket. If empty, the value is populated
2076    /// from [Job.output_uri][google.cloud.video.transcoder.v1.Job.output_uri]. See
2077    /// [Supported input and output
2078    /// formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats).
2079    ///
2080    /// [google.cloud.video.transcoder.v1.Job.output_uri]: crate::model::Job::output_uri
2081    pub uri: std::string::String,
2082
2083    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2084}
2085
2086impl Output {
2087    pub fn new() -> Self {
2088        std::default::Default::default()
2089    }
2090
2091    /// Sets the value of [uri][crate::model::Output::uri].
2092    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2093        self.uri = v.into();
2094        self
2095    }
2096}
2097
2098impl wkt::message::Message for Output {
2099    fn typename() -> &'static str {
2100        "type.googleapis.com/google.cloud.video.transcoder.v1.Output"
2101    }
2102}
2103
2104#[doc(hidden)]
2105impl<'de> serde::de::Deserialize<'de> for Output {
2106    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2107    where
2108        D: serde::Deserializer<'de>,
2109    {
2110        #[allow(non_camel_case_types)]
2111        #[doc(hidden)]
2112        #[derive(PartialEq, Eq, Hash)]
2113        enum __FieldTag {
2114            __uri,
2115            Unknown(std::string::String),
2116        }
2117        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2118            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2119            where
2120                D: serde::Deserializer<'de>,
2121            {
2122                struct Visitor;
2123                impl<'de> serde::de::Visitor<'de> for Visitor {
2124                    type Value = __FieldTag;
2125                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2126                        formatter.write_str("a field name for Output")
2127                    }
2128                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2129                    where
2130                        E: serde::de::Error,
2131                    {
2132                        use std::result::Result::Ok;
2133                        use std::string::ToString;
2134                        match value {
2135                            "uri" => Ok(__FieldTag::__uri),
2136                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2137                        }
2138                    }
2139                }
2140                deserializer.deserialize_identifier(Visitor)
2141            }
2142        }
2143        struct Visitor;
2144        impl<'de> serde::de::Visitor<'de> for Visitor {
2145            type Value = Output;
2146            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2147                formatter.write_str("struct Output")
2148            }
2149            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2150            where
2151                A: serde::de::MapAccess<'de>,
2152            {
2153                #[allow(unused_imports)]
2154                use serde::de::Error;
2155                use std::option::Option::Some;
2156                let mut fields = std::collections::HashSet::new();
2157                let mut result = Self::Value::new();
2158                while let Some(tag) = map.next_key::<__FieldTag>()? {
2159                    #[allow(clippy::match_single_binding)]
2160                    match tag {
2161                        __FieldTag::__uri => {
2162                            if !fields.insert(__FieldTag::__uri) {
2163                                return std::result::Result::Err(A::Error::duplicate_field(
2164                                    "multiple values for uri",
2165                                ));
2166                            }
2167                            result.uri = map
2168                                .next_value::<std::option::Option<std::string::String>>()?
2169                                .unwrap_or_default();
2170                        }
2171                        __FieldTag::Unknown(key) => {
2172                            let value = map.next_value::<serde_json::Value>()?;
2173                            result._unknown_fields.insert(key, value);
2174                        }
2175                    }
2176                }
2177                std::result::Result::Ok(result)
2178            }
2179        }
2180        deserializer.deserialize_any(Visitor)
2181    }
2182}
2183
2184#[doc(hidden)]
2185impl serde::ser::Serialize for Output {
2186    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2187    where
2188        S: serde::ser::Serializer,
2189    {
2190        use serde::ser::SerializeMap;
2191        #[allow(unused_imports)]
2192        use std::option::Option::Some;
2193        let mut state = serializer.serialize_map(std::option::Option::None)?;
2194        if !self.uri.is_empty() {
2195            state.serialize_entry("uri", &self.uri)?;
2196        }
2197        if !self._unknown_fields.is_empty() {
2198            for (key, value) in self._unknown_fields.iter() {
2199                state.serialize_entry(key, &value)?;
2200            }
2201        }
2202        state.end()
2203    }
2204}
2205
2206impl std::fmt::Debug for Output {
2207    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2208        let mut debug_struct = f.debug_struct("Output");
2209        debug_struct.field("uri", &self.uri);
2210        if !self._unknown_fields.is_empty() {
2211            debug_struct.field("_unknown_fields", &self._unknown_fields);
2212        }
2213        debug_struct.finish()
2214    }
2215}
2216
2217/// Edit atom.
2218#[derive(Clone, Default, PartialEq)]
2219#[non_exhaustive]
2220pub struct EditAtom {
2221    /// A unique key for this atom. Must be specified when using advanced
2222    /// mapping.
2223    pub key: std::string::String,
2224
2225    /// List of [Input.key][google.cloud.video.transcoder.v1.Input.key] values
2226    /// identifying files that should be used in this atom. The listed `inputs`
2227    /// must have the same timeline.
2228    ///
2229    /// [google.cloud.video.transcoder.v1.Input.key]: crate::model::Input::key
2230    pub inputs: std::vec::Vec<std::string::String>,
2231
2232    /// End time in seconds for the atom, relative to the input file timeline.
2233    /// When `end_time_offset` is not specified, the `inputs` are used until
2234    /// the end of the atom.
2235    pub end_time_offset: std::option::Option<wkt::Duration>,
2236
2237    /// Start time in seconds for the atom, relative to the input file timeline.
2238    /// The default is `0s`.
2239    pub start_time_offset: std::option::Option<wkt::Duration>,
2240
2241    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2242}
2243
2244impl EditAtom {
2245    pub fn new() -> Self {
2246        std::default::Default::default()
2247    }
2248
2249    /// Sets the value of [key][crate::model::EditAtom::key].
2250    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2251        self.key = v.into();
2252        self
2253    }
2254
2255    /// Sets the value of [inputs][crate::model::EditAtom::inputs].
2256    pub fn set_inputs<T, V>(mut self, v: T) -> Self
2257    where
2258        T: std::iter::IntoIterator<Item = V>,
2259        V: std::convert::Into<std::string::String>,
2260    {
2261        use std::iter::Iterator;
2262        self.inputs = v.into_iter().map(|i| i.into()).collect();
2263        self
2264    }
2265
2266    /// Sets the value of [end_time_offset][crate::model::EditAtom::end_time_offset].
2267    pub fn set_end_time_offset<T>(mut self, v: T) -> Self
2268    where
2269        T: std::convert::Into<wkt::Duration>,
2270    {
2271        self.end_time_offset = std::option::Option::Some(v.into());
2272        self
2273    }
2274
2275    /// Sets or clears the value of [end_time_offset][crate::model::EditAtom::end_time_offset].
2276    pub fn set_or_clear_end_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
2277    where
2278        T: std::convert::Into<wkt::Duration>,
2279    {
2280        self.end_time_offset = v.map(|x| x.into());
2281        self
2282    }
2283
2284    /// Sets the value of [start_time_offset][crate::model::EditAtom::start_time_offset].
2285    pub fn set_start_time_offset<T>(mut self, v: T) -> Self
2286    where
2287        T: std::convert::Into<wkt::Duration>,
2288    {
2289        self.start_time_offset = std::option::Option::Some(v.into());
2290        self
2291    }
2292
2293    /// Sets or clears the value of [start_time_offset][crate::model::EditAtom::start_time_offset].
2294    pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
2295    where
2296        T: std::convert::Into<wkt::Duration>,
2297    {
2298        self.start_time_offset = v.map(|x| x.into());
2299        self
2300    }
2301}
2302
2303impl wkt::message::Message for EditAtom {
2304    fn typename() -> &'static str {
2305        "type.googleapis.com/google.cloud.video.transcoder.v1.EditAtom"
2306    }
2307}
2308
2309#[doc(hidden)]
2310impl<'de> serde::de::Deserialize<'de> for EditAtom {
2311    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2312    where
2313        D: serde::Deserializer<'de>,
2314    {
2315        #[allow(non_camel_case_types)]
2316        #[doc(hidden)]
2317        #[derive(PartialEq, Eq, Hash)]
2318        enum __FieldTag {
2319            __key,
2320            __inputs,
2321            __end_time_offset,
2322            __start_time_offset,
2323            Unknown(std::string::String),
2324        }
2325        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2326            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2327            where
2328                D: serde::Deserializer<'de>,
2329            {
2330                struct Visitor;
2331                impl<'de> serde::de::Visitor<'de> for Visitor {
2332                    type Value = __FieldTag;
2333                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2334                        formatter.write_str("a field name for EditAtom")
2335                    }
2336                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2337                    where
2338                        E: serde::de::Error,
2339                    {
2340                        use std::result::Result::Ok;
2341                        use std::string::ToString;
2342                        match value {
2343                            "key" => Ok(__FieldTag::__key),
2344                            "inputs" => Ok(__FieldTag::__inputs),
2345                            "endTimeOffset" => Ok(__FieldTag::__end_time_offset),
2346                            "end_time_offset" => Ok(__FieldTag::__end_time_offset),
2347                            "startTimeOffset" => Ok(__FieldTag::__start_time_offset),
2348                            "start_time_offset" => Ok(__FieldTag::__start_time_offset),
2349                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2350                        }
2351                    }
2352                }
2353                deserializer.deserialize_identifier(Visitor)
2354            }
2355        }
2356        struct Visitor;
2357        impl<'de> serde::de::Visitor<'de> for Visitor {
2358            type Value = EditAtom;
2359            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2360                formatter.write_str("struct EditAtom")
2361            }
2362            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2363            where
2364                A: serde::de::MapAccess<'de>,
2365            {
2366                #[allow(unused_imports)]
2367                use serde::de::Error;
2368                use std::option::Option::Some;
2369                let mut fields = std::collections::HashSet::new();
2370                let mut result = Self::Value::new();
2371                while let Some(tag) = map.next_key::<__FieldTag>()? {
2372                    #[allow(clippy::match_single_binding)]
2373                    match tag {
2374                        __FieldTag::__key => {
2375                            if !fields.insert(__FieldTag::__key) {
2376                                return std::result::Result::Err(A::Error::duplicate_field(
2377                                    "multiple values for key",
2378                                ));
2379                            }
2380                            result.key = map
2381                                .next_value::<std::option::Option<std::string::String>>()?
2382                                .unwrap_or_default();
2383                        }
2384                        __FieldTag::__inputs => {
2385                            if !fields.insert(__FieldTag::__inputs) {
2386                                return std::result::Result::Err(A::Error::duplicate_field(
2387                                    "multiple values for inputs",
2388                                ));
2389                            }
2390                            result.inputs = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
2391                        }
2392                        __FieldTag::__end_time_offset => {
2393                            if !fields.insert(__FieldTag::__end_time_offset) {
2394                                return std::result::Result::Err(A::Error::duplicate_field(
2395                                    "multiple values for end_time_offset",
2396                                ));
2397                            }
2398                            result.end_time_offset =
2399                                map.next_value::<std::option::Option<wkt::Duration>>()?;
2400                        }
2401                        __FieldTag::__start_time_offset => {
2402                            if !fields.insert(__FieldTag::__start_time_offset) {
2403                                return std::result::Result::Err(A::Error::duplicate_field(
2404                                    "multiple values for start_time_offset",
2405                                ));
2406                            }
2407                            result.start_time_offset =
2408                                map.next_value::<std::option::Option<wkt::Duration>>()?;
2409                        }
2410                        __FieldTag::Unknown(key) => {
2411                            let value = map.next_value::<serde_json::Value>()?;
2412                            result._unknown_fields.insert(key, value);
2413                        }
2414                    }
2415                }
2416                std::result::Result::Ok(result)
2417            }
2418        }
2419        deserializer.deserialize_any(Visitor)
2420    }
2421}
2422
2423#[doc(hidden)]
2424impl serde::ser::Serialize for EditAtom {
2425    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2426    where
2427        S: serde::ser::Serializer,
2428    {
2429        use serde::ser::SerializeMap;
2430        #[allow(unused_imports)]
2431        use std::option::Option::Some;
2432        let mut state = serializer.serialize_map(std::option::Option::None)?;
2433        if !self.key.is_empty() {
2434            state.serialize_entry("key", &self.key)?;
2435        }
2436        if !self.inputs.is_empty() {
2437            state.serialize_entry("inputs", &self.inputs)?;
2438        }
2439        if self.end_time_offset.is_some() {
2440            state.serialize_entry("endTimeOffset", &self.end_time_offset)?;
2441        }
2442        if self.start_time_offset.is_some() {
2443            state.serialize_entry("startTimeOffset", &self.start_time_offset)?;
2444        }
2445        if !self._unknown_fields.is_empty() {
2446            for (key, value) in self._unknown_fields.iter() {
2447                state.serialize_entry(key, &value)?;
2448            }
2449        }
2450        state.end()
2451    }
2452}
2453
2454impl std::fmt::Debug for EditAtom {
2455    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2456        let mut debug_struct = f.debug_struct("EditAtom");
2457        debug_struct.field("key", &self.key);
2458        debug_struct.field("inputs", &self.inputs);
2459        debug_struct.field("end_time_offset", &self.end_time_offset);
2460        debug_struct.field("start_time_offset", &self.start_time_offset);
2461        if !self._unknown_fields.is_empty() {
2462            debug_struct.field("_unknown_fields", &self._unknown_fields);
2463        }
2464        debug_struct.finish()
2465    }
2466}
2467
2468/// Ad break.
2469#[derive(Clone, Default, PartialEq)]
2470#[non_exhaustive]
2471pub struct AdBreak {
2472    /// Start time in seconds for the ad break, relative to the output file
2473    /// timeline. The default is `0s`.
2474    pub start_time_offset: std::option::Option<wkt::Duration>,
2475
2476    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2477}
2478
2479impl AdBreak {
2480    pub fn new() -> Self {
2481        std::default::Default::default()
2482    }
2483
2484    /// Sets the value of [start_time_offset][crate::model::AdBreak::start_time_offset].
2485    pub fn set_start_time_offset<T>(mut self, v: T) -> Self
2486    where
2487        T: std::convert::Into<wkt::Duration>,
2488    {
2489        self.start_time_offset = std::option::Option::Some(v.into());
2490        self
2491    }
2492
2493    /// Sets or clears the value of [start_time_offset][crate::model::AdBreak::start_time_offset].
2494    pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
2495    where
2496        T: std::convert::Into<wkt::Duration>,
2497    {
2498        self.start_time_offset = v.map(|x| x.into());
2499        self
2500    }
2501}
2502
2503impl wkt::message::Message for AdBreak {
2504    fn typename() -> &'static str {
2505        "type.googleapis.com/google.cloud.video.transcoder.v1.AdBreak"
2506    }
2507}
2508
2509#[doc(hidden)]
2510impl<'de> serde::de::Deserialize<'de> for AdBreak {
2511    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2512    where
2513        D: serde::Deserializer<'de>,
2514    {
2515        #[allow(non_camel_case_types)]
2516        #[doc(hidden)]
2517        #[derive(PartialEq, Eq, Hash)]
2518        enum __FieldTag {
2519            __start_time_offset,
2520            Unknown(std::string::String),
2521        }
2522        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2523            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2524            where
2525                D: serde::Deserializer<'de>,
2526            {
2527                struct Visitor;
2528                impl<'de> serde::de::Visitor<'de> for Visitor {
2529                    type Value = __FieldTag;
2530                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2531                        formatter.write_str("a field name for AdBreak")
2532                    }
2533                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2534                    where
2535                        E: serde::de::Error,
2536                    {
2537                        use std::result::Result::Ok;
2538                        use std::string::ToString;
2539                        match value {
2540                            "startTimeOffset" => Ok(__FieldTag::__start_time_offset),
2541                            "start_time_offset" => Ok(__FieldTag::__start_time_offset),
2542                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2543                        }
2544                    }
2545                }
2546                deserializer.deserialize_identifier(Visitor)
2547            }
2548        }
2549        struct Visitor;
2550        impl<'de> serde::de::Visitor<'de> for Visitor {
2551            type Value = AdBreak;
2552            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2553                formatter.write_str("struct AdBreak")
2554            }
2555            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2556            where
2557                A: serde::de::MapAccess<'de>,
2558            {
2559                #[allow(unused_imports)]
2560                use serde::de::Error;
2561                use std::option::Option::Some;
2562                let mut fields = std::collections::HashSet::new();
2563                let mut result = Self::Value::new();
2564                while let Some(tag) = map.next_key::<__FieldTag>()? {
2565                    #[allow(clippy::match_single_binding)]
2566                    match tag {
2567                        __FieldTag::__start_time_offset => {
2568                            if !fields.insert(__FieldTag::__start_time_offset) {
2569                                return std::result::Result::Err(A::Error::duplicate_field(
2570                                    "multiple values for start_time_offset",
2571                                ));
2572                            }
2573                            result.start_time_offset =
2574                                map.next_value::<std::option::Option<wkt::Duration>>()?;
2575                        }
2576                        __FieldTag::Unknown(key) => {
2577                            let value = map.next_value::<serde_json::Value>()?;
2578                            result._unknown_fields.insert(key, value);
2579                        }
2580                    }
2581                }
2582                std::result::Result::Ok(result)
2583            }
2584        }
2585        deserializer.deserialize_any(Visitor)
2586    }
2587}
2588
2589#[doc(hidden)]
2590impl serde::ser::Serialize for AdBreak {
2591    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2592    where
2593        S: serde::ser::Serializer,
2594    {
2595        use serde::ser::SerializeMap;
2596        #[allow(unused_imports)]
2597        use std::option::Option::Some;
2598        let mut state = serializer.serialize_map(std::option::Option::None)?;
2599        if self.start_time_offset.is_some() {
2600            state.serialize_entry("startTimeOffset", &self.start_time_offset)?;
2601        }
2602        if !self._unknown_fields.is_empty() {
2603            for (key, value) in self._unknown_fields.iter() {
2604                state.serialize_entry(key, &value)?;
2605            }
2606        }
2607        state.end()
2608    }
2609}
2610
2611impl std::fmt::Debug for AdBreak {
2612    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2613        let mut debug_struct = f.debug_struct("AdBreak");
2614        debug_struct.field("start_time_offset", &self.start_time_offset);
2615        if !self._unknown_fields.is_empty() {
2616            debug_struct.field("_unknown_fields", &self._unknown_fields);
2617        }
2618        debug_struct.finish()
2619    }
2620}
2621
2622/// Encoding of an input file such as an audio, video, or text track.
2623/// Elementary streams must be packaged before
2624/// mapping and sharing between different output formats.
2625#[derive(Clone, Default, PartialEq)]
2626#[non_exhaustive]
2627pub struct ElementaryStream {
2628    /// A unique key for this elementary stream.
2629    pub key: std::string::String,
2630
2631    /// Encoding of an audio, video, or text track.
2632    pub elementary_stream: std::option::Option<crate::model::elementary_stream::ElementaryStream>,
2633
2634    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2635}
2636
2637impl ElementaryStream {
2638    pub fn new() -> Self {
2639        std::default::Default::default()
2640    }
2641
2642    /// Sets the value of [key][crate::model::ElementaryStream::key].
2643    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2644        self.key = v.into();
2645        self
2646    }
2647
2648    /// Sets the value of [elementary_stream][crate::model::ElementaryStream::elementary_stream].
2649    ///
2650    /// Note that all the setters affecting `elementary_stream` are mutually
2651    /// exclusive.
2652    pub fn set_elementary_stream<
2653        T: std::convert::Into<std::option::Option<crate::model::elementary_stream::ElementaryStream>>,
2654    >(
2655        mut self,
2656        v: T,
2657    ) -> Self {
2658        self.elementary_stream = v.into();
2659        self
2660    }
2661
2662    /// The value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
2663    /// if it holds a `VideoStream`, `None` if the field is not set or
2664    /// holds a different branch.
2665    pub fn video_stream(&self) -> std::option::Option<&std::boxed::Box<crate::model::VideoStream>> {
2666        #[allow(unreachable_patterns)]
2667        self.elementary_stream.as_ref().and_then(|v| match v {
2668            crate::model::elementary_stream::ElementaryStream::VideoStream(v) => {
2669                std::option::Option::Some(v)
2670            }
2671            _ => std::option::Option::None,
2672        })
2673    }
2674
2675    /// Sets the value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
2676    /// to hold a `VideoStream`.
2677    ///
2678    /// Note that all the setters affecting `elementary_stream` are
2679    /// mutually exclusive.
2680    pub fn set_video_stream<T: std::convert::Into<std::boxed::Box<crate::model::VideoStream>>>(
2681        mut self,
2682        v: T,
2683    ) -> Self {
2684        self.elementary_stream = std::option::Option::Some(
2685            crate::model::elementary_stream::ElementaryStream::VideoStream(v.into()),
2686        );
2687        self
2688    }
2689
2690    /// The value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
2691    /// if it holds a `AudioStream`, `None` if the field is not set or
2692    /// holds a different branch.
2693    pub fn audio_stream(&self) -> std::option::Option<&std::boxed::Box<crate::model::AudioStream>> {
2694        #[allow(unreachable_patterns)]
2695        self.elementary_stream.as_ref().and_then(|v| match v {
2696            crate::model::elementary_stream::ElementaryStream::AudioStream(v) => {
2697                std::option::Option::Some(v)
2698            }
2699            _ => std::option::Option::None,
2700        })
2701    }
2702
2703    /// Sets the value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
2704    /// to hold a `AudioStream`.
2705    ///
2706    /// Note that all the setters affecting `elementary_stream` are
2707    /// mutually exclusive.
2708    pub fn set_audio_stream<T: std::convert::Into<std::boxed::Box<crate::model::AudioStream>>>(
2709        mut self,
2710        v: T,
2711    ) -> Self {
2712        self.elementary_stream = std::option::Option::Some(
2713            crate::model::elementary_stream::ElementaryStream::AudioStream(v.into()),
2714        );
2715        self
2716    }
2717
2718    /// The value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
2719    /// if it holds a `TextStream`, `None` if the field is not set or
2720    /// holds a different branch.
2721    pub fn text_stream(&self) -> std::option::Option<&std::boxed::Box<crate::model::TextStream>> {
2722        #[allow(unreachable_patterns)]
2723        self.elementary_stream.as_ref().and_then(|v| match v {
2724            crate::model::elementary_stream::ElementaryStream::TextStream(v) => {
2725                std::option::Option::Some(v)
2726            }
2727            _ => std::option::Option::None,
2728        })
2729    }
2730
2731    /// Sets the value of [elementary_stream][crate::model::ElementaryStream::elementary_stream]
2732    /// to hold a `TextStream`.
2733    ///
2734    /// Note that all the setters affecting `elementary_stream` are
2735    /// mutually exclusive.
2736    pub fn set_text_stream<T: std::convert::Into<std::boxed::Box<crate::model::TextStream>>>(
2737        mut self,
2738        v: T,
2739    ) -> Self {
2740        self.elementary_stream = std::option::Option::Some(
2741            crate::model::elementary_stream::ElementaryStream::TextStream(v.into()),
2742        );
2743        self
2744    }
2745}
2746
2747impl wkt::message::Message for ElementaryStream {
2748    fn typename() -> &'static str {
2749        "type.googleapis.com/google.cloud.video.transcoder.v1.ElementaryStream"
2750    }
2751}
2752
2753#[doc(hidden)]
2754impl<'de> serde::de::Deserialize<'de> for ElementaryStream {
2755    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2756    where
2757        D: serde::Deserializer<'de>,
2758    {
2759        #[allow(non_camel_case_types)]
2760        #[doc(hidden)]
2761        #[derive(PartialEq, Eq, Hash)]
2762        enum __FieldTag {
2763            __key,
2764            __video_stream,
2765            __audio_stream,
2766            __text_stream,
2767            Unknown(std::string::String),
2768        }
2769        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2770            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2771            where
2772                D: serde::Deserializer<'de>,
2773            {
2774                struct Visitor;
2775                impl<'de> serde::de::Visitor<'de> for Visitor {
2776                    type Value = __FieldTag;
2777                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2778                        formatter.write_str("a field name for ElementaryStream")
2779                    }
2780                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2781                    where
2782                        E: serde::de::Error,
2783                    {
2784                        use std::result::Result::Ok;
2785                        use std::string::ToString;
2786                        match value {
2787                            "key" => Ok(__FieldTag::__key),
2788                            "videoStream" => Ok(__FieldTag::__video_stream),
2789                            "video_stream" => Ok(__FieldTag::__video_stream),
2790                            "audioStream" => Ok(__FieldTag::__audio_stream),
2791                            "audio_stream" => Ok(__FieldTag::__audio_stream),
2792                            "textStream" => Ok(__FieldTag::__text_stream),
2793                            "text_stream" => Ok(__FieldTag::__text_stream),
2794                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2795                        }
2796                    }
2797                }
2798                deserializer.deserialize_identifier(Visitor)
2799            }
2800        }
2801        struct Visitor;
2802        impl<'de> serde::de::Visitor<'de> for Visitor {
2803            type Value = ElementaryStream;
2804            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2805                formatter.write_str("struct ElementaryStream")
2806            }
2807            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2808            where
2809                A: serde::de::MapAccess<'de>,
2810            {
2811                #[allow(unused_imports)]
2812                use serde::de::Error;
2813                use std::option::Option::Some;
2814                let mut fields = std::collections::HashSet::new();
2815                let mut result = Self::Value::new();
2816                while let Some(tag) = map.next_key::<__FieldTag>()? {
2817                    #[allow(clippy::match_single_binding)]
2818                    match tag {
2819                        __FieldTag::__key => {
2820                            if !fields.insert(__FieldTag::__key) {
2821                                return std::result::Result::Err(A::Error::duplicate_field(
2822                                    "multiple values for key",
2823                                ));
2824                            }
2825                            result.key = map
2826                                .next_value::<std::option::Option<std::string::String>>()?
2827                                .unwrap_or_default();
2828                        }
2829                        __FieldTag::__video_stream => {
2830                            if !fields.insert(__FieldTag::__video_stream) {
2831                                return std::result::Result::Err(A::Error::duplicate_field(
2832                                    "multiple values for video_stream",
2833                                ));
2834                            }
2835                            if result.elementary_stream.is_some() {
2836                                return std::result::Result::Err(A::Error::duplicate_field(
2837                                    "multiple values for `elementary_stream`, a oneof with full ID .google.cloud.video.transcoder.v1.ElementaryStream.video_stream, latest field was videoStream",
2838                                ));
2839                            }
2840                            result.elementary_stream = std::option::Option::Some(
2841                                crate::model::elementary_stream::ElementaryStream::VideoStream(
2842                                    map.next_value::<std::option::Option<
2843                                        std::boxed::Box<crate::model::VideoStream>,
2844                                    >>()?
2845                                    .unwrap_or_default(),
2846                                ),
2847                            );
2848                        }
2849                        __FieldTag::__audio_stream => {
2850                            if !fields.insert(__FieldTag::__audio_stream) {
2851                                return std::result::Result::Err(A::Error::duplicate_field(
2852                                    "multiple values for audio_stream",
2853                                ));
2854                            }
2855                            if result.elementary_stream.is_some() {
2856                                return std::result::Result::Err(A::Error::duplicate_field(
2857                                    "multiple values for `elementary_stream`, a oneof with full ID .google.cloud.video.transcoder.v1.ElementaryStream.audio_stream, latest field was audioStream",
2858                                ));
2859                            }
2860                            result.elementary_stream = std::option::Option::Some(
2861                                crate::model::elementary_stream::ElementaryStream::AudioStream(
2862                                    map.next_value::<std::option::Option<
2863                                        std::boxed::Box<crate::model::AudioStream>,
2864                                    >>()?
2865                                    .unwrap_or_default(),
2866                                ),
2867                            );
2868                        }
2869                        __FieldTag::__text_stream => {
2870                            if !fields.insert(__FieldTag::__text_stream) {
2871                                return std::result::Result::Err(A::Error::duplicate_field(
2872                                    "multiple values for text_stream",
2873                                ));
2874                            }
2875                            if result.elementary_stream.is_some() {
2876                                return std::result::Result::Err(A::Error::duplicate_field(
2877                                    "multiple values for `elementary_stream`, a oneof with full ID .google.cloud.video.transcoder.v1.ElementaryStream.text_stream, latest field was textStream",
2878                                ));
2879                            }
2880                            result.elementary_stream = std::option::Option::Some(
2881                                crate::model::elementary_stream::ElementaryStream::TextStream(
2882                                    map.next_value::<std::option::Option<
2883                                        std::boxed::Box<crate::model::TextStream>,
2884                                    >>()?
2885                                    .unwrap_or_default(),
2886                                ),
2887                            );
2888                        }
2889                        __FieldTag::Unknown(key) => {
2890                            let value = map.next_value::<serde_json::Value>()?;
2891                            result._unknown_fields.insert(key, value);
2892                        }
2893                    }
2894                }
2895                std::result::Result::Ok(result)
2896            }
2897        }
2898        deserializer.deserialize_any(Visitor)
2899    }
2900}
2901
2902#[doc(hidden)]
2903impl serde::ser::Serialize for ElementaryStream {
2904    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2905    where
2906        S: serde::ser::Serializer,
2907    {
2908        use serde::ser::SerializeMap;
2909        #[allow(unused_imports)]
2910        use std::option::Option::Some;
2911        let mut state = serializer.serialize_map(std::option::Option::None)?;
2912        if !self.key.is_empty() {
2913            state.serialize_entry("key", &self.key)?;
2914        }
2915        if let Some(value) = self.video_stream() {
2916            state.serialize_entry("videoStream", value)?;
2917        }
2918        if let Some(value) = self.audio_stream() {
2919            state.serialize_entry("audioStream", value)?;
2920        }
2921        if let Some(value) = self.text_stream() {
2922            state.serialize_entry("textStream", value)?;
2923        }
2924        if !self._unknown_fields.is_empty() {
2925            for (key, value) in self._unknown_fields.iter() {
2926                state.serialize_entry(key, &value)?;
2927            }
2928        }
2929        state.end()
2930    }
2931}
2932
2933impl std::fmt::Debug for ElementaryStream {
2934    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2935        let mut debug_struct = f.debug_struct("ElementaryStream");
2936        debug_struct.field("key", &self.key);
2937        debug_struct.field("elementary_stream", &self.elementary_stream);
2938        if !self._unknown_fields.is_empty() {
2939            debug_struct.field("_unknown_fields", &self._unknown_fields);
2940        }
2941        debug_struct.finish()
2942    }
2943}
2944
2945/// Defines additional types related to [ElementaryStream].
2946pub mod elementary_stream {
2947    #[allow(unused_imports)]
2948    use super::*;
2949
2950    /// Encoding of an audio, video, or text track.
2951    #[derive(Clone, Debug, PartialEq)]
2952    #[non_exhaustive]
2953    pub enum ElementaryStream {
2954        /// Encoding of a video stream.
2955        VideoStream(std::boxed::Box<crate::model::VideoStream>),
2956        /// Encoding of an audio stream.
2957        AudioStream(std::boxed::Box<crate::model::AudioStream>),
2958        /// Encoding of a text stream. For example, closed captions or subtitles.
2959        TextStream(std::boxed::Box<crate::model::TextStream>),
2960    }
2961}
2962
2963/// Multiplexing settings for output stream.
2964#[derive(Clone, Default, PartialEq)]
2965#[non_exhaustive]
2966pub struct MuxStream {
2967    /// A unique key for this multiplexed stream.
2968    pub key: std::string::String,
2969
2970    /// The name of the generated file. The default is
2971    /// [MuxStream.key][google.cloud.video.transcoder.v1.MuxStream.key] with the
2972    /// extension suffix corresponding to the
2973    /// [MuxStream.container][google.cloud.video.transcoder.v1.MuxStream.container].
2974    ///
2975    /// Individual segments also have an incremental 10-digit zero-padded suffix
2976    /// starting from 0 before the extension, such as `mux_stream0000000123.ts`.
2977    ///
2978    /// [google.cloud.video.transcoder.v1.MuxStream.container]: crate::model::MuxStream::container
2979    /// [google.cloud.video.transcoder.v1.MuxStream.key]: crate::model::MuxStream::key
2980    pub file_name: std::string::String,
2981
2982    /// The container format. The default is `mp4`
2983    ///
2984    /// Supported streaming formats:
2985    ///
2986    /// - `ts`
2987    /// - `fmp4`- the corresponding file extension is `.m4s`
2988    ///
2989    /// Supported standalone file formats:
2990    ///
2991    /// - `mp4`
2992    /// - `mp3`
2993    /// - `ogg`
2994    /// - `vtt`
2995    ///
2996    /// See also:
2997    /// [Supported input and output
2998    /// formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats)
2999    pub container: std::string::String,
3000
3001    /// List of
3002    /// [ElementaryStream.key][google.cloud.video.transcoder.v1.ElementaryStream.key]
3003    /// values multiplexed in this stream.
3004    ///
3005    /// [google.cloud.video.transcoder.v1.ElementaryStream.key]: crate::model::ElementaryStream::key
3006    pub elementary_streams: std::vec::Vec<std::string::String>,
3007
3008    /// Segment settings for `ts`, `fmp4` and `vtt`.
3009    pub segment_settings: std::option::Option<crate::model::SegmentSettings>,
3010
3011    /// Identifier of the encryption configuration to use. If omitted, output will
3012    /// be unencrypted.
3013    pub encryption_id: std::string::String,
3014
3015    /// Specifies the container configuration.
3016    pub container_config: std::option::Option<crate::model::mux_stream::ContainerConfig>,
3017
3018    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3019}
3020
3021impl MuxStream {
3022    pub fn new() -> Self {
3023        std::default::Default::default()
3024    }
3025
3026    /// Sets the value of [key][crate::model::MuxStream::key].
3027    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3028        self.key = v.into();
3029        self
3030    }
3031
3032    /// Sets the value of [file_name][crate::model::MuxStream::file_name].
3033    pub fn set_file_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3034        self.file_name = v.into();
3035        self
3036    }
3037
3038    /// Sets the value of [container][crate::model::MuxStream::container].
3039    pub fn set_container<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3040        self.container = v.into();
3041        self
3042    }
3043
3044    /// Sets the value of [elementary_streams][crate::model::MuxStream::elementary_streams].
3045    pub fn set_elementary_streams<T, V>(mut self, v: T) -> Self
3046    where
3047        T: std::iter::IntoIterator<Item = V>,
3048        V: std::convert::Into<std::string::String>,
3049    {
3050        use std::iter::Iterator;
3051        self.elementary_streams = v.into_iter().map(|i| i.into()).collect();
3052        self
3053    }
3054
3055    /// Sets the value of [segment_settings][crate::model::MuxStream::segment_settings].
3056    pub fn set_segment_settings<T>(mut self, v: T) -> Self
3057    where
3058        T: std::convert::Into<crate::model::SegmentSettings>,
3059    {
3060        self.segment_settings = std::option::Option::Some(v.into());
3061        self
3062    }
3063
3064    /// Sets or clears the value of [segment_settings][crate::model::MuxStream::segment_settings].
3065    pub fn set_or_clear_segment_settings<T>(mut self, v: std::option::Option<T>) -> Self
3066    where
3067        T: std::convert::Into<crate::model::SegmentSettings>,
3068    {
3069        self.segment_settings = v.map(|x| x.into());
3070        self
3071    }
3072
3073    /// Sets the value of [encryption_id][crate::model::MuxStream::encryption_id].
3074    pub fn set_encryption_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3075        self.encryption_id = v.into();
3076        self
3077    }
3078
3079    /// Sets the value of [container_config][crate::model::MuxStream::container_config].
3080    ///
3081    /// Note that all the setters affecting `container_config` are mutually
3082    /// exclusive.
3083    pub fn set_container_config<
3084        T: std::convert::Into<std::option::Option<crate::model::mux_stream::ContainerConfig>>,
3085    >(
3086        mut self,
3087        v: T,
3088    ) -> Self {
3089        self.container_config = v.into();
3090        self
3091    }
3092
3093    /// The value of [container_config][crate::model::MuxStream::container_config]
3094    /// if it holds a `Fmp4`, `None` if the field is not set or
3095    /// holds a different branch.
3096    pub fn fmp4(
3097        &self,
3098    ) -> std::option::Option<&std::boxed::Box<crate::model::mux_stream::Fmp4Config>> {
3099        #[allow(unreachable_patterns)]
3100        self.container_config.as_ref().and_then(|v| match v {
3101            crate::model::mux_stream::ContainerConfig::Fmp4(v) => std::option::Option::Some(v),
3102            _ => std::option::Option::None,
3103        })
3104    }
3105
3106    /// Sets the value of [container_config][crate::model::MuxStream::container_config]
3107    /// to hold a `Fmp4`.
3108    ///
3109    /// Note that all the setters affecting `container_config` are
3110    /// mutually exclusive.
3111    pub fn set_fmp4<
3112        T: std::convert::Into<std::boxed::Box<crate::model::mux_stream::Fmp4Config>>,
3113    >(
3114        mut self,
3115        v: T,
3116    ) -> Self {
3117        self.container_config =
3118            std::option::Option::Some(crate::model::mux_stream::ContainerConfig::Fmp4(v.into()));
3119        self
3120    }
3121}
3122
3123impl wkt::message::Message for MuxStream {
3124    fn typename() -> &'static str {
3125        "type.googleapis.com/google.cloud.video.transcoder.v1.MuxStream"
3126    }
3127}
3128
3129#[doc(hidden)]
3130impl<'de> serde::de::Deserialize<'de> for MuxStream {
3131    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3132    where
3133        D: serde::Deserializer<'de>,
3134    {
3135        #[allow(non_camel_case_types)]
3136        #[doc(hidden)]
3137        #[derive(PartialEq, Eq, Hash)]
3138        enum __FieldTag {
3139            __key,
3140            __file_name,
3141            __container,
3142            __elementary_streams,
3143            __segment_settings,
3144            __encryption_id,
3145            __fmp4,
3146            Unknown(std::string::String),
3147        }
3148        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3149            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3150            where
3151                D: serde::Deserializer<'de>,
3152            {
3153                struct Visitor;
3154                impl<'de> serde::de::Visitor<'de> for Visitor {
3155                    type Value = __FieldTag;
3156                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3157                        formatter.write_str("a field name for MuxStream")
3158                    }
3159                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3160                    where
3161                        E: serde::de::Error,
3162                    {
3163                        use std::result::Result::Ok;
3164                        use std::string::ToString;
3165                        match value {
3166                            "key" => Ok(__FieldTag::__key),
3167                            "fileName" => Ok(__FieldTag::__file_name),
3168                            "file_name" => Ok(__FieldTag::__file_name),
3169                            "container" => Ok(__FieldTag::__container),
3170                            "elementaryStreams" => Ok(__FieldTag::__elementary_streams),
3171                            "elementary_streams" => Ok(__FieldTag::__elementary_streams),
3172                            "segmentSettings" => Ok(__FieldTag::__segment_settings),
3173                            "segment_settings" => Ok(__FieldTag::__segment_settings),
3174                            "encryptionId" => Ok(__FieldTag::__encryption_id),
3175                            "encryption_id" => Ok(__FieldTag::__encryption_id),
3176                            "fmp4" => Ok(__FieldTag::__fmp4),
3177                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3178                        }
3179                    }
3180                }
3181                deserializer.deserialize_identifier(Visitor)
3182            }
3183        }
3184        struct Visitor;
3185        impl<'de> serde::de::Visitor<'de> for Visitor {
3186            type Value = MuxStream;
3187            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3188                formatter.write_str("struct MuxStream")
3189            }
3190            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3191            where
3192                A: serde::de::MapAccess<'de>,
3193            {
3194                #[allow(unused_imports)]
3195                use serde::de::Error;
3196                use std::option::Option::Some;
3197                let mut fields = std::collections::HashSet::new();
3198                let mut result = Self::Value::new();
3199                while let Some(tag) = map.next_key::<__FieldTag>()? {
3200                    #[allow(clippy::match_single_binding)]
3201                    match tag {
3202                        __FieldTag::__key => {
3203                            if !fields.insert(__FieldTag::__key) {
3204                                return std::result::Result::Err(A::Error::duplicate_field(
3205                                    "multiple values for key",
3206                                ));
3207                            }
3208                            result.key = map
3209                                .next_value::<std::option::Option<std::string::String>>()?
3210                                .unwrap_or_default();
3211                        }
3212                        __FieldTag::__file_name => {
3213                            if !fields.insert(__FieldTag::__file_name) {
3214                                return std::result::Result::Err(A::Error::duplicate_field(
3215                                    "multiple values for file_name",
3216                                ));
3217                            }
3218                            result.file_name = map
3219                                .next_value::<std::option::Option<std::string::String>>()?
3220                                .unwrap_or_default();
3221                        }
3222                        __FieldTag::__container => {
3223                            if !fields.insert(__FieldTag::__container) {
3224                                return std::result::Result::Err(A::Error::duplicate_field(
3225                                    "multiple values for container",
3226                                ));
3227                            }
3228                            result.container = map
3229                                .next_value::<std::option::Option<std::string::String>>()?
3230                                .unwrap_or_default();
3231                        }
3232                        __FieldTag::__elementary_streams => {
3233                            if !fields.insert(__FieldTag::__elementary_streams) {
3234                                return std::result::Result::Err(A::Error::duplicate_field(
3235                                    "multiple values for elementary_streams",
3236                                ));
3237                            }
3238                            result.elementary_streams = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
3239                        }
3240                        __FieldTag::__segment_settings => {
3241                            if !fields.insert(__FieldTag::__segment_settings) {
3242                                return std::result::Result::Err(A::Error::duplicate_field(
3243                                    "multiple values for segment_settings",
3244                                ));
3245                            }
3246                            result.segment_settings = map
3247                                .next_value::<std::option::Option<crate::model::SegmentSettings>>(
3248                                )?;
3249                        }
3250                        __FieldTag::__encryption_id => {
3251                            if !fields.insert(__FieldTag::__encryption_id) {
3252                                return std::result::Result::Err(A::Error::duplicate_field(
3253                                    "multiple values for encryption_id",
3254                                ));
3255                            }
3256                            result.encryption_id = map
3257                                .next_value::<std::option::Option<std::string::String>>()?
3258                                .unwrap_or_default();
3259                        }
3260                        __FieldTag::__fmp4 => {
3261                            if !fields.insert(__FieldTag::__fmp4) {
3262                                return std::result::Result::Err(A::Error::duplicate_field(
3263                                    "multiple values for fmp4",
3264                                ));
3265                            }
3266                            if result.container_config.is_some() {
3267                                return std::result::Result::Err(A::Error::duplicate_field(
3268                                    "multiple values for `container_config`, a oneof with full ID .google.cloud.video.transcoder.v1.MuxStream.fmp4, latest field was fmp4",
3269                                ));
3270                            }
3271                            result.container_config = std::option::Option::Some(
3272                                crate::model::mux_stream::ContainerConfig::Fmp4(
3273                                    map.next_value::<std::option::Option<
3274                                        std::boxed::Box<crate::model::mux_stream::Fmp4Config>,
3275                                    >>()?
3276                                    .unwrap_or_default(),
3277                                ),
3278                            );
3279                        }
3280                        __FieldTag::Unknown(key) => {
3281                            let value = map.next_value::<serde_json::Value>()?;
3282                            result._unknown_fields.insert(key, value);
3283                        }
3284                    }
3285                }
3286                std::result::Result::Ok(result)
3287            }
3288        }
3289        deserializer.deserialize_any(Visitor)
3290    }
3291}
3292
3293#[doc(hidden)]
3294impl serde::ser::Serialize for MuxStream {
3295    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3296    where
3297        S: serde::ser::Serializer,
3298    {
3299        use serde::ser::SerializeMap;
3300        #[allow(unused_imports)]
3301        use std::option::Option::Some;
3302        let mut state = serializer.serialize_map(std::option::Option::None)?;
3303        if !self.key.is_empty() {
3304            state.serialize_entry("key", &self.key)?;
3305        }
3306        if !self.file_name.is_empty() {
3307            state.serialize_entry("fileName", &self.file_name)?;
3308        }
3309        if !self.container.is_empty() {
3310            state.serialize_entry("container", &self.container)?;
3311        }
3312        if !self.elementary_streams.is_empty() {
3313            state.serialize_entry("elementaryStreams", &self.elementary_streams)?;
3314        }
3315        if self.segment_settings.is_some() {
3316            state.serialize_entry("segmentSettings", &self.segment_settings)?;
3317        }
3318        if !self.encryption_id.is_empty() {
3319            state.serialize_entry("encryptionId", &self.encryption_id)?;
3320        }
3321        if let Some(value) = self.fmp4() {
3322            state.serialize_entry("fmp4", value)?;
3323        }
3324        if !self._unknown_fields.is_empty() {
3325            for (key, value) in self._unknown_fields.iter() {
3326                state.serialize_entry(key, &value)?;
3327            }
3328        }
3329        state.end()
3330    }
3331}
3332
3333impl std::fmt::Debug for MuxStream {
3334    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3335        let mut debug_struct = f.debug_struct("MuxStream");
3336        debug_struct.field("key", &self.key);
3337        debug_struct.field("file_name", &self.file_name);
3338        debug_struct.field("container", &self.container);
3339        debug_struct.field("elementary_streams", &self.elementary_streams);
3340        debug_struct.field("segment_settings", &self.segment_settings);
3341        debug_struct.field("encryption_id", &self.encryption_id);
3342        debug_struct.field("container_config", &self.container_config);
3343        if !self._unknown_fields.is_empty() {
3344            debug_struct.field("_unknown_fields", &self._unknown_fields);
3345        }
3346        debug_struct.finish()
3347    }
3348}
3349
3350/// Defines additional types related to [MuxStream].
3351pub mod mux_stream {
3352    #[allow(unused_imports)]
3353    use super::*;
3354
3355    /// `fmp4` container configuration.
3356    #[derive(Clone, Default, PartialEq)]
3357    #[non_exhaustive]
3358    pub struct Fmp4Config {
3359        /// Optional. Specify the codec tag string that will be used in the media
3360        /// bitstream. When not specified, the codec appropriate value is used.
3361        ///
3362        /// Supported H265 codec tags:
3363        ///
3364        /// - `hvc1` (default)
3365        /// - `hev1`
3366        pub codec_tag: std::string::String,
3367
3368        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3369    }
3370
3371    impl Fmp4Config {
3372        pub fn new() -> Self {
3373            std::default::Default::default()
3374        }
3375
3376        /// Sets the value of [codec_tag][crate::model::mux_stream::Fmp4Config::codec_tag].
3377        pub fn set_codec_tag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3378            self.codec_tag = v.into();
3379            self
3380        }
3381    }
3382
3383    impl wkt::message::Message for Fmp4Config {
3384        fn typename() -> &'static str {
3385            "type.googleapis.com/google.cloud.video.transcoder.v1.MuxStream.Fmp4Config"
3386        }
3387    }
3388
3389    #[doc(hidden)]
3390    impl<'de> serde::de::Deserialize<'de> for Fmp4Config {
3391        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3392        where
3393            D: serde::Deserializer<'de>,
3394        {
3395            #[allow(non_camel_case_types)]
3396            #[doc(hidden)]
3397            #[derive(PartialEq, Eq, Hash)]
3398            enum __FieldTag {
3399                __codec_tag,
3400                Unknown(std::string::String),
3401            }
3402            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3403                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3404                where
3405                    D: serde::Deserializer<'de>,
3406                {
3407                    struct Visitor;
3408                    impl<'de> serde::de::Visitor<'de> for Visitor {
3409                        type Value = __FieldTag;
3410                        fn expecting(
3411                            &self,
3412                            formatter: &mut std::fmt::Formatter,
3413                        ) -> std::fmt::Result {
3414                            formatter.write_str("a field name for Fmp4Config")
3415                        }
3416                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3417                        where
3418                            E: serde::de::Error,
3419                        {
3420                            use std::result::Result::Ok;
3421                            use std::string::ToString;
3422                            match value {
3423                                "codecTag" => Ok(__FieldTag::__codec_tag),
3424                                "codec_tag" => Ok(__FieldTag::__codec_tag),
3425                                _ => Ok(__FieldTag::Unknown(value.to_string())),
3426                            }
3427                        }
3428                    }
3429                    deserializer.deserialize_identifier(Visitor)
3430                }
3431            }
3432            struct Visitor;
3433            impl<'de> serde::de::Visitor<'de> for Visitor {
3434                type Value = Fmp4Config;
3435                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3436                    formatter.write_str("struct Fmp4Config")
3437                }
3438                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3439                where
3440                    A: serde::de::MapAccess<'de>,
3441                {
3442                    #[allow(unused_imports)]
3443                    use serde::de::Error;
3444                    use std::option::Option::Some;
3445                    let mut fields = std::collections::HashSet::new();
3446                    let mut result = Self::Value::new();
3447                    while let Some(tag) = map.next_key::<__FieldTag>()? {
3448                        #[allow(clippy::match_single_binding)]
3449                        match tag {
3450                            __FieldTag::__codec_tag => {
3451                                if !fields.insert(__FieldTag::__codec_tag) {
3452                                    return std::result::Result::Err(A::Error::duplicate_field(
3453                                        "multiple values for codec_tag",
3454                                    ));
3455                                }
3456                                result.codec_tag = map
3457                                    .next_value::<std::option::Option<std::string::String>>()?
3458                                    .unwrap_or_default();
3459                            }
3460                            __FieldTag::Unknown(key) => {
3461                                let value = map.next_value::<serde_json::Value>()?;
3462                                result._unknown_fields.insert(key, value);
3463                            }
3464                        }
3465                    }
3466                    std::result::Result::Ok(result)
3467                }
3468            }
3469            deserializer.deserialize_any(Visitor)
3470        }
3471    }
3472
3473    #[doc(hidden)]
3474    impl serde::ser::Serialize for Fmp4Config {
3475        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3476        where
3477            S: serde::ser::Serializer,
3478        {
3479            use serde::ser::SerializeMap;
3480            #[allow(unused_imports)]
3481            use std::option::Option::Some;
3482            let mut state = serializer.serialize_map(std::option::Option::None)?;
3483            if !self.codec_tag.is_empty() {
3484                state.serialize_entry("codecTag", &self.codec_tag)?;
3485            }
3486            if !self._unknown_fields.is_empty() {
3487                for (key, value) in self._unknown_fields.iter() {
3488                    state.serialize_entry(key, &value)?;
3489                }
3490            }
3491            state.end()
3492        }
3493    }
3494
3495    impl std::fmt::Debug for Fmp4Config {
3496        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3497            let mut debug_struct = f.debug_struct("Fmp4Config");
3498            debug_struct.field("codec_tag", &self.codec_tag);
3499            if !self._unknown_fields.is_empty() {
3500                debug_struct.field("_unknown_fields", &self._unknown_fields);
3501            }
3502            debug_struct.finish()
3503        }
3504    }
3505
3506    /// Specifies the container configuration.
3507    #[derive(Clone, Debug, PartialEq)]
3508    #[non_exhaustive]
3509    pub enum ContainerConfig {
3510        /// Optional. `fmp4` container configuration.
3511        Fmp4(std::boxed::Box<crate::model::mux_stream::Fmp4Config>),
3512    }
3513}
3514
3515/// Manifest configuration.
3516#[derive(Clone, Default, PartialEq)]
3517#[non_exhaustive]
3518pub struct Manifest {
3519    /// The name of the generated file. The default is `manifest` with the
3520    /// extension suffix corresponding to the
3521    /// [Manifest.type][google.cloud.video.transcoder.v1.Manifest.type].
3522    ///
3523    /// [google.cloud.video.transcoder.v1.Manifest.type]: crate::model::Manifest::type
3524    pub file_name: std::string::String,
3525
3526    /// Required. Type of the manifest.
3527    pub r#type: crate::model::manifest::ManifestType,
3528
3529    /// Required. List of user supplied
3530    /// [MuxStream.key][google.cloud.video.transcoder.v1.MuxStream.key] values that
3531    /// should appear in this manifest.
3532    ///
3533    /// When [Manifest.type][google.cloud.video.transcoder.v1.Manifest.type] is
3534    /// `HLS`, a media manifest with name
3535    /// [MuxStream.key][google.cloud.video.transcoder.v1.MuxStream.key] and `.m3u8`
3536    /// extension is generated for each element in this list.
3537    ///
3538    /// [google.cloud.video.transcoder.v1.Manifest.type]: crate::model::Manifest::type
3539    /// [google.cloud.video.transcoder.v1.MuxStream.key]: crate::model::MuxStream::key
3540    pub mux_streams: std::vec::Vec<std::string::String>,
3541
3542    /// Specifies the manifest configuration.
3543    pub manifest_config: std::option::Option<crate::model::manifest::ManifestConfig>,
3544
3545    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3546}
3547
3548impl Manifest {
3549    pub fn new() -> Self {
3550        std::default::Default::default()
3551    }
3552
3553    /// Sets the value of [file_name][crate::model::Manifest::file_name].
3554    pub fn set_file_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3555        self.file_name = v.into();
3556        self
3557    }
3558
3559    /// Sets the value of [r#type][crate::model::Manifest::type].
3560    pub fn set_type<T: std::convert::Into<crate::model::manifest::ManifestType>>(
3561        mut self,
3562        v: T,
3563    ) -> Self {
3564        self.r#type = v.into();
3565        self
3566    }
3567
3568    /// Sets the value of [mux_streams][crate::model::Manifest::mux_streams].
3569    pub fn set_mux_streams<T, V>(mut self, v: T) -> Self
3570    where
3571        T: std::iter::IntoIterator<Item = V>,
3572        V: std::convert::Into<std::string::String>,
3573    {
3574        use std::iter::Iterator;
3575        self.mux_streams = v.into_iter().map(|i| i.into()).collect();
3576        self
3577    }
3578
3579    /// Sets the value of [manifest_config][crate::model::Manifest::manifest_config].
3580    ///
3581    /// Note that all the setters affecting `manifest_config` are mutually
3582    /// exclusive.
3583    pub fn set_manifest_config<
3584        T: std::convert::Into<std::option::Option<crate::model::manifest::ManifestConfig>>,
3585    >(
3586        mut self,
3587        v: T,
3588    ) -> Self {
3589        self.manifest_config = v.into();
3590        self
3591    }
3592
3593    /// The value of [manifest_config][crate::model::Manifest::manifest_config]
3594    /// if it holds a `Dash`, `None` if the field is not set or
3595    /// holds a different branch.
3596    pub fn dash(
3597        &self,
3598    ) -> std::option::Option<&std::boxed::Box<crate::model::manifest::DashConfig>> {
3599        #[allow(unreachable_patterns)]
3600        self.manifest_config.as_ref().and_then(|v| match v {
3601            crate::model::manifest::ManifestConfig::Dash(v) => std::option::Option::Some(v),
3602            _ => std::option::Option::None,
3603        })
3604    }
3605
3606    /// Sets the value of [manifest_config][crate::model::Manifest::manifest_config]
3607    /// to hold a `Dash`.
3608    ///
3609    /// Note that all the setters affecting `manifest_config` are
3610    /// mutually exclusive.
3611    pub fn set_dash<T: std::convert::Into<std::boxed::Box<crate::model::manifest::DashConfig>>>(
3612        mut self,
3613        v: T,
3614    ) -> Self {
3615        self.manifest_config =
3616            std::option::Option::Some(crate::model::manifest::ManifestConfig::Dash(v.into()));
3617        self
3618    }
3619}
3620
3621impl wkt::message::Message for Manifest {
3622    fn typename() -> &'static str {
3623        "type.googleapis.com/google.cloud.video.transcoder.v1.Manifest"
3624    }
3625}
3626
3627#[doc(hidden)]
3628impl<'de> serde::de::Deserialize<'de> for Manifest {
3629    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3630    where
3631        D: serde::Deserializer<'de>,
3632    {
3633        #[allow(non_camel_case_types)]
3634        #[doc(hidden)]
3635        #[derive(PartialEq, Eq, Hash)]
3636        enum __FieldTag {
3637            __file_name,
3638            __type,
3639            __mux_streams,
3640            __dash,
3641            Unknown(std::string::String),
3642        }
3643        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3644            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3645            where
3646                D: serde::Deserializer<'de>,
3647            {
3648                struct Visitor;
3649                impl<'de> serde::de::Visitor<'de> for Visitor {
3650                    type Value = __FieldTag;
3651                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3652                        formatter.write_str("a field name for Manifest")
3653                    }
3654                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3655                    where
3656                        E: serde::de::Error,
3657                    {
3658                        use std::result::Result::Ok;
3659                        use std::string::ToString;
3660                        match value {
3661                            "fileName" => Ok(__FieldTag::__file_name),
3662                            "file_name" => Ok(__FieldTag::__file_name),
3663                            "type" => Ok(__FieldTag::__type),
3664                            "muxStreams" => Ok(__FieldTag::__mux_streams),
3665                            "mux_streams" => Ok(__FieldTag::__mux_streams),
3666                            "dash" => Ok(__FieldTag::__dash),
3667                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3668                        }
3669                    }
3670                }
3671                deserializer.deserialize_identifier(Visitor)
3672            }
3673        }
3674        struct Visitor;
3675        impl<'de> serde::de::Visitor<'de> for Visitor {
3676            type Value = Manifest;
3677            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3678                formatter.write_str("struct Manifest")
3679            }
3680            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3681            where
3682                A: serde::de::MapAccess<'de>,
3683            {
3684                #[allow(unused_imports)]
3685                use serde::de::Error;
3686                use std::option::Option::Some;
3687                let mut fields = std::collections::HashSet::new();
3688                let mut result = Self::Value::new();
3689                while let Some(tag) = map.next_key::<__FieldTag>()? {
3690                    #[allow(clippy::match_single_binding)]
3691                    match tag {
3692                        __FieldTag::__file_name => {
3693                            if !fields.insert(__FieldTag::__file_name) {
3694                                return std::result::Result::Err(A::Error::duplicate_field(
3695                                    "multiple values for file_name",
3696                                ));
3697                            }
3698                            result.file_name = map
3699                                .next_value::<std::option::Option<std::string::String>>()?
3700                                .unwrap_or_default();
3701                        }
3702                        __FieldTag::__type => {
3703                            if !fields.insert(__FieldTag::__type) {
3704                                return std::result::Result::Err(A::Error::duplicate_field(
3705                                    "multiple values for type",
3706                                ));
3707                            }
3708                            result.r#type = map.next_value::<std::option::Option<crate::model::manifest::ManifestType>>()?.unwrap_or_default();
3709                        }
3710                        __FieldTag::__mux_streams => {
3711                            if !fields.insert(__FieldTag::__mux_streams) {
3712                                return std::result::Result::Err(A::Error::duplicate_field(
3713                                    "multiple values for mux_streams",
3714                                ));
3715                            }
3716                            result.mux_streams = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
3717                        }
3718                        __FieldTag::__dash => {
3719                            if !fields.insert(__FieldTag::__dash) {
3720                                return std::result::Result::Err(A::Error::duplicate_field(
3721                                    "multiple values for dash",
3722                                ));
3723                            }
3724                            if result.manifest_config.is_some() {
3725                                return std::result::Result::Err(A::Error::duplicate_field(
3726                                    "multiple values for `manifest_config`, a oneof with full ID .google.cloud.video.transcoder.v1.Manifest.dash, latest field was dash",
3727                                ));
3728                            }
3729                            result.manifest_config = std::option::Option::Some(
3730                                crate::model::manifest::ManifestConfig::Dash(
3731                                    map.next_value::<std::option::Option<
3732                                        std::boxed::Box<crate::model::manifest::DashConfig>,
3733                                    >>()?
3734                                    .unwrap_or_default(),
3735                                ),
3736                            );
3737                        }
3738                        __FieldTag::Unknown(key) => {
3739                            let value = map.next_value::<serde_json::Value>()?;
3740                            result._unknown_fields.insert(key, value);
3741                        }
3742                    }
3743                }
3744                std::result::Result::Ok(result)
3745            }
3746        }
3747        deserializer.deserialize_any(Visitor)
3748    }
3749}
3750
3751#[doc(hidden)]
3752impl serde::ser::Serialize for Manifest {
3753    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3754    where
3755        S: serde::ser::Serializer,
3756    {
3757        use serde::ser::SerializeMap;
3758        #[allow(unused_imports)]
3759        use std::option::Option::Some;
3760        let mut state = serializer.serialize_map(std::option::Option::None)?;
3761        if !self.file_name.is_empty() {
3762            state.serialize_entry("fileName", &self.file_name)?;
3763        }
3764        if !wkt::internal::is_default(&self.r#type) {
3765            state.serialize_entry("type", &self.r#type)?;
3766        }
3767        if !self.mux_streams.is_empty() {
3768            state.serialize_entry("muxStreams", &self.mux_streams)?;
3769        }
3770        if let Some(value) = self.dash() {
3771            state.serialize_entry("dash", value)?;
3772        }
3773        if !self._unknown_fields.is_empty() {
3774            for (key, value) in self._unknown_fields.iter() {
3775                state.serialize_entry(key, &value)?;
3776            }
3777        }
3778        state.end()
3779    }
3780}
3781
3782impl std::fmt::Debug for Manifest {
3783    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3784        let mut debug_struct = f.debug_struct("Manifest");
3785        debug_struct.field("file_name", &self.file_name);
3786        debug_struct.field("r#type", &self.r#type);
3787        debug_struct.field("mux_streams", &self.mux_streams);
3788        debug_struct.field("manifest_config", &self.manifest_config);
3789        if !self._unknown_fields.is_empty() {
3790            debug_struct.field("_unknown_fields", &self._unknown_fields);
3791        }
3792        debug_struct.finish()
3793    }
3794}
3795
3796/// Defines additional types related to [Manifest].
3797pub mod manifest {
3798    #[allow(unused_imports)]
3799    use super::*;
3800
3801    /// `DASH` manifest configuration.
3802    #[derive(Clone, Default, PartialEq)]
3803    #[non_exhaustive]
3804    pub struct DashConfig {
3805        /// The segment reference scheme for a `DASH` manifest. The default is
3806        /// `SEGMENT_LIST`.
3807        pub segment_reference_scheme: crate::model::manifest::dash_config::SegmentReferenceScheme,
3808
3809        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3810    }
3811
3812    impl DashConfig {
3813        pub fn new() -> Self {
3814            std::default::Default::default()
3815        }
3816
3817        /// Sets the value of [segment_reference_scheme][crate::model::manifest::DashConfig::segment_reference_scheme].
3818        pub fn set_segment_reference_scheme<
3819            T: std::convert::Into<crate::model::manifest::dash_config::SegmentReferenceScheme>,
3820        >(
3821            mut self,
3822            v: T,
3823        ) -> Self {
3824            self.segment_reference_scheme = v.into();
3825            self
3826        }
3827    }
3828
3829    impl wkt::message::Message for DashConfig {
3830        fn typename() -> &'static str {
3831            "type.googleapis.com/google.cloud.video.transcoder.v1.Manifest.DashConfig"
3832        }
3833    }
3834
3835    #[doc(hidden)]
3836    impl<'de> serde::de::Deserialize<'de> for DashConfig {
3837        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3838        where
3839            D: serde::Deserializer<'de>,
3840        {
3841            #[allow(non_camel_case_types)]
3842            #[doc(hidden)]
3843            #[derive(PartialEq, Eq, Hash)]
3844            enum __FieldTag {
3845                __segment_reference_scheme,
3846                Unknown(std::string::String),
3847            }
3848            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3849                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3850                where
3851                    D: serde::Deserializer<'de>,
3852                {
3853                    struct Visitor;
3854                    impl<'de> serde::de::Visitor<'de> for Visitor {
3855                        type Value = __FieldTag;
3856                        fn expecting(
3857                            &self,
3858                            formatter: &mut std::fmt::Formatter,
3859                        ) -> std::fmt::Result {
3860                            formatter.write_str("a field name for DashConfig")
3861                        }
3862                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3863                        where
3864                            E: serde::de::Error,
3865                        {
3866                            use std::result::Result::Ok;
3867                            use std::string::ToString;
3868                            match value {
3869                                "segmentReferenceScheme" => {
3870                                    Ok(__FieldTag::__segment_reference_scheme)
3871                                }
3872                                "segment_reference_scheme" => {
3873                                    Ok(__FieldTag::__segment_reference_scheme)
3874                                }
3875                                _ => Ok(__FieldTag::Unknown(value.to_string())),
3876                            }
3877                        }
3878                    }
3879                    deserializer.deserialize_identifier(Visitor)
3880                }
3881            }
3882            struct Visitor;
3883            impl<'de> serde::de::Visitor<'de> for Visitor {
3884                type Value = DashConfig;
3885                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3886                    formatter.write_str("struct DashConfig")
3887                }
3888                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3889                where
3890                    A: serde::de::MapAccess<'de>,
3891                {
3892                    #[allow(unused_imports)]
3893                    use serde::de::Error;
3894                    use std::option::Option::Some;
3895                    let mut fields = std::collections::HashSet::new();
3896                    let mut result = Self::Value::new();
3897                    while let Some(tag) = map.next_key::<__FieldTag>()? {
3898                        #[allow(clippy::match_single_binding)]
3899                        match tag {
3900                            __FieldTag::__segment_reference_scheme => {
3901                                if !fields.insert(__FieldTag::__segment_reference_scheme) {
3902                                    return std::result::Result::Err(A::Error::duplicate_field(
3903                                        "multiple values for segment_reference_scheme",
3904                                    ));
3905                                }
3906                                result.segment_reference_scheme = map
3907                                    .next_value::<std::option::Option<
3908                                        crate::model::manifest::dash_config::SegmentReferenceScheme,
3909                                    >>()?
3910                                    .unwrap_or_default();
3911                            }
3912                            __FieldTag::Unknown(key) => {
3913                                let value = map.next_value::<serde_json::Value>()?;
3914                                result._unknown_fields.insert(key, value);
3915                            }
3916                        }
3917                    }
3918                    std::result::Result::Ok(result)
3919                }
3920            }
3921            deserializer.deserialize_any(Visitor)
3922        }
3923    }
3924
3925    #[doc(hidden)]
3926    impl serde::ser::Serialize for DashConfig {
3927        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3928        where
3929            S: serde::ser::Serializer,
3930        {
3931            use serde::ser::SerializeMap;
3932            #[allow(unused_imports)]
3933            use std::option::Option::Some;
3934            let mut state = serializer.serialize_map(std::option::Option::None)?;
3935            if !wkt::internal::is_default(&self.segment_reference_scheme) {
3936                state.serialize_entry("segmentReferenceScheme", &self.segment_reference_scheme)?;
3937            }
3938            if !self._unknown_fields.is_empty() {
3939                for (key, value) in self._unknown_fields.iter() {
3940                    state.serialize_entry(key, &value)?;
3941                }
3942            }
3943            state.end()
3944        }
3945    }
3946
3947    impl std::fmt::Debug for DashConfig {
3948        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3949            let mut debug_struct = f.debug_struct("DashConfig");
3950            debug_struct.field("segment_reference_scheme", &self.segment_reference_scheme);
3951            if !self._unknown_fields.is_empty() {
3952                debug_struct.field("_unknown_fields", &self._unknown_fields);
3953            }
3954            debug_struct.finish()
3955        }
3956    }
3957
3958    /// Defines additional types related to [DashConfig].
3959    pub mod dash_config {
3960        #[allow(unused_imports)]
3961        use super::*;
3962
3963        /// The segment reference scheme for a `DASH` manifest.
3964        ///
3965        /// # Working with unknown values
3966        ///
3967        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3968        /// additional enum variants at any time. Adding new variants is not considered
3969        /// a breaking change. Applications should write their code in anticipation of:
3970        ///
3971        /// - New values appearing in future releases of the client library, **and**
3972        /// - New values received dynamically, without application changes.
3973        ///
3974        /// Please consult the [Working with enums] section in the user guide for some
3975        /// guidelines.
3976        ///
3977        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3978        #[derive(Clone, Debug, PartialEq)]
3979        #[non_exhaustive]
3980        pub enum SegmentReferenceScheme {
3981            /// The segment reference scheme is not specified.
3982            Unspecified,
3983            /// Explicitly lists the URLs of media files for each segment. For example,
3984            /// if
3985            /// [SegmentSettings.individual_segments][google.cloud.video.transcoder.v1.SegmentSettings.individual_segments]
3986            /// is `true`, then the manifest contains fields similar to the following:
3987            ///
3988            /// ```norust
3989            /// <Initialization sourceURL="my-hd-stream-init.m4s"/>
3990            ///   <SegmentList presentationTimeOffset="0" duration="1000"
3991            ///   timescale="10000">
3992            ///     <SegmentURL media="hd-stream0000000000.m4s"/>
3993            ///     <SegmentURL media="hd-stream0000000001.m4s"/>
3994            ///     ...
3995            /// ```
3996            ///
3997            /// [google.cloud.video.transcoder.v1.SegmentSettings.individual_segments]: crate::model::SegmentSettings::individual_segments
3998            SegmentList,
3999            /// [SegmentSettings.individual_segments][google.cloud.video.transcoder.v1.SegmentSettings.individual_segments]
4000            /// must be set to `true` to use this segment reference scheme. Uses the
4001            /// DASH specification
4002            /// `<SegmentTemplate>` tag to determine the URLs of media files for each
4003            /// segment. For example:
4004            ///
4005            /// ```norust
4006            /// <SegmentTemplate presentationTimeOffset="0" timescale="10000"
4007            ///       initialization="my-hd-stream-init.m4s"
4008            ///       media="hd-stream$Number%010d$.m4s" startNumber="0">
4009            ///   ...
4010            /// ```
4011            ///
4012            /// [google.cloud.video.transcoder.v1.SegmentSettings.individual_segments]: crate::model::SegmentSettings::individual_segments
4013            SegmentTemplateNumber,
4014            /// If set, the enum was initialized with an unknown value.
4015            ///
4016            /// Applications can examine the value using [SegmentReferenceScheme::value] or
4017            /// [SegmentReferenceScheme::name].
4018            UnknownValue(segment_reference_scheme::UnknownValue),
4019        }
4020
4021        #[doc(hidden)]
4022        pub mod segment_reference_scheme {
4023            #[allow(unused_imports)]
4024            use super::*;
4025            #[derive(Clone, Debug, PartialEq)]
4026            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4027        }
4028
4029        impl SegmentReferenceScheme {
4030            /// Gets the enum value.
4031            ///
4032            /// Returns `None` if the enum contains an unknown value deserialized from
4033            /// the string representation of enums.
4034            pub fn value(&self) -> std::option::Option<i32> {
4035                match self {
4036                    Self::Unspecified => std::option::Option::Some(0),
4037                    Self::SegmentList => std::option::Option::Some(1),
4038                    Self::SegmentTemplateNumber => std::option::Option::Some(2),
4039                    Self::UnknownValue(u) => u.0.value(),
4040                }
4041            }
4042
4043            /// Gets the enum value as a string.
4044            ///
4045            /// Returns `None` if the enum contains an unknown value deserialized from
4046            /// the integer representation of enums.
4047            pub fn name(&self) -> std::option::Option<&str> {
4048                match self {
4049                    Self::Unspecified => {
4050                        std::option::Option::Some("SEGMENT_REFERENCE_SCHEME_UNSPECIFIED")
4051                    }
4052                    Self::SegmentList => std::option::Option::Some("SEGMENT_LIST"),
4053                    Self::SegmentTemplateNumber => {
4054                        std::option::Option::Some("SEGMENT_TEMPLATE_NUMBER")
4055                    }
4056                    Self::UnknownValue(u) => u.0.name(),
4057                }
4058            }
4059        }
4060
4061        impl std::default::Default for SegmentReferenceScheme {
4062            fn default() -> Self {
4063                use std::convert::From;
4064                Self::from(0)
4065            }
4066        }
4067
4068        impl std::fmt::Display for SegmentReferenceScheme {
4069            fn fmt(
4070                &self,
4071                f: &mut std::fmt::Formatter<'_>,
4072            ) -> std::result::Result<(), std::fmt::Error> {
4073                wkt::internal::display_enum(f, self.name(), self.value())
4074            }
4075        }
4076
4077        impl std::convert::From<i32> for SegmentReferenceScheme {
4078            fn from(value: i32) -> Self {
4079                match value {
4080                    0 => Self::Unspecified,
4081                    1 => Self::SegmentList,
4082                    2 => Self::SegmentTemplateNumber,
4083                    _ => Self::UnknownValue(segment_reference_scheme::UnknownValue(
4084                        wkt::internal::UnknownEnumValue::Integer(value),
4085                    )),
4086                }
4087            }
4088        }
4089
4090        impl std::convert::From<&str> for SegmentReferenceScheme {
4091            fn from(value: &str) -> Self {
4092                use std::string::ToString;
4093                match value {
4094                    "SEGMENT_REFERENCE_SCHEME_UNSPECIFIED" => Self::Unspecified,
4095                    "SEGMENT_LIST" => Self::SegmentList,
4096                    "SEGMENT_TEMPLATE_NUMBER" => Self::SegmentTemplateNumber,
4097                    _ => Self::UnknownValue(segment_reference_scheme::UnknownValue(
4098                        wkt::internal::UnknownEnumValue::String(value.to_string()),
4099                    )),
4100                }
4101            }
4102        }
4103
4104        impl serde::ser::Serialize for SegmentReferenceScheme {
4105            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4106            where
4107                S: serde::Serializer,
4108            {
4109                match self {
4110                    Self::Unspecified => serializer.serialize_i32(0),
4111                    Self::SegmentList => serializer.serialize_i32(1),
4112                    Self::SegmentTemplateNumber => serializer.serialize_i32(2),
4113                    Self::UnknownValue(u) => u.0.serialize(serializer),
4114                }
4115            }
4116        }
4117
4118        impl<'de> serde::de::Deserialize<'de> for SegmentReferenceScheme {
4119            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4120            where
4121                D: serde::Deserializer<'de>,
4122            {
4123                deserializer.deserialize_any(wkt::internal::EnumVisitor::<SegmentReferenceScheme>::new(
4124                    ".google.cloud.video.transcoder.v1.Manifest.DashConfig.SegmentReferenceScheme"))
4125            }
4126        }
4127    }
4128
4129    /// The manifest type, which corresponds to the adaptive streaming format used.
4130    ///
4131    /// # Working with unknown values
4132    ///
4133    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4134    /// additional enum variants at any time. Adding new variants is not considered
4135    /// a breaking change. Applications should write their code in anticipation of:
4136    ///
4137    /// - New values appearing in future releases of the client library, **and**
4138    /// - New values received dynamically, without application changes.
4139    ///
4140    /// Please consult the [Working with enums] section in the user guide for some
4141    /// guidelines.
4142    ///
4143    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4144    #[derive(Clone, Debug, PartialEq)]
4145    #[non_exhaustive]
4146    pub enum ManifestType {
4147        /// The manifest type is not specified.
4148        Unspecified,
4149        /// Create an HLS manifest. The corresponding file extension is `.m3u8`.
4150        Hls,
4151        /// Create an MPEG-DASH manifest. The corresponding file extension is `.mpd`.
4152        Dash,
4153        /// If set, the enum was initialized with an unknown value.
4154        ///
4155        /// Applications can examine the value using [ManifestType::value] or
4156        /// [ManifestType::name].
4157        UnknownValue(manifest_type::UnknownValue),
4158    }
4159
4160    #[doc(hidden)]
4161    pub mod manifest_type {
4162        #[allow(unused_imports)]
4163        use super::*;
4164        #[derive(Clone, Debug, PartialEq)]
4165        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4166    }
4167
4168    impl ManifestType {
4169        /// Gets the enum value.
4170        ///
4171        /// Returns `None` if the enum contains an unknown value deserialized from
4172        /// the string representation of enums.
4173        pub fn value(&self) -> std::option::Option<i32> {
4174            match self {
4175                Self::Unspecified => std::option::Option::Some(0),
4176                Self::Hls => std::option::Option::Some(1),
4177                Self::Dash => std::option::Option::Some(2),
4178                Self::UnknownValue(u) => u.0.value(),
4179            }
4180        }
4181
4182        /// Gets the enum value as a string.
4183        ///
4184        /// Returns `None` if the enum contains an unknown value deserialized from
4185        /// the integer representation of enums.
4186        pub fn name(&self) -> std::option::Option<&str> {
4187            match self {
4188                Self::Unspecified => std::option::Option::Some("MANIFEST_TYPE_UNSPECIFIED"),
4189                Self::Hls => std::option::Option::Some("HLS"),
4190                Self::Dash => std::option::Option::Some("DASH"),
4191                Self::UnknownValue(u) => u.0.name(),
4192            }
4193        }
4194    }
4195
4196    impl std::default::Default for ManifestType {
4197        fn default() -> Self {
4198            use std::convert::From;
4199            Self::from(0)
4200        }
4201    }
4202
4203    impl std::fmt::Display for ManifestType {
4204        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4205            wkt::internal::display_enum(f, self.name(), self.value())
4206        }
4207    }
4208
4209    impl std::convert::From<i32> for ManifestType {
4210        fn from(value: i32) -> Self {
4211            match value {
4212                0 => Self::Unspecified,
4213                1 => Self::Hls,
4214                2 => Self::Dash,
4215                _ => Self::UnknownValue(manifest_type::UnknownValue(
4216                    wkt::internal::UnknownEnumValue::Integer(value),
4217                )),
4218            }
4219        }
4220    }
4221
4222    impl std::convert::From<&str> for ManifestType {
4223        fn from(value: &str) -> Self {
4224            use std::string::ToString;
4225            match value {
4226                "MANIFEST_TYPE_UNSPECIFIED" => Self::Unspecified,
4227                "HLS" => Self::Hls,
4228                "DASH" => Self::Dash,
4229                _ => Self::UnknownValue(manifest_type::UnknownValue(
4230                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4231                )),
4232            }
4233        }
4234    }
4235
4236    impl serde::ser::Serialize for ManifestType {
4237        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4238        where
4239            S: serde::Serializer,
4240        {
4241            match self {
4242                Self::Unspecified => serializer.serialize_i32(0),
4243                Self::Hls => serializer.serialize_i32(1),
4244                Self::Dash => serializer.serialize_i32(2),
4245                Self::UnknownValue(u) => u.0.serialize(serializer),
4246            }
4247        }
4248    }
4249
4250    impl<'de> serde::de::Deserialize<'de> for ManifestType {
4251        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4252        where
4253            D: serde::Deserializer<'de>,
4254        {
4255            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ManifestType>::new(
4256                ".google.cloud.video.transcoder.v1.Manifest.ManifestType",
4257            ))
4258        }
4259    }
4260
4261    /// Specifies the manifest configuration.
4262    #[derive(Clone, Debug, PartialEq)]
4263    #[non_exhaustive]
4264    pub enum ManifestConfig {
4265        /// `DASH` manifest configuration.
4266        Dash(std::boxed::Box<crate::model::manifest::DashConfig>),
4267    }
4268}
4269
4270/// A Pub/Sub destination.
4271#[derive(Clone, Default, PartialEq)]
4272#[non_exhaustive]
4273pub struct PubsubDestination {
4274    /// The name of the Pub/Sub topic to publish job completion notification
4275    /// to. For example: `projects/{project}/topics/{topic}`.
4276    pub topic: std::string::String,
4277
4278    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4279}
4280
4281impl PubsubDestination {
4282    pub fn new() -> Self {
4283        std::default::Default::default()
4284    }
4285
4286    /// Sets the value of [topic][crate::model::PubsubDestination::topic].
4287    pub fn set_topic<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4288        self.topic = v.into();
4289        self
4290    }
4291}
4292
4293impl wkt::message::Message for PubsubDestination {
4294    fn typename() -> &'static str {
4295        "type.googleapis.com/google.cloud.video.transcoder.v1.PubsubDestination"
4296    }
4297}
4298
4299#[doc(hidden)]
4300impl<'de> serde::de::Deserialize<'de> for PubsubDestination {
4301    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4302    where
4303        D: serde::Deserializer<'de>,
4304    {
4305        #[allow(non_camel_case_types)]
4306        #[doc(hidden)]
4307        #[derive(PartialEq, Eq, Hash)]
4308        enum __FieldTag {
4309            __topic,
4310            Unknown(std::string::String),
4311        }
4312        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4313            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4314            where
4315                D: serde::Deserializer<'de>,
4316            {
4317                struct Visitor;
4318                impl<'de> serde::de::Visitor<'de> for Visitor {
4319                    type Value = __FieldTag;
4320                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4321                        formatter.write_str("a field name for PubsubDestination")
4322                    }
4323                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4324                    where
4325                        E: serde::de::Error,
4326                    {
4327                        use std::result::Result::Ok;
4328                        use std::string::ToString;
4329                        match value {
4330                            "topic" => Ok(__FieldTag::__topic),
4331                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4332                        }
4333                    }
4334                }
4335                deserializer.deserialize_identifier(Visitor)
4336            }
4337        }
4338        struct Visitor;
4339        impl<'de> serde::de::Visitor<'de> for Visitor {
4340            type Value = PubsubDestination;
4341            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4342                formatter.write_str("struct PubsubDestination")
4343            }
4344            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4345            where
4346                A: serde::de::MapAccess<'de>,
4347            {
4348                #[allow(unused_imports)]
4349                use serde::de::Error;
4350                use std::option::Option::Some;
4351                let mut fields = std::collections::HashSet::new();
4352                let mut result = Self::Value::new();
4353                while let Some(tag) = map.next_key::<__FieldTag>()? {
4354                    #[allow(clippy::match_single_binding)]
4355                    match tag {
4356                        __FieldTag::__topic => {
4357                            if !fields.insert(__FieldTag::__topic) {
4358                                return std::result::Result::Err(A::Error::duplicate_field(
4359                                    "multiple values for topic",
4360                                ));
4361                            }
4362                            result.topic = map
4363                                .next_value::<std::option::Option<std::string::String>>()?
4364                                .unwrap_or_default();
4365                        }
4366                        __FieldTag::Unknown(key) => {
4367                            let value = map.next_value::<serde_json::Value>()?;
4368                            result._unknown_fields.insert(key, value);
4369                        }
4370                    }
4371                }
4372                std::result::Result::Ok(result)
4373            }
4374        }
4375        deserializer.deserialize_any(Visitor)
4376    }
4377}
4378
4379#[doc(hidden)]
4380impl serde::ser::Serialize for PubsubDestination {
4381    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4382    where
4383        S: serde::ser::Serializer,
4384    {
4385        use serde::ser::SerializeMap;
4386        #[allow(unused_imports)]
4387        use std::option::Option::Some;
4388        let mut state = serializer.serialize_map(std::option::Option::None)?;
4389        if !self.topic.is_empty() {
4390            state.serialize_entry("topic", &self.topic)?;
4391        }
4392        if !self._unknown_fields.is_empty() {
4393            for (key, value) in self._unknown_fields.iter() {
4394                state.serialize_entry(key, &value)?;
4395            }
4396        }
4397        state.end()
4398    }
4399}
4400
4401impl std::fmt::Debug for PubsubDestination {
4402    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4403        let mut debug_struct = f.debug_struct("PubsubDestination");
4404        debug_struct.field("topic", &self.topic);
4405        if !self._unknown_fields.is_empty() {
4406            debug_struct.field("_unknown_fields", &self._unknown_fields);
4407        }
4408        debug_struct.finish()
4409    }
4410}
4411
4412/// Sprite sheet configuration.
4413#[derive(Clone, Default, PartialEq)]
4414#[non_exhaustive]
4415pub struct SpriteSheet {
4416    /// Format type. The default is `jpeg`.
4417    ///
4418    /// Supported formats:
4419    ///
4420    /// - `jpeg`
4421    pub format: std::string::String,
4422
4423    /// Required. File name prefix for the generated sprite sheets.
4424    ///
4425    /// Each sprite sheet has an incremental 10-digit zero-padded suffix starting
4426    /// from 0 before the extension, such as `sprite_sheet0000000123.jpeg`.
4427    pub file_prefix: std::string::String,
4428
4429    /// Required. The width of sprite in pixels. Must be an even integer. To
4430    /// preserve the source aspect ratio, set the
4431    /// [SpriteSheet.sprite_width_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_width_pixels]
4432    /// field or the
4433    /// [SpriteSheet.sprite_height_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_height_pixels]
4434    /// field, but not both (the API will automatically calculate the missing
4435    /// field).
4436    ///
4437    /// For portrait videos that contain horizontal ASR and rotation metadata,
4438    /// provide the width, in pixels, per the horizontal ASR. The API calculates
4439    /// the height per the horizontal ASR. The API detects any rotation metadata
4440    /// and swaps the requested height and width for the output.
4441    ///
4442    /// [google.cloud.video.transcoder.v1.SpriteSheet.sprite_height_pixels]: crate::model::SpriteSheet::sprite_height_pixels
4443    /// [google.cloud.video.transcoder.v1.SpriteSheet.sprite_width_pixels]: crate::model::SpriteSheet::sprite_width_pixels
4444    pub sprite_width_pixels: i32,
4445
4446    /// Required. The height of sprite in pixels. Must be an even integer. To
4447    /// preserve the source aspect ratio, set the
4448    /// [SpriteSheet.sprite_height_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_height_pixels]
4449    /// field or the
4450    /// [SpriteSheet.sprite_width_pixels][google.cloud.video.transcoder.v1.SpriteSheet.sprite_width_pixels]
4451    /// field, but not both (the API will automatically calculate the missing
4452    /// field).
4453    ///
4454    /// For portrait videos that contain horizontal ASR and rotation metadata,
4455    /// provide the height, in pixels, per the horizontal ASR. The API calculates
4456    /// the width per the horizontal ASR. The API detects any rotation metadata
4457    /// and swaps the requested height and width for the output.
4458    ///
4459    /// [google.cloud.video.transcoder.v1.SpriteSheet.sprite_height_pixels]: crate::model::SpriteSheet::sprite_height_pixels
4460    /// [google.cloud.video.transcoder.v1.SpriteSheet.sprite_width_pixels]: crate::model::SpriteSheet::sprite_width_pixels
4461    pub sprite_height_pixels: i32,
4462
4463    /// The maximum number of sprites per row in a sprite sheet. The default is 0,
4464    /// which indicates no maximum limit.
4465    pub column_count: i32,
4466
4467    /// The maximum number of rows per sprite sheet. When the sprite sheet is full,
4468    /// a new sprite sheet is created. The default is 0, which indicates no maximum
4469    /// limit.
4470    pub row_count: i32,
4471
4472    /// Start time in seconds, relative to the output file timeline. Determines the
4473    /// first sprite to pick. The default is `0s`.
4474    pub start_time_offset: std::option::Option<wkt::Duration>,
4475
4476    /// End time in seconds, relative to the output file timeline. When
4477    /// `end_time_offset` is not specified, the sprites are generated until the end
4478    /// of the output file.
4479    pub end_time_offset: std::option::Option<wkt::Duration>,
4480
4481    /// The quality of the generated sprite sheet. Enter a value between 1
4482    /// and 100, where 1 is the lowest quality and 100 is the highest quality.
4483    /// The default is 100. A high quality value corresponds to a low image data
4484    /// compression ratio.
4485    pub quality: i32,
4486
4487    /// Specify either total number of sprites or interval to create sprites.
4488    pub extraction_strategy: std::option::Option<crate::model::sprite_sheet::ExtractionStrategy>,
4489
4490    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4491}
4492
4493impl SpriteSheet {
4494    pub fn new() -> Self {
4495        std::default::Default::default()
4496    }
4497
4498    /// Sets the value of [format][crate::model::SpriteSheet::format].
4499    pub fn set_format<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4500        self.format = v.into();
4501        self
4502    }
4503
4504    /// Sets the value of [file_prefix][crate::model::SpriteSheet::file_prefix].
4505    pub fn set_file_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4506        self.file_prefix = v.into();
4507        self
4508    }
4509
4510    /// Sets the value of [sprite_width_pixels][crate::model::SpriteSheet::sprite_width_pixels].
4511    pub fn set_sprite_width_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4512        self.sprite_width_pixels = v.into();
4513        self
4514    }
4515
4516    /// Sets the value of [sprite_height_pixels][crate::model::SpriteSheet::sprite_height_pixels].
4517    pub fn set_sprite_height_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4518        self.sprite_height_pixels = v.into();
4519        self
4520    }
4521
4522    /// Sets the value of [column_count][crate::model::SpriteSheet::column_count].
4523    pub fn set_column_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4524        self.column_count = v.into();
4525        self
4526    }
4527
4528    /// Sets the value of [row_count][crate::model::SpriteSheet::row_count].
4529    pub fn set_row_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4530        self.row_count = v.into();
4531        self
4532    }
4533
4534    /// Sets the value of [start_time_offset][crate::model::SpriteSheet::start_time_offset].
4535    pub fn set_start_time_offset<T>(mut self, v: T) -> Self
4536    where
4537        T: std::convert::Into<wkt::Duration>,
4538    {
4539        self.start_time_offset = std::option::Option::Some(v.into());
4540        self
4541    }
4542
4543    /// Sets or clears the value of [start_time_offset][crate::model::SpriteSheet::start_time_offset].
4544    pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
4545    where
4546        T: std::convert::Into<wkt::Duration>,
4547    {
4548        self.start_time_offset = v.map(|x| x.into());
4549        self
4550    }
4551
4552    /// Sets the value of [end_time_offset][crate::model::SpriteSheet::end_time_offset].
4553    pub fn set_end_time_offset<T>(mut self, v: T) -> Self
4554    where
4555        T: std::convert::Into<wkt::Duration>,
4556    {
4557        self.end_time_offset = std::option::Option::Some(v.into());
4558        self
4559    }
4560
4561    /// Sets or clears the value of [end_time_offset][crate::model::SpriteSheet::end_time_offset].
4562    pub fn set_or_clear_end_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
4563    where
4564        T: std::convert::Into<wkt::Duration>,
4565    {
4566        self.end_time_offset = v.map(|x| x.into());
4567        self
4568    }
4569
4570    /// Sets the value of [quality][crate::model::SpriteSheet::quality].
4571    pub fn set_quality<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4572        self.quality = v.into();
4573        self
4574    }
4575
4576    /// Sets the value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy].
4577    ///
4578    /// Note that all the setters affecting `extraction_strategy` are mutually
4579    /// exclusive.
4580    pub fn set_extraction_strategy<
4581        T: std::convert::Into<std::option::Option<crate::model::sprite_sheet::ExtractionStrategy>>,
4582    >(
4583        mut self,
4584        v: T,
4585    ) -> Self {
4586        self.extraction_strategy = v.into();
4587        self
4588    }
4589
4590    /// The value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy]
4591    /// if it holds a `TotalCount`, `None` if the field is not set or
4592    /// holds a different branch.
4593    pub fn total_count(&self) -> std::option::Option<&i32> {
4594        #[allow(unreachable_patterns)]
4595        self.extraction_strategy.as_ref().and_then(|v| match v {
4596            crate::model::sprite_sheet::ExtractionStrategy::TotalCount(v) => {
4597                std::option::Option::Some(v)
4598            }
4599            _ => std::option::Option::None,
4600        })
4601    }
4602
4603    /// Sets the value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy]
4604    /// to hold a `TotalCount`.
4605    ///
4606    /// Note that all the setters affecting `extraction_strategy` are
4607    /// mutually exclusive.
4608    pub fn set_total_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4609        self.extraction_strategy = std::option::Option::Some(
4610            crate::model::sprite_sheet::ExtractionStrategy::TotalCount(v.into()),
4611        );
4612        self
4613    }
4614
4615    /// The value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy]
4616    /// if it holds a `Interval`, `None` if the field is not set or
4617    /// holds a different branch.
4618    pub fn interval(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
4619        #[allow(unreachable_patterns)]
4620        self.extraction_strategy.as_ref().and_then(|v| match v {
4621            crate::model::sprite_sheet::ExtractionStrategy::Interval(v) => {
4622                std::option::Option::Some(v)
4623            }
4624            _ => std::option::Option::None,
4625        })
4626    }
4627
4628    /// Sets the value of [extraction_strategy][crate::model::SpriteSheet::extraction_strategy]
4629    /// to hold a `Interval`.
4630    ///
4631    /// Note that all the setters affecting `extraction_strategy` are
4632    /// mutually exclusive.
4633    pub fn set_interval<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
4634        mut self,
4635        v: T,
4636    ) -> Self {
4637        self.extraction_strategy = std::option::Option::Some(
4638            crate::model::sprite_sheet::ExtractionStrategy::Interval(v.into()),
4639        );
4640        self
4641    }
4642}
4643
4644impl wkt::message::Message for SpriteSheet {
4645    fn typename() -> &'static str {
4646        "type.googleapis.com/google.cloud.video.transcoder.v1.SpriteSheet"
4647    }
4648}
4649
4650#[doc(hidden)]
4651impl<'de> serde::de::Deserialize<'de> for SpriteSheet {
4652    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4653    where
4654        D: serde::Deserializer<'de>,
4655    {
4656        #[allow(non_camel_case_types)]
4657        #[doc(hidden)]
4658        #[derive(PartialEq, Eq, Hash)]
4659        enum __FieldTag {
4660            __format,
4661            __file_prefix,
4662            __sprite_width_pixels,
4663            __sprite_height_pixels,
4664            __column_count,
4665            __row_count,
4666            __start_time_offset,
4667            __end_time_offset,
4668            __total_count,
4669            __interval,
4670            __quality,
4671            Unknown(std::string::String),
4672        }
4673        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4674            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4675            where
4676                D: serde::Deserializer<'de>,
4677            {
4678                struct Visitor;
4679                impl<'de> serde::de::Visitor<'de> for Visitor {
4680                    type Value = __FieldTag;
4681                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4682                        formatter.write_str("a field name for SpriteSheet")
4683                    }
4684                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4685                    where
4686                        E: serde::de::Error,
4687                    {
4688                        use std::result::Result::Ok;
4689                        use std::string::ToString;
4690                        match value {
4691                            "format" => Ok(__FieldTag::__format),
4692                            "filePrefix" => Ok(__FieldTag::__file_prefix),
4693                            "file_prefix" => Ok(__FieldTag::__file_prefix),
4694                            "spriteWidthPixels" => Ok(__FieldTag::__sprite_width_pixels),
4695                            "sprite_width_pixels" => Ok(__FieldTag::__sprite_width_pixels),
4696                            "spriteHeightPixels" => Ok(__FieldTag::__sprite_height_pixels),
4697                            "sprite_height_pixels" => Ok(__FieldTag::__sprite_height_pixels),
4698                            "columnCount" => Ok(__FieldTag::__column_count),
4699                            "column_count" => Ok(__FieldTag::__column_count),
4700                            "rowCount" => Ok(__FieldTag::__row_count),
4701                            "row_count" => Ok(__FieldTag::__row_count),
4702                            "startTimeOffset" => Ok(__FieldTag::__start_time_offset),
4703                            "start_time_offset" => Ok(__FieldTag::__start_time_offset),
4704                            "endTimeOffset" => Ok(__FieldTag::__end_time_offset),
4705                            "end_time_offset" => Ok(__FieldTag::__end_time_offset),
4706                            "totalCount" => Ok(__FieldTag::__total_count),
4707                            "total_count" => Ok(__FieldTag::__total_count),
4708                            "interval" => Ok(__FieldTag::__interval),
4709                            "quality" => Ok(__FieldTag::__quality),
4710                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4711                        }
4712                    }
4713                }
4714                deserializer.deserialize_identifier(Visitor)
4715            }
4716        }
4717        struct Visitor;
4718        impl<'de> serde::de::Visitor<'de> for Visitor {
4719            type Value = SpriteSheet;
4720            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4721                formatter.write_str("struct SpriteSheet")
4722            }
4723            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4724            where
4725                A: serde::de::MapAccess<'de>,
4726            {
4727                #[allow(unused_imports)]
4728                use serde::de::Error;
4729                use std::option::Option::Some;
4730                let mut fields = std::collections::HashSet::new();
4731                let mut result = Self::Value::new();
4732                while let Some(tag) = map.next_key::<__FieldTag>()? {
4733                    #[allow(clippy::match_single_binding)]
4734                    match tag {
4735                        __FieldTag::__format => {
4736                            if !fields.insert(__FieldTag::__format) {
4737                                return std::result::Result::Err(A::Error::duplicate_field(
4738                                    "multiple values for format",
4739                                ));
4740                            }
4741                            result.format = map
4742                                .next_value::<std::option::Option<std::string::String>>()?
4743                                .unwrap_or_default();
4744                        }
4745                        __FieldTag::__file_prefix => {
4746                            if !fields.insert(__FieldTag::__file_prefix) {
4747                                return std::result::Result::Err(A::Error::duplicate_field(
4748                                    "multiple values for file_prefix",
4749                                ));
4750                            }
4751                            result.file_prefix = map
4752                                .next_value::<std::option::Option<std::string::String>>()?
4753                                .unwrap_or_default();
4754                        }
4755                        __FieldTag::__sprite_width_pixels => {
4756                            if !fields.insert(__FieldTag::__sprite_width_pixels) {
4757                                return std::result::Result::Err(A::Error::duplicate_field(
4758                                    "multiple values for sprite_width_pixels",
4759                                ));
4760                            }
4761                            struct __With(std::option::Option<i32>);
4762                            impl<'de> serde::de::Deserialize<'de> for __With {
4763                                fn deserialize<D>(
4764                                    deserializer: D,
4765                                ) -> std::result::Result<Self, D::Error>
4766                                where
4767                                    D: serde::de::Deserializer<'de>,
4768                                {
4769                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
4770                                }
4771                            }
4772                            result.sprite_width_pixels =
4773                                map.next_value::<__With>()?.0.unwrap_or_default();
4774                        }
4775                        __FieldTag::__sprite_height_pixels => {
4776                            if !fields.insert(__FieldTag::__sprite_height_pixels) {
4777                                return std::result::Result::Err(A::Error::duplicate_field(
4778                                    "multiple values for sprite_height_pixels",
4779                                ));
4780                            }
4781                            struct __With(std::option::Option<i32>);
4782                            impl<'de> serde::de::Deserialize<'de> for __With {
4783                                fn deserialize<D>(
4784                                    deserializer: D,
4785                                ) -> std::result::Result<Self, D::Error>
4786                                where
4787                                    D: serde::de::Deserializer<'de>,
4788                                {
4789                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
4790                                }
4791                            }
4792                            result.sprite_height_pixels =
4793                                map.next_value::<__With>()?.0.unwrap_or_default();
4794                        }
4795                        __FieldTag::__column_count => {
4796                            if !fields.insert(__FieldTag::__column_count) {
4797                                return std::result::Result::Err(A::Error::duplicate_field(
4798                                    "multiple values for column_count",
4799                                ));
4800                            }
4801                            struct __With(std::option::Option<i32>);
4802                            impl<'de> serde::de::Deserialize<'de> for __With {
4803                                fn deserialize<D>(
4804                                    deserializer: D,
4805                                ) -> std::result::Result<Self, D::Error>
4806                                where
4807                                    D: serde::de::Deserializer<'de>,
4808                                {
4809                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
4810                                }
4811                            }
4812                            result.column_count = map.next_value::<__With>()?.0.unwrap_or_default();
4813                        }
4814                        __FieldTag::__row_count => {
4815                            if !fields.insert(__FieldTag::__row_count) {
4816                                return std::result::Result::Err(A::Error::duplicate_field(
4817                                    "multiple values for row_count",
4818                                ));
4819                            }
4820                            struct __With(std::option::Option<i32>);
4821                            impl<'de> serde::de::Deserialize<'de> for __With {
4822                                fn deserialize<D>(
4823                                    deserializer: D,
4824                                ) -> std::result::Result<Self, D::Error>
4825                                where
4826                                    D: serde::de::Deserializer<'de>,
4827                                {
4828                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
4829                                }
4830                            }
4831                            result.row_count = map.next_value::<__With>()?.0.unwrap_or_default();
4832                        }
4833                        __FieldTag::__start_time_offset => {
4834                            if !fields.insert(__FieldTag::__start_time_offset) {
4835                                return std::result::Result::Err(A::Error::duplicate_field(
4836                                    "multiple values for start_time_offset",
4837                                ));
4838                            }
4839                            result.start_time_offset =
4840                                map.next_value::<std::option::Option<wkt::Duration>>()?;
4841                        }
4842                        __FieldTag::__end_time_offset => {
4843                            if !fields.insert(__FieldTag::__end_time_offset) {
4844                                return std::result::Result::Err(A::Error::duplicate_field(
4845                                    "multiple values for end_time_offset",
4846                                ));
4847                            }
4848                            result.end_time_offset =
4849                                map.next_value::<std::option::Option<wkt::Duration>>()?;
4850                        }
4851                        __FieldTag::__total_count => {
4852                            if !fields.insert(__FieldTag::__total_count) {
4853                                return std::result::Result::Err(A::Error::duplicate_field(
4854                                    "multiple values for total_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                            if result.extraction_strategy.is_some() {
4869                                return std::result::Result::Err(A::Error::duplicate_field(
4870                                    "multiple values for `extraction_strategy`, a oneof with full ID .google.cloud.video.transcoder.v1.SpriteSheet.total_count, latest field was totalCount",
4871                                ));
4872                            }
4873                            result.extraction_strategy = std::option::Option::Some(
4874                                crate::model::sprite_sheet::ExtractionStrategy::TotalCount(
4875                                    map.next_value::<__With>()?.0.unwrap_or_default(),
4876                                ),
4877                            );
4878                        }
4879                        __FieldTag::__interval => {
4880                            if !fields.insert(__FieldTag::__interval) {
4881                                return std::result::Result::Err(A::Error::duplicate_field(
4882                                    "multiple values for interval",
4883                                ));
4884                            }
4885                            if result.extraction_strategy.is_some() {
4886                                return std::result::Result::Err(A::Error::duplicate_field(
4887                                    "multiple values for `extraction_strategy`, a oneof with full ID .google.cloud.video.transcoder.v1.SpriteSheet.interval, latest field was interval",
4888                                ));
4889                            }
4890                            result.extraction_strategy = std::option::Option::Some(
4891                                crate::model::sprite_sheet::ExtractionStrategy::Interval(
4892                                    map.next_value::<std::option::Option<std::boxed::Box<wkt::Duration>>>()?.unwrap_or_default()
4893                                ),
4894                            );
4895                        }
4896                        __FieldTag::__quality => {
4897                            if !fields.insert(__FieldTag::__quality) {
4898                                return std::result::Result::Err(A::Error::duplicate_field(
4899                                    "multiple values for quality",
4900                                ));
4901                            }
4902                            struct __With(std::option::Option<i32>);
4903                            impl<'de> serde::de::Deserialize<'de> for __With {
4904                                fn deserialize<D>(
4905                                    deserializer: D,
4906                                ) -> std::result::Result<Self, D::Error>
4907                                where
4908                                    D: serde::de::Deserializer<'de>,
4909                                {
4910                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
4911                                }
4912                            }
4913                            result.quality = map.next_value::<__With>()?.0.unwrap_or_default();
4914                        }
4915                        __FieldTag::Unknown(key) => {
4916                            let value = map.next_value::<serde_json::Value>()?;
4917                            result._unknown_fields.insert(key, value);
4918                        }
4919                    }
4920                }
4921                std::result::Result::Ok(result)
4922            }
4923        }
4924        deserializer.deserialize_any(Visitor)
4925    }
4926}
4927
4928#[doc(hidden)]
4929impl serde::ser::Serialize for SpriteSheet {
4930    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4931    where
4932        S: serde::ser::Serializer,
4933    {
4934        use serde::ser::SerializeMap;
4935        #[allow(unused_imports)]
4936        use std::option::Option::Some;
4937        let mut state = serializer.serialize_map(std::option::Option::None)?;
4938        if !self.format.is_empty() {
4939            state.serialize_entry("format", &self.format)?;
4940        }
4941        if !self.file_prefix.is_empty() {
4942            state.serialize_entry("filePrefix", &self.file_prefix)?;
4943        }
4944        if !wkt::internal::is_default(&self.sprite_width_pixels) {
4945            struct __With<'a>(&'a i32);
4946            impl<'a> serde::ser::Serialize for __With<'a> {
4947                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4948                where
4949                    S: serde::ser::Serializer,
4950                {
4951                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
4952                }
4953            }
4954            state.serialize_entry("spriteWidthPixels", &__With(&self.sprite_width_pixels))?;
4955        }
4956        if !wkt::internal::is_default(&self.sprite_height_pixels) {
4957            struct __With<'a>(&'a i32);
4958            impl<'a> serde::ser::Serialize for __With<'a> {
4959                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4960                where
4961                    S: serde::ser::Serializer,
4962                {
4963                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
4964                }
4965            }
4966            state.serialize_entry("spriteHeightPixels", &__With(&self.sprite_height_pixels))?;
4967        }
4968        if !wkt::internal::is_default(&self.column_count) {
4969            struct __With<'a>(&'a i32);
4970            impl<'a> serde::ser::Serialize for __With<'a> {
4971                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4972                where
4973                    S: serde::ser::Serializer,
4974                {
4975                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
4976                }
4977            }
4978            state.serialize_entry("columnCount", &__With(&self.column_count))?;
4979        }
4980        if !wkt::internal::is_default(&self.row_count) {
4981            struct __With<'a>(&'a i32);
4982            impl<'a> serde::ser::Serialize for __With<'a> {
4983                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4984                where
4985                    S: serde::ser::Serializer,
4986                {
4987                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
4988                }
4989            }
4990            state.serialize_entry("rowCount", &__With(&self.row_count))?;
4991        }
4992        if self.start_time_offset.is_some() {
4993            state.serialize_entry("startTimeOffset", &self.start_time_offset)?;
4994        }
4995        if self.end_time_offset.is_some() {
4996            state.serialize_entry("endTimeOffset", &self.end_time_offset)?;
4997        }
4998        if let Some(value) = self.total_count() {
4999            struct __With<'a>(&'a i32);
5000            impl<'a> serde::ser::Serialize for __With<'a> {
5001                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5002                where
5003                    S: serde::ser::Serializer,
5004                {
5005                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
5006                }
5007            }
5008            state.serialize_entry("totalCount", &__With(value))?;
5009        }
5010        if let Some(value) = self.interval() {
5011            state.serialize_entry("interval", value)?;
5012        }
5013        if !wkt::internal::is_default(&self.quality) {
5014            struct __With<'a>(&'a i32);
5015            impl<'a> serde::ser::Serialize for __With<'a> {
5016                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5017                where
5018                    S: serde::ser::Serializer,
5019                {
5020                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
5021                }
5022            }
5023            state.serialize_entry("quality", &__With(&self.quality))?;
5024        }
5025        if !self._unknown_fields.is_empty() {
5026            for (key, value) in self._unknown_fields.iter() {
5027                state.serialize_entry(key, &value)?;
5028            }
5029        }
5030        state.end()
5031    }
5032}
5033
5034impl std::fmt::Debug for SpriteSheet {
5035    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5036        let mut debug_struct = f.debug_struct("SpriteSheet");
5037        debug_struct.field("format", &self.format);
5038        debug_struct.field("file_prefix", &self.file_prefix);
5039        debug_struct.field("sprite_width_pixels", &self.sprite_width_pixels);
5040        debug_struct.field("sprite_height_pixels", &self.sprite_height_pixels);
5041        debug_struct.field("column_count", &self.column_count);
5042        debug_struct.field("row_count", &self.row_count);
5043        debug_struct.field("start_time_offset", &self.start_time_offset);
5044        debug_struct.field("end_time_offset", &self.end_time_offset);
5045        debug_struct.field("quality", &self.quality);
5046        debug_struct.field("extraction_strategy", &self.extraction_strategy);
5047        if !self._unknown_fields.is_empty() {
5048            debug_struct.field("_unknown_fields", &self._unknown_fields);
5049        }
5050        debug_struct.finish()
5051    }
5052}
5053
5054/// Defines additional types related to [SpriteSheet].
5055pub mod sprite_sheet {
5056    #[allow(unused_imports)]
5057    use super::*;
5058
5059    /// Specify either total number of sprites or interval to create sprites.
5060    #[derive(Clone, Debug, PartialEq)]
5061    #[non_exhaustive]
5062    pub enum ExtractionStrategy {
5063        /// Total number of sprites. Create the specified number of sprites
5064        /// distributed evenly across the timeline of the output media. The default
5065        /// is 100.
5066        TotalCount(i32),
5067        /// Starting from `0s`, create sprites at regular intervals. Specify the
5068        /// interval value in seconds.
5069        Interval(std::boxed::Box<wkt::Duration>),
5070    }
5071}
5072
5073/// Overlay configuration.
5074#[derive(Clone, Default, PartialEq)]
5075#[non_exhaustive]
5076pub struct Overlay {
5077    /// Image overlay.
5078    pub image: std::option::Option<crate::model::overlay::Image>,
5079
5080    /// List of animations. The list should be chronological, without any time
5081    /// overlap.
5082    pub animations: std::vec::Vec<crate::model::overlay::Animation>,
5083
5084    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5085}
5086
5087impl Overlay {
5088    pub fn new() -> Self {
5089        std::default::Default::default()
5090    }
5091
5092    /// Sets the value of [image][crate::model::Overlay::image].
5093    pub fn set_image<T>(mut self, v: T) -> Self
5094    where
5095        T: std::convert::Into<crate::model::overlay::Image>,
5096    {
5097        self.image = std::option::Option::Some(v.into());
5098        self
5099    }
5100
5101    /// Sets or clears the value of [image][crate::model::Overlay::image].
5102    pub fn set_or_clear_image<T>(mut self, v: std::option::Option<T>) -> Self
5103    where
5104        T: std::convert::Into<crate::model::overlay::Image>,
5105    {
5106        self.image = v.map(|x| x.into());
5107        self
5108    }
5109
5110    /// Sets the value of [animations][crate::model::Overlay::animations].
5111    pub fn set_animations<T, V>(mut self, v: T) -> Self
5112    where
5113        T: std::iter::IntoIterator<Item = V>,
5114        V: std::convert::Into<crate::model::overlay::Animation>,
5115    {
5116        use std::iter::Iterator;
5117        self.animations = v.into_iter().map(|i| i.into()).collect();
5118        self
5119    }
5120}
5121
5122impl wkt::message::Message for Overlay {
5123    fn typename() -> &'static str {
5124        "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay"
5125    }
5126}
5127
5128#[doc(hidden)]
5129impl<'de> serde::de::Deserialize<'de> for Overlay {
5130    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5131    where
5132        D: serde::Deserializer<'de>,
5133    {
5134        #[allow(non_camel_case_types)]
5135        #[doc(hidden)]
5136        #[derive(PartialEq, Eq, Hash)]
5137        enum __FieldTag {
5138            __image,
5139            __animations,
5140            Unknown(std::string::String),
5141        }
5142        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5143            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5144            where
5145                D: serde::Deserializer<'de>,
5146            {
5147                struct Visitor;
5148                impl<'de> serde::de::Visitor<'de> for Visitor {
5149                    type Value = __FieldTag;
5150                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5151                        formatter.write_str("a field name for Overlay")
5152                    }
5153                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5154                    where
5155                        E: serde::de::Error,
5156                    {
5157                        use std::result::Result::Ok;
5158                        use std::string::ToString;
5159                        match value {
5160                            "image" => Ok(__FieldTag::__image),
5161                            "animations" => Ok(__FieldTag::__animations),
5162                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5163                        }
5164                    }
5165                }
5166                deserializer.deserialize_identifier(Visitor)
5167            }
5168        }
5169        struct Visitor;
5170        impl<'de> serde::de::Visitor<'de> for Visitor {
5171            type Value = Overlay;
5172            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5173                formatter.write_str("struct Overlay")
5174            }
5175            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5176            where
5177                A: serde::de::MapAccess<'de>,
5178            {
5179                #[allow(unused_imports)]
5180                use serde::de::Error;
5181                use std::option::Option::Some;
5182                let mut fields = std::collections::HashSet::new();
5183                let mut result = Self::Value::new();
5184                while let Some(tag) = map.next_key::<__FieldTag>()? {
5185                    #[allow(clippy::match_single_binding)]
5186                    match tag {
5187                        __FieldTag::__image => {
5188                            if !fields.insert(__FieldTag::__image) {
5189                                return std::result::Result::Err(A::Error::duplicate_field(
5190                                    "multiple values for image",
5191                                ));
5192                            }
5193                            result.image = map
5194                                .next_value::<std::option::Option<crate::model::overlay::Image>>(
5195                                )?;
5196                        }
5197                        __FieldTag::__animations => {
5198                            if !fields.insert(__FieldTag::__animations) {
5199                                return std::result::Result::Err(A::Error::duplicate_field(
5200                                    "multiple values for animations",
5201                                ));
5202                            }
5203                            result.animations = map
5204                                .next_value::<std::option::Option<
5205                                    std::vec::Vec<crate::model::overlay::Animation>,
5206                                >>()?
5207                                .unwrap_or_default();
5208                        }
5209                        __FieldTag::Unknown(key) => {
5210                            let value = map.next_value::<serde_json::Value>()?;
5211                            result._unknown_fields.insert(key, value);
5212                        }
5213                    }
5214                }
5215                std::result::Result::Ok(result)
5216            }
5217        }
5218        deserializer.deserialize_any(Visitor)
5219    }
5220}
5221
5222#[doc(hidden)]
5223impl serde::ser::Serialize for Overlay {
5224    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5225    where
5226        S: serde::ser::Serializer,
5227    {
5228        use serde::ser::SerializeMap;
5229        #[allow(unused_imports)]
5230        use std::option::Option::Some;
5231        let mut state = serializer.serialize_map(std::option::Option::None)?;
5232        if self.image.is_some() {
5233            state.serialize_entry("image", &self.image)?;
5234        }
5235        if !self.animations.is_empty() {
5236            state.serialize_entry("animations", &self.animations)?;
5237        }
5238        if !self._unknown_fields.is_empty() {
5239            for (key, value) in self._unknown_fields.iter() {
5240                state.serialize_entry(key, &value)?;
5241            }
5242        }
5243        state.end()
5244    }
5245}
5246
5247impl std::fmt::Debug for Overlay {
5248    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5249        let mut debug_struct = f.debug_struct("Overlay");
5250        debug_struct.field("image", &self.image);
5251        debug_struct.field("animations", &self.animations);
5252        if !self._unknown_fields.is_empty() {
5253            debug_struct.field("_unknown_fields", &self._unknown_fields);
5254        }
5255        debug_struct.finish()
5256    }
5257}
5258
5259/// Defines additional types related to [Overlay].
5260pub mod overlay {
5261    #[allow(unused_imports)]
5262    use super::*;
5263
5264    /// 2D normalized coordinates. Default: `{0.0, 0.0}`
5265    #[derive(Clone, Default, PartialEq)]
5266    #[non_exhaustive]
5267    pub struct NormalizedCoordinate {
5268        /// Normalized x coordinate.
5269        pub x: f64,
5270
5271        /// Normalized y coordinate.
5272        pub y: f64,
5273
5274        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5275    }
5276
5277    impl NormalizedCoordinate {
5278        pub fn new() -> Self {
5279            std::default::Default::default()
5280        }
5281
5282        /// Sets the value of [x][crate::model::overlay::NormalizedCoordinate::x].
5283        pub fn set_x<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
5284            self.x = v.into();
5285            self
5286        }
5287
5288        /// Sets the value of [y][crate::model::overlay::NormalizedCoordinate::y].
5289        pub fn set_y<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
5290            self.y = v.into();
5291            self
5292        }
5293    }
5294
5295    impl wkt::message::Message for NormalizedCoordinate {
5296        fn typename() -> &'static str {
5297            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.NormalizedCoordinate"
5298        }
5299    }
5300
5301    #[doc(hidden)]
5302    impl<'de> serde::de::Deserialize<'de> for NormalizedCoordinate {
5303        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5304        where
5305            D: serde::Deserializer<'de>,
5306        {
5307            #[allow(non_camel_case_types)]
5308            #[doc(hidden)]
5309            #[derive(PartialEq, Eq, Hash)]
5310            enum __FieldTag {
5311                __x,
5312                __y,
5313                Unknown(std::string::String),
5314            }
5315            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5316                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5317                where
5318                    D: serde::Deserializer<'de>,
5319                {
5320                    struct Visitor;
5321                    impl<'de> serde::de::Visitor<'de> for Visitor {
5322                        type Value = __FieldTag;
5323                        fn expecting(
5324                            &self,
5325                            formatter: &mut std::fmt::Formatter,
5326                        ) -> std::fmt::Result {
5327                            formatter.write_str("a field name for NormalizedCoordinate")
5328                        }
5329                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5330                        where
5331                            E: serde::de::Error,
5332                        {
5333                            use std::result::Result::Ok;
5334                            use std::string::ToString;
5335                            match value {
5336                                "x" => Ok(__FieldTag::__x),
5337                                "y" => Ok(__FieldTag::__y),
5338                                _ => Ok(__FieldTag::Unknown(value.to_string())),
5339                            }
5340                        }
5341                    }
5342                    deserializer.deserialize_identifier(Visitor)
5343                }
5344            }
5345            struct Visitor;
5346            impl<'de> serde::de::Visitor<'de> for Visitor {
5347                type Value = NormalizedCoordinate;
5348                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5349                    formatter.write_str("struct NormalizedCoordinate")
5350                }
5351                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5352                where
5353                    A: serde::de::MapAccess<'de>,
5354                {
5355                    #[allow(unused_imports)]
5356                    use serde::de::Error;
5357                    use std::option::Option::Some;
5358                    let mut fields = std::collections::HashSet::new();
5359                    let mut result = Self::Value::new();
5360                    while let Some(tag) = map.next_key::<__FieldTag>()? {
5361                        #[allow(clippy::match_single_binding)]
5362                        match tag {
5363                            __FieldTag::__x => {
5364                                if !fields.insert(__FieldTag::__x) {
5365                                    return std::result::Result::Err(A::Error::duplicate_field(
5366                                        "multiple values for x",
5367                                    ));
5368                                }
5369                                struct __With(std::option::Option<f64>);
5370                                impl<'de> serde::de::Deserialize<'de> for __With {
5371                                    fn deserialize<D>(
5372                                        deserializer: D,
5373                                    ) -> std::result::Result<Self, D::Error>
5374                                    where
5375                                        D: serde::de::Deserializer<'de>,
5376                                    {
5377                                        serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
5378                                    }
5379                                }
5380                                result.x = map.next_value::<__With>()?.0.unwrap_or_default();
5381                            }
5382                            __FieldTag::__y => {
5383                                if !fields.insert(__FieldTag::__y) {
5384                                    return std::result::Result::Err(A::Error::duplicate_field(
5385                                        "multiple values for y",
5386                                    ));
5387                                }
5388                                struct __With(std::option::Option<f64>);
5389                                impl<'de> serde::de::Deserialize<'de> for __With {
5390                                    fn deserialize<D>(
5391                                        deserializer: D,
5392                                    ) -> std::result::Result<Self, D::Error>
5393                                    where
5394                                        D: serde::de::Deserializer<'de>,
5395                                    {
5396                                        serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
5397                                    }
5398                                }
5399                                result.y = map.next_value::<__With>()?.0.unwrap_or_default();
5400                            }
5401                            __FieldTag::Unknown(key) => {
5402                                let value = map.next_value::<serde_json::Value>()?;
5403                                result._unknown_fields.insert(key, value);
5404                            }
5405                        }
5406                    }
5407                    std::result::Result::Ok(result)
5408                }
5409            }
5410            deserializer.deserialize_any(Visitor)
5411        }
5412    }
5413
5414    #[doc(hidden)]
5415    impl serde::ser::Serialize for NormalizedCoordinate {
5416        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5417        where
5418            S: serde::ser::Serializer,
5419        {
5420            use serde::ser::SerializeMap;
5421            #[allow(unused_imports)]
5422            use std::option::Option::Some;
5423            let mut state = serializer.serialize_map(std::option::Option::None)?;
5424            if !wkt::internal::is_default(&self.x) {
5425                struct __With<'a>(&'a f64);
5426                impl<'a> serde::ser::Serialize for __With<'a> {
5427                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5428                    where
5429                        S: serde::ser::Serializer,
5430                    {
5431                        serde_with::As::<wkt::internal::F64>::serialize(self.0, serializer)
5432                    }
5433                }
5434                state.serialize_entry("x", &__With(&self.x))?;
5435            }
5436            if !wkt::internal::is_default(&self.y) {
5437                struct __With<'a>(&'a f64);
5438                impl<'a> serde::ser::Serialize for __With<'a> {
5439                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5440                    where
5441                        S: serde::ser::Serializer,
5442                    {
5443                        serde_with::As::<wkt::internal::F64>::serialize(self.0, serializer)
5444                    }
5445                }
5446                state.serialize_entry("y", &__With(&self.y))?;
5447            }
5448            if !self._unknown_fields.is_empty() {
5449                for (key, value) in self._unknown_fields.iter() {
5450                    state.serialize_entry(key, &value)?;
5451                }
5452            }
5453            state.end()
5454        }
5455    }
5456
5457    impl std::fmt::Debug for NormalizedCoordinate {
5458        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5459            let mut debug_struct = f.debug_struct("NormalizedCoordinate");
5460            debug_struct.field("x", &self.x);
5461            debug_struct.field("y", &self.y);
5462            if !self._unknown_fields.is_empty() {
5463                debug_struct.field("_unknown_fields", &self._unknown_fields);
5464            }
5465            debug_struct.finish()
5466        }
5467    }
5468
5469    /// Overlaid image.
5470    #[derive(Clone, Default, PartialEq)]
5471    #[non_exhaustive]
5472    pub struct Image {
5473        /// Required. URI of the image in Cloud Storage. For example,
5474        /// `gs://bucket/inputs/image.png`. Only PNG and JPEG images are supported.
5475        pub uri: std::string::String,
5476
5477        /// Normalized image resolution, based on output video resolution. Valid
5478        /// values: `0.0`–`1.0`. To respect the original image aspect ratio, set
5479        /// either `x` or `y` to `0.0`. To use the original image resolution, set
5480        /// both `x` and `y` to `0.0`.
5481        pub resolution: std::option::Option<crate::model::overlay::NormalizedCoordinate>,
5482
5483        /// Target image opacity. Valid values are from  `1.0` (solid, default) to
5484        /// `0.0` (transparent), exclusive. Set this to a value greater than `0.0`.
5485        pub alpha: f64,
5486
5487        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5488    }
5489
5490    impl Image {
5491        pub fn new() -> Self {
5492            std::default::Default::default()
5493        }
5494
5495        /// Sets the value of [uri][crate::model::overlay::Image::uri].
5496        pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5497            self.uri = v.into();
5498            self
5499        }
5500
5501        /// Sets the value of [resolution][crate::model::overlay::Image::resolution].
5502        pub fn set_resolution<T>(mut self, v: T) -> Self
5503        where
5504            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
5505        {
5506            self.resolution = std::option::Option::Some(v.into());
5507            self
5508        }
5509
5510        /// Sets or clears the value of [resolution][crate::model::overlay::Image::resolution].
5511        pub fn set_or_clear_resolution<T>(mut self, v: std::option::Option<T>) -> Self
5512        where
5513            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
5514        {
5515            self.resolution = v.map(|x| x.into());
5516            self
5517        }
5518
5519        /// Sets the value of [alpha][crate::model::overlay::Image::alpha].
5520        pub fn set_alpha<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
5521            self.alpha = v.into();
5522            self
5523        }
5524    }
5525
5526    impl wkt::message::Message for Image {
5527        fn typename() -> &'static str {
5528            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.Image"
5529        }
5530    }
5531
5532    #[doc(hidden)]
5533    impl<'de> serde::de::Deserialize<'de> for Image {
5534        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5535        where
5536            D: serde::Deserializer<'de>,
5537        {
5538            #[allow(non_camel_case_types)]
5539            #[doc(hidden)]
5540            #[derive(PartialEq, Eq, Hash)]
5541            enum __FieldTag {
5542                __uri,
5543                __resolution,
5544                __alpha,
5545                Unknown(std::string::String),
5546            }
5547            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5548                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5549                where
5550                    D: serde::Deserializer<'de>,
5551                {
5552                    struct Visitor;
5553                    impl<'de> serde::de::Visitor<'de> for Visitor {
5554                        type Value = __FieldTag;
5555                        fn expecting(
5556                            &self,
5557                            formatter: &mut std::fmt::Formatter,
5558                        ) -> std::fmt::Result {
5559                            formatter.write_str("a field name for Image")
5560                        }
5561                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5562                        where
5563                            E: serde::de::Error,
5564                        {
5565                            use std::result::Result::Ok;
5566                            use std::string::ToString;
5567                            match value {
5568                                "uri" => Ok(__FieldTag::__uri),
5569                                "resolution" => Ok(__FieldTag::__resolution),
5570                                "alpha" => Ok(__FieldTag::__alpha),
5571                                _ => Ok(__FieldTag::Unknown(value.to_string())),
5572                            }
5573                        }
5574                    }
5575                    deserializer.deserialize_identifier(Visitor)
5576                }
5577            }
5578            struct Visitor;
5579            impl<'de> serde::de::Visitor<'de> for Visitor {
5580                type Value = Image;
5581                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5582                    formatter.write_str("struct Image")
5583                }
5584                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5585                where
5586                    A: serde::de::MapAccess<'de>,
5587                {
5588                    #[allow(unused_imports)]
5589                    use serde::de::Error;
5590                    use std::option::Option::Some;
5591                    let mut fields = std::collections::HashSet::new();
5592                    let mut result = Self::Value::new();
5593                    while let Some(tag) = map.next_key::<__FieldTag>()? {
5594                        #[allow(clippy::match_single_binding)]
5595                        match tag {
5596                            __FieldTag::__uri => {
5597                                if !fields.insert(__FieldTag::__uri) {
5598                                    return std::result::Result::Err(A::Error::duplicate_field(
5599                                        "multiple values for uri",
5600                                    ));
5601                                }
5602                                result.uri = map
5603                                    .next_value::<std::option::Option<std::string::String>>()?
5604                                    .unwrap_or_default();
5605                            }
5606                            __FieldTag::__resolution => {
5607                                if !fields.insert(__FieldTag::__resolution) {
5608                                    return std::result::Result::Err(A::Error::duplicate_field(
5609                                        "multiple values for resolution",
5610                                    ));
5611                                }
5612                                result.resolution = map.next_value::<std::option::Option<
5613                                    crate::model::overlay::NormalizedCoordinate,
5614                                >>()?;
5615                            }
5616                            __FieldTag::__alpha => {
5617                                if !fields.insert(__FieldTag::__alpha) {
5618                                    return std::result::Result::Err(A::Error::duplicate_field(
5619                                        "multiple values for alpha",
5620                                    ));
5621                                }
5622                                struct __With(std::option::Option<f64>);
5623                                impl<'de> serde::de::Deserialize<'de> for __With {
5624                                    fn deserialize<D>(
5625                                        deserializer: D,
5626                                    ) -> std::result::Result<Self, D::Error>
5627                                    where
5628                                        D: serde::de::Deserializer<'de>,
5629                                    {
5630                                        serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
5631                                    }
5632                                }
5633                                result.alpha = map.next_value::<__With>()?.0.unwrap_or_default();
5634                            }
5635                            __FieldTag::Unknown(key) => {
5636                                let value = map.next_value::<serde_json::Value>()?;
5637                                result._unknown_fields.insert(key, value);
5638                            }
5639                        }
5640                    }
5641                    std::result::Result::Ok(result)
5642                }
5643            }
5644            deserializer.deserialize_any(Visitor)
5645        }
5646    }
5647
5648    #[doc(hidden)]
5649    impl serde::ser::Serialize for Image {
5650        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5651        where
5652            S: serde::ser::Serializer,
5653        {
5654            use serde::ser::SerializeMap;
5655            #[allow(unused_imports)]
5656            use std::option::Option::Some;
5657            let mut state = serializer.serialize_map(std::option::Option::None)?;
5658            if !self.uri.is_empty() {
5659                state.serialize_entry("uri", &self.uri)?;
5660            }
5661            if self.resolution.is_some() {
5662                state.serialize_entry("resolution", &self.resolution)?;
5663            }
5664            if !wkt::internal::is_default(&self.alpha) {
5665                struct __With<'a>(&'a f64);
5666                impl<'a> serde::ser::Serialize for __With<'a> {
5667                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5668                    where
5669                        S: serde::ser::Serializer,
5670                    {
5671                        serde_with::As::<wkt::internal::F64>::serialize(self.0, serializer)
5672                    }
5673                }
5674                state.serialize_entry("alpha", &__With(&self.alpha))?;
5675            }
5676            if !self._unknown_fields.is_empty() {
5677                for (key, value) in self._unknown_fields.iter() {
5678                    state.serialize_entry(key, &value)?;
5679                }
5680            }
5681            state.end()
5682        }
5683    }
5684
5685    impl std::fmt::Debug for Image {
5686        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5687            let mut debug_struct = f.debug_struct("Image");
5688            debug_struct.field("uri", &self.uri);
5689            debug_struct.field("resolution", &self.resolution);
5690            debug_struct.field("alpha", &self.alpha);
5691            if !self._unknown_fields.is_empty() {
5692                debug_struct.field("_unknown_fields", &self._unknown_fields);
5693            }
5694            debug_struct.finish()
5695        }
5696    }
5697
5698    /// Display static overlay object.
5699    #[derive(Clone, Default, PartialEq)]
5700    #[non_exhaustive]
5701    pub struct AnimationStatic {
5702        /// Normalized coordinates based on output video resolution. Valid
5703        /// values: `0.0`–`1.0`. `xy` is the upper-left coordinate of the overlay
5704        /// object. For example, use the x and y coordinates {0,0} to position the
5705        /// top-left corner of the overlay animation in the top-left corner of the
5706        /// output video.
5707        pub xy: std::option::Option<crate::model::overlay::NormalizedCoordinate>,
5708
5709        /// The time to start displaying the overlay object, in seconds. Default: 0
5710        pub start_time_offset: std::option::Option<wkt::Duration>,
5711
5712        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5713    }
5714
5715    impl AnimationStatic {
5716        pub fn new() -> Self {
5717            std::default::Default::default()
5718        }
5719
5720        /// Sets the value of [xy][crate::model::overlay::AnimationStatic::xy].
5721        pub fn set_xy<T>(mut self, v: T) -> Self
5722        where
5723            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
5724        {
5725            self.xy = std::option::Option::Some(v.into());
5726            self
5727        }
5728
5729        /// Sets or clears the value of [xy][crate::model::overlay::AnimationStatic::xy].
5730        pub fn set_or_clear_xy<T>(mut self, v: std::option::Option<T>) -> Self
5731        where
5732            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
5733        {
5734            self.xy = v.map(|x| x.into());
5735            self
5736        }
5737
5738        /// Sets the value of [start_time_offset][crate::model::overlay::AnimationStatic::start_time_offset].
5739        pub fn set_start_time_offset<T>(mut self, v: T) -> Self
5740        where
5741            T: std::convert::Into<wkt::Duration>,
5742        {
5743            self.start_time_offset = std::option::Option::Some(v.into());
5744            self
5745        }
5746
5747        /// Sets or clears the value of [start_time_offset][crate::model::overlay::AnimationStatic::start_time_offset].
5748        pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
5749        where
5750            T: std::convert::Into<wkt::Duration>,
5751        {
5752            self.start_time_offset = v.map(|x| x.into());
5753            self
5754        }
5755    }
5756
5757    impl wkt::message::Message for AnimationStatic {
5758        fn typename() -> &'static str {
5759            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.AnimationStatic"
5760        }
5761    }
5762
5763    #[doc(hidden)]
5764    impl<'de> serde::de::Deserialize<'de> for AnimationStatic {
5765        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5766        where
5767            D: serde::Deserializer<'de>,
5768        {
5769            #[allow(non_camel_case_types)]
5770            #[doc(hidden)]
5771            #[derive(PartialEq, Eq, Hash)]
5772            enum __FieldTag {
5773                __xy,
5774                __start_time_offset,
5775                Unknown(std::string::String),
5776            }
5777            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5778                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5779                where
5780                    D: serde::Deserializer<'de>,
5781                {
5782                    struct Visitor;
5783                    impl<'de> serde::de::Visitor<'de> for Visitor {
5784                        type Value = __FieldTag;
5785                        fn expecting(
5786                            &self,
5787                            formatter: &mut std::fmt::Formatter,
5788                        ) -> std::fmt::Result {
5789                            formatter.write_str("a field name for AnimationStatic")
5790                        }
5791                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5792                        where
5793                            E: serde::de::Error,
5794                        {
5795                            use std::result::Result::Ok;
5796                            use std::string::ToString;
5797                            match value {
5798                                "xy" => Ok(__FieldTag::__xy),
5799                                "startTimeOffset" => Ok(__FieldTag::__start_time_offset),
5800                                "start_time_offset" => Ok(__FieldTag::__start_time_offset),
5801                                _ => Ok(__FieldTag::Unknown(value.to_string())),
5802                            }
5803                        }
5804                    }
5805                    deserializer.deserialize_identifier(Visitor)
5806                }
5807            }
5808            struct Visitor;
5809            impl<'de> serde::de::Visitor<'de> for Visitor {
5810                type Value = AnimationStatic;
5811                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5812                    formatter.write_str("struct AnimationStatic")
5813                }
5814                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5815                where
5816                    A: serde::de::MapAccess<'de>,
5817                {
5818                    #[allow(unused_imports)]
5819                    use serde::de::Error;
5820                    use std::option::Option::Some;
5821                    let mut fields = std::collections::HashSet::new();
5822                    let mut result = Self::Value::new();
5823                    while let Some(tag) = map.next_key::<__FieldTag>()? {
5824                        #[allow(clippy::match_single_binding)]
5825                        match tag {
5826                            __FieldTag::__xy => {
5827                                if !fields.insert(__FieldTag::__xy) {
5828                                    return std::result::Result::Err(A::Error::duplicate_field(
5829                                        "multiple values for xy",
5830                                    ));
5831                                }
5832                                result.xy = map.next_value::<std::option::Option<
5833                                    crate::model::overlay::NormalizedCoordinate,
5834                                >>()?;
5835                            }
5836                            __FieldTag::__start_time_offset => {
5837                                if !fields.insert(__FieldTag::__start_time_offset) {
5838                                    return std::result::Result::Err(A::Error::duplicate_field(
5839                                        "multiple values for start_time_offset",
5840                                    ));
5841                                }
5842                                result.start_time_offset =
5843                                    map.next_value::<std::option::Option<wkt::Duration>>()?;
5844                            }
5845                            __FieldTag::Unknown(key) => {
5846                                let value = map.next_value::<serde_json::Value>()?;
5847                                result._unknown_fields.insert(key, value);
5848                            }
5849                        }
5850                    }
5851                    std::result::Result::Ok(result)
5852                }
5853            }
5854            deserializer.deserialize_any(Visitor)
5855        }
5856    }
5857
5858    #[doc(hidden)]
5859    impl serde::ser::Serialize for AnimationStatic {
5860        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5861        where
5862            S: serde::ser::Serializer,
5863        {
5864            use serde::ser::SerializeMap;
5865            #[allow(unused_imports)]
5866            use std::option::Option::Some;
5867            let mut state = serializer.serialize_map(std::option::Option::None)?;
5868            if self.xy.is_some() {
5869                state.serialize_entry("xy", &self.xy)?;
5870            }
5871            if self.start_time_offset.is_some() {
5872                state.serialize_entry("startTimeOffset", &self.start_time_offset)?;
5873            }
5874            if !self._unknown_fields.is_empty() {
5875                for (key, value) in self._unknown_fields.iter() {
5876                    state.serialize_entry(key, &value)?;
5877                }
5878            }
5879            state.end()
5880        }
5881    }
5882
5883    impl std::fmt::Debug for AnimationStatic {
5884        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5885            let mut debug_struct = f.debug_struct("AnimationStatic");
5886            debug_struct.field("xy", &self.xy);
5887            debug_struct.field("start_time_offset", &self.start_time_offset);
5888            if !self._unknown_fields.is_empty() {
5889                debug_struct.field("_unknown_fields", &self._unknown_fields);
5890            }
5891            debug_struct.finish()
5892        }
5893    }
5894
5895    /// Display overlay object with fade animation.
5896    #[derive(Clone, Default, PartialEq)]
5897    #[non_exhaustive]
5898    pub struct AnimationFade {
5899        /// Required. Type of fade animation: `FADE_IN` or `FADE_OUT`.
5900        pub fade_type: crate::model::overlay::FadeType,
5901
5902        /// Normalized coordinates based on output video resolution. Valid
5903        /// values: `0.0`–`1.0`. `xy` is the upper-left coordinate of the overlay
5904        /// object. For example, use the x and y coordinates {0,0} to position the
5905        /// top-left corner of the overlay animation in the top-left corner of the
5906        /// output video.
5907        pub xy: std::option::Option<crate::model::overlay::NormalizedCoordinate>,
5908
5909        /// The time to start the fade animation, in seconds. Default: 0
5910        pub start_time_offset: std::option::Option<wkt::Duration>,
5911
5912        /// The time to end the fade animation, in seconds. Default:
5913        /// `start_time_offset` + 1s
5914        pub end_time_offset: std::option::Option<wkt::Duration>,
5915
5916        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5917    }
5918
5919    impl AnimationFade {
5920        pub fn new() -> Self {
5921            std::default::Default::default()
5922        }
5923
5924        /// Sets the value of [fade_type][crate::model::overlay::AnimationFade::fade_type].
5925        pub fn set_fade_type<T: std::convert::Into<crate::model::overlay::FadeType>>(
5926            mut self,
5927            v: T,
5928        ) -> Self {
5929            self.fade_type = v.into();
5930            self
5931        }
5932
5933        /// Sets the value of [xy][crate::model::overlay::AnimationFade::xy].
5934        pub fn set_xy<T>(mut self, v: T) -> Self
5935        where
5936            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
5937        {
5938            self.xy = std::option::Option::Some(v.into());
5939            self
5940        }
5941
5942        /// Sets or clears the value of [xy][crate::model::overlay::AnimationFade::xy].
5943        pub fn set_or_clear_xy<T>(mut self, v: std::option::Option<T>) -> Self
5944        where
5945            T: std::convert::Into<crate::model::overlay::NormalizedCoordinate>,
5946        {
5947            self.xy = v.map(|x| x.into());
5948            self
5949        }
5950
5951        /// Sets the value of [start_time_offset][crate::model::overlay::AnimationFade::start_time_offset].
5952        pub fn set_start_time_offset<T>(mut self, v: T) -> Self
5953        where
5954            T: std::convert::Into<wkt::Duration>,
5955        {
5956            self.start_time_offset = std::option::Option::Some(v.into());
5957            self
5958        }
5959
5960        /// Sets or clears the value of [start_time_offset][crate::model::overlay::AnimationFade::start_time_offset].
5961        pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
5962        where
5963            T: std::convert::Into<wkt::Duration>,
5964        {
5965            self.start_time_offset = v.map(|x| x.into());
5966            self
5967        }
5968
5969        /// Sets the value of [end_time_offset][crate::model::overlay::AnimationFade::end_time_offset].
5970        pub fn set_end_time_offset<T>(mut self, v: T) -> Self
5971        where
5972            T: std::convert::Into<wkt::Duration>,
5973        {
5974            self.end_time_offset = std::option::Option::Some(v.into());
5975            self
5976        }
5977
5978        /// Sets or clears the value of [end_time_offset][crate::model::overlay::AnimationFade::end_time_offset].
5979        pub fn set_or_clear_end_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
5980        where
5981            T: std::convert::Into<wkt::Duration>,
5982        {
5983            self.end_time_offset = v.map(|x| x.into());
5984            self
5985        }
5986    }
5987
5988    impl wkt::message::Message for AnimationFade {
5989        fn typename() -> &'static str {
5990            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.AnimationFade"
5991        }
5992    }
5993
5994    #[doc(hidden)]
5995    impl<'de> serde::de::Deserialize<'de> for AnimationFade {
5996        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5997        where
5998            D: serde::Deserializer<'de>,
5999        {
6000            #[allow(non_camel_case_types)]
6001            #[doc(hidden)]
6002            #[derive(PartialEq, Eq, Hash)]
6003            enum __FieldTag {
6004                __fade_type,
6005                __xy,
6006                __start_time_offset,
6007                __end_time_offset,
6008                Unknown(std::string::String),
6009            }
6010            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6011                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6012                where
6013                    D: serde::Deserializer<'de>,
6014                {
6015                    struct Visitor;
6016                    impl<'de> serde::de::Visitor<'de> for Visitor {
6017                        type Value = __FieldTag;
6018                        fn expecting(
6019                            &self,
6020                            formatter: &mut std::fmt::Formatter,
6021                        ) -> std::fmt::Result {
6022                            formatter.write_str("a field name for AnimationFade")
6023                        }
6024                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6025                        where
6026                            E: serde::de::Error,
6027                        {
6028                            use std::result::Result::Ok;
6029                            use std::string::ToString;
6030                            match value {
6031                                "fadeType" => Ok(__FieldTag::__fade_type),
6032                                "fade_type" => Ok(__FieldTag::__fade_type),
6033                                "xy" => Ok(__FieldTag::__xy),
6034                                "startTimeOffset" => Ok(__FieldTag::__start_time_offset),
6035                                "start_time_offset" => Ok(__FieldTag::__start_time_offset),
6036                                "endTimeOffset" => Ok(__FieldTag::__end_time_offset),
6037                                "end_time_offset" => Ok(__FieldTag::__end_time_offset),
6038                                _ => Ok(__FieldTag::Unknown(value.to_string())),
6039                            }
6040                        }
6041                    }
6042                    deserializer.deserialize_identifier(Visitor)
6043                }
6044            }
6045            struct Visitor;
6046            impl<'de> serde::de::Visitor<'de> for Visitor {
6047                type Value = AnimationFade;
6048                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6049                    formatter.write_str("struct AnimationFade")
6050                }
6051                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6052                where
6053                    A: serde::de::MapAccess<'de>,
6054                {
6055                    #[allow(unused_imports)]
6056                    use serde::de::Error;
6057                    use std::option::Option::Some;
6058                    let mut fields = std::collections::HashSet::new();
6059                    let mut result = Self::Value::new();
6060                    while let Some(tag) = map.next_key::<__FieldTag>()? {
6061                        #[allow(clippy::match_single_binding)]
6062                        match tag {
6063                            __FieldTag::__fade_type => {
6064                                if !fields.insert(__FieldTag::__fade_type) {
6065                                    return std::result::Result::Err(A::Error::duplicate_field(
6066                                        "multiple values for fade_type",
6067                                    ));
6068                                }
6069                                result.fade_type = map.next_value::<std::option::Option<crate::model::overlay::FadeType>>()?.unwrap_or_default();
6070                            }
6071                            __FieldTag::__xy => {
6072                                if !fields.insert(__FieldTag::__xy) {
6073                                    return std::result::Result::Err(A::Error::duplicate_field(
6074                                        "multiple values for xy",
6075                                    ));
6076                                }
6077                                result.xy = map.next_value::<std::option::Option<
6078                                    crate::model::overlay::NormalizedCoordinate,
6079                                >>()?;
6080                            }
6081                            __FieldTag::__start_time_offset => {
6082                                if !fields.insert(__FieldTag::__start_time_offset) {
6083                                    return std::result::Result::Err(A::Error::duplicate_field(
6084                                        "multiple values for start_time_offset",
6085                                    ));
6086                                }
6087                                result.start_time_offset =
6088                                    map.next_value::<std::option::Option<wkt::Duration>>()?;
6089                            }
6090                            __FieldTag::__end_time_offset => {
6091                                if !fields.insert(__FieldTag::__end_time_offset) {
6092                                    return std::result::Result::Err(A::Error::duplicate_field(
6093                                        "multiple values for end_time_offset",
6094                                    ));
6095                                }
6096                                result.end_time_offset =
6097                                    map.next_value::<std::option::Option<wkt::Duration>>()?;
6098                            }
6099                            __FieldTag::Unknown(key) => {
6100                                let value = map.next_value::<serde_json::Value>()?;
6101                                result._unknown_fields.insert(key, value);
6102                            }
6103                        }
6104                    }
6105                    std::result::Result::Ok(result)
6106                }
6107            }
6108            deserializer.deserialize_any(Visitor)
6109        }
6110    }
6111
6112    #[doc(hidden)]
6113    impl serde::ser::Serialize for AnimationFade {
6114        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6115        where
6116            S: serde::ser::Serializer,
6117        {
6118            use serde::ser::SerializeMap;
6119            #[allow(unused_imports)]
6120            use std::option::Option::Some;
6121            let mut state = serializer.serialize_map(std::option::Option::None)?;
6122            if !wkt::internal::is_default(&self.fade_type) {
6123                state.serialize_entry("fadeType", &self.fade_type)?;
6124            }
6125            if self.xy.is_some() {
6126                state.serialize_entry("xy", &self.xy)?;
6127            }
6128            if self.start_time_offset.is_some() {
6129                state.serialize_entry("startTimeOffset", &self.start_time_offset)?;
6130            }
6131            if self.end_time_offset.is_some() {
6132                state.serialize_entry("endTimeOffset", &self.end_time_offset)?;
6133            }
6134            if !self._unknown_fields.is_empty() {
6135                for (key, value) in self._unknown_fields.iter() {
6136                    state.serialize_entry(key, &value)?;
6137                }
6138            }
6139            state.end()
6140        }
6141    }
6142
6143    impl std::fmt::Debug for AnimationFade {
6144        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6145            let mut debug_struct = f.debug_struct("AnimationFade");
6146            debug_struct.field("fade_type", &self.fade_type);
6147            debug_struct.field("xy", &self.xy);
6148            debug_struct.field("start_time_offset", &self.start_time_offset);
6149            debug_struct.field("end_time_offset", &self.end_time_offset);
6150            if !self._unknown_fields.is_empty() {
6151                debug_struct.field("_unknown_fields", &self._unknown_fields);
6152            }
6153            debug_struct.finish()
6154        }
6155    }
6156
6157    /// End previous overlay animation from the video. Without `AnimationEnd`, the
6158    /// overlay object will keep the state of previous animation until the end of
6159    /// the video.
6160    #[derive(Clone, Default, PartialEq)]
6161    #[non_exhaustive]
6162    pub struct AnimationEnd {
6163        /// The time to end overlay object, in seconds. Default: 0
6164        pub start_time_offset: std::option::Option<wkt::Duration>,
6165
6166        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6167    }
6168
6169    impl AnimationEnd {
6170        pub fn new() -> Self {
6171            std::default::Default::default()
6172        }
6173
6174        /// Sets the value of [start_time_offset][crate::model::overlay::AnimationEnd::start_time_offset].
6175        pub fn set_start_time_offset<T>(mut self, v: T) -> Self
6176        where
6177            T: std::convert::Into<wkt::Duration>,
6178        {
6179            self.start_time_offset = std::option::Option::Some(v.into());
6180            self
6181        }
6182
6183        /// Sets or clears the value of [start_time_offset][crate::model::overlay::AnimationEnd::start_time_offset].
6184        pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
6185        where
6186            T: std::convert::Into<wkt::Duration>,
6187        {
6188            self.start_time_offset = v.map(|x| x.into());
6189            self
6190        }
6191    }
6192
6193    impl wkt::message::Message for AnimationEnd {
6194        fn typename() -> &'static str {
6195            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.AnimationEnd"
6196        }
6197    }
6198
6199    #[doc(hidden)]
6200    impl<'de> serde::de::Deserialize<'de> for AnimationEnd {
6201        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6202        where
6203            D: serde::Deserializer<'de>,
6204        {
6205            #[allow(non_camel_case_types)]
6206            #[doc(hidden)]
6207            #[derive(PartialEq, Eq, Hash)]
6208            enum __FieldTag {
6209                __start_time_offset,
6210                Unknown(std::string::String),
6211            }
6212            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6213                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6214                where
6215                    D: serde::Deserializer<'de>,
6216                {
6217                    struct Visitor;
6218                    impl<'de> serde::de::Visitor<'de> for Visitor {
6219                        type Value = __FieldTag;
6220                        fn expecting(
6221                            &self,
6222                            formatter: &mut std::fmt::Formatter,
6223                        ) -> std::fmt::Result {
6224                            formatter.write_str("a field name for AnimationEnd")
6225                        }
6226                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6227                        where
6228                            E: serde::de::Error,
6229                        {
6230                            use std::result::Result::Ok;
6231                            use std::string::ToString;
6232                            match value {
6233                                "startTimeOffset" => Ok(__FieldTag::__start_time_offset),
6234                                "start_time_offset" => Ok(__FieldTag::__start_time_offset),
6235                                _ => Ok(__FieldTag::Unknown(value.to_string())),
6236                            }
6237                        }
6238                    }
6239                    deserializer.deserialize_identifier(Visitor)
6240                }
6241            }
6242            struct Visitor;
6243            impl<'de> serde::de::Visitor<'de> for Visitor {
6244                type Value = AnimationEnd;
6245                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6246                    formatter.write_str("struct AnimationEnd")
6247                }
6248                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6249                where
6250                    A: serde::de::MapAccess<'de>,
6251                {
6252                    #[allow(unused_imports)]
6253                    use serde::de::Error;
6254                    use std::option::Option::Some;
6255                    let mut fields = std::collections::HashSet::new();
6256                    let mut result = Self::Value::new();
6257                    while let Some(tag) = map.next_key::<__FieldTag>()? {
6258                        #[allow(clippy::match_single_binding)]
6259                        match tag {
6260                            __FieldTag::__start_time_offset => {
6261                                if !fields.insert(__FieldTag::__start_time_offset) {
6262                                    return std::result::Result::Err(A::Error::duplicate_field(
6263                                        "multiple values for start_time_offset",
6264                                    ));
6265                                }
6266                                result.start_time_offset =
6267                                    map.next_value::<std::option::Option<wkt::Duration>>()?;
6268                            }
6269                            __FieldTag::Unknown(key) => {
6270                                let value = map.next_value::<serde_json::Value>()?;
6271                                result._unknown_fields.insert(key, value);
6272                            }
6273                        }
6274                    }
6275                    std::result::Result::Ok(result)
6276                }
6277            }
6278            deserializer.deserialize_any(Visitor)
6279        }
6280    }
6281
6282    #[doc(hidden)]
6283    impl serde::ser::Serialize for AnimationEnd {
6284        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6285        where
6286            S: serde::ser::Serializer,
6287        {
6288            use serde::ser::SerializeMap;
6289            #[allow(unused_imports)]
6290            use std::option::Option::Some;
6291            let mut state = serializer.serialize_map(std::option::Option::None)?;
6292            if self.start_time_offset.is_some() {
6293                state.serialize_entry("startTimeOffset", &self.start_time_offset)?;
6294            }
6295            if !self._unknown_fields.is_empty() {
6296                for (key, value) in self._unknown_fields.iter() {
6297                    state.serialize_entry(key, &value)?;
6298                }
6299            }
6300            state.end()
6301        }
6302    }
6303
6304    impl std::fmt::Debug for AnimationEnd {
6305        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6306            let mut debug_struct = f.debug_struct("AnimationEnd");
6307            debug_struct.field("start_time_offset", &self.start_time_offset);
6308            if !self._unknown_fields.is_empty() {
6309                debug_struct.field("_unknown_fields", &self._unknown_fields);
6310            }
6311            debug_struct.finish()
6312        }
6313    }
6314
6315    /// Animation types.
6316    #[derive(Clone, Default, PartialEq)]
6317    #[non_exhaustive]
6318    pub struct Animation {
6319        /// Animations can be static or fade, or they can end the previous animation.
6320        pub animation_type: std::option::Option<crate::model::overlay::animation::AnimationType>,
6321
6322        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6323    }
6324
6325    impl Animation {
6326        pub fn new() -> Self {
6327            std::default::Default::default()
6328        }
6329
6330        /// Sets the value of [animation_type][crate::model::overlay::Animation::animation_type].
6331        ///
6332        /// Note that all the setters affecting `animation_type` are mutually
6333        /// exclusive.
6334        pub fn set_animation_type<
6335            T: std::convert::Into<
6336                    std::option::Option<crate::model::overlay::animation::AnimationType>,
6337                >,
6338        >(
6339            mut self,
6340            v: T,
6341        ) -> Self {
6342            self.animation_type = v.into();
6343            self
6344        }
6345
6346        /// The value of [animation_type][crate::model::overlay::Animation::animation_type]
6347        /// if it holds a `AnimationStatic`, `None` if the field is not set or
6348        /// holds a different branch.
6349        pub fn animation_static(
6350            &self,
6351        ) -> std::option::Option<&std::boxed::Box<crate::model::overlay::AnimationStatic>> {
6352            #[allow(unreachable_patterns)]
6353            self.animation_type.as_ref().and_then(|v| match v {
6354                crate::model::overlay::animation::AnimationType::AnimationStatic(v) => {
6355                    std::option::Option::Some(v)
6356                }
6357                _ => std::option::Option::None,
6358            })
6359        }
6360
6361        /// Sets the value of [animation_type][crate::model::overlay::Animation::animation_type]
6362        /// to hold a `AnimationStatic`.
6363        ///
6364        /// Note that all the setters affecting `animation_type` are
6365        /// mutually exclusive.
6366        pub fn set_animation_static<
6367            T: std::convert::Into<std::boxed::Box<crate::model::overlay::AnimationStatic>>,
6368        >(
6369            mut self,
6370            v: T,
6371        ) -> Self {
6372            self.animation_type = std::option::Option::Some(
6373                crate::model::overlay::animation::AnimationType::AnimationStatic(v.into()),
6374            );
6375            self
6376        }
6377
6378        /// The value of [animation_type][crate::model::overlay::Animation::animation_type]
6379        /// if it holds a `AnimationFade`, `None` if the field is not set or
6380        /// holds a different branch.
6381        pub fn animation_fade(
6382            &self,
6383        ) -> std::option::Option<&std::boxed::Box<crate::model::overlay::AnimationFade>> {
6384            #[allow(unreachable_patterns)]
6385            self.animation_type.as_ref().and_then(|v| match v {
6386                crate::model::overlay::animation::AnimationType::AnimationFade(v) => {
6387                    std::option::Option::Some(v)
6388                }
6389                _ => std::option::Option::None,
6390            })
6391        }
6392
6393        /// Sets the value of [animation_type][crate::model::overlay::Animation::animation_type]
6394        /// to hold a `AnimationFade`.
6395        ///
6396        /// Note that all the setters affecting `animation_type` are
6397        /// mutually exclusive.
6398        pub fn set_animation_fade<
6399            T: std::convert::Into<std::boxed::Box<crate::model::overlay::AnimationFade>>,
6400        >(
6401            mut self,
6402            v: T,
6403        ) -> Self {
6404            self.animation_type = std::option::Option::Some(
6405                crate::model::overlay::animation::AnimationType::AnimationFade(v.into()),
6406            );
6407            self
6408        }
6409
6410        /// The value of [animation_type][crate::model::overlay::Animation::animation_type]
6411        /// if it holds a `AnimationEnd`, `None` if the field is not set or
6412        /// holds a different branch.
6413        pub fn animation_end(
6414            &self,
6415        ) -> std::option::Option<&std::boxed::Box<crate::model::overlay::AnimationEnd>> {
6416            #[allow(unreachable_patterns)]
6417            self.animation_type.as_ref().and_then(|v| match v {
6418                crate::model::overlay::animation::AnimationType::AnimationEnd(v) => {
6419                    std::option::Option::Some(v)
6420                }
6421                _ => std::option::Option::None,
6422            })
6423        }
6424
6425        /// Sets the value of [animation_type][crate::model::overlay::Animation::animation_type]
6426        /// to hold a `AnimationEnd`.
6427        ///
6428        /// Note that all the setters affecting `animation_type` are
6429        /// mutually exclusive.
6430        pub fn set_animation_end<
6431            T: std::convert::Into<std::boxed::Box<crate::model::overlay::AnimationEnd>>,
6432        >(
6433            mut self,
6434            v: T,
6435        ) -> Self {
6436            self.animation_type = std::option::Option::Some(
6437                crate::model::overlay::animation::AnimationType::AnimationEnd(v.into()),
6438            );
6439            self
6440        }
6441    }
6442
6443    impl wkt::message::Message for Animation {
6444        fn typename() -> &'static str {
6445            "type.googleapis.com/google.cloud.video.transcoder.v1.Overlay.Animation"
6446        }
6447    }
6448
6449    #[doc(hidden)]
6450    impl<'de> serde::de::Deserialize<'de> for Animation {
6451        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6452        where
6453            D: serde::Deserializer<'de>,
6454        {
6455            #[allow(non_camel_case_types)]
6456            #[doc(hidden)]
6457            #[derive(PartialEq, Eq, Hash)]
6458            enum __FieldTag {
6459                __animation_static,
6460                __animation_fade,
6461                __animation_end,
6462                Unknown(std::string::String),
6463            }
6464            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6465                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6466                where
6467                    D: serde::Deserializer<'de>,
6468                {
6469                    struct Visitor;
6470                    impl<'de> serde::de::Visitor<'de> for Visitor {
6471                        type Value = __FieldTag;
6472                        fn expecting(
6473                            &self,
6474                            formatter: &mut std::fmt::Formatter,
6475                        ) -> std::fmt::Result {
6476                            formatter.write_str("a field name for Animation")
6477                        }
6478                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6479                        where
6480                            E: serde::de::Error,
6481                        {
6482                            use std::result::Result::Ok;
6483                            use std::string::ToString;
6484                            match value {
6485                                "animationStatic" => Ok(__FieldTag::__animation_static),
6486                                "animation_static" => Ok(__FieldTag::__animation_static),
6487                                "animationFade" => Ok(__FieldTag::__animation_fade),
6488                                "animation_fade" => Ok(__FieldTag::__animation_fade),
6489                                "animationEnd" => Ok(__FieldTag::__animation_end),
6490                                "animation_end" => Ok(__FieldTag::__animation_end),
6491                                _ => Ok(__FieldTag::Unknown(value.to_string())),
6492                            }
6493                        }
6494                    }
6495                    deserializer.deserialize_identifier(Visitor)
6496                }
6497            }
6498            struct Visitor;
6499            impl<'de> serde::de::Visitor<'de> for Visitor {
6500                type Value = Animation;
6501                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6502                    formatter.write_str("struct Animation")
6503                }
6504                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6505                where
6506                    A: serde::de::MapAccess<'de>,
6507                {
6508                    #[allow(unused_imports)]
6509                    use serde::de::Error;
6510                    use std::option::Option::Some;
6511                    let mut fields = std::collections::HashSet::new();
6512                    let mut result = Self::Value::new();
6513                    while let Some(tag) = map.next_key::<__FieldTag>()? {
6514                        #[allow(clippy::match_single_binding)]
6515                        match tag {
6516                            __FieldTag::__animation_static => {
6517                                if !fields.insert(__FieldTag::__animation_static) {
6518                                    return std::result::Result::Err(A::Error::duplicate_field(
6519                                        "multiple values for animation_static",
6520                                    ));
6521                                }
6522                                if result.animation_type.is_some() {
6523                                    return std::result::Result::Err(A::Error::duplicate_field(
6524                                        "multiple values for `animation_type`, a oneof with full ID .google.cloud.video.transcoder.v1.Overlay.Animation.animation_static, latest field was animationStatic",
6525                                    ));
6526                                }
6527                                result.animation_type = std::option::Option::Some(
6528                                    crate::model::overlay::animation::AnimationType::AnimationStatic(
6529                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::overlay::AnimationStatic>>>()?.unwrap_or_default()
6530                                    ),
6531                                );
6532                            }
6533                            __FieldTag::__animation_fade => {
6534                                if !fields.insert(__FieldTag::__animation_fade) {
6535                                    return std::result::Result::Err(A::Error::duplicate_field(
6536                                        "multiple values for animation_fade",
6537                                    ));
6538                                }
6539                                if result.animation_type.is_some() {
6540                                    return std::result::Result::Err(A::Error::duplicate_field(
6541                                        "multiple values for `animation_type`, a oneof with full ID .google.cloud.video.transcoder.v1.Overlay.Animation.animation_fade, latest field was animationFade",
6542                                    ));
6543                                }
6544                                result.animation_type = std::option::Option::Some(
6545                                    crate::model::overlay::animation::AnimationType::AnimationFade(
6546                                        map.next_value::<std::option::Option<
6547                                            std::boxed::Box<crate::model::overlay::AnimationFade>,
6548                                        >>()?
6549                                        .unwrap_or_default(),
6550                                    ),
6551                                );
6552                            }
6553                            __FieldTag::__animation_end => {
6554                                if !fields.insert(__FieldTag::__animation_end) {
6555                                    return std::result::Result::Err(A::Error::duplicate_field(
6556                                        "multiple values for animation_end",
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_end, latest field was animationEnd",
6562                                    ));
6563                                }
6564                                result.animation_type = std::option::Option::Some(
6565                                    crate::model::overlay::animation::AnimationType::AnimationEnd(
6566                                        map.next_value::<std::option::Option<
6567                                            std::boxed::Box<crate::model::overlay::AnimationEnd>,
6568                                        >>()?
6569                                        .unwrap_or_default(),
6570                                    ),
6571                                );
6572                            }
6573                            __FieldTag::Unknown(key) => {
6574                                let value = map.next_value::<serde_json::Value>()?;
6575                                result._unknown_fields.insert(key, value);
6576                            }
6577                        }
6578                    }
6579                    std::result::Result::Ok(result)
6580                }
6581            }
6582            deserializer.deserialize_any(Visitor)
6583        }
6584    }
6585
6586    #[doc(hidden)]
6587    impl serde::ser::Serialize for Animation {
6588        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6589        where
6590            S: serde::ser::Serializer,
6591        {
6592            use serde::ser::SerializeMap;
6593            #[allow(unused_imports)]
6594            use std::option::Option::Some;
6595            let mut state = serializer.serialize_map(std::option::Option::None)?;
6596            if let Some(value) = self.animation_static() {
6597                state.serialize_entry("animationStatic", value)?;
6598            }
6599            if let Some(value) = self.animation_fade() {
6600                state.serialize_entry("animationFade", value)?;
6601            }
6602            if let Some(value) = self.animation_end() {
6603                state.serialize_entry("animationEnd", value)?;
6604            }
6605            if !self._unknown_fields.is_empty() {
6606                for (key, value) in self._unknown_fields.iter() {
6607                    state.serialize_entry(key, &value)?;
6608                }
6609            }
6610            state.end()
6611        }
6612    }
6613
6614    impl std::fmt::Debug for Animation {
6615        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6616            let mut debug_struct = f.debug_struct("Animation");
6617            debug_struct.field("animation_type", &self.animation_type);
6618            if !self._unknown_fields.is_empty() {
6619                debug_struct.field("_unknown_fields", &self._unknown_fields);
6620            }
6621            debug_struct.finish()
6622        }
6623    }
6624
6625    /// Defines additional types related to [Animation].
6626    pub mod animation {
6627        #[allow(unused_imports)]
6628        use super::*;
6629
6630        /// Animations can be static or fade, or they can end the previous animation.
6631        #[derive(Clone, Debug, PartialEq)]
6632        #[non_exhaustive]
6633        pub enum AnimationType {
6634            /// Display static overlay object.
6635            AnimationStatic(std::boxed::Box<crate::model::overlay::AnimationStatic>),
6636            /// Display overlay object with fade animation.
6637            AnimationFade(std::boxed::Box<crate::model::overlay::AnimationFade>),
6638            /// End previous animation.
6639            AnimationEnd(std::boxed::Box<crate::model::overlay::AnimationEnd>),
6640        }
6641    }
6642
6643    /// Fade type for the overlay: `FADE_IN` or `FADE_OUT`.
6644    ///
6645    /// # Working with unknown values
6646    ///
6647    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6648    /// additional enum variants at any time. Adding new variants is not considered
6649    /// a breaking change. Applications should write their code in anticipation of:
6650    ///
6651    /// - New values appearing in future releases of the client library, **and**
6652    /// - New values received dynamically, without application changes.
6653    ///
6654    /// Please consult the [Working with enums] section in the user guide for some
6655    /// guidelines.
6656    ///
6657    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6658    #[derive(Clone, Debug, PartialEq)]
6659    #[non_exhaustive]
6660    pub enum FadeType {
6661        /// The fade type is not specified.
6662        Unspecified,
6663        /// Fade the overlay object into view.
6664        FadeIn,
6665        /// Fade the overlay object out of view.
6666        FadeOut,
6667        /// If set, the enum was initialized with an unknown value.
6668        ///
6669        /// Applications can examine the value using [FadeType::value] or
6670        /// [FadeType::name].
6671        UnknownValue(fade_type::UnknownValue),
6672    }
6673
6674    #[doc(hidden)]
6675    pub mod fade_type {
6676        #[allow(unused_imports)]
6677        use super::*;
6678        #[derive(Clone, Debug, PartialEq)]
6679        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6680    }
6681
6682    impl FadeType {
6683        /// Gets the enum value.
6684        ///
6685        /// Returns `None` if the enum contains an unknown value deserialized from
6686        /// the string representation of enums.
6687        pub fn value(&self) -> std::option::Option<i32> {
6688            match self {
6689                Self::Unspecified => std::option::Option::Some(0),
6690                Self::FadeIn => std::option::Option::Some(1),
6691                Self::FadeOut => std::option::Option::Some(2),
6692                Self::UnknownValue(u) => u.0.value(),
6693            }
6694        }
6695
6696        /// Gets the enum value as a string.
6697        ///
6698        /// Returns `None` if the enum contains an unknown value deserialized from
6699        /// the integer representation of enums.
6700        pub fn name(&self) -> std::option::Option<&str> {
6701            match self {
6702                Self::Unspecified => std::option::Option::Some("FADE_TYPE_UNSPECIFIED"),
6703                Self::FadeIn => std::option::Option::Some("FADE_IN"),
6704                Self::FadeOut => std::option::Option::Some("FADE_OUT"),
6705                Self::UnknownValue(u) => u.0.name(),
6706            }
6707        }
6708    }
6709
6710    impl std::default::Default for FadeType {
6711        fn default() -> Self {
6712            use std::convert::From;
6713            Self::from(0)
6714        }
6715    }
6716
6717    impl std::fmt::Display for FadeType {
6718        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6719            wkt::internal::display_enum(f, self.name(), self.value())
6720        }
6721    }
6722
6723    impl std::convert::From<i32> for FadeType {
6724        fn from(value: i32) -> Self {
6725            match value {
6726                0 => Self::Unspecified,
6727                1 => Self::FadeIn,
6728                2 => Self::FadeOut,
6729                _ => Self::UnknownValue(fade_type::UnknownValue(
6730                    wkt::internal::UnknownEnumValue::Integer(value),
6731                )),
6732            }
6733        }
6734    }
6735
6736    impl std::convert::From<&str> for FadeType {
6737        fn from(value: &str) -> Self {
6738            use std::string::ToString;
6739            match value {
6740                "FADE_TYPE_UNSPECIFIED" => Self::Unspecified,
6741                "FADE_IN" => Self::FadeIn,
6742                "FADE_OUT" => Self::FadeOut,
6743                _ => Self::UnknownValue(fade_type::UnknownValue(
6744                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6745                )),
6746            }
6747        }
6748    }
6749
6750    impl serde::ser::Serialize for FadeType {
6751        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6752        where
6753            S: serde::Serializer,
6754        {
6755            match self {
6756                Self::Unspecified => serializer.serialize_i32(0),
6757                Self::FadeIn => serializer.serialize_i32(1),
6758                Self::FadeOut => serializer.serialize_i32(2),
6759                Self::UnknownValue(u) => u.0.serialize(serializer),
6760            }
6761        }
6762    }
6763
6764    impl<'de> serde::de::Deserialize<'de> for FadeType {
6765        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6766        where
6767            D: serde::Deserializer<'de>,
6768        {
6769            deserializer.deserialize_any(wkt::internal::EnumVisitor::<FadeType>::new(
6770                ".google.cloud.video.transcoder.v1.Overlay.FadeType",
6771            ))
6772        }
6773    }
6774}
6775
6776/// Preprocessing configurations.
6777#[derive(Clone, Default, PartialEq)]
6778#[non_exhaustive]
6779pub struct PreprocessingConfig {
6780    /// Color preprocessing configuration.
6781    pub color: std::option::Option<crate::model::preprocessing_config::Color>,
6782
6783    /// Denoise preprocessing configuration.
6784    pub denoise: std::option::Option<crate::model::preprocessing_config::Denoise>,
6785
6786    /// Deblock preprocessing configuration.
6787    pub deblock: std::option::Option<crate::model::preprocessing_config::Deblock>,
6788
6789    /// Audio preprocessing configuration.
6790    pub audio: std::option::Option<crate::model::preprocessing_config::Audio>,
6791
6792    /// Specify the video cropping configuration.
6793    pub crop: std::option::Option<crate::model::preprocessing_config::Crop>,
6794
6795    /// Specify the video pad filter configuration.
6796    pub pad: std::option::Option<crate::model::preprocessing_config::Pad>,
6797
6798    /// Specify the video deinterlace configuration.
6799    pub deinterlace: std::option::Option<crate::model::preprocessing_config::Deinterlace>,
6800
6801    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6802}
6803
6804impl PreprocessingConfig {
6805    pub fn new() -> Self {
6806        std::default::Default::default()
6807    }
6808
6809    /// Sets the value of [color][crate::model::PreprocessingConfig::color].
6810    pub fn set_color<T>(mut self, v: T) -> Self
6811    where
6812        T: std::convert::Into<crate::model::preprocessing_config::Color>,
6813    {
6814        self.color = std::option::Option::Some(v.into());
6815        self
6816    }
6817
6818    /// Sets or clears the value of [color][crate::model::PreprocessingConfig::color].
6819    pub fn set_or_clear_color<T>(mut self, v: std::option::Option<T>) -> Self
6820    where
6821        T: std::convert::Into<crate::model::preprocessing_config::Color>,
6822    {
6823        self.color = v.map(|x| x.into());
6824        self
6825    }
6826
6827    /// Sets the value of [denoise][crate::model::PreprocessingConfig::denoise].
6828    pub fn set_denoise<T>(mut self, v: T) -> Self
6829    where
6830        T: std::convert::Into<crate::model::preprocessing_config::Denoise>,
6831    {
6832        self.denoise = std::option::Option::Some(v.into());
6833        self
6834    }
6835
6836    /// Sets or clears the value of [denoise][crate::model::PreprocessingConfig::denoise].
6837    pub fn set_or_clear_denoise<T>(mut self, v: std::option::Option<T>) -> Self
6838    where
6839        T: std::convert::Into<crate::model::preprocessing_config::Denoise>,
6840    {
6841        self.denoise = v.map(|x| x.into());
6842        self
6843    }
6844
6845    /// Sets the value of [deblock][crate::model::PreprocessingConfig::deblock].
6846    pub fn set_deblock<T>(mut self, v: T) -> Self
6847    where
6848        T: std::convert::Into<crate::model::preprocessing_config::Deblock>,
6849    {
6850        self.deblock = std::option::Option::Some(v.into());
6851        self
6852    }
6853
6854    /// Sets or clears the value of [deblock][crate::model::PreprocessingConfig::deblock].
6855    pub fn set_or_clear_deblock<T>(mut self, v: std::option::Option<T>) -> Self
6856    where
6857        T: std::convert::Into<crate::model::preprocessing_config::Deblock>,
6858    {
6859        self.deblock = v.map(|x| x.into());
6860        self
6861    }
6862
6863    /// Sets the value of [audio][crate::model::PreprocessingConfig::audio].
6864    pub fn set_audio<T>(mut self, v: T) -> Self
6865    where
6866        T: std::convert::Into<crate::model::preprocessing_config::Audio>,
6867    {
6868        self.audio = std::option::Option::Some(v.into());
6869        self
6870    }
6871
6872    /// Sets or clears the value of [audio][crate::model::PreprocessingConfig::audio].
6873    pub fn set_or_clear_audio<T>(mut self, v: std::option::Option<T>) -> Self
6874    where
6875        T: std::convert::Into<crate::model::preprocessing_config::Audio>,
6876    {
6877        self.audio = v.map(|x| x.into());
6878        self
6879    }
6880
6881    /// Sets the value of [crop][crate::model::PreprocessingConfig::crop].
6882    pub fn set_crop<T>(mut self, v: T) -> Self
6883    where
6884        T: std::convert::Into<crate::model::preprocessing_config::Crop>,
6885    {
6886        self.crop = std::option::Option::Some(v.into());
6887        self
6888    }
6889
6890    /// Sets or clears the value of [crop][crate::model::PreprocessingConfig::crop].
6891    pub fn set_or_clear_crop<T>(mut self, v: std::option::Option<T>) -> Self
6892    where
6893        T: std::convert::Into<crate::model::preprocessing_config::Crop>,
6894    {
6895        self.crop = v.map(|x| x.into());
6896        self
6897    }
6898
6899    /// Sets the value of [pad][crate::model::PreprocessingConfig::pad].
6900    pub fn set_pad<T>(mut self, v: T) -> Self
6901    where
6902        T: std::convert::Into<crate::model::preprocessing_config::Pad>,
6903    {
6904        self.pad = std::option::Option::Some(v.into());
6905        self
6906    }
6907
6908    /// Sets or clears the value of [pad][crate::model::PreprocessingConfig::pad].
6909    pub fn set_or_clear_pad<T>(mut self, v: std::option::Option<T>) -> Self
6910    where
6911        T: std::convert::Into<crate::model::preprocessing_config::Pad>,
6912    {
6913        self.pad = v.map(|x| x.into());
6914        self
6915    }
6916
6917    /// Sets the value of [deinterlace][crate::model::PreprocessingConfig::deinterlace].
6918    pub fn set_deinterlace<T>(mut self, v: T) -> Self
6919    where
6920        T: std::convert::Into<crate::model::preprocessing_config::Deinterlace>,
6921    {
6922        self.deinterlace = std::option::Option::Some(v.into());
6923        self
6924    }
6925
6926    /// Sets or clears the value of [deinterlace][crate::model::PreprocessingConfig::deinterlace].
6927    pub fn set_or_clear_deinterlace<T>(mut self, v: std::option::Option<T>) -> Self
6928    where
6929        T: std::convert::Into<crate::model::preprocessing_config::Deinterlace>,
6930    {
6931        self.deinterlace = v.map(|x| x.into());
6932        self
6933    }
6934}
6935
6936impl wkt::message::Message for PreprocessingConfig {
6937    fn typename() -> &'static str {
6938        "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig"
6939    }
6940}
6941
6942#[doc(hidden)]
6943impl<'de> serde::de::Deserialize<'de> for PreprocessingConfig {
6944    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6945    where
6946        D: serde::Deserializer<'de>,
6947    {
6948        #[allow(non_camel_case_types)]
6949        #[doc(hidden)]
6950        #[derive(PartialEq, Eq, Hash)]
6951        enum __FieldTag {
6952            __color,
6953            __denoise,
6954            __deblock,
6955            __audio,
6956            __crop,
6957            __pad,
6958            __deinterlace,
6959            Unknown(std::string::String),
6960        }
6961        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6962            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6963            where
6964                D: serde::Deserializer<'de>,
6965            {
6966                struct Visitor;
6967                impl<'de> serde::de::Visitor<'de> for Visitor {
6968                    type Value = __FieldTag;
6969                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6970                        formatter.write_str("a field name for PreprocessingConfig")
6971                    }
6972                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6973                    where
6974                        E: serde::de::Error,
6975                    {
6976                        use std::result::Result::Ok;
6977                        use std::string::ToString;
6978                        match value {
6979                            "color" => Ok(__FieldTag::__color),
6980                            "denoise" => Ok(__FieldTag::__denoise),
6981                            "deblock" => Ok(__FieldTag::__deblock),
6982                            "audio" => Ok(__FieldTag::__audio),
6983                            "crop" => Ok(__FieldTag::__crop),
6984                            "pad" => Ok(__FieldTag::__pad),
6985                            "deinterlace" => Ok(__FieldTag::__deinterlace),
6986                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6987                        }
6988                    }
6989                }
6990                deserializer.deserialize_identifier(Visitor)
6991            }
6992        }
6993        struct Visitor;
6994        impl<'de> serde::de::Visitor<'de> for Visitor {
6995            type Value = PreprocessingConfig;
6996            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6997                formatter.write_str("struct PreprocessingConfig")
6998            }
6999            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7000            where
7001                A: serde::de::MapAccess<'de>,
7002            {
7003                #[allow(unused_imports)]
7004                use serde::de::Error;
7005                use std::option::Option::Some;
7006                let mut fields = std::collections::HashSet::new();
7007                let mut result = Self::Value::new();
7008                while let Some(tag) = map.next_key::<__FieldTag>()? {
7009                    #[allow(clippy::match_single_binding)]
7010                    match tag {
7011                        __FieldTag::__color => {
7012                            if !fields.insert(__FieldTag::__color) {
7013                                return std::result::Result::Err(A::Error::duplicate_field(
7014                                    "multiple values for color",
7015                                ));
7016                            }
7017                            result.color = map.next_value::<std::option::Option<crate::model::preprocessing_config::Color>>()?
7018                                ;
7019                        }
7020                        __FieldTag::__denoise => {
7021                            if !fields.insert(__FieldTag::__denoise) {
7022                                return std::result::Result::Err(A::Error::duplicate_field(
7023                                    "multiple values for denoise",
7024                                ));
7025                            }
7026                            result.denoise =
7027                                map.next_value::<std::option::Option<
7028                                    crate::model::preprocessing_config::Denoise,
7029                                >>()?;
7030                        }
7031                        __FieldTag::__deblock => {
7032                            if !fields.insert(__FieldTag::__deblock) {
7033                                return std::result::Result::Err(A::Error::duplicate_field(
7034                                    "multiple values for deblock",
7035                                ));
7036                            }
7037                            result.deblock =
7038                                map.next_value::<std::option::Option<
7039                                    crate::model::preprocessing_config::Deblock,
7040                                >>()?;
7041                        }
7042                        __FieldTag::__audio => {
7043                            if !fields.insert(__FieldTag::__audio) {
7044                                return std::result::Result::Err(A::Error::duplicate_field(
7045                                    "multiple values for audio",
7046                                ));
7047                            }
7048                            result.audio = map.next_value::<std::option::Option<crate::model::preprocessing_config::Audio>>()?
7049                                ;
7050                        }
7051                        __FieldTag::__crop => {
7052                            if !fields.insert(__FieldTag::__crop) {
7053                                return std::result::Result::Err(A::Error::duplicate_field(
7054                                    "multiple values for crop",
7055                                ));
7056                            }
7057                            result.crop = map.next_value::<std::option::Option<crate::model::preprocessing_config::Crop>>()?
7058                                ;
7059                        }
7060                        __FieldTag::__pad => {
7061                            if !fields.insert(__FieldTag::__pad) {
7062                                return std::result::Result::Err(A::Error::duplicate_field(
7063                                    "multiple values for pad",
7064                                ));
7065                            }
7066                            result.pad = map.next_value::<std::option::Option<crate::model::preprocessing_config::Pad>>()?
7067                                ;
7068                        }
7069                        __FieldTag::__deinterlace => {
7070                            if !fields.insert(__FieldTag::__deinterlace) {
7071                                return std::result::Result::Err(A::Error::duplicate_field(
7072                                    "multiple values for deinterlace",
7073                                ));
7074                            }
7075                            result.deinterlace = map.next_value::<std::option::Option<
7076                                crate::model::preprocessing_config::Deinterlace,
7077                            >>()?;
7078                        }
7079                        __FieldTag::Unknown(key) => {
7080                            let value = map.next_value::<serde_json::Value>()?;
7081                            result._unknown_fields.insert(key, value);
7082                        }
7083                    }
7084                }
7085                std::result::Result::Ok(result)
7086            }
7087        }
7088        deserializer.deserialize_any(Visitor)
7089    }
7090}
7091
7092#[doc(hidden)]
7093impl serde::ser::Serialize for PreprocessingConfig {
7094    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7095    where
7096        S: serde::ser::Serializer,
7097    {
7098        use serde::ser::SerializeMap;
7099        #[allow(unused_imports)]
7100        use std::option::Option::Some;
7101        let mut state = serializer.serialize_map(std::option::Option::None)?;
7102        if self.color.is_some() {
7103            state.serialize_entry("color", &self.color)?;
7104        }
7105        if self.denoise.is_some() {
7106            state.serialize_entry("denoise", &self.denoise)?;
7107        }
7108        if self.deblock.is_some() {
7109            state.serialize_entry("deblock", &self.deblock)?;
7110        }
7111        if self.audio.is_some() {
7112            state.serialize_entry("audio", &self.audio)?;
7113        }
7114        if self.crop.is_some() {
7115            state.serialize_entry("crop", &self.crop)?;
7116        }
7117        if self.pad.is_some() {
7118            state.serialize_entry("pad", &self.pad)?;
7119        }
7120        if self.deinterlace.is_some() {
7121            state.serialize_entry("deinterlace", &self.deinterlace)?;
7122        }
7123        if !self._unknown_fields.is_empty() {
7124            for (key, value) in self._unknown_fields.iter() {
7125                state.serialize_entry(key, &value)?;
7126            }
7127        }
7128        state.end()
7129    }
7130}
7131
7132impl std::fmt::Debug for PreprocessingConfig {
7133    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7134        let mut debug_struct = f.debug_struct("PreprocessingConfig");
7135        debug_struct.field("color", &self.color);
7136        debug_struct.field("denoise", &self.denoise);
7137        debug_struct.field("deblock", &self.deblock);
7138        debug_struct.field("audio", &self.audio);
7139        debug_struct.field("crop", &self.crop);
7140        debug_struct.field("pad", &self.pad);
7141        debug_struct.field("deinterlace", &self.deinterlace);
7142        if !self._unknown_fields.is_empty() {
7143            debug_struct.field("_unknown_fields", &self._unknown_fields);
7144        }
7145        debug_struct.finish()
7146    }
7147}
7148
7149/// Defines additional types related to [PreprocessingConfig].
7150pub mod preprocessing_config {
7151    #[allow(unused_imports)]
7152    use super::*;
7153
7154    /// Color preprocessing configuration.
7155    ///
7156    /// **Note:** This configuration is not supported.
7157    #[derive(Clone, Default, PartialEq)]
7158    #[non_exhaustive]
7159    pub struct Color {
7160        /// Control color saturation of the video. Enter a value between -1 and 1,
7161        /// where -1 is fully desaturated and 1 is maximum saturation. 0 is no
7162        /// change. The default is 0.
7163        pub saturation: f64,
7164
7165        /// Control black and white contrast of the video. Enter a value between -1
7166        /// and 1, where -1 is minimum contrast and 1 is maximum contrast. 0 is no
7167        /// change. The default is 0.
7168        pub contrast: f64,
7169
7170        /// Control brightness of the video. Enter a value between -1 and 1, where -1
7171        /// is minimum brightness and 1 is maximum brightness. 0 is no change. The
7172        /// default is 0.
7173        pub brightness: f64,
7174
7175        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7176    }
7177
7178    impl Color {
7179        pub fn new() -> Self {
7180            std::default::Default::default()
7181        }
7182
7183        /// Sets the value of [saturation][crate::model::preprocessing_config::Color::saturation].
7184        pub fn set_saturation<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
7185            self.saturation = v.into();
7186            self
7187        }
7188
7189        /// Sets the value of [contrast][crate::model::preprocessing_config::Color::contrast].
7190        pub fn set_contrast<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
7191            self.contrast = v.into();
7192            self
7193        }
7194
7195        /// Sets the value of [brightness][crate::model::preprocessing_config::Color::brightness].
7196        pub fn set_brightness<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
7197            self.brightness = v.into();
7198            self
7199        }
7200    }
7201
7202    impl wkt::message::Message for Color {
7203        fn typename() -> &'static str {
7204            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Color"
7205        }
7206    }
7207
7208    #[doc(hidden)]
7209    impl<'de> serde::de::Deserialize<'de> for Color {
7210        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7211        where
7212            D: serde::Deserializer<'de>,
7213        {
7214            #[allow(non_camel_case_types)]
7215            #[doc(hidden)]
7216            #[derive(PartialEq, Eq, Hash)]
7217            enum __FieldTag {
7218                __saturation,
7219                __contrast,
7220                __brightness,
7221                Unknown(std::string::String),
7222            }
7223            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7224                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7225                where
7226                    D: serde::Deserializer<'de>,
7227                {
7228                    struct Visitor;
7229                    impl<'de> serde::de::Visitor<'de> for Visitor {
7230                        type Value = __FieldTag;
7231                        fn expecting(
7232                            &self,
7233                            formatter: &mut std::fmt::Formatter,
7234                        ) -> std::fmt::Result {
7235                            formatter.write_str("a field name for Color")
7236                        }
7237                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7238                        where
7239                            E: serde::de::Error,
7240                        {
7241                            use std::result::Result::Ok;
7242                            use std::string::ToString;
7243                            match value {
7244                                "saturation" => Ok(__FieldTag::__saturation),
7245                                "contrast" => Ok(__FieldTag::__contrast),
7246                                "brightness" => Ok(__FieldTag::__brightness),
7247                                _ => Ok(__FieldTag::Unknown(value.to_string())),
7248                            }
7249                        }
7250                    }
7251                    deserializer.deserialize_identifier(Visitor)
7252                }
7253            }
7254            struct Visitor;
7255            impl<'de> serde::de::Visitor<'de> for Visitor {
7256                type Value = Color;
7257                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7258                    formatter.write_str("struct Color")
7259                }
7260                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7261                where
7262                    A: serde::de::MapAccess<'de>,
7263                {
7264                    #[allow(unused_imports)]
7265                    use serde::de::Error;
7266                    use std::option::Option::Some;
7267                    let mut fields = std::collections::HashSet::new();
7268                    let mut result = Self::Value::new();
7269                    while let Some(tag) = map.next_key::<__FieldTag>()? {
7270                        #[allow(clippy::match_single_binding)]
7271                        match tag {
7272                            __FieldTag::__saturation => {
7273                                if !fields.insert(__FieldTag::__saturation) {
7274                                    return std::result::Result::Err(A::Error::duplicate_field(
7275                                        "multiple values for saturation",
7276                                    ));
7277                                }
7278                                struct __With(std::option::Option<f64>);
7279                                impl<'de> serde::de::Deserialize<'de> for __With {
7280                                    fn deserialize<D>(
7281                                        deserializer: D,
7282                                    ) -> std::result::Result<Self, D::Error>
7283                                    where
7284                                        D: serde::de::Deserializer<'de>,
7285                                    {
7286                                        serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
7287                                    }
7288                                }
7289                                result.saturation =
7290                                    map.next_value::<__With>()?.0.unwrap_or_default();
7291                            }
7292                            __FieldTag::__contrast => {
7293                                if !fields.insert(__FieldTag::__contrast) {
7294                                    return std::result::Result::Err(A::Error::duplicate_field(
7295                                        "multiple values for contrast",
7296                                    ));
7297                                }
7298                                struct __With(std::option::Option<f64>);
7299                                impl<'de> serde::de::Deserialize<'de> for __With {
7300                                    fn deserialize<D>(
7301                                        deserializer: D,
7302                                    ) -> std::result::Result<Self, D::Error>
7303                                    where
7304                                        D: serde::de::Deserializer<'de>,
7305                                    {
7306                                        serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
7307                                    }
7308                                }
7309                                result.contrast = map.next_value::<__With>()?.0.unwrap_or_default();
7310                            }
7311                            __FieldTag::__brightness => {
7312                                if !fields.insert(__FieldTag::__brightness) {
7313                                    return std::result::Result::Err(A::Error::duplicate_field(
7314                                        "multiple values for brightness",
7315                                    ));
7316                                }
7317                                struct __With(std::option::Option<f64>);
7318                                impl<'de> serde::de::Deserialize<'de> for __With {
7319                                    fn deserialize<D>(
7320                                        deserializer: D,
7321                                    ) -> std::result::Result<Self, D::Error>
7322                                    where
7323                                        D: serde::de::Deserializer<'de>,
7324                                    {
7325                                        serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
7326                                    }
7327                                }
7328                                result.brightness =
7329                                    map.next_value::<__With>()?.0.unwrap_or_default();
7330                            }
7331                            __FieldTag::Unknown(key) => {
7332                                let value = map.next_value::<serde_json::Value>()?;
7333                                result._unknown_fields.insert(key, value);
7334                            }
7335                        }
7336                    }
7337                    std::result::Result::Ok(result)
7338                }
7339            }
7340            deserializer.deserialize_any(Visitor)
7341        }
7342    }
7343
7344    #[doc(hidden)]
7345    impl serde::ser::Serialize for Color {
7346        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7347        where
7348            S: serde::ser::Serializer,
7349        {
7350            use serde::ser::SerializeMap;
7351            #[allow(unused_imports)]
7352            use std::option::Option::Some;
7353            let mut state = serializer.serialize_map(std::option::Option::None)?;
7354            if !wkt::internal::is_default(&self.saturation) {
7355                struct __With<'a>(&'a f64);
7356                impl<'a> serde::ser::Serialize for __With<'a> {
7357                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7358                    where
7359                        S: serde::ser::Serializer,
7360                    {
7361                        serde_with::As::<wkt::internal::F64>::serialize(self.0, serializer)
7362                    }
7363                }
7364                state.serialize_entry("saturation", &__With(&self.saturation))?;
7365            }
7366            if !wkt::internal::is_default(&self.contrast) {
7367                struct __With<'a>(&'a f64);
7368                impl<'a> serde::ser::Serialize for __With<'a> {
7369                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7370                    where
7371                        S: serde::ser::Serializer,
7372                    {
7373                        serde_with::As::<wkt::internal::F64>::serialize(self.0, serializer)
7374                    }
7375                }
7376                state.serialize_entry("contrast", &__With(&self.contrast))?;
7377            }
7378            if !wkt::internal::is_default(&self.brightness) {
7379                struct __With<'a>(&'a f64);
7380                impl<'a> serde::ser::Serialize for __With<'a> {
7381                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7382                    where
7383                        S: serde::ser::Serializer,
7384                    {
7385                        serde_with::As::<wkt::internal::F64>::serialize(self.0, serializer)
7386                    }
7387                }
7388                state.serialize_entry("brightness", &__With(&self.brightness))?;
7389            }
7390            if !self._unknown_fields.is_empty() {
7391                for (key, value) in self._unknown_fields.iter() {
7392                    state.serialize_entry(key, &value)?;
7393                }
7394            }
7395            state.end()
7396        }
7397    }
7398
7399    impl std::fmt::Debug for Color {
7400        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7401            let mut debug_struct = f.debug_struct("Color");
7402            debug_struct.field("saturation", &self.saturation);
7403            debug_struct.field("contrast", &self.contrast);
7404            debug_struct.field("brightness", &self.brightness);
7405            if !self._unknown_fields.is_empty() {
7406                debug_struct.field("_unknown_fields", &self._unknown_fields);
7407            }
7408            debug_struct.finish()
7409        }
7410    }
7411
7412    /// Denoise preprocessing configuration.
7413    ///
7414    /// **Note:** This configuration is not supported.
7415    #[derive(Clone, Default, PartialEq)]
7416    #[non_exhaustive]
7417    pub struct Denoise {
7418        /// Set strength of the denoise. Enter a value between 0 and 1. The higher
7419        /// the value, the smoother the image. 0 is no denoising. The default is 0.
7420        pub strength: f64,
7421
7422        /// Set the denoiser mode. The default is `standard`.
7423        ///
7424        /// Supported denoiser modes:
7425        ///
7426        /// - `standard`
7427        /// - `grain`
7428        pub tune: std::string::String,
7429
7430        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7431    }
7432
7433    impl Denoise {
7434        pub fn new() -> Self {
7435            std::default::Default::default()
7436        }
7437
7438        /// Sets the value of [strength][crate::model::preprocessing_config::Denoise::strength].
7439        pub fn set_strength<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
7440            self.strength = v.into();
7441            self
7442        }
7443
7444        /// Sets the value of [tune][crate::model::preprocessing_config::Denoise::tune].
7445        pub fn set_tune<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7446            self.tune = v.into();
7447            self
7448        }
7449    }
7450
7451    impl wkt::message::Message for Denoise {
7452        fn typename() -> &'static str {
7453            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Denoise"
7454        }
7455    }
7456
7457    #[doc(hidden)]
7458    impl<'de> serde::de::Deserialize<'de> for Denoise {
7459        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7460        where
7461            D: serde::Deserializer<'de>,
7462        {
7463            #[allow(non_camel_case_types)]
7464            #[doc(hidden)]
7465            #[derive(PartialEq, Eq, Hash)]
7466            enum __FieldTag {
7467                __strength,
7468                __tune,
7469                Unknown(std::string::String),
7470            }
7471            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7472                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7473                where
7474                    D: serde::Deserializer<'de>,
7475                {
7476                    struct Visitor;
7477                    impl<'de> serde::de::Visitor<'de> for Visitor {
7478                        type Value = __FieldTag;
7479                        fn expecting(
7480                            &self,
7481                            formatter: &mut std::fmt::Formatter,
7482                        ) -> std::fmt::Result {
7483                            formatter.write_str("a field name for Denoise")
7484                        }
7485                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7486                        where
7487                            E: serde::de::Error,
7488                        {
7489                            use std::result::Result::Ok;
7490                            use std::string::ToString;
7491                            match value {
7492                                "strength" => Ok(__FieldTag::__strength),
7493                                "tune" => Ok(__FieldTag::__tune),
7494                                _ => Ok(__FieldTag::Unknown(value.to_string())),
7495                            }
7496                        }
7497                    }
7498                    deserializer.deserialize_identifier(Visitor)
7499                }
7500            }
7501            struct Visitor;
7502            impl<'de> serde::de::Visitor<'de> for Visitor {
7503                type Value = Denoise;
7504                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7505                    formatter.write_str("struct Denoise")
7506                }
7507                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7508                where
7509                    A: serde::de::MapAccess<'de>,
7510                {
7511                    #[allow(unused_imports)]
7512                    use serde::de::Error;
7513                    use std::option::Option::Some;
7514                    let mut fields = std::collections::HashSet::new();
7515                    let mut result = Self::Value::new();
7516                    while let Some(tag) = map.next_key::<__FieldTag>()? {
7517                        #[allow(clippy::match_single_binding)]
7518                        match tag {
7519                            __FieldTag::__strength => {
7520                                if !fields.insert(__FieldTag::__strength) {
7521                                    return std::result::Result::Err(A::Error::duplicate_field(
7522                                        "multiple values for strength",
7523                                    ));
7524                                }
7525                                struct __With(std::option::Option<f64>);
7526                                impl<'de> serde::de::Deserialize<'de> for __With {
7527                                    fn deserialize<D>(
7528                                        deserializer: D,
7529                                    ) -> std::result::Result<Self, D::Error>
7530                                    where
7531                                        D: serde::de::Deserializer<'de>,
7532                                    {
7533                                        serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
7534                                    }
7535                                }
7536                                result.strength = map.next_value::<__With>()?.0.unwrap_or_default();
7537                            }
7538                            __FieldTag::__tune => {
7539                                if !fields.insert(__FieldTag::__tune) {
7540                                    return std::result::Result::Err(A::Error::duplicate_field(
7541                                        "multiple values for tune",
7542                                    ));
7543                                }
7544                                result.tune = map
7545                                    .next_value::<std::option::Option<std::string::String>>()?
7546                                    .unwrap_or_default();
7547                            }
7548                            __FieldTag::Unknown(key) => {
7549                                let value = map.next_value::<serde_json::Value>()?;
7550                                result._unknown_fields.insert(key, value);
7551                            }
7552                        }
7553                    }
7554                    std::result::Result::Ok(result)
7555                }
7556            }
7557            deserializer.deserialize_any(Visitor)
7558        }
7559    }
7560
7561    #[doc(hidden)]
7562    impl serde::ser::Serialize for Denoise {
7563        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7564        where
7565            S: serde::ser::Serializer,
7566        {
7567            use serde::ser::SerializeMap;
7568            #[allow(unused_imports)]
7569            use std::option::Option::Some;
7570            let mut state = serializer.serialize_map(std::option::Option::None)?;
7571            if !wkt::internal::is_default(&self.strength) {
7572                struct __With<'a>(&'a f64);
7573                impl<'a> serde::ser::Serialize for __With<'a> {
7574                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7575                    where
7576                        S: serde::ser::Serializer,
7577                    {
7578                        serde_with::As::<wkt::internal::F64>::serialize(self.0, serializer)
7579                    }
7580                }
7581                state.serialize_entry("strength", &__With(&self.strength))?;
7582            }
7583            if !self.tune.is_empty() {
7584                state.serialize_entry("tune", &self.tune)?;
7585            }
7586            if !self._unknown_fields.is_empty() {
7587                for (key, value) in self._unknown_fields.iter() {
7588                    state.serialize_entry(key, &value)?;
7589                }
7590            }
7591            state.end()
7592        }
7593    }
7594
7595    impl std::fmt::Debug for Denoise {
7596        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7597            let mut debug_struct = f.debug_struct("Denoise");
7598            debug_struct.field("strength", &self.strength);
7599            debug_struct.field("tune", &self.tune);
7600            if !self._unknown_fields.is_empty() {
7601                debug_struct.field("_unknown_fields", &self._unknown_fields);
7602            }
7603            debug_struct.finish()
7604        }
7605    }
7606
7607    /// Deblock preprocessing configuration.
7608    ///
7609    /// **Note:** This configuration is not supported.
7610    #[derive(Clone, Default, PartialEq)]
7611    #[non_exhaustive]
7612    pub struct Deblock {
7613        /// Set strength of the deblocker. Enter a value between 0 and 1. The higher
7614        /// the value, the stronger the block removal. 0 is no deblocking. The
7615        /// default is 0.
7616        pub strength: f64,
7617
7618        /// Enable deblocker. The default is `false`.
7619        pub enabled: bool,
7620
7621        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7622    }
7623
7624    impl Deblock {
7625        pub fn new() -> Self {
7626            std::default::Default::default()
7627        }
7628
7629        /// Sets the value of [strength][crate::model::preprocessing_config::Deblock::strength].
7630        pub fn set_strength<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
7631            self.strength = v.into();
7632            self
7633        }
7634
7635        /// Sets the value of [enabled][crate::model::preprocessing_config::Deblock::enabled].
7636        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7637            self.enabled = v.into();
7638            self
7639        }
7640    }
7641
7642    impl wkt::message::Message for Deblock {
7643        fn typename() -> &'static str {
7644            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Deblock"
7645        }
7646    }
7647
7648    #[doc(hidden)]
7649    impl<'de> serde::de::Deserialize<'de> for Deblock {
7650        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7651        where
7652            D: serde::Deserializer<'de>,
7653        {
7654            #[allow(non_camel_case_types)]
7655            #[doc(hidden)]
7656            #[derive(PartialEq, Eq, Hash)]
7657            enum __FieldTag {
7658                __strength,
7659                __enabled,
7660                Unknown(std::string::String),
7661            }
7662            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7663                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7664                where
7665                    D: serde::Deserializer<'de>,
7666                {
7667                    struct Visitor;
7668                    impl<'de> serde::de::Visitor<'de> for Visitor {
7669                        type Value = __FieldTag;
7670                        fn expecting(
7671                            &self,
7672                            formatter: &mut std::fmt::Formatter,
7673                        ) -> std::fmt::Result {
7674                            formatter.write_str("a field name for Deblock")
7675                        }
7676                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7677                        where
7678                            E: serde::de::Error,
7679                        {
7680                            use std::result::Result::Ok;
7681                            use std::string::ToString;
7682                            match value {
7683                                "strength" => Ok(__FieldTag::__strength),
7684                                "enabled" => Ok(__FieldTag::__enabled),
7685                                _ => Ok(__FieldTag::Unknown(value.to_string())),
7686                            }
7687                        }
7688                    }
7689                    deserializer.deserialize_identifier(Visitor)
7690                }
7691            }
7692            struct Visitor;
7693            impl<'de> serde::de::Visitor<'de> for Visitor {
7694                type Value = Deblock;
7695                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7696                    formatter.write_str("struct Deblock")
7697                }
7698                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7699                where
7700                    A: serde::de::MapAccess<'de>,
7701                {
7702                    #[allow(unused_imports)]
7703                    use serde::de::Error;
7704                    use std::option::Option::Some;
7705                    let mut fields = std::collections::HashSet::new();
7706                    let mut result = Self::Value::new();
7707                    while let Some(tag) = map.next_key::<__FieldTag>()? {
7708                        #[allow(clippy::match_single_binding)]
7709                        match tag {
7710                            __FieldTag::__strength => {
7711                                if !fields.insert(__FieldTag::__strength) {
7712                                    return std::result::Result::Err(A::Error::duplicate_field(
7713                                        "multiple values for strength",
7714                                    ));
7715                                }
7716                                struct __With(std::option::Option<f64>);
7717                                impl<'de> serde::de::Deserialize<'de> for __With {
7718                                    fn deserialize<D>(
7719                                        deserializer: D,
7720                                    ) -> std::result::Result<Self, D::Error>
7721                                    where
7722                                        D: serde::de::Deserializer<'de>,
7723                                    {
7724                                        serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
7725                                    }
7726                                }
7727                                result.strength = map.next_value::<__With>()?.0.unwrap_or_default();
7728                            }
7729                            __FieldTag::__enabled => {
7730                                if !fields.insert(__FieldTag::__enabled) {
7731                                    return std::result::Result::Err(A::Error::duplicate_field(
7732                                        "multiple values for enabled",
7733                                    ));
7734                                }
7735                                result.enabled = map
7736                                    .next_value::<std::option::Option<bool>>()?
7737                                    .unwrap_or_default();
7738                            }
7739                            __FieldTag::Unknown(key) => {
7740                                let value = map.next_value::<serde_json::Value>()?;
7741                                result._unknown_fields.insert(key, value);
7742                            }
7743                        }
7744                    }
7745                    std::result::Result::Ok(result)
7746                }
7747            }
7748            deserializer.deserialize_any(Visitor)
7749        }
7750    }
7751
7752    #[doc(hidden)]
7753    impl serde::ser::Serialize for Deblock {
7754        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7755        where
7756            S: serde::ser::Serializer,
7757        {
7758            use serde::ser::SerializeMap;
7759            #[allow(unused_imports)]
7760            use std::option::Option::Some;
7761            let mut state = serializer.serialize_map(std::option::Option::None)?;
7762            if !wkt::internal::is_default(&self.strength) {
7763                struct __With<'a>(&'a f64);
7764                impl<'a> serde::ser::Serialize for __With<'a> {
7765                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7766                    where
7767                        S: serde::ser::Serializer,
7768                    {
7769                        serde_with::As::<wkt::internal::F64>::serialize(self.0, serializer)
7770                    }
7771                }
7772                state.serialize_entry("strength", &__With(&self.strength))?;
7773            }
7774            if !wkt::internal::is_default(&self.enabled) {
7775                state.serialize_entry("enabled", &self.enabled)?;
7776            }
7777            if !self._unknown_fields.is_empty() {
7778                for (key, value) in self._unknown_fields.iter() {
7779                    state.serialize_entry(key, &value)?;
7780                }
7781            }
7782            state.end()
7783        }
7784    }
7785
7786    impl std::fmt::Debug for Deblock {
7787        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7788            let mut debug_struct = f.debug_struct("Deblock");
7789            debug_struct.field("strength", &self.strength);
7790            debug_struct.field("enabled", &self.enabled);
7791            if !self._unknown_fields.is_empty() {
7792                debug_struct.field("_unknown_fields", &self._unknown_fields);
7793            }
7794            debug_struct.finish()
7795        }
7796    }
7797
7798    /// Audio preprocessing configuration.
7799    #[derive(Clone, Default, PartialEq)]
7800    #[non_exhaustive]
7801    pub struct Audio {
7802        /// Specify audio loudness normalization in loudness units relative to full
7803        /// scale (LUFS). Enter a value between -24 and 0 (the default), where:
7804        ///
7805        /// * -24 is the Advanced Television Systems Committee (ATSC A/85) standard
7806        /// * -23 is the EU R128 broadcast standard
7807        /// * -19 is the prior standard for online mono audio
7808        /// * -18 is the ReplayGain standard
7809        /// * -16 is the prior standard for stereo audio
7810        /// * -14 is the new online audio standard recommended by Spotify, as well
7811        ///   as Amazon Echo
7812        /// * 0 disables normalization
7813        pub lufs: f64,
7814
7815        /// Enable boosting high frequency components. The default is `false`.
7816        ///
7817        /// **Note:** This field is not supported.
7818        pub high_boost: bool,
7819
7820        /// Enable boosting low frequency components. The default is `false`.
7821        ///
7822        /// **Note:** This field is not supported.
7823        pub low_boost: bool,
7824
7825        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7826    }
7827
7828    impl Audio {
7829        pub fn new() -> Self {
7830            std::default::Default::default()
7831        }
7832
7833        /// Sets the value of [lufs][crate::model::preprocessing_config::Audio::lufs].
7834        pub fn set_lufs<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
7835            self.lufs = v.into();
7836            self
7837        }
7838
7839        /// Sets the value of [high_boost][crate::model::preprocessing_config::Audio::high_boost].
7840        pub fn set_high_boost<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7841            self.high_boost = v.into();
7842            self
7843        }
7844
7845        /// Sets the value of [low_boost][crate::model::preprocessing_config::Audio::low_boost].
7846        pub fn set_low_boost<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7847            self.low_boost = v.into();
7848            self
7849        }
7850    }
7851
7852    impl wkt::message::Message for Audio {
7853        fn typename() -> &'static str {
7854            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Audio"
7855        }
7856    }
7857
7858    #[doc(hidden)]
7859    impl<'de> serde::de::Deserialize<'de> for Audio {
7860        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7861        where
7862            D: serde::Deserializer<'de>,
7863        {
7864            #[allow(non_camel_case_types)]
7865            #[doc(hidden)]
7866            #[derive(PartialEq, Eq, Hash)]
7867            enum __FieldTag {
7868                __lufs,
7869                __high_boost,
7870                __low_boost,
7871                Unknown(std::string::String),
7872            }
7873            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7874                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7875                where
7876                    D: serde::Deserializer<'de>,
7877                {
7878                    struct Visitor;
7879                    impl<'de> serde::de::Visitor<'de> for Visitor {
7880                        type Value = __FieldTag;
7881                        fn expecting(
7882                            &self,
7883                            formatter: &mut std::fmt::Formatter,
7884                        ) -> std::fmt::Result {
7885                            formatter.write_str("a field name for Audio")
7886                        }
7887                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7888                        where
7889                            E: serde::de::Error,
7890                        {
7891                            use std::result::Result::Ok;
7892                            use std::string::ToString;
7893                            match value {
7894                                "lufs" => Ok(__FieldTag::__lufs),
7895                                "highBoost" => Ok(__FieldTag::__high_boost),
7896                                "high_boost" => Ok(__FieldTag::__high_boost),
7897                                "lowBoost" => Ok(__FieldTag::__low_boost),
7898                                "low_boost" => Ok(__FieldTag::__low_boost),
7899                                _ => Ok(__FieldTag::Unknown(value.to_string())),
7900                            }
7901                        }
7902                    }
7903                    deserializer.deserialize_identifier(Visitor)
7904                }
7905            }
7906            struct Visitor;
7907            impl<'de> serde::de::Visitor<'de> for Visitor {
7908                type Value = Audio;
7909                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7910                    formatter.write_str("struct Audio")
7911                }
7912                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7913                where
7914                    A: serde::de::MapAccess<'de>,
7915                {
7916                    #[allow(unused_imports)]
7917                    use serde::de::Error;
7918                    use std::option::Option::Some;
7919                    let mut fields = std::collections::HashSet::new();
7920                    let mut result = Self::Value::new();
7921                    while let Some(tag) = map.next_key::<__FieldTag>()? {
7922                        #[allow(clippy::match_single_binding)]
7923                        match tag {
7924                            __FieldTag::__lufs => {
7925                                if !fields.insert(__FieldTag::__lufs) {
7926                                    return std::result::Result::Err(A::Error::duplicate_field(
7927                                        "multiple values for lufs",
7928                                    ));
7929                                }
7930                                struct __With(std::option::Option<f64>);
7931                                impl<'de> serde::de::Deserialize<'de> for __With {
7932                                    fn deserialize<D>(
7933                                        deserializer: D,
7934                                    ) -> std::result::Result<Self, D::Error>
7935                                    where
7936                                        D: serde::de::Deserializer<'de>,
7937                                    {
7938                                        serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
7939                                    }
7940                                }
7941                                result.lufs = map.next_value::<__With>()?.0.unwrap_or_default();
7942                            }
7943                            __FieldTag::__high_boost => {
7944                                if !fields.insert(__FieldTag::__high_boost) {
7945                                    return std::result::Result::Err(A::Error::duplicate_field(
7946                                        "multiple values for high_boost",
7947                                    ));
7948                                }
7949                                result.high_boost = map
7950                                    .next_value::<std::option::Option<bool>>()?
7951                                    .unwrap_or_default();
7952                            }
7953                            __FieldTag::__low_boost => {
7954                                if !fields.insert(__FieldTag::__low_boost) {
7955                                    return std::result::Result::Err(A::Error::duplicate_field(
7956                                        "multiple values for low_boost",
7957                                    ));
7958                                }
7959                                result.low_boost = map
7960                                    .next_value::<std::option::Option<bool>>()?
7961                                    .unwrap_or_default();
7962                            }
7963                            __FieldTag::Unknown(key) => {
7964                                let value = map.next_value::<serde_json::Value>()?;
7965                                result._unknown_fields.insert(key, value);
7966                            }
7967                        }
7968                    }
7969                    std::result::Result::Ok(result)
7970                }
7971            }
7972            deserializer.deserialize_any(Visitor)
7973        }
7974    }
7975
7976    #[doc(hidden)]
7977    impl serde::ser::Serialize for Audio {
7978        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7979        where
7980            S: serde::ser::Serializer,
7981        {
7982            use serde::ser::SerializeMap;
7983            #[allow(unused_imports)]
7984            use std::option::Option::Some;
7985            let mut state = serializer.serialize_map(std::option::Option::None)?;
7986            if !wkt::internal::is_default(&self.lufs) {
7987                struct __With<'a>(&'a f64);
7988                impl<'a> serde::ser::Serialize for __With<'a> {
7989                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7990                    where
7991                        S: serde::ser::Serializer,
7992                    {
7993                        serde_with::As::<wkt::internal::F64>::serialize(self.0, serializer)
7994                    }
7995                }
7996                state.serialize_entry("lufs", &__With(&self.lufs))?;
7997            }
7998            if !wkt::internal::is_default(&self.high_boost) {
7999                state.serialize_entry("highBoost", &self.high_boost)?;
8000            }
8001            if !wkt::internal::is_default(&self.low_boost) {
8002                state.serialize_entry("lowBoost", &self.low_boost)?;
8003            }
8004            if !self._unknown_fields.is_empty() {
8005                for (key, value) in self._unknown_fields.iter() {
8006                    state.serialize_entry(key, &value)?;
8007                }
8008            }
8009            state.end()
8010        }
8011    }
8012
8013    impl std::fmt::Debug for Audio {
8014        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8015            let mut debug_struct = f.debug_struct("Audio");
8016            debug_struct.field("lufs", &self.lufs);
8017            debug_struct.field("high_boost", &self.high_boost);
8018            debug_struct.field("low_boost", &self.low_boost);
8019            if !self._unknown_fields.is_empty() {
8020                debug_struct.field("_unknown_fields", &self._unknown_fields);
8021            }
8022            debug_struct.finish()
8023        }
8024    }
8025
8026    /// Video cropping configuration for the input video. The cropped input video
8027    /// is scaled to match the output resolution.
8028    #[derive(Clone, Default, PartialEq)]
8029    #[non_exhaustive]
8030    pub struct Crop {
8031        /// The number of pixels to crop from the top. The default is 0.
8032        pub top_pixels: i32,
8033
8034        /// The number of pixels to crop from the bottom. The default is 0.
8035        pub bottom_pixels: i32,
8036
8037        /// The number of pixels to crop from the left. The default is 0.
8038        pub left_pixels: i32,
8039
8040        /// The number of pixels to crop from the right. The default is 0.
8041        pub right_pixels: i32,
8042
8043        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8044    }
8045
8046    impl Crop {
8047        pub fn new() -> Self {
8048            std::default::Default::default()
8049        }
8050
8051        /// Sets the value of [top_pixels][crate::model::preprocessing_config::Crop::top_pixels].
8052        pub fn set_top_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8053            self.top_pixels = v.into();
8054            self
8055        }
8056
8057        /// Sets the value of [bottom_pixels][crate::model::preprocessing_config::Crop::bottom_pixels].
8058        pub fn set_bottom_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8059            self.bottom_pixels = v.into();
8060            self
8061        }
8062
8063        /// Sets the value of [left_pixels][crate::model::preprocessing_config::Crop::left_pixels].
8064        pub fn set_left_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8065            self.left_pixels = v.into();
8066            self
8067        }
8068
8069        /// Sets the value of [right_pixels][crate::model::preprocessing_config::Crop::right_pixels].
8070        pub fn set_right_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8071            self.right_pixels = v.into();
8072            self
8073        }
8074    }
8075
8076    impl wkt::message::Message for Crop {
8077        fn typename() -> &'static str {
8078            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Crop"
8079        }
8080    }
8081
8082    #[doc(hidden)]
8083    impl<'de> serde::de::Deserialize<'de> for Crop {
8084        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8085        where
8086            D: serde::Deserializer<'de>,
8087        {
8088            #[allow(non_camel_case_types)]
8089            #[doc(hidden)]
8090            #[derive(PartialEq, Eq, Hash)]
8091            enum __FieldTag {
8092                __top_pixels,
8093                __bottom_pixels,
8094                __left_pixels,
8095                __right_pixels,
8096                Unknown(std::string::String),
8097            }
8098            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8099                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8100                where
8101                    D: serde::Deserializer<'de>,
8102                {
8103                    struct Visitor;
8104                    impl<'de> serde::de::Visitor<'de> for Visitor {
8105                        type Value = __FieldTag;
8106                        fn expecting(
8107                            &self,
8108                            formatter: &mut std::fmt::Formatter,
8109                        ) -> std::fmt::Result {
8110                            formatter.write_str("a field name for Crop")
8111                        }
8112                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8113                        where
8114                            E: serde::de::Error,
8115                        {
8116                            use std::result::Result::Ok;
8117                            use std::string::ToString;
8118                            match value {
8119                                "topPixels" => Ok(__FieldTag::__top_pixels),
8120                                "top_pixels" => Ok(__FieldTag::__top_pixels),
8121                                "bottomPixels" => Ok(__FieldTag::__bottom_pixels),
8122                                "bottom_pixels" => Ok(__FieldTag::__bottom_pixels),
8123                                "leftPixels" => Ok(__FieldTag::__left_pixels),
8124                                "left_pixels" => Ok(__FieldTag::__left_pixels),
8125                                "rightPixels" => Ok(__FieldTag::__right_pixels),
8126                                "right_pixels" => Ok(__FieldTag::__right_pixels),
8127                                _ => Ok(__FieldTag::Unknown(value.to_string())),
8128                            }
8129                        }
8130                    }
8131                    deserializer.deserialize_identifier(Visitor)
8132                }
8133            }
8134            struct Visitor;
8135            impl<'de> serde::de::Visitor<'de> for Visitor {
8136                type Value = Crop;
8137                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8138                    formatter.write_str("struct Crop")
8139                }
8140                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8141                where
8142                    A: serde::de::MapAccess<'de>,
8143                {
8144                    #[allow(unused_imports)]
8145                    use serde::de::Error;
8146                    use std::option::Option::Some;
8147                    let mut fields = std::collections::HashSet::new();
8148                    let mut result = Self::Value::new();
8149                    while let Some(tag) = map.next_key::<__FieldTag>()? {
8150                        #[allow(clippy::match_single_binding)]
8151                        match tag {
8152                            __FieldTag::__top_pixels => {
8153                                if !fields.insert(__FieldTag::__top_pixels) {
8154                                    return std::result::Result::Err(A::Error::duplicate_field(
8155                                        "multiple values for top_pixels",
8156                                    ));
8157                                }
8158                                struct __With(std::option::Option<i32>);
8159                                impl<'de> serde::de::Deserialize<'de> for __With {
8160                                    fn deserialize<D>(
8161                                        deserializer: D,
8162                                    ) -> std::result::Result<Self, D::Error>
8163                                    where
8164                                        D: serde::de::Deserializer<'de>,
8165                                    {
8166                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
8167                                    }
8168                                }
8169                                result.top_pixels =
8170                                    map.next_value::<__With>()?.0.unwrap_or_default();
8171                            }
8172                            __FieldTag::__bottom_pixels => {
8173                                if !fields.insert(__FieldTag::__bottom_pixels) {
8174                                    return std::result::Result::Err(A::Error::duplicate_field(
8175                                        "multiple values for bottom_pixels",
8176                                    ));
8177                                }
8178                                struct __With(std::option::Option<i32>);
8179                                impl<'de> serde::de::Deserialize<'de> for __With {
8180                                    fn deserialize<D>(
8181                                        deserializer: D,
8182                                    ) -> std::result::Result<Self, D::Error>
8183                                    where
8184                                        D: serde::de::Deserializer<'de>,
8185                                    {
8186                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
8187                                    }
8188                                }
8189                                result.bottom_pixels =
8190                                    map.next_value::<__With>()?.0.unwrap_or_default();
8191                            }
8192                            __FieldTag::__left_pixels => {
8193                                if !fields.insert(__FieldTag::__left_pixels) {
8194                                    return std::result::Result::Err(A::Error::duplicate_field(
8195                                        "multiple values for left_pixels",
8196                                    ));
8197                                }
8198                                struct __With(std::option::Option<i32>);
8199                                impl<'de> serde::de::Deserialize<'de> for __With {
8200                                    fn deserialize<D>(
8201                                        deserializer: D,
8202                                    ) -> std::result::Result<Self, D::Error>
8203                                    where
8204                                        D: serde::de::Deserializer<'de>,
8205                                    {
8206                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
8207                                    }
8208                                }
8209                                result.left_pixels =
8210                                    map.next_value::<__With>()?.0.unwrap_or_default();
8211                            }
8212                            __FieldTag::__right_pixels => {
8213                                if !fields.insert(__FieldTag::__right_pixels) {
8214                                    return std::result::Result::Err(A::Error::duplicate_field(
8215                                        "multiple values for right_pixels",
8216                                    ));
8217                                }
8218                                struct __With(std::option::Option<i32>);
8219                                impl<'de> serde::de::Deserialize<'de> for __With {
8220                                    fn deserialize<D>(
8221                                        deserializer: D,
8222                                    ) -> std::result::Result<Self, D::Error>
8223                                    where
8224                                        D: serde::de::Deserializer<'de>,
8225                                    {
8226                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
8227                                    }
8228                                }
8229                                result.right_pixels =
8230                                    map.next_value::<__With>()?.0.unwrap_or_default();
8231                            }
8232                            __FieldTag::Unknown(key) => {
8233                                let value = map.next_value::<serde_json::Value>()?;
8234                                result._unknown_fields.insert(key, value);
8235                            }
8236                        }
8237                    }
8238                    std::result::Result::Ok(result)
8239                }
8240            }
8241            deserializer.deserialize_any(Visitor)
8242        }
8243    }
8244
8245    #[doc(hidden)]
8246    impl serde::ser::Serialize for Crop {
8247        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8248        where
8249            S: serde::ser::Serializer,
8250        {
8251            use serde::ser::SerializeMap;
8252            #[allow(unused_imports)]
8253            use std::option::Option::Some;
8254            let mut state = serializer.serialize_map(std::option::Option::None)?;
8255            if !wkt::internal::is_default(&self.top_pixels) {
8256                struct __With<'a>(&'a i32);
8257                impl<'a> serde::ser::Serialize for __With<'a> {
8258                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8259                    where
8260                        S: serde::ser::Serializer,
8261                    {
8262                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
8263                    }
8264                }
8265                state.serialize_entry("topPixels", &__With(&self.top_pixels))?;
8266            }
8267            if !wkt::internal::is_default(&self.bottom_pixels) {
8268                struct __With<'a>(&'a i32);
8269                impl<'a> serde::ser::Serialize for __With<'a> {
8270                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8271                    where
8272                        S: serde::ser::Serializer,
8273                    {
8274                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
8275                    }
8276                }
8277                state.serialize_entry("bottomPixels", &__With(&self.bottom_pixels))?;
8278            }
8279            if !wkt::internal::is_default(&self.left_pixels) {
8280                struct __With<'a>(&'a i32);
8281                impl<'a> serde::ser::Serialize for __With<'a> {
8282                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8283                    where
8284                        S: serde::ser::Serializer,
8285                    {
8286                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
8287                    }
8288                }
8289                state.serialize_entry("leftPixels", &__With(&self.left_pixels))?;
8290            }
8291            if !wkt::internal::is_default(&self.right_pixels) {
8292                struct __With<'a>(&'a i32);
8293                impl<'a> serde::ser::Serialize for __With<'a> {
8294                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8295                    where
8296                        S: serde::ser::Serializer,
8297                    {
8298                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
8299                    }
8300                }
8301                state.serialize_entry("rightPixels", &__With(&self.right_pixels))?;
8302            }
8303            if !self._unknown_fields.is_empty() {
8304                for (key, value) in self._unknown_fields.iter() {
8305                    state.serialize_entry(key, &value)?;
8306                }
8307            }
8308            state.end()
8309        }
8310    }
8311
8312    impl std::fmt::Debug for Crop {
8313        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8314            let mut debug_struct = f.debug_struct("Crop");
8315            debug_struct.field("top_pixels", &self.top_pixels);
8316            debug_struct.field("bottom_pixels", &self.bottom_pixels);
8317            debug_struct.field("left_pixels", &self.left_pixels);
8318            debug_struct.field("right_pixels", &self.right_pixels);
8319            if !self._unknown_fields.is_empty() {
8320                debug_struct.field("_unknown_fields", &self._unknown_fields);
8321            }
8322            debug_struct.finish()
8323        }
8324    }
8325
8326    /// Pad filter configuration for the input video. The padded input video
8327    /// is scaled after padding with black to match the output resolution.
8328    #[derive(Clone, Default, PartialEq)]
8329    #[non_exhaustive]
8330    pub struct Pad {
8331        /// The number of pixels to add to the top. The default is 0.
8332        pub top_pixels: i32,
8333
8334        /// The number of pixels to add to the bottom. The default is 0.
8335        pub bottom_pixels: i32,
8336
8337        /// The number of pixels to add to the left. The default is 0.
8338        pub left_pixels: i32,
8339
8340        /// The number of pixels to add to the right. The default is 0.
8341        pub right_pixels: i32,
8342
8343        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8344    }
8345
8346    impl Pad {
8347        pub fn new() -> Self {
8348            std::default::Default::default()
8349        }
8350
8351        /// Sets the value of [top_pixels][crate::model::preprocessing_config::Pad::top_pixels].
8352        pub fn set_top_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8353            self.top_pixels = v.into();
8354            self
8355        }
8356
8357        /// Sets the value of [bottom_pixels][crate::model::preprocessing_config::Pad::bottom_pixels].
8358        pub fn set_bottom_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8359            self.bottom_pixels = v.into();
8360            self
8361        }
8362
8363        /// Sets the value of [left_pixels][crate::model::preprocessing_config::Pad::left_pixels].
8364        pub fn set_left_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8365            self.left_pixels = v.into();
8366            self
8367        }
8368
8369        /// Sets the value of [right_pixels][crate::model::preprocessing_config::Pad::right_pixels].
8370        pub fn set_right_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8371            self.right_pixels = v.into();
8372            self
8373        }
8374    }
8375
8376    impl wkt::message::Message for Pad {
8377        fn typename() -> &'static str {
8378            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Pad"
8379        }
8380    }
8381
8382    #[doc(hidden)]
8383    impl<'de> serde::de::Deserialize<'de> for Pad {
8384        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8385        where
8386            D: serde::Deserializer<'de>,
8387        {
8388            #[allow(non_camel_case_types)]
8389            #[doc(hidden)]
8390            #[derive(PartialEq, Eq, Hash)]
8391            enum __FieldTag {
8392                __top_pixels,
8393                __bottom_pixels,
8394                __left_pixels,
8395                __right_pixels,
8396                Unknown(std::string::String),
8397            }
8398            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8399                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8400                where
8401                    D: serde::Deserializer<'de>,
8402                {
8403                    struct Visitor;
8404                    impl<'de> serde::de::Visitor<'de> for Visitor {
8405                        type Value = __FieldTag;
8406                        fn expecting(
8407                            &self,
8408                            formatter: &mut std::fmt::Formatter,
8409                        ) -> std::fmt::Result {
8410                            formatter.write_str("a field name for Pad")
8411                        }
8412                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8413                        where
8414                            E: serde::de::Error,
8415                        {
8416                            use std::result::Result::Ok;
8417                            use std::string::ToString;
8418                            match value {
8419                                "topPixels" => Ok(__FieldTag::__top_pixels),
8420                                "top_pixels" => Ok(__FieldTag::__top_pixels),
8421                                "bottomPixels" => Ok(__FieldTag::__bottom_pixels),
8422                                "bottom_pixels" => Ok(__FieldTag::__bottom_pixels),
8423                                "leftPixels" => Ok(__FieldTag::__left_pixels),
8424                                "left_pixels" => Ok(__FieldTag::__left_pixels),
8425                                "rightPixels" => Ok(__FieldTag::__right_pixels),
8426                                "right_pixels" => Ok(__FieldTag::__right_pixels),
8427                                _ => Ok(__FieldTag::Unknown(value.to_string())),
8428                            }
8429                        }
8430                    }
8431                    deserializer.deserialize_identifier(Visitor)
8432                }
8433            }
8434            struct Visitor;
8435            impl<'de> serde::de::Visitor<'de> for Visitor {
8436                type Value = Pad;
8437                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8438                    formatter.write_str("struct Pad")
8439                }
8440                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8441                where
8442                    A: serde::de::MapAccess<'de>,
8443                {
8444                    #[allow(unused_imports)]
8445                    use serde::de::Error;
8446                    use std::option::Option::Some;
8447                    let mut fields = std::collections::HashSet::new();
8448                    let mut result = Self::Value::new();
8449                    while let Some(tag) = map.next_key::<__FieldTag>()? {
8450                        #[allow(clippy::match_single_binding)]
8451                        match tag {
8452                            __FieldTag::__top_pixels => {
8453                                if !fields.insert(__FieldTag::__top_pixels) {
8454                                    return std::result::Result::Err(A::Error::duplicate_field(
8455                                        "multiple values for top_pixels",
8456                                    ));
8457                                }
8458                                struct __With(std::option::Option<i32>);
8459                                impl<'de> serde::de::Deserialize<'de> for __With {
8460                                    fn deserialize<D>(
8461                                        deserializer: D,
8462                                    ) -> std::result::Result<Self, D::Error>
8463                                    where
8464                                        D: serde::de::Deserializer<'de>,
8465                                    {
8466                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
8467                                    }
8468                                }
8469                                result.top_pixels =
8470                                    map.next_value::<__With>()?.0.unwrap_or_default();
8471                            }
8472                            __FieldTag::__bottom_pixels => {
8473                                if !fields.insert(__FieldTag::__bottom_pixels) {
8474                                    return std::result::Result::Err(A::Error::duplicate_field(
8475                                        "multiple values for bottom_pixels",
8476                                    ));
8477                                }
8478                                struct __With(std::option::Option<i32>);
8479                                impl<'de> serde::de::Deserialize<'de> for __With {
8480                                    fn deserialize<D>(
8481                                        deserializer: D,
8482                                    ) -> std::result::Result<Self, D::Error>
8483                                    where
8484                                        D: serde::de::Deserializer<'de>,
8485                                    {
8486                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
8487                                    }
8488                                }
8489                                result.bottom_pixels =
8490                                    map.next_value::<__With>()?.0.unwrap_or_default();
8491                            }
8492                            __FieldTag::__left_pixels => {
8493                                if !fields.insert(__FieldTag::__left_pixels) {
8494                                    return std::result::Result::Err(A::Error::duplicate_field(
8495                                        "multiple values for left_pixels",
8496                                    ));
8497                                }
8498                                struct __With(std::option::Option<i32>);
8499                                impl<'de> serde::de::Deserialize<'de> for __With {
8500                                    fn deserialize<D>(
8501                                        deserializer: D,
8502                                    ) -> std::result::Result<Self, D::Error>
8503                                    where
8504                                        D: serde::de::Deserializer<'de>,
8505                                    {
8506                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
8507                                    }
8508                                }
8509                                result.left_pixels =
8510                                    map.next_value::<__With>()?.0.unwrap_or_default();
8511                            }
8512                            __FieldTag::__right_pixels => {
8513                                if !fields.insert(__FieldTag::__right_pixels) {
8514                                    return std::result::Result::Err(A::Error::duplicate_field(
8515                                        "multiple values for right_pixels",
8516                                    ));
8517                                }
8518                                struct __With(std::option::Option<i32>);
8519                                impl<'de> serde::de::Deserialize<'de> for __With {
8520                                    fn deserialize<D>(
8521                                        deserializer: D,
8522                                    ) -> std::result::Result<Self, D::Error>
8523                                    where
8524                                        D: serde::de::Deserializer<'de>,
8525                                    {
8526                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
8527                                    }
8528                                }
8529                                result.right_pixels =
8530                                    map.next_value::<__With>()?.0.unwrap_or_default();
8531                            }
8532                            __FieldTag::Unknown(key) => {
8533                                let value = map.next_value::<serde_json::Value>()?;
8534                                result._unknown_fields.insert(key, value);
8535                            }
8536                        }
8537                    }
8538                    std::result::Result::Ok(result)
8539                }
8540            }
8541            deserializer.deserialize_any(Visitor)
8542        }
8543    }
8544
8545    #[doc(hidden)]
8546    impl serde::ser::Serialize for Pad {
8547        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8548        where
8549            S: serde::ser::Serializer,
8550        {
8551            use serde::ser::SerializeMap;
8552            #[allow(unused_imports)]
8553            use std::option::Option::Some;
8554            let mut state = serializer.serialize_map(std::option::Option::None)?;
8555            if !wkt::internal::is_default(&self.top_pixels) {
8556                struct __With<'a>(&'a i32);
8557                impl<'a> serde::ser::Serialize for __With<'a> {
8558                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8559                    where
8560                        S: serde::ser::Serializer,
8561                    {
8562                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
8563                    }
8564                }
8565                state.serialize_entry("topPixels", &__With(&self.top_pixels))?;
8566            }
8567            if !wkt::internal::is_default(&self.bottom_pixels) {
8568                struct __With<'a>(&'a i32);
8569                impl<'a> serde::ser::Serialize for __With<'a> {
8570                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8571                    where
8572                        S: serde::ser::Serializer,
8573                    {
8574                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
8575                    }
8576                }
8577                state.serialize_entry("bottomPixels", &__With(&self.bottom_pixels))?;
8578            }
8579            if !wkt::internal::is_default(&self.left_pixels) {
8580                struct __With<'a>(&'a i32);
8581                impl<'a> serde::ser::Serialize for __With<'a> {
8582                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8583                    where
8584                        S: serde::ser::Serializer,
8585                    {
8586                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
8587                    }
8588                }
8589                state.serialize_entry("leftPixels", &__With(&self.left_pixels))?;
8590            }
8591            if !wkt::internal::is_default(&self.right_pixels) {
8592                struct __With<'a>(&'a i32);
8593                impl<'a> serde::ser::Serialize for __With<'a> {
8594                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8595                    where
8596                        S: serde::ser::Serializer,
8597                    {
8598                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
8599                    }
8600                }
8601                state.serialize_entry("rightPixels", &__With(&self.right_pixels))?;
8602            }
8603            if !self._unknown_fields.is_empty() {
8604                for (key, value) in self._unknown_fields.iter() {
8605                    state.serialize_entry(key, &value)?;
8606                }
8607            }
8608            state.end()
8609        }
8610    }
8611
8612    impl std::fmt::Debug for Pad {
8613        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8614            let mut debug_struct = f.debug_struct("Pad");
8615            debug_struct.field("top_pixels", &self.top_pixels);
8616            debug_struct.field("bottom_pixels", &self.bottom_pixels);
8617            debug_struct.field("left_pixels", &self.left_pixels);
8618            debug_struct.field("right_pixels", &self.right_pixels);
8619            if !self._unknown_fields.is_empty() {
8620                debug_struct.field("_unknown_fields", &self._unknown_fields);
8621            }
8622            debug_struct.finish()
8623        }
8624    }
8625
8626    /// Deinterlace configuration for input video.
8627    #[derive(Clone, Default, PartialEq)]
8628    #[non_exhaustive]
8629    pub struct Deinterlace {
8630        /// Specify the video deinterlacing filter. The default is `yadif`.
8631        pub deinterlacing_filter: std::option::Option<
8632            crate::model::preprocessing_config::deinterlace::DeinterlacingFilter,
8633        >,
8634
8635        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8636    }
8637
8638    impl Deinterlace {
8639        pub fn new() -> Self {
8640            std::default::Default::default()
8641        }
8642
8643        /// Sets the value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter].
8644        ///
8645        /// Note that all the setters affecting `deinterlacing_filter` are mutually
8646        /// exclusive.
8647        pub fn set_deinterlacing_filter<
8648            T: std::convert::Into<
8649                    std::option::Option<
8650                        crate::model::preprocessing_config::deinterlace::DeinterlacingFilter,
8651                    >,
8652                >,
8653        >(
8654            mut self,
8655            v: T,
8656        ) -> Self {
8657            self.deinterlacing_filter = v.into();
8658            self
8659        }
8660
8661        /// The value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter]
8662        /// if it holds a `Yadif`, `None` if the field is not set or
8663        /// holds a different branch.
8664        pub fn yadif(
8665            &self,
8666        ) -> std::option::Option<
8667            &std::boxed::Box<crate::model::preprocessing_config::deinterlace::YadifConfig>,
8668        > {
8669            #[allow(unreachable_patterns)]
8670            self.deinterlacing_filter.as_ref().and_then(|v| match v {
8671                crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Yadif(v) => {
8672                    std::option::Option::Some(v)
8673                }
8674                _ => std::option::Option::None,
8675            })
8676        }
8677
8678        /// Sets the value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter]
8679        /// to hold a `Yadif`.
8680        ///
8681        /// Note that all the setters affecting `deinterlacing_filter` are
8682        /// mutually exclusive.
8683        pub fn set_yadif<
8684            T: std::convert::Into<
8685                    std::boxed::Box<crate::model::preprocessing_config::deinterlace::YadifConfig>,
8686                >,
8687        >(
8688            mut self,
8689            v: T,
8690        ) -> Self {
8691            self.deinterlacing_filter = std::option::Option::Some(
8692                crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Yadif(
8693                    v.into(),
8694                ),
8695            );
8696            self
8697        }
8698
8699        /// The value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter]
8700        /// if it holds a `Bwdif`, `None` if the field is not set or
8701        /// holds a different branch.
8702        pub fn bwdif(
8703            &self,
8704        ) -> std::option::Option<
8705            &std::boxed::Box<crate::model::preprocessing_config::deinterlace::BwdifConfig>,
8706        > {
8707            #[allow(unreachable_patterns)]
8708            self.deinterlacing_filter.as_ref().and_then(|v| match v {
8709                crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Bwdif(v) => {
8710                    std::option::Option::Some(v)
8711                }
8712                _ => std::option::Option::None,
8713            })
8714        }
8715
8716        /// Sets the value of [deinterlacing_filter][crate::model::preprocessing_config::Deinterlace::deinterlacing_filter]
8717        /// to hold a `Bwdif`.
8718        ///
8719        /// Note that all the setters affecting `deinterlacing_filter` are
8720        /// mutually exclusive.
8721        pub fn set_bwdif<
8722            T: std::convert::Into<
8723                    std::boxed::Box<crate::model::preprocessing_config::deinterlace::BwdifConfig>,
8724                >,
8725        >(
8726            mut self,
8727            v: T,
8728        ) -> Self {
8729            self.deinterlacing_filter = std::option::Option::Some(
8730                crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Bwdif(
8731                    v.into(),
8732                ),
8733            );
8734            self
8735        }
8736    }
8737
8738    impl wkt::message::Message for Deinterlace {
8739        fn typename() -> &'static str {
8740            "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace"
8741        }
8742    }
8743
8744    #[doc(hidden)]
8745    impl<'de> serde::de::Deserialize<'de> for Deinterlace {
8746        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8747        where
8748            D: serde::Deserializer<'de>,
8749        {
8750            #[allow(non_camel_case_types)]
8751            #[doc(hidden)]
8752            #[derive(PartialEq, Eq, Hash)]
8753            enum __FieldTag {
8754                __yadif,
8755                __bwdif,
8756                Unknown(std::string::String),
8757            }
8758            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8759                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8760                where
8761                    D: serde::Deserializer<'de>,
8762                {
8763                    struct Visitor;
8764                    impl<'de> serde::de::Visitor<'de> for Visitor {
8765                        type Value = __FieldTag;
8766                        fn expecting(
8767                            &self,
8768                            formatter: &mut std::fmt::Formatter,
8769                        ) -> std::fmt::Result {
8770                            formatter.write_str("a field name for Deinterlace")
8771                        }
8772                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8773                        where
8774                            E: serde::de::Error,
8775                        {
8776                            use std::result::Result::Ok;
8777                            use std::string::ToString;
8778                            match value {
8779                                "yadif" => Ok(__FieldTag::__yadif),
8780                                "bwdif" => Ok(__FieldTag::__bwdif),
8781                                _ => Ok(__FieldTag::Unknown(value.to_string())),
8782                            }
8783                        }
8784                    }
8785                    deserializer.deserialize_identifier(Visitor)
8786                }
8787            }
8788            struct Visitor;
8789            impl<'de> serde::de::Visitor<'de> for Visitor {
8790                type Value = Deinterlace;
8791                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8792                    formatter.write_str("struct Deinterlace")
8793                }
8794                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8795                where
8796                    A: serde::de::MapAccess<'de>,
8797                {
8798                    #[allow(unused_imports)]
8799                    use serde::de::Error;
8800                    use std::option::Option::Some;
8801                    let mut fields = std::collections::HashSet::new();
8802                    let mut result = Self::Value::new();
8803                    while let Some(tag) = map.next_key::<__FieldTag>()? {
8804                        #[allow(clippy::match_single_binding)]
8805                        match tag {
8806                            __FieldTag::__yadif => {
8807                                if !fields.insert(__FieldTag::__yadif) {
8808                                    return std::result::Result::Err(A::Error::duplicate_field(
8809                                        "multiple values for yadif",
8810                                    ));
8811                                }
8812                                if result.deinterlacing_filter.is_some() {
8813                                    return std::result::Result::Err(A::Error::duplicate_field(
8814                                        "multiple values for `deinterlacing_filter`, a oneof with full ID .google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace.yadif, latest field was yadif",
8815                                    ));
8816                                }
8817                                result.deinterlacing_filter = std::option::Option::Some(
8818                                    crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Yadif(
8819                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::preprocessing_config::deinterlace::YadifConfig>>>()?.unwrap_or_default()
8820                                    ),
8821                                );
8822                            }
8823                            __FieldTag::__bwdif => {
8824                                if !fields.insert(__FieldTag::__bwdif) {
8825                                    return std::result::Result::Err(A::Error::duplicate_field(
8826                                        "multiple values for bwdif",
8827                                    ));
8828                                }
8829                                if result.deinterlacing_filter.is_some() {
8830                                    return std::result::Result::Err(A::Error::duplicate_field(
8831                                        "multiple values for `deinterlacing_filter`, a oneof with full ID .google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace.bwdif, latest field was bwdif",
8832                                    ));
8833                                }
8834                                result.deinterlacing_filter = std::option::Option::Some(
8835                                    crate::model::preprocessing_config::deinterlace::DeinterlacingFilter::Bwdif(
8836                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::preprocessing_config::deinterlace::BwdifConfig>>>()?.unwrap_or_default()
8837                                    ),
8838                                );
8839                            }
8840                            __FieldTag::Unknown(key) => {
8841                                let value = map.next_value::<serde_json::Value>()?;
8842                                result._unknown_fields.insert(key, value);
8843                            }
8844                        }
8845                    }
8846                    std::result::Result::Ok(result)
8847                }
8848            }
8849            deserializer.deserialize_any(Visitor)
8850        }
8851    }
8852
8853    #[doc(hidden)]
8854    impl serde::ser::Serialize for Deinterlace {
8855        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8856        where
8857            S: serde::ser::Serializer,
8858        {
8859            use serde::ser::SerializeMap;
8860            #[allow(unused_imports)]
8861            use std::option::Option::Some;
8862            let mut state = serializer.serialize_map(std::option::Option::None)?;
8863            if let Some(value) = self.yadif() {
8864                state.serialize_entry("yadif", value)?;
8865            }
8866            if let Some(value) = self.bwdif() {
8867                state.serialize_entry("bwdif", value)?;
8868            }
8869            if !self._unknown_fields.is_empty() {
8870                for (key, value) in self._unknown_fields.iter() {
8871                    state.serialize_entry(key, &value)?;
8872                }
8873            }
8874            state.end()
8875        }
8876    }
8877
8878    impl std::fmt::Debug for Deinterlace {
8879        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8880            let mut debug_struct = f.debug_struct("Deinterlace");
8881            debug_struct.field("deinterlacing_filter", &self.deinterlacing_filter);
8882            if !self._unknown_fields.is_empty() {
8883                debug_struct.field("_unknown_fields", &self._unknown_fields);
8884            }
8885            debug_struct.finish()
8886        }
8887    }
8888
8889    /// Defines additional types related to [Deinterlace].
8890    pub mod deinterlace {
8891        #[allow(unused_imports)]
8892        use super::*;
8893
8894        /// Yet Another Deinterlacing Filter Configuration.
8895        #[derive(Clone, Default, PartialEq)]
8896        #[non_exhaustive]
8897        pub struct YadifConfig {
8898            /// Specifies the deinterlacing mode to adopt.
8899            /// The default is `send_frame`.
8900            /// Supported values:
8901            ///
8902            /// - `send_frame`: Output one frame for each frame
8903            /// - `send_field`: Output one frame for each field
8904            pub mode: std::string::String,
8905
8906            /// Disable spacial interlacing.
8907            /// The default is `false`.
8908            pub disable_spatial_interlacing: bool,
8909
8910            /// The picture field parity assumed for the input interlaced video.
8911            /// The default is `auto`.
8912            /// Supported values:
8913            ///
8914            /// - `tff`: Assume the top field is first
8915            /// - `bff`: Assume the bottom field is first
8916            /// - `auto`: Enable automatic detection of field parity
8917            pub parity: std::string::String,
8918
8919            /// Deinterlace all frames rather than just the frames identified as
8920            /// interlaced. The default is `false`.
8921            pub deinterlace_all_frames: bool,
8922
8923            _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8924        }
8925
8926        impl YadifConfig {
8927            pub fn new() -> Self {
8928                std::default::Default::default()
8929            }
8930
8931            /// Sets the value of [mode][crate::model::preprocessing_config::deinterlace::YadifConfig::mode].
8932            pub fn set_mode<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8933                self.mode = v.into();
8934                self
8935            }
8936
8937            /// Sets the value of [disable_spatial_interlacing][crate::model::preprocessing_config::deinterlace::YadifConfig::disable_spatial_interlacing].
8938            pub fn set_disable_spatial_interlacing<T: std::convert::Into<bool>>(
8939                mut self,
8940                v: T,
8941            ) -> Self {
8942                self.disable_spatial_interlacing = v.into();
8943                self
8944            }
8945
8946            /// Sets the value of [parity][crate::model::preprocessing_config::deinterlace::YadifConfig::parity].
8947            pub fn set_parity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8948                self.parity = v.into();
8949                self
8950            }
8951
8952            /// Sets the value of [deinterlace_all_frames][crate::model::preprocessing_config::deinterlace::YadifConfig::deinterlace_all_frames].
8953            pub fn set_deinterlace_all_frames<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8954                self.deinterlace_all_frames = v.into();
8955                self
8956            }
8957        }
8958
8959        impl wkt::message::Message for YadifConfig {
8960            fn typename() -> &'static str {
8961                "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace.YadifConfig"
8962            }
8963        }
8964
8965        #[doc(hidden)]
8966        impl<'de> serde::de::Deserialize<'de> for YadifConfig {
8967            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8968            where
8969                D: serde::Deserializer<'de>,
8970            {
8971                #[allow(non_camel_case_types)]
8972                #[doc(hidden)]
8973                #[derive(PartialEq, Eq, Hash)]
8974                enum __FieldTag {
8975                    __mode,
8976                    __disable_spatial_interlacing,
8977                    __parity,
8978                    __deinterlace_all_frames,
8979                    Unknown(std::string::String),
8980                }
8981                impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8982                    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8983                    where
8984                        D: serde::Deserializer<'de>,
8985                    {
8986                        struct Visitor;
8987                        impl<'de> serde::de::Visitor<'de> for Visitor {
8988                            type Value = __FieldTag;
8989                            fn expecting(
8990                                &self,
8991                                formatter: &mut std::fmt::Formatter,
8992                            ) -> std::fmt::Result {
8993                                formatter.write_str("a field name for YadifConfig")
8994                            }
8995                            fn visit_str<E>(
8996                                self,
8997                                value: &str,
8998                            ) -> std::result::Result<Self::Value, E>
8999                            where
9000                                E: serde::de::Error,
9001                            {
9002                                use std::result::Result::Ok;
9003                                use std::string::ToString;
9004                                match value {
9005                                    "mode" => Ok(__FieldTag::__mode),
9006                                    "disableSpatialInterlacing" => {
9007                                        Ok(__FieldTag::__disable_spatial_interlacing)
9008                                    }
9009                                    "disable_spatial_interlacing" => {
9010                                        Ok(__FieldTag::__disable_spatial_interlacing)
9011                                    }
9012                                    "parity" => Ok(__FieldTag::__parity),
9013                                    "deinterlaceAllFrames" => {
9014                                        Ok(__FieldTag::__deinterlace_all_frames)
9015                                    }
9016                                    "deinterlace_all_frames" => {
9017                                        Ok(__FieldTag::__deinterlace_all_frames)
9018                                    }
9019                                    _ => Ok(__FieldTag::Unknown(value.to_string())),
9020                                }
9021                            }
9022                        }
9023                        deserializer.deserialize_identifier(Visitor)
9024                    }
9025                }
9026                struct Visitor;
9027                impl<'de> serde::de::Visitor<'de> for Visitor {
9028                    type Value = YadifConfig;
9029                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9030                        formatter.write_str("struct YadifConfig")
9031                    }
9032                    fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9033                    where
9034                        A: serde::de::MapAccess<'de>,
9035                    {
9036                        #[allow(unused_imports)]
9037                        use serde::de::Error;
9038                        use std::option::Option::Some;
9039                        let mut fields = std::collections::HashSet::new();
9040                        let mut result = Self::Value::new();
9041                        while let Some(tag) = map.next_key::<__FieldTag>()? {
9042                            #[allow(clippy::match_single_binding)]
9043                            match tag {
9044                                __FieldTag::__mode => {
9045                                    if !fields.insert(__FieldTag::__mode) {
9046                                        return std::result::Result::Err(
9047                                            A::Error::duplicate_field("multiple values for mode"),
9048                                        );
9049                                    }
9050                                    result.mode = map
9051                                        .next_value::<std::option::Option<std::string::String>>()?
9052                                        .unwrap_or_default();
9053                                }
9054                                __FieldTag::__disable_spatial_interlacing => {
9055                                    if !fields.insert(__FieldTag::__disable_spatial_interlacing) {
9056                                        return std::result::Result::Err(
9057                                            A::Error::duplicate_field(
9058                                                "multiple values for disable_spatial_interlacing",
9059                                            ),
9060                                        );
9061                                    }
9062                                    result.disable_spatial_interlacing = map
9063                                        .next_value::<std::option::Option<bool>>()?
9064                                        .unwrap_or_default();
9065                                }
9066                                __FieldTag::__parity => {
9067                                    if !fields.insert(__FieldTag::__parity) {
9068                                        return std::result::Result::Err(
9069                                            A::Error::duplicate_field("multiple values for parity"),
9070                                        );
9071                                    }
9072                                    result.parity = map
9073                                        .next_value::<std::option::Option<std::string::String>>()?
9074                                        .unwrap_or_default();
9075                                }
9076                                __FieldTag::__deinterlace_all_frames => {
9077                                    if !fields.insert(__FieldTag::__deinterlace_all_frames) {
9078                                        return std::result::Result::Err(
9079                                            A::Error::duplicate_field(
9080                                                "multiple values for deinterlace_all_frames",
9081                                            ),
9082                                        );
9083                                    }
9084                                    result.deinterlace_all_frames = map
9085                                        .next_value::<std::option::Option<bool>>()?
9086                                        .unwrap_or_default();
9087                                }
9088                                __FieldTag::Unknown(key) => {
9089                                    let value = map.next_value::<serde_json::Value>()?;
9090                                    result._unknown_fields.insert(key, value);
9091                                }
9092                            }
9093                        }
9094                        std::result::Result::Ok(result)
9095                    }
9096                }
9097                deserializer.deserialize_any(Visitor)
9098            }
9099        }
9100
9101        #[doc(hidden)]
9102        impl serde::ser::Serialize for YadifConfig {
9103            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9104            where
9105                S: serde::ser::Serializer,
9106            {
9107                use serde::ser::SerializeMap;
9108                #[allow(unused_imports)]
9109                use std::option::Option::Some;
9110                let mut state = serializer.serialize_map(std::option::Option::None)?;
9111                if !self.mode.is_empty() {
9112                    state.serialize_entry("mode", &self.mode)?;
9113                }
9114                if !wkt::internal::is_default(&self.disable_spatial_interlacing) {
9115                    state.serialize_entry(
9116                        "disableSpatialInterlacing",
9117                        &self.disable_spatial_interlacing,
9118                    )?;
9119                }
9120                if !self.parity.is_empty() {
9121                    state.serialize_entry("parity", &self.parity)?;
9122                }
9123                if !wkt::internal::is_default(&self.deinterlace_all_frames) {
9124                    state.serialize_entry("deinterlaceAllFrames", &self.deinterlace_all_frames)?;
9125                }
9126                if !self._unknown_fields.is_empty() {
9127                    for (key, value) in self._unknown_fields.iter() {
9128                        state.serialize_entry(key, &value)?;
9129                    }
9130                }
9131                state.end()
9132            }
9133        }
9134
9135        impl std::fmt::Debug for YadifConfig {
9136            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9137                let mut debug_struct = f.debug_struct("YadifConfig");
9138                debug_struct.field("mode", &self.mode);
9139                debug_struct.field(
9140                    "disable_spatial_interlacing",
9141                    &self.disable_spatial_interlacing,
9142                );
9143                debug_struct.field("parity", &self.parity);
9144                debug_struct.field("deinterlace_all_frames", &self.deinterlace_all_frames);
9145                if !self._unknown_fields.is_empty() {
9146                    debug_struct.field("_unknown_fields", &self._unknown_fields);
9147                }
9148                debug_struct.finish()
9149            }
9150        }
9151
9152        /// Bob Weaver Deinterlacing Filter Configuration.
9153        #[derive(Clone, Default, PartialEq)]
9154        #[non_exhaustive]
9155        pub struct BwdifConfig {
9156            /// Specifies the deinterlacing mode to adopt.
9157            /// The default is `send_frame`.
9158            /// Supported values:
9159            ///
9160            /// - `send_frame`: Output one frame for each frame
9161            /// - `send_field`: Output one frame for each field
9162            pub mode: std::string::String,
9163
9164            /// The picture field parity assumed for the input interlaced video.
9165            /// The default is `auto`.
9166            /// Supported values:
9167            ///
9168            /// - `tff`: Assume the top field is first
9169            /// - `bff`: Assume the bottom field is first
9170            /// - `auto`: Enable automatic detection of field parity
9171            pub parity: std::string::String,
9172
9173            /// Deinterlace all frames rather than just the frames identified as
9174            /// interlaced. The default is `false`.
9175            pub deinterlace_all_frames: bool,
9176
9177            _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9178        }
9179
9180        impl BwdifConfig {
9181            pub fn new() -> Self {
9182                std::default::Default::default()
9183            }
9184
9185            /// Sets the value of [mode][crate::model::preprocessing_config::deinterlace::BwdifConfig::mode].
9186            pub fn set_mode<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9187                self.mode = v.into();
9188                self
9189            }
9190
9191            /// Sets the value of [parity][crate::model::preprocessing_config::deinterlace::BwdifConfig::parity].
9192            pub fn set_parity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9193                self.parity = v.into();
9194                self
9195            }
9196
9197            /// Sets the value of [deinterlace_all_frames][crate::model::preprocessing_config::deinterlace::BwdifConfig::deinterlace_all_frames].
9198            pub fn set_deinterlace_all_frames<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9199                self.deinterlace_all_frames = v.into();
9200                self
9201            }
9202        }
9203
9204        impl wkt::message::Message for BwdifConfig {
9205            fn typename() -> &'static str {
9206                "type.googleapis.com/google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace.BwdifConfig"
9207            }
9208        }
9209
9210        #[doc(hidden)]
9211        impl<'de> serde::de::Deserialize<'de> for BwdifConfig {
9212            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9213            where
9214                D: serde::Deserializer<'de>,
9215            {
9216                #[allow(non_camel_case_types)]
9217                #[doc(hidden)]
9218                #[derive(PartialEq, Eq, Hash)]
9219                enum __FieldTag {
9220                    __mode,
9221                    __parity,
9222                    __deinterlace_all_frames,
9223                    Unknown(std::string::String),
9224                }
9225                impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9226                    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9227                    where
9228                        D: serde::Deserializer<'de>,
9229                    {
9230                        struct Visitor;
9231                        impl<'de> serde::de::Visitor<'de> for Visitor {
9232                            type Value = __FieldTag;
9233                            fn expecting(
9234                                &self,
9235                                formatter: &mut std::fmt::Formatter,
9236                            ) -> std::fmt::Result {
9237                                formatter.write_str("a field name for BwdifConfig")
9238                            }
9239                            fn visit_str<E>(
9240                                self,
9241                                value: &str,
9242                            ) -> std::result::Result<Self::Value, E>
9243                            where
9244                                E: serde::de::Error,
9245                            {
9246                                use std::result::Result::Ok;
9247                                use std::string::ToString;
9248                                match value {
9249                                    "mode" => Ok(__FieldTag::__mode),
9250                                    "parity" => Ok(__FieldTag::__parity),
9251                                    "deinterlaceAllFrames" => {
9252                                        Ok(__FieldTag::__deinterlace_all_frames)
9253                                    }
9254                                    "deinterlace_all_frames" => {
9255                                        Ok(__FieldTag::__deinterlace_all_frames)
9256                                    }
9257                                    _ => Ok(__FieldTag::Unknown(value.to_string())),
9258                                }
9259                            }
9260                        }
9261                        deserializer.deserialize_identifier(Visitor)
9262                    }
9263                }
9264                struct Visitor;
9265                impl<'de> serde::de::Visitor<'de> for Visitor {
9266                    type Value = BwdifConfig;
9267                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9268                        formatter.write_str("struct BwdifConfig")
9269                    }
9270                    fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9271                    where
9272                        A: serde::de::MapAccess<'de>,
9273                    {
9274                        #[allow(unused_imports)]
9275                        use serde::de::Error;
9276                        use std::option::Option::Some;
9277                        let mut fields = std::collections::HashSet::new();
9278                        let mut result = Self::Value::new();
9279                        while let Some(tag) = map.next_key::<__FieldTag>()? {
9280                            #[allow(clippy::match_single_binding)]
9281                            match tag {
9282                                __FieldTag::__mode => {
9283                                    if !fields.insert(__FieldTag::__mode) {
9284                                        return std::result::Result::Err(
9285                                            A::Error::duplicate_field("multiple values for mode"),
9286                                        );
9287                                    }
9288                                    result.mode = map
9289                                        .next_value::<std::option::Option<std::string::String>>()?
9290                                        .unwrap_or_default();
9291                                }
9292                                __FieldTag::__parity => {
9293                                    if !fields.insert(__FieldTag::__parity) {
9294                                        return std::result::Result::Err(
9295                                            A::Error::duplicate_field("multiple values for parity"),
9296                                        );
9297                                    }
9298                                    result.parity = map
9299                                        .next_value::<std::option::Option<std::string::String>>()?
9300                                        .unwrap_or_default();
9301                                }
9302                                __FieldTag::__deinterlace_all_frames => {
9303                                    if !fields.insert(__FieldTag::__deinterlace_all_frames) {
9304                                        return std::result::Result::Err(
9305                                            A::Error::duplicate_field(
9306                                                "multiple values for deinterlace_all_frames",
9307                                            ),
9308                                        );
9309                                    }
9310                                    result.deinterlace_all_frames = map
9311                                        .next_value::<std::option::Option<bool>>()?
9312                                        .unwrap_or_default();
9313                                }
9314                                __FieldTag::Unknown(key) => {
9315                                    let value = map.next_value::<serde_json::Value>()?;
9316                                    result._unknown_fields.insert(key, value);
9317                                }
9318                            }
9319                        }
9320                        std::result::Result::Ok(result)
9321                    }
9322                }
9323                deserializer.deserialize_any(Visitor)
9324            }
9325        }
9326
9327        #[doc(hidden)]
9328        impl serde::ser::Serialize for BwdifConfig {
9329            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9330            where
9331                S: serde::ser::Serializer,
9332            {
9333                use serde::ser::SerializeMap;
9334                #[allow(unused_imports)]
9335                use std::option::Option::Some;
9336                let mut state = serializer.serialize_map(std::option::Option::None)?;
9337                if !self.mode.is_empty() {
9338                    state.serialize_entry("mode", &self.mode)?;
9339                }
9340                if !self.parity.is_empty() {
9341                    state.serialize_entry("parity", &self.parity)?;
9342                }
9343                if !wkt::internal::is_default(&self.deinterlace_all_frames) {
9344                    state.serialize_entry("deinterlaceAllFrames", &self.deinterlace_all_frames)?;
9345                }
9346                if !self._unknown_fields.is_empty() {
9347                    for (key, value) in self._unknown_fields.iter() {
9348                        state.serialize_entry(key, &value)?;
9349                    }
9350                }
9351                state.end()
9352            }
9353        }
9354
9355        impl std::fmt::Debug for BwdifConfig {
9356            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9357                let mut debug_struct = f.debug_struct("BwdifConfig");
9358                debug_struct.field("mode", &self.mode);
9359                debug_struct.field("parity", &self.parity);
9360                debug_struct.field("deinterlace_all_frames", &self.deinterlace_all_frames);
9361                if !self._unknown_fields.is_empty() {
9362                    debug_struct.field("_unknown_fields", &self._unknown_fields);
9363                }
9364                debug_struct.finish()
9365            }
9366        }
9367
9368        /// Specify the video deinterlacing filter. The default is `yadif`.
9369        #[derive(Clone, Debug, PartialEq)]
9370        #[non_exhaustive]
9371        pub enum DeinterlacingFilter {
9372            /// Specifies the Yet Another Deinterlacing Filter Configuration.
9373            Yadif(std::boxed::Box<crate::model::preprocessing_config::deinterlace::YadifConfig>),
9374            /// Specifies the Bob Weaver Deinterlacing Filter Configuration.
9375            Bwdif(std::boxed::Box<crate::model::preprocessing_config::deinterlace::BwdifConfig>),
9376        }
9377    }
9378}
9379
9380/// Video stream resource.
9381#[derive(Clone, Default, PartialEq)]
9382#[non_exhaustive]
9383pub struct VideoStream {
9384    /// Codec settings can be h264, h265, or vp9.
9385    pub codec_settings: std::option::Option<crate::model::video_stream::CodecSettings>,
9386
9387    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9388}
9389
9390impl VideoStream {
9391    pub fn new() -> Self {
9392        std::default::Default::default()
9393    }
9394
9395    /// Sets the value of [codec_settings][crate::model::VideoStream::codec_settings].
9396    ///
9397    /// Note that all the setters affecting `codec_settings` are mutually
9398    /// exclusive.
9399    pub fn set_codec_settings<
9400        T: std::convert::Into<std::option::Option<crate::model::video_stream::CodecSettings>>,
9401    >(
9402        mut self,
9403        v: T,
9404    ) -> Self {
9405        self.codec_settings = v.into();
9406        self
9407    }
9408
9409    /// The value of [codec_settings][crate::model::VideoStream::codec_settings]
9410    /// if it holds a `H264`, `None` if the field is not set or
9411    /// holds a different branch.
9412    pub fn h264(
9413        &self,
9414    ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H264CodecSettings>> {
9415        #[allow(unreachable_patterns)]
9416        self.codec_settings.as_ref().and_then(|v| match v {
9417            crate::model::video_stream::CodecSettings::H264(v) => std::option::Option::Some(v),
9418            _ => std::option::Option::None,
9419        })
9420    }
9421
9422    /// Sets the value of [codec_settings][crate::model::VideoStream::codec_settings]
9423    /// to hold a `H264`.
9424    ///
9425    /// Note that all the setters affecting `codec_settings` are
9426    /// mutually exclusive.
9427    pub fn set_h264<
9428        T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H264CodecSettings>>,
9429    >(
9430        mut self,
9431        v: T,
9432    ) -> Self {
9433        self.codec_settings =
9434            std::option::Option::Some(crate::model::video_stream::CodecSettings::H264(v.into()));
9435        self
9436    }
9437
9438    /// The value of [codec_settings][crate::model::VideoStream::codec_settings]
9439    /// if it holds a `H265`, `None` if the field is not set or
9440    /// holds a different branch.
9441    pub fn h265(
9442        &self,
9443    ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H265CodecSettings>> {
9444        #[allow(unreachable_patterns)]
9445        self.codec_settings.as_ref().and_then(|v| match v {
9446            crate::model::video_stream::CodecSettings::H265(v) => std::option::Option::Some(v),
9447            _ => std::option::Option::None,
9448        })
9449    }
9450
9451    /// Sets the value of [codec_settings][crate::model::VideoStream::codec_settings]
9452    /// to hold a `H265`.
9453    ///
9454    /// Note that all the setters affecting `codec_settings` are
9455    /// mutually exclusive.
9456    pub fn set_h265<
9457        T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H265CodecSettings>>,
9458    >(
9459        mut self,
9460        v: T,
9461    ) -> Self {
9462        self.codec_settings =
9463            std::option::Option::Some(crate::model::video_stream::CodecSettings::H265(v.into()));
9464        self
9465    }
9466
9467    /// The value of [codec_settings][crate::model::VideoStream::codec_settings]
9468    /// if it holds a `Vp9`, `None` if the field is not set or
9469    /// holds a different branch.
9470    pub fn vp9(
9471        &self,
9472    ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::Vp9CodecSettings>> {
9473        #[allow(unreachable_patterns)]
9474        self.codec_settings.as_ref().and_then(|v| match v {
9475            crate::model::video_stream::CodecSettings::Vp9(v) => std::option::Option::Some(v),
9476            _ => std::option::Option::None,
9477        })
9478    }
9479
9480    /// Sets the value of [codec_settings][crate::model::VideoStream::codec_settings]
9481    /// to hold a `Vp9`.
9482    ///
9483    /// Note that all the setters affecting `codec_settings` are
9484    /// mutually exclusive.
9485    pub fn set_vp9<
9486        T: std::convert::Into<std::boxed::Box<crate::model::video_stream::Vp9CodecSettings>>,
9487    >(
9488        mut self,
9489        v: T,
9490    ) -> Self {
9491        self.codec_settings =
9492            std::option::Option::Some(crate::model::video_stream::CodecSettings::Vp9(v.into()));
9493        self
9494    }
9495}
9496
9497impl wkt::message::Message for VideoStream {
9498    fn typename() -> &'static str {
9499        "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream"
9500    }
9501}
9502
9503#[doc(hidden)]
9504impl<'de> serde::de::Deserialize<'de> for VideoStream {
9505    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9506    where
9507        D: serde::Deserializer<'de>,
9508    {
9509        #[allow(non_camel_case_types)]
9510        #[doc(hidden)]
9511        #[derive(PartialEq, Eq, Hash)]
9512        enum __FieldTag {
9513            __h264,
9514            __h265,
9515            __vp9,
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 VideoStream")
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                            "h264" => Ok(__FieldTag::__h264),
9537                            "h265" => Ok(__FieldTag::__h265),
9538                            "vp9" => Ok(__FieldTag::__vp9),
9539                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9540                        }
9541                    }
9542                }
9543                deserializer.deserialize_identifier(Visitor)
9544            }
9545        }
9546        struct Visitor;
9547        impl<'de> serde::de::Visitor<'de> for Visitor {
9548            type Value = VideoStream;
9549            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9550                formatter.write_str("struct VideoStream")
9551            }
9552            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9553            where
9554                A: serde::de::MapAccess<'de>,
9555            {
9556                #[allow(unused_imports)]
9557                use serde::de::Error;
9558                use std::option::Option::Some;
9559                let mut fields = std::collections::HashSet::new();
9560                let mut result = Self::Value::new();
9561                while let Some(tag) = map.next_key::<__FieldTag>()? {
9562                    #[allow(clippy::match_single_binding)]
9563                    match tag {
9564                        __FieldTag::__h264 => {
9565                            if !fields.insert(__FieldTag::__h264) {
9566                                return std::result::Result::Err(A::Error::duplicate_field(
9567                                    "multiple values for h264",
9568                                ));
9569                            }
9570                            if result.codec_settings.is_some() {
9571                                return std::result::Result::Err(A::Error::duplicate_field(
9572                                    "multiple values for `codec_settings`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.h264, latest field was h264",
9573                                ));
9574                            }
9575                            result.codec_settings = std::option::Option::Some(
9576                                crate::model::video_stream::CodecSettings::H264(
9577                                    map.next_value::<std::option::Option<
9578                                        std::boxed::Box<
9579                                            crate::model::video_stream::H264CodecSettings,
9580                                        >,
9581                                    >>()?
9582                                    .unwrap_or_default(),
9583                                ),
9584                            );
9585                        }
9586                        __FieldTag::__h265 => {
9587                            if !fields.insert(__FieldTag::__h265) {
9588                                return std::result::Result::Err(A::Error::duplicate_field(
9589                                    "multiple values for h265",
9590                                ));
9591                            }
9592                            if result.codec_settings.is_some() {
9593                                return std::result::Result::Err(A::Error::duplicate_field(
9594                                    "multiple values for `codec_settings`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.h265, latest field was h265",
9595                                ));
9596                            }
9597                            result.codec_settings = std::option::Option::Some(
9598                                crate::model::video_stream::CodecSettings::H265(
9599                                    map.next_value::<std::option::Option<
9600                                        std::boxed::Box<
9601                                            crate::model::video_stream::H265CodecSettings,
9602                                        >,
9603                                    >>()?
9604                                    .unwrap_or_default(),
9605                                ),
9606                            );
9607                        }
9608                        __FieldTag::__vp9 => {
9609                            if !fields.insert(__FieldTag::__vp9) {
9610                                return std::result::Result::Err(A::Error::duplicate_field(
9611                                    "multiple values for vp9",
9612                                ));
9613                            }
9614                            if result.codec_settings.is_some() {
9615                                return std::result::Result::Err(A::Error::duplicate_field(
9616                                    "multiple values for `codec_settings`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.vp9, latest field was vp9",
9617                                ));
9618                            }
9619                            result.codec_settings = std::option::Option::Some(
9620                                crate::model::video_stream::CodecSettings::Vp9(
9621                                    map.next_value::<std::option::Option<
9622                                        std::boxed::Box<
9623                                            crate::model::video_stream::Vp9CodecSettings,
9624                                        >,
9625                                    >>()?
9626                                    .unwrap_or_default(),
9627                                ),
9628                            );
9629                        }
9630                        __FieldTag::Unknown(key) => {
9631                            let value = map.next_value::<serde_json::Value>()?;
9632                            result._unknown_fields.insert(key, value);
9633                        }
9634                    }
9635                }
9636                std::result::Result::Ok(result)
9637            }
9638        }
9639        deserializer.deserialize_any(Visitor)
9640    }
9641}
9642
9643#[doc(hidden)]
9644impl serde::ser::Serialize for VideoStream {
9645    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9646    where
9647        S: serde::ser::Serializer,
9648    {
9649        use serde::ser::SerializeMap;
9650        #[allow(unused_imports)]
9651        use std::option::Option::Some;
9652        let mut state = serializer.serialize_map(std::option::Option::None)?;
9653        if let Some(value) = self.h264() {
9654            state.serialize_entry("h264", value)?;
9655        }
9656        if let Some(value) = self.h265() {
9657            state.serialize_entry("h265", value)?;
9658        }
9659        if let Some(value) = self.vp9() {
9660            state.serialize_entry("vp9", value)?;
9661        }
9662        if !self._unknown_fields.is_empty() {
9663            for (key, value) in self._unknown_fields.iter() {
9664                state.serialize_entry(key, &value)?;
9665            }
9666        }
9667        state.end()
9668    }
9669}
9670
9671impl std::fmt::Debug for VideoStream {
9672    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9673        let mut debug_struct = f.debug_struct("VideoStream");
9674        debug_struct.field("codec_settings", &self.codec_settings);
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/// Defines additional types related to [VideoStream].
9683pub mod video_stream {
9684    #[allow(unused_imports)]
9685    use super::*;
9686
9687    /// Convert the input video to a Standard Dynamic Range (SDR) video.
9688    #[derive(Clone, Default, PartialEq)]
9689    #[non_exhaustive]
9690    pub struct H264ColorFormatSDR {
9691        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9692    }
9693
9694    impl H264ColorFormatSDR {
9695        pub fn new() -> Self {
9696            std::default::Default::default()
9697        }
9698    }
9699
9700    impl wkt::message::Message for H264ColorFormatSDR {
9701        fn typename() -> &'static str {
9702            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H264ColorFormatSDR"
9703        }
9704    }
9705
9706    #[doc(hidden)]
9707    impl<'de> serde::de::Deserialize<'de> for H264ColorFormatSDR {
9708        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9709        where
9710            D: serde::Deserializer<'de>,
9711        {
9712            #[allow(non_camel_case_types)]
9713            #[doc(hidden)]
9714            #[derive(PartialEq, Eq, Hash)]
9715            enum __FieldTag {
9716                Unknown(std::string::String),
9717            }
9718            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9719                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9720                where
9721                    D: serde::Deserializer<'de>,
9722                {
9723                    struct Visitor;
9724                    impl<'de> serde::de::Visitor<'de> for Visitor {
9725                        type Value = __FieldTag;
9726                        fn expecting(
9727                            &self,
9728                            formatter: &mut std::fmt::Formatter,
9729                        ) -> std::fmt::Result {
9730                            formatter.write_str("a field name for H264ColorFormatSDR")
9731                        }
9732                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9733                        where
9734                            E: serde::de::Error,
9735                        {
9736                            use std::result::Result::Ok;
9737                            use std::string::ToString;
9738                            Ok(__FieldTag::Unknown(value.to_string()))
9739                        }
9740                    }
9741                    deserializer.deserialize_identifier(Visitor)
9742                }
9743            }
9744            struct Visitor;
9745            impl<'de> serde::de::Visitor<'de> for Visitor {
9746                type Value = H264ColorFormatSDR;
9747                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9748                    formatter.write_str("struct H264ColorFormatSDR")
9749                }
9750                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9751                where
9752                    A: serde::de::MapAccess<'de>,
9753                {
9754                    #[allow(unused_imports)]
9755                    use serde::de::Error;
9756                    use std::option::Option::Some;
9757                    let mut result = Self::Value::new();
9758                    while let Some(tag) = map.next_key::<__FieldTag>()? {
9759                        #[allow(clippy::match_single_binding)]
9760                        match tag {
9761                            __FieldTag::Unknown(key) => {
9762                                let value = map.next_value::<serde_json::Value>()?;
9763                                result._unknown_fields.insert(key, value);
9764                            }
9765                        }
9766                    }
9767                    std::result::Result::Ok(result)
9768                }
9769            }
9770            deserializer.deserialize_any(Visitor)
9771        }
9772    }
9773
9774    #[doc(hidden)]
9775    impl serde::ser::Serialize for H264ColorFormatSDR {
9776        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9777        where
9778            S: serde::ser::Serializer,
9779        {
9780            use serde::ser::SerializeMap;
9781            #[allow(unused_imports)]
9782            use std::option::Option::Some;
9783            let mut state = serializer.serialize_map(std::option::Option::None)?;
9784            if !self._unknown_fields.is_empty() {
9785                for (key, value) in self._unknown_fields.iter() {
9786                    state.serialize_entry(key, &value)?;
9787                }
9788            }
9789            state.end()
9790        }
9791    }
9792
9793    impl std::fmt::Debug for H264ColorFormatSDR {
9794        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9795            let mut debug_struct = f.debug_struct("H264ColorFormatSDR");
9796            if !self._unknown_fields.is_empty() {
9797                debug_struct.field("_unknown_fields", &self._unknown_fields);
9798            }
9799            debug_struct.finish()
9800        }
9801    }
9802
9803    /// Convert the input video to a Hybrid Log Gamma (HLG) video.
9804    #[derive(Clone, Default, PartialEq)]
9805    #[non_exhaustive]
9806    pub struct H264ColorFormatHLG {
9807        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9808    }
9809
9810    impl H264ColorFormatHLG {
9811        pub fn new() -> Self {
9812            std::default::Default::default()
9813        }
9814    }
9815
9816    impl wkt::message::Message for H264ColorFormatHLG {
9817        fn typename() -> &'static str {
9818            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H264ColorFormatHLG"
9819        }
9820    }
9821
9822    #[doc(hidden)]
9823    impl<'de> serde::de::Deserialize<'de> for H264ColorFormatHLG {
9824        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9825        where
9826            D: serde::Deserializer<'de>,
9827        {
9828            #[allow(non_camel_case_types)]
9829            #[doc(hidden)]
9830            #[derive(PartialEq, Eq, Hash)]
9831            enum __FieldTag {
9832                Unknown(std::string::String),
9833            }
9834            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9835                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9836                where
9837                    D: serde::Deserializer<'de>,
9838                {
9839                    struct Visitor;
9840                    impl<'de> serde::de::Visitor<'de> for Visitor {
9841                        type Value = __FieldTag;
9842                        fn expecting(
9843                            &self,
9844                            formatter: &mut std::fmt::Formatter,
9845                        ) -> std::fmt::Result {
9846                            formatter.write_str("a field name for H264ColorFormatHLG")
9847                        }
9848                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9849                        where
9850                            E: serde::de::Error,
9851                        {
9852                            use std::result::Result::Ok;
9853                            use std::string::ToString;
9854                            Ok(__FieldTag::Unknown(value.to_string()))
9855                        }
9856                    }
9857                    deserializer.deserialize_identifier(Visitor)
9858                }
9859            }
9860            struct Visitor;
9861            impl<'de> serde::de::Visitor<'de> for Visitor {
9862                type Value = H264ColorFormatHLG;
9863                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9864                    formatter.write_str("struct H264ColorFormatHLG")
9865                }
9866                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9867                where
9868                    A: serde::de::MapAccess<'de>,
9869                {
9870                    #[allow(unused_imports)]
9871                    use serde::de::Error;
9872                    use std::option::Option::Some;
9873                    let mut result = Self::Value::new();
9874                    while let Some(tag) = map.next_key::<__FieldTag>()? {
9875                        #[allow(clippy::match_single_binding)]
9876                        match tag {
9877                            __FieldTag::Unknown(key) => {
9878                                let value = map.next_value::<serde_json::Value>()?;
9879                                result._unknown_fields.insert(key, value);
9880                            }
9881                        }
9882                    }
9883                    std::result::Result::Ok(result)
9884                }
9885            }
9886            deserializer.deserialize_any(Visitor)
9887        }
9888    }
9889
9890    #[doc(hidden)]
9891    impl serde::ser::Serialize for H264ColorFormatHLG {
9892        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9893        where
9894            S: serde::ser::Serializer,
9895        {
9896            use serde::ser::SerializeMap;
9897            #[allow(unused_imports)]
9898            use std::option::Option::Some;
9899            let mut state = serializer.serialize_map(std::option::Option::None)?;
9900            if !self._unknown_fields.is_empty() {
9901                for (key, value) in self._unknown_fields.iter() {
9902                    state.serialize_entry(key, &value)?;
9903                }
9904            }
9905            state.end()
9906        }
9907    }
9908
9909    impl std::fmt::Debug for H264ColorFormatHLG {
9910        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9911            let mut debug_struct = f.debug_struct("H264ColorFormatHLG");
9912            if !self._unknown_fields.is_empty() {
9913                debug_struct.field("_unknown_fields", &self._unknown_fields);
9914            }
9915            debug_struct.finish()
9916        }
9917    }
9918
9919    /// H264 codec settings.
9920    #[derive(Clone, Default, PartialEq)]
9921    #[non_exhaustive]
9922    pub struct H264CodecSettings {
9923        /// The width of the video in pixels. Must be an even integer.
9924        /// When not specified, the width is adjusted to match the specified height
9925        /// and input aspect ratio. If both are omitted, the input width is used.
9926        ///
9927        /// For portrait videos that contain horizontal ASR and rotation metadata,
9928        /// provide the width, in pixels, per the horizontal ASR. The API calculates
9929        /// the height per the horizontal ASR. The API detects any rotation metadata
9930        /// and swaps the requested height and width for the output.
9931        pub width_pixels: i32,
9932
9933        /// The height of the video in pixels. Must be an even integer.
9934        /// When not specified, the height is adjusted to match the specified width
9935        /// and input aspect ratio. If both are omitted, the input height is used.
9936        ///
9937        /// For portrait videos that contain horizontal ASR and rotation metadata,
9938        /// provide the height, in pixels, per the horizontal ASR. The API calculates
9939        /// the width per the horizontal ASR. The API detects any rotation metadata
9940        /// and swaps the requested height and width for the output.
9941        pub height_pixels: i32,
9942
9943        /// Required. The target video frame rate in frames per second (FPS). Must be
9944        /// less than or equal to 120.
9945        pub frame_rate: f64,
9946
9947        /// Optional. Frame rate conversion strategy for desired frame rate. The
9948        /// default is `DOWNSAMPLE`.
9949        pub frame_rate_conversion_strategy: crate::model::video_stream::FrameRateConversionStrategy,
9950
9951        /// Required. The video bitrate in bits per second. The minimum value is
9952        /// 1,000. The maximum value is 800,000,000.
9953        pub bitrate_bps: i32,
9954
9955        /// Pixel format to use. The default is `yuv420p`.
9956        ///
9957        /// Supported pixel formats:
9958        ///
9959        /// - `yuv420p` pixel format
9960        /// - `yuv422p` pixel format
9961        /// - `yuv444p` pixel format
9962        /// - `yuv420p10` 10-bit HDR pixel format
9963        /// - `yuv422p10` 10-bit HDR pixel format
9964        /// - `yuv444p10` 10-bit HDR pixel format
9965        /// - `yuv420p12` 12-bit HDR pixel format
9966        /// - `yuv422p12` 12-bit HDR pixel format
9967        /// - `yuv444p12` 12-bit HDR pixel format
9968        pub pixel_format: std::string::String,
9969
9970        /// Specify the mode. The default is `vbr`.
9971        ///
9972        /// Supported rate control modes:
9973        ///
9974        /// - `vbr` - variable bitrate
9975        /// - `crf` - constant rate factor
9976        pub rate_control_mode: std::string::String,
9977
9978        /// Target CRF level. Must be between 10 and 36, where 10 is the highest
9979        /// quality and 36 is the most efficient compression. The default is 21.
9980        pub crf_level: i32,
9981
9982        /// Specifies whether an open Group of Pictures (GOP) structure should be
9983        /// allowed or not. The default is `false`.
9984        pub allow_open_gop: bool,
9985
9986        /// Use two-pass encoding strategy to achieve better video quality.
9987        /// [H264CodecSettings.rate_control_mode][google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.rate_control_mode]
9988        /// must be `vbr`. The default is `false`.
9989        ///
9990        /// [google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.rate_control_mode]: crate::model::video_stream::H264CodecSettings::rate_control_mode
9991        pub enable_two_pass: bool,
9992
9993        /// Size of the Video Buffering Verifier (VBV) buffer in bits. Must be
9994        /// greater than zero. The default is equal to
9995        /// [H264CodecSettings.bitrate_bps][google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.bitrate_bps].
9996        ///
9997        /// [google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.bitrate_bps]: crate::model::video_stream::H264CodecSettings::bitrate_bps
9998        pub vbv_size_bits: i32,
9999
10000        /// Initial fullness of the Video Buffering Verifier (VBV) buffer in bits.
10001        /// Must be greater than zero. The default is equal to 90% of
10002        /// [H264CodecSettings.vbv_size_bits][google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.vbv_size_bits].
10003        ///
10004        /// [google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.vbv_size_bits]: crate::model::video_stream::H264CodecSettings::vbv_size_bits
10005        pub vbv_fullness_bits: i32,
10006
10007        /// The entropy coder to use. The default is `cabac`.
10008        ///
10009        /// Supported entropy coders:
10010        ///
10011        /// - `cavlc`
10012        /// - `cabac`
10013        pub entropy_coder: std::string::String,
10014
10015        /// Allow B-pyramid for reference frame selection. This may not be supported
10016        /// on all decoders. The default is `false`.
10017        pub b_pyramid: bool,
10018
10019        /// The number of consecutive B-frames. Must be greater than or equal to
10020        /// zero. Must be less than
10021        /// [H264CodecSettings.gop_frame_count][google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.gop_frame_count]
10022        /// if set. The default is 0.
10023        ///
10024        /// [google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.gop_frame_count]: crate::model::video_stream::H264CodecSettings::gop_mode
10025        pub b_frame_count: i32,
10026
10027        /// Specify the intensity of the adaptive quantizer (AQ). Must be between 0
10028        /// and 1, where 0 disables the quantizer and 1 maximizes the quantizer. A
10029        /// higher value equals a lower bitrate but smoother image. The default is 0.
10030        pub aq_strength: f64,
10031
10032        /// Enforces the specified codec profile. The following profiles are
10033        /// supported:
10034        ///
10035        /// * `baseline`
10036        /// * `main`
10037        /// * `high` (default)
10038        ///
10039        /// The available options are
10040        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.264#Tune).
10041        /// Note that certain values for this field may cause the
10042        /// transcoder to override other fields you set in the `H264CodecSettings`
10043        /// message.
10044        pub profile: std::string::String,
10045
10046        /// Enforces the specified codec tune. The available options are
10047        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.264#Tune).
10048        /// Note that certain values for this field may cause the
10049        /// transcoder to override other fields you set in the `H264CodecSettings`
10050        /// message.
10051        pub tune: std::string::String,
10052
10053        /// Enforces the specified codec preset. The default is `veryfast`. The
10054        /// available options are
10055        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.264#Preset).
10056        /// Note that certain values for this field may cause the
10057        /// transcoder to override other fields you set in the `H264CodecSettings`
10058        /// message.
10059        pub preset: std::string::String,
10060
10061        /// GOP mode can be either by frame count or duration.
10062        pub gop_mode:
10063            std::option::Option<crate::model::video_stream::h_264_codec_settings::GopMode>,
10064
10065        /// Color format can be sdr or hlg.
10066        pub color_format:
10067            std::option::Option<crate::model::video_stream::h_264_codec_settings::ColorFormat>,
10068
10069        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10070    }
10071
10072    impl H264CodecSettings {
10073        pub fn new() -> Self {
10074            std::default::Default::default()
10075        }
10076
10077        /// Sets the value of [width_pixels][crate::model::video_stream::H264CodecSettings::width_pixels].
10078        pub fn set_width_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10079            self.width_pixels = v.into();
10080            self
10081        }
10082
10083        /// Sets the value of [height_pixels][crate::model::video_stream::H264CodecSettings::height_pixels].
10084        pub fn set_height_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10085            self.height_pixels = v.into();
10086            self
10087        }
10088
10089        /// Sets the value of [frame_rate][crate::model::video_stream::H264CodecSettings::frame_rate].
10090        pub fn set_frame_rate<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
10091            self.frame_rate = v.into();
10092            self
10093        }
10094
10095        /// Sets the value of [frame_rate_conversion_strategy][crate::model::video_stream::H264CodecSettings::frame_rate_conversion_strategy].
10096        pub fn set_frame_rate_conversion_strategy<
10097            T: std::convert::Into<crate::model::video_stream::FrameRateConversionStrategy>,
10098        >(
10099            mut self,
10100            v: T,
10101        ) -> Self {
10102            self.frame_rate_conversion_strategy = v.into();
10103            self
10104        }
10105
10106        /// Sets the value of [bitrate_bps][crate::model::video_stream::H264CodecSettings::bitrate_bps].
10107        pub fn set_bitrate_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10108            self.bitrate_bps = v.into();
10109            self
10110        }
10111
10112        /// Sets the value of [pixel_format][crate::model::video_stream::H264CodecSettings::pixel_format].
10113        pub fn set_pixel_format<T: std::convert::Into<std::string::String>>(
10114            mut self,
10115            v: T,
10116        ) -> Self {
10117            self.pixel_format = v.into();
10118            self
10119        }
10120
10121        /// Sets the value of [rate_control_mode][crate::model::video_stream::H264CodecSettings::rate_control_mode].
10122        pub fn set_rate_control_mode<T: std::convert::Into<std::string::String>>(
10123            mut self,
10124            v: T,
10125        ) -> Self {
10126            self.rate_control_mode = v.into();
10127            self
10128        }
10129
10130        /// Sets the value of [crf_level][crate::model::video_stream::H264CodecSettings::crf_level].
10131        pub fn set_crf_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10132            self.crf_level = v.into();
10133            self
10134        }
10135
10136        /// Sets the value of [allow_open_gop][crate::model::video_stream::H264CodecSettings::allow_open_gop].
10137        pub fn set_allow_open_gop<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10138            self.allow_open_gop = v.into();
10139            self
10140        }
10141
10142        /// Sets the value of [enable_two_pass][crate::model::video_stream::H264CodecSettings::enable_two_pass].
10143        pub fn set_enable_two_pass<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10144            self.enable_two_pass = v.into();
10145            self
10146        }
10147
10148        /// Sets the value of [vbv_size_bits][crate::model::video_stream::H264CodecSettings::vbv_size_bits].
10149        pub fn set_vbv_size_bits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10150            self.vbv_size_bits = v.into();
10151            self
10152        }
10153
10154        /// Sets the value of [vbv_fullness_bits][crate::model::video_stream::H264CodecSettings::vbv_fullness_bits].
10155        pub fn set_vbv_fullness_bits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10156            self.vbv_fullness_bits = v.into();
10157            self
10158        }
10159
10160        /// Sets the value of [entropy_coder][crate::model::video_stream::H264CodecSettings::entropy_coder].
10161        pub fn set_entropy_coder<T: std::convert::Into<std::string::String>>(
10162            mut self,
10163            v: T,
10164        ) -> Self {
10165            self.entropy_coder = v.into();
10166            self
10167        }
10168
10169        /// Sets the value of [b_pyramid][crate::model::video_stream::H264CodecSettings::b_pyramid].
10170        pub fn set_b_pyramid<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10171            self.b_pyramid = v.into();
10172            self
10173        }
10174
10175        /// Sets the value of [b_frame_count][crate::model::video_stream::H264CodecSettings::b_frame_count].
10176        pub fn set_b_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10177            self.b_frame_count = v.into();
10178            self
10179        }
10180
10181        /// Sets the value of [aq_strength][crate::model::video_stream::H264CodecSettings::aq_strength].
10182        pub fn set_aq_strength<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
10183            self.aq_strength = v.into();
10184            self
10185        }
10186
10187        /// Sets the value of [profile][crate::model::video_stream::H264CodecSettings::profile].
10188        pub fn set_profile<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10189            self.profile = v.into();
10190            self
10191        }
10192
10193        /// Sets the value of [tune][crate::model::video_stream::H264CodecSettings::tune].
10194        pub fn set_tune<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10195            self.tune = v.into();
10196            self
10197        }
10198
10199        /// Sets the value of [preset][crate::model::video_stream::H264CodecSettings::preset].
10200        pub fn set_preset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10201            self.preset = v.into();
10202            self
10203        }
10204
10205        /// Sets the value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode].
10206        ///
10207        /// Note that all the setters affecting `gop_mode` are mutually
10208        /// exclusive.
10209        pub fn set_gop_mode<
10210            T: std::convert::Into<
10211                    std::option::Option<crate::model::video_stream::h_264_codec_settings::GopMode>,
10212                >,
10213        >(
10214            mut self,
10215            v: T,
10216        ) -> Self {
10217            self.gop_mode = v.into();
10218            self
10219        }
10220
10221        /// The value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode]
10222        /// if it holds a `GopFrameCount`, `None` if the field is not set or
10223        /// holds a different branch.
10224        pub fn gop_frame_count(&self) -> std::option::Option<&i32> {
10225            #[allow(unreachable_patterns)]
10226            self.gop_mode.as_ref().and_then(|v| match v {
10227                crate::model::video_stream::h_264_codec_settings::GopMode::GopFrameCount(v) => {
10228                    std::option::Option::Some(v)
10229                }
10230                _ => std::option::Option::None,
10231            })
10232        }
10233
10234        /// Sets the value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode]
10235        /// to hold a `GopFrameCount`.
10236        ///
10237        /// Note that all the setters affecting `gop_mode` are
10238        /// mutually exclusive.
10239        pub fn set_gop_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10240            self.gop_mode = std::option::Option::Some(
10241                crate::model::video_stream::h_264_codec_settings::GopMode::GopFrameCount(v.into()),
10242            );
10243            self
10244        }
10245
10246        /// The value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode]
10247        /// if it holds a `GopDuration`, `None` if the field is not set or
10248        /// holds a different branch.
10249        pub fn gop_duration(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
10250            #[allow(unreachable_patterns)]
10251            self.gop_mode.as_ref().and_then(|v| match v {
10252                crate::model::video_stream::h_264_codec_settings::GopMode::GopDuration(v) => {
10253                    std::option::Option::Some(v)
10254                }
10255                _ => std::option::Option::None,
10256            })
10257        }
10258
10259        /// Sets the value of [gop_mode][crate::model::video_stream::H264CodecSettings::gop_mode]
10260        /// to hold a `GopDuration`.
10261        ///
10262        /// Note that all the setters affecting `gop_mode` are
10263        /// mutually exclusive.
10264        pub fn set_gop_duration<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
10265            mut self,
10266            v: T,
10267        ) -> Self {
10268            self.gop_mode = std::option::Option::Some(
10269                crate::model::video_stream::h_264_codec_settings::GopMode::GopDuration(v.into()),
10270            );
10271            self
10272        }
10273
10274        /// Sets the value of [color_format][crate::model::video_stream::H264CodecSettings::color_format].
10275        ///
10276        /// Note that all the setters affecting `color_format` are mutually
10277        /// exclusive.
10278        pub fn set_color_format<
10279            T: std::convert::Into<
10280                    std::option::Option<
10281                        crate::model::video_stream::h_264_codec_settings::ColorFormat,
10282                    >,
10283                >,
10284        >(
10285            mut self,
10286            v: T,
10287        ) -> Self {
10288            self.color_format = v.into();
10289            self
10290        }
10291
10292        /// The value of [color_format][crate::model::video_stream::H264CodecSettings::color_format]
10293        /// if it holds a `Sdr`, `None` if the field is not set or
10294        /// holds a different branch.
10295        pub fn sdr(
10296            &self,
10297        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H264ColorFormatSDR>>
10298        {
10299            #[allow(unreachable_patterns)]
10300            self.color_format.as_ref().and_then(|v| match v {
10301                crate::model::video_stream::h_264_codec_settings::ColorFormat::Sdr(v) => {
10302                    std::option::Option::Some(v)
10303                }
10304                _ => std::option::Option::None,
10305            })
10306        }
10307
10308        /// Sets the value of [color_format][crate::model::video_stream::H264CodecSettings::color_format]
10309        /// to hold a `Sdr`.
10310        ///
10311        /// Note that all the setters affecting `color_format` are
10312        /// mutually exclusive.
10313        pub fn set_sdr<
10314            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H264ColorFormatSDR>>,
10315        >(
10316            mut self,
10317            v: T,
10318        ) -> Self {
10319            self.color_format = std::option::Option::Some(
10320                crate::model::video_stream::h_264_codec_settings::ColorFormat::Sdr(v.into()),
10321            );
10322            self
10323        }
10324
10325        /// The value of [color_format][crate::model::video_stream::H264CodecSettings::color_format]
10326        /// if it holds a `Hlg`, `None` if the field is not set or
10327        /// holds a different branch.
10328        pub fn hlg(
10329            &self,
10330        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H264ColorFormatHLG>>
10331        {
10332            #[allow(unreachable_patterns)]
10333            self.color_format.as_ref().and_then(|v| match v {
10334                crate::model::video_stream::h_264_codec_settings::ColorFormat::Hlg(v) => {
10335                    std::option::Option::Some(v)
10336                }
10337                _ => std::option::Option::None,
10338            })
10339        }
10340
10341        /// Sets the value of [color_format][crate::model::video_stream::H264CodecSettings::color_format]
10342        /// to hold a `Hlg`.
10343        ///
10344        /// Note that all the setters affecting `color_format` are
10345        /// mutually exclusive.
10346        pub fn set_hlg<
10347            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H264ColorFormatHLG>>,
10348        >(
10349            mut self,
10350            v: T,
10351        ) -> Self {
10352            self.color_format = std::option::Option::Some(
10353                crate::model::video_stream::h_264_codec_settings::ColorFormat::Hlg(v.into()),
10354            );
10355            self
10356        }
10357    }
10358
10359    impl wkt::message::Message for H264CodecSettings {
10360        fn typename() -> &'static str {
10361            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings"
10362        }
10363    }
10364
10365    #[doc(hidden)]
10366    impl<'de> serde::de::Deserialize<'de> for H264CodecSettings {
10367        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10368        where
10369            D: serde::Deserializer<'de>,
10370        {
10371            #[allow(non_camel_case_types)]
10372            #[doc(hidden)]
10373            #[derive(PartialEq, Eq, Hash)]
10374            enum __FieldTag {
10375                __width_pixels,
10376                __height_pixels,
10377                __frame_rate,
10378                __frame_rate_conversion_strategy,
10379                __bitrate_bps,
10380                __pixel_format,
10381                __rate_control_mode,
10382                __crf_level,
10383                __allow_open_gop,
10384                __gop_frame_count,
10385                __gop_duration,
10386                __enable_two_pass,
10387                __vbv_size_bits,
10388                __vbv_fullness_bits,
10389                __entropy_coder,
10390                __b_pyramid,
10391                __b_frame_count,
10392                __aq_strength,
10393                __profile,
10394                __tune,
10395                __preset,
10396                __sdr,
10397                __hlg,
10398                Unknown(std::string::String),
10399            }
10400            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10401                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10402                where
10403                    D: serde::Deserializer<'de>,
10404                {
10405                    struct Visitor;
10406                    impl<'de> serde::de::Visitor<'de> for Visitor {
10407                        type Value = __FieldTag;
10408                        fn expecting(
10409                            &self,
10410                            formatter: &mut std::fmt::Formatter,
10411                        ) -> std::fmt::Result {
10412                            formatter.write_str("a field name for H264CodecSettings")
10413                        }
10414                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10415                        where
10416                            E: serde::de::Error,
10417                        {
10418                            use std::result::Result::Ok;
10419                            use std::string::ToString;
10420                            match value {
10421                                "widthPixels" => Ok(__FieldTag::__width_pixels),
10422                                "width_pixels" => Ok(__FieldTag::__width_pixels),
10423                                "heightPixels" => Ok(__FieldTag::__height_pixels),
10424                                "height_pixels" => Ok(__FieldTag::__height_pixels),
10425                                "frameRate" => Ok(__FieldTag::__frame_rate),
10426                                "frame_rate" => Ok(__FieldTag::__frame_rate),
10427                                "frameRateConversionStrategy" => {
10428                                    Ok(__FieldTag::__frame_rate_conversion_strategy)
10429                                }
10430                                "frame_rate_conversion_strategy" => {
10431                                    Ok(__FieldTag::__frame_rate_conversion_strategy)
10432                                }
10433                                "bitrateBps" => Ok(__FieldTag::__bitrate_bps),
10434                                "bitrate_bps" => Ok(__FieldTag::__bitrate_bps),
10435                                "pixelFormat" => Ok(__FieldTag::__pixel_format),
10436                                "pixel_format" => Ok(__FieldTag::__pixel_format),
10437                                "rateControlMode" => Ok(__FieldTag::__rate_control_mode),
10438                                "rate_control_mode" => Ok(__FieldTag::__rate_control_mode),
10439                                "crfLevel" => Ok(__FieldTag::__crf_level),
10440                                "crf_level" => Ok(__FieldTag::__crf_level),
10441                                "allowOpenGop" => Ok(__FieldTag::__allow_open_gop),
10442                                "allow_open_gop" => Ok(__FieldTag::__allow_open_gop),
10443                                "gopFrameCount" => Ok(__FieldTag::__gop_frame_count),
10444                                "gop_frame_count" => Ok(__FieldTag::__gop_frame_count),
10445                                "gopDuration" => Ok(__FieldTag::__gop_duration),
10446                                "gop_duration" => Ok(__FieldTag::__gop_duration),
10447                                "enableTwoPass" => Ok(__FieldTag::__enable_two_pass),
10448                                "enable_two_pass" => Ok(__FieldTag::__enable_two_pass),
10449                                "vbvSizeBits" => Ok(__FieldTag::__vbv_size_bits),
10450                                "vbv_size_bits" => Ok(__FieldTag::__vbv_size_bits),
10451                                "vbvFullnessBits" => Ok(__FieldTag::__vbv_fullness_bits),
10452                                "vbv_fullness_bits" => Ok(__FieldTag::__vbv_fullness_bits),
10453                                "entropyCoder" => Ok(__FieldTag::__entropy_coder),
10454                                "entropy_coder" => Ok(__FieldTag::__entropy_coder),
10455                                "bPyramid" => Ok(__FieldTag::__b_pyramid),
10456                                "b_pyramid" => Ok(__FieldTag::__b_pyramid),
10457                                "bFrameCount" => Ok(__FieldTag::__b_frame_count),
10458                                "b_frame_count" => Ok(__FieldTag::__b_frame_count),
10459                                "aqStrength" => Ok(__FieldTag::__aq_strength),
10460                                "aq_strength" => Ok(__FieldTag::__aq_strength),
10461                                "profile" => Ok(__FieldTag::__profile),
10462                                "tune" => Ok(__FieldTag::__tune),
10463                                "preset" => Ok(__FieldTag::__preset),
10464                                "sdr" => Ok(__FieldTag::__sdr),
10465                                "hlg" => Ok(__FieldTag::__hlg),
10466                                _ => Ok(__FieldTag::Unknown(value.to_string())),
10467                            }
10468                        }
10469                    }
10470                    deserializer.deserialize_identifier(Visitor)
10471                }
10472            }
10473            struct Visitor;
10474            impl<'de> serde::de::Visitor<'de> for Visitor {
10475                type Value = H264CodecSettings;
10476                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10477                    formatter.write_str("struct H264CodecSettings")
10478                }
10479                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10480                where
10481                    A: serde::de::MapAccess<'de>,
10482                {
10483                    #[allow(unused_imports)]
10484                    use serde::de::Error;
10485                    use std::option::Option::Some;
10486                    let mut fields = std::collections::HashSet::new();
10487                    let mut result = Self::Value::new();
10488                    while let Some(tag) = map.next_key::<__FieldTag>()? {
10489                        #[allow(clippy::match_single_binding)]
10490                        match tag {
10491                            __FieldTag::__width_pixels => {
10492                                if !fields.insert(__FieldTag::__width_pixels) {
10493                                    return std::result::Result::Err(A::Error::duplicate_field(
10494                                        "multiple values for width_pixels",
10495                                    ));
10496                                }
10497                                struct __With(std::option::Option<i32>);
10498                                impl<'de> serde::de::Deserialize<'de> for __With {
10499                                    fn deserialize<D>(
10500                                        deserializer: D,
10501                                    ) -> std::result::Result<Self, D::Error>
10502                                    where
10503                                        D: serde::de::Deserializer<'de>,
10504                                    {
10505                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
10506                                    }
10507                                }
10508                                result.width_pixels =
10509                                    map.next_value::<__With>()?.0.unwrap_or_default();
10510                            }
10511                            __FieldTag::__height_pixels => {
10512                                if !fields.insert(__FieldTag::__height_pixels) {
10513                                    return std::result::Result::Err(A::Error::duplicate_field(
10514                                        "multiple values for height_pixels",
10515                                    ));
10516                                }
10517                                struct __With(std::option::Option<i32>);
10518                                impl<'de> serde::de::Deserialize<'de> for __With {
10519                                    fn deserialize<D>(
10520                                        deserializer: D,
10521                                    ) -> std::result::Result<Self, D::Error>
10522                                    where
10523                                        D: serde::de::Deserializer<'de>,
10524                                    {
10525                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
10526                                    }
10527                                }
10528                                result.height_pixels =
10529                                    map.next_value::<__With>()?.0.unwrap_or_default();
10530                            }
10531                            __FieldTag::__frame_rate => {
10532                                if !fields.insert(__FieldTag::__frame_rate) {
10533                                    return std::result::Result::Err(A::Error::duplicate_field(
10534                                        "multiple values for frame_rate",
10535                                    ));
10536                                }
10537                                struct __With(std::option::Option<f64>);
10538                                impl<'de> serde::de::Deserialize<'de> for __With {
10539                                    fn deserialize<D>(
10540                                        deserializer: D,
10541                                    ) -> std::result::Result<Self, D::Error>
10542                                    where
10543                                        D: serde::de::Deserializer<'de>,
10544                                    {
10545                                        serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
10546                                    }
10547                                }
10548                                result.frame_rate =
10549                                    map.next_value::<__With>()?.0.unwrap_or_default();
10550                            }
10551                            __FieldTag::__frame_rate_conversion_strategy => {
10552                                if !fields.insert(__FieldTag::__frame_rate_conversion_strategy) {
10553                                    return std::result::Result::Err(A::Error::duplicate_field(
10554                                        "multiple values for frame_rate_conversion_strategy",
10555                                    ));
10556                                }
10557                                result.frame_rate_conversion_strategy = map
10558                                    .next_value::<std::option::Option<
10559                                        crate::model::video_stream::FrameRateConversionStrategy,
10560                                    >>()?
10561                                    .unwrap_or_default();
10562                            }
10563                            __FieldTag::__bitrate_bps => {
10564                                if !fields.insert(__FieldTag::__bitrate_bps) {
10565                                    return std::result::Result::Err(A::Error::duplicate_field(
10566                                        "multiple values for bitrate_bps",
10567                                    ));
10568                                }
10569                                struct __With(std::option::Option<i32>);
10570                                impl<'de> serde::de::Deserialize<'de> for __With {
10571                                    fn deserialize<D>(
10572                                        deserializer: D,
10573                                    ) -> std::result::Result<Self, D::Error>
10574                                    where
10575                                        D: serde::de::Deserializer<'de>,
10576                                    {
10577                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
10578                                    }
10579                                }
10580                                result.bitrate_bps =
10581                                    map.next_value::<__With>()?.0.unwrap_or_default();
10582                            }
10583                            __FieldTag::__pixel_format => {
10584                                if !fields.insert(__FieldTag::__pixel_format) {
10585                                    return std::result::Result::Err(A::Error::duplicate_field(
10586                                        "multiple values for pixel_format",
10587                                    ));
10588                                }
10589                                result.pixel_format = map
10590                                    .next_value::<std::option::Option<std::string::String>>()?
10591                                    .unwrap_or_default();
10592                            }
10593                            __FieldTag::__rate_control_mode => {
10594                                if !fields.insert(__FieldTag::__rate_control_mode) {
10595                                    return std::result::Result::Err(A::Error::duplicate_field(
10596                                        "multiple values for rate_control_mode",
10597                                    ));
10598                                }
10599                                result.rate_control_mode = map
10600                                    .next_value::<std::option::Option<std::string::String>>()?
10601                                    .unwrap_or_default();
10602                            }
10603                            __FieldTag::__crf_level => {
10604                                if !fields.insert(__FieldTag::__crf_level) {
10605                                    return std::result::Result::Err(A::Error::duplicate_field(
10606                                        "multiple values for crf_level",
10607                                    ));
10608                                }
10609                                struct __With(std::option::Option<i32>);
10610                                impl<'de> serde::de::Deserialize<'de> for __With {
10611                                    fn deserialize<D>(
10612                                        deserializer: D,
10613                                    ) -> std::result::Result<Self, D::Error>
10614                                    where
10615                                        D: serde::de::Deserializer<'de>,
10616                                    {
10617                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
10618                                    }
10619                                }
10620                                result.crf_level =
10621                                    map.next_value::<__With>()?.0.unwrap_or_default();
10622                            }
10623                            __FieldTag::__allow_open_gop => {
10624                                if !fields.insert(__FieldTag::__allow_open_gop) {
10625                                    return std::result::Result::Err(A::Error::duplicate_field(
10626                                        "multiple values for allow_open_gop",
10627                                    ));
10628                                }
10629                                result.allow_open_gop = map
10630                                    .next_value::<std::option::Option<bool>>()?
10631                                    .unwrap_or_default();
10632                            }
10633                            __FieldTag::__gop_frame_count => {
10634                                if !fields.insert(__FieldTag::__gop_frame_count) {
10635                                    return std::result::Result::Err(A::Error::duplicate_field(
10636                                        "multiple values for gop_frame_count",
10637                                    ));
10638                                }
10639                                struct __With(std::option::Option<i32>);
10640                                impl<'de> serde::de::Deserialize<'de> for __With {
10641                                    fn deserialize<D>(
10642                                        deserializer: D,
10643                                    ) -> std::result::Result<Self, D::Error>
10644                                    where
10645                                        D: serde::de::Deserializer<'de>,
10646                                    {
10647                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
10648                                    }
10649                                }
10650                                if result.gop_mode.is_some() {
10651                                    return std::result::Result::Err(A::Error::duplicate_field(
10652                                        "multiple values for `gop_mode`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.gop_frame_count, latest field was gopFrameCount",
10653                                    ));
10654                                }
10655                                result.gop_mode = std::option::Option::Some(
10656                                    crate::model::video_stream::h_264_codec_settings::GopMode::GopFrameCount(
10657                                        map.next_value::<__With>()?.0.unwrap_or_default()
10658                                    ),
10659                                );
10660                            }
10661                            __FieldTag::__gop_duration => {
10662                                if !fields.insert(__FieldTag::__gop_duration) {
10663                                    return std::result::Result::Err(A::Error::duplicate_field(
10664                                        "multiple values for gop_duration",
10665                                    ));
10666                                }
10667                                if result.gop_mode.is_some() {
10668                                    return std::result::Result::Err(A::Error::duplicate_field(
10669                                        "multiple values for `gop_mode`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.gop_duration, latest field was gopDuration",
10670                                    ));
10671                                }
10672                                result.gop_mode = std::option::Option::Some(
10673                                    crate::model::video_stream::h_264_codec_settings::GopMode::GopDuration(
10674                                        map.next_value::<std::option::Option<std::boxed::Box<wkt::Duration>>>()?.unwrap_or_default()
10675                                    ),
10676                                );
10677                            }
10678                            __FieldTag::__enable_two_pass => {
10679                                if !fields.insert(__FieldTag::__enable_two_pass) {
10680                                    return std::result::Result::Err(A::Error::duplicate_field(
10681                                        "multiple values for enable_two_pass",
10682                                    ));
10683                                }
10684                                result.enable_two_pass = map
10685                                    .next_value::<std::option::Option<bool>>()?
10686                                    .unwrap_or_default();
10687                            }
10688                            __FieldTag::__vbv_size_bits => {
10689                                if !fields.insert(__FieldTag::__vbv_size_bits) {
10690                                    return std::result::Result::Err(A::Error::duplicate_field(
10691                                        "multiple values for vbv_size_bits",
10692                                    ));
10693                                }
10694                                struct __With(std::option::Option<i32>);
10695                                impl<'de> serde::de::Deserialize<'de> for __With {
10696                                    fn deserialize<D>(
10697                                        deserializer: D,
10698                                    ) -> std::result::Result<Self, D::Error>
10699                                    where
10700                                        D: serde::de::Deserializer<'de>,
10701                                    {
10702                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
10703                                    }
10704                                }
10705                                result.vbv_size_bits =
10706                                    map.next_value::<__With>()?.0.unwrap_or_default();
10707                            }
10708                            __FieldTag::__vbv_fullness_bits => {
10709                                if !fields.insert(__FieldTag::__vbv_fullness_bits) {
10710                                    return std::result::Result::Err(A::Error::duplicate_field(
10711                                        "multiple values for vbv_fullness_bits",
10712                                    ));
10713                                }
10714                                struct __With(std::option::Option<i32>);
10715                                impl<'de> serde::de::Deserialize<'de> for __With {
10716                                    fn deserialize<D>(
10717                                        deserializer: D,
10718                                    ) -> std::result::Result<Self, D::Error>
10719                                    where
10720                                        D: serde::de::Deserializer<'de>,
10721                                    {
10722                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
10723                                    }
10724                                }
10725                                result.vbv_fullness_bits =
10726                                    map.next_value::<__With>()?.0.unwrap_or_default();
10727                            }
10728                            __FieldTag::__entropy_coder => {
10729                                if !fields.insert(__FieldTag::__entropy_coder) {
10730                                    return std::result::Result::Err(A::Error::duplicate_field(
10731                                        "multiple values for entropy_coder",
10732                                    ));
10733                                }
10734                                result.entropy_coder = map
10735                                    .next_value::<std::option::Option<std::string::String>>()?
10736                                    .unwrap_or_default();
10737                            }
10738                            __FieldTag::__b_pyramid => {
10739                                if !fields.insert(__FieldTag::__b_pyramid) {
10740                                    return std::result::Result::Err(A::Error::duplicate_field(
10741                                        "multiple values for b_pyramid",
10742                                    ));
10743                                }
10744                                result.b_pyramid = map
10745                                    .next_value::<std::option::Option<bool>>()?
10746                                    .unwrap_or_default();
10747                            }
10748                            __FieldTag::__b_frame_count => {
10749                                if !fields.insert(__FieldTag::__b_frame_count) {
10750                                    return std::result::Result::Err(A::Error::duplicate_field(
10751                                        "multiple values for b_frame_count",
10752                                    ));
10753                                }
10754                                struct __With(std::option::Option<i32>);
10755                                impl<'de> serde::de::Deserialize<'de> for __With {
10756                                    fn deserialize<D>(
10757                                        deserializer: D,
10758                                    ) -> std::result::Result<Self, D::Error>
10759                                    where
10760                                        D: serde::de::Deserializer<'de>,
10761                                    {
10762                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
10763                                    }
10764                                }
10765                                result.b_frame_count =
10766                                    map.next_value::<__With>()?.0.unwrap_or_default();
10767                            }
10768                            __FieldTag::__aq_strength => {
10769                                if !fields.insert(__FieldTag::__aq_strength) {
10770                                    return std::result::Result::Err(A::Error::duplicate_field(
10771                                        "multiple values for aq_strength",
10772                                    ));
10773                                }
10774                                struct __With(std::option::Option<f64>);
10775                                impl<'de> serde::de::Deserialize<'de> for __With {
10776                                    fn deserialize<D>(
10777                                        deserializer: D,
10778                                    ) -> std::result::Result<Self, D::Error>
10779                                    where
10780                                        D: serde::de::Deserializer<'de>,
10781                                    {
10782                                        serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
10783                                    }
10784                                }
10785                                result.aq_strength =
10786                                    map.next_value::<__With>()?.0.unwrap_or_default();
10787                            }
10788                            __FieldTag::__profile => {
10789                                if !fields.insert(__FieldTag::__profile) {
10790                                    return std::result::Result::Err(A::Error::duplicate_field(
10791                                        "multiple values for profile",
10792                                    ));
10793                                }
10794                                result.profile = map
10795                                    .next_value::<std::option::Option<std::string::String>>()?
10796                                    .unwrap_or_default();
10797                            }
10798                            __FieldTag::__tune => {
10799                                if !fields.insert(__FieldTag::__tune) {
10800                                    return std::result::Result::Err(A::Error::duplicate_field(
10801                                        "multiple values for tune",
10802                                    ));
10803                                }
10804                                result.tune = map
10805                                    .next_value::<std::option::Option<std::string::String>>()?
10806                                    .unwrap_or_default();
10807                            }
10808                            __FieldTag::__preset => {
10809                                if !fields.insert(__FieldTag::__preset) {
10810                                    return std::result::Result::Err(A::Error::duplicate_field(
10811                                        "multiple values for preset",
10812                                    ));
10813                                }
10814                                result.preset = map
10815                                    .next_value::<std::option::Option<std::string::String>>()?
10816                                    .unwrap_or_default();
10817                            }
10818                            __FieldTag::__sdr => {
10819                                if !fields.insert(__FieldTag::__sdr) {
10820                                    return std::result::Result::Err(A::Error::duplicate_field(
10821                                        "multiple values for sdr",
10822                                    ));
10823                                }
10824                                if result.color_format.is_some() {
10825                                    return std::result::Result::Err(A::Error::duplicate_field(
10826                                        "multiple values for `color_format`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.sdr, latest field was sdr",
10827                                    ));
10828                                }
10829                                result.color_format = std::option::Option::Some(
10830                                    crate::model::video_stream::h_264_codec_settings::ColorFormat::Sdr(
10831                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::video_stream::H264ColorFormatSDR>>>()?.unwrap_or_default()
10832                                    ),
10833                                );
10834                            }
10835                            __FieldTag::__hlg => {
10836                                if !fields.insert(__FieldTag::__hlg) {
10837                                    return std::result::Result::Err(A::Error::duplicate_field(
10838                                        "multiple values for hlg",
10839                                    ));
10840                                }
10841                                if result.color_format.is_some() {
10842                                    return std::result::Result::Err(A::Error::duplicate_field(
10843                                        "multiple values for `color_format`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings.hlg, latest field was hlg",
10844                                    ));
10845                                }
10846                                result.color_format = std::option::Option::Some(
10847                                    crate::model::video_stream::h_264_codec_settings::ColorFormat::Hlg(
10848                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::video_stream::H264ColorFormatHLG>>>()?.unwrap_or_default()
10849                                    ),
10850                                );
10851                            }
10852                            __FieldTag::Unknown(key) => {
10853                                let value = map.next_value::<serde_json::Value>()?;
10854                                result._unknown_fields.insert(key, value);
10855                            }
10856                        }
10857                    }
10858                    std::result::Result::Ok(result)
10859                }
10860            }
10861            deserializer.deserialize_any(Visitor)
10862        }
10863    }
10864
10865    #[doc(hidden)]
10866    impl serde::ser::Serialize for H264CodecSettings {
10867        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10868        where
10869            S: serde::ser::Serializer,
10870        {
10871            use serde::ser::SerializeMap;
10872            #[allow(unused_imports)]
10873            use std::option::Option::Some;
10874            let mut state = serializer.serialize_map(std::option::Option::None)?;
10875            if !wkt::internal::is_default(&self.width_pixels) {
10876                struct __With<'a>(&'a i32);
10877                impl<'a> serde::ser::Serialize for __With<'a> {
10878                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10879                    where
10880                        S: serde::ser::Serializer,
10881                    {
10882                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
10883                    }
10884                }
10885                state.serialize_entry("widthPixels", &__With(&self.width_pixels))?;
10886            }
10887            if !wkt::internal::is_default(&self.height_pixels) {
10888                struct __With<'a>(&'a i32);
10889                impl<'a> serde::ser::Serialize for __With<'a> {
10890                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10891                    where
10892                        S: serde::ser::Serializer,
10893                    {
10894                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
10895                    }
10896                }
10897                state.serialize_entry("heightPixels", &__With(&self.height_pixels))?;
10898            }
10899            if !wkt::internal::is_default(&self.frame_rate) {
10900                struct __With<'a>(&'a f64);
10901                impl<'a> serde::ser::Serialize for __With<'a> {
10902                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10903                    where
10904                        S: serde::ser::Serializer,
10905                    {
10906                        serde_with::As::<wkt::internal::F64>::serialize(self.0, serializer)
10907                    }
10908                }
10909                state.serialize_entry("frameRate", &__With(&self.frame_rate))?;
10910            }
10911            if !wkt::internal::is_default(&self.frame_rate_conversion_strategy) {
10912                state.serialize_entry(
10913                    "frameRateConversionStrategy",
10914                    &self.frame_rate_conversion_strategy,
10915                )?;
10916            }
10917            if !wkt::internal::is_default(&self.bitrate_bps) {
10918                struct __With<'a>(&'a i32);
10919                impl<'a> serde::ser::Serialize for __With<'a> {
10920                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10921                    where
10922                        S: serde::ser::Serializer,
10923                    {
10924                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
10925                    }
10926                }
10927                state.serialize_entry("bitrateBps", &__With(&self.bitrate_bps))?;
10928            }
10929            if !self.pixel_format.is_empty() {
10930                state.serialize_entry("pixelFormat", &self.pixel_format)?;
10931            }
10932            if !self.rate_control_mode.is_empty() {
10933                state.serialize_entry("rateControlMode", &self.rate_control_mode)?;
10934            }
10935            if !wkt::internal::is_default(&self.crf_level) {
10936                struct __With<'a>(&'a i32);
10937                impl<'a> serde::ser::Serialize for __With<'a> {
10938                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10939                    where
10940                        S: serde::ser::Serializer,
10941                    {
10942                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
10943                    }
10944                }
10945                state.serialize_entry("crfLevel", &__With(&self.crf_level))?;
10946            }
10947            if !wkt::internal::is_default(&self.allow_open_gop) {
10948                state.serialize_entry("allowOpenGop", &self.allow_open_gop)?;
10949            }
10950            if let Some(value) = self.gop_frame_count() {
10951                struct __With<'a>(&'a i32);
10952                impl<'a> serde::ser::Serialize for __With<'a> {
10953                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10954                    where
10955                        S: serde::ser::Serializer,
10956                    {
10957                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
10958                    }
10959                }
10960                state.serialize_entry("gopFrameCount", &__With(value))?;
10961            }
10962            if let Some(value) = self.gop_duration() {
10963                state.serialize_entry("gopDuration", value)?;
10964            }
10965            if !wkt::internal::is_default(&self.enable_two_pass) {
10966                state.serialize_entry("enableTwoPass", &self.enable_two_pass)?;
10967            }
10968            if !wkt::internal::is_default(&self.vbv_size_bits) {
10969                struct __With<'a>(&'a i32);
10970                impl<'a> serde::ser::Serialize for __With<'a> {
10971                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10972                    where
10973                        S: serde::ser::Serializer,
10974                    {
10975                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
10976                    }
10977                }
10978                state.serialize_entry("vbvSizeBits", &__With(&self.vbv_size_bits))?;
10979            }
10980            if !wkt::internal::is_default(&self.vbv_fullness_bits) {
10981                struct __With<'a>(&'a i32);
10982                impl<'a> serde::ser::Serialize for __With<'a> {
10983                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10984                    where
10985                        S: serde::ser::Serializer,
10986                    {
10987                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
10988                    }
10989                }
10990                state.serialize_entry("vbvFullnessBits", &__With(&self.vbv_fullness_bits))?;
10991            }
10992            if !self.entropy_coder.is_empty() {
10993                state.serialize_entry("entropyCoder", &self.entropy_coder)?;
10994            }
10995            if !wkt::internal::is_default(&self.b_pyramid) {
10996                state.serialize_entry("bPyramid", &self.b_pyramid)?;
10997            }
10998            if !wkt::internal::is_default(&self.b_frame_count) {
10999                struct __With<'a>(&'a i32);
11000                impl<'a> serde::ser::Serialize for __With<'a> {
11001                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11002                    where
11003                        S: serde::ser::Serializer,
11004                    {
11005                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
11006                    }
11007                }
11008                state.serialize_entry("bFrameCount", &__With(&self.b_frame_count))?;
11009            }
11010            if !wkt::internal::is_default(&self.aq_strength) {
11011                struct __With<'a>(&'a f64);
11012                impl<'a> serde::ser::Serialize for __With<'a> {
11013                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11014                    where
11015                        S: serde::ser::Serializer,
11016                    {
11017                        serde_with::As::<wkt::internal::F64>::serialize(self.0, serializer)
11018                    }
11019                }
11020                state.serialize_entry("aqStrength", &__With(&self.aq_strength))?;
11021            }
11022            if !self.profile.is_empty() {
11023                state.serialize_entry("profile", &self.profile)?;
11024            }
11025            if !self.tune.is_empty() {
11026                state.serialize_entry("tune", &self.tune)?;
11027            }
11028            if !self.preset.is_empty() {
11029                state.serialize_entry("preset", &self.preset)?;
11030            }
11031            if let Some(value) = self.sdr() {
11032                state.serialize_entry("sdr", value)?;
11033            }
11034            if let Some(value) = self.hlg() {
11035                state.serialize_entry("hlg", value)?;
11036            }
11037            if !self._unknown_fields.is_empty() {
11038                for (key, value) in self._unknown_fields.iter() {
11039                    state.serialize_entry(key, &value)?;
11040                }
11041            }
11042            state.end()
11043        }
11044    }
11045
11046    impl std::fmt::Debug for H264CodecSettings {
11047        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11048            let mut debug_struct = f.debug_struct("H264CodecSettings");
11049            debug_struct.field("width_pixels", &self.width_pixels);
11050            debug_struct.field("height_pixels", &self.height_pixels);
11051            debug_struct.field("frame_rate", &self.frame_rate);
11052            debug_struct.field(
11053                "frame_rate_conversion_strategy",
11054                &self.frame_rate_conversion_strategy,
11055            );
11056            debug_struct.field("bitrate_bps", &self.bitrate_bps);
11057            debug_struct.field("pixel_format", &self.pixel_format);
11058            debug_struct.field("rate_control_mode", &self.rate_control_mode);
11059            debug_struct.field("crf_level", &self.crf_level);
11060            debug_struct.field("allow_open_gop", &self.allow_open_gop);
11061            debug_struct.field("enable_two_pass", &self.enable_two_pass);
11062            debug_struct.field("vbv_size_bits", &self.vbv_size_bits);
11063            debug_struct.field("vbv_fullness_bits", &self.vbv_fullness_bits);
11064            debug_struct.field("entropy_coder", &self.entropy_coder);
11065            debug_struct.field("b_pyramid", &self.b_pyramid);
11066            debug_struct.field("b_frame_count", &self.b_frame_count);
11067            debug_struct.field("aq_strength", &self.aq_strength);
11068            debug_struct.field("profile", &self.profile);
11069            debug_struct.field("tune", &self.tune);
11070            debug_struct.field("preset", &self.preset);
11071            debug_struct.field("gop_mode", &self.gop_mode);
11072            debug_struct.field("color_format", &self.color_format);
11073            if !self._unknown_fields.is_empty() {
11074                debug_struct.field("_unknown_fields", &self._unknown_fields);
11075            }
11076            debug_struct.finish()
11077        }
11078    }
11079
11080    /// Defines additional types related to [H264CodecSettings].
11081    pub mod h_264_codec_settings {
11082        #[allow(unused_imports)]
11083        use super::*;
11084
11085        /// GOP mode can be either by frame count or duration.
11086        #[derive(Clone, Debug, PartialEq)]
11087        #[non_exhaustive]
11088        pub enum GopMode {
11089            /// Select the GOP size based on the specified frame count. Must be greater
11090            /// than zero.
11091            GopFrameCount(i32),
11092            /// Select the GOP size based on the specified duration. The default is
11093            /// `3s`. Note that `gopDuration` must be less than or equal to
11094            /// [`segmentDuration`](#SegmentSettings), and
11095            /// [`segmentDuration`](#SegmentSettings) must be divisible by
11096            /// `gopDuration`.
11097            GopDuration(std::boxed::Box<wkt::Duration>),
11098        }
11099
11100        /// Color format can be sdr or hlg.
11101        #[derive(Clone, Debug, PartialEq)]
11102        #[non_exhaustive]
11103        pub enum ColorFormat {
11104            /// Optional. SDR color format setting for H264.
11105            Sdr(std::boxed::Box<crate::model::video_stream::H264ColorFormatSDR>),
11106            /// Optional. HLG color format setting for H264.
11107            Hlg(std::boxed::Box<crate::model::video_stream::H264ColorFormatHLG>),
11108        }
11109    }
11110
11111    /// Convert the input video to a Standard Dynamic Range (SDR) video.
11112    #[derive(Clone, Default, PartialEq)]
11113    #[non_exhaustive]
11114    pub struct H265ColorFormatSDR {
11115        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11116    }
11117
11118    impl H265ColorFormatSDR {
11119        pub fn new() -> Self {
11120            std::default::Default::default()
11121        }
11122    }
11123
11124    impl wkt::message::Message for H265ColorFormatSDR {
11125        fn typename() -> &'static str {
11126            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H265ColorFormatSDR"
11127        }
11128    }
11129
11130    #[doc(hidden)]
11131    impl<'de> serde::de::Deserialize<'de> for H265ColorFormatSDR {
11132        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11133        where
11134            D: serde::Deserializer<'de>,
11135        {
11136            #[allow(non_camel_case_types)]
11137            #[doc(hidden)]
11138            #[derive(PartialEq, Eq, Hash)]
11139            enum __FieldTag {
11140                Unknown(std::string::String),
11141            }
11142            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11143                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11144                where
11145                    D: serde::Deserializer<'de>,
11146                {
11147                    struct Visitor;
11148                    impl<'de> serde::de::Visitor<'de> for Visitor {
11149                        type Value = __FieldTag;
11150                        fn expecting(
11151                            &self,
11152                            formatter: &mut std::fmt::Formatter,
11153                        ) -> std::fmt::Result {
11154                            formatter.write_str("a field name for H265ColorFormatSDR")
11155                        }
11156                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11157                        where
11158                            E: serde::de::Error,
11159                        {
11160                            use std::result::Result::Ok;
11161                            use std::string::ToString;
11162                            Ok(__FieldTag::Unknown(value.to_string()))
11163                        }
11164                    }
11165                    deserializer.deserialize_identifier(Visitor)
11166                }
11167            }
11168            struct Visitor;
11169            impl<'de> serde::de::Visitor<'de> for Visitor {
11170                type Value = H265ColorFormatSDR;
11171                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11172                    formatter.write_str("struct H265ColorFormatSDR")
11173                }
11174                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11175                where
11176                    A: serde::de::MapAccess<'de>,
11177                {
11178                    #[allow(unused_imports)]
11179                    use serde::de::Error;
11180                    use std::option::Option::Some;
11181                    let mut result = Self::Value::new();
11182                    while let Some(tag) = map.next_key::<__FieldTag>()? {
11183                        #[allow(clippy::match_single_binding)]
11184                        match tag {
11185                            __FieldTag::Unknown(key) => {
11186                                let value = map.next_value::<serde_json::Value>()?;
11187                                result._unknown_fields.insert(key, value);
11188                            }
11189                        }
11190                    }
11191                    std::result::Result::Ok(result)
11192                }
11193            }
11194            deserializer.deserialize_any(Visitor)
11195        }
11196    }
11197
11198    #[doc(hidden)]
11199    impl serde::ser::Serialize for H265ColorFormatSDR {
11200        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11201        where
11202            S: serde::ser::Serializer,
11203        {
11204            use serde::ser::SerializeMap;
11205            #[allow(unused_imports)]
11206            use std::option::Option::Some;
11207            let mut state = serializer.serialize_map(std::option::Option::None)?;
11208            if !self._unknown_fields.is_empty() {
11209                for (key, value) in self._unknown_fields.iter() {
11210                    state.serialize_entry(key, &value)?;
11211                }
11212            }
11213            state.end()
11214        }
11215    }
11216
11217    impl std::fmt::Debug for H265ColorFormatSDR {
11218        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11219            let mut debug_struct = f.debug_struct("H265ColorFormatSDR");
11220            if !self._unknown_fields.is_empty() {
11221                debug_struct.field("_unknown_fields", &self._unknown_fields);
11222            }
11223            debug_struct.finish()
11224        }
11225    }
11226
11227    /// Convert the input video to a Hybrid Log Gamma (HLG) video.
11228    #[derive(Clone, Default, PartialEq)]
11229    #[non_exhaustive]
11230    pub struct H265ColorFormatHLG {
11231        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11232    }
11233
11234    impl H265ColorFormatHLG {
11235        pub fn new() -> Self {
11236            std::default::Default::default()
11237        }
11238    }
11239
11240    impl wkt::message::Message for H265ColorFormatHLG {
11241        fn typename() -> &'static str {
11242            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H265ColorFormatHLG"
11243        }
11244    }
11245
11246    #[doc(hidden)]
11247    impl<'de> serde::de::Deserialize<'de> for H265ColorFormatHLG {
11248        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11249        where
11250            D: serde::Deserializer<'de>,
11251        {
11252            #[allow(non_camel_case_types)]
11253            #[doc(hidden)]
11254            #[derive(PartialEq, Eq, Hash)]
11255            enum __FieldTag {
11256                Unknown(std::string::String),
11257            }
11258            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11259                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11260                where
11261                    D: serde::Deserializer<'de>,
11262                {
11263                    struct Visitor;
11264                    impl<'de> serde::de::Visitor<'de> for Visitor {
11265                        type Value = __FieldTag;
11266                        fn expecting(
11267                            &self,
11268                            formatter: &mut std::fmt::Formatter,
11269                        ) -> std::fmt::Result {
11270                            formatter.write_str("a field name for H265ColorFormatHLG")
11271                        }
11272                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11273                        where
11274                            E: serde::de::Error,
11275                        {
11276                            use std::result::Result::Ok;
11277                            use std::string::ToString;
11278                            Ok(__FieldTag::Unknown(value.to_string()))
11279                        }
11280                    }
11281                    deserializer.deserialize_identifier(Visitor)
11282                }
11283            }
11284            struct Visitor;
11285            impl<'de> serde::de::Visitor<'de> for Visitor {
11286                type Value = H265ColorFormatHLG;
11287                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11288                    formatter.write_str("struct H265ColorFormatHLG")
11289                }
11290                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11291                where
11292                    A: serde::de::MapAccess<'de>,
11293                {
11294                    #[allow(unused_imports)]
11295                    use serde::de::Error;
11296                    use std::option::Option::Some;
11297                    let mut result = Self::Value::new();
11298                    while let Some(tag) = map.next_key::<__FieldTag>()? {
11299                        #[allow(clippy::match_single_binding)]
11300                        match tag {
11301                            __FieldTag::Unknown(key) => {
11302                                let value = map.next_value::<serde_json::Value>()?;
11303                                result._unknown_fields.insert(key, value);
11304                            }
11305                        }
11306                    }
11307                    std::result::Result::Ok(result)
11308                }
11309            }
11310            deserializer.deserialize_any(Visitor)
11311        }
11312    }
11313
11314    #[doc(hidden)]
11315    impl serde::ser::Serialize for H265ColorFormatHLG {
11316        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11317        where
11318            S: serde::ser::Serializer,
11319        {
11320            use serde::ser::SerializeMap;
11321            #[allow(unused_imports)]
11322            use std::option::Option::Some;
11323            let mut state = serializer.serialize_map(std::option::Option::None)?;
11324            if !self._unknown_fields.is_empty() {
11325                for (key, value) in self._unknown_fields.iter() {
11326                    state.serialize_entry(key, &value)?;
11327                }
11328            }
11329            state.end()
11330        }
11331    }
11332
11333    impl std::fmt::Debug for H265ColorFormatHLG {
11334        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11335            let mut debug_struct = f.debug_struct("H265ColorFormatHLG");
11336            if !self._unknown_fields.is_empty() {
11337                debug_struct.field("_unknown_fields", &self._unknown_fields);
11338            }
11339            debug_struct.finish()
11340        }
11341    }
11342
11343    /// Convert the input video to a High Dynamic Range 10 (HDR10) video.
11344    #[derive(Clone, Default, PartialEq)]
11345    #[non_exhaustive]
11346    pub struct H265ColorFormatHDR10 {
11347        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11348    }
11349
11350    impl H265ColorFormatHDR10 {
11351        pub fn new() -> Self {
11352            std::default::Default::default()
11353        }
11354    }
11355
11356    impl wkt::message::Message for H265ColorFormatHDR10 {
11357        fn typename() -> &'static str {
11358            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H265ColorFormatHDR10"
11359        }
11360    }
11361
11362    #[doc(hidden)]
11363    impl<'de> serde::de::Deserialize<'de> for H265ColorFormatHDR10 {
11364        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11365        where
11366            D: serde::Deserializer<'de>,
11367        {
11368            #[allow(non_camel_case_types)]
11369            #[doc(hidden)]
11370            #[derive(PartialEq, Eq, Hash)]
11371            enum __FieldTag {
11372                Unknown(std::string::String),
11373            }
11374            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11375                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11376                where
11377                    D: serde::Deserializer<'de>,
11378                {
11379                    struct Visitor;
11380                    impl<'de> serde::de::Visitor<'de> for Visitor {
11381                        type Value = __FieldTag;
11382                        fn expecting(
11383                            &self,
11384                            formatter: &mut std::fmt::Formatter,
11385                        ) -> std::fmt::Result {
11386                            formatter.write_str("a field name for H265ColorFormatHDR10")
11387                        }
11388                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11389                        where
11390                            E: serde::de::Error,
11391                        {
11392                            use std::result::Result::Ok;
11393                            use std::string::ToString;
11394                            Ok(__FieldTag::Unknown(value.to_string()))
11395                        }
11396                    }
11397                    deserializer.deserialize_identifier(Visitor)
11398                }
11399            }
11400            struct Visitor;
11401            impl<'de> serde::de::Visitor<'de> for Visitor {
11402                type Value = H265ColorFormatHDR10;
11403                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
11404                    formatter.write_str("struct H265ColorFormatHDR10")
11405                }
11406                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
11407                where
11408                    A: serde::de::MapAccess<'de>,
11409                {
11410                    #[allow(unused_imports)]
11411                    use serde::de::Error;
11412                    use std::option::Option::Some;
11413                    let mut result = Self::Value::new();
11414                    while let Some(tag) = map.next_key::<__FieldTag>()? {
11415                        #[allow(clippy::match_single_binding)]
11416                        match tag {
11417                            __FieldTag::Unknown(key) => {
11418                                let value = map.next_value::<serde_json::Value>()?;
11419                                result._unknown_fields.insert(key, value);
11420                            }
11421                        }
11422                    }
11423                    std::result::Result::Ok(result)
11424                }
11425            }
11426            deserializer.deserialize_any(Visitor)
11427        }
11428    }
11429
11430    #[doc(hidden)]
11431    impl serde::ser::Serialize for H265ColorFormatHDR10 {
11432        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11433        where
11434            S: serde::ser::Serializer,
11435        {
11436            use serde::ser::SerializeMap;
11437            #[allow(unused_imports)]
11438            use std::option::Option::Some;
11439            let mut state = serializer.serialize_map(std::option::Option::None)?;
11440            if !self._unknown_fields.is_empty() {
11441                for (key, value) in self._unknown_fields.iter() {
11442                    state.serialize_entry(key, &value)?;
11443                }
11444            }
11445            state.end()
11446        }
11447    }
11448
11449    impl std::fmt::Debug for H265ColorFormatHDR10 {
11450        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11451            let mut debug_struct = f.debug_struct("H265ColorFormatHDR10");
11452            if !self._unknown_fields.is_empty() {
11453                debug_struct.field("_unknown_fields", &self._unknown_fields);
11454            }
11455            debug_struct.finish()
11456        }
11457    }
11458
11459    /// H265 codec settings.
11460    #[derive(Clone, Default, PartialEq)]
11461    #[non_exhaustive]
11462    pub struct H265CodecSettings {
11463        /// The width of the video in pixels. Must be an even integer.
11464        /// When not specified, the width is adjusted to match the specified height
11465        /// and input aspect ratio. If both are omitted, the input width is used.
11466        ///
11467        /// For portrait videos that contain horizontal ASR and rotation metadata,
11468        /// provide the width, in pixels, per the horizontal ASR. The API calculates
11469        /// the height per the horizontal ASR. The API detects any rotation metadata
11470        /// and swaps the requested height and width for the output.
11471        pub width_pixels: i32,
11472
11473        /// The height of the video in pixels. Must be an even integer.
11474        /// When not specified, the height is adjusted to match the specified width
11475        /// and input aspect ratio. If both are omitted, the input height is used.
11476        ///
11477        /// For portrait videos that contain horizontal ASR and rotation metadata,
11478        /// provide the height, in pixels, per the horizontal ASR. The API calculates
11479        /// the width per the horizontal ASR. The API detects any rotation metadata
11480        /// and swaps the requested height and width for the output.
11481        pub height_pixels: i32,
11482
11483        /// Required. The target video frame rate in frames per second (FPS). Must be
11484        /// less than or equal to 120.
11485        pub frame_rate: f64,
11486
11487        /// Optional. Frame rate conversion strategy for desired frame rate. The
11488        /// default is `DOWNSAMPLE`.
11489        pub frame_rate_conversion_strategy: crate::model::video_stream::FrameRateConversionStrategy,
11490
11491        /// Required. The video bitrate in bits per second. The minimum value is
11492        /// 1,000. The maximum value is 800,000,000.
11493        pub bitrate_bps: i32,
11494
11495        /// Pixel format to use. The default is `yuv420p`.
11496        ///
11497        /// Supported pixel formats:
11498        ///
11499        /// - `yuv420p` pixel format
11500        /// - `yuv422p` pixel format
11501        /// - `yuv444p` pixel format
11502        /// - `yuv420p10` 10-bit HDR pixel format
11503        /// - `yuv422p10` 10-bit HDR pixel format
11504        /// - `yuv444p10` 10-bit HDR pixel format
11505        /// - `yuv420p12` 12-bit HDR pixel format
11506        /// - `yuv422p12` 12-bit HDR pixel format
11507        /// - `yuv444p12` 12-bit HDR pixel format
11508        pub pixel_format: std::string::String,
11509
11510        /// Specify the mode. The default is `vbr`.
11511        ///
11512        /// Supported rate control modes:
11513        ///
11514        /// - `vbr` - variable bitrate
11515        /// - `crf` - constant rate factor
11516        pub rate_control_mode: std::string::String,
11517
11518        /// Target CRF level. Must be between 10 and 36, where 10 is the highest
11519        /// quality and 36 is the most efficient compression. The default is 21.
11520        pub crf_level: i32,
11521
11522        /// Specifies whether an open Group of Pictures (GOP) structure should be
11523        /// allowed or not. The default is `false`.
11524        pub allow_open_gop: bool,
11525
11526        /// Use two-pass encoding strategy to achieve better video quality.
11527        /// [H265CodecSettings.rate_control_mode][google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.rate_control_mode]
11528        /// must be `vbr`. The default is `false`.
11529        ///
11530        /// [google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.rate_control_mode]: crate::model::video_stream::H265CodecSettings::rate_control_mode
11531        pub enable_two_pass: bool,
11532
11533        /// Size of the Video Buffering Verifier (VBV) buffer in bits. Must be
11534        /// greater than zero. The default is equal to `VideoStream.bitrate_bps`.
11535        pub vbv_size_bits: i32,
11536
11537        /// Initial fullness of the Video Buffering Verifier (VBV) buffer in bits.
11538        /// Must be greater than zero. The default is equal to 90% of
11539        /// [H265CodecSettings.vbv_size_bits][google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.vbv_size_bits].
11540        ///
11541        /// [google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.vbv_size_bits]: crate::model::video_stream::H265CodecSettings::vbv_size_bits
11542        pub vbv_fullness_bits: i32,
11543
11544        /// Allow B-pyramid for reference frame selection. This may not be supported
11545        /// on all decoders. The default is `false`.
11546        pub b_pyramid: bool,
11547
11548        /// The number of consecutive B-frames. Must be greater than or equal to
11549        /// zero. Must be less than
11550        /// [H265CodecSettings.gop_frame_count][google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.gop_frame_count]
11551        /// if set. The default is 0.
11552        ///
11553        /// [google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.gop_frame_count]: crate::model::video_stream::H265CodecSettings::gop_mode
11554        pub b_frame_count: i32,
11555
11556        /// Specify the intensity of the adaptive quantizer (AQ). Must be between 0
11557        /// and 1, where 0 disables the quantizer and 1 maximizes the quantizer. A
11558        /// higher value equals a lower bitrate but smoother image. The default is 0.
11559        pub aq_strength: f64,
11560
11561        /// Enforces the specified codec profile. The following profiles are
11562        /// supported:
11563        ///
11564        /// * 8-bit profiles
11565        ///   * `main` (default)
11566        ///   * `main-intra`
11567        ///   * `mainstillpicture`
11568        /// * 10-bit profiles
11569        ///   * `main10` (default)
11570        ///   * `main10-intra`
11571        ///   * `main422-10`
11572        ///   * `main422-10-intra`
11573        ///   * `main444-10`
11574        ///   * `main444-10-intra`
11575        /// * 12-bit profiles
11576        ///   * `main12` (default)
11577        ///   * `main12-intra`
11578        ///   * `main422-12`
11579        ///   * `main422-12-intra`
11580        ///   * `main444-12`
11581        ///   * `main444-12-intra`
11582        ///
11583        /// The available options are
11584        /// [FFmpeg-compatible](https://x265.readthedocs.io/).
11585        /// Note that certain values for this field may cause the
11586        /// transcoder to override other fields you set in the `H265CodecSettings`
11587        /// message.
11588        pub profile: std::string::String,
11589
11590        /// Enforces the specified codec tune. The available options are
11591        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.265).
11592        /// Note that certain values for this field may cause the
11593        /// transcoder to override other fields you set in the `H265CodecSettings`
11594        /// message.
11595        pub tune: std::string::String,
11596
11597        /// Enforces the specified codec preset. The default is `veryfast`. The
11598        /// available options are
11599        /// [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.265).
11600        /// Note that certain values for this field may cause the
11601        /// transcoder to override other fields you set in the `H265CodecSettings`
11602        /// message.
11603        pub preset: std::string::String,
11604
11605        /// GOP mode can be either by frame count or duration.
11606        pub gop_mode:
11607            std::option::Option<crate::model::video_stream::h_265_codec_settings::GopMode>,
11608
11609        /// Color format can be sdr, hlg, hdr10.
11610        pub color_format:
11611            std::option::Option<crate::model::video_stream::h_265_codec_settings::ColorFormat>,
11612
11613        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11614    }
11615
11616    impl H265CodecSettings {
11617        pub fn new() -> Self {
11618            std::default::Default::default()
11619        }
11620
11621        /// Sets the value of [width_pixels][crate::model::video_stream::H265CodecSettings::width_pixels].
11622        pub fn set_width_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11623            self.width_pixels = v.into();
11624            self
11625        }
11626
11627        /// Sets the value of [height_pixels][crate::model::video_stream::H265CodecSettings::height_pixels].
11628        pub fn set_height_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11629            self.height_pixels = v.into();
11630            self
11631        }
11632
11633        /// Sets the value of [frame_rate][crate::model::video_stream::H265CodecSettings::frame_rate].
11634        pub fn set_frame_rate<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11635            self.frame_rate = v.into();
11636            self
11637        }
11638
11639        /// Sets the value of [frame_rate_conversion_strategy][crate::model::video_stream::H265CodecSettings::frame_rate_conversion_strategy].
11640        pub fn set_frame_rate_conversion_strategy<
11641            T: std::convert::Into<crate::model::video_stream::FrameRateConversionStrategy>,
11642        >(
11643            mut self,
11644            v: T,
11645        ) -> Self {
11646            self.frame_rate_conversion_strategy = v.into();
11647            self
11648        }
11649
11650        /// Sets the value of [bitrate_bps][crate::model::video_stream::H265CodecSettings::bitrate_bps].
11651        pub fn set_bitrate_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11652            self.bitrate_bps = v.into();
11653            self
11654        }
11655
11656        /// Sets the value of [pixel_format][crate::model::video_stream::H265CodecSettings::pixel_format].
11657        pub fn set_pixel_format<T: std::convert::Into<std::string::String>>(
11658            mut self,
11659            v: T,
11660        ) -> Self {
11661            self.pixel_format = v.into();
11662            self
11663        }
11664
11665        /// Sets the value of [rate_control_mode][crate::model::video_stream::H265CodecSettings::rate_control_mode].
11666        pub fn set_rate_control_mode<T: std::convert::Into<std::string::String>>(
11667            mut self,
11668            v: T,
11669        ) -> Self {
11670            self.rate_control_mode = v.into();
11671            self
11672        }
11673
11674        /// Sets the value of [crf_level][crate::model::video_stream::H265CodecSettings::crf_level].
11675        pub fn set_crf_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11676            self.crf_level = v.into();
11677            self
11678        }
11679
11680        /// Sets the value of [allow_open_gop][crate::model::video_stream::H265CodecSettings::allow_open_gop].
11681        pub fn set_allow_open_gop<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11682            self.allow_open_gop = v.into();
11683            self
11684        }
11685
11686        /// Sets the value of [enable_two_pass][crate::model::video_stream::H265CodecSettings::enable_two_pass].
11687        pub fn set_enable_two_pass<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11688            self.enable_two_pass = v.into();
11689            self
11690        }
11691
11692        /// Sets the value of [vbv_size_bits][crate::model::video_stream::H265CodecSettings::vbv_size_bits].
11693        pub fn set_vbv_size_bits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11694            self.vbv_size_bits = v.into();
11695            self
11696        }
11697
11698        /// Sets the value of [vbv_fullness_bits][crate::model::video_stream::H265CodecSettings::vbv_fullness_bits].
11699        pub fn set_vbv_fullness_bits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11700            self.vbv_fullness_bits = v.into();
11701            self
11702        }
11703
11704        /// Sets the value of [b_pyramid][crate::model::video_stream::H265CodecSettings::b_pyramid].
11705        pub fn set_b_pyramid<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11706            self.b_pyramid = v.into();
11707            self
11708        }
11709
11710        /// Sets the value of [b_frame_count][crate::model::video_stream::H265CodecSettings::b_frame_count].
11711        pub fn set_b_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11712            self.b_frame_count = v.into();
11713            self
11714        }
11715
11716        /// Sets the value of [aq_strength][crate::model::video_stream::H265CodecSettings::aq_strength].
11717        pub fn set_aq_strength<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11718            self.aq_strength = v.into();
11719            self
11720        }
11721
11722        /// Sets the value of [profile][crate::model::video_stream::H265CodecSettings::profile].
11723        pub fn set_profile<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11724            self.profile = v.into();
11725            self
11726        }
11727
11728        /// Sets the value of [tune][crate::model::video_stream::H265CodecSettings::tune].
11729        pub fn set_tune<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11730            self.tune = v.into();
11731            self
11732        }
11733
11734        /// Sets the value of [preset][crate::model::video_stream::H265CodecSettings::preset].
11735        pub fn set_preset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11736            self.preset = v.into();
11737            self
11738        }
11739
11740        /// Sets the value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode].
11741        ///
11742        /// Note that all the setters affecting `gop_mode` are mutually
11743        /// exclusive.
11744        pub fn set_gop_mode<
11745            T: std::convert::Into<
11746                    std::option::Option<crate::model::video_stream::h_265_codec_settings::GopMode>,
11747                >,
11748        >(
11749            mut self,
11750            v: T,
11751        ) -> Self {
11752            self.gop_mode = v.into();
11753            self
11754        }
11755
11756        /// The value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode]
11757        /// if it holds a `GopFrameCount`, `None` if the field is not set or
11758        /// holds a different branch.
11759        pub fn gop_frame_count(&self) -> std::option::Option<&i32> {
11760            #[allow(unreachable_patterns)]
11761            self.gop_mode.as_ref().and_then(|v| match v {
11762                crate::model::video_stream::h_265_codec_settings::GopMode::GopFrameCount(v) => {
11763                    std::option::Option::Some(v)
11764                }
11765                _ => std::option::Option::None,
11766            })
11767        }
11768
11769        /// Sets the value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode]
11770        /// to hold a `GopFrameCount`.
11771        ///
11772        /// Note that all the setters affecting `gop_mode` are
11773        /// mutually exclusive.
11774        pub fn set_gop_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11775            self.gop_mode = std::option::Option::Some(
11776                crate::model::video_stream::h_265_codec_settings::GopMode::GopFrameCount(v.into()),
11777            );
11778            self
11779        }
11780
11781        /// The value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode]
11782        /// if it holds a `GopDuration`, `None` if the field is not set or
11783        /// holds a different branch.
11784        pub fn gop_duration(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
11785            #[allow(unreachable_patterns)]
11786            self.gop_mode.as_ref().and_then(|v| match v {
11787                crate::model::video_stream::h_265_codec_settings::GopMode::GopDuration(v) => {
11788                    std::option::Option::Some(v)
11789                }
11790                _ => std::option::Option::None,
11791            })
11792        }
11793
11794        /// Sets the value of [gop_mode][crate::model::video_stream::H265CodecSettings::gop_mode]
11795        /// to hold a `GopDuration`.
11796        ///
11797        /// Note that all the setters affecting `gop_mode` are
11798        /// mutually exclusive.
11799        pub fn set_gop_duration<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
11800            mut self,
11801            v: T,
11802        ) -> Self {
11803            self.gop_mode = std::option::Option::Some(
11804                crate::model::video_stream::h_265_codec_settings::GopMode::GopDuration(v.into()),
11805            );
11806            self
11807        }
11808
11809        /// Sets the value of [color_format][crate::model::video_stream::H265CodecSettings::color_format].
11810        ///
11811        /// Note that all the setters affecting `color_format` are mutually
11812        /// exclusive.
11813        pub fn set_color_format<
11814            T: std::convert::Into<
11815                    std::option::Option<
11816                        crate::model::video_stream::h_265_codec_settings::ColorFormat,
11817                    >,
11818                >,
11819        >(
11820            mut self,
11821            v: T,
11822        ) -> Self {
11823            self.color_format = v.into();
11824            self
11825        }
11826
11827        /// The value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
11828        /// if it holds a `Sdr`, `None` if the field is not set or
11829        /// holds a different branch.
11830        pub fn sdr(
11831            &self,
11832        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H265ColorFormatSDR>>
11833        {
11834            #[allow(unreachable_patterns)]
11835            self.color_format.as_ref().and_then(|v| match v {
11836                crate::model::video_stream::h_265_codec_settings::ColorFormat::Sdr(v) => {
11837                    std::option::Option::Some(v)
11838                }
11839                _ => std::option::Option::None,
11840            })
11841        }
11842
11843        /// Sets the value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
11844        /// to hold a `Sdr`.
11845        ///
11846        /// Note that all the setters affecting `color_format` are
11847        /// mutually exclusive.
11848        pub fn set_sdr<
11849            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H265ColorFormatSDR>>,
11850        >(
11851            mut self,
11852            v: T,
11853        ) -> Self {
11854            self.color_format = std::option::Option::Some(
11855                crate::model::video_stream::h_265_codec_settings::ColorFormat::Sdr(v.into()),
11856            );
11857            self
11858        }
11859
11860        /// The value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
11861        /// if it holds a `Hlg`, `None` if the field is not set or
11862        /// holds a different branch.
11863        pub fn hlg(
11864            &self,
11865        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H265ColorFormatHLG>>
11866        {
11867            #[allow(unreachable_patterns)]
11868            self.color_format.as_ref().and_then(|v| match v {
11869                crate::model::video_stream::h_265_codec_settings::ColorFormat::Hlg(v) => {
11870                    std::option::Option::Some(v)
11871                }
11872                _ => std::option::Option::None,
11873            })
11874        }
11875
11876        /// Sets the value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
11877        /// to hold a `Hlg`.
11878        ///
11879        /// Note that all the setters affecting `color_format` are
11880        /// mutually exclusive.
11881        pub fn set_hlg<
11882            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H265ColorFormatHLG>>,
11883        >(
11884            mut self,
11885            v: T,
11886        ) -> Self {
11887            self.color_format = std::option::Option::Some(
11888                crate::model::video_stream::h_265_codec_settings::ColorFormat::Hlg(v.into()),
11889            );
11890            self
11891        }
11892
11893        /// The value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
11894        /// if it holds a `Hdr10`, `None` if the field is not set or
11895        /// holds a different branch.
11896        pub fn hdr10(
11897            &self,
11898        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::H265ColorFormatHDR10>>
11899        {
11900            #[allow(unreachable_patterns)]
11901            self.color_format.as_ref().and_then(|v| match v {
11902                crate::model::video_stream::h_265_codec_settings::ColorFormat::Hdr10(v) => {
11903                    std::option::Option::Some(v)
11904                }
11905                _ => std::option::Option::None,
11906            })
11907        }
11908
11909        /// Sets the value of [color_format][crate::model::video_stream::H265CodecSettings::color_format]
11910        /// to hold a `Hdr10`.
11911        ///
11912        /// Note that all the setters affecting `color_format` are
11913        /// mutually exclusive.
11914        pub fn set_hdr10<
11915            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::H265ColorFormatHDR10>>,
11916        >(
11917            mut self,
11918            v: T,
11919        ) -> Self {
11920            self.color_format = std::option::Option::Some(
11921                crate::model::video_stream::h_265_codec_settings::ColorFormat::Hdr10(v.into()),
11922            );
11923            self
11924        }
11925    }
11926
11927    impl wkt::message::Message for H265CodecSettings {
11928        fn typename() -> &'static str {
11929            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings"
11930        }
11931    }
11932
11933    #[doc(hidden)]
11934    impl<'de> serde::de::Deserialize<'de> for H265CodecSettings {
11935        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11936        where
11937            D: serde::Deserializer<'de>,
11938        {
11939            #[allow(non_camel_case_types)]
11940            #[doc(hidden)]
11941            #[derive(PartialEq, Eq, Hash)]
11942            enum __FieldTag {
11943                __width_pixels,
11944                __height_pixels,
11945                __frame_rate,
11946                __frame_rate_conversion_strategy,
11947                __bitrate_bps,
11948                __pixel_format,
11949                __rate_control_mode,
11950                __crf_level,
11951                __allow_open_gop,
11952                __gop_frame_count,
11953                __gop_duration,
11954                __enable_two_pass,
11955                __vbv_size_bits,
11956                __vbv_fullness_bits,
11957                __b_pyramid,
11958                __b_frame_count,
11959                __aq_strength,
11960                __profile,
11961                __tune,
11962                __preset,
11963                __sdr,
11964                __hlg,
11965                __hdr10,
11966                Unknown(std::string::String),
11967            }
11968            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
11969                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11970                where
11971                    D: serde::Deserializer<'de>,
11972                {
11973                    struct Visitor;
11974                    impl<'de> serde::de::Visitor<'de> for Visitor {
11975                        type Value = __FieldTag;
11976                        fn expecting(
11977                            &self,
11978                            formatter: &mut std::fmt::Formatter,
11979                        ) -> std::fmt::Result {
11980                            formatter.write_str("a field name for H265CodecSettings")
11981                        }
11982                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
11983                        where
11984                            E: serde::de::Error,
11985                        {
11986                            use std::result::Result::Ok;
11987                            use std::string::ToString;
11988                            match value {
11989                                "widthPixels" => Ok(__FieldTag::__width_pixels),
11990                                "width_pixels" => Ok(__FieldTag::__width_pixels),
11991                                "heightPixels" => Ok(__FieldTag::__height_pixels),
11992                                "height_pixels" => Ok(__FieldTag::__height_pixels),
11993                                "frameRate" => Ok(__FieldTag::__frame_rate),
11994                                "frame_rate" => Ok(__FieldTag::__frame_rate),
11995                                "frameRateConversionStrategy" => {
11996                                    Ok(__FieldTag::__frame_rate_conversion_strategy)
11997                                }
11998                                "frame_rate_conversion_strategy" => {
11999                                    Ok(__FieldTag::__frame_rate_conversion_strategy)
12000                                }
12001                                "bitrateBps" => Ok(__FieldTag::__bitrate_bps),
12002                                "bitrate_bps" => Ok(__FieldTag::__bitrate_bps),
12003                                "pixelFormat" => Ok(__FieldTag::__pixel_format),
12004                                "pixel_format" => Ok(__FieldTag::__pixel_format),
12005                                "rateControlMode" => Ok(__FieldTag::__rate_control_mode),
12006                                "rate_control_mode" => Ok(__FieldTag::__rate_control_mode),
12007                                "crfLevel" => Ok(__FieldTag::__crf_level),
12008                                "crf_level" => Ok(__FieldTag::__crf_level),
12009                                "allowOpenGop" => Ok(__FieldTag::__allow_open_gop),
12010                                "allow_open_gop" => Ok(__FieldTag::__allow_open_gop),
12011                                "gopFrameCount" => Ok(__FieldTag::__gop_frame_count),
12012                                "gop_frame_count" => Ok(__FieldTag::__gop_frame_count),
12013                                "gopDuration" => Ok(__FieldTag::__gop_duration),
12014                                "gop_duration" => Ok(__FieldTag::__gop_duration),
12015                                "enableTwoPass" => Ok(__FieldTag::__enable_two_pass),
12016                                "enable_two_pass" => Ok(__FieldTag::__enable_two_pass),
12017                                "vbvSizeBits" => Ok(__FieldTag::__vbv_size_bits),
12018                                "vbv_size_bits" => Ok(__FieldTag::__vbv_size_bits),
12019                                "vbvFullnessBits" => Ok(__FieldTag::__vbv_fullness_bits),
12020                                "vbv_fullness_bits" => Ok(__FieldTag::__vbv_fullness_bits),
12021                                "bPyramid" => Ok(__FieldTag::__b_pyramid),
12022                                "b_pyramid" => Ok(__FieldTag::__b_pyramid),
12023                                "bFrameCount" => Ok(__FieldTag::__b_frame_count),
12024                                "b_frame_count" => Ok(__FieldTag::__b_frame_count),
12025                                "aqStrength" => Ok(__FieldTag::__aq_strength),
12026                                "aq_strength" => Ok(__FieldTag::__aq_strength),
12027                                "profile" => Ok(__FieldTag::__profile),
12028                                "tune" => Ok(__FieldTag::__tune),
12029                                "preset" => Ok(__FieldTag::__preset),
12030                                "sdr" => Ok(__FieldTag::__sdr),
12031                                "hlg" => Ok(__FieldTag::__hlg),
12032                                "hdr10" => Ok(__FieldTag::__hdr10),
12033                                _ => Ok(__FieldTag::Unknown(value.to_string())),
12034                            }
12035                        }
12036                    }
12037                    deserializer.deserialize_identifier(Visitor)
12038                }
12039            }
12040            struct Visitor;
12041            impl<'de> serde::de::Visitor<'de> for Visitor {
12042                type Value = H265CodecSettings;
12043                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12044                    formatter.write_str("struct H265CodecSettings")
12045                }
12046                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
12047                where
12048                    A: serde::de::MapAccess<'de>,
12049                {
12050                    #[allow(unused_imports)]
12051                    use serde::de::Error;
12052                    use std::option::Option::Some;
12053                    let mut fields = std::collections::HashSet::new();
12054                    let mut result = Self::Value::new();
12055                    while let Some(tag) = map.next_key::<__FieldTag>()? {
12056                        #[allow(clippy::match_single_binding)]
12057                        match tag {
12058                            __FieldTag::__width_pixels => {
12059                                if !fields.insert(__FieldTag::__width_pixels) {
12060                                    return std::result::Result::Err(A::Error::duplicate_field(
12061                                        "multiple values for width_pixels",
12062                                    ));
12063                                }
12064                                struct __With(std::option::Option<i32>);
12065                                impl<'de> serde::de::Deserialize<'de> for __With {
12066                                    fn deserialize<D>(
12067                                        deserializer: D,
12068                                    ) -> std::result::Result<Self, D::Error>
12069                                    where
12070                                        D: serde::de::Deserializer<'de>,
12071                                    {
12072                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
12073                                    }
12074                                }
12075                                result.width_pixels =
12076                                    map.next_value::<__With>()?.0.unwrap_or_default();
12077                            }
12078                            __FieldTag::__height_pixels => {
12079                                if !fields.insert(__FieldTag::__height_pixels) {
12080                                    return std::result::Result::Err(A::Error::duplicate_field(
12081                                        "multiple values for height_pixels",
12082                                    ));
12083                                }
12084                                struct __With(std::option::Option<i32>);
12085                                impl<'de> serde::de::Deserialize<'de> for __With {
12086                                    fn deserialize<D>(
12087                                        deserializer: D,
12088                                    ) -> std::result::Result<Self, D::Error>
12089                                    where
12090                                        D: serde::de::Deserializer<'de>,
12091                                    {
12092                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
12093                                    }
12094                                }
12095                                result.height_pixels =
12096                                    map.next_value::<__With>()?.0.unwrap_or_default();
12097                            }
12098                            __FieldTag::__frame_rate => {
12099                                if !fields.insert(__FieldTag::__frame_rate) {
12100                                    return std::result::Result::Err(A::Error::duplicate_field(
12101                                        "multiple values for frame_rate",
12102                                    ));
12103                                }
12104                                struct __With(std::option::Option<f64>);
12105                                impl<'de> serde::de::Deserialize<'de> for __With {
12106                                    fn deserialize<D>(
12107                                        deserializer: D,
12108                                    ) -> std::result::Result<Self, D::Error>
12109                                    where
12110                                        D: serde::de::Deserializer<'de>,
12111                                    {
12112                                        serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
12113                                    }
12114                                }
12115                                result.frame_rate =
12116                                    map.next_value::<__With>()?.0.unwrap_or_default();
12117                            }
12118                            __FieldTag::__frame_rate_conversion_strategy => {
12119                                if !fields.insert(__FieldTag::__frame_rate_conversion_strategy) {
12120                                    return std::result::Result::Err(A::Error::duplicate_field(
12121                                        "multiple values for frame_rate_conversion_strategy",
12122                                    ));
12123                                }
12124                                result.frame_rate_conversion_strategy = map
12125                                    .next_value::<std::option::Option<
12126                                        crate::model::video_stream::FrameRateConversionStrategy,
12127                                    >>()?
12128                                    .unwrap_or_default();
12129                            }
12130                            __FieldTag::__bitrate_bps => {
12131                                if !fields.insert(__FieldTag::__bitrate_bps) {
12132                                    return std::result::Result::Err(A::Error::duplicate_field(
12133                                        "multiple values for bitrate_bps",
12134                                    ));
12135                                }
12136                                struct __With(std::option::Option<i32>);
12137                                impl<'de> serde::de::Deserialize<'de> for __With {
12138                                    fn deserialize<D>(
12139                                        deserializer: D,
12140                                    ) -> std::result::Result<Self, D::Error>
12141                                    where
12142                                        D: serde::de::Deserializer<'de>,
12143                                    {
12144                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
12145                                    }
12146                                }
12147                                result.bitrate_bps =
12148                                    map.next_value::<__With>()?.0.unwrap_or_default();
12149                            }
12150                            __FieldTag::__pixel_format => {
12151                                if !fields.insert(__FieldTag::__pixel_format) {
12152                                    return std::result::Result::Err(A::Error::duplicate_field(
12153                                        "multiple values for pixel_format",
12154                                    ));
12155                                }
12156                                result.pixel_format = map
12157                                    .next_value::<std::option::Option<std::string::String>>()?
12158                                    .unwrap_or_default();
12159                            }
12160                            __FieldTag::__rate_control_mode => {
12161                                if !fields.insert(__FieldTag::__rate_control_mode) {
12162                                    return std::result::Result::Err(A::Error::duplicate_field(
12163                                        "multiple values for rate_control_mode",
12164                                    ));
12165                                }
12166                                result.rate_control_mode = map
12167                                    .next_value::<std::option::Option<std::string::String>>()?
12168                                    .unwrap_or_default();
12169                            }
12170                            __FieldTag::__crf_level => {
12171                                if !fields.insert(__FieldTag::__crf_level) {
12172                                    return std::result::Result::Err(A::Error::duplicate_field(
12173                                        "multiple values for crf_level",
12174                                    ));
12175                                }
12176                                struct __With(std::option::Option<i32>);
12177                                impl<'de> serde::de::Deserialize<'de> for __With {
12178                                    fn deserialize<D>(
12179                                        deserializer: D,
12180                                    ) -> std::result::Result<Self, D::Error>
12181                                    where
12182                                        D: serde::de::Deserializer<'de>,
12183                                    {
12184                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
12185                                    }
12186                                }
12187                                result.crf_level =
12188                                    map.next_value::<__With>()?.0.unwrap_or_default();
12189                            }
12190                            __FieldTag::__allow_open_gop => {
12191                                if !fields.insert(__FieldTag::__allow_open_gop) {
12192                                    return std::result::Result::Err(A::Error::duplicate_field(
12193                                        "multiple values for allow_open_gop",
12194                                    ));
12195                                }
12196                                result.allow_open_gop = map
12197                                    .next_value::<std::option::Option<bool>>()?
12198                                    .unwrap_or_default();
12199                            }
12200                            __FieldTag::__gop_frame_count => {
12201                                if !fields.insert(__FieldTag::__gop_frame_count) {
12202                                    return std::result::Result::Err(A::Error::duplicate_field(
12203                                        "multiple values for gop_frame_count",
12204                                    ));
12205                                }
12206                                struct __With(std::option::Option<i32>);
12207                                impl<'de> serde::de::Deserialize<'de> for __With {
12208                                    fn deserialize<D>(
12209                                        deserializer: D,
12210                                    ) -> std::result::Result<Self, D::Error>
12211                                    where
12212                                        D: serde::de::Deserializer<'de>,
12213                                    {
12214                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
12215                                    }
12216                                }
12217                                if result.gop_mode.is_some() {
12218                                    return std::result::Result::Err(A::Error::duplicate_field(
12219                                        "multiple values for `gop_mode`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.gop_frame_count, latest field was gopFrameCount",
12220                                    ));
12221                                }
12222                                result.gop_mode = std::option::Option::Some(
12223                                    crate::model::video_stream::h_265_codec_settings::GopMode::GopFrameCount(
12224                                        map.next_value::<__With>()?.0.unwrap_or_default()
12225                                    ),
12226                                );
12227                            }
12228                            __FieldTag::__gop_duration => {
12229                                if !fields.insert(__FieldTag::__gop_duration) {
12230                                    return std::result::Result::Err(A::Error::duplicate_field(
12231                                        "multiple values for gop_duration",
12232                                    ));
12233                                }
12234                                if result.gop_mode.is_some() {
12235                                    return std::result::Result::Err(A::Error::duplicate_field(
12236                                        "multiple values for `gop_mode`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.gop_duration, latest field was gopDuration",
12237                                    ));
12238                                }
12239                                result.gop_mode = std::option::Option::Some(
12240                                    crate::model::video_stream::h_265_codec_settings::GopMode::GopDuration(
12241                                        map.next_value::<std::option::Option<std::boxed::Box<wkt::Duration>>>()?.unwrap_or_default()
12242                                    ),
12243                                );
12244                            }
12245                            __FieldTag::__enable_two_pass => {
12246                                if !fields.insert(__FieldTag::__enable_two_pass) {
12247                                    return std::result::Result::Err(A::Error::duplicate_field(
12248                                        "multiple values for enable_two_pass",
12249                                    ));
12250                                }
12251                                result.enable_two_pass = map
12252                                    .next_value::<std::option::Option<bool>>()?
12253                                    .unwrap_or_default();
12254                            }
12255                            __FieldTag::__vbv_size_bits => {
12256                                if !fields.insert(__FieldTag::__vbv_size_bits) {
12257                                    return std::result::Result::Err(A::Error::duplicate_field(
12258                                        "multiple values for vbv_size_bits",
12259                                    ));
12260                                }
12261                                struct __With(std::option::Option<i32>);
12262                                impl<'de> serde::de::Deserialize<'de> for __With {
12263                                    fn deserialize<D>(
12264                                        deserializer: D,
12265                                    ) -> std::result::Result<Self, D::Error>
12266                                    where
12267                                        D: serde::de::Deserializer<'de>,
12268                                    {
12269                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
12270                                    }
12271                                }
12272                                result.vbv_size_bits =
12273                                    map.next_value::<__With>()?.0.unwrap_or_default();
12274                            }
12275                            __FieldTag::__vbv_fullness_bits => {
12276                                if !fields.insert(__FieldTag::__vbv_fullness_bits) {
12277                                    return std::result::Result::Err(A::Error::duplicate_field(
12278                                        "multiple values for vbv_fullness_bits",
12279                                    ));
12280                                }
12281                                struct __With(std::option::Option<i32>);
12282                                impl<'de> serde::de::Deserialize<'de> for __With {
12283                                    fn deserialize<D>(
12284                                        deserializer: D,
12285                                    ) -> std::result::Result<Self, D::Error>
12286                                    where
12287                                        D: serde::de::Deserializer<'de>,
12288                                    {
12289                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
12290                                    }
12291                                }
12292                                result.vbv_fullness_bits =
12293                                    map.next_value::<__With>()?.0.unwrap_or_default();
12294                            }
12295                            __FieldTag::__b_pyramid => {
12296                                if !fields.insert(__FieldTag::__b_pyramid) {
12297                                    return std::result::Result::Err(A::Error::duplicate_field(
12298                                        "multiple values for b_pyramid",
12299                                    ));
12300                                }
12301                                result.b_pyramid = map
12302                                    .next_value::<std::option::Option<bool>>()?
12303                                    .unwrap_or_default();
12304                            }
12305                            __FieldTag::__b_frame_count => {
12306                                if !fields.insert(__FieldTag::__b_frame_count) {
12307                                    return std::result::Result::Err(A::Error::duplicate_field(
12308                                        "multiple values for b_frame_count",
12309                                    ));
12310                                }
12311                                struct __With(std::option::Option<i32>);
12312                                impl<'de> serde::de::Deserialize<'de> for __With {
12313                                    fn deserialize<D>(
12314                                        deserializer: D,
12315                                    ) -> std::result::Result<Self, D::Error>
12316                                    where
12317                                        D: serde::de::Deserializer<'de>,
12318                                    {
12319                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
12320                                    }
12321                                }
12322                                result.b_frame_count =
12323                                    map.next_value::<__With>()?.0.unwrap_or_default();
12324                            }
12325                            __FieldTag::__aq_strength => {
12326                                if !fields.insert(__FieldTag::__aq_strength) {
12327                                    return std::result::Result::Err(A::Error::duplicate_field(
12328                                        "multiple values for aq_strength",
12329                                    ));
12330                                }
12331                                struct __With(std::option::Option<f64>);
12332                                impl<'de> serde::de::Deserialize<'de> for __With {
12333                                    fn deserialize<D>(
12334                                        deserializer: D,
12335                                    ) -> std::result::Result<Self, D::Error>
12336                                    where
12337                                        D: serde::de::Deserializer<'de>,
12338                                    {
12339                                        serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
12340                                    }
12341                                }
12342                                result.aq_strength =
12343                                    map.next_value::<__With>()?.0.unwrap_or_default();
12344                            }
12345                            __FieldTag::__profile => {
12346                                if !fields.insert(__FieldTag::__profile) {
12347                                    return std::result::Result::Err(A::Error::duplicate_field(
12348                                        "multiple values for profile",
12349                                    ));
12350                                }
12351                                result.profile = map
12352                                    .next_value::<std::option::Option<std::string::String>>()?
12353                                    .unwrap_or_default();
12354                            }
12355                            __FieldTag::__tune => {
12356                                if !fields.insert(__FieldTag::__tune) {
12357                                    return std::result::Result::Err(A::Error::duplicate_field(
12358                                        "multiple values for tune",
12359                                    ));
12360                                }
12361                                result.tune = map
12362                                    .next_value::<std::option::Option<std::string::String>>()?
12363                                    .unwrap_or_default();
12364                            }
12365                            __FieldTag::__preset => {
12366                                if !fields.insert(__FieldTag::__preset) {
12367                                    return std::result::Result::Err(A::Error::duplicate_field(
12368                                        "multiple values for preset",
12369                                    ));
12370                                }
12371                                result.preset = map
12372                                    .next_value::<std::option::Option<std::string::String>>()?
12373                                    .unwrap_or_default();
12374                            }
12375                            __FieldTag::__sdr => {
12376                                if !fields.insert(__FieldTag::__sdr) {
12377                                    return std::result::Result::Err(A::Error::duplicate_field(
12378                                        "multiple values for sdr",
12379                                    ));
12380                                }
12381                                if result.color_format.is_some() {
12382                                    return std::result::Result::Err(A::Error::duplicate_field(
12383                                        "multiple values for `color_format`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.sdr, latest field was sdr",
12384                                    ));
12385                                }
12386                                result.color_format = std::option::Option::Some(
12387                                    crate::model::video_stream::h_265_codec_settings::ColorFormat::Sdr(
12388                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::video_stream::H265ColorFormatSDR>>>()?.unwrap_or_default()
12389                                    ),
12390                                );
12391                            }
12392                            __FieldTag::__hlg => {
12393                                if !fields.insert(__FieldTag::__hlg) {
12394                                    return std::result::Result::Err(A::Error::duplicate_field(
12395                                        "multiple values for hlg",
12396                                    ));
12397                                }
12398                                if result.color_format.is_some() {
12399                                    return std::result::Result::Err(A::Error::duplicate_field(
12400                                        "multiple values for `color_format`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.hlg, latest field was hlg",
12401                                    ));
12402                                }
12403                                result.color_format = std::option::Option::Some(
12404                                    crate::model::video_stream::h_265_codec_settings::ColorFormat::Hlg(
12405                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::video_stream::H265ColorFormatHLG>>>()?.unwrap_or_default()
12406                                    ),
12407                                );
12408                            }
12409                            __FieldTag::__hdr10 => {
12410                                if !fields.insert(__FieldTag::__hdr10) {
12411                                    return std::result::Result::Err(A::Error::duplicate_field(
12412                                        "multiple values for hdr10",
12413                                    ));
12414                                }
12415                                if result.color_format.is_some() {
12416                                    return std::result::Result::Err(A::Error::duplicate_field(
12417                                        "multiple values for `color_format`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings.hdr10, latest field was hdr10",
12418                                    ));
12419                                }
12420                                result.color_format = std::option::Option::Some(
12421                                    crate::model::video_stream::h_265_codec_settings::ColorFormat::Hdr10(
12422                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::video_stream::H265ColorFormatHDR10>>>()?.unwrap_or_default()
12423                                    ),
12424                                );
12425                            }
12426                            __FieldTag::Unknown(key) => {
12427                                let value = map.next_value::<serde_json::Value>()?;
12428                                result._unknown_fields.insert(key, value);
12429                            }
12430                        }
12431                    }
12432                    std::result::Result::Ok(result)
12433                }
12434            }
12435            deserializer.deserialize_any(Visitor)
12436        }
12437    }
12438
12439    #[doc(hidden)]
12440    impl serde::ser::Serialize for H265CodecSettings {
12441        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12442        where
12443            S: serde::ser::Serializer,
12444        {
12445            use serde::ser::SerializeMap;
12446            #[allow(unused_imports)]
12447            use std::option::Option::Some;
12448            let mut state = serializer.serialize_map(std::option::Option::None)?;
12449            if !wkt::internal::is_default(&self.width_pixels) {
12450                struct __With<'a>(&'a i32);
12451                impl<'a> serde::ser::Serialize for __With<'a> {
12452                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12453                    where
12454                        S: serde::ser::Serializer,
12455                    {
12456                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
12457                    }
12458                }
12459                state.serialize_entry("widthPixels", &__With(&self.width_pixels))?;
12460            }
12461            if !wkt::internal::is_default(&self.height_pixels) {
12462                struct __With<'a>(&'a i32);
12463                impl<'a> serde::ser::Serialize for __With<'a> {
12464                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12465                    where
12466                        S: serde::ser::Serializer,
12467                    {
12468                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
12469                    }
12470                }
12471                state.serialize_entry("heightPixels", &__With(&self.height_pixels))?;
12472            }
12473            if !wkt::internal::is_default(&self.frame_rate) {
12474                struct __With<'a>(&'a f64);
12475                impl<'a> serde::ser::Serialize for __With<'a> {
12476                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12477                    where
12478                        S: serde::ser::Serializer,
12479                    {
12480                        serde_with::As::<wkt::internal::F64>::serialize(self.0, serializer)
12481                    }
12482                }
12483                state.serialize_entry("frameRate", &__With(&self.frame_rate))?;
12484            }
12485            if !wkt::internal::is_default(&self.frame_rate_conversion_strategy) {
12486                state.serialize_entry(
12487                    "frameRateConversionStrategy",
12488                    &self.frame_rate_conversion_strategy,
12489                )?;
12490            }
12491            if !wkt::internal::is_default(&self.bitrate_bps) {
12492                struct __With<'a>(&'a i32);
12493                impl<'a> serde::ser::Serialize for __With<'a> {
12494                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12495                    where
12496                        S: serde::ser::Serializer,
12497                    {
12498                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
12499                    }
12500                }
12501                state.serialize_entry("bitrateBps", &__With(&self.bitrate_bps))?;
12502            }
12503            if !self.pixel_format.is_empty() {
12504                state.serialize_entry("pixelFormat", &self.pixel_format)?;
12505            }
12506            if !self.rate_control_mode.is_empty() {
12507                state.serialize_entry("rateControlMode", &self.rate_control_mode)?;
12508            }
12509            if !wkt::internal::is_default(&self.crf_level) {
12510                struct __With<'a>(&'a i32);
12511                impl<'a> serde::ser::Serialize for __With<'a> {
12512                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12513                    where
12514                        S: serde::ser::Serializer,
12515                    {
12516                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
12517                    }
12518                }
12519                state.serialize_entry("crfLevel", &__With(&self.crf_level))?;
12520            }
12521            if !wkt::internal::is_default(&self.allow_open_gop) {
12522                state.serialize_entry("allowOpenGop", &self.allow_open_gop)?;
12523            }
12524            if let Some(value) = self.gop_frame_count() {
12525                struct __With<'a>(&'a i32);
12526                impl<'a> serde::ser::Serialize for __With<'a> {
12527                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12528                    where
12529                        S: serde::ser::Serializer,
12530                    {
12531                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
12532                    }
12533                }
12534                state.serialize_entry("gopFrameCount", &__With(value))?;
12535            }
12536            if let Some(value) = self.gop_duration() {
12537                state.serialize_entry("gopDuration", value)?;
12538            }
12539            if !wkt::internal::is_default(&self.enable_two_pass) {
12540                state.serialize_entry("enableTwoPass", &self.enable_two_pass)?;
12541            }
12542            if !wkt::internal::is_default(&self.vbv_size_bits) {
12543                struct __With<'a>(&'a i32);
12544                impl<'a> serde::ser::Serialize for __With<'a> {
12545                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12546                    where
12547                        S: serde::ser::Serializer,
12548                    {
12549                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
12550                    }
12551                }
12552                state.serialize_entry("vbvSizeBits", &__With(&self.vbv_size_bits))?;
12553            }
12554            if !wkt::internal::is_default(&self.vbv_fullness_bits) {
12555                struct __With<'a>(&'a i32);
12556                impl<'a> serde::ser::Serialize for __With<'a> {
12557                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12558                    where
12559                        S: serde::ser::Serializer,
12560                    {
12561                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
12562                    }
12563                }
12564                state.serialize_entry("vbvFullnessBits", &__With(&self.vbv_fullness_bits))?;
12565            }
12566            if !wkt::internal::is_default(&self.b_pyramid) {
12567                state.serialize_entry("bPyramid", &self.b_pyramid)?;
12568            }
12569            if !wkt::internal::is_default(&self.b_frame_count) {
12570                struct __With<'a>(&'a i32);
12571                impl<'a> serde::ser::Serialize for __With<'a> {
12572                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12573                    where
12574                        S: serde::ser::Serializer,
12575                    {
12576                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
12577                    }
12578                }
12579                state.serialize_entry("bFrameCount", &__With(&self.b_frame_count))?;
12580            }
12581            if !wkt::internal::is_default(&self.aq_strength) {
12582                struct __With<'a>(&'a f64);
12583                impl<'a> serde::ser::Serialize for __With<'a> {
12584                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12585                    where
12586                        S: serde::ser::Serializer,
12587                    {
12588                        serde_with::As::<wkt::internal::F64>::serialize(self.0, serializer)
12589                    }
12590                }
12591                state.serialize_entry("aqStrength", &__With(&self.aq_strength))?;
12592            }
12593            if !self.profile.is_empty() {
12594                state.serialize_entry("profile", &self.profile)?;
12595            }
12596            if !self.tune.is_empty() {
12597                state.serialize_entry("tune", &self.tune)?;
12598            }
12599            if !self.preset.is_empty() {
12600                state.serialize_entry("preset", &self.preset)?;
12601            }
12602            if let Some(value) = self.sdr() {
12603                state.serialize_entry("sdr", value)?;
12604            }
12605            if let Some(value) = self.hlg() {
12606                state.serialize_entry("hlg", value)?;
12607            }
12608            if let Some(value) = self.hdr10() {
12609                state.serialize_entry("hdr10", value)?;
12610            }
12611            if !self._unknown_fields.is_empty() {
12612                for (key, value) in self._unknown_fields.iter() {
12613                    state.serialize_entry(key, &value)?;
12614                }
12615            }
12616            state.end()
12617        }
12618    }
12619
12620    impl std::fmt::Debug for H265CodecSettings {
12621        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12622            let mut debug_struct = f.debug_struct("H265CodecSettings");
12623            debug_struct.field("width_pixels", &self.width_pixels);
12624            debug_struct.field("height_pixels", &self.height_pixels);
12625            debug_struct.field("frame_rate", &self.frame_rate);
12626            debug_struct.field(
12627                "frame_rate_conversion_strategy",
12628                &self.frame_rate_conversion_strategy,
12629            );
12630            debug_struct.field("bitrate_bps", &self.bitrate_bps);
12631            debug_struct.field("pixel_format", &self.pixel_format);
12632            debug_struct.field("rate_control_mode", &self.rate_control_mode);
12633            debug_struct.field("crf_level", &self.crf_level);
12634            debug_struct.field("allow_open_gop", &self.allow_open_gop);
12635            debug_struct.field("enable_two_pass", &self.enable_two_pass);
12636            debug_struct.field("vbv_size_bits", &self.vbv_size_bits);
12637            debug_struct.field("vbv_fullness_bits", &self.vbv_fullness_bits);
12638            debug_struct.field("b_pyramid", &self.b_pyramid);
12639            debug_struct.field("b_frame_count", &self.b_frame_count);
12640            debug_struct.field("aq_strength", &self.aq_strength);
12641            debug_struct.field("profile", &self.profile);
12642            debug_struct.field("tune", &self.tune);
12643            debug_struct.field("preset", &self.preset);
12644            debug_struct.field("gop_mode", &self.gop_mode);
12645            debug_struct.field("color_format", &self.color_format);
12646            if !self._unknown_fields.is_empty() {
12647                debug_struct.field("_unknown_fields", &self._unknown_fields);
12648            }
12649            debug_struct.finish()
12650        }
12651    }
12652
12653    /// Defines additional types related to [H265CodecSettings].
12654    pub mod h_265_codec_settings {
12655        #[allow(unused_imports)]
12656        use super::*;
12657
12658        /// GOP mode can be either by frame count or duration.
12659        #[derive(Clone, Debug, PartialEq)]
12660        #[non_exhaustive]
12661        pub enum GopMode {
12662            /// Select the GOP size based on the specified frame count. Must be greater
12663            /// than zero.
12664            GopFrameCount(i32),
12665            /// Select the GOP size based on the specified duration. The default is
12666            /// `3s`. Note that `gopDuration` must be less than or equal to
12667            /// [`segmentDuration`](#SegmentSettings), and
12668            /// [`segmentDuration`](#SegmentSettings) must be divisible by
12669            /// `gopDuration`.
12670            GopDuration(std::boxed::Box<wkt::Duration>),
12671        }
12672
12673        /// Color format can be sdr, hlg, hdr10.
12674        #[derive(Clone, Debug, PartialEq)]
12675        #[non_exhaustive]
12676        pub enum ColorFormat {
12677            /// Optional. SDR color format setting for H265.
12678            Sdr(std::boxed::Box<crate::model::video_stream::H265ColorFormatSDR>),
12679            /// Optional. HLG color format setting for H265.
12680            Hlg(std::boxed::Box<crate::model::video_stream::H265ColorFormatHLG>),
12681            /// Optional. HDR10 color format setting for H265.
12682            Hdr10(std::boxed::Box<crate::model::video_stream::H265ColorFormatHDR10>),
12683        }
12684    }
12685
12686    /// Convert the input video to a Standard Dynamic Range (SDR) video.
12687    #[derive(Clone, Default, PartialEq)]
12688    #[non_exhaustive]
12689    pub struct Vp9ColorFormatSDR {
12690        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12691    }
12692
12693    impl Vp9ColorFormatSDR {
12694        pub fn new() -> Self {
12695            std::default::Default::default()
12696        }
12697    }
12698
12699    impl wkt::message::Message for Vp9ColorFormatSDR {
12700        fn typename() -> &'static str {
12701            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.Vp9ColorFormatSDR"
12702        }
12703    }
12704
12705    #[doc(hidden)]
12706    impl<'de> serde::de::Deserialize<'de> for Vp9ColorFormatSDR {
12707        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12708        where
12709            D: serde::Deserializer<'de>,
12710        {
12711            #[allow(non_camel_case_types)]
12712            #[doc(hidden)]
12713            #[derive(PartialEq, Eq, Hash)]
12714            enum __FieldTag {
12715                Unknown(std::string::String),
12716            }
12717            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
12718                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12719                where
12720                    D: serde::Deserializer<'de>,
12721                {
12722                    struct Visitor;
12723                    impl<'de> serde::de::Visitor<'de> for Visitor {
12724                        type Value = __FieldTag;
12725                        fn expecting(
12726                            &self,
12727                            formatter: &mut std::fmt::Formatter,
12728                        ) -> std::fmt::Result {
12729                            formatter.write_str("a field name for Vp9ColorFormatSDR")
12730                        }
12731                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
12732                        where
12733                            E: serde::de::Error,
12734                        {
12735                            use std::result::Result::Ok;
12736                            use std::string::ToString;
12737                            Ok(__FieldTag::Unknown(value.to_string()))
12738                        }
12739                    }
12740                    deserializer.deserialize_identifier(Visitor)
12741                }
12742            }
12743            struct Visitor;
12744            impl<'de> serde::de::Visitor<'de> for Visitor {
12745                type Value = Vp9ColorFormatSDR;
12746                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12747                    formatter.write_str("struct Vp9ColorFormatSDR")
12748                }
12749                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
12750                where
12751                    A: serde::de::MapAccess<'de>,
12752                {
12753                    #[allow(unused_imports)]
12754                    use serde::de::Error;
12755                    use std::option::Option::Some;
12756                    let mut result = Self::Value::new();
12757                    while let Some(tag) = map.next_key::<__FieldTag>()? {
12758                        #[allow(clippy::match_single_binding)]
12759                        match tag {
12760                            __FieldTag::Unknown(key) => {
12761                                let value = map.next_value::<serde_json::Value>()?;
12762                                result._unknown_fields.insert(key, value);
12763                            }
12764                        }
12765                    }
12766                    std::result::Result::Ok(result)
12767                }
12768            }
12769            deserializer.deserialize_any(Visitor)
12770        }
12771    }
12772
12773    #[doc(hidden)]
12774    impl serde::ser::Serialize for Vp9ColorFormatSDR {
12775        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12776        where
12777            S: serde::ser::Serializer,
12778        {
12779            use serde::ser::SerializeMap;
12780            #[allow(unused_imports)]
12781            use std::option::Option::Some;
12782            let mut state = serializer.serialize_map(std::option::Option::None)?;
12783            if !self._unknown_fields.is_empty() {
12784                for (key, value) in self._unknown_fields.iter() {
12785                    state.serialize_entry(key, &value)?;
12786                }
12787            }
12788            state.end()
12789        }
12790    }
12791
12792    impl std::fmt::Debug for Vp9ColorFormatSDR {
12793        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12794            let mut debug_struct = f.debug_struct("Vp9ColorFormatSDR");
12795            if !self._unknown_fields.is_empty() {
12796                debug_struct.field("_unknown_fields", &self._unknown_fields);
12797            }
12798            debug_struct.finish()
12799        }
12800    }
12801
12802    /// Convert the input video to a Hybrid Log Gamma (HLG) video.
12803    #[derive(Clone, Default, PartialEq)]
12804    #[non_exhaustive]
12805    pub struct Vp9ColorFormatHLG {
12806        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12807    }
12808
12809    impl Vp9ColorFormatHLG {
12810        pub fn new() -> Self {
12811            std::default::Default::default()
12812        }
12813    }
12814
12815    impl wkt::message::Message for Vp9ColorFormatHLG {
12816        fn typename() -> &'static str {
12817            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.Vp9ColorFormatHLG"
12818        }
12819    }
12820
12821    #[doc(hidden)]
12822    impl<'de> serde::de::Deserialize<'de> for Vp9ColorFormatHLG {
12823        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12824        where
12825            D: serde::Deserializer<'de>,
12826        {
12827            #[allow(non_camel_case_types)]
12828            #[doc(hidden)]
12829            #[derive(PartialEq, Eq, Hash)]
12830            enum __FieldTag {
12831                Unknown(std::string::String),
12832            }
12833            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
12834                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12835                where
12836                    D: serde::Deserializer<'de>,
12837                {
12838                    struct Visitor;
12839                    impl<'de> serde::de::Visitor<'de> for Visitor {
12840                        type Value = __FieldTag;
12841                        fn expecting(
12842                            &self,
12843                            formatter: &mut std::fmt::Formatter,
12844                        ) -> std::fmt::Result {
12845                            formatter.write_str("a field name for Vp9ColorFormatHLG")
12846                        }
12847                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
12848                        where
12849                            E: serde::de::Error,
12850                        {
12851                            use std::result::Result::Ok;
12852                            use std::string::ToString;
12853                            Ok(__FieldTag::Unknown(value.to_string()))
12854                        }
12855                    }
12856                    deserializer.deserialize_identifier(Visitor)
12857                }
12858            }
12859            struct Visitor;
12860            impl<'de> serde::de::Visitor<'de> for Visitor {
12861                type Value = Vp9ColorFormatHLG;
12862                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
12863                    formatter.write_str("struct Vp9ColorFormatHLG")
12864                }
12865                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
12866                where
12867                    A: serde::de::MapAccess<'de>,
12868                {
12869                    #[allow(unused_imports)]
12870                    use serde::de::Error;
12871                    use std::option::Option::Some;
12872                    let mut result = Self::Value::new();
12873                    while let Some(tag) = map.next_key::<__FieldTag>()? {
12874                        #[allow(clippy::match_single_binding)]
12875                        match tag {
12876                            __FieldTag::Unknown(key) => {
12877                                let value = map.next_value::<serde_json::Value>()?;
12878                                result._unknown_fields.insert(key, value);
12879                            }
12880                        }
12881                    }
12882                    std::result::Result::Ok(result)
12883                }
12884            }
12885            deserializer.deserialize_any(Visitor)
12886        }
12887    }
12888
12889    #[doc(hidden)]
12890    impl serde::ser::Serialize for Vp9ColorFormatHLG {
12891        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12892        where
12893            S: serde::ser::Serializer,
12894        {
12895            use serde::ser::SerializeMap;
12896            #[allow(unused_imports)]
12897            use std::option::Option::Some;
12898            let mut state = serializer.serialize_map(std::option::Option::None)?;
12899            if !self._unknown_fields.is_empty() {
12900                for (key, value) in self._unknown_fields.iter() {
12901                    state.serialize_entry(key, &value)?;
12902                }
12903            }
12904            state.end()
12905        }
12906    }
12907
12908    impl std::fmt::Debug for Vp9ColorFormatHLG {
12909        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
12910            let mut debug_struct = f.debug_struct("Vp9ColorFormatHLG");
12911            if !self._unknown_fields.is_empty() {
12912                debug_struct.field("_unknown_fields", &self._unknown_fields);
12913            }
12914            debug_struct.finish()
12915        }
12916    }
12917
12918    /// VP9 codec settings.
12919    #[derive(Clone, Default, PartialEq)]
12920    #[non_exhaustive]
12921    pub struct Vp9CodecSettings {
12922        /// The width of the video in pixels. Must be an even integer.
12923        /// When not specified, the width is adjusted to match the specified height
12924        /// and input aspect ratio. If both are omitted, the input width is used.
12925        ///
12926        /// For portrait videos that contain horizontal ASR and rotation metadata,
12927        /// provide the width, in pixels, per the horizontal ASR. The API calculates
12928        /// the height per the horizontal ASR. The API detects any rotation metadata
12929        /// and swaps the requested height and width for the output.
12930        pub width_pixels: i32,
12931
12932        /// The height of the video in pixels. Must be an even integer.
12933        /// When not specified, the height is adjusted to match the specified width
12934        /// and input aspect ratio. If both are omitted, the input height is used.
12935        ///
12936        /// For portrait videos that contain horizontal ASR and rotation metadata,
12937        /// provide the height, in pixels, per the horizontal ASR. The API calculates
12938        /// the width per the horizontal ASR. The API detects any rotation metadata
12939        /// and swaps the requested height and width for the output.
12940        pub height_pixels: i32,
12941
12942        /// Required. The target video frame rate in frames per second (FPS). Must be
12943        /// less than or equal to 120.
12944        pub frame_rate: f64,
12945
12946        /// Optional. Frame rate conversion strategy for desired frame rate. The
12947        /// default is `DOWNSAMPLE`.
12948        pub frame_rate_conversion_strategy: crate::model::video_stream::FrameRateConversionStrategy,
12949
12950        /// Required. The video bitrate in bits per second. The minimum value is
12951        /// 1,000. The maximum value is 480,000,000.
12952        pub bitrate_bps: i32,
12953
12954        /// Pixel format to use. The default is `yuv420p`.
12955        ///
12956        /// Supported pixel formats:
12957        ///
12958        /// - `yuv420p` pixel format
12959        /// - `yuv422p` pixel format
12960        /// - `yuv444p` pixel format
12961        /// - `yuv420p10` 10-bit HDR pixel format
12962        /// - `yuv422p10` 10-bit HDR pixel format
12963        /// - `yuv444p10` 10-bit HDR pixel format
12964        /// - `yuv420p12` 12-bit HDR pixel format
12965        /// - `yuv422p12` 12-bit HDR pixel format
12966        /// - `yuv444p12` 12-bit HDR pixel format
12967        pub pixel_format: std::string::String,
12968
12969        /// Specify the mode. The default is `vbr`.
12970        ///
12971        /// Supported rate control modes:
12972        ///
12973        /// - `vbr` - variable bitrate
12974        pub rate_control_mode: std::string::String,
12975
12976        /// Target CRF level. Must be between 10 and 36, where 10 is the highest
12977        /// quality and 36 is the most efficient compression. The default is 21.
12978        ///
12979        /// **Note:** This field is not supported.
12980        pub crf_level: i32,
12981
12982        /// Enforces the specified codec profile. The following profiles are
12983        /// supported:
12984        ///
12985        /// * `profile0` (default)
12986        /// * `profile1`
12987        /// * `profile2`
12988        /// * `profile3`
12989        ///
12990        /// The available options are
12991        /// [WebM-compatible](https://www.webmproject.org/vp9/profiles/).
12992        /// Note that certain values for this field may cause the
12993        /// transcoder to override other fields you set in the `Vp9CodecSettings`
12994        /// message.
12995        pub profile: std::string::String,
12996
12997        /// GOP mode can be either by frame count or duration.
12998        pub gop_mode: std::option::Option<crate::model::video_stream::vp_9_codec_settings::GopMode>,
12999
13000        /// Color format can be sdr or hlg.
13001        pub color_format:
13002            std::option::Option<crate::model::video_stream::vp_9_codec_settings::ColorFormat>,
13003
13004        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13005    }
13006
13007    impl Vp9CodecSettings {
13008        pub fn new() -> Self {
13009            std::default::Default::default()
13010        }
13011
13012        /// Sets the value of [width_pixels][crate::model::video_stream::Vp9CodecSettings::width_pixels].
13013        pub fn set_width_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13014            self.width_pixels = v.into();
13015            self
13016        }
13017
13018        /// Sets the value of [height_pixels][crate::model::video_stream::Vp9CodecSettings::height_pixels].
13019        pub fn set_height_pixels<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13020            self.height_pixels = v.into();
13021            self
13022        }
13023
13024        /// Sets the value of [frame_rate][crate::model::video_stream::Vp9CodecSettings::frame_rate].
13025        pub fn set_frame_rate<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
13026            self.frame_rate = v.into();
13027            self
13028        }
13029
13030        /// Sets the value of [frame_rate_conversion_strategy][crate::model::video_stream::Vp9CodecSettings::frame_rate_conversion_strategy].
13031        pub fn set_frame_rate_conversion_strategy<
13032            T: std::convert::Into<crate::model::video_stream::FrameRateConversionStrategy>,
13033        >(
13034            mut self,
13035            v: T,
13036        ) -> Self {
13037            self.frame_rate_conversion_strategy = v.into();
13038            self
13039        }
13040
13041        /// Sets the value of [bitrate_bps][crate::model::video_stream::Vp9CodecSettings::bitrate_bps].
13042        pub fn set_bitrate_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13043            self.bitrate_bps = v.into();
13044            self
13045        }
13046
13047        /// Sets the value of [pixel_format][crate::model::video_stream::Vp9CodecSettings::pixel_format].
13048        pub fn set_pixel_format<T: std::convert::Into<std::string::String>>(
13049            mut self,
13050            v: T,
13051        ) -> Self {
13052            self.pixel_format = v.into();
13053            self
13054        }
13055
13056        /// Sets the value of [rate_control_mode][crate::model::video_stream::Vp9CodecSettings::rate_control_mode].
13057        pub fn set_rate_control_mode<T: std::convert::Into<std::string::String>>(
13058            mut self,
13059            v: T,
13060        ) -> Self {
13061            self.rate_control_mode = v.into();
13062            self
13063        }
13064
13065        /// Sets the value of [crf_level][crate::model::video_stream::Vp9CodecSettings::crf_level].
13066        pub fn set_crf_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13067            self.crf_level = v.into();
13068            self
13069        }
13070
13071        /// Sets the value of [profile][crate::model::video_stream::Vp9CodecSettings::profile].
13072        pub fn set_profile<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13073            self.profile = v.into();
13074            self
13075        }
13076
13077        /// Sets the value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode].
13078        ///
13079        /// Note that all the setters affecting `gop_mode` are mutually
13080        /// exclusive.
13081        pub fn set_gop_mode<
13082            T: std::convert::Into<
13083                    std::option::Option<crate::model::video_stream::vp_9_codec_settings::GopMode>,
13084                >,
13085        >(
13086            mut self,
13087            v: T,
13088        ) -> Self {
13089            self.gop_mode = v.into();
13090            self
13091        }
13092
13093        /// The value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode]
13094        /// if it holds a `GopFrameCount`, `None` if the field is not set or
13095        /// holds a different branch.
13096        pub fn gop_frame_count(&self) -> std::option::Option<&i32> {
13097            #[allow(unreachable_patterns)]
13098            self.gop_mode.as_ref().and_then(|v| match v {
13099                crate::model::video_stream::vp_9_codec_settings::GopMode::GopFrameCount(v) => {
13100                    std::option::Option::Some(v)
13101                }
13102                _ => std::option::Option::None,
13103            })
13104        }
13105
13106        /// Sets the value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode]
13107        /// to hold a `GopFrameCount`.
13108        ///
13109        /// Note that all the setters affecting `gop_mode` are
13110        /// mutually exclusive.
13111        pub fn set_gop_frame_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13112            self.gop_mode = std::option::Option::Some(
13113                crate::model::video_stream::vp_9_codec_settings::GopMode::GopFrameCount(v.into()),
13114            );
13115            self
13116        }
13117
13118        /// The value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode]
13119        /// if it holds a `GopDuration`, `None` if the field is not set or
13120        /// holds a different branch.
13121        pub fn gop_duration(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
13122            #[allow(unreachable_patterns)]
13123            self.gop_mode.as_ref().and_then(|v| match v {
13124                crate::model::video_stream::vp_9_codec_settings::GopMode::GopDuration(v) => {
13125                    std::option::Option::Some(v)
13126                }
13127                _ => std::option::Option::None,
13128            })
13129        }
13130
13131        /// Sets the value of [gop_mode][crate::model::video_stream::Vp9CodecSettings::gop_mode]
13132        /// to hold a `GopDuration`.
13133        ///
13134        /// Note that all the setters affecting `gop_mode` are
13135        /// mutually exclusive.
13136        pub fn set_gop_duration<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(
13137            mut self,
13138            v: T,
13139        ) -> Self {
13140            self.gop_mode = std::option::Option::Some(
13141                crate::model::video_stream::vp_9_codec_settings::GopMode::GopDuration(v.into()),
13142            );
13143            self
13144        }
13145
13146        /// Sets the value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format].
13147        ///
13148        /// Note that all the setters affecting `color_format` are mutually
13149        /// exclusive.
13150        pub fn set_color_format<
13151            T: std::convert::Into<
13152                    std::option::Option<
13153                        crate::model::video_stream::vp_9_codec_settings::ColorFormat,
13154                    >,
13155                >,
13156        >(
13157            mut self,
13158            v: T,
13159        ) -> Self {
13160            self.color_format = v.into();
13161            self
13162        }
13163
13164        /// The value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format]
13165        /// if it holds a `Sdr`, `None` if the field is not set or
13166        /// holds a different branch.
13167        pub fn sdr(
13168            &self,
13169        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::Vp9ColorFormatSDR>>
13170        {
13171            #[allow(unreachable_patterns)]
13172            self.color_format.as_ref().and_then(|v| match v {
13173                crate::model::video_stream::vp_9_codec_settings::ColorFormat::Sdr(v) => {
13174                    std::option::Option::Some(v)
13175                }
13176                _ => std::option::Option::None,
13177            })
13178        }
13179
13180        /// Sets the value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format]
13181        /// to hold a `Sdr`.
13182        ///
13183        /// Note that all the setters affecting `color_format` are
13184        /// mutually exclusive.
13185        pub fn set_sdr<
13186            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::Vp9ColorFormatSDR>>,
13187        >(
13188            mut self,
13189            v: T,
13190        ) -> Self {
13191            self.color_format = std::option::Option::Some(
13192                crate::model::video_stream::vp_9_codec_settings::ColorFormat::Sdr(v.into()),
13193            );
13194            self
13195        }
13196
13197        /// The value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format]
13198        /// if it holds a `Hlg`, `None` if the field is not set or
13199        /// holds a different branch.
13200        pub fn hlg(
13201            &self,
13202        ) -> std::option::Option<&std::boxed::Box<crate::model::video_stream::Vp9ColorFormatHLG>>
13203        {
13204            #[allow(unreachable_patterns)]
13205            self.color_format.as_ref().and_then(|v| match v {
13206                crate::model::video_stream::vp_9_codec_settings::ColorFormat::Hlg(v) => {
13207                    std::option::Option::Some(v)
13208                }
13209                _ => std::option::Option::None,
13210            })
13211        }
13212
13213        /// Sets the value of [color_format][crate::model::video_stream::Vp9CodecSettings::color_format]
13214        /// to hold a `Hlg`.
13215        ///
13216        /// Note that all the setters affecting `color_format` are
13217        /// mutually exclusive.
13218        pub fn set_hlg<
13219            T: std::convert::Into<std::boxed::Box<crate::model::video_stream::Vp9ColorFormatHLG>>,
13220        >(
13221            mut self,
13222            v: T,
13223        ) -> Self {
13224            self.color_format = std::option::Option::Some(
13225                crate::model::video_stream::vp_9_codec_settings::ColorFormat::Hlg(v.into()),
13226            );
13227            self
13228        }
13229    }
13230
13231    impl wkt::message::Message for Vp9CodecSettings {
13232        fn typename() -> &'static str {
13233            "type.googleapis.com/google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings"
13234        }
13235    }
13236
13237    #[doc(hidden)]
13238    impl<'de> serde::de::Deserialize<'de> for Vp9CodecSettings {
13239        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13240        where
13241            D: serde::Deserializer<'de>,
13242        {
13243            #[allow(non_camel_case_types)]
13244            #[doc(hidden)]
13245            #[derive(PartialEq, Eq, Hash)]
13246            enum __FieldTag {
13247                __width_pixels,
13248                __height_pixels,
13249                __frame_rate,
13250                __frame_rate_conversion_strategy,
13251                __bitrate_bps,
13252                __pixel_format,
13253                __rate_control_mode,
13254                __crf_level,
13255                __gop_frame_count,
13256                __gop_duration,
13257                __profile,
13258                __sdr,
13259                __hlg,
13260                Unknown(std::string::String),
13261            }
13262            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
13263                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13264                where
13265                    D: serde::Deserializer<'de>,
13266                {
13267                    struct Visitor;
13268                    impl<'de> serde::de::Visitor<'de> for Visitor {
13269                        type Value = __FieldTag;
13270                        fn expecting(
13271                            &self,
13272                            formatter: &mut std::fmt::Formatter,
13273                        ) -> std::fmt::Result {
13274                            formatter.write_str("a field name for Vp9CodecSettings")
13275                        }
13276                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
13277                        where
13278                            E: serde::de::Error,
13279                        {
13280                            use std::result::Result::Ok;
13281                            use std::string::ToString;
13282                            match value {
13283                                "widthPixels" => Ok(__FieldTag::__width_pixels),
13284                                "width_pixels" => Ok(__FieldTag::__width_pixels),
13285                                "heightPixels" => Ok(__FieldTag::__height_pixels),
13286                                "height_pixels" => Ok(__FieldTag::__height_pixels),
13287                                "frameRate" => Ok(__FieldTag::__frame_rate),
13288                                "frame_rate" => Ok(__FieldTag::__frame_rate),
13289                                "frameRateConversionStrategy" => {
13290                                    Ok(__FieldTag::__frame_rate_conversion_strategy)
13291                                }
13292                                "frame_rate_conversion_strategy" => {
13293                                    Ok(__FieldTag::__frame_rate_conversion_strategy)
13294                                }
13295                                "bitrateBps" => Ok(__FieldTag::__bitrate_bps),
13296                                "bitrate_bps" => Ok(__FieldTag::__bitrate_bps),
13297                                "pixelFormat" => Ok(__FieldTag::__pixel_format),
13298                                "pixel_format" => Ok(__FieldTag::__pixel_format),
13299                                "rateControlMode" => Ok(__FieldTag::__rate_control_mode),
13300                                "rate_control_mode" => Ok(__FieldTag::__rate_control_mode),
13301                                "crfLevel" => Ok(__FieldTag::__crf_level),
13302                                "crf_level" => Ok(__FieldTag::__crf_level),
13303                                "gopFrameCount" => Ok(__FieldTag::__gop_frame_count),
13304                                "gop_frame_count" => Ok(__FieldTag::__gop_frame_count),
13305                                "gopDuration" => Ok(__FieldTag::__gop_duration),
13306                                "gop_duration" => Ok(__FieldTag::__gop_duration),
13307                                "profile" => Ok(__FieldTag::__profile),
13308                                "sdr" => Ok(__FieldTag::__sdr),
13309                                "hlg" => Ok(__FieldTag::__hlg),
13310                                _ => Ok(__FieldTag::Unknown(value.to_string())),
13311                            }
13312                        }
13313                    }
13314                    deserializer.deserialize_identifier(Visitor)
13315                }
13316            }
13317            struct Visitor;
13318            impl<'de> serde::de::Visitor<'de> for Visitor {
13319                type Value = Vp9CodecSettings;
13320                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
13321                    formatter.write_str("struct Vp9CodecSettings")
13322                }
13323                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
13324                where
13325                    A: serde::de::MapAccess<'de>,
13326                {
13327                    #[allow(unused_imports)]
13328                    use serde::de::Error;
13329                    use std::option::Option::Some;
13330                    let mut fields = std::collections::HashSet::new();
13331                    let mut result = Self::Value::new();
13332                    while let Some(tag) = map.next_key::<__FieldTag>()? {
13333                        #[allow(clippy::match_single_binding)]
13334                        match tag {
13335                            __FieldTag::__width_pixels => {
13336                                if !fields.insert(__FieldTag::__width_pixels) {
13337                                    return std::result::Result::Err(A::Error::duplicate_field(
13338                                        "multiple values for width_pixels",
13339                                    ));
13340                                }
13341                                struct __With(std::option::Option<i32>);
13342                                impl<'de> serde::de::Deserialize<'de> for __With {
13343                                    fn deserialize<D>(
13344                                        deserializer: D,
13345                                    ) -> std::result::Result<Self, D::Error>
13346                                    where
13347                                        D: serde::de::Deserializer<'de>,
13348                                    {
13349                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
13350                                    }
13351                                }
13352                                result.width_pixels =
13353                                    map.next_value::<__With>()?.0.unwrap_or_default();
13354                            }
13355                            __FieldTag::__height_pixels => {
13356                                if !fields.insert(__FieldTag::__height_pixels) {
13357                                    return std::result::Result::Err(A::Error::duplicate_field(
13358                                        "multiple values for height_pixels",
13359                                    ));
13360                                }
13361                                struct __With(std::option::Option<i32>);
13362                                impl<'de> serde::de::Deserialize<'de> for __With {
13363                                    fn deserialize<D>(
13364                                        deserializer: D,
13365                                    ) -> std::result::Result<Self, D::Error>
13366                                    where
13367                                        D: serde::de::Deserializer<'de>,
13368                                    {
13369                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
13370                                    }
13371                                }
13372                                result.height_pixels =
13373                                    map.next_value::<__With>()?.0.unwrap_or_default();
13374                            }
13375                            __FieldTag::__frame_rate => {
13376                                if !fields.insert(__FieldTag::__frame_rate) {
13377                                    return std::result::Result::Err(A::Error::duplicate_field(
13378                                        "multiple values for frame_rate",
13379                                    ));
13380                                }
13381                                struct __With(std::option::Option<f64>);
13382                                impl<'de> serde::de::Deserialize<'de> for __With {
13383                                    fn deserialize<D>(
13384                                        deserializer: D,
13385                                    ) -> std::result::Result<Self, D::Error>
13386                                    where
13387                                        D: serde::de::Deserializer<'de>,
13388                                    {
13389                                        serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
13390                                    }
13391                                }
13392                                result.frame_rate =
13393                                    map.next_value::<__With>()?.0.unwrap_or_default();
13394                            }
13395                            __FieldTag::__frame_rate_conversion_strategy => {
13396                                if !fields.insert(__FieldTag::__frame_rate_conversion_strategy) {
13397                                    return std::result::Result::Err(A::Error::duplicate_field(
13398                                        "multiple values for frame_rate_conversion_strategy",
13399                                    ));
13400                                }
13401                                result.frame_rate_conversion_strategy = map
13402                                    .next_value::<std::option::Option<
13403                                        crate::model::video_stream::FrameRateConversionStrategy,
13404                                    >>()?
13405                                    .unwrap_or_default();
13406                            }
13407                            __FieldTag::__bitrate_bps => {
13408                                if !fields.insert(__FieldTag::__bitrate_bps) {
13409                                    return std::result::Result::Err(A::Error::duplicate_field(
13410                                        "multiple values for bitrate_bps",
13411                                    ));
13412                                }
13413                                struct __With(std::option::Option<i32>);
13414                                impl<'de> serde::de::Deserialize<'de> for __With {
13415                                    fn deserialize<D>(
13416                                        deserializer: D,
13417                                    ) -> std::result::Result<Self, D::Error>
13418                                    where
13419                                        D: serde::de::Deserializer<'de>,
13420                                    {
13421                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
13422                                    }
13423                                }
13424                                result.bitrate_bps =
13425                                    map.next_value::<__With>()?.0.unwrap_or_default();
13426                            }
13427                            __FieldTag::__pixel_format => {
13428                                if !fields.insert(__FieldTag::__pixel_format) {
13429                                    return std::result::Result::Err(A::Error::duplicate_field(
13430                                        "multiple values for pixel_format",
13431                                    ));
13432                                }
13433                                result.pixel_format = map
13434                                    .next_value::<std::option::Option<std::string::String>>()?
13435                                    .unwrap_or_default();
13436                            }
13437                            __FieldTag::__rate_control_mode => {
13438                                if !fields.insert(__FieldTag::__rate_control_mode) {
13439                                    return std::result::Result::Err(A::Error::duplicate_field(
13440                                        "multiple values for rate_control_mode",
13441                                    ));
13442                                }
13443                                result.rate_control_mode = map
13444                                    .next_value::<std::option::Option<std::string::String>>()?
13445                                    .unwrap_or_default();
13446                            }
13447                            __FieldTag::__crf_level => {
13448                                if !fields.insert(__FieldTag::__crf_level) {
13449                                    return std::result::Result::Err(A::Error::duplicate_field(
13450                                        "multiple values for crf_level",
13451                                    ));
13452                                }
13453                                struct __With(std::option::Option<i32>);
13454                                impl<'de> serde::de::Deserialize<'de> for __With {
13455                                    fn deserialize<D>(
13456                                        deserializer: D,
13457                                    ) -> std::result::Result<Self, D::Error>
13458                                    where
13459                                        D: serde::de::Deserializer<'de>,
13460                                    {
13461                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
13462                                    }
13463                                }
13464                                result.crf_level =
13465                                    map.next_value::<__With>()?.0.unwrap_or_default();
13466                            }
13467                            __FieldTag::__gop_frame_count => {
13468                                if !fields.insert(__FieldTag::__gop_frame_count) {
13469                                    return std::result::Result::Err(A::Error::duplicate_field(
13470                                        "multiple values for gop_frame_count",
13471                                    ));
13472                                }
13473                                struct __With(std::option::Option<i32>);
13474                                impl<'de> serde::de::Deserialize<'de> for __With {
13475                                    fn deserialize<D>(
13476                                        deserializer: D,
13477                                    ) -> std::result::Result<Self, D::Error>
13478                                    where
13479                                        D: serde::de::Deserializer<'de>,
13480                                    {
13481                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
13482                                    }
13483                                }
13484                                if result.gop_mode.is_some() {
13485                                    return std::result::Result::Err(A::Error::duplicate_field(
13486                                        "multiple values for `gop_mode`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings.gop_frame_count, latest field was gopFrameCount",
13487                                    ));
13488                                }
13489                                result.gop_mode = std::option::Option::Some(
13490                                    crate::model::video_stream::vp_9_codec_settings::GopMode::GopFrameCount(
13491                                        map.next_value::<__With>()?.0.unwrap_or_default()
13492                                    ),
13493                                );
13494                            }
13495                            __FieldTag::__gop_duration => {
13496                                if !fields.insert(__FieldTag::__gop_duration) {
13497                                    return std::result::Result::Err(A::Error::duplicate_field(
13498                                        "multiple values for gop_duration",
13499                                    ));
13500                                }
13501                                if result.gop_mode.is_some() {
13502                                    return std::result::Result::Err(A::Error::duplicate_field(
13503                                        "multiple values for `gop_mode`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings.gop_duration, latest field was gopDuration",
13504                                    ));
13505                                }
13506                                result.gop_mode = std::option::Option::Some(
13507                                    crate::model::video_stream::vp_9_codec_settings::GopMode::GopDuration(
13508                                        map.next_value::<std::option::Option<std::boxed::Box<wkt::Duration>>>()?.unwrap_or_default()
13509                                    ),
13510                                );
13511                            }
13512                            __FieldTag::__profile => {
13513                                if !fields.insert(__FieldTag::__profile) {
13514                                    return std::result::Result::Err(A::Error::duplicate_field(
13515                                        "multiple values for profile",
13516                                    ));
13517                                }
13518                                result.profile = map
13519                                    .next_value::<std::option::Option<std::string::String>>()?
13520                                    .unwrap_or_default();
13521                            }
13522                            __FieldTag::__sdr => {
13523                                if !fields.insert(__FieldTag::__sdr) {
13524                                    return std::result::Result::Err(A::Error::duplicate_field(
13525                                        "multiple values for sdr",
13526                                    ));
13527                                }
13528                                if result.color_format.is_some() {
13529                                    return std::result::Result::Err(A::Error::duplicate_field(
13530                                        "multiple values for `color_format`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings.sdr, latest field was sdr",
13531                                    ));
13532                                }
13533                                result.color_format = std::option::Option::Some(
13534                                    crate::model::video_stream::vp_9_codec_settings::ColorFormat::Sdr(
13535                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::video_stream::Vp9ColorFormatSDR>>>()?.unwrap_or_default()
13536                                    ),
13537                                );
13538                            }
13539                            __FieldTag::__hlg => {
13540                                if !fields.insert(__FieldTag::__hlg) {
13541                                    return std::result::Result::Err(A::Error::duplicate_field(
13542                                        "multiple values for hlg",
13543                                    ));
13544                                }
13545                                if result.color_format.is_some() {
13546                                    return std::result::Result::Err(A::Error::duplicate_field(
13547                                        "multiple values for `color_format`, a oneof with full ID .google.cloud.video.transcoder.v1.VideoStream.Vp9CodecSettings.hlg, latest field was hlg",
13548                                    ));
13549                                }
13550                                result.color_format = std::option::Option::Some(
13551                                    crate::model::video_stream::vp_9_codec_settings::ColorFormat::Hlg(
13552                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::video_stream::Vp9ColorFormatHLG>>>()?.unwrap_or_default()
13553                                    ),
13554                                );
13555                            }
13556                            __FieldTag::Unknown(key) => {
13557                                let value = map.next_value::<serde_json::Value>()?;
13558                                result._unknown_fields.insert(key, value);
13559                            }
13560                        }
13561                    }
13562                    std::result::Result::Ok(result)
13563                }
13564            }
13565            deserializer.deserialize_any(Visitor)
13566        }
13567    }
13568
13569    #[doc(hidden)]
13570    impl serde::ser::Serialize for Vp9CodecSettings {
13571        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13572        where
13573            S: serde::ser::Serializer,
13574        {
13575            use serde::ser::SerializeMap;
13576            #[allow(unused_imports)]
13577            use std::option::Option::Some;
13578            let mut state = serializer.serialize_map(std::option::Option::None)?;
13579            if !wkt::internal::is_default(&self.width_pixels) {
13580                struct __With<'a>(&'a i32);
13581                impl<'a> serde::ser::Serialize for __With<'a> {
13582                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13583                    where
13584                        S: serde::ser::Serializer,
13585                    {
13586                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
13587                    }
13588                }
13589                state.serialize_entry("widthPixels", &__With(&self.width_pixels))?;
13590            }
13591            if !wkt::internal::is_default(&self.height_pixels) {
13592                struct __With<'a>(&'a i32);
13593                impl<'a> serde::ser::Serialize for __With<'a> {
13594                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13595                    where
13596                        S: serde::ser::Serializer,
13597                    {
13598                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
13599                    }
13600                }
13601                state.serialize_entry("heightPixels", &__With(&self.height_pixels))?;
13602            }
13603            if !wkt::internal::is_default(&self.frame_rate) {
13604                struct __With<'a>(&'a f64);
13605                impl<'a> serde::ser::Serialize for __With<'a> {
13606                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13607                    where
13608                        S: serde::ser::Serializer,
13609                    {
13610                        serde_with::As::<wkt::internal::F64>::serialize(self.0, serializer)
13611                    }
13612                }
13613                state.serialize_entry("frameRate", &__With(&self.frame_rate))?;
13614            }
13615            if !wkt::internal::is_default(&self.frame_rate_conversion_strategy) {
13616                state.serialize_entry(
13617                    "frameRateConversionStrategy",
13618                    &self.frame_rate_conversion_strategy,
13619                )?;
13620            }
13621            if !wkt::internal::is_default(&self.bitrate_bps) {
13622                struct __With<'a>(&'a i32);
13623                impl<'a> serde::ser::Serialize for __With<'a> {
13624                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13625                    where
13626                        S: serde::ser::Serializer,
13627                    {
13628                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
13629                    }
13630                }
13631                state.serialize_entry("bitrateBps", &__With(&self.bitrate_bps))?;
13632            }
13633            if !self.pixel_format.is_empty() {
13634                state.serialize_entry("pixelFormat", &self.pixel_format)?;
13635            }
13636            if !self.rate_control_mode.is_empty() {
13637                state.serialize_entry("rateControlMode", &self.rate_control_mode)?;
13638            }
13639            if !wkt::internal::is_default(&self.crf_level) {
13640                struct __With<'a>(&'a i32);
13641                impl<'a> serde::ser::Serialize for __With<'a> {
13642                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13643                    where
13644                        S: serde::ser::Serializer,
13645                    {
13646                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
13647                    }
13648                }
13649                state.serialize_entry("crfLevel", &__With(&self.crf_level))?;
13650            }
13651            if let Some(value) = self.gop_frame_count() {
13652                struct __With<'a>(&'a i32);
13653                impl<'a> serde::ser::Serialize for __With<'a> {
13654                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13655                    where
13656                        S: serde::ser::Serializer,
13657                    {
13658                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
13659                    }
13660                }
13661                state.serialize_entry("gopFrameCount", &__With(value))?;
13662            }
13663            if let Some(value) = self.gop_duration() {
13664                state.serialize_entry("gopDuration", value)?;
13665            }
13666            if !self.profile.is_empty() {
13667                state.serialize_entry("profile", &self.profile)?;
13668            }
13669            if let Some(value) = self.sdr() {
13670                state.serialize_entry("sdr", value)?;
13671            }
13672            if let Some(value) = self.hlg() {
13673                state.serialize_entry("hlg", value)?;
13674            }
13675            if !self._unknown_fields.is_empty() {
13676                for (key, value) in self._unknown_fields.iter() {
13677                    state.serialize_entry(key, &value)?;
13678                }
13679            }
13680            state.end()
13681        }
13682    }
13683
13684    impl std::fmt::Debug for Vp9CodecSettings {
13685        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13686            let mut debug_struct = f.debug_struct("Vp9CodecSettings");
13687            debug_struct.field("width_pixels", &self.width_pixels);
13688            debug_struct.field("height_pixels", &self.height_pixels);
13689            debug_struct.field("frame_rate", &self.frame_rate);
13690            debug_struct.field(
13691                "frame_rate_conversion_strategy",
13692                &self.frame_rate_conversion_strategy,
13693            );
13694            debug_struct.field("bitrate_bps", &self.bitrate_bps);
13695            debug_struct.field("pixel_format", &self.pixel_format);
13696            debug_struct.field("rate_control_mode", &self.rate_control_mode);
13697            debug_struct.field("crf_level", &self.crf_level);
13698            debug_struct.field("profile", &self.profile);
13699            debug_struct.field("gop_mode", &self.gop_mode);
13700            debug_struct.field("color_format", &self.color_format);
13701            if !self._unknown_fields.is_empty() {
13702                debug_struct.field("_unknown_fields", &self._unknown_fields);
13703            }
13704            debug_struct.finish()
13705        }
13706    }
13707
13708    /// Defines additional types related to [Vp9CodecSettings].
13709    pub mod vp_9_codec_settings {
13710        #[allow(unused_imports)]
13711        use super::*;
13712
13713        /// GOP mode can be either by frame count or duration.
13714        #[derive(Clone, Debug, PartialEq)]
13715        #[non_exhaustive]
13716        pub enum GopMode {
13717            /// Select the GOP size based on the specified frame count. Must be greater
13718            /// than zero.
13719            GopFrameCount(i32),
13720            /// Select the GOP size based on the specified duration. The default is
13721            /// `3s`. Note that `gopDuration` must be less than or equal to
13722            /// [`segmentDuration`](#SegmentSettings), and
13723            /// [`segmentDuration`](#SegmentSettings) must be divisible by
13724            /// `gopDuration`.
13725            GopDuration(std::boxed::Box<wkt::Duration>),
13726        }
13727
13728        /// Color format can be sdr or hlg.
13729        #[derive(Clone, Debug, PartialEq)]
13730        #[non_exhaustive]
13731        pub enum ColorFormat {
13732            /// Optional. SDR color format setting for VP9.
13733            Sdr(std::boxed::Box<crate::model::video_stream::Vp9ColorFormatSDR>),
13734            /// Optional. HLG color format setting for VP9.
13735            Hlg(std::boxed::Box<crate::model::video_stream::Vp9ColorFormatHLG>),
13736        }
13737    }
13738
13739    /// The conversion strategy for desired frame rate.
13740    ///
13741    /// # Working with unknown values
13742    ///
13743    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13744    /// additional enum variants at any time. Adding new variants is not considered
13745    /// a breaking change. Applications should write their code in anticipation of:
13746    ///
13747    /// - New values appearing in future releases of the client library, **and**
13748    /// - New values received dynamically, without application changes.
13749    ///
13750    /// Please consult the [Working with enums] section in the user guide for some
13751    /// guidelines.
13752    ///
13753    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13754    #[derive(Clone, Debug, PartialEq)]
13755    #[non_exhaustive]
13756    pub enum FrameRateConversionStrategy {
13757        /// Unspecified frame rate conversion strategy.
13758        Unspecified,
13759        /// Selectively retain frames to reduce the output frame rate.
13760        /// Every _n_ th frame is kept, where `n = ceil(input frame rate / target
13761        /// frame rate)`. When _n_ = 1 (that is, the target frame rate is greater
13762        /// than the input frame rate), the output frame rate matches the input frame
13763        /// rate. When _n_ > 1, frames are dropped and the output frame rate is
13764        /// equal to `(input frame rate / n)`. For more information, see
13765        /// [Calculate frame
13766        /// rate](https://cloud.google.com/transcoder/docs/concepts/frame-rate).
13767        Downsample,
13768        /// Drop or duplicate frames to match the specified frame rate.
13769        DropDuplicate,
13770        /// If set, the enum was initialized with an unknown value.
13771        ///
13772        /// Applications can examine the value using [FrameRateConversionStrategy::value] or
13773        /// [FrameRateConversionStrategy::name].
13774        UnknownValue(frame_rate_conversion_strategy::UnknownValue),
13775    }
13776
13777    #[doc(hidden)]
13778    pub mod frame_rate_conversion_strategy {
13779        #[allow(unused_imports)]
13780        use super::*;
13781        #[derive(Clone, Debug, PartialEq)]
13782        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13783    }
13784
13785    impl FrameRateConversionStrategy {
13786        /// Gets the enum value.
13787        ///
13788        /// Returns `None` if the enum contains an unknown value deserialized from
13789        /// the string representation of enums.
13790        pub fn value(&self) -> std::option::Option<i32> {
13791            match self {
13792                Self::Unspecified => std::option::Option::Some(0),
13793                Self::Downsample => std::option::Option::Some(1),
13794                Self::DropDuplicate => std::option::Option::Some(2),
13795                Self::UnknownValue(u) => u.0.value(),
13796            }
13797        }
13798
13799        /// Gets the enum value as a string.
13800        ///
13801        /// Returns `None` if the enum contains an unknown value deserialized from
13802        /// the integer representation of enums.
13803        pub fn name(&self) -> std::option::Option<&str> {
13804            match self {
13805                Self::Unspecified => {
13806                    std::option::Option::Some("FRAME_RATE_CONVERSION_STRATEGY_UNSPECIFIED")
13807                }
13808                Self::Downsample => std::option::Option::Some("DOWNSAMPLE"),
13809                Self::DropDuplicate => std::option::Option::Some("DROP_DUPLICATE"),
13810                Self::UnknownValue(u) => u.0.name(),
13811            }
13812        }
13813    }
13814
13815    impl std::default::Default for FrameRateConversionStrategy {
13816        fn default() -> Self {
13817            use std::convert::From;
13818            Self::from(0)
13819        }
13820    }
13821
13822    impl std::fmt::Display for FrameRateConversionStrategy {
13823        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13824            wkt::internal::display_enum(f, self.name(), self.value())
13825        }
13826    }
13827
13828    impl std::convert::From<i32> for FrameRateConversionStrategy {
13829        fn from(value: i32) -> Self {
13830            match value {
13831                0 => Self::Unspecified,
13832                1 => Self::Downsample,
13833                2 => Self::DropDuplicate,
13834                _ => Self::UnknownValue(frame_rate_conversion_strategy::UnknownValue(
13835                    wkt::internal::UnknownEnumValue::Integer(value),
13836                )),
13837            }
13838        }
13839    }
13840
13841    impl std::convert::From<&str> for FrameRateConversionStrategy {
13842        fn from(value: &str) -> Self {
13843            use std::string::ToString;
13844            match value {
13845                "FRAME_RATE_CONVERSION_STRATEGY_UNSPECIFIED" => Self::Unspecified,
13846                "DOWNSAMPLE" => Self::Downsample,
13847                "DROP_DUPLICATE" => Self::DropDuplicate,
13848                _ => Self::UnknownValue(frame_rate_conversion_strategy::UnknownValue(
13849                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13850                )),
13851            }
13852        }
13853    }
13854
13855    impl serde::ser::Serialize for FrameRateConversionStrategy {
13856        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13857        where
13858            S: serde::Serializer,
13859        {
13860            match self {
13861                Self::Unspecified => serializer.serialize_i32(0),
13862                Self::Downsample => serializer.serialize_i32(1),
13863                Self::DropDuplicate => serializer.serialize_i32(2),
13864                Self::UnknownValue(u) => u.0.serialize(serializer),
13865            }
13866        }
13867    }
13868
13869    impl<'de> serde::de::Deserialize<'de> for FrameRateConversionStrategy {
13870        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13871        where
13872            D: serde::Deserializer<'de>,
13873        {
13874            deserializer.deserialize_any(
13875                wkt::internal::EnumVisitor::<FrameRateConversionStrategy>::new(
13876                    ".google.cloud.video.transcoder.v1.VideoStream.FrameRateConversionStrategy",
13877                ),
13878            )
13879        }
13880    }
13881
13882    /// Codec settings can be h264, h265, or vp9.
13883    #[derive(Clone, Debug, PartialEq)]
13884    #[non_exhaustive]
13885    pub enum CodecSettings {
13886        /// H264 codec settings.
13887        H264(std::boxed::Box<crate::model::video_stream::H264CodecSettings>),
13888        /// H265 codec settings.
13889        H265(std::boxed::Box<crate::model::video_stream::H265CodecSettings>),
13890        /// VP9 codec settings.
13891        Vp9(std::boxed::Box<crate::model::video_stream::Vp9CodecSettings>),
13892    }
13893}
13894
13895/// Audio stream resource.
13896#[derive(Clone, Default, PartialEq)]
13897#[non_exhaustive]
13898pub struct AudioStream {
13899    /// The codec for this audio stream. The default is `aac`.
13900    ///
13901    /// Supported audio codecs:
13902    ///
13903    /// - `aac`
13904    /// - `aac-he`
13905    /// - `aac-he-v2`
13906    /// - `mp3`
13907    /// - `ac3`
13908    /// - `eac3`
13909    /// - `vorbis`
13910    pub codec: std::string::String,
13911
13912    /// Required. Audio bitrate in bits per second. Must be between 1 and
13913    /// 10,000,000.
13914    pub bitrate_bps: i32,
13915
13916    /// Number of audio channels. Must be between 1 and 6. The default is 2.
13917    pub channel_count: i32,
13918
13919    /// A list of channel names specifying layout of the audio channels.
13920    /// This only affects the metadata embedded in the container headers, if
13921    /// supported by the specified format. The default is `["fl", "fr"]`.
13922    ///
13923    /// Supported channel names:
13924    ///
13925    /// - `fl` - Front left channel
13926    /// - `fr` - Front right channel
13927    /// - `sl` - Side left channel
13928    /// - `sr` - Side right channel
13929    /// - `fc` - Front center channel
13930    /// - `lfe` - Low frequency
13931    pub channel_layout: std::vec::Vec<std::string::String>,
13932
13933    /// The mapping for the
13934    /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list]
13935    /// atoms with audio
13936    /// [EditAtom.inputs][google.cloud.video.transcoder.v1.EditAtom.inputs].
13937    ///
13938    /// [google.cloud.video.transcoder.v1.EditAtom.inputs]: crate::model::EditAtom::inputs
13939    /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
13940    pub mapping: std::vec::Vec<crate::model::audio_stream::AudioMapping>,
13941
13942    /// The audio sample rate in Hertz. The default is 48000 Hertz.
13943    pub sample_rate_hertz: i32,
13944
13945    /// The BCP-47 language code, such as `en-US` or `sr-Latn`. For more
13946    /// information, see
13947    /// <https://www.unicode.org/reports/tr35/#Unicode_locale_identifier>. Not
13948    /// supported in MP4 files.
13949    pub language_code: std::string::String,
13950
13951    /// The name for this particular audio stream that
13952    /// will be added to the HLS/DASH manifest. Not supported in MP4 files.
13953    pub display_name: std::string::String,
13954
13955    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13956}
13957
13958impl AudioStream {
13959    pub fn new() -> Self {
13960        std::default::Default::default()
13961    }
13962
13963    /// Sets the value of [codec][crate::model::AudioStream::codec].
13964    pub fn set_codec<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13965        self.codec = v.into();
13966        self
13967    }
13968
13969    /// Sets the value of [bitrate_bps][crate::model::AudioStream::bitrate_bps].
13970    pub fn set_bitrate_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13971        self.bitrate_bps = v.into();
13972        self
13973    }
13974
13975    /// Sets the value of [channel_count][crate::model::AudioStream::channel_count].
13976    pub fn set_channel_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13977        self.channel_count = v.into();
13978        self
13979    }
13980
13981    /// Sets the value of [channel_layout][crate::model::AudioStream::channel_layout].
13982    pub fn set_channel_layout<T, V>(mut self, v: T) -> Self
13983    where
13984        T: std::iter::IntoIterator<Item = V>,
13985        V: std::convert::Into<std::string::String>,
13986    {
13987        use std::iter::Iterator;
13988        self.channel_layout = v.into_iter().map(|i| i.into()).collect();
13989        self
13990    }
13991
13992    /// Sets the value of [mapping][crate::model::AudioStream::mapping].
13993    pub fn set_mapping<T, V>(mut self, v: T) -> Self
13994    where
13995        T: std::iter::IntoIterator<Item = V>,
13996        V: std::convert::Into<crate::model::audio_stream::AudioMapping>,
13997    {
13998        use std::iter::Iterator;
13999        self.mapping = v.into_iter().map(|i| i.into()).collect();
14000        self
14001    }
14002
14003    /// Sets the value of [sample_rate_hertz][crate::model::AudioStream::sample_rate_hertz].
14004    pub fn set_sample_rate_hertz<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14005        self.sample_rate_hertz = v.into();
14006        self
14007    }
14008
14009    /// Sets the value of [language_code][crate::model::AudioStream::language_code].
14010    pub fn set_language_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14011        self.language_code = v.into();
14012        self
14013    }
14014
14015    /// Sets the value of [display_name][crate::model::AudioStream::display_name].
14016    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14017        self.display_name = v.into();
14018        self
14019    }
14020}
14021
14022impl wkt::message::Message for AudioStream {
14023    fn typename() -> &'static str {
14024        "type.googleapis.com/google.cloud.video.transcoder.v1.AudioStream"
14025    }
14026}
14027
14028#[doc(hidden)]
14029impl<'de> serde::de::Deserialize<'de> for AudioStream {
14030    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14031    where
14032        D: serde::Deserializer<'de>,
14033    {
14034        #[allow(non_camel_case_types)]
14035        #[doc(hidden)]
14036        #[derive(PartialEq, Eq, Hash)]
14037        enum __FieldTag {
14038            __codec,
14039            __bitrate_bps,
14040            __channel_count,
14041            __channel_layout,
14042            __mapping,
14043            __sample_rate_hertz,
14044            __language_code,
14045            __display_name,
14046            Unknown(std::string::String),
14047        }
14048        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
14049            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14050            where
14051                D: serde::Deserializer<'de>,
14052            {
14053                struct Visitor;
14054                impl<'de> serde::de::Visitor<'de> for Visitor {
14055                    type Value = __FieldTag;
14056                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14057                        formatter.write_str("a field name for AudioStream")
14058                    }
14059                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
14060                    where
14061                        E: serde::de::Error,
14062                    {
14063                        use std::result::Result::Ok;
14064                        use std::string::ToString;
14065                        match value {
14066                            "codec" => Ok(__FieldTag::__codec),
14067                            "bitrateBps" => Ok(__FieldTag::__bitrate_bps),
14068                            "bitrate_bps" => Ok(__FieldTag::__bitrate_bps),
14069                            "channelCount" => Ok(__FieldTag::__channel_count),
14070                            "channel_count" => Ok(__FieldTag::__channel_count),
14071                            "channelLayout" => Ok(__FieldTag::__channel_layout),
14072                            "channel_layout" => Ok(__FieldTag::__channel_layout),
14073                            "mapping" => Ok(__FieldTag::__mapping),
14074                            "sampleRateHertz" => Ok(__FieldTag::__sample_rate_hertz),
14075                            "sample_rate_hertz" => Ok(__FieldTag::__sample_rate_hertz),
14076                            "languageCode" => Ok(__FieldTag::__language_code),
14077                            "language_code" => Ok(__FieldTag::__language_code),
14078                            "displayName" => Ok(__FieldTag::__display_name),
14079                            "display_name" => Ok(__FieldTag::__display_name),
14080                            _ => Ok(__FieldTag::Unknown(value.to_string())),
14081                        }
14082                    }
14083                }
14084                deserializer.deserialize_identifier(Visitor)
14085            }
14086        }
14087        struct Visitor;
14088        impl<'de> serde::de::Visitor<'de> for Visitor {
14089            type Value = AudioStream;
14090            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14091                formatter.write_str("struct AudioStream")
14092            }
14093            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
14094            where
14095                A: serde::de::MapAccess<'de>,
14096            {
14097                #[allow(unused_imports)]
14098                use serde::de::Error;
14099                use std::option::Option::Some;
14100                let mut fields = std::collections::HashSet::new();
14101                let mut result = Self::Value::new();
14102                while let Some(tag) = map.next_key::<__FieldTag>()? {
14103                    #[allow(clippy::match_single_binding)]
14104                    match tag {
14105                        __FieldTag::__codec => {
14106                            if !fields.insert(__FieldTag::__codec) {
14107                                return std::result::Result::Err(A::Error::duplicate_field(
14108                                    "multiple values for codec",
14109                                ));
14110                            }
14111                            result.codec = map
14112                                .next_value::<std::option::Option<std::string::String>>()?
14113                                .unwrap_or_default();
14114                        }
14115                        __FieldTag::__bitrate_bps => {
14116                            if !fields.insert(__FieldTag::__bitrate_bps) {
14117                                return std::result::Result::Err(A::Error::duplicate_field(
14118                                    "multiple values for bitrate_bps",
14119                                ));
14120                            }
14121                            struct __With(std::option::Option<i32>);
14122                            impl<'de> serde::de::Deserialize<'de> for __With {
14123                                fn deserialize<D>(
14124                                    deserializer: D,
14125                                ) -> std::result::Result<Self, D::Error>
14126                                where
14127                                    D: serde::de::Deserializer<'de>,
14128                                {
14129                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
14130                                }
14131                            }
14132                            result.bitrate_bps = map.next_value::<__With>()?.0.unwrap_or_default();
14133                        }
14134                        __FieldTag::__channel_count => {
14135                            if !fields.insert(__FieldTag::__channel_count) {
14136                                return std::result::Result::Err(A::Error::duplicate_field(
14137                                    "multiple values for channel_count",
14138                                ));
14139                            }
14140                            struct __With(std::option::Option<i32>);
14141                            impl<'de> serde::de::Deserialize<'de> for __With {
14142                                fn deserialize<D>(
14143                                    deserializer: D,
14144                                ) -> std::result::Result<Self, D::Error>
14145                                where
14146                                    D: serde::de::Deserializer<'de>,
14147                                {
14148                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
14149                                }
14150                            }
14151                            result.channel_count =
14152                                map.next_value::<__With>()?.0.unwrap_or_default();
14153                        }
14154                        __FieldTag::__channel_layout => {
14155                            if !fields.insert(__FieldTag::__channel_layout) {
14156                                return std::result::Result::Err(A::Error::duplicate_field(
14157                                    "multiple values for channel_layout",
14158                                ));
14159                            }
14160                            result.channel_layout = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
14161                        }
14162                        __FieldTag::__mapping => {
14163                            if !fields.insert(__FieldTag::__mapping) {
14164                                return std::result::Result::Err(A::Error::duplicate_field(
14165                                    "multiple values for mapping",
14166                                ));
14167                            }
14168                            result.mapping = map
14169                                .next_value::<std::option::Option<
14170                                    std::vec::Vec<crate::model::audio_stream::AudioMapping>,
14171                                >>()?
14172                                .unwrap_or_default();
14173                        }
14174                        __FieldTag::__sample_rate_hertz => {
14175                            if !fields.insert(__FieldTag::__sample_rate_hertz) {
14176                                return std::result::Result::Err(A::Error::duplicate_field(
14177                                    "multiple values for sample_rate_hertz",
14178                                ));
14179                            }
14180                            struct __With(std::option::Option<i32>);
14181                            impl<'de> serde::de::Deserialize<'de> for __With {
14182                                fn deserialize<D>(
14183                                    deserializer: D,
14184                                ) -> std::result::Result<Self, D::Error>
14185                                where
14186                                    D: serde::de::Deserializer<'de>,
14187                                {
14188                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
14189                                }
14190                            }
14191                            result.sample_rate_hertz =
14192                                map.next_value::<__With>()?.0.unwrap_or_default();
14193                        }
14194                        __FieldTag::__language_code => {
14195                            if !fields.insert(__FieldTag::__language_code) {
14196                                return std::result::Result::Err(A::Error::duplicate_field(
14197                                    "multiple values for language_code",
14198                                ));
14199                            }
14200                            result.language_code = map
14201                                .next_value::<std::option::Option<std::string::String>>()?
14202                                .unwrap_or_default();
14203                        }
14204                        __FieldTag::__display_name => {
14205                            if !fields.insert(__FieldTag::__display_name) {
14206                                return std::result::Result::Err(A::Error::duplicate_field(
14207                                    "multiple values for display_name",
14208                                ));
14209                            }
14210                            result.display_name = map
14211                                .next_value::<std::option::Option<std::string::String>>()?
14212                                .unwrap_or_default();
14213                        }
14214                        __FieldTag::Unknown(key) => {
14215                            let value = map.next_value::<serde_json::Value>()?;
14216                            result._unknown_fields.insert(key, value);
14217                        }
14218                    }
14219                }
14220                std::result::Result::Ok(result)
14221            }
14222        }
14223        deserializer.deserialize_any(Visitor)
14224    }
14225}
14226
14227#[doc(hidden)]
14228impl serde::ser::Serialize for AudioStream {
14229    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14230    where
14231        S: serde::ser::Serializer,
14232    {
14233        use serde::ser::SerializeMap;
14234        #[allow(unused_imports)]
14235        use std::option::Option::Some;
14236        let mut state = serializer.serialize_map(std::option::Option::None)?;
14237        if !self.codec.is_empty() {
14238            state.serialize_entry("codec", &self.codec)?;
14239        }
14240        if !wkt::internal::is_default(&self.bitrate_bps) {
14241            struct __With<'a>(&'a i32);
14242            impl<'a> serde::ser::Serialize for __With<'a> {
14243                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14244                where
14245                    S: serde::ser::Serializer,
14246                {
14247                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
14248                }
14249            }
14250            state.serialize_entry("bitrateBps", &__With(&self.bitrate_bps))?;
14251        }
14252        if !wkt::internal::is_default(&self.channel_count) {
14253            struct __With<'a>(&'a i32);
14254            impl<'a> serde::ser::Serialize for __With<'a> {
14255                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14256                where
14257                    S: serde::ser::Serializer,
14258                {
14259                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
14260                }
14261            }
14262            state.serialize_entry("channelCount", &__With(&self.channel_count))?;
14263        }
14264        if !self.channel_layout.is_empty() {
14265            state.serialize_entry("channelLayout", &self.channel_layout)?;
14266        }
14267        if !self.mapping.is_empty() {
14268            state.serialize_entry("mapping", &self.mapping)?;
14269        }
14270        if !wkt::internal::is_default(&self.sample_rate_hertz) {
14271            struct __With<'a>(&'a i32);
14272            impl<'a> serde::ser::Serialize for __With<'a> {
14273                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14274                where
14275                    S: serde::ser::Serializer,
14276                {
14277                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
14278                }
14279            }
14280            state.serialize_entry("sampleRateHertz", &__With(&self.sample_rate_hertz))?;
14281        }
14282        if !self.language_code.is_empty() {
14283            state.serialize_entry("languageCode", &self.language_code)?;
14284        }
14285        if !self.display_name.is_empty() {
14286            state.serialize_entry("displayName", &self.display_name)?;
14287        }
14288        if !self._unknown_fields.is_empty() {
14289            for (key, value) in self._unknown_fields.iter() {
14290                state.serialize_entry(key, &value)?;
14291            }
14292        }
14293        state.end()
14294    }
14295}
14296
14297impl std::fmt::Debug for AudioStream {
14298    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14299        let mut debug_struct = f.debug_struct("AudioStream");
14300        debug_struct.field("codec", &self.codec);
14301        debug_struct.field("bitrate_bps", &self.bitrate_bps);
14302        debug_struct.field("channel_count", &self.channel_count);
14303        debug_struct.field("channel_layout", &self.channel_layout);
14304        debug_struct.field("mapping", &self.mapping);
14305        debug_struct.field("sample_rate_hertz", &self.sample_rate_hertz);
14306        debug_struct.field("language_code", &self.language_code);
14307        debug_struct.field("display_name", &self.display_name);
14308        if !self._unknown_fields.is_empty() {
14309            debug_struct.field("_unknown_fields", &self._unknown_fields);
14310        }
14311        debug_struct.finish()
14312    }
14313}
14314
14315/// Defines additional types related to [AudioStream].
14316pub mod audio_stream {
14317    #[allow(unused_imports)]
14318    use super::*;
14319
14320    /// The mapping for the
14321    /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list]
14322    /// atoms with audio
14323    /// [EditAtom.inputs][google.cloud.video.transcoder.v1.EditAtom.inputs].
14324    ///
14325    /// [google.cloud.video.transcoder.v1.EditAtom.inputs]: crate::model::EditAtom::inputs
14326    /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
14327    #[derive(Clone, Default, PartialEq)]
14328    #[non_exhaustive]
14329    pub struct AudioMapping {
14330        /// Required. The
14331        /// [EditAtom.key][google.cloud.video.transcoder.v1.EditAtom.key] that
14332        /// references the atom with audio inputs in the
14333        /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list].
14334        ///
14335        /// [google.cloud.video.transcoder.v1.EditAtom.key]: crate::model::EditAtom::key
14336        /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
14337        pub atom_key: std::string::String,
14338
14339        /// Required. The [Input.key][google.cloud.video.transcoder.v1.Input.key]
14340        /// that identifies the input file.
14341        ///
14342        /// [google.cloud.video.transcoder.v1.Input.key]: crate::model::Input::key
14343        pub input_key: std::string::String,
14344
14345        /// Required. The zero-based index of the track in the input file.
14346        pub input_track: i32,
14347
14348        /// Required. The zero-based index of the channel in the input audio stream.
14349        pub input_channel: i32,
14350
14351        /// Required. The zero-based index of the channel in the output audio stream.
14352        pub output_channel: i32,
14353
14354        /// Audio volume control in dB. Negative values decrease volume,
14355        /// positive values increase. The default is 0.
14356        pub gain_db: f64,
14357
14358        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14359    }
14360
14361    impl AudioMapping {
14362        pub fn new() -> Self {
14363            std::default::Default::default()
14364        }
14365
14366        /// Sets the value of [atom_key][crate::model::audio_stream::AudioMapping::atom_key].
14367        pub fn set_atom_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14368            self.atom_key = v.into();
14369            self
14370        }
14371
14372        /// Sets the value of [input_key][crate::model::audio_stream::AudioMapping::input_key].
14373        pub fn set_input_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14374            self.input_key = v.into();
14375            self
14376        }
14377
14378        /// Sets the value of [input_track][crate::model::audio_stream::AudioMapping::input_track].
14379        pub fn set_input_track<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14380            self.input_track = v.into();
14381            self
14382        }
14383
14384        /// Sets the value of [input_channel][crate::model::audio_stream::AudioMapping::input_channel].
14385        pub fn set_input_channel<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14386            self.input_channel = v.into();
14387            self
14388        }
14389
14390        /// Sets the value of [output_channel][crate::model::audio_stream::AudioMapping::output_channel].
14391        pub fn set_output_channel<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14392            self.output_channel = v.into();
14393            self
14394        }
14395
14396        /// Sets the value of [gain_db][crate::model::audio_stream::AudioMapping::gain_db].
14397        pub fn set_gain_db<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
14398            self.gain_db = v.into();
14399            self
14400        }
14401    }
14402
14403    impl wkt::message::Message for AudioMapping {
14404        fn typename() -> &'static str {
14405            "type.googleapis.com/google.cloud.video.transcoder.v1.AudioStream.AudioMapping"
14406        }
14407    }
14408
14409    #[doc(hidden)]
14410    impl<'de> serde::de::Deserialize<'de> for AudioMapping {
14411        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14412        where
14413            D: serde::Deserializer<'de>,
14414        {
14415            #[allow(non_camel_case_types)]
14416            #[doc(hidden)]
14417            #[derive(PartialEq, Eq, Hash)]
14418            enum __FieldTag {
14419                __atom_key,
14420                __input_key,
14421                __input_track,
14422                __input_channel,
14423                __output_channel,
14424                __gain_db,
14425                Unknown(std::string::String),
14426            }
14427            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
14428                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14429                where
14430                    D: serde::Deserializer<'de>,
14431                {
14432                    struct Visitor;
14433                    impl<'de> serde::de::Visitor<'de> for Visitor {
14434                        type Value = __FieldTag;
14435                        fn expecting(
14436                            &self,
14437                            formatter: &mut std::fmt::Formatter,
14438                        ) -> std::fmt::Result {
14439                            formatter.write_str("a field name for AudioMapping")
14440                        }
14441                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
14442                        where
14443                            E: serde::de::Error,
14444                        {
14445                            use std::result::Result::Ok;
14446                            use std::string::ToString;
14447                            match value {
14448                                "atomKey" => Ok(__FieldTag::__atom_key),
14449                                "atom_key" => Ok(__FieldTag::__atom_key),
14450                                "inputKey" => Ok(__FieldTag::__input_key),
14451                                "input_key" => Ok(__FieldTag::__input_key),
14452                                "inputTrack" => Ok(__FieldTag::__input_track),
14453                                "input_track" => Ok(__FieldTag::__input_track),
14454                                "inputChannel" => Ok(__FieldTag::__input_channel),
14455                                "input_channel" => Ok(__FieldTag::__input_channel),
14456                                "outputChannel" => Ok(__FieldTag::__output_channel),
14457                                "output_channel" => Ok(__FieldTag::__output_channel),
14458                                "gainDb" => Ok(__FieldTag::__gain_db),
14459                                "gain_db" => Ok(__FieldTag::__gain_db),
14460                                _ => Ok(__FieldTag::Unknown(value.to_string())),
14461                            }
14462                        }
14463                    }
14464                    deserializer.deserialize_identifier(Visitor)
14465                }
14466            }
14467            struct Visitor;
14468            impl<'de> serde::de::Visitor<'de> for Visitor {
14469                type Value = AudioMapping;
14470                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14471                    formatter.write_str("struct AudioMapping")
14472                }
14473                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
14474                where
14475                    A: serde::de::MapAccess<'de>,
14476                {
14477                    #[allow(unused_imports)]
14478                    use serde::de::Error;
14479                    use std::option::Option::Some;
14480                    let mut fields = std::collections::HashSet::new();
14481                    let mut result = Self::Value::new();
14482                    while let Some(tag) = map.next_key::<__FieldTag>()? {
14483                        #[allow(clippy::match_single_binding)]
14484                        match tag {
14485                            __FieldTag::__atom_key => {
14486                                if !fields.insert(__FieldTag::__atom_key) {
14487                                    return std::result::Result::Err(A::Error::duplicate_field(
14488                                        "multiple values for atom_key",
14489                                    ));
14490                                }
14491                                result.atom_key = map
14492                                    .next_value::<std::option::Option<std::string::String>>()?
14493                                    .unwrap_or_default();
14494                            }
14495                            __FieldTag::__input_key => {
14496                                if !fields.insert(__FieldTag::__input_key) {
14497                                    return std::result::Result::Err(A::Error::duplicate_field(
14498                                        "multiple values for input_key",
14499                                    ));
14500                                }
14501                                result.input_key = map
14502                                    .next_value::<std::option::Option<std::string::String>>()?
14503                                    .unwrap_or_default();
14504                            }
14505                            __FieldTag::__input_track => {
14506                                if !fields.insert(__FieldTag::__input_track) {
14507                                    return std::result::Result::Err(A::Error::duplicate_field(
14508                                        "multiple values for input_track",
14509                                    ));
14510                                }
14511                                struct __With(std::option::Option<i32>);
14512                                impl<'de> serde::de::Deserialize<'de> for __With {
14513                                    fn deserialize<D>(
14514                                        deserializer: D,
14515                                    ) -> std::result::Result<Self, D::Error>
14516                                    where
14517                                        D: serde::de::Deserializer<'de>,
14518                                    {
14519                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
14520                                    }
14521                                }
14522                                result.input_track =
14523                                    map.next_value::<__With>()?.0.unwrap_or_default();
14524                            }
14525                            __FieldTag::__input_channel => {
14526                                if !fields.insert(__FieldTag::__input_channel) {
14527                                    return std::result::Result::Err(A::Error::duplicate_field(
14528                                        "multiple values for input_channel",
14529                                    ));
14530                                }
14531                                struct __With(std::option::Option<i32>);
14532                                impl<'de> serde::de::Deserialize<'de> for __With {
14533                                    fn deserialize<D>(
14534                                        deserializer: D,
14535                                    ) -> std::result::Result<Self, D::Error>
14536                                    where
14537                                        D: serde::de::Deserializer<'de>,
14538                                    {
14539                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
14540                                    }
14541                                }
14542                                result.input_channel =
14543                                    map.next_value::<__With>()?.0.unwrap_or_default();
14544                            }
14545                            __FieldTag::__output_channel => {
14546                                if !fields.insert(__FieldTag::__output_channel) {
14547                                    return std::result::Result::Err(A::Error::duplicate_field(
14548                                        "multiple values for output_channel",
14549                                    ));
14550                                }
14551                                struct __With(std::option::Option<i32>);
14552                                impl<'de> serde::de::Deserialize<'de> for __With {
14553                                    fn deserialize<D>(
14554                                        deserializer: D,
14555                                    ) -> std::result::Result<Self, D::Error>
14556                                    where
14557                                        D: serde::de::Deserializer<'de>,
14558                                    {
14559                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
14560                                    }
14561                                }
14562                                result.output_channel =
14563                                    map.next_value::<__With>()?.0.unwrap_or_default();
14564                            }
14565                            __FieldTag::__gain_db => {
14566                                if !fields.insert(__FieldTag::__gain_db) {
14567                                    return std::result::Result::Err(A::Error::duplicate_field(
14568                                        "multiple values for gain_db",
14569                                    ));
14570                                }
14571                                struct __With(std::option::Option<f64>);
14572                                impl<'de> serde::de::Deserialize<'de> for __With {
14573                                    fn deserialize<D>(
14574                                        deserializer: D,
14575                                    ) -> std::result::Result<Self, D::Error>
14576                                    where
14577                                        D: serde::de::Deserializer<'de>,
14578                                    {
14579                                        serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
14580                                    }
14581                                }
14582                                result.gain_db = map.next_value::<__With>()?.0.unwrap_or_default();
14583                            }
14584                            __FieldTag::Unknown(key) => {
14585                                let value = map.next_value::<serde_json::Value>()?;
14586                                result._unknown_fields.insert(key, value);
14587                            }
14588                        }
14589                    }
14590                    std::result::Result::Ok(result)
14591                }
14592            }
14593            deserializer.deserialize_any(Visitor)
14594        }
14595    }
14596
14597    #[doc(hidden)]
14598    impl serde::ser::Serialize for AudioMapping {
14599        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14600        where
14601            S: serde::ser::Serializer,
14602        {
14603            use serde::ser::SerializeMap;
14604            #[allow(unused_imports)]
14605            use std::option::Option::Some;
14606            let mut state = serializer.serialize_map(std::option::Option::None)?;
14607            if !self.atom_key.is_empty() {
14608                state.serialize_entry("atomKey", &self.atom_key)?;
14609            }
14610            if !self.input_key.is_empty() {
14611                state.serialize_entry("inputKey", &self.input_key)?;
14612            }
14613            if !wkt::internal::is_default(&self.input_track) {
14614                struct __With<'a>(&'a i32);
14615                impl<'a> serde::ser::Serialize for __With<'a> {
14616                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14617                    where
14618                        S: serde::ser::Serializer,
14619                    {
14620                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
14621                    }
14622                }
14623                state.serialize_entry("inputTrack", &__With(&self.input_track))?;
14624            }
14625            if !wkt::internal::is_default(&self.input_channel) {
14626                struct __With<'a>(&'a i32);
14627                impl<'a> serde::ser::Serialize for __With<'a> {
14628                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14629                    where
14630                        S: serde::ser::Serializer,
14631                    {
14632                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
14633                    }
14634                }
14635                state.serialize_entry("inputChannel", &__With(&self.input_channel))?;
14636            }
14637            if !wkt::internal::is_default(&self.output_channel) {
14638                struct __With<'a>(&'a i32);
14639                impl<'a> serde::ser::Serialize for __With<'a> {
14640                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14641                    where
14642                        S: serde::ser::Serializer,
14643                    {
14644                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
14645                    }
14646                }
14647                state.serialize_entry("outputChannel", &__With(&self.output_channel))?;
14648            }
14649            if !wkt::internal::is_default(&self.gain_db) {
14650                struct __With<'a>(&'a f64);
14651                impl<'a> serde::ser::Serialize for __With<'a> {
14652                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14653                    where
14654                        S: serde::ser::Serializer,
14655                    {
14656                        serde_with::As::<wkt::internal::F64>::serialize(self.0, serializer)
14657                    }
14658                }
14659                state.serialize_entry("gainDb", &__With(&self.gain_db))?;
14660            }
14661            if !self._unknown_fields.is_empty() {
14662                for (key, value) in self._unknown_fields.iter() {
14663                    state.serialize_entry(key, &value)?;
14664                }
14665            }
14666            state.end()
14667        }
14668    }
14669
14670    impl std::fmt::Debug for AudioMapping {
14671        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14672            let mut debug_struct = f.debug_struct("AudioMapping");
14673            debug_struct.field("atom_key", &self.atom_key);
14674            debug_struct.field("input_key", &self.input_key);
14675            debug_struct.field("input_track", &self.input_track);
14676            debug_struct.field("input_channel", &self.input_channel);
14677            debug_struct.field("output_channel", &self.output_channel);
14678            debug_struct.field("gain_db", &self.gain_db);
14679            if !self._unknown_fields.is_empty() {
14680                debug_struct.field("_unknown_fields", &self._unknown_fields);
14681            }
14682            debug_struct.finish()
14683        }
14684    }
14685}
14686
14687/// Encoding of a text stream. For example, closed captions or subtitles.
14688#[derive(Clone, Default, PartialEq)]
14689#[non_exhaustive]
14690pub struct TextStream {
14691    /// The codec for this text stream. The default is `webvtt`.
14692    ///
14693    /// Supported text codecs:
14694    ///
14695    /// - `srt`
14696    /// - `ttml`
14697    /// - `cea608`
14698    /// - `cea708`
14699    /// - `webvtt`
14700    pub codec: std::string::String,
14701
14702    /// The BCP-47 language code, such as `en-US` or `sr-Latn`. For more
14703    /// information, see
14704    /// <https://www.unicode.org/reports/tr35/#Unicode_locale_identifier>. Not
14705    /// supported in MP4 files.
14706    pub language_code: std::string::String,
14707
14708    /// The mapping for the
14709    /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list]
14710    /// atoms with text
14711    /// [EditAtom.inputs][google.cloud.video.transcoder.v1.EditAtom.inputs].
14712    ///
14713    /// [google.cloud.video.transcoder.v1.EditAtom.inputs]: crate::model::EditAtom::inputs
14714    /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
14715    pub mapping: std::vec::Vec<crate::model::text_stream::TextMapping>,
14716
14717    /// The name for this particular text stream that
14718    /// will be added to the HLS/DASH manifest. Not supported in MP4 files.
14719    pub display_name: std::string::String,
14720
14721    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14722}
14723
14724impl TextStream {
14725    pub fn new() -> Self {
14726        std::default::Default::default()
14727    }
14728
14729    /// Sets the value of [codec][crate::model::TextStream::codec].
14730    pub fn set_codec<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14731        self.codec = v.into();
14732        self
14733    }
14734
14735    /// Sets the value of [language_code][crate::model::TextStream::language_code].
14736    pub fn set_language_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14737        self.language_code = v.into();
14738        self
14739    }
14740
14741    /// Sets the value of [mapping][crate::model::TextStream::mapping].
14742    pub fn set_mapping<T, V>(mut self, v: T) -> Self
14743    where
14744        T: std::iter::IntoIterator<Item = V>,
14745        V: std::convert::Into<crate::model::text_stream::TextMapping>,
14746    {
14747        use std::iter::Iterator;
14748        self.mapping = v.into_iter().map(|i| i.into()).collect();
14749        self
14750    }
14751
14752    /// Sets the value of [display_name][crate::model::TextStream::display_name].
14753    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14754        self.display_name = v.into();
14755        self
14756    }
14757}
14758
14759impl wkt::message::Message for TextStream {
14760    fn typename() -> &'static str {
14761        "type.googleapis.com/google.cloud.video.transcoder.v1.TextStream"
14762    }
14763}
14764
14765#[doc(hidden)]
14766impl<'de> serde::de::Deserialize<'de> for TextStream {
14767    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14768    where
14769        D: serde::Deserializer<'de>,
14770    {
14771        #[allow(non_camel_case_types)]
14772        #[doc(hidden)]
14773        #[derive(PartialEq, Eq, Hash)]
14774        enum __FieldTag {
14775            __codec,
14776            __language_code,
14777            __mapping,
14778            __display_name,
14779            Unknown(std::string::String),
14780        }
14781        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
14782            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14783            where
14784                D: serde::Deserializer<'de>,
14785            {
14786                struct Visitor;
14787                impl<'de> serde::de::Visitor<'de> for Visitor {
14788                    type Value = __FieldTag;
14789                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14790                        formatter.write_str("a field name for TextStream")
14791                    }
14792                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
14793                    where
14794                        E: serde::de::Error,
14795                    {
14796                        use std::result::Result::Ok;
14797                        use std::string::ToString;
14798                        match value {
14799                            "codec" => Ok(__FieldTag::__codec),
14800                            "languageCode" => Ok(__FieldTag::__language_code),
14801                            "language_code" => Ok(__FieldTag::__language_code),
14802                            "mapping" => Ok(__FieldTag::__mapping),
14803                            "displayName" => Ok(__FieldTag::__display_name),
14804                            "display_name" => Ok(__FieldTag::__display_name),
14805                            _ => Ok(__FieldTag::Unknown(value.to_string())),
14806                        }
14807                    }
14808                }
14809                deserializer.deserialize_identifier(Visitor)
14810            }
14811        }
14812        struct Visitor;
14813        impl<'de> serde::de::Visitor<'de> for Visitor {
14814            type Value = TextStream;
14815            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
14816                formatter.write_str("struct TextStream")
14817            }
14818            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
14819            where
14820                A: serde::de::MapAccess<'de>,
14821            {
14822                #[allow(unused_imports)]
14823                use serde::de::Error;
14824                use std::option::Option::Some;
14825                let mut fields = std::collections::HashSet::new();
14826                let mut result = Self::Value::new();
14827                while let Some(tag) = map.next_key::<__FieldTag>()? {
14828                    #[allow(clippy::match_single_binding)]
14829                    match tag {
14830                        __FieldTag::__codec => {
14831                            if !fields.insert(__FieldTag::__codec) {
14832                                return std::result::Result::Err(A::Error::duplicate_field(
14833                                    "multiple values for codec",
14834                                ));
14835                            }
14836                            result.codec = map
14837                                .next_value::<std::option::Option<std::string::String>>()?
14838                                .unwrap_or_default();
14839                        }
14840                        __FieldTag::__language_code => {
14841                            if !fields.insert(__FieldTag::__language_code) {
14842                                return std::result::Result::Err(A::Error::duplicate_field(
14843                                    "multiple values for language_code",
14844                                ));
14845                            }
14846                            result.language_code = map
14847                                .next_value::<std::option::Option<std::string::String>>()?
14848                                .unwrap_or_default();
14849                        }
14850                        __FieldTag::__mapping => {
14851                            if !fields.insert(__FieldTag::__mapping) {
14852                                return std::result::Result::Err(A::Error::duplicate_field(
14853                                    "multiple values for mapping",
14854                                ));
14855                            }
14856                            result.mapping = map
14857                                .next_value::<std::option::Option<
14858                                    std::vec::Vec<crate::model::text_stream::TextMapping>,
14859                                >>()?
14860                                .unwrap_or_default();
14861                        }
14862                        __FieldTag::__display_name => {
14863                            if !fields.insert(__FieldTag::__display_name) {
14864                                return std::result::Result::Err(A::Error::duplicate_field(
14865                                    "multiple values for display_name",
14866                                ));
14867                            }
14868                            result.display_name = map
14869                                .next_value::<std::option::Option<std::string::String>>()?
14870                                .unwrap_or_default();
14871                        }
14872                        __FieldTag::Unknown(key) => {
14873                            let value = map.next_value::<serde_json::Value>()?;
14874                            result._unknown_fields.insert(key, value);
14875                        }
14876                    }
14877                }
14878                std::result::Result::Ok(result)
14879            }
14880        }
14881        deserializer.deserialize_any(Visitor)
14882    }
14883}
14884
14885#[doc(hidden)]
14886impl serde::ser::Serialize for TextStream {
14887    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14888    where
14889        S: serde::ser::Serializer,
14890    {
14891        use serde::ser::SerializeMap;
14892        #[allow(unused_imports)]
14893        use std::option::Option::Some;
14894        let mut state = serializer.serialize_map(std::option::Option::None)?;
14895        if !self.codec.is_empty() {
14896            state.serialize_entry("codec", &self.codec)?;
14897        }
14898        if !self.language_code.is_empty() {
14899            state.serialize_entry("languageCode", &self.language_code)?;
14900        }
14901        if !self.mapping.is_empty() {
14902            state.serialize_entry("mapping", &self.mapping)?;
14903        }
14904        if !self.display_name.is_empty() {
14905            state.serialize_entry("displayName", &self.display_name)?;
14906        }
14907        if !self._unknown_fields.is_empty() {
14908            for (key, value) in self._unknown_fields.iter() {
14909                state.serialize_entry(key, &value)?;
14910            }
14911        }
14912        state.end()
14913    }
14914}
14915
14916impl std::fmt::Debug for TextStream {
14917    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14918        let mut debug_struct = f.debug_struct("TextStream");
14919        debug_struct.field("codec", &self.codec);
14920        debug_struct.field("language_code", &self.language_code);
14921        debug_struct.field("mapping", &self.mapping);
14922        debug_struct.field("display_name", &self.display_name);
14923        if !self._unknown_fields.is_empty() {
14924            debug_struct.field("_unknown_fields", &self._unknown_fields);
14925        }
14926        debug_struct.finish()
14927    }
14928}
14929
14930/// Defines additional types related to [TextStream].
14931pub mod text_stream {
14932    #[allow(unused_imports)]
14933    use super::*;
14934
14935    /// The mapping for the
14936    /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list]
14937    /// atoms with text
14938    /// [EditAtom.inputs][google.cloud.video.transcoder.v1.EditAtom.inputs].
14939    ///
14940    /// [google.cloud.video.transcoder.v1.EditAtom.inputs]: crate::model::EditAtom::inputs
14941    /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
14942    #[derive(Clone, Default, PartialEq)]
14943    #[non_exhaustive]
14944    pub struct TextMapping {
14945        /// Required. The
14946        /// [EditAtom.key][google.cloud.video.transcoder.v1.EditAtom.key] that
14947        /// references atom with text inputs in the
14948        /// [JobConfig.edit_list][google.cloud.video.transcoder.v1.JobConfig.edit_list].
14949        ///
14950        /// [google.cloud.video.transcoder.v1.EditAtom.key]: crate::model::EditAtom::key
14951        /// [google.cloud.video.transcoder.v1.JobConfig.edit_list]: crate::model::JobConfig::edit_list
14952        pub atom_key: std::string::String,
14953
14954        /// Required. The [Input.key][google.cloud.video.transcoder.v1.Input.key]
14955        /// that identifies the input file.
14956        ///
14957        /// [google.cloud.video.transcoder.v1.Input.key]: crate::model::Input::key
14958        pub input_key: std::string::String,
14959
14960        /// Required. The zero-based index of the track in the input file.
14961        pub input_track: i32,
14962
14963        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14964    }
14965
14966    impl TextMapping {
14967        pub fn new() -> Self {
14968            std::default::Default::default()
14969        }
14970
14971        /// Sets the value of [atom_key][crate::model::text_stream::TextMapping::atom_key].
14972        pub fn set_atom_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14973            self.atom_key = v.into();
14974            self
14975        }
14976
14977        /// Sets the value of [input_key][crate::model::text_stream::TextMapping::input_key].
14978        pub fn set_input_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14979            self.input_key = v.into();
14980            self
14981        }
14982
14983        /// Sets the value of [input_track][crate::model::text_stream::TextMapping::input_track].
14984        pub fn set_input_track<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14985            self.input_track = v.into();
14986            self
14987        }
14988    }
14989
14990    impl wkt::message::Message for TextMapping {
14991        fn typename() -> &'static str {
14992            "type.googleapis.com/google.cloud.video.transcoder.v1.TextStream.TextMapping"
14993        }
14994    }
14995
14996    #[doc(hidden)]
14997    impl<'de> serde::de::Deserialize<'de> for TextMapping {
14998        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14999        where
15000            D: serde::Deserializer<'de>,
15001        {
15002            #[allow(non_camel_case_types)]
15003            #[doc(hidden)]
15004            #[derive(PartialEq, Eq, Hash)]
15005            enum __FieldTag {
15006                __atom_key,
15007                __input_key,
15008                __input_track,
15009                Unknown(std::string::String),
15010            }
15011            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
15012                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15013                where
15014                    D: serde::Deserializer<'de>,
15015                {
15016                    struct Visitor;
15017                    impl<'de> serde::de::Visitor<'de> for Visitor {
15018                        type Value = __FieldTag;
15019                        fn expecting(
15020                            &self,
15021                            formatter: &mut std::fmt::Formatter,
15022                        ) -> std::fmt::Result {
15023                            formatter.write_str("a field name for TextMapping")
15024                        }
15025                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
15026                        where
15027                            E: serde::de::Error,
15028                        {
15029                            use std::result::Result::Ok;
15030                            use std::string::ToString;
15031                            match value {
15032                                "atomKey" => Ok(__FieldTag::__atom_key),
15033                                "atom_key" => Ok(__FieldTag::__atom_key),
15034                                "inputKey" => Ok(__FieldTag::__input_key),
15035                                "input_key" => Ok(__FieldTag::__input_key),
15036                                "inputTrack" => Ok(__FieldTag::__input_track),
15037                                "input_track" => Ok(__FieldTag::__input_track),
15038                                _ => Ok(__FieldTag::Unknown(value.to_string())),
15039                            }
15040                        }
15041                    }
15042                    deserializer.deserialize_identifier(Visitor)
15043                }
15044            }
15045            struct Visitor;
15046            impl<'de> serde::de::Visitor<'de> for Visitor {
15047                type Value = TextMapping;
15048                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15049                    formatter.write_str("struct TextMapping")
15050                }
15051                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
15052                where
15053                    A: serde::de::MapAccess<'de>,
15054                {
15055                    #[allow(unused_imports)]
15056                    use serde::de::Error;
15057                    use std::option::Option::Some;
15058                    let mut fields = std::collections::HashSet::new();
15059                    let mut result = Self::Value::new();
15060                    while let Some(tag) = map.next_key::<__FieldTag>()? {
15061                        #[allow(clippy::match_single_binding)]
15062                        match tag {
15063                            __FieldTag::__atom_key => {
15064                                if !fields.insert(__FieldTag::__atom_key) {
15065                                    return std::result::Result::Err(A::Error::duplicate_field(
15066                                        "multiple values for atom_key",
15067                                    ));
15068                                }
15069                                result.atom_key = map
15070                                    .next_value::<std::option::Option<std::string::String>>()?
15071                                    .unwrap_or_default();
15072                            }
15073                            __FieldTag::__input_key => {
15074                                if !fields.insert(__FieldTag::__input_key) {
15075                                    return std::result::Result::Err(A::Error::duplicate_field(
15076                                        "multiple values for input_key",
15077                                    ));
15078                                }
15079                                result.input_key = map
15080                                    .next_value::<std::option::Option<std::string::String>>()?
15081                                    .unwrap_or_default();
15082                            }
15083                            __FieldTag::__input_track => {
15084                                if !fields.insert(__FieldTag::__input_track) {
15085                                    return std::result::Result::Err(A::Error::duplicate_field(
15086                                        "multiple values for input_track",
15087                                    ));
15088                                }
15089                                struct __With(std::option::Option<i32>);
15090                                impl<'de> serde::de::Deserialize<'de> for __With {
15091                                    fn deserialize<D>(
15092                                        deserializer: D,
15093                                    ) -> std::result::Result<Self, D::Error>
15094                                    where
15095                                        D: serde::de::Deserializer<'de>,
15096                                    {
15097                                        serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
15098                                    }
15099                                }
15100                                result.input_track =
15101                                    map.next_value::<__With>()?.0.unwrap_or_default();
15102                            }
15103                            __FieldTag::Unknown(key) => {
15104                                let value = map.next_value::<serde_json::Value>()?;
15105                                result._unknown_fields.insert(key, value);
15106                            }
15107                        }
15108                    }
15109                    std::result::Result::Ok(result)
15110                }
15111            }
15112            deserializer.deserialize_any(Visitor)
15113        }
15114    }
15115
15116    #[doc(hidden)]
15117    impl serde::ser::Serialize for TextMapping {
15118        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15119        where
15120            S: serde::ser::Serializer,
15121        {
15122            use serde::ser::SerializeMap;
15123            #[allow(unused_imports)]
15124            use std::option::Option::Some;
15125            let mut state = serializer.serialize_map(std::option::Option::None)?;
15126            if !self.atom_key.is_empty() {
15127                state.serialize_entry("atomKey", &self.atom_key)?;
15128            }
15129            if !self.input_key.is_empty() {
15130                state.serialize_entry("inputKey", &self.input_key)?;
15131            }
15132            if !wkt::internal::is_default(&self.input_track) {
15133                struct __With<'a>(&'a i32);
15134                impl<'a> serde::ser::Serialize for __With<'a> {
15135                    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15136                    where
15137                        S: serde::ser::Serializer,
15138                    {
15139                        serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
15140                    }
15141                }
15142                state.serialize_entry("inputTrack", &__With(&self.input_track))?;
15143            }
15144            if !self._unknown_fields.is_empty() {
15145                for (key, value) in self._unknown_fields.iter() {
15146                    state.serialize_entry(key, &value)?;
15147                }
15148            }
15149            state.end()
15150        }
15151    }
15152
15153    impl std::fmt::Debug for TextMapping {
15154        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15155            let mut debug_struct = f.debug_struct("TextMapping");
15156            debug_struct.field("atom_key", &self.atom_key);
15157            debug_struct.field("input_key", &self.input_key);
15158            debug_struct.field("input_track", &self.input_track);
15159            if !self._unknown_fields.is_empty() {
15160                debug_struct.field("_unknown_fields", &self._unknown_fields);
15161            }
15162            debug_struct.finish()
15163        }
15164    }
15165}
15166
15167/// Segment settings for `ts`, `fmp4` and `vtt`.
15168#[derive(Clone, Default, PartialEq)]
15169#[non_exhaustive]
15170pub struct SegmentSettings {
15171    /// Duration of the segments in seconds. The default is `6.0s`. Note that
15172    /// `segmentDuration` must be greater than or equal to
15173    /// [`gopDuration`](#videostream), and `segmentDuration` must be divisible by
15174    /// [`gopDuration`](#videostream).
15175    pub segment_duration: std::option::Option<wkt::Duration>,
15176
15177    /// Required. Create an individual segment file. The default is `false`.
15178    pub individual_segments: bool,
15179
15180    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15181}
15182
15183impl SegmentSettings {
15184    pub fn new() -> Self {
15185        std::default::Default::default()
15186    }
15187
15188    /// Sets the value of [segment_duration][crate::model::SegmentSettings::segment_duration].
15189    pub fn set_segment_duration<T>(mut self, v: T) -> Self
15190    where
15191        T: std::convert::Into<wkt::Duration>,
15192    {
15193        self.segment_duration = std::option::Option::Some(v.into());
15194        self
15195    }
15196
15197    /// Sets or clears the value of [segment_duration][crate::model::SegmentSettings::segment_duration].
15198    pub fn set_or_clear_segment_duration<T>(mut self, v: std::option::Option<T>) -> Self
15199    where
15200        T: std::convert::Into<wkt::Duration>,
15201    {
15202        self.segment_duration = v.map(|x| x.into());
15203        self
15204    }
15205
15206    /// Sets the value of [individual_segments][crate::model::SegmentSettings::individual_segments].
15207    pub fn set_individual_segments<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15208        self.individual_segments = v.into();
15209        self
15210    }
15211}
15212
15213impl wkt::message::Message for SegmentSettings {
15214    fn typename() -> &'static str {
15215        "type.googleapis.com/google.cloud.video.transcoder.v1.SegmentSettings"
15216    }
15217}
15218
15219#[doc(hidden)]
15220impl<'de> serde::de::Deserialize<'de> for SegmentSettings {
15221    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15222    where
15223        D: serde::Deserializer<'de>,
15224    {
15225        #[allow(non_camel_case_types)]
15226        #[doc(hidden)]
15227        #[derive(PartialEq, Eq, Hash)]
15228        enum __FieldTag {
15229            __segment_duration,
15230            __individual_segments,
15231            Unknown(std::string::String),
15232        }
15233        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
15234            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15235            where
15236                D: serde::Deserializer<'de>,
15237            {
15238                struct Visitor;
15239                impl<'de> serde::de::Visitor<'de> for Visitor {
15240                    type Value = __FieldTag;
15241                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15242                        formatter.write_str("a field name for SegmentSettings")
15243                    }
15244                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
15245                    where
15246                        E: serde::de::Error,
15247                    {
15248                        use std::result::Result::Ok;
15249                        use std::string::ToString;
15250                        match value {
15251                            "segmentDuration" => Ok(__FieldTag::__segment_duration),
15252                            "segment_duration" => Ok(__FieldTag::__segment_duration),
15253                            "individualSegments" => Ok(__FieldTag::__individual_segments),
15254                            "individual_segments" => Ok(__FieldTag::__individual_segments),
15255                            _ => Ok(__FieldTag::Unknown(value.to_string())),
15256                        }
15257                    }
15258                }
15259                deserializer.deserialize_identifier(Visitor)
15260            }
15261        }
15262        struct Visitor;
15263        impl<'de> serde::de::Visitor<'de> for Visitor {
15264            type Value = SegmentSettings;
15265            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15266                formatter.write_str("struct SegmentSettings")
15267            }
15268            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
15269            where
15270                A: serde::de::MapAccess<'de>,
15271            {
15272                #[allow(unused_imports)]
15273                use serde::de::Error;
15274                use std::option::Option::Some;
15275                let mut fields = std::collections::HashSet::new();
15276                let mut result = Self::Value::new();
15277                while let Some(tag) = map.next_key::<__FieldTag>()? {
15278                    #[allow(clippy::match_single_binding)]
15279                    match tag {
15280                        __FieldTag::__segment_duration => {
15281                            if !fields.insert(__FieldTag::__segment_duration) {
15282                                return std::result::Result::Err(A::Error::duplicate_field(
15283                                    "multiple values for segment_duration",
15284                                ));
15285                            }
15286                            result.segment_duration =
15287                                map.next_value::<std::option::Option<wkt::Duration>>()?;
15288                        }
15289                        __FieldTag::__individual_segments => {
15290                            if !fields.insert(__FieldTag::__individual_segments) {
15291                                return std::result::Result::Err(A::Error::duplicate_field(
15292                                    "multiple values for individual_segments",
15293                                ));
15294                            }
15295                            result.individual_segments = map
15296                                .next_value::<std::option::Option<bool>>()?
15297                                .unwrap_or_default();
15298                        }
15299                        __FieldTag::Unknown(key) => {
15300                            let value = map.next_value::<serde_json::Value>()?;
15301                            result._unknown_fields.insert(key, value);
15302                        }
15303                    }
15304                }
15305                std::result::Result::Ok(result)
15306            }
15307        }
15308        deserializer.deserialize_any(Visitor)
15309    }
15310}
15311
15312#[doc(hidden)]
15313impl serde::ser::Serialize for SegmentSettings {
15314    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15315    where
15316        S: serde::ser::Serializer,
15317    {
15318        use serde::ser::SerializeMap;
15319        #[allow(unused_imports)]
15320        use std::option::Option::Some;
15321        let mut state = serializer.serialize_map(std::option::Option::None)?;
15322        if self.segment_duration.is_some() {
15323            state.serialize_entry("segmentDuration", &self.segment_duration)?;
15324        }
15325        if !wkt::internal::is_default(&self.individual_segments) {
15326            state.serialize_entry("individualSegments", &self.individual_segments)?;
15327        }
15328        if !self._unknown_fields.is_empty() {
15329            for (key, value) in self._unknown_fields.iter() {
15330                state.serialize_entry(key, &value)?;
15331            }
15332        }
15333        state.end()
15334    }
15335}
15336
15337impl std::fmt::Debug for SegmentSettings {
15338    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15339        let mut debug_struct = f.debug_struct("SegmentSettings");
15340        debug_struct.field("segment_duration", &self.segment_duration);
15341        debug_struct.field("individual_segments", &self.individual_segments);
15342        if !self._unknown_fields.is_empty() {
15343            debug_struct.field("_unknown_fields", &self._unknown_fields);
15344        }
15345        debug_struct.finish()
15346    }
15347}
15348
15349/// Encryption settings.
15350#[derive(Clone, Default, PartialEq)]
15351#[non_exhaustive]
15352pub struct Encryption {
15353    /// Required. Identifier for this set of encryption options.
15354    pub id: std::string::String,
15355
15356    /// Required. DRM system(s) to use; at least one must be specified. If a
15357    /// DRM system is omitted, it is considered disabled.
15358    pub drm_systems: std::option::Option<crate::model::encryption::DrmSystems>,
15359
15360    /// Encryption mode can be either `aes` or `cenc`.
15361    pub encryption_mode: std::option::Option<crate::model::encryption::EncryptionMode>,
15362
15363    /// Defines where content keys are stored.
15364    pub secret_source: std::option::Option<crate::model::encryption::SecretSource>,
15365
15366    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15367}
15368
15369impl Encryption {
15370    pub fn new() -> Self {
15371        std::default::Default::default()
15372    }
15373
15374    /// Sets the value of [id][crate::model::Encryption::id].
15375    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15376        self.id = v.into();
15377        self
15378    }
15379
15380    /// Sets the value of [drm_systems][crate::model::Encryption::drm_systems].
15381    pub fn set_drm_systems<T>(mut self, v: T) -> Self
15382    where
15383        T: std::convert::Into<crate::model::encryption::DrmSystems>,
15384    {
15385        self.drm_systems = std::option::Option::Some(v.into());
15386        self
15387    }
15388
15389    /// Sets or clears the value of [drm_systems][crate::model::Encryption::drm_systems].
15390    pub fn set_or_clear_drm_systems<T>(mut self, v: std::option::Option<T>) -> Self
15391    where
15392        T: std::convert::Into<crate::model::encryption::DrmSystems>,
15393    {
15394        self.drm_systems = v.map(|x| x.into());
15395        self
15396    }
15397
15398    /// Sets the value of [encryption_mode][crate::model::Encryption::encryption_mode].
15399    ///
15400    /// Note that all the setters affecting `encryption_mode` are mutually
15401    /// exclusive.
15402    pub fn set_encryption_mode<
15403        T: std::convert::Into<std::option::Option<crate::model::encryption::EncryptionMode>>,
15404    >(
15405        mut self,
15406        v: T,
15407    ) -> Self {
15408        self.encryption_mode = v.into();
15409        self
15410    }
15411
15412    /// The value of [encryption_mode][crate::model::Encryption::encryption_mode]
15413    /// if it holds a `Aes128`, `None` if the field is not set or
15414    /// holds a different branch.
15415    pub fn aes_128(
15416        &self,
15417    ) -> std::option::Option<&std::boxed::Box<crate::model::encryption::Aes128Encryption>> {
15418        #[allow(unreachable_patterns)]
15419        self.encryption_mode.as_ref().and_then(|v| match v {
15420            crate::model::encryption::EncryptionMode::Aes128(v) => std::option::Option::Some(v),
15421            _ => std::option::Option::None,
15422        })
15423    }
15424
15425    /// Sets the value of [encryption_mode][crate::model::Encryption::encryption_mode]
15426    /// to hold a `Aes128`.
15427    ///
15428    /// Note that all the setters affecting `encryption_mode` are
15429    /// mutually exclusive.
15430    pub fn set_aes_128<
15431        T: std::convert::Into<std::boxed::Box<crate::model::encryption::Aes128Encryption>>,
15432    >(
15433        mut self,
15434        v: T,
15435    ) -> Self {
15436        self.encryption_mode =
15437            std::option::Option::Some(crate::model::encryption::EncryptionMode::Aes128(v.into()));
15438        self
15439    }
15440
15441    /// The value of [encryption_mode][crate::model::Encryption::encryption_mode]
15442    /// if it holds a `SampleAes`, `None` if the field is not set or
15443    /// holds a different branch.
15444    pub fn sample_aes(
15445        &self,
15446    ) -> std::option::Option<&std::boxed::Box<crate::model::encryption::SampleAesEncryption>> {
15447        #[allow(unreachable_patterns)]
15448        self.encryption_mode.as_ref().and_then(|v| match v {
15449            crate::model::encryption::EncryptionMode::SampleAes(v) => std::option::Option::Some(v),
15450            _ => std::option::Option::None,
15451        })
15452    }
15453
15454    /// Sets the value of [encryption_mode][crate::model::Encryption::encryption_mode]
15455    /// to hold a `SampleAes`.
15456    ///
15457    /// Note that all the setters affecting `encryption_mode` are
15458    /// mutually exclusive.
15459    pub fn set_sample_aes<
15460        T: std::convert::Into<std::boxed::Box<crate::model::encryption::SampleAesEncryption>>,
15461    >(
15462        mut self,
15463        v: T,
15464    ) -> Self {
15465        self.encryption_mode = std::option::Option::Some(
15466            crate::model::encryption::EncryptionMode::SampleAes(v.into()),
15467        );
15468        self
15469    }
15470
15471    /// The value of [encryption_mode][crate::model::Encryption::encryption_mode]
15472    /// if it holds a `MpegCenc`, `None` if the field is not set or
15473    /// holds a different branch.
15474    pub fn mpeg_cenc(
15475        &self,
15476    ) -> std::option::Option<&std::boxed::Box<crate::model::encryption::MpegCommonEncryption>> {
15477        #[allow(unreachable_patterns)]
15478        self.encryption_mode.as_ref().and_then(|v| match v {
15479            crate::model::encryption::EncryptionMode::MpegCenc(v) => std::option::Option::Some(v),
15480            _ => std::option::Option::None,
15481        })
15482    }
15483
15484    /// Sets the value of [encryption_mode][crate::model::Encryption::encryption_mode]
15485    /// to hold a `MpegCenc`.
15486    ///
15487    /// Note that all the setters affecting `encryption_mode` are
15488    /// mutually exclusive.
15489    pub fn set_mpeg_cenc<
15490        T: std::convert::Into<std::boxed::Box<crate::model::encryption::MpegCommonEncryption>>,
15491    >(
15492        mut self,
15493        v: T,
15494    ) -> Self {
15495        self.encryption_mode =
15496            std::option::Option::Some(crate::model::encryption::EncryptionMode::MpegCenc(v.into()));
15497        self
15498    }
15499
15500    /// Sets the value of [secret_source][crate::model::Encryption::secret_source].
15501    ///
15502    /// Note that all the setters affecting `secret_source` are mutually
15503    /// exclusive.
15504    pub fn set_secret_source<
15505        T: std::convert::Into<std::option::Option<crate::model::encryption::SecretSource>>,
15506    >(
15507        mut self,
15508        v: T,
15509    ) -> Self {
15510        self.secret_source = v.into();
15511        self
15512    }
15513
15514    /// The value of [secret_source][crate::model::Encryption::secret_source]
15515    /// if it holds a `SecretManagerKeySource`, `None` if the field is not set or
15516    /// holds a different branch.
15517    pub fn secret_manager_key_source(
15518        &self,
15519    ) -> std::option::Option<&std::boxed::Box<crate::model::encryption::SecretManagerSource>> {
15520        #[allow(unreachable_patterns)]
15521        self.secret_source.as_ref().and_then(|v| match v {
15522            crate::model::encryption::SecretSource::SecretManagerKeySource(v) => {
15523                std::option::Option::Some(v)
15524            }
15525            _ => std::option::Option::None,
15526        })
15527    }
15528
15529    /// Sets the value of [secret_source][crate::model::Encryption::secret_source]
15530    /// to hold a `SecretManagerKeySource`.
15531    ///
15532    /// Note that all the setters affecting `secret_source` are
15533    /// mutually exclusive.
15534    pub fn set_secret_manager_key_source<
15535        T: std::convert::Into<std::boxed::Box<crate::model::encryption::SecretManagerSource>>,
15536    >(
15537        mut self,
15538        v: T,
15539    ) -> Self {
15540        self.secret_source = std::option::Option::Some(
15541            crate::model::encryption::SecretSource::SecretManagerKeySource(v.into()),
15542        );
15543        self
15544    }
15545}
15546
15547impl wkt::message::Message for Encryption {
15548    fn typename() -> &'static str {
15549        "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption"
15550    }
15551}
15552
15553#[doc(hidden)]
15554impl<'de> serde::de::Deserialize<'de> for Encryption {
15555    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15556    where
15557        D: serde::Deserializer<'de>,
15558    {
15559        #[allow(non_camel_case_types)]
15560        #[doc(hidden)]
15561        #[derive(PartialEq, Eq, Hash)]
15562        enum __FieldTag {
15563            __id,
15564            __aes_128,
15565            __sample_aes,
15566            __mpeg_cenc,
15567            __secret_manager_key_source,
15568            __drm_systems,
15569            Unknown(std::string::String),
15570        }
15571        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
15572            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15573            where
15574                D: serde::Deserializer<'de>,
15575            {
15576                struct Visitor;
15577                impl<'de> serde::de::Visitor<'de> for Visitor {
15578                    type Value = __FieldTag;
15579                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15580                        formatter.write_str("a field name for Encryption")
15581                    }
15582                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
15583                    where
15584                        E: serde::de::Error,
15585                    {
15586                        use std::result::Result::Ok;
15587                        use std::string::ToString;
15588                        match value {
15589                            "id" => Ok(__FieldTag::__id),
15590                            "aes128" => Ok(__FieldTag::__aes_128),
15591                            "aes_128" => Ok(__FieldTag::__aes_128),
15592                            "sampleAes" => Ok(__FieldTag::__sample_aes),
15593                            "sample_aes" => Ok(__FieldTag::__sample_aes),
15594                            "mpegCenc" => Ok(__FieldTag::__mpeg_cenc),
15595                            "mpeg_cenc" => Ok(__FieldTag::__mpeg_cenc),
15596                            "secretManagerKeySource" => Ok(__FieldTag::__secret_manager_key_source),
15597                            "secret_manager_key_source" => {
15598                                Ok(__FieldTag::__secret_manager_key_source)
15599                            }
15600                            "drmSystems" => Ok(__FieldTag::__drm_systems),
15601                            "drm_systems" => Ok(__FieldTag::__drm_systems),
15602                            _ => Ok(__FieldTag::Unknown(value.to_string())),
15603                        }
15604                    }
15605                }
15606                deserializer.deserialize_identifier(Visitor)
15607            }
15608        }
15609        struct Visitor;
15610        impl<'de> serde::de::Visitor<'de> for Visitor {
15611            type Value = Encryption;
15612            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15613                formatter.write_str("struct Encryption")
15614            }
15615            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
15616            where
15617                A: serde::de::MapAccess<'de>,
15618            {
15619                #[allow(unused_imports)]
15620                use serde::de::Error;
15621                use std::option::Option::Some;
15622                let mut fields = std::collections::HashSet::new();
15623                let mut result = Self::Value::new();
15624                while let Some(tag) = map.next_key::<__FieldTag>()? {
15625                    #[allow(clippy::match_single_binding)]
15626                    match tag {
15627                        __FieldTag::__id => {
15628                            if !fields.insert(__FieldTag::__id) {
15629                                return std::result::Result::Err(A::Error::duplicate_field(
15630                                    "multiple values for id",
15631                                ));
15632                            }
15633                            result.id = map
15634                                .next_value::<std::option::Option<std::string::String>>()?
15635                                .unwrap_or_default();
15636                        }
15637                        __FieldTag::__aes_128 => {
15638                            if !fields.insert(__FieldTag::__aes_128) {
15639                                return std::result::Result::Err(A::Error::duplicate_field(
15640                                    "multiple values for aes_128",
15641                                ));
15642                            }
15643                            if result.encryption_mode.is_some() {
15644                                return std::result::Result::Err(A::Error::duplicate_field(
15645                                    "multiple values for `encryption_mode`, a oneof with full ID .google.cloud.video.transcoder.v1.Encryption.aes_128, latest field was aes128",
15646                                ));
15647                            }
15648                            result.encryption_mode = std::option::Option::Some(
15649                                crate::model::encryption::EncryptionMode::Aes128(
15650                                    map.next_value::<std::option::Option<
15651                                        std::boxed::Box<crate::model::encryption::Aes128Encryption>,
15652                                    >>()?
15653                                    .unwrap_or_default(),
15654                                ),
15655                            );
15656                        }
15657                        __FieldTag::__sample_aes => {
15658                            if !fields.insert(__FieldTag::__sample_aes) {
15659                                return std::result::Result::Err(A::Error::duplicate_field(
15660                                    "multiple values for sample_aes",
15661                                ));
15662                            }
15663                            if result.encryption_mode.is_some() {
15664                                return std::result::Result::Err(A::Error::duplicate_field(
15665                                    "multiple values for `encryption_mode`, a oneof with full ID .google.cloud.video.transcoder.v1.Encryption.sample_aes, latest field was sampleAes",
15666                                ));
15667                            }
15668                            result.encryption_mode = std::option::Option::Some(
15669                                crate::model::encryption::EncryptionMode::SampleAes(
15670                                    map.next_value::<std::option::Option<
15671                                        std::boxed::Box<
15672                                            crate::model::encryption::SampleAesEncryption,
15673                                        >,
15674                                    >>()?
15675                                    .unwrap_or_default(),
15676                                ),
15677                            );
15678                        }
15679                        __FieldTag::__mpeg_cenc => {
15680                            if !fields.insert(__FieldTag::__mpeg_cenc) {
15681                                return std::result::Result::Err(A::Error::duplicate_field(
15682                                    "multiple values for mpeg_cenc",
15683                                ));
15684                            }
15685                            if result.encryption_mode.is_some() {
15686                                return std::result::Result::Err(A::Error::duplicate_field(
15687                                    "multiple values for `encryption_mode`, a oneof with full ID .google.cloud.video.transcoder.v1.Encryption.mpeg_cenc, latest field was mpegCenc",
15688                                ));
15689                            }
15690                            result.encryption_mode = std::option::Option::Some(
15691                                crate::model::encryption::EncryptionMode::MpegCenc(
15692                                    map.next_value::<std::option::Option<
15693                                        std::boxed::Box<
15694                                            crate::model::encryption::MpegCommonEncryption,
15695                                        >,
15696                                    >>()?
15697                                    .unwrap_or_default(),
15698                                ),
15699                            );
15700                        }
15701                        __FieldTag::__secret_manager_key_source => {
15702                            if !fields.insert(__FieldTag::__secret_manager_key_source) {
15703                                return std::result::Result::Err(A::Error::duplicate_field(
15704                                    "multiple values for secret_manager_key_source",
15705                                ));
15706                            }
15707                            if result.secret_source.is_some() {
15708                                return std::result::Result::Err(A::Error::duplicate_field(
15709                                    "multiple values for `secret_source`, a oneof with full ID .google.cloud.video.transcoder.v1.Encryption.secret_manager_key_source, latest field was secretManagerKeySource",
15710                                ));
15711                            }
15712                            result.secret_source = std::option::Option::Some(
15713                                crate::model::encryption::SecretSource::SecretManagerKeySource(
15714                                    map.next_value::<std::option::Option<
15715                                        std::boxed::Box<
15716                                            crate::model::encryption::SecretManagerSource,
15717                                        >,
15718                                    >>()?
15719                                    .unwrap_or_default(),
15720                                ),
15721                            );
15722                        }
15723                        __FieldTag::__drm_systems => {
15724                            if !fields.insert(__FieldTag::__drm_systems) {
15725                                return std::result::Result::Err(A::Error::duplicate_field(
15726                                    "multiple values for drm_systems",
15727                                ));
15728                            }
15729                            result.drm_systems = map.next_value::<std::option::Option<crate::model::encryption::DrmSystems>>()?
15730                                ;
15731                        }
15732                        __FieldTag::Unknown(key) => {
15733                            let value = map.next_value::<serde_json::Value>()?;
15734                            result._unknown_fields.insert(key, value);
15735                        }
15736                    }
15737                }
15738                std::result::Result::Ok(result)
15739            }
15740        }
15741        deserializer.deserialize_any(Visitor)
15742    }
15743}
15744
15745#[doc(hidden)]
15746impl serde::ser::Serialize for Encryption {
15747    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15748    where
15749        S: serde::ser::Serializer,
15750    {
15751        use serde::ser::SerializeMap;
15752        #[allow(unused_imports)]
15753        use std::option::Option::Some;
15754        let mut state = serializer.serialize_map(std::option::Option::None)?;
15755        if !self.id.is_empty() {
15756            state.serialize_entry("id", &self.id)?;
15757        }
15758        if let Some(value) = self.aes_128() {
15759            state.serialize_entry("aes128", value)?;
15760        }
15761        if let Some(value) = self.sample_aes() {
15762            state.serialize_entry("sampleAes", value)?;
15763        }
15764        if let Some(value) = self.mpeg_cenc() {
15765            state.serialize_entry("mpegCenc", value)?;
15766        }
15767        if let Some(value) = self.secret_manager_key_source() {
15768            state.serialize_entry("secretManagerKeySource", value)?;
15769        }
15770        if self.drm_systems.is_some() {
15771            state.serialize_entry("drmSystems", &self.drm_systems)?;
15772        }
15773        if !self._unknown_fields.is_empty() {
15774            for (key, value) in self._unknown_fields.iter() {
15775                state.serialize_entry(key, &value)?;
15776            }
15777        }
15778        state.end()
15779    }
15780}
15781
15782impl std::fmt::Debug for Encryption {
15783    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15784        let mut debug_struct = f.debug_struct("Encryption");
15785        debug_struct.field("id", &self.id);
15786        debug_struct.field("drm_systems", &self.drm_systems);
15787        debug_struct.field("encryption_mode", &self.encryption_mode);
15788        debug_struct.field("secret_source", &self.secret_source);
15789        if !self._unknown_fields.is_empty() {
15790            debug_struct.field("_unknown_fields", &self._unknown_fields);
15791        }
15792        debug_struct.finish()
15793    }
15794}
15795
15796/// Defines additional types related to [Encryption].
15797pub mod encryption {
15798    #[allow(unused_imports)]
15799    use super::*;
15800
15801    /// Configuration for AES-128 encryption.
15802    #[derive(Clone, Default, PartialEq)]
15803    #[non_exhaustive]
15804    pub struct Aes128Encryption {
15805        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15806    }
15807
15808    impl Aes128Encryption {
15809        pub fn new() -> Self {
15810            std::default::Default::default()
15811        }
15812    }
15813
15814    impl wkt::message::Message for Aes128Encryption {
15815        fn typename() -> &'static str {
15816            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Aes128Encryption"
15817        }
15818    }
15819
15820    #[doc(hidden)]
15821    impl<'de> serde::de::Deserialize<'de> for Aes128Encryption {
15822        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15823        where
15824            D: serde::Deserializer<'de>,
15825        {
15826            #[allow(non_camel_case_types)]
15827            #[doc(hidden)]
15828            #[derive(PartialEq, Eq, Hash)]
15829            enum __FieldTag {
15830                Unknown(std::string::String),
15831            }
15832            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
15833                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15834                where
15835                    D: serde::Deserializer<'de>,
15836                {
15837                    struct Visitor;
15838                    impl<'de> serde::de::Visitor<'de> for Visitor {
15839                        type Value = __FieldTag;
15840                        fn expecting(
15841                            &self,
15842                            formatter: &mut std::fmt::Formatter,
15843                        ) -> std::fmt::Result {
15844                            formatter.write_str("a field name for Aes128Encryption")
15845                        }
15846                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
15847                        where
15848                            E: serde::de::Error,
15849                        {
15850                            use std::result::Result::Ok;
15851                            use std::string::ToString;
15852                            Ok(__FieldTag::Unknown(value.to_string()))
15853                        }
15854                    }
15855                    deserializer.deserialize_identifier(Visitor)
15856                }
15857            }
15858            struct Visitor;
15859            impl<'de> serde::de::Visitor<'de> for Visitor {
15860                type Value = Aes128Encryption;
15861                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15862                    formatter.write_str("struct Aes128Encryption")
15863                }
15864                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
15865                where
15866                    A: serde::de::MapAccess<'de>,
15867                {
15868                    #[allow(unused_imports)]
15869                    use serde::de::Error;
15870                    use std::option::Option::Some;
15871                    let mut result = Self::Value::new();
15872                    while let Some(tag) = map.next_key::<__FieldTag>()? {
15873                        #[allow(clippy::match_single_binding)]
15874                        match tag {
15875                            __FieldTag::Unknown(key) => {
15876                                let value = map.next_value::<serde_json::Value>()?;
15877                                result._unknown_fields.insert(key, value);
15878                            }
15879                        }
15880                    }
15881                    std::result::Result::Ok(result)
15882                }
15883            }
15884            deserializer.deserialize_any(Visitor)
15885        }
15886    }
15887
15888    #[doc(hidden)]
15889    impl serde::ser::Serialize for Aes128Encryption {
15890        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15891        where
15892            S: serde::ser::Serializer,
15893        {
15894            use serde::ser::SerializeMap;
15895            #[allow(unused_imports)]
15896            use std::option::Option::Some;
15897            let mut state = serializer.serialize_map(std::option::Option::None)?;
15898            if !self._unknown_fields.is_empty() {
15899                for (key, value) in self._unknown_fields.iter() {
15900                    state.serialize_entry(key, &value)?;
15901                }
15902            }
15903            state.end()
15904        }
15905    }
15906
15907    impl std::fmt::Debug for Aes128Encryption {
15908        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15909            let mut debug_struct = f.debug_struct("Aes128Encryption");
15910            if !self._unknown_fields.is_empty() {
15911                debug_struct.field("_unknown_fields", &self._unknown_fields);
15912            }
15913            debug_struct.finish()
15914        }
15915    }
15916
15917    /// Configuration for SAMPLE-AES encryption.
15918    #[derive(Clone, Default, PartialEq)]
15919    #[non_exhaustive]
15920    pub struct SampleAesEncryption {
15921        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15922    }
15923
15924    impl SampleAesEncryption {
15925        pub fn new() -> Self {
15926            std::default::Default::default()
15927        }
15928    }
15929
15930    impl wkt::message::Message for SampleAesEncryption {
15931        fn typename() -> &'static str {
15932            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.SampleAesEncryption"
15933        }
15934    }
15935
15936    #[doc(hidden)]
15937    impl<'de> serde::de::Deserialize<'de> for SampleAesEncryption {
15938        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15939        where
15940            D: serde::Deserializer<'de>,
15941        {
15942            #[allow(non_camel_case_types)]
15943            #[doc(hidden)]
15944            #[derive(PartialEq, Eq, Hash)]
15945            enum __FieldTag {
15946                Unknown(std::string::String),
15947            }
15948            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
15949                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15950                where
15951                    D: serde::Deserializer<'de>,
15952                {
15953                    struct Visitor;
15954                    impl<'de> serde::de::Visitor<'de> for Visitor {
15955                        type Value = __FieldTag;
15956                        fn expecting(
15957                            &self,
15958                            formatter: &mut std::fmt::Formatter,
15959                        ) -> std::fmt::Result {
15960                            formatter.write_str("a field name for SampleAesEncryption")
15961                        }
15962                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
15963                        where
15964                            E: serde::de::Error,
15965                        {
15966                            use std::result::Result::Ok;
15967                            use std::string::ToString;
15968                            Ok(__FieldTag::Unknown(value.to_string()))
15969                        }
15970                    }
15971                    deserializer.deserialize_identifier(Visitor)
15972                }
15973            }
15974            struct Visitor;
15975            impl<'de> serde::de::Visitor<'de> for Visitor {
15976                type Value = SampleAesEncryption;
15977                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
15978                    formatter.write_str("struct SampleAesEncryption")
15979                }
15980                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
15981                where
15982                    A: serde::de::MapAccess<'de>,
15983                {
15984                    #[allow(unused_imports)]
15985                    use serde::de::Error;
15986                    use std::option::Option::Some;
15987                    let mut result = Self::Value::new();
15988                    while let Some(tag) = map.next_key::<__FieldTag>()? {
15989                        #[allow(clippy::match_single_binding)]
15990                        match tag {
15991                            __FieldTag::Unknown(key) => {
15992                                let value = map.next_value::<serde_json::Value>()?;
15993                                result._unknown_fields.insert(key, value);
15994                            }
15995                        }
15996                    }
15997                    std::result::Result::Ok(result)
15998                }
15999            }
16000            deserializer.deserialize_any(Visitor)
16001        }
16002    }
16003
16004    #[doc(hidden)]
16005    impl serde::ser::Serialize for SampleAesEncryption {
16006        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16007        where
16008            S: serde::ser::Serializer,
16009        {
16010            use serde::ser::SerializeMap;
16011            #[allow(unused_imports)]
16012            use std::option::Option::Some;
16013            let mut state = serializer.serialize_map(std::option::Option::None)?;
16014            if !self._unknown_fields.is_empty() {
16015                for (key, value) in self._unknown_fields.iter() {
16016                    state.serialize_entry(key, &value)?;
16017                }
16018            }
16019            state.end()
16020        }
16021    }
16022
16023    impl std::fmt::Debug for SampleAesEncryption {
16024        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16025            let mut debug_struct = f.debug_struct("SampleAesEncryption");
16026            if !self._unknown_fields.is_empty() {
16027                debug_struct.field("_unknown_fields", &self._unknown_fields);
16028            }
16029            debug_struct.finish()
16030        }
16031    }
16032
16033    /// Configuration for MPEG Common Encryption (MPEG-CENC).
16034    #[derive(Clone, Default, PartialEq)]
16035    #[non_exhaustive]
16036    pub struct MpegCommonEncryption {
16037        /// Required. Specify the encryption scheme.
16038        ///
16039        /// Supported encryption schemes:
16040        ///
16041        /// - `cenc`
16042        /// - `cbcs`
16043        pub scheme: std::string::String,
16044
16045        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16046    }
16047
16048    impl MpegCommonEncryption {
16049        pub fn new() -> Self {
16050            std::default::Default::default()
16051        }
16052
16053        /// Sets the value of [scheme][crate::model::encryption::MpegCommonEncryption::scheme].
16054        pub fn set_scheme<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16055            self.scheme = v.into();
16056            self
16057        }
16058    }
16059
16060    impl wkt::message::Message for MpegCommonEncryption {
16061        fn typename() -> &'static str {
16062            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.MpegCommonEncryption"
16063        }
16064    }
16065
16066    #[doc(hidden)]
16067    impl<'de> serde::de::Deserialize<'de> for MpegCommonEncryption {
16068        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16069        where
16070            D: serde::Deserializer<'de>,
16071        {
16072            #[allow(non_camel_case_types)]
16073            #[doc(hidden)]
16074            #[derive(PartialEq, Eq, Hash)]
16075            enum __FieldTag {
16076                __scheme,
16077                Unknown(std::string::String),
16078            }
16079            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
16080                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16081                where
16082                    D: serde::Deserializer<'de>,
16083                {
16084                    struct Visitor;
16085                    impl<'de> serde::de::Visitor<'de> for Visitor {
16086                        type Value = __FieldTag;
16087                        fn expecting(
16088                            &self,
16089                            formatter: &mut std::fmt::Formatter,
16090                        ) -> std::fmt::Result {
16091                            formatter.write_str("a field name for MpegCommonEncryption")
16092                        }
16093                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
16094                        where
16095                            E: serde::de::Error,
16096                        {
16097                            use std::result::Result::Ok;
16098                            use std::string::ToString;
16099                            match value {
16100                                "scheme" => Ok(__FieldTag::__scheme),
16101                                _ => Ok(__FieldTag::Unknown(value.to_string())),
16102                            }
16103                        }
16104                    }
16105                    deserializer.deserialize_identifier(Visitor)
16106                }
16107            }
16108            struct Visitor;
16109            impl<'de> serde::de::Visitor<'de> for Visitor {
16110                type Value = MpegCommonEncryption;
16111                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16112                    formatter.write_str("struct MpegCommonEncryption")
16113                }
16114                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
16115                where
16116                    A: serde::de::MapAccess<'de>,
16117                {
16118                    #[allow(unused_imports)]
16119                    use serde::de::Error;
16120                    use std::option::Option::Some;
16121                    let mut fields = std::collections::HashSet::new();
16122                    let mut result = Self::Value::new();
16123                    while let Some(tag) = map.next_key::<__FieldTag>()? {
16124                        #[allow(clippy::match_single_binding)]
16125                        match tag {
16126                            __FieldTag::__scheme => {
16127                                if !fields.insert(__FieldTag::__scheme) {
16128                                    return std::result::Result::Err(A::Error::duplicate_field(
16129                                        "multiple values for scheme",
16130                                    ));
16131                                }
16132                                result.scheme = map
16133                                    .next_value::<std::option::Option<std::string::String>>()?
16134                                    .unwrap_or_default();
16135                            }
16136                            __FieldTag::Unknown(key) => {
16137                                let value = map.next_value::<serde_json::Value>()?;
16138                                result._unknown_fields.insert(key, value);
16139                            }
16140                        }
16141                    }
16142                    std::result::Result::Ok(result)
16143                }
16144            }
16145            deserializer.deserialize_any(Visitor)
16146        }
16147    }
16148
16149    #[doc(hidden)]
16150    impl serde::ser::Serialize for MpegCommonEncryption {
16151        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16152        where
16153            S: serde::ser::Serializer,
16154        {
16155            use serde::ser::SerializeMap;
16156            #[allow(unused_imports)]
16157            use std::option::Option::Some;
16158            let mut state = serializer.serialize_map(std::option::Option::None)?;
16159            if !self.scheme.is_empty() {
16160                state.serialize_entry("scheme", &self.scheme)?;
16161            }
16162            if !self._unknown_fields.is_empty() {
16163                for (key, value) in self._unknown_fields.iter() {
16164                    state.serialize_entry(key, &value)?;
16165                }
16166            }
16167            state.end()
16168        }
16169    }
16170
16171    impl std::fmt::Debug for MpegCommonEncryption {
16172        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16173            let mut debug_struct = f.debug_struct("MpegCommonEncryption");
16174            debug_struct.field("scheme", &self.scheme);
16175            if !self._unknown_fields.is_empty() {
16176                debug_struct.field("_unknown_fields", &self._unknown_fields);
16177            }
16178            debug_struct.finish()
16179        }
16180    }
16181
16182    /// Configuration for secrets stored in Google Secret Manager.
16183    #[derive(Clone, Default, PartialEq)]
16184    #[non_exhaustive]
16185    pub struct SecretManagerSource {
16186        /// Required. The name of the Secret Version containing the encryption key in
16187        /// the following format:
16188        /// `projects/{project}/secrets/{secret_id}/versions/{version_number}`
16189        ///
16190        /// Note that only numbered versions are supported. Aliases like "latest" are
16191        /// not supported.
16192        pub secret_version: std::string::String,
16193
16194        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16195    }
16196
16197    impl SecretManagerSource {
16198        pub fn new() -> Self {
16199            std::default::Default::default()
16200        }
16201
16202        /// Sets the value of [secret_version][crate::model::encryption::SecretManagerSource::secret_version].
16203        pub fn set_secret_version<T: std::convert::Into<std::string::String>>(
16204            mut self,
16205            v: T,
16206        ) -> Self {
16207            self.secret_version = v.into();
16208            self
16209        }
16210    }
16211
16212    impl wkt::message::Message for SecretManagerSource {
16213        fn typename() -> &'static str {
16214            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.SecretManagerSource"
16215        }
16216    }
16217
16218    #[doc(hidden)]
16219    impl<'de> serde::de::Deserialize<'de> for SecretManagerSource {
16220        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16221        where
16222            D: serde::Deserializer<'de>,
16223        {
16224            #[allow(non_camel_case_types)]
16225            #[doc(hidden)]
16226            #[derive(PartialEq, Eq, Hash)]
16227            enum __FieldTag {
16228                __secret_version,
16229                Unknown(std::string::String),
16230            }
16231            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
16232                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16233                where
16234                    D: serde::Deserializer<'de>,
16235                {
16236                    struct Visitor;
16237                    impl<'de> serde::de::Visitor<'de> for Visitor {
16238                        type Value = __FieldTag;
16239                        fn expecting(
16240                            &self,
16241                            formatter: &mut std::fmt::Formatter,
16242                        ) -> std::fmt::Result {
16243                            formatter.write_str("a field name for SecretManagerSource")
16244                        }
16245                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
16246                        where
16247                            E: serde::de::Error,
16248                        {
16249                            use std::result::Result::Ok;
16250                            use std::string::ToString;
16251                            match value {
16252                                "secretVersion" => Ok(__FieldTag::__secret_version),
16253                                "secret_version" => Ok(__FieldTag::__secret_version),
16254                                _ => Ok(__FieldTag::Unknown(value.to_string())),
16255                            }
16256                        }
16257                    }
16258                    deserializer.deserialize_identifier(Visitor)
16259                }
16260            }
16261            struct Visitor;
16262            impl<'de> serde::de::Visitor<'de> for Visitor {
16263                type Value = SecretManagerSource;
16264                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16265                    formatter.write_str("struct SecretManagerSource")
16266                }
16267                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
16268                where
16269                    A: serde::de::MapAccess<'de>,
16270                {
16271                    #[allow(unused_imports)]
16272                    use serde::de::Error;
16273                    use std::option::Option::Some;
16274                    let mut fields = std::collections::HashSet::new();
16275                    let mut result = Self::Value::new();
16276                    while let Some(tag) = map.next_key::<__FieldTag>()? {
16277                        #[allow(clippy::match_single_binding)]
16278                        match tag {
16279                            __FieldTag::__secret_version => {
16280                                if !fields.insert(__FieldTag::__secret_version) {
16281                                    return std::result::Result::Err(A::Error::duplicate_field(
16282                                        "multiple values for secret_version",
16283                                    ));
16284                                }
16285                                result.secret_version = map
16286                                    .next_value::<std::option::Option<std::string::String>>()?
16287                                    .unwrap_or_default();
16288                            }
16289                            __FieldTag::Unknown(key) => {
16290                                let value = map.next_value::<serde_json::Value>()?;
16291                                result._unknown_fields.insert(key, value);
16292                            }
16293                        }
16294                    }
16295                    std::result::Result::Ok(result)
16296                }
16297            }
16298            deserializer.deserialize_any(Visitor)
16299        }
16300    }
16301
16302    #[doc(hidden)]
16303    impl serde::ser::Serialize for SecretManagerSource {
16304        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16305        where
16306            S: serde::ser::Serializer,
16307        {
16308            use serde::ser::SerializeMap;
16309            #[allow(unused_imports)]
16310            use std::option::Option::Some;
16311            let mut state = serializer.serialize_map(std::option::Option::None)?;
16312            if !self.secret_version.is_empty() {
16313                state.serialize_entry("secretVersion", &self.secret_version)?;
16314            }
16315            if !self._unknown_fields.is_empty() {
16316                for (key, value) in self._unknown_fields.iter() {
16317                    state.serialize_entry(key, &value)?;
16318                }
16319            }
16320            state.end()
16321        }
16322    }
16323
16324    impl std::fmt::Debug for SecretManagerSource {
16325        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16326            let mut debug_struct = f.debug_struct("SecretManagerSource");
16327            debug_struct.field("secret_version", &self.secret_version);
16328            if !self._unknown_fields.is_empty() {
16329                debug_struct.field("_unknown_fields", &self._unknown_fields);
16330            }
16331            debug_struct.finish()
16332        }
16333    }
16334
16335    /// Widevine configuration.
16336    #[derive(Clone, Default, PartialEq)]
16337    #[non_exhaustive]
16338    pub struct Widevine {
16339        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16340    }
16341
16342    impl Widevine {
16343        pub fn new() -> Self {
16344            std::default::Default::default()
16345        }
16346    }
16347
16348    impl wkt::message::Message for Widevine {
16349        fn typename() -> &'static str {
16350            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Widevine"
16351        }
16352    }
16353
16354    #[doc(hidden)]
16355    impl<'de> serde::de::Deserialize<'de> for Widevine {
16356        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16357        where
16358            D: serde::Deserializer<'de>,
16359        {
16360            #[allow(non_camel_case_types)]
16361            #[doc(hidden)]
16362            #[derive(PartialEq, Eq, Hash)]
16363            enum __FieldTag {
16364                Unknown(std::string::String),
16365            }
16366            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
16367                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16368                where
16369                    D: serde::Deserializer<'de>,
16370                {
16371                    struct Visitor;
16372                    impl<'de> serde::de::Visitor<'de> for Visitor {
16373                        type Value = __FieldTag;
16374                        fn expecting(
16375                            &self,
16376                            formatter: &mut std::fmt::Formatter,
16377                        ) -> std::fmt::Result {
16378                            formatter.write_str("a field name for Widevine")
16379                        }
16380                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
16381                        where
16382                            E: serde::de::Error,
16383                        {
16384                            use std::result::Result::Ok;
16385                            use std::string::ToString;
16386                            Ok(__FieldTag::Unknown(value.to_string()))
16387                        }
16388                    }
16389                    deserializer.deserialize_identifier(Visitor)
16390                }
16391            }
16392            struct Visitor;
16393            impl<'de> serde::de::Visitor<'de> for Visitor {
16394                type Value = Widevine;
16395                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16396                    formatter.write_str("struct Widevine")
16397                }
16398                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
16399                where
16400                    A: serde::de::MapAccess<'de>,
16401                {
16402                    #[allow(unused_imports)]
16403                    use serde::de::Error;
16404                    use std::option::Option::Some;
16405                    let mut result = Self::Value::new();
16406                    while let Some(tag) = map.next_key::<__FieldTag>()? {
16407                        #[allow(clippy::match_single_binding)]
16408                        match tag {
16409                            __FieldTag::Unknown(key) => {
16410                                let value = map.next_value::<serde_json::Value>()?;
16411                                result._unknown_fields.insert(key, value);
16412                            }
16413                        }
16414                    }
16415                    std::result::Result::Ok(result)
16416                }
16417            }
16418            deserializer.deserialize_any(Visitor)
16419        }
16420    }
16421
16422    #[doc(hidden)]
16423    impl serde::ser::Serialize for Widevine {
16424        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16425        where
16426            S: serde::ser::Serializer,
16427        {
16428            use serde::ser::SerializeMap;
16429            #[allow(unused_imports)]
16430            use std::option::Option::Some;
16431            let mut state = serializer.serialize_map(std::option::Option::None)?;
16432            if !self._unknown_fields.is_empty() {
16433                for (key, value) in self._unknown_fields.iter() {
16434                    state.serialize_entry(key, &value)?;
16435                }
16436            }
16437            state.end()
16438        }
16439    }
16440
16441    impl std::fmt::Debug for Widevine {
16442        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16443            let mut debug_struct = f.debug_struct("Widevine");
16444            if !self._unknown_fields.is_empty() {
16445                debug_struct.field("_unknown_fields", &self._unknown_fields);
16446            }
16447            debug_struct.finish()
16448        }
16449    }
16450
16451    /// Fairplay configuration.
16452    #[derive(Clone, Default, PartialEq)]
16453    #[non_exhaustive]
16454    pub struct Fairplay {
16455        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16456    }
16457
16458    impl Fairplay {
16459        pub fn new() -> Self {
16460            std::default::Default::default()
16461        }
16462    }
16463
16464    impl wkt::message::Message for Fairplay {
16465        fn typename() -> &'static str {
16466            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Fairplay"
16467        }
16468    }
16469
16470    #[doc(hidden)]
16471    impl<'de> serde::de::Deserialize<'de> for Fairplay {
16472        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16473        where
16474            D: serde::Deserializer<'de>,
16475        {
16476            #[allow(non_camel_case_types)]
16477            #[doc(hidden)]
16478            #[derive(PartialEq, Eq, Hash)]
16479            enum __FieldTag {
16480                Unknown(std::string::String),
16481            }
16482            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
16483                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16484                where
16485                    D: serde::Deserializer<'de>,
16486                {
16487                    struct Visitor;
16488                    impl<'de> serde::de::Visitor<'de> for Visitor {
16489                        type Value = __FieldTag;
16490                        fn expecting(
16491                            &self,
16492                            formatter: &mut std::fmt::Formatter,
16493                        ) -> std::fmt::Result {
16494                            formatter.write_str("a field name for Fairplay")
16495                        }
16496                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
16497                        where
16498                            E: serde::de::Error,
16499                        {
16500                            use std::result::Result::Ok;
16501                            use std::string::ToString;
16502                            Ok(__FieldTag::Unknown(value.to_string()))
16503                        }
16504                    }
16505                    deserializer.deserialize_identifier(Visitor)
16506                }
16507            }
16508            struct Visitor;
16509            impl<'de> serde::de::Visitor<'de> for Visitor {
16510                type Value = Fairplay;
16511                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16512                    formatter.write_str("struct Fairplay")
16513                }
16514                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
16515                where
16516                    A: serde::de::MapAccess<'de>,
16517                {
16518                    #[allow(unused_imports)]
16519                    use serde::de::Error;
16520                    use std::option::Option::Some;
16521                    let mut result = Self::Value::new();
16522                    while let Some(tag) = map.next_key::<__FieldTag>()? {
16523                        #[allow(clippy::match_single_binding)]
16524                        match tag {
16525                            __FieldTag::Unknown(key) => {
16526                                let value = map.next_value::<serde_json::Value>()?;
16527                                result._unknown_fields.insert(key, value);
16528                            }
16529                        }
16530                    }
16531                    std::result::Result::Ok(result)
16532                }
16533            }
16534            deserializer.deserialize_any(Visitor)
16535        }
16536    }
16537
16538    #[doc(hidden)]
16539    impl serde::ser::Serialize for Fairplay {
16540        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16541        where
16542            S: serde::ser::Serializer,
16543        {
16544            use serde::ser::SerializeMap;
16545            #[allow(unused_imports)]
16546            use std::option::Option::Some;
16547            let mut state = serializer.serialize_map(std::option::Option::None)?;
16548            if !self._unknown_fields.is_empty() {
16549                for (key, value) in self._unknown_fields.iter() {
16550                    state.serialize_entry(key, &value)?;
16551                }
16552            }
16553            state.end()
16554        }
16555    }
16556
16557    impl std::fmt::Debug for Fairplay {
16558        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16559            let mut debug_struct = f.debug_struct("Fairplay");
16560            if !self._unknown_fields.is_empty() {
16561                debug_struct.field("_unknown_fields", &self._unknown_fields);
16562            }
16563            debug_struct.finish()
16564        }
16565    }
16566
16567    /// Playready configuration.
16568    #[derive(Clone, Default, PartialEq)]
16569    #[non_exhaustive]
16570    pub struct Playready {
16571        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16572    }
16573
16574    impl Playready {
16575        pub fn new() -> Self {
16576            std::default::Default::default()
16577        }
16578    }
16579
16580    impl wkt::message::Message for Playready {
16581        fn typename() -> &'static str {
16582            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Playready"
16583        }
16584    }
16585
16586    #[doc(hidden)]
16587    impl<'de> serde::de::Deserialize<'de> for Playready {
16588        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16589        where
16590            D: serde::Deserializer<'de>,
16591        {
16592            #[allow(non_camel_case_types)]
16593            #[doc(hidden)]
16594            #[derive(PartialEq, Eq, Hash)]
16595            enum __FieldTag {
16596                Unknown(std::string::String),
16597            }
16598            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
16599                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16600                where
16601                    D: serde::Deserializer<'de>,
16602                {
16603                    struct Visitor;
16604                    impl<'de> serde::de::Visitor<'de> for Visitor {
16605                        type Value = __FieldTag;
16606                        fn expecting(
16607                            &self,
16608                            formatter: &mut std::fmt::Formatter,
16609                        ) -> std::fmt::Result {
16610                            formatter.write_str("a field name for Playready")
16611                        }
16612                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
16613                        where
16614                            E: serde::de::Error,
16615                        {
16616                            use std::result::Result::Ok;
16617                            use std::string::ToString;
16618                            Ok(__FieldTag::Unknown(value.to_string()))
16619                        }
16620                    }
16621                    deserializer.deserialize_identifier(Visitor)
16622                }
16623            }
16624            struct Visitor;
16625            impl<'de> serde::de::Visitor<'de> for Visitor {
16626                type Value = Playready;
16627                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16628                    formatter.write_str("struct Playready")
16629                }
16630                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
16631                where
16632                    A: serde::de::MapAccess<'de>,
16633                {
16634                    #[allow(unused_imports)]
16635                    use serde::de::Error;
16636                    use std::option::Option::Some;
16637                    let mut result = Self::Value::new();
16638                    while let Some(tag) = map.next_key::<__FieldTag>()? {
16639                        #[allow(clippy::match_single_binding)]
16640                        match tag {
16641                            __FieldTag::Unknown(key) => {
16642                                let value = map.next_value::<serde_json::Value>()?;
16643                                result._unknown_fields.insert(key, value);
16644                            }
16645                        }
16646                    }
16647                    std::result::Result::Ok(result)
16648                }
16649            }
16650            deserializer.deserialize_any(Visitor)
16651        }
16652    }
16653
16654    #[doc(hidden)]
16655    impl serde::ser::Serialize for Playready {
16656        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16657        where
16658            S: serde::ser::Serializer,
16659        {
16660            use serde::ser::SerializeMap;
16661            #[allow(unused_imports)]
16662            use std::option::Option::Some;
16663            let mut state = serializer.serialize_map(std::option::Option::None)?;
16664            if !self._unknown_fields.is_empty() {
16665                for (key, value) in self._unknown_fields.iter() {
16666                    state.serialize_entry(key, &value)?;
16667                }
16668            }
16669            state.end()
16670        }
16671    }
16672
16673    impl std::fmt::Debug for Playready {
16674        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16675            let mut debug_struct = f.debug_struct("Playready");
16676            if !self._unknown_fields.is_empty() {
16677                debug_struct.field("_unknown_fields", &self._unknown_fields);
16678            }
16679            debug_struct.finish()
16680        }
16681    }
16682
16683    /// Clearkey configuration.
16684    #[derive(Clone, Default, PartialEq)]
16685    #[non_exhaustive]
16686    pub struct Clearkey {
16687        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16688    }
16689
16690    impl Clearkey {
16691        pub fn new() -> Self {
16692            std::default::Default::default()
16693        }
16694    }
16695
16696    impl wkt::message::Message for Clearkey {
16697        fn typename() -> &'static str {
16698            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.Clearkey"
16699        }
16700    }
16701
16702    #[doc(hidden)]
16703    impl<'de> serde::de::Deserialize<'de> for Clearkey {
16704        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16705        where
16706            D: serde::Deserializer<'de>,
16707        {
16708            #[allow(non_camel_case_types)]
16709            #[doc(hidden)]
16710            #[derive(PartialEq, Eq, Hash)]
16711            enum __FieldTag {
16712                Unknown(std::string::String),
16713            }
16714            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
16715                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16716                where
16717                    D: serde::Deserializer<'de>,
16718                {
16719                    struct Visitor;
16720                    impl<'de> serde::de::Visitor<'de> for Visitor {
16721                        type Value = __FieldTag;
16722                        fn expecting(
16723                            &self,
16724                            formatter: &mut std::fmt::Formatter,
16725                        ) -> std::fmt::Result {
16726                            formatter.write_str("a field name for Clearkey")
16727                        }
16728                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
16729                        where
16730                            E: serde::de::Error,
16731                        {
16732                            use std::result::Result::Ok;
16733                            use std::string::ToString;
16734                            Ok(__FieldTag::Unknown(value.to_string()))
16735                        }
16736                    }
16737                    deserializer.deserialize_identifier(Visitor)
16738                }
16739            }
16740            struct Visitor;
16741            impl<'de> serde::de::Visitor<'de> for Visitor {
16742                type Value = Clearkey;
16743                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16744                    formatter.write_str("struct Clearkey")
16745                }
16746                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
16747                where
16748                    A: serde::de::MapAccess<'de>,
16749                {
16750                    #[allow(unused_imports)]
16751                    use serde::de::Error;
16752                    use std::option::Option::Some;
16753                    let mut result = Self::Value::new();
16754                    while let Some(tag) = map.next_key::<__FieldTag>()? {
16755                        #[allow(clippy::match_single_binding)]
16756                        match tag {
16757                            __FieldTag::Unknown(key) => {
16758                                let value = map.next_value::<serde_json::Value>()?;
16759                                result._unknown_fields.insert(key, value);
16760                            }
16761                        }
16762                    }
16763                    std::result::Result::Ok(result)
16764                }
16765            }
16766            deserializer.deserialize_any(Visitor)
16767        }
16768    }
16769
16770    #[doc(hidden)]
16771    impl serde::ser::Serialize for Clearkey {
16772        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16773        where
16774            S: serde::ser::Serializer,
16775        {
16776            use serde::ser::SerializeMap;
16777            #[allow(unused_imports)]
16778            use std::option::Option::Some;
16779            let mut state = serializer.serialize_map(std::option::Option::None)?;
16780            if !self._unknown_fields.is_empty() {
16781                for (key, value) in self._unknown_fields.iter() {
16782                    state.serialize_entry(key, &value)?;
16783                }
16784            }
16785            state.end()
16786        }
16787    }
16788
16789    impl std::fmt::Debug for Clearkey {
16790        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16791            let mut debug_struct = f.debug_struct("Clearkey");
16792            if !self._unknown_fields.is_empty() {
16793                debug_struct.field("_unknown_fields", &self._unknown_fields);
16794            }
16795            debug_struct.finish()
16796        }
16797    }
16798
16799    /// Defines configuration for DRM systems in use.
16800    #[derive(Clone, Default, PartialEq)]
16801    #[non_exhaustive]
16802    pub struct DrmSystems {
16803        /// Widevine configuration.
16804        pub widevine: std::option::Option<crate::model::encryption::Widevine>,
16805
16806        /// Fairplay configuration.
16807        pub fairplay: std::option::Option<crate::model::encryption::Fairplay>,
16808
16809        /// Playready configuration.
16810        pub playready: std::option::Option<crate::model::encryption::Playready>,
16811
16812        /// Clearkey configuration.
16813        pub clearkey: std::option::Option<crate::model::encryption::Clearkey>,
16814
16815        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16816    }
16817
16818    impl DrmSystems {
16819        pub fn new() -> Self {
16820            std::default::Default::default()
16821        }
16822
16823        /// Sets the value of [widevine][crate::model::encryption::DrmSystems::widevine].
16824        pub fn set_widevine<T>(mut self, v: T) -> Self
16825        where
16826            T: std::convert::Into<crate::model::encryption::Widevine>,
16827        {
16828            self.widevine = std::option::Option::Some(v.into());
16829            self
16830        }
16831
16832        /// Sets or clears the value of [widevine][crate::model::encryption::DrmSystems::widevine].
16833        pub fn set_or_clear_widevine<T>(mut self, v: std::option::Option<T>) -> Self
16834        where
16835            T: std::convert::Into<crate::model::encryption::Widevine>,
16836        {
16837            self.widevine = v.map(|x| x.into());
16838            self
16839        }
16840
16841        /// Sets the value of [fairplay][crate::model::encryption::DrmSystems::fairplay].
16842        pub fn set_fairplay<T>(mut self, v: T) -> Self
16843        where
16844            T: std::convert::Into<crate::model::encryption::Fairplay>,
16845        {
16846            self.fairplay = std::option::Option::Some(v.into());
16847            self
16848        }
16849
16850        /// Sets or clears the value of [fairplay][crate::model::encryption::DrmSystems::fairplay].
16851        pub fn set_or_clear_fairplay<T>(mut self, v: std::option::Option<T>) -> Self
16852        where
16853            T: std::convert::Into<crate::model::encryption::Fairplay>,
16854        {
16855            self.fairplay = v.map(|x| x.into());
16856            self
16857        }
16858
16859        /// Sets the value of [playready][crate::model::encryption::DrmSystems::playready].
16860        pub fn set_playready<T>(mut self, v: T) -> Self
16861        where
16862            T: std::convert::Into<crate::model::encryption::Playready>,
16863        {
16864            self.playready = std::option::Option::Some(v.into());
16865            self
16866        }
16867
16868        /// Sets or clears the value of [playready][crate::model::encryption::DrmSystems::playready].
16869        pub fn set_or_clear_playready<T>(mut self, v: std::option::Option<T>) -> Self
16870        where
16871            T: std::convert::Into<crate::model::encryption::Playready>,
16872        {
16873            self.playready = v.map(|x| x.into());
16874            self
16875        }
16876
16877        /// Sets the value of [clearkey][crate::model::encryption::DrmSystems::clearkey].
16878        pub fn set_clearkey<T>(mut self, v: T) -> Self
16879        where
16880            T: std::convert::Into<crate::model::encryption::Clearkey>,
16881        {
16882            self.clearkey = std::option::Option::Some(v.into());
16883            self
16884        }
16885
16886        /// Sets or clears the value of [clearkey][crate::model::encryption::DrmSystems::clearkey].
16887        pub fn set_or_clear_clearkey<T>(mut self, v: std::option::Option<T>) -> Self
16888        where
16889            T: std::convert::Into<crate::model::encryption::Clearkey>,
16890        {
16891            self.clearkey = v.map(|x| x.into());
16892            self
16893        }
16894    }
16895
16896    impl wkt::message::Message for DrmSystems {
16897        fn typename() -> &'static str {
16898            "type.googleapis.com/google.cloud.video.transcoder.v1.Encryption.DrmSystems"
16899        }
16900    }
16901
16902    #[doc(hidden)]
16903    impl<'de> serde::de::Deserialize<'de> for DrmSystems {
16904        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16905        where
16906            D: serde::Deserializer<'de>,
16907        {
16908            #[allow(non_camel_case_types)]
16909            #[doc(hidden)]
16910            #[derive(PartialEq, Eq, Hash)]
16911            enum __FieldTag {
16912                __widevine,
16913                __fairplay,
16914                __playready,
16915                __clearkey,
16916                Unknown(std::string::String),
16917            }
16918            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
16919                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16920                where
16921                    D: serde::Deserializer<'de>,
16922                {
16923                    struct Visitor;
16924                    impl<'de> serde::de::Visitor<'de> for Visitor {
16925                        type Value = __FieldTag;
16926                        fn expecting(
16927                            &self,
16928                            formatter: &mut std::fmt::Formatter,
16929                        ) -> std::fmt::Result {
16930                            formatter.write_str("a field name for DrmSystems")
16931                        }
16932                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
16933                        where
16934                            E: serde::de::Error,
16935                        {
16936                            use std::result::Result::Ok;
16937                            use std::string::ToString;
16938                            match value {
16939                                "widevine" => Ok(__FieldTag::__widevine),
16940                                "fairplay" => Ok(__FieldTag::__fairplay),
16941                                "playready" => Ok(__FieldTag::__playready),
16942                                "clearkey" => Ok(__FieldTag::__clearkey),
16943                                _ => Ok(__FieldTag::Unknown(value.to_string())),
16944                            }
16945                        }
16946                    }
16947                    deserializer.deserialize_identifier(Visitor)
16948                }
16949            }
16950            struct Visitor;
16951            impl<'de> serde::de::Visitor<'de> for Visitor {
16952                type Value = DrmSystems;
16953                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
16954                    formatter.write_str("struct DrmSystems")
16955                }
16956                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
16957                where
16958                    A: serde::de::MapAccess<'de>,
16959                {
16960                    #[allow(unused_imports)]
16961                    use serde::de::Error;
16962                    use std::option::Option::Some;
16963                    let mut fields = std::collections::HashSet::new();
16964                    let mut result = Self::Value::new();
16965                    while let Some(tag) = map.next_key::<__FieldTag>()? {
16966                        #[allow(clippy::match_single_binding)]
16967                        match tag {
16968                            __FieldTag::__widevine => {
16969                                if !fields.insert(__FieldTag::__widevine) {
16970                                    return std::result::Result::Err(A::Error::duplicate_field(
16971                                        "multiple values for widevine",
16972                                    ));
16973                                }
16974                                result.widevine = map.next_value::<std::option::Option<crate::model::encryption::Widevine>>()?
16975                                    ;
16976                            }
16977                            __FieldTag::__fairplay => {
16978                                if !fields.insert(__FieldTag::__fairplay) {
16979                                    return std::result::Result::Err(A::Error::duplicate_field(
16980                                        "multiple values for fairplay",
16981                                    ));
16982                                }
16983                                result.fairplay = map.next_value::<std::option::Option<crate::model::encryption::Fairplay>>()?
16984                                    ;
16985                            }
16986                            __FieldTag::__playready => {
16987                                if !fields.insert(__FieldTag::__playready) {
16988                                    return std::result::Result::Err(A::Error::duplicate_field(
16989                                        "multiple values for playready",
16990                                    ));
16991                                }
16992                                result.playready = map.next_value::<std::option::Option<crate::model::encryption::Playready>>()?
16993                                    ;
16994                            }
16995                            __FieldTag::__clearkey => {
16996                                if !fields.insert(__FieldTag::__clearkey) {
16997                                    return std::result::Result::Err(A::Error::duplicate_field(
16998                                        "multiple values for clearkey",
16999                                    ));
17000                                }
17001                                result.clearkey = map.next_value::<std::option::Option<crate::model::encryption::Clearkey>>()?
17002                                    ;
17003                            }
17004                            __FieldTag::Unknown(key) => {
17005                                let value = map.next_value::<serde_json::Value>()?;
17006                                result._unknown_fields.insert(key, value);
17007                            }
17008                        }
17009                    }
17010                    std::result::Result::Ok(result)
17011                }
17012            }
17013            deserializer.deserialize_any(Visitor)
17014        }
17015    }
17016
17017    #[doc(hidden)]
17018    impl serde::ser::Serialize for DrmSystems {
17019        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17020        where
17021            S: serde::ser::Serializer,
17022        {
17023            use serde::ser::SerializeMap;
17024            #[allow(unused_imports)]
17025            use std::option::Option::Some;
17026            let mut state = serializer.serialize_map(std::option::Option::None)?;
17027            if self.widevine.is_some() {
17028                state.serialize_entry("widevine", &self.widevine)?;
17029            }
17030            if self.fairplay.is_some() {
17031                state.serialize_entry("fairplay", &self.fairplay)?;
17032            }
17033            if self.playready.is_some() {
17034                state.serialize_entry("playready", &self.playready)?;
17035            }
17036            if self.clearkey.is_some() {
17037                state.serialize_entry("clearkey", &self.clearkey)?;
17038            }
17039            if !self._unknown_fields.is_empty() {
17040                for (key, value) in self._unknown_fields.iter() {
17041                    state.serialize_entry(key, &value)?;
17042                }
17043            }
17044            state.end()
17045        }
17046    }
17047
17048    impl std::fmt::Debug for DrmSystems {
17049        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17050            let mut debug_struct = f.debug_struct("DrmSystems");
17051            debug_struct.field("widevine", &self.widevine);
17052            debug_struct.field("fairplay", &self.fairplay);
17053            debug_struct.field("playready", &self.playready);
17054            debug_struct.field("clearkey", &self.clearkey);
17055            if !self._unknown_fields.is_empty() {
17056                debug_struct.field("_unknown_fields", &self._unknown_fields);
17057            }
17058            debug_struct.finish()
17059        }
17060    }
17061
17062    /// Encryption mode can be either `aes` or `cenc`.
17063    #[derive(Clone, Debug, PartialEq)]
17064    #[non_exhaustive]
17065    pub enum EncryptionMode {
17066        /// Configuration for AES-128 encryption.
17067        Aes128(std::boxed::Box<crate::model::encryption::Aes128Encryption>),
17068        /// Configuration for SAMPLE-AES encryption.
17069        SampleAes(std::boxed::Box<crate::model::encryption::SampleAesEncryption>),
17070        /// Configuration for MPEG Common Encryption (MPEG-CENC).
17071        MpegCenc(std::boxed::Box<crate::model::encryption::MpegCommonEncryption>),
17072    }
17073
17074    /// Defines where content keys are stored.
17075    #[derive(Clone, Debug, PartialEq)]
17076    #[non_exhaustive]
17077    pub enum SecretSource {
17078        /// Keys are stored in Google Secret Manager.
17079        SecretManagerKeySource(std::boxed::Box<crate::model::encryption::SecretManagerSource>),
17080    }
17081}
17082
17083/// Request message for `TranscoderService.CreateJob`.
17084#[derive(Clone, Default, PartialEq)]
17085#[non_exhaustive]
17086pub struct CreateJobRequest {
17087    /// Required. The parent location to create and process this job.
17088    /// Format: `projects/{project}/locations/{location}`
17089    pub parent: std::string::String,
17090
17091    /// Required. Parameters for creating transcoding job.
17092    pub job: std::option::Option<crate::model::Job>,
17093
17094    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17095}
17096
17097impl CreateJobRequest {
17098    pub fn new() -> Self {
17099        std::default::Default::default()
17100    }
17101
17102    /// Sets the value of [parent][crate::model::CreateJobRequest::parent].
17103    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17104        self.parent = v.into();
17105        self
17106    }
17107
17108    /// Sets the value of [job][crate::model::CreateJobRequest::job].
17109    pub fn set_job<T>(mut self, v: T) -> Self
17110    where
17111        T: std::convert::Into<crate::model::Job>,
17112    {
17113        self.job = std::option::Option::Some(v.into());
17114        self
17115    }
17116
17117    /// Sets or clears the value of [job][crate::model::CreateJobRequest::job].
17118    pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
17119    where
17120        T: std::convert::Into<crate::model::Job>,
17121    {
17122        self.job = v.map(|x| x.into());
17123        self
17124    }
17125}
17126
17127impl wkt::message::Message for CreateJobRequest {
17128    fn typename() -> &'static str {
17129        "type.googleapis.com/google.cloud.video.transcoder.v1.CreateJobRequest"
17130    }
17131}
17132
17133#[doc(hidden)]
17134impl<'de> serde::de::Deserialize<'de> for CreateJobRequest {
17135    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17136    where
17137        D: serde::Deserializer<'de>,
17138    {
17139        #[allow(non_camel_case_types)]
17140        #[doc(hidden)]
17141        #[derive(PartialEq, Eq, Hash)]
17142        enum __FieldTag {
17143            __parent,
17144            __job,
17145            Unknown(std::string::String),
17146        }
17147        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
17148            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17149            where
17150                D: serde::Deserializer<'de>,
17151            {
17152                struct Visitor;
17153                impl<'de> serde::de::Visitor<'de> for Visitor {
17154                    type Value = __FieldTag;
17155                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17156                        formatter.write_str("a field name for CreateJobRequest")
17157                    }
17158                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
17159                    where
17160                        E: serde::de::Error,
17161                    {
17162                        use std::result::Result::Ok;
17163                        use std::string::ToString;
17164                        match value {
17165                            "parent" => Ok(__FieldTag::__parent),
17166                            "job" => Ok(__FieldTag::__job),
17167                            _ => Ok(__FieldTag::Unknown(value.to_string())),
17168                        }
17169                    }
17170                }
17171                deserializer.deserialize_identifier(Visitor)
17172            }
17173        }
17174        struct Visitor;
17175        impl<'de> serde::de::Visitor<'de> for Visitor {
17176            type Value = CreateJobRequest;
17177            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17178                formatter.write_str("struct CreateJobRequest")
17179            }
17180            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
17181            where
17182                A: serde::de::MapAccess<'de>,
17183            {
17184                #[allow(unused_imports)]
17185                use serde::de::Error;
17186                use std::option::Option::Some;
17187                let mut fields = std::collections::HashSet::new();
17188                let mut result = Self::Value::new();
17189                while let Some(tag) = map.next_key::<__FieldTag>()? {
17190                    #[allow(clippy::match_single_binding)]
17191                    match tag {
17192                        __FieldTag::__parent => {
17193                            if !fields.insert(__FieldTag::__parent) {
17194                                return std::result::Result::Err(A::Error::duplicate_field(
17195                                    "multiple values for parent",
17196                                ));
17197                            }
17198                            result.parent = map
17199                                .next_value::<std::option::Option<std::string::String>>()?
17200                                .unwrap_or_default();
17201                        }
17202                        __FieldTag::__job => {
17203                            if !fields.insert(__FieldTag::__job) {
17204                                return std::result::Result::Err(A::Error::duplicate_field(
17205                                    "multiple values for job",
17206                                ));
17207                            }
17208                            result.job =
17209                                map.next_value::<std::option::Option<crate::model::Job>>()?;
17210                        }
17211                        __FieldTag::Unknown(key) => {
17212                            let value = map.next_value::<serde_json::Value>()?;
17213                            result._unknown_fields.insert(key, value);
17214                        }
17215                    }
17216                }
17217                std::result::Result::Ok(result)
17218            }
17219        }
17220        deserializer.deserialize_any(Visitor)
17221    }
17222}
17223
17224#[doc(hidden)]
17225impl serde::ser::Serialize for CreateJobRequest {
17226    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17227    where
17228        S: serde::ser::Serializer,
17229    {
17230        use serde::ser::SerializeMap;
17231        #[allow(unused_imports)]
17232        use std::option::Option::Some;
17233        let mut state = serializer.serialize_map(std::option::Option::None)?;
17234        if !self.parent.is_empty() {
17235            state.serialize_entry("parent", &self.parent)?;
17236        }
17237        if self.job.is_some() {
17238            state.serialize_entry("job", &self.job)?;
17239        }
17240        if !self._unknown_fields.is_empty() {
17241            for (key, value) in self._unknown_fields.iter() {
17242                state.serialize_entry(key, &value)?;
17243            }
17244        }
17245        state.end()
17246    }
17247}
17248
17249impl std::fmt::Debug for CreateJobRequest {
17250    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17251        let mut debug_struct = f.debug_struct("CreateJobRequest");
17252        debug_struct.field("parent", &self.parent);
17253        debug_struct.field("job", &self.job);
17254        if !self._unknown_fields.is_empty() {
17255            debug_struct.field("_unknown_fields", &self._unknown_fields);
17256        }
17257        debug_struct.finish()
17258    }
17259}
17260
17261/// Request message for `TranscoderService.ListJobs`.
17262/// The parent location from which to retrieve the collection of jobs.
17263#[derive(Clone, Default, PartialEq)]
17264#[non_exhaustive]
17265pub struct ListJobsRequest {
17266    /// Required. Format: `projects/{project}/locations/{location}`
17267    pub parent: std::string::String,
17268
17269    /// The maximum number of items to return.
17270    pub page_size: i32,
17271
17272    /// The `next_page_token` value returned from a previous List request, if
17273    /// any.
17274    pub page_token: std::string::String,
17275
17276    /// The filter expression, following the syntax outlined in
17277    /// <https://google.aip.dev/160>.
17278    pub filter: std::string::String,
17279
17280    /// One or more fields to compare and use to sort the output.
17281    /// See <https://google.aip.dev/132#ordering>.
17282    pub order_by: std::string::String,
17283
17284    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17285}
17286
17287impl ListJobsRequest {
17288    pub fn new() -> Self {
17289        std::default::Default::default()
17290    }
17291
17292    /// Sets the value of [parent][crate::model::ListJobsRequest::parent].
17293    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17294        self.parent = v.into();
17295        self
17296    }
17297
17298    /// Sets the value of [page_size][crate::model::ListJobsRequest::page_size].
17299    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17300        self.page_size = v.into();
17301        self
17302    }
17303
17304    /// Sets the value of [page_token][crate::model::ListJobsRequest::page_token].
17305    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17306        self.page_token = v.into();
17307        self
17308    }
17309
17310    /// Sets the value of [filter][crate::model::ListJobsRequest::filter].
17311    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17312        self.filter = v.into();
17313        self
17314    }
17315
17316    /// Sets the value of [order_by][crate::model::ListJobsRequest::order_by].
17317    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17318        self.order_by = v.into();
17319        self
17320    }
17321}
17322
17323impl wkt::message::Message for ListJobsRequest {
17324    fn typename() -> &'static str {
17325        "type.googleapis.com/google.cloud.video.transcoder.v1.ListJobsRequest"
17326    }
17327}
17328
17329#[doc(hidden)]
17330impl<'de> serde::de::Deserialize<'de> for ListJobsRequest {
17331    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17332    where
17333        D: serde::Deserializer<'de>,
17334    {
17335        #[allow(non_camel_case_types)]
17336        #[doc(hidden)]
17337        #[derive(PartialEq, Eq, Hash)]
17338        enum __FieldTag {
17339            __parent,
17340            __page_size,
17341            __page_token,
17342            __filter,
17343            __order_by,
17344            Unknown(std::string::String),
17345        }
17346        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
17347            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17348            where
17349                D: serde::Deserializer<'de>,
17350            {
17351                struct Visitor;
17352                impl<'de> serde::de::Visitor<'de> for Visitor {
17353                    type Value = __FieldTag;
17354                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17355                        formatter.write_str("a field name for ListJobsRequest")
17356                    }
17357                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
17358                    where
17359                        E: serde::de::Error,
17360                    {
17361                        use std::result::Result::Ok;
17362                        use std::string::ToString;
17363                        match value {
17364                            "parent" => Ok(__FieldTag::__parent),
17365                            "pageSize" => Ok(__FieldTag::__page_size),
17366                            "page_size" => Ok(__FieldTag::__page_size),
17367                            "pageToken" => Ok(__FieldTag::__page_token),
17368                            "page_token" => Ok(__FieldTag::__page_token),
17369                            "filter" => Ok(__FieldTag::__filter),
17370                            "orderBy" => Ok(__FieldTag::__order_by),
17371                            "order_by" => Ok(__FieldTag::__order_by),
17372                            _ => Ok(__FieldTag::Unknown(value.to_string())),
17373                        }
17374                    }
17375                }
17376                deserializer.deserialize_identifier(Visitor)
17377            }
17378        }
17379        struct Visitor;
17380        impl<'de> serde::de::Visitor<'de> for Visitor {
17381            type Value = ListJobsRequest;
17382            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17383                formatter.write_str("struct ListJobsRequest")
17384            }
17385            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
17386            where
17387                A: serde::de::MapAccess<'de>,
17388            {
17389                #[allow(unused_imports)]
17390                use serde::de::Error;
17391                use std::option::Option::Some;
17392                let mut fields = std::collections::HashSet::new();
17393                let mut result = Self::Value::new();
17394                while let Some(tag) = map.next_key::<__FieldTag>()? {
17395                    #[allow(clippy::match_single_binding)]
17396                    match tag {
17397                        __FieldTag::__parent => {
17398                            if !fields.insert(__FieldTag::__parent) {
17399                                return std::result::Result::Err(A::Error::duplicate_field(
17400                                    "multiple values for parent",
17401                                ));
17402                            }
17403                            result.parent = map
17404                                .next_value::<std::option::Option<std::string::String>>()?
17405                                .unwrap_or_default();
17406                        }
17407                        __FieldTag::__page_size => {
17408                            if !fields.insert(__FieldTag::__page_size) {
17409                                return std::result::Result::Err(A::Error::duplicate_field(
17410                                    "multiple values for page_size",
17411                                ));
17412                            }
17413                            struct __With(std::option::Option<i32>);
17414                            impl<'de> serde::de::Deserialize<'de> for __With {
17415                                fn deserialize<D>(
17416                                    deserializer: D,
17417                                ) -> std::result::Result<Self, D::Error>
17418                                where
17419                                    D: serde::de::Deserializer<'de>,
17420                                {
17421                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
17422                                }
17423                            }
17424                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
17425                        }
17426                        __FieldTag::__page_token => {
17427                            if !fields.insert(__FieldTag::__page_token) {
17428                                return std::result::Result::Err(A::Error::duplicate_field(
17429                                    "multiple values for page_token",
17430                                ));
17431                            }
17432                            result.page_token = map
17433                                .next_value::<std::option::Option<std::string::String>>()?
17434                                .unwrap_or_default();
17435                        }
17436                        __FieldTag::__filter => {
17437                            if !fields.insert(__FieldTag::__filter) {
17438                                return std::result::Result::Err(A::Error::duplicate_field(
17439                                    "multiple values for filter",
17440                                ));
17441                            }
17442                            result.filter = map
17443                                .next_value::<std::option::Option<std::string::String>>()?
17444                                .unwrap_or_default();
17445                        }
17446                        __FieldTag::__order_by => {
17447                            if !fields.insert(__FieldTag::__order_by) {
17448                                return std::result::Result::Err(A::Error::duplicate_field(
17449                                    "multiple values for order_by",
17450                                ));
17451                            }
17452                            result.order_by = map
17453                                .next_value::<std::option::Option<std::string::String>>()?
17454                                .unwrap_or_default();
17455                        }
17456                        __FieldTag::Unknown(key) => {
17457                            let value = map.next_value::<serde_json::Value>()?;
17458                            result._unknown_fields.insert(key, value);
17459                        }
17460                    }
17461                }
17462                std::result::Result::Ok(result)
17463            }
17464        }
17465        deserializer.deserialize_any(Visitor)
17466    }
17467}
17468
17469#[doc(hidden)]
17470impl serde::ser::Serialize for ListJobsRequest {
17471    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17472    where
17473        S: serde::ser::Serializer,
17474    {
17475        use serde::ser::SerializeMap;
17476        #[allow(unused_imports)]
17477        use std::option::Option::Some;
17478        let mut state = serializer.serialize_map(std::option::Option::None)?;
17479        if !self.parent.is_empty() {
17480            state.serialize_entry("parent", &self.parent)?;
17481        }
17482        if !wkt::internal::is_default(&self.page_size) {
17483            struct __With<'a>(&'a i32);
17484            impl<'a> serde::ser::Serialize for __With<'a> {
17485                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17486                where
17487                    S: serde::ser::Serializer,
17488                {
17489                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
17490                }
17491            }
17492            state.serialize_entry("pageSize", &__With(&self.page_size))?;
17493        }
17494        if !self.page_token.is_empty() {
17495            state.serialize_entry("pageToken", &self.page_token)?;
17496        }
17497        if !self.filter.is_empty() {
17498            state.serialize_entry("filter", &self.filter)?;
17499        }
17500        if !self.order_by.is_empty() {
17501            state.serialize_entry("orderBy", &self.order_by)?;
17502        }
17503        if !self._unknown_fields.is_empty() {
17504            for (key, value) in self._unknown_fields.iter() {
17505                state.serialize_entry(key, &value)?;
17506            }
17507        }
17508        state.end()
17509    }
17510}
17511
17512impl std::fmt::Debug for ListJobsRequest {
17513    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17514        let mut debug_struct = f.debug_struct("ListJobsRequest");
17515        debug_struct.field("parent", &self.parent);
17516        debug_struct.field("page_size", &self.page_size);
17517        debug_struct.field("page_token", &self.page_token);
17518        debug_struct.field("filter", &self.filter);
17519        debug_struct.field("order_by", &self.order_by);
17520        if !self._unknown_fields.is_empty() {
17521            debug_struct.field("_unknown_fields", &self._unknown_fields);
17522        }
17523        debug_struct.finish()
17524    }
17525}
17526
17527/// Request message for `TranscoderService.GetJob`.
17528#[derive(Clone, Default, PartialEq)]
17529#[non_exhaustive]
17530pub struct GetJobRequest {
17531    /// Required. The name of the job to retrieve.
17532    /// Format: `projects/{project}/locations/{location}/jobs/{job}`
17533    pub name: std::string::String,
17534
17535    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17536}
17537
17538impl GetJobRequest {
17539    pub fn new() -> Self {
17540        std::default::Default::default()
17541    }
17542
17543    /// Sets the value of [name][crate::model::GetJobRequest::name].
17544    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17545        self.name = v.into();
17546        self
17547    }
17548}
17549
17550impl wkt::message::Message for GetJobRequest {
17551    fn typename() -> &'static str {
17552        "type.googleapis.com/google.cloud.video.transcoder.v1.GetJobRequest"
17553    }
17554}
17555
17556#[doc(hidden)]
17557impl<'de> serde::de::Deserialize<'de> for GetJobRequest {
17558    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17559    where
17560        D: serde::Deserializer<'de>,
17561    {
17562        #[allow(non_camel_case_types)]
17563        #[doc(hidden)]
17564        #[derive(PartialEq, Eq, Hash)]
17565        enum __FieldTag {
17566            __name,
17567            Unknown(std::string::String),
17568        }
17569        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
17570            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17571            where
17572                D: serde::Deserializer<'de>,
17573            {
17574                struct Visitor;
17575                impl<'de> serde::de::Visitor<'de> for Visitor {
17576                    type Value = __FieldTag;
17577                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17578                        formatter.write_str("a field name for GetJobRequest")
17579                    }
17580                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
17581                    where
17582                        E: serde::de::Error,
17583                    {
17584                        use std::result::Result::Ok;
17585                        use std::string::ToString;
17586                        match value {
17587                            "name" => Ok(__FieldTag::__name),
17588                            _ => Ok(__FieldTag::Unknown(value.to_string())),
17589                        }
17590                    }
17591                }
17592                deserializer.deserialize_identifier(Visitor)
17593            }
17594        }
17595        struct Visitor;
17596        impl<'de> serde::de::Visitor<'de> for Visitor {
17597            type Value = GetJobRequest;
17598            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17599                formatter.write_str("struct GetJobRequest")
17600            }
17601            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
17602            where
17603                A: serde::de::MapAccess<'de>,
17604            {
17605                #[allow(unused_imports)]
17606                use serde::de::Error;
17607                use std::option::Option::Some;
17608                let mut fields = std::collections::HashSet::new();
17609                let mut result = Self::Value::new();
17610                while let Some(tag) = map.next_key::<__FieldTag>()? {
17611                    #[allow(clippy::match_single_binding)]
17612                    match tag {
17613                        __FieldTag::__name => {
17614                            if !fields.insert(__FieldTag::__name) {
17615                                return std::result::Result::Err(A::Error::duplicate_field(
17616                                    "multiple values for name",
17617                                ));
17618                            }
17619                            result.name = map
17620                                .next_value::<std::option::Option<std::string::String>>()?
17621                                .unwrap_or_default();
17622                        }
17623                        __FieldTag::Unknown(key) => {
17624                            let value = map.next_value::<serde_json::Value>()?;
17625                            result._unknown_fields.insert(key, value);
17626                        }
17627                    }
17628                }
17629                std::result::Result::Ok(result)
17630            }
17631        }
17632        deserializer.deserialize_any(Visitor)
17633    }
17634}
17635
17636#[doc(hidden)]
17637impl serde::ser::Serialize for GetJobRequest {
17638    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17639    where
17640        S: serde::ser::Serializer,
17641    {
17642        use serde::ser::SerializeMap;
17643        #[allow(unused_imports)]
17644        use std::option::Option::Some;
17645        let mut state = serializer.serialize_map(std::option::Option::None)?;
17646        if !self.name.is_empty() {
17647            state.serialize_entry("name", &self.name)?;
17648        }
17649        if !self._unknown_fields.is_empty() {
17650            for (key, value) in self._unknown_fields.iter() {
17651                state.serialize_entry(key, &value)?;
17652            }
17653        }
17654        state.end()
17655    }
17656}
17657
17658impl std::fmt::Debug for GetJobRequest {
17659    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17660        let mut debug_struct = f.debug_struct("GetJobRequest");
17661        debug_struct.field("name", &self.name);
17662        if !self._unknown_fields.is_empty() {
17663            debug_struct.field("_unknown_fields", &self._unknown_fields);
17664        }
17665        debug_struct.finish()
17666    }
17667}
17668
17669/// Request message for `TranscoderService.DeleteJob`.
17670#[derive(Clone, Default, PartialEq)]
17671#[non_exhaustive]
17672pub struct DeleteJobRequest {
17673    /// Required. The name of the job to delete.
17674    /// Format: `projects/{project}/locations/{location}/jobs/{job}`
17675    pub name: std::string::String,
17676
17677    /// If set to true, and the job is not found, the request will succeed but no
17678    /// action will be taken on the server.
17679    pub allow_missing: bool,
17680
17681    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17682}
17683
17684impl DeleteJobRequest {
17685    pub fn new() -> Self {
17686        std::default::Default::default()
17687    }
17688
17689    /// Sets the value of [name][crate::model::DeleteJobRequest::name].
17690    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17691        self.name = v.into();
17692        self
17693    }
17694
17695    /// Sets the value of [allow_missing][crate::model::DeleteJobRequest::allow_missing].
17696    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
17697        self.allow_missing = v.into();
17698        self
17699    }
17700}
17701
17702impl wkt::message::Message for DeleteJobRequest {
17703    fn typename() -> &'static str {
17704        "type.googleapis.com/google.cloud.video.transcoder.v1.DeleteJobRequest"
17705    }
17706}
17707
17708#[doc(hidden)]
17709impl<'de> serde::de::Deserialize<'de> for DeleteJobRequest {
17710    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17711    where
17712        D: serde::Deserializer<'de>,
17713    {
17714        #[allow(non_camel_case_types)]
17715        #[doc(hidden)]
17716        #[derive(PartialEq, Eq, Hash)]
17717        enum __FieldTag {
17718            __name,
17719            __allow_missing,
17720            Unknown(std::string::String),
17721        }
17722        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
17723            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17724            where
17725                D: serde::Deserializer<'de>,
17726            {
17727                struct Visitor;
17728                impl<'de> serde::de::Visitor<'de> for Visitor {
17729                    type Value = __FieldTag;
17730                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17731                        formatter.write_str("a field name for DeleteJobRequest")
17732                    }
17733                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
17734                    where
17735                        E: serde::de::Error,
17736                    {
17737                        use std::result::Result::Ok;
17738                        use std::string::ToString;
17739                        match value {
17740                            "name" => Ok(__FieldTag::__name),
17741                            "allowMissing" => Ok(__FieldTag::__allow_missing),
17742                            "allow_missing" => Ok(__FieldTag::__allow_missing),
17743                            _ => Ok(__FieldTag::Unknown(value.to_string())),
17744                        }
17745                    }
17746                }
17747                deserializer.deserialize_identifier(Visitor)
17748            }
17749        }
17750        struct Visitor;
17751        impl<'de> serde::de::Visitor<'de> for Visitor {
17752            type Value = DeleteJobRequest;
17753            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17754                formatter.write_str("struct DeleteJobRequest")
17755            }
17756            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
17757            where
17758                A: serde::de::MapAccess<'de>,
17759            {
17760                #[allow(unused_imports)]
17761                use serde::de::Error;
17762                use std::option::Option::Some;
17763                let mut fields = std::collections::HashSet::new();
17764                let mut result = Self::Value::new();
17765                while let Some(tag) = map.next_key::<__FieldTag>()? {
17766                    #[allow(clippy::match_single_binding)]
17767                    match tag {
17768                        __FieldTag::__name => {
17769                            if !fields.insert(__FieldTag::__name) {
17770                                return std::result::Result::Err(A::Error::duplicate_field(
17771                                    "multiple values for name",
17772                                ));
17773                            }
17774                            result.name = map
17775                                .next_value::<std::option::Option<std::string::String>>()?
17776                                .unwrap_or_default();
17777                        }
17778                        __FieldTag::__allow_missing => {
17779                            if !fields.insert(__FieldTag::__allow_missing) {
17780                                return std::result::Result::Err(A::Error::duplicate_field(
17781                                    "multiple values for allow_missing",
17782                                ));
17783                            }
17784                            result.allow_missing = map
17785                                .next_value::<std::option::Option<bool>>()?
17786                                .unwrap_or_default();
17787                        }
17788                        __FieldTag::Unknown(key) => {
17789                            let value = map.next_value::<serde_json::Value>()?;
17790                            result._unknown_fields.insert(key, value);
17791                        }
17792                    }
17793                }
17794                std::result::Result::Ok(result)
17795            }
17796        }
17797        deserializer.deserialize_any(Visitor)
17798    }
17799}
17800
17801#[doc(hidden)]
17802impl serde::ser::Serialize for DeleteJobRequest {
17803    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17804    where
17805        S: serde::ser::Serializer,
17806    {
17807        use serde::ser::SerializeMap;
17808        #[allow(unused_imports)]
17809        use std::option::Option::Some;
17810        let mut state = serializer.serialize_map(std::option::Option::None)?;
17811        if !self.name.is_empty() {
17812            state.serialize_entry("name", &self.name)?;
17813        }
17814        if !wkt::internal::is_default(&self.allow_missing) {
17815            state.serialize_entry("allowMissing", &self.allow_missing)?;
17816        }
17817        if !self._unknown_fields.is_empty() {
17818            for (key, value) in self._unknown_fields.iter() {
17819                state.serialize_entry(key, &value)?;
17820            }
17821        }
17822        state.end()
17823    }
17824}
17825
17826impl std::fmt::Debug for DeleteJobRequest {
17827    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17828        let mut debug_struct = f.debug_struct("DeleteJobRequest");
17829        debug_struct.field("name", &self.name);
17830        debug_struct.field("allow_missing", &self.allow_missing);
17831        if !self._unknown_fields.is_empty() {
17832            debug_struct.field("_unknown_fields", &self._unknown_fields);
17833        }
17834        debug_struct.finish()
17835    }
17836}
17837
17838/// Response message for `TranscoderService.ListJobs`.
17839#[derive(Clone, Default, PartialEq)]
17840#[non_exhaustive]
17841pub struct ListJobsResponse {
17842    /// List of jobs in the specified region.
17843    pub jobs: std::vec::Vec<crate::model::Job>,
17844
17845    /// The pagination token.
17846    pub next_page_token: std::string::String,
17847
17848    /// List of regions that could not be reached.
17849    pub unreachable: std::vec::Vec<std::string::String>,
17850
17851    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17852}
17853
17854impl ListJobsResponse {
17855    pub fn new() -> Self {
17856        std::default::Default::default()
17857    }
17858
17859    /// Sets the value of [jobs][crate::model::ListJobsResponse::jobs].
17860    pub fn set_jobs<T, V>(mut self, v: T) -> Self
17861    where
17862        T: std::iter::IntoIterator<Item = V>,
17863        V: std::convert::Into<crate::model::Job>,
17864    {
17865        use std::iter::Iterator;
17866        self.jobs = v.into_iter().map(|i| i.into()).collect();
17867        self
17868    }
17869
17870    /// Sets the value of [next_page_token][crate::model::ListJobsResponse::next_page_token].
17871    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17872        self.next_page_token = v.into();
17873        self
17874    }
17875
17876    /// Sets the value of [unreachable][crate::model::ListJobsResponse::unreachable].
17877    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
17878    where
17879        T: std::iter::IntoIterator<Item = V>,
17880        V: std::convert::Into<std::string::String>,
17881    {
17882        use std::iter::Iterator;
17883        self.unreachable = v.into_iter().map(|i| i.into()).collect();
17884        self
17885    }
17886}
17887
17888impl wkt::message::Message for ListJobsResponse {
17889    fn typename() -> &'static str {
17890        "type.googleapis.com/google.cloud.video.transcoder.v1.ListJobsResponse"
17891    }
17892}
17893
17894#[doc(hidden)]
17895impl gax::paginator::internal::PageableResponse for ListJobsResponse {
17896    type PageItem = crate::model::Job;
17897
17898    fn items(self) -> std::vec::Vec<Self::PageItem> {
17899        self.jobs
17900    }
17901
17902    fn next_page_token(&self) -> std::string::String {
17903        use std::clone::Clone;
17904        self.next_page_token.clone()
17905    }
17906}
17907
17908#[doc(hidden)]
17909impl<'de> serde::de::Deserialize<'de> for ListJobsResponse {
17910    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17911    where
17912        D: serde::Deserializer<'de>,
17913    {
17914        #[allow(non_camel_case_types)]
17915        #[doc(hidden)]
17916        #[derive(PartialEq, Eq, Hash)]
17917        enum __FieldTag {
17918            __jobs,
17919            __next_page_token,
17920            __unreachable,
17921            Unknown(std::string::String),
17922        }
17923        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
17924            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17925            where
17926                D: serde::Deserializer<'de>,
17927            {
17928                struct Visitor;
17929                impl<'de> serde::de::Visitor<'de> for Visitor {
17930                    type Value = __FieldTag;
17931                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17932                        formatter.write_str("a field name for ListJobsResponse")
17933                    }
17934                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
17935                    where
17936                        E: serde::de::Error,
17937                    {
17938                        use std::result::Result::Ok;
17939                        use std::string::ToString;
17940                        match value {
17941                            "jobs" => Ok(__FieldTag::__jobs),
17942                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
17943                            "next_page_token" => Ok(__FieldTag::__next_page_token),
17944                            "unreachable" => Ok(__FieldTag::__unreachable),
17945                            _ => Ok(__FieldTag::Unknown(value.to_string())),
17946                        }
17947                    }
17948                }
17949                deserializer.deserialize_identifier(Visitor)
17950            }
17951        }
17952        struct Visitor;
17953        impl<'de> serde::de::Visitor<'de> for Visitor {
17954            type Value = ListJobsResponse;
17955            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
17956                formatter.write_str("struct ListJobsResponse")
17957            }
17958            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
17959            where
17960                A: serde::de::MapAccess<'de>,
17961            {
17962                #[allow(unused_imports)]
17963                use serde::de::Error;
17964                use std::option::Option::Some;
17965                let mut fields = std::collections::HashSet::new();
17966                let mut result = Self::Value::new();
17967                while let Some(tag) = map.next_key::<__FieldTag>()? {
17968                    #[allow(clippy::match_single_binding)]
17969                    match tag {
17970                        __FieldTag::__jobs => {
17971                            if !fields.insert(__FieldTag::__jobs) {
17972                                return std::result::Result::Err(A::Error::duplicate_field(
17973                                    "multiple values for jobs",
17974                                ));
17975                            }
17976                            result.jobs = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Job>>>()?.unwrap_or_default();
17977                        }
17978                        __FieldTag::__next_page_token => {
17979                            if !fields.insert(__FieldTag::__next_page_token) {
17980                                return std::result::Result::Err(A::Error::duplicate_field(
17981                                    "multiple values for next_page_token",
17982                                ));
17983                            }
17984                            result.next_page_token = map
17985                                .next_value::<std::option::Option<std::string::String>>()?
17986                                .unwrap_or_default();
17987                        }
17988                        __FieldTag::__unreachable => {
17989                            if !fields.insert(__FieldTag::__unreachable) {
17990                                return std::result::Result::Err(A::Error::duplicate_field(
17991                                    "multiple values for unreachable",
17992                                ));
17993                            }
17994                            result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
17995                        }
17996                        __FieldTag::Unknown(key) => {
17997                            let value = map.next_value::<serde_json::Value>()?;
17998                            result._unknown_fields.insert(key, value);
17999                        }
18000                    }
18001                }
18002                std::result::Result::Ok(result)
18003            }
18004        }
18005        deserializer.deserialize_any(Visitor)
18006    }
18007}
18008
18009#[doc(hidden)]
18010impl serde::ser::Serialize for ListJobsResponse {
18011    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18012    where
18013        S: serde::ser::Serializer,
18014    {
18015        use serde::ser::SerializeMap;
18016        #[allow(unused_imports)]
18017        use std::option::Option::Some;
18018        let mut state = serializer.serialize_map(std::option::Option::None)?;
18019        if !self.jobs.is_empty() {
18020            state.serialize_entry("jobs", &self.jobs)?;
18021        }
18022        if !self.next_page_token.is_empty() {
18023            state.serialize_entry("nextPageToken", &self.next_page_token)?;
18024        }
18025        if !self.unreachable.is_empty() {
18026            state.serialize_entry("unreachable", &self.unreachable)?;
18027        }
18028        if !self._unknown_fields.is_empty() {
18029            for (key, value) in self._unknown_fields.iter() {
18030                state.serialize_entry(key, &value)?;
18031            }
18032        }
18033        state.end()
18034    }
18035}
18036
18037impl std::fmt::Debug for ListJobsResponse {
18038    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18039        let mut debug_struct = f.debug_struct("ListJobsResponse");
18040        debug_struct.field("jobs", &self.jobs);
18041        debug_struct.field("next_page_token", &self.next_page_token);
18042        debug_struct.field("unreachable", &self.unreachable);
18043        if !self._unknown_fields.is_empty() {
18044            debug_struct.field("_unknown_fields", &self._unknown_fields);
18045        }
18046        debug_struct.finish()
18047    }
18048}
18049
18050/// Request message for `TranscoderService.CreateJobTemplate`.
18051#[derive(Clone, Default, PartialEq)]
18052#[non_exhaustive]
18053pub struct CreateJobTemplateRequest {
18054    /// Required. The parent location to create this job template.
18055    /// Format: `projects/{project}/locations/{location}`
18056    pub parent: std::string::String,
18057
18058    /// Required. Parameters for creating job template.
18059    pub job_template: std::option::Option<crate::model::JobTemplate>,
18060
18061    /// Required. The ID to use for the job template, which will become the final
18062    /// component of the job template's resource name.
18063    ///
18064    /// This value should be 4-63 characters, and valid characters must match the
18065    /// regular expression `[a-zA-Z][a-zA-Z0-9_-]*`.
18066    pub job_template_id: std::string::String,
18067
18068    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18069}
18070
18071impl CreateJobTemplateRequest {
18072    pub fn new() -> Self {
18073        std::default::Default::default()
18074    }
18075
18076    /// Sets the value of [parent][crate::model::CreateJobTemplateRequest::parent].
18077    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18078        self.parent = v.into();
18079        self
18080    }
18081
18082    /// Sets the value of [job_template][crate::model::CreateJobTemplateRequest::job_template].
18083    pub fn set_job_template<T>(mut self, v: T) -> Self
18084    where
18085        T: std::convert::Into<crate::model::JobTemplate>,
18086    {
18087        self.job_template = std::option::Option::Some(v.into());
18088        self
18089    }
18090
18091    /// Sets or clears the value of [job_template][crate::model::CreateJobTemplateRequest::job_template].
18092    pub fn set_or_clear_job_template<T>(mut self, v: std::option::Option<T>) -> Self
18093    where
18094        T: std::convert::Into<crate::model::JobTemplate>,
18095    {
18096        self.job_template = v.map(|x| x.into());
18097        self
18098    }
18099
18100    /// Sets the value of [job_template_id][crate::model::CreateJobTemplateRequest::job_template_id].
18101    pub fn set_job_template_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18102        self.job_template_id = v.into();
18103        self
18104    }
18105}
18106
18107impl wkt::message::Message for CreateJobTemplateRequest {
18108    fn typename() -> &'static str {
18109        "type.googleapis.com/google.cloud.video.transcoder.v1.CreateJobTemplateRequest"
18110    }
18111}
18112
18113#[doc(hidden)]
18114impl<'de> serde::de::Deserialize<'de> for CreateJobTemplateRequest {
18115    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18116    where
18117        D: serde::Deserializer<'de>,
18118    {
18119        #[allow(non_camel_case_types)]
18120        #[doc(hidden)]
18121        #[derive(PartialEq, Eq, Hash)]
18122        enum __FieldTag {
18123            __parent,
18124            __job_template,
18125            __job_template_id,
18126            Unknown(std::string::String),
18127        }
18128        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
18129            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18130            where
18131                D: serde::Deserializer<'de>,
18132            {
18133                struct Visitor;
18134                impl<'de> serde::de::Visitor<'de> for Visitor {
18135                    type Value = __FieldTag;
18136                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18137                        formatter.write_str("a field name for CreateJobTemplateRequest")
18138                    }
18139                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
18140                    where
18141                        E: serde::de::Error,
18142                    {
18143                        use std::result::Result::Ok;
18144                        use std::string::ToString;
18145                        match value {
18146                            "parent" => Ok(__FieldTag::__parent),
18147                            "jobTemplate" => Ok(__FieldTag::__job_template),
18148                            "job_template" => Ok(__FieldTag::__job_template),
18149                            "jobTemplateId" => Ok(__FieldTag::__job_template_id),
18150                            "job_template_id" => Ok(__FieldTag::__job_template_id),
18151                            _ => Ok(__FieldTag::Unknown(value.to_string())),
18152                        }
18153                    }
18154                }
18155                deserializer.deserialize_identifier(Visitor)
18156            }
18157        }
18158        struct Visitor;
18159        impl<'de> serde::de::Visitor<'de> for Visitor {
18160            type Value = CreateJobTemplateRequest;
18161            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18162                formatter.write_str("struct CreateJobTemplateRequest")
18163            }
18164            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
18165            where
18166                A: serde::de::MapAccess<'de>,
18167            {
18168                #[allow(unused_imports)]
18169                use serde::de::Error;
18170                use std::option::Option::Some;
18171                let mut fields = std::collections::HashSet::new();
18172                let mut result = Self::Value::new();
18173                while let Some(tag) = map.next_key::<__FieldTag>()? {
18174                    #[allow(clippy::match_single_binding)]
18175                    match tag {
18176                        __FieldTag::__parent => {
18177                            if !fields.insert(__FieldTag::__parent) {
18178                                return std::result::Result::Err(A::Error::duplicate_field(
18179                                    "multiple values for parent",
18180                                ));
18181                            }
18182                            result.parent = map
18183                                .next_value::<std::option::Option<std::string::String>>()?
18184                                .unwrap_or_default();
18185                        }
18186                        __FieldTag::__job_template => {
18187                            if !fields.insert(__FieldTag::__job_template) {
18188                                return std::result::Result::Err(A::Error::duplicate_field(
18189                                    "multiple values for job_template",
18190                                ));
18191                            }
18192                            result.job_template =
18193                                map.next_value::<std::option::Option<crate::model::JobTemplate>>()?;
18194                        }
18195                        __FieldTag::__job_template_id => {
18196                            if !fields.insert(__FieldTag::__job_template_id) {
18197                                return std::result::Result::Err(A::Error::duplicate_field(
18198                                    "multiple values for job_template_id",
18199                                ));
18200                            }
18201                            result.job_template_id = map
18202                                .next_value::<std::option::Option<std::string::String>>()?
18203                                .unwrap_or_default();
18204                        }
18205                        __FieldTag::Unknown(key) => {
18206                            let value = map.next_value::<serde_json::Value>()?;
18207                            result._unknown_fields.insert(key, value);
18208                        }
18209                    }
18210                }
18211                std::result::Result::Ok(result)
18212            }
18213        }
18214        deserializer.deserialize_any(Visitor)
18215    }
18216}
18217
18218#[doc(hidden)]
18219impl serde::ser::Serialize for CreateJobTemplateRequest {
18220    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18221    where
18222        S: serde::ser::Serializer,
18223    {
18224        use serde::ser::SerializeMap;
18225        #[allow(unused_imports)]
18226        use std::option::Option::Some;
18227        let mut state = serializer.serialize_map(std::option::Option::None)?;
18228        if !self.parent.is_empty() {
18229            state.serialize_entry("parent", &self.parent)?;
18230        }
18231        if self.job_template.is_some() {
18232            state.serialize_entry("jobTemplate", &self.job_template)?;
18233        }
18234        if !self.job_template_id.is_empty() {
18235            state.serialize_entry("jobTemplateId", &self.job_template_id)?;
18236        }
18237        if !self._unknown_fields.is_empty() {
18238            for (key, value) in self._unknown_fields.iter() {
18239                state.serialize_entry(key, &value)?;
18240            }
18241        }
18242        state.end()
18243    }
18244}
18245
18246impl std::fmt::Debug for CreateJobTemplateRequest {
18247    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18248        let mut debug_struct = f.debug_struct("CreateJobTemplateRequest");
18249        debug_struct.field("parent", &self.parent);
18250        debug_struct.field("job_template", &self.job_template);
18251        debug_struct.field("job_template_id", &self.job_template_id);
18252        if !self._unknown_fields.is_empty() {
18253            debug_struct.field("_unknown_fields", &self._unknown_fields);
18254        }
18255        debug_struct.finish()
18256    }
18257}
18258
18259/// Request message for `TranscoderService.ListJobTemplates`.
18260#[derive(Clone, Default, PartialEq)]
18261#[non_exhaustive]
18262pub struct ListJobTemplatesRequest {
18263    /// Required. The parent location from which to retrieve the collection of job
18264    /// templates. Format: `projects/{project}/locations/{location}`
18265    pub parent: std::string::String,
18266
18267    /// The maximum number of items to return.
18268    pub page_size: i32,
18269
18270    /// The `next_page_token` value returned from a previous List request, if
18271    /// any.
18272    pub page_token: std::string::String,
18273
18274    /// The filter expression, following the syntax outlined in
18275    /// <https://google.aip.dev/160>.
18276    pub filter: std::string::String,
18277
18278    /// One or more fields to compare and use to sort the output.
18279    /// See <https://google.aip.dev/132#ordering>.
18280    pub order_by: std::string::String,
18281
18282    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18283}
18284
18285impl ListJobTemplatesRequest {
18286    pub fn new() -> Self {
18287        std::default::Default::default()
18288    }
18289
18290    /// Sets the value of [parent][crate::model::ListJobTemplatesRequest::parent].
18291    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18292        self.parent = v.into();
18293        self
18294    }
18295
18296    /// Sets the value of [page_size][crate::model::ListJobTemplatesRequest::page_size].
18297    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18298        self.page_size = v.into();
18299        self
18300    }
18301
18302    /// Sets the value of [page_token][crate::model::ListJobTemplatesRequest::page_token].
18303    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18304        self.page_token = v.into();
18305        self
18306    }
18307
18308    /// Sets the value of [filter][crate::model::ListJobTemplatesRequest::filter].
18309    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18310        self.filter = v.into();
18311        self
18312    }
18313
18314    /// Sets the value of [order_by][crate::model::ListJobTemplatesRequest::order_by].
18315    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18316        self.order_by = v.into();
18317        self
18318    }
18319}
18320
18321impl wkt::message::Message for ListJobTemplatesRequest {
18322    fn typename() -> &'static str {
18323        "type.googleapis.com/google.cloud.video.transcoder.v1.ListJobTemplatesRequest"
18324    }
18325}
18326
18327#[doc(hidden)]
18328impl<'de> serde::de::Deserialize<'de> for ListJobTemplatesRequest {
18329    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18330    where
18331        D: serde::Deserializer<'de>,
18332    {
18333        #[allow(non_camel_case_types)]
18334        #[doc(hidden)]
18335        #[derive(PartialEq, Eq, Hash)]
18336        enum __FieldTag {
18337            __parent,
18338            __page_size,
18339            __page_token,
18340            __filter,
18341            __order_by,
18342            Unknown(std::string::String),
18343        }
18344        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
18345            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18346            where
18347                D: serde::Deserializer<'de>,
18348            {
18349                struct Visitor;
18350                impl<'de> serde::de::Visitor<'de> for Visitor {
18351                    type Value = __FieldTag;
18352                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18353                        formatter.write_str("a field name for ListJobTemplatesRequest")
18354                    }
18355                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
18356                    where
18357                        E: serde::de::Error,
18358                    {
18359                        use std::result::Result::Ok;
18360                        use std::string::ToString;
18361                        match value {
18362                            "parent" => Ok(__FieldTag::__parent),
18363                            "pageSize" => Ok(__FieldTag::__page_size),
18364                            "page_size" => Ok(__FieldTag::__page_size),
18365                            "pageToken" => Ok(__FieldTag::__page_token),
18366                            "page_token" => Ok(__FieldTag::__page_token),
18367                            "filter" => Ok(__FieldTag::__filter),
18368                            "orderBy" => Ok(__FieldTag::__order_by),
18369                            "order_by" => Ok(__FieldTag::__order_by),
18370                            _ => Ok(__FieldTag::Unknown(value.to_string())),
18371                        }
18372                    }
18373                }
18374                deserializer.deserialize_identifier(Visitor)
18375            }
18376        }
18377        struct Visitor;
18378        impl<'de> serde::de::Visitor<'de> for Visitor {
18379            type Value = ListJobTemplatesRequest;
18380            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18381                formatter.write_str("struct ListJobTemplatesRequest")
18382            }
18383            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
18384            where
18385                A: serde::de::MapAccess<'de>,
18386            {
18387                #[allow(unused_imports)]
18388                use serde::de::Error;
18389                use std::option::Option::Some;
18390                let mut fields = std::collections::HashSet::new();
18391                let mut result = Self::Value::new();
18392                while let Some(tag) = map.next_key::<__FieldTag>()? {
18393                    #[allow(clippy::match_single_binding)]
18394                    match tag {
18395                        __FieldTag::__parent => {
18396                            if !fields.insert(__FieldTag::__parent) {
18397                                return std::result::Result::Err(A::Error::duplicate_field(
18398                                    "multiple values for parent",
18399                                ));
18400                            }
18401                            result.parent = map
18402                                .next_value::<std::option::Option<std::string::String>>()?
18403                                .unwrap_or_default();
18404                        }
18405                        __FieldTag::__page_size => {
18406                            if !fields.insert(__FieldTag::__page_size) {
18407                                return std::result::Result::Err(A::Error::duplicate_field(
18408                                    "multiple values for page_size",
18409                                ));
18410                            }
18411                            struct __With(std::option::Option<i32>);
18412                            impl<'de> serde::de::Deserialize<'de> for __With {
18413                                fn deserialize<D>(
18414                                    deserializer: D,
18415                                ) -> std::result::Result<Self, D::Error>
18416                                where
18417                                    D: serde::de::Deserializer<'de>,
18418                                {
18419                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
18420                                }
18421                            }
18422                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
18423                        }
18424                        __FieldTag::__page_token => {
18425                            if !fields.insert(__FieldTag::__page_token) {
18426                                return std::result::Result::Err(A::Error::duplicate_field(
18427                                    "multiple values for page_token",
18428                                ));
18429                            }
18430                            result.page_token = map
18431                                .next_value::<std::option::Option<std::string::String>>()?
18432                                .unwrap_or_default();
18433                        }
18434                        __FieldTag::__filter => {
18435                            if !fields.insert(__FieldTag::__filter) {
18436                                return std::result::Result::Err(A::Error::duplicate_field(
18437                                    "multiple values for filter",
18438                                ));
18439                            }
18440                            result.filter = map
18441                                .next_value::<std::option::Option<std::string::String>>()?
18442                                .unwrap_or_default();
18443                        }
18444                        __FieldTag::__order_by => {
18445                            if !fields.insert(__FieldTag::__order_by) {
18446                                return std::result::Result::Err(A::Error::duplicate_field(
18447                                    "multiple values for order_by",
18448                                ));
18449                            }
18450                            result.order_by = map
18451                                .next_value::<std::option::Option<std::string::String>>()?
18452                                .unwrap_or_default();
18453                        }
18454                        __FieldTag::Unknown(key) => {
18455                            let value = map.next_value::<serde_json::Value>()?;
18456                            result._unknown_fields.insert(key, value);
18457                        }
18458                    }
18459                }
18460                std::result::Result::Ok(result)
18461            }
18462        }
18463        deserializer.deserialize_any(Visitor)
18464    }
18465}
18466
18467#[doc(hidden)]
18468impl serde::ser::Serialize for ListJobTemplatesRequest {
18469    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18470    where
18471        S: serde::ser::Serializer,
18472    {
18473        use serde::ser::SerializeMap;
18474        #[allow(unused_imports)]
18475        use std::option::Option::Some;
18476        let mut state = serializer.serialize_map(std::option::Option::None)?;
18477        if !self.parent.is_empty() {
18478            state.serialize_entry("parent", &self.parent)?;
18479        }
18480        if !wkt::internal::is_default(&self.page_size) {
18481            struct __With<'a>(&'a i32);
18482            impl<'a> serde::ser::Serialize for __With<'a> {
18483                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18484                where
18485                    S: serde::ser::Serializer,
18486                {
18487                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
18488                }
18489            }
18490            state.serialize_entry("pageSize", &__With(&self.page_size))?;
18491        }
18492        if !self.page_token.is_empty() {
18493            state.serialize_entry("pageToken", &self.page_token)?;
18494        }
18495        if !self.filter.is_empty() {
18496            state.serialize_entry("filter", &self.filter)?;
18497        }
18498        if !self.order_by.is_empty() {
18499            state.serialize_entry("orderBy", &self.order_by)?;
18500        }
18501        if !self._unknown_fields.is_empty() {
18502            for (key, value) in self._unknown_fields.iter() {
18503                state.serialize_entry(key, &value)?;
18504            }
18505        }
18506        state.end()
18507    }
18508}
18509
18510impl std::fmt::Debug for ListJobTemplatesRequest {
18511    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18512        let mut debug_struct = f.debug_struct("ListJobTemplatesRequest");
18513        debug_struct.field("parent", &self.parent);
18514        debug_struct.field("page_size", &self.page_size);
18515        debug_struct.field("page_token", &self.page_token);
18516        debug_struct.field("filter", &self.filter);
18517        debug_struct.field("order_by", &self.order_by);
18518        if !self._unknown_fields.is_empty() {
18519            debug_struct.field("_unknown_fields", &self._unknown_fields);
18520        }
18521        debug_struct.finish()
18522    }
18523}
18524
18525/// Request message for `TranscoderService.GetJobTemplate`.
18526#[derive(Clone, Default, PartialEq)]
18527#[non_exhaustive]
18528pub struct GetJobTemplateRequest {
18529    /// Required. The name of the job template to retrieve.
18530    /// Format:
18531    /// `projects/{project}/locations/{location}/jobTemplates/{job_template}`
18532    pub name: std::string::String,
18533
18534    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18535}
18536
18537impl GetJobTemplateRequest {
18538    pub fn new() -> Self {
18539        std::default::Default::default()
18540    }
18541
18542    /// Sets the value of [name][crate::model::GetJobTemplateRequest::name].
18543    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18544        self.name = v.into();
18545        self
18546    }
18547}
18548
18549impl wkt::message::Message for GetJobTemplateRequest {
18550    fn typename() -> &'static str {
18551        "type.googleapis.com/google.cloud.video.transcoder.v1.GetJobTemplateRequest"
18552    }
18553}
18554
18555#[doc(hidden)]
18556impl<'de> serde::de::Deserialize<'de> for GetJobTemplateRequest {
18557    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18558    where
18559        D: serde::Deserializer<'de>,
18560    {
18561        #[allow(non_camel_case_types)]
18562        #[doc(hidden)]
18563        #[derive(PartialEq, Eq, Hash)]
18564        enum __FieldTag {
18565            __name,
18566            Unknown(std::string::String),
18567        }
18568        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
18569            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18570            where
18571                D: serde::Deserializer<'de>,
18572            {
18573                struct Visitor;
18574                impl<'de> serde::de::Visitor<'de> for Visitor {
18575                    type Value = __FieldTag;
18576                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18577                        formatter.write_str("a field name for GetJobTemplateRequest")
18578                    }
18579                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
18580                    where
18581                        E: serde::de::Error,
18582                    {
18583                        use std::result::Result::Ok;
18584                        use std::string::ToString;
18585                        match value {
18586                            "name" => Ok(__FieldTag::__name),
18587                            _ => Ok(__FieldTag::Unknown(value.to_string())),
18588                        }
18589                    }
18590                }
18591                deserializer.deserialize_identifier(Visitor)
18592            }
18593        }
18594        struct Visitor;
18595        impl<'de> serde::de::Visitor<'de> for Visitor {
18596            type Value = GetJobTemplateRequest;
18597            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18598                formatter.write_str("struct GetJobTemplateRequest")
18599            }
18600            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
18601            where
18602                A: serde::de::MapAccess<'de>,
18603            {
18604                #[allow(unused_imports)]
18605                use serde::de::Error;
18606                use std::option::Option::Some;
18607                let mut fields = std::collections::HashSet::new();
18608                let mut result = Self::Value::new();
18609                while let Some(tag) = map.next_key::<__FieldTag>()? {
18610                    #[allow(clippy::match_single_binding)]
18611                    match tag {
18612                        __FieldTag::__name => {
18613                            if !fields.insert(__FieldTag::__name) {
18614                                return std::result::Result::Err(A::Error::duplicate_field(
18615                                    "multiple values for name",
18616                                ));
18617                            }
18618                            result.name = map
18619                                .next_value::<std::option::Option<std::string::String>>()?
18620                                .unwrap_or_default();
18621                        }
18622                        __FieldTag::Unknown(key) => {
18623                            let value = map.next_value::<serde_json::Value>()?;
18624                            result._unknown_fields.insert(key, value);
18625                        }
18626                    }
18627                }
18628                std::result::Result::Ok(result)
18629            }
18630        }
18631        deserializer.deserialize_any(Visitor)
18632    }
18633}
18634
18635#[doc(hidden)]
18636impl serde::ser::Serialize for GetJobTemplateRequest {
18637    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18638    where
18639        S: serde::ser::Serializer,
18640    {
18641        use serde::ser::SerializeMap;
18642        #[allow(unused_imports)]
18643        use std::option::Option::Some;
18644        let mut state = serializer.serialize_map(std::option::Option::None)?;
18645        if !self.name.is_empty() {
18646            state.serialize_entry("name", &self.name)?;
18647        }
18648        if !self._unknown_fields.is_empty() {
18649            for (key, value) in self._unknown_fields.iter() {
18650                state.serialize_entry(key, &value)?;
18651            }
18652        }
18653        state.end()
18654    }
18655}
18656
18657impl std::fmt::Debug for GetJobTemplateRequest {
18658    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18659        let mut debug_struct = f.debug_struct("GetJobTemplateRequest");
18660        debug_struct.field("name", &self.name);
18661        if !self._unknown_fields.is_empty() {
18662            debug_struct.field("_unknown_fields", &self._unknown_fields);
18663        }
18664        debug_struct.finish()
18665    }
18666}
18667
18668/// Request message for `TranscoderService.DeleteJobTemplate`.
18669#[derive(Clone, Default, PartialEq)]
18670#[non_exhaustive]
18671pub struct DeleteJobTemplateRequest {
18672    /// Required. The name of the job template to delete.
18673    /// `projects/{project}/locations/{location}/jobTemplates/{job_template}`
18674    pub name: std::string::String,
18675
18676    /// If set to true, and the job template is not found, the request will succeed
18677    /// but no action will be taken on the server.
18678    pub allow_missing: bool,
18679
18680    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18681}
18682
18683impl DeleteJobTemplateRequest {
18684    pub fn new() -> Self {
18685        std::default::Default::default()
18686    }
18687
18688    /// Sets the value of [name][crate::model::DeleteJobTemplateRequest::name].
18689    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18690        self.name = v.into();
18691        self
18692    }
18693
18694    /// Sets the value of [allow_missing][crate::model::DeleteJobTemplateRequest::allow_missing].
18695    pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
18696        self.allow_missing = v.into();
18697        self
18698    }
18699}
18700
18701impl wkt::message::Message for DeleteJobTemplateRequest {
18702    fn typename() -> &'static str {
18703        "type.googleapis.com/google.cloud.video.transcoder.v1.DeleteJobTemplateRequest"
18704    }
18705}
18706
18707#[doc(hidden)]
18708impl<'de> serde::de::Deserialize<'de> for DeleteJobTemplateRequest {
18709    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18710    where
18711        D: serde::Deserializer<'de>,
18712    {
18713        #[allow(non_camel_case_types)]
18714        #[doc(hidden)]
18715        #[derive(PartialEq, Eq, Hash)]
18716        enum __FieldTag {
18717            __name,
18718            __allow_missing,
18719            Unknown(std::string::String),
18720        }
18721        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
18722            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18723            where
18724                D: serde::Deserializer<'de>,
18725            {
18726                struct Visitor;
18727                impl<'de> serde::de::Visitor<'de> for Visitor {
18728                    type Value = __FieldTag;
18729                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18730                        formatter.write_str("a field name for DeleteJobTemplateRequest")
18731                    }
18732                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
18733                    where
18734                        E: serde::de::Error,
18735                    {
18736                        use std::result::Result::Ok;
18737                        use std::string::ToString;
18738                        match value {
18739                            "name" => Ok(__FieldTag::__name),
18740                            "allowMissing" => Ok(__FieldTag::__allow_missing),
18741                            "allow_missing" => Ok(__FieldTag::__allow_missing),
18742                            _ => Ok(__FieldTag::Unknown(value.to_string())),
18743                        }
18744                    }
18745                }
18746                deserializer.deserialize_identifier(Visitor)
18747            }
18748        }
18749        struct Visitor;
18750        impl<'de> serde::de::Visitor<'de> for Visitor {
18751            type Value = DeleteJobTemplateRequest;
18752            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18753                formatter.write_str("struct DeleteJobTemplateRequest")
18754            }
18755            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
18756            where
18757                A: serde::de::MapAccess<'de>,
18758            {
18759                #[allow(unused_imports)]
18760                use serde::de::Error;
18761                use std::option::Option::Some;
18762                let mut fields = std::collections::HashSet::new();
18763                let mut result = Self::Value::new();
18764                while let Some(tag) = map.next_key::<__FieldTag>()? {
18765                    #[allow(clippy::match_single_binding)]
18766                    match tag {
18767                        __FieldTag::__name => {
18768                            if !fields.insert(__FieldTag::__name) {
18769                                return std::result::Result::Err(A::Error::duplicate_field(
18770                                    "multiple values for name",
18771                                ));
18772                            }
18773                            result.name = map
18774                                .next_value::<std::option::Option<std::string::String>>()?
18775                                .unwrap_or_default();
18776                        }
18777                        __FieldTag::__allow_missing => {
18778                            if !fields.insert(__FieldTag::__allow_missing) {
18779                                return std::result::Result::Err(A::Error::duplicate_field(
18780                                    "multiple values for allow_missing",
18781                                ));
18782                            }
18783                            result.allow_missing = map
18784                                .next_value::<std::option::Option<bool>>()?
18785                                .unwrap_or_default();
18786                        }
18787                        __FieldTag::Unknown(key) => {
18788                            let value = map.next_value::<serde_json::Value>()?;
18789                            result._unknown_fields.insert(key, value);
18790                        }
18791                    }
18792                }
18793                std::result::Result::Ok(result)
18794            }
18795        }
18796        deserializer.deserialize_any(Visitor)
18797    }
18798}
18799
18800#[doc(hidden)]
18801impl serde::ser::Serialize for DeleteJobTemplateRequest {
18802    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18803    where
18804        S: serde::ser::Serializer,
18805    {
18806        use serde::ser::SerializeMap;
18807        #[allow(unused_imports)]
18808        use std::option::Option::Some;
18809        let mut state = serializer.serialize_map(std::option::Option::None)?;
18810        if !self.name.is_empty() {
18811            state.serialize_entry("name", &self.name)?;
18812        }
18813        if !wkt::internal::is_default(&self.allow_missing) {
18814            state.serialize_entry("allowMissing", &self.allow_missing)?;
18815        }
18816        if !self._unknown_fields.is_empty() {
18817            for (key, value) in self._unknown_fields.iter() {
18818                state.serialize_entry(key, &value)?;
18819            }
18820        }
18821        state.end()
18822    }
18823}
18824
18825impl std::fmt::Debug for DeleteJobTemplateRequest {
18826    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18827        let mut debug_struct = f.debug_struct("DeleteJobTemplateRequest");
18828        debug_struct.field("name", &self.name);
18829        debug_struct.field("allow_missing", &self.allow_missing);
18830        if !self._unknown_fields.is_empty() {
18831            debug_struct.field("_unknown_fields", &self._unknown_fields);
18832        }
18833        debug_struct.finish()
18834    }
18835}
18836
18837/// Response message for `TranscoderService.ListJobTemplates`.
18838#[derive(Clone, Default, PartialEq)]
18839#[non_exhaustive]
18840pub struct ListJobTemplatesResponse {
18841    /// List of job templates in the specified region.
18842    pub job_templates: std::vec::Vec<crate::model::JobTemplate>,
18843
18844    /// The pagination token.
18845    pub next_page_token: std::string::String,
18846
18847    /// List of regions that could not be reached.
18848    pub unreachable: std::vec::Vec<std::string::String>,
18849
18850    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18851}
18852
18853impl ListJobTemplatesResponse {
18854    pub fn new() -> Self {
18855        std::default::Default::default()
18856    }
18857
18858    /// Sets the value of [job_templates][crate::model::ListJobTemplatesResponse::job_templates].
18859    pub fn set_job_templates<T, V>(mut self, v: T) -> Self
18860    where
18861        T: std::iter::IntoIterator<Item = V>,
18862        V: std::convert::Into<crate::model::JobTemplate>,
18863    {
18864        use std::iter::Iterator;
18865        self.job_templates = v.into_iter().map(|i| i.into()).collect();
18866        self
18867    }
18868
18869    /// Sets the value of [next_page_token][crate::model::ListJobTemplatesResponse::next_page_token].
18870    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18871        self.next_page_token = v.into();
18872        self
18873    }
18874
18875    /// Sets the value of [unreachable][crate::model::ListJobTemplatesResponse::unreachable].
18876    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
18877    where
18878        T: std::iter::IntoIterator<Item = V>,
18879        V: std::convert::Into<std::string::String>,
18880    {
18881        use std::iter::Iterator;
18882        self.unreachable = v.into_iter().map(|i| i.into()).collect();
18883        self
18884    }
18885}
18886
18887impl wkt::message::Message for ListJobTemplatesResponse {
18888    fn typename() -> &'static str {
18889        "type.googleapis.com/google.cloud.video.transcoder.v1.ListJobTemplatesResponse"
18890    }
18891}
18892
18893#[doc(hidden)]
18894impl gax::paginator::internal::PageableResponse for ListJobTemplatesResponse {
18895    type PageItem = crate::model::JobTemplate;
18896
18897    fn items(self) -> std::vec::Vec<Self::PageItem> {
18898        self.job_templates
18899    }
18900
18901    fn next_page_token(&self) -> std::string::String {
18902        use std::clone::Clone;
18903        self.next_page_token.clone()
18904    }
18905}
18906
18907#[doc(hidden)]
18908impl<'de> serde::de::Deserialize<'de> for ListJobTemplatesResponse {
18909    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18910    where
18911        D: serde::Deserializer<'de>,
18912    {
18913        #[allow(non_camel_case_types)]
18914        #[doc(hidden)]
18915        #[derive(PartialEq, Eq, Hash)]
18916        enum __FieldTag {
18917            __job_templates,
18918            __next_page_token,
18919            __unreachable,
18920            Unknown(std::string::String),
18921        }
18922        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
18923            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18924            where
18925                D: serde::Deserializer<'de>,
18926            {
18927                struct Visitor;
18928                impl<'de> serde::de::Visitor<'de> for Visitor {
18929                    type Value = __FieldTag;
18930                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18931                        formatter.write_str("a field name for ListJobTemplatesResponse")
18932                    }
18933                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
18934                    where
18935                        E: serde::de::Error,
18936                    {
18937                        use std::result::Result::Ok;
18938                        use std::string::ToString;
18939                        match value {
18940                            "jobTemplates" => Ok(__FieldTag::__job_templates),
18941                            "job_templates" => Ok(__FieldTag::__job_templates),
18942                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
18943                            "next_page_token" => Ok(__FieldTag::__next_page_token),
18944                            "unreachable" => Ok(__FieldTag::__unreachable),
18945                            _ => Ok(__FieldTag::Unknown(value.to_string())),
18946                        }
18947                    }
18948                }
18949                deserializer.deserialize_identifier(Visitor)
18950            }
18951        }
18952        struct Visitor;
18953        impl<'de> serde::de::Visitor<'de> for Visitor {
18954            type Value = ListJobTemplatesResponse;
18955            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
18956                formatter.write_str("struct ListJobTemplatesResponse")
18957            }
18958            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
18959            where
18960                A: serde::de::MapAccess<'de>,
18961            {
18962                #[allow(unused_imports)]
18963                use serde::de::Error;
18964                use std::option::Option::Some;
18965                let mut fields = std::collections::HashSet::new();
18966                let mut result = Self::Value::new();
18967                while let Some(tag) = map.next_key::<__FieldTag>()? {
18968                    #[allow(clippy::match_single_binding)]
18969                    match tag {
18970                        __FieldTag::__job_templates => {
18971                            if !fields.insert(__FieldTag::__job_templates) {
18972                                return std::result::Result::Err(A::Error::duplicate_field(
18973                                    "multiple values for job_templates",
18974                                ));
18975                            }
18976                            result.job_templates = map.next_value::<std::option::Option<std::vec::Vec<crate::model::JobTemplate>>>()?.unwrap_or_default();
18977                        }
18978                        __FieldTag::__next_page_token => {
18979                            if !fields.insert(__FieldTag::__next_page_token) {
18980                                return std::result::Result::Err(A::Error::duplicate_field(
18981                                    "multiple values for next_page_token",
18982                                ));
18983                            }
18984                            result.next_page_token = map
18985                                .next_value::<std::option::Option<std::string::String>>()?
18986                                .unwrap_or_default();
18987                        }
18988                        __FieldTag::__unreachable => {
18989                            if !fields.insert(__FieldTag::__unreachable) {
18990                                return std::result::Result::Err(A::Error::duplicate_field(
18991                                    "multiple values for unreachable",
18992                                ));
18993                            }
18994                            result.unreachable = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
18995                        }
18996                        __FieldTag::Unknown(key) => {
18997                            let value = map.next_value::<serde_json::Value>()?;
18998                            result._unknown_fields.insert(key, value);
18999                        }
19000                    }
19001                }
19002                std::result::Result::Ok(result)
19003            }
19004        }
19005        deserializer.deserialize_any(Visitor)
19006    }
19007}
19008
19009#[doc(hidden)]
19010impl serde::ser::Serialize for ListJobTemplatesResponse {
19011    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19012    where
19013        S: serde::ser::Serializer,
19014    {
19015        use serde::ser::SerializeMap;
19016        #[allow(unused_imports)]
19017        use std::option::Option::Some;
19018        let mut state = serializer.serialize_map(std::option::Option::None)?;
19019        if !self.job_templates.is_empty() {
19020            state.serialize_entry("jobTemplates", &self.job_templates)?;
19021        }
19022        if !self.next_page_token.is_empty() {
19023            state.serialize_entry("nextPageToken", &self.next_page_token)?;
19024        }
19025        if !self.unreachable.is_empty() {
19026            state.serialize_entry("unreachable", &self.unreachable)?;
19027        }
19028        if !self._unknown_fields.is_empty() {
19029            for (key, value) in self._unknown_fields.iter() {
19030                state.serialize_entry(key, &value)?;
19031            }
19032        }
19033        state.end()
19034    }
19035}
19036
19037impl std::fmt::Debug for ListJobTemplatesResponse {
19038    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19039        let mut debug_struct = f.debug_struct("ListJobTemplatesResponse");
19040        debug_struct.field("job_templates", &self.job_templates);
19041        debug_struct.field("next_page_token", &self.next_page_token);
19042        debug_struct.field("unreachable", &self.unreachable);
19043        if !self._unknown_fields.is_empty() {
19044            debug_struct.field("_unknown_fields", &self._unknown_fields);
19045        }
19046        debug_struct.finish()
19047    }
19048}