google_cloud_chronicle_v1/
builder.rs

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