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        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
593        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
594            self.0.request.return_partial_success = v.into();
595            self
596        }
597    }
598
599    #[doc(hidden)]
600    impl gax::options::internal::RequestBuilder for ListOperations {
601        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
602            &mut self.0.options
603        }
604    }
605
606    /// The request builder for [Ids::get_operation][crate::client::Ids::get_operation] calls.
607    ///
608    /// # Example
609    /// ```no_run
610    /// # use google_cloud_ids_v1::builder;
611    /// use builder::ids::GetOperation;
612    /// # tokio_test::block_on(async {
613    ///
614    /// let builder = prepare_request_builder();
615    /// let response = builder.send().await?;
616    /// # gax::Result::<()>::Ok(()) });
617    ///
618    /// fn prepare_request_builder() -> GetOperation {
619    ///   # panic!();
620    ///   // ... details omitted ...
621    /// }
622    /// ```
623    #[derive(Clone, Debug)]
624    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
625
626    impl GetOperation {
627        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Ids>) -> Self {
628            Self(RequestBuilder::new(stub))
629        }
630
631        /// Sets the full request, replacing any prior values.
632        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
633            mut self,
634            v: V,
635        ) -> Self {
636            self.0.request = v.into();
637            self
638        }
639
640        /// Sets all the options, replacing any prior values.
641        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
642            self.0.options = v.into();
643            self
644        }
645
646        /// Sends the request.
647        pub async fn send(self) -> Result<longrunning::model::Operation> {
648            (*self.0.stub)
649                .get_operation(self.0.request, self.0.options)
650                .await
651                .map(gax::response::Response::into_body)
652        }
653
654        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
655        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
656            self.0.request.name = v.into();
657            self
658        }
659    }
660
661    #[doc(hidden)]
662    impl gax::options::internal::RequestBuilder for GetOperation {
663        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
664            &mut self.0.options
665        }
666    }
667
668    /// The request builder for [Ids::delete_operation][crate::client::Ids::delete_operation] calls.
669    ///
670    /// # Example
671    /// ```no_run
672    /// # use google_cloud_ids_v1::builder;
673    /// use builder::ids::DeleteOperation;
674    /// # tokio_test::block_on(async {
675    ///
676    /// let builder = prepare_request_builder();
677    /// let response = builder.send().await?;
678    /// # gax::Result::<()>::Ok(()) });
679    ///
680    /// fn prepare_request_builder() -> DeleteOperation {
681    ///   # panic!();
682    ///   // ... details omitted ...
683    /// }
684    /// ```
685    #[derive(Clone, Debug)]
686    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
687
688    impl DeleteOperation {
689        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Ids>) -> Self {
690            Self(RequestBuilder::new(stub))
691        }
692
693        /// Sets the full request, replacing any prior values.
694        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
695            mut self,
696            v: V,
697        ) -> Self {
698            self.0.request = v.into();
699            self
700        }
701
702        /// Sets all the options, replacing any prior values.
703        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
704            self.0.options = v.into();
705            self
706        }
707
708        /// Sends the request.
709        pub async fn send(self) -> Result<()> {
710            (*self.0.stub)
711                .delete_operation(self.0.request, self.0.options)
712                .await
713                .map(gax::response::Response::into_body)
714        }
715
716        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
717        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
718            self.0.request.name = v.into();
719            self
720        }
721    }
722
723    #[doc(hidden)]
724    impl gax::options::internal::RequestBuilder for DeleteOperation {
725        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
726            &mut self.0.options
727        }
728    }
729
730    /// The request builder for [Ids::cancel_operation][crate::client::Ids::cancel_operation] calls.
731    ///
732    /// # Example
733    /// ```no_run
734    /// # use google_cloud_ids_v1::builder;
735    /// use builder::ids::CancelOperation;
736    /// # tokio_test::block_on(async {
737    ///
738    /// let builder = prepare_request_builder();
739    /// let response = builder.send().await?;
740    /// # gax::Result::<()>::Ok(()) });
741    ///
742    /// fn prepare_request_builder() -> CancelOperation {
743    ///   # panic!();
744    ///   // ... details omitted ...
745    /// }
746    /// ```
747    #[derive(Clone, Debug)]
748    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
749
750    impl CancelOperation {
751        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Ids>) -> Self {
752            Self(RequestBuilder::new(stub))
753        }
754
755        /// Sets the full request, replacing any prior values.
756        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
757            mut self,
758            v: V,
759        ) -> Self {
760            self.0.request = v.into();
761            self
762        }
763
764        /// Sets all the options, replacing any prior values.
765        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
766            self.0.options = v.into();
767            self
768        }
769
770        /// Sends the request.
771        pub async fn send(self) -> Result<()> {
772            (*self.0.stub)
773                .cancel_operation(self.0.request, self.0.options)
774                .await
775                .map(gax::response::Response::into_body)
776        }
777
778        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
779        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
780            self.0.request.name = v.into();
781            self
782        }
783    }
784
785    #[doc(hidden)]
786    impl gax::options::internal::RequestBuilder for CancelOperation {
787        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
788            &mut self.0.options
789        }
790    }
791}