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
17pub mod developer_connect {
18 use crate::Result;
19
20 /// A builder for [DeveloperConnect][crate::client::DeveloperConnect].
21 ///
22 /// ```
23 /// # tokio_test::block_on(async {
24 /// # use google_cloud_developerconnect_v1::*;
25 /// # use builder::developer_connect::ClientBuilder;
26 /// # use client::DeveloperConnect;
27 /// let builder : ClientBuilder = DeveloperConnect::builder();
28 /// let client = builder
29 /// .with_endpoint("https://developerconnect.googleapis.com")
30 /// .build().await?;
31 /// # gax::client_builder::Result::<()>::Ok(()) });
32 /// ```
33 pub type ClientBuilder =
34 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::DeveloperConnect;
38 pub struct Factory;
39 impl gax::client_builder::internal::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 ) -> gax::client_builder::Result<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: gax::options::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: gax::options::RequestOptions::default(),
70 }
71 }
72 }
73
74 /// The request builder for [DeveloperConnect::list_connections][crate::client::DeveloperConnect::list_connections] calls.
75 ///
76 /// # Example
77 /// ```no_run
78 /// # use google_cloud_developerconnect_v1::builder;
79 /// use builder::developer_connect::ListConnections;
80 /// # tokio_test::block_on(async {
81 /// use gax::paginator::ItemPaginator;
82 ///
83 /// let builder = prepare_request_builder();
84 /// let mut items = builder.by_item();
85 /// while let Some(result) = items.next().await {
86 /// let item = result?;
87 /// }
88 /// # gax::Result::<()>::Ok(()) });
89 ///
90 /// fn prepare_request_builder() -> ListConnections {
91 /// # panic!();
92 /// // ... details omitted ...
93 /// }
94 /// ```
95 #[derive(Clone, Debug)]
96 pub struct ListConnections(RequestBuilder<crate::model::ListConnectionsRequest>);
97
98 impl ListConnections {
99 pub(crate) fn new(
100 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
101 ) -> Self {
102 Self(RequestBuilder::new(stub))
103 }
104
105 /// Sets the full request, replacing any prior values.
106 pub fn with_request<V: Into<crate::model::ListConnectionsRequest>>(mut self, v: V) -> Self {
107 self.0.request = v.into();
108 self
109 }
110
111 /// Sets all the options, replacing any prior values.
112 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
113 self.0.options = v.into();
114 self
115 }
116
117 /// Sends the request.
118 pub async fn send(self) -> Result<crate::model::ListConnectionsResponse> {
119 (*self.0.stub)
120 .list_connections(self.0.request, self.0.options)
121 .await
122 .map(gax::response::Response::into_body)
123 }
124
125 /// Streams each page in the collection.
126 pub fn by_page(
127 self,
128 ) -> impl gax::paginator::Paginator<crate::model::ListConnectionsResponse, gax::error::Error>
129 {
130 use std::clone::Clone;
131 let token = self.0.request.page_token.clone();
132 let execute = move |token: String| {
133 let mut builder = self.clone();
134 builder.0.request = builder.0.request.set_page_token(token);
135 builder.send()
136 };
137 gax::paginator::internal::new_paginator(token, execute)
138 }
139
140 /// Streams each item in the collection.
141 pub fn by_item(
142 self,
143 ) -> impl gax::paginator::ItemPaginator<crate::model::ListConnectionsResponse, gax::error::Error>
144 {
145 use gax::paginator::Paginator;
146 self.by_page().items()
147 }
148
149 /// Sets the value of [parent][crate::model::ListConnectionsRequest::parent].
150 ///
151 /// This is a **required** field for requests.
152 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
153 self.0.request.parent = v.into();
154 self
155 }
156
157 /// Sets the value of [page_size][crate::model::ListConnectionsRequest::page_size].
158 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
159 self.0.request.page_size = v.into();
160 self
161 }
162
163 /// Sets the value of [page_token][crate::model::ListConnectionsRequest::page_token].
164 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
165 self.0.request.page_token = v.into();
166 self
167 }
168
169 /// Sets the value of [filter][crate::model::ListConnectionsRequest::filter].
170 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
171 self.0.request.filter = v.into();
172 self
173 }
174
175 /// Sets the value of [order_by][crate::model::ListConnectionsRequest::order_by].
176 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
177 self.0.request.order_by = v.into();
178 self
179 }
180 }
181
182 #[doc(hidden)]
183 impl gax::options::internal::RequestBuilder for ListConnections {
184 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
185 &mut self.0.options
186 }
187 }
188
189 /// The request builder for [DeveloperConnect::get_connection][crate::client::DeveloperConnect::get_connection] calls.
190 ///
191 /// # Example
192 /// ```no_run
193 /// # use google_cloud_developerconnect_v1::builder;
194 /// use builder::developer_connect::GetConnection;
195 /// # tokio_test::block_on(async {
196 ///
197 /// let builder = prepare_request_builder();
198 /// let response = builder.send().await?;
199 /// # gax::Result::<()>::Ok(()) });
200 ///
201 /// fn prepare_request_builder() -> GetConnection {
202 /// # panic!();
203 /// // ... details omitted ...
204 /// }
205 /// ```
206 #[derive(Clone, Debug)]
207 pub struct GetConnection(RequestBuilder<crate::model::GetConnectionRequest>);
208
209 impl GetConnection {
210 pub(crate) fn new(
211 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
212 ) -> Self {
213 Self(RequestBuilder::new(stub))
214 }
215
216 /// Sets the full request, replacing any prior values.
217 pub fn with_request<V: Into<crate::model::GetConnectionRequest>>(mut self, v: V) -> Self {
218 self.0.request = v.into();
219 self
220 }
221
222 /// Sets all the options, replacing any prior values.
223 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
224 self.0.options = v.into();
225 self
226 }
227
228 /// Sends the request.
229 pub async fn send(self) -> Result<crate::model::Connection> {
230 (*self.0.stub)
231 .get_connection(self.0.request, self.0.options)
232 .await
233 .map(gax::response::Response::into_body)
234 }
235
236 /// Sets the value of [name][crate::model::GetConnectionRequest::name].
237 ///
238 /// This is a **required** field for requests.
239 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
240 self.0.request.name = v.into();
241 self
242 }
243 }
244
245 #[doc(hidden)]
246 impl gax::options::internal::RequestBuilder for GetConnection {
247 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
248 &mut self.0.options
249 }
250 }
251
252 /// The request builder for [DeveloperConnect::create_connection][crate::client::DeveloperConnect::create_connection] calls.
253 ///
254 /// # Example
255 /// ```no_run
256 /// # use google_cloud_developerconnect_v1::builder;
257 /// use builder::developer_connect::CreateConnection;
258 /// # tokio_test::block_on(async {
259 /// use lro::Poller;
260 ///
261 /// let builder = prepare_request_builder();
262 /// let response = builder.poller().until_done().await?;
263 /// # gax::Result::<()>::Ok(()) });
264 ///
265 /// fn prepare_request_builder() -> CreateConnection {
266 /// # panic!();
267 /// // ... details omitted ...
268 /// }
269 /// ```
270 #[derive(Clone, Debug)]
271 pub struct CreateConnection(RequestBuilder<crate::model::CreateConnectionRequest>);
272
273 impl CreateConnection {
274 pub(crate) fn new(
275 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
276 ) -> Self {
277 Self(RequestBuilder::new(stub))
278 }
279
280 /// Sets the full request, replacing any prior values.
281 pub fn with_request<V: Into<crate::model::CreateConnectionRequest>>(
282 mut self,
283 v: V,
284 ) -> Self {
285 self.0.request = v.into();
286 self
287 }
288
289 /// Sets all the options, replacing any prior values.
290 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
291 self.0.options = v.into();
292 self
293 }
294
295 /// Sends the request.
296 ///
297 /// # Long running operations
298 ///
299 /// This starts, but does not poll, a longrunning operation. More information
300 /// on [create_connection][crate::client::DeveloperConnect::create_connection].
301 pub async fn send(self) -> Result<longrunning::model::Operation> {
302 (*self.0.stub)
303 .create_connection(self.0.request, self.0.options)
304 .await
305 .map(gax::response::Response::into_body)
306 }
307
308 /// Creates a [Poller][lro::Poller] to work with `create_connection`.
309 pub fn poller(
310 self,
311 ) -> impl lro::Poller<crate::model::Connection, crate::model::OperationMetadata> {
312 type Operation =
313 lro::internal::Operation<crate::model::Connection, crate::model::OperationMetadata>;
314 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
315 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
316
317 let stub = self.0.stub.clone();
318 let mut options = self.0.options.clone();
319 options.set_retry_policy(gax::retry_policy::NeverRetry);
320 let query = move |name| {
321 let stub = stub.clone();
322 let options = options.clone();
323 async {
324 let op = GetOperation::new(stub)
325 .set_name(name)
326 .with_options(options)
327 .send()
328 .await?;
329 Ok(Operation::new(op))
330 }
331 };
332
333 let start = move || async {
334 let op = self.send().await?;
335 Ok(Operation::new(op))
336 };
337
338 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
339 }
340
341 /// Sets the value of [parent][crate::model::CreateConnectionRequest::parent].
342 ///
343 /// This is a **required** field for requests.
344 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
345 self.0.request.parent = v.into();
346 self
347 }
348
349 /// Sets the value of [connection_id][crate::model::CreateConnectionRequest::connection_id].
350 ///
351 /// This is a **required** field for requests.
352 pub fn set_connection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
353 self.0.request.connection_id = v.into();
354 self
355 }
356
357 /// Sets the value of [connection][crate::model::CreateConnectionRequest::connection].
358 ///
359 /// This is a **required** field for requests.
360 pub fn set_connection<T>(mut self, v: T) -> Self
361 where
362 T: std::convert::Into<crate::model::Connection>,
363 {
364 self.0.request.connection = std::option::Option::Some(v.into());
365 self
366 }
367
368 /// Sets or clears the value of [connection][crate::model::CreateConnectionRequest::connection].
369 ///
370 /// This is a **required** field for requests.
371 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
372 where
373 T: std::convert::Into<crate::model::Connection>,
374 {
375 self.0.request.connection = v.map(|x| x.into());
376 self
377 }
378
379 /// Sets the value of [request_id][crate::model::CreateConnectionRequest::request_id].
380 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
381 self.0.request.request_id = v.into();
382 self
383 }
384
385 /// Sets the value of [validate_only][crate::model::CreateConnectionRequest::validate_only].
386 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
387 self.0.request.validate_only = v.into();
388 self
389 }
390 }
391
392 #[doc(hidden)]
393 impl gax::options::internal::RequestBuilder for CreateConnection {
394 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
395 &mut self.0.options
396 }
397 }
398
399 /// The request builder for [DeveloperConnect::update_connection][crate::client::DeveloperConnect::update_connection] calls.
400 ///
401 /// # Example
402 /// ```no_run
403 /// # use google_cloud_developerconnect_v1::builder;
404 /// use builder::developer_connect::UpdateConnection;
405 /// # tokio_test::block_on(async {
406 /// use lro::Poller;
407 ///
408 /// let builder = prepare_request_builder();
409 /// let response = builder.poller().until_done().await?;
410 /// # gax::Result::<()>::Ok(()) });
411 ///
412 /// fn prepare_request_builder() -> UpdateConnection {
413 /// # panic!();
414 /// // ... details omitted ...
415 /// }
416 /// ```
417 #[derive(Clone, Debug)]
418 pub struct UpdateConnection(RequestBuilder<crate::model::UpdateConnectionRequest>);
419
420 impl UpdateConnection {
421 pub(crate) fn new(
422 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
423 ) -> Self {
424 Self(RequestBuilder::new(stub))
425 }
426
427 /// Sets the full request, replacing any prior values.
428 pub fn with_request<V: Into<crate::model::UpdateConnectionRequest>>(
429 mut self,
430 v: V,
431 ) -> Self {
432 self.0.request = v.into();
433 self
434 }
435
436 /// Sets all the options, replacing any prior values.
437 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
438 self.0.options = v.into();
439 self
440 }
441
442 /// Sends the request.
443 ///
444 /// # Long running operations
445 ///
446 /// This starts, but does not poll, a longrunning operation. More information
447 /// on [update_connection][crate::client::DeveloperConnect::update_connection].
448 pub async fn send(self) -> Result<longrunning::model::Operation> {
449 (*self.0.stub)
450 .update_connection(self.0.request, self.0.options)
451 .await
452 .map(gax::response::Response::into_body)
453 }
454
455 /// Creates a [Poller][lro::Poller] to work with `update_connection`.
456 pub fn poller(
457 self,
458 ) -> impl lro::Poller<crate::model::Connection, crate::model::OperationMetadata> {
459 type Operation =
460 lro::internal::Operation<crate::model::Connection, crate::model::OperationMetadata>;
461 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
462 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
463
464 let stub = self.0.stub.clone();
465 let mut options = self.0.options.clone();
466 options.set_retry_policy(gax::retry_policy::NeverRetry);
467 let query = move |name| {
468 let stub = stub.clone();
469 let options = options.clone();
470 async {
471 let op = GetOperation::new(stub)
472 .set_name(name)
473 .with_options(options)
474 .send()
475 .await?;
476 Ok(Operation::new(op))
477 }
478 };
479
480 let start = move || async {
481 let op = self.send().await?;
482 Ok(Operation::new(op))
483 };
484
485 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
486 }
487
488 /// Sets the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
489 ///
490 /// This is a **required** field for requests.
491 pub fn set_update_mask<T>(mut self, v: T) -> Self
492 where
493 T: std::convert::Into<wkt::FieldMask>,
494 {
495 self.0.request.update_mask = std::option::Option::Some(v.into());
496 self
497 }
498
499 /// Sets or clears the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
500 ///
501 /// This is a **required** field for requests.
502 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
503 where
504 T: std::convert::Into<wkt::FieldMask>,
505 {
506 self.0.request.update_mask = v.map(|x| x.into());
507 self
508 }
509
510 /// Sets the value of [connection][crate::model::UpdateConnectionRequest::connection].
511 ///
512 /// This is a **required** field for requests.
513 pub fn set_connection<T>(mut self, v: T) -> Self
514 where
515 T: std::convert::Into<crate::model::Connection>,
516 {
517 self.0.request.connection = std::option::Option::Some(v.into());
518 self
519 }
520
521 /// Sets or clears the value of [connection][crate::model::UpdateConnectionRequest::connection].
522 ///
523 /// This is a **required** field for requests.
524 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
525 where
526 T: std::convert::Into<crate::model::Connection>,
527 {
528 self.0.request.connection = v.map(|x| x.into());
529 self
530 }
531
532 /// Sets the value of [request_id][crate::model::UpdateConnectionRequest::request_id].
533 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
534 self.0.request.request_id = v.into();
535 self
536 }
537
538 /// Sets the value of [allow_missing][crate::model::UpdateConnectionRequest::allow_missing].
539 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
540 self.0.request.allow_missing = v.into();
541 self
542 }
543
544 /// Sets the value of [validate_only][crate::model::UpdateConnectionRequest::validate_only].
545 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
546 self.0.request.validate_only = v.into();
547 self
548 }
549 }
550
551 #[doc(hidden)]
552 impl gax::options::internal::RequestBuilder for UpdateConnection {
553 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
554 &mut self.0.options
555 }
556 }
557
558 /// The request builder for [DeveloperConnect::delete_connection][crate::client::DeveloperConnect::delete_connection] calls.
559 ///
560 /// # Example
561 /// ```no_run
562 /// # use google_cloud_developerconnect_v1::builder;
563 /// use builder::developer_connect::DeleteConnection;
564 /// # tokio_test::block_on(async {
565 /// use lro::Poller;
566 ///
567 /// let builder = prepare_request_builder();
568 /// let response = builder.poller().until_done().await?;
569 /// # gax::Result::<()>::Ok(()) });
570 ///
571 /// fn prepare_request_builder() -> DeleteConnection {
572 /// # panic!();
573 /// // ... details omitted ...
574 /// }
575 /// ```
576 #[derive(Clone, Debug)]
577 pub struct DeleteConnection(RequestBuilder<crate::model::DeleteConnectionRequest>);
578
579 impl DeleteConnection {
580 pub(crate) fn new(
581 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
582 ) -> Self {
583 Self(RequestBuilder::new(stub))
584 }
585
586 /// Sets the full request, replacing any prior values.
587 pub fn with_request<V: Into<crate::model::DeleteConnectionRequest>>(
588 mut self,
589 v: V,
590 ) -> Self {
591 self.0.request = v.into();
592 self
593 }
594
595 /// Sets all the options, replacing any prior values.
596 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
597 self.0.options = v.into();
598 self
599 }
600
601 /// Sends the request.
602 ///
603 /// # Long running operations
604 ///
605 /// This starts, but does not poll, a longrunning operation. More information
606 /// on [delete_connection][crate::client::DeveloperConnect::delete_connection].
607 pub async fn send(self) -> Result<longrunning::model::Operation> {
608 (*self.0.stub)
609 .delete_connection(self.0.request, self.0.options)
610 .await
611 .map(gax::response::Response::into_body)
612 }
613
614 /// Creates a [Poller][lro::Poller] to work with `delete_connection`.
615 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
616 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
617 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
618 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
619
620 let stub = self.0.stub.clone();
621 let mut options = self.0.options.clone();
622 options.set_retry_policy(gax::retry_policy::NeverRetry);
623 let query = move |name| {
624 let stub = stub.clone();
625 let options = options.clone();
626 async {
627 let op = GetOperation::new(stub)
628 .set_name(name)
629 .with_options(options)
630 .send()
631 .await?;
632 Ok(Operation::new(op))
633 }
634 };
635
636 let start = move || async {
637 let op = self.send().await?;
638 Ok(Operation::new(op))
639 };
640
641 lro::internal::new_unit_response_poller(
642 polling_error_policy,
643 polling_backoff_policy,
644 start,
645 query,
646 )
647 }
648
649 /// Sets the value of [name][crate::model::DeleteConnectionRequest::name].
650 ///
651 /// This is a **required** field for requests.
652 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
653 self.0.request.name = v.into();
654 self
655 }
656
657 /// Sets the value of [request_id][crate::model::DeleteConnectionRequest::request_id].
658 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
659 self.0.request.request_id = v.into();
660 self
661 }
662
663 /// Sets the value of [validate_only][crate::model::DeleteConnectionRequest::validate_only].
664 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
665 self.0.request.validate_only = v.into();
666 self
667 }
668
669 /// Sets the value of [etag][crate::model::DeleteConnectionRequest::etag].
670 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
671 self.0.request.etag = v.into();
672 self
673 }
674 }
675
676 #[doc(hidden)]
677 impl gax::options::internal::RequestBuilder for DeleteConnection {
678 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
679 &mut self.0.options
680 }
681 }
682
683 /// The request builder for [DeveloperConnect::create_git_repository_link][crate::client::DeveloperConnect::create_git_repository_link] calls.
684 ///
685 /// # Example
686 /// ```no_run
687 /// # use google_cloud_developerconnect_v1::builder;
688 /// use builder::developer_connect::CreateGitRepositoryLink;
689 /// # tokio_test::block_on(async {
690 /// use lro::Poller;
691 ///
692 /// let builder = prepare_request_builder();
693 /// let response = builder.poller().until_done().await?;
694 /// # gax::Result::<()>::Ok(()) });
695 ///
696 /// fn prepare_request_builder() -> CreateGitRepositoryLink {
697 /// # panic!();
698 /// // ... details omitted ...
699 /// }
700 /// ```
701 #[derive(Clone, Debug)]
702 pub struct CreateGitRepositoryLink(
703 RequestBuilder<crate::model::CreateGitRepositoryLinkRequest>,
704 );
705
706 impl CreateGitRepositoryLink {
707 pub(crate) fn new(
708 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
709 ) -> Self {
710 Self(RequestBuilder::new(stub))
711 }
712
713 /// Sets the full request, replacing any prior values.
714 pub fn with_request<V: Into<crate::model::CreateGitRepositoryLinkRequest>>(
715 mut self,
716 v: V,
717 ) -> Self {
718 self.0.request = v.into();
719 self
720 }
721
722 /// Sets all the options, replacing any prior values.
723 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
724 self.0.options = v.into();
725 self
726 }
727
728 /// Sends the request.
729 ///
730 /// # Long running operations
731 ///
732 /// This starts, but does not poll, a longrunning operation. More information
733 /// on [create_git_repository_link][crate::client::DeveloperConnect::create_git_repository_link].
734 pub async fn send(self) -> Result<longrunning::model::Operation> {
735 (*self.0.stub)
736 .create_git_repository_link(self.0.request, self.0.options)
737 .await
738 .map(gax::response::Response::into_body)
739 }
740
741 /// Creates a [Poller][lro::Poller] to work with `create_git_repository_link`.
742 pub fn poller(
743 self,
744 ) -> impl lro::Poller<crate::model::GitRepositoryLink, crate::model::OperationMetadata>
745 {
746 type Operation = lro::internal::Operation<
747 crate::model::GitRepositoryLink,
748 crate::model::OperationMetadata,
749 >;
750 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
751 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
752
753 let stub = self.0.stub.clone();
754 let mut options = self.0.options.clone();
755 options.set_retry_policy(gax::retry_policy::NeverRetry);
756 let query = move |name| {
757 let stub = stub.clone();
758 let options = options.clone();
759 async {
760 let op = GetOperation::new(stub)
761 .set_name(name)
762 .with_options(options)
763 .send()
764 .await?;
765 Ok(Operation::new(op))
766 }
767 };
768
769 let start = move || async {
770 let op = self.send().await?;
771 Ok(Operation::new(op))
772 };
773
774 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
775 }
776
777 /// Sets the value of [parent][crate::model::CreateGitRepositoryLinkRequest::parent].
778 ///
779 /// This is a **required** field for requests.
780 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
781 self.0.request.parent = v.into();
782 self
783 }
784
785 /// Sets the value of [git_repository_link][crate::model::CreateGitRepositoryLinkRequest::git_repository_link].
786 ///
787 /// This is a **required** field for requests.
788 pub fn set_git_repository_link<T>(mut self, v: T) -> Self
789 where
790 T: std::convert::Into<crate::model::GitRepositoryLink>,
791 {
792 self.0.request.git_repository_link = std::option::Option::Some(v.into());
793 self
794 }
795
796 /// Sets or clears the value of [git_repository_link][crate::model::CreateGitRepositoryLinkRequest::git_repository_link].
797 ///
798 /// This is a **required** field for requests.
799 pub fn set_or_clear_git_repository_link<T>(mut self, v: std::option::Option<T>) -> Self
800 where
801 T: std::convert::Into<crate::model::GitRepositoryLink>,
802 {
803 self.0.request.git_repository_link = v.map(|x| x.into());
804 self
805 }
806
807 /// Sets the value of [git_repository_link_id][crate::model::CreateGitRepositoryLinkRequest::git_repository_link_id].
808 ///
809 /// This is a **required** field for requests.
810 pub fn set_git_repository_link_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
811 self.0.request.git_repository_link_id = v.into();
812 self
813 }
814
815 /// Sets the value of [request_id][crate::model::CreateGitRepositoryLinkRequest::request_id].
816 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
817 self.0.request.request_id = v.into();
818 self
819 }
820
821 /// Sets the value of [validate_only][crate::model::CreateGitRepositoryLinkRequest::validate_only].
822 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
823 self.0.request.validate_only = v.into();
824 self
825 }
826 }
827
828 #[doc(hidden)]
829 impl gax::options::internal::RequestBuilder for CreateGitRepositoryLink {
830 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
831 &mut self.0.options
832 }
833 }
834
835 /// The request builder for [DeveloperConnect::delete_git_repository_link][crate::client::DeveloperConnect::delete_git_repository_link] calls.
836 ///
837 /// # Example
838 /// ```no_run
839 /// # use google_cloud_developerconnect_v1::builder;
840 /// use builder::developer_connect::DeleteGitRepositoryLink;
841 /// # tokio_test::block_on(async {
842 /// use lro::Poller;
843 ///
844 /// let builder = prepare_request_builder();
845 /// let response = builder.poller().until_done().await?;
846 /// # gax::Result::<()>::Ok(()) });
847 ///
848 /// fn prepare_request_builder() -> DeleteGitRepositoryLink {
849 /// # panic!();
850 /// // ... details omitted ...
851 /// }
852 /// ```
853 #[derive(Clone, Debug)]
854 pub struct DeleteGitRepositoryLink(
855 RequestBuilder<crate::model::DeleteGitRepositoryLinkRequest>,
856 );
857
858 impl DeleteGitRepositoryLink {
859 pub(crate) fn new(
860 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
861 ) -> Self {
862 Self(RequestBuilder::new(stub))
863 }
864
865 /// Sets the full request, replacing any prior values.
866 pub fn with_request<V: Into<crate::model::DeleteGitRepositoryLinkRequest>>(
867 mut self,
868 v: V,
869 ) -> Self {
870 self.0.request = v.into();
871 self
872 }
873
874 /// Sets all the options, replacing any prior values.
875 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
876 self.0.options = v.into();
877 self
878 }
879
880 /// Sends the request.
881 ///
882 /// # Long running operations
883 ///
884 /// This starts, but does not poll, a longrunning operation. More information
885 /// on [delete_git_repository_link][crate::client::DeveloperConnect::delete_git_repository_link].
886 pub async fn send(self) -> Result<longrunning::model::Operation> {
887 (*self.0.stub)
888 .delete_git_repository_link(self.0.request, self.0.options)
889 .await
890 .map(gax::response::Response::into_body)
891 }
892
893 /// Creates a [Poller][lro::Poller] to work with `delete_git_repository_link`.
894 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
895 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
896 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
897 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
898
899 let stub = self.0.stub.clone();
900 let mut options = self.0.options.clone();
901 options.set_retry_policy(gax::retry_policy::NeverRetry);
902 let query = move |name| {
903 let stub = stub.clone();
904 let options = options.clone();
905 async {
906 let op = GetOperation::new(stub)
907 .set_name(name)
908 .with_options(options)
909 .send()
910 .await?;
911 Ok(Operation::new(op))
912 }
913 };
914
915 let start = move || async {
916 let op = self.send().await?;
917 Ok(Operation::new(op))
918 };
919
920 lro::internal::new_unit_response_poller(
921 polling_error_policy,
922 polling_backoff_policy,
923 start,
924 query,
925 )
926 }
927
928 /// Sets the value of [name][crate::model::DeleteGitRepositoryLinkRequest::name].
929 ///
930 /// This is a **required** field for requests.
931 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
932 self.0.request.name = v.into();
933 self
934 }
935
936 /// Sets the value of [request_id][crate::model::DeleteGitRepositoryLinkRequest::request_id].
937 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
938 self.0.request.request_id = v.into();
939 self
940 }
941
942 /// Sets the value of [validate_only][crate::model::DeleteGitRepositoryLinkRequest::validate_only].
943 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
944 self.0.request.validate_only = v.into();
945 self
946 }
947
948 /// Sets the value of [etag][crate::model::DeleteGitRepositoryLinkRequest::etag].
949 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
950 self.0.request.etag = v.into();
951 self
952 }
953 }
954
955 #[doc(hidden)]
956 impl gax::options::internal::RequestBuilder for DeleteGitRepositoryLink {
957 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
958 &mut self.0.options
959 }
960 }
961
962 /// The request builder for [DeveloperConnect::list_git_repository_links][crate::client::DeveloperConnect::list_git_repository_links] calls.
963 ///
964 /// # Example
965 /// ```no_run
966 /// # use google_cloud_developerconnect_v1::builder;
967 /// use builder::developer_connect::ListGitRepositoryLinks;
968 /// # tokio_test::block_on(async {
969 /// use gax::paginator::ItemPaginator;
970 ///
971 /// let builder = prepare_request_builder();
972 /// let mut items = builder.by_item();
973 /// while let Some(result) = items.next().await {
974 /// let item = result?;
975 /// }
976 /// # gax::Result::<()>::Ok(()) });
977 ///
978 /// fn prepare_request_builder() -> ListGitRepositoryLinks {
979 /// # panic!();
980 /// // ... details omitted ...
981 /// }
982 /// ```
983 #[derive(Clone, Debug)]
984 pub struct ListGitRepositoryLinks(RequestBuilder<crate::model::ListGitRepositoryLinksRequest>);
985
986 impl ListGitRepositoryLinks {
987 pub(crate) fn new(
988 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
989 ) -> Self {
990 Self(RequestBuilder::new(stub))
991 }
992
993 /// Sets the full request, replacing any prior values.
994 pub fn with_request<V: Into<crate::model::ListGitRepositoryLinksRequest>>(
995 mut self,
996 v: V,
997 ) -> Self {
998 self.0.request = v.into();
999 self
1000 }
1001
1002 /// Sets all the options, replacing any prior values.
1003 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1004 self.0.options = v.into();
1005 self
1006 }
1007
1008 /// Sends the request.
1009 pub async fn send(self) -> Result<crate::model::ListGitRepositoryLinksResponse> {
1010 (*self.0.stub)
1011 .list_git_repository_links(self.0.request, self.0.options)
1012 .await
1013 .map(gax::response::Response::into_body)
1014 }
1015
1016 /// Streams each page in the collection.
1017 pub fn by_page(
1018 self,
1019 ) -> impl gax::paginator::Paginator<
1020 crate::model::ListGitRepositoryLinksResponse,
1021 gax::error::Error,
1022 > {
1023 use std::clone::Clone;
1024 let token = self.0.request.page_token.clone();
1025 let execute = move |token: String| {
1026 let mut builder = self.clone();
1027 builder.0.request = builder.0.request.set_page_token(token);
1028 builder.send()
1029 };
1030 gax::paginator::internal::new_paginator(token, execute)
1031 }
1032
1033 /// Streams each item in the collection.
1034 pub fn by_item(
1035 self,
1036 ) -> impl gax::paginator::ItemPaginator<
1037 crate::model::ListGitRepositoryLinksResponse,
1038 gax::error::Error,
1039 > {
1040 use gax::paginator::Paginator;
1041 self.by_page().items()
1042 }
1043
1044 /// Sets the value of [parent][crate::model::ListGitRepositoryLinksRequest::parent].
1045 ///
1046 /// This is a **required** field for requests.
1047 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1048 self.0.request.parent = v.into();
1049 self
1050 }
1051
1052 /// Sets the value of [page_size][crate::model::ListGitRepositoryLinksRequest::page_size].
1053 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1054 self.0.request.page_size = v.into();
1055 self
1056 }
1057
1058 /// Sets the value of [page_token][crate::model::ListGitRepositoryLinksRequest::page_token].
1059 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1060 self.0.request.page_token = v.into();
1061 self
1062 }
1063
1064 /// Sets the value of [filter][crate::model::ListGitRepositoryLinksRequest::filter].
1065 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1066 self.0.request.filter = v.into();
1067 self
1068 }
1069
1070 /// Sets the value of [order_by][crate::model::ListGitRepositoryLinksRequest::order_by].
1071 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1072 self.0.request.order_by = v.into();
1073 self
1074 }
1075 }
1076
1077 #[doc(hidden)]
1078 impl gax::options::internal::RequestBuilder for ListGitRepositoryLinks {
1079 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1080 &mut self.0.options
1081 }
1082 }
1083
1084 /// The request builder for [DeveloperConnect::get_git_repository_link][crate::client::DeveloperConnect::get_git_repository_link] calls.
1085 ///
1086 /// # Example
1087 /// ```no_run
1088 /// # use google_cloud_developerconnect_v1::builder;
1089 /// use builder::developer_connect::GetGitRepositoryLink;
1090 /// # tokio_test::block_on(async {
1091 ///
1092 /// let builder = prepare_request_builder();
1093 /// let response = builder.send().await?;
1094 /// # gax::Result::<()>::Ok(()) });
1095 ///
1096 /// fn prepare_request_builder() -> GetGitRepositoryLink {
1097 /// # panic!();
1098 /// // ... details omitted ...
1099 /// }
1100 /// ```
1101 #[derive(Clone, Debug)]
1102 pub struct GetGitRepositoryLink(RequestBuilder<crate::model::GetGitRepositoryLinkRequest>);
1103
1104 impl GetGitRepositoryLink {
1105 pub(crate) fn new(
1106 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1107 ) -> Self {
1108 Self(RequestBuilder::new(stub))
1109 }
1110
1111 /// Sets the full request, replacing any prior values.
1112 pub fn with_request<V: Into<crate::model::GetGitRepositoryLinkRequest>>(
1113 mut self,
1114 v: V,
1115 ) -> Self {
1116 self.0.request = v.into();
1117 self
1118 }
1119
1120 /// Sets all the options, replacing any prior values.
1121 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1122 self.0.options = v.into();
1123 self
1124 }
1125
1126 /// Sends the request.
1127 pub async fn send(self) -> Result<crate::model::GitRepositoryLink> {
1128 (*self.0.stub)
1129 .get_git_repository_link(self.0.request, self.0.options)
1130 .await
1131 .map(gax::response::Response::into_body)
1132 }
1133
1134 /// Sets the value of [name][crate::model::GetGitRepositoryLinkRequest::name].
1135 ///
1136 /// This is a **required** field for requests.
1137 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1138 self.0.request.name = v.into();
1139 self
1140 }
1141 }
1142
1143 #[doc(hidden)]
1144 impl gax::options::internal::RequestBuilder for GetGitRepositoryLink {
1145 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1146 &mut self.0.options
1147 }
1148 }
1149
1150 /// The request builder for [DeveloperConnect::fetch_read_write_token][crate::client::DeveloperConnect::fetch_read_write_token] calls.
1151 ///
1152 /// # Example
1153 /// ```no_run
1154 /// # use google_cloud_developerconnect_v1::builder;
1155 /// use builder::developer_connect::FetchReadWriteToken;
1156 /// # tokio_test::block_on(async {
1157 ///
1158 /// let builder = prepare_request_builder();
1159 /// let response = builder.send().await?;
1160 /// # gax::Result::<()>::Ok(()) });
1161 ///
1162 /// fn prepare_request_builder() -> FetchReadWriteToken {
1163 /// # panic!();
1164 /// // ... details omitted ...
1165 /// }
1166 /// ```
1167 #[derive(Clone, Debug)]
1168 pub struct FetchReadWriteToken(RequestBuilder<crate::model::FetchReadWriteTokenRequest>);
1169
1170 impl FetchReadWriteToken {
1171 pub(crate) fn new(
1172 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1173 ) -> Self {
1174 Self(RequestBuilder::new(stub))
1175 }
1176
1177 /// Sets the full request, replacing any prior values.
1178 pub fn with_request<V: Into<crate::model::FetchReadWriteTokenRequest>>(
1179 mut self,
1180 v: V,
1181 ) -> Self {
1182 self.0.request = v.into();
1183 self
1184 }
1185
1186 /// Sets all the options, replacing any prior values.
1187 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1188 self.0.options = v.into();
1189 self
1190 }
1191
1192 /// Sends the request.
1193 pub async fn send(self) -> Result<crate::model::FetchReadWriteTokenResponse> {
1194 (*self.0.stub)
1195 .fetch_read_write_token(self.0.request, self.0.options)
1196 .await
1197 .map(gax::response::Response::into_body)
1198 }
1199
1200 /// Sets the value of [git_repository_link][crate::model::FetchReadWriteTokenRequest::git_repository_link].
1201 ///
1202 /// This is a **required** field for requests.
1203 pub fn set_git_repository_link<T: Into<std::string::String>>(mut self, v: T) -> Self {
1204 self.0.request.git_repository_link = v.into();
1205 self
1206 }
1207 }
1208
1209 #[doc(hidden)]
1210 impl gax::options::internal::RequestBuilder for FetchReadWriteToken {
1211 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1212 &mut self.0.options
1213 }
1214 }
1215
1216 /// The request builder for [DeveloperConnect::fetch_read_token][crate::client::DeveloperConnect::fetch_read_token] calls.
1217 ///
1218 /// # Example
1219 /// ```no_run
1220 /// # use google_cloud_developerconnect_v1::builder;
1221 /// use builder::developer_connect::FetchReadToken;
1222 /// # tokio_test::block_on(async {
1223 ///
1224 /// let builder = prepare_request_builder();
1225 /// let response = builder.send().await?;
1226 /// # gax::Result::<()>::Ok(()) });
1227 ///
1228 /// fn prepare_request_builder() -> FetchReadToken {
1229 /// # panic!();
1230 /// // ... details omitted ...
1231 /// }
1232 /// ```
1233 #[derive(Clone, Debug)]
1234 pub struct FetchReadToken(RequestBuilder<crate::model::FetchReadTokenRequest>);
1235
1236 impl FetchReadToken {
1237 pub(crate) fn new(
1238 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1239 ) -> Self {
1240 Self(RequestBuilder::new(stub))
1241 }
1242
1243 /// Sets the full request, replacing any prior values.
1244 pub fn with_request<V: Into<crate::model::FetchReadTokenRequest>>(mut self, v: V) -> Self {
1245 self.0.request = v.into();
1246 self
1247 }
1248
1249 /// Sets all the options, replacing any prior values.
1250 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1251 self.0.options = v.into();
1252 self
1253 }
1254
1255 /// Sends the request.
1256 pub async fn send(self) -> Result<crate::model::FetchReadTokenResponse> {
1257 (*self.0.stub)
1258 .fetch_read_token(self.0.request, self.0.options)
1259 .await
1260 .map(gax::response::Response::into_body)
1261 }
1262
1263 /// Sets the value of [git_repository_link][crate::model::FetchReadTokenRequest::git_repository_link].
1264 ///
1265 /// This is a **required** field for requests.
1266 pub fn set_git_repository_link<T: Into<std::string::String>>(mut self, v: T) -> Self {
1267 self.0.request.git_repository_link = v.into();
1268 self
1269 }
1270 }
1271
1272 #[doc(hidden)]
1273 impl gax::options::internal::RequestBuilder for FetchReadToken {
1274 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1275 &mut self.0.options
1276 }
1277 }
1278
1279 /// The request builder for [DeveloperConnect::fetch_linkable_git_repositories][crate::client::DeveloperConnect::fetch_linkable_git_repositories] calls.
1280 ///
1281 /// # Example
1282 /// ```no_run
1283 /// # use google_cloud_developerconnect_v1::builder;
1284 /// use builder::developer_connect::FetchLinkableGitRepositories;
1285 /// # tokio_test::block_on(async {
1286 /// use gax::paginator::ItemPaginator;
1287 ///
1288 /// let builder = prepare_request_builder();
1289 /// let mut items = builder.by_item();
1290 /// while let Some(result) = items.next().await {
1291 /// let item = result?;
1292 /// }
1293 /// # gax::Result::<()>::Ok(()) });
1294 ///
1295 /// fn prepare_request_builder() -> FetchLinkableGitRepositories {
1296 /// # panic!();
1297 /// // ... details omitted ...
1298 /// }
1299 /// ```
1300 #[derive(Clone, Debug)]
1301 pub struct FetchLinkableGitRepositories(
1302 RequestBuilder<crate::model::FetchLinkableGitRepositoriesRequest>,
1303 );
1304
1305 impl FetchLinkableGitRepositories {
1306 pub(crate) fn new(
1307 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1308 ) -> Self {
1309 Self(RequestBuilder::new(stub))
1310 }
1311
1312 /// Sets the full request, replacing any prior values.
1313 pub fn with_request<V: Into<crate::model::FetchLinkableGitRepositoriesRequest>>(
1314 mut self,
1315 v: V,
1316 ) -> Self {
1317 self.0.request = v.into();
1318 self
1319 }
1320
1321 /// Sets all the options, replacing any prior values.
1322 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1323 self.0.options = v.into();
1324 self
1325 }
1326
1327 /// Sends the request.
1328 pub async fn send(self) -> Result<crate::model::FetchLinkableGitRepositoriesResponse> {
1329 (*self.0.stub)
1330 .fetch_linkable_git_repositories(self.0.request, self.0.options)
1331 .await
1332 .map(gax::response::Response::into_body)
1333 }
1334
1335 /// Streams each page in the collection.
1336 pub fn by_page(
1337 self,
1338 ) -> impl gax::paginator::Paginator<
1339 crate::model::FetchLinkableGitRepositoriesResponse,
1340 gax::error::Error,
1341 > {
1342 use std::clone::Clone;
1343 let token = self.0.request.page_token.clone();
1344 let execute = move |token: String| {
1345 let mut builder = self.clone();
1346 builder.0.request = builder.0.request.set_page_token(token);
1347 builder.send()
1348 };
1349 gax::paginator::internal::new_paginator(token, execute)
1350 }
1351
1352 /// Streams each item in the collection.
1353 pub fn by_item(
1354 self,
1355 ) -> impl gax::paginator::ItemPaginator<
1356 crate::model::FetchLinkableGitRepositoriesResponse,
1357 gax::error::Error,
1358 > {
1359 use gax::paginator::Paginator;
1360 self.by_page().items()
1361 }
1362
1363 /// Sets the value of [connection][crate::model::FetchLinkableGitRepositoriesRequest::connection].
1364 ///
1365 /// This is a **required** field for requests.
1366 pub fn set_connection<T: Into<std::string::String>>(mut self, v: T) -> Self {
1367 self.0.request.connection = v.into();
1368 self
1369 }
1370
1371 /// Sets the value of [page_size][crate::model::FetchLinkableGitRepositoriesRequest::page_size].
1372 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1373 self.0.request.page_size = v.into();
1374 self
1375 }
1376
1377 /// Sets the value of [page_token][crate::model::FetchLinkableGitRepositoriesRequest::page_token].
1378 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1379 self.0.request.page_token = v.into();
1380 self
1381 }
1382 }
1383
1384 #[doc(hidden)]
1385 impl gax::options::internal::RequestBuilder for FetchLinkableGitRepositories {
1386 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1387 &mut self.0.options
1388 }
1389 }
1390
1391 /// The request builder for [DeveloperConnect::fetch_git_hub_installations][crate::client::DeveloperConnect::fetch_git_hub_installations] calls.
1392 ///
1393 /// # Example
1394 /// ```no_run
1395 /// # use google_cloud_developerconnect_v1::builder;
1396 /// use builder::developer_connect::FetchGitHubInstallations;
1397 /// # tokio_test::block_on(async {
1398 ///
1399 /// let builder = prepare_request_builder();
1400 /// let response = builder.send().await?;
1401 /// # gax::Result::<()>::Ok(()) });
1402 ///
1403 /// fn prepare_request_builder() -> FetchGitHubInstallations {
1404 /// # panic!();
1405 /// // ... details omitted ...
1406 /// }
1407 /// ```
1408 #[derive(Clone, Debug)]
1409 pub struct FetchGitHubInstallations(
1410 RequestBuilder<crate::model::FetchGitHubInstallationsRequest>,
1411 );
1412
1413 impl FetchGitHubInstallations {
1414 pub(crate) fn new(
1415 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1416 ) -> Self {
1417 Self(RequestBuilder::new(stub))
1418 }
1419
1420 /// Sets the full request, replacing any prior values.
1421 pub fn with_request<V: Into<crate::model::FetchGitHubInstallationsRequest>>(
1422 mut self,
1423 v: V,
1424 ) -> Self {
1425 self.0.request = v.into();
1426 self
1427 }
1428
1429 /// Sets all the options, replacing any prior values.
1430 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1431 self.0.options = v.into();
1432 self
1433 }
1434
1435 /// Sends the request.
1436 pub async fn send(self) -> Result<crate::model::FetchGitHubInstallationsResponse> {
1437 (*self.0.stub)
1438 .fetch_git_hub_installations(self.0.request, self.0.options)
1439 .await
1440 .map(gax::response::Response::into_body)
1441 }
1442
1443 /// Sets the value of [connection][crate::model::FetchGitHubInstallationsRequest::connection].
1444 ///
1445 /// This is a **required** field for requests.
1446 pub fn set_connection<T: Into<std::string::String>>(mut self, v: T) -> Self {
1447 self.0.request.connection = v.into();
1448 self
1449 }
1450 }
1451
1452 #[doc(hidden)]
1453 impl gax::options::internal::RequestBuilder for FetchGitHubInstallations {
1454 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1455 &mut self.0.options
1456 }
1457 }
1458
1459 /// The request builder for [DeveloperConnect::fetch_git_refs][crate::client::DeveloperConnect::fetch_git_refs] calls.
1460 ///
1461 /// # Example
1462 /// ```no_run
1463 /// # use google_cloud_developerconnect_v1::builder;
1464 /// use builder::developer_connect::FetchGitRefs;
1465 /// # tokio_test::block_on(async {
1466 ///
1467 /// let builder = prepare_request_builder();
1468 /// let response = builder.send().await?;
1469 /// # gax::Result::<()>::Ok(()) });
1470 ///
1471 /// fn prepare_request_builder() -> FetchGitRefs {
1472 /// # panic!();
1473 /// // ... details omitted ...
1474 /// }
1475 /// ```
1476 #[derive(Clone, Debug)]
1477 pub struct FetchGitRefs(RequestBuilder<crate::model::FetchGitRefsRequest>);
1478
1479 impl FetchGitRefs {
1480 pub(crate) fn new(
1481 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1482 ) -> Self {
1483 Self(RequestBuilder::new(stub))
1484 }
1485
1486 /// Sets the full request, replacing any prior values.
1487 pub fn with_request<V: Into<crate::model::FetchGitRefsRequest>>(mut self, v: V) -> Self {
1488 self.0.request = v.into();
1489 self
1490 }
1491
1492 /// Sets all the options, replacing any prior values.
1493 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1494 self.0.options = v.into();
1495 self
1496 }
1497
1498 /// Sends the request.
1499 pub async fn send(self) -> Result<crate::model::FetchGitRefsResponse> {
1500 (*self.0.stub)
1501 .fetch_git_refs(self.0.request, self.0.options)
1502 .await
1503 .map(gax::response::Response::into_body)
1504 }
1505
1506 /// Sets the value of [git_repository_link][crate::model::FetchGitRefsRequest::git_repository_link].
1507 ///
1508 /// This is a **required** field for requests.
1509 pub fn set_git_repository_link<T: Into<std::string::String>>(mut self, v: T) -> Self {
1510 self.0.request.git_repository_link = v.into();
1511 self
1512 }
1513
1514 /// Sets the value of [ref_type][crate::model::FetchGitRefsRequest::ref_type].
1515 ///
1516 /// This is a **required** field for requests.
1517 pub fn set_ref_type<T: Into<crate::model::fetch_git_refs_request::RefType>>(
1518 mut self,
1519 v: T,
1520 ) -> Self {
1521 self.0.request.ref_type = v.into();
1522 self
1523 }
1524
1525 /// Sets the value of [page_size][crate::model::FetchGitRefsRequest::page_size].
1526 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1527 self.0.request.page_size = v.into();
1528 self
1529 }
1530
1531 /// Sets the value of [page_token][crate::model::FetchGitRefsRequest::page_token].
1532 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1533 self.0.request.page_token = v.into();
1534 self
1535 }
1536 }
1537
1538 #[doc(hidden)]
1539 impl gax::options::internal::RequestBuilder for FetchGitRefs {
1540 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1541 &mut self.0.options
1542 }
1543 }
1544
1545 /// The request builder for [DeveloperConnect::list_locations][crate::client::DeveloperConnect::list_locations] calls.
1546 ///
1547 /// # Example
1548 /// ```no_run
1549 /// # use google_cloud_developerconnect_v1::builder;
1550 /// use builder::developer_connect::ListLocations;
1551 /// # tokio_test::block_on(async {
1552 /// use gax::paginator::ItemPaginator;
1553 ///
1554 /// let builder = prepare_request_builder();
1555 /// let mut items = builder.by_item();
1556 /// while let Some(result) = items.next().await {
1557 /// let item = result?;
1558 /// }
1559 /// # gax::Result::<()>::Ok(()) });
1560 ///
1561 /// fn prepare_request_builder() -> ListLocations {
1562 /// # panic!();
1563 /// // ... details omitted ...
1564 /// }
1565 /// ```
1566 #[derive(Clone, Debug)]
1567 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
1568
1569 impl ListLocations {
1570 pub(crate) fn new(
1571 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1572 ) -> Self {
1573 Self(RequestBuilder::new(stub))
1574 }
1575
1576 /// Sets the full request, replacing any prior values.
1577 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
1578 mut self,
1579 v: V,
1580 ) -> Self {
1581 self.0.request = v.into();
1582 self
1583 }
1584
1585 /// Sets all the options, replacing any prior values.
1586 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1587 self.0.options = v.into();
1588 self
1589 }
1590
1591 /// Sends the request.
1592 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
1593 (*self.0.stub)
1594 .list_locations(self.0.request, self.0.options)
1595 .await
1596 .map(gax::response::Response::into_body)
1597 }
1598
1599 /// Streams each page in the collection.
1600 pub fn by_page(
1601 self,
1602 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
1603 {
1604 use std::clone::Clone;
1605 let token = self.0.request.page_token.clone();
1606 let execute = move |token: String| {
1607 let mut builder = self.clone();
1608 builder.0.request = builder.0.request.set_page_token(token);
1609 builder.send()
1610 };
1611 gax::paginator::internal::new_paginator(token, execute)
1612 }
1613
1614 /// Streams each item in the collection.
1615 pub fn by_item(
1616 self,
1617 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
1618 {
1619 use gax::paginator::Paginator;
1620 self.by_page().items()
1621 }
1622
1623 /// Sets the value of [name][location::model::ListLocationsRequest::name].
1624 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1625 self.0.request.name = v.into();
1626 self
1627 }
1628
1629 /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
1630 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1631 self.0.request.filter = v.into();
1632 self
1633 }
1634
1635 /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
1636 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1637 self.0.request.page_size = v.into();
1638 self
1639 }
1640
1641 /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
1642 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1643 self.0.request.page_token = v.into();
1644 self
1645 }
1646 }
1647
1648 #[doc(hidden)]
1649 impl gax::options::internal::RequestBuilder for ListLocations {
1650 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1651 &mut self.0.options
1652 }
1653 }
1654
1655 /// The request builder for [DeveloperConnect::get_location][crate::client::DeveloperConnect::get_location] calls.
1656 ///
1657 /// # Example
1658 /// ```no_run
1659 /// # use google_cloud_developerconnect_v1::builder;
1660 /// use builder::developer_connect::GetLocation;
1661 /// # tokio_test::block_on(async {
1662 ///
1663 /// let builder = prepare_request_builder();
1664 /// let response = builder.send().await?;
1665 /// # gax::Result::<()>::Ok(()) });
1666 ///
1667 /// fn prepare_request_builder() -> GetLocation {
1668 /// # panic!();
1669 /// // ... details omitted ...
1670 /// }
1671 /// ```
1672 #[derive(Clone, Debug)]
1673 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
1674
1675 impl GetLocation {
1676 pub(crate) fn new(
1677 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1678 ) -> Self {
1679 Self(RequestBuilder::new(stub))
1680 }
1681
1682 /// Sets the full request, replacing any prior values.
1683 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
1684 self.0.request = v.into();
1685 self
1686 }
1687
1688 /// Sets all the options, replacing any prior values.
1689 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1690 self.0.options = v.into();
1691 self
1692 }
1693
1694 /// Sends the request.
1695 pub async fn send(self) -> Result<location::model::Location> {
1696 (*self.0.stub)
1697 .get_location(self.0.request, self.0.options)
1698 .await
1699 .map(gax::response::Response::into_body)
1700 }
1701
1702 /// Sets the value of [name][location::model::GetLocationRequest::name].
1703 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1704 self.0.request.name = v.into();
1705 self
1706 }
1707 }
1708
1709 #[doc(hidden)]
1710 impl gax::options::internal::RequestBuilder for GetLocation {
1711 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1712 &mut self.0.options
1713 }
1714 }
1715
1716 /// The request builder for [DeveloperConnect::list_operations][crate::client::DeveloperConnect::list_operations] calls.
1717 ///
1718 /// # Example
1719 /// ```no_run
1720 /// # use google_cloud_developerconnect_v1::builder;
1721 /// use builder::developer_connect::ListOperations;
1722 /// # tokio_test::block_on(async {
1723 /// use gax::paginator::ItemPaginator;
1724 ///
1725 /// let builder = prepare_request_builder();
1726 /// let mut items = builder.by_item();
1727 /// while let Some(result) = items.next().await {
1728 /// let item = result?;
1729 /// }
1730 /// # gax::Result::<()>::Ok(()) });
1731 ///
1732 /// fn prepare_request_builder() -> ListOperations {
1733 /// # panic!();
1734 /// // ... details omitted ...
1735 /// }
1736 /// ```
1737 #[derive(Clone, Debug)]
1738 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1739
1740 impl ListOperations {
1741 pub(crate) fn new(
1742 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1743 ) -> Self {
1744 Self(RequestBuilder::new(stub))
1745 }
1746
1747 /// Sets the full request, replacing any prior values.
1748 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1749 mut self,
1750 v: V,
1751 ) -> Self {
1752 self.0.request = v.into();
1753 self
1754 }
1755
1756 /// Sets all the options, replacing any prior values.
1757 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1758 self.0.options = v.into();
1759 self
1760 }
1761
1762 /// Sends the request.
1763 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1764 (*self.0.stub)
1765 .list_operations(self.0.request, self.0.options)
1766 .await
1767 .map(gax::response::Response::into_body)
1768 }
1769
1770 /// Streams each page in the collection.
1771 pub fn by_page(
1772 self,
1773 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1774 {
1775 use std::clone::Clone;
1776 let token = self.0.request.page_token.clone();
1777 let execute = move |token: String| {
1778 let mut builder = self.clone();
1779 builder.0.request = builder.0.request.set_page_token(token);
1780 builder.send()
1781 };
1782 gax::paginator::internal::new_paginator(token, execute)
1783 }
1784
1785 /// Streams each item in the collection.
1786 pub fn by_item(
1787 self,
1788 ) -> impl gax::paginator::ItemPaginator<
1789 longrunning::model::ListOperationsResponse,
1790 gax::error::Error,
1791 > {
1792 use gax::paginator::Paginator;
1793 self.by_page().items()
1794 }
1795
1796 /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
1797 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1798 self.0.request.name = v.into();
1799 self
1800 }
1801
1802 /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
1803 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1804 self.0.request.filter = v.into();
1805 self
1806 }
1807
1808 /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
1809 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1810 self.0.request.page_size = v.into();
1811 self
1812 }
1813
1814 /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
1815 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1816 self.0.request.page_token = v.into();
1817 self
1818 }
1819 }
1820
1821 #[doc(hidden)]
1822 impl gax::options::internal::RequestBuilder for ListOperations {
1823 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1824 &mut self.0.options
1825 }
1826 }
1827
1828 /// The request builder for [DeveloperConnect::get_operation][crate::client::DeveloperConnect::get_operation] calls.
1829 ///
1830 /// # Example
1831 /// ```no_run
1832 /// # use google_cloud_developerconnect_v1::builder;
1833 /// use builder::developer_connect::GetOperation;
1834 /// # tokio_test::block_on(async {
1835 ///
1836 /// let builder = prepare_request_builder();
1837 /// let response = builder.send().await?;
1838 /// # gax::Result::<()>::Ok(()) });
1839 ///
1840 /// fn prepare_request_builder() -> GetOperation {
1841 /// # panic!();
1842 /// // ... details omitted ...
1843 /// }
1844 /// ```
1845 #[derive(Clone, Debug)]
1846 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1847
1848 impl GetOperation {
1849 pub(crate) fn new(
1850 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1851 ) -> Self {
1852 Self(RequestBuilder::new(stub))
1853 }
1854
1855 /// Sets the full request, replacing any prior values.
1856 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1857 mut self,
1858 v: V,
1859 ) -> Self {
1860 self.0.request = v.into();
1861 self
1862 }
1863
1864 /// Sets all the options, replacing any prior values.
1865 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1866 self.0.options = v.into();
1867 self
1868 }
1869
1870 /// Sends the request.
1871 pub async fn send(self) -> Result<longrunning::model::Operation> {
1872 (*self.0.stub)
1873 .get_operation(self.0.request, self.0.options)
1874 .await
1875 .map(gax::response::Response::into_body)
1876 }
1877
1878 /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
1879 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1880 self.0.request.name = v.into();
1881 self
1882 }
1883 }
1884
1885 #[doc(hidden)]
1886 impl gax::options::internal::RequestBuilder for GetOperation {
1887 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1888 &mut self.0.options
1889 }
1890 }
1891
1892 /// The request builder for [DeveloperConnect::delete_operation][crate::client::DeveloperConnect::delete_operation] calls.
1893 ///
1894 /// # Example
1895 /// ```no_run
1896 /// # use google_cloud_developerconnect_v1::builder;
1897 /// use builder::developer_connect::DeleteOperation;
1898 /// # tokio_test::block_on(async {
1899 ///
1900 /// let builder = prepare_request_builder();
1901 /// let response = builder.send().await?;
1902 /// # gax::Result::<()>::Ok(()) });
1903 ///
1904 /// fn prepare_request_builder() -> DeleteOperation {
1905 /// # panic!();
1906 /// // ... details omitted ...
1907 /// }
1908 /// ```
1909 #[derive(Clone, Debug)]
1910 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
1911
1912 impl DeleteOperation {
1913 pub(crate) fn new(
1914 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1915 ) -> Self {
1916 Self(RequestBuilder::new(stub))
1917 }
1918
1919 /// Sets the full request, replacing any prior values.
1920 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
1921 mut self,
1922 v: V,
1923 ) -> Self {
1924 self.0.request = v.into();
1925 self
1926 }
1927
1928 /// Sets all the options, replacing any prior values.
1929 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1930 self.0.options = v.into();
1931 self
1932 }
1933
1934 /// Sends the request.
1935 pub async fn send(self) -> Result<()> {
1936 (*self.0.stub)
1937 .delete_operation(self.0.request, self.0.options)
1938 .await
1939 .map(gax::response::Response::into_body)
1940 }
1941
1942 /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
1943 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1944 self.0.request.name = v.into();
1945 self
1946 }
1947 }
1948
1949 #[doc(hidden)]
1950 impl gax::options::internal::RequestBuilder for DeleteOperation {
1951 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1952 &mut self.0.options
1953 }
1954 }
1955
1956 /// The request builder for [DeveloperConnect::cancel_operation][crate::client::DeveloperConnect::cancel_operation] calls.
1957 ///
1958 /// # Example
1959 /// ```no_run
1960 /// # use google_cloud_developerconnect_v1::builder;
1961 /// use builder::developer_connect::CancelOperation;
1962 /// # tokio_test::block_on(async {
1963 ///
1964 /// let builder = prepare_request_builder();
1965 /// let response = builder.send().await?;
1966 /// # gax::Result::<()>::Ok(()) });
1967 ///
1968 /// fn prepare_request_builder() -> CancelOperation {
1969 /// # panic!();
1970 /// // ... details omitted ...
1971 /// }
1972 /// ```
1973 #[derive(Clone, Debug)]
1974 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
1975
1976 impl CancelOperation {
1977 pub(crate) fn new(
1978 stub: std::sync::Arc<dyn super::super::stub::dynamic::DeveloperConnect>,
1979 ) -> Self {
1980 Self(RequestBuilder::new(stub))
1981 }
1982
1983 /// Sets the full request, replacing any prior values.
1984 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
1985 mut self,
1986 v: V,
1987 ) -> Self {
1988 self.0.request = v.into();
1989 self
1990 }
1991
1992 /// Sets all the options, replacing any prior values.
1993 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1994 self.0.options = v.into();
1995 self
1996 }
1997
1998 /// Sends the request.
1999 pub async fn send(self) -> Result<()> {
2000 (*self.0.stub)
2001 .cancel_operation(self.0.request, self.0.options)
2002 .await
2003 .map(gax::response::Response::into_body)
2004 }
2005
2006 /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
2007 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2008 self.0.request.name = v.into();
2009 self
2010 }
2011 }
2012
2013 #[doc(hidden)]
2014 impl gax::options::internal::RequestBuilder for CancelOperation {
2015 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2016 &mut self.0.options
2017 }
2018 }
2019}