Skip to main content

google_cloud_auditmanager_v1/
builder.rs

1// Copyright 2026 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 audit_manager {
18    use crate::Result;
19
20    /// A builder for [AuditManager][crate::client::AuditManager].
21    ///
22    /// ```
23    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
24    /// # use google_cloud_auditmanager_v1::*;
25    /// # use builder::audit_manager::ClientBuilder;
26    /// # use client::AuditManager;
27    /// let builder : ClientBuilder = AuditManager::builder();
28    /// let client = builder
29    ///     .with_endpoint("https://auditmanager.googleapis.com")
30    ///     .build().await?;
31    /// # Ok(()) }
32    /// ```
33    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
34
35    pub(crate) mod client {
36        use super::super::super::client::AuditManager;
37        pub struct Factory;
38        impl crate::ClientFactory for Factory {
39            type Client = AuditManager;
40            type Credentials = gaxi::options::Credentials;
41            async fn build(
42                self,
43                config: gaxi::options::ClientConfig,
44            ) -> crate::ClientBuilderResult<Self::Client> {
45                Self::Client::new(config).await
46            }
47        }
48    }
49
50    /// Common implementation for [crate::client::AuditManager] request builders.
51    #[derive(Clone, Debug)]
52    pub(crate) struct RequestBuilder<R: std::default::Default> {
53        stub: std::sync::Arc<dyn super::super::stub::dynamic::AuditManager>,
54        request: R,
55        options: crate::RequestOptions,
56    }
57
58    impl<R> RequestBuilder<R>
59    where
60        R: std::default::Default,
61    {
62        pub(crate) fn new(
63            stub: std::sync::Arc<dyn super::super::stub::dynamic::AuditManager>,
64        ) -> Self {
65            Self {
66                stub,
67                request: R::default(),
68                options: crate::RequestOptions::default(),
69            }
70        }
71    }
72
73    /// The request builder for [AuditManager::enroll_resource][crate::client::AuditManager::enroll_resource] calls.
74    ///
75    /// # Example
76    /// ```
77    /// # use google_cloud_auditmanager_v1::builder::audit_manager::EnrollResource;
78    /// # async fn sample() -> google_cloud_auditmanager_v1::Result<()> {
79    ///
80    /// let builder = prepare_request_builder();
81    /// let response = builder.send().await?;
82    /// # Ok(()) }
83    ///
84    /// fn prepare_request_builder() -> EnrollResource {
85    ///   # panic!();
86    ///   // ... details omitted ...
87    /// }
88    /// ```
89    #[derive(Clone, Debug)]
90    pub struct EnrollResource(RequestBuilder<crate::model::EnrollResourceRequest>);
91
92    impl EnrollResource {
93        pub(crate) fn new(
94            stub: std::sync::Arc<dyn super::super::stub::dynamic::AuditManager>,
95        ) -> Self {
96            Self(RequestBuilder::new(stub))
97        }
98
99        /// Sets the full request, replacing any prior values.
100        pub fn with_request<V: Into<crate::model::EnrollResourceRequest>>(mut self, v: V) -> Self {
101            self.0.request = v.into();
102            self
103        }
104
105        /// Sets all the options, replacing any prior values.
106        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
107            self.0.options = v.into();
108            self
109        }
110
111        /// Sends the request.
112        pub async fn send(self) -> Result<crate::model::Enrollment> {
113            (*self.0.stub)
114                .enroll_resource(self.0.request, self.0.options)
115                .await
116                .map(crate::Response::into_body)
117        }
118
119        /// Sets the value of [scope][crate::model::EnrollResourceRequest::scope].
120        ///
121        /// This is a **required** field for requests.
122        pub fn set_scope<T: Into<std::string::String>>(mut self, v: T) -> Self {
123            self.0.request.scope = v.into();
124            self
125        }
126
127        /// Sets the value of [destinations][crate::model::EnrollResourceRequest::destinations].
128        ///
129        /// This is a **required** field for requests.
130        pub fn set_destinations<T, V>(mut self, v: T) -> Self
131        where
132            T: std::iter::IntoIterator<Item = V>,
133            V: std::convert::Into<crate::model::enroll_resource_request::EligibleDestination>,
134        {
135            use std::iter::Iterator;
136            self.0.request.destinations = v.into_iter().map(|i| i.into()).collect();
137            self
138        }
139    }
140
141    #[doc(hidden)]
142    impl crate::RequestBuilder for EnrollResource {
143        fn request_options(&mut self) -> &mut crate::RequestOptions {
144            &mut self.0.options
145        }
146    }
147
148    /// The request builder for [AuditManager::generate_audit_scope_report][crate::client::AuditManager::generate_audit_scope_report] calls.
149    ///
150    /// # Example
151    /// ```
152    /// # use google_cloud_auditmanager_v1::builder::audit_manager::GenerateAuditScopeReport;
153    /// # async fn sample() -> google_cloud_auditmanager_v1::Result<()> {
154    ///
155    /// let builder = prepare_request_builder();
156    /// let response = builder.send().await?;
157    /// # Ok(()) }
158    ///
159    /// fn prepare_request_builder() -> GenerateAuditScopeReport {
160    ///   # panic!();
161    ///   // ... details omitted ...
162    /// }
163    /// ```
164    #[derive(Clone, Debug)]
165    pub struct GenerateAuditScopeReport(
166        RequestBuilder<crate::model::GenerateAuditScopeReportRequest>,
167    );
168
169    impl GenerateAuditScopeReport {
170        pub(crate) fn new(
171            stub: std::sync::Arc<dyn super::super::stub::dynamic::AuditManager>,
172        ) -> Self {
173            Self(RequestBuilder::new(stub))
174        }
175
176        /// Sets the full request, replacing any prior values.
177        pub fn with_request<V: Into<crate::model::GenerateAuditScopeReportRequest>>(
178            mut self,
179            v: V,
180        ) -> Self {
181            self.0.request = v.into();
182            self
183        }
184
185        /// Sets all the options, replacing any prior values.
186        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
187            self.0.options = v.into();
188            self
189        }
190
191        /// Sends the request.
192        pub async fn send(self) -> Result<crate::model::AuditScopeReport> {
193            (*self.0.stub)
194                .generate_audit_scope_report(self.0.request, self.0.options)
195                .await
196                .map(crate::Response::into_body)
197        }
198
199        /// Sets the value of [scope][crate::model::GenerateAuditScopeReportRequest::scope].
200        ///
201        /// This is a **required** field for requests.
202        pub fn set_scope<T: Into<std::string::String>>(mut self, v: T) -> Self {
203            self.0.request.scope = v.into();
204            self
205        }
206
207        /// Sets the value of [compliance_standard][crate::model::GenerateAuditScopeReportRequest::compliance_standard].
208        ///
209        /// This is a **required** field for requests.
210        pub fn set_compliance_standard<T: Into<std::string::String>>(mut self, v: T) -> Self {
211            self.0.request.compliance_standard = v.into();
212            self
213        }
214
215        /// Sets the value of [report_format][crate::model::GenerateAuditScopeReportRequest::report_format].
216        ///
217        /// This is a **required** field for requests.
218        pub fn set_report_format<
219            T: Into<crate::model::generate_audit_scope_report_request::AuditScopeReportFormat>,
220        >(
221            mut self,
222            v: T,
223        ) -> Self {
224            self.0.request.report_format = v.into();
225            self
226        }
227
228        /// Sets the value of [compliance_framework][crate::model::GenerateAuditScopeReportRequest::compliance_framework].
229        ///
230        /// This is a **required** field for requests.
231        pub fn set_compliance_framework<T: Into<std::string::String>>(mut self, v: T) -> Self {
232            self.0.request.compliance_framework = v.into();
233            self
234        }
235    }
236
237    #[doc(hidden)]
238    impl crate::RequestBuilder for GenerateAuditScopeReport {
239        fn request_options(&mut self) -> &mut crate::RequestOptions {
240            &mut self.0.options
241        }
242    }
243
244    /// The request builder for [AuditManager::generate_audit_report][crate::client::AuditManager::generate_audit_report] calls.
245    ///
246    /// # Example
247    /// ```
248    /// # use google_cloud_auditmanager_v1::builder::audit_manager::GenerateAuditReport;
249    /// # async fn sample() -> google_cloud_auditmanager_v1::Result<()> {
250    /// use google_cloud_lro::Poller;
251    ///
252    /// let builder = prepare_request_builder();
253    /// let response = builder.poller().until_done().await?;
254    /// # Ok(()) }
255    ///
256    /// fn prepare_request_builder() -> GenerateAuditReport {
257    ///   # panic!();
258    ///   // ... details omitted ...
259    /// }
260    /// ```
261    #[derive(Clone, Debug)]
262    pub struct GenerateAuditReport(RequestBuilder<crate::model::GenerateAuditReportRequest>);
263
264    impl GenerateAuditReport {
265        pub(crate) fn new(
266            stub: std::sync::Arc<dyn super::super::stub::dynamic::AuditManager>,
267        ) -> Self {
268            Self(RequestBuilder::new(stub))
269        }
270
271        /// Sets the full request, replacing any prior values.
272        pub fn with_request<V: Into<crate::model::GenerateAuditReportRequest>>(
273            mut self,
274            v: V,
275        ) -> Self {
276            self.0.request = v.into();
277            self
278        }
279
280        /// Sets all the options, replacing any prior values.
281        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
282            self.0.options = v.into();
283            self
284        }
285
286        /// Sends the request.
287        ///
288        /// # Long running operations
289        ///
290        /// This starts, but does not poll, a longrunning operation. More information
291        /// on [generate_audit_report][crate::client::AuditManager::generate_audit_report].
292        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
293            (*self.0.stub)
294                .generate_audit_report(self.0.request, self.0.options)
295                .await
296                .map(crate::Response::into_body)
297        }
298
299        /// Creates a [Poller][google_cloud_lro::Poller] to work with `generate_audit_report`.
300        pub fn poller(
301            self,
302        ) -> impl google_cloud_lro::Poller<crate::model::AuditReport, crate::model::OperationMetadata>
303        {
304            type Operation = google_cloud_lro::internal::Operation<
305                crate::model::AuditReport,
306                crate::model::OperationMetadata,
307            >;
308            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
309            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
310
311            let stub = self.0.stub.clone();
312            let mut options = self.0.options.clone();
313            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
314            let query = move |name| {
315                let stub = stub.clone();
316                let options = options.clone();
317                async {
318                    let op = GetOperation::new(stub)
319                        .set_name(name)
320                        .with_options(options)
321                        .send()
322                        .await?;
323                    Ok(Operation::new(op))
324                }
325            };
326
327            let start = move || async {
328                let op = self.send().await?;
329                Ok(Operation::new(op))
330            };
331
332            google_cloud_lro::internal::new_poller(
333                polling_error_policy,
334                polling_backoff_policy,
335                start,
336                query,
337            )
338        }
339
340        /// Sets the value of [scope][crate::model::GenerateAuditReportRequest::scope].
341        ///
342        /// This is a **required** field for requests.
343        pub fn set_scope<T: Into<std::string::String>>(mut self, v: T) -> Self {
344            self.0.request.scope = v.into();
345            self
346        }
347
348        /// Sets the value of [compliance_standard][crate::model::GenerateAuditReportRequest::compliance_standard].
349        ///
350        /// This is a **required** field for requests.
351        pub fn set_compliance_standard<T: Into<std::string::String>>(mut self, v: T) -> Self {
352            self.0.request.compliance_standard = v.into();
353            self
354        }
355
356        /// Sets the value of [report_format][crate::model::GenerateAuditReportRequest::report_format].
357        ///
358        /// This is a **required** field for requests.
359        pub fn set_report_format<
360            T: Into<crate::model::generate_audit_report_request::AuditReportFormat>,
361        >(
362            mut self,
363            v: T,
364        ) -> Self {
365            self.0.request.report_format = v.into();
366            self
367        }
368
369        /// Sets the value of [compliance_framework][crate::model::GenerateAuditReportRequest::compliance_framework].
370        ///
371        /// This is a **required** field for requests.
372        pub fn set_compliance_framework<T: Into<std::string::String>>(mut self, v: T) -> Self {
373            self.0.request.compliance_framework = v.into();
374            self
375        }
376
377        /// Sets the value of [destination][crate::model::GenerateAuditReportRequest::destination].
378        ///
379        /// Note that all the setters affecting `destination` are
380        /// mutually exclusive.
381        pub fn set_destination<
382            T: Into<Option<crate::model::generate_audit_report_request::Destination>>,
383        >(
384            mut self,
385            v: T,
386        ) -> Self {
387            self.0.request.destination = v.into();
388            self
389        }
390
391        /// Sets the value of [destination][crate::model::GenerateAuditReportRequest::destination]
392        /// to hold a `GcsUri`.
393        ///
394        /// Note that all the setters affecting `destination` are
395        /// mutually exclusive.
396        pub fn set_gcs_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
397            self.0.request = self.0.request.set_gcs_uri(v);
398            self
399        }
400    }
401
402    #[doc(hidden)]
403    impl crate::RequestBuilder for GenerateAuditReport {
404        fn request_options(&mut self) -> &mut crate::RequestOptions {
405            &mut self.0.options
406        }
407    }
408
409    /// The request builder for [AuditManager::list_audit_reports][crate::client::AuditManager::list_audit_reports] calls.
410    ///
411    /// # Example
412    /// ```
413    /// # use google_cloud_auditmanager_v1::builder::audit_manager::ListAuditReports;
414    /// # async fn sample() -> google_cloud_auditmanager_v1::Result<()> {
415    /// use google_cloud_gax::paginator::ItemPaginator;
416    ///
417    /// let builder = prepare_request_builder();
418    /// let mut items = builder.by_item();
419    /// while let Some(result) = items.next().await {
420    ///   let item = result?;
421    /// }
422    /// # Ok(()) }
423    ///
424    /// fn prepare_request_builder() -> ListAuditReports {
425    ///   # panic!();
426    ///   // ... details omitted ...
427    /// }
428    /// ```
429    #[derive(Clone, Debug)]
430    pub struct ListAuditReports(RequestBuilder<crate::model::ListAuditReportsRequest>);
431
432    impl ListAuditReports {
433        pub(crate) fn new(
434            stub: std::sync::Arc<dyn super::super::stub::dynamic::AuditManager>,
435        ) -> Self {
436            Self(RequestBuilder::new(stub))
437        }
438
439        /// Sets the full request, replacing any prior values.
440        pub fn with_request<V: Into<crate::model::ListAuditReportsRequest>>(
441            mut self,
442            v: V,
443        ) -> Self {
444            self.0.request = v.into();
445            self
446        }
447
448        /// Sets all the options, replacing any prior values.
449        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
450            self.0.options = v.into();
451            self
452        }
453
454        /// Sends the request.
455        pub async fn send(self) -> Result<crate::model::ListAuditReportsResponse> {
456            (*self.0.stub)
457                .list_audit_reports(self.0.request, self.0.options)
458                .await
459                .map(crate::Response::into_body)
460        }
461
462        /// Streams each page in the collection.
463        pub fn by_page(
464            self,
465        ) -> impl google_cloud_gax::paginator::Paginator<
466            crate::model::ListAuditReportsResponse,
467            crate::Error,
468        > {
469            use std::clone::Clone;
470            let token = self.0.request.page_token.clone();
471            let execute = move |token: String| {
472                let mut builder = self.clone();
473                builder.0.request = builder.0.request.set_page_token(token);
474                builder.send()
475            };
476            google_cloud_gax::paginator::internal::new_paginator(token, execute)
477        }
478
479        /// Streams each item in the collection.
480        pub fn by_item(
481            self,
482        ) -> impl google_cloud_gax::paginator::ItemPaginator<
483            crate::model::ListAuditReportsResponse,
484            crate::Error,
485        > {
486            use google_cloud_gax::paginator::Paginator;
487            self.by_page().items()
488        }
489
490        /// Sets the value of [parent][crate::model::ListAuditReportsRequest::parent].
491        ///
492        /// This is a **required** field for requests.
493        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
494            self.0.request.parent = v.into();
495            self
496        }
497
498        /// Sets the value of [page_size][crate::model::ListAuditReportsRequest::page_size].
499        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
500            self.0.request.page_size = v.into();
501            self
502        }
503
504        /// Sets the value of [page_token][crate::model::ListAuditReportsRequest::page_token].
505        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
506            self.0.request.page_token = v.into();
507            self
508        }
509    }
510
511    #[doc(hidden)]
512    impl crate::RequestBuilder for ListAuditReports {
513        fn request_options(&mut self) -> &mut crate::RequestOptions {
514            &mut self.0.options
515        }
516    }
517
518    /// The request builder for [AuditManager::get_audit_report][crate::client::AuditManager::get_audit_report] calls.
519    ///
520    /// # Example
521    /// ```
522    /// # use google_cloud_auditmanager_v1::builder::audit_manager::GetAuditReport;
523    /// # async fn sample() -> google_cloud_auditmanager_v1::Result<()> {
524    ///
525    /// let builder = prepare_request_builder();
526    /// let response = builder.send().await?;
527    /// # Ok(()) }
528    ///
529    /// fn prepare_request_builder() -> GetAuditReport {
530    ///   # panic!();
531    ///   // ... details omitted ...
532    /// }
533    /// ```
534    #[derive(Clone, Debug)]
535    pub struct GetAuditReport(RequestBuilder<crate::model::GetAuditReportRequest>);
536
537    impl GetAuditReport {
538        pub(crate) fn new(
539            stub: std::sync::Arc<dyn super::super::stub::dynamic::AuditManager>,
540        ) -> Self {
541            Self(RequestBuilder::new(stub))
542        }
543
544        /// Sets the full request, replacing any prior values.
545        pub fn with_request<V: Into<crate::model::GetAuditReportRequest>>(mut self, v: V) -> Self {
546            self.0.request = v.into();
547            self
548        }
549
550        /// Sets all the options, replacing any prior values.
551        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
552            self.0.options = v.into();
553            self
554        }
555
556        /// Sends the request.
557        pub async fn send(self) -> Result<crate::model::AuditReport> {
558            (*self.0.stub)
559                .get_audit_report(self.0.request, self.0.options)
560                .await
561                .map(crate::Response::into_body)
562        }
563
564        /// Sets the value of [name][crate::model::GetAuditReportRequest::name].
565        ///
566        /// This is a **required** field for requests.
567        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
568            self.0.request.name = v.into();
569            self
570        }
571    }
572
573    #[doc(hidden)]
574    impl crate::RequestBuilder for GetAuditReport {
575        fn request_options(&mut self) -> &mut crate::RequestOptions {
576            &mut self.0.options
577        }
578    }
579
580    /// The request builder for [AuditManager::get_resource_enrollment_status][crate::client::AuditManager::get_resource_enrollment_status] calls.
581    ///
582    /// # Example
583    /// ```
584    /// # use google_cloud_auditmanager_v1::builder::audit_manager::GetResourceEnrollmentStatus;
585    /// # async fn sample() -> google_cloud_auditmanager_v1::Result<()> {
586    ///
587    /// let builder = prepare_request_builder();
588    /// let response = builder.send().await?;
589    /// # Ok(()) }
590    ///
591    /// fn prepare_request_builder() -> GetResourceEnrollmentStatus {
592    ///   # panic!();
593    ///   // ... details omitted ...
594    /// }
595    /// ```
596    #[derive(Clone, Debug)]
597    pub struct GetResourceEnrollmentStatus(
598        RequestBuilder<crate::model::GetResourceEnrollmentStatusRequest>,
599    );
600
601    impl GetResourceEnrollmentStatus {
602        pub(crate) fn new(
603            stub: std::sync::Arc<dyn super::super::stub::dynamic::AuditManager>,
604        ) -> Self {
605            Self(RequestBuilder::new(stub))
606        }
607
608        /// Sets the full request, replacing any prior values.
609        pub fn with_request<V: Into<crate::model::GetResourceEnrollmentStatusRequest>>(
610            mut self,
611            v: V,
612        ) -> Self {
613            self.0.request = v.into();
614            self
615        }
616
617        /// Sets all the options, replacing any prior values.
618        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
619            self.0.options = v.into();
620            self
621        }
622
623        /// Sends the request.
624        pub async fn send(self) -> Result<crate::model::ResourceEnrollmentStatus> {
625            (*self.0.stub)
626                .get_resource_enrollment_status(self.0.request, self.0.options)
627                .await
628                .map(crate::Response::into_body)
629        }
630
631        /// Sets the value of [name][crate::model::GetResourceEnrollmentStatusRequest::name].
632        ///
633        /// This is a **required** field for requests.
634        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
635            self.0.request.name = v.into();
636            self
637        }
638    }
639
640    #[doc(hidden)]
641    impl crate::RequestBuilder for GetResourceEnrollmentStatus {
642        fn request_options(&mut self) -> &mut crate::RequestOptions {
643            &mut self.0.options
644        }
645    }
646
647    /// The request builder for [AuditManager::list_resource_enrollment_statuses][crate::client::AuditManager::list_resource_enrollment_statuses] calls.
648    ///
649    /// # Example
650    /// ```
651    /// # use google_cloud_auditmanager_v1::builder::audit_manager::ListResourceEnrollmentStatuses;
652    /// # async fn sample() -> google_cloud_auditmanager_v1::Result<()> {
653    /// use google_cloud_gax::paginator::ItemPaginator;
654    ///
655    /// let builder = prepare_request_builder();
656    /// let mut items = builder.by_item();
657    /// while let Some(result) = items.next().await {
658    ///   let item = result?;
659    /// }
660    /// # Ok(()) }
661    ///
662    /// fn prepare_request_builder() -> ListResourceEnrollmentStatuses {
663    ///   # panic!();
664    ///   // ... details omitted ...
665    /// }
666    /// ```
667    #[derive(Clone, Debug)]
668    pub struct ListResourceEnrollmentStatuses(
669        RequestBuilder<crate::model::ListResourceEnrollmentStatusesRequest>,
670    );
671
672    impl ListResourceEnrollmentStatuses {
673        pub(crate) fn new(
674            stub: std::sync::Arc<dyn super::super::stub::dynamic::AuditManager>,
675        ) -> Self {
676            Self(RequestBuilder::new(stub))
677        }
678
679        /// Sets the full request, replacing any prior values.
680        pub fn with_request<V: Into<crate::model::ListResourceEnrollmentStatusesRequest>>(
681            mut self,
682            v: V,
683        ) -> Self {
684            self.0.request = v.into();
685            self
686        }
687
688        /// Sets all the options, replacing any prior values.
689        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
690            self.0.options = v.into();
691            self
692        }
693
694        /// Sends the request.
695        pub async fn send(self) -> Result<crate::model::ListResourceEnrollmentStatusesResponse> {
696            (*self.0.stub)
697                .list_resource_enrollment_statuses(self.0.request, self.0.options)
698                .await
699                .map(crate::Response::into_body)
700        }
701
702        /// Streams each page in the collection.
703        pub fn by_page(
704            self,
705        ) -> impl google_cloud_gax::paginator::Paginator<
706            crate::model::ListResourceEnrollmentStatusesResponse,
707            crate::Error,
708        > {
709            use std::clone::Clone;
710            let token = self.0.request.page_token.clone();
711            let execute = move |token: String| {
712                let mut builder = self.clone();
713                builder.0.request = builder.0.request.set_page_token(token);
714                builder.send()
715            };
716            google_cloud_gax::paginator::internal::new_paginator(token, execute)
717        }
718
719        /// Streams each item in the collection.
720        pub fn by_item(
721            self,
722        ) -> impl google_cloud_gax::paginator::ItemPaginator<
723            crate::model::ListResourceEnrollmentStatusesResponse,
724            crate::Error,
725        > {
726            use google_cloud_gax::paginator::Paginator;
727            self.by_page().items()
728        }
729
730        /// Sets the value of [parent][crate::model::ListResourceEnrollmentStatusesRequest::parent].
731        ///
732        /// This is a **required** field for requests.
733        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
734            self.0.request.parent = v.into();
735            self
736        }
737
738        /// Sets the value of [page_size][crate::model::ListResourceEnrollmentStatusesRequest::page_size].
739        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
740            self.0.request.page_size = v.into();
741            self
742        }
743
744        /// Sets the value of [page_token][crate::model::ListResourceEnrollmentStatusesRequest::page_token].
745        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
746            self.0.request.page_token = v.into();
747            self
748        }
749    }
750
751    #[doc(hidden)]
752    impl crate::RequestBuilder for ListResourceEnrollmentStatuses {
753        fn request_options(&mut self) -> &mut crate::RequestOptions {
754            &mut self.0.options
755        }
756    }
757
758    /// The request builder for [AuditManager::list_controls][crate::client::AuditManager::list_controls] calls.
759    ///
760    /// # Example
761    /// ```
762    /// # use google_cloud_auditmanager_v1::builder::audit_manager::ListControls;
763    /// # async fn sample() -> google_cloud_auditmanager_v1::Result<()> {
764    /// use google_cloud_gax::paginator::ItemPaginator;
765    ///
766    /// let builder = prepare_request_builder();
767    /// let mut items = builder.by_item();
768    /// while let Some(result) = items.next().await {
769    ///   let item = result?;
770    /// }
771    /// # Ok(()) }
772    ///
773    /// fn prepare_request_builder() -> ListControls {
774    ///   # panic!();
775    ///   // ... details omitted ...
776    /// }
777    /// ```
778    #[derive(Clone, Debug)]
779    pub struct ListControls(RequestBuilder<crate::model::ListControlsRequest>);
780
781    impl ListControls {
782        pub(crate) fn new(
783            stub: std::sync::Arc<dyn super::super::stub::dynamic::AuditManager>,
784        ) -> Self {
785            Self(RequestBuilder::new(stub))
786        }
787
788        /// Sets the full request, replacing any prior values.
789        pub fn with_request<V: Into<crate::model::ListControlsRequest>>(mut self, v: V) -> Self {
790            self.0.request = v.into();
791            self
792        }
793
794        /// Sets all the options, replacing any prior values.
795        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
796            self.0.options = v.into();
797            self
798        }
799
800        /// Sends the request.
801        pub async fn send(self) -> Result<crate::model::ListControlsResponse> {
802            (*self.0.stub)
803                .list_controls(self.0.request, self.0.options)
804                .await
805                .map(crate::Response::into_body)
806        }
807
808        /// Streams each page in the collection.
809        pub fn by_page(
810            self,
811        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListControlsResponse, crate::Error>
812        {
813            use std::clone::Clone;
814            let token = self.0.request.page_token.clone();
815            let execute = move |token: String| {
816                let mut builder = self.clone();
817                builder.0.request = builder.0.request.set_page_token(token);
818                builder.send()
819            };
820            google_cloud_gax::paginator::internal::new_paginator(token, execute)
821        }
822
823        /// Streams each item in the collection.
824        pub fn by_item(
825            self,
826        ) -> impl google_cloud_gax::paginator::ItemPaginator<
827            crate::model::ListControlsResponse,
828            crate::Error,
829        > {
830            use google_cloud_gax::paginator::Paginator;
831            self.by_page().items()
832        }
833
834        /// Sets the value of [parent][crate::model::ListControlsRequest::parent].
835        ///
836        /// This is a **required** field for requests.
837        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
838            self.0.request.parent = v.into();
839            self
840        }
841
842        /// Sets the value of [page_size][crate::model::ListControlsRequest::page_size].
843        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
844            self.0.request.page_size = v.into();
845            self
846        }
847
848        /// Sets the value of [page_token][crate::model::ListControlsRequest::page_token].
849        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
850            self.0.request.page_token = v.into();
851            self
852        }
853    }
854
855    #[doc(hidden)]
856    impl crate::RequestBuilder for ListControls {
857        fn request_options(&mut self) -> &mut crate::RequestOptions {
858            &mut self.0.options
859        }
860    }
861
862    /// The request builder for [AuditManager::list_locations][crate::client::AuditManager::list_locations] calls.
863    ///
864    /// # Example
865    /// ```
866    /// # use google_cloud_auditmanager_v1::builder::audit_manager::ListLocations;
867    /// # async fn sample() -> google_cloud_auditmanager_v1::Result<()> {
868    /// use google_cloud_gax::paginator::ItemPaginator;
869    ///
870    /// let builder = prepare_request_builder();
871    /// let mut items = builder.by_item();
872    /// while let Some(result) = items.next().await {
873    ///   let item = result?;
874    /// }
875    /// # Ok(()) }
876    ///
877    /// fn prepare_request_builder() -> ListLocations {
878    ///   # panic!();
879    ///   // ... details omitted ...
880    /// }
881    /// ```
882    #[derive(Clone, Debug)]
883    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
884
885    impl ListLocations {
886        pub(crate) fn new(
887            stub: std::sync::Arc<dyn super::super::stub::dynamic::AuditManager>,
888        ) -> Self {
889            Self(RequestBuilder::new(stub))
890        }
891
892        /// Sets the full request, replacing any prior values.
893        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
894            mut self,
895            v: V,
896        ) -> Self {
897            self.0.request = v.into();
898            self
899        }
900
901        /// Sets all the options, replacing any prior values.
902        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
903            self.0.options = v.into();
904            self
905        }
906
907        /// Sends the request.
908        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
909            (*self.0.stub)
910                .list_locations(self.0.request, self.0.options)
911                .await
912                .map(crate::Response::into_body)
913        }
914
915        /// Streams each page in the collection.
916        pub fn by_page(
917            self,
918        ) -> impl google_cloud_gax::paginator::Paginator<
919            google_cloud_location::model::ListLocationsResponse,
920            crate::Error,
921        > {
922            use std::clone::Clone;
923            let token = self.0.request.page_token.clone();
924            let execute = move |token: String| {
925                let mut builder = self.clone();
926                builder.0.request = builder.0.request.set_page_token(token);
927                builder.send()
928            };
929            google_cloud_gax::paginator::internal::new_paginator(token, execute)
930        }
931
932        /// Streams each item in the collection.
933        pub fn by_item(
934            self,
935        ) -> impl google_cloud_gax::paginator::ItemPaginator<
936            google_cloud_location::model::ListLocationsResponse,
937            crate::Error,
938        > {
939            use google_cloud_gax::paginator::Paginator;
940            self.by_page().items()
941        }
942
943        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
944        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
945            self.0.request.name = v.into();
946            self
947        }
948
949        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
950        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
951            self.0.request.filter = v.into();
952            self
953        }
954
955        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
956        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
957            self.0.request.page_size = v.into();
958            self
959        }
960
961        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
962        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
963            self.0.request.page_token = v.into();
964            self
965        }
966    }
967
968    #[doc(hidden)]
969    impl crate::RequestBuilder for ListLocations {
970        fn request_options(&mut self) -> &mut crate::RequestOptions {
971            &mut self.0.options
972        }
973    }
974
975    /// The request builder for [AuditManager::get_location][crate::client::AuditManager::get_location] calls.
976    ///
977    /// # Example
978    /// ```
979    /// # use google_cloud_auditmanager_v1::builder::audit_manager::GetLocation;
980    /// # async fn sample() -> google_cloud_auditmanager_v1::Result<()> {
981    ///
982    /// let builder = prepare_request_builder();
983    /// let response = builder.send().await?;
984    /// # Ok(()) }
985    ///
986    /// fn prepare_request_builder() -> GetLocation {
987    ///   # panic!();
988    ///   // ... details omitted ...
989    /// }
990    /// ```
991    #[derive(Clone, Debug)]
992    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
993
994    impl GetLocation {
995        pub(crate) fn new(
996            stub: std::sync::Arc<dyn super::super::stub::dynamic::AuditManager>,
997        ) -> Self {
998            Self(RequestBuilder::new(stub))
999        }
1000
1001        /// Sets the full request, replacing any prior values.
1002        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1003            mut self,
1004            v: V,
1005        ) -> Self {
1006            self.0.request = v.into();
1007            self
1008        }
1009
1010        /// Sets all the options, replacing any prior values.
1011        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1012            self.0.options = v.into();
1013            self
1014        }
1015
1016        /// Sends the request.
1017        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1018            (*self.0.stub)
1019                .get_location(self.0.request, self.0.options)
1020                .await
1021                .map(crate::Response::into_body)
1022        }
1023
1024        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
1025        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1026            self.0.request.name = v.into();
1027            self
1028        }
1029    }
1030
1031    #[doc(hidden)]
1032    impl crate::RequestBuilder for GetLocation {
1033        fn request_options(&mut self) -> &mut crate::RequestOptions {
1034            &mut self.0.options
1035        }
1036    }
1037
1038    /// The request builder for [AuditManager::list_operations][crate::client::AuditManager::list_operations] calls.
1039    ///
1040    /// # Example
1041    /// ```
1042    /// # use google_cloud_auditmanager_v1::builder::audit_manager::ListOperations;
1043    /// # async fn sample() -> google_cloud_auditmanager_v1::Result<()> {
1044    /// use google_cloud_gax::paginator::ItemPaginator;
1045    ///
1046    /// let builder = prepare_request_builder();
1047    /// let mut items = builder.by_item();
1048    /// while let Some(result) = items.next().await {
1049    ///   let item = result?;
1050    /// }
1051    /// # Ok(()) }
1052    ///
1053    /// fn prepare_request_builder() -> ListOperations {
1054    ///   # panic!();
1055    ///   // ... details omitted ...
1056    /// }
1057    /// ```
1058    #[derive(Clone, Debug)]
1059    pub struct ListOperations(
1060        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1061    );
1062
1063    impl ListOperations {
1064        pub(crate) fn new(
1065            stub: std::sync::Arc<dyn super::super::stub::dynamic::AuditManager>,
1066        ) -> Self {
1067            Self(RequestBuilder::new(stub))
1068        }
1069
1070        /// Sets the full request, replacing any prior values.
1071        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1072            mut self,
1073            v: V,
1074        ) -> Self {
1075            self.0.request = v.into();
1076            self
1077        }
1078
1079        /// Sets all the options, replacing any prior values.
1080        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1081            self.0.options = v.into();
1082            self
1083        }
1084
1085        /// Sends the request.
1086        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1087            (*self.0.stub)
1088                .list_operations(self.0.request, self.0.options)
1089                .await
1090                .map(crate::Response::into_body)
1091        }
1092
1093        /// Streams each page in the collection.
1094        pub fn by_page(
1095            self,
1096        ) -> impl google_cloud_gax::paginator::Paginator<
1097            google_cloud_longrunning::model::ListOperationsResponse,
1098            crate::Error,
1099        > {
1100            use std::clone::Clone;
1101            let token = self.0.request.page_token.clone();
1102            let execute = move |token: String| {
1103                let mut builder = self.clone();
1104                builder.0.request = builder.0.request.set_page_token(token);
1105                builder.send()
1106            };
1107            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1108        }
1109
1110        /// Streams each item in the collection.
1111        pub fn by_item(
1112            self,
1113        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1114            google_cloud_longrunning::model::ListOperationsResponse,
1115            crate::Error,
1116        > {
1117            use google_cloud_gax::paginator::Paginator;
1118            self.by_page().items()
1119        }
1120
1121        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
1122        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1123            self.0.request.name = v.into();
1124            self
1125        }
1126
1127        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
1128        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1129            self.0.request.filter = v.into();
1130            self
1131        }
1132
1133        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
1134        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1135            self.0.request.page_size = v.into();
1136            self
1137        }
1138
1139        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
1140        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1141            self.0.request.page_token = v.into();
1142            self
1143        }
1144
1145        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
1146        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1147            self.0.request.return_partial_success = v.into();
1148            self
1149        }
1150    }
1151
1152    #[doc(hidden)]
1153    impl crate::RequestBuilder for ListOperations {
1154        fn request_options(&mut self) -> &mut crate::RequestOptions {
1155            &mut self.0.options
1156        }
1157    }
1158
1159    /// The request builder for [AuditManager::get_operation][crate::client::AuditManager::get_operation] calls.
1160    ///
1161    /// # Example
1162    /// ```
1163    /// # use google_cloud_auditmanager_v1::builder::audit_manager::GetOperation;
1164    /// # async fn sample() -> google_cloud_auditmanager_v1::Result<()> {
1165    ///
1166    /// let builder = prepare_request_builder();
1167    /// let response = builder.send().await?;
1168    /// # Ok(()) }
1169    ///
1170    /// fn prepare_request_builder() -> GetOperation {
1171    ///   # panic!();
1172    ///   // ... details omitted ...
1173    /// }
1174    /// ```
1175    #[derive(Clone, Debug)]
1176    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1177
1178    impl GetOperation {
1179        pub(crate) fn new(
1180            stub: std::sync::Arc<dyn super::super::stub::dynamic::AuditManager>,
1181        ) -> Self {
1182            Self(RequestBuilder::new(stub))
1183        }
1184
1185        /// Sets the full request, replacing any prior values.
1186        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1187            mut self,
1188            v: V,
1189        ) -> Self {
1190            self.0.request = v.into();
1191            self
1192        }
1193
1194        /// Sets all the options, replacing any prior values.
1195        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1196            self.0.options = v.into();
1197            self
1198        }
1199
1200        /// Sends the request.
1201        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1202            (*self.0.stub)
1203                .get_operation(self.0.request, self.0.options)
1204                .await
1205                .map(crate::Response::into_body)
1206        }
1207
1208        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
1209        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1210            self.0.request.name = v.into();
1211            self
1212        }
1213    }
1214
1215    #[doc(hidden)]
1216    impl crate::RequestBuilder for GetOperation {
1217        fn request_options(&mut self) -> &mut crate::RequestOptions {
1218            &mut self.0.options
1219        }
1220    }
1221
1222    /// The request builder for [AuditManager::delete_operation][crate::client::AuditManager::delete_operation] calls.
1223    ///
1224    /// # Example
1225    /// ```
1226    /// # use google_cloud_auditmanager_v1::builder::audit_manager::DeleteOperation;
1227    /// # async fn sample() -> google_cloud_auditmanager_v1::Result<()> {
1228    ///
1229    /// let builder = prepare_request_builder();
1230    /// let response = builder.send().await?;
1231    /// # Ok(()) }
1232    ///
1233    /// fn prepare_request_builder() -> DeleteOperation {
1234    ///   # panic!();
1235    ///   // ... details omitted ...
1236    /// }
1237    /// ```
1238    #[derive(Clone, Debug)]
1239    pub struct DeleteOperation(
1240        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
1241    );
1242
1243    impl DeleteOperation {
1244        pub(crate) fn new(
1245            stub: std::sync::Arc<dyn super::super::stub::dynamic::AuditManager>,
1246        ) -> Self {
1247            Self(RequestBuilder::new(stub))
1248        }
1249
1250        /// Sets the full request, replacing any prior values.
1251        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
1252            mut self,
1253            v: V,
1254        ) -> Self {
1255            self.0.request = v.into();
1256            self
1257        }
1258
1259        /// Sets all the options, replacing any prior values.
1260        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1261            self.0.options = v.into();
1262            self
1263        }
1264
1265        /// Sends the request.
1266        pub async fn send(self) -> Result<()> {
1267            (*self.0.stub)
1268                .delete_operation(self.0.request, self.0.options)
1269                .await
1270                .map(crate::Response::into_body)
1271        }
1272
1273        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
1274        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1275            self.0.request.name = v.into();
1276            self
1277        }
1278    }
1279
1280    #[doc(hidden)]
1281    impl crate::RequestBuilder for DeleteOperation {
1282        fn request_options(&mut self) -> &mut crate::RequestOptions {
1283            &mut self.0.options
1284        }
1285    }
1286
1287    /// The request builder for [AuditManager::cancel_operation][crate::client::AuditManager::cancel_operation] calls.
1288    ///
1289    /// # Example
1290    /// ```
1291    /// # use google_cloud_auditmanager_v1::builder::audit_manager::CancelOperation;
1292    /// # async fn sample() -> google_cloud_auditmanager_v1::Result<()> {
1293    ///
1294    /// let builder = prepare_request_builder();
1295    /// let response = builder.send().await?;
1296    /// # Ok(()) }
1297    ///
1298    /// fn prepare_request_builder() -> CancelOperation {
1299    ///   # panic!();
1300    ///   // ... details omitted ...
1301    /// }
1302    /// ```
1303    #[derive(Clone, Debug)]
1304    pub struct CancelOperation(
1305        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
1306    );
1307
1308    impl CancelOperation {
1309        pub(crate) fn new(
1310            stub: std::sync::Arc<dyn super::super::stub::dynamic::AuditManager>,
1311        ) -> Self {
1312            Self(RequestBuilder::new(stub))
1313        }
1314
1315        /// Sets the full request, replacing any prior values.
1316        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
1317            mut self,
1318            v: V,
1319        ) -> Self {
1320            self.0.request = v.into();
1321            self
1322        }
1323
1324        /// Sets all the options, replacing any prior values.
1325        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1326            self.0.options = v.into();
1327            self
1328        }
1329
1330        /// Sends the request.
1331        pub async fn send(self) -> Result<()> {
1332            (*self.0.stub)
1333                .cancel_operation(self.0.request, self.0.options)
1334                .await
1335                .map(crate::Response::into_body)
1336        }
1337
1338        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
1339        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1340            self.0.request.name = v.into();
1341            self
1342        }
1343    }
1344
1345    #[doc(hidden)]
1346    impl crate::RequestBuilder for CancelOperation {
1347        fn request_options(&mut self) -> &mut crate::RequestOptions {
1348            &mut self.0.options
1349        }
1350    }
1351}