Skip to main content

google_cloud_auditmanager_v1/
model.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
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_location;
25extern crate google_cloud_longrunning;
26extern crate google_cloud_lro;
27extern crate lazy_static;
28extern crate serde;
29extern crate serde_json;
30extern crate serde_with;
31extern crate std;
32extern crate tracing;
33extern crate wkt;
34
35mod debug;
36mod deserialize;
37mod serialize;
38
39/// Request message to subscribe the Audit Manager service for given resource.
40#[derive(Clone, Default, PartialEq)]
41#[non_exhaustive]
42pub struct EnrollResourceRequest {
43    /// Required. The resource to be enrolled to the audit manager. Scope format
44    /// should be resource_type/resource_identifier Eg:
45    /// projects/{project}/locations/{location},
46    /// folders/{folder}/locations/{location}
47    /// organizations/{organization}/locations/{location}
48    pub scope: std::string::String,
49
50    /// Required. List of destination among which customer can choose to upload
51    /// their reports during the audit process. While enrolling at a
52    /// organization/folder level, customer can choose Cloud storage bucket in any
53    /// project. If the audit is triggered at project level using the service agent
54    /// at organization/folder level, all the destination options associated with
55    /// respective organization/folder level service agent will be available to
56    /// auditing projects.
57    pub destinations: std::vec::Vec<crate::model::enroll_resource_request::EligibleDestination>,
58
59    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
60}
61
62impl EnrollResourceRequest {
63    pub fn new() -> Self {
64        std::default::Default::default()
65    }
66
67    /// Sets the value of [scope][crate::model::EnrollResourceRequest::scope].
68    ///
69    /// # Example
70    /// ```ignore,no_run
71    /// # use google_cloud_auditmanager_v1::model::EnrollResourceRequest;
72    /// let x = EnrollResourceRequest::new().set_scope("example");
73    /// ```
74    pub fn set_scope<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
75        self.scope = v.into();
76        self
77    }
78
79    /// Sets the value of [destinations][crate::model::EnrollResourceRequest::destinations].
80    ///
81    /// # Example
82    /// ```ignore,no_run
83    /// # use google_cloud_auditmanager_v1::model::EnrollResourceRequest;
84    /// use google_cloud_auditmanager_v1::model::enroll_resource_request::EligibleDestination;
85    /// let x = EnrollResourceRequest::new()
86    ///     .set_destinations([
87    ///         EligibleDestination::default()/* use setters */,
88    ///         EligibleDestination::default()/* use (different) setters */,
89    ///     ]);
90    /// ```
91    pub fn set_destinations<T, V>(mut self, v: T) -> Self
92    where
93        T: std::iter::IntoIterator<Item = V>,
94        V: std::convert::Into<crate::model::enroll_resource_request::EligibleDestination>,
95    {
96        use std::iter::Iterator;
97        self.destinations = v.into_iter().map(|i| i.into()).collect();
98        self
99    }
100}
101
102impl wkt::message::Message for EnrollResourceRequest {
103    fn typename() -> &'static str {
104        "type.googleapis.com/google.cloud.auditmanager.v1.EnrollResourceRequest"
105    }
106}
107
108/// Defines additional types related to [EnrollResourceRequest].
109pub mod enroll_resource_request {
110    #[allow(unused_imports)]
111    use super::*;
112
113    /// The destination details where the audit report must be uploaded.
114    #[derive(Clone, Default, PartialEq)]
115    #[non_exhaustive]
116    pub struct EligibleDestination {
117        /// The options for the report destination location.
118        pub eligible_destinations: std::option::Option<
119            crate::model::enroll_resource_request::eligible_destination::EligibleDestinations,
120        >,
121
122        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
123    }
124
125    impl EligibleDestination {
126        pub fn new() -> Self {
127            std::default::Default::default()
128        }
129
130        /// Sets the value of [eligible_destinations][crate::model::enroll_resource_request::EligibleDestination::eligible_destinations].
131        ///
132        /// Note that all the setters affecting `eligible_destinations` are mutually
133        /// exclusive.
134        ///
135        /// # Example
136        /// ```ignore,no_run
137        /// # use google_cloud_auditmanager_v1::model::enroll_resource_request::EligibleDestination;
138        /// use google_cloud_auditmanager_v1::model::enroll_resource_request::eligible_destination::EligibleDestinations;
139        /// let x = EligibleDestination::new().set_eligible_destinations(Some(EligibleDestinations::EligibleGcsBucket("example".to_string())));
140        /// ```
141        pub fn set_eligible_destinations<T: std::convert::Into<std::option::Option<crate::model::enroll_resource_request::eligible_destination::EligibleDestinations>>>(mut self, v: T) -> Self
142        {
143            self.eligible_destinations = v.into();
144            self
145        }
146
147        /// The value of [eligible_destinations][crate::model::enroll_resource_request::EligibleDestination::eligible_destinations]
148        /// if it holds a `EligibleGcsBucket`, `None` if the field is not set or
149        /// holds a different branch.
150        pub fn eligible_gcs_bucket(&self) -> std::option::Option<&std::string::String> {
151            #[allow(unreachable_patterns)]
152            self.eligible_destinations.as_ref().and_then(|v| match v {
153                crate::model::enroll_resource_request::eligible_destination::EligibleDestinations::EligibleGcsBucket(v) => std::option::Option::Some(v),
154                _ => std::option::Option::None,
155            })
156        }
157
158        /// Sets the value of [eligible_destinations][crate::model::enroll_resource_request::EligibleDestination::eligible_destinations]
159        /// to hold a `EligibleGcsBucket`.
160        ///
161        /// Note that all the setters affecting `eligible_destinations` are
162        /// mutually exclusive.
163        ///
164        /// # Example
165        /// ```ignore,no_run
166        /// # use google_cloud_auditmanager_v1::model::enroll_resource_request::EligibleDestination;
167        /// let x = EligibleDestination::new().set_eligible_gcs_bucket("example");
168        /// assert!(x.eligible_gcs_bucket().is_some());
169        /// ```
170        pub fn set_eligible_gcs_bucket<T: std::convert::Into<std::string::String>>(
171            mut self,
172            v: T,
173        ) -> Self {
174            self.eligible_destinations = std::option::Option::Some(
175                crate::model::enroll_resource_request::eligible_destination::EligibleDestinations::EligibleGcsBucket(
176                    v.into()
177                )
178            );
179            self
180        }
181    }
182
183    impl wkt::message::Message for EligibleDestination {
184        fn typename() -> &'static str {
185            "type.googleapis.com/google.cloud.auditmanager.v1.EnrollResourceRequest.EligibleDestination"
186        }
187    }
188
189    /// Defines additional types related to [EligibleDestination].
190    pub mod eligible_destination {
191        #[allow(unused_imports)]
192        use super::*;
193
194        /// The options for the report destination location.
195        #[derive(Clone, Debug, PartialEq)]
196        #[non_exhaustive]
197        pub enum EligibleDestinations {
198            /// The Cloud Storage bucket location where the audit report and evidences
199            /// can be uploaded during the `GenerateAuditReport` API call.
200            EligibleGcsBucket(std::string::String),
201        }
202    }
203}
204
205/// Message for requesting audit scope report.
206#[derive(Clone, Default, PartialEq)]
207#[non_exhaustive]
208pub struct GenerateAuditScopeReportRequest {
209    /// Required. Scope for which the AuditScopeReport is required. Must be of
210    /// format resource_type/resource_identifier Eg:
211    /// projects/{project}/locations/{location},
212    /// folders/{folder}/locations/{location}
213    pub scope: std::string::String,
214
215    /// Required. Compliance Standard against which the Scope Report must be
216    /// generated. Eg: FEDRAMP_MODERATE
217    pub compliance_standard: std::string::String,
218
219    /// Required. The format in which the Scope report bytes should be returned.
220    pub report_format: crate::model::generate_audit_scope_report_request::AuditScopeReportFormat,
221
222    /// Required. Compliance framework against which the Scope Report must be
223    /// generated.
224    pub compliance_framework: std::string::String,
225
226    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
227}
228
229impl GenerateAuditScopeReportRequest {
230    pub fn new() -> Self {
231        std::default::Default::default()
232    }
233
234    /// Sets the value of [scope][crate::model::GenerateAuditScopeReportRequest::scope].
235    ///
236    /// # Example
237    /// ```ignore,no_run
238    /// # use google_cloud_auditmanager_v1::model::GenerateAuditScopeReportRequest;
239    /// let x = GenerateAuditScopeReportRequest::new().set_scope("example");
240    /// ```
241    pub fn set_scope<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
242        self.scope = v.into();
243        self
244    }
245
246    /// Sets the value of [compliance_standard][crate::model::GenerateAuditScopeReportRequest::compliance_standard].
247    ///
248    /// # Example
249    /// ```ignore,no_run
250    /// # use google_cloud_auditmanager_v1::model::GenerateAuditScopeReportRequest;
251    /// let x = GenerateAuditScopeReportRequest::new().set_compliance_standard("example");
252    /// ```
253    pub fn set_compliance_standard<T: std::convert::Into<std::string::String>>(
254        mut self,
255        v: T,
256    ) -> Self {
257        self.compliance_standard = v.into();
258        self
259    }
260
261    /// Sets the value of [report_format][crate::model::GenerateAuditScopeReportRequest::report_format].
262    ///
263    /// # Example
264    /// ```ignore,no_run
265    /// # use google_cloud_auditmanager_v1::model::GenerateAuditScopeReportRequest;
266    /// use google_cloud_auditmanager_v1::model::generate_audit_scope_report_request::AuditScopeReportFormat;
267    /// let x0 = GenerateAuditScopeReportRequest::new().set_report_format(AuditScopeReportFormat::Odf);
268    /// ```
269    pub fn set_report_format<
270        T: std::convert::Into<
271                crate::model::generate_audit_scope_report_request::AuditScopeReportFormat,
272            >,
273    >(
274        mut self,
275        v: T,
276    ) -> Self {
277        self.report_format = v.into();
278        self
279    }
280
281    /// Sets the value of [compliance_framework][crate::model::GenerateAuditScopeReportRequest::compliance_framework].
282    ///
283    /// # Example
284    /// ```ignore,no_run
285    /// # use google_cloud_auditmanager_v1::model::GenerateAuditScopeReportRequest;
286    /// let x = GenerateAuditScopeReportRequest::new().set_compliance_framework("example");
287    /// ```
288    pub fn set_compliance_framework<T: std::convert::Into<std::string::String>>(
289        mut self,
290        v: T,
291    ) -> Self {
292        self.compliance_framework = v.into();
293        self
294    }
295}
296
297impl wkt::message::Message for GenerateAuditScopeReportRequest {
298    fn typename() -> &'static str {
299        "type.googleapis.com/google.cloud.auditmanager.v1.GenerateAuditScopeReportRequest"
300    }
301}
302
303/// Defines additional types related to [GenerateAuditScopeReportRequest].
304pub mod generate_audit_scope_report_request {
305    #[allow(unused_imports)]
306    use super::*;
307
308    /// The options for the audit scope report format.
309    ///
310    /// # Working with unknown values
311    ///
312    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
313    /// additional enum variants at any time. Adding new variants is not considered
314    /// a breaking change. Applications should write their code in anticipation of:
315    ///
316    /// - New values appearing in future releases of the client library, **and**
317    /// - New values received dynamically, without application changes.
318    ///
319    /// Please consult the [Working with enums] section in the user guide for some
320    /// guidelines.
321    ///
322    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
323    #[derive(Clone, Debug, PartialEq)]
324    #[non_exhaustive]
325    pub enum AuditScopeReportFormat {
326        /// Unspecified. Invalid format.
327        Unspecified,
328        /// Audit Scope Report creation format is Open Document.
329        Odf,
330        /// If set, the enum was initialized with an unknown value.
331        ///
332        /// Applications can examine the value using [AuditScopeReportFormat::value] or
333        /// [AuditScopeReportFormat::name].
334        UnknownValue(audit_scope_report_format::UnknownValue),
335    }
336
337    #[doc(hidden)]
338    pub mod audit_scope_report_format {
339        #[allow(unused_imports)]
340        use super::*;
341        #[derive(Clone, Debug, PartialEq)]
342        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
343    }
344
345    impl AuditScopeReportFormat {
346        /// Gets the enum value.
347        ///
348        /// Returns `None` if the enum contains an unknown value deserialized from
349        /// the string representation of enums.
350        pub fn value(&self) -> std::option::Option<i32> {
351            match self {
352                Self::Unspecified => std::option::Option::Some(0),
353                Self::Odf => std::option::Option::Some(1),
354                Self::UnknownValue(u) => u.0.value(),
355            }
356        }
357
358        /// Gets the enum value as a string.
359        ///
360        /// Returns `None` if the enum contains an unknown value deserialized from
361        /// the integer representation of enums.
362        pub fn name(&self) -> std::option::Option<&str> {
363            match self {
364                Self::Unspecified => {
365                    std::option::Option::Some("AUDIT_SCOPE_REPORT_FORMAT_UNSPECIFIED")
366                }
367                Self::Odf => std::option::Option::Some("AUDIT_SCOPE_REPORT_FORMAT_ODF"),
368                Self::UnknownValue(u) => u.0.name(),
369            }
370        }
371    }
372
373    impl std::default::Default for AuditScopeReportFormat {
374        fn default() -> Self {
375            use std::convert::From;
376            Self::from(0)
377        }
378    }
379
380    impl std::fmt::Display for AuditScopeReportFormat {
381        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
382            wkt::internal::display_enum(f, self.name(), self.value())
383        }
384    }
385
386    impl std::convert::From<i32> for AuditScopeReportFormat {
387        fn from(value: i32) -> Self {
388            match value {
389                0 => Self::Unspecified,
390                1 => Self::Odf,
391                _ => Self::UnknownValue(audit_scope_report_format::UnknownValue(
392                    wkt::internal::UnknownEnumValue::Integer(value),
393                )),
394            }
395        }
396    }
397
398    impl std::convert::From<&str> for AuditScopeReportFormat {
399        fn from(value: &str) -> Self {
400            use std::string::ToString;
401            match value {
402                "AUDIT_SCOPE_REPORT_FORMAT_UNSPECIFIED" => Self::Unspecified,
403                "AUDIT_SCOPE_REPORT_FORMAT_ODF" => Self::Odf,
404                _ => Self::UnknownValue(audit_scope_report_format::UnknownValue(
405                    wkt::internal::UnknownEnumValue::String(value.to_string()),
406                )),
407            }
408        }
409    }
410
411    impl serde::ser::Serialize for AuditScopeReportFormat {
412        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
413        where
414            S: serde::Serializer,
415        {
416            match self {
417                Self::Unspecified => serializer.serialize_i32(0),
418                Self::Odf => serializer.serialize_i32(1),
419                Self::UnknownValue(u) => u.0.serialize(serializer),
420            }
421        }
422    }
423
424    impl<'de> serde::de::Deserialize<'de> for AuditScopeReportFormat {
425        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
426        where
427            D: serde::Deserializer<'de>,
428        {
429            deserializer.deserialize_any(wkt::internal::EnumVisitor::<AuditScopeReportFormat>::new(
430                ".google.cloud.auditmanager.v1.GenerateAuditScopeReportRequest.AuditScopeReportFormat"))
431        }
432    }
433}
434
435/// Message for requesting the Audit Report.
436#[derive(Clone, Default, PartialEq)]
437#[non_exhaustive]
438pub struct GenerateAuditReportRequest {
439    /// Required. Scope for which the AuditScopeReport is required. Must be of
440    /// format resource_type/resource_identifier Eg:
441    /// projects/{project}/locations/{location},
442    /// folders/{folder}/locations/{location}
443    pub scope: std::string::String,
444
445    /// Required. Compliance Standard against which the Scope Report must be
446    /// generated. Eg: FEDRAMP_MODERATE
447    pub compliance_standard: std::string::String,
448
449    /// Required. The format in which the audit report should be created.
450    pub report_format: crate::model::generate_audit_report_request::AuditReportFormat,
451
452    /// Required. Compliance framework against which the Report must be generated.
453    pub compliance_framework: std::string::String,
454
455    /// Set of options for the report destination location.
456    pub destination: std::option::Option<crate::model::generate_audit_report_request::Destination>,
457
458    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
459}
460
461impl GenerateAuditReportRequest {
462    pub fn new() -> Self {
463        std::default::Default::default()
464    }
465
466    /// Sets the value of [scope][crate::model::GenerateAuditReportRequest::scope].
467    ///
468    /// # Example
469    /// ```ignore,no_run
470    /// # use google_cloud_auditmanager_v1::model::GenerateAuditReportRequest;
471    /// let x = GenerateAuditReportRequest::new().set_scope("example");
472    /// ```
473    pub fn set_scope<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
474        self.scope = v.into();
475        self
476    }
477
478    /// Sets the value of [compliance_standard][crate::model::GenerateAuditReportRequest::compliance_standard].
479    ///
480    /// # Example
481    /// ```ignore,no_run
482    /// # use google_cloud_auditmanager_v1::model::GenerateAuditReportRequest;
483    /// let x = GenerateAuditReportRequest::new().set_compliance_standard("example");
484    /// ```
485    pub fn set_compliance_standard<T: std::convert::Into<std::string::String>>(
486        mut self,
487        v: T,
488    ) -> Self {
489        self.compliance_standard = v.into();
490        self
491    }
492
493    /// Sets the value of [report_format][crate::model::GenerateAuditReportRequest::report_format].
494    ///
495    /// # Example
496    /// ```ignore,no_run
497    /// # use google_cloud_auditmanager_v1::model::GenerateAuditReportRequest;
498    /// use google_cloud_auditmanager_v1::model::generate_audit_report_request::AuditReportFormat;
499    /// let x0 = GenerateAuditReportRequest::new().set_report_format(AuditReportFormat::Odf);
500    /// ```
501    pub fn set_report_format<
502        T: std::convert::Into<crate::model::generate_audit_report_request::AuditReportFormat>,
503    >(
504        mut self,
505        v: T,
506    ) -> Self {
507        self.report_format = v.into();
508        self
509    }
510
511    /// Sets the value of [compliance_framework][crate::model::GenerateAuditReportRequest::compliance_framework].
512    ///
513    /// # Example
514    /// ```ignore,no_run
515    /// # use google_cloud_auditmanager_v1::model::GenerateAuditReportRequest;
516    /// let x = GenerateAuditReportRequest::new().set_compliance_framework("example");
517    /// ```
518    pub fn set_compliance_framework<T: std::convert::Into<std::string::String>>(
519        mut self,
520        v: T,
521    ) -> Self {
522        self.compliance_framework = v.into();
523        self
524    }
525
526    /// Sets the value of [destination][crate::model::GenerateAuditReportRequest::destination].
527    ///
528    /// Note that all the setters affecting `destination` are mutually
529    /// exclusive.
530    ///
531    /// # Example
532    /// ```ignore,no_run
533    /// # use google_cloud_auditmanager_v1::model::GenerateAuditReportRequest;
534    /// use google_cloud_auditmanager_v1::model::generate_audit_report_request::Destination;
535    /// let x = GenerateAuditReportRequest::new().set_destination(Some(Destination::GcsUri("example".to_string())));
536    /// ```
537    pub fn set_destination<
538        T: std::convert::Into<
539                std::option::Option<crate::model::generate_audit_report_request::Destination>,
540            >,
541    >(
542        mut self,
543        v: T,
544    ) -> Self {
545        self.destination = v.into();
546        self
547    }
548
549    /// The value of [destination][crate::model::GenerateAuditReportRequest::destination]
550    /// if it holds a `GcsUri`, `None` if the field is not set or
551    /// holds a different branch.
552    pub fn gcs_uri(&self) -> std::option::Option<&std::string::String> {
553        #[allow(unreachable_patterns)]
554        self.destination.as_ref().and_then(|v| match v {
555            crate::model::generate_audit_report_request::Destination::GcsUri(v) => {
556                std::option::Option::Some(v)
557            }
558            _ => std::option::Option::None,
559        })
560    }
561
562    /// Sets the value of [destination][crate::model::GenerateAuditReportRequest::destination]
563    /// to hold a `GcsUri`.
564    ///
565    /// Note that all the setters affecting `destination` are
566    /// mutually exclusive.
567    ///
568    /// # Example
569    /// ```ignore,no_run
570    /// # use google_cloud_auditmanager_v1::model::GenerateAuditReportRequest;
571    /// let x = GenerateAuditReportRequest::new().set_gcs_uri("example");
572    /// assert!(x.gcs_uri().is_some());
573    /// ```
574    pub fn set_gcs_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
575        self.destination = std::option::Option::Some(
576            crate::model::generate_audit_report_request::Destination::GcsUri(v.into()),
577        );
578        self
579    }
580}
581
582impl wkt::message::Message for GenerateAuditReportRequest {
583    fn typename() -> &'static str {
584        "type.googleapis.com/google.cloud.auditmanager.v1.GenerateAuditReportRequest"
585    }
586}
587
588/// Defines additional types related to [GenerateAuditReportRequest].
589pub mod generate_audit_report_request {
590    #[allow(unused_imports)]
591    use super::*;
592
593    /// The options for the audit report format.
594    ///
595    /// # Working with unknown values
596    ///
597    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
598    /// additional enum variants at any time. Adding new variants is not considered
599    /// a breaking change. Applications should write their code in anticipation of:
600    ///
601    /// - New values appearing in future releases of the client library, **and**
602    /// - New values received dynamically, without application changes.
603    ///
604    /// Please consult the [Working with enums] section in the user guide for some
605    /// guidelines.
606    ///
607    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
608    #[derive(Clone, Debug, PartialEq)]
609    #[non_exhaustive]
610    pub enum AuditReportFormat {
611        /// Unspecified. Invalid state.
612        Unspecified,
613        /// Audit Report creation format is Open Document.
614        Odf,
615        /// If set, the enum was initialized with an unknown value.
616        ///
617        /// Applications can examine the value using [AuditReportFormat::value] or
618        /// [AuditReportFormat::name].
619        UnknownValue(audit_report_format::UnknownValue),
620    }
621
622    #[doc(hidden)]
623    pub mod audit_report_format {
624        #[allow(unused_imports)]
625        use super::*;
626        #[derive(Clone, Debug, PartialEq)]
627        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
628    }
629
630    impl AuditReportFormat {
631        /// Gets the enum value.
632        ///
633        /// Returns `None` if the enum contains an unknown value deserialized from
634        /// the string representation of enums.
635        pub fn value(&self) -> std::option::Option<i32> {
636            match self {
637                Self::Unspecified => std::option::Option::Some(0),
638                Self::Odf => std::option::Option::Some(1),
639                Self::UnknownValue(u) => u.0.value(),
640            }
641        }
642
643        /// Gets the enum value as a string.
644        ///
645        /// Returns `None` if the enum contains an unknown value deserialized from
646        /// the integer representation of enums.
647        pub fn name(&self) -> std::option::Option<&str> {
648            match self {
649                Self::Unspecified => std::option::Option::Some("AUDIT_REPORT_FORMAT_UNSPECIFIED"),
650                Self::Odf => std::option::Option::Some("AUDIT_REPORT_FORMAT_ODF"),
651                Self::UnknownValue(u) => u.0.name(),
652            }
653        }
654    }
655
656    impl std::default::Default for AuditReportFormat {
657        fn default() -> Self {
658            use std::convert::From;
659            Self::from(0)
660        }
661    }
662
663    impl std::fmt::Display for AuditReportFormat {
664        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
665            wkt::internal::display_enum(f, self.name(), self.value())
666        }
667    }
668
669    impl std::convert::From<i32> for AuditReportFormat {
670        fn from(value: i32) -> Self {
671            match value {
672                0 => Self::Unspecified,
673                1 => Self::Odf,
674                _ => Self::UnknownValue(audit_report_format::UnknownValue(
675                    wkt::internal::UnknownEnumValue::Integer(value),
676                )),
677            }
678        }
679    }
680
681    impl std::convert::From<&str> for AuditReportFormat {
682        fn from(value: &str) -> Self {
683            use std::string::ToString;
684            match value {
685                "AUDIT_REPORT_FORMAT_UNSPECIFIED" => Self::Unspecified,
686                "AUDIT_REPORT_FORMAT_ODF" => Self::Odf,
687                _ => Self::UnknownValue(audit_report_format::UnknownValue(
688                    wkt::internal::UnknownEnumValue::String(value.to_string()),
689                )),
690            }
691        }
692    }
693
694    impl serde::ser::Serialize for AuditReportFormat {
695        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
696        where
697            S: serde::Serializer,
698        {
699            match self {
700                Self::Unspecified => serializer.serialize_i32(0),
701                Self::Odf => serializer.serialize_i32(1),
702                Self::UnknownValue(u) => u.0.serialize(serializer),
703            }
704        }
705    }
706
707    impl<'de> serde::de::Deserialize<'de> for AuditReportFormat {
708        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
709        where
710            D: serde::Deserializer<'de>,
711        {
712            deserializer.deserialize_any(wkt::internal::EnumVisitor::<AuditReportFormat>::new(
713                ".google.cloud.auditmanager.v1.GenerateAuditReportRequest.AuditReportFormat",
714            ))
715        }
716    }
717
718    /// Set of options for the report destination location.
719    #[derive(Clone, Debug, PartialEq)]
720    #[non_exhaustive]
721    pub enum Destination {
722        /// Destination Cloud storage bucket where report and evidence must be
723        /// uploaded. The Cloud storage bucket provided here must be selected among
724        /// the buckets entered during the enrollment process.
725        GcsUri(std::string::String),
726    }
727}
728
729/// Message for getting the enrollment status of a resource.
730#[derive(Clone, Default, PartialEq)]
731#[non_exhaustive]
732pub struct GetResourceEnrollmentStatusRequest {
733    /// Required. Format
734    /// folders/{folder}/locations/{location}/resourceEnrollmentStatuses/{resource_enrollment_status},
735    /// projects/{project}/locations/{location}/resourceEnrollmentStatuses/{resource_enrollment_status},
736    /// organizations/{organization}/locations/{location}/resourceEnrollmentStatuses/{resource_enrollment_status}
737    pub name: std::string::String,
738
739    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
740}
741
742impl GetResourceEnrollmentStatusRequest {
743    pub fn new() -> Self {
744        std::default::Default::default()
745    }
746
747    /// Sets the value of [name][crate::model::GetResourceEnrollmentStatusRequest::name].
748    ///
749    /// # Example
750    /// ```ignore,no_run
751    /// # use google_cloud_auditmanager_v1::model::GetResourceEnrollmentStatusRequest;
752    /// let x = GetResourceEnrollmentStatusRequest::new().set_name("example");
753    /// ```
754    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
755        self.name = v.into();
756        self
757    }
758}
759
760impl wkt::message::Message for GetResourceEnrollmentStatusRequest {
761    fn typename() -> &'static str {
762        "type.googleapis.com/google.cloud.auditmanager.v1.GetResourceEnrollmentStatusRequest"
763    }
764}
765
766/// Message for listing all the descendent resources under parent with
767/// enrollment.
768#[derive(Clone, Default, PartialEq)]
769#[non_exhaustive]
770pub struct ListResourceEnrollmentStatusesRequest {
771    /// Required. The parent scope for which the list of resources with enrollments
772    /// are required.
773    pub parent: std::string::String,
774
775    /// Optional. The maximum number of resources to return.
776    pub page_size: i32,
777
778    /// Optional. The next_page_token value returned from a previous List request,
779    /// if any.
780    pub page_token: std::string::String,
781
782    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
783}
784
785impl ListResourceEnrollmentStatusesRequest {
786    pub fn new() -> Self {
787        std::default::Default::default()
788    }
789
790    /// Sets the value of [parent][crate::model::ListResourceEnrollmentStatusesRequest::parent].
791    ///
792    /// # Example
793    /// ```ignore,no_run
794    /// # use google_cloud_auditmanager_v1::model::ListResourceEnrollmentStatusesRequest;
795    /// let x = ListResourceEnrollmentStatusesRequest::new().set_parent("example");
796    /// ```
797    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
798        self.parent = v.into();
799        self
800    }
801
802    /// Sets the value of [page_size][crate::model::ListResourceEnrollmentStatusesRequest::page_size].
803    ///
804    /// # Example
805    /// ```ignore,no_run
806    /// # use google_cloud_auditmanager_v1::model::ListResourceEnrollmentStatusesRequest;
807    /// let x = ListResourceEnrollmentStatusesRequest::new().set_page_size(42);
808    /// ```
809    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
810        self.page_size = v.into();
811        self
812    }
813
814    /// Sets the value of [page_token][crate::model::ListResourceEnrollmentStatusesRequest::page_token].
815    ///
816    /// # Example
817    /// ```ignore,no_run
818    /// # use google_cloud_auditmanager_v1::model::ListResourceEnrollmentStatusesRequest;
819    /// let x = ListResourceEnrollmentStatusesRequest::new().set_page_token("example");
820    /// ```
821    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
822        self.page_token = v.into();
823        self
824    }
825}
826
827impl wkt::message::Message for ListResourceEnrollmentStatusesRequest {
828    fn typename() -> &'static str {
829        "type.googleapis.com/google.cloud.auditmanager.v1.ListResourceEnrollmentStatusesRequest"
830    }
831}
832
833/// Response message with all the descendent resources with enrollment.
834#[derive(Clone, Default, PartialEq)]
835#[non_exhaustive]
836pub struct ListResourceEnrollmentStatusesResponse {
837    /// The resources with their enrollment status.
838    pub resource_enrollment_statuses: std::vec::Vec<crate::model::ResourceEnrollmentStatus>,
839
840    /// Output only. The token to retrieve the next page of results.
841    pub next_page_token: std::string::String,
842
843    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
844}
845
846impl ListResourceEnrollmentStatusesResponse {
847    pub fn new() -> Self {
848        std::default::Default::default()
849    }
850
851    /// Sets the value of [resource_enrollment_statuses][crate::model::ListResourceEnrollmentStatusesResponse::resource_enrollment_statuses].
852    ///
853    /// # Example
854    /// ```ignore,no_run
855    /// # use google_cloud_auditmanager_v1::model::ListResourceEnrollmentStatusesResponse;
856    /// use google_cloud_auditmanager_v1::model::ResourceEnrollmentStatus;
857    /// let x = ListResourceEnrollmentStatusesResponse::new()
858    ///     .set_resource_enrollment_statuses([
859    ///         ResourceEnrollmentStatus::default()/* use setters */,
860    ///         ResourceEnrollmentStatus::default()/* use (different) setters */,
861    ///     ]);
862    /// ```
863    pub fn set_resource_enrollment_statuses<T, V>(mut self, v: T) -> Self
864    where
865        T: std::iter::IntoIterator<Item = V>,
866        V: std::convert::Into<crate::model::ResourceEnrollmentStatus>,
867    {
868        use std::iter::Iterator;
869        self.resource_enrollment_statuses = v.into_iter().map(|i| i.into()).collect();
870        self
871    }
872
873    /// Sets the value of [next_page_token][crate::model::ListResourceEnrollmentStatusesResponse::next_page_token].
874    ///
875    /// # Example
876    /// ```ignore,no_run
877    /// # use google_cloud_auditmanager_v1::model::ListResourceEnrollmentStatusesResponse;
878    /// let x = ListResourceEnrollmentStatusesResponse::new().set_next_page_token("example");
879    /// ```
880    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
881        self.next_page_token = v.into();
882        self
883    }
884}
885
886impl wkt::message::Message for ListResourceEnrollmentStatusesResponse {
887    fn typename() -> &'static str {
888        "type.googleapis.com/google.cloud.auditmanager.v1.ListResourceEnrollmentStatusesResponse"
889    }
890}
891
892#[doc(hidden)]
893impl google_cloud_gax::paginator::internal::PageableResponse
894    for ListResourceEnrollmentStatusesResponse
895{
896    type PageItem = crate::model::ResourceEnrollmentStatus;
897
898    fn items(self) -> std::vec::Vec<Self::PageItem> {
899        self.resource_enrollment_statuses
900    }
901
902    fn next_page_token(&self) -> std::string::String {
903        use std::clone::Clone;
904        self.next_page_token.clone()
905    }
906}
907
908/// Message for requesting to list the audit reports.
909#[derive(Clone, Default, PartialEq)]
910#[non_exhaustive]
911pub struct ListAuditReportsRequest {
912    /// Required. The parent scope for which to list the reports.
913    pub parent: std::string::String,
914
915    /// Optional. The maximum number of resources to return.
916    pub page_size: i32,
917
918    /// Optional. The next_page_token value returned from a previous List request,
919    /// if any.
920    pub page_token: std::string::String,
921
922    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
923}
924
925impl ListAuditReportsRequest {
926    pub fn new() -> Self {
927        std::default::Default::default()
928    }
929
930    /// Sets the value of [parent][crate::model::ListAuditReportsRequest::parent].
931    ///
932    /// # Example
933    /// ```ignore,no_run
934    /// # use google_cloud_auditmanager_v1::model::ListAuditReportsRequest;
935    /// let x = ListAuditReportsRequest::new().set_parent("example");
936    /// ```
937    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
938        self.parent = v.into();
939        self
940    }
941
942    /// Sets the value of [page_size][crate::model::ListAuditReportsRequest::page_size].
943    ///
944    /// # Example
945    /// ```ignore,no_run
946    /// # use google_cloud_auditmanager_v1::model::ListAuditReportsRequest;
947    /// let x = ListAuditReportsRequest::new().set_page_size(42);
948    /// ```
949    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
950        self.page_size = v.into();
951        self
952    }
953
954    /// Sets the value of [page_token][crate::model::ListAuditReportsRequest::page_token].
955    ///
956    /// # Example
957    /// ```ignore,no_run
958    /// # use google_cloud_auditmanager_v1::model::ListAuditReportsRequest;
959    /// let x = ListAuditReportsRequest::new().set_page_token("example");
960    /// ```
961    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
962        self.page_token = v.into();
963        self
964    }
965}
966
967impl wkt::message::Message for ListAuditReportsRequest {
968    fn typename() -> &'static str {
969        "type.googleapis.com/google.cloud.auditmanager.v1.ListAuditReportsRequest"
970    }
971}
972
973/// Response message with all the audit reports.
974#[derive(Clone, Default, PartialEq)]
975#[non_exhaustive]
976pub struct ListAuditReportsResponse {
977    /// Output only. The audit reports.
978    pub audit_reports: std::vec::Vec<crate::model::AuditReport>,
979
980    /// Output only. The token to retrieve the next page of results.
981    pub next_page_token: std::string::String,
982
983    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
984}
985
986impl ListAuditReportsResponse {
987    pub fn new() -> Self {
988        std::default::Default::default()
989    }
990
991    /// Sets the value of [audit_reports][crate::model::ListAuditReportsResponse::audit_reports].
992    ///
993    /// # Example
994    /// ```ignore,no_run
995    /// # use google_cloud_auditmanager_v1::model::ListAuditReportsResponse;
996    /// use google_cloud_auditmanager_v1::model::AuditReport;
997    /// let x = ListAuditReportsResponse::new()
998    ///     .set_audit_reports([
999    ///         AuditReport::default()/* use setters */,
1000    ///         AuditReport::default()/* use (different) setters */,
1001    ///     ]);
1002    /// ```
1003    pub fn set_audit_reports<T, V>(mut self, v: T) -> Self
1004    where
1005        T: std::iter::IntoIterator<Item = V>,
1006        V: std::convert::Into<crate::model::AuditReport>,
1007    {
1008        use std::iter::Iterator;
1009        self.audit_reports = v.into_iter().map(|i| i.into()).collect();
1010        self
1011    }
1012
1013    /// Sets the value of [next_page_token][crate::model::ListAuditReportsResponse::next_page_token].
1014    ///
1015    /// # Example
1016    /// ```ignore,no_run
1017    /// # use google_cloud_auditmanager_v1::model::ListAuditReportsResponse;
1018    /// let x = ListAuditReportsResponse::new().set_next_page_token("example");
1019    /// ```
1020    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1021        self.next_page_token = v.into();
1022        self
1023    }
1024}
1025
1026impl wkt::message::Message for ListAuditReportsResponse {
1027    fn typename() -> &'static str {
1028        "type.googleapis.com/google.cloud.auditmanager.v1.ListAuditReportsResponse"
1029    }
1030}
1031
1032#[doc(hidden)]
1033impl google_cloud_gax::paginator::internal::PageableResponse for ListAuditReportsResponse {
1034    type PageItem = crate::model::AuditReport;
1035
1036    fn items(self) -> std::vec::Vec<Self::PageItem> {
1037        self.audit_reports
1038    }
1039
1040    fn next_page_token(&self) -> std::string::String {
1041        use std::clone::Clone;
1042        self.next_page_token.clone()
1043    }
1044}
1045
1046/// Message for requesting the overall audit report for an audit report name.
1047#[derive(Clone, Default, PartialEq)]
1048#[non_exhaustive]
1049pub struct GetAuditReportRequest {
1050    /// Required. Format
1051    /// projects/{project}/locations/{location}/auditReports/{audit_report},
1052    /// folders/{folder}/locations/{location}/auditReports/{audit_report}
1053    pub name: std::string::String,
1054
1055    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1056}
1057
1058impl GetAuditReportRequest {
1059    pub fn new() -> Self {
1060        std::default::Default::default()
1061    }
1062
1063    /// Sets the value of [name][crate::model::GetAuditReportRequest::name].
1064    ///
1065    /// # Example
1066    /// ```ignore,no_run
1067    /// # use google_cloud_auditmanager_v1::model::GetAuditReportRequest;
1068    /// let x = GetAuditReportRequest::new().set_name("example");
1069    /// ```
1070    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1071        self.name = v.into();
1072        self
1073    }
1074}
1075
1076impl wkt::message::Message for GetAuditReportRequest {
1077    fn typename() -> &'static str {
1078        "type.googleapis.com/google.cloud.auditmanager.v1.GetAuditReportRequest"
1079    }
1080}
1081
1082/// Message for requesting all the controls for a compliance standard.
1083#[derive(Clone, Default, PartialEq)]
1084#[non_exhaustive]
1085pub struct ListControlsRequest {
1086    /// Required. Format
1087    /// projects/{project}/locations/{location}/standards/{standard},
1088    /// folders/{folder}/locations/{location}/standards/{standard}
1089    pub parent: std::string::String,
1090
1091    /// Optional. The maximum number of resources to return.
1092    pub page_size: i32,
1093
1094    /// Optional. The next_page_token value returned from a previous List request,
1095    /// if any.
1096    pub page_token: std::string::String,
1097
1098    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1099}
1100
1101impl ListControlsRequest {
1102    pub fn new() -> Self {
1103        std::default::Default::default()
1104    }
1105
1106    /// Sets the value of [parent][crate::model::ListControlsRequest::parent].
1107    ///
1108    /// # Example
1109    /// ```ignore,no_run
1110    /// # use google_cloud_auditmanager_v1::model::ListControlsRequest;
1111    /// let x = ListControlsRequest::new().set_parent("example");
1112    /// ```
1113    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1114        self.parent = v.into();
1115        self
1116    }
1117
1118    /// Sets the value of [page_size][crate::model::ListControlsRequest::page_size].
1119    ///
1120    /// # Example
1121    /// ```ignore,no_run
1122    /// # use google_cloud_auditmanager_v1::model::ListControlsRequest;
1123    /// let x = ListControlsRequest::new().set_page_size(42);
1124    /// ```
1125    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1126        self.page_size = v.into();
1127        self
1128    }
1129
1130    /// Sets the value of [page_token][crate::model::ListControlsRequest::page_token].
1131    ///
1132    /// # Example
1133    /// ```ignore,no_run
1134    /// # use google_cloud_auditmanager_v1::model::ListControlsRequest;
1135    /// let x = ListControlsRequest::new().set_page_token("example");
1136    /// ```
1137    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1138        self.page_token = v.into();
1139        self
1140    }
1141}
1142
1143impl wkt::message::Message for ListControlsRequest {
1144    fn typename() -> &'static str {
1145        "type.googleapis.com/google.cloud.auditmanager.v1.ListControlsRequest"
1146    }
1147}
1148
1149/// Response message with all the controls for a compliance standard.
1150#[derive(Clone, Default, PartialEq)]
1151#[non_exhaustive]
1152pub struct ListControlsResponse {
1153    /// Output only. The controls for the compliance standard.
1154    pub controls: std::vec::Vec<crate::model::Control>,
1155
1156    /// Output only. The token to retrieve the next page of results.
1157    pub next_page_token: std::string::String,
1158
1159    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1160}
1161
1162impl ListControlsResponse {
1163    pub fn new() -> Self {
1164        std::default::Default::default()
1165    }
1166
1167    /// Sets the value of [controls][crate::model::ListControlsResponse::controls].
1168    ///
1169    /// # Example
1170    /// ```ignore,no_run
1171    /// # use google_cloud_auditmanager_v1::model::ListControlsResponse;
1172    /// use google_cloud_auditmanager_v1::model::Control;
1173    /// let x = ListControlsResponse::new()
1174    ///     .set_controls([
1175    ///         Control::default()/* use setters */,
1176    ///         Control::default()/* use (different) setters */,
1177    ///     ]);
1178    /// ```
1179    pub fn set_controls<T, V>(mut self, v: T) -> Self
1180    where
1181        T: std::iter::IntoIterator<Item = V>,
1182        V: std::convert::Into<crate::model::Control>,
1183    {
1184        use std::iter::Iterator;
1185        self.controls = v.into_iter().map(|i| i.into()).collect();
1186        self
1187    }
1188
1189    /// Sets the value of [next_page_token][crate::model::ListControlsResponse::next_page_token].
1190    ///
1191    /// # Example
1192    /// ```ignore,no_run
1193    /// # use google_cloud_auditmanager_v1::model::ListControlsResponse;
1194    /// let x = ListControlsResponse::new().set_next_page_token("example");
1195    /// ```
1196    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1197        self.next_page_token = v.into();
1198        self
1199    }
1200}
1201
1202impl wkt::message::Message for ListControlsResponse {
1203    fn typename() -> &'static str {
1204        "type.googleapis.com/google.cloud.auditmanager.v1.ListControlsResponse"
1205    }
1206}
1207
1208#[doc(hidden)]
1209impl google_cloud_gax::paginator::internal::PageableResponse for ListControlsResponse {
1210    type PageItem = crate::model::Control;
1211
1212    fn items(self) -> std::vec::Vec<Self::PageItem> {
1213        self.controls
1214    }
1215
1216    fn next_page_token(&self) -> std::string::String {
1217        use std::clone::Clone;
1218        self.next_page_token.clone()
1219    }
1220}
1221
1222/// The `ReportGenerationProgress` is part of
1223/// [google.longrunning.Operation][google.longrunning.Operation] returned to the
1224/// client for every `GetOperation` request.
1225///
1226/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
1227#[derive(Clone, Default, PartialEq)]
1228#[non_exhaustive]
1229pub struct ReportGenerationProgress {
1230    /// Output only. The current state of execution for report generation.
1231    pub state: crate::model::OperationState,
1232
1233    /// Output only. States the reason of failure during the audit report
1234    /// generation process. This field is set only if the state attribute is
1235    /// OPERATION_STATE_FAILED.
1236    pub failure_reason: std::string::String,
1237
1238    /// Shows the progress of the CESS service evaluation process. The progress is
1239    /// defined in terms of percentage complete and is being fetched from the CESS
1240    /// service.
1241    pub evaluation_percent_complete: f64,
1242
1243    /// Shows the report generation progress of the CESS Result Processor Service.
1244    /// The // progress is defined in terms of percentage complete and is being
1245    /// fetched from the CESS service. If report_generation_in_progress is non zero
1246    /// then evaluation_percent_complete will be 100%.
1247    pub report_generation_percent_complete: f64,
1248
1249    /// Shows the report uploading progress of the CESS Result Processor Service.
1250    /// The progress is defined in terms of percentage complete and is being
1251    /// fetched from the CESS service. If report_uploading_in_progress is non zero
1252    /// then evaluation_percent_complete and report_generation_percent_complete
1253    /// will be 100%.
1254    pub report_uploading_percent_complete: f64,
1255
1256    /// Output only. The Cloud Storage bucket where the audit report will be
1257    /// uploaded once the evaluation process is completed.
1258    pub destination_gcs_bucket: std::string::String,
1259
1260    /// Output only. The name of the audit report.
1261    pub audit_report: std::string::String,
1262
1263    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1264}
1265
1266impl ReportGenerationProgress {
1267    pub fn new() -> Self {
1268        std::default::Default::default()
1269    }
1270
1271    /// Sets the value of [state][crate::model::ReportGenerationProgress::state].
1272    ///
1273    /// # Example
1274    /// ```ignore,no_run
1275    /// # use google_cloud_auditmanager_v1::model::ReportGenerationProgress;
1276    /// use google_cloud_auditmanager_v1::model::OperationState;
1277    /// let x0 = ReportGenerationProgress::new().set_state(OperationState::NotStarted);
1278    /// let x1 = ReportGenerationProgress::new().set_state(OperationState::EvaluationInProgress);
1279    /// let x2 = ReportGenerationProgress::new().set_state(OperationState::EvaluationDone);
1280    /// ```
1281    pub fn set_state<T: std::convert::Into<crate::model::OperationState>>(mut self, v: T) -> Self {
1282        self.state = v.into();
1283        self
1284    }
1285
1286    /// Sets the value of [failure_reason][crate::model::ReportGenerationProgress::failure_reason].
1287    ///
1288    /// # Example
1289    /// ```ignore,no_run
1290    /// # use google_cloud_auditmanager_v1::model::ReportGenerationProgress;
1291    /// let x = ReportGenerationProgress::new().set_failure_reason("example");
1292    /// ```
1293    pub fn set_failure_reason<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1294        self.failure_reason = v.into();
1295        self
1296    }
1297
1298    /// Sets the value of [evaluation_percent_complete][crate::model::ReportGenerationProgress::evaluation_percent_complete].
1299    ///
1300    /// # Example
1301    /// ```ignore,no_run
1302    /// # use google_cloud_auditmanager_v1::model::ReportGenerationProgress;
1303    /// let x = ReportGenerationProgress::new().set_evaluation_percent_complete(42.0);
1304    /// ```
1305    pub fn set_evaluation_percent_complete<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
1306        self.evaluation_percent_complete = v.into();
1307        self
1308    }
1309
1310    /// Sets the value of [report_generation_percent_complete][crate::model::ReportGenerationProgress::report_generation_percent_complete].
1311    ///
1312    /// # Example
1313    /// ```ignore,no_run
1314    /// # use google_cloud_auditmanager_v1::model::ReportGenerationProgress;
1315    /// let x = ReportGenerationProgress::new().set_report_generation_percent_complete(42.0);
1316    /// ```
1317    pub fn set_report_generation_percent_complete<T: std::convert::Into<f64>>(
1318        mut self,
1319        v: T,
1320    ) -> Self {
1321        self.report_generation_percent_complete = v.into();
1322        self
1323    }
1324
1325    /// Sets the value of [report_uploading_percent_complete][crate::model::ReportGenerationProgress::report_uploading_percent_complete].
1326    ///
1327    /// # Example
1328    /// ```ignore,no_run
1329    /// # use google_cloud_auditmanager_v1::model::ReportGenerationProgress;
1330    /// let x = ReportGenerationProgress::new().set_report_uploading_percent_complete(42.0);
1331    /// ```
1332    pub fn set_report_uploading_percent_complete<T: std::convert::Into<f64>>(
1333        mut self,
1334        v: T,
1335    ) -> Self {
1336        self.report_uploading_percent_complete = v.into();
1337        self
1338    }
1339
1340    /// Sets the value of [destination_gcs_bucket][crate::model::ReportGenerationProgress::destination_gcs_bucket].
1341    ///
1342    /// # Example
1343    /// ```ignore,no_run
1344    /// # use google_cloud_auditmanager_v1::model::ReportGenerationProgress;
1345    /// let x = ReportGenerationProgress::new().set_destination_gcs_bucket("example");
1346    /// ```
1347    pub fn set_destination_gcs_bucket<T: std::convert::Into<std::string::String>>(
1348        mut self,
1349        v: T,
1350    ) -> Self {
1351        self.destination_gcs_bucket = v.into();
1352        self
1353    }
1354
1355    /// Sets the value of [audit_report][crate::model::ReportGenerationProgress::audit_report].
1356    ///
1357    /// # Example
1358    /// ```ignore,no_run
1359    /// # use google_cloud_auditmanager_v1::model::ReportGenerationProgress;
1360    /// let x = ReportGenerationProgress::new().set_audit_report("example");
1361    /// ```
1362    pub fn set_audit_report<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1363        self.audit_report = v.into();
1364        self
1365    }
1366}
1367
1368impl wkt::message::Message for ReportGenerationProgress {
1369    fn typename() -> &'static str {
1370        "type.googleapis.com/google.cloud.auditmanager.v1.ReportGenerationProgress"
1371    }
1372}
1373
1374/// The enrollment resource.
1375#[derive(Clone, Default, PartialEq)]
1376#[non_exhaustive]
1377pub struct Enrollment {
1378    /// Identifier. The name of this Enrollment, in the format of scope given in
1379    /// request.
1380    pub name: std::string::String,
1381
1382    /// Output only. The locations where the generated reports can be uploaded.
1383    pub destination_details: std::vec::Vec<crate::model::DestinationDetails>,
1384
1385    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1386}
1387
1388impl Enrollment {
1389    pub fn new() -> Self {
1390        std::default::Default::default()
1391    }
1392
1393    /// Sets the value of [name][crate::model::Enrollment::name].
1394    ///
1395    /// # Example
1396    /// ```ignore,no_run
1397    /// # use google_cloud_auditmanager_v1::model::Enrollment;
1398    /// let x = Enrollment::new().set_name("example");
1399    /// ```
1400    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1401        self.name = v.into();
1402        self
1403    }
1404
1405    /// Sets the value of [destination_details][crate::model::Enrollment::destination_details].
1406    ///
1407    /// # Example
1408    /// ```ignore,no_run
1409    /// # use google_cloud_auditmanager_v1::model::Enrollment;
1410    /// use google_cloud_auditmanager_v1::model::DestinationDetails;
1411    /// let x = Enrollment::new()
1412    ///     .set_destination_details([
1413    ///         DestinationDetails::default()/* use setters */,
1414    ///         DestinationDetails::default()/* use (different) setters */,
1415    ///     ]);
1416    /// ```
1417    pub fn set_destination_details<T, V>(mut self, v: T) -> Self
1418    where
1419        T: std::iter::IntoIterator<Item = V>,
1420        V: std::convert::Into<crate::model::DestinationDetails>,
1421    {
1422        use std::iter::Iterator;
1423        self.destination_details = v.into_iter().map(|i| i.into()).collect();
1424        self
1425    }
1426}
1427
1428impl wkt::message::Message for Enrollment {
1429    fn typename() -> &'static str {
1430        "type.googleapis.com/google.cloud.auditmanager.v1.Enrollment"
1431    }
1432}
1433
1434/// The audit scope report.
1435#[derive(Clone, Default, PartialEq)]
1436#[non_exhaustive]
1437pub struct AuditScopeReport {
1438    /// Identifier. The name of this Audit Report, in the format of scope given in
1439    /// request.
1440    pub name: std::string::String,
1441
1442    /// The options in which the audit scope report is exported.
1443    pub audit_report: std::option::Option<crate::model::audit_scope_report::AuditReport>,
1444
1445    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1446}
1447
1448impl AuditScopeReport {
1449    pub fn new() -> Self {
1450        std::default::Default::default()
1451    }
1452
1453    /// Sets the value of [name][crate::model::AuditScopeReport::name].
1454    ///
1455    /// # Example
1456    /// ```ignore,no_run
1457    /// # use google_cloud_auditmanager_v1::model::AuditScopeReport;
1458    /// let x = AuditScopeReport::new().set_name("example");
1459    /// ```
1460    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1461        self.name = v.into();
1462        self
1463    }
1464
1465    /// Sets the value of [audit_report][crate::model::AuditScopeReport::audit_report].
1466    ///
1467    /// Note that all the setters affecting `audit_report` are mutually
1468    /// exclusive.
1469    ///
1470    /// # Example
1471    /// ```ignore,no_run
1472    /// # use google_cloud_auditmanager_v1::model::AuditScopeReport;
1473    /// use google_cloud_auditmanager_v1::model::audit_scope_report::AuditReport;
1474    /// let x = AuditScopeReport::new().set_audit_report(Some(AuditReport::ScopeReportContents(bytes::Bytes::from_static(b"example"))));
1475    /// ```
1476    pub fn set_audit_report<
1477        T: std::convert::Into<std::option::Option<crate::model::audit_scope_report::AuditReport>>,
1478    >(
1479        mut self,
1480        v: T,
1481    ) -> Self {
1482        self.audit_report = v.into();
1483        self
1484    }
1485
1486    /// The value of [audit_report][crate::model::AuditScopeReport::audit_report]
1487    /// if it holds a `ScopeReportContents`, `None` if the field is not set or
1488    /// holds a different branch.
1489    pub fn scope_report_contents(&self) -> std::option::Option<&::bytes::Bytes> {
1490        #[allow(unreachable_patterns)]
1491        self.audit_report.as_ref().and_then(|v| match v {
1492            crate::model::audit_scope_report::AuditReport::ScopeReportContents(v) => {
1493                std::option::Option::Some(v)
1494            }
1495            _ => std::option::Option::None,
1496        })
1497    }
1498
1499    /// Sets the value of [audit_report][crate::model::AuditScopeReport::audit_report]
1500    /// to hold a `ScopeReportContents`.
1501    ///
1502    /// Note that all the setters affecting `audit_report` are
1503    /// mutually exclusive.
1504    ///
1505    /// # Example
1506    /// ```ignore,no_run
1507    /// # use google_cloud_auditmanager_v1::model::AuditScopeReport;
1508    /// let x = AuditScopeReport::new().set_scope_report_contents(bytes::Bytes::from_static(b"example"));
1509    /// assert!(x.scope_report_contents().is_some());
1510    /// ```
1511    pub fn set_scope_report_contents<T: std::convert::Into<::bytes::Bytes>>(
1512        mut self,
1513        v: T,
1514    ) -> Self {
1515        self.audit_report = std::option::Option::Some(
1516            crate::model::audit_scope_report::AuditReport::ScopeReportContents(v.into()),
1517        );
1518        self
1519    }
1520}
1521
1522impl wkt::message::Message for AuditScopeReport {
1523    fn typename() -> &'static str {
1524        "type.googleapis.com/google.cloud.auditmanager.v1.AuditScopeReport"
1525    }
1526}
1527
1528/// Defines additional types related to [AuditScopeReport].
1529pub mod audit_scope_report {
1530    #[allow(unused_imports)]
1531    use super::*;
1532
1533    /// The options in which the audit scope report is exported.
1534    #[derive(Clone, Debug, PartialEq)]
1535    #[non_exhaustive]
1536    pub enum AuditReport {
1537        /// The audit scope report content in byte format.
1538        ScopeReportContents(::bytes::Bytes),
1539    }
1540}
1541
1542/// The metadata of the long-running operation.
1543#[derive(Clone, Default, PartialEq)]
1544#[non_exhaustive]
1545pub struct OperationMetadata {
1546    /// Output only. The time the operation was created.
1547    pub create_time: std::option::Option<wkt::Timestamp>,
1548
1549    /// Output only. The time the operation finished running.
1550    pub end_time: std::option::Option<wkt::Timestamp>,
1551
1552    /// Output only. Server-defined resource path for the target of the operation.
1553    pub target: std::string::String,
1554
1555    /// Output only. Name of the verb executed by the operation.
1556    pub verb: std::string::String,
1557
1558    /// Output only. Human-readable status of the operation, if any.
1559    pub status_message: std::string::String,
1560
1561    /// Output only. Identifies whether the user has requested cancellation
1562    /// of the operation. Operations that have been cancelled successfully
1563    /// have [Operation.error][] value with a
1564    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
1565    /// `Code.CANCELLED`.
1566    ///
1567    /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
1568    pub requested_cancellation: bool,
1569
1570    /// Output only. API version used to start the operation.
1571    pub api_version: std::string::String,
1572
1573    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1574}
1575
1576impl OperationMetadata {
1577    pub fn new() -> Self {
1578        std::default::Default::default()
1579    }
1580
1581    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
1582    ///
1583    /// # Example
1584    /// ```ignore,no_run
1585    /// # use google_cloud_auditmanager_v1::model::OperationMetadata;
1586    /// use wkt::Timestamp;
1587    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
1588    /// ```
1589    pub fn set_create_time<T>(mut self, v: T) -> Self
1590    where
1591        T: std::convert::Into<wkt::Timestamp>,
1592    {
1593        self.create_time = std::option::Option::Some(v.into());
1594        self
1595    }
1596
1597    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
1598    ///
1599    /// # Example
1600    /// ```ignore,no_run
1601    /// # use google_cloud_auditmanager_v1::model::OperationMetadata;
1602    /// use wkt::Timestamp;
1603    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1604    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
1605    /// ```
1606    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1607    where
1608        T: std::convert::Into<wkt::Timestamp>,
1609    {
1610        self.create_time = v.map(|x| x.into());
1611        self
1612    }
1613
1614    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
1615    ///
1616    /// # Example
1617    /// ```ignore,no_run
1618    /// # use google_cloud_auditmanager_v1::model::OperationMetadata;
1619    /// use wkt::Timestamp;
1620    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
1621    /// ```
1622    pub fn set_end_time<T>(mut self, v: T) -> Self
1623    where
1624        T: std::convert::Into<wkt::Timestamp>,
1625    {
1626        self.end_time = std::option::Option::Some(v.into());
1627        self
1628    }
1629
1630    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
1631    ///
1632    /// # Example
1633    /// ```ignore,no_run
1634    /// # use google_cloud_auditmanager_v1::model::OperationMetadata;
1635    /// use wkt::Timestamp;
1636    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
1637    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
1638    /// ```
1639    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
1640    where
1641        T: std::convert::Into<wkt::Timestamp>,
1642    {
1643        self.end_time = v.map(|x| x.into());
1644        self
1645    }
1646
1647    /// Sets the value of [target][crate::model::OperationMetadata::target].
1648    ///
1649    /// # Example
1650    /// ```ignore,no_run
1651    /// # use google_cloud_auditmanager_v1::model::OperationMetadata;
1652    /// let x = OperationMetadata::new().set_target("example");
1653    /// ```
1654    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1655        self.target = v.into();
1656        self
1657    }
1658
1659    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
1660    ///
1661    /// # Example
1662    /// ```ignore,no_run
1663    /// # use google_cloud_auditmanager_v1::model::OperationMetadata;
1664    /// let x = OperationMetadata::new().set_verb("example");
1665    /// ```
1666    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1667        self.verb = v.into();
1668        self
1669    }
1670
1671    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
1672    ///
1673    /// # Example
1674    /// ```ignore,no_run
1675    /// # use google_cloud_auditmanager_v1::model::OperationMetadata;
1676    /// let x = OperationMetadata::new().set_status_message("example");
1677    /// ```
1678    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1679        self.status_message = v.into();
1680        self
1681    }
1682
1683    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
1684    ///
1685    /// # Example
1686    /// ```ignore,no_run
1687    /// # use google_cloud_auditmanager_v1::model::OperationMetadata;
1688    /// let x = OperationMetadata::new().set_requested_cancellation(true);
1689    /// ```
1690    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1691        self.requested_cancellation = v.into();
1692        self
1693    }
1694
1695    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
1696    ///
1697    /// # Example
1698    /// ```ignore,no_run
1699    /// # use google_cloud_auditmanager_v1::model::OperationMetadata;
1700    /// let x = OperationMetadata::new().set_api_version("example");
1701    /// ```
1702    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1703        self.api_version = v.into();
1704        self
1705    }
1706}
1707
1708impl wkt::message::Message for OperationMetadata {
1709    fn typename() -> &'static str {
1710        "type.googleapis.com/google.cloud.auditmanager.v1.OperationMetadata"
1711    }
1712}
1713
1714/// A resource with its enrollment status.
1715#[derive(Clone, Default, PartialEq)]
1716#[non_exhaustive]
1717pub struct ResourceEnrollmentStatus {
1718    /// Identifier. The name of this resource.
1719    pub name: std::string::String,
1720
1721    /// Output only. Enrollment which contains enrolled destination details for a
1722    /// resource
1723    pub enrollment: std::option::Option<crate::model::Enrollment>,
1724
1725    /// Output only. Is resource enrolled.
1726    #[deprecated]
1727    pub enrolled: bool,
1728
1729    /// Output only. Display name of the project/folder/organization.
1730    pub display_name: std::string::String,
1731
1732    /// Output only. Enrollment state of the resource.
1733    pub enrollment_state: crate::model::resource_enrollment_status::ResourceEnrollmentState,
1734
1735    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1736}
1737
1738impl ResourceEnrollmentStatus {
1739    pub fn new() -> Self {
1740        std::default::Default::default()
1741    }
1742
1743    /// Sets the value of [name][crate::model::ResourceEnrollmentStatus::name].
1744    ///
1745    /// # Example
1746    /// ```ignore,no_run
1747    /// # use google_cloud_auditmanager_v1::model::ResourceEnrollmentStatus;
1748    /// let x = ResourceEnrollmentStatus::new().set_name("example");
1749    /// ```
1750    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1751        self.name = v.into();
1752        self
1753    }
1754
1755    /// Sets the value of [enrollment][crate::model::ResourceEnrollmentStatus::enrollment].
1756    ///
1757    /// # Example
1758    /// ```ignore,no_run
1759    /// # use google_cloud_auditmanager_v1::model::ResourceEnrollmentStatus;
1760    /// use google_cloud_auditmanager_v1::model::Enrollment;
1761    /// let x = ResourceEnrollmentStatus::new().set_enrollment(Enrollment::default()/* use setters */);
1762    /// ```
1763    pub fn set_enrollment<T>(mut self, v: T) -> Self
1764    where
1765        T: std::convert::Into<crate::model::Enrollment>,
1766    {
1767        self.enrollment = std::option::Option::Some(v.into());
1768        self
1769    }
1770
1771    /// Sets or clears the value of [enrollment][crate::model::ResourceEnrollmentStatus::enrollment].
1772    ///
1773    /// # Example
1774    /// ```ignore,no_run
1775    /// # use google_cloud_auditmanager_v1::model::ResourceEnrollmentStatus;
1776    /// use google_cloud_auditmanager_v1::model::Enrollment;
1777    /// let x = ResourceEnrollmentStatus::new().set_or_clear_enrollment(Some(Enrollment::default()/* use setters */));
1778    /// let x = ResourceEnrollmentStatus::new().set_or_clear_enrollment(None::<Enrollment>);
1779    /// ```
1780    pub fn set_or_clear_enrollment<T>(mut self, v: std::option::Option<T>) -> Self
1781    where
1782        T: std::convert::Into<crate::model::Enrollment>,
1783    {
1784        self.enrollment = v.map(|x| x.into());
1785        self
1786    }
1787
1788    /// Sets the value of [enrolled][crate::model::ResourceEnrollmentStatus::enrolled].
1789    ///
1790    /// # Example
1791    /// ```ignore,no_run
1792    /// # use google_cloud_auditmanager_v1::model::ResourceEnrollmentStatus;
1793    /// let x = ResourceEnrollmentStatus::new().set_enrolled(true);
1794    /// ```
1795    #[deprecated]
1796    pub fn set_enrolled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1797        self.enrolled = v.into();
1798        self
1799    }
1800
1801    /// Sets the value of [display_name][crate::model::ResourceEnrollmentStatus::display_name].
1802    ///
1803    /// # Example
1804    /// ```ignore,no_run
1805    /// # use google_cloud_auditmanager_v1::model::ResourceEnrollmentStatus;
1806    /// let x = ResourceEnrollmentStatus::new().set_display_name("example");
1807    /// ```
1808    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1809        self.display_name = v.into();
1810        self
1811    }
1812
1813    /// Sets the value of [enrollment_state][crate::model::ResourceEnrollmentStatus::enrollment_state].
1814    ///
1815    /// # Example
1816    /// ```ignore,no_run
1817    /// # use google_cloud_auditmanager_v1::model::ResourceEnrollmentStatus;
1818    /// use google_cloud_auditmanager_v1::model::resource_enrollment_status::ResourceEnrollmentState;
1819    /// let x0 = ResourceEnrollmentStatus::new().set_enrollment_state(ResourceEnrollmentState::NotEnrolled);
1820    /// let x1 = ResourceEnrollmentStatus::new().set_enrollment_state(ResourceEnrollmentState::Inherited);
1821    /// let x2 = ResourceEnrollmentStatus::new().set_enrollment_state(ResourceEnrollmentState::Enrolled);
1822    /// ```
1823    pub fn set_enrollment_state<
1824        T: std::convert::Into<crate::model::resource_enrollment_status::ResourceEnrollmentState>,
1825    >(
1826        mut self,
1827        v: T,
1828    ) -> Self {
1829        self.enrollment_state = v.into();
1830        self
1831    }
1832}
1833
1834impl wkt::message::Message for ResourceEnrollmentStatus {
1835    fn typename() -> &'static str {
1836        "type.googleapis.com/google.cloud.auditmanager.v1.ResourceEnrollmentStatus"
1837    }
1838}
1839
1840/// Defines additional types related to [ResourceEnrollmentStatus].
1841pub mod resource_enrollment_status {
1842    #[allow(unused_imports)]
1843    use super::*;
1844
1845    /// The different enrollment states of a resource.
1846    ///
1847    /// # Working with unknown values
1848    ///
1849    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1850    /// additional enum variants at any time. Adding new variants is not considered
1851    /// a breaking change. Applications should write their code in anticipation of:
1852    ///
1853    /// - New values appearing in future releases of the client library, **and**
1854    /// - New values received dynamically, without application changes.
1855    ///
1856    /// Please consult the [Working with enums] section in the user guide for some
1857    /// guidelines.
1858    ///
1859    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1860    #[derive(Clone, Debug, PartialEq)]
1861    #[non_exhaustive]
1862    pub enum ResourceEnrollmentState {
1863        /// Unspecified. Invalid state.
1864        Unspecified,
1865        /// Not enrolled.
1866        NotEnrolled,
1867        /// Resource is not enrolled but the parent is enrolled.
1868        Inherited,
1869        /// Enrolled.
1870        Enrolled,
1871        /// If set, the enum was initialized with an unknown value.
1872        ///
1873        /// Applications can examine the value using [ResourceEnrollmentState::value] or
1874        /// [ResourceEnrollmentState::name].
1875        UnknownValue(resource_enrollment_state::UnknownValue),
1876    }
1877
1878    #[doc(hidden)]
1879    pub mod resource_enrollment_state {
1880        #[allow(unused_imports)]
1881        use super::*;
1882        #[derive(Clone, Debug, PartialEq)]
1883        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1884    }
1885
1886    impl ResourceEnrollmentState {
1887        /// Gets the enum value.
1888        ///
1889        /// Returns `None` if the enum contains an unknown value deserialized from
1890        /// the string representation of enums.
1891        pub fn value(&self) -> std::option::Option<i32> {
1892            match self {
1893                Self::Unspecified => std::option::Option::Some(0),
1894                Self::NotEnrolled => std::option::Option::Some(1),
1895                Self::Inherited => std::option::Option::Some(2),
1896                Self::Enrolled => std::option::Option::Some(3),
1897                Self::UnknownValue(u) => u.0.value(),
1898            }
1899        }
1900
1901        /// Gets the enum value as a string.
1902        ///
1903        /// Returns `None` if the enum contains an unknown value deserialized from
1904        /// the integer representation of enums.
1905        pub fn name(&self) -> std::option::Option<&str> {
1906            match self {
1907                Self::Unspecified => {
1908                    std::option::Option::Some("RESOURCE_ENROLLMENT_STATE_UNSPECIFIED")
1909                }
1910                Self::NotEnrolled => std::option::Option::Some("NOT_ENROLLED"),
1911                Self::Inherited => std::option::Option::Some("INHERITED"),
1912                Self::Enrolled => std::option::Option::Some("ENROLLED"),
1913                Self::UnknownValue(u) => u.0.name(),
1914            }
1915        }
1916    }
1917
1918    impl std::default::Default for ResourceEnrollmentState {
1919        fn default() -> Self {
1920            use std::convert::From;
1921            Self::from(0)
1922        }
1923    }
1924
1925    impl std::fmt::Display for ResourceEnrollmentState {
1926        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1927            wkt::internal::display_enum(f, self.name(), self.value())
1928        }
1929    }
1930
1931    impl std::convert::From<i32> for ResourceEnrollmentState {
1932        fn from(value: i32) -> Self {
1933            match value {
1934                0 => Self::Unspecified,
1935                1 => Self::NotEnrolled,
1936                2 => Self::Inherited,
1937                3 => Self::Enrolled,
1938                _ => Self::UnknownValue(resource_enrollment_state::UnknownValue(
1939                    wkt::internal::UnknownEnumValue::Integer(value),
1940                )),
1941            }
1942        }
1943    }
1944
1945    impl std::convert::From<&str> for ResourceEnrollmentState {
1946        fn from(value: &str) -> Self {
1947            use std::string::ToString;
1948            match value {
1949                "RESOURCE_ENROLLMENT_STATE_UNSPECIFIED" => Self::Unspecified,
1950                "NOT_ENROLLED" => Self::NotEnrolled,
1951                "INHERITED" => Self::Inherited,
1952                "ENROLLED" => Self::Enrolled,
1953                _ => Self::UnknownValue(resource_enrollment_state::UnknownValue(
1954                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1955                )),
1956            }
1957        }
1958    }
1959
1960    impl serde::ser::Serialize for ResourceEnrollmentState {
1961        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1962        where
1963            S: serde::Serializer,
1964        {
1965            match self {
1966                Self::Unspecified => serializer.serialize_i32(0),
1967                Self::NotEnrolled => serializer.serialize_i32(1),
1968                Self::Inherited => serializer.serialize_i32(2),
1969                Self::Enrolled => serializer.serialize_i32(3),
1970                Self::UnknownValue(u) => u.0.serialize(serializer),
1971            }
1972        }
1973    }
1974
1975    impl<'de> serde::de::Deserialize<'de> for ResourceEnrollmentState {
1976        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1977        where
1978            D: serde::Deserializer<'de>,
1979        {
1980            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResourceEnrollmentState>::new(
1981                ".google.cloud.auditmanager.v1.ResourceEnrollmentStatus.ResourceEnrollmentState"))
1982        }
1983    }
1984}
1985
1986/// An audit report.
1987#[derive(Clone, Default, PartialEq)]
1988#[non_exhaustive]
1989pub struct AuditReport {
1990    /// Identifier. The name of this Audit Report, in the format of scope given in
1991    /// request.
1992    pub name: std::string::String,
1993
1994    /// Output only. Report summary with compliance, violation counts etc.
1995    pub report_summary: std::option::Option<crate::model::ReportSummary>,
1996
1997    /// Output only. ClientOperationId
1998    pub operation_id: std::string::String,
1999
2000    /// Output only. The location where the generated report will be uploaded.
2001    pub destination_details: std::option::Option<crate::model::DestinationDetails>,
2002
2003    /// Output only. Compliance Standard.
2004    pub compliance_standard: std::string::String,
2005
2006    /// Output only. The parent scope on which the report was generated.
2007    pub scope: std::string::String,
2008
2009    /// Output only. Creation time of the audit report.
2010    pub create_time: std::option::Option<wkt::Timestamp>,
2011
2012    /// Output only. The overall status of controls
2013    pub control_details: std::vec::Vec<crate::model::ControlDetails>,
2014
2015    /// Output only. The state of Audit Report Generation.
2016    pub report_generation_state: crate::model::audit_report::ReportGenerationState,
2017
2018    /// Output only. Compliance Framework of Audit Report
2019    pub compliance_framework: std::string::String,
2020
2021    /// Output only. The ID/ Number for the scope on which the audit report was
2022    /// generated.
2023    pub scope_id: std::string::String,
2024
2025    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2026}
2027
2028impl AuditReport {
2029    pub fn new() -> Self {
2030        std::default::Default::default()
2031    }
2032
2033    /// Sets the value of [name][crate::model::AuditReport::name].
2034    ///
2035    /// # Example
2036    /// ```ignore,no_run
2037    /// # use google_cloud_auditmanager_v1::model::AuditReport;
2038    /// let x = AuditReport::new().set_name("example");
2039    /// ```
2040    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2041        self.name = v.into();
2042        self
2043    }
2044
2045    /// Sets the value of [report_summary][crate::model::AuditReport::report_summary].
2046    ///
2047    /// # Example
2048    /// ```ignore,no_run
2049    /// # use google_cloud_auditmanager_v1::model::AuditReport;
2050    /// use google_cloud_auditmanager_v1::model::ReportSummary;
2051    /// let x = AuditReport::new().set_report_summary(ReportSummary::default()/* use setters */);
2052    /// ```
2053    pub fn set_report_summary<T>(mut self, v: T) -> Self
2054    where
2055        T: std::convert::Into<crate::model::ReportSummary>,
2056    {
2057        self.report_summary = std::option::Option::Some(v.into());
2058        self
2059    }
2060
2061    /// Sets or clears the value of [report_summary][crate::model::AuditReport::report_summary].
2062    ///
2063    /// # Example
2064    /// ```ignore,no_run
2065    /// # use google_cloud_auditmanager_v1::model::AuditReport;
2066    /// use google_cloud_auditmanager_v1::model::ReportSummary;
2067    /// let x = AuditReport::new().set_or_clear_report_summary(Some(ReportSummary::default()/* use setters */));
2068    /// let x = AuditReport::new().set_or_clear_report_summary(None::<ReportSummary>);
2069    /// ```
2070    pub fn set_or_clear_report_summary<T>(mut self, v: std::option::Option<T>) -> Self
2071    where
2072        T: std::convert::Into<crate::model::ReportSummary>,
2073    {
2074        self.report_summary = v.map(|x| x.into());
2075        self
2076    }
2077
2078    /// Sets the value of [operation_id][crate::model::AuditReport::operation_id].
2079    ///
2080    /// # Example
2081    /// ```ignore,no_run
2082    /// # use google_cloud_auditmanager_v1::model::AuditReport;
2083    /// let x = AuditReport::new().set_operation_id("example");
2084    /// ```
2085    pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2086        self.operation_id = v.into();
2087        self
2088    }
2089
2090    /// Sets the value of [destination_details][crate::model::AuditReport::destination_details].
2091    ///
2092    /// # Example
2093    /// ```ignore,no_run
2094    /// # use google_cloud_auditmanager_v1::model::AuditReport;
2095    /// use google_cloud_auditmanager_v1::model::DestinationDetails;
2096    /// let x = AuditReport::new().set_destination_details(DestinationDetails::default()/* use setters */);
2097    /// ```
2098    pub fn set_destination_details<T>(mut self, v: T) -> Self
2099    where
2100        T: std::convert::Into<crate::model::DestinationDetails>,
2101    {
2102        self.destination_details = std::option::Option::Some(v.into());
2103        self
2104    }
2105
2106    /// Sets or clears the value of [destination_details][crate::model::AuditReport::destination_details].
2107    ///
2108    /// # Example
2109    /// ```ignore,no_run
2110    /// # use google_cloud_auditmanager_v1::model::AuditReport;
2111    /// use google_cloud_auditmanager_v1::model::DestinationDetails;
2112    /// let x = AuditReport::new().set_or_clear_destination_details(Some(DestinationDetails::default()/* use setters */));
2113    /// let x = AuditReport::new().set_or_clear_destination_details(None::<DestinationDetails>);
2114    /// ```
2115    pub fn set_or_clear_destination_details<T>(mut self, v: std::option::Option<T>) -> Self
2116    where
2117        T: std::convert::Into<crate::model::DestinationDetails>,
2118    {
2119        self.destination_details = v.map(|x| x.into());
2120        self
2121    }
2122
2123    /// Sets the value of [compliance_standard][crate::model::AuditReport::compliance_standard].
2124    ///
2125    /// # Example
2126    /// ```ignore,no_run
2127    /// # use google_cloud_auditmanager_v1::model::AuditReport;
2128    /// let x = AuditReport::new().set_compliance_standard("example");
2129    /// ```
2130    pub fn set_compliance_standard<T: std::convert::Into<std::string::String>>(
2131        mut self,
2132        v: T,
2133    ) -> Self {
2134        self.compliance_standard = v.into();
2135        self
2136    }
2137
2138    /// Sets the value of [scope][crate::model::AuditReport::scope].
2139    ///
2140    /// # Example
2141    /// ```ignore,no_run
2142    /// # use google_cloud_auditmanager_v1::model::AuditReport;
2143    /// let x = AuditReport::new().set_scope("example");
2144    /// ```
2145    pub fn set_scope<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2146        self.scope = v.into();
2147        self
2148    }
2149
2150    /// Sets the value of [create_time][crate::model::AuditReport::create_time].
2151    ///
2152    /// # Example
2153    /// ```ignore,no_run
2154    /// # use google_cloud_auditmanager_v1::model::AuditReport;
2155    /// use wkt::Timestamp;
2156    /// let x = AuditReport::new().set_create_time(Timestamp::default()/* use setters */);
2157    /// ```
2158    pub fn set_create_time<T>(mut self, v: T) -> Self
2159    where
2160        T: std::convert::Into<wkt::Timestamp>,
2161    {
2162        self.create_time = std::option::Option::Some(v.into());
2163        self
2164    }
2165
2166    /// Sets or clears the value of [create_time][crate::model::AuditReport::create_time].
2167    ///
2168    /// # Example
2169    /// ```ignore,no_run
2170    /// # use google_cloud_auditmanager_v1::model::AuditReport;
2171    /// use wkt::Timestamp;
2172    /// let x = AuditReport::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2173    /// let x = AuditReport::new().set_or_clear_create_time(None::<Timestamp>);
2174    /// ```
2175    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2176    where
2177        T: std::convert::Into<wkt::Timestamp>,
2178    {
2179        self.create_time = v.map(|x| x.into());
2180        self
2181    }
2182
2183    /// Sets the value of [control_details][crate::model::AuditReport::control_details].
2184    ///
2185    /// # Example
2186    /// ```ignore,no_run
2187    /// # use google_cloud_auditmanager_v1::model::AuditReport;
2188    /// use google_cloud_auditmanager_v1::model::ControlDetails;
2189    /// let x = AuditReport::new()
2190    ///     .set_control_details([
2191    ///         ControlDetails::default()/* use setters */,
2192    ///         ControlDetails::default()/* use (different) setters */,
2193    ///     ]);
2194    /// ```
2195    pub fn set_control_details<T, V>(mut self, v: T) -> Self
2196    where
2197        T: std::iter::IntoIterator<Item = V>,
2198        V: std::convert::Into<crate::model::ControlDetails>,
2199    {
2200        use std::iter::Iterator;
2201        self.control_details = v.into_iter().map(|i| i.into()).collect();
2202        self
2203    }
2204
2205    /// Sets the value of [report_generation_state][crate::model::AuditReport::report_generation_state].
2206    ///
2207    /// # Example
2208    /// ```ignore,no_run
2209    /// # use google_cloud_auditmanager_v1::model::AuditReport;
2210    /// use google_cloud_auditmanager_v1::model::audit_report::ReportGenerationState;
2211    /// let x0 = AuditReport::new().set_report_generation_state(ReportGenerationState::InProgress);
2212    /// let x1 = AuditReport::new().set_report_generation_state(ReportGenerationState::Completed);
2213    /// let x2 = AuditReport::new().set_report_generation_state(ReportGenerationState::Failed);
2214    /// ```
2215    pub fn set_report_generation_state<
2216        T: std::convert::Into<crate::model::audit_report::ReportGenerationState>,
2217    >(
2218        mut self,
2219        v: T,
2220    ) -> Self {
2221        self.report_generation_state = v.into();
2222        self
2223    }
2224
2225    /// Sets the value of [compliance_framework][crate::model::AuditReport::compliance_framework].
2226    ///
2227    /// # Example
2228    /// ```ignore,no_run
2229    /// # use google_cloud_auditmanager_v1::model::AuditReport;
2230    /// let x = AuditReport::new().set_compliance_framework("example");
2231    /// ```
2232    pub fn set_compliance_framework<T: std::convert::Into<std::string::String>>(
2233        mut self,
2234        v: T,
2235    ) -> Self {
2236        self.compliance_framework = v.into();
2237        self
2238    }
2239
2240    /// Sets the value of [scope_id][crate::model::AuditReport::scope_id].
2241    ///
2242    /// # Example
2243    /// ```ignore,no_run
2244    /// # use google_cloud_auditmanager_v1::model::AuditReport;
2245    /// let x = AuditReport::new().set_scope_id("example");
2246    /// ```
2247    pub fn set_scope_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2248        self.scope_id = v.into();
2249        self
2250    }
2251}
2252
2253impl wkt::message::Message for AuditReport {
2254    fn typename() -> &'static str {
2255        "type.googleapis.com/google.cloud.auditmanager.v1.AuditReport"
2256    }
2257}
2258
2259/// Defines additional types related to [AuditReport].
2260pub mod audit_report {
2261    #[allow(unused_imports)]
2262    use super::*;
2263
2264    /// The different states of the Audit Manager report generation.
2265    ///
2266    /// # Working with unknown values
2267    ///
2268    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2269    /// additional enum variants at any time. Adding new variants is not considered
2270    /// a breaking change. Applications should write their code in anticipation of:
2271    ///
2272    /// - New values appearing in future releases of the client library, **and**
2273    /// - New values received dynamically, without application changes.
2274    ///
2275    /// Please consult the [Working with enums] section in the user guide for some
2276    /// guidelines.
2277    ///
2278    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2279    #[derive(Clone, Debug, PartialEq)]
2280    #[non_exhaustive]
2281    pub enum ReportGenerationState {
2282        /// Unspecified. Invalid state.
2283        Unspecified,
2284        /// Audit report generation process is in progress, ie. operation state is
2285        /// neither OPERATION_STATE_DONE nor OPERATION_STATE_FAILED.
2286        InProgress,
2287        /// Audit report generation process is completed. Operation state is
2288        /// OPERATION_STATE_DONE.
2289        Completed,
2290        /// Audit report generation process has failed. Operation state is
2291        /// OPERATION_STATE_FAILED.
2292        Failed,
2293        /// Audit report generation process has completed. But report summary is
2294        /// unknown. This is valid for older reports.
2295        SummaryUnknown,
2296        /// If set, the enum was initialized with an unknown value.
2297        ///
2298        /// Applications can examine the value using [ReportGenerationState::value] or
2299        /// [ReportGenerationState::name].
2300        UnknownValue(report_generation_state::UnknownValue),
2301    }
2302
2303    #[doc(hidden)]
2304    pub mod report_generation_state {
2305        #[allow(unused_imports)]
2306        use super::*;
2307        #[derive(Clone, Debug, PartialEq)]
2308        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2309    }
2310
2311    impl ReportGenerationState {
2312        /// Gets the enum value.
2313        ///
2314        /// Returns `None` if the enum contains an unknown value deserialized from
2315        /// the string representation of enums.
2316        pub fn value(&self) -> std::option::Option<i32> {
2317            match self {
2318                Self::Unspecified => std::option::Option::Some(0),
2319                Self::InProgress => std::option::Option::Some(1),
2320                Self::Completed => std::option::Option::Some(2),
2321                Self::Failed => std::option::Option::Some(3),
2322                Self::SummaryUnknown => std::option::Option::Some(4),
2323                Self::UnknownValue(u) => u.0.value(),
2324            }
2325        }
2326
2327        /// Gets the enum value as a string.
2328        ///
2329        /// Returns `None` if the enum contains an unknown value deserialized from
2330        /// the integer representation of enums.
2331        pub fn name(&self) -> std::option::Option<&str> {
2332            match self {
2333                Self::Unspecified => {
2334                    std::option::Option::Some("REPORT_GENERATION_STATE_UNSPECIFIED")
2335                }
2336                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
2337                Self::Completed => std::option::Option::Some("COMPLETED"),
2338                Self::Failed => std::option::Option::Some("FAILED"),
2339                Self::SummaryUnknown => std::option::Option::Some("SUMMARY_UNKNOWN"),
2340                Self::UnknownValue(u) => u.0.name(),
2341            }
2342        }
2343    }
2344
2345    impl std::default::Default for ReportGenerationState {
2346        fn default() -> Self {
2347            use std::convert::From;
2348            Self::from(0)
2349        }
2350    }
2351
2352    impl std::fmt::Display for ReportGenerationState {
2353        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2354            wkt::internal::display_enum(f, self.name(), self.value())
2355        }
2356    }
2357
2358    impl std::convert::From<i32> for ReportGenerationState {
2359        fn from(value: i32) -> Self {
2360            match value {
2361                0 => Self::Unspecified,
2362                1 => Self::InProgress,
2363                2 => Self::Completed,
2364                3 => Self::Failed,
2365                4 => Self::SummaryUnknown,
2366                _ => Self::UnknownValue(report_generation_state::UnknownValue(
2367                    wkt::internal::UnknownEnumValue::Integer(value),
2368                )),
2369            }
2370        }
2371    }
2372
2373    impl std::convert::From<&str> for ReportGenerationState {
2374        fn from(value: &str) -> Self {
2375            use std::string::ToString;
2376            match value {
2377                "REPORT_GENERATION_STATE_UNSPECIFIED" => Self::Unspecified,
2378                "IN_PROGRESS" => Self::InProgress,
2379                "COMPLETED" => Self::Completed,
2380                "FAILED" => Self::Failed,
2381                "SUMMARY_UNKNOWN" => Self::SummaryUnknown,
2382                _ => Self::UnknownValue(report_generation_state::UnknownValue(
2383                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2384                )),
2385            }
2386        }
2387    }
2388
2389    impl serde::ser::Serialize for ReportGenerationState {
2390        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2391        where
2392            S: serde::Serializer,
2393        {
2394            match self {
2395                Self::Unspecified => serializer.serialize_i32(0),
2396                Self::InProgress => serializer.serialize_i32(1),
2397                Self::Completed => serializer.serialize_i32(2),
2398                Self::Failed => serializer.serialize_i32(3),
2399                Self::SummaryUnknown => serializer.serialize_i32(4),
2400                Self::UnknownValue(u) => u.0.serialize(serializer),
2401            }
2402        }
2403    }
2404
2405    impl<'de> serde::de::Deserialize<'de> for ReportGenerationState {
2406        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2407        where
2408            D: serde::Deserializer<'de>,
2409        {
2410            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReportGenerationState>::new(
2411                ".google.cloud.auditmanager.v1.AuditReport.ReportGenerationState",
2412            ))
2413        }
2414    }
2415}
2416
2417/// The regulatory family of the control.
2418#[derive(Clone, Default, PartialEq)]
2419#[non_exhaustive]
2420pub struct ControlFamily {
2421    /// The ID of the regulatory control family.
2422    pub family_id: std::string::String,
2423
2424    /// The display name of the regulatory control family.
2425    pub display_name: std::string::String,
2426
2427    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2428}
2429
2430impl ControlFamily {
2431    pub fn new() -> Self {
2432        std::default::Default::default()
2433    }
2434
2435    /// Sets the value of [family_id][crate::model::ControlFamily::family_id].
2436    ///
2437    /// # Example
2438    /// ```ignore,no_run
2439    /// # use google_cloud_auditmanager_v1::model::ControlFamily;
2440    /// let x = ControlFamily::new().set_family_id("example");
2441    /// ```
2442    pub fn set_family_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2443        self.family_id = v.into();
2444        self
2445    }
2446
2447    /// Sets the value of [display_name][crate::model::ControlFamily::display_name].
2448    ///
2449    /// # Example
2450    /// ```ignore,no_run
2451    /// # use google_cloud_auditmanager_v1::model::ControlFamily;
2452    /// let x = ControlFamily::new().set_display_name("example");
2453    /// ```
2454    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2455        self.display_name = v.into();
2456        self
2457    }
2458}
2459
2460impl wkt::message::Message for ControlFamily {
2461    fn typename() -> &'static str {
2462        "type.googleapis.com/google.cloud.auditmanager.v1.ControlFamily"
2463    }
2464}
2465
2466/// A control.
2467#[derive(Clone, Default, PartialEq)]
2468#[non_exhaustive]
2469pub struct Control {
2470    /// Output only. The control identifier used to fetch the findings. This is
2471    /// same as the control report name.
2472    pub id: std::string::String,
2473
2474    /// Output only. Display name of the control.
2475    pub display_name: std::string::String,
2476
2477    /// Output only. Group where the control belongs. E.g. Access Control.
2478    pub family: crate::model::control::Family,
2479
2480    /// Output only. Regulatory Family of the control E.g. Access Control
2481    pub control_family: std::option::Option<crate::model::ControlFamily>,
2482
2483    /// Output only. Regulatory control ask of the control
2484    pub description: std::string::String,
2485
2486    /// Output only. The type of responsibility for implementing this control. It
2487    /// can be google, customer or shared.
2488    pub responsibility_type: std::string::String,
2489
2490    /// Output only. Description of the google responsibility for implementing this
2491    /// control.
2492    pub google_responsibility_description: std::string::String,
2493
2494    /// Output only. Implementation of the google responsibility for implementing
2495    /// this control.
2496    pub google_responsibility_implementation: std::string::String,
2497
2498    /// Output only. Description of the customer responsibility for implementing
2499    /// this control.
2500    pub customer_responsibility_description: std::string::String,
2501
2502    /// Output only. Implementation of the customer responsibility for implementing
2503    /// this control.
2504    pub customer_responsibility_implementation: std::string::String,
2505
2506    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2507}
2508
2509impl Control {
2510    pub fn new() -> Self {
2511        std::default::Default::default()
2512    }
2513
2514    /// Sets the value of [id][crate::model::Control::id].
2515    ///
2516    /// # Example
2517    /// ```ignore,no_run
2518    /// # use google_cloud_auditmanager_v1::model::Control;
2519    /// let x = Control::new().set_id("example");
2520    /// ```
2521    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2522        self.id = v.into();
2523        self
2524    }
2525
2526    /// Sets the value of [display_name][crate::model::Control::display_name].
2527    ///
2528    /// # Example
2529    /// ```ignore,no_run
2530    /// # use google_cloud_auditmanager_v1::model::Control;
2531    /// let x = Control::new().set_display_name("example");
2532    /// ```
2533    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2534        self.display_name = v.into();
2535        self
2536    }
2537
2538    /// Sets the value of [family][crate::model::Control::family].
2539    ///
2540    /// # Example
2541    /// ```ignore,no_run
2542    /// # use google_cloud_auditmanager_v1::model::Control;
2543    /// use google_cloud_auditmanager_v1::model::control::Family;
2544    /// let x0 = Control::new().set_family(Family::Ac);
2545    /// let x1 = Control::new().set_family(Family::At);
2546    /// let x2 = Control::new().set_family(Family::Au);
2547    /// ```
2548    pub fn set_family<T: std::convert::Into<crate::model::control::Family>>(
2549        mut self,
2550        v: T,
2551    ) -> Self {
2552        self.family = v.into();
2553        self
2554    }
2555
2556    /// Sets the value of [control_family][crate::model::Control::control_family].
2557    ///
2558    /// # Example
2559    /// ```ignore,no_run
2560    /// # use google_cloud_auditmanager_v1::model::Control;
2561    /// use google_cloud_auditmanager_v1::model::ControlFamily;
2562    /// let x = Control::new().set_control_family(ControlFamily::default()/* use setters */);
2563    /// ```
2564    pub fn set_control_family<T>(mut self, v: T) -> Self
2565    where
2566        T: std::convert::Into<crate::model::ControlFamily>,
2567    {
2568        self.control_family = std::option::Option::Some(v.into());
2569        self
2570    }
2571
2572    /// Sets or clears the value of [control_family][crate::model::Control::control_family].
2573    ///
2574    /// # Example
2575    /// ```ignore,no_run
2576    /// # use google_cloud_auditmanager_v1::model::Control;
2577    /// use google_cloud_auditmanager_v1::model::ControlFamily;
2578    /// let x = Control::new().set_or_clear_control_family(Some(ControlFamily::default()/* use setters */));
2579    /// let x = Control::new().set_or_clear_control_family(None::<ControlFamily>);
2580    /// ```
2581    pub fn set_or_clear_control_family<T>(mut self, v: std::option::Option<T>) -> Self
2582    where
2583        T: std::convert::Into<crate::model::ControlFamily>,
2584    {
2585        self.control_family = v.map(|x| x.into());
2586        self
2587    }
2588
2589    /// Sets the value of [description][crate::model::Control::description].
2590    ///
2591    /// # Example
2592    /// ```ignore,no_run
2593    /// # use google_cloud_auditmanager_v1::model::Control;
2594    /// let x = Control::new().set_description("example");
2595    /// ```
2596    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2597        self.description = v.into();
2598        self
2599    }
2600
2601    /// Sets the value of [responsibility_type][crate::model::Control::responsibility_type].
2602    ///
2603    /// # Example
2604    /// ```ignore,no_run
2605    /// # use google_cloud_auditmanager_v1::model::Control;
2606    /// let x = Control::new().set_responsibility_type("example");
2607    /// ```
2608    pub fn set_responsibility_type<T: std::convert::Into<std::string::String>>(
2609        mut self,
2610        v: T,
2611    ) -> Self {
2612        self.responsibility_type = v.into();
2613        self
2614    }
2615
2616    /// Sets the value of [google_responsibility_description][crate::model::Control::google_responsibility_description].
2617    ///
2618    /// # Example
2619    /// ```ignore,no_run
2620    /// # use google_cloud_auditmanager_v1::model::Control;
2621    /// let x = Control::new().set_google_responsibility_description("example");
2622    /// ```
2623    pub fn set_google_responsibility_description<T: std::convert::Into<std::string::String>>(
2624        mut self,
2625        v: T,
2626    ) -> Self {
2627        self.google_responsibility_description = v.into();
2628        self
2629    }
2630
2631    /// Sets the value of [google_responsibility_implementation][crate::model::Control::google_responsibility_implementation].
2632    ///
2633    /// # Example
2634    /// ```ignore,no_run
2635    /// # use google_cloud_auditmanager_v1::model::Control;
2636    /// let x = Control::new().set_google_responsibility_implementation("example");
2637    /// ```
2638    pub fn set_google_responsibility_implementation<T: std::convert::Into<std::string::String>>(
2639        mut self,
2640        v: T,
2641    ) -> Self {
2642        self.google_responsibility_implementation = v.into();
2643        self
2644    }
2645
2646    /// Sets the value of [customer_responsibility_description][crate::model::Control::customer_responsibility_description].
2647    ///
2648    /// # Example
2649    /// ```ignore,no_run
2650    /// # use google_cloud_auditmanager_v1::model::Control;
2651    /// let x = Control::new().set_customer_responsibility_description("example");
2652    /// ```
2653    pub fn set_customer_responsibility_description<T: std::convert::Into<std::string::String>>(
2654        mut self,
2655        v: T,
2656    ) -> Self {
2657        self.customer_responsibility_description = v.into();
2658        self
2659    }
2660
2661    /// Sets the value of [customer_responsibility_implementation][crate::model::Control::customer_responsibility_implementation].
2662    ///
2663    /// # Example
2664    /// ```ignore,no_run
2665    /// # use google_cloud_auditmanager_v1::model::Control;
2666    /// let x = Control::new().set_customer_responsibility_implementation("example");
2667    /// ```
2668    pub fn set_customer_responsibility_implementation<
2669        T: std::convert::Into<std::string::String>,
2670    >(
2671        mut self,
2672        v: T,
2673    ) -> Self {
2674        self.customer_responsibility_implementation = v.into();
2675        self
2676    }
2677}
2678
2679impl wkt::message::Message for Control {
2680    fn typename() -> &'static str {
2681        "type.googleapis.com/google.cloud.auditmanager.v1.Control"
2682    }
2683}
2684
2685/// Defines additional types related to [Control].
2686pub mod control {
2687    #[allow(unused_imports)]
2688    use super::*;
2689
2690    /// The family of the control. For example, Access Control.
2691    ///
2692    /// # Working with unknown values
2693    ///
2694    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2695    /// additional enum variants at any time. Adding new variants is not considered
2696    /// a breaking change. Applications should write their code in anticipation of:
2697    ///
2698    /// - New values appearing in future releases of the client library, **and**
2699    /// - New values received dynamically, without application changes.
2700    ///
2701    /// Please consult the [Working with enums] section in the user guide for some
2702    /// guidelines.
2703    ///
2704    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2705    #[derive(Clone, Debug, PartialEq)]
2706    #[non_exhaustive]
2707    pub enum Family {
2708        /// Unspecified. Invalid state.
2709        Unspecified,
2710        /// Access Control
2711        Ac,
2712        /// Awareness and Training
2713        At,
2714        /// Audit and Accountability
2715        Au,
2716        /// Certification, Accreditation and Security Assessments
2717        Ca,
2718        /// Configuration Management
2719        Cm,
2720        /// Contingency Planning
2721        Cp,
2722        /// Identification and Authentication
2723        Ia,
2724        /// Incident Response
2725        Ir,
2726        /// Maintenance
2727        Ma,
2728        /// Media Protection
2729        Mp,
2730        /// Physical and Environmental Protection
2731        Pe,
2732        /// Security Planning
2733        Pl,
2734        /// Personnel Security
2735        Ps,
2736        /// Risk Assessment
2737        Ra,
2738        /// System Services and Acquisition
2739        Sa,
2740        /// System and Communications Protection
2741        Sc,
2742        /// System and Information Integrity
2743        Si,
2744        /// Supply Chain Risk Management
2745        Sr,
2746        /// If set, the enum was initialized with an unknown value.
2747        ///
2748        /// Applications can examine the value using [Family::value] or
2749        /// [Family::name].
2750        UnknownValue(family::UnknownValue),
2751    }
2752
2753    #[doc(hidden)]
2754    pub mod family {
2755        #[allow(unused_imports)]
2756        use super::*;
2757        #[derive(Clone, Debug, PartialEq)]
2758        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2759    }
2760
2761    impl Family {
2762        /// Gets the enum value.
2763        ///
2764        /// Returns `None` if the enum contains an unknown value deserialized from
2765        /// the string representation of enums.
2766        pub fn value(&self) -> std::option::Option<i32> {
2767            match self {
2768                Self::Unspecified => std::option::Option::Some(0),
2769                Self::Ac => std::option::Option::Some(1),
2770                Self::At => std::option::Option::Some(2),
2771                Self::Au => std::option::Option::Some(3),
2772                Self::Ca => std::option::Option::Some(4),
2773                Self::Cm => std::option::Option::Some(5),
2774                Self::Cp => std::option::Option::Some(6),
2775                Self::Ia => std::option::Option::Some(7),
2776                Self::Ir => std::option::Option::Some(8),
2777                Self::Ma => std::option::Option::Some(9),
2778                Self::Mp => std::option::Option::Some(10),
2779                Self::Pe => std::option::Option::Some(11),
2780                Self::Pl => std::option::Option::Some(12),
2781                Self::Ps => std::option::Option::Some(13),
2782                Self::Ra => std::option::Option::Some(14),
2783                Self::Sa => std::option::Option::Some(15),
2784                Self::Sc => std::option::Option::Some(16),
2785                Self::Si => std::option::Option::Some(17),
2786                Self::Sr => std::option::Option::Some(18),
2787                Self::UnknownValue(u) => u.0.value(),
2788            }
2789        }
2790
2791        /// Gets the enum value as a string.
2792        ///
2793        /// Returns `None` if the enum contains an unknown value deserialized from
2794        /// the integer representation of enums.
2795        pub fn name(&self) -> std::option::Option<&str> {
2796            match self {
2797                Self::Unspecified => std::option::Option::Some("FAMILY_UNSPECIFIED"),
2798                Self::Ac => std::option::Option::Some("AC"),
2799                Self::At => std::option::Option::Some("AT"),
2800                Self::Au => std::option::Option::Some("AU"),
2801                Self::Ca => std::option::Option::Some("CA"),
2802                Self::Cm => std::option::Option::Some("CM"),
2803                Self::Cp => std::option::Option::Some("CP"),
2804                Self::Ia => std::option::Option::Some("IA"),
2805                Self::Ir => std::option::Option::Some("IR"),
2806                Self::Ma => std::option::Option::Some("MA"),
2807                Self::Mp => std::option::Option::Some("MP"),
2808                Self::Pe => std::option::Option::Some("PE"),
2809                Self::Pl => std::option::Option::Some("PL"),
2810                Self::Ps => std::option::Option::Some("PS"),
2811                Self::Ra => std::option::Option::Some("RA"),
2812                Self::Sa => std::option::Option::Some("SA"),
2813                Self::Sc => std::option::Option::Some("SC"),
2814                Self::Si => std::option::Option::Some("SI"),
2815                Self::Sr => std::option::Option::Some("SR"),
2816                Self::UnknownValue(u) => u.0.name(),
2817            }
2818        }
2819    }
2820
2821    impl std::default::Default for Family {
2822        fn default() -> Self {
2823            use std::convert::From;
2824            Self::from(0)
2825        }
2826    }
2827
2828    impl std::fmt::Display for Family {
2829        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2830            wkt::internal::display_enum(f, self.name(), self.value())
2831        }
2832    }
2833
2834    impl std::convert::From<i32> for Family {
2835        fn from(value: i32) -> Self {
2836            match value {
2837                0 => Self::Unspecified,
2838                1 => Self::Ac,
2839                2 => Self::At,
2840                3 => Self::Au,
2841                4 => Self::Ca,
2842                5 => Self::Cm,
2843                6 => Self::Cp,
2844                7 => Self::Ia,
2845                8 => Self::Ir,
2846                9 => Self::Ma,
2847                10 => Self::Mp,
2848                11 => Self::Pe,
2849                12 => Self::Pl,
2850                13 => Self::Ps,
2851                14 => Self::Ra,
2852                15 => Self::Sa,
2853                16 => Self::Sc,
2854                17 => Self::Si,
2855                18 => Self::Sr,
2856                _ => Self::UnknownValue(family::UnknownValue(
2857                    wkt::internal::UnknownEnumValue::Integer(value),
2858                )),
2859            }
2860        }
2861    }
2862
2863    impl std::convert::From<&str> for Family {
2864        fn from(value: &str) -> Self {
2865            use std::string::ToString;
2866            match value {
2867                "FAMILY_UNSPECIFIED" => Self::Unspecified,
2868                "AC" => Self::Ac,
2869                "AT" => Self::At,
2870                "AU" => Self::Au,
2871                "CA" => Self::Ca,
2872                "CM" => Self::Cm,
2873                "CP" => Self::Cp,
2874                "IA" => Self::Ia,
2875                "IR" => Self::Ir,
2876                "MA" => Self::Ma,
2877                "MP" => Self::Mp,
2878                "PE" => Self::Pe,
2879                "PL" => Self::Pl,
2880                "PS" => Self::Ps,
2881                "RA" => Self::Ra,
2882                "SA" => Self::Sa,
2883                "SC" => Self::Sc,
2884                "SI" => Self::Si,
2885                "SR" => Self::Sr,
2886                _ => Self::UnknownValue(family::UnknownValue(
2887                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2888                )),
2889            }
2890        }
2891    }
2892
2893    impl serde::ser::Serialize for Family {
2894        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2895        where
2896            S: serde::Serializer,
2897        {
2898            match self {
2899                Self::Unspecified => serializer.serialize_i32(0),
2900                Self::Ac => serializer.serialize_i32(1),
2901                Self::At => serializer.serialize_i32(2),
2902                Self::Au => serializer.serialize_i32(3),
2903                Self::Ca => serializer.serialize_i32(4),
2904                Self::Cm => serializer.serialize_i32(5),
2905                Self::Cp => serializer.serialize_i32(6),
2906                Self::Ia => serializer.serialize_i32(7),
2907                Self::Ir => serializer.serialize_i32(8),
2908                Self::Ma => serializer.serialize_i32(9),
2909                Self::Mp => serializer.serialize_i32(10),
2910                Self::Pe => serializer.serialize_i32(11),
2911                Self::Pl => serializer.serialize_i32(12),
2912                Self::Ps => serializer.serialize_i32(13),
2913                Self::Ra => serializer.serialize_i32(14),
2914                Self::Sa => serializer.serialize_i32(15),
2915                Self::Sc => serializer.serialize_i32(16),
2916                Self::Si => serializer.serialize_i32(17),
2917                Self::Sr => serializer.serialize_i32(18),
2918                Self::UnknownValue(u) => u.0.serialize(serializer),
2919            }
2920        }
2921    }
2922
2923    impl<'de> serde::de::Deserialize<'de> for Family {
2924        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2925        where
2926            D: serde::Deserializer<'de>,
2927        {
2928            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Family>::new(
2929                ".google.cloud.auditmanager.v1.Control.Family",
2930            ))
2931        }
2932    }
2933}
2934
2935/// The locations where the generated reports are saved.
2936#[derive(Clone, Default, PartialEq)]
2937#[non_exhaustive]
2938pub struct DestinationDetails {
2939    pub destination: std::option::Option<crate::model::destination_details::Destination>,
2940
2941    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2942}
2943
2944impl DestinationDetails {
2945    pub fn new() -> Self {
2946        std::default::Default::default()
2947    }
2948
2949    /// Sets the value of [destination][crate::model::DestinationDetails::destination].
2950    ///
2951    /// Note that all the setters affecting `destination` are mutually
2952    /// exclusive.
2953    ///
2954    /// # Example
2955    /// ```ignore,no_run
2956    /// # use google_cloud_auditmanager_v1::model::DestinationDetails;
2957    /// use google_cloud_auditmanager_v1::model::destination_details::Destination;
2958    /// let x = DestinationDetails::new().set_destination(Some(Destination::GcsBucketUri("example".to_string())));
2959    /// ```
2960    pub fn set_destination<
2961        T: std::convert::Into<std::option::Option<crate::model::destination_details::Destination>>,
2962    >(
2963        mut self,
2964        v: T,
2965    ) -> Self {
2966        self.destination = v.into();
2967        self
2968    }
2969
2970    /// The value of [destination][crate::model::DestinationDetails::destination]
2971    /// if it holds a `GcsBucketUri`, `None` if the field is not set or
2972    /// holds a different branch.
2973    pub fn gcs_bucket_uri(&self) -> std::option::Option<&std::string::String> {
2974        #[allow(unreachable_patterns)]
2975        self.destination.as_ref().and_then(|v| match v {
2976            crate::model::destination_details::Destination::GcsBucketUri(v) => {
2977                std::option::Option::Some(v)
2978            }
2979            _ => std::option::Option::None,
2980        })
2981    }
2982
2983    /// Sets the value of [destination][crate::model::DestinationDetails::destination]
2984    /// to hold a `GcsBucketUri`.
2985    ///
2986    /// Note that all the setters affecting `destination` are
2987    /// mutually exclusive.
2988    ///
2989    /// # Example
2990    /// ```ignore,no_run
2991    /// # use google_cloud_auditmanager_v1::model::DestinationDetails;
2992    /// let x = DestinationDetails::new().set_gcs_bucket_uri("example");
2993    /// assert!(x.gcs_bucket_uri().is_some());
2994    /// ```
2995    pub fn set_gcs_bucket_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2996        self.destination = std::option::Option::Some(
2997            crate::model::destination_details::Destination::GcsBucketUri(v.into()),
2998        );
2999        self
3000    }
3001}
3002
3003impl wkt::message::Message for DestinationDetails {
3004    fn typename() -> &'static str {
3005        "type.googleapis.com/google.cloud.auditmanager.v1.DestinationDetails"
3006    }
3007}
3008
3009/// Defines additional types related to [DestinationDetails].
3010pub mod destination_details {
3011    #[allow(unused_imports)]
3012    use super::*;
3013
3014    #[derive(Clone, Debug, PartialEq)]
3015    #[non_exhaustive]
3016    pub enum Destination {
3017        /// The Cloud Storage bucket where the audit report is/will be uploaded.
3018        GcsBucketUri(std::string::String),
3019    }
3020}
3021
3022/// The additional information for an audit operation.
3023#[derive(Clone, Default, PartialEq)]
3024#[non_exhaustive]
3025pub struct ReportSummary {
3026    /// Total number of checks.
3027    pub total_count: i32,
3028
3029    /// Number of compliant checks.
3030    pub compliant_count: i32,
3031
3032    /// Number of checks with violations.
3033    pub violation_count: i32,
3034
3035    /// Number of checks with "manual review needed" status.
3036    pub manual_review_needed_count: i32,
3037
3038    /// Number of checks that could not be performed due to errors.
3039    pub error_count: i32,
3040
3041    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3042}
3043
3044impl ReportSummary {
3045    pub fn new() -> Self {
3046        std::default::Default::default()
3047    }
3048
3049    /// Sets the value of [total_count][crate::model::ReportSummary::total_count].
3050    ///
3051    /// # Example
3052    /// ```ignore,no_run
3053    /// # use google_cloud_auditmanager_v1::model::ReportSummary;
3054    /// let x = ReportSummary::new().set_total_count(42);
3055    /// ```
3056    pub fn set_total_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3057        self.total_count = v.into();
3058        self
3059    }
3060
3061    /// Sets the value of [compliant_count][crate::model::ReportSummary::compliant_count].
3062    ///
3063    /// # Example
3064    /// ```ignore,no_run
3065    /// # use google_cloud_auditmanager_v1::model::ReportSummary;
3066    /// let x = ReportSummary::new().set_compliant_count(42);
3067    /// ```
3068    pub fn set_compliant_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3069        self.compliant_count = v.into();
3070        self
3071    }
3072
3073    /// Sets the value of [violation_count][crate::model::ReportSummary::violation_count].
3074    ///
3075    /// # Example
3076    /// ```ignore,no_run
3077    /// # use google_cloud_auditmanager_v1::model::ReportSummary;
3078    /// let x = ReportSummary::new().set_violation_count(42);
3079    /// ```
3080    pub fn set_violation_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3081        self.violation_count = v.into();
3082        self
3083    }
3084
3085    /// Sets the value of [manual_review_needed_count][crate::model::ReportSummary::manual_review_needed_count].
3086    ///
3087    /// # Example
3088    /// ```ignore,no_run
3089    /// # use google_cloud_auditmanager_v1::model::ReportSummary;
3090    /// let x = ReportSummary::new().set_manual_review_needed_count(42);
3091    /// ```
3092    pub fn set_manual_review_needed_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3093        self.manual_review_needed_count = v.into();
3094        self
3095    }
3096
3097    /// Sets the value of [error_count][crate::model::ReportSummary::error_count].
3098    ///
3099    /// # Example
3100    /// ```ignore,no_run
3101    /// # use google_cloud_auditmanager_v1::model::ReportSummary;
3102    /// let x = ReportSummary::new().set_error_count(42);
3103    /// ```
3104    pub fn set_error_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3105        self.error_count = v.into();
3106        self
3107    }
3108}
3109
3110impl wkt::message::Message for ReportSummary {
3111    fn typename() -> &'static str {
3112        "type.googleapis.com/google.cloud.auditmanager.v1.ReportSummary"
3113    }
3114}
3115
3116/// The evaluation details for a control.
3117#[derive(Clone, Default, PartialEq)]
3118#[non_exhaustive]
3119pub struct ControlDetails {
3120    /// The control for which the findings are being reported.
3121    pub control: std::option::Option<crate::model::Control>,
3122
3123    /// Output only. Overall status of the findings for the control.
3124    pub compliance_state: crate::model::ComplianceState,
3125
3126    /// Report summary with compliance, violation counts etc.
3127    pub control_report_summary: std::option::Option<crate::model::ReportSummary>,
3128
3129    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3130}
3131
3132impl ControlDetails {
3133    pub fn new() -> Self {
3134        std::default::Default::default()
3135    }
3136
3137    /// Sets the value of [control][crate::model::ControlDetails::control].
3138    ///
3139    /// # Example
3140    /// ```ignore,no_run
3141    /// # use google_cloud_auditmanager_v1::model::ControlDetails;
3142    /// use google_cloud_auditmanager_v1::model::Control;
3143    /// let x = ControlDetails::new().set_control(Control::default()/* use setters */);
3144    /// ```
3145    pub fn set_control<T>(mut self, v: T) -> Self
3146    where
3147        T: std::convert::Into<crate::model::Control>,
3148    {
3149        self.control = std::option::Option::Some(v.into());
3150        self
3151    }
3152
3153    /// Sets or clears the value of [control][crate::model::ControlDetails::control].
3154    ///
3155    /// # Example
3156    /// ```ignore,no_run
3157    /// # use google_cloud_auditmanager_v1::model::ControlDetails;
3158    /// use google_cloud_auditmanager_v1::model::Control;
3159    /// let x = ControlDetails::new().set_or_clear_control(Some(Control::default()/* use setters */));
3160    /// let x = ControlDetails::new().set_or_clear_control(None::<Control>);
3161    /// ```
3162    pub fn set_or_clear_control<T>(mut self, v: std::option::Option<T>) -> Self
3163    where
3164        T: std::convert::Into<crate::model::Control>,
3165    {
3166        self.control = v.map(|x| x.into());
3167        self
3168    }
3169
3170    /// Sets the value of [compliance_state][crate::model::ControlDetails::compliance_state].
3171    ///
3172    /// # Example
3173    /// ```ignore,no_run
3174    /// # use google_cloud_auditmanager_v1::model::ControlDetails;
3175    /// use google_cloud_auditmanager_v1::model::ComplianceState;
3176    /// let x0 = ControlDetails::new().set_compliance_state(ComplianceState::Compliant);
3177    /// let x1 = ControlDetails::new().set_compliance_state(ComplianceState::Violation);
3178    /// let x2 = ControlDetails::new().set_compliance_state(ComplianceState::ManualReviewNeeded);
3179    /// ```
3180    pub fn set_compliance_state<T: std::convert::Into<crate::model::ComplianceState>>(
3181        mut self,
3182        v: T,
3183    ) -> Self {
3184        self.compliance_state = v.into();
3185        self
3186    }
3187
3188    /// Sets the value of [control_report_summary][crate::model::ControlDetails::control_report_summary].
3189    ///
3190    /// # Example
3191    /// ```ignore,no_run
3192    /// # use google_cloud_auditmanager_v1::model::ControlDetails;
3193    /// use google_cloud_auditmanager_v1::model::ReportSummary;
3194    /// let x = ControlDetails::new().set_control_report_summary(ReportSummary::default()/* use setters */);
3195    /// ```
3196    pub fn set_control_report_summary<T>(mut self, v: T) -> Self
3197    where
3198        T: std::convert::Into<crate::model::ReportSummary>,
3199    {
3200        self.control_report_summary = std::option::Option::Some(v.into());
3201        self
3202    }
3203
3204    /// Sets or clears the value of [control_report_summary][crate::model::ControlDetails::control_report_summary].
3205    ///
3206    /// # Example
3207    /// ```ignore,no_run
3208    /// # use google_cloud_auditmanager_v1::model::ControlDetails;
3209    /// use google_cloud_auditmanager_v1::model::ReportSummary;
3210    /// let x = ControlDetails::new().set_or_clear_control_report_summary(Some(ReportSummary::default()/* use setters */));
3211    /// let x = ControlDetails::new().set_or_clear_control_report_summary(None::<ReportSummary>);
3212    /// ```
3213    pub fn set_or_clear_control_report_summary<T>(mut self, v: std::option::Option<T>) -> Self
3214    where
3215        T: std::convert::Into<crate::model::ReportSummary>,
3216    {
3217        self.control_report_summary = v.map(|x| x.into());
3218        self
3219    }
3220}
3221
3222impl wkt::message::Message for ControlDetails {
3223    fn typename() -> &'static str {
3224        "type.googleapis.com/google.cloud.auditmanager.v1.ControlDetails"
3225    }
3226}
3227
3228/// The different execution states of the Audit Manager service.
3229///
3230/// # Working with unknown values
3231///
3232/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3233/// additional enum variants at any time. Adding new variants is not considered
3234/// a breaking change. Applications should write their code in anticipation of:
3235///
3236/// - New values appearing in future releases of the client library, **and**
3237/// - New values received dynamically, without application changes.
3238///
3239/// Please consult the [Working with enums] section in the user guide for some
3240/// guidelines.
3241///
3242/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3243#[derive(Clone, Debug, PartialEq)]
3244#[non_exhaustive]
3245pub enum OperationState {
3246    /// Unspecified. Invalid state.
3247    Unspecified,
3248    /// Audit report generation process has not started.
3249    NotStarted,
3250    /// Audit Manager is currently evaluating the workloads against specific
3251    /// standard.
3252    EvaluationInProgress,
3253    /// Audit Manager has completed Evaluation for the workload.
3254    EvaluationDone,
3255    /// Audit Manager is creating audit report from the evaluated data.
3256    EvidenceReportGenerationInProgress,
3257    /// Audit Manager has completed generation of the audit report.
3258    EvidenceReportGenerationDone,
3259    /// Audit Manager is uploading the audit report and evidences to the customer
3260    /// provided destination.
3261    EvidenceUploadInProgress,
3262    /// Audit report generation process is completed.
3263    Done,
3264    /// Audit report generation process has failed.
3265    Failed,
3266    /// If set, the enum was initialized with an unknown value.
3267    ///
3268    /// Applications can examine the value using [OperationState::value] or
3269    /// [OperationState::name].
3270    UnknownValue(operation_state::UnknownValue),
3271}
3272
3273#[doc(hidden)]
3274pub mod operation_state {
3275    #[allow(unused_imports)]
3276    use super::*;
3277    #[derive(Clone, Debug, PartialEq)]
3278    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3279}
3280
3281impl OperationState {
3282    /// Gets the enum value.
3283    ///
3284    /// Returns `None` if the enum contains an unknown value deserialized from
3285    /// the string representation of enums.
3286    pub fn value(&self) -> std::option::Option<i32> {
3287        match self {
3288            Self::Unspecified => std::option::Option::Some(0),
3289            Self::NotStarted => std::option::Option::Some(10),
3290            Self::EvaluationInProgress => std::option::Option::Some(20),
3291            Self::EvaluationDone => std::option::Option::Some(21),
3292            Self::EvidenceReportGenerationInProgress => std::option::Option::Some(30),
3293            Self::EvidenceReportGenerationDone => std::option::Option::Some(31),
3294            Self::EvidenceUploadInProgress => std::option::Option::Some(40),
3295            Self::Done => std::option::Option::Some(50),
3296            Self::Failed => std::option::Option::Some(60),
3297            Self::UnknownValue(u) => u.0.value(),
3298        }
3299    }
3300
3301    /// Gets the enum value as a string.
3302    ///
3303    /// Returns `None` if the enum contains an unknown value deserialized from
3304    /// the integer representation of enums.
3305    pub fn name(&self) -> std::option::Option<&str> {
3306        match self {
3307            Self::Unspecified => std::option::Option::Some("OPERATION_STATE_UNSPECIFIED"),
3308            Self::NotStarted => std::option::Option::Some("OPERATION_STATE_NOT_STARTED"),
3309            Self::EvaluationInProgress => {
3310                std::option::Option::Some("OPERATION_STATE_EVALUATION_IN_PROGRESS")
3311            }
3312            Self::EvaluationDone => std::option::Option::Some("OPERATION_STATE_EVALUATION_DONE"),
3313            Self::EvidenceReportGenerationInProgress => {
3314                std::option::Option::Some("OPERATION_STATE_EVIDENCE_REPORT_GENERATION_IN_PROGRESS")
3315            }
3316            Self::EvidenceReportGenerationDone => {
3317                std::option::Option::Some("OPERATION_STATE_EVIDENCE_REPORT_GENERATION_DONE")
3318            }
3319            Self::EvidenceUploadInProgress => {
3320                std::option::Option::Some("OPERATION_STATE_EVIDENCE_UPLOAD_IN_PROGRESS")
3321            }
3322            Self::Done => std::option::Option::Some("OPERATION_STATE_DONE"),
3323            Self::Failed => std::option::Option::Some("OPERATION_STATE_FAILED"),
3324            Self::UnknownValue(u) => u.0.name(),
3325        }
3326    }
3327}
3328
3329impl std::default::Default for OperationState {
3330    fn default() -> Self {
3331        use std::convert::From;
3332        Self::from(0)
3333    }
3334}
3335
3336impl std::fmt::Display for OperationState {
3337    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3338        wkt::internal::display_enum(f, self.name(), self.value())
3339    }
3340}
3341
3342impl std::convert::From<i32> for OperationState {
3343    fn from(value: i32) -> Self {
3344        match value {
3345            0 => Self::Unspecified,
3346            10 => Self::NotStarted,
3347            20 => Self::EvaluationInProgress,
3348            21 => Self::EvaluationDone,
3349            30 => Self::EvidenceReportGenerationInProgress,
3350            31 => Self::EvidenceReportGenerationDone,
3351            40 => Self::EvidenceUploadInProgress,
3352            50 => Self::Done,
3353            60 => Self::Failed,
3354            _ => Self::UnknownValue(operation_state::UnknownValue(
3355                wkt::internal::UnknownEnumValue::Integer(value),
3356            )),
3357        }
3358    }
3359}
3360
3361impl std::convert::From<&str> for OperationState {
3362    fn from(value: &str) -> Self {
3363        use std::string::ToString;
3364        match value {
3365            "OPERATION_STATE_UNSPECIFIED" => Self::Unspecified,
3366            "OPERATION_STATE_NOT_STARTED" => Self::NotStarted,
3367            "OPERATION_STATE_EVALUATION_IN_PROGRESS" => Self::EvaluationInProgress,
3368            "OPERATION_STATE_EVALUATION_DONE" => Self::EvaluationDone,
3369            "OPERATION_STATE_EVIDENCE_REPORT_GENERATION_IN_PROGRESS" => {
3370                Self::EvidenceReportGenerationInProgress
3371            }
3372            "OPERATION_STATE_EVIDENCE_REPORT_GENERATION_DONE" => Self::EvidenceReportGenerationDone,
3373            "OPERATION_STATE_EVIDENCE_UPLOAD_IN_PROGRESS" => Self::EvidenceUploadInProgress,
3374            "OPERATION_STATE_DONE" => Self::Done,
3375            "OPERATION_STATE_FAILED" => Self::Failed,
3376            _ => Self::UnknownValue(operation_state::UnknownValue(
3377                wkt::internal::UnknownEnumValue::String(value.to_string()),
3378            )),
3379        }
3380    }
3381}
3382
3383impl serde::ser::Serialize for OperationState {
3384    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3385    where
3386        S: serde::Serializer,
3387    {
3388        match self {
3389            Self::Unspecified => serializer.serialize_i32(0),
3390            Self::NotStarted => serializer.serialize_i32(10),
3391            Self::EvaluationInProgress => serializer.serialize_i32(20),
3392            Self::EvaluationDone => serializer.serialize_i32(21),
3393            Self::EvidenceReportGenerationInProgress => serializer.serialize_i32(30),
3394            Self::EvidenceReportGenerationDone => serializer.serialize_i32(31),
3395            Self::EvidenceUploadInProgress => serializer.serialize_i32(40),
3396            Self::Done => serializer.serialize_i32(50),
3397            Self::Failed => serializer.serialize_i32(60),
3398            Self::UnknownValue(u) => u.0.serialize(serializer),
3399        }
3400    }
3401}
3402
3403impl<'de> serde::de::Deserialize<'de> for OperationState {
3404    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3405    where
3406        D: serde::Deserializer<'de>,
3407    {
3408        deserializer.deserialize_any(wkt::internal::EnumVisitor::<OperationState>::new(
3409            ".google.cloud.auditmanager.v1.OperationState",
3410        ))
3411    }
3412}
3413
3414/// The compliance state after evaluation.
3415///
3416/// # Working with unknown values
3417///
3418/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3419/// additional enum variants at any time. Adding new variants is not considered
3420/// a breaking change. Applications should write their code in anticipation of:
3421///
3422/// - New values appearing in future releases of the client library, **and**
3423/// - New values received dynamically, without application changes.
3424///
3425/// Please consult the [Working with enums] section in the user guide for some
3426/// guidelines.
3427///
3428/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3429#[derive(Clone, Debug, PartialEq)]
3430#[non_exhaustive]
3431pub enum ComplianceState {
3432    /// Unspecified. Invalid state.
3433    Unspecified,
3434    /// Compliant.
3435    Compliant,
3436    /// Violation.
3437    Violation,
3438    /// MANUAL_REVIEW_NEEDED, requires manual review
3439    ManualReviewNeeded,
3440    /// Error while computing status.
3441    Error,
3442    /// Cannot be audited
3443    AuditNotSupported,
3444    /// If set, the enum was initialized with an unknown value.
3445    ///
3446    /// Applications can examine the value using [ComplianceState::value] or
3447    /// [ComplianceState::name].
3448    UnknownValue(compliance_state::UnknownValue),
3449}
3450
3451#[doc(hidden)]
3452pub mod compliance_state {
3453    #[allow(unused_imports)]
3454    use super::*;
3455    #[derive(Clone, Debug, PartialEq)]
3456    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3457}
3458
3459impl ComplianceState {
3460    /// Gets the enum value.
3461    ///
3462    /// Returns `None` if the enum contains an unknown value deserialized from
3463    /// the string representation of enums.
3464    pub fn value(&self) -> std::option::Option<i32> {
3465        match self {
3466            Self::Unspecified => std::option::Option::Some(0),
3467            Self::Compliant => std::option::Option::Some(1),
3468            Self::Violation => std::option::Option::Some(2),
3469            Self::ManualReviewNeeded => std::option::Option::Some(3),
3470            Self::Error => std::option::Option::Some(4),
3471            Self::AuditNotSupported => std::option::Option::Some(5),
3472            Self::UnknownValue(u) => u.0.value(),
3473        }
3474    }
3475
3476    /// Gets the enum value as a string.
3477    ///
3478    /// Returns `None` if the enum contains an unknown value deserialized from
3479    /// the integer representation of enums.
3480    pub fn name(&self) -> std::option::Option<&str> {
3481        match self {
3482            Self::Unspecified => std::option::Option::Some("COMPLIANCE_STATE_UNSPECIFIED"),
3483            Self::Compliant => std::option::Option::Some("COMPLIANT"),
3484            Self::Violation => std::option::Option::Some("VIOLATION"),
3485            Self::ManualReviewNeeded => std::option::Option::Some("MANUAL_REVIEW_NEEDED"),
3486            Self::Error => std::option::Option::Some("ERROR"),
3487            Self::AuditNotSupported => std::option::Option::Some("AUDIT_NOT_SUPPORTED"),
3488            Self::UnknownValue(u) => u.0.name(),
3489        }
3490    }
3491}
3492
3493impl std::default::Default for ComplianceState {
3494    fn default() -> Self {
3495        use std::convert::From;
3496        Self::from(0)
3497    }
3498}
3499
3500impl std::fmt::Display for ComplianceState {
3501    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3502        wkt::internal::display_enum(f, self.name(), self.value())
3503    }
3504}
3505
3506impl std::convert::From<i32> for ComplianceState {
3507    fn from(value: i32) -> Self {
3508        match value {
3509            0 => Self::Unspecified,
3510            1 => Self::Compliant,
3511            2 => Self::Violation,
3512            3 => Self::ManualReviewNeeded,
3513            4 => Self::Error,
3514            5 => Self::AuditNotSupported,
3515            _ => Self::UnknownValue(compliance_state::UnknownValue(
3516                wkt::internal::UnknownEnumValue::Integer(value),
3517            )),
3518        }
3519    }
3520}
3521
3522impl std::convert::From<&str> for ComplianceState {
3523    fn from(value: &str) -> Self {
3524        use std::string::ToString;
3525        match value {
3526            "COMPLIANCE_STATE_UNSPECIFIED" => Self::Unspecified,
3527            "COMPLIANT" => Self::Compliant,
3528            "VIOLATION" => Self::Violation,
3529            "MANUAL_REVIEW_NEEDED" => Self::ManualReviewNeeded,
3530            "ERROR" => Self::Error,
3531            "AUDIT_NOT_SUPPORTED" => Self::AuditNotSupported,
3532            _ => Self::UnknownValue(compliance_state::UnknownValue(
3533                wkt::internal::UnknownEnumValue::String(value.to_string()),
3534            )),
3535        }
3536    }
3537}
3538
3539impl serde::ser::Serialize for ComplianceState {
3540    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3541    where
3542        S: serde::Serializer,
3543    {
3544        match self {
3545            Self::Unspecified => serializer.serialize_i32(0),
3546            Self::Compliant => serializer.serialize_i32(1),
3547            Self::Violation => serializer.serialize_i32(2),
3548            Self::ManualReviewNeeded => serializer.serialize_i32(3),
3549            Self::Error => serializer.serialize_i32(4),
3550            Self::AuditNotSupported => serializer.serialize_i32(5),
3551            Self::UnknownValue(u) => u.0.serialize(serializer),
3552        }
3553    }
3554}
3555
3556impl<'de> serde::de::Deserialize<'de> for ComplianceState {
3557    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3558    where
3559        D: serde::Deserializer<'de>,
3560    {
3561        deserializer.deserialize_any(wkt::internal::EnumVisitor::<ComplianceState>::new(
3562            ".google.cloud.auditmanager.v1.ComplianceState",
3563        ))
3564    }
3565}