Skip to main content

google_cloud_edgenetwork_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 edge_network {
18    use crate::Result;
19
20    /// A builder for [EdgeNetwork][crate::client::EdgeNetwork].
21    ///
22    /// ```
23    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
24    /// # use google_cloud_edgenetwork_v1::*;
25    /// # use builder::edge_network::ClientBuilder;
26    /// # use client::EdgeNetwork;
27    /// let builder : ClientBuilder = EdgeNetwork::builder();
28    /// let client = builder
29    ///     .with_endpoint("https://edgenetwork.googleapis.com")
30    ///     .build().await?;
31    /// # Ok(()) }
32    /// ```
33    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
34
35    pub(crate) mod client {
36        use super::super::super::client::EdgeNetwork;
37        pub struct Factory;
38        impl crate::ClientFactory for Factory {
39            type Client = EdgeNetwork;
40            type Credentials = gaxi::options::Credentials;
41            async fn build(
42                self,
43                config: gaxi::options::ClientConfig,
44            ) -> crate::ClientBuilderResult<Self::Client> {
45                Self::Client::new(config).await
46            }
47        }
48    }
49
50    /// Common implementation for [crate::client::EdgeNetwork] request builders.
51    #[derive(Clone, Debug)]
52    pub(crate) struct RequestBuilder<R: std::default::Default> {
53        stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
54        request: R,
55        options: crate::RequestOptions,
56    }
57
58    impl<R> RequestBuilder<R>
59    where
60        R: std::default::Default,
61    {
62        pub(crate) fn new(
63            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
64        ) -> Self {
65            Self {
66                stub,
67                request: R::default(),
68                options: crate::RequestOptions::default(),
69            }
70        }
71    }
72
73    /// The request builder for [EdgeNetwork::initialize_zone][crate::client::EdgeNetwork::initialize_zone] calls.
74    ///
75    /// # Example
76    /// ```
77    /// # use google_cloud_edgenetwork_v1::builder::edge_network::InitializeZone;
78    /// # async fn sample() -> google_cloud_edgenetwork_v1::Result<()> {
79    ///
80    /// let builder = prepare_request_builder();
81    /// let response = builder.send().await?;
82    /// # Ok(()) }
83    ///
84    /// fn prepare_request_builder() -> InitializeZone {
85    ///   # panic!();
86    ///   // ... details omitted ...
87    /// }
88    /// ```
89    #[derive(Clone, Debug)]
90    pub struct InitializeZone(RequestBuilder<crate::model::InitializeZoneRequest>);
91
92    impl InitializeZone {
93        pub(crate) fn new(
94            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
95        ) -> Self {
96            Self(RequestBuilder::new(stub))
97        }
98
99        /// Sets the full request, replacing any prior values.
100        pub fn with_request<V: Into<crate::model::InitializeZoneRequest>>(mut self, v: V) -> Self {
101            self.0.request = v.into();
102            self
103        }
104
105        /// Sets all the options, replacing any prior values.
106        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
107            self.0.options = v.into();
108            self
109        }
110
111        /// Sends the request.
112        pub async fn send(self) -> Result<crate::model::InitializeZoneResponse> {
113            (*self.0.stub)
114                .initialize_zone(self.0.request, self.0.options)
115                .await
116                .map(crate::Response::into_body)
117        }
118
119        /// Sets the value of [name][crate::model::InitializeZoneRequest::name].
120        ///
121        /// This is a **required** field for requests.
122        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
123            self.0.request.name = v.into();
124            self
125        }
126    }
127
128    #[doc(hidden)]
129    impl crate::RequestBuilder for InitializeZone {
130        fn request_options(&mut self) -> &mut crate::RequestOptions {
131            &mut self.0.options
132        }
133    }
134
135    /// The request builder for [EdgeNetwork::list_zones][crate::client::EdgeNetwork::list_zones] calls.
136    ///
137    /// # Example
138    /// ```
139    /// # use google_cloud_edgenetwork_v1::builder::edge_network::ListZones;
140    /// # async fn sample() -> google_cloud_edgenetwork_v1::Result<()> {
141    /// use google_cloud_gax::paginator::ItemPaginator;
142    ///
143    /// let builder = prepare_request_builder();
144    /// let mut items = builder.by_item();
145    /// while let Some(result) = items.next().await {
146    ///   let item = result?;
147    /// }
148    /// # Ok(()) }
149    ///
150    /// fn prepare_request_builder() -> ListZones {
151    ///   # panic!();
152    ///   // ... details omitted ...
153    /// }
154    /// ```
155    #[derive(Clone, Debug)]
156    pub struct ListZones(RequestBuilder<crate::model::ListZonesRequest>);
157
158    impl ListZones {
159        pub(crate) fn new(
160            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
161        ) -> Self {
162            Self(RequestBuilder::new(stub))
163        }
164
165        /// Sets the full request, replacing any prior values.
166        pub fn with_request<V: Into<crate::model::ListZonesRequest>>(mut self, v: V) -> Self {
167            self.0.request = v.into();
168            self
169        }
170
171        /// Sets all the options, replacing any prior values.
172        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
173            self.0.options = v.into();
174            self
175        }
176
177        /// Sends the request.
178        pub async fn send(self) -> Result<crate::model::ListZonesResponse> {
179            (*self.0.stub)
180                .list_zones(self.0.request, self.0.options)
181                .await
182                .map(crate::Response::into_body)
183        }
184
185        /// Streams each page in the collection.
186        pub fn by_page(
187            self,
188        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListZonesResponse, crate::Error>
189        {
190            use std::clone::Clone;
191            let token = self.0.request.page_token.clone();
192            let execute = move |token: String| {
193                let mut builder = self.clone();
194                builder.0.request = builder.0.request.set_page_token(token);
195                builder.send()
196            };
197            google_cloud_gax::paginator::internal::new_paginator(token, execute)
198        }
199
200        /// Streams each item in the collection.
201        pub fn by_item(
202            self,
203        ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListZonesResponse, crate::Error>
204        {
205            use google_cloud_gax::paginator::Paginator;
206            self.by_page().items()
207        }
208
209        /// Sets the value of [parent][crate::model::ListZonesRequest::parent].
210        ///
211        /// This is a **required** field for requests.
212        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
213            self.0.request.parent = v.into();
214            self
215        }
216
217        /// Sets the value of [page_size][crate::model::ListZonesRequest::page_size].
218        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
219            self.0.request.page_size = v.into();
220            self
221        }
222
223        /// Sets the value of [page_token][crate::model::ListZonesRequest::page_token].
224        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
225            self.0.request.page_token = v.into();
226            self
227        }
228
229        /// Sets the value of [filter][crate::model::ListZonesRequest::filter].
230        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
231            self.0.request.filter = v.into();
232            self
233        }
234
235        /// Sets the value of [order_by][crate::model::ListZonesRequest::order_by].
236        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
237            self.0.request.order_by = v.into();
238            self
239        }
240    }
241
242    #[doc(hidden)]
243    impl crate::RequestBuilder for ListZones {
244        fn request_options(&mut self) -> &mut crate::RequestOptions {
245            &mut self.0.options
246        }
247    }
248
249    /// The request builder for [EdgeNetwork::get_zone][crate::client::EdgeNetwork::get_zone] calls.
250    ///
251    /// # Example
252    /// ```
253    /// # use google_cloud_edgenetwork_v1::builder::edge_network::GetZone;
254    /// # async fn sample() -> google_cloud_edgenetwork_v1::Result<()> {
255    ///
256    /// let builder = prepare_request_builder();
257    /// let response = builder.send().await?;
258    /// # Ok(()) }
259    ///
260    /// fn prepare_request_builder() -> GetZone {
261    ///   # panic!();
262    ///   // ... details omitted ...
263    /// }
264    /// ```
265    #[derive(Clone, Debug)]
266    pub struct GetZone(RequestBuilder<crate::model::GetZoneRequest>);
267
268    impl GetZone {
269        pub(crate) fn new(
270            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
271        ) -> Self {
272            Self(RequestBuilder::new(stub))
273        }
274
275        /// Sets the full request, replacing any prior values.
276        pub fn with_request<V: Into<crate::model::GetZoneRequest>>(mut self, v: V) -> Self {
277            self.0.request = v.into();
278            self
279        }
280
281        /// Sets all the options, replacing any prior values.
282        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
283            self.0.options = v.into();
284            self
285        }
286
287        /// Sends the request.
288        pub async fn send(self) -> Result<crate::model::Zone> {
289            (*self.0.stub)
290                .get_zone(self.0.request, self.0.options)
291                .await
292                .map(crate::Response::into_body)
293        }
294
295        /// Sets the value of [name][crate::model::GetZoneRequest::name].
296        ///
297        /// This is a **required** field for requests.
298        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
299            self.0.request.name = v.into();
300            self
301        }
302    }
303
304    #[doc(hidden)]
305    impl crate::RequestBuilder for GetZone {
306        fn request_options(&mut self) -> &mut crate::RequestOptions {
307            &mut self.0.options
308        }
309    }
310
311    /// The request builder for [EdgeNetwork::list_networks][crate::client::EdgeNetwork::list_networks] calls.
312    ///
313    /// # Example
314    /// ```
315    /// # use google_cloud_edgenetwork_v1::builder::edge_network::ListNetworks;
316    /// # async fn sample() -> google_cloud_edgenetwork_v1::Result<()> {
317    /// use google_cloud_gax::paginator::ItemPaginator;
318    ///
319    /// let builder = prepare_request_builder();
320    /// let mut items = builder.by_item();
321    /// while let Some(result) = items.next().await {
322    ///   let item = result?;
323    /// }
324    /// # Ok(()) }
325    ///
326    /// fn prepare_request_builder() -> ListNetworks {
327    ///   # panic!();
328    ///   // ... details omitted ...
329    /// }
330    /// ```
331    #[derive(Clone, Debug)]
332    pub struct ListNetworks(RequestBuilder<crate::model::ListNetworksRequest>);
333
334    impl ListNetworks {
335        pub(crate) fn new(
336            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
337        ) -> Self {
338            Self(RequestBuilder::new(stub))
339        }
340
341        /// Sets the full request, replacing any prior values.
342        pub fn with_request<V: Into<crate::model::ListNetworksRequest>>(mut self, v: V) -> Self {
343            self.0.request = v.into();
344            self
345        }
346
347        /// Sets all the options, replacing any prior values.
348        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
349            self.0.options = v.into();
350            self
351        }
352
353        /// Sends the request.
354        pub async fn send(self) -> Result<crate::model::ListNetworksResponse> {
355            (*self.0.stub)
356                .list_networks(self.0.request, self.0.options)
357                .await
358                .map(crate::Response::into_body)
359        }
360
361        /// Streams each page in the collection.
362        pub fn by_page(
363            self,
364        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListNetworksResponse, crate::Error>
365        {
366            use std::clone::Clone;
367            let token = self.0.request.page_token.clone();
368            let execute = move |token: String| {
369                let mut builder = self.clone();
370                builder.0.request = builder.0.request.set_page_token(token);
371                builder.send()
372            };
373            google_cloud_gax::paginator::internal::new_paginator(token, execute)
374        }
375
376        /// Streams each item in the collection.
377        pub fn by_item(
378            self,
379        ) -> impl google_cloud_gax::paginator::ItemPaginator<
380            crate::model::ListNetworksResponse,
381            crate::Error,
382        > {
383            use google_cloud_gax::paginator::Paginator;
384            self.by_page().items()
385        }
386
387        /// Sets the value of [parent][crate::model::ListNetworksRequest::parent].
388        ///
389        /// This is a **required** field for requests.
390        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
391            self.0.request.parent = v.into();
392            self
393        }
394
395        /// Sets the value of [page_size][crate::model::ListNetworksRequest::page_size].
396        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
397            self.0.request.page_size = v.into();
398            self
399        }
400
401        /// Sets the value of [page_token][crate::model::ListNetworksRequest::page_token].
402        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
403            self.0.request.page_token = v.into();
404            self
405        }
406
407        /// Sets the value of [filter][crate::model::ListNetworksRequest::filter].
408        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
409            self.0.request.filter = v.into();
410            self
411        }
412
413        /// Sets the value of [order_by][crate::model::ListNetworksRequest::order_by].
414        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
415            self.0.request.order_by = v.into();
416            self
417        }
418    }
419
420    #[doc(hidden)]
421    impl crate::RequestBuilder for ListNetworks {
422        fn request_options(&mut self) -> &mut crate::RequestOptions {
423            &mut self.0.options
424        }
425    }
426
427    /// The request builder for [EdgeNetwork::get_network][crate::client::EdgeNetwork::get_network] calls.
428    ///
429    /// # Example
430    /// ```
431    /// # use google_cloud_edgenetwork_v1::builder::edge_network::GetNetwork;
432    /// # async fn sample() -> google_cloud_edgenetwork_v1::Result<()> {
433    ///
434    /// let builder = prepare_request_builder();
435    /// let response = builder.send().await?;
436    /// # Ok(()) }
437    ///
438    /// fn prepare_request_builder() -> GetNetwork {
439    ///   # panic!();
440    ///   // ... details omitted ...
441    /// }
442    /// ```
443    #[derive(Clone, Debug)]
444    pub struct GetNetwork(RequestBuilder<crate::model::GetNetworkRequest>);
445
446    impl GetNetwork {
447        pub(crate) fn new(
448            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
449        ) -> Self {
450            Self(RequestBuilder::new(stub))
451        }
452
453        /// Sets the full request, replacing any prior values.
454        pub fn with_request<V: Into<crate::model::GetNetworkRequest>>(mut self, v: V) -> Self {
455            self.0.request = v.into();
456            self
457        }
458
459        /// Sets all the options, replacing any prior values.
460        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
461            self.0.options = v.into();
462            self
463        }
464
465        /// Sends the request.
466        pub async fn send(self) -> Result<crate::model::Network> {
467            (*self.0.stub)
468                .get_network(self.0.request, self.0.options)
469                .await
470                .map(crate::Response::into_body)
471        }
472
473        /// Sets the value of [name][crate::model::GetNetworkRequest::name].
474        ///
475        /// This is a **required** field for requests.
476        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
477            self.0.request.name = v.into();
478            self
479        }
480    }
481
482    #[doc(hidden)]
483    impl crate::RequestBuilder for GetNetwork {
484        fn request_options(&mut self) -> &mut crate::RequestOptions {
485            &mut self.0.options
486        }
487    }
488
489    /// The request builder for [EdgeNetwork::diagnose_network][crate::client::EdgeNetwork::diagnose_network] calls.
490    ///
491    /// # Example
492    /// ```
493    /// # use google_cloud_edgenetwork_v1::builder::edge_network::DiagnoseNetwork;
494    /// # async fn sample() -> google_cloud_edgenetwork_v1::Result<()> {
495    ///
496    /// let builder = prepare_request_builder();
497    /// let response = builder.send().await?;
498    /// # Ok(()) }
499    ///
500    /// fn prepare_request_builder() -> DiagnoseNetwork {
501    ///   # panic!();
502    ///   // ... details omitted ...
503    /// }
504    /// ```
505    #[derive(Clone, Debug)]
506    pub struct DiagnoseNetwork(RequestBuilder<crate::model::DiagnoseNetworkRequest>);
507
508    impl DiagnoseNetwork {
509        pub(crate) fn new(
510            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
511        ) -> Self {
512            Self(RequestBuilder::new(stub))
513        }
514
515        /// Sets the full request, replacing any prior values.
516        pub fn with_request<V: Into<crate::model::DiagnoseNetworkRequest>>(mut self, v: V) -> Self {
517            self.0.request = v.into();
518            self
519        }
520
521        /// Sets all the options, replacing any prior values.
522        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
523            self.0.options = v.into();
524            self
525        }
526
527        /// Sends the request.
528        pub async fn send(self) -> Result<crate::model::DiagnoseNetworkResponse> {
529            (*self.0.stub)
530                .diagnose_network(self.0.request, self.0.options)
531                .await
532                .map(crate::Response::into_body)
533        }
534
535        /// Sets the value of [name][crate::model::DiagnoseNetworkRequest::name].
536        ///
537        /// This is a **required** field for requests.
538        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
539            self.0.request.name = v.into();
540            self
541        }
542    }
543
544    #[doc(hidden)]
545    impl crate::RequestBuilder for DiagnoseNetwork {
546        fn request_options(&mut self) -> &mut crate::RequestOptions {
547            &mut self.0.options
548        }
549    }
550
551    /// The request builder for [EdgeNetwork::create_network][crate::client::EdgeNetwork::create_network] calls.
552    ///
553    /// # Example
554    /// ```
555    /// # use google_cloud_edgenetwork_v1::builder::edge_network::CreateNetwork;
556    /// # async fn sample() -> google_cloud_edgenetwork_v1::Result<()> {
557    /// use google_cloud_lro::Poller;
558    ///
559    /// let builder = prepare_request_builder();
560    /// let response = builder.poller().until_done().await?;
561    /// # Ok(()) }
562    ///
563    /// fn prepare_request_builder() -> CreateNetwork {
564    ///   # panic!();
565    ///   // ... details omitted ...
566    /// }
567    /// ```
568    #[derive(Clone, Debug)]
569    pub struct CreateNetwork(RequestBuilder<crate::model::CreateNetworkRequest>);
570
571    impl CreateNetwork {
572        pub(crate) fn new(
573            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
574        ) -> Self {
575            Self(RequestBuilder::new(stub))
576        }
577
578        /// Sets the full request, replacing any prior values.
579        pub fn with_request<V: Into<crate::model::CreateNetworkRequest>>(mut self, v: V) -> Self {
580            self.0.request = v.into();
581            self
582        }
583
584        /// Sets all the options, replacing any prior values.
585        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
586            self.0.options = v.into();
587            self
588        }
589
590        /// Sends the request.
591        ///
592        /// # Long running operations
593        ///
594        /// This starts, but does not poll, a longrunning operation. More information
595        /// on [create_network][crate::client::EdgeNetwork::create_network].
596        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
597            (*self.0.stub)
598                .create_network(self.0.request, self.0.options)
599                .await
600                .map(crate::Response::into_body)
601        }
602
603        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_network`.
604        pub fn poller(
605            self,
606        ) -> impl google_cloud_lro::Poller<crate::model::Network, crate::model::OperationMetadata>
607        {
608            type Operation = google_cloud_lro::internal::Operation<
609                crate::model::Network,
610                crate::model::OperationMetadata,
611            >;
612            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
613            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
614
615            let stub = self.0.stub.clone();
616            let mut options = self.0.options.clone();
617            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
618            let query = move |name| {
619                let stub = stub.clone();
620                let options = options.clone();
621                async {
622                    let op = GetOperation::new(stub)
623                        .set_name(name)
624                        .with_options(options)
625                        .send()
626                        .await?;
627                    Ok(Operation::new(op))
628                }
629            };
630
631            let start = move || async {
632                let op = self.send().await?;
633                Ok(Operation::new(op))
634            };
635
636            google_cloud_lro::internal::new_poller(
637                polling_error_policy,
638                polling_backoff_policy,
639                start,
640                query,
641            )
642        }
643
644        /// Sets the value of [parent][crate::model::CreateNetworkRequest::parent].
645        ///
646        /// This is a **required** field for requests.
647        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
648            self.0.request.parent = v.into();
649            self
650        }
651
652        /// Sets the value of [network_id][crate::model::CreateNetworkRequest::network_id].
653        ///
654        /// This is a **required** field for requests.
655        pub fn set_network_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
656            self.0.request.network_id = v.into();
657            self
658        }
659
660        /// Sets the value of [network][crate::model::CreateNetworkRequest::network].
661        ///
662        /// This is a **required** field for requests.
663        pub fn set_network<T>(mut self, v: T) -> Self
664        where
665            T: std::convert::Into<crate::model::Network>,
666        {
667            self.0.request.network = std::option::Option::Some(v.into());
668            self
669        }
670
671        /// Sets or clears the value of [network][crate::model::CreateNetworkRequest::network].
672        ///
673        /// This is a **required** field for requests.
674        pub fn set_or_clear_network<T>(mut self, v: std::option::Option<T>) -> Self
675        where
676            T: std::convert::Into<crate::model::Network>,
677        {
678            self.0.request.network = v.map(|x| x.into());
679            self
680        }
681
682        /// Sets the value of [request_id][crate::model::CreateNetworkRequest::request_id].
683        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
684            self.0.request.request_id = v.into();
685            self
686        }
687    }
688
689    #[doc(hidden)]
690    impl crate::RequestBuilder for CreateNetwork {
691        fn request_options(&mut self) -> &mut crate::RequestOptions {
692            &mut self.0.options
693        }
694    }
695
696    /// The request builder for [EdgeNetwork::delete_network][crate::client::EdgeNetwork::delete_network] calls.
697    ///
698    /// # Example
699    /// ```
700    /// # use google_cloud_edgenetwork_v1::builder::edge_network::DeleteNetwork;
701    /// # async fn sample() -> google_cloud_edgenetwork_v1::Result<()> {
702    /// use google_cloud_lro::Poller;
703    ///
704    /// let builder = prepare_request_builder();
705    /// let response = builder.poller().until_done().await?;
706    /// # Ok(()) }
707    ///
708    /// fn prepare_request_builder() -> DeleteNetwork {
709    ///   # panic!();
710    ///   // ... details omitted ...
711    /// }
712    /// ```
713    #[derive(Clone, Debug)]
714    pub struct DeleteNetwork(RequestBuilder<crate::model::DeleteNetworkRequest>);
715
716    impl DeleteNetwork {
717        pub(crate) fn new(
718            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
719        ) -> Self {
720            Self(RequestBuilder::new(stub))
721        }
722
723        /// Sets the full request, replacing any prior values.
724        pub fn with_request<V: Into<crate::model::DeleteNetworkRequest>>(mut self, v: V) -> Self {
725            self.0.request = v.into();
726            self
727        }
728
729        /// Sets all the options, replacing any prior values.
730        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
731            self.0.options = v.into();
732            self
733        }
734
735        /// Sends the request.
736        ///
737        /// # Long running operations
738        ///
739        /// This starts, but does not poll, a longrunning operation. More information
740        /// on [delete_network][crate::client::EdgeNetwork::delete_network].
741        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
742            (*self.0.stub)
743                .delete_network(self.0.request, self.0.options)
744                .await
745                .map(crate::Response::into_body)
746        }
747
748        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_network`.
749        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
750            type Operation =
751                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
752            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
753            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
754
755            let stub = self.0.stub.clone();
756            let mut options = self.0.options.clone();
757            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
758            let query = move |name| {
759                let stub = stub.clone();
760                let options = options.clone();
761                async {
762                    let op = GetOperation::new(stub)
763                        .set_name(name)
764                        .with_options(options)
765                        .send()
766                        .await?;
767                    Ok(Operation::new(op))
768                }
769            };
770
771            let start = move || async {
772                let op = self.send().await?;
773                Ok(Operation::new(op))
774            };
775
776            google_cloud_lro::internal::new_unit_response_poller(
777                polling_error_policy,
778                polling_backoff_policy,
779                start,
780                query,
781            )
782        }
783
784        /// Sets the value of [name][crate::model::DeleteNetworkRequest::name].
785        ///
786        /// This is a **required** field for requests.
787        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
788            self.0.request.name = v.into();
789            self
790        }
791
792        /// Sets the value of [request_id][crate::model::DeleteNetworkRequest::request_id].
793        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
794            self.0.request.request_id = v.into();
795            self
796        }
797    }
798
799    #[doc(hidden)]
800    impl crate::RequestBuilder for DeleteNetwork {
801        fn request_options(&mut self) -> &mut crate::RequestOptions {
802            &mut self.0.options
803        }
804    }
805
806    /// The request builder for [EdgeNetwork::list_subnets][crate::client::EdgeNetwork::list_subnets] calls.
807    ///
808    /// # Example
809    /// ```
810    /// # use google_cloud_edgenetwork_v1::builder::edge_network::ListSubnets;
811    /// # async fn sample() -> google_cloud_edgenetwork_v1::Result<()> {
812    /// use google_cloud_gax::paginator::ItemPaginator;
813    ///
814    /// let builder = prepare_request_builder();
815    /// let mut items = builder.by_item();
816    /// while let Some(result) = items.next().await {
817    ///   let item = result?;
818    /// }
819    /// # Ok(()) }
820    ///
821    /// fn prepare_request_builder() -> ListSubnets {
822    ///   # panic!();
823    ///   // ... details omitted ...
824    /// }
825    /// ```
826    #[derive(Clone, Debug)]
827    pub struct ListSubnets(RequestBuilder<crate::model::ListSubnetsRequest>);
828
829    impl ListSubnets {
830        pub(crate) fn new(
831            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
832        ) -> Self {
833            Self(RequestBuilder::new(stub))
834        }
835
836        /// Sets the full request, replacing any prior values.
837        pub fn with_request<V: Into<crate::model::ListSubnetsRequest>>(mut self, v: V) -> Self {
838            self.0.request = v.into();
839            self
840        }
841
842        /// Sets all the options, replacing any prior values.
843        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
844            self.0.options = v.into();
845            self
846        }
847
848        /// Sends the request.
849        pub async fn send(self) -> Result<crate::model::ListSubnetsResponse> {
850            (*self.0.stub)
851                .list_subnets(self.0.request, self.0.options)
852                .await
853                .map(crate::Response::into_body)
854        }
855
856        /// Streams each page in the collection.
857        pub fn by_page(
858            self,
859        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListSubnetsResponse, crate::Error>
860        {
861            use std::clone::Clone;
862            let token = self.0.request.page_token.clone();
863            let execute = move |token: String| {
864                let mut builder = self.clone();
865                builder.0.request = builder.0.request.set_page_token(token);
866                builder.send()
867            };
868            google_cloud_gax::paginator::internal::new_paginator(token, execute)
869        }
870
871        /// Streams each item in the collection.
872        pub fn by_item(
873            self,
874        ) -> impl google_cloud_gax::paginator::ItemPaginator<
875            crate::model::ListSubnetsResponse,
876            crate::Error,
877        > {
878            use google_cloud_gax::paginator::Paginator;
879            self.by_page().items()
880        }
881
882        /// Sets the value of [parent][crate::model::ListSubnetsRequest::parent].
883        ///
884        /// This is a **required** field for requests.
885        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
886            self.0.request.parent = v.into();
887            self
888        }
889
890        /// Sets the value of [page_size][crate::model::ListSubnetsRequest::page_size].
891        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
892            self.0.request.page_size = v.into();
893            self
894        }
895
896        /// Sets the value of [page_token][crate::model::ListSubnetsRequest::page_token].
897        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
898            self.0.request.page_token = v.into();
899            self
900        }
901
902        /// Sets the value of [filter][crate::model::ListSubnetsRequest::filter].
903        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
904            self.0.request.filter = v.into();
905            self
906        }
907
908        /// Sets the value of [order_by][crate::model::ListSubnetsRequest::order_by].
909        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
910            self.0.request.order_by = v.into();
911            self
912        }
913    }
914
915    #[doc(hidden)]
916    impl crate::RequestBuilder for ListSubnets {
917        fn request_options(&mut self) -> &mut crate::RequestOptions {
918            &mut self.0.options
919        }
920    }
921
922    /// The request builder for [EdgeNetwork::get_subnet][crate::client::EdgeNetwork::get_subnet] calls.
923    ///
924    /// # Example
925    /// ```
926    /// # use google_cloud_edgenetwork_v1::builder::edge_network::GetSubnet;
927    /// # async fn sample() -> google_cloud_edgenetwork_v1::Result<()> {
928    ///
929    /// let builder = prepare_request_builder();
930    /// let response = builder.send().await?;
931    /// # Ok(()) }
932    ///
933    /// fn prepare_request_builder() -> GetSubnet {
934    ///   # panic!();
935    ///   // ... details omitted ...
936    /// }
937    /// ```
938    #[derive(Clone, Debug)]
939    pub struct GetSubnet(RequestBuilder<crate::model::GetSubnetRequest>);
940
941    impl GetSubnet {
942        pub(crate) fn new(
943            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
944        ) -> Self {
945            Self(RequestBuilder::new(stub))
946        }
947
948        /// Sets the full request, replacing any prior values.
949        pub fn with_request<V: Into<crate::model::GetSubnetRequest>>(mut self, v: V) -> Self {
950            self.0.request = v.into();
951            self
952        }
953
954        /// Sets all the options, replacing any prior values.
955        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
956            self.0.options = v.into();
957            self
958        }
959
960        /// Sends the request.
961        pub async fn send(self) -> Result<crate::model::Subnet> {
962            (*self.0.stub)
963                .get_subnet(self.0.request, self.0.options)
964                .await
965                .map(crate::Response::into_body)
966        }
967
968        /// Sets the value of [name][crate::model::GetSubnetRequest::name].
969        ///
970        /// This is a **required** field for requests.
971        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
972            self.0.request.name = v.into();
973            self
974        }
975    }
976
977    #[doc(hidden)]
978    impl crate::RequestBuilder for GetSubnet {
979        fn request_options(&mut self) -> &mut crate::RequestOptions {
980            &mut self.0.options
981        }
982    }
983
984    /// The request builder for [EdgeNetwork::create_subnet][crate::client::EdgeNetwork::create_subnet] calls.
985    ///
986    /// # Example
987    /// ```
988    /// # use google_cloud_edgenetwork_v1::builder::edge_network::CreateSubnet;
989    /// # async fn sample() -> google_cloud_edgenetwork_v1::Result<()> {
990    /// use google_cloud_lro::Poller;
991    ///
992    /// let builder = prepare_request_builder();
993    /// let response = builder.poller().until_done().await?;
994    /// # Ok(()) }
995    ///
996    /// fn prepare_request_builder() -> CreateSubnet {
997    ///   # panic!();
998    ///   // ... details omitted ...
999    /// }
1000    /// ```
1001    #[derive(Clone, Debug)]
1002    pub struct CreateSubnet(RequestBuilder<crate::model::CreateSubnetRequest>);
1003
1004    impl CreateSubnet {
1005        pub(crate) fn new(
1006            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
1007        ) -> Self {
1008            Self(RequestBuilder::new(stub))
1009        }
1010
1011        /// Sets the full request, replacing any prior values.
1012        pub fn with_request<V: Into<crate::model::CreateSubnetRequest>>(mut self, v: V) -> Self {
1013            self.0.request = v.into();
1014            self
1015        }
1016
1017        /// Sets all the options, replacing any prior values.
1018        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1019            self.0.options = v.into();
1020            self
1021        }
1022
1023        /// Sends the request.
1024        ///
1025        /// # Long running operations
1026        ///
1027        /// This starts, but does not poll, a longrunning operation. More information
1028        /// on [create_subnet][crate::client::EdgeNetwork::create_subnet].
1029        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1030            (*self.0.stub)
1031                .create_subnet(self.0.request, self.0.options)
1032                .await
1033                .map(crate::Response::into_body)
1034        }
1035
1036        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_subnet`.
1037        pub fn poller(
1038            self,
1039        ) -> impl google_cloud_lro::Poller<crate::model::Subnet, crate::model::OperationMetadata>
1040        {
1041            type Operation = google_cloud_lro::internal::Operation<
1042                crate::model::Subnet,
1043                crate::model::OperationMetadata,
1044            >;
1045            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1046            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1047
1048            let stub = self.0.stub.clone();
1049            let mut options = self.0.options.clone();
1050            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1051            let query = move |name| {
1052                let stub = stub.clone();
1053                let options = options.clone();
1054                async {
1055                    let op = GetOperation::new(stub)
1056                        .set_name(name)
1057                        .with_options(options)
1058                        .send()
1059                        .await?;
1060                    Ok(Operation::new(op))
1061                }
1062            };
1063
1064            let start = move || async {
1065                let op = self.send().await?;
1066                Ok(Operation::new(op))
1067            };
1068
1069            google_cloud_lro::internal::new_poller(
1070                polling_error_policy,
1071                polling_backoff_policy,
1072                start,
1073                query,
1074            )
1075        }
1076
1077        /// Sets the value of [parent][crate::model::CreateSubnetRequest::parent].
1078        ///
1079        /// This is a **required** field for requests.
1080        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1081            self.0.request.parent = v.into();
1082            self
1083        }
1084
1085        /// Sets the value of [subnet_id][crate::model::CreateSubnetRequest::subnet_id].
1086        ///
1087        /// This is a **required** field for requests.
1088        pub fn set_subnet_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1089            self.0.request.subnet_id = v.into();
1090            self
1091        }
1092
1093        /// Sets the value of [subnet][crate::model::CreateSubnetRequest::subnet].
1094        ///
1095        /// This is a **required** field for requests.
1096        pub fn set_subnet<T>(mut self, v: T) -> Self
1097        where
1098            T: std::convert::Into<crate::model::Subnet>,
1099        {
1100            self.0.request.subnet = std::option::Option::Some(v.into());
1101            self
1102        }
1103
1104        /// Sets or clears the value of [subnet][crate::model::CreateSubnetRequest::subnet].
1105        ///
1106        /// This is a **required** field for requests.
1107        pub fn set_or_clear_subnet<T>(mut self, v: std::option::Option<T>) -> Self
1108        where
1109            T: std::convert::Into<crate::model::Subnet>,
1110        {
1111            self.0.request.subnet = v.map(|x| x.into());
1112            self
1113        }
1114
1115        /// Sets the value of [request_id][crate::model::CreateSubnetRequest::request_id].
1116        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1117            self.0.request.request_id = v.into();
1118            self
1119        }
1120    }
1121
1122    #[doc(hidden)]
1123    impl crate::RequestBuilder for CreateSubnet {
1124        fn request_options(&mut self) -> &mut crate::RequestOptions {
1125            &mut self.0.options
1126        }
1127    }
1128
1129    /// The request builder for [EdgeNetwork::update_subnet][crate::client::EdgeNetwork::update_subnet] calls.
1130    ///
1131    /// # Example
1132    /// ```
1133    /// # use google_cloud_edgenetwork_v1::builder::edge_network::UpdateSubnet;
1134    /// # async fn sample() -> google_cloud_edgenetwork_v1::Result<()> {
1135    /// use google_cloud_lro::Poller;
1136    ///
1137    /// let builder = prepare_request_builder();
1138    /// let response = builder.poller().until_done().await?;
1139    /// # Ok(()) }
1140    ///
1141    /// fn prepare_request_builder() -> UpdateSubnet {
1142    ///   # panic!();
1143    ///   // ... details omitted ...
1144    /// }
1145    /// ```
1146    #[derive(Clone, Debug)]
1147    pub struct UpdateSubnet(RequestBuilder<crate::model::UpdateSubnetRequest>);
1148
1149    impl UpdateSubnet {
1150        pub(crate) fn new(
1151            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
1152        ) -> Self {
1153            Self(RequestBuilder::new(stub))
1154        }
1155
1156        /// Sets the full request, replacing any prior values.
1157        pub fn with_request<V: Into<crate::model::UpdateSubnetRequest>>(mut self, v: V) -> Self {
1158            self.0.request = v.into();
1159            self
1160        }
1161
1162        /// Sets all the options, replacing any prior values.
1163        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1164            self.0.options = v.into();
1165            self
1166        }
1167
1168        /// Sends the request.
1169        ///
1170        /// # Long running operations
1171        ///
1172        /// This starts, but does not poll, a longrunning operation. More information
1173        /// on [update_subnet][crate::client::EdgeNetwork::update_subnet].
1174        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1175            (*self.0.stub)
1176                .update_subnet(self.0.request, self.0.options)
1177                .await
1178                .map(crate::Response::into_body)
1179        }
1180
1181        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_subnet`.
1182        pub fn poller(
1183            self,
1184        ) -> impl google_cloud_lro::Poller<crate::model::Subnet, crate::model::OperationMetadata>
1185        {
1186            type Operation = google_cloud_lro::internal::Operation<
1187                crate::model::Subnet,
1188                crate::model::OperationMetadata,
1189            >;
1190            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1191            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1192
1193            let stub = self.0.stub.clone();
1194            let mut options = self.0.options.clone();
1195            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1196            let query = move |name| {
1197                let stub = stub.clone();
1198                let options = options.clone();
1199                async {
1200                    let op = GetOperation::new(stub)
1201                        .set_name(name)
1202                        .with_options(options)
1203                        .send()
1204                        .await?;
1205                    Ok(Operation::new(op))
1206                }
1207            };
1208
1209            let start = move || async {
1210                let op = self.send().await?;
1211                Ok(Operation::new(op))
1212            };
1213
1214            google_cloud_lro::internal::new_poller(
1215                polling_error_policy,
1216                polling_backoff_policy,
1217                start,
1218                query,
1219            )
1220        }
1221
1222        /// Sets the value of [update_mask][crate::model::UpdateSubnetRequest::update_mask].
1223        ///
1224        /// This is a **required** field for requests.
1225        pub fn set_update_mask<T>(mut self, v: T) -> Self
1226        where
1227            T: std::convert::Into<wkt::FieldMask>,
1228        {
1229            self.0.request.update_mask = std::option::Option::Some(v.into());
1230            self
1231        }
1232
1233        /// Sets or clears the value of [update_mask][crate::model::UpdateSubnetRequest::update_mask].
1234        ///
1235        /// This is a **required** field for requests.
1236        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1237        where
1238            T: std::convert::Into<wkt::FieldMask>,
1239        {
1240            self.0.request.update_mask = v.map(|x| x.into());
1241            self
1242        }
1243
1244        /// Sets the value of [subnet][crate::model::UpdateSubnetRequest::subnet].
1245        ///
1246        /// This is a **required** field for requests.
1247        pub fn set_subnet<T>(mut self, v: T) -> Self
1248        where
1249            T: std::convert::Into<crate::model::Subnet>,
1250        {
1251            self.0.request.subnet = std::option::Option::Some(v.into());
1252            self
1253        }
1254
1255        /// Sets or clears the value of [subnet][crate::model::UpdateSubnetRequest::subnet].
1256        ///
1257        /// This is a **required** field for requests.
1258        pub fn set_or_clear_subnet<T>(mut self, v: std::option::Option<T>) -> Self
1259        where
1260            T: std::convert::Into<crate::model::Subnet>,
1261        {
1262            self.0.request.subnet = v.map(|x| x.into());
1263            self
1264        }
1265
1266        /// Sets the value of [request_id][crate::model::UpdateSubnetRequest::request_id].
1267        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1268            self.0.request.request_id = v.into();
1269            self
1270        }
1271    }
1272
1273    #[doc(hidden)]
1274    impl crate::RequestBuilder for UpdateSubnet {
1275        fn request_options(&mut self) -> &mut crate::RequestOptions {
1276            &mut self.0.options
1277        }
1278    }
1279
1280    /// The request builder for [EdgeNetwork::delete_subnet][crate::client::EdgeNetwork::delete_subnet] calls.
1281    ///
1282    /// # Example
1283    /// ```
1284    /// # use google_cloud_edgenetwork_v1::builder::edge_network::DeleteSubnet;
1285    /// # async fn sample() -> google_cloud_edgenetwork_v1::Result<()> {
1286    /// use google_cloud_lro::Poller;
1287    ///
1288    /// let builder = prepare_request_builder();
1289    /// let response = builder.poller().until_done().await?;
1290    /// # Ok(()) }
1291    ///
1292    /// fn prepare_request_builder() -> DeleteSubnet {
1293    ///   # panic!();
1294    ///   // ... details omitted ...
1295    /// }
1296    /// ```
1297    #[derive(Clone, Debug)]
1298    pub struct DeleteSubnet(RequestBuilder<crate::model::DeleteSubnetRequest>);
1299
1300    impl DeleteSubnet {
1301        pub(crate) fn new(
1302            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
1303        ) -> Self {
1304            Self(RequestBuilder::new(stub))
1305        }
1306
1307        /// Sets the full request, replacing any prior values.
1308        pub fn with_request<V: Into<crate::model::DeleteSubnetRequest>>(mut self, v: V) -> Self {
1309            self.0.request = v.into();
1310            self
1311        }
1312
1313        /// Sets all the options, replacing any prior values.
1314        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1315            self.0.options = v.into();
1316            self
1317        }
1318
1319        /// Sends the request.
1320        ///
1321        /// # Long running operations
1322        ///
1323        /// This starts, but does not poll, a longrunning operation. More information
1324        /// on [delete_subnet][crate::client::EdgeNetwork::delete_subnet].
1325        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1326            (*self.0.stub)
1327                .delete_subnet(self.0.request, self.0.options)
1328                .await
1329                .map(crate::Response::into_body)
1330        }
1331
1332        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_subnet`.
1333        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1334            type Operation =
1335                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1336            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1337            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1338
1339            let stub = self.0.stub.clone();
1340            let mut options = self.0.options.clone();
1341            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1342            let query = move |name| {
1343                let stub = stub.clone();
1344                let options = options.clone();
1345                async {
1346                    let op = GetOperation::new(stub)
1347                        .set_name(name)
1348                        .with_options(options)
1349                        .send()
1350                        .await?;
1351                    Ok(Operation::new(op))
1352                }
1353            };
1354
1355            let start = move || async {
1356                let op = self.send().await?;
1357                Ok(Operation::new(op))
1358            };
1359
1360            google_cloud_lro::internal::new_unit_response_poller(
1361                polling_error_policy,
1362                polling_backoff_policy,
1363                start,
1364                query,
1365            )
1366        }
1367
1368        /// Sets the value of [name][crate::model::DeleteSubnetRequest::name].
1369        ///
1370        /// This is a **required** field for requests.
1371        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1372            self.0.request.name = v.into();
1373            self
1374        }
1375
1376        /// Sets the value of [request_id][crate::model::DeleteSubnetRequest::request_id].
1377        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1378            self.0.request.request_id = v.into();
1379            self
1380        }
1381    }
1382
1383    #[doc(hidden)]
1384    impl crate::RequestBuilder for DeleteSubnet {
1385        fn request_options(&mut self) -> &mut crate::RequestOptions {
1386            &mut self.0.options
1387        }
1388    }
1389
1390    /// The request builder for [EdgeNetwork::list_interconnects][crate::client::EdgeNetwork::list_interconnects] calls.
1391    ///
1392    /// # Example
1393    /// ```
1394    /// # use google_cloud_edgenetwork_v1::builder::edge_network::ListInterconnects;
1395    /// # async fn sample() -> google_cloud_edgenetwork_v1::Result<()> {
1396    /// use google_cloud_gax::paginator::ItemPaginator;
1397    ///
1398    /// let builder = prepare_request_builder();
1399    /// let mut items = builder.by_item();
1400    /// while let Some(result) = items.next().await {
1401    ///   let item = result?;
1402    /// }
1403    /// # Ok(()) }
1404    ///
1405    /// fn prepare_request_builder() -> ListInterconnects {
1406    ///   # panic!();
1407    ///   // ... details omitted ...
1408    /// }
1409    /// ```
1410    #[derive(Clone, Debug)]
1411    pub struct ListInterconnects(RequestBuilder<crate::model::ListInterconnectsRequest>);
1412
1413    impl ListInterconnects {
1414        pub(crate) fn new(
1415            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
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::ListInterconnectsRequest>>(
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<crate::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::ListInterconnectsResponse> {
1437            (*self.0.stub)
1438                .list_interconnects(self.0.request, self.0.options)
1439                .await
1440                .map(crate::Response::into_body)
1441        }
1442
1443        /// Streams each page in the collection.
1444        pub fn by_page(
1445            self,
1446        ) -> impl google_cloud_gax::paginator::Paginator<
1447            crate::model::ListInterconnectsResponse,
1448            crate::Error,
1449        > {
1450            use std::clone::Clone;
1451            let token = self.0.request.page_token.clone();
1452            let execute = move |token: String| {
1453                let mut builder = self.clone();
1454                builder.0.request = builder.0.request.set_page_token(token);
1455                builder.send()
1456            };
1457            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1458        }
1459
1460        /// Streams each item in the collection.
1461        pub fn by_item(
1462            self,
1463        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1464            crate::model::ListInterconnectsResponse,
1465            crate::Error,
1466        > {
1467            use google_cloud_gax::paginator::Paginator;
1468            self.by_page().items()
1469        }
1470
1471        /// Sets the value of [parent][crate::model::ListInterconnectsRequest::parent].
1472        ///
1473        /// This is a **required** field for requests.
1474        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1475            self.0.request.parent = v.into();
1476            self
1477        }
1478
1479        /// Sets the value of [page_size][crate::model::ListInterconnectsRequest::page_size].
1480        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1481            self.0.request.page_size = v.into();
1482            self
1483        }
1484
1485        /// Sets the value of [page_token][crate::model::ListInterconnectsRequest::page_token].
1486        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1487            self.0.request.page_token = v.into();
1488            self
1489        }
1490
1491        /// Sets the value of [filter][crate::model::ListInterconnectsRequest::filter].
1492        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1493            self.0.request.filter = v.into();
1494            self
1495        }
1496
1497        /// Sets the value of [order_by][crate::model::ListInterconnectsRequest::order_by].
1498        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1499            self.0.request.order_by = v.into();
1500            self
1501        }
1502    }
1503
1504    #[doc(hidden)]
1505    impl crate::RequestBuilder for ListInterconnects {
1506        fn request_options(&mut self) -> &mut crate::RequestOptions {
1507            &mut self.0.options
1508        }
1509    }
1510
1511    /// The request builder for [EdgeNetwork::get_interconnect][crate::client::EdgeNetwork::get_interconnect] calls.
1512    ///
1513    /// # Example
1514    /// ```
1515    /// # use google_cloud_edgenetwork_v1::builder::edge_network::GetInterconnect;
1516    /// # async fn sample() -> google_cloud_edgenetwork_v1::Result<()> {
1517    ///
1518    /// let builder = prepare_request_builder();
1519    /// let response = builder.send().await?;
1520    /// # Ok(()) }
1521    ///
1522    /// fn prepare_request_builder() -> GetInterconnect {
1523    ///   # panic!();
1524    ///   // ... details omitted ...
1525    /// }
1526    /// ```
1527    #[derive(Clone, Debug)]
1528    pub struct GetInterconnect(RequestBuilder<crate::model::GetInterconnectRequest>);
1529
1530    impl GetInterconnect {
1531        pub(crate) fn new(
1532            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
1533        ) -> Self {
1534            Self(RequestBuilder::new(stub))
1535        }
1536
1537        /// Sets the full request, replacing any prior values.
1538        pub fn with_request<V: Into<crate::model::GetInterconnectRequest>>(mut self, v: V) -> Self {
1539            self.0.request = v.into();
1540            self
1541        }
1542
1543        /// Sets all the options, replacing any prior values.
1544        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1545            self.0.options = v.into();
1546            self
1547        }
1548
1549        /// Sends the request.
1550        pub async fn send(self) -> Result<crate::model::Interconnect> {
1551            (*self.0.stub)
1552                .get_interconnect(self.0.request, self.0.options)
1553                .await
1554                .map(crate::Response::into_body)
1555        }
1556
1557        /// Sets the value of [name][crate::model::GetInterconnectRequest::name].
1558        ///
1559        /// This is a **required** field for requests.
1560        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1561            self.0.request.name = v.into();
1562            self
1563        }
1564    }
1565
1566    #[doc(hidden)]
1567    impl crate::RequestBuilder for GetInterconnect {
1568        fn request_options(&mut self) -> &mut crate::RequestOptions {
1569            &mut self.0.options
1570        }
1571    }
1572
1573    /// The request builder for [EdgeNetwork::diagnose_interconnect][crate::client::EdgeNetwork::diagnose_interconnect] calls.
1574    ///
1575    /// # Example
1576    /// ```
1577    /// # use google_cloud_edgenetwork_v1::builder::edge_network::DiagnoseInterconnect;
1578    /// # async fn sample() -> google_cloud_edgenetwork_v1::Result<()> {
1579    ///
1580    /// let builder = prepare_request_builder();
1581    /// let response = builder.send().await?;
1582    /// # Ok(()) }
1583    ///
1584    /// fn prepare_request_builder() -> DiagnoseInterconnect {
1585    ///   # panic!();
1586    ///   // ... details omitted ...
1587    /// }
1588    /// ```
1589    #[derive(Clone, Debug)]
1590    pub struct DiagnoseInterconnect(RequestBuilder<crate::model::DiagnoseInterconnectRequest>);
1591
1592    impl DiagnoseInterconnect {
1593        pub(crate) fn new(
1594            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
1595        ) -> Self {
1596            Self(RequestBuilder::new(stub))
1597        }
1598
1599        /// Sets the full request, replacing any prior values.
1600        pub fn with_request<V: Into<crate::model::DiagnoseInterconnectRequest>>(
1601            mut self,
1602            v: V,
1603        ) -> Self {
1604            self.0.request = v.into();
1605            self
1606        }
1607
1608        /// Sets all the options, replacing any prior values.
1609        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1610            self.0.options = v.into();
1611            self
1612        }
1613
1614        /// Sends the request.
1615        pub async fn send(self) -> Result<crate::model::DiagnoseInterconnectResponse> {
1616            (*self.0.stub)
1617                .diagnose_interconnect(self.0.request, self.0.options)
1618                .await
1619                .map(crate::Response::into_body)
1620        }
1621
1622        /// Sets the value of [name][crate::model::DiagnoseInterconnectRequest::name].
1623        ///
1624        /// This is a **required** field for requests.
1625        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1626            self.0.request.name = v.into();
1627            self
1628        }
1629    }
1630
1631    #[doc(hidden)]
1632    impl crate::RequestBuilder for DiagnoseInterconnect {
1633        fn request_options(&mut self) -> &mut crate::RequestOptions {
1634            &mut self.0.options
1635        }
1636    }
1637
1638    /// The request builder for [EdgeNetwork::list_interconnect_attachments][crate::client::EdgeNetwork::list_interconnect_attachments] calls.
1639    ///
1640    /// # Example
1641    /// ```
1642    /// # use google_cloud_edgenetwork_v1::builder::edge_network::ListInterconnectAttachments;
1643    /// # async fn sample() -> google_cloud_edgenetwork_v1::Result<()> {
1644    /// use google_cloud_gax::paginator::ItemPaginator;
1645    ///
1646    /// let builder = prepare_request_builder();
1647    /// let mut items = builder.by_item();
1648    /// while let Some(result) = items.next().await {
1649    ///   let item = result?;
1650    /// }
1651    /// # Ok(()) }
1652    ///
1653    /// fn prepare_request_builder() -> ListInterconnectAttachments {
1654    ///   # panic!();
1655    ///   // ... details omitted ...
1656    /// }
1657    /// ```
1658    #[derive(Clone, Debug)]
1659    pub struct ListInterconnectAttachments(
1660        RequestBuilder<crate::model::ListInterconnectAttachmentsRequest>,
1661    );
1662
1663    impl ListInterconnectAttachments {
1664        pub(crate) fn new(
1665            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
1666        ) -> Self {
1667            Self(RequestBuilder::new(stub))
1668        }
1669
1670        /// Sets the full request, replacing any prior values.
1671        pub fn with_request<V: Into<crate::model::ListInterconnectAttachmentsRequest>>(
1672            mut self,
1673            v: V,
1674        ) -> Self {
1675            self.0.request = v.into();
1676            self
1677        }
1678
1679        /// Sets all the options, replacing any prior values.
1680        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1681            self.0.options = v.into();
1682            self
1683        }
1684
1685        /// Sends the request.
1686        pub async fn send(self) -> Result<crate::model::ListInterconnectAttachmentsResponse> {
1687            (*self.0.stub)
1688                .list_interconnect_attachments(self.0.request, self.0.options)
1689                .await
1690                .map(crate::Response::into_body)
1691        }
1692
1693        /// Streams each page in the collection.
1694        pub fn by_page(
1695            self,
1696        ) -> impl google_cloud_gax::paginator::Paginator<
1697            crate::model::ListInterconnectAttachmentsResponse,
1698            crate::Error,
1699        > {
1700            use std::clone::Clone;
1701            let token = self.0.request.page_token.clone();
1702            let execute = move |token: String| {
1703                let mut builder = self.clone();
1704                builder.0.request = builder.0.request.set_page_token(token);
1705                builder.send()
1706            };
1707            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1708        }
1709
1710        /// Streams each item in the collection.
1711        pub fn by_item(
1712            self,
1713        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1714            crate::model::ListInterconnectAttachmentsResponse,
1715            crate::Error,
1716        > {
1717            use google_cloud_gax::paginator::Paginator;
1718            self.by_page().items()
1719        }
1720
1721        /// Sets the value of [parent][crate::model::ListInterconnectAttachmentsRequest::parent].
1722        ///
1723        /// This is a **required** field for requests.
1724        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1725            self.0.request.parent = v.into();
1726            self
1727        }
1728
1729        /// Sets the value of [page_size][crate::model::ListInterconnectAttachmentsRequest::page_size].
1730        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1731            self.0.request.page_size = v.into();
1732            self
1733        }
1734
1735        /// Sets the value of [page_token][crate::model::ListInterconnectAttachmentsRequest::page_token].
1736        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1737            self.0.request.page_token = v.into();
1738            self
1739        }
1740
1741        /// Sets the value of [filter][crate::model::ListInterconnectAttachmentsRequest::filter].
1742        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1743            self.0.request.filter = v.into();
1744            self
1745        }
1746
1747        /// Sets the value of [order_by][crate::model::ListInterconnectAttachmentsRequest::order_by].
1748        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1749            self.0.request.order_by = v.into();
1750            self
1751        }
1752    }
1753
1754    #[doc(hidden)]
1755    impl crate::RequestBuilder for ListInterconnectAttachments {
1756        fn request_options(&mut self) -> &mut crate::RequestOptions {
1757            &mut self.0.options
1758        }
1759    }
1760
1761    /// The request builder for [EdgeNetwork::get_interconnect_attachment][crate::client::EdgeNetwork::get_interconnect_attachment] calls.
1762    ///
1763    /// # Example
1764    /// ```
1765    /// # use google_cloud_edgenetwork_v1::builder::edge_network::GetInterconnectAttachment;
1766    /// # async fn sample() -> google_cloud_edgenetwork_v1::Result<()> {
1767    ///
1768    /// let builder = prepare_request_builder();
1769    /// let response = builder.send().await?;
1770    /// # Ok(()) }
1771    ///
1772    /// fn prepare_request_builder() -> GetInterconnectAttachment {
1773    ///   # panic!();
1774    ///   // ... details omitted ...
1775    /// }
1776    /// ```
1777    #[derive(Clone, Debug)]
1778    pub struct GetInterconnectAttachment(
1779        RequestBuilder<crate::model::GetInterconnectAttachmentRequest>,
1780    );
1781
1782    impl GetInterconnectAttachment {
1783        pub(crate) fn new(
1784            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
1785        ) -> Self {
1786            Self(RequestBuilder::new(stub))
1787        }
1788
1789        /// Sets the full request, replacing any prior values.
1790        pub fn with_request<V: Into<crate::model::GetInterconnectAttachmentRequest>>(
1791            mut self,
1792            v: V,
1793        ) -> Self {
1794            self.0.request = v.into();
1795            self
1796        }
1797
1798        /// Sets all the options, replacing any prior values.
1799        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1800            self.0.options = v.into();
1801            self
1802        }
1803
1804        /// Sends the request.
1805        pub async fn send(self) -> Result<crate::model::InterconnectAttachment> {
1806            (*self.0.stub)
1807                .get_interconnect_attachment(self.0.request, self.0.options)
1808                .await
1809                .map(crate::Response::into_body)
1810        }
1811
1812        /// Sets the value of [name][crate::model::GetInterconnectAttachmentRequest::name].
1813        ///
1814        /// This is a **required** field for requests.
1815        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1816            self.0.request.name = v.into();
1817            self
1818        }
1819    }
1820
1821    #[doc(hidden)]
1822    impl crate::RequestBuilder for GetInterconnectAttachment {
1823        fn request_options(&mut self) -> &mut crate::RequestOptions {
1824            &mut self.0.options
1825        }
1826    }
1827
1828    /// The request builder for [EdgeNetwork::create_interconnect_attachment][crate::client::EdgeNetwork::create_interconnect_attachment] calls.
1829    ///
1830    /// # Example
1831    /// ```
1832    /// # use google_cloud_edgenetwork_v1::builder::edge_network::CreateInterconnectAttachment;
1833    /// # async fn sample() -> google_cloud_edgenetwork_v1::Result<()> {
1834    /// use google_cloud_lro::Poller;
1835    ///
1836    /// let builder = prepare_request_builder();
1837    /// let response = builder.poller().until_done().await?;
1838    /// # Ok(()) }
1839    ///
1840    /// fn prepare_request_builder() -> CreateInterconnectAttachment {
1841    ///   # panic!();
1842    ///   // ... details omitted ...
1843    /// }
1844    /// ```
1845    #[derive(Clone, Debug)]
1846    pub struct CreateInterconnectAttachment(
1847        RequestBuilder<crate::model::CreateInterconnectAttachmentRequest>,
1848    );
1849
1850    impl CreateInterconnectAttachment {
1851        pub(crate) fn new(
1852            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
1853        ) -> Self {
1854            Self(RequestBuilder::new(stub))
1855        }
1856
1857        /// Sets the full request, replacing any prior values.
1858        pub fn with_request<V: Into<crate::model::CreateInterconnectAttachmentRequest>>(
1859            mut self,
1860            v: V,
1861        ) -> Self {
1862            self.0.request = v.into();
1863            self
1864        }
1865
1866        /// Sets all the options, replacing any prior values.
1867        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1868            self.0.options = v.into();
1869            self
1870        }
1871
1872        /// Sends the request.
1873        ///
1874        /// # Long running operations
1875        ///
1876        /// This starts, but does not poll, a longrunning operation. More information
1877        /// on [create_interconnect_attachment][crate::client::EdgeNetwork::create_interconnect_attachment].
1878        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1879            (*self.0.stub)
1880                .create_interconnect_attachment(self.0.request, self.0.options)
1881                .await
1882                .map(crate::Response::into_body)
1883        }
1884
1885        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_interconnect_attachment`.
1886        pub fn poller(
1887            self,
1888        ) -> impl google_cloud_lro::Poller<
1889            crate::model::InterconnectAttachment,
1890            crate::model::OperationMetadata,
1891        > {
1892            type Operation = google_cloud_lro::internal::Operation<
1893                crate::model::InterconnectAttachment,
1894                crate::model::OperationMetadata,
1895            >;
1896            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1897            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1898
1899            let stub = self.0.stub.clone();
1900            let mut options = self.0.options.clone();
1901            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1902            let query = move |name| {
1903                let stub = stub.clone();
1904                let options = options.clone();
1905                async {
1906                    let op = GetOperation::new(stub)
1907                        .set_name(name)
1908                        .with_options(options)
1909                        .send()
1910                        .await?;
1911                    Ok(Operation::new(op))
1912                }
1913            };
1914
1915            let start = move || async {
1916                let op = self.send().await?;
1917                Ok(Operation::new(op))
1918            };
1919
1920            google_cloud_lro::internal::new_poller(
1921                polling_error_policy,
1922                polling_backoff_policy,
1923                start,
1924                query,
1925            )
1926        }
1927
1928        /// Sets the value of [parent][crate::model::CreateInterconnectAttachmentRequest::parent].
1929        ///
1930        /// This is a **required** field for requests.
1931        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1932            self.0.request.parent = v.into();
1933            self
1934        }
1935
1936        /// Sets the value of [interconnect_attachment_id][crate::model::CreateInterconnectAttachmentRequest::interconnect_attachment_id].
1937        ///
1938        /// This is a **required** field for requests.
1939        pub fn set_interconnect_attachment_id<T: Into<std::string::String>>(
1940            mut self,
1941            v: T,
1942        ) -> Self {
1943            self.0.request.interconnect_attachment_id = v.into();
1944            self
1945        }
1946
1947        /// Sets the value of [interconnect_attachment][crate::model::CreateInterconnectAttachmentRequest::interconnect_attachment].
1948        ///
1949        /// This is a **required** field for requests.
1950        pub fn set_interconnect_attachment<T>(mut self, v: T) -> Self
1951        where
1952            T: std::convert::Into<crate::model::InterconnectAttachment>,
1953        {
1954            self.0.request.interconnect_attachment = std::option::Option::Some(v.into());
1955            self
1956        }
1957
1958        /// Sets or clears the value of [interconnect_attachment][crate::model::CreateInterconnectAttachmentRequest::interconnect_attachment].
1959        ///
1960        /// This is a **required** field for requests.
1961        pub fn set_or_clear_interconnect_attachment<T>(mut self, v: std::option::Option<T>) -> Self
1962        where
1963            T: std::convert::Into<crate::model::InterconnectAttachment>,
1964        {
1965            self.0.request.interconnect_attachment = v.map(|x| x.into());
1966            self
1967        }
1968
1969        /// Sets the value of [request_id][crate::model::CreateInterconnectAttachmentRequest::request_id].
1970        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1971            self.0.request.request_id = v.into();
1972            self
1973        }
1974    }
1975
1976    #[doc(hidden)]
1977    impl crate::RequestBuilder for CreateInterconnectAttachment {
1978        fn request_options(&mut self) -> &mut crate::RequestOptions {
1979            &mut self.0.options
1980        }
1981    }
1982
1983    /// The request builder for [EdgeNetwork::delete_interconnect_attachment][crate::client::EdgeNetwork::delete_interconnect_attachment] calls.
1984    ///
1985    /// # Example
1986    /// ```
1987    /// # use google_cloud_edgenetwork_v1::builder::edge_network::DeleteInterconnectAttachment;
1988    /// # async fn sample() -> google_cloud_edgenetwork_v1::Result<()> {
1989    /// use google_cloud_lro::Poller;
1990    ///
1991    /// let builder = prepare_request_builder();
1992    /// let response = builder.poller().until_done().await?;
1993    /// # Ok(()) }
1994    ///
1995    /// fn prepare_request_builder() -> DeleteInterconnectAttachment {
1996    ///   # panic!();
1997    ///   // ... details omitted ...
1998    /// }
1999    /// ```
2000    #[derive(Clone, Debug)]
2001    pub struct DeleteInterconnectAttachment(
2002        RequestBuilder<crate::model::DeleteInterconnectAttachmentRequest>,
2003    );
2004
2005    impl DeleteInterconnectAttachment {
2006        pub(crate) fn new(
2007            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
2008        ) -> Self {
2009            Self(RequestBuilder::new(stub))
2010        }
2011
2012        /// Sets the full request, replacing any prior values.
2013        pub fn with_request<V: Into<crate::model::DeleteInterconnectAttachmentRequest>>(
2014            mut self,
2015            v: V,
2016        ) -> Self {
2017            self.0.request = v.into();
2018            self
2019        }
2020
2021        /// Sets all the options, replacing any prior values.
2022        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2023            self.0.options = v.into();
2024            self
2025        }
2026
2027        /// Sends the request.
2028        ///
2029        /// # Long running operations
2030        ///
2031        /// This starts, but does not poll, a longrunning operation. More information
2032        /// on [delete_interconnect_attachment][crate::client::EdgeNetwork::delete_interconnect_attachment].
2033        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2034            (*self.0.stub)
2035                .delete_interconnect_attachment(self.0.request, self.0.options)
2036                .await
2037                .map(crate::Response::into_body)
2038        }
2039
2040        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_interconnect_attachment`.
2041        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2042            type Operation =
2043                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2044            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2045            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2046
2047            let stub = self.0.stub.clone();
2048            let mut options = self.0.options.clone();
2049            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2050            let query = move |name| {
2051                let stub = stub.clone();
2052                let options = options.clone();
2053                async {
2054                    let op = GetOperation::new(stub)
2055                        .set_name(name)
2056                        .with_options(options)
2057                        .send()
2058                        .await?;
2059                    Ok(Operation::new(op))
2060                }
2061            };
2062
2063            let start = move || async {
2064                let op = self.send().await?;
2065                Ok(Operation::new(op))
2066            };
2067
2068            google_cloud_lro::internal::new_unit_response_poller(
2069                polling_error_policy,
2070                polling_backoff_policy,
2071                start,
2072                query,
2073            )
2074        }
2075
2076        /// Sets the value of [name][crate::model::DeleteInterconnectAttachmentRequest::name].
2077        ///
2078        /// This is a **required** field for requests.
2079        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2080            self.0.request.name = v.into();
2081            self
2082        }
2083
2084        /// Sets the value of [request_id][crate::model::DeleteInterconnectAttachmentRequest::request_id].
2085        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2086            self.0.request.request_id = v.into();
2087            self
2088        }
2089    }
2090
2091    #[doc(hidden)]
2092    impl crate::RequestBuilder for DeleteInterconnectAttachment {
2093        fn request_options(&mut self) -> &mut crate::RequestOptions {
2094            &mut self.0.options
2095        }
2096    }
2097
2098    /// The request builder for [EdgeNetwork::list_routers][crate::client::EdgeNetwork::list_routers] calls.
2099    ///
2100    /// # Example
2101    /// ```
2102    /// # use google_cloud_edgenetwork_v1::builder::edge_network::ListRouters;
2103    /// # async fn sample() -> google_cloud_edgenetwork_v1::Result<()> {
2104    /// use google_cloud_gax::paginator::ItemPaginator;
2105    ///
2106    /// let builder = prepare_request_builder();
2107    /// let mut items = builder.by_item();
2108    /// while let Some(result) = items.next().await {
2109    ///   let item = result?;
2110    /// }
2111    /// # Ok(()) }
2112    ///
2113    /// fn prepare_request_builder() -> ListRouters {
2114    ///   # panic!();
2115    ///   // ... details omitted ...
2116    /// }
2117    /// ```
2118    #[derive(Clone, Debug)]
2119    pub struct ListRouters(RequestBuilder<crate::model::ListRoutersRequest>);
2120
2121    impl ListRouters {
2122        pub(crate) fn new(
2123            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
2124        ) -> Self {
2125            Self(RequestBuilder::new(stub))
2126        }
2127
2128        /// Sets the full request, replacing any prior values.
2129        pub fn with_request<V: Into<crate::model::ListRoutersRequest>>(mut self, v: V) -> Self {
2130            self.0.request = v.into();
2131            self
2132        }
2133
2134        /// Sets all the options, replacing any prior values.
2135        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2136            self.0.options = v.into();
2137            self
2138        }
2139
2140        /// Sends the request.
2141        pub async fn send(self) -> Result<crate::model::ListRoutersResponse> {
2142            (*self.0.stub)
2143                .list_routers(self.0.request, self.0.options)
2144                .await
2145                .map(crate::Response::into_body)
2146        }
2147
2148        /// Streams each page in the collection.
2149        pub fn by_page(
2150            self,
2151        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListRoutersResponse, crate::Error>
2152        {
2153            use std::clone::Clone;
2154            let token = self.0.request.page_token.clone();
2155            let execute = move |token: String| {
2156                let mut builder = self.clone();
2157                builder.0.request = builder.0.request.set_page_token(token);
2158                builder.send()
2159            };
2160            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2161        }
2162
2163        /// Streams each item in the collection.
2164        pub fn by_item(
2165            self,
2166        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2167            crate::model::ListRoutersResponse,
2168            crate::Error,
2169        > {
2170            use google_cloud_gax::paginator::Paginator;
2171            self.by_page().items()
2172        }
2173
2174        /// Sets the value of [parent][crate::model::ListRoutersRequest::parent].
2175        ///
2176        /// This is a **required** field for requests.
2177        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2178            self.0.request.parent = v.into();
2179            self
2180        }
2181
2182        /// Sets the value of [page_size][crate::model::ListRoutersRequest::page_size].
2183        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2184            self.0.request.page_size = v.into();
2185            self
2186        }
2187
2188        /// Sets the value of [page_token][crate::model::ListRoutersRequest::page_token].
2189        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2190            self.0.request.page_token = v.into();
2191            self
2192        }
2193
2194        /// Sets the value of [filter][crate::model::ListRoutersRequest::filter].
2195        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2196            self.0.request.filter = v.into();
2197            self
2198        }
2199
2200        /// Sets the value of [order_by][crate::model::ListRoutersRequest::order_by].
2201        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2202            self.0.request.order_by = v.into();
2203            self
2204        }
2205    }
2206
2207    #[doc(hidden)]
2208    impl crate::RequestBuilder for ListRouters {
2209        fn request_options(&mut self) -> &mut crate::RequestOptions {
2210            &mut self.0.options
2211        }
2212    }
2213
2214    /// The request builder for [EdgeNetwork::get_router][crate::client::EdgeNetwork::get_router] calls.
2215    ///
2216    /// # Example
2217    /// ```
2218    /// # use google_cloud_edgenetwork_v1::builder::edge_network::GetRouter;
2219    /// # async fn sample() -> google_cloud_edgenetwork_v1::Result<()> {
2220    ///
2221    /// let builder = prepare_request_builder();
2222    /// let response = builder.send().await?;
2223    /// # Ok(()) }
2224    ///
2225    /// fn prepare_request_builder() -> GetRouter {
2226    ///   # panic!();
2227    ///   // ... details omitted ...
2228    /// }
2229    /// ```
2230    #[derive(Clone, Debug)]
2231    pub struct GetRouter(RequestBuilder<crate::model::GetRouterRequest>);
2232
2233    impl GetRouter {
2234        pub(crate) fn new(
2235            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
2236        ) -> Self {
2237            Self(RequestBuilder::new(stub))
2238        }
2239
2240        /// Sets the full request, replacing any prior values.
2241        pub fn with_request<V: Into<crate::model::GetRouterRequest>>(mut self, v: V) -> Self {
2242            self.0.request = v.into();
2243            self
2244        }
2245
2246        /// Sets all the options, replacing any prior values.
2247        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2248            self.0.options = v.into();
2249            self
2250        }
2251
2252        /// Sends the request.
2253        pub async fn send(self) -> Result<crate::model::Router> {
2254            (*self.0.stub)
2255                .get_router(self.0.request, self.0.options)
2256                .await
2257                .map(crate::Response::into_body)
2258        }
2259
2260        /// Sets the value of [name][crate::model::GetRouterRequest::name].
2261        ///
2262        /// This is a **required** field for requests.
2263        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2264            self.0.request.name = v.into();
2265            self
2266        }
2267    }
2268
2269    #[doc(hidden)]
2270    impl crate::RequestBuilder for GetRouter {
2271        fn request_options(&mut self) -> &mut crate::RequestOptions {
2272            &mut self.0.options
2273        }
2274    }
2275
2276    /// The request builder for [EdgeNetwork::diagnose_router][crate::client::EdgeNetwork::diagnose_router] calls.
2277    ///
2278    /// # Example
2279    /// ```
2280    /// # use google_cloud_edgenetwork_v1::builder::edge_network::DiagnoseRouter;
2281    /// # async fn sample() -> google_cloud_edgenetwork_v1::Result<()> {
2282    ///
2283    /// let builder = prepare_request_builder();
2284    /// let response = builder.send().await?;
2285    /// # Ok(()) }
2286    ///
2287    /// fn prepare_request_builder() -> DiagnoseRouter {
2288    ///   # panic!();
2289    ///   // ... details omitted ...
2290    /// }
2291    /// ```
2292    #[derive(Clone, Debug)]
2293    pub struct DiagnoseRouter(RequestBuilder<crate::model::DiagnoseRouterRequest>);
2294
2295    impl DiagnoseRouter {
2296        pub(crate) fn new(
2297            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
2298        ) -> Self {
2299            Self(RequestBuilder::new(stub))
2300        }
2301
2302        /// Sets the full request, replacing any prior values.
2303        pub fn with_request<V: Into<crate::model::DiagnoseRouterRequest>>(mut self, v: V) -> Self {
2304            self.0.request = v.into();
2305            self
2306        }
2307
2308        /// Sets all the options, replacing any prior values.
2309        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2310            self.0.options = v.into();
2311            self
2312        }
2313
2314        /// Sends the request.
2315        pub async fn send(self) -> Result<crate::model::DiagnoseRouterResponse> {
2316            (*self.0.stub)
2317                .diagnose_router(self.0.request, self.0.options)
2318                .await
2319                .map(crate::Response::into_body)
2320        }
2321
2322        /// Sets the value of [name][crate::model::DiagnoseRouterRequest::name].
2323        ///
2324        /// This is a **required** field for requests.
2325        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2326            self.0.request.name = v.into();
2327            self
2328        }
2329    }
2330
2331    #[doc(hidden)]
2332    impl crate::RequestBuilder for DiagnoseRouter {
2333        fn request_options(&mut self) -> &mut crate::RequestOptions {
2334            &mut self.0.options
2335        }
2336    }
2337
2338    /// The request builder for [EdgeNetwork::create_router][crate::client::EdgeNetwork::create_router] calls.
2339    ///
2340    /// # Example
2341    /// ```
2342    /// # use google_cloud_edgenetwork_v1::builder::edge_network::CreateRouter;
2343    /// # async fn sample() -> google_cloud_edgenetwork_v1::Result<()> {
2344    /// use google_cloud_lro::Poller;
2345    ///
2346    /// let builder = prepare_request_builder();
2347    /// let response = builder.poller().until_done().await?;
2348    /// # Ok(()) }
2349    ///
2350    /// fn prepare_request_builder() -> CreateRouter {
2351    ///   # panic!();
2352    ///   // ... details omitted ...
2353    /// }
2354    /// ```
2355    #[derive(Clone, Debug)]
2356    pub struct CreateRouter(RequestBuilder<crate::model::CreateRouterRequest>);
2357
2358    impl CreateRouter {
2359        pub(crate) fn new(
2360            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
2361        ) -> Self {
2362            Self(RequestBuilder::new(stub))
2363        }
2364
2365        /// Sets the full request, replacing any prior values.
2366        pub fn with_request<V: Into<crate::model::CreateRouterRequest>>(mut self, v: V) -> Self {
2367            self.0.request = v.into();
2368            self
2369        }
2370
2371        /// Sets all the options, replacing any prior values.
2372        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2373            self.0.options = v.into();
2374            self
2375        }
2376
2377        /// Sends the request.
2378        ///
2379        /// # Long running operations
2380        ///
2381        /// This starts, but does not poll, a longrunning operation. More information
2382        /// on [create_router][crate::client::EdgeNetwork::create_router].
2383        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2384            (*self.0.stub)
2385                .create_router(self.0.request, self.0.options)
2386                .await
2387                .map(crate::Response::into_body)
2388        }
2389
2390        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_router`.
2391        pub fn poller(
2392            self,
2393        ) -> impl google_cloud_lro::Poller<crate::model::Router, crate::model::OperationMetadata>
2394        {
2395            type Operation = google_cloud_lro::internal::Operation<
2396                crate::model::Router,
2397                crate::model::OperationMetadata,
2398            >;
2399            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2400            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2401
2402            let stub = self.0.stub.clone();
2403            let mut options = self.0.options.clone();
2404            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2405            let query = move |name| {
2406                let stub = stub.clone();
2407                let options = options.clone();
2408                async {
2409                    let op = GetOperation::new(stub)
2410                        .set_name(name)
2411                        .with_options(options)
2412                        .send()
2413                        .await?;
2414                    Ok(Operation::new(op))
2415                }
2416            };
2417
2418            let start = move || async {
2419                let op = self.send().await?;
2420                Ok(Operation::new(op))
2421            };
2422
2423            google_cloud_lro::internal::new_poller(
2424                polling_error_policy,
2425                polling_backoff_policy,
2426                start,
2427                query,
2428            )
2429        }
2430
2431        /// Sets the value of [parent][crate::model::CreateRouterRequest::parent].
2432        ///
2433        /// This is a **required** field for requests.
2434        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2435            self.0.request.parent = v.into();
2436            self
2437        }
2438
2439        /// Sets the value of [router_id][crate::model::CreateRouterRequest::router_id].
2440        ///
2441        /// This is a **required** field for requests.
2442        pub fn set_router_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2443            self.0.request.router_id = v.into();
2444            self
2445        }
2446
2447        /// Sets the value of [router][crate::model::CreateRouterRequest::router].
2448        ///
2449        /// This is a **required** field for requests.
2450        pub fn set_router<T>(mut self, v: T) -> Self
2451        where
2452            T: std::convert::Into<crate::model::Router>,
2453        {
2454            self.0.request.router = std::option::Option::Some(v.into());
2455            self
2456        }
2457
2458        /// Sets or clears the value of [router][crate::model::CreateRouterRequest::router].
2459        ///
2460        /// This is a **required** field for requests.
2461        pub fn set_or_clear_router<T>(mut self, v: std::option::Option<T>) -> Self
2462        where
2463            T: std::convert::Into<crate::model::Router>,
2464        {
2465            self.0.request.router = v.map(|x| x.into());
2466            self
2467        }
2468
2469        /// Sets the value of [request_id][crate::model::CreateRouterRequest::request_id].
2470        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2471            self.0.request.request_id = v.into();
2472            self
2473        }
2474    }
2475
2476    #[doc(hidden)]
2477    impl crate::RequestBuilder for CreateRouter {
2478        fn request_options(&mut self) -> &mut crate::RequestOptions {
2479            &mut self.0.options
2480        }
2481    }
2482
2483    /// The request builder for [EdgeNetwork::update_router][crate::client::EdgeNetwork::update_router] calls.
2484    ///
2485    /// # Example
2486    /// ```
2487    /// # use google_cloud_edgenetwork_v1::builder::edge_network::UpdateRouter;
2488    /// # async fn sample() -> google_cloud_edgenetwork_v1::Result<()> {
2489    /// use google_cloud_lro::Poller;
2490    ///
2491    /// let builder = prepare_request_builder();
2492    /// let response = builder.poller().until_done().await?;
2493    /// # Ok(()) }
2494    ///
2495    /// fn prepare_request_builder() -> UpdateRouter {
2496    ///   # panic!();
2497    ///   // ... details omitted ...
2498    /// }
2499    /// ```
2500    #[derive(Clone, Debug)]
2501    pub struct UpdateRouter(RequestBuilder<crate::model::UpdateRouterRequest>);
2502
2503    impl UpdateRouter {
2504        pub(crate) fn new(
2505            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
2506        ) -> Self {
2507            Self(RequestBuilder::new(stub))
2508        }
2509
2510        /// Sets the full request, replacing any prior values.
2511        pub fn with_request<V: Into<crate::model::UpdateRouterRequest>>(mut self, v: V) -> Self {
2512            self.0.request = v.into();
2513            self
2514        }
2515
2516        /// Sets all the options, replacing any prior values.
2517        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2518            self.0.options = v.into();
2519            self
2520        }
2521
2522        /// Sends the request.
2523        ///
2524        /// # Long running operations
2525        ///
2526        /// This starts, but does not poll, a longrunning operation. More information
2527        /// on [update_router][crate::client::EdgeNetwork::update_router].
2528        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2529            (*self.0.stub)
2530                .update_router(self.0.request, self.0.options)
2531                .await
2532                .map(crate::Response::into_body)
2533        }
2534
2535        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_router`.
2536        pub fn poller(
2537            self,
2538        ) -> impl google_cloud_lro::Poller<crate::model::Router, crate::model::OperationMetadata>
2539        {
2540            type Operation = google_cloud_lro::internal::Operation<
2541                crate::model::Router,
2542                crate::model::OperationMetadata,
2543            >;
2544            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2545            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2546
2547            let stub = self.0.stub.clone();
2548            let mut options = self.0.options.clone();
2549            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2550            let query = move |name| {
2551                let stub = stub.clone();
2552                let options = options.clone();
2553                async {
2554                    let op = GetOperation::new(stub)
2555                        .set_name(name)
2556                        .with_options(options)
2557                        .send()
2558                        .await?;
2559                    Ok(Operation::new(op))
2560                }
2561            };
2562
2563            let start = move || async {
2564                let op = self.send().await?;
2565                Ok(Operation::new(op))
2566            };
2567
2568            google_cloud_lro::internal::new_poller(
2569                polling_error_policy,
2570                polling_backoff_policy,
2571                start,
2572                query,
2573            )
2574        }
2575
2576        /// Sets the value of [update_mask][crate::model::UpdateRouterRequest::update_mask].
2577        ///
2578        /// This is a **required** field for requests.
2579        pub fn set_update_mask<T>(mut self, v: T) -> Self
2580        where
2581            T: std::convert::Into<wkt::FieldMask>,
2582        {
2583            self.0.request.update_mask = std::option::Option::Some(v.into());
2584            self
2585        }
2586
2587        /// Sets or clears the value of [update_mask][crate::model::UpdateRouterRequest::update_mask].
2588        ///
2589        /// This is a **required** field for requests.
2590        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2591        where
2592            T: std::convert::Into<wkt::FieldMask>,
2593        {
2594            self.0.request.update_mask = v.map(|x| x.into());
2595            self
2596        }
2597
2598        /// Sets the value of [router][crate::model::UpdateRouterRequest::router].
2599        ///
2600        /// This is a **required** field for requests.
2601        pub fn set_router<T>(mut self, v: T) -> Self
2602        where
2603            T: std::convert::Into<crate::model::Router>,
2604        {
2605            self.0.request.router = std::option::Option::Some(v.into());
2606            self
2607        }
2608
2609        /// Sets or clears the value of [router][crate::model::UpdateRouterRequest::router].
2610        ///
2611        /// This is a **required** field for requests.
2612        pub fn set_or_clear_router<T>(mut self, v: std::option::Option<T>) -> Self
2613        where
2614            T: std::convert::Into<crate::model::Router>,
2615        {
2616            self.0.request.router = v.map(|x| x.into());
2617            self
2618        }
2619
2620        /// Sets the value of [request_id][crate::model::UpdateRouterRequest::request_id].
2621        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2622            self.0.request.request_id = v.into();
2623            self
2624        }
2625    }
2626
2627    #[doc(hidden)]
2628    impl crate::RequestBuilder for UpdateRouter {
2629        fn request_options(&mut self) -> &mut crate::RequestOptions {
2630            &mut self.0.options
2631        }
2632    }
2633
2634    /// The request builder for [EdgeNetwork::delete_router][crate::client::EdgeNetwork::delete_router] calls.
2635    ///
2636    /// # Example
2637    /// ```
2638    /// # use google_cloud_edgenetwork_v1::builder::edge_network::DeleteRouter;
2639    /// # async fn sample() -> google_cloud_edgenetwork_v1::Result<()> {
2640    /// use google_cloud_lro::Poller;
2641    ///
2642    /// let builder = prepare_request_builder();
2643    /// let response = builder.poller().until_done().await?;
2644    /// # Ok(()) }
2645    ///
2646    /// fn prepare_request_builder() -> DeleteRouter {
2647    ///   # panic!();
2648    ///   // ... details omitted ...
2649    /// }
2650    /// ```
2651    #[derive(Clone, Debug)]
2652    pub struct DeleteRouter(RequestBuilder<crate::model::DeleteRouterRequest>);
2653
2654    impl DeleteRouter {
2655        pub(crate) fn new(
2656            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
2657        ) -> Self {
2658            Self(RequestBuilder::new(stub))
2659        }
2660
2661        /// Sets the full request, replacing any prior values.
2662        pub fn with_request<V: Into<crate::model::DeleteRouterRequest>>(mut self, v: V) -> Self {
2663            self.0.request = v.into();
2664            self
2665        }
2666
2667        /// Sets all the options, replacing any prior values.
2668        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2669            self.0.options = v.into();
2670            self
2671        }
2672
2673        /// Sends the request.
2674        ///
2675        /// # Long running operations
2676        ///
2677        /// This starts, but does not poll, a longrunning operation. More information
2678        /// on [delete_router][crate::client::EdgeNetwork::delete_router].
2679        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2680            (*self.0.stub)
2681                .delete_router(self.0.request, self.0.options)
2682                .await
2683                .map(crate::Response::into_body)
2684        }
2685
2686        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_router`.
2687        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2688            type Operation =
2689                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2690            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2691            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2692
2693            let stub = self.0.stub.clone();
2694            let mut options = self.0.options.clone();
2695            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2696            let query = move |name| {
2697                let stub = stub.clone();
2698                let options = options.clone();
2699                async {
2700                    let op = GetOperation::new(stub)
2701                        .set_name(name)
2702                        .with_options(options)
2703                        .send()
2704                        .await?;
2705                    Ok(Operation::new(op))
2706                }
2707            };
2708
2709            let start = move || async {
2710                let op = self.send().await?;
2711                Ok(Operation::new(op))
2712            };
2713
2714            google_cloud_lro::internal::new_unit_response_poller(
2715                polling_error_policy,
2716                polling_backoff_policy,
2717                start,
2718                query,
2719            )
2720        }
2721
2722        /// Sets the value of [name][crate::model::DeleteRouterRequest::name].
2723        ///
2724        /// This is a **required** field for requests.
2725        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2726            self.0.request.name = v.into();
2727            self
2728        }
2729
2730        /// Sets the value of [request_id][crate::model::DeleteRouterRequest::request_id].
2731        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2732            self.0.request.request_id = v.into();
2733            self
2734        }
2735    }
2736
2737    #[doc(hidden)]
2738    impl crate::RequestBuilder for DeleteRouter {
2739        fn request_options(&mut self) -> &mut crate::RequestOptions {
2740            &mut self.0.options
2741        }
2742    }
2743
2744    /// The request builder for [EdgeNetwork::list_locations][crate::client::EdgeNetwork::list_locations] calls.
2745    ///
2746    /// # Example
2747    /// ```
2748    /// # use google_cloud_edgenetwork_v1::builder::edge_network::ListLocations;
2749    /// # async fn sample() -> google_cloud_edgenetwork_v1::Result<()> {
2750    /// use google_cloud_gax::paginator::ItemPaginator;
2751    ///
2752    /// let builder = prepare_request_builder();
2753    /// let mut items = builder.by_item();
2754    /// while let Some(result) = items.next().await {
2755    ///   let item = result?;
2756    /// }
2757    /// # Ok(()) }
2758    ///
2759    /// fn prepare_request_builder() -> ListLocations {
2760    ///   # panic!();
2761    ///   // ... details omitted ...
2762    /// }
2763    /// ```
2764    #[derive(Clone, Debug)]
2765    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
2766
2767    impl ListLocations {
2768        pub(crate) fn new(
2769            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
2770        ) -> Self {
2771            Self(RequestBuilder::new(stub))
2772        }
2773
2774        /// Sets the full request, replacing any prior values.
2775        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
2776            mut self,
2777            v: V,
2778        ) -> Self {
2779            self.0.request = v.into();
2780            self
2781        }
2782
2783        /// Sets all the options, replacing any prior values.
2784        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2785            self.0.options = v.into();
2786            self
2787        }
2788
2789        /// Sends the request.
2790        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
2791            (*self.0.stub)
2792                .list_locations(self.0.request, self.0.options)
2793                .await
2794                .map(crate::Response::into_body)
2795        }
2796
2797        /// Streams each page in the collection.
2798        pub fn by_page(
2799            self,
2800        ) -> impl google_cloud_gax::paginator::Paginator<
2801            google_cloud_location::model::ListLocationsResponse,
2802            crate::Error,
2803        > {
2804            use std::clone::Clone;
2805            let token = self.0.request.page_token.clone();
2806            let execute = move |token: String| {
2807                let mut builder = self.clone();
2808                builder.0.request = builder.0.request.set_page_token(token);
2809                builder.send()
2810            };
2811            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2812        }
2813
2814        /// Streams each item in the collection.
2815        pub fn by_item(
2816            self,
2817        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2818            google_cloud_location::model::ListLocationsResponse,
2819            crate::Error,
2820        > {
2821            use google_cloud_gax::paginator::Paginator;
2822            self.by_page().items()
2823        }
2824
2825        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
2826        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2827            self.0.request.name = v.into();
2828            self
2829        }
2830
2831        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
2832        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2833            self.0.request.filter = v.into();
2834            self
2835        }
2836
2837        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
2838        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2839            self.0.request.page_size = v.into();
2840            self
2841        }
2842
2843        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
2844        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2845            self.0.request.page_token = v.into();
2846            self
2847        }
2848    }
2849
2850    #[doc(hidden)]
2851    impl crate::RequestBuilder for ListLocations {
2852        fn request_options(&mut self) -> &mut crate::RequestOptions {
2853            &mut self.0.options
2854        }
2855    }
2856
2857    /// The request builder for [EdgeNetwork::get_location][crate::client::EdgeNetwork::get_location] calls.
2858    ///
2859    /// # Example
2860    /// ```
2861    /// # use google_cloud_edgenetwork_v1::builder::edge_network::GetLocation;
2862    /// # async fn sample() -> google_cloud_edgenetwork_v1::Result<()> {
2863    ///
2864    /// let builder = prepare_request_builder();
2865    /// let response = builder.send().await?;
2866    /// # Ok(()) }
2867    ///
2868    /// fn prepare_request_builder() -> GetLocation {
2869    ///   # panic!();
2870    ///   // ... details omitted ...
2871    /// }
2872    /// ```
2873    #[derive(Clone, Debug)]
2874    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
2875
2876    impl GetLocation {
2877        pub(crate) fn new(
2878            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
2879        ) -> Self {
2880            Self(RequestBuilder::new(stub))
2881        }
2882
2883        /// Sets the full request, replacing any prior values.
2884        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
2885            mut self,
2886            v: V,
2887        ) -> Self {
2888            self.0.request = v.into();
2889            self
2890        }
2891
2892        /// Sets all the options, replacing any prior values.
2893        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2894            self.0.options = v.into();
2895            self
2896        }
2897
2898        /// Sends the request.
2899        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
2900            (*self.0.stub)
2901                .get_location(self.0.request, self.0.options)
2902                .await
2903                .map(crate::Response::into_body)
2904        }
2905
2906        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
2907        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2908            self.0.request.name = v.into();
2909            self
2910        }
2911    }
2912
2913    #[doc(hidden)]
2914    impl crate::RequestBuilder for GetLocation {
2915        fn request_options(&mut self) -> &mut crate::RequestOptions {
2916            &mut self.0.options
2917        }
2918    }
2919
2920    /// The request builder for [EdgeNetwork::list_operations][crate::client::EdgeNetwork::list_operations] calls.
2921    ///
2922    /// # Example
2923    /// ```
2924    /// # use google_cloud_edgenetwork_v1::builder::edge_network::ListOperations;
2925    /// # async fn sample() -> google_cloud_edgenetwork_v1::Result<()> {
2926    /// use google_cloud_gax::paginator::ItemPaginator;
2927    ///
2928    /// let builder = prepare_request_builder();
2929    /// let mut items = builder.by_item();
2930    /// while let Some(result) = items.next().await {
2931    ///   let item = result?;
2932    /// }
2933    /// # Ok(()) }
2934    ///
2935    /// fn prepare_request_builder() -> ListOperations {
2936    ///   # panic!();
2937    ///   // ... details omitted ...
2938    /// }
2939    /// ```
2940    #[derive(Clone, Debug)]
2941    pub struct ListOperations(
2942        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2943    );
2944
2945    impl ListOperations {
2946        pub(crate) fn new(
2947            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
2948        ) -> Self {
2949            Self(RequestBuilder::new(stub))
2950        }
2951
2952        /// Sets the full request, replacing any prior values.
2953        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2954            mut self,
2955            v: V,
2956        ) -> Self {
2957            self.0.request = v.into();
2958            self
2959        }
2960
2961        /// Sets all the options, replacing any prior values.
2962        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2963            self.0.options = v.into();
2964            self
2965        }
2966
2967        /// Sends the request.
2968        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2969            (*self.0.stub)
2970                .list_operations(self.0.request, self.0.options)
2971                .await
2972                .map(crate::Response::into_body)
2973        }
2974
2975        /// Streams each page in the collection.
2976        pub fn by_page(
2977            self,
2978        ) -> impl google_cloud_gax::paginator::Paginator<
2979            google_cloud_longrunning::model::ListOperationsResponse,
2980            crate::Error,
2981        > {
2982            use std::clone::Clone;
2983            let token = self.0.request.page_token.clone();
2984            let execute = move |token: String| {
2985                let mut builder = self.clone();
2986                builder.0.request = builder.0.request.set_page_token(token);
2987                builder.send()
2988            };
2989            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2990        }
2991
2992        /// Streams each item in the collection.
2993        pub fn by_item(
2994            self,
2995        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2996            google_cloud_longrunning::model::ListOperationsResponse,
2997            crate::Error,
2998        > {
2999            use google_cloud_gax::paginator::Paginator;
3000            self.by_page().items()
3001        }
3002
3003        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
3004        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3005            self.0.request.name = v.into();
3006            self
3007        }
3008
3009        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
3010        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3011            self.0.request.filter = v.into();
3012            self
3013        }
3014
3015        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
3016        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3017            self.0.request.page_size = v.into();
3018            self
3019        }
3020
3021        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
3022        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3023            self.0.request.page_token = v.into();
3024            self
3025        }
3026
3027        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
3028        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3029            self.0.request.return_partial_success = v.into();
3030            self
3031        }
3032    }
3033
3034    #[doc(hidden)]
3035    impl crate::RequestBuilder for ListOperations {
3036        fn request_options(&mut self) -> &mut crate::RequestOptions {
3037            &mut self.0.options
3038        }
3039    }
3040
3041    /// The request builder for [EdgeNetwork::get_operation][crate::client::EdgeNetwork::get_operation] calls.
3042    ///
3043    /// # Example
3044    /// ```
3045    /// # use google_cloud_edgenetwork_v1::builder::edge_network::GetOperation;
3046    /// # async fn sample() -> google_cloud_edgenetwork_v1::Result<()> {
3047    ///
3048    /// let builder = prepare_request_builder();
3049    /// let response = builder.send().await?;
3050    /// # Ok(()) }
3051    ///
3052    /// fn prepare_request_builder() -> GetOperation {
3053    ///   # panic!();
3054    ///   // ... details omitted ...
3055    /// }
3056    /// ```
3057    #[derive(Clone, Debug)]
3058    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3059
3060    impl GetOperation {
3061        pub(crate) fn new(
3062            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
3063        ) -> Self {
3064            Self(RequestBuilder::new(stub))
3065        }
3066
3067        /// Sets the full request, replacing any prior values.
3068        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3069            mut self,
3070            v: V,
3071        ) -> Self {
3072            self.0.request = v.into();
3073            self
3074        }
3075
3076        /// Sets all the options, replacing any prior values.
3077        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3078            self.0.options = v.into();
3079            self
3080        }
3081
3082        /// Sends the request.
3083        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3084            (*self.0.stub)
3085                .get_operation(self.0.request, self.0.options)
3086                .await
3087                .map(crate::Response::into_body)
3088        }
3089
3090        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
3091        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3092            self.0.request.name = v.into();
3093            self
3094        }
3095    }
3096
3097    #[doc(hidden)]
3098    impl crate::RequestBuilder for GetOperation {
3099        fn request_options(&mut self) -> &mut crate::RequestOptions {
3100            &mut self.0.options
3101        }
3102    }
3103
3104    /// The request builder for [EdgeNetwork::delete_operation][crate::client::EdgeNetwork::delete_operation] calls.
3105    ///
3106    /// # Example
3107    /// ```
3108    /// # use google_cloud_edgenetwork_v1::builder::edge_network::DeleteOperation;
3109    /// # async fn sample() -> google_cloud_edgenetwork_v1::Result<()> {
3110    ///
3111    /// let builder = prepare_request_builder();
3112    /// let response = builder.send().await?;
3113    /// # Ok(()) }
3114    ///
3115    /// fn prepare_request_builder() -> DeleteOperation {
3116    ///   # panic!();
3117    ///   // ... details omitted ...
3118    /// }
3119    /// ```
3120    #[derive(Clone, Debug)]
3121    pub struct DeleteOperation(
3122        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
3123    );
3124
3125    impl DeleteOperation {
3126        pub(crate) fn new(
3127            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
3128        ) -> Self {
3129            Self(RequestBuilder::new(stub))
3130        }
3131
3132        /// Sets the full request, replacing any prior values.
3133        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
3134            mut self,
3135            v: V,
3136        ) -> Self {
3137            self.0.request = v.into();
3138            self
3139        }
3140
3141        /// Sets all the options, replacing any prior values.
3142        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3143            self.0.options = v.into();
3144            self
3145        }
3146
3147        /// Sends the request.
3148        pub async fn send(self) -> Result<()> {
3149            (*self.0.stub)
3150                .delete_operation(self.0.request, self.0.options)
3151                .await
3152                .map(crate::Response::into_body)
3153        }
3154
3155        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
3156        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3157            self.0.request.name = v.into();
3158            self
3159        }
3160    }
3161
3162    #[doc(hidden)]
3163    impl crate::RequestBuilder for DeleteOperation {
3164        fn request_options(&mut self) -> &mut crate::RequestOptions {
3165            &mut self.0.options
3166        }
3167    }
3168
3169    /// The request builder for [EdgeNetwork::cancel_operation][crate::client::EdgeNetwork::cancel_operation] calls.
3170    ///
3171    /// # Example
3172    /// ```
3173    /// # use google_cloud_edgenetwork_v1::builder::edge_network::CancelOperation;
3174    /// # async fn sample() -> google_cloud_edgenetwork_v1::Result<()> {
3175    ///
3176    /// let builder = prepare_request_builder();
3177    /// let response = builder.send().await?;
3178    /// # Ok(()) }
3179    ///
3180    /// fn prepare_request_builder() -> CancelOperation {
3181    ///   # panic!();
3182    ///   // ... details omitted ...
3183    /// }
3184    /// ```
3185    #[derive(Clone, Debug)]
3186    pub struct CancelOperation(
3187        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
3188    );
3189
3190    impl CancelOperation {
3191        pub(crate) fn new(
3192            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
3193        ) -> Self {
3194            Self(RequestBuilder::new(stub))
3195        }
3196
3197        /// Sets the full request, replacing any prior values.
3198        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3199            mut self,
3200            v: V,
3201        ) -> Self {
3202            self.0.request = v.into();
3203            self
3204        }
3205
3206        /// Sets all the options, replacing any prior values.
3207        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3208            self.0.options = v.into();
3209            self
3210        }
3211
3212        /// Sends the request.
3213        pub async fn send(self) -> Result<()> {
3214            (*self.0.stub)
3215                .cancel_operation(self.0.request, self.0.options)
3216                .await
3217                .map(crate::Response::into_body)
3218        }
3219
3220        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
3221        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3222            self.0.request.name = v.into();
3223            self
3224        }
3225    }
3226
3227    #[doc(hidden)]
3228    impl crate::RequestBuilder for CancelOperation {
3229        fn request_options(&mut self) -> &mut crate::RequestOptions {
3230            &mut self.0.options
3231        }
3232    }
3233}