Skip to main content

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