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
17/// Request and client builders for [TranscoderService][crate::client::TranscoderService].
18pub mod transcoder_service {
19 use crate::Result;
20
21 /// A builder for [TranscoderService][crate::client::TranscoderService].
22 ///
23 /// ```
24 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
25 /// # use google_cloud_video_transcoder_v1::*;
26 /// # use builder::transcoder_service::ClientBuilder;
27 /// # use client::TranscoderService;
28 /// let builder : ClientBuilder = TranscoderService::builder();
29 /// let client = builder
30 /// .with_endpoint("https://transcoder.googleapis.com")
31 /// .build().await?;
32 /// # Ok(()) }
33 /// ```
34 pub type ClientBuilder = crate::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 crate::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 ) -> crate::ClientBuilderResult<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: crate::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: crate::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() -> google_cloud_video_transcoder_v1::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<crate::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(crate::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 crate::RequestBuilder for CreateJob {
153 fn request_options(&mut self) -> &mut crate::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() -> google_cloud_video_transcoder_v1::Result<()> {
164 /// use google_cloud_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<crate::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(crate::Response::into_body)
206 }
207
208 /// Streams each page in the collection.
209 pub fn by_page(
210 self,
211 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListJobsResponse, crate::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 google_cloud_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 google_cloud_gax::paginator::ItemPaginator<crate::model::ListJobsResponse, crate::Error>
227 {
228 use google_cloud_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 crate::RequestBuilder for ListJobs {
267 fn request_options(&mut self) -> &mut crate::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() -> google_cloud_video_transcoder_v1::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<crate::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(crate::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 crate::RequestBuilder for GetJob {
329 fn request_options(&mut self) -> &mut crate::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() -> google_cloud_video_transcoder_v1::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<crate::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(crate::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 crate::RequestBuilder for DeleteJob {
397 fn request_options(&mut self) -> &mut crate::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() -> google_cloud_video_transcoder_v1::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<crate::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(crate::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 crate::RequestBuilder for CreateJobTemplate {
492 fn request_options(&mut self) -> &mut crate::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() -> google_cloud_video_transcoder_v1::Result<()> {
503 /// use google_cloud_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<crate::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(crate::Response::into_body)
548 }
549
550 /// Streams each page in the collection.
551 pub fn by_page(
552 self,
553 ) -> impl google_cloud_gax::paginator::Paginator<
554 crate::model::ListJobTemplatesResponse,
555 crate::Error,
556 > {
557 use std::clone::Clone;
558 let token = self.0.request.page_token.clone();
559 let execute = move |token: String| {
560 let mut builder = self.clone();
561 builder.0.request = builder.0.request.set_page_token(token);
562 builder.send()
563 };
564 google_cloud_gax::paginator::internal::new_paginator(token, execute)
565 }
566
567 /// Streams each item in the collection.
568 pub fn by_item(
569 self,
570 ) -> impl google_cloud_gax::paginator::ItemPaginator<
571 crate::model::ListJobTemplatesResponse,
572 crate::Error,
573 > {
574 use google_cloud_gax::paginator::Paginator;
575 self.by_page().items()
576 }
577
578 /// Sets the value of [parent][crate::model::ListJobTemplatesRequest::parent].
579 ///
580 /// This is a **required** field for requests.
581 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
582 self.0.request.parent = v.into();
583 self
584 }
585
586 /// Sets the value of [page_size][crate::model::ListJobTemplatesRequest::page_size].
587 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
588 self.0.request.page_size = v.into();
589 self
590 }
591
592 /// Sets the value of [page_token][crate::model::ListJobTemplatesRequest::page_token].
593 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
594 self.0.request.page_token = v.into();
595 self
596 }
597
598 /// Sets the value of [filter][crate::model::ListJobTemplatesRequest::filter].
599 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
600 self.0.request.filter = v.into();
601 self
602 }
603
604 /// Sets the value of [order_by][crate::model::ListJobTemplatesRequest::order_by].
605 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
606 self.0.request.order_by = v.into();
607 self
608 }
609 }
610
611 #[doc(hidden)]
612 impl crate::RequestBuilder for ListJobTemplates {
613 fn request_options(&mut self) -> &mut crate::RequestOptions {
614 &mut self.0.options
615 }
616 }
617
618 /// The request builder for [TranscoderService::get_job_template][crate::client::TranscoderService::get_job_template] calls.
619 ///
620 /// # Example
621 /// ```
622 /// # use google_cloud_video_transcoder_v1::builder::transcoder_service::GetJobTemplate;
623 /// # async fn sample() -> google_cloud_video_transcoder_v1::Result<()> {
624 ///
625 /// let builder = prepare_request_builder();
626 /// let response = builder.send().await?;
627 /// # Ok(()) }
628 ///
629 /// fn prepare_request_builder() -> GetJobTemplate {
630 /// # panic!();
631 /// // ... details omitted ...
632 /// }
633 /// ```
634 #[derive(Clone, Debug)]
635 pub struct GetJobTemplate(RequestBuilder<crate::model::GetJobTemplateRequest>);
636
637 impl GetJobTemplate {
638 pub(crate) fn new(
639 stub: std::sync::Arc<dyn super::super::stub::dynamic::TranscoderService>,
640 ) -> Self {
641 Self(RequestBuilder::new(stub))
642 }
643
644 /// Sets the full request, replacing any prior values.
645 pub fn with_request<V: Into<crate::model::GetJobTemplateRequest>>(mut self, v: V) -> Self {
646 self.0.request = v.into();
647 self
648 }
649
650 /// Sets all the options, replacing any prior values.
651 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
652 self.0.options = v.into();
653 self
654 }
655
656 /// Sends the request.
657 pub async fn send(self) -> Result<crate::model::JobTemplate> {
658 (*self.0.stub)
659 .get_job_template(self.0.request, self.0.options)
660 .await
661 .map(crate::Response::into_body)
662 }
663
664 /// Sets the value of [name][crate::model::GetJobTemplateRequest::name].
665 ///
666 /// This is a **required** field for requests.
667 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
668 self.0.request.name = v.into();
669 self
670 }
671 }
672
673 #[doc(hidden)]
674 impl crate::RequestBuilder for GetJobTemplate {
675 fn request_options(&mut self) -> &mut crate::RequestOptions {
676 &mut self.0.options
677 }
678 }
679
680 /// The request builder for [TranscoderService::delete_job_template][crate::client::TranscoderService::delete_job_template] calls.
681 ///
682 /// # Example
683 /// ```
684 /// # use google_cloud_video_transcoder_v1::builder::transcoder_service::DeleteJobTemplate;
685 /// # async fn sample() -> google_cloud_video_transcoder_v1::Result<()> {
686 ///
687 /// let builder = prepare_request_builder();
688 /// let response = builder.send().await?;
689 /// # Ok(()) }
690 ///
691 /// fn prepare_request_builder() -> DeleteJobTemplate {
692 /// # panic!();
693 /// // ... details omitted ...
694 /// }
695 /// ```
696 #[derive(Clone, Debug)]
697 pub struct DeleteJobTemplate(RequestBuilder<crate::model::DeleteJobTemplateRequest>);
698
699 impl DeleteJobTemplate {
700 pub(crate) fn new(
701 stub: std::sync::Arc<dyn super::super::stub::dynamic::TranscoderService>,
702 ) -> Self {
703 Self(RequestBuilder::new(stub))
704 }
705
706 /// Sets the full request, replacing any prior values.
707 pub fn with_request<V: Into<crate::model::DeleteJobTemplateRequest>>(
708 mut self,
709 v: V,
710 ) -> Self {
711 self.0.request = v.into();
712 self
713 }
714
715 /// Sets all the options, replacing any prior values.
716 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
717 self.0.options = v.into();
718 self
719 }
720
721 /// Sends the request.
722 pub async fn send(self) -> Result<()> {
723 (*self.0.stub)
724 .delete_job_template(self.0.request, self.0.options)
725 .await
726 .map(crate::Response::into_body)
727 }
728
729 /// Sets the value of [name][crate::model::DeleteJobTemplateRequest::name].
730 ///
731 /// This is a **required** field for requests.
732 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
733 self.0.request.name = v.into();
734 self
735 }
736
737 /// Sets the value of [allow_missing][crate::model::DeleteJobTemplateRequest::allow_missing].
738 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
739 self.0.request.allow_missing = v.into();
740 self
741 }
742 }
743
744 #[doc(hidden)]
745 impl crate::RequestBuilder for DeleteJobTemplate {
746 fn request_options(&mut self) -> &mut crate::RequestOptions {
747 &mut self.0.options
748 }
749 }
750}