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