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