google_cloud_video_transcoder_v1/
builder.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
17pub mod transcoder_service {
18    use crate::Result;
19
20    /// A builder for [TranscoderService][crate::client::TranscoderService].
21    ///
22    /// ```
23    /// # tokio_test::block_on(async {
24    /// # use google_cloud_video_transcoder_v1::*;
25    /// # use builder::transcoder_service::ClientBuilder;
26    /// # use client::TranscoderService;
27    /// let builder : ClientBuilder = TranscoderService::builder();
28    /// let client = builder
29    ///     .with_endpoint("https://transcoder.googleapis.com")
30    ///     .build().await?;
31    /// # gax::client_builder::Result::<()>::Ok(()) });
32    /// ```
33    pub type ClientBuilder =
34        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36    pub(crate) mod client {
37        use super::super::super::client::TranscoderService;
38        pub struct Factory;
39        impl gax::client_builder::internal::ClientFactory for Factory {
40            type Client = TranscoderService;
41            type Credentials = gaxi::options::Credentials;
42            async fn build(
43                self,
44                config: gaxi::options::ClientConfig,
45            ) -> gax::client_builder::Result<Self::Client> {
46                Self::Client::new(config).await
47            }
48        }
49    }
50
51    /// Common implementation for [crate::client::TranscoderService] request builders.
52    #[derive(Clone, Debug)]
53    pub(crate) struct RequestBuilder<R: std::default::Default> {
54        stub: std::sync::Arc<dyn super::super::stub::dynamic::TranscoderService>,
55        request: R,
56        options: gax::options::RequestOptions,
57    }
58
59    impl<R> RequestBuilder<R>
60    where
61        R: std::default::Default,
62    {
63        pub(crate) fn new(
64            stub: std::sync::Arc<dyn super::super::stub::dynamic::TranscoderService>,
65        ) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: gax::options::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [TranscoderService::create_job][crate::client::TranscoderService::create_job] calls.
75    ///
76    /// # Example
77    /// ```no_run
78    /// # use google_cloud_video_transcoder_v1::builder;
79    /// use builder::transcoder_service::CreateJob;
80    /// # tokio_test::block_on(async {
81    ///
82    /// let builder = prepare_request_builder();
83    /// let response = builder.send().await?;
84    /// # gax::Result::<()>::Ok(()) });
85    ///
86    /// fn prepare_request_builder() -> CreateJob {
87    ///   # panic!();
88    ///   // ... details omitted ...
89    /// }
90    /// ```
91    #[derive(Clone, Debug)]
92    pub struct CreateJob(RequestBuilder<crate::model::CreateJobRequest>);
93
94    impl CreateJob {
95        pub(crate) fn new(
96            stub: std::sync::Arc<dyn super::super::stub::dynamic::TranscoderService>,
97        ) -> Self {
98            Self(RequestBuilder::new(stub))
99        }
100
101        /// Sets the full request, replacing any prior values.
102        pub fn with_request<V: Into<crate::model::CreateJobRequest>>(mut self, v: V) -> Self {
103            self.0.request = v.into();
104            self
105        }
106
107        /// Sets all the options, replacing any prior values.
108        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
109            self.0.options = v.into();
110            self
111        }
112
113        /// Sends the request.
114        pub async fn send(self) -> Result<crate::model::Job> {
115            (*self.0.stub)
116                .create_job(self.0.request, self.0.options)
117                .await
118                .map(gax::response::Response::into_body)
119        }
120
121        /// Sets the value of [parent][crate::model::CreateJobRequest::parent].
122        ///
123        /// This is a **required** field for requests.
124        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
125            self.0.request.parent = v.into();
126            self
127        }
128
129        /// Sets the value of [job][crate::model::CreateJobRequest::job].
130        ///
131        /// This is a **required** field for requests.
132        pub fn set_job<T>(mut self, v: T) -> Self
133        where
134            T: std::convert::Into<crate::model::Job>,
135        {
136            self.0.request.job = std::option::Option::Some(v.into());
137            self
138        }
139
140        /// Sets or clears the value of [job][crate::model::CreateJobRequest::job].
141        ///
142        /// This is a **required** field for requests.
143        pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
144        where
145            T: std::convert::Into<crate::model::Job>,
146        {
147            self.0.request.job = v.map(|x| x.into());
148            self
149        }
150    }
151
152    #[doc(hidden)]
153    impl gax::options::internal::RequestBuilder for CreateJob {
154        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
155            &mut self.0.options
156        }
157    }
158
159    /// The request builder for [TranscoderService::list_jobs][crate::client::TranscoderService::list_jobs] calls.
160    ///
161    /// # Example
162    /// ```no_run
163    /// # use google_cloud_video_transcoder_v1::builder;
164    /// use builder::transcoder_service::ListJobs;
165    /// # tokio_test::block_on(async {
166    /// use gax::paginator::ItemPaginator;
167    ///
168    /// let builder = prepare_request_builder();
169    /// let mut items = builder.by_item();
170    /// while let Some(result) = items.next().await {
171    ///   let item = result?;
172    /// }
173    /// # gax::Result::<()>::Ok(()) });
174    ///
175    /// fn prepare_request_builder() -> ListJobs {
176    ///   # panic!();
177    ///   // ... details omitted ...
178    /// }
179    /// ```
180    #[derive(Clone, Debug)]
181    pub struct ListJobs(RequestBuilder<crate::model::ListJobsRequest>);
182
183    impl ListJobs {
184        pub(crate) fn new(
185            stub: std::sync::Arc<dyn super::super::stub::dynamic::TranscoderService>,
186        ) -> Self {
187            Self(RequestBuilder::new(stub))
188        }
189
190        /// Sets the full request, replacing any prior values.
191        pub fn with_request<V: Into<crate::model::ListJobsRequest>>(mut self, v: V) -> Self {
192            self.0.request = v.into();
193            self
194        }
195
196        /// Sets all the options, replacing any prior values.
197        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
198            self.0.options = v.into();
199            self
200        }
201
202        /// Sends the request.
203        pub async fn send(self) -> Result<crate::model::ListJobsResponse> {
204            (*self.0.stub)
205                .list_jobs(self.0.request, self.0.options)
206                .await
207                .map(gax::response::Response::into_body)
208        }
209
210        /// Streams each page in the collection.
211        pub fn by_page(
212            self,
213        ) -> impl gax::paginator::Paginator<crate::model::ListJobsResponse, gax::error::Error>
214        {
215            use std::clone::Clone;
216            let token = self.0.request.page_token.clone();
217            let execute = move |token: String| {
218                let mut builder = self.clone();
219                builder.0.request = builder.0.request.set_page_token(token);
220                builder.send()
221            };
222            gax::paginator::internal::new_paginator(token, execute)
223        }
224
225        /// Streams each item in the collection.
226        pub fn by_item(
227            self,
228        ) -> impl gax::paginator::ItemPaginator<crate::model::ListJobsResponse, gax::error::Error>
229        {
230            use gax::paginator::Paginator;
231            self.by_page().items()
232        }
233
234        /// Sets the value of [parent][crate::model::ListJobsRequest::parent].
235        ///
236        /// This is a **required** field for requests.
237        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
238            self.0.request.parent = v.into();
239            self
240        }
241
242        /// Sets the value of [page_size][crate::model::ListJobsRequest::page_size].
243        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
244            self.0.request.page_size = v.into();
245            self
246        }
247
248        /// Sets the value of [page_token][crate::model::ListJobsRequest::page_token].
249        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
250            self.0.request.page_token = v.into();
251            self
252        }
253
254        /// Sets the value of [filter][crate::model::ListJobsRequest::filter].
255        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
256            self.0.request.filter = v.into();
257            self
258        }
259
260        /// Sets the value of [order_by][crate::model::ListJobsRequest::order_by].
261        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
262            self.0.request.order_by = v.into();
263            self
264        }
265    }
266
267    #[doc(hidden)]
268    impl gax::options::internal::RequestBuilder for ListJobs {
269        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
270            &mut self.0.options
271        }
272    }
273
274    /// The request builder for [TranscoderService::get_job][crate::client::TranscoderService::get_job] calls.
275    ///
276    /// # Example
277    /// ```no_run
278    /// # use google_cloud_video_transcoder_v1::builder;
279    /// use builder::transcoder_service::GetJob;
280    /// # tokio_test::block_on(async {
281    ///
282    /// let builder = prepare_request_builder();
283    /// let response = builder.send().await?;
284    /// # gax::Result::<()>::Ok(()) });
285    ///
286    /// fn prepare_request_builder() -> GetJob {
287    ///   # panic!();
288    ///   // ... details omitted ...
289    /// }
290    /// ```
291    #[derive(Clone, Debug)]
292    pub struct GetJob(RequestBuilder<crate::model::GetJobRequest>);
293
294    impl GetJob {
295        pub(crate) fn new(
296            stub: std::sync::Arc<dyn super::super::stub::dynamic::TranscoderService>,
297        ) -> Self {
298            Self(RequestBuilder::new(stub))
299        }
300
301        /// Sets the full request, replacing any prior values.
302        pub fn with_request<V: Into<crate::model::GetJobRequest>>(mut self, v: V) -> Self {
303            self.0.request = v.into();
304            self
305        }
306
307        /// Sets all the options, replacing any prior values.
308        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
309            self.0.options = v.into();
310            self
311        }
312
313        /// Sends the request.
314        pub async fn send(self) -> Result<crate::model::Job> {
315            (*self.0.stub)
316                .get_job(self.0.request, self.0.options)
317                .await
318                .map(gax::response::Response::into_body)
319        }
320
321        /// Sets the value of [name][crate::model::GetJobRequest::name].
322        ///
323        /// This is a **required** field for requests.
324        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
325            self.0.request.name = v.into();
326            self
327        }
328    }
329
330    #[doc(hidden)]
331    impl gax::options::internal::RequestBuilder for GetJob {
332        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
333            &mut self.0.options
334        }
335    }
336
337    /// The request builder for [TranscoderService::delete_job][crate::client::TranscoderService::delete_job] calls.
338    ///
339    /// # Example
340    /// ```no_run
341    /// # use google_cloud_video_transcoder_v1::builder;
342    /// use builder::transcoder_service::DeleteJob;
343    /// # tokio_test::block_on(async {
344    ///
345    /// let builder = prepare_request_builder();
346    /// let response = builder.send().await?;
347    /// # gax::Result::<()>::Ok(()) });
348    ///
349    /// fn prepare_request_builder() -> DeleteJob {
350    ///   # panic!();
351    ///   // ... details omitted ...
352    /// }
353    /// ```
354    #[derive(Clone, Debug)]
355    pub struct DeleteJob(RequestBuilder<crate::model::DeleteJobRequest>);
356
357    impl DeleteJob {
358        pub(crate) fn new(
359            stub: std::sync::Arc<dyn super::super::stub::dynamic::TranscoderService>,
360        ) -> Self {
361            Self(RequestBuilder::new(stub))
362        }
363
364        /// Sets the full request, replacing any prior values.
365        pub fn with_request<V: Into<crate::model::DeleteJobRequest>>(mut self, v: V) -> Self {
366            self.0.request = v.into();
367            self
368        }
369
370        /// Sets all the options, replacing any prior values.
371        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
372            self.0.options = v.into();
373            self
374        }
375
376        /// Sends the request.
377        pub async fn send(self) -> Result<()> {
378            (*self.0.stub)
379                .delete_job(self.0.request, self.0.options)
380                .await
381                .map(gax::response::Response::into_body)
382        }
383
384        /// Sets the value of [name][crate::model::DeleteJobRequest::name].
385        ///
386        /// This is a **required** field for requests.
387        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
388            self.0.request.name = v.into();
389            self
390        }
391
392        /// Sets the value of [allow_missing][crate::model::DeleteJobRequest::allow_missing].
393        pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
394            self.0.request.allow_missing = v.into();
395            self
396        }
397    }
398
399    #[doc(hidden)]
400    impl gax::options::internal::RequestBuilder for DeleteJob {
401        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
402            &mut self.0.options
403        }
404    }
405
406    /// The request builder for [TranscoderService::create_job_template][crate::client::TranscoderService::create_job_template] calls.
407    ///
408    /// # Example
409    /// ```no_run
410    /// # use google_cloud_video_transcoder_v1::builder;
411    /// use builder::transcoder_service::CreateJobTemplate;
412    /// # tokio_test::block_on(async {
413    ///
414    /// let builder = prepare_request_builder();
415    /// let response = builder.send().await?;
416    /// # gax::Result::<()>::Ok(()) });
417    ///
418    /// fn prepare_request_builder() -> CreateJobTemplate {
419    ///   # panic!();
420    ///   // ... details omitted ...
421    /// }
422    /// ```
423    #[derive(Clone, Debug)]
424    pub struct CreateJobTemplate(RequestBuilder<crate::model::CreateJobTemplateRequest>);
425
426    impl CreateJobTemplate {
427        pub(crate) fn new(
428            stub: std::sync::Arc<dyn super::super::stub::dynamic::TranscoderService>,
429        ) -> Self {
430            Self(RequestBuilder::new(stub))
431        }
432
433        /// Sets the full request, replacing any prior values.
434        pub fn with_request<V: Into<crate::model::CreateJobTemplateRequest>>(
435            mut self,
436            v: V,
437        ) -> Self {
438            self.0.request = v.into();
439            self
440        }
441
442        /// Sets all the options, replacing any prior values.
443        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
444            self.0.options = v.into();
445            self
446        }
447
448        /// Sends the request.
449        pub async fn send(self) -> Result<crate::model::JobTemplate> {
450            (*self.0.stub)
451                .create_job_template(self.0.request, self.0.options)
452                .await
453                .map(gax::response::Response::into_body)
454        }
455
456        /// Sets the value of [parent][crate::model::CreateJobTemplateRequest::parent].
457        ///
458        /// This is a **required** field for requests.
459        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
460            self.0.request.parent = v.into();
461            self
462        }
463
464        /// Sets the value of [job_template][crate::model::CreateJobTemplateRequest::job_template].
465        ///
466        /// This is a **required** field for requests.
467        pub fn set_job_template<T>(mut self, v: T) -> Self
468        where
469            T: std::convert::Into<crate::model::JobTemplate>,
470        {
471            self.0.request.job_template = std::option::Option::Some(v.into());
472            self
473        }
474
475        /// Sets or clears the value of [job_template][crate::model::CreateJobTemplateRequest::job_template].
476        ///
477        /// This is a **required** field for requests.
478        pub fn set_or_clear_job_template<T>(mut self, v: std::option::Option<T>) -> Self
479        where
480            T: std::convert::Into<crate::model::JobTemplate>,
481        {
482            self.0.request.job_template = v.map(|x| x.into());
483            self
484        }
485
486        /// Sets the value of [job_template_id][crate::model::CreateJobTemplateRequest::job_template_id].
487        ///
488        /// This is a **required** field for requests.
489        pub fn set_job_template_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
490            self.0.request.job_template_id = v.into();
491            self
492        }
493    }
494
495    #[doc(hidden)]
496    impl gax::options::internal::RequestBuilder for CreateJobTemplate {
497        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
498            &mut self.0.options
499        }
500    }
501
502    /// The request builder for [TranscoderService::list_job_templates][crate::client::TranscoderService::list_job_templates] calls.
503    ///
504    /// # Example
505    /// ```no_run
506    /// # use google_cloud_video_transcoder_v1::builder;
507    /// use builder::transcoder_service::ListJobTemplates;
508    /// # tokio_test::block_on(async {
509    /// use gax::paginator::ItemPaginator;
510    ///
511    /// let builder = prepare_request_builder();
512    /// let mut items = builder.by_item();
513    /// while let Some(result) = items.next().await {
514    ///   let item = result?;
515    /// }
516    /// # gax::Result::<()>::Ok(()) });
517    ///
518    /// fn prepare_request_builder() -> ListJobTemplates {
519    ///   # panic!();
520    ///   // ... details omitted ...
521    /// }
522    /// ```
523    #[derive(Clone, Debug)]
524    pub struct ListJobTemplates(RequestBuilder<crate::model::ListJobTemplatesRequest>);
525
526    impl ListJobTemplates {
527        pub(crate) fn new(
528            stub: std::sync::Arc<dyn super::super::stub::dynamic::TranscoderService>,
529        ) -> Self {
530            Self(RequestBuilder::new(stub))
531        }
532
533        /// Sets the full request, replacing any prior values.
534        pub fn with_request<V: Into<crate::model::ListJobTemplatesRequest>>(
535            mut self,
536            v: V,
537        ) -> Self {
538            self.0.request = v.into();
539            self
540        }
541
542        /// Sets all the options, replacing any prior values.
543        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
544            self.0.options = v.into();
545            self
546        }
547
548        /// Sends the request.
549        pub async fn send(self) -> Result<crate::model::ListJobTemplatesResponse> {
550            (*self.0.stub)
551                .list_job_templates(self.0.request, self.0.options)
552                .await
553                .map(gax::response::Response::into_body)
554        }
555
556        /// Streams each page in the collection.
557        pub fn by_page(
558            self,
559        ) -> impl gax::paginator::Paginator<crate::model::ListJobTemplatesResponse, gax::error::Error>
560        {
561            use std::clone::Clone;
562            let token = self.0.request.page_token.clone();
563            let execute = move |token: String| {
564                let mut builder = self.clone();
565                builder.0.request = builder.0.request.set_page_token(token);
566                builder.send()
567            };
568            gax::paginator::internal::new_paginator(token, execute)
569        }
570
571        /// Streams each item in the collection.
572        pub fn by_item(
573            self,
574        ) -> impl gax::paginator::ItemPaginator<crate::model::ListJobTemplatesResponse, gax::error::Error>
575        {
576            use gax::paginator::Paginator;
577            self.by_page().items()
578        }
579
580        /// Sets the value of [parent][crate::model::ListJobTemplatesRequest::parent].
581        ///
582        /// This is a **required** field for requests.
583        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
584            self.0.request.parent = v.into();
585            self
586        }
587
588        /// Sets the value of [page_size][crate::model::ListJobTemplatesRequest::page_size].
589        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
590            self.0.request.page_size = v.into();
591            self
592        }
593
594        /// Sets the value of [page_token][crate::model::ListJobTemplatesRequest::page_token].
595        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
596            self.0.request.page_token = v.into();
597            self
598        }
599
600        /// Sets the value of [filter][crate::model::ListJobTemplatesRequest::filter].
601        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
602            self.0.request.filter = v.into();
603            self
604        }
605
606        /// Sets the value of [order_by][crate::model::ListJobTemplatesRequest::order_by].
607        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
608            self.0.request.order_by = v.into();
609            self
610        }
611    }
612
613    #[doc(hidden)]
614    impl gax::options::internal::RequestBuilder for ListJobTemplates {
615        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
616            &mut self.0.options
617        }
618    }
619
620    /// The request builder for [TranscoderService::get_job_template][crate::client::TranscoderService::get_job_template] calls.
621    ///
622    /// # Example
623    /// ```no_run
624    /// # use google_cloud_video_transcoder_v1::builder;
625    /// use builder::transcoder_service::GetJobTemplate;
626    /// # tokio_test::block_on(async {
627    ///
628    /// let builder = prepare_request_builder();
629    /// let response = builder.send().await?;
630    /// # gax::Result::<()>::Ok(()) });
631    ///
632    /// fn prepare_request_builder() -> GetJobTemplate {
633    ///   # panic!();
634    ///   // ... details omitted ...
635    /// }
636    /// ```
637    #[derive(Clone, Debug)]
638    pub struct GetJobTemplate(RequestBuilder<crate::model::GetJobTemplateRequest>);
639
640    impl GetJobTemplate {
641        pub(crate) fn new(
642            stub: std::sync::Arc<dyn super::super::stub::dynamic::TranscoderService>,
643        ) -> Self {
644            Self(RequestBuilder::new(stub))
645        }
646
647        /// Sets the full request, replacing any prior values.
648        pub fn with_request<V: Into<crate::model::GetJobTemplateRequest>>(mut self, v: V) -> Self {
649            self.0.request = v.into();
650            self
651        }
652
653        /// Sets all the options, replacing any prior values.
654        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
655            self.0.options = v.into();
656            self
657        }
658
659        /// Sends the request.
660        pub async fn send(self) -> Result<crate::model::JobTemplate> {
661            (*self.0.stub)
662                .get_job_template(self.0.request, self.0.options)
663                .await
664                .map(gax::response::Response::into_body)
665        }
666
667        /// Sets the value of [name][crate::model::GetJobTemplateRequest::name].
668        ///
669        /// This is a **required** field for requests.
670        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
671            self.0.request.name = v.into();
672            self
673        }
674    }
675
676    #[doc(hidden)]
677    impl gax::options::internal::RequestBuilder for GetJobTemplate {
678        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
679            &mut self.0.options
680        }
681    }
682
683    /// The request builder for [TranscoderService::delete_job_template][crate::client::TranscoderService::delete_job_template] calls.
684    ///
685    /// # Example
686    /// ```no_run
687    /// # use google_cloud_video_transcoder_v1::builder;
688    /// use builder::transcoder_service::DeleteJobTemplate;
689    /// # tokio_test::block_on(async {
690    ///
691    /// let builder = prepare_request_builder();
692    /// let response = builder.send().await?;
693    /// # gax::Result::<()>::Ok(()) });
694    ///
695    /// fn prepare_request_builder() -> DeleteJobTemplate {
696    ///   # panic!();
697    ///   // ... details omitted ...
698    /// }
699    /// ```
700    #[derive(Clone, Debug)]
701    pub struct DeleteJobTemplate(RequestBuilder<crate::model::DeleteJobTemplateRequest>);
702
703    impl DeleteJobTemplate {
704        pub(crate) fn new(
705            stub: std::sync::Arc<dyn super::super::stub::dynamic::TranscoderService>,
706        ) -> Self {
707            Self(RequestBuilder::new(stub))
708        }
709
710        /// Sets the full request, replacing any prior values.
711        pub fn with_request<V: Into<crate::model::DeleteJobTemplateRequest>>(
712            mut self,
713            v: V,
714        ) -> Self {
715            self.0.request = v.into();
716            self
717        }
718
719        /// Sets all the options, replacing any prior values.
720        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
721            self.0.options = v.into();
722            self
723        }
724
725        /// Sends the request.
726        pub async fn send(self) -> Result<()> {
727            (*self.0.stub)
728                .delete_job_template(self.0.request, self.0.options)
729                .await
730                .map(gax::response::Response::into_body)
731        }
732
733        /// Sets the value of [name][crate::model::DeleteJobTemplateRequest::name].
734        ///
735        /// This is a **required** field for requests.
736        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
737            self.0.request.name = v.into();
738            self
739        }
740
741        /// Sets the value of [allow_missing][crate::model::DeleteJobTemplateRequest::allow_missing].
742        pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
743            self.0.request.allow_missing = v.into();
744            self
745        }
746    }
747
748    #[doc(hidden)]
749    impl gax::options::internal::RequestBuilder for DeleteJobTemplate {
750        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
751            &mut self.0.options
752        }
753    }
754}