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