google_cloud_developerconnect_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 [DeveloperConnect][crate::client::DeveloperConnect].
18pub mod developer_connect {
19 use crate::Result;
20
21 /// A builder for [DeveloperConnect][crate::client::DeveloperConnect].
22 ///
23 /// ```
24 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
25 /// # use google_cloud_developerconnect_v1::*;
26 /// # use builder::developer_connect::ClientBuilder;
27 /// # use client::DeveloperConnect;
28 /// let builder : ClientBuilder = DeveloperConnect::builder();
29 /// let client = builder
30 /// .with_endpoint("https://developerconnect.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::DeveloperConnect;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = DeveloperConnect;
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::DeveloperConnect] 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::DeveloperConnect>,
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::DeveloperConnect>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: crate::RequestOptions::default(),
70 }
71 }
72 }
73
74 /// The request builder for [DeveloperConnect::list_connections][crate::client::DeveloperConnect::list_connections] calls.
75 ///
76 /// # Example
77 /// ```
78 /// # use google_cloud_developerconnect_v1::builder::developer_connect::ListConnections;
79 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
80 /// use google_cloud_gax::paginator::ItemPaginator;
81 ///
82 /// let builder = prepare_request_builder();
83 /// let mut items = builder.by_item();
84 /// while let Some(result) = items.next().await {
85 /// let item = result?;
86 /// }
87 /// # Ok(()) }
88 ///
89 /// fn prepare_request_builder() -> ListConnections {
90 /// # panic!();
91 /// // ... details omitted ...
92 /// }
93 /// ```
94 #[derive(Clone, Debug)]
95 pub struct ListConnections(RequestBuilder<crate::model::ListConnectionsRequest>);
96
97 impl ListConnections {
98 pub(crate) fn new(
99 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
100 ) -> Self {
101 Self(RequestBuilder::new(stub))
102 }
103
104 /// Sets the full request, replacing any prior values.
105 pub fn with_request<V: Into<crate::model::ListConnectionsRequest>>(mut self, v: V) -> Self {
106 self.0.request = v.into();
107 self
108 }
109
110 /// Sets all the options, replacing any prior values.
111 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
112 self.0.options = v.into();
113 self
114 }
115
116 /// Sends the request.
117 pub async fn send(self) -> Result<crate::model::ListConnectionsResponse> {
118 (*self.0.stub)
119 .list_connections(self.0.request, self.0.options)
120 .await
121 .map(crate::Response::into_body)
122 }
123
124 /// Streams each page in the collection.
125 pub fn by_page(
126 self,
127 ) -> impl google_cloud_gax::paginator::Paginator<
128 crate::model::ListConnectionsResponse,
129 crate::Error,
130 > {
131 use std::clone::Clone;
132 let token = self.0.request.page_token.clone();
133 let execute = move |token: String| {
134 let mut builder = self.clone();
135 builder.0.request = builder.0.request.set_page_token(token);
136 builder.send()
137 };
138 google_cloud_gax::paginator::internal::new_paginator(token, execute)
139 }
140
141 /// Streams each item in the collection.
142 pub fn by_item(
143 self,
144 ) -> impl google_cloud_gax::paginator::ItemPaginator<
145 crate::model::ListConnectionsResponse,
146 crate::Error,
147 > {
148 use google_cloud_gax::paginator::Paginator;
149 self.by_page().items()
150 }
151
152 /// Sets the value of [parent][crate::model::ListConnectionsRequest::parent].
153 ///
154 /// This is a **required** field for requests.
155 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
156 self.0.request.parent = v.into();
157 self
158 }
159
160 /// Sets the value of [page_size][crate::model::ListConnectionsRequest::page_size].
161 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
162 self.0.request.page_size = v.into();
163 self
164 }
165
166 /// Sets the value of [page_token][crate::model::ListConnectionsRequest::page_token].
167 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
168 self.0.request.page_token = v.into();
169 self
170 }
171
172 /// Sets the value of [filter][crate::model::ListConnectionsRequest::filter].
173 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
174 self.0.request.filter = v.into();
175 self
176 }
177
178 /// Sets the value of [order_by][crate::model::ListConnectionsRequest::order_by].
179 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
180 self.0.request.order_by = v.into();
181 self
182 }
183 }
184
185 #[doc(hidden)]
186 impl crate::RequestBuilder for ListConnections {
187 fn request_options(&mut self) -> &mut crate::RequestOptions {
188 &mut self.0.options
189 }
190 }
191
192 /// The request builder for [DeveloperConnect::get_connection][crate::client::DeveloperConnect::get_connection] calls.
193 ///
194 /// # Example
195 /// ```
196 /// # use google_cloud_developerconnect_v1::builder::developer_connect::GetConnection;
197 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
198 ///
199 /// let builder = prepare_request_builder();
200 /// let response = builder.send().await?;
201 /// # Ok(()) }
202 ///
203 /// fn prepare_request_builder() -> GetConnection {
204 /// # panic!();
205 /// // ... details omitted ...
206 /// }
207 /// ```
208 #[derive(Clone, Debug)]
209 pub struct GetConnection(RequestBuilder<crate::model::GetConnectionRequest>);
210
211 impl GetConnection {
212 pub(crate) fn new(
213 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
214 ) -> Self {
215 Self(RequestBuilder::new(stub))
216 }
217
218 /// Sets the full request, replacing any prior values.
219 pub fn with_request<V: Into<crate::model::GetConnectionRequest>>(mut self, v: V) -> Self {
220 self.0.request = v.into();
221 self
222 }
223
224 /// Sets all the options, replacing any prior values.
225 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
226 self.0.options = v.into();
227 self
228 }
229
230 /// Sends the request.
231 pub async fn send(self) -> Result<crate::model::Connection> {
232 (*self.0.stub)
233 .get_connection(self.0.request, self.0.options)
234 .await
235 .map(crate::Response::into_body)
236 }
237
238 /// Sets the value of [name][crate::model::GetConnectionRequest::name].
239 ///
240 /// This is a **required** field for requests.
241 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
242 self.0.request.name = v.into();
243 self
244 }
245 }
246
247 #[doc(hidden)]
248 impl crate::RequestBuilder for GetConnection {
249 fn request_options(&mut self) -> &mut crate::RequestOptions {
250 &mut self.0.options
251 }
252 }
253
254 /// The request builder for [DeveloperConnect::create_connection][crate::client::DeveloperConnect::create_connection] calls.
255 ///
256 /// # Example
257 /// ```
258 /// # use google_cloud_developerconnect_v1::builder::developer_connect::CreateConnection;
259 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
260 /// use google_cloud_lro::Poller;
261 ///
262 /// let builder = prepare_request_builder();
263 /// let response = builder.poller().until_done().await?;
264 /// # Ok(()) }
265 ///
266 /// fn prepare_request_builder() -> CreateConnection {
267 /// # panic!();
268 /// // ... details omitted ...
269 /// }
270 /// ```
271 #[derive(Clone, Debug)]
272 pub struct CreateConnection(RequestBuilder<crate::model::CreateConnectionRequest>);
273
274 impl CreateConnection {
275 pub(crate) fn new(
276 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
277 ) -> Self {
278 Self(RequestBuilder::new(stub))
279 }
280
281 /// Sets the full request, replacing any prior values.
282 pub fn with_request<V: Into<crate::model::CreateConnectionRequest>>(
283 mut self,
284 v: V,
285 ) -> Self {
286 self.0.request = v.into();
287 self
288 }
289
290 /// Sets all the options, replacing any prior values.
291 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
292 self.0.options = v.into();
293 self
294 }
295
296 /// Sends the request.
297 ///
298 /// # Long running operations
299 ///
300 /// This starts, but does not poll, a longrunning operation. More information
301 /// on [create_connection][crate::client::DeveloperConnect::create_connection].
302 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
303 (*self.0.stub)
304 .create_connection(self.0.request, self.0.options)
305 .await
306 .map(crate::Response::into_body)
307 }
308
309 /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_connection`.
310 pub fn poller(
311 self,
312 ) -> impl google_cloud_lro::Poller<crate::model::Connection, crate::model::OperationMetadata>
313 {
314 type Operation = google_cloud_lro::internal::Operation<
315 crate::model::Connection,
316 crate::model::OperationMetadata,
317 >;
318 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
319 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
320
321 let stub = self.0.stub.clone();
322 let mut options = self.0.options.clone();
323 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
324 let query = move |name| {
325 let stub = stub.clone();
326 let options = options.clone();
327 async {
328 let op = GetOperation::new(stub)
329 .set_name(name)
330 .with_options(options)
331 .send()
332 .await?;
333 Ok(Operation::new(op))
334 }
335 };
336
337 let start = move || async {
338 let op = self.send().await?;
339 Ok(Operation::new(op))
340 };
341
342 google_cloud_lro::internal::new_poller(
343 polling_error_policy,
344 polling_backoff_policy,
345 start,
346 query,
347 )
348 }
349
350 /// Sets the value of [parent][crate::model::CreateConnectionRequest::parent].
351 ///
352 /// This is a **required** field for requests.
353 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
354 self.0.request.parent = v.into();
355 self
356 }
357
358 /// Sets the value of [connection_id][crate::model::CreateConnectionRequest::connection_id].
359 ///
360 /// This is a **required** field for requests.
361 pub fn set_connection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
362 self.0.request.connection_id = v.into();
363 self
364 }
365
366 /// Sets the value of [connection][crate::model::CreateConnectionRequest::connection].
367 ///
368 /// This is a **required** field for requests.
369 pub fn set_connection<T>(mut self, v: T) -> Self
370 where
371 T: std::convert::Into<crate::model::Connection>,
372 {
373 self.0.request.connection = std::option::Option::Some(v.into());
374 self
375 }
376
377 /// Sets or clears the value of [connection][crate::model::CreateConnectionRequest::connection].
378 ///
379 /// This is a **required** field for requests.
380 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
381 where
382 T: std::convert::Into<crate::model::Connection>,
383 {
384 self.0.request.connection = v.map(|x| x.into());
385 self
386 }
387
388 /// Sets the value of [request_id][crate::model::CreateConnectionRequest::request_id].
389 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
390 self.0.request.request_id = v.into();
391 self
392 }
393
394 /// Sets the value of [validate_only][crate::model::CreateConnectionRequest::validate_only].
395 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
396 self.0.request.validate_only = v.into();
397 self
398 }
399 }
400
401 #[doc(hidden)]
402 impl crate::RequestBuilder for CreateConnection {
403 fn request_options(&mut self) -> &mut crate::RequestOptions {
404 &mut self.0.options
405 }
406 }
407
408 /// The request builder for [DeveloperConnect::update_connection][crate::client::DeveloperConnect::update_connection] calls.
409 ///
410 /// # Example
411 /// ```
412 /// # use google_cloud_developerconnect_v1::builder::developer_connect::UpdateConnection;
413 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
414 /// use google_cloud_lro::Poller;
415 ///
416 /// let builder = prepare_request_builder();
417 /// let response = builder.poller().until_done().await?;
418 /// # Ok(()) }
419 ///
420 /// fn prepare_request_builder() -> UpdateConnection {
421 /// # panic!();
422 /// // ... details omitted ...
423 /// }
424 /// ```
425 #[derive(Clone, Debug)]
426 pub struct UpdateConnection(RequestBuilder<crate::model::UpdateConnectionRequest>);
427
428 impl UpdateConnection {
429 pub(crate) fn new(
430 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
431 ) -> Self {
432 Self(RequestBuilder::new(stub))
433 }
434
435 /// Sets the full request, replacing any prior values.
436 pub fn with_request<V: Into<crate::model::UpdateConnectionRequest>>(
437 mut self,
438 v: V,
439 ) -> Self {
440 self.0.request = v.into();
441 self
442 }
443
444 /// Sets all the options, replacing any prior values.
445 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
446 self.0.options = v.into();
447 self
448 }
449
450 /// Sends the request.
451 ///
452 /// # Long running operations
453 ///
454 /// This starts, but does not poll, a longrunning operation. More information
455 /// on [update_connection][crate::client::DeveloperConnect::update_connection].
456 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
457 (*self.0.stub)
458 .update_connection(self.0.request, self.0.options)
459 .await
460 .map(crate::Response::into_body)
461 }
462
463 /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_connection`.
464 pub fn poller(
465 self,
466 ) -> impl google_cloud_lro::Poller<crate::model::Connection, crate::model::OperationMetadata>
467 {
468 type Operation = google_cloud_lro::internal::Operation<
469 crate::model::Connection,
470 crate::model::OperationMetadata,
471 >;
472 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
473 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
474
475 let stub = self.0.stub.clone();
476 let mut options = self.0.options.clone();
477 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
478 let query = move |name| {
479 let stub = stub.clone();
480 let options = options.clone();
481 async {
482 let op = GetOperation::new(stub)
483 .set_name(name)
484 .with_options(options)
485 .send()
486 .await?;
487 Ok(Operation::new(op))
488 }
489 };
490
491 let start = move || async {
492 let op = self.send().await?;
493 Ok(Operation::new(op))
494 };
495
496 google_cloud_lro::internal::new_poller(
497 polling_error_policy,
498 polling_backoff_policy,
499 start,
500 query,
501 )
502 }
503
504 /// Sets the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
505 ///
506 /// This is a **required** field for requests.
507 pub fn set_update_mask<T>(mut self, v: T) -> Self
508 where
509 T: std::convert::Into<wkt::FieldMask>,
510 {
511 self.0.request.update_mask = std::option::Option::Some(v.into());
512 self
513 }
514
515 /// Sets or clears the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
516 ///
517 /// This is a **required** field for requests.
518 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
519 where
520 T: std::convert::Into<wkt::FieldMask>,
521 {
522 self.0.request.update_mask = v.map(|x| x.into());
523 self
524 }
525
526 /// Sets the value of [connection][crate::model::UpdateConnectionRequest::connection].
527 ///
528 /// This is a **required** field for requests.
529 pub fn set_connection<T>(mut self, v: T) -> Self
530 where
531 T: std::convert::Into<crate::model::Connection>,
532 {
533 self.0.request.connection = std::option::Option::Some(v.into());
534 self
535 }
536
537 /// Sets or clears the value of [connection][crate::model::UpdateConnectionRequest::connection].
538 ///
539 /// This is a **required** field for requests.
540 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
541 where
542 T: std::convert::Into<crate::model::Connection>,
543 {
544 self.0.request.connection = v.map(|x| x.into());
545 self
546 }
547
548 /// Sets the value of [request_id][crate::model::UpdateConnectionRequest::request_id].
549 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
550 self.0.request.request_id = v.into();
551 self
552 }
553
554 /// Sets the value of [allow_missing][crate::model::UpdateConnectionRequest::allow_missing].
555 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
556 self.0.request.allow_missing = v.into();
557 self
558 }
559
560 /// Sets the value of [validate_only][crate::model::UpdateConnectionRequest::validate_only].
561 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
562 self.0.request.validate_only = v.into();
563 self
564 }
565 }
566
567 #[doc(hidden)]
568 impl crate::RequestBuilder for UpdateConnection {
569 fn request_options(&mut self) -> &mut crate::RequestOptions {
570 &mut self.0.options
571 }
572 }
573
574 /// The request builder for [DeveloperConnect::delete_connection][crate::client::DeveloperConnect::delete_connection] calls.
575 ///
576 /// # Example
577 /// ```
578 /// # use google_cloud_developerconnect_v1::builder::developer_connect::DeleteConnection;
579 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
580 /// use google_cloud_lro::Poller;
581 ///
582 /// let builder = prepare_request_builder();
583 /// let response = builder.poller().until_done().await?;
584 /// # Ok(()) }
585 ///
586 /// fn prepare_request_builder() -> DeleteConnection {
587 /// # panic!();
588 /// // ... details omitted ...
589 /// }
590 /// ```
591 #[derive(Clone, Debug)]
592 pub struct DeleteConnection(RequestBuilder<crate::model::DeleteConnectionRequest>);
593
594 impl DeleteConnection {
595 pub(crate) fn new(
596 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
597 ) -> Self {
598 Self(RequestBuilder::new(stub))
599 }
600
601 /// Sets the full request, replacing any prior values.
602 pub fn with_request<V: Into<crate::model::DeleteConnectionRequest>>(
603 mut self,
604 v: V,
605 ) -> Self {
606 self.0.request = v.into();
607 self
608 }
609
610 /// Sets all the options, replacing any prior values.
611 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
612 self.0.options = v.into();
613 self
614 }
615
616 /// Sends the request.
617 ///
618 /// # Long running operations
619 ///
620 /// This starts, but does not poll, a longrunning operation. More information
621 /// on [delete_connection][crate::client::DeveloperConnect::delete_connection].
622 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
623 (*self.0.stub)
624 .delete_connection(self.0.request, self.0.options)
625 .await
626 .map(crate::Response::into_body)
627 }
628
629 /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_connection`.
630 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
631 type Operation =
632 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
633 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
634 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
635
636 let stub = self.0.stub.clone();
637 let mut options = self.0.options.clone();
638 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
639 let query = move |name| {
640 let stub = stub.clone();
641 let options = options.clone();
642 async {
643 let op = GetOperation::new(stub)
644 .set_name(name)
645 .with_options(options)
646 .send()
647 .await?;
648 Ok(Operation::new(op))
649 }
650 };
651
652 let start = move || async {
653 let op = self.send().await?;
654 Ok(Operation::new(op))
655 };
656
657 google_cloud_lro::internal::new_unit_response_poller(
658 polling_error_policy,
659 polling_backoff_policy,
660 start,
661 query,
662 )
663 }
664
665 /// Sets the value of [name][crate::model::DeleteConnectionRequest::name].
666 ///
667 /// This is a **required** field for requests.
668 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
669 self.0.request.name = v.into();
670 self
671 }
672
673 /// Sets the value of [request_id][crate::model::DeleteConnectionRequest::request_id].
674 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
675 self.0.request.request_id = v.into();
676 self
677 }
678
679 /// Sets the value of [validate_only][crate::model::DeleteConnectionRequest::validate_only].
680 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
681 self.0.request.validate_only = v.into();
682 self
683 }
684
685 /// Sets the value of [etag][crate::model::DeleteConnectionRequest::etag].
686 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
687 self.0.request.etag = v.into();
688 self
689 }
690 }
691
692 #[doc(hidden)]
693 impl crate::RequestBuilder for DeleteConnection {
694 fn request_options(&mut self) -> &mut crate::RequestOptions {
695 &mut self.0.options
696 }
697 }
698
699 /// The request builder for [DeveloperConnect::create_git_repository_link][crate::client::DeveloperConnect::create_git_repository_link] calls.
700 ///
701 /// # Example
702 /// ```
703 /// # use google_cloud_developerconnect_v1::builder::developer_connect::CreateGitRepositoryLink;
704 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
705 /// use google_cloud_lro::Poller;
706 ///
707 /// let builder = prepare_request_builder();
708 /// let response = builder.poller().until_done().await?;
709 /// # Ok(()) }
710 ///
711 /// fn prepare_request_builder() -> CreateGitRepositoryLink {
712 /// # panic!();
713 /// // ... details omitted ...
714 /// }
715 /// ```
716 #[derive(Clone, Debug)]
717 pub struct CreateGitRepositoryLink(
718 RequestBuilder<crate::model::CreateGitRepositoryLinkRequest>,
719 );
720
721 impl CreateGitRepositoryLink {
722 pub(crate) fn new(
723 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
724 ) -> Self {
725 Self(RequestBuilder::new(stub))
726 }
727
728 /// Sets the full request, replacing any prior values.
729 pub fn with_request<V: Into<crate::model::CreateGitRepositoryLinkRequest>>(
730 mut self,
731 v: V,
732 ) -> Self {
733 self.0.request = v.into();
734 self
735 }
736
737 /// Sets all the options, replacing any prior values.
738 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
739 self.0.options = v.into();
740 self
741 }
742
743 /// Sends the request.
744 ///
745 /// # Long running operations
746 ///
747 /// This starts, but does not poll, a longrunning operation. More information
748 /// on [create_git_repository_link][crate::client::DeveloperConnect::create_git_repository_link].
749 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
750 (*self.0.stub)
751 .create_git_repository_link(self.0.request, self.0.options)
752 .await
753 .map(crate::Response::into_body)
754 }
755
756 /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_git_repository_link`.
757 pub fn poller(
758 self,
759 ) -> impl google_cloud_lro::Poller<
760 crate::model::GitRepositoryLink,
761 crate::model::OperationMetadata,
762 > {
763 type Operation = google_cloud_lro::internal::Operation<
764 crate::model::GitRepositoryLink,
765 crate::model::OperationMetadata,
766 >;
767 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
768 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
769
770 let stub = self.0.stub.clone();
771 let mut options = self.0.options.clone();
772 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
773 let query = move |name| {
774 let stub = stub.clone();
775 let options = options.clone();
776 async {
777 let op = GetOperation::new(stub)
778 .set_name(name)
779 .with_options(options)
780 .send()
781 .await?;
782 Ok(Operation::new(op))
783 }
784 };
785
786 let start = move || async {
787 let op = self.send().await?;
788 Ok(Operation::new(op))
789 };
790
791 google_cloud_lro::internal::new_poller(
792 polling_error_policy,
793 polling_backoff_policy,
794 start,
795 query,
796 )
797 }
798
799 /// Sets the value of [parent][crate::model::CreateGitRepositoryLinkRequest::parent].
800 ///
801 /// This is a **required** field for requests.
802 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
803 self.0.request.parent = v.into();
804 self
805 }
806
807 /// Sets the value of [git_repository_link][crate::model::CreateGitRepositoryLinkRequest::git_repository_link].
808 ///
809 /// This is a **required** field for requests.
810 pub fn set_git_repository_link<T>(mut self, v: T) -> Self
811 where
812 T: std::convert::Into<crate::model::GitRepositoryLink>,
813 {
814 self.0.request.git_repository_link = std::option::Option::Some(v.into());
815 self
816 }
817
818 /// Sets or clears the value of [git_repository_link][crate::model::CreateGitRepositoryLinkRequest::git_repository_link].
819 ///
820 /// This is a **required** field for requests.
821 pub fn set_or_clear_git_repository_link<T>(mut self, v: std::option::Option<T>) -> Self
822 where
823 T: std::convert::Into<crate::model::GitRepositoryLink>,
824 {
825 self.0.request.git_repository_link = v.map(|x| x.into());
826 self
827 }
828
829 /// Sets the value of [git_repository_link_id][crate::model::CreateGitRepositoryLinkRequest::git_repository_link_id].
830 ///
831 /// This is a **required** field for requests.
832 pub fn set_git_repository_link_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
833 self.0.request.git_repository_link_id = v.into();
834 self
835 }
836
837 /// Sets the value of [request_id][crate::model::CreateGitRepositoryLinkRequest::request_id].
838 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
839 self.0.request.request_id = v.into();
840 self
841 }
842
843 /// Sets the value of [validate_only][crate::model::CreateGitRepositoryLinkRequest::validate_only].
844 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
845 self.0.request.validate_only = v.into();
846 self
847 }
848 }
849
850 #[doc(hidden)]
851 impl crate::RequestBuilder for CreateGitRepositoryLink {
852 fn request_options(&mut self) -> &mut crate::RequestOptions {
853 &mut self.0.options
854 }
855 }
856
857 /// The request builder for [DeveloperConnect::delete_git_repository_link][crate::client::DeveloperConnect::delete_git_repository_link] calls.
858 ///
859 /// # Example
860 /// ```
861 /// # use google_cloud_developerconnect_v1::builder::developer_connect::DeleteGitRepositoryLink;
862 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
863 /// use google_cloud_lro::Poller;
864 ///
865 /// let builder = prepare_request_builder();
866 /// let response = builder.poller().until_done().await?;
867 /// # Ok(()) }
868 ///
869 /// fn prepare_request_builder() -> DeleteGitRepositoryLink {
870 /// # panic!();
871 /// // ... details omitted ...
872 /// }
873 /// ```
874 #[derive(Clone, Debug)]
875 pub struct DeleteGitRepositoryLink(
876 RequestBuilder<crate::model::DeleteGitRepositoryLinkRequest>,
877 );
878
879 impl DeleteGitRepositoryLink {
880 pub(crate) fn new(
881 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
882 ) -> Self {
883 Self(RequestBuilder::new(stub))
884 }
885
886 /// Sets the full request, replacing any prior values.
887 pub fn with_request<V: Into<crate::model::DeleteGitRepositoryLinkRequest>>(
888 mut self,
889 v: V,
890 ) -> Self {
891 self.0.request = v.into();
892 self
893 }
894
895 /// Sets all the options, replacing any prior values.
896 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
897 self.0.options = v.into();
898 self
899 }
900
901 /// Sends the request.
902 ///
903 /// # Long running operations
904 ///
905 /// This starts, but does not poll, a longrunning operation. More information
906 /// on [delete_git_repository_link][crate::client::DeveloperConnect::delete_git_repository_link].
907 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
908 (*self.0.stub)
909 .delete_git_repository_link(self.0.request, self.0.options)
910 .await
911 .map(crate::Response::into_body)
912 }
913
914 /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_git_repository_link`.
915 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
916 type Operation =
917 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
918 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
919 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
920
921 let stub = self.0.stub.clone();
922 let mut options = self.0.options.clone();
923 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
924 let query = move |name| {
925 let stub = stub.clone();
926 let options = options.clone();
927 async {
928 let op = GetOperation::new(stub)
929 .set_name(name)
930 .with_options(options)
931 .send()
932 .await?;
933 Ok(Operation::new(op))
934 }
935 };
936
937 let start = move || async {
938 let op = self.send().await?;
939 Ok(Operation::new(op))
940 };
941
942 google_cloud_lro::internal::new_unit_response_poller(
943 polling_error_policy,
944 polling_backoff_policy,
945 start,
946 query,
947 )
948 }
949
950 /// Sets the value of [name][crate::model::DeleteGitRepositoryLinkRequest::name].
951 ///
952 /// This is a **required** field for requests.
953 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
954 self.0.request.name = v.into();
955 self
956 }
957
958 /// Sets the value of [request_id][crate::model::DeleteGitRepositoryLinkRequest::request_id].
959 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
960 self.0.request.request_id = v.into();
961 self
962 }
963
964 /// Sets the value of [validate_only][crate::model::DeleteGitRepositoryLinkRequest::validate_only].
965 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
966 self.0.request.validate_only = v.into();
967 self
968 }
969
970 /// Sets the value of [etag][crate::model::DeleteGitRepositoryLinkRequest::etag].
971 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
972 self.0.request.etag = v.into();
973 self
974 }
975 }
976
977 #[doc(hidden)]
978 impl crate::RequestBuilder for DeleteGitRepositoryLink {
979 fn request_options(&mut self) -> &mut crate::RequestOptions {
980 &mut self.0.options
981 }
982 }
983
984 /// The request builder for [DeveloperConnect::list_git_repository_links][crate::client::DeveloperConnect::list_git_repository_links] calls.
985 ///
986 /// # Example
987 /// ```
988 /// # use google_cloud_developerconnect_v1::builder::developer_connect::ListGitRepositoryLinks;
989 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
990 /// use google_cloud_gax::paginator::ItemPaginator;
991 ///
992 /// let builder = prepare_request_builder();
993 /// let mut items = builder.by_item();
994 /// while let Some(result) = items.next().await {
995 /// let item = result?;
996 /// }
997 /// # Ok(()) }
998 ///
999 /// fn prepare_request_builder() -> ListGitRepositoryLinks {
1000 /// # panic!();
1001 /// // ... details omitted ...
1002 /// }
1003 /// ```
1004 #[derive(Clone, Debug)]
1005 pub struct ListGitRepositoryLinks(RequestBuilder<crate::model::ListGitRepositoryLinksRequest>);
1006
1007 impl ListGitRepositoryLinks {
1008 pub(crate) fn new(
1009 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1010 ) -> Self {
1011 Self(RequestBuilder::new(stub))
1012 }
1013
1014 /// Sets the full request, replacing any prior values.
1015 pub fn with_request<V: Into<crate::model::ListGitRepositoryLinksRequest>>(
1016 mut self,
1017 v: V,
1018 ) -> Self {
1019 self.0.request = v.into();
1020 self
1021 }
1022
1023 /// Sets all the options, replacing any prior values.
1024 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1025 self.0.options = v.into();
1026 self
1027 }
1028
1029 /// Sends the request.
1030 pub async fn send(self) -> Result<crate::model::ListGitRepositoryLinksResponse> {
1031 (*self.0.stub)
1032 .list_git_repository_links(self.0.request, self.0.options)
1033 .await
1034 .map(crate::Response::into_body)
1035 }
1036
1037 /// Streams each page in the collection.
1038 pub fn by_page(
1039 self,
1040 ) -> impl google_cloud_gax::paginator::Paginator<
1041 crate::model::ListGitRepositoryLinksResponse,
1042 crate::Error,
1043 > {
1044 use std::clone::Clone;
1045 let token = self.0.request.page_token.clone();
1046 let execute = move |token: String| {
1047 let mut builder = self.clone();
1048 builder.0.request = builder.0.request.set_page_token(token);
1049 builder.send()
1050 };
1051 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1052 }
1053
1054 /// Streams each item in the collection.
1055 pub fn by_item(
1056 self,
1057 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1058 crate::model::ListGitRepositoryLinksResponse,
1059 crate::Error,
1060 > {
1061 use google_cloud_gax::paginator::Paginator;
1062 self.by_page().items()
1063 }
1064
1065 /// Sets the value of [parent][crate::model::ListGitRepositoryLinksRequest::parent].
1066 ///
1067 /// This is a **required** field for requests.
1068 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1069 self.0.request.parent = v.into();
1070 self
1071 }
1072
1073 /// Sets the value of [page_size][crate::model::ListGitRepositoryLinksRequest::page_size].
1074 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1075 self.0.request.page_size = v.into();
1076 self
1077 }
1078
1079 /// Sets the value of [page_token][crate::model::ListGitRepositoryLinksRequest::page_token].
1080 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1081 self.0.request.page_token = v.into();
1082 self
1083 }
1084
1085 /// Sets the value of [filter][crate::model::ListGitRepositoryLinksRequest::filter].
1086 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1087 self.0.request.filter = v.into();
1088 self
1089 }
1090
1091 /// Sets the value of [order_by][crate::model::ListGitRepositoryLinksRequest::order_by].
1092 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1093 self.0.request.order_by = v.into();
1094 self
1095 }
1096 }
1097
1098 #[doc(hidden)]
1099 impl crate::RequestBuilder for ListGitRepositoryLinks {
1100 fn request_options(&mut self) -> &mut crate::RequestOptions {
1101 &mut self.0.options
1102 }
1103 }
1104
1105 /// The request builder for [DeveloperConnect::get_git_repository_link][crate::client::DeveloperConnect::get_git_repository_link] calls.
1106 ///
1107 /// # Example
1108 /// ```
1109 /// # use google_cloud_developerconnect_v1::builder::developer_connect::GetGitRepositoryLink;
1110 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
1111 ///
1112 /// let builder = prepare_request_builder();
1113 /// let response = builder.send().await?;
1114 /// # Ok(()) }
1115 ///
1116 /// fn prepare_request_builder() -> GetGitRepositoryLink {
1117 /// # panic!();
1118 /// // ... details omitted ...
1119 /// }
1120 /// ```
1121 #[derive(Clone, Debug)]
1122 pub struct GetGitRepositoryLink(RequestBuilder<crate::model::GetGitRepositoryLinkRequest>);
1123
1124 impl GetGitRepositoryLink {
1125 pub(crate) fn new(
1126 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1127 ) -> Self {
1128 Self(RequestBuilder::new(stub))
1129 }
1130
1131 /// Sets the full request, replacing any prior values.
1132 pub fn with_request<V: Into<crate::model::GetGitRepositoryLinkRequest>>(
1133 mut self,
1134 v: V,
1135 ) -> Self {
1136 self.0.request = v.into();
1137 self
1138 }
1139
1140 /// Sets all the options, replacing any prior values.
1141 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1142 self.0.options = v.into();
1143 self
1144 }
1145
1146 /// Sends the request.
1147 pub async fn send(self) -> Result<crate::model::GitRepositoryLink> {
1148 (*self.0.stub)
1149 .get_git_repository_link(self.0.request, self.0.options)
1150 .await
1151 .map(crate::Response::into_body)
1152 }
1153
1154 /// Sets the value of [name][crate::model::GetGitRepositoryLinkRequest::name].
1155 ///
1156 /// This is a **required** field for requests.
1157 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1158 self.0.request.name = v.into();
1159 self
1160 }
1161 }
1162
1163 #[doc(hidden)]
1164 impl crate::RequestBuilder for GetGitRepositoryLink {
1165 fn request_options(&mut self) -> &mut crate::RequestOptions {
1166 &mut self.0.options
1167 }
1168 }
1169
1170 /// The request builder for [DeveloperConnect::fetch_read_write_token][crate::client::DeveloperConnect::fetch_read_write_token] calls.
1171 ///
1172 /// # Example
1173 /// ```
1174 /// # use google_cloud_developerconnect_v1::builder::developer_connect::FetchReadWriteToken;
1175 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
1176 ///
1177 /// let builder = prepare_request_builder();
1178 /// let response = builder.send().await?;
1179 /// # Ok(()) }
1180 ///
1181 /// fn prepare_request_builder() -> FetchReadWriteToken {
1182 /// # panic!();
1183 /// // ... details omitted ...
1184 /// }
1185 /// ```
1186 #[derive(Clone, Debug)]
1187 pub struct FetchReadWriteToken(RequestBuilder<crate::model::FetchReadWriteTokenRequest>);
1188
1189 impl FetchReadWriteToken {
1190 pub(crate) fn new(
1191 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1192 ) -> Self {
1193 Self(RequestBuilder::new(stub))
1194 }
1195
1196 /// Sets the full request, replacing any prior values.
1197 pub fn with_request<V: Into<crate::model::FetchReadWriteTokenRequest>>(
1198 mut self,
1199 v: V,
1200 ) -> Self {
1201 self.0.request = v.into();
1202 self
1203 }
1204
1205 /// Sets all the options, replacing any prior values.
1206 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1207 self.0.options = v.into();
1208 self
1209 }
1210
1211 /// Sends the request.
1212 pub async fn send(self) -> Result<crate::model::FetchReadWriteTokenResponse> {
1213 (*self.0.stub)
1214 .fetch_read_write_token(self.0.request, self.0.options)
1215 .await
1216 .map(crate::Response::into_body)
1217 }
1218
1219 /// Sets the value of [git_repository_link][crate::model::FetchReadWriteTokenRequest::git_repository_link].
1220 ///
1221 /// This is a **required** field for requests.
1222 pub fn set_git_repository_link<T: Into<std::string::String>>(mut self, v: T) -> Self {
1223 self.0.request.git_repository_link = v.into();
1224 self
1225 }
1226 }
1227
1228 #[doc(hidden)]
1229 impl crate::RequestBuilder for FetchReadWriteToken {
1230 fn request_options(&mut self) -> &mut crate::RequestOptions {
1231 &mut self.0.options
1232 }
1233 }
1234
1235 /// The request builder for [DeveloperConnect::fetch_read_token][crate::client::DeveloperConnect::fetch_read_token] calls.
1236 ///
1237 /// # Example
1238 /// ```
1239 /// # use google_cloud_developerconnect_v1::builder::developer_connect::FetchReadToken;
1240 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
1241 ///
1242 /// let builder = prepare_request_builder();
1243 /// let response = builder.send().await?;
1244 /// # Ok(()) }
1245 ///
1246 /// fn prepare_request_builder() -> FetchReadToken {
1247 /// # panic!();
1248 /// // ... details omitted ...
1249 /// }
1250 /// ```
1251 #[derive(Clone, Debug)]
1252 pub struct FetchReadToken(RequestBuilder<crate::model::FetchReadTokenRequest>);
1253
1254 impl FetchReadToken {
1255 pub(crate) fn new(
1256 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1257 ) -> Self {
1258 Self(RequestBuilder::new(stub))
1259 }
1260
1261 /// Sets the full request, replacing any prior values.
1262 pub fn with_request<V: Into<crate::model::FetchReadTokenRequest>>(mut self, v: V) -> Self {
1263 self.0.request = v.into();
1264 self
1265 }
1266
1267 /// Sets all the options, replacing any prior values.
1268 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1269 self.0.options = v.into();
1270 self
1271 }
1272
1273 /// Sends the request.
1274 pub async fn send(self) -> Result<crate::model::FetchReadTokenResponse> {
1275 (*self.0.stub)
1276 .fetch_read_token(self.0.request, self.0.options)
1277 .await
1278 .map(crate::Response::into_body)
1279 }
1280
1281 /// Sets the value of [git_repository_link][crate::model::FetchReadTokenRequest::git_repository_link].
1282 ///
1283 /// This is a **required** field for requests.
1284 pub fn set_git_repository_link<T: Into<std::string::String>>(mut self, v: T) -> Self {
1285 self.0.request.git_repository_link = v.into();
1286 self
1287 }
1288 }
1289
1290 #[doc(hidden)]
1291 impl crate::RequestBuilder for FetchReadToken {
1292 fn request_options(&mut self) -> &mut crate::RequestOptions {
1293 &mut self.0.options
1294 }
1295 }
1296
1297 /// The request builder for [DeveloperConnect::fetch_linkable_git_repositories][crate::client::DeveloperConnect::fetch_linkable_git_repositories] calls.
1298 ///
1299 /// # Example
1300 /// ```
1301 /// # use google_cloud_developerconnect_v1::builder::developer_connect::FetchLinkableGitRepositories;
1302 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
1303 /// use google_cloud_gax::paginator::ItemPaginator;
1304 ///
1305 /// let builder = prepare_request_builder();
1306 /// let mut items = builder.by_item();
1307 /// while let Some(result) = items.next().await {
1308 /// let item = result?;
1309 /// }
1310 /// # Ok(()) }
1311 ///
1312 /// fn prepare_request_builder() -> FetchLinkableGitRepositories {
1313 /// # panic!();
1314 /// // ... details omitted ...
1315 /// }
1316 /// ```
1317 #[derive(Clone, Debug)]
1318 pub struct FetchLinkableGitRepositories(
1319 RequestBuilder<crate::model::FetchLinkableGitRepositoriesRequest>,
1320 );
1321
1322 impl FetchLinkableGitRepositories {
1323 pub(crate) fn new(
1324 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1325 ) -> Self {
1326 Self(RequestBuilder::new(stub))
1327 }
1328
1329 /// Sets the full request, replacing any prior values.
1330 pub fn with_request<V: Into<crate::model::FetchLinkableGitRepositoriesRequest>>(
1331 mut self,
1332 v: V,
1333 ) -> Self {
1334 self.0.request = v.into();
1335 self
1336 }
1337
1338 /// Sets all the options, replacing any prior values.
1339 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1340 self.0.options = v.into();
1341 self
1342 }
1343
1344 /// Sends the request.
1345 pub async fn send(self) -> Result<crate::model::FetchLinkableGitRepositoriesResponse> {
1346 (*self.0.stub)
1347 .fetch_linkable_git_repositories(self.0.request, self.0.options)
1348 .await
1349 .map(crate::Response::into_body)
1350 }
1351
1352 /// Streams each page in the collection.
1353 pub fn by_page(
1354 self,
1355 ) -> impl google_cloud_gax::paginator::Paginator<
1356 crate::model::FetchLinkableGitRepositoriesResponse,
1357 crate::Error,
1358 > {
1359 use std::clone::Clone;
1360 let token = self.0.request.page_token.clone();
1361 let execute = move |token: String| {
1362 let mut builder = self.clone();
1363 builder.0.request = builder.0.request.set_page_token(token);
1364 builder.send()
1365 };
1366 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1367 }
1368
1369 /// Streams each item in the collection.
1370 pub fn by_item(
1371 self,
1372 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1373 crate::model::FetchLinkableGitRepositoriesResponse,
1374 crate::Error,
1375 > {
1376 use google_cloud_gax::paginator::Paginator;
1377 self.by_page().items()
1378 }
1379
1380 /// Sets the value of [connection][crate::model::FetchLinkableGitRepositoriesRequest::connection].
1381 ///
1382 /// This is a **required** field for requests.
1383 pub fn set_connection<T: Into<std::string::String>>(mut self, v: T) -> Self {
1384 self.0.request.connection = v.into();
1385 self
1386 }
1387
1388 /// Sets the value of [page_size][crate::model::FetchLinkableGitRepositoriesRequest::page_size].
1389 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1390 self.0.request.page_size = v.into();
1391 self
1392 }
1393
1394 /// Sets the value of [page_token][crate::model::FetchLinkableGitRepositoriesRequest::page_token].
1395 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1396 self.0.request.page_token = v.into();
1397 self
1398 }
1399 }
1400
1401 #[doc(hidden)]
1402 impl crate::RequestBuilder for FetchLinkableGitRepositories {
1403 fn request_options(&mut self) -> &mut crate::RequestOptions {
1404 &mut self.0.options
1405 }
1406 }
1407
1408 /// The request builder for [DeveloperConnect::fetch_git_hub_installations][crate::client::DeveloperConnect::fetch_git_hub_installations] calls.
1409 ///
1410 /// # Example
1411 /// ```
1412 /// # use google_cloud_developerconnect_v1::builder::developer_connect::FetchGitHubInstallations;
1413 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
1414 ///
1415 /// let builder = prepare_request_builder();
1416 /// let response = builder.send().await?;
1417 /// # Ok(()) }
1418 ///
1419 /// fn prepare_request_builder() -> FetchGitHubInstallations {
1420 /// # panic!();
1421 /// // ... details omitted ...
1422 /// }
1423 /// ```
1424 #[derive(Clone, Debug)]
1425 pub struct FetchGitHubInstallations(
1426 RequestBuilder<crate::model::FetchGitHubInstallationsRequest>,
1427 );
1428
1429 impl FetchGitHubInstallations {
1430 pub(crate) fn new(
1431 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1432 ) -> Self {
1433 Self(RequestBuilder::new(stub))
1434 }
1435
1436 /// Sets the full request, replacing any prior values.
1437 pub fn with_request<V: Into<crate::model::FetchGitHubInstallationsRequest>>(
1438 mut self,
1439 v: V,
1440 ) -> Self {
1441 self.0.request = v.into();
1442 self
1443 }
1444
1445 /// Sets all the options, replacing any prior values.
1446 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1447 self.0.options = v.into();
1448 self
1449 }
1450
1451 /// Sends the request.
1452 pub async fn send(self) -> Result<crate::model::FetchGitHubInstallationsResponse> {
1453 (*self.0.stub)
1454 .fetch_git_hub_installations(self.0.request, self.0.options)
1455 .await
1456 .map(crate::Response::into_body)
1457 }
1458
1459 /// Sets the value of [connection][crate::model::FetchGitHubInstallationsRequest::connection].
1460 ///
1461 /// This is a **required** field for requests.
1462 pub fn set_connection<T: Into<std::string::String>>(mut self, v: T) -> Self {
1463 self.0.request.connection = v.into();
1464 self
1465 }
1466 }
1467
1468 #[doc(hidden)]
1469 impl crate::RequestBuilder for FetchGitHubInstallations {
1470 fn request_options(&mut self) -> &mut crate::RequestOptions {
1471 &mut self.0.options
1472 }
1473 }
1474
1475 /// The request builder for [DeveloperConnect::fetch_git_refs][crate::client::DeveloperConnect::fetch_git_refs] calls.
1476 ///
1477 /// # Example
1478 /// ```
1479 /// # use google_cloud_developerconnect_v1::builder::developer_connect::FetchGitRefs;
1480 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
1481 ///
1482 /// let builder = prepare_request_builder();
1483 /// let response = builder.send().await?;
1484 /// # Ok(()) }
1485 ///
1486 /// fn prepare_request_builder() -> FetchGitRefs {
1487 /// # panic!();
1488 /// // ... details omitted ...
1489 /// }
1490 /// ```
1491 #[derive(Clone, Debug)]
1492 pub struct FetchGitRefs(RequestBuilder<crate::model::FetchGitRefsRequest>);
1493
1494 impl FetchGitRefs {
1495 pub(crate) fn new(
1496 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1497 ) -> Self {
1498 Self(RequestBuilder::new(stub))
1499 }
1500
1501 /// Sets the full request, replacing any prior values.
1502 pub fn with_request<V: Into<crate::model::FetchGitRefsRequest>>(mut self, v: V) -> Self {
1503 self.0.request = v.into();
1504 self
1505 }
1506
1507 /// Sets all the options, replacing any prior values.
1508 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1509 self.0.options = v.into();
1510 self
1511 }
1512
1513 /// Sends the request.
1514 pub async fn send(self) -> Result<crate::model::FetchGitRefsResponse> {
1515 (*self.0.stub)
1516 .fetch_git_refs(self.0.request, self.0.options)
1517 .await
1518 .map(crate::Response::into_body)
1519 }
1520
1521 /// Sets the value of [git_repository_link][crate::model::FetchGitRefsRequest::git_repository_link].
1522 ///
1523 /// This is a **required** field for requests.
1524 pub fn set_git_repository_link<T: Into<std::string::String>>(mut self, v: T) -> Self {
1525 self.0.request.git_repository_link = v.into();
1526 self
1527 }
1528
1529 /// Sets the value of [ref_type][crate::model::FetchGitRefsRequest::ref_type].
1530 ///
1531 /// This is a **required** field for requests.
1532 pub fn set_ref_type<T: Into<crate::model::fetch_git_refs_request::RefType>>(
1533 mut self,
1534 v: T,
1535 ) -> Self {
1536 self.0.request.ref_type = v.into();
1537 self
1538 }
1539
1540 /// Sets the value of [page_size][crate::model::FetchGitRefsRequest::page_size].
1541 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1542 self.0.request.page_size = v.into();
1543 self
1544 }
1545
1546 /// Sets the value of [page_token][crate::model::FetchGitRefsRequest::page_token].
1547 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1548 self.0.request.page_token = v.into();
1549 self
1550 }
1551 }
1552
1553 #[doc(hidden)]
1554 impl crate::RequestBuilder for FetchGitRefs {
1555 fn request_options(&mut self) -> &mut crate::RequestOptions {
1556 &mut self.0.options
1557 }
1558 }
1559
1560 /// The request builder for [DeveloperConnect::list_account_connectors][crate::client::DeveloperConnect::list_account_connectors] calls.
1561 ///
1562 /// # Example
1563 /// ```
1564 /// # use google_cloud_developerconnect_v1::builder::developer_connect::ListAccountConnectors;
1565 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
1566 /// use google_cloud_gax::paginator::ItemPaginator;
1567 ///
1568 /// let builder = prepare_request_builder();
1569 /// let mut items = builder.by_item();
1570 /// while let Some(result) = items.next().await {
1571 /// let item = result?;
1572 /// }
1573 /// # Ok(()) }
1574 ///
1575 /// fn prepare_request_builder() -> ListAccountConnectors {
1576 /// # panic!();
1577 /// // ... details omitted ...
1578 /// }
1579 /// ```
1580 #[derive(Clone, Debug)]
1581 pub struct ListAccountConnectors(RequestBuilder<crate::model::ListAccountConnectorsRequest>);
1582
1583 impl ListAccountConnectors {
1584 pub(crate) fn new(
1585 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1586 ) -> Self {
1587 Self(RequestBuilder::new(stub))
1588 }
1589
1590 /// Sets the full request, replacing any prior values.
1591 pub fn with_request<V: Into<crate::model::ListAccountConnectorsRequest>>(
1592 mut self,
1593 v: V,
1594 ) -> Self {
1595 self.0.request = v.into();
1596 self
1597 }
1598
1599 /// Sets all the options, replacing any prior values.
1600 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1601 self.0.options = v.into();
1602 self
1603 }
1604
1605 /// Sends the request.
1606 pub async fn send(self) -> Result<crate::model::ListAccountConnectorsResponse> {
1607 (*self.0.stub)
1608 .list_account_connectors(self.0.request, self.0.options)
1609 .await
1610 .map(crate::Response::into_body)
1611 }
1612
1613 /// Streams each page in the collection.
1614 pub fn by_page(
1615 self,
1616 ) -> impl google_cloud_gax::paginator::Paginator<
1617 crate::model::ListAccountConnectorsResponse,
1618 crate::Error,
1619 > {
1620 use std::clone::Clone;
1621 let token = self.0.request.page_token.clone();
1622 let execute = move |token: String| {
1623 let mut builder = self.clone();
1624 builder.0.request = builder.0.request.set_page_token(token);
1625 builder.send()
1626 };
1627 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1628 }
1629
1630 /// Streams each item in the collection.
1631 pub fn by_item(
1632 self,
1633 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1634 crate::model::ListAccountConnectorsResponse,
1635 crate::Error,
1636 > {
1637 use google_cloud_gax::paginator::Paginator;
1638 self.by_page().items()
1639 }
1640
1641 /// Sets the value of [parent][crate::model::ListAccountConnectorsRequest::parent].
1642 ///
1643 /// This is a **required** field for requests.
1644 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1645 self.0.request.parent = v.into();
1646 self
1647 }
1648
1649 /// Sets the value of [page_size][crate::model::ListAccountConnectorsRequest::page_size].
1650 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1651 self.0.request.page_size = v.into();
1652 self
1653 }
1654
1655 /// Sets the value of [page_token][crate::model::ListAccountConnectorsRequest::page_token].
1656 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1657 self.0.request.page_token = v.into();
1658 self
1659 }
1660
1661 /// Sets the value of [filter][crate::model::ListAccountConnectorsRequest::filter].
1662 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1663 self.0.request.filter = v.into();
1664 self
1665 }
1666
1667 /// Sets the value of [order_by][crate::model::ListAccountConnectorsRequest::order_by].
1668 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1669 self.0.request.order_by = v.into();
1670 self
1671 }
1672 }
1673
1674 #[doc(hidden)]
1675 impl crate::RequestBuilder for ListAccountConnectors {
1676 fn request_options(&mut self) -> &mut crate::RequestOptions {
1677 &mut self.0.options
1678 }
1679 }
1680
1681 /// The request builder for [DeveloperConnect::get_account_connector][crate::client::DeveloperConnect::get_account_connector] calls.
1682 ///
1683 /// # Example
1684 /// ```
1685 /// # use google_cloud_developerconnect_v1::builder::developer_connect::GetAccountConnector;
1686 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
1687 ///
1688 /// let builder = prepare_request_builder();
1689 /// let response = builder.send().await?;
1690 /// # Ok(()) }
1691 ///
1692 /// fn prepare_request_builder() -> GetAccountConnector {
1693 /// # panic!();
1694 /// // ... details omitted ...
1695 /// }
1696 /// ```
1697 #[derive(Clone, Debug)]
1698 pub struct GetAccountConnector(RequestBuilder<crate::model::GetAccountConnectorRequest>);
1699
1700 impl GetAccountConnector {
1701 pub(crate) fn new(
1702 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1703 ) -> Self {
1704 Self(RequestBuilder::new(stub))
1705 }
1706
1707 /// Sets the full request, replacing any prior values.
1708 pub fn with_request<V: Into<crate::model::GetAccountConnectorRequest>>(
1709 mut self,
1710 v: V,
1711 ) -> Self {
1712 self.0.request = v.into();
1713 self
1714 }
1715
1716 /// Sets all the options, replacing any prior values.
1717 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1718 self.0.options = v.into();
1719 self
1720 }
1721
1722 /// Sends the request.
1723 pub async fn send(self) -> Result<crate::model::AccountConnector> {
1724 (*self.0.stub)
1725 .get_account_connector(self.0.request, self.0.options)
1726 .await
1727 .map(crate::Response::into_body)
1728 }
1729
1730 /// Sets the value of [name][crate::model::GetAccountConnectorRequest::name].
1731 ///
1732 /// This is a **required** field for requests.
1733 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1734 self.0.request.name = v.into();
1735 self
1736 }
1737 }
1738
1739 #[doc(hidden)]
1740 impl crate::RequestBuilder for GetAccountConnector {
1741 fn request_options(&mut self) -> &mut crate::RequestOptions {
1742 &mut self.0.options
1743 }
1744 }
1745
1746 /// The request builder for [DeveloperConnect::create_account_connector][crate::client::DeveloperConnect::create_account_connector] calls.
1747 ///
1748 /// # Example
1749 /// ```
1750 /// # use google_cloud_developerconnect_v1::builder::developer_connect::CreateAccountConnector;
1751 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
1752 /// use google_cloud_lro::Poller;
1753 ///
1754 /// let builder = prepare_request_builder();
1755 /// let response = builder.poller().until_done().await?;
1756 /// # Ok(()) }
1757 ///
1758 /// fn prepare_request_builder() -> CreateAccountConnector {
1759 /// # panic!();
1760 /// // ... details omitted ...
1761 /// }
1762 /// ```
1763 #[derive(Clone, Debug)]
1764 pub struct CreateAccountConnector(RequestBuilder<crate::model::CreateAccountConnectorRequest>);
1765
1766 impl CreateAccountConnector {
1767 pub(crate) fn new(
1768 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1769 ) -> Self {
1770 Self(RequestBuilder::new(stub))
1771 }
1772
1773 /// Sets the full request, replacing any prior values.
1774 pub fn with_request<V: Into<crate::model::CreateAccountConnectorRequest>>(
1775 mut self,
1776 v: V,
1777 ) -> Self {
1778 self.0.request = v.into();
1779 self
1780 }
1781
1782 /// Sets all the options, replacing any prior values.
1783 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1784 self.0.options = v.into();
1785 self
1786 }
1787
1788 /// Sends the request.
1789 ///
1790 /// # Long running operations
1791 ///
1792 /// This starts, but does not poll, a longrunning operation. More information
1793 /// on [create_account_connector][crate::client::DeveloperConnect::create_account_connector].
1794 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1795 (*self.0.stub)
1796 .create_account_connector(self.0.request, self.0.options)
1797 .await
1798 .map(crate::Response::into_body)
1799 }
1800
1801 /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_account_connector`.
1802 pub fn poller(
1803 self,
1804 ) -> impl google_cloud_lro::Poller<crate::model::AccountConnector, crate::model::OperationMetadata>
1805 {
1806 type Operation = google_cloud_lro::internal::Operation<
1807 crate::model::AccountConnector,
1808 crate::model::OperationMetadata,
1809 >;
1810 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1811 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1812
1813 let stub = self.0.stub.clone();
1814 let mut options = self.0.options.clone();
1815 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1816 let query = move |name| {
1817 let stub = stub.clone();
1818 let options = options.clone();
1819 async {
1820 let op = GetOperation::new(stub)
1821 .set_name(name)
1822 .with_options(options)
1823 .send()
1824 .await?;
1825 Ok(Operation::new(op))
1826 }
1827 };
1828
1829 let start = move || async {
1830 let op = self.send().await?;
1831 Ok(Operation::new(op))
1832 };
1833
1834 google_cloud_lro::internal::new_poller(
1835 polling_error_policy,
1836 polling_backoff_policy,
1837 start,
1838 query,
1839 )
1840 }
1841
1842 /// Sets the value of [parent][crate::model::CreateAccountConnectorRequest::parent].
1843 ///
1844 /// This is a **required** field for requests.
1845 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1846 self.0.request.parent = v.into();
1847 self
1848 }
1849
1850 /// Sets the value of [account_connector_id][crate::model::CreateAccountConnectorRequest::account_connector_id].
1851 ///
1852 /// This is a **required** field for requests.
1853 pub fn set_account_connector_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1854 self.0.request.account_connector_id = v.into();
1855 self
1856 }
1857
1858 /// Sets the value of [account_connector][crate::model::CreateAccountConnectorRequest::account_connector].
1859 ///
1860 /// This is a **required** field for requests.
1861 pub fn set_account_connector<T>(mut self, v: T) -> Self
1862 where
1863 T: std::convert::Into<crate::model::AccountConnector>,
1864 {
1865 self.0.request.account_connector = std::option::Option::Some(v.into());
1866 self
1867 }
1868
1869 /// Sets or clears the value of [account_connector][crate::model::CreateAccountConnectorRequest::account_connector].
1870 ///
1871 /// This is a **required** field for requests.
1872 pub fn set_or_clear_account_connector<T>(mut self, v: std::option::Option<T>) -> Self
1873 where
1874 T: std::convert::Into<crate::model::AccountConnector>,
1875 {
1876 self.0.request.account_connector = v.map(|x| x.into());
1877 self
1878 }
1879
1880 /// Sets the value of [request_id][crate::model::CreateAccountConnectorRequest::request_id].
1881 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1882 self.0.request.request_id = v.into();
1883 self
1884 }
1885
1886 /// Sets the value of [validate_only][crate::model::CreateAccountConnectorRequest::validate_only].
1887 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1888 self.0.request.validate_only = v.into();
1889 self
1890 }
1891 }
1892
1893 #[doc(hidden)]
1894 impl crate::RequestBuilder for CreateAccountConnector {
1895 fn request_options(&mut self) -> &mut crate::RequestOptions {
1896 &mut self.0.options
1897 }
1898 }
1899
1900 /// The request builder for [DeveloperConnect::update_account_connector][crate::client::DeveloperConnect::update_account_connector] calls.
1901 ///
1902 /// # Example
1903 /// ```
1904 /// # use google_cloud_developerconnect_v1::builder::developer_connect::UpdateAccountConnector;
1905 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
1906 /// use google_cloud_lro::Poller;
1907 ///
1908 /// let builder = prepare_request_builder();
1909 /// let response = builder.poller().until_done().await?;
1910 /// # Ok(()) }
1911 ///
1912 /// fn prepare_request_builder() -> UpdateAccountConnector {
1913 /// # panic!();
1914 /// // ... details omitted ...
1915 /// }
1916 /// ```
1917 #[derive(Clone, Debug)]
1918 pub struct UpdateAccountConnector(RequestBuilder<crate::model::UpdateAccountConnectorRequest>);
1919
1920 impl UpdateAccountConnector {
1921 pub(crate) fn new(
1922 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1923 ) -> Self {
1924 Self(RequestBuilder::new(stub))
1925 }
1926
1927 /// Sets the full request, replacing any prior values.
1928 pub fn with_request<V: Into<crate::model::UpdateAccountConnectorRequest>>(
1929 mut self,
1930 v: V,
1931 ) -> Self {
1932 self.0.request = v.into();
1933 self
1934 }
1935
1936 /// Sets all the options, replacing any prior values.
1937 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1938 self.0.options = v.into();
1939 self
1940 }
1941
1942 /// Sends the request.
1943 ///
1944 /// # Long running operations
1945 ///
1946 /// This starts, but does not poll, a longrunning operation. More information
1947 /// on [update_account_connector][crate::client::DeveloperConnect::update_account_connector].
1948 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1949 (*self.0.stub)
1950 .update_account_connector(self.0.request, self.0.options)
1951 .await
1952 .map(crate::Response::into_body)
1953 }
1954
1955 /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_account_connector`.
1956 pub fn poller(
1957 self,
1958 ) -> impl google_cloud_lro::Poller<crate::model::AccountConnector, crate::model::OperationMetadata>
1959 {
1960 type Operation = google_cloud_lro::internal::Operation<
1961 crate::model::AccountConnector,
1962 crate::model::OperationMetadata,
1963 >;
1964 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1965 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1966
1967 let stub = self.0.stub.clone();
1968 let mut options = self.0.options.clone();
1969 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1970 let query = move |name| {
1971 let stub = stub.clone();
1972 let options = options.clone();
1973 async {
1974 let op = GetOperation::new(stub)
1975 .set_name(name)
1976 .with_options(options)
1977 .send()
1978 .await?;
1979 Ok(Operation::new(op))
1980 }
1981 };
1982
1983 let start = move || async {
1984 let op = self.send().await?;
1985 Ok(Operation::new(op))
1986 };
1987
1988 google_cloud_lro::internal::new_poller(
1989 polling_error_policy,
1990 polling_backoff_policy,
1991 start,
1992 query,
1993 )
1994 }
1995
1996 /// Sets the value of [update_mask][crate::model::UpdateAccountConnectorRequest::update_mask].
1997 pub fn set_update_mask<T>(mut self, v: T) -> Self
1998 where
1999 T: std::convert::Into<wkt::FieldMask>,
2000 {
2001 self.0.request.update_mask = std::option::Option::Some(v.into());
2002 self
2003 }
2004
2005 /// Sets or clears the value of [update_mask][crate::model::UpdateAccountConnectorRequest::update_mask].
2006 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2007 where
2008 T: std::convert::Into<wkt::FieldMask>,
2009 {
2010 self.0.request.update_mask = v.map(|x| x.into());
2011 self
2012 }
2013
2014 /// Sets the value of [account_connector][crate::model::UpdateAccountConnectorRequest::account_connector].
2015 ///
2016 /// This is a **required** field for requests.
2017 pub fn set_account_connector<T>(mut self, v: T) -> Self
2018 where
2019 T: std::convert::Into<crate::model::AccountConnector>,
2020 {
2021 self.0.request.account_connector = std::option::Option::Some(v.into());
2022 self
2023 }
2024
2025 /// Sets or clears the value of [account_connector][crate::model::UpdateAccountConnectorRequest::account_connector].
2026 ///
2027 /// This is a **required** field for requests.
2028 pub fn set_or_clear_account_connector<T>(mut self, v: std::option::Option<T>) -> Self
2029 where
2030 T: std::convert::Into<crate::model::AccountConnector>,
2031 {
2032 self.0.request.account_connector = v.map(|x| x.into());
2033 self
2034 }
2035
2036 /// Sets the value of [request_id][crate::model::UpdateAccountConnectorRequest::request_id].
2037 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2038 self.0.request.request_id = v.into();
2039 self
2040 }
2041
2042 /// Sets the value of [allow_missing][crate::model::UpdateAccountConnectorRequest::allow_missing].
2043 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
2044 self.0.request.allow_missing = v.into();
2045 self
2046 }
2047
2048 /// Sets the value of [validate_only][crate::model::UpdateAccountConnectorRequest::validate_only].
2049 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2050 self.0.request.validate_only = v.into();
2051 self
2052 }
2053 }
2054
2055 #[doc(hidden)]
2056 impl crate::RequestBuilder for UpdateAccountConnector {
2057 fn request_options(&mut self) -> &mut crate::RequestOptions {
2058 &mut self.0.options
2059 }
2060 }
2061
2062 /// The request builder for [DeveloperConnect::delete_account_connector][crate::client::DeveloperConnect::delete_account_connector] calls.
2063 ///
2064 /// # Example
2065 /// ```
2066 /// # use google_cloud_developerconnect_v1::builder::developer_connect::DeleteAccountConnector;
2067 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
2068 /// use google_cloud_lro::Poller;
2069 ///
2070 /// let builder = prepare_request_builder();
2071 /// let response = builder.poller().until_done().await?;
2072 /// # Ok(()) }
2073 ///
2074 /// fn prepare_request_builder() -> DeleteAccountConnector {
2075 /// # panic!();
2076 /// // ... details omitted ...
2077 /// }
2078 /// ```
2079 #[derive(Clone, Debug)]
2080 pub struct DeleteAccountConnector(RequestBuilder<crate::model::DeleteAccountConnectorRequest>);
2081
2082 impl DeleteAccountConnector {
2083 pub(crate) fn new(
2084 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2085 ) -> Self {
2086 Self(RequestBuilder::new(stub))
2087 }
2088
2089 /// Sets the full request, replacing any prior values.
2090 pub fn with_request<V: Into<crate::model::DeleteAccountConnectorRequest>>(
2091 mut self,
2092 v: V,
2093 ) -> Self {
2094 self.0.request = v.into();
2095 self
2096 }
2097
2098 /// Sets all the options, replacing any prior values.
2099 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2100 self.0.options = v.into();
2101 self
2102 }
2103
2104 /// Sends the request.
2105 ///
2106 /// # Long running operations
2107 ///
2108 /// This starts, but does not poll, a longrunning operation. More information
2109 /// on [delete_account_connector][crate::client::DeveloperConnect::delete_account_connector].
2110 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2111 (*self.0.stub)
2112 .delete_account_connector(self.0.request, self.0.options)
2113 .await
2114 .map(crate::Response::into_body)
2115 }
2116
2117 /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_account_connector`.
2118 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2119 type Operation =
2120 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2121 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2122 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2123
2124 let stub = self.0.stub.clone();
2125 let mut options = self.0.options.clone();
2126 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2127 let query = move |name| {
2128 let stub = stub.clone();
2129 let options = options.clone();
2130 async {
2131 let op = GetOperation::new(stub)
2132 .set_name(name)
2133 .with_options(options)
2134 .send()
2135 .await?;
2136 Ok(Operation::new(op))
2137 }
2138 };
2139
2140 let start = move || async {
2141 let op = self.send().await?;
2142 Ok(Operation::new(op))
2143 };
2144
2145 google_cloud_lro::internal::new_unit_response_poller(
2146 polling_error_policy,
2147 polling_backoff_policy,
2148 start,
2149 query,
2150 )
2151 }
2152
2153 /// Sets the value of [name][crate::model::DeleteAccountConnectorRequest::name].
2154 ///
2155 /// This is a **required** field for requests.
2156 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2157 self.0.request.name = v.into();
2158 self
2159 }
2160
2161 /// Sets the value of [request_id][crate::model::DeleteAccountConnectorRequest::request_id].
2162 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2163 self.0.request.request_id = v.into();
2164 self
2165 }
2166
2167 /// Sets the value of [validate_only][crate::model::DeleteAccountConnectorRequest::validate_only].
2168 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2169 self.0.request.validate_only = v.into();
2170 self
2171 }
2172
2173 /// Sets the value of [etag][crate::model::DeleteAccountConnectorRequest::etag].
2174 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2175 self.0.request.etag = v.into();
2176 self
2177 }
2178
2179 /// Sets the value of [force][crate::model::DeleteAccountConnectorRequest::force].
2180 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
2181 self.0.request.force = v.into();
2182 self
2183 }
2184 }
2185
2186 #[doc(hidden)]
2187 impl crate::RequestBuilder for DeleteAccountConnector {
2188 fn request_options(&mut self) -> &mut crate::RequestOptions {
2189 &mut self.0.options
2190 }
2191 }
2192
2193 /// The request builder for [DeveloperConnect::fetch_access_token][crate::client::DeveloperConnect::fetch_access_token] calls.
2194 ///
2195 /// # Example
2196 /// ```
2197 /// # use google_cloud_developerconnect_v1::builder::developer_connect::FetchAccessToken;
2198 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
2199 ///
2200 /// let builder = prepare_request_builder();
2201 /// let response = builder.send().await?;
2202 /// # Ok(()) }
2203 ///
2204 /// fn prepare_request_builder() -> FetchAccessToken {
2205 /// # panic!();
2206 /// // ... details omitted ...
2207 /// }
2208 /// ```
2209 #[derive(Clone, Debug)]
2210 pub struct FetchAccessToken(RequestBuilder<crate::model::FetchAccessTokenRequest>);
2211
2212 impl FetchAccessToken {
2213 pub(crate) fn new(
2214 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2215 ) -> Self {
2216 Self(RequestBuilder::new(stub))
2217 }
2218
2219 /// Sets the full request, replacing any prior values.
2220 pub fn with_request<V: Into<crate::model::FetchAccessTokenRequest>>(
2221 mut self,
2222 v: V,
2223 ) -> Self {
2224 self.0.request = v.into();
2225 self
2226 }
2227
2228 /// Sets all the options, replacing any prior values.
2229 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2230 self.0.options = v.into();
2231 self
2232 }
2233
2234 /// Sends the request.
2235 pub async fn send(self) -> Result<crate::model::FetchAccessTokenResponse> {
2236 (*self.0.stub)
2237 .fetch_access_token(self.0.request, self.0.options)
2238 .await
2239 .map(crate::Response::into_body)
2240 }
2241
2242 /// Sets the value of [account_connector][crate::model::FetchAccessTokenRequest::account_connector].
2243 ///
2244 /// This is a **required** field for requests.
2245 pub fn set_account_connector<T: Into<std::string::String>>(mut self, v: T) -> Self {
2246 self.0.request.account_connector = v.into();
2247 self
2248 }
2249 }
2250
2251 #[doc(hidden)]
2252 impl crate::RequestBuilder for FetchAccessToken {
2253 fn request_options(&mut self) -> &mut crate::RequestOptions {
2254 &mut self.0.options
2255 }
2256 }
2257
2258 /// The request builder for [DeveloperConnect::list_users][crate::client::DeveloperConnect::list_users] calls.
2259 ///
2260 /// # Example
2261 /// ```
2262 /// # use google_cloud_developerconnect_v1::builder::developer_connect::ListUsers;
2263 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
2264 /// use google_cloud_gax::paginator::ItemPaginator;
2265 ///
2266 /// let builder = prepare_request_builder();
2267 /// let mut items = builder.by_item();
2268 /// while let Some(result) = items.next().await {
2269 /// let item = result?;
2270 /// }
2271 /// # Ok(()) }
2272 ///
2273 /// fn prepare_request_builder() -> ListUsers {
2274 /// # panic!();
2275 /// // ... details omitted ...
2276 /// }
2277 /// ```
2278 #[derive(Clone, Debug)]
2279 pub struct ListUsers(RequestBuilder<crate::model::ListUsersRequest>);
2280
2281 impl ListUsers {
2282 pub(crate) fn new(
2283 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2284 ) -> Self {
2285 Self(RequestBuilder::new(stub))
2286 }
2287
2288 /// Sets the full request, replacing any prior values.
2289 pub fn with_request<V: Into<crate::model::ListUsersRequest>>(mut self, v: V) -> Self {
2290 self.0.request = v.into();
2291 self
2292 }
2293
2294 /// Sets all the options, replacing any prior values.
2295 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2296 self.0.options = v.into();
2297 self
2298 }
2299
2300 /// Sends the request.
2301 pub async fn send(self) -> Result<crate::model::ListUsersResponse> {
2302 (*self.0.stub)
2303 .list_users(self.0.request, self.0.options)
2304 .await
2305 .map(crate::Response::into_body)
2306 }
2307
2308 /// Streams each page in the collection.
2309 pub fn by_page(
2310 self,
2311 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListUsersResponse, crate::Error>
2312 {
2313 use std::clone::Clone;
2314 let token = self.0.request.page_token.clone();
2315 let execute = move |token: String| {
2316 let mut builder = self.clone();
2317 builder.0.request = builder.0.request.set_page_token(token);
2318 builder.send()
2319 };
2320 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2321 }
2322
2323 /// Streams each item in the collection.
2324 pub fn by_item(
2325 self,
2326 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListUsersResponse, crate::Error>
2327 {
2328 use google_cloud_gax::paginator::Paginator;
2329 self.by_page().items()
2330 }
2331
2332 /// Sets the value of [parent][crate::model::ListUsersRequest::parent].
2333 ///
2334 /// This is a **required** field for requests.
2335 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2336 self.0.request.parent = v.into();
2337 self
2338 }
2339
2340 /// Sets the value of [page_size][crate::model::ListUsersRequest::page_size].
2341 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2342 self.0.request.page_size = v.into();
2343 self
2344 }
2345
2346 /// Sets the value of [page_token][crate::model::ListUsersRequest::page_token].
2347 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2348 self.0.request.page_token = v.into();
2349 self
2350 }
2351
2352 /// Sets the value of [filter][crate::model::ListUsersRequest::filter].
2353 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2354 self.0.request.filter = v.into();
2355 self
2356 }
2357
2358 /// Sets the value of [order_by][crate::model::ListUsersRequest::order_by].
2359 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2360 self.0.request.order_by = v.into();
2361 self
2362 }
2363 }
2364
2365 #[doc(hidden)]
2366 impl crate::RequestBuilder for ListUsers {
2367 fn request_options(&mut self) -> &mut crate::RequestOptions {
2368 &mut self.0.options
2369 }
2370 }
2371
2372 /// The request builder for [DeveloperConnect::delete_user][crate::client::DeveloperConnect::delete_user] calls.
2373 ///
2374 /// # Example
2375 /// ```
2376 /// # use google_cloud_developerconnect_v1::builder::developer_connect::DeleteUser;
2377 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
2378 /// use google_cloud_lro::Poller;
2379 ///
2380 /// let builder = prepare_request_builder();
2381 /// let response = builder.poller().until_done().await?;
2382 /// # Ok(()) }
2383 ///
2384 /// fn prepare_request_builder() -> DeleteUser {
2385 /// # panic!();
2386 /// // ... details omitted ...
2387 /// }
2388 /// ```
2389 #[derive(Clone, Debug)]
2390 pub struct DeleteUser(RequestBuilder<crate::model::DeleteUserRequest>);
2391
2392 impl DeleteUser {
2393 pub(crate) fn new(
2394 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2395 ) -> Self {
2396 Self(RequestBuilder::new(stub))
2397 }
2398
2399 /// Sets the full request, replacing any prior values.
2400 pub fn with_request<V: Into<crate::model::DeleteUserRequest>>(mut self, v: V) -> Self {
2401 self.0.request = v.into();
2402 self
2403 }
2404
2405 /// Sets all the options, replacing any prior values.
2406 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2407 self.0.options = v.into();
2408 self
2409 }
2410
2411 /// Sends the request.
2412 ///
2413 /// # Long running operations
2414 ///
2415 /// This starts, but does not poll, a longrunning operation. More information
2416 /// on [delete_user][crate::client::DeveloperConnect::delete_user].
2417 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2418 (*self.0.stub)
2419 .delete_user(self.0.request, self.0.options)
2420 .await
2421 .map(crate::Response::into_body)
2422 }
2423
2424 /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_user`.
2425 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2426 type Operation =
2427 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2428 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2429 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2430
2431 let stub = self.0.stub.clone();
2432 let mut options = self.0.options.clone();
2433 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2434 let query = move |name| {
2435 let stub = stub.clone();
2436 let options = options.clone();
2437 async {
2438 let op = GetOperation::new(stub)
2439 .set_name(name)
2440 .with_options(options)
2441 .send()
2442 .await?;
2443 Ok(Operation::new(op))
2444 }
2445 };
2446
2447 let start = move || async {
2448 let op = self.send().await?;
2449 Ok(Operation::new(op))
2450 };
2451
2452 google_cloud_lro::internal::new_unit_response_poller(
2453 polling_error_policy,
2454 polling_backoff_policy,
2455 start,
2456 query,
2457 )
2458 }
2459
2460 /// Sets the value of [name][crate::model::DeleteUserRequest::name].
2461 ///
2462 /// This is a **required** field for requests.
2463 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2464 self.0.request.name = v.into();
2465 self
2466 }
2467
2468 /// Sets the value of [request_id][crate::model::DeleteUserRequest::request_id].
2469 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2470 self.0.request.request_id = v.into();
2471 self
2472 }
2473
2474 /// Sets the value of [validate_only][crate::model::DeleteUserRequest::validate_only].
2475 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
2476 self.0.request.validate_only = v.into();
2477 self
2478 }
2479
2480 /// Sets the value of [etag][crate::model::DeleteUserRequest::etag].
2481 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2482 self.0.request.etag = v.into();
2483 self
2484 }
2485 }
2486
2487 #[doc(hidden)]
2488 impl crate::RequestBuilder for DeleteUser {
2489 fn request_options(&mut self) -> &mut crate::RequestOptions {
2490 &mut self.0.options
2491 }
2492 }
2493
2494 /// The request builder for [DeveloperConnect::fetch_self][crate::client::DeveloperConnect::fetch_self] calls.
2495 ///
2496 /// # Example
2497 /// ```
2498 /// # use google_cloud_developerconnect_v1::builder::developer_connect::FetchSelf;
2499 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
2500 ///
2501 /// let builder = prepare_request_builder();
2502 /// let response = builder.send().await?;
2503 /// # Ok(()) }
2504 ///
2505 /// fn prepare_request_builder() -> FetchSelf {
2506 /// # panic!();
2507 /// // ... details omitted ...
2508 /// }
2509 /// ```
2510 #[derive(Clone, Debug)]
2511 pub struct FetchSelf(RequestBuilder<crate::model::FetchSelfRequest>);
2512
2513 impl FetchSelf {
2514 pub(crate) fn new(
2515 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2516 ) -> Self {
2517 Self(RequestBuilder::new(stub))
2518 }
2519
2520 /// Sets the full request, replacing any prior values.
2521 pub fn with_request<V: Into<crate::model::FetchSelfRequest>>(mut self, v: V) -> Self {
2522 self.0.request = v.into();
2523 self
2524 }
2525
2526 /// Sets all the options, replacing any prior values.
2527 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2528 self.0.options = v.into();
2529 self
2530 }
2531
2532 /// Sends the request.
2533 pub async fn send(self) -> Result<crate::model::User> {
2534 (*self.0.stub)
2535 .fetch_self(self.0.request, self.0.options)
2536 .await
2537 .map(crate::Response::into_body)
2538 }
2539
2540 /// Sets the value of [name][crate::model::FetchSelfRequest::name].
2541 ///
2542 /// This is a **required** field for requests.
2543 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2544 self.0.request.name = v.into();
2545 self
2546 }
2547 }
2548
2549 #[doc(hidden)]
2550 impl crate::RequestBuilder for FetchSelf {
2551 fn request_options(&mut self) -> &mut crate::RequestOptions {
2552 &mut self.0.options
2553 }
2554 }
2555
2556 /// The request builder for [DeveloperConnect::delete_self][crate::client::DeveloperConnect::delete_self] calls.
2557 ///
2558 /// # Example
2559 /// ```
2560 /// # use google_cloud_developerconnect_v1::builder::developer_connect::DeleteSelf;
2561 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
2562 /// use google_cloud_lro::Poller;
2563 ///
2564 /// let builder = prepare_request_builder();
2565 /// let response = builder.poller().until_done().await?;
2566 /// # Ok(()) }
2567 ///
2568 /// fn prepare_request_builder() -> DeleteSelf {
2569 /// # panic!();
2570 /// // ... details omitted ...
2571 /// }
2572 /// ```
2573 #[derive(Clone, Debug)]
2574 pub struct DeleteSelf(RequestBuilder<crate::model::DeleteSelfRequest>);
2575
2576 impl DeleteSelf {
2577 pub(crate) fn new(
2578 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2579 ) -> Self {
2580 Self(RequestBuilder::new(stub))
2581 }
2582
2583 /// Sets the full request, replacing any prior values.
2584 pub fn with_request<V: Into<crate::model::DeleteSelfRequest>>(mut self, v: V) -> Self {
2585 self.0.request = v.into();
2586 self
2587 }
2588
2589 /// Sets all the options, replacing any prior values.
2590 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2591 self.0.options = v.into();
2592 self
2593 }
2594
2595 /// Sends the request.
2596 ///
2597 /// # Long running operations
2598 ///
2599 /// This starts, but does not poll, a longrunning operation. More information
2600 /// on [delete_self][crate::client::DeveloperConnect::delete_self].
2601 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2602 (*self.0.stub)
2603 .delete_self(self.0.request, self.0.options)
2604 .await
2605 .map(crate::Response::into_body)
2606 }
2607
2608 /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_self`.
2609 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2610 type Operation =
2611 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2612 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2613 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2614
2615 let stub = self.0.stub.clone();
2616 let mut options = self.0.options.clone();
2617 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2618 let query = move |name| {
2619 let stub = stub.clone();
2620 let options = options.clone();
2621 async {
2622 let op = GetOperation::new(stub)
2623 .set_name(name)
2624 .with_options(options)
2625 .send()
2626 .await?;
2627 Ok(Operation::new(op))
2628 }
2629 };
2630
2631 let start = move || async {
2632 let op = self.send().await?;
2633 Ok(Operation::new(op))
2634 };
2635
2636 google_cloud_lro::internal::new_unit_response_poller(
2637 polling_error_policy,
2638 polling_backoff_policy,
2639 start,
2640 query,
2641 )
2642 }
2643
2644 /// Sets the value of [name][crate::model::DeleteSelfRequest::name].
2645 ///
2646 /// This is a **required** field for requests.
2647 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2648 self.0.request.name = v.into();
2649 self
2650 }
2651 }
2652
2653 #[doc(hidden)]
2654 impl crate::RequestBuilder for DeleteSelf {
2655 fn request_options(&mut self) -> &mut crate::RequestOptions {
2656 &mut self.0.options
2657 }
2658 }
2659
2660 /// The request builder for [DeveloperConnect::start_o_auth][crate::client::DeveloperConnect::start_o_auth] calls.
2661 ///
2662 /// # Example
2663 /// ```
2664 /// # use google_cloud_developerconnect_v1::builder::developer_connect::StartOAuth;
2665 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
2666 ///
2667 /// let builder = prepare_request_builder();
2668 /// let response = builder.send().await?;
2669 /// # Ok(()) }
2670 ///
2671 /// fn prepare_request_builder() -> StartOAuth {
2672 /// # panic!();
2673 /// // ... details omitted ...
2674 /// }
2675 /// ```
2676 #[derive(Clone, Debug)]
2677 pub struct StartOAuth(RequestBuilder<crate::model::StartOAuthRequest>);
2678
2679 impl StartOAuth {
2680 pub(crate) fn new(
2681 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2682 ) -> Self {
2683 Self(RequestBuilder::new(stub))
2684 }
2685
2686 /// Sets the full request, replacing any prior values.
2687 pub fn with_request<V: Into<crate::model::StartOAuthRequest>>(mut self, v: V) -> Self {
2688 self.0.request = v.into();
2689 self
2690 }
2691
2692 /// Sets all the options, replacing any prior values.
2693 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2694 self.0.options = v.into();
2695 self
2696 }
2697
2698 /// Sends the request.
2699 pub async fn send(self) -> Result<crate::model::StartOAuthResponse> {
2700 (*self.0.stub)
2701 .start_o_auth(self.0.request, self.0.options)
2702 .await
2703 .map(crate::Response::into_body)
2704 }
2705
2706 /// Sets the value of [account_connector][crate::model::StartOAuthRequest::account_connector].
2707 ///
2708 /// This is a **required** field for requests.
2709 pub fn set_account_connector<T: Into<std::string::String>>(mut self, v: T) -> Self {
2710 self.0.request.account_connector = v.into();
2711 self
2712 }
2713 }
2714
2715 #[doc(hidden)]
2716 impl crate::RequestBuilder for StartOAuth {
2717 fn request_options(&mut self) -> &mut crate::RequestOptions {
2718 &mut self.0.options
2719 }
2720 }
2721
2722 /// The request builder for [DeveloperConnect::finish_o_auth][crate::client::DeveloperConnect::finish_o_auth] calls.
2723 ///
2724 /// # Example
2725 /// ```
2726 /// # use google_cloud_developerconnect_v1::builder::developer_connect::FinishOAuth;
2727 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
2728 ///
2729 /// let builder = prepare_request_builder();
2730 /// let response = builder.send().await?;
2731 /// # Ok(()) }
2732 ///
2733 /// fn prepare_request_builder() -> FinishOAuth {
2734 /// # panic!();
2735 /// // ... details omitted ...
2736 /// }
2737 /// ```
2738 #[derive(Clone, Debug)]
2739 pub struct FinishOAuth(RequestBuilder<crate::model::FinishOAuthRequest>);
2740
2741 impl FinishOAuth {
2742 pub(crate) fn new(
2743 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2744 ) -> Self {
2745 Self(RequestBuilder::new(stub))
2746 }
2747
2748 /// Sets the full request, replacing any prior values.
2749 pub fn with_request<V: Into<crate::model::FinishOAuthRequest>>(mut self, v: V) -> Self {
2750 self.0.request = v.into();
2751 self
2752 }
2753
2754 /// Sets all the options, replacing any prior values.
2755 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2756 self.0.options = v.into();
2757 self
2758 }
2759
2760 /// Sends the request.
2761 pub async fn send(self) -> Result<crate::model::FinishOAuthResponse> {
2762 (*self.0.stub)
2763 .finish_o_auth(self.0.request, self.0.options)
2764 .await
2765 .map(crate::Response::into_body)
2766 }
2767
2768 /// Sets the value of [account_connector][crate::model::FinishOAuthRequest::account_connector].
2769 ///
2770 /// This is a **required** field for requests.
2771 pub fn set_account_connector<T: Into<std::string::String>>(mut self, v: T) -> Self {
2772 self.0.request.account_connector = v.into();
2773 self
2774 }
2775
2776 /// Sets the value of [params][crate::model::FinishOAuthRequest::params].
2777 ///
2778 /// Note that all the setters affecting `params` are
2779 /// mutually exclusive.
2780 pub fn set_params<T: Into<Option<crate::model::finish_o_auth_request::Params>>>(
2781 mut self,
2782 v: T,
2783 ) -> Self {
2784 self.0.request.params = v.into();
2785 self
2786 }
2787
2788 /// Sets the value of [params][crate::model::FinishOAuthRequest::params]
2789 /// to hold a `OauthParams`.
2790 ///
2791 /// Note that all the setters affecting `params` are
2792 /// mutually exclusive.
2793 pub fn set_oauth_params<
2794 T: std::convert::Into<std::boxed::Box<crate::model::finish_o_auth_request::OAuthParams>>,
2795 >(
2796 mut self,
2797 v: T,
2798 ) -> Self {
2799 self.0.request = self.0.request.set_oauth_params(v);
2800 self
2801 }
2802
2803 /// Sets the value of [params][crate::model::FinishOAuthRequest::params]
2804 /// to hold a `GoogleOauthParams`.
2805 ///
2806 /// Note that all the setters affecting `params` are
2807 /// mutually exclusive.
2808 pub fn set_google_oauth_params<
2809 T: std::convert::Into<
2810 std::boxed::Box<crate::model::finish_o_auth_request::GoogleOAuthParams>,
2811 >,
2812 >(
2813 mut self,
2814 v: T,
2815 ) -> Self {
2816 self.0.request = self.0.request.set_google_oauth_params(v);
2817 self
2818 }
2819 }
2820
2821 #[doc(hidden)]
2822 impl crate::RequestBuilder for FinishOAuth {
2823 fn request_options(&mut self) -> &mut crate::RequestOptions {
2824 &mut self.0.options
2825 }
2826 }
2827
2828 /// The request builder for [DeveloperConnect::list_locations][crate::client::DeveloperConnect::list_locations] calls.
2829 ///
2830 /// # Example
2831 /// ```
2832 /// # use google_cloud_developerconnect_v1::builder::developer_connect::ListLocations;
2833 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
2834 /// use google_cloud_gax::paginator::ItemPaginator;
2835 ///
2836 /// let builder = prepare_request_builder();
2837 /// let mut items = builder.by_item();
2838 /// while let Some(result) = items.next().await {
2839 /// let item = result?;
2840 /// }
2841 /// # Ok(()) }
2842 ///
2843 /// fn prepare_request_builder() -> ListLocations {
2844 /// # panic!();
2845 /// // ... details omitted ...
2846 /// }
2847 /// ```
2848 #[derive(Clone, Debug)]
2849 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
2850
2851 impl ListLocations {
2852 pub(crate) fn new(
2853 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2854 ) -> Self {
2855 Self(RequestBuilder::new(stub))
2856 }
2857
2858 /// Sets the full request, replacing any prior values.
2859 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
2860 mut self,
2861 v: V,
2862 ) -> Self {
2863 self.0.request = v.into();
2864 self
2865 }
2866
2867 /// Sets all the options, replacing any prior values.
2868 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2869 self.0.options = v.into();
2870 self
2871 }
2872
2873 /// Sends the request.
2874 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
2875 (*self.0.stub)
2876 .list_locations(self.0.request, self.0.options)
2877 .await
2878 .map(crate::Response::into_body)
2879 }
2880
2881 /// Streams each page in the collection.
2882 pub fn by_page(
2883 self,
2884 ) -> impl google_cloud_gax::paginator::Paginator<
2885 google_cloud_location::model::ListLocationsResponse,
2886 crate::Error,
2887 > {
2888 use std::clone::Clone;
2889 let token = self.0.request.page_token.clone();
2890 let execute = move |token: String| {
2891 let mut builder = self.clone();
2892 builder.0.request = builder.0.request.set_page_token(token);
2893 builder.send()
2894 };
2895 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2896 }
2897
2898 /// Streams each item in the collection.
2899 pub fn by_item(
2900 self,
2901 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2902 google_cloud_location::model::ListLocationsResponse,
2903 crate::Error,
2904 > {
2905 use google_cloud_gax::paginator::Paginator;
2906 self.by_page().items()
2907 }
2908
2909 /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
2910 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2911 self.0.request.name = v.into();
2912 self
2913 }
2914
2915 /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
2916 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2917 self.0.request.filter = v.into();
2918 self
2919 }
2920
2921 /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
2922 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2923 self.0.request.page_size = v.into();
2924 self
2925 }
2926
2927 /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
2928 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2929 self.0.request.page_token = v.into();
2930 self
2931 }
2932 }
2933
2934 #[doc(hidden)]
2935 impl crate::RequestBuilder for ListLocations {
2936 fn request_options(&mut self) -> &mut crate::RequestOptions {
2937 &mut self.0.options
2938 }
2939 }
2940
2941 /// The request builder for [DeveloperConnect::get_location][crate::client::DeveloperConnect::get_location] calls.
2942 ///
2943 /// # Example
2944 /// ```
2945 /// # use google_cloud_developerconnect_v1::builder::developer_connect::GetLocation;
2946 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
2947 ///
2948 /// let builder = prepare_request_builder();
2949 /// let response = builder.send().await?;
2950 /// # Ok(()) }
2951 ///
2952 /// fn prepare_request_builder() -> GetLocation {
2953 /// # panic!();
2954 /// // ... details omitted ...
2955 /// }
2956 /// ```
2957 #[derive(Clone, Debug)]
2958 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
2959
2960 impl GetLocation {
2961 pub(crate) fn new(
2962 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
2963 ) -> Self {
2964 Self(RequestBuilder::new(stub))
2965 }
2966
2967 /// Sets the full request, replacing any prior values.
2968 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
2969 mut self,
2970 v: V,
2971 ) -> Self {
2972 self.0.request = v.into();
2973 self
2974 }
2975
2976 /// Sets all the options, replacing any prior values.
2977 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2978 self.0.options = v.into();
2979 self
2980 }
2981
2982 /// Sends the request.
2983 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
2984 (*self.0.stub)
2985 .get_location(self.0.request, self.0.options)
2986 .await
2987 .map(crate::Response::into_body)
2988 }
2989
2990 /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
2991 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2992 self.0.request.name = v.into();
2993 self
2994 }
2995 }
2996
2997 #[doc(hidden)]
2998 impl crate::RequestBuilder for GetLocation {
2999 fn request_options(&mut self) -> &mut crate::RequestOptions {
3000 &mut self.0.options
3001 }
3002 }
3003
3004 /// The request builder for [DeveloperConnect::list_operations][crate::client::DeveloperConnect::list_operations] calls.
3005 ///
3006 /// # Example
3007 /// ```
3008 /// # use google_cloud_developerconnect_v1::builder::developer_connect::ListOperations;
3009 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
3010 /// use google_cloud_gax::paginator::ItemPaginator;
3011 ///
3012 /// let builder = prepare_request_builder();
3013 /// let mut items = builder.by_item();
3014 /// while let Some(result) = items.next().await {
3015 /// let item = result?;
3016 /// }
3017 /// # Ok(()) }
3018 ///
3019 /// fn prepare_request_builder() -> ListOperations {
3020 /// # panic!();
3021 /// // ... details omitted ...
3022 /// }
3023 /// ```
3024 #[derive(Clone, Debug)]
3025 pub struct ListOperations(
3026 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3027 );
3028
3029 impl ListOperations {
3030 pub(crate) fn new(
3031 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
3032 ) -> Self {
3033 Self(RequestBuilder::new(stub))
3034 }
3035
3036 /// Sets the full request, replacing any prior values.
3037 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3038 mut self,
3039 v: V,
3040 ) -> Self {
3041 self.0.request = v.into();
3042 self
3043 }
3044
3045 /// Sets all the options, replacing any prior values.
3046 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3047 self.0.options = v.into();
3048 self
3049 }
3050
3051 /// Sends the request.
3052 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3053 (*self.0.stub)
3054 .list_operations(self.0.request, self.0.options)
3055 .await
3056 .map(crate::Response::into_body)
3057 }
3058
3059 /// Streams each page in the collection.
3060 pub fn by_page(
3061 self,
3062 ) -> impl google_cloud_gax::paginator::Paginator<
3063 google_cloud_longrunning::model::ListOperationsResponse,
3064 crate::Error,
3065 > {
3066 use std::clone::Clone;
3067 let token = self.0.request.page_token.clone();
3068 let execute = move |token: String| {
3069 let mut builder = self.clone();
3070 builder.0.request = builder.0.request.set_page_token(token);
3071 builder.send()
3072 };
3073 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3074 }
3075
3076 /// Streams each item in the collection.
3077 pub fn by_item(
3078 self,
3079 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3080 google_cloud_longrunning::model::ListOperationsResponse,
3081 crate::Error,
3082 > {
3083 use google_cloud_gax::paginator::Paginator;
3084 self.by_page().items()
3085 }
3086
3087 /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
3088 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3089 self.0.request.name = v.into();
3090 self
3091 }
3092
3093 /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
3094 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3095 self.0.request.filter = v.into();
3096 self
3097 }
3098
3099 /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
3100 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3101 self.0.request.page_size = v.into();
3102 self
3103 }
3104
3105 /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
3106 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3107 self.0.request.page_token = v.into();
3108 self
3109 }
3110
3111 /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
3112 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3113 self.0.request.return_partial_success = v.into();
3114 self
3115 }
3116 }
3117
3118 #[doc(hidden)]
3119 impl crate::RequestBuilder for ListOperations {
3120 fn request_options(&mut self) -> &mut crate::RequestOptions {
3121 &mut self.0.options
3122 }
3123 }
3124
3125 /// The request builder for [DeveloperConnect::get_operation][crate::client::DeveloperConnect::get_operation] calls.
3126 ///
3127 /// # Example
3128 /// ```
3129 /// # use google_cloud_developerconnect_v1::builder::developer_connect::GetOperation;
3130 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
3131 ///
3132 /// let builder = prepare_request_builder();
3133 /// let response = builder.send().await?;
3134 /// # Ok(()) }
3135 ///
3136 /// fn prepare_request_builder() -> GetOperation {
3137 /// # panic!();
3138 /// // ... details omitted ...
3139 /// }
3140 /// ```
3141 #[derive(Clone, Debug)]
3142 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3143
3144 impl GetOperation {
3145 pub(crate) fn new(
3146 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
3147 ) -> Self {
3148 Self(RequestBuilder::new(stub))
3149 }
3150
3151 /// Sets the full request, replacing any prior values.
3152 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3153 mut self,
3154 v: V,
3155 ) -> Self {
3156 self.0.request = v.into();
3157 self
3158 }
3159
3160 /// Sets all the options, replacing any prior values.
3161 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3162 self.0.options = v.into();
3163 self
3164 }
3165
3166 /// Sends the request.
3167 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3168 (*self.0.stub)
3169 .get_operation(self.0.request, self.0.options)
3170 .await
3171 .map(crate::Response::into_body)
3172 }
3173
3174 /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
3175 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3176 self.0.request.name = v.into();
3177 self
3178 }
3179 }
3180
3181 #[doc(hidden)]
3182 impl crate::RequestBuilder for GetOperation {
3183 fn request_options(&mut self) -> &mut crate::RequestOptions {
3184 &mut self.0.options
3185 }
3186 }
3187
3188 /// The request builder for [DeveloperConnect::delete_operation][crate::client::DeveloperConnect::delete_operation] calls.
3189 ///
3190 /// # Example
3191 /// ```
3192 /// # use google_cloud_developerconnect_v1::builder::developer_connect::DeleteOperation;
3193 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
3194 ///
3195 /// let builder = prepare_request_builder();
3196 /// let response = builder.send().await?;
3197 /// # Ok(()) }
3198 ///
3199 /// fn prepare_request_builder() -> DeleteOperation {
3200 /// # panic!();
3201 /// // ... details omitted ...
3202 /// }
3203 /// ```
3204 #[derive(Clone, Debug)]
3205 pub struct DeleteOperation(
3206 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
3207 );
3208
3209 impl DeleteOperation {
3210 pub(crate) fn new(
3211 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
3212 ) -> Self {
3213 Self(RequestBuilder::new(stub))
3214 }
3215
3216 /// Sets the full request, replacing any prior values.
3217 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
3218 mut self,
3219 v: V,
3220 ) -> Self {
3221 self.0.request = v.into();
3222 self
3223 }
3224
3225 /// Sets all the options, replacing any prior values.
3226 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3227 self.0.options = v.into();
3228 self
3229 }
3230
3231 /// Sends the request.
3232 pub async fn send(self) -> Result<()> {
3233 (*self.0.stub)
3234 .delete_operation(self.0.request, self.0.options)
3235 .await
3236 .map(crate::Response::into_body)
3237 }
3238
3239 /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
3240 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3241 self.0.request.name = v.into();
3242 self
3243 }
3244 }
3245
3246 #[doc(hidden)]
3247 impl crate::RequestBuilder for DeleteOperation {
3248 fn request_options(&mut self) -> &mut crate::RequestOptions {
3249 &mut self.0.options
3250 }
3251 }
3252
3253 /// The request builder for [DeveloperConnect::cancel_operation][crate::client::DeveloperConnect::cancel_operation] calls.
3254 ///
3255 /// # Example
3256 /// ```
3257 /// # use google_cloud_developerconnect_v1::builder::developer_connect::CancelOperation;
3258 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
3259 ///
3260 /// let builder = prepare_request_builder();
3261 /// let response = builder.send().await?;
3262 /// # Ok(()) }
3263 ///
3264 /// fn prepare_request_builder() -> CancelOperation {
3265 /// # panic!();
3266 /// // ... details omitted ...
3267 /// }
3268 /// ```
3269 #[derive(Clone, Debug)]
3270 pub struct CancelOperation(
3271 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
3272 );
3273
3274 impl CancelOperation {
3275 pub(crate) fn new(
3276 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
3277 ) -> Self {
3278 Self(RequestBuilder::new(stub))
3279 }
3280
3281 /// Sets the full request, replacing any prior values.
3282 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3283 mut self,
3284 v: V,
3285 ) -> Self {
3286 self.0.request = v.into();
3287 self
3288 }
3289
3290 /// Sets all the options, replacing any prior values.
3291 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3292 self.0.options = v.into();
3293 self
3294 }
3295
3296 /// Sends the request.
3297 pub async fn send(self) -> Result<()> {
3298 (*self.0.stub)
3299 .cancel_operation(self.0.request, self.0.options)
3300 .await
3301 .map(crate::Response::into_body)
3302 }
3303
3304 /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
3305 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3306 self.0.request.name = v.into();
3307 self
3308 }
3309 }
3310
3311 #[doc(hidden)]
3312 impl crate::RequestBuilder for CancelOperation {
3313 fn request_options(&mut self) -> &mut crate::RequestOptions {
3314 &mut self.0.options
3315 }
3316 }
3317}
3318
3319/// Request and client builders for [InsightsConfigService][crate::client::InsightsConfigService].
3320pub mod insights_config_service {
3321 use crate::Result;
3322
3323 /// A builder for [InsightsConfigService][crate::client::InsightsConfigService].
3324 ///
3325 /// ```
3326 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3327 /// # use google_cloud_developerconnect_v1::*;
3328 /// # use builder::insights_config_service::ClientBuilder;
3329 /// # use client::InsightsConfigService;
3330 /// let builder : ClientBuilder = InsightsConfigService::builder();
3331 /// let client = builder
3332 /// .with_endpoint("https://developerconnect.googleapis.com")
3333 /// .build().await?;
3334 /// # Ok(()) }
3335 /// ```
3336 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3337
3338 pub(crate) mod client {
3339 use super::super::super::client::InsightsConfigService;
3340 pub struct Factory;
3341 impl crate::ClientFactory for Factory {
3342 type Client = InsightsConfigService;
3343 type Credentials = gaxi::options::Credentials;
3344 async fn build(
3345 self,
3346 config: gaxi::options::ClientConfig,
3347 ) -> crate::ClientBuilderResult<Self::Client> {
3348 Self::Client::new(config).await
3349 }
3350 }
3351 }
3352
3353 /// Common implementation for [crate::client::InsightsConfigService] request builders.
3354 #[derive(Clone, Debug)]
3355 pub(crate) struct RequestBuilder<R: std::default::Default> {
3356 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3357 request: R,
3358 options: crate::RequestOptions,
3359 }
3360
3361 impl<R> RequestBuilder<R>
3362 where
3363 R: std::default::Default,
3364 {
3365 pub(crate) fn new(
3366 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3367 ) -> Self {
3368 Self {
3369 stub,
3370 request: R::default(),
3371 options: crate::RequestOptions::default(),
3372 }
3373 }
3374 }
3375
3376 /// The request builder for [InsightsConfigService::list_insights_configs][crate::client::InsightsConfigService::list_insights_configs] calls.
3377 ///
3378 /// # Example
3379 /// ```
3380 /// # use google_cloud_developerconnect_v1::builder::insights_config_service::ListInsightsConfigs;
3381 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
3382 /// use google_cloud_gax::paginator::ItemPaginator;
3383 ///
3384 /// let builder = prepare_request_builder();
3385 /// let mut items = builder.by_item();
3386 /// while let Some(result) = items.next().await {
3387 /// let item = result?;
3388 /// }
3389 /// # Ok(()) }
3390 ///
3391 /// fn prepare_request_builder() -> ListInsightsConfigs {
3392 /// # panic!();
3393 /// // ... details omitted ...
3394 /// }
3395 /// ```
3396 #[derive(Clone, Debug)]
3397 pub struct ListInsightsConfigs(RequestBuilder<crate::model::ListInsightsConfigsRequest>);
3398
3399 impl ListInsightsConfigs {
3400 pub(crate) fn new(
3401 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3402 ) -> Self {
3403 Self(RequestBuilder::new(stub))
3404 }
3405
3406 /// Sets the full request, replacing any prior values.
3407 pub fn with_request<V: Into<crate::model::ListInsightsConfigsRequest>>(
3408 mut self,
3409 v: V,
3410 ) -> Self {
3411 self.0.request = v.into();
3412 self
3413 }
3414
3415 /// Sets all the options, replacing any prior values.
3416 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3417 self.0.options = v.into();
3418 self
3419 }
3420
3421 /// Sends the request.
3422 pub async fn send(self) -> Result<crate::model::ListInsightsConfigsResponse> {
3423 (*self.0.stub)
3424 .list_insights_configs(self.0.request, self.0.options)
3425 .await
3426 .map(crate::Response::into_body)
3427 }
3428
3429 /// Streams each page in the collection.
3430 pub fn by_page(
3431 self,
3432 ) -> impl google_cloud_gax::paginator::Paginator<
3433 crate::model::ListInsightsConfigsResponse,
3434 crate::Error,
3435 > {
3436 use std::clone::Clone;
3437 let token = self.0.request.page_token.clone();
3438 let execute = move |token: String| {
3439 let mut builder = self.clone();
3440 builder.0.request = builder.0.request.set_page_token(token);
3441 builder.send()
3442 };
3443 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3444 }
3445
3446 /// Streams each item in the collection.
3447 pub fn by_item(
3448 self,
3449 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3450 crate::model::ListInsightsConfigsResponse,
3451 crate::Error,
3452 > {
3453 use google_cloud_gax::paginator::Paginator;
3454 self.by_page().items()
3455 }
3456
3457 /// Sets the value of [parent][crate::model::ListInsightsConfigsRequest::parent].
3458 ///
3459 /// This is a **required** field for requests.
3460 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3461 self.0.request.parent = v.into();
3462 self
3463 }
3464
3465 /// Sets the value of [page_size][crate::model::ListInsightsConfigsRequest::page_size].
3466 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3467 self.0.request.page_size = v.into();
3468 self
3469 }
3470
3471 /// Sets the value of [page_token][crate::model::ListInsightsConfigsRequest::page_token].
3472 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3473 self.0.request.page_token = v.into();
3474 self
3475 }
3476
3477 /// Sets the value of [filter][crate::model::ListInsightsConfigsRequest::filter].
3478 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3479 self.0.request.filter = v.into();
3480 self
3481 }
3482
3483 /// Sets the value of [order_by][crate::model::ListInsightsConfigsRequest::order_by].
3484 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3485 self.0.request.order_by = v.into();
3486 self
3487 }
3488 }
3489
3490 #[doc(hidden)]
3491 impl crate::RequestBuilder for ListInsightsConfigs {
3492 fn request_options(&mut self) -> &mut crate::RequestOptions {
3493 &mut self.0.options
3494 }
3495 }
3496
3497 /// The request builder for [InsightsConfigService::create_insights_config][crate::client::InsightsConfigService::create_insights_config] calls.
3498 ///
3499 /// # Example
3500 /// ```
3501 /// # use google_cloud_developerconnect_v1::builder::insights_config_service::CreateInsightsConfig;
3502 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
3503 /// use google_cloud_lro::Poller;
3504 ///
3505 /// let builder = prepare_request_builder();
3506 /// let response = builder.poller().until_done().await?;
3507 /// # Ok(()) }
3508 ///
3509 /// fn prepare_request_builder() -> CreateInsightsConfig {
3510 /// # panic!();
3511 /// // ... details omitted ...
3512 /// }
3513 /// ```
3514 #[derive(Clone, Debug)]
3515 pub struct CreateInsightsConfig(RequestBuilder<crate::model::CreateInsightsConfigRequest>);
3516
3517 impl CreateInsightsConfig {
3518 pub(crate) fn new(
3519 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3520 ) -> Self {
3521 Self(RequestBuilder::new(stub))
3522 }
3523
3524 /// Sets the full request, replacing any prior values.
3525 pub fn with_request<V: Into<crate::model::CreateInsightsConfigRequest>>(
3526 mut self,
3527 v: V,
3528 ) -> Self {
3529 self.0.request = v.into();
3530 self
3531 }
3532
3533 /// Sets all the options, replacing any prior values.
3534 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3535 self.0.options = v.into();
3536 self
3537 }
3538
3539 /// Sends the request.
3540 ///
3541 /// # Long running operations
3542 ///
3543 /// This starts, but does not poll, a longrunning operation. More information
3544 /// on [create_insights_config][crate::client::InsightsConfigService::create_insights_config].
3545 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3546 (*self.0.stub)
3547 .create_insights_config(self.0.request, self.0.options)
3548 .await
3549 .map(crate::Response::into_body)
3550 }
3551
3552 /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_insights_config`.
3553 pub fn poller(
3554 self,
3555 ) -> impl google_cloud_lro::Poller<crate::model::InsightsConfig, crate::model::OperationMetadata>
3556 {
3557 type Operation = google_cloud_lro::internal::Operation<
3558 crate::model::InsightsConfig,
3559 crate::model::OperationMetadata,
3560 >;
3561 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3562 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3563
3564 let stub = self.0.stub.clone();
3565 let mut options = self.0.options.clone();
3566 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3567 let query = move |name| {
3568 let stub = stub.clone();
3569 let options = options.clone();
3570 async {
3571 let op = GetOperation::new(stub)
3572 .set_name(name)
3573 .with_options(options)
3574 .send()
3575 .await?;
3576 Ok(Operation::new(op))
3577 }
3578 };
3579
3580 let start = move || async {
3581 let op = self.send().await?;
3582 Ok(Operation::new(op))
3583 };
3584
3585 google_cloud_lro::internal::new_poller(
3586 polling_error_policy,
3587 polling_backoff_policy,
3588 start,
3589 query,
3590 )
3591 }
3592
3593 /// Sets the value of [parent][crate::model::CreateInsightsConfigRequest::parent].
3594 ///
3595 /// This is a **required** field for requests.
3596 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3597 self.0.request.parent = v.into();
3598 self
3599 }
3600
3601 /// Sets the value of [insights_config_id][crate::model::CreateInsightsConfigRequest::insights_config_id].
3602 ///
3603 /// This is a **required** field for requests.
3604 pub fn set_insights_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3605 self.0.request.insights_config_id = v.into();
3606 self
3607 }
3608
3609 /// Sets the value of [insights_config][crate::model::CreateInsightsConfigRequest::insights_config].
3610 ///
3611 /// This is a **required** field for requests.
3612 pub fn set_insights_config<T>(mut self, v: T) -> Self
3613 where
3614 T: std::convert::Into<crate::model::InsightsConfig>,
3615 {
3616 self.0.request.insights_config = std::option::Option::Some(v.into());
3617 self
3618 }
3619
3620 /// Sets or clears the value of [insights_config][crate::model::CreateInsightsConfigRequest::insights_config].
3621 ///
3622 /// This is a **required** field for requests.
3623 pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
3624 where
3625 T: std::convert::Into<crate::model::InsightsConfig>,
3626 {
3627 self.0.request.insights_config = v.map(|x| x.into());
3628 self
3629 }
3630
3631 /// Sets the value of [validate_only][crate::model::CreateInsightsConfigRequest::validate_only].
3632 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3633 self.0.request.validate_only = v.into();
3634 self
3635 }
3636 }
3637
3638 #[doc(hidden)]
3639 impl crate::RequestBuilder for CreateInsightsConfig {
3640 fn request_options(&mut self) -> &mut crate::RequestOptions {
3641 &mut self.0.options
3642 }
3643 }
3644
3645 /// The request builder for [InsightsConfigService::get_insights_config][crate::client::InsightsConfigService::get_insights_config] calls.
3646 ///
3647 /// # Example
3648 /// ```
3649 /// # use google_cloud_developerconnect_v1::builder::insights_config_service::GetInsightsConfig;
3650 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
3651 ///
3652 /// let builder = prepare_request_builder();
3653 /// let response = builder.send().await?;
3654 /// # Ok(()) }
3655 ///
3656 /// fn prepare_request_builder() -> GetInsightsConfig {
3657 /// # panic!();
3658 /// // ... details omitted ...
3659 /// }
3660 /// ```
3661 #[derive(Clone, Debug)]
3662 pub struct GetInsightsConfig(RequestBuilder<crate::model::GetInsightsConfigRequest>);
3663
3664 impl GetInsightsConfig {
3665 pub(crate) fn new(
3666 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3667 ) -> Self {
3668 Self(RequestBuilder::new(stub))
3669 }
3670
3671 /// Sets the full request, replacing any prior values.
3672 pub fn with_request<V: Into<crate::model::GetInsightsConfigRequest>>(
3673 mut self,
3674 v: V,
3675 ) -> Self {
3676 self.0.request = v.into();
3677 self
3678 }
3679
3680 /// Sets all the options, replacing any prior values.
3681 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3682 self.0.options = v.into();
3683 self
3684 }
3685
3686 /// Sends the request.
3687 pub async fn send(self) -> Result<crate::model::InsightsConfig> {
3688 (*self.0.stub)
3689 .get_insights_config(self.0.request, self.0.options)
3690 .await
3691 .map(crate::Response::into_body)
3692 }
3693
3694 /// Sets the value of [name][crate::model::GetInsightsConfigRequest::name].
3695 ///
3696 /// This is a **required** field for requests.
3697 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3698 self.0.request.name = v.into();
3699 self
3700 }
3701 }
3702
3703 #[doc(hidden)]
3704 impl crate::RequestBuilder for GetInsightsConfig {
3705 fn request_options(&mut self) -> &mut crate::RequestOptions {
3706 &mut self.0.options
3707 }
3708 }
3709
3710 /// The request builder for [InsightsConfigService::update_insights_config][crate::client::InsightsConfigService::update_insights_config] calls.
3711 ///
3712 /// # Example
3713 /// ```
3714 /// # use google_cloud_developerconnect_v1::builder::insights_config_service::UpdateInsightsConfig;
3715 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
3716 /// use google_cloud_lro::Poller;
3717 ///
3718 /// let builder = prepare_request_builder();
3719 /// let response = builder.poller().until_done().await?;
3720 /// # Ok(()) }
3721 ///
3722 /// fn prepare_request_builder() -> UpdateInsightsConfig {
3723 /// # panic!();
3724 /// // ... details omitted ...
3725 /// }
3726 /// ```
3727 #[derive(Clone, Debug)]
3728 pub struct UpdateInsightsConfig(RequestBuilder<crate::model::UpdateInsightsConfigRequest>);
3729
3730 impl UpdateInsightsConfig {
3731 pub(crate) fn new(
3732 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3733 ) -> Self {
3734 Self(RequestBuilder::new(stub))
3735 }
3736
3737 /// Sets the full request, replacing any prior values.
3738 pub fn with_request<V: Into<crate::model::UpdateInsightsConfigRequest>>(
3739 mut self,
3740 v: V,
3741 ) -> Self {
3742 self.0.request = v.into();
3743 self
3744 }
3745
3746 /// Sets all the options, replacing any prior values.
3747 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3748 self.0.options = v.into();
3749 self
3750 }
3751
3752 /// Sends the request.
3753 ///
3754 /// # Long running operations
3755 ///
3756 /// This starts, but does not poll, a longrunning operation. More information
3757 /// on [update_insights_config][crate::client::InsightsConfigService::update_insights_config].
3758 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3759 (*self.0.stub)
3760 .update_insights_config(self.0.request, self.0.options)
3761 .await
3762 .map(crate::Response::into_body)
3763 }
3764
3765 /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_insights_config`.
3766 pub fn poller(
3767 self,
3768 ) -> impl google_cloud_lro::Poller<crate::model::InsightsConfig, crate::model::OperationMetadata>
3769 {
3770 type Operation = google_cloud_lro::internal::Operation<
3771 crate::model::InsightsConfig,
3772 crate::model::OperationMetadata,
3773 >;
3774 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3775 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3776
3777 let stub = self.0.stub.clone();
3778 let mut options = self.0.options.clone();
3779 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3780 let query = move |name| {
3781 let stub = stub.clone();
3782 let options = options.clone();
3783 async {
3784 let op = GetOperation::new(stub)
3785 .set_name(name)
3786 .with_options(options)
3787 .send()
3788 .await?;
3789 Ok(Operation::new(op))
3790 }
3791 };
3792
3793 let start = move || async {
3794 let op = self.send().await?;
3795 Ok(Operation::new(op))
3796 };
3797
3798 google_cloud_lro::internal::new_poller(
3799 polling_error_policy,
3800 polling_backoff_policy,
3801 start,
3802 query,
3803 )
3804 }
3805
3806 /// Sets the value of [insights_config][crate::model::UpdateInsightsConfigRequest::insights_config].
3807 ///
3808 /// This is a **required** field for requests.
3809 pub fn set_insights_config<T>(mut self, v: T) -> Self
3810 where
3811 T: std::convert::Into<crate::model::InsightsConfig>,
3812 {
3813 self.0.request.insights_config = std::option::Option::Some(v.into());
3814 self
3815 }
3816
3817 /// Sets or clears the value of [insights_config][crate::model::UpdateInsightsConfigRequest::insights_config].
3818 ///
3819 /// This is a **required** field for requests.
3820 pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
3821 where
3822 T: std::convert::Into<crate::model::InsightsConfig>,
3823 {
3824 self.0.request.insights_config = v.map(|x| x.into());
3825 self
3826 }
3827
3828 /// Sets the value of [request_id][crate::model::UpdateInsightsConfigRequest::request_id].
3829 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3830 self.0.request.request_id = v.into();
3831 self
3832 }
3833
3834 /// Sets the value of [allow_missing][crate::model::UpdateInsightsConfigRequest::allow_missing].
3835 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
3836 self.0.request.allow_missing = v.into();
3837 self
3838 }
3839
3840 /// Sets the value of [validate_only][crate::model::UpdateInsightsConfigRequest::validate_only].
3841 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3842 self.0.request.validate_only = v.into();
3843 self
3844 }
3845 }
3846
3847 #[doc(hidden)]
3848 impl crate::RequestBuilder for UpdateInsightsConfig {
3849 fn request_options(&mut self) -> &mut crate::RequestOptions {
3850 &mut self.0.options
3851 }
3852 }
3853
3854 /// The request builder for [InsightsConfigService::delete_insights_config][crate::client::InsightsConfigService::delete_insights_config] calls.
3855 ///
3856 /// # Example
3857 /// ```
3858 /// # use google_cloud_developerconnect_v1::builder::insights_config_service::DeleteInsightsConfig;
3859 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
3860 /// use google_cloud_lro::Poller;
3861 ///
3862 /// let builder = prepare_request_builder();
3863 /// let response = builder.poller().until_done().await?;
3864 /// # Ok(()) }
3865 ///
3866 /// fn prepare_request_builder() -> DeleteInsightsConfig {
3867 /// # panic!();
3868 /// // ... details omitted ...
3869 /// }
3870 /// ```
3871 #[derive(Clone, Debug)]
3872 pub struct DeleteInsightsConfig(RequestBuilder<crate::model::DeleteInsightsConfigRequest>);
3873
3874 impl DeleteInsightsConfig {
3875 pub(crate) fn new(
3876 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
3877 ) -> Self {
3878 Self(RequestBuilder::new(stub))
3879 }
3880
3881 /// Sets the full request, replacing any prior values.
3882 pub fn with_request<V: Into<crate::model::DeleteInsightsConfigRequest>>(
3883 mut self,
3884 v: V,
3885 ) -> Self {
3886 self.0.request = v.into();
3887 self
3888 }
3889
3890 /// Sets all the options, replacing any prior values.
3891 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3892 self.0.options = v.into();
3893 self
3894 }
3895
3896 /// Sends the request.
3897 ///
3898 /// # Long running operations
3899 ///
3900 /// This starts, but does not poll, a longrunning operation. More information
3901 /// on [delete_insights_config][crate::client::InsightsConfigService::delete_insights_config].
3902 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3903 (*self.0.stub)
3904 .delete_insights_config(self.0.request, self.0.options)
3905 .await
3906 .map(crate::Response::into_body)
3907 }
3908
3909 /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_insights_config`.
3910 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
3911 type Operation =
3912 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3913 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3914 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3915
3916 let stub = self.0.stub.clone();
3917 let mut options = self.0.options.clone();
3918 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3919 let query = move |name| {
3920 let stub = stub.clone();
3921 let options = options.clone();
3922 async {
3923 let op = GetOperation::new(stub)
3924 .set_name(name)
3925 .with_options(options)
3926 .send()
3927 .await?;
3928 Ok(Operation::new(op))
3929 }
3930 };
3931
3932 let start = move || async {
3933 let op = self.send().await?;
3934 Ok(Operation::new(op))
3935 };
3936
3937 google_cloud_lro::internal::new_unit_response_poller(
3938 polling_error_policy,
3939 polling_backoff_policy,
3940 start,
3941 query,
3942 )
3943 }
3944
3945 /// Sets the value of [name][crate::model::DeleteInsightsConfigRequest::name].
3946 ///
3947 /// This is a **required** field for requests.
3948 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3949 self.0.request.name = v.into();
3950 self
3951 }
3952
3953 /// Sets the value of [request_id][crate::model::DeleteInsightsConfigRequest::request_id].
3954 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3955 self.0.request.request_id = v.into();
3956 self
3957 }
3958
3959 /// Sets the value of [validate_only][crate::model::DeleteInsightsConfigRequest::validate_only].
3960 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
3961 self.0.request.validate_only = v.into();
3962 self
3963 }
3964
3965 /// Sets the value of [etag][crate::model::DeleteInsightsConfigRequest::etag].
3966 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3967 self.0.request.etag = v.into();
3968 self
3969 }
3970 }
3971
3972 #[doc(hidden)]
3973 impl crate::RequestBuilder for DeleteInsightsConfig {
3974 fn request_options(&mut self) -> &mut crate::RequestOptions {
3975 &mut self.0.options
3976 }
3977 }
3978
3979 /// The request builder for [InsightsConfigService::get_deployment_event][crate::client::InsightsConfigService::get_deployment_event] calls.
3980 ///
3981 /// # Example
3982 /// ```
3983 /// # use google_cloud_developerconnect_v1::builder::insights_config_service::GetDeploymentEvent;
3984 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
3985 ///
3986 /// let builder = prepare_request_builder();
3987 /// let response = builder.send().await?;
3988 /// # Ok(()) }
3989 ///
3990 /// fn prepare_request_builder() -> GetDeploymentEvent {
3991 /// # panic!();
3992 /// // ... details omitted ...
3993 /// }
3994 /// ```
3995 #[derive(Clone, Debug)]
3996 pub struct GetDeploymentEvent(RequestBuilder<crate::model::GetDeploymentEventRequest>);
3997
3998 impl GetDeploymentEvent {
3999 pub(crate) fn new(
4000 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
4001 ) -> Self {
4002 Self(RequestBuilder::new(stub))
4003 }
4004
4005 /// Sets the full request, replacing any prior values.
4006 pub fn with_request<V: Into<crate::model::GetDeploymentEventRequest>>(
4007 mut self,
4008 v: V,
4009 ) -> Self {
4010 self.0.request = v.into();
4011 self
4012 }
4013
4014 /// Sets all the options, replacing any prior values.
4015 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4016 self.0.options = v.into();
4017 self
4018 }
4019
4020 /// Sends the request.
4021 pub async fn send(self) -> Result<crate::model::DeploymentEvent> {
4022 (*self.0.stub)
4023 .get_deployment_event(self.0.request, self.0.options)
4024 .await
4025 .map(crate::Response::into_body)
4026 }
4027
4028 /// Sets the value of [name][crate::model::GetDeploymentEventRequest::name].
4029 ///
4030 /// This is a **required** field for requests.
4031 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4032 self.0.request.name = v.into();
4033 self
4034 }
4035 }
4036
4037 #[doc(hidden)]
4038 impl crate::RequestBuilder for GetDeploymentEvent {
4039 fn request_options(&mut self) -> &mut crate::RequestOptions {
4040 &mut self.0.options
4041 }
4042 }
4043
4044 /// The request builder for [InsightsConfigService::list_deployment_events][crate::client::InsightsConfigService::list_deployment_events] calls.
4045 ///
4046 /// # Example
4047 /// ```
4048 /// # use google_cloud_developerconnect_v1::builder::insights_config_service::ListDeploymentEvents;
4049 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
4050 /// use google_cloud_gax::paginator::ItemPaginator;
4051 ///
4052 /// let builder = prepare_request_builder();
4053 /// let mut items = builder.by_item();
4054 /// while let Some(result) = items.next().await {
4055 /// let item = result?;
4056 /// }
4057 /// # Ok(()) }
4058 ///
4059 /// fn prepare_request_builder() -> ListDeploymentEvents {
4060 /// # panic!();
4061 /// // ... details omitted ...
4062 /// }
4063 /// ```
4064 #[derive(Clone, Debug)]
4065 pub struct ListDeploymentEvents(RequestBuilder<crate::model::ListDeploymentEventsRequest>);
4066
4067 impl ListDeploymentEvents {
4068 pub(crate) fn new(
4069 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
4070 ) -> Self {
4071 Self(RequestBuilder::new(stub))
4072 }
4073
4074 /// Sets the full request, replacing any prior values.
4075 pub fn with_request<V: Into<crate::model::ListDeploymentEventsRequest>>(
4076 mut self,
4077 v: V,
4078 ) -> Self {
4079 self.0.request = v.into();
4080 self
4081 }
4082
4083 /// Sets all the options, replacing any prior values.
4084 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4085 self.0.options = v.into();
4086 self
4087 }
4088
4089 /// Sends the request.
4090 pub async fn send(self) -> Result<crate::model::ListDeploymentEventsResponse> {
4091 (*self.0.stub)
4092 .list_deployment_events(self.0.request, self.0.options)
4093 .await
4094 .map(crate::Response::into_body)
4095 }
4096
4097 /// Streams each page in the collection.
4098 pub fn by_page(
4099 self,
4100 ) -> impl google_cloud_gax::paginator::Paginator<
4101 crate::model::ListDeploymentEventsResponse,
4102 crate::Error,
4103 > {
4104 use std::clone::Clone;
4105 let token = self.0.request.page_token.clone();
4106 let execute = move |token: String| {
4107 let mut builder = self.clone();
4108 builder.0.request = builder.0.request.set_page_token(token);
4109 builder.send()
4110 };
4111 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4112 }
4113
4114 /// Streams each item in the collection.
4115 pub fn by_item(
4116 self,
4117 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4118 crate::model::ListDeploymentEventsResponse,
4119 crate::Error,
4120 > {
4121 use google_cloud_gax::paginator::Paginator;
4122 self.by_page().items()
4123 }
4124
4125 /// Sets the value of [parent][crate::model::ListDeploymentEventsRequest::parent].
4126 ///
4127 /// This is a **required** field for requests.
4128 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4129 self.0.request.parent = v.into();
4130 self
4131 }
4132
4133 /// Sets the value of [page_size][crate::model::ListDeploymentEventsRequest::page_size].
4134 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4135 self.0.request.page_size = v.into();
4136 self
4137 }
4138
4139 /// Sets the value of [page_token][crate::model::ListDeploymentEventsRequest::page_token].
4140 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4141 self.0.request.page_token = v.into();
4142 self
4143 }
4144
4145 /// Sets the value of [filter][crate::model::ListDeploymentEventsRequest::filter].
4146 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4147 self.0.request.filter = v.into();
4148 self
4149 }
4150 }
4151
4152 #[doc(hidden)]
4153 impl crate::RequestBuilder for ListDeploymentEvents {
4154 fn request_options(&mut self) -> &mut crate::RequestOptions {
4155 &mut self.0.options
4156 }
4157 }
4158
4159 /// The request builder for [InsightsConfigService::list_locations][crate::client::InsightsConfigService::list_locations] calls.
4160 ///
4161 /// # Example
4162 /// ```
4163 /// # use google_cloud_developerconnect_v1::builder::insights_config_service::ListLocations;
4164 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
4165 /// use google_cloud_gax::paginator::ItemPaginator;
4166 ///
4167 /// let builder = prepare_request_builder();
4168 /// let mut items = builder.by_item();
4169 /// while let Some(result) = items.next().await {
4170 /// let item = result?;
4171 /// }
4172 /// # Ok(()) }
4173 ///
4174 /// fn prepare_request_builder() -> ListLocations {
4175 /// # panic!();
4176 /// // ... details omitted ...
4177 /// }
4178 /// ```
4179 #[derive(Clone, Debug)]
4180 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
4181
4182 impl ListLocations {
4183 pub(crate) fn new(
4184 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
4185 ) -> Self {
4186 Self(RequestBuilder::new(stub))
4187 }
4188
4189 /// Sets the full request, replacing any prior values.
4190 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
4191 mut self,
4192 v: V,
4193 ) -> Self {
4194 self.0.request = v.into();
4195 self
4196 }
4197
4198 /// Sets all the options, replacing any prior values.
4199 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4200 self.0.options = v.into();
4201 self
4202 }
4203
4204 /// Sends the request.
4205 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
4206 (*self.0.stub)
4207 .list_locations(self.0.request, self.0.options)
4208 .await
4209 .map(crate::Response::into_body)
4210 }
4211
4212 /// Streams each page in the collection.
4213 pub fn by_page(
4214 self,
4215 ) -> impl google_cloud_gax::paginator::Paginator<
4216 google_cloud_location::model::ListLocationsResponse,
4217 crate::Error,
4218 > {
4219 use std::clone::Clone;
4220 let token = self.0.request.page_token.clone();
4221 let execute = move |token: String| {
4222 let mut builder = self.clone();
4223 builder.0.request = builder.0.request.set_page_token(token);
4224 builder.send()
4225 };
4226 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4227 }
4228
4229 /// Streams each item in the collection.
4230 pub fn by_item(
4231 self,
4232 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4233 google_cloud_location::model::ListLocationsResponse,
4234 crate::Error,
4235 > {
4236 use google_cloud_gax::paginator::Paginator;
4237 self.by_page().items()
4238 }
4239
4240 /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
4241 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4242 self.0.request.name = v.into();
4243 self
4244 }
4245
4246 /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
4247 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4248 self.0.request.filter = v.into();
4249 self
4250 }
4251
4252 /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
4253 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4254 self.0.request.page_size = v.into();
4255 self
4256 }
4257
4258 /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
4259 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4260 self.0.request.page_token = v.into();
4261 self
4262 }
4263 }
4264
4265 #[doc(hidden)]
4266 impl crate::RequestBuilder for ListLocations {
4267 fn request_options(&mut self) -> &mut crate::RequestOptions {
4268 &mut self.0.options
4269 }
4270 }
4271
4272 /// The request builder for [InsightsConfigService::get_location][crate::client::InsightsConfigService::get_location] calls.
4273 ///
4274 /// # Example
4275 /// ```
4276 /// # use google_cloud_developerconnect_v1::builder::insights_config_service::GetLocation;
4277 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
4278 ///
4279 /// let builder = prepare_request_builder();
4280 /// let response = builder.send().await?;
4281 /// # Ok(()) }
4282 ///
4283 /// fn prepare_request_builder() -> GetLocation {
4284 /// # panic!();
4285 /// // ... details omitted ...
4286 /// }
4287 /// ```
4288 #[derive(Clone, Debug)]
4289 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
4290
4291 impl GetLocation {
4292 pub(crate) fn new(
4293 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
4294 ) -> Self {
4295 Self(RequestBuilder::new(stub))
4296 }
4297
4298 /// Sets the full request, replacing any prior values.
4299 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
4300 mut self,
4301 v: V,
4302 ) -> Self {
4303 self.0.request = v.into();
4304 self
4305 }
4306
4307 /// Sets all the options, replacing any prior values.
4308 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4309 self.0.options = v.into();
4310 self
4311 }
4312
4313 /// Sends the request.
4314 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
4315 (*self.0.stub)
4316 .get_location(self.0.request, self.0.options)
4317 .await
4318 .map(crate::Response::into_body)
4319 }
4320
4321 /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
4322 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4323 self.0.request.name = v.into();
4324 self
4325 }
4326 }
4327
4328 #[doc(hidden)]
4329 impl crate::RequestBuilder for GetLocation {
4330 fn request_options(&mut self) -> &mut crate::RequestOptions {
4331 &mut self.0.options
4332 }
4333 }
4334
4335 /// The request builder for [InsightsConfigService::list_operations][crate::client::InsightsConfigService::list_operations] calls.
4336 ///
4337 /// # Example
4338 /// ```
4339 /// # use google_cloud_developerconnect_v1::builder::insights_config_service::ListOperations;
4340 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
4341 /// use google_cloud_gax::paginator::ItemPaginator;
4342 ///
4343 /// let builder = prepare_request_builder();
4344 /// let mut items = builder.by_item();
4345 /// while let Some(result) = items.next().await {
4346 /// let item = result?;
4347 /// }
4348 /// # Ok(()) }
4349 ///
4350 /// fn prepare_request_builder() -> ListOperations {
4351 /// # panic!();
4352 /// // ... details omitted ...
4353 /// }
4354 /// ```
4355 #[derive(Clone, Debug)]
4356 pub struct ListOperations(
4357 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4358 );
4359
4360 impl ListOperations {
4361 pub(crate) fn new(
4362 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
4363 ) -> Self {
4364 Self(RequestBuilder::new(stub))
4365 }
4366
4367 /// Sets the full request, replacing any prior values.
4368 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4369 mut self,
4370 v: V,
4371 ) -> Self {
4372 self.0.request = v.into();
4373 self
4374 }
4375
4376 /// Sets all the options, replacing any prior values.
4377 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4378 self.0.options = v.into();
4379 self
4380 }
4381
4382 /// Sends the request.
4383 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
4384 (*self.0.stub)
4385 .list_operations(self.0.request, self.0.options)
4386 .await
4387 .map(crate::Response::into_body)
4388 }
4389
4390 /// Streams each page in the collection.
4391 pub fn by_page(
4392 self,
4393 ) -> impl google_cloud_gax::paginator::Paginator<
4394 google_cloud_longrunning::model::ListOperationsResponse,
4395 crate::Error,
4396 > {
4397 use std::clone::Clone;
4398 let token = self.0.request.page_token.clone();
4399 let execute = move |token: String| {
4400 let mut builder = self.clone();
4401 builder.0.request = builder.0.request.set_page_token(token);
4402 builder.send()
4403 };
4404 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4405 }
4406
4407 /// Streams each item in the collection.
4408 pub fn by_item(
4409 self,
4410 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4411 google_cloud_longrunning::model::ListOperationsResponse,
4412 crate::Error,
4413 > {
4414 use google_cloud_gax::paginator::Paginator;
4415 self.by_page().items()
4416 }
4417
4418 /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
4419 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4420 self.0.request.name = v.into();
4421 self
4422 }
4423
4424 /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
4425 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4426 self.0.request.filter = v.into();
4427 self
4428 }
4429
4430 /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
4431 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4432 self.0.request.page_size = v.into();
4433 self
4434 }
4435
4436 /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
4437 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4438 self.0.request.page_token = v.into();
4439 self
4440 }
4441
4442 /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
4443 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4444 self.0.request.return_partial_success = v.into();
4445 self
4446 }
4447 }
4448
4449 #[doc(hidden)]
4450 impl crate::RequestBuilder for ListOperations {
4451 fn request_options(&mut self) -> &mut crate::RequestOptions {
4452 &mut self.0.options
4453 }
4454 }
4455
4456 /// The request builder for [InsightsConfigService::get_operation][crate::client::InsightsConfigService::get_operation] calls.
4457 ///
4458 /// # Example
4459 /// ```
4460 /// # use google_cloud_developerconnect_v1::builder::insights_config_service::GetOperation;
4461 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
4462 ///
4463 /// let builder = prepare_request_builder();
4464 /// let response = builder.send().await?;
4465 /// # Ok(()) }
4466 ///
4467 /// fn prepare_request_builder() -> GetOperation {
4468 /// # panic!();
4469 /// // ... details omitted ...
4470 /// }
4471 /// ```
4472 #[derive(Clone, Debug)]
4473 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4474
4475 impl GetOperation {
4476 pub(crate) fn new(
4477 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
4478 ) -> Self {
4479 Self(RequestBuilder::new(stub))
4480 }
4481
4482 /// Sets the full request, replacing any prior values.
4483 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4484 mut self,
4485 v: V,
4486 ) -> Self {
4487 self.0.request = v.into();
4488 self
4489 }
4490
4491 /// Sets all the options, replacing any prior values.
4492 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4493 self.0.options = v.into();
4494 self
4495 }
4496
4497 /// Sends the request.
4498 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4499 (*self.0.stub)
4500 .get_operation(self.0.request, self.0.options)
4501 .await
4502 .map(crate::Response::into_body)
4503 }
4504
4505 /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
4506 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4507 self.0.request.name = v.into();
4508 self
4509 }
4510 }
4511
4512 #[doc(hidden)]
4513 impl crate::RequestBuilder for GetOperation {
4514 fn request_options(&mut self) -> &mut crate::RequestOptions {
4515 &mut self.0.options
4516 }
4517 }
4518
4519 /// The request builder for [InsightsConfigService::delete_operation][crate::client::InsightsConfigService::delete_operation] calls.
4520 ///
4521 /// # Example
4522 /// ```
4523 /// # use google_cloud_developerconnect_v1::builder::insights_config_service::DeleteOperation;
4524 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
4525 ///
4526 /// let builder = prepare_request_builder();
4527 /// let response = builder.send().await?;
4528 /// # Ok(()) }
4529 ///
4530 /// fn prepare_request_builder() -> DeleteOperation {
4531 /// # panic!();
4532 /// // ... details omitted ...
4533 /// }
4534 /// ```
4535 #[derive(Clone, Debug)]
4536 pub struct DeleteOperation(
4537 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
4538 );
4539
4540 impl DeleteOperation {
4541 pub(crate) fn new(
4542 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
4543 ) -> Self {
4544 Self(RequestBuilder::new(stub))
4545 }
4546
4547 /// Sets the full request, replacing any prior values.
4548 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
4549 mut self,
4550 v: V,
4551 ) -> Self {
4552 self.0.request = v.into();
4553 self
4554 }
4555
4556 /// Sets all the options, replacing any prior values.
4557 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4558 self.0.options = v.into();
4559 self
4560 }
4561
4562 /// Sends the request.
4563 pub async fn send(self) -> Result<()> {
4564 (*self.0.stub)
4565 .delete_operation(self.0.request, self.0.options)
4566 .await
4567 .map(crate::Response::into_body)
4568 }
4569
4570 /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
4571 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4572 self.0.request.name = v.into();
4573 self
4574 }
4575 }
4576
4577 #[doc(hidden)]
4578 impl crate::RequestBuilder for DeleteOperation {
4579 fn request_options(&mut self) -> &mut crate::RequestOptions {
4580 &mut self.0.options
4581 }
4582 }
4583
4584 /// The request builder for [InsightsConfigService::cancel_operation][crate::client::InsightsConfigService::cancel_operation] calls.
4585 ///
4586 /// # Example
4587 /// ```
4588 /// # use google_cloud_developerconnect_v1::builder::insights_config_service::CancelOperation;
4589 /// # async fn sample() -> google_cloud_developerconnect_v1::Result<()> {
4590 ///
4591 /// let builder = prepare_request_builder();
4592 /// let response = builder.send().await?;
4593 /// # Ok(()) }
4594 ///
4595 /// fn prepare_request_builder() -> CancelOperation {
4596 /// # panic!();
4597 /// // ... details omitted ...
4598 /// }
4599 /// ```
4600 #[derive(Clone, Debug)]
4601 pub struct CancelOperation(
4602 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
4603 );
4604
4605 impl CancelOperation {
4606 pub(crate) fn new(
4607 stub: std::sync::Arc<dyn super::super::stub::dynamic::InsightsConfigService>,
4608 ) -> Self {
4609 Self(RequestBuilder::new(stub))
4610 }
4611
4612 /// Sets the full request, replacing any prior values.
4613 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
4614 mut self,
4615 v: V,
4616 ) -> Self {
4617 self.0.request = v.into();
4618 self
4619 }
4620
4621 /// Sets all the options, replacing any prior values.
4622 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4623 self.0.options = v.into();
4624 self
4625 }
4626
4627 /// Sends the request.
4628 pub async fn send(self) -> Result<()> {
4629 (*self.0.stub)
4630 .cancel_operation(self.0.request, self.0.options)
4631 .await
4632 .map(crate::Response::into_body)
4633 }
4634
4635 /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
4636 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4637 self.0.request.name = v.into();
4638 self
4639 }
4640 }
4641
4642 #[doc(hidden)]
4643 impl crate::RequestBuilder for CancelOperation {
4644 fn request_options(&mut self) -> &mut crate::RequestOptions {
4645 &mut self.0.options
4646 }
4647 }
4648}