Skip to main content

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