google_cloud_cloudsecuritycompliance_v1/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
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 gax;
23extern crate gaxi;
24extern crate gtype;
25extern crate lazy_static;
26extern crate location;
27extern crate longrunning;
28extern crate lro;
29extern crate reqwest;
30extern crate serde;
31extern crate serde_json;
32extern crate serde_with;
33extern crate std;
34extern crate tracing;
35extern crate wkt;
36
37mod debug;
38mod deserialize;
39mod serialize;
40
41/// The request message for [GenerateFrameworkAuditScopeReport][].
42#[derive(Clone, Default, PartialEq)]
43#[non_exhaustive]
44pub struct GenerateFrameworkAuditScopeReportRequest {
45 /// Required. The organization, folder or project for the audit report.
46 ///
47 /// Supported formats are the following:
48 ///
49 /// * `projects/{project_id}/locations/{location}`
50 /// * `folders/{folder_id}/locations/{location}`
51 /// * `organizations/{organization_id}/locations/{location}`
52 pub scope: std::string::String,
53
54 /// Required. The format that the scope report bytes is returned in.
55 pub report_format: crate::model::generate_framework_audit_scope_report_request::Format,
56
57 /// Required. The compliance framework that the scope report is generated for.
58 pub compliance_framework: std::string::String,
59
60 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
61}
62
63impl GenerateFrameworkAuditScopeReportRequest {
64 pub fn new() -> Self {
65 std::default::Default::default()
66 }
67
68 /// Sets the value of [scope][crate::model::GenerateFrameworkAuditScopeReportRequest::scope].
69 ///
70 /// # Example
71 /// ```ignore,no_run
72 /// # use google_cloud_cloudsecuritycompliance_v1::model::GenerateFrameworkAuditScopeReportRequest;
73 /// let x = GenerateFrameworkAuditScopeReportRequest::new().set_scope("example");
74 /// ```
75 pub fn set_scope<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
76 self.scope = v.into();
77 self
78 }
79
80 /// Sets the value of [report_format][crate::model::GenerateFrameworkAuditScopeReportRequest::report_format].
81 ///
82 /// # Example
83 /// ```ignore,no_run
84 /// # use google_cloud_cloudsecuritycompliance_v1::model::GenerateFrameworkAuditScopeReportRequest;
85 /// use google_cloud_cloudsecuritycompliance_v1::model::generate_framework_audit_scope_report_request::Format;
86 /// let x0 = GenerateFrameworkAuditScopeReportRequest::new().set_report_format(Format::Odf);
87 /// ```
88 pub fn set_report_format<
89 T: std::convert::Into<crate::model::generate_framework_audit_scope_report_request::Format>,
90 >(
91 mut self,
92 v: T,
93 ) -> Self {
94 self.report_format = v.into();
95 self
96 }
97
98 /// Sets the value of [compliance_framework][crate::model::GenerateFrameworkAuditScopeReportRequest::compliance_framework].
99 ///
100 /// # Example
101 /// ```ignore,no_run
102 /// # use google_cloud_cloudsecuritycompliance_v1::model::GenerateFrameworkAuditScopeReportRequest;
103 /// let x = GenerateFrameworkAuditScopeReportRequest::new().set_compliance_framework("example");
104 /// ```
105 pub fn set_compliance_framework<T: std::convert::Into<std::string::String>>(
106 mut self,
107 v: T,
108 ) -> Self {
109 self.compliance_framework = v.into();
110 self
111 }
112}
113
114impl wkt::message::Message for GenerateFrameworkAuditScopeReportRequest {
115 fn typename() -> &'static str {
116 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.GenerateFrameworkAuditScopeReportRequest"
117 }
118}
119
120/// Defines additional types related to [GenerateFrameworkAuditScopeReportRequest].
121pub mod generate_framework_audit_scope_report_request {
122 #[allow(unused_imports)]
123 use super::*;
124
125 /// The set of options for the audit scope report format.
126 ///
127 /// # Working with unknown values
128 ///
129 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
130 /// additional enum variants at any time. Adding new variants is not considered
131 /// a breaking change. Applications should write their code in anticipation of:
132 ///
133 /// - New values appearing in future releases of the client library, **and**
134 /// - New values received dynamically, without application changes.
135 ///
136 /// Please consult the [Working with enums] section in the user guide for some
137 /// guidelines.
138 ///
139 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
140 #[derive(Clone, Debug, PartialEq)]
141 #[non_exhaustive]
142 pub enum Format {
143 /// Default value. This value is unused.
144 Unspecified,
145 /// The report format is the Open Document Format (ODF).
146 Odf,
147 /// If set, the enum was initialized with an unknown value.
148 ///
149 /// Applications can examine the value using [Format::value] or
150 /// [Format::name].
151 UnknownValue(format::UnknownValue),
152 }
153
154 #[doc(hidden)]
155 pub mod format {
156 #[allow(unused_imports)]
157 use super::*;
158 #[derive(Clone, Debug, PartialEq)]
159 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
160 }
161
162 impl Format {
163 /// Gets the enum value.
164 ///
165 /// Returns `None` if the enum contains an unknown value deserialized from
166 /// the string representation of enums.
167 pub fn value(&self) -> std::option::Option<i32> {
168 match self {
169 Self::Unspecified => std::option::Option::Some(0),
170 Self::Odf => std::option::Option::Some(1),
171 Self::UnknownValue(u) => u.0.value(),
172 }
173 }
174
175 /// Gets the enum value as a string.
176 ///
177 /// Returns `None` if the enum contains an unknown value deserialized from
178 /// the integer representation of enums.
179 pub fn name(&self) -> std::option::Option<&str> {
180 match self {
181 Self::Unspecified => std::option::Option::Some("FORMAT_UNSPECIFIED"),
182 Self::Odf => std::option::Option::Some("ODF"),
183 Self::UnknownValue(u) => u.0.name(),
184 }
185 }
186 }
187
188 impl std::default::Default for Format {
189 fn default() -> Self {
190 use std::convert::From;
191 Self::from(0)
192 }
193 }
194
195 impl std::fmt::Display for Format {
196 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
197 wkt::internal::display_enum(f, self.name(), self.value())
198 }
199 }
200
201 impl std::convert::From<i32> for Format {
202 fn from(value: i32) -> Self {
203 match value {
204 0 => Self::Unspecified,
205 1 => Self::Odf,
206 _ => Self::UnknownValue(format::UnknownValue(
207 wkt::internal::UnknownEnumValue::Integer(value),
208 )),
209 }
210 }
211 }
212
213 impl std::convert::From<&str> for Format {
214 fn from(value: &str) -> Self {
215 use std::string::ToString;
216 match value {
217 "FORMAT_UNSPECIFIED" => Self::Unspecified,
218 "ODF" => Self::Odf,
219 _ => Self::UnknownValue(format::UnknownValue(
220 wkt::internal::UnknownEnumValue::String(value.to_string()),
221 )),
222 }
223 }
224 }
225
226 impl serde::ser::Serialize for Format {
227 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
228 where
229 S: serde::Serializer,
230 {
231 match self {
232 Self::Unspecified => serializer.serialize_i32(0),
233 Self::Odf => serializer.serialize_i32(1),
234 Self::UnknownValue(u) => u.0.serialize(serializer),
235 }
236 }
237 }
238
239 impl<'de> serde::de::Deserialize<'de> for Format {
240 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
241 where
242 D: serde::Deserializer<'de>,
243 {
244 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Format>::new(
245 ".google.cloud.cloudsecuritycompliance.v1.GenerateFrameworkAuditScopeReportRequest.Format"))
246 }
247 }
248}
249
250/// The response message for [GenerateFrameworkAuditScopeReport][].
251#[derive(Clone, Default, PartialEq)]
252#[non_exhaustive]
253pub struct GenerateFrameworkAuditScopeReportResponse {
254 /// Identifier. The name of the audit report, in the format that was
255 /// given in the request.
256 pub name: std::string::String,
257
258 /// Required. The compliance framework that the audit scope report is generated
259 /// for.
260 pub compliance_framework: std::string::String,
261
262 /// The set of options that the audit scope report is exported in.
263 pub audit_report: std::option::Option<
264 crate::model::generate_framework_audit_scope_report_response::AuditReport,
265 >,
266
267 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
268}
269
270impl GenerateFrameworkAuditScopeReportResponse {
271 pub fn new() -> Self {
272 std::default::Default::default()
273 }
274
275 /// Sets the value of [name][crate::model::GenerateFrameworkAuditScopeReportResponse::name].
276 ///
277 /// # Example
278 /// ```ignore,no_run
279 /// # use google_cloud_cloudsecuritycompliance_v1::model::GenerateFrameworkAuditScopeReportResponse;
280 /// let x = GenerateFrameworkAuditScopeReportResponse::new().set_name("example");
281 /// ```
282 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
283 self.name = v.into();
284 self
285 }
286
287 /// Sets the value of [compliance_framework][crate::model::GenerateFrameworkAuditScopeReportResponse::compliance_framework].
288 ///
289 /// # Example
290 /// ```ignore,no_run
291 /// # use google_cloud_cloudsecuritycompliance_v1::model::GenerateFrameworkAuditScopeReportResponse;
292 /// let x = GenerateFrameworkAuditScopeReportResponse::new().set_compliance_framework("example");
293 /// ```
294 pub fn set_compliance_framework<T: std::convert::Into<std::string::String>>(
295 mut self,
296 v: T,
297 ) -> Self {
298 self.compliance_framework = v.into();
299 self
300 }
301
302 /// Sets the value of [audit_report][crate::model::GenerateFrameworkAuditScopeReportResponse::audit_report].
303 ///
304 /// Note that all the setters affecting `audit_report` are mutually
305 /// exclusive.
306 ///
307 /// # Example
308 /// ```ignore,no_run
309 /// # use google_cloud_cloudsecuritycompliance_v1::model::GenerateFrameworkAuditScopeReportResponse;
310 /// use google_cloud_cloudsecuritycompliance_v1::model::generate_framework_audit_scope_report_response::AuditReport;
311 /// let x = GenerateFrameworkAuditScopeReportResponse::new().set_audit_report(Some(AuditReport::ScopeReportContents(bytes::Bytes::from_static(b"example"))));
312 /// ```
313 pub fn set_audit_report<
314 T: std::convert::Into<
315 std::option::Option<
316 crate::model::generate_framework_audit_scope_report_response::AuditReport,
317 >,
318 >,
319 >(
320 mut self,
321 v: T,
322 ) -> Self {
323 self.audit_report = v.into();
324 self
325 }
326
327 /// The value of [audit_report][crate::model::GenerateFrameworkAuditScopeReportResponse::audit_report]
328 /// if it holds a `ScopeReportContents`, `None` if the field is not set or
329 /// holds a different branch.
330 pub fn scope_report_contents(&self) -> std::option::Option<&::bytes::Bytes> {
331 #[allow(unreachable_patterns)]
332 self.audit_report.as_ref().and_then(|v| match v {
333 crate::model::generate_framework_audit_scope_report_response::AuditReport::ScopeReportContents(v) => std::option::Option::Some(v),
334 _ => std::option::Option::None,
335 })
336 }
337
338 /// Sets the value of [audit_report][crate::model::GenerateFrameworkAuditScopeReportResponse::audit_report]
339 /// to hold a `ScopeReportContents`.
340 ///
341 /// Note that all the setters affecting `audit_report` are
342 /// mutually exclusive.
343 ///
344 /// # Example
345 /// ```ignore,no_run
346 /// # use google_cloud_cloudsecuritycompliance_v1::model::GenerateFrameworkAuditScopeReportResponse;
347 /// let x = GenerateFrameworkAuditScopeReportResponse::new().set_scope_report_contents(bytes::Bytes::from_static(b"example"));
348 /// assert!(x.scope_report_contents().is_some());
349 /// ```
350 pub fn set_scope_report_contents<T: std::convert::Into<::bytes::Bytes>>(
351 mut self,
352 v: T,
353 ) -> Self {
354 self.audit_report = std::option::Option::Some(
355 crate::model::generate_framework_audit_scope_report_response::AuditReport::ScopeReportContents(
356 v.into()
357 )
358 );
359 self
360 }
361}
362
363impl wkt::message::Message for GenerateFrameworkAuditScopeReportResponse {
364 fn typename() -> &'static str {
365 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.GenerateFrameworkAuditScopeReportResponse"
366 }
367}
368
369/// Defines additional types related to [GenerateFrameworkAuditScopeReportResponse].
370pub mod generate_framework_audit_scope_report_response {
371 #[allow(unused_imports)]
372 use super::*;
373
374 /// The set of options that the audit scope report is exported in.
375 #[derive(Clone, Debug, PartialEq)]
376 #[non_exhaustive]
377 pub enum AuditReport {
378 /// The audit scope report content in byte format.
379 ScopeReportContents(::bytes::Bytes),
380 }
381}
382
383/// Additional information for an audit operation.
384#[derive(Clone, Default, PartialEq)]
385#[non_exhaustive]
386pub struct ReportSummary {
387 /// Output only. The total number of checks.
388 pub total_count: i32,
389
390 /// Output only. The number of compliant checks.
391 pub compliant_count: i32,
392
393 /// Output only. The number of checks with violations.
394 pub violation_count: i32,
395
396 /// Output only. The number of checks with "manual review needed" status.
397 pub manual_review_needed_count: i32,
398
399 /// Output only. The number of checks that can't be performed due to errors.
400 pub error_count: i32,
401
402 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
403}
404
405impl ReportSummary {
406 pub fn new() -> Self {
407 std::default::Default::default()
408 }
409
410 /// Sets the value of [total_count][crate::model::ReportSummary::total_count].
411 ///
412 /// # Example
413 /// ```ignore,no_run
414 /// # use google_cloud_cloudsecuritycompliance_v1::model::ReportSummary;
415 /// let x = ReportSummary::new().set_total_count(42);
416 /// ```
417 pub fn set_total_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
418 self.total_count = v.into();
419 self
420 }
421
422 /// Sets the value of [compliant_count][crate::model::ReportSummary::compliant_count].
423 ///
424 /// # Example
425 /// ```ignore,no_run
426 /// # use google_cloud_cloudsecuritycompliance_v1::model::ReportSummary;
427 /// let x = ReportSummary::new().set_compliant_count(42);
428 /// ```
429 pub fn set_compliant_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
430 self.compliant_count = v.into();
431 self
432 }
433
434 /// Sets the value of [violation_count][crate::model::ReportSummary::violation_count].
435 ///
436 /// # Example
437 /// ```ignore,no_run
438 /// # use google_cloud_cloudsecuritycompliance_v1::model::ReportSummary;
439 /// let x = ReportSummary::new().set_violation_count(42);
440 /// ```
441 pub fn set_violation_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
442 self.violation_count = v.into();
443 self
444 }
445
446 /// Sets the value of [manual_review_needed_count][crate::model::ReportSummary::manual_review_needed_count].
447 ///
448 /// # Example
449 /// ```ignore,no_run
450 /// # use google_cloud_cloudsecuritycompliance_v1::model::ReportSummary;
451 /// let x = ReportSummary::new().set_manual_review_needed_count(42);
452 /// ```
453 pub fn set_manual_review_needed_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
454 self.manual_review_needed_count = v.into();
455 self
456 }
457
458 /// Sets the value of [error_count][crate::model::ReportSummary::error_count].
459 ///
460 /// # Example
461 /// ```ignore,no_run
462 /// # use google_cloud_cloudsecuritycompliance_v1::model::ReportSummary;
463 /// let x = ReportSummary::new().set_error_count(42);
464 /// ```
465 pub fn set_error_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
466 self.error_count = v.into();
467 self
468 }
469}
470
471impl wkt::message::Message for ReportSummary {
472 fn typename() -> &'static str {
473 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ReportSummary"
474 }
475}
476
477/// The request message for [CreateFrameworkAudit][].
478#[derive(Clone, Default, PartialEq)]
479#[non_exhaustive]
480pub struct CreateFrameworkAuditRequest {
481 /// Required. The parent resource where this framework audit is created.
482 ///
483 /// Supported formats are the following:
484 ///
485 /// * `organizations/{organization_id}/locations/{location}`
486 /// * `folders/{folder_id}/locations/{location}`
487 /// * `projects/{project_id}/locations/{location}`
488 pub parent: std::string::String,
489
490 /// Optional. The ID to use for the framework audit. The ID becomes the final
491 /// component of the framework audit's full resource name.
492 ///
493 /// The ID must be between 4-63 characters, and valid characters
494 /// are `\[a-z][0-9]-\`.
495 pub framework_audit_id: std::string::String,
496
497 /// Required. The framework audit to create.
498 pub framework_audit: std::option::Option<crate::model::FrameworkAudit>,
499
500 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
501}
502
503impl CreateFrameworkAuditRequest {
504 pub fn new() -> Self {
505 std::default::Default::default()
506 }
507
508 /// Sets the value of [parent][crate::model::CreateFrameworkAuditRequest::parent].
509 ///
510 /// # Example
511 /// ```ignore,no_run
512 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkAuditRequest;
513 /// let x = CreateFrameworkAuditRequest::new().set_parent("example");
514 /// ```
515 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
516 self.parent = v.into();
517 self
518 }
519
520 /// Sets the value of [framework_audit_id][crate::model::CreateFrameworkAuditRequest::framework_audit_id].
521 ///
522 /// # Example
523 /// ```ignore,no_run
524 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkAuditRequest;
525 /// let x = CreateFrameworkAuditRequest::new().set_framework_audit_id("example");
526 /// ```
527 pub fn set_framework_audit_id<T: std::convert::Into<std::string::String>>(
528 mut self,
529 v: T,
530 ) -> Self {
531 self.framework_audit_id = v.into();
532 self
533 }
534
535 /// Sets the value of [framework_audit][crate::model::CreateFrameworkAuditRequest::framework_audit].
536 ///
537 /// # Example
538 /// ```ignore,no_run
539 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkAuditRequest;
540 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
541 /// let x = CreateFrameworkAuditRequest::new().set_framework_audit(FrameworkAudit::default()/* use setters */);
542 /// ```
543 pub fn set_framework_audit<T>(mut self, v: T) -> Self
544 where
545 T: std::convert::Into<crate::model::FrameworkAudit>,
546 {
547 self.framework_audit = std::option::Option::Some(v.into());
548 self
549 }
550
551 /// Sets or clears the value of [framework_audit][crate::model::CreateFrameworkAuditRequest::framework_audit].
552 ///
553 /// # Example
554 /// ```ignore,no_run
555 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkAuditRequest;
556 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
557 /// let x = CreateFrameworkAuditRequest::new().set_or_clear_framework_audit(Some(FrameworkAudit::default()/* use setters */));
558 /// let x = CreateFrameworkAuditRequest::new().set_or_clear_framework_audit(None::<FrameworkAudit>);
559 /// ```
560 pub fn set_or_clear_framework_audit<T>(mut self, v: std::option::Option<T>) -> Self
561 where
562 T: std::convert::Into<crate::model::FrameworkAudit>,
563 {
564 self.framework_audit = v.map(|x| x.into());
565 self
566 }
567}
568
569impl wkt::message::Message for CreateFrameworkAuditRequest {
570 fn typename() -> &'static str {
571 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CreateFrameworkAuditRequest"
572 }
573}
574
575/// A destination for the framework audit.
576#[derive(Clone, Default, PartialEq)]
577#[non_exhaustive]
578pub struct FrameworkAuditDestination {
579 /// The type of destination.
580 pub destination_type:
581 std::option::Option<crate::model::framework_audit_destination::DestinationType>,
582
583 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
584}
585
586impl FrameworkAuditDestination {
587 pub fn new() -> Self {
588 std::default::Default::default()
589 }
590
591 /// Sets the value of [destination_type][crate::model::FrameworkAuditDestination::destination_type].
592 ///
593 /// Note that all the setters affecting `destination_type` are mutually
594 /// exclusive.
595 ///
596 /// # Example
597 /// ```ignore,no_run
598 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAuditDestination;
599 /// use google_cloud_cloudsecuritycompliance_v1::model::BucketDestination;
600 /// let x = FrameworkAuditDestination::new().set_destination_type(Some(
601 /// google_cloud_cloudsecuritycompliance_v1::model::framework_audit_destination::DestinationType::Bucket(BucketDestination::default().into())));
602 /// ```
603 pub fn set_destination_type<
604 T: std::convert::Into<
605 std::option::Option<crate::model::framework_audit_destination::DestinationType>,
606 >,
607 >(
608 mut self,
609 v: T,
610 ) -> Self {
611 self.destination_type = v.into();
612 self
613 }
614
615 /// The value of [destination_type][crate::model::FrameworkAuditDestination::destination_type]
616 /// if it holds a `Bucket`, `None` if the field is not set or
617 /// holds a different branch.
618 pub fn bucket(&self) -> std::option::Option<&std::boxed::Box<crate::model::BucketDestination>> {
619 #[allow(unreachable_patterns)]
620 self.destination_type.as_ref().and_then(|v| match v {
621 crate::model::framework_audit_destination::DestinationType::Bucket(v) => {
622 std::option::Option::Some(v)
623 }
624 _ => std::option::Option::None,
625 })
626 }
627
628 /// Sets the value of [destination_type][crate::model::FrameworkAuditDestination::destination_type]
629 /// to hold a `Bucket`.
630 ///
631 /// Note that all the setters affecting `destination_type` are
632 /// mutually exclusive.
633 ///
634 /// # Example
635 /// ```ignore,no_run
636 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAuditDestination;
637 /// use google_cloud_cloudsecuritycompliance_v1::model::BucketDestination;
638 /// let x = FrameworkAuditDestination::new().set_bucket(BucketDestination::default()/* use setters */);
639 /// assert!(x.bucket().is_some());
640 /// ```
641 pub fn set_bucket<T: std::convert::Into<std::boxed::Box<crate::model::BucketDestination>>>(
642 mut self,
643 v: T,
644 ) -> Self {
645 self.destination_type = std::option::Option::Some(
646 crate::model::framework_audit_destination::DestinationType::Bucket(v.into()),
647 );
648 self
649 }
650}
651
652impl wkt::message::Message for FrameworkAuditDestination {
653 fn typename() -> &'static str {
654 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FrameworkAuditDestination"
655 }
656}
657
658/// Defines additional types related to [FrameworkAuditDestination].
659pub mod framework_audit_destination {
660 #[allow(unused_imports)]
661 use super::*;
662
663 /// The type of destination.
664 #[derive(Clone, Debug, PartialEq)]
665 #[non_exhaustive]
666 pub enum DestinationType {
667 /// The Cloud Storage bucket destination.
668 Bucket(std::boxed::Box<crate::model::BucketDestination>),
669 }
670}
671
672/// A Cloud Storage bucket destination.
673#[derive(Clone, Default, PartialEq)]
674#[non_exhaustive]
675pub struct BucketDestination {
676 /// Required. The URI of the Cloud Storage bucket.
677 pub bucket_uri: std::string::String,
678
679 /// Optional. The format of the framework audit.
680 pub framework_audit_format: crate::model::bucket_destination::Format,
681
682 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
683}
684
685impl BucketDestination {
686 pub fn new() -> Self {
687 std::default::Default::default()
688 }
689
690 /// Sets the value of [bucket_uri][crate::model::BucketDestination::bucket_uri].
691 ///
692 /// # Example
693 /// ```ignore,no_run
694 /// # use google_cloud_cloudsecuritycompliance_v1::model::BucketDestination;
695 /// let x = BucketDestination::new().set_bucket_uri("example");
696 /// ```
697 pub fn set_bucket_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
698 self.bucket_uri = v.into();
699 self
700 }
701
702 /// Sets the value of [framework_audit_format][crate::model::BucketDestination::framework_audit_format].
703 ///
704 /// # Example
705 /// ```ignore,no_run
706 /// # use google_cloud_cloudsecuritycompliance_v1::model::BucketDestination;
707 /// use google_cloud_cloudsecuritycompliance_v1::model::bucket_destination::Format;
708 /// let x0 = BucketDestination::new().set_framework_audit_format(Format::Odf);
709 /// ```
710 pub fn set_framework_audit_format<
711 T: std::convert::Into<crate::model::bucket_destination::Format>,
712 >(
713 mut self,
714 v: T,
715 ) -> Self {
716 self.framework_audit_format = v.into();
717 self
718 }
719}
720
721impl wkt::message::Message for BucketDestination {
722 fn typename() -> &'static str {
723 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.BucketDestination"
724 }
725}
726
727/// Defines additional types related to [BucketDestination].
728pub mod bucket_destination {
729 #[allow(unused_imports)]
730 use super::*;
731
732 /// The set of options for the framework audit format.
733 ///
734 /// # Working with unknown values
735 ///
736 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
737 /// additional enum variants at any time. Adding new variants is not considered
738 /// a breaking change. Applications should write their code in anticipation of:
739 ///
740 /// - New values appearing in future releases of the client library, **and**
741 /// - New values received dynamically, without application changes.
742 ///
743 /// Please consult the [Working with enums] section in the user guide for some
744 /// guidelines.
745 ///
746 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
747 #[derive(Clone, Debug, PartialEq)]
748 #[non_exhaustive]
749 pub enum Format {
750 /// Default value. This value is unused.
751 Unspecified,
752 /// The format for the framework audit report is Open Document.
753 Odf,
754 /// If set, the enum was initialized with an unknown value.
755 ///
756 /// Applications can examine the value using [Format::value] or
757 /// [Format::name].
758 UnknownValue(format::UnknownValue),
759 }
760
761 #[doc(hidden)]
762 pub mod format {
763 #[allow(unused_imports)]
764 use super::*;
765 #[derive(Clone, Debug, PartialEq)]
766 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
767 }
768
769 impl Format {
770 /// Gets the enum value.
771 ///
772 /// Returns `None` if the enum contains an unknown value deserialized from
773 /// the string representation of enums.
774 pub fn value(&self) -> std::option::Option<i32> {
775 match self {
776 Self::Unspecified => std::option::Option::Some(0),
777 Self::Odf => std::option::Option::Some(1),
778 Self::UnknownValue(u) => u.0.value(),
779 }
780 }
781
782 /// Gets the enum value as a string.
783 ///
784 /// Returns `None` if the enum contains an unknown value deserialized from
785 /// the integer representation of enums.
786 pub fn name(&self) -> std::option::Option<&str> {
787 match self {
788 Self::Unspecified => std::option::Option::Some("FORMAT_UNSPECIFIED"),
789 Self::Odf => std::option::Option::Some("ODF"),
790 Self::UnknownValue(u) => u.0.name(),
791 }
792 }
793 }
794
795 impl std::default::Default for Format {
796 fn default() -> Self {
797 use std::convert::From;
798 Self::from(0)
799 }
800 }
801
802 impl std::fmt::Display for Format {
803 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
804 wkt::internal::display_enum(f, self.name(), self.value())
805 }
806 }
807
808 impl std::convert::From<i32> for Format {
809 fn from(value: i32) -> Self {
810 match value {
811 0 => Self::Unspecified,
812 1 => Self::Odf,
813 _ => Self::UnknownValue(format::UnknownValue(
814 wkt::internal::UnknownEnumValue::Integer(value),
815 )),
816 }
817 }
818 }
819
820 impl std::convert::From<&str> for Format {
821 fn from(value: &str) -> Self {
822 use std::string::ToString;
823 match value {
824 "FORMAT_UNSPECIFIED" => Self::Unspecified,
825 "ODF" => Self::Odf,
826 _ => Self::UnknownValue(format::UnknownValue(
827 wkt::internal::UnknownEnumValue::String(value.to_string()),
828 )),
829 }
830 }
831 }
832
833 impl serde::ser::Serialize for Format {
834 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
835 where
836 S: serde::Serializer,
837 {
838 match self {
839 Self::Unspecified => serializer.serialize_i32(0),
840 Self::Odf => serializer.serialize_i32(1),
841 Self::UnknownValue(u) => u.0.serialize(serializer),
842 }
843 }
844 }
845
846 impl<'de> serde::de::Deserialize<'de> for Format {
847 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
848 where
849 D: serde::Deserializer<'de>,
850 {
851 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Format>::new(
852 ".google.cloud.cloudsecuritycompliance.v1.BucketDestination.Format",
853 ))
854 }
855 }
856}
857
858/// A framework audit.
859#[derive(Clone, Default, PartialEq)]
860#[non_exhaustive]
861pub struct FrameworkAudit {
862 /// Output only. Identifier. The name of the framework audit.
863 pub name: std::string::String,
864
865 /// Output only. The ID of the framework audit.
866 pub framework_audit_id: std::string::String,
867
868 /// Output only. The compliance framework used for the audit.
869 pub compliance_framework: std::string::String,
870
871 /// Output only. The scope of the audit.
872 pub scope: std::string::String,
873
874 /// Required. The destination for the audit reports.
875 pub framework_audit_destination: std::option::Option<crate::model::FrameworkAuditDestination>,
876
877 /// Output only. The time that the audit started.
878 pub start_time: std::option::Option<wkt::Timestamp>,
879
880 /// Output only. The time that the audit finished.
881 pub finish_time: std::option::Option<wkt::Timestamp>,
882
883 /// Output only. The overall compliance state of the audit.
884 pub compliance_state: crate::model::ComplianceState,
885
886 /// Output only. The summary of the report.
887 pub report_summary: std::option::Option<crate::model::ReportSummary>,
888
889 /// Optional. The details for the cloud control groups within this audit.
890 pub cloud_control_group_audit_details:
891 std::vec::Vec<crate::model::CloudControlGroupAuditDetails>,
892
893 /// Optional. The details for the cloud controls within this audit.
894 pub cloud_control_audit_details: std::vec::Vec<crate::model::CloudControlAuditDetails>,
895
896 /// Output only. The ID of the long-running operation.
897 pub operation_id: std::string::String,
898
899 /// Output only. The framework audit state of the audit.
900 pub state: crate::model::framework_audit::State,
901
902 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
903}
904
905impl FrameworkAudit {
906 pub fn new() -> Self {
907 std::default::Default::default()
908 }
909
910 /// Sets the value of [name][crate::model::FrameworkAudit::name].
911 ///
912 /// # Example
913 /// ```ignore,no_run
914 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
915 /// let x = FrameworkAudit::new().set_name("example");
916 /// ```
917 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
918 self.name = v.into();
919 self
920 }
921
922 /// Sets the value of [framework_audit_id][crate::model::FrameworkAudit::framework_audit_id].
923 ///
924 /// # Example
925 /// ```ignore,no_run
926 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
927 /// let x = FrameworkAudit::new().set_framework_audit_id("example");
928 /// ```
929 pub fn set_framework_audit_id<T: std::convert::Into<std::string::String>>(
930 mut self,
931 v: T,
932 ) -> Self {
933 self.framework_audit_id = v.into();
934 self
935 }
936
937 /// Sets the value of [compliance_framework][crate::model::FrameworkAudit::compliance_framework].
938 ///
939 /// # Example
940 /// ```ignore,no_run
941 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
942 /// let x = FrameworkAudit::new().set_compliance_framework("example");
943 /// ```
944 pub fn set_compliance_framework<T: std::convert::Into<std::string::String>>(
945 mut self,
946 v: T,
947 ) -> Self {
948 self.compliance_framework = v.into();
949 self
950 }
951
952 /// Sets the value of [scope][crate::model::FrameworkAudit::scope].
953 ///
954 /// # Example
955 /// ```ignore,no_run
956 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
957 /// let x = FrameworkAudit::new().set_scope("example");
958 /// ```
959 pub fn set_scope<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
960 self.scope = v.into();
961 self
962 }
963
964 /// Sets the value of [framework_audit_destination][crate::model::FrameworkAudit::framework_audit_destination].
965 ///
966 /// # Example
967 /// ```ignore,no_run
968 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
969 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAuditDestination;
970 /// let x = FrameworkAudit::new().set_framework_audit_destination(FrameworkAuditDestination::default()/* use setters */);
971 /// ```
972 pub fn set_framework_audit_destination<T>(mut self, v: T) -> Self
973 where
974 T: std::convert::Into<crate::model::FrameworkAuditDestination>,
975 {
976 self.framework_audit_destination = std::option::Option::Some(v.into());
977 self
978 }
979
980 /// Sets or clears the value of [framework_audit_destination][crate::model::FrameworkAudit::framework_audit_destination].
981 ///
982 /// # Example
983 /// ```ignore,no_run
984 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
985 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAuditDestination;
986 /// let x = FrameworkAudit::new().set_or_clear_framework_audit_destination(Some(FrameworkAuditDestination::default()/* use setters */));
987 /// let x = FrameworkAudit::new().set_or_clear_framework_audit_destination(None::<FrameworkAuditDestination>);
988 /// ```
989 pub fn set_or_clear_framework_audit_destination<T>(mut self, v: std::option::Option<T>) -> Self
990 where
991 T: std::convert::Into<crate::model::FrameworkAuditDestination>,
992 {
993 self.framework_audit_destination = v.map(|x| x.into());
994 self
995 }
996
997 /// Sets the value of [start_time][crate::model::FrameworkAudit::start_time].
998 ///
999 /// # Example
1000 /// ```ignore,no_run
1001 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1002 /// use wkt::Timestamp;
1003 /// let x = FrameworkAudit::new().set_start_time(Timestamp::default()/* use setters */);
1004 /// ```
1005 pub fn set_start_time<T>(mut self, v: T) -> Self
1006 where
1007 T: std::convert::Into<wkt::Timestamp>,
1008 {
1009 self.start_time = std::option::Option::Some(v.into());
1010 self
1011 }
1012
1013 /// Sets or clears the value of [start_time][crate::model::FrameworkAudit::start_time].
1014 ///
1015 /// # Example
1016 /// ```ignore,no_run
1017 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1018 /// use wkt::Timestamp;
1019 /// let x = FrameworkAudit::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
1020 /// let x = FrameworkAudit::new().set_or_clear_start_time(None::<Timestamp>);
1021 /// ```
1022 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
1023 where
1024 T: std::convert::Into<wkt::Timestamp>,
1025 {
1026 self.start_time = v.map(|x| x.into());
1027 self
1028 }
1029
1030 /// Sets the value of [finish_time][crate::model::FrameworkAudit::finish_time].
1031 ///
1032 /// # Example
1033 /// ```ignore,no_run
1034 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1035 /// use wkt::Timestamp;
1036 /// let x = FrameworkAudit::new().set_finish_time(Timestamp::default()/* use setters */);
1037 /// ```
1038 pub fn set_finish_time<T>(mut self, v: T) -> Self
1039 where
1040 T: std::convert::Into<wkt::Timestamp>,
1041 {
1042 self.finish_time = std::option::Option::Some(v.into());
1043 self
1044 }
1045
1046 /// Sets or clears the value of [finish_time][crate::model::FrameworkAudit::finish_time].
1047 ///
1048 /// # Example
1049 /// ```ignore,no_run
1050 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1051 /// use wkt::Timestamp;
1052 /// let x = FrameworkAudit::new().set_or_clear_finish_time(Some(Timestamp::default()/* use setters */));
1053 /// let x = FrameworkAudit::new().set_or_clear_finish_time(None::<Timestamp>);
1054 /// ```
1055 pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
1056 where
1057 T: std::convert::Into<wkt::Timestamp>,
1058 {
1059 self.finish_time = v.map(|x| x.into());
1060 self
1061 }
1062
1063 /// Sets the value of [compliance_state][crate::model::FrameworkAudit::compliance_state].
1064 ///
1065 /// # Example
1066 /// ```ignore,no_run
1067 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1068 /// use google_cloud_cloudsecuritycompliance_v1::model::ComplianceState;
1069 /// let x0 = FrameworkAudit::new().set_compliance_state(ComplianceState::Compliant);
1070 /// let x1 = FrameworkAudit::new().set_compliance_state(ComplianceState::Violation);
1071 /// let x2 = FrameworkAudit::new().set_compliance_state(ComplianceState::ManualReviewNeeded);
1072 /// ```
1073 pub fn set_compliance_state<T: std::convert::Into<crate::model::ComplianceState>>(
1074 mut self,
1075 v: T,
1076 ) -> Self {
1077 self.compliance_state = v.into();
1078 self
1079 }
1080
1081 /// Sets the value of [report_summary][crate::model::FrameworkAudit::report_summary].
1082 ///
1083 /// # Example
1084 /// ```ignore,no_run
1085 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1086 /// use google_cloud_cloudsecuritycompliance_v1::model::ReportSummary;
1087 /// let x = FrameworkAudit::new().set_report_summary(ReportSummary::default()/* use setters */);
1088 /// ```
1089 pub fn set_report_summary<T>(mut self, v: T) -> Self
1090 where
1091 T: std::convert::Into<crate::model::ReportSummary>,
1092 {
1093 self.report_summary = std::option::Option::Some(v.into());
1094 self
1095 }
1096
1097 /// Sets or clears the value of [report_summary][crate::model::FrameworkAudit::report_summary].
1098 ///
1099 /// # Example
1100 /// ```ignore,no_run
1101 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1102 /// use google_cloud_cloudsecuritycompliance_v1::model::ReportSummary;
1103 /// let x = FrameworkAudit::new().set_or_clear_report_summary(Some(ReportSummary::default()/* use setters */));
1104 /// let x = FrameworkAudit::new().set_or_clear_report_summary(None::<ReportSummary>);
1105 /// ```
1106 pub fn set_or_clear_report_summary<T>(mut self, v: std::option::Option<T>) -> Self
1107 where
1108 T: std::convert::Into<crate::model::ReportSummary>,
1109 {
1110 self.report_summary = v.map(|x| x.into());
1111 self
1112 }
1113
1114 /// Sets the value of [cloud_control_group_audit_details][crate::model::FrameworkAudit::cloud_control_group_audit_details].
1115 ///
1116 /// # Example
1117 /// ```ignore,no_run
1118 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1119 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1120 /// let x = FrameworkAudit::new()
1121 /// .set_cloud_control_group_audit_details([
1122 /// CloudControlGroupAuditDetails::default()/* use setters */,
1123 /// CloudControlGroupAuditDetails::default()/* use (different) setters */,
1124 /// ]);
1125 /// ```
1126 pub fn set_cloud_control_group_audit_details<T, V>(mut self, v: T) -> Self
1127 where
1128 T: std::iter::IntoIterator<Item = V>,
1129 V: std::convert::Into<crate::model::CloudControlGroupAuditDetails>,
1130 {
1131 use std::iter::Iterator;
1132 self.cloud_control_group_audit_details = v.into_iter().map(|i| i.into()).collect();
1133 self
1134 }
1135
1136 /// Sets the value of [cloud_control_audit_details][crate::model::FrameworkAudit::cloud_control_audit_details].
1137 ///
1138 /// # Example
1139 /// ```ignore,no_run
1140 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1141 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAuditDetails;
1142 /// let x = FrameworkAudit::new()
1143 /// .set_cloud_control_audit_details([
1144 /// CloudControlAuditDetails::default()/* use setters */,
1145 /// CloudControlAuditDetails::default()/* use (different) setters */,
1146 /// ]);
1147 /// ```
1148 pub fn set_cloud_control_audit_details<T, V>(mut self, v: T) -> Self
1149 where
1150 T: std::iter::IntoIterator<Item = V>,
1151 V: std::convert::Into<crate::model::CloudControlAuditDetails>,
1152 {
1153 use std::iter::Iterator;
1154 self.cloud_control_audit_details = v.into_iter().map(|i| i.into()).collect();
1155 self
1156 }
1157
1158 /// Sets the value of [operation_id][crate::model::FrameworkAudit::operation_id].
1159 ///
1160 /// # Example
1161 /// ```ignore,no_run
1162 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1163 /// let x = FrameworkAudit::new().set_operation_id("example");
1164 /// ```
1165 pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1166 self.operation_id = v.into();
1167 self
1168 }
1169
1170 /// Sets the value of [state][crate::model::FrameworkAudit::state].
1171 ///
1172 /// # Example
1173 /// ```ignore,no_run
1174 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1175 /// use google_cloud_cloudsecuritycompliance_v1::model::framework_audit::State;
1176 /// let x0 = FrameworkAudit::new().set_state(State::Scheduled);
1177 /// let x1 = FrameworkAudit::new().set_state(State::Running);
1178 /// let x2 = FrameworkAudit::new().set_state(State::Uploading);
1179 /// ```
1180 pub fn set_state<T: std::convert::Into<crate::model::framework_audit::State>>(
1181 mut self,
1182 v: T,
1183 ) -> Self {
1184 self.state = v.into();
1185 self
1186 }
1187}
1188
1189impl wkt::message::Message for FrameworkAudit {
1190 fn typename() -> &'static str {
1191 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FrameworkAudit"
1192 }
1193}
1194
1195/// Defines additional types related to [FrameworkAudit].
1196pub mod framework_audit {
1197 #[allow(unused_imports)]
1198 use super::*;
1199
1200 /// The state of the framework audit.
1201 ///
1202 /// # Working with unknown values
1203 ///
1204 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1205 /// additional enum variants at any time. Adding new variants is not considered
1206 /// a breaking change. Applications should write their code in anticipation of:
1207 ///
1208 /// - New values appearing in future releases of the client library, **and**
1209 /// - New values received dynamically, without application changes.
1210 ///
1211 /// Please consult the [Working with enums] section in the user guide for some
1212 /// guidelines.
1213 ///
1214 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1215 #[derive(Clone, Debug, PartialEq)]
1216 #[non_exhaustive]
1217 pub enum State {
1218 /// Default value. This value is unused.
1219 Unspecified,
1220 /// The audit is scheduled.
1221 Scheduled,
1222 /// The audit is running.
1223 Running,
1224 /// The audit results are being uploaded.
1225 Uploading,
1226 /// The audit failed.
1227 Failed,
1228 /// The audit completed successfully.
1229 Succeeded,
1230 /// If set, the enum was initialized with an unknown value.
1231 ///
1232 /// Applications can examine the value using [State::value] or
1233 /// [State::name].
1234 UnknownValue(state::UnknownValue),
1235 }
1236
1237 #[doc(hidden)]
1238 pub mod state {
1239 #[allow(unused_imports)]
1240 use super::*;
1241 #[derive(Clone, Debug, PartialEq)]
1242 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1243 }
1244
1245 impl State {
1246 /// Gets the enum value.
1247 ///
1248 /// Returns `None` if the enum contains an unknown value deserialized from
1249 /// the string representation of enums.
1250 pub fn value(&self) -> std::option::Option<i32> {
1251 match self {
1252 Self::Unspecified => std::option::Option::Some(0),
1253 Self::Scheduled => std::option::Option::Some(1),
1254 Self::Running => std::option::Option::Some(2),
1255 Self::Uploading => std::option::Option::Some(3),
1256 Self::Failed => std::option::Option::Some(4),
1257 Self::Succeeded => std::option::Option::Some(5),
1258 Self::UnknownValue(u) => u.0.value(),
1259 }
1260 }
1261
1262 /// Gets the enum value as a string.
1263 ///
1264 /// Returns `None` if the enum contains an unknown value deserialized from
1265 /// the integer representation of enums.
1266 pub fn name(&self) -> std::option::Option<&str> {
1267 match self {
1268 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1269 Self::Scheduled => std::option::Option::Some("SCHEDULED"),
1270 Self::Running => std::option::Option::Some("RUNNING"),
1271 Self::Uploading => std::option::Option::Some("UPLOADING"),
1272 Self::Failed => std::option::Option::Some("FAILED"),
1273 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
1274 Self::UnknownValue(u) => u.0.name(),
1275 }
1276 }
1277 }
1278
1279 impl std::default::Default for State {
1280 fn default() -> Self {
1281 use std::convert::From;
1282 Self::from(0)
1283 }
1284 }
1285
1286 impl std::fmt::Display for State {
1287 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1288 wkt::internal::display_enum(f, self.name(), self.value())
1289 }
1290 }
1291
1292 impl std::convert::From<i32> for State {
1293 fn from(value: i32) -> Self {
1294 match value {
1295 0 => Self::Unspecified,
1296 1 => Self::Scheduled,
1297 2 => Self::Running,
1298 3 => Self::Uploading,
1299 4 => Self::Failed,
1300 5 => Self::Succeeded,
1301 _ => Self::UnknownValue(state::UnknownValue(
1302 wkt::internal::UnknownEnumValue::Integer(value),
1303 )),
1304 }
1305 }
1306 }
1307
1308 impl std::convert::From<&str> for State {
1309 fn from(value: &str) -> Self {
1310 use std::string::ToString;
1311 match value {
1312 "STATE_UNSPECIFIED" => Self::Unspecified,
1313 "SCHEDULED" => Self::Scheduled,
1314 "RUNNING" => Self::Running,
1315 "UPLOADING" => Self::Uploading,
1316 "FAILED" => Self::Failed,
1317 "SUCCEEDED" => Self::Succeeded,
1318 _ => Self::UnknownValue(state::UnknownValue(
1319 wkt::internal::UnknownEnumValue::String(value.to_string()),
1320 )),
1321 }
1322 }
1323 }
1324
1325 impl serde::ser::Serialize for State {
1326 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1327 where
1328 S: serde::Serializer,
1329 {
1330 match self {
1331 Self::Unspecified => serializer.serialize_i32(0),
1332 Self::Scheduled => serializer.serialize_i32(1),
1333 Self::Running => serializer.serialize_i32(2),
1334 Self::Uploading => serializer.serialize_i32(3),
1335 Self::Failed => serializer.serialize_i32(4),
1336 Self::Succeeded => serializer.serialize_i32(5),
1337 Self::UnknownValue(u) => u.0.serialize(serializer),
1338 }
1339 }
1340 }
1341
1342 impl<'de> serde::de::Deserialize<'de> for State {
1343 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1344 where
1345 D: serde::Deserializer<'de>,
1346 {
1347 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1348 ".google.cloud.cloudsecuritycompliance.v1.FrameworkAudit.State",
1349 ))
1350 }
1351 }
1352}
1353
1354/// The request message for [ListFrameworkAudits][].
1355#[derive(Clone, Default, PartialEq)]
1356#[non_exhaustive]
1357pub struct ListFrameworkAuditsRequest {
1358 /// Required. The parent resource where the framework audits are listed.
1359 ///
1360 /// Supported formats are the following:
1361 ///
1362 /// * `organizations/{organization_id}/locations/{location}`
1363 /// * `folders/{folder_id}/locations/{location}`
1364 /// * `projects/{project_id}/locations/{location}`
1365 pub parent: std::string::String,
1366
1367 /// Optional. The maximum number of framework audits to return. The service
1368 /// might return fewer audits than this value. If unspecified, a maximum of 10
1369 /// framework audits are returned. The maximum value is 50; values above 50 are
1370 /// limited to 50.
1371 pub page_size: i32,
1372
1373 /// Optional. The `next_page_token` value that's returned from a previous list
1374 /// request, if any.
1375 pub page_token: std::string::String,
1376
1377 /// Optional. The filters to apply to the framework audits.
1378 /// Supported filters are `compliance_framework`, `compliance_state`,
1379 /// `create_time,` and `framework_audit_name`. If the filter is invalid, an
1380 /// invalid argument error is returned.
1381 /// For syntax details, see [AIP-160][<https://google.aip.dev/160>].
1382 pub filter: std::string::String,
1383
1384 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1385}
1386
1387impl ListFrameworkAuditsRequest {
1388 pub fn new() -> Self {
1389 std::default::Default::default()
1390 }
1391
1392 /// Sets the value of [parent][crate::model::ListFrameworkAuditsRequest::parent].
1393 ///
1394 /// # Example
1395 /// ```ignore,no_run
1396 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkAuditsRequest;
1397 /// let x = ListFrameworkAuditsRequest::new().set_parent("example");
1398 /// ```
1399 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1400 self.parent = v.into();
1401 self
1402 }
1403
1404 /// Sets the value of [page_size][crate::model::ListFrameworkAuditsRequest::page_size].
1405 ///
1406 /// # Example
1407 /// ```ignore,no_run
1408 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkAuditsRequest;
1409 /// let x = ListFrameworkAuditsRequest::new().set_page_size(42);
1410 /// ```
1411 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1412 self.page_size = v.into();
1413 self
1414 }
1415
1416 /// Sets the value of [page_token][crate::model::ListFrameworkAuditsRequest::page_token].
1417 ///
1418 /// # Example
1419 /// ```ignore,no_run
1420 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkAuditsRequest;
1421 /// let x = ListFrameworkAuditsRequest::new().set_page_token("example");
1422 /// ```
1423 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1424 self.page_token = v.into();
1425 self
1426 }
1427
1428 /// Sets the value of [filter][crate::model::ListFrameworkAuditsRequest::filter].
1429 ///
1430 /// # Example
1431 /// ```ignore,no_run
1432 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkAuditsRequest;
1433 /// let x = ListFrameworkAuditsRequest::new().set_filter("example");
1434 /// ```
1435 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1436 self.filter = v.into();
1437 self
1438 }
1439}
1440
1441impl wkt::message::Message for ListFrameworkAuditsRequest {
1442 fn typename() -> &'static str {
1443 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFrameworkAuditsRequest"
1444 }
1445}
1446
1447/// The response message for [ListFrameworkAudits][].
1448#[derive(Clone, Default, PartialEq)]
1449#[non_exhaustive]
1450pub struct ListFrameworkAuditsResponse {
1451 /// The framework audits.
1452 pub framework_audits: std::vec::Vec<crate::model::FrameworkAudit>,
1453
1454 /// A token, which you can send as the `page_token` to retrieve the next page.
1455 /// If this field is omitted, there are no subsequent pages.
1456 pub next_page_token: std::string::String,
1457
1458 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1459}
1460
1461impl ListFrameworkAuditsResponse {
1462 pub fn new() -> Self {
1463 std::default::Default::default()
1464 }
1465
1466 /// Sets the value of [framework_audits][crate::model::ListFrameworkAuditsResponse::framework_audits].
1467 ///
1468 /// # Example
1469 /// ```ignore,no_run
1470 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkAuditsResponse;
1471 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1472 /// let x = ListFrameworkAuditsResponse::new()
1473 /// .set_framework_audits([
1474 /// FrameworkAudit::default()/* use setters */,
1475 /// FrameworkAudit::default()/* use (different) setters */,
1476 /// ]);
1477 /// ```
1478 pub fn set_framework_audits<T, V>(mut self, v: T) -> Self
1479 where
1480 T: std::iter::IntoIterator<Item = V>,
1481 V: std::convert::Into<crate::model::FrameworkAudit>,
1482 {
1483 use std::iter::Iterator;
1484 self.framework_audits = v.into_iter().map(|i| i.into()).collect();
1485 self
1486 }
1487
1488 /// Sets the value of [next_page_token][crate::model::ListFrameworkAuditsResponse::next_page_token].
1489 ///
1490 /// # Example
1491 /// ```ignore,no_run
1492 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkAuditsResponse;
1493 /// let x = ListFrameworkAuditsResponse::new().set_next_page_token("example");
1494 /// ```
1495 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1496 self.next_page_token = v.into();
1497 self
1498 }
1499}
1500
1501impl wkt::message::Message for ListFrameworkAuditsResponse {
1502 fn typename() -> &'static str {
1503 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFrameworkAuditsResponse"
1504 }
1505}
1506
1507#[doc(hidden)]
1508impl gax::paginator::internal::PageableResponse for ListFrameworkAuditsResponse {
1509 type PageItem = crate::model::FrameworkAudit;
1510
1511 fn items(self) -> std::vec::Vec<Self::PageItem> {
1512 self.framework_audits
1513 }
1514
1515 fn next_page_token(&self) -> std::string::String {
1516 use std::clone::Clone;
1517 self.next_page_token.clone()
1518 }
1519}
1520
1521/// The request message for [GetFrameworkAudit][].
1522#[derive(Clone, Default, PartialEq)]
1523#[non_exhaustive]
1524pub struct GetFrameworkAuditRequest {
1525 /// Required. The name of the framework audit to retrieve.
1526 ///
1527 /// Supported formats are the following:
1528 ///
1529 /// * `organizations/{organization_id}/locations/{location}/frameworkAudits/{frameworkAuditName}`
1530 /// * `folders/{folder_id}/locations/{location}/frameworkAudits/{frameworkAuditName}`
1531 /// * `projects/{project_id}/locations/{location}/frameworkAudits/{frameworkAuditName}`
1532 pub name: std::string::String,
1533
1534 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1535}
1536
1537impl GetFrameworkAuditRequest {
1538 pub fn new() -> Self {
1539 std::default::Default::default()
1540 }
1541
1542 /// Sets the value of [name][crate::model::GetFrameworkAuditRequest::name].
1543 ///
1544 /// # Example
1545 /// ```ignore,no_run
1546 /// # use google_cloud_cloudsecuritycompliance_v1::model::GetFrameworkAuditRequest;
1547 /// let x = GetFrameworkAuditRequest::new().set_name("example");
1548 /// ```
1549 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1550 self.name = v.into();
1551 self
1552 }
1553}
1554
1555impl wkt::message::Message for GetFrameworkAuditRequest {
1556 fn typename() -> &'static str {
1557 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.GetFrameworkAuditRequest"
1558 }
1559}
1560
1561/// The details for a cloud control group.
1562#[derive(Clone, Default, PartialEq)]
1563#[non_exhaustive]
1564pub struct CloudControlGroupAuditDetails {
1565 /// Output only. The ID of the cloud control group.
1566 pub cloud_control_group_id: std::string::String,
1567
1568 /// Output only. The display name of the cloud control group.
1569 pub display_name: std::string::String,
1570
1571 /// Output only. The description of the cloud control group.
1572 pub description: std::string::String,
1573
1574 /// Output only. The responsibility type.
1575 pub responsibility_type: std::string::String,
1576
1577 /// Output only. The description of Google's responsibility.
1578 pub google_responsibility_description: std::string::String,
1579
1580 /// Output only. The implementation of Google's responsibility.
1581 pub google_responsibility_implementation: std::string::String,
1582
1583 /// Output only. The description of your responsibility.
1584 pub customer_responsibility_description: std::string::String,
1585
1586 /// Output only. The implementation of your responsibility.
1587 pub customer_responsibility_implementation: std::string::String,
1588
1589 /// Output only. The compliance state of the control group.
1590 pub compliance_state: crate::model::ComplianceState,
1591
1592 /// Output only. The ID of the regulatory control.
1593 pub control_id: std::string::String,
1594
1595 /// Output only. The control family.
1596 pub control_family: std::option::Option<crate::model::ControlFamily>,
1597
1598 /// Output only. The details for the cloud controls within this group.
1599 pub cloud_control_details: std::vec::Vec<crate::model::CloudControlAuditDetails>,
1600
1601 /// Output only. The summary of the report.
1602 pub report_summary: std::option::Option<crate::model::ReportSummary>,
1603
1604 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1605}
1606
1607impl CloudControlGroupAuditDetails {
1608 pub fn new() -> Self {
1609 std::default::Default::default()
1610 }
1611
1612 /// Sets the value of [cloud_control_group_id][crate::model::CloudControlGroupAuditDetails::cloud_control_group_id].
1613 ///
1614 /// # Example
1615 /// ```ignore,no_run
1616 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1617 /// let x = CloudControlGroupAuditDetails::new().set_cloud_control_group_id("example");
1618 /// ```
1619 pub fn set_cloud_control_group_id<T: std::convert::Into<std::string::String>>(
1620 mut self,
1621 v: T,
1622 ) -> Self {
1623 self.cloud_control_group_id = v.into();
1624 self
1625 }
1626
1627 /// Sets the value of [display_name][crate::model::CloudControlGroupAuditDetails::display_name].
1628 ///
1629 /// # Example
1630 /// ```ignore,no_run
1631 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1632 /// let x = CloudControlGroupAuditDetails::new().set_display_name("example");
1633 /// ```
1634 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1635 self.display_name = v.into();
1636 self
1637 }
1638
1639 /// Sets the value of [description][crate::model::CloudControlGroupAuditDetails::description].
1640 ///
1641 /// # Example
1642 /// ```ignore,no_run
1643 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1644 /// let x = CloudControlGroupAuditDetails::new().set_description("example");
1645 /// ```
1646 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1647 self.description = v.into();
1648 self
1649 }
1650
1651 /// Sets the value of [responsibility_type][crate::model::CloudControlGroupAuditDetails::responsibility_type].
1652 ///
1653 /// # Example
1654 /// ```ignore,no_run
1655 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1656 /// let x = CloudControlGroupAuditDetails::new().set_responsibility_type("example");
1657 /// ```
1658 pub fn set_responsibility_type<T: std::convert::Into<std::string::String>>(
1659 mut self,
1660 v: T,
1661 ) -> Self {
1662 self.responsibility_type = v.into();
1663 self
1664 }
1665
1666 /// Sets the value of [google_responsibility_description][crate::model::CloudControlGroupAuditDetails::google_responsibility_description].
1667 ///
1668 /// # Example
1669 /// ```ignore,no_run
1670 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1671 /// let x = CloudControlGroupAuditDetails::new().set_google_responsibility_description("example");
1672 /// ```
1673 pub fn set_google_responsibility_description<T: std::convert::Into<std::string::String>>(
1674 mut self,
1675 v: T,
1676 ) -> Self {
1677 self.google_responsibility_description = v.into();
1678 self
1679 }
1680
1681 /// Sets the value of [google_responsibility_implementation][crate::model::CloudControlGroupAuditDetails::google_responsibility_implementation].
1682 ///
1683 /// # Example
1684 /// ```ignore,no_run
1685 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1686 /// let x = CloudControlGroupAuditDetails::new().set_google_responsibility_implementation("example");
1687 /// ```
1688 pub fn set_google_responsibility_implementation<T: std::convert::Into<std::string::String>>(
1689 mut self,
1690 v: T,
1691 ) -> Self {
1692 self.google_responsibility_implementation = v.into();
1693 self
1694 }
1695
1696 /// Sets the value of [customer_responsibility_description][crate::model::CloudControlGroupAuditDetails::customer_responsibility_description].
1697 ///
1698 /// # Example
1699 /// ```ignore,no_run
1700 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1701 /// let x = CloudControlGroupAuditDetails::new().set_customer_responsibility_description("example");
1702 /// ```
1703 pub fn set_customer_responsibility_description<T: std::convert::Into<std::string::String>>(
1704 mut self,
1705 v: T,
1706 ) -> Self {
1707 self.customer_responsibility_description = v.into();
1708 self
1709 }
1710
1711 /// Sets the value of [customer_responsibility_implementation][crate::model::CloudControlGroupAuditDetails::customer_responsibility_implementation].
1712 ///
1713 /// # Example
1714 /// ```ignore,no_run
1715 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1716 /// let x = CloudControlGroupAuditDetails::new().set_customer_responsibility_implementation("example");
1717 /// ```
1718 pub fn set_customer_responsibility_implementation<
1719 T: std::convert::Into<std::string::String>,
1720 >(
1721 mut self,
1722 v: T,
1723 ) -> Self {
1724 self.customer_responsibility_implementation = v.into();
1725 self
1726 }
1727
1728 /// Sets the value of [compliance_state][crate::model::CloudControlGroupAuditDetails::compliance_state].
1729 ///
1730 /// # Example
1731 /// ```ignore,no_run
1732 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1733 /// use google_cloud_cloudsecuritycompliance_v1::model::ComplianceState;
1734 /// let x0 = CloudControlGroupAuditDetails::new().set_compliance_state(ComplianceState::Compliant);
1735 /// let x1 = CloudControlGroupAuditDetails::new().set_compliance_state(ComplianceState::Violation);
1736 /// let x2 = CloudControlGroupAuditDetails::new().set_compliance_state(ComplianceState::ManualReviewNeeded);
1737 /// ```
1738 pub fn set_compliance_state<T: std::convert::Into<crate::model::ComplianceState>>(
1739 mut self,
1740 v: T,
1741 ) -> Self {
1742 self.compliance_state = v.into();
1743 self
1744 }
1745
1746 /// Sets the value of [control_id][crate::model::CloudControlGroupAuditDetails::control_id].
1747 ///
1748 /// # Example
1749 /// ```ignore,no_run
1750 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1751 /// let x = CloudControlGroupAuditDetails::new().set_control_id("example");
1752 /// ```
1753 pub fn set_control_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1754 self.control_id = v.into();
1755 self
1756 }
1757
1758 /// Sets the value of [control_family][crate::model::CloudControlGroupAuditDetails::control_family].
1759 ///
1760 /// # Example
1761 /// ```ignore,no_run
1762 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1763 /// use google_cloud_cloudsecuritycompliance_v1::model::ControlFamily;
1764 /// let x = CloudControlGroupAuditDetails::new().set_control_family(ControlFamily::default()/* use setters */);
1765 /// ```
1766 pub fn set_control_family<T>(mut self, v: T) -> Self
1767 where
1768 T: std::convert::Into<crate::model::ControlFamily>,
1769 {
1770 self.control_family = std::option::Option::Some(v.into());
1771 self
1772 }
1773
1774 /// Sets or clears the value of [control_family][crate::model::CloudControlGroupAuditDetails::control_family].
1775 ///
1776 /// # Example
1777 /// ```ignore,no_run
1778 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1779 /// use google_cloud_cloudsecuritycompliance_v1::model::ControlFamily;
1780 /// let x = CloudControlGroupAuditDetails::new().set_or_clear_control_family(Some(ControlFamily::default()/* use setters */));
1781 /// let x = CloudControlGroupAuditDetails::new().set_or_clear_control_family(None::<ControlFamily>);
1782 /// ```
1783 pub fn set_or_clear_control_family<T>(mut self, v: std::option::Option<T>) -> Self
1784 where
1785 T: std::convert::Into<crate::model::ControlFamily>,
1786 {
1787 self.control_family = v.map(|x| x.into());
1788 self
1789 }
1790
1791 /// Sets the value of [cloud_control_details][crate::model::CloudControlGroupAuditDetails::cloud_control_details].
1792 ///
1793 /// # Example
1794 /// ```ignore,no_run
1795 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1796 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAuditDetails;
1797 /// let x = CloudControlGroupAuditDetails::new()
1798 /// .set_cloud_control_details([
1799 /// CloudControlAuditDetails::default()/* use setters */,
1800 /// CloudControlAuditDetails::default()/* use (different) setters */,
1801 /// ]);
1802 /// ```
1803 pub fn set_cloud_control_details<T, V>(mut self, v: T) -> Self
1804 where
1805 T: std::iter::IntoIterator<Item = V>,
1806 V: std::convert::Into<crate::model::CloudControlAuditDetails>,
1807 {
1808 use std::iter::Iterator;
1809 self.cloud_control_details = v.into_iter().map(|i| i.into()).collect();
1810 self
1811 }
1812
1813 /// Sets the value of [report_summary][crate::model::CloudControlGroupAuditDetails::report_summary].
1814 ///
1815 /// # Example
1816 /// ```ignore,no_run
1817 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1818 /// use google_cloud_cloudsecuritycompliance_v1::model::ReportSummary;
1819 /// let x = CloudControlGroupAuditDetails::new().set_report_summary(ReportSummary::default()/* use setters */);
1820 /// ```
1821 pub fn set_report_summary<T>(mut self, v: T) -> Self
1822 where
1823 T: std::convert::Into<crate::model::ReportSummary>,
1824 {
1825 self.report_summary = std::option::Option::Some(v.into());
1826 self
1827 }
1828
1829 /// Sets or clears the value of [report_summary][crate::model::CloudControlGroupAuditDetails::report_summary].
1830 ///
1831 /// # Example
1832 /// ```ignore,no_run
1833 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1834 /// use google_cloud_cloudsecuritycompliance_v1::model::ReportSummary;
1835 /// let x = CloudControlGroupAuditDetails::new().set_or_clear_report_summary(Some(ReportSummary::default()/* use setters */));
1836 /// let x = CloudControlGroupAuditDetails::new().set_or_clear_report_summary(None::<ReportSummary>);
1837 /// ```
1838 pub fn set_or_clear_report_summary<T>(mut self, v: std::option::Option<T>) -> Self
1839 where
1840 T: std::convert::Into<crate::model::ReportSummary>,
1841 {
1842 self.report_summary = v.map(|x| x.into());
1843 self
1844 }
1845}
1846
1847impl wkt::message::Message for CloudControlGroupAuditDetails {
1848 fn typename() -> &'static str {
1849 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControlGroupAuditDetails"
1850 }
1851}
1852
1853/// The details for a finding.
1854#[derive(Clone, Default, PartialEq)]
1855#[non_exhaustive]
1856pub struct FindingDetails {
1857 /// Output only. The name of the finding.
1858 pub name: std::string::String,
1859
1860 /// Output only. The compliance state of the finding.
1861 pub compliance_state: crate::model::ComplianceState,
1862
1863 /// Output only. The observation details for the finding.
1864 pub observation: std::option::Option<crate::model::ObservationDetails>,
1865
1866 /// Output only. The evidence details for the finding.
1867 pub evidence: std::option::Option<crate::model::EvidenceDetails>,
1868
1869 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1870}
1871
1872impl FindingDetails {
1873 pub fn new() -> Self {
1874 std::default::Default::default()
1875 }
1876
1877 /// Sets the value of [name][crate::model::FindingDetails::name].
1878 ///
1879 /// # Example
1880 /// ```ignore,no_run
1881 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingDetails;
1882 /// let x = FindingDetails::new().set_name("example");
1883 /// ```
1884 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1885 self.name = v.into();
1886 self
1887 }
1888
1889 /// Sets the value of [compliance_state][crate::model::FindingDetails::compliance_state].
1890 ///
1891 /// # Example
1892 /// ```ignore,no_run
1893 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingDetails;
1894 /// use google_cloud_cloudsecuritycompliance_v1::model::ComplianceState;
1895 /// let x0 = FindingDetails::new().set_compliance_state(ComplianceState::Compliant);
1896 /// let x1 = FindingDetails::new().set_compliance_state(ComplianceState::Violation);
1897 /// let x2 = FindingDetails::new().set_compliance_state(ComplianceState::ManualReviewNeeded);
1898 /// ```
1899 pub fn set_compliance_state<T: std::convert::Into<crate::model::ComplianceState>>(
1900 mut self,
1901 v: T,
1902 ) -> Self {
1903 self.compliance_state = v.into();
1904 self
1905 }
1906
1907 /// Sets the value of [observation][crate::model::FindingDetails::observation].
1908 ///
1909 /// # Example
1910 /// ```ignore,no_run
1911 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingDetails;
1912 /// use google_cloud_cloudsecuritycompliance_v1::model::ObservationDetails;
1913 /// let x = FindingDetails::new().set_observation(ObservationDetails::default()/* use setters */);
1914 /// ```
1915 pub fn set_observation<T>(mut self, v: T) -> Self
1916 where
1917 T: std::convert::Into<crate::model::ObservationDetails>,
1918 {
1919 self.observation = std::option::Option::Some(v.into());
1920 self
1921 }
1922
1923 /// Sets or clears the value of [observation][crate::model::FindingDetails::observation].
1924 ///
1925 /// # Example
1926 /// ```ignore,no_run
1927 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingDetails;
1928 /// use google_cloud_cloudsecuritycompliance_v1::model::ObservationDetails;
1929 /// let x = FindingDetails::new().set_or_clear_observation(Some(ObservationDetails::default()/* use setters */));
1930 /// let x = FindingDetails::new().set_or_clear_observation(None::<ObservationDetails>);
1931 /// ```
1932 pub fn set_or_clear_observation<T>(mut self, v: std::option::Option<T>) -> Self
1933 where
1934 T: std::convert::Into<crate::model::ObservationDetails>,
1935 {
1936 self.observation = v.map(|x| x.into());
1937 self
1938 }
1939
1940 /// Sets the value of [evidence][crate::model::FindingDetails::evidence].
1941 ///
1942 /// # Example
1943 /// ```ignore,no_run
1944 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingDetails;
1945 /// use google_cloud_cloudsecuritycompliance_v1::model::EvidenceDetails;
1946 /// let x = FindingDetails::new().set_evidence(EvidenceDetails::default()/* use setters */);
1947 /// ```
1948 pub fn set_evidence<T>(mut self, v: T) -> Self
1949 where
1950 T: std::convert::Into<crate::model::EvidenceDetails>,
1951 {
1952 self.evidence = std::option::Option::Some(v.into());
1953 self
1954 }
1955
1956 /// Sets or clears the value of [evidence][crate::model::FindingDetails::evidence].
1957 ///
1958 /// # Example
1959 /// ```ignore,no_run
1960 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingDetails;
1961 /// use google_cloud_cloudsecuritycompliance_v1::model::EvidenceDetails;
1962 /// let x = FindingDetails::new().set_or_clear_evidence(Some(EvidenceDetails::default()/* use setters */));
1963 /// let x = FindingDetails::new().set_or_clear_evidence(None::<EvidenceDetails>);
1964 /// ```
1965 pub fn set_or_clear_evidence<T>(mut self, v: std::option::Option<T>) -> Self
1966 where
1967 T: std::convert::Into<crate::model::EvidenceDetails>,
1968 {
1969 self.evidence = v.map(|x| x.into());
1970 self
1971 }
1972}
1973
1974impl wkt::message::Message for FindingDetails {
1975 fn typename() -> &'static str {
1976 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FindingDetails"
1977 }
1978}
1979
1980/// The observation details for a finding.
1981#[derive(Clone, Default, PartialEq)]
1982#[non_exhaustive]
1983pub struct ObservationDetails {
1984 /// Output only. The current value.
1985 pub current_value: std::string::String,
1986
1987 /// Optional. The expected value.
1988 pub expected_value: std::string::String,
1989
1990 /// Output only. Any guidance for the observation.
1991 pub guidance: std::string::String,
1992
1993 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1994}
1995
1996impl ObservationDetails {
1997 pub fn new() -> Self {
1998 std::default::Default::default()
1999 }
2000
2001 /// Sets the value of [current_value][crate::model::ObservationDetails::current_value].
2002 ///
2003 /// # Example
2004 /// ```ignore,no_run
2005 /// # use google_cloud_cloudsecuritycompliance_v1::model::ObservationDetails;
2006 /// let x = ObservationDetails::new().set_current_value("example");
2007 /// ```
2008 pub fn set_current_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2009 self.current_value = v.into();
2010 self
2011 }
2012
2013 /// Sets the value of [expected_value][crate::model::ObservationDetails::expected_value].
2014 ///
2015 /// # Example
2016 /// ```ignore,no_run
2017 /// # use google_cloud_cloudsecuritycompliance_v1::model::ObservationDetails;
2018 /// let x = ObservationDetails::new().set_expected_value("example");
2019 /// ```
2020 pub fn set_expected_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2021 self.expected_value = v.into();
2022 self
2023 }
2024
2025 /// Sets the value of [guidance][crate::model::ObservationDetails::guidance].
2026 ///
2027 /// # Example
2028 /// ```ignore,no_run
2029 /// # use google_cloud_cloudsecuritycompliance_v1::model::ObservationDetails;
2030 /// let x = ObservationDetails::new().set_guidance("example");
2031 /// ```
2032 pub fn set_guidance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2033 self.guidance = v.into();
2034 self
2035 }
2036}
2037
2038impl wkt::message::Message for ObservationDetails {
2039 fn typename() -> &'static str {
2040 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ObservationDetails"
2041 }
2042}
2043
2044/// The evidence details for a finding.
2045#[derive(Clone, Default, PartialEq)]
2046#[non_exhaustive]
2047pub struct EvidenceDetails {
2048 /// Output only. The resource identifier.
2049 pub resource: std::string::String,
2050
2051 /// Output only. The service identifier.
2052 pub service: std::string::String,
2053
2054 /// Output only. The path to the evidence.
2055 pub evidence_path: std::string::String,
2056
2057 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2058}
2059
2060impl EvidenceDetails {
2061 pub fn new() -> Self {
2062 std::default::Default::default()
2063 }
2064
2065 /// Sets the value of [resource][crate::model::EvidenceDetails::resource].
2066 ///
2067 /// # Example
2068 /// ```ignore,no_run
2069 /// # use google_cloud_cloudsecuritycompliance_v1::model::EvidenceDetails;
2070 /// let x = EvidenceDetails::new().set_resource("example");
2071 /// ```
2072 pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2073 self.resource = v.into();
2074 self
2075 }
2076
2077 /// Sets the value of [service][crate::model::EvidenceDetails::service].
2078 ///
2079 /// # Example
2080 /// ```ignore,no_run
2081 /// # use google_cloud_cloudsecuritycompliance_v1::model::EvidenceDetails;
2082 /// let x = EvidenceDetails::new().set_service("example");
2083 /// ```
2084 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2085 self.service = v.into();
2086 self
2087 }
2088
2089 /// Sets the value of [evidence_path][crate::model::EvidenceDetails::evidence_path].
2090 ///
2091 /// # Example
2092 /// ```ignore,no_run
2093 /// # use google_cloud_cloudsecuritycompliance_v1::model::EvidenceDetails;
2094 /// let x = EvidenceDetails::new().set_evidence_path("example");
2095 /// ```
2096 pub fn set_evidence_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2097 self.evidence_path = v.into();
2098 self
2099 }
2100}
2101
2102impl wkt::message::Message for EvidenceDetails {
2103 fn typename() -> &'static str {
2104 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.EvidenceDetails"
2105 }
2106}
2107
2108/// The details for a cloud control audit.
2109#[derive(Clone, Default, PartialEq)]
2110#[non_exhaustive]
2111pub struct CloudControlAuditDetails {
2112 /// Output only. The name of the cloud control.
2113 pub cloud_control: std::string::String,
2114
2115 /// Output only. The ID of the cloud control.
2116 pub cloud_control_id: std::string::String,
2117
2118 /// Output only. The description of the cloud control.
2119 pub cloud_control_description: std::string::String,
2120
2121 /// Output only. The overall status of the findings for the control.
2122 pub compliance_state: crate::model::ComplianceState,
2123
2124 /// Output only. The summary of the report.
2125 pub report_summary: std::option::Option<crate::model::ReportSummary>,
2126
2127 /// Output only. The findings for the control.
2128 pub findings: std::vec::Vec<crate::model::FindingDetails>,
2129
2130 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2131}
2132
2133impl CloudControlAuditDetails {
2134 pub fn new() -> Self {
2135 std::default::Default::default()
2136 }
2137
2138 /// Sets the value of [cloud_control][crate::model::CloudControlAuditDetails::cloud_control].
2139 ///
2140 /// # Example
2141 /// ```ignore,no_run
2142 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAuditDetails;
2143 /// let x = CloudControlAuditDetails::new().set_cloud_control("example");
2144 /// ```
2145 pub fn set_cloud_control<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2146 self.cloud_control = v.into();
2147 self
2148 }
2149
2150 /// Sets the value of [cloud_control_id][crate::model::CloudControlAuditDetails::cloud_control_id].
2151 ///
2152 /// # Example
2153 /// ```ignore,no_run
2154 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAuditDetails;
2155 /// let x = CloudControlAuditDetails::new().set_cloud_control_id("example");
2156 /// ```
2157 pub fn set_cloud_control_id<T: std::convert::Into<std::string::String>>(
2158 mut self,
2159 v: T,
2160 ) -> Self {
2161 self.cloud_control_id = v.into();
2162 self
2163 }
2164
2165 /// Sets the value of [cloud_control_description][crate::model::CloudControlAuditDetails::cloud_control_description].
2166 ///
2167 /// # Example
2168 /// ```ignore,no_run
2169 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAuditDetails;
2170 /// let x = CloudControlAuditDetails::new().set_cloud_control_description("example");
2171 /// ```
2172 pub fn set_cloud_control_description<T: std::convert::Into<std::string::String>>(
2173 mut self,
2174 v: T,
2175 ) -> Self {
2176 self.cloud_control_description = v.into();
2177 self
2178 }
2179
2180 /// Sets the value of [compliance_state][crate::model::CloudControlAuditDetails::compliance_state].
2181 ///
2182 /// # Example
2183 /// ```ignore,no_run
2184 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAuditDetails;
2185 /// use google_cloud_cloudsecuritycompliance_v1::model::ComplianceState;
2186 /// let x0 = CloudControlAuditDetails::new().set_compliance_state(ComplianceState::Compliant);
2187 /// let x1 = CloudControlAuditDetails::new().set_compliance_state(ComplianceState::Violation);
2188 /// let x2 = CloudControlAuditDetails::new().set_compliance_state(ComplianceState::ManualReviewNeeded);
2189 /// ```
2190 pub fn set_compliance_state<T: std::convert::Into<crate::model::ComplianceState>>(
2191 mut self,
2192 v: T,
2193 ) -> Self {
2194 self.compliance_state = v.into();
2195 self
2196 }
2197
2198 /// Sets the value of [report_summary][crate::model::CloudControlAuditDetails::report_summary].
2199 ///
2200 /// # Example
2201 /// ```ignore,no_run
2202 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAuditDetails;
2203 /// use google_cloud_cloudsecuritycompliance_v1::model::ReportSummary;
2204 /// let x = CloudControlAuditDetails::new().set_report_summary(ReportSummary::default()/* use setters */);
2205 /// ```
2206 pub fn set_report_summary<T>(mut self, v: T) -> Self
2207 where
2208 T: std::convert::Into<crate::model::ReportSummary>,
2209 {
2210 self.report_summary = std::option::Option::Some(v.into());
2211 self
2212 }
2213
2214 /// Sets or clears the value of [report_summary][crate::model::CloudControlAuditDetails::report_summary].
2215 ///
2216 /// # Example
2217 /// ```ignore,no_run
2218 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAuditDetails;
2219 /// use google_cloud_cloudsecuritycompliance_v1::model::ReportSummary;
2220 /// let x = CloudControlAuditDetails::new().set_or_clear_report_summary(Some(ReportSummary::default()/* use setters */));
2221 /// let x = CloudControlAuditDetails::new().set_or_clear_report_summary(None::<ReportSummary>);
2222 /// ```
2223 pub fn set_or_clear_report_summary<T>(mut self, v: std::option::Option<T>) -> Self
2224 where
2225 T: std::convert::Into<crate::model::ReportSummary>,
2226 {
2227 self.report_summary = v.map(|x| x.into());
2228 self
2229 }
2230
2231 /// Sets the value of [findings][crate::model::CloudControlAuditDetails::findings].
2232 ///
2233 /// # Example
2234 /// ```ignore,no_run
2235 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAuditDetails;
2236 /// use google_cloud_cloudsecuritycompliance_v1::model::FindingDetails;
2237 /// let x = CloudControlAuditDetails::new()
2238 /// .set_findings([
2239 /// FindingDetails::default()/* use setters */,
2240 /// FindingDetails::default()/* use (different) setters */,
2241 /// ]);
2242 /// ```
2243 pub fn set_findings<T, V>(mut self, v: T) -> Self
2244 where
2245 T: std::iter::IntoIterator<Item = V>,
2246 V: std::convert::Into<crate::model::FindingDetails>,
2247 {
2248 use std::iter::Iterator;
2249 self.findings = v.into_iter().map(|i| i.into()).collect();
2250 self
2251 }
2252}
2253
2254impl wkt::message::Message for CloudControlAuditDetails {
2255 fn typename() -> &'static str {
2256 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControlAuditDetails"
2257 }
2258}
2259
2260/// The request message for [UpdateCmEnrollment][].
2261#[derive(Clone, Default, PartialEq)]
2262#[non_exhaustive]
2263pub struct UpdateCmEnrollmentRequest {
2264 /// Required. The Compliance Manager enrollment to update.
2265 /// The `name` field is used to identify the settings that you want to update.
2266 pub cm_enrollment: std::option::Option<crate::model::CmEnrollment>,
2267
2268 /// Optional. The list of fields that you want to update.
2269 pub update_mask: std::option::Option<wkt::FieldMask>,
2270
2271 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2272}
2273
2274impl UpdateCmEnrollmentRequest {
2275 pub fn new() -> Self {
2276 std::default::Default::default()
2277 }
2278
2279 /// Sets the value of [cm_enrollment][crate::model::UpdateCmEnrollmentRequest::cm_enrollment].
2280 ///
2281 /// # Example
2282 /// ```ignore,no_run
2283 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateCmEnrollmentRequest;
2284 /// use google_cloud_cloudsecuritycompliance_v1::model::CmEnrollment;
2285 /// let x = UpdateCmEnrollmentRequest::new().set_cm_enrollment(CmEnrollment::default()/* use setters */);
2286 /// ```
2287 pub fn set_cm_enrollment<T>(mut self, v: T) -> Self
2288 where
2289 T: std::convert::Into<crate::model::CmEnrollment>,
2290 {
2291 self.cm_enrollment = std::option::Option::Some(v.into());
2292 self
2293 }
2294
2295 /// Sets or clears the value of [cm_enrollment][crate::model::UpdateCmEnrollmentRequest::cm_enrollment].
2296 ///
2297 /// # Example
2298 /// ```ignore,no_run
2299 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateCmEnrollmentRequest;
2300 /// use google_cloud_cloudsecuritycompliance_v1::model::CmEnrollment;
2301 /// let x = UpdateCmEnrollmentRequest::new().set_or_clear_cm_enrollment(Some(CmEnrollment::default()/* use setters */));
2302 /// let x = UpdateCmEnrollmentRequest::new().set_or_clear_cm_enrollment(None::<CmEnrollment>);
2303 /// ```
2304 pub fn set_or_clear_cm_enrollment<T>(mut self, v: std::option::Option<T>) -> Self
2305 where
2306 T: std::convert::Into<crate::model::CmEnrollment>,
2307 {
2308 self.cm_enrollment = v.map(|x| x.into());
2309 self
2310 }
2311
2312 /// Sets the value of [update_mask][crate::model::UpdateCmEnrollmentRequest::update_mask].
2313 ///
2314 /// # Example
2315 /// ```ignore,no_run
2316 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateCmEnrollmentRequest;
2317 /// use wkt::FieldMask;
2318 /// let x = UpdateCmEnrollmentRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2319 /// ```
2320 pub fn set_update_mask<T>(mut self, v: T) -> Self
2321 where
2322 T: std::convert::Into<wkt::FieldMask>,
2323 {
2324 self.update_mask = std::option::Option::Some(v.into());
2325 self
2326 }
2327
2328 /// Sets or clears the value of [update_mask][crate::model::UpdateCmEnrollmentRequest::update_mask].
2329 ///
2330 /// # Example
2331 /// ```ignore,no_run
2332 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateCmEnrollmentRequest;
2333 /// use wkt::FieldMask;
2334 /// let x = UpdateCmEnrollmentRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2335 /// let x = UpdateCmEnrollmentRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2336 /// ```
2337 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2338 where
2339 T: std::convert::Into<wkt::FieldMask>,
2340 {
2341 self.update_mask = v.map(|x| x.into());
2342 self
2343 }
2344}
2345
2346impl wkt::message::Message for UpdateCmEnrollmentRequest {
2347 fn typename() -> &'static str {
2348 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.UpdateCmEnrollmentRequest"
2349 }
2350}
2351
2352/// The request message for [CalculateEffectiveCmEnrollment][].
2353#[derive(Clone, Default, PartialEq)]
2354#[non_exhaustive]
2355pub struct CalculateEffectiveCmEnrollmentRequest {
2356 /// Required. The name of the Compliance Manager enrollment to calculate.
2357 ///
2358 /// Supported formats are the following:
2359 ///
2360 /// * `organizations/{organization_id}/locations/{location}/cmEnrollment`
2361 /// * `folders/{folder_id}/locations/{location}/cmEnrollment`
2362 /// * `projects/{project_id}/locations/{location}/cmEnrollment`
2363 pub name: std::string::String,
2364
2365 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2366}
2367
2368impl CalculateEffectiveCmEnrollmentRequest {
2369 pub fn new() -> Self {
2370 std::default::Default::default()
2371 }
2372
2373 /// Sets the value of [name][crate::model::CalculateEffectiveCmEnrollmentRequest::name].
2374 ///
2375 /// # Example
2376 /// ```ignore,no_run
2377 /// # use google_cloud_cloudsecuritycompliance_v1::model::CalculateEffectiveCmEnrollmentRequest;
2378 /// let x = CalculateEffectiveCmEnrollmentRequest::new().set_name("example");
2379 /// ```
2380 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2381 self.name = v.into();
2382 self
2383 }
2384}
2385
2386impl wkt::message::Message for CalculateEffectiveCmEnrollmentRequest {
2387 fn typename() -> &'static str {
2388 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CalculateEffectiveCmEnrollmentRequest"
2389 }
2390}
2391
2392/// The settings for Compliance Manager at a specific resource scope.=
2393#[derive(Clone, Default, PartialEq)]
2394#[non_exhaustive]
2395pub struct CmEnrollment {
2396 /// Identifier. The name of the Compliance Manager enrollment.
2397 ///
2398 /// Supported formats are the following:
2399 ///
2400 /// * `organizations/{organization_id}/locations/{location}/cmEnrollment`
2401 /// * `folders/{folder_id}/locations/{location}/cmEnrollment`
2402 /// * `projects/{project_id}/locations/{location}/cmEnrollment`
2403 pub name: std::string::String,
2404
2405 /// Optional. Whether the resource is enrolled in Compliance Manager.
2406 /// This setting is inherited by all descendants.
2407 pub enrolled: bool,
2408
2409 /// Optional. The audit configuration for Compliance Manager.
2410 /// If set at a scope, this configuration overrides any inherited audit
2411 /// configuration.
2412 pub audit_config: std::option::Option<crate::model::AuditConfig>,
2413
2414 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2415}
2416
2417impl CmEnrollment {
2418 pub fn new() -> Self {
2419 std::default::Default::default()
2420 }
2421
2422 /// Sets the value of [name][crate::model::CmEnrollment::name].
2423 ///
2424 /// # Example
2425 /// ```ignore,no_run
2426 /// # use google_cloud_cloudsecuritycompliance_v1::model::CmEnrollment;
2427 /// let x = CmEnrollment::new().set_name("example");
2428 /// ```
2429 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2430 self.name = v.into();
2431 self
2432 }
2433
2434 /// Sets the value of [enrolled][crate::model::CmEnrollment::enrolled].
2435 ///
2436 /// # Example
2437 /// ```ignore,no_run
2438 /// # use google_cloud_cloudsecuritycompliance_v1::model::CmEnrollment;
2439 /// let x = CmEnrollment::new().set_enrolled(true);
2440 /// ```
2441 pub fn set_enrolled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2442 self.enrolled = v.into();
2443 self
2444 }
2445
2446 /// Sets the value of [audit_config][crate::model::CmEnrollment::audit_config].
2447 ///
2448 /// # Example
2449 /// ```ignore,no_run
2450 /// # use google_cloud_cloudsecuritycompliance_v1::model::CmEnrollment;
2451 /// use google_cloud_cloudsecuritycompliance_v1::model::AuditConfig;
2452 /// let x = CmEnrollment::new().set_audit_config(AuditConfig::default()/* use setters */);
2453 /// ```
2454 pub fn set_audit_config<T>(mut self, v: T) -> Self
2455 where
2456 T: std::convert::Into<crate::model::AuditConfig>,
2457 {
2458 self.audit_config = std::option::Option::Some(v.into());
2459 self
2460 }
2461
2462 /// Sets or clears the value of [audit_config][crate::model::CmEnrollment::audit_config].
2463 ///
2464 /// # Example
2465 /// ```ignore,no_run
2466 /// # use google_cloud_cloudsecuritycompliance_v1::model::CmEnrollment;
2467 /// use google_cloud_cloudsecuritycompliance_v1::model::AuditConfig;
2468 /// let x = CmEnrollment::new().set_or_clear_audit_config(Some(AuditConfig::default()/* use setters */));
2469 /// let x = CmEnrollment::new().set_or_clear_audit_config(None::<AuditConfig>);
2470 /// ```
2471 pub fn set_or_clear_audit_config<T>(mut self, v: std::option::Option<T>) -> Self
2472 where
2473 T: std::convert::Into<crate::model::AuditConfig>,
2474 {
2475 self.audit_config = v.map(|x| x.into());
2476 self
2477 }
2478}
2479
2480impl wkt::message::Message for CmEnrollment {
2481 fn typename() -> &'static str {
2482 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CmEnrollment"
2483 }
2484}
2485
2486/// The response message for [CalculateEffectiveCmEnrollment][].
2487#[derive(Clone, Default, PartialEq)]
2488#[non_exhaustive]
2489pub struct CalculateEffectiveCmEnrollmentResponse {
2490 /// The effective Compliance Manager enrollment for the resource.
2491 pub cm_enrollment: std::option::Option<crate::model::CmEnrollment>,
2492
2493 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2494}
2495
2496impl CalculateEffectiveCmEnrollmentResponse {
2497 pub fn new() -> Self {
2498 std::default::Default::default()
2499 }
2500
2501 /// Sets the value of [cm_enrollment][crate::model::CalculateEffectiveCmEnrollmentResponse::cm_enrollment].
2502 ///
2503 /// # Example
2504 /// ```ignore,no_run
2505 /// # use google_cloud_cloudsecuritycompliance_v1::model::CalculateEffectiveCmEnrollmentResponse;
2506 /// use google_cloud_cloudsecuritycompliance_v1::model::CmEnrollment;
2507 /// let x = CalculateEffectiveCmEnrollmentResponse::new().set_cm_enrollment(CmEnrollment::default()/* use setters */);
2508 /// ```
2509 pub fn set_cm_enrollment<T>(mut self, v: T) -> Self
2510 where
2511 T: std::convert::Into<crate::model::CmEnrollment>,
2512 {
2513 self.cm_enrollment = std::option::Option::Some(v.into());
2514 self
2515 }
2516
2517 /// Sets or clears the value of [cm_enrollment][crate::model::CalculateEffectiveCmEnrollmentResponse::cm_enrollment].
2518 ///
2519 /// # Example
2520 /// ```ignore,no_run
2521 /// # use google_cloud_cloudsecuritycompliance_v1::model::CalculateEffectiveCmEnrollmentResponse;
2522 /// use google_cloud_cloudsecuritycompliance_v1::model::CmEnrollment;
2523 /// let x = CalculateEffectiveCmEnrollmentResponse::new().set_or_clear_cm_enrollment(Some(CmEnrollment::default()/* use setters */));
2524 /// let x = CalculateEffectiveCmEnrollmentResponse::new().set_or_clear_cm_enrollment(None::<CmEnrollment>);
2525 /// ```
2526 pub fn set_or_clear_cm_enrollment<T>(mut self, v: std::option::Option<T>) -> Self
2527 where
2528 T: std::convert::Into<crate::model::CmEnrollment>,
2529 {
2530 self.cm_enrollment = v.map(|x| x.into());
2531 self
2532 }
2533}
2534
2535impl wkt::message::Message for CalculateEffectiveCmEnrollmentResponse {
2536 fn typename() -> &'static str {
2537 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CalculateEffectiveCmEnrollmentResponse"
2538 }
2539}
2540
2541/// The audit configuration for Compliance Manager.
2542#[derive(Clone, Default, PartialEq)]
2543#[non_exhaustive]
2544pub struct AuditConfig {
2545 /// Required. The list of destinations that can be selected for uploading audit
2546 /// reports to.
2547 pub destinations: std::vec::Vec<crate::model::audit_config::CmEligibleDestination>,
2548
2549 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2550}
2551
2552impl AuditConfig {
2553 pub fn new() -> Self {
2554 std::default::Default::default()
2555 }
2556
2557 /// Sets the value of [destinations][crate::model::AuditConfig::destinations].
2558 ///
2559 /// # Example
2560 /// ```ignore,no_run
2561 /// # use google_cloud_cloudsecuritycompliance_v1::model::AuditConfig;
2562 /// use google_cloud_cloudsecuritycompliance_v1::model::audit_config::CmEligibleDestination;
2563 /// let x = AuditConfig::new()
2564 /// .set_destinations([
2565 /// CmEligibleDestination::default()/* use setters */,
2566 /// CmEligibleDestination::default()/* use (different) setters */,
2567 /// ]);
2568 /// ```
2569 pub fn set_destinations<T, V>(mut self, v: T) -> Self
2570 where
2571 T: std::iter::IntoIterator<Item = V>,
2572 V: std::convert::Into<crate::model::audit_config::CmEligibleDestination>,
2573 {
2574 use std::iter::Iterator;
2575 self.destinations = v.into_iter().map(|i| i.into()).collect();
2576 self
2577 }
2578}
2579
2580impl wkt::message::Message for AuditConfig {
2581 fn typename() -> &'static str {
2582 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.AuditConfig"
2583 }
2584}
2585
2586/// Defines additional types related to [AuditConfig].
2587pub mod audit_config {
2588 #[allow(unused_imports)]
2589 use super::*;
2590
2591 /// The destination details where audit reports are
2592 /// uploaded.
2593 #[derive(Clone, Default, PartialEq)]
2594 #[non_exhaustive]
2595 pub struct CmEligibleDestination {
2596 /// Set of options for the report destination location.
2597 pub cm_eligible_destinations: std::option::Option<
2598 crate::model::audit_config::cm_eligible_destination::CmEligibleDestinations,
2599 >,
2600
2601 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2602 }
2603
2604 impl CmEligibleDestination {
2605 pub fn new() -> Self {
2606 std::default::Default::default()
2607 }
2608
2609 /// Sets the value of [cm_eligible_destinations][crate::model::audit_config::CmEligibleDestination::cm_eligible_destinations].
2610 ///
2611 /// Note that all the setters affecting `cm_eligible_destinations` are mutually
2612 /// exclusive.
2613 ///
2614 /// # Example
2615 /// ```ignore,no_run
2616 /// # use google_cloud_cloudsecuritycompliance_v1::model::audit_config::CmEligibleDestination;
2617 /// use google_cloud_cloudsecuritycompliance_v1::model::audit_config::cm_eligible_destination::CmEligibleDestinations;
2618 /// let x = CmEligibleDestination::new().set_cm_eligible_destinations(Some(CmEligibleDestinations::GcsBucket("example".to_string())));
2619 /// ```
2620 pub fn set_cm_eligible_destinations<
2621 T: std::convert::Into<
2622 std::option::Option<
2623 crate::model::audit_config::cm_eligible_destination::CmEligibleDestinations,
2624 >,
2625 >,
2626 >(
2627 mut self,
2628 v: T,
2629 ) -> Self {
2630 self.cm_eligible_destinations = v.into();
2631 self
2632 }
2633
2634 /// The value of [cm_eligible_destinations][crate::model::audit_config::CmEligibleDestination::cm_eligible_destinations]
2635 /// if it holds a `GcsBucket`, `None` if the field is not set or
2636 /// holds a different branch.
2637 pub fn gcs_bucket(&self) -> std::option::Option<&std::string::String> {
2638 #[allow(unreachable_patterns)]
2639 self.cm_eligible_destinations.as_ref().and_then(|v| match v {
2640 crate::model::audit_config::cm_eligible_destination::CmEligibleDestinations::GcsBucket(v) => std::option::Option::Some(v),
2641 _ => std::option::Option::None,
2642 })
2643 }
2644
2645 /// Sets the value of [cm_eligible_destinations][crate::model::audit_config::CmEligibleDestination::cm_eligible_destinations]
2646 /// to hold a `GcsBucket`.
2647 ///
2648 /// Note that all the setters affecting `cm_eligible_destinations` are
2649 /// mutually exclusive.
2650 ///
2651 /// # Example
2652 /// ```ignore,no_run
2653 /// # use google_cloud_cloudsecuritycompliance_v1::model::audit_config::CmEligibleDestination;
2654 /// let x = CmEligibleDestination::new().set_gcs_bucket("example");
2655 /// assert!(x.gcs_bucket().is_some());
2656 /// ```
2657 pub fn set_gcs_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2658 self.cm_eligible_destinations = std::option::Option::Some(
2659 crate::model::audit_config::cm_eligible_destination::CmEligibleDestinations::GcsBucket(
2660 v.into()
2661 )
2662 );
2663 self
2664 }
2665 }
2666
2667 impl wkt::message::Message for CmEligibleDestination {
2668 fn typename() -> &'static str {
2669 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.AuditConfig.CmEligibleDestination"
2670 }
2671 }
2672
2673 /// Defines additional types related to [CmEligibleDestination].
2674 pub mod cm_eligible_destination {
2675 #[allow(unused_imports)]
2676 use super::*;
2677
2678 /// Set of options for the report destination location.
2679 #[derive(Clone, Debug, PartialEq)]
2680 #[non_exhaustive]
2681 pub enum CmEligibleDestinations {
2682 /// The Cloud Storage bucket where audit reports and evidences can be
2683 /// uploaded. The format is `gs://{bucket_name}`.
2684 GcsBucket(std::string::String),
2685 }
2686 }
2687}
2688
2689/// A framework is a collection of cloud controls and regulatory controls
2690/// that represent security best practices or industry-defined standards such as
2691/// FedRAMP or NIST.
2692#[derive(Clone, Default, PartialEq)]
2693#[non_exhaustive]
2694pub struct Framework {
2695 /// Required. Identifier. The name of the framework, in the format
2696 /// `organizations/{organization}/locations/{location}/frameworks/{framework_id}`.
2697 /// The only supported location is `global`.
2698 pub name: std::string::String,
2699
2700 /// Output only. The major version of the framework, which is incremented in
2701 /// ascending order.
2702 pub major_revision_id: i64,
2703
2704 /// Optional. The friendly name of the framework. The maximum length is 200
2705 /// characters.
2706 pub display_name: std::string::String,
2707
2708 /// Optional. The description of the framework. The maximum length is 2000
2709 /// characters.
2710 pub description: std::string::String,
2711
2712 /// Output only. The type of framework.
2713 pub r#type: crate::model::framework::FrameworkType,
2714
2715 /// Optional. The cloud control details that are directly added without any
2716 /// grouping in the framework.
2717 pub cloud_control_details: std::vec::Vec<crate::model::CloudControlDetails>,
2718
2719 /// Optional. The category of the framework.
2720 pub category: std::vec::Vec<crate::model::FrameworkCategory>,
2721
2722 /// Output only. The cloud providers that are supported by the framework.
2723 pub supported_cloud_providers: std::vec::Vec<crate::model::CloudProvider>,
2724
2725 /// Output only. The target resource types that are supported by the framework.
2726 pub supported_target_resource_types: std::vec::Vec<crate::model::TargetResourceType>,
2727
2728 /// Output only. The supported enforcement modes of the framework.
2729 pub supported_enforcement_modes: std::vec::Vec<crate::model::EnforcementMode>,
2730
2731 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2732}
2733
2734impl Framework {
2735 pub fn new() -> Self {
2736 std::default::Default::default()
2737 }
2738
2739 /// Sets the value of [name][crate::model::Framework::name].
2740 ///
2741 /// # Example
2742 /// ```ignore,no_run
2743 /// # use google_cloud_cloudsecuritycompliance_v1::model::Framework;
2744 /// let x = Framework::new().set_name("example");
2745 /// ```
2746 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2747 self.name = v.into();
2748 self
2749 }
2750
2751 /// Sets the value of [major_revision_id][crate::model::Framework::major_revision_id].
2752 ///
2753 /// # Example
2754 /// ```ignore,no_run
2755 /// # use google_cloud_cloudsecuritycompliance_v1::model::Framework;
2756 /// let x = Framework::new().set_major_revision_id(42);
2757 /// ```
2758 pub fn set_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2759 self.major_revision_id = v.into();
2760 self
2761 }
2762
2763 /// Sets the value of [display_name][crate::model::Framework::display_name].
2764 ///
2765 /// # Example
2766 /// ```ignore,no_run
2767 /// # use google_cloud_cloudsecuritycompliance_v1::model::Framework;
2768 /// let x = Framework::new().set_display_name("example");
2769 /// ```
2770 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2771 self.display_name = v.into();
2772 self
2773 }
2774
2775 /// Sets the value of [description][crate::model::Framework::description].
2776 ///
2777 /// # Example
2778 /// ```ignore,no_run
2779 /// # use google_cloud_cloudsecuritycompliance_v1::model::Framework;
2780 /// let x = Framework::new().set_description("example");
2781 /// ```
2782 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2783 self.description = v.into();
2784 self
2785 }
2786
2787 /// Sets the value of [r#type][crate::model::Framework::type].
2788 ///
2789 /// # Example
2790 /// ```ignore,no_run
2791 /// # use google_cloud_cloudsecuritycompliance_v1::model::Framework;
2792 /// use google_cloud_cloudsecuritycompliance_v1::model::framework::FrameworkType;
2793 /// let x0 = Framework::new().set_type(FrameworkType::BuiltIn);
2794 /// let x1 = Framework::new().set_type(FrameworkType::Custom);
2795 /// ```
2796 pub fn set_type<T: std::convert::Into<crate::model::framework::FrameworkType>>(
2797 mut self,
2798 v: T,
2799 ) -> Self {
2800 self.r#type = v.into();
2801 self
2802 }
2803
2804 /// Sets the value of [cloud_control_details][crate::model::Framework::cloud_control_details].
2805 ///
2806 /// # Example
2807 /// ```ignore,no_run
2808 /// # use google_cloud_cloudsecuritycompliance_v1::model::Framework;
2809 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDetails;
2810 /// let x = Framework::new()
2811 /// .set_cloud_control_details([
2812 /// CloudControlDetails::default()/* use setters */,
2813 /// CloudControlDetails::default()/* use (different) setters */,
2814 /// ]);
2815 /// ```
2816 pub fn set_cloud_control_details<T, V>(mut self, v: T) -> Self
2817 where
2818 T: std::iter::IntoIterator<Item = V>,
2819 V: std::convert::Into<crate::model::CloudControlDetails>,
2820 {
2821 use std::iter::Iterator;
2822 self.cloud_control_details = v.into_iter().map(|i| i.into()).collect();
2823 self
2824 }
2825
2826 /// Sets the value of [category][crate::model::Framework::category].
2827 ///
2828 /// # Example
2829 /// ```ignore,no_run
2830 /// # use google_cloud_cloudsecuritycompliance_v1::model::Framework;
2831 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkCategory;
2832 /// let x = Framework::new().set_category([
2833 /// FrameworkCategory::IndustryDefinedStandard,
2834 /// FrameworkCategory::AssuredWorkloads,
2835 /// FrameworkCategory::DataSecurity,
2836 /// ]);
2837 /// ```
2838 pub fn set_category<T, V>(mut self, v: T) -> Self
2839 where
2840 T: std::iter::IntoIterator<Item = V>,
2841 V: std::convert::Into<crate::model::FrameworkCategory>,
2842 {
2843 use std::iter::Iterator;
2844 self.category = v.into_iter().map(|i| i.into()).collect();
2845 self
2846 }
2847
2848 /// Sets the value of [supported_cloud_providers][crate::model::Framework::supported_cloud_providers].
2849 ///
2850 /// # Example
2851 /// ```ignore,no_run
2852 /// # use google_cloud_cloudsecuritycompliance_v1::model::Framework;
2853 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudProvider;
2854 /// let x = Framework::new().set_supported_cloud_providers([
2855 /// CloudProvider::Aws,
2856 /// CloudProvider::Azure,
2857 /// CloudProvider::Gcp,
2858 /// ]);
2859 /// ```
2860 pub fn set_supported_cloud_providers<T, V>(mut self, v: T) -> Self
2861 where
2862 T: std::iter::IntoIterator<Item = V>,
2863 V: std::convert::Into<crate::model::CloudProvider>,
2864 {
2865 use std::iter::Iterator;
2866 self.supported_cloud_providers = v.into_iter().map(|i| i.into()).collect();
2867 self
2868 }
2869
2870 /// Sets the value of [supported_target_resource_types][crate::model::Framework::supported_target_resource_types].
2871 ///
2872 /// # Example
2873 /// ```ignore,no_run
2874 /// # use google_cloud_cloudsecuritycompliance_v1::model::Framework;
2875 /// use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceType;
2876 /// let x = Framework::new().set_supported_target_resource_types([
2877 /// TargetResourceType::TargetResourceCrmTypeOrg,
2878 /// TargetResourceType::TargetResourceCrmTypeFolder,
2879 /// TargetResourceType::TargetResourceCrmTypeProject,
2880 /// ]);
2881 /// ```
2882 pub fn set_supported_target_resource_types<T, V>(mut self, v: T) -> Self
2883 where
2884 T: std::iter::IntoIterator<Item = V>,
2885 V: std::convert::Into<crate::model::TargetResourceType>,
2886 {
2887 use std::iter::Iterator;
2888 self.supported_target_resource_types = v.into_iter().map(|i| i.into()).collect();
2889 self
2890 }
2891
2892 /// Sets the value of [supported_enforcement_modes][crate::model::Framework::supported_enforcement_modes].
2893 ///
2894 /// # Example
2895 /// ```ignore,no_run
2896 /// # use google_cloud_cloudsecuritycompliance_v1::model::Framework;
2897 /// use google_cloud_cloudsecuritycompliance_v1::model::EnforcementMode;
2898 /// let x = Framework::new().set_supported_enforcement_modes([
2899 /// EnforcementMode::Preventive,
2900 /// EnforcementMode::Detective,
2901 /// EnforcementMode::Audit,
2902 /// ]);
2903 /// ```
2904 pub fn set_supported_enforcement_modes<T, V>(mut self, v: T) -> Self
2905 where
2906 T: std::iter::IntoIterator<Item = V>,
2907 V: std::convert::Into<crate::model::EnforcementMode>,
2908 {
2909 use std::iter::Iterator;
2910 self.supported_enforcement_modes = v.into_iter().map(|i| i.into()).collect();
2911 self
2912 }
2913}
2914
2915impl wkt::message::Message for Framework {
2916 fn typename() -> &'static str {
2917 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.Framework"
2918 }
2919}
2920
2921/// Defines additional types related to [Framework].
2922pub mod framework {
2923 #[allow(unused_imports)]
2924 use super::*;
2925
2926 /// The type of framework.
2927 ///
2928 /// # Working with unknown values
2929 ///
2930 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2931 /// additional enum variants at any time. Adding new variants is not considered
2932 /// a breaking change. Applications should write their code in anticipation of:
2933 ///
2934 /// - New values appearing in future releases of the client library, **and**
2935 /// - New values received dynamically, without application changes.
2936 ///
2937 /// Please consult the [Working with enums] section in the user guide for some
2938 /// guidelines.
2939 ///
2940 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2941 #[derive(Clone, Debug, PartialEq)]
2942 #[non_exhaustive]
2943 pub enum FrameworkType {
2944 /// Default value. This value is unused.
2945 Unspecified,
2946 /// A framework that's provided and managed by Google.
2947 BuiltIn,
2948 /// A framework that's created and managed by you.
2949 Custom,
2950 /// If set, the enum was initialized with an unknown value.
2951 ///
2952 /// Applications can examine the value using [FrameworkType::value] or
2953 /// [FrameworkType::name].
2954 UnknownValue(framework_type::UnknownValue),
2955 }
2956
2957 #[doc(hidden)]
2958 pub mod framework_type {
2959 #[allow(unused_imports)]
2960 use super::*;
2961 #[derive(Clone, Debug, PartialEq)]
2962 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2963 }
2964
2965 impl FrameworkType {
2966 /// Gets the enum value.
2967 ///
2968 /// Returns `None` if the enum contains an unknown value deserialized from
2969 /// the string representation of enums.
2970 pub fn value(&self) -> std::option::Option<i32> {
2971 match self {
2972 Self::Unspecified => std::option::Option::Some(0),
2973 Self::BuiltIn => std::option::Option::Some(1),
2974 Self::Custom => std::option::Option::Some(2),
2975 Self::UnknownValue(u) => u.0.value(),
2976 }
2977 }
2978
2979 /// Gets the enum value as a string.
2980 ///
2981 /// Returns `None` if the enum contains an unknown value deserialized from
2982 /// the integer representation of enums.
2983 pub fn name(&self) -> std::option::Option<&str> {
2984 match self {
2985 Self::Unspecified => std::option::Option::Some("FRAMEWORK_TYPE_UNSPECIFIED"),
2986 Self::BuiltIn => std::option::Option::Some("BUILT_IN"),
2987 Self::Custom => std::option::Option::Some("CUSTOM"),
2988 Self::UnknownValue(u) => u.0.name(),
2989 }
2990 }
2991 }
2992
2993 impl std::default::Default for FrameworkType {
2994 fn default() -> Self {
2995 use std::convert::From;
2996 Self::from(0)
2997 }
2998 }
2999
3000 impl std::fmt::Display for FrameworkType {
3001 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3002 wkt::internal::display_enum(f, self.name(), self.value())
3003 }
3004 }
3005
3006 impl std::convert::From<i32> for FrameworkType {
3007 fn from(value: i32) -> Self {
3008 match value {
3009 0 => Self::Unspecified,
3010 1 => Self::BuiltIn,
3011 2 => Self::Custom,
3012 _ => Self::UnknownValue(framework_type::UnknownValue(
3013 wkt::internal::UnknownEnumValue::Integer(value),
3014 )),
3015 }
3016 }
3017 }
3018
3019 impl std::convert::From<&str> for FrameworkType {
3020 fn from(value: &str) -> Self {
3021 use std::string::ToString;
3022 match value {
3023 "FRAMEWORK_TYPE_UNSPECIFIED" => Self::Unspecified,
3024 "BUILT_IN" => Self::BuiltIn,
3025 "CUSTOM" => Self::Custom,
3026 _ => Self::UnknownValue(framework_type::UnknownValue(
3027 wkt::internal::UnknownEnumValue::String(value.to_string()),
3028 )),
3029 }
3030 }
3031 }
3032
3033 impl serde::ser::Serialize for FrameworkType {
3034 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3035 where
3036 S: serde::Serializer,
3037 {
3038 match self {
3039 Self::Unspecified => serializer.serialize_i32(0),
3040 Self::BuiltIn => serializer.serialize_i32(1),
3041 Self::Custom => serializer.serialize_i32(2),
3042 Self::UnknownValue(u) => u.0.serialize(serializer),
3043 }
3044 }
3045 }
3046
3047 impl<'de> serde::de::Deserialize<'de> for FrameworkType {
3048 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3049 where
3050 D: serde::Deserializer<'de>,
3051 {
3052 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FrameworkType>::new(
3053 ".google.cloud.cloudsecuritycompliance.v1.Framework.FrameworkType",
3054 ))
3055 }
3056 }
3057}
3058
3059/// The details of a cloud control.
3060#[derive(Clone, Default, PartialEq)]
3061#[non_exhaustive]
3062pub struct CloudControlDetails {
3063 /// Required. The name of the cloud control, in the format
3064 /// `organizations/{organization}/locations/{location}/cloudControls/{cloud-control}`.
3065 /// The only supported location is `global`.
3066 pub name: std::string::String,
3067
3068 /// Required. The major version of the cloud control.
3069 pub major_revision_id: i64,
3070
3071 /// Optional. Parameters are key-value pairs that let you provide your custom
3072 /// location requirements, environment requirements, or other settings that are
3073 /// relevant to the cloud control. An example parameter is
3074 /// `{"name": "location","value": "us-west-1"}`.
3075 pub parameters: std::vec::Vec<crate::model::Parameter>,
3076
3077 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3078}
3079
3080impl CloudControlDetails {
3081 pub fn new() -> Self {
3082 std::default::Default::default()
3083 }
3084
3085 /// Sets the value of [name][crate::model::CloudControlDetails::name].
3086 ///
3087 /// # Example
3088 /// ```ignore,no_run
3089 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDetails;
3090 /// let x = CloudControlDetails::new().set_name("example");
3091 /// ```
3092 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3093 self.name = v.into();
3094 self
3095 }
3096
3097 /// Sets the value of [major_revision_id][crate::model::CloudControlDetails::major_revision_id].
3098 ///
3099 /// # Example
3100 /// ```ignore,no_run
3101 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDetails;
3102 /// let x = CloudControlDetails::new().set_major_revision_id(42);
3103 /// ```
3104 pub fn set_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3105 self.major_revision_id = v.into();
3106 self
3107 }
3108
3109 /// Sets the value of [parameters][crate::model::CloudControlDetails::parameters].
3110 ///
3111 /// # Example
3112 /// ```ignore,no_run
3113 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDetails;
3114 /// use google_cloud_cloudsecuritycompliance_v1::model::Parameter;
3115 /// let x = CloudControlDetails::new()
3116 /// .set_parameters([
3117 /// Parameter::default()/* use setters */,
3118 /// Parameter::default()/* use (different) setters */,
3119 /// ]);
3120 /// ```
3121 pub fn set_parameters<T, V>(mut self, v: T) -> Self
3122 where
3123 T: std::iter::IntoIterator<Item = V>,
3124 V: std::convert::Into<crate::model::Parameter>,
3125 {
3126 use std::iter::Iterator;
3127 self.parameters = v.into_iter().map(|i| i.into()).collect();
3128 self
3129 }
3130}
3131
3132impl wkt::message::Message for CloudControlDetails {
3133 fn typename() -> &'static str {
3134 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControlDetails"
3135 }
3136}
3137
3138/// The reference of a framework, in the format
3139/// `organizations/{organization}/locations/{location}/frameworks/{framework}`.
3140/// The only supported location is `global`.
3141#[derive(Clone, Default, PartialEq)]
3142#[non_exhaustive]
3143pub struct FrameworkReference {
3144 /// Required. The major version of the framework. If not specified, the version
3145 /// corresponds to the latest version of the framework.
3146 pub framework: std::string::String,
3147
3148 /// Optional. The major version of the framework. If not specified, the version
3149 /// corresponds to the latest version of the framework.
3150 pub major_revision_id: std::option::Option<i64>,
3151
3152 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3153}
3154
3155impl FrameworkReference {
3156 pub fn new() -> Self {
3157 std::default::Default::default()
3158 }
3159
3160 /// Sets the value of [framework][crate::model::FrameworkReference::framework].
3161 ///
3162 /// # Example
3163 /// ```ignore,no_run
3164 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkReference;
3165 /// let x = FrameworkReference::new().set_framework("example");
3166 /// ```
3167 pub fn set_framework<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3168 self.framework = v.into();
3169 self
3170 }
3171
3172 /// Sets the value of [major_revision_id][crate::model::FrameworkReference::major_revision_id].
3173 ///
3174 /// # Example
3175 /// ```ignore,no_run
3176 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkReference;
3177 /// let x = FrameworkReference::new().set_major_revision_id(42);
3178 /// ```
3179 pub fn set_major_revision_id<T>(mut self, v: T) -> Self
3180 where
3181 T: std::convert::Into<i64>,
3182 {
3183 self.major_revision_id = std::option::Option::Some(v.into());
3184 self
3185 }
3186
3187 /// Sets or clears the value of [major_revision_id][crate::model::FrameworkReference::major_revision_id].
3188 ///
3189 /// # Example
3190 /// ```ignore,no_run
3191 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkReference;
3192 /// let x = FrameworkReference::new().set_or_clear_major_revision_id(Some(42));
3193 /// let x = FrameworkReference::new().set_or_clear_major_revision_id(None::<i32>);
3194 /// ```
3195 pub fn set_or_clear_major_revision_id<T>(mut self, v: std::option::Option<T>) -> Self
3196 where
3197 T: std::convert::Into<i64>,
3198 {
3199 self.major_revision_id = v.map(|x| x.into());
3200 self
3201 }
3202}
3203
3204impl wkt::message::Message for FrameworkReference {
3205 fn typename() -> &'static str {
3206 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FrameworkReference"
3207 }
3208}
3209
3210/// Parameters are key-value pairs that let you provide your custom location
3211/// requirements, environment requirements, or other settings that are
3212/// relevant to the cloud control.
3213#[derive(Clone, Default, PartialEq)]
3214#[non_exhaustive]
3215pub struct Parameter {
3216 /// Required. The name or key of the parameter.
3217 pub name: std::string::String,
3218
3219 /// Required. The value of the parameter.
3220 pub parameter_value: std::option::Option<std::boxed::Box<crate::model::ParamValue>>,
3221
3222 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3223}
3224
3225impl Parameter {
3226 pub fn new() -> Self {
3227 std::default::Default::default()
3228 }
3229
3230 /// Sets the value of [name][crate::model::Parameter::name].
3231 ///
3232 /// # Example
3233 /// ```ignore,no_run
3234 /// # use google_cloud_cloudsecuritycompliance_v1::model::Parameter;
3235 /// let x = Parameter::new().set_name("example");
3236 /// ```
3237 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3238 self.name = v.into();
3239 self
3240 }
3241
3242 /// Sets the value of [parameter_value][crate::model::Parameter::parameter_value].
3243 ///
3244 /// # Example
3245 /// ```ignore,no_run
3246 /// # use google_cloud_cloudsecuritycompliance_v1::model::Parameter;
3247 /// use google_cloud_cloudsecuritycompliance_v1::model::ParamValue;
3248 /// let x = Parameter::new().set_parameter_value(ParamValue::default()/* use setters */);
3249 /// ```
3250 pub fn set_parameter_value<T>(mut self, v: T) -> Self
3251 where
3252 T: std::convert::Into<crate::model::ParamValue>,
3253 {
3254 self.parameter_value = std::option::Option::Some(std::boxed::Box::new(v.into()));
3255 self
3256 }
3257
3258 /// Sets or clears the value of [parameter_value][crate::model::Parameter::parameter_value].
3259 ///
3260 /// # Example
3261 /// ```ignore,no_run
3262 /// # use google_cloud_cloudsecuritycompliance_v1::model::Parameter;
3263 /// use google_cloud_cloudsecuritycompliance_v1::model::ParamValue;
3264 /// let x = Parameter::new().set_or_clear_parameter_value(Some(ParamValue::default()/* use setters */));
3265 /// let x = Parameter::new().set_or_clear_parameter_value(None::<ParamValue>);
3266 /// ```
3267 pub fn set_or_clear_parameter_value<T>(mut self, v: std::option::Option<T>) -> Self
3268 where
3269 T: std::convert::Into<crate::model::ParamValue>,
3270 {
3271 self.parameter_value = v.map(|x| std::boxed::Box::new(x.into()));
3272 self
3273 }
3274}
3275
3276impl wkt::message::Message for Parameter {
3277 fn typename() -> &'static str {
3278 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.Parameter"
3279 }
3280}
3281
3282/// A cloud control is a set of rules and associated metadata that you can
3283/// use to define your organization's security or compliance intent.
3284#[derive(Clone, Default, PartialEq)]
3285#[non_exhaustive]
3286pub struct CloudControl {
3287 /// Required. Identifier. The name of the cloud control, in the format
3288 /// `organizations/{organization}/locations/{location}/cloudControls/{cloud_control_id}`.
3289 /// The only supported location is `global`.
3290 pub name: std::string::String,
3291
3292 /// Output only. The major version of the cloud control, which is incremented
3293 /// in ascending order.
3294 pub major_revision_id: i64,
3295
3296 /// Optional. A description of the cloud control. The maximum length is 2000
3297 /// characters.
3298 pub description: std::string::String,
3299
3300 /// Optional. The friendly name of the cloud control. The maximum length is 200
3301 /// characters.
3302 pub display_name: std::string::String,
3303
3304 /// Output only. The supported enforcement modes for the cloud control.
3305 pub supported_enforcement_modes: std::vec::Vec<crate::model::EnforcementMode>,
3306
3307 /// Optional. The parameter specifications for the cloud control.
3308 pub parameter_spec: std::vec::Vec<crate::model::ParameterSpec>,
3309
3310 /// Optional. The rules that you can enforce to meet your security or
3311 /// compliance intent.
3312 pub rules: std::vec::Vec<crate::model::Rule>,
3313
3314 /// Optional. The severity of the findings that are generated by the cloud
3315 /// control.
3316 pub severity: crate::model::Severity,
3317
3318 /// Optional. The finding category for the cloud control findings. The maximum
3319 /// length is 255 characters.
3320 pub finding_category: std::string::String,
3321
3322 /// Optional. The supported cloud providers.
3323 pub supported_cloud_providers: std::vec::Vec<crate::model::CloudProvider>,
3324
3325 /// Output only. The frameworks that include this cloud control.
3326 pub related_frameworks: std::vec::Vec<std::string::String>,
3327
3328 /// Optional. The remediation steps for the cloud control findings. The
3329 /// maximum length is 400 characters.
3330 pub remediation_steps: std::string::String,
3331
3332 /// Optional. The categories for the cloud control.
3333 pub categories: std::vec::Vec<crate::model::CloudControlCategory>,
3334
3335 /// Output only. The time that the cloud control was last updated.
3336 /// `create_time` is used because a new cloud control is created
3337 /// whenever an existing cloud control is updated.
3338 pub create_time: std::option::Option<wkt::Timestamp>,
3339
3340 /// Optional. The target resource types that are supported by the cloud
3341 /// control.
3342 pub supported_target_resource_types: std::vec::Vec<crate::model::TargetResourceType>,
3343
3344 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3345}
3346
3347impl CloudControl {
3348 pub fn new() -> Self {
3349 std::default::Default::default()
3350 }
3351
3352 /// Sets the value of [name][crate::model::CloudControl::name].
3353 ///
3354 /// # Example
3355 /// ```ignore,no_run
3356 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3357 /// let x = CloudControl::new().set_name("example");
3358 /// ```
3359 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3360 self.name = v.into();
3361 self
3362 }
3363
3364 /// Sets the value of [major_revision_id][crate::model::CloudControl::major_revision_id].
3365 ///
3366 /// # Example
3367 /// ```ignore,no_run
3368 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3369 /// let x = CloudControl::new().set_major_revision_id(42);
3370 /// ```
3371 pub fn set_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3372 self.major_revision_id = v.into();
3373 self
3374 }
3375
3376 /// Sets the value of [description][crate::model::CloudControl::description].
3377 ///
3378 /// # Example
3379 /// ```ignore,no_run
3380 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3381 /// let x = CloudControl::new().set_description("example");
3382 /// ```
3383 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3384 self.description = v.into();
3385 self
3386 }
3387
3388 /// Sets the value of [display_name][crate::model::CloudControl::display_name].
3389 ///
3390 /// # Example
3391 /// ```ignore,no_run
3392 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3393 /// let x = CloudControl::new().set_display_name("example");
3394 /// ```
3395 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3396 self.display_name = v.into();
3397 self
3398 }
3399
3400 /// Sets the value of [supported_enforcement_modes][crate::model::CloudControl::supported_enforcement_modes].
3401 ///
3402 /// # Example
3403 /// ```ignore,no_run
3404 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3405 /// use google_cloud_cloudsecuritycompliance_v1::model::EnforcementMode;
3406 /// let x = CloudControl::new().set_supported_enforcement_modes([
3407 /// EnforcementMode::Preventive,
3408 /// EnforcementMode::Detective,
3409 /// EnforcementMode::Audit,
3410 /// ]);
3411 /// ```
3412 pub fn set_supported_enforcement_modes<T, V>(mut self, v: T) -> Self
3413 where
3414 T: std::iter::IntoIterator<Item = V>,
3415 V: std::convert::Into<crate::model::EnforcementMode>,
3416 {
3417 use std::iter::Iterator;
3418 self.supported_enforcement_modes = v.into_iter().map(|i| i.into()).collect();
3419 self
3420 }
3421
3422 /// Sets the value of [parameter_spec][crate::model::CloudControl::parameter_spec].
3423 ///
3424 /// # Example
3425 /// ```ignore,no_run
3426 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3427 /// use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
3428 /// let x = CloudControl::new()
3429 /// .set_parameter_spec([
3430 /// ParameterSpec::default()/* use setters */,
3431 /// ParameterSpec::default()/* use (different) setters */,
3432 /// ]);
3433 /// ```
3434 pub fn set_parameter_spec<T, V>(mut self, v: T) -> Self
3435 where
3436 T: std::iter::IntoIterator<Item = V>,
3437 V: std::convert::Into<crate::model::ParameterSpec>,
3438 {
3439 use std::iter::Iterator;
3440 self.parameter_spec = v.into_iter().map(|i| i.into()).collect();
3441 self
3442 }
3443
3444 /// Sets the value of [rules][crate::model::CloudControl::rules].
3445 ///
3446 /// # Example
3447 /// ```ignore,no_run
3448 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3449 /// use google_cloud_cloudsecuritycompliance_v1::model::Rule;
3450 /// let x = CloudControl::new()
3451 /// .set_rules([
3452 /// Rule::default()/* use setters */,
3453 /// Rule::default()/* use (different) setters */,
3454 /// ]);
3455 /// ```
3456 pub fn set_rules<T, V>(mut self, v: T) -> Self
3457 where
3458 T: std::iter::IntoIterator<Item = V>,
3459 V: std::convert::Into<crate::model::Rule>,
3460 {
3461 use std::iter::Iterator;
3462 self.rules = v.into_iter().map(|i| i.into()).collect();
3463 self
3464 }
3465
3466 /// Sets the value of [severity][crate::model::CloudControl::severity].
3467 ///
3468 /// # Example
3469 /// ```ignore,no_run
3470 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3471 /// use google_cloud_cloudsecuritycompliance_v1::model::Severity;
3472 /// let x0 = CloudControl::new().set_severity(Severity::Critical);
3473 /// let x1 = CloudControl::new().set_severity(Severity::High);
3474 /// let x2 = CloudControl::new().set_severity(Severity::Medium);
3475 /// ```
3476 pub fn set_severity<T: std::convert::Into<crate::model::Severity>>(mut self, v: T) -> Self {
3477 self.severity = v.into();
3478 self
3479 }
3480
3481 /// Sets the value of [finding_category][crate::model::CloudControl::finding_category].
3482 ///
3483 /// # Example
3484 /// ```ignore,no_run
3485 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3486 /// let x = CloudControl::new().set_finding_category("example");
3487 /// ```
3488 pub fn set_finding_category<T: std::convert::Into<std::string::String>>(
3489 mut self,
3490 v: T,
3491 ) -> Self {
3492 self.finding_category = v.into();
3493 self
3494 }
3495
3496 /// Sets the value of [supported_cloud_providers][crate::model::CloudControl::supported_cloud_providers].
3497 ///
3498 /// # Example
3499 /// ```ignore,no_run
3500 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3501 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudProvider;
3502 /// let x = CloudControl::new().set_supported_cloud_providers([
3503 /// CloudProvider::Aws,
3504 /// CloudProvider::Azure,
3505 /// CloudProvider::Gcp,
3506 /// ]);
3507 /// ```
3508 pub fn set_supported_cloud_providers<T, V>(mut self, v: T) -> Self
3509 where
3510 T: std::iter::IntoIterator<Item = V>,
3511 V: std::convert::Into<crate::model::CloudProvider>,
3512 {
3513 use std::iter::Iterator;
3514 self.supported_cloud_providers = v.into_iter().map(|i| i.into()).collect();
3515 self
3516 }
3517
3518 /// Sets the value of [related_frameworks][crate::model::CloudControl::related_frameworks].
3519 ///
3520 /// # Example
3521 /// ```ignore,no_run
3522 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3523 /// let x = CloudControl::new().set_related_frameworks(["a", "b", "c"]);
3524 /// ```
3525 pub fn set_related_frameworks<T, V>(mut self, v: T) -> Self
3526 where
3527 T: std::iter::IntoIterator<Item = V>,
3528 V: std::convert::Into<std::string::String>,
3529 {
3530 use std::iter::Iterator;
3531 self.related_frameworks = v.into_iter().map(|i| i.into()).collect();
3532 self
3533 }
3534
3535 /// Sets the value of [remediation_steps][crate::model::CloudControl::remediation_steps].
3536 ///
3537 /// # Example
3538 /// ```ignore,no_run
3539 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3540 /// let x = CloudControl::new().set_remediation_steps("example");
3541 /// ```
3542 pub fn set_remediation_steps<T: std::convert::Into<std::string::String>>(
3543 mut self,
3544 v: T,
3545 ) -> Self {
3546 self.remediation_steps = v.into();
3547 self
3548 }
3549
3550 /// Sets the value of [categories][crate::model::CloudControl::categories].
3551 ///
3552 /// # Example
3553 /// ```ignore,no_run
3554 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3555 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlCategory;
3556 /// let x = CloudControl::new().set_categories([
3557 /// CloudControlCategory::CcCategoryInfrastructure,
3558 /// CloudControlCategory::CcCategoryArtificialIntelligence,
3559 /// CloudControlCategory::CcCategoryPhysicalSecurity,
3560 /// ]);
3561 /// ```
3562 pub fn set_categories<T, V>(mut self, v: T) -> Self
3563 where
3564 T: std::iter::IntoIterator<Item = V>,
3565 V: std::convert::Into<crate::model::CloudControlCategory>,
3566 {
3567 use std::iter::Iterator;
3568 self.categories = v.into_iter().map(|i| i.into()).collect();
3569 self
3570 }
3571
3572 /// Sets the value of [create_time][crate::model::CloudControl::create_time].
3573 ///
3574 /// # Example
3575 /// ```ignore,no_run
3576 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3577 /// use wkt::Timestamp;
3578 /// let x = CloudControl::new().set_create_time(Timestamp::default()/* use setters */);
3579 /// ```
3580 pub fn set_create_time<T>(mut self, v: T) -> Self
3581 where
3582 T: std::convert::Into<wkt::Timestamp>,
3583 {
3584 self.create_time = std::option::Option::Some(v.into());
3585 self
3586 }
3587
3588 /// Sets or clears the value of [create_time][crate::model::CloudControl::create_time].
3589 ///
3590 /// # Example
3591 /// ```ignore,no_run
3592 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3593 /// use wkt::Timestamp;
3594 /// let x = CloudControl::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3595 /// let x = CloudControl::new().set_or_clear_create_time(None::<Timestamp>);
3596 /// ```
3597 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3598 where
3599 T: std::convert::Into<wkt::Timestamp>,
3600 {
3601 self.create_time = v.map(|x| x.into());
3602 self
3603 }
3604
3605 /// Sets the value of [supported_target_resource_types][crate::model::CloudControl::supported_target_resource_types].
3606 ///
3607 /// # Example
3608 /// ```ignore,no_run
3609 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3610 /// use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceType;
3611 /// let x = CloudControl::new().set_supported_target_resource_types([
3612 /// TargetResourceType::TargetResourceCrmTypeOrg,
3613 /// TargetResourceType::TargetResourceCrmTypeFolder,
3614 /// TargetResourceType::TargetResourceCrmTypeProject,
3615 /// ]);
3616 /// ```
3617 pub fn set_supported_target_resource_types<T, V>(mut self, v: T) -> Self
3618 where
3619 T: std::iter::IntoIterator<Item = V>,
3620 V: std::convert::Into<crate::model::TargetResourceType>,
3621 {
3622 use std::iter::Iterator;
3623 self.supported_target_resource_types = v.into_iter().map(|i| i.into()).collect();
3624 self
3625 }
3626}
3627
3628impl wkt::message::Message for CloudControl {
3629 fn typename() -> &'static str {
3630 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControl"
3631 }
3632}
3633
3634/// Defines additional types related to [CloudControl].
3635pub mod cloud_control {
3636 #[allow(unused_imports)]
3637 use super::*;
3638
3639 /// The type of cloud control.
3640 ///
3641 /// # Working with unknown values
3642 ///
3643 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3644 /// additional enum variants at any time. Adding new variants is not considered
3645 /// a breaking change. Applications should write their code in anticipation of:
3646 ///
3647 /// - New values appearing in future releases of the client library, **and**
3648 /// - New values received dynamically, without application changes.
3649 ///
3650 /// Please consult the [Working with enums] section in the user guide for some
3651 /// guidelines.
3652 ///
3653 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3654 #[derive(Clone, Debug, PartialEq)]
3655 #[non_exhaustive]
3656 pub enum Type {
3657 /// Default value. This value is unused.
3658 Unspecified,
3659 /// A cloud control that's created and managed by you.
3660 Custom,
3661 /// A cloud control that's provided and managed by Google.
3662 BuiltIn,
3663 /// If set, the enum was initialized with an unknown value.
3664 ///
3665 /// Applications can examine the value using [Type::value] or
3666 /// [Type::name].
3667 UnknownValue(r#type::UnknownValue),
3668 }
3669
3670 #[doc(hidden)]
3671 pub mod r#type {
3672 #[allow(unused_imports)]
3673 use super::*;
3674 #[derive(Clone, Debug, PartialEq)]
3675 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3676 }
3677
3678 impl Type {
3679 /// Gets the enum value.
3680 ///
3681 /// Returns `None` if the enum contains an unknown value deserialized from
3682 /// the string representation of enums.
3683 pub fn value(&self) -> std::option::Option<i32> {
3684 match self {
3685 Self::Unspecified => std::option::Option::Some(0),
3686 Self::Custom => std::option::Option::Some(1),
3687 Self::BuiltIn => std::option::Option::Some(2),
3688 Self::UnknownValue(u) => u.0.value(),
3689 }
3690 }
3691
3692 /// Gets the enum value as a string.
3693 ///
3694 /// Returns `None` if the enum contains an unknown value deserialized from
3695 /// the integer representation of enums.
3696 pub fn name(&self) -> std::option::Option<&str> {
3697 match self {
3698 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
3699 Self::Custom => std::option::Option::Some("CUSTOM"),
3700 Self::BuiltIn => std::option::Option::Some("BUILT_IN"),
3701 Self::UnknownValue(u) => u.0.name(),
3702 }
3703 }
3704 }
3705
3706 impl std::default::Default for Type {
3707 fn default() -> Self {
3708 use std::convert::From;
3709 Self::from(0)
3710 }
3711 }
3712
3713 impl std::fmt::Display for Type {
3714 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3715 wkt::internal::display_enum(f, self.name(), self.value())
3716 }
3717 }
3718
3719 impl std::convert::From<i32> for Type {
3720 fn from(value: i32) -> Self {
3721 match value {
3722 0 => Self::Unspecified,
3723 1 => Self::Custom,
3724 2 => Self::BuiltIn,
3725 _ => Self::UnknownValue(r#type::UnknownValue(
3726 wkt::internal::UnknownEnumValue::Integer(value),
3727 )),
3728 }
3729 }
3730 }
3731
3732 impl std::convert::From<&str> for Type {
3733 fn from(value: &str) -> Self {
3734 use std::string::ToString;
3735 match value {
3736 "TYPE_UNSPECIFIED" => Self::Unspecified,
3737 "CUSTOM" => Self::Custom,
3738 "BUILT_IN" => Self::BuiltIn,
3739 _ => Self::UnknownValue(r#type::UnknownValue(
3740 wkt::internal::UnknownEnumValue::String(value.to_string()),
3741 )),
3742 }
3743 }
3744 }
3745
3746 impl serde::ser::Serialize for Type {
3747 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3748 where
3749 S: serde::Serializer,
3750 {
3751 match self {
3752 Self::Unspecified => serializer.serialize_i32(0),
3753 Self::Custom => serializer.serialize_i32(1),
3754 Self::BuiltIn => serializer.serialize_i32(2),
3755 Self::UnknownValue(u) => u.0.serialize(serializer),
3756 }
3757 }
3758 }
3759
3760 impl<'de> serde::de::Deserialize<'de> for Type {
3761 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3762 where
3763 D: serde::Deserializer<'de>,
3764 {
3765 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
3766 ".google.cloud.cloudsecuritycompliance.v1.CloudControl.Type",
3767 ))
3768 }
3769 }
3770}
3771
3772/// The parameter specification for the cloud control.
3773#[derive(Clone, Default, PartialEq)]
3774#[non_exhaustive]
3775pub struct ParameterSpec {
3776 /// Required. The name of the parameter.
3777 pub name: std::string::String,
3778
3779 /// Optional. The friendly name of the parameter. The maximum length is 200
3780 /// characters.
3781 pub display_name: std::string::String,
3782
3783 /// Optional. The description of the parameter. The maximum length is 2000
3784 /// characters.
3785 pub description: std::string::String,
3786
3787 /// Required. Whether the parameter is required.
3788 pub is_required: bool,
3789
3790 /// Required. The parameter value type.
3791 pub value_type: crate::model::parameter_spec::ValueType,
3792
3793 /// Optional. The default value of the parameter.
3794 pub default_value: std::option::Option<crate::model::ParamValue>,
3795
3796 /// Optional. The list of parameter substitutions.
3797 pub substitution_rules: std::vec::Vec<crate::model::ParameterSubstitutionRule>,
3798
3799 /// Optional. The parameter specification for `oneOf` attributes.
3800 pub sub_parameters: std::vec::Vec<crate::model::ParameterSpec>,
3801
3802 /// Optional. The permitted set of values for the parameter.
3803 pub validation: std::option::Option<crate::model::Validation>,
3804
3805 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3806}
3807
3808impl ParameterSpec {
3809 pub fn new() -> Self {
3810 std::default::Default::default()
3811 }
3812
3813 /// Sets the value of [name][crate::model::ParameterSpec::name].
3814 ///
3815 /// # Example
3816 /// ```ignore,no_run
3817 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
3818 /// let x = ParameterSpec::new().set_name("example");
3819 /// ```
3820 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3821 self.name = v.into();
3822 self
3823 }
3824
3825 /// Sets the value of [display_name][crate::model::ParameterSpec::display_name].
3826 ///
3827 /// # Example
3828 /// ```ignore,no_run
3829 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
3830 /// let x = ParameterSpec::new().set_display_name("example");
3831 /// ```
3832 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3833 self.display_name = v.into();
3834 self
3835 }
3836
3837 /// Sets the value of [description][crate::model::ParameterSpec::description].
3838 ///
3839 /// # Example
3840 /// ```ignore,no_run
3841 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
3842 /// let x = ParameterSpec::new().set_description("example");
3843 /// ```
3844 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3845 self.description = v.into();
3846 self
3847 }
3848
3849 /// Sets the value of [is_required][crate::model::ParameterSpec::is_required].
3850 ///
3851 /// # Example
3852 /// ```ignore,no_run
3853 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
3854 /// let x = ParameterSpec::new().set_is_required(true);
3855 /// ```
3856 pub fn set_is_required<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3857 self.is_required = v.into();
3858 self
3859 }
3860
3861 /// Sets the value of [value_type][crate::model::ParameterSpec::value_type].
3862 ///
3863 /// # Example
3864 /// ```ignore,no_run
3865 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
3866 /// use google_cloud_cloudsecuritycompliance_v1::model::parameter_spec::ValueType;
3867 /// let x0 = ParameterSpec::new().set_value_type(ValueType::String);
3868 /// let x1 = ParameterSpec::new().set_value_type(ValueType::Boolean);
3869 /// let x2 = ParameterSpec::new().set_value_type(ValueType::Stringlist);
3870 /// ```
3871 pub fn set_value_type<T: std::convert::Into<crate::model::parameter_spec::ValueType>>(
3872 mut self,
3873 v: T,
3874 ) -> Self {
3875 self.value_type = v.into();
3876 self
3877 }
3878
3879 /// Sets the value of [default_value][crate::model::ParameterSpec::default_value].
3880 ///
3881 /// # Example
3882 /// ```ignore,no_run
3883 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
3884 /// use google_cloud_cloudsecuritycompliance_v1::model::ParamValue;
3885 /// let x = ParameterSpec::new().set_default_value(ParamValue::default()/* use setters */);
3886 /// ```
3887 pub fn set_default_value<T>(mut self, v: T) -> Self
3888 where
3889 T: std::convert::Into<crate::model::ParamValue>,
3890 {
3891 self.default_value = std::option::Option::Some(v.into());
3892 self
3893 }
3894
3895 /// Sets or clears the value of [default_value][crate::model::ParameterSpec::default_value].
3896 ///
3897 /// # Example
3898 /// ```ignore,no_run
3899 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
3900 /// use google_cloud_cloudsecuritycompliance_v1::model::ParamValue;
3901 /// let x = ParameterSpec::new().set_or_clear_default_value(Some(ParamValue::default()/* use setters */));
3902 /// let x = ParameterSpec::new().set_or_clear_default_value(None::<ParamValue>);
3903 /// ```
3904 pub fn set_or_clear_default_value<T>(mut self, v: std::option::Option<T>) -> Self
3905 where
3906 T: std::convert::Into<crate::model::ParamValue>,
3907 {
3908 self.default_value = v.map(|x| x.into());
3909 self
3910 }
3911
3912 /// Sets the value of [substitution_rules][crate::model::ParameterSpec::substitution_rules].
3913 ///
3914 /// # Example
3915 /// ```ignore,no_run
3916 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
3917 /// use google_cloud_cloudsecuritycompliance_v1::model::ParameterSubstitutionRule;
3918 /// let x = ParameterSpec::new()
3919 /// .set_substitution_rules([
3920 /// ParameterSubstitutionRule::default()/* use setters */,
3921 /// ParameterSubstitutionRule::default()/* use (different) setters */,
3922 /// ]);
3923 /// ```
3924 pub fn set_substitution_rules<T, V>(mut self, v: T) -> Self
3925 where
3926 T: std::iter::IntoIterator<Item = V>,
3927 V: std::convert::Into<crate::model::ParameterSubstitutionRule>,
3928 {
3929 use std::iter::Iterator;
3930 self.substitution_rules = v.into_iter().map(|i| i.into()).collect();
3931 self
3932 }
3933
3934 /// Sets the value of [sub_parameters][crate::model::ParameterSpec::sub_parameters].
3935 ///
3936 /// # Example
3937 /// ```ignore,no_run
3938 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
3939 /// let x = ParameterSpec::new()
3940 /// .set_sub_parameters([
3941 /// ParameterSpec::default()/* use setters */,
3942 /// ParameterSpec::default()/* use (different) setters */,
3943 /// ]);
3944 /// ```
3945 pub fn set_sub_parameters<T, V>(mut self, v: T) -> Self
3946 where
3947 T: std::iter::IntoIterator<Item = V>,
3948 V: std::convert::Into<crate::model::ParameterSpec>,
3949 {
3950 use std::iter::Iterator;
3951 self.sub_parameters = v.into_iter().map(|i| i.into()).collect();
3952 self
3953 }
3954
3955 /// Sets the value of [validation][crate::model::ParameterSpec::validation].
3956 ///
3957 /// # Example
3958 /// ```ignore,no_run
3959 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
3960 /// use google_cloud_cloudsecuritycompliance_v1::model::Validation;
3961 /// let x = ParameterSpec::new().set_validation(Validation::default()/* use setters */);
3962 /// ```
3963 pub fn set_validation<T>(mut self, v: T) -> Self
3964 where
3965 T: std::convert::Into<crate::model::Validation>,
3966 {
3967 self.validation = std::option::Option::Some(v.into());
3968 self
3969 }
3970
3971 /// Sets or clears the value of [validation][crate::model::ParameterSpec::validation].
3972 ///
3973 /// # Example
3974 /// ```ignore,no_run
3975 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
3976 /// use google_cloud_cloudsecuritycompliance_v1::model::Validation;
3977 /// let x = ParameterSpec::new().set_or_clear_validation(Some(Validation::default()/* use setters */));
3978 /// let x = ParameterSpec::new().set_or_clear_validation(None::<Validation>);
3979 /// ```
3980 pub fn set_or_clear_validation<T>(mut self, v: std::option::Option<T>) -> Self
3981 where
3982 T: std::convert::Into<crate::model::Validation>,
3983 {
3984 self.validation = v.map(|x| x.into());
3985 self
3986 }
3987}
3988
3989impl wkt::message::Message for ParameterSpec {
3990 fn typename() -> &'static str {
3991 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ParameterSpec"
3992 }
3993}
3994
3995/// Defines additional types related to [ParameterSpec].
3996pub mod parameter_spec {
3997 #[allow(unused_imports)]
3998 use super::*;
3999
4000 /// The type of parameter value.
4001 ///
4002 /// # Working with unknown values
4003 ///
4004 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4005 /// additional enum variants at any time. Adding new variants is not considered
4006 /// a breaking change. Applications should write their code in anticipation of:
4007 ///
4008 /// - New values appearing in future releases of the client library, **and**
4009 /// - New values received dynamically, without application changes.
4010 ///
4011 /// Please consult the [Working with enums] section in the user guide for some
4012 /// guidelines.
4013 ///
4014 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4015 #[derive(Clone, Debug, PartialEq)]
4016 #[non_exhaustive]
4017 pub enum ValueType {
4018 /// Default value. This value is unused.
4019 Unspecified,
4020 /// A string value.
4021 String,
4022 /// A boolean value.
4023 Boolean,
4024 /// A string list value.
4025 Stringlist,
4026 /// A numeric value.
4027 Number,
4028 /// A oneOf value.
4029 Oneof,
4030 /// If set, the enum was initialized with an unknown value.
4031 ///
4032 /// Applications can examine the value using [ValueType::value] or
4033 /// [ValueType::name].
4034 UnknownValue(value_type::UnknownValue),
4035 }
4036
4037 #[doc(hidden)]
4038 pub mod value_type {
4039 #[allow(unused_imports)]
4040 use super::*;
4041 #[derive(Clone, Debug, PartialEq)]
4042 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4043 }
4044
4045 impl ValueType {
4046 /// Gets the enum value.
4047 ///
4048 /// Returns `None` if the enum contains an unknown value deserialized from
4049 /// the string representation of enums.
4050 pub fn value(&self) -> std::option::Option<i32> {
4051 match self {
4052 Self::Unspecified => std::option::Option::Some(0),
4053 Self::String => std::option::Option::Some(3),
4054 Self::Boolean => std::option::Option::Some(4),
4055 Self::Stringlist => std::option::Option::Some(5),
4056 Self::Number => std::option::Option::Some(6),
4057 Self::Oneof => std::option::Option::Some(7),
4058 Self::UnknownValue(u) => u.0.value(),
4059 }
4060 }
4061
4062 /// Gets the enum value as a string.
4063 ///
4064 /// Returns `None` if the enum contains an unknown value deserialized from
4065 /// the integer representation of enums.
4066 pub fn name(&self) -> std::option::Option<&str> {
4067 match self {
4068 Self::Unspecified => std::option::Option::Some("VALUE_TYPE_UNSPECIFIED"),
4069 Self::String => std::option::Option::Some("STRING"),
4070 Self::Boolean => std::option::Option::Some("BOOLEAN"),
4071 Self::Stringlist => std::option::Option::Some("STRINGLIST"),
4072 Self::Number => std::option::Option::Some("NUMBER"),
4073 Self::Oneof => std::option::Option::Some("ONEOF"),
4074 Self::UnknownValue(u) => u.0.name(),
4075 }
4076 }
4077 }
4078
4079 impl std::default::Default for ValueType {
4080 fn default() -> Self {
4081 use std::convert::From;
4082 Self::from(0)
4083 }
4084 }
4085
4086 impl std::fmt::Display for ValueType {
4087 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4088 wkt::internal::display_enum(f, self.name(), self.value())
4089 }
4090 }
4091
4092 impl std::convert::From<i32> for ValueType {
4093 fn from(value: i32) -> Self {
4094 match value {
4095 0 => Self::Unspecified,
4096 3 => Self::String,
4097 4 => Self::Boolean,
4098 5 => Self::Stringlist,
4099 6 => Self::Number,
4100 7 => Self::Oneof,
4101 _ => Self::UnknownValue(value_type::UnknownValue(
4102 wkt::internal::UnknownEnumValue::Integer(value),
4103 )),
4104 }
4105 }
4106 }
4107
4108 impl std::convert::From<&str> for ValueType {
4109 fn from(value: &str) -> Self {
4110 use std::string::ToString;
4111 match value {
4112 "VALUE_TYPE_UNSPECIFIED" => Self::Unspecified,
4113 "STRING" => Self::String,
4114 "BOOLEAN" => Self::Boolean,
4115 "STRINGLIST" => Self::Stringlist,
4116 "NUMBER" => Self::Number,
4117 "ONEOF" => Self::Oneof,
4118 _ => Self::UnknownValue(value_type::UnknownValue(
4119 wkt::internal::UnknownEnumValue::String(value.to_string()),
4120 )),
4121 }
4122 }
4123 }
4124
4125 impl serde::ser::Serialize for ValueType {
4126 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4127 where
4128 S: serde::Serializer,
4129 {
4130 match self {
4131 Self::Unspecified => serializer.serialize_i32(0),
4132 Self::String => serializer.serialize_i32(3),
4133 Self::Boolean => serializer.serialize_i32(4),
4134 Self::Stringlist => serializer.serialize_i32(5),
4135 Self::Number => serializer.serialize_i32(6),
4136 Self::Oneof => serializer.serialize_i32(7),
4137 Self::UnknownValue(u) => u.0.serialize(serializer),
4138 }
4139 }
4140 }
4141
4142 impl<'de> serde::de::Deserialize<'de> for ValueType {
4143 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4144 where
4145 D: serde::Deserializer<'de>,
4146 {
4147 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ValueType>::new(
4148 ".google.cloud.cloudsecuritycompliance.v1.ParameterSpec.ValueType",
4149 ))
4150 }
4151 }
4152}
4153
4154/// The validation of the parameter.
4155#[derive(Clone, Default, PartialEq)]
4156#[non_exhaustive]
4157pub struct Validation {
4158 /// Defines validators for parameter values.
4159 pub constraint: std::option::Option<crate::model::validation::Constraint>,
4160
4161 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4162}
4163
4164impl Validation {
4165 pub fn new() -> Self {
4166 std::default::Default::default()
4167 }
4168
4169 /// Sets the value of [constraint][crate::model::Validation::constraint].
4170 ///
4171 /// Note that all the setters affecting `constraint` are mutually
4172 /// exclusive.
4173 ///
4174 /// # Example
4175 /// ```ignore,no_run
4176 /// # use google_cloud_cloudsecuritycompliance_v1::model::Validation;
4177 /// use google_cloud_cloudsecuritycompliance_v1::model::AllowedValues;
4178 /// let x = Validation::new().set_constraint(Some(
4179 /// google_cloud_cloudsecuritycompliance_v1::model::validation::Constraint::AllowedValues(AllowedValues::default().into())));
4180 /// ```
4181 pub fn set_constraint<
4182 T: std::convert::Into<std::option::Option<crate::model::validation::Constraint>>,
4183 >(
4184 mut self,
4185 v: T,
4186 ) -> Self {
4187 self.constraint = v.into();
4188 self
4189 }
4190
4191 /// The value of [constraint][crate::model::Validation::constraint]
4192 /// if it holds a `AllowedValues`, `None` if the field is not set or
4193 /// holds a different branch.
4194 pub fn allowed_values(
4195 &self,
4196 ) -> std::option::Option<&std::boxed::Box<crate::model::AllowedValues>> {
4197 #[allow(unreachable_patterns)]
4198 self.constraint.as_ref().and_then(|v| match v {
4199 crate::model::validation::Constraint::AllowedValues(v) => std::option::Option::Some(v),
4200 _ => std::option::Option::None,
4201 })
4202 }
4203
4204 /// Sets the value of [constraint][crate::model::Validation::constraint]
4205 /// to hold a `AllowedValues`.
4206 ///
4207 /// Note that all the setters affecting `constraint` are
4208 /// mutually exclusive.
4209 ///
4210 /// # Example
4211 /// ```ignore,no_run
4212 /// # use google_cloud_cloudsecuritycompliance_v1::model::Validation;
4213 /// use google_cloud_cloudsecuritycompliance_v1::model::AllowedValues;
4214 /// let x = Validation::new().set_allowed_values(AllowedValues::default()/* use setters */);
4215 /// assert!(x.allowed_values().is_some());
4216 /// assert!(x.int_range().is_none());
4217 /// assert!(x.regexp_pattern().is_none());
4218 /// ```
4219 pub fn set_allowed_values<
4220 T: std::convert::Into<std::boxed::Box<crate::model::AllowedValues>>,
4221 >(
4222 mut self,
4223 v: T,
4224 ) -> Self {
4225 self.constraint = std::option::Option::Some(
4226 crate::model::validation::Constraint::AllowedValues(v.into()),
4227 );
4228 self
4229 }
4230
4231 /// The value of [constraint][crate::model::Validation::constraint]
4232 /// if it holds a `IntRange`, `None` if the field is not set or
4233 /// holds a different branch.
4234 pub fn int_range(&self) -> std::option::Option<&std::boxed::Box<crate::model::IntRange>> {
4235 #[allow(unreachable_patterns)]
4236 self.constraint.as_ref().and_then(|v| match v {
4237 crate::model::validation::Constraint::IntRange(v) => std::option::Option::Some(v),
4238 _ => std::option::Option::None,
4239 })
4240 }
4241
4242 /// Sets the value of [constraint][crate::model::Validation::constraint]
4243 /// to hold a `IntRange`.
4244 ///
4245 /// Note that all the setters affecting `constraint` are
4246 /// mutually exclusive.
4247 ///
4248 /// # Example
4249 /// ```ignore,no_run
4250 /// # use google_cloud_cloudsecuritycompliance_v1::model::Validation;
4251 /// use google_cloud_cloudsecuritycompliance_v1::model::IntRange;
4252 /// let x = Validation::new().set_int_range(IntRange::default()/* use setters */);
4253 /// assert!(x.int_range().is_some());
4254 /// assert!(x.allowed_values().is_none());
4255 /// assert!(x.regexp_pattern().is_none());
4256 /// ```
4257 pub fn set_int_range<T: std::convert::Into<std::boxed::Box<crate::model::IntRange>>>(
4258 mut self,
4259 v: T,
4260 ) -> Self {
4261 self.constraint =
4262 std::option::Option::Some(crate::model::validation::Constraint::IntRange(v.into()));
4263 self
4264 }
4265
4266 /// The value of [constraint][crate::model::Validation::constraint]
4267 /// if it holds a `RegexpPattern`, `None` if the field is not set or
4268 /// holds a different branch.
4269 pub fn regexp_pattern(
4270 &self,
4271 ) -> std::option::Option<&std::boxed::Box<crate::model::RegexpPattern>> {
4272 #[allow(unreachable_patterns)]
4273 self.constraint.as_ref().and_then(|v| match v {
4274 crate::model::validation::Constraint::RegexpPattern(v) => std::option::Option::Some(v),
4275 _ => std::option::Option::None,
4276 })
4277 }
4278
4279 /// Sets the value of [constraint][crate::model::Validation::constraint]
4280 /// to hold a `RegexpPattern`.
4281 ///
4282 /// Note that all the setters affecting `constraint` are
4283 /// mutually exclusive.
4284 ///
4285 /// # Example
4286 /// ```ignore,no_run
4287 /// # use google_cloud_cloudsecuritycompliance_v1::model::Validation;
4288 /// use google_cloud_cloudsecuritycompliance_v1::model::RegexpPattern;
4289 /// let x = Validation::new().set_regexp_pattern(RegexpPattern::default()/* use setters */);
4290 /// assert!(x.regexp_pattern().is_some());
4291 /// assert!(x.allowed_values().is_none());
4292 /// assert!(x.int_range().is_none());
4293 /// ```
4294 pub fn set_regexp_pattern<
4295 T: std::convert::Into<std::boxed::Box<crate::model::RegexpPattern>>,
4296 >(
4297 mut self,
4298 v: T,
4299 ) -> Self {
4300 self.constraint = std::option::Option::Some(
4301 crate::model::validation::Constraint::RegexpPattern(v.into()),
4302 );
4303 self
4304 }
4305}
4306
4307impl wkt::message::Message for Validation {
4308 fn typename() -> &'static str {
4309 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.Validation"
4310 }
4311}
4312
4313/// Defines additional types related to [Validation].
4314pub mod validation {
4315 #[allow(unused_imports)]
4316 use super::*;
4317
4318 /// Defines validators for parameter values.
4319 #[derive(Clone, Debug, PartialEq)]
4320 #[non_exhaustive]
4321 pub enum Constraint {
4322 /// The permitted set of values for the parameter.
4323 AllowedValues(std::boxed::Box<crate::model::AllowedValues>),
4324 /// The permitted range for numeric parameters.
4325 IntRange(std::boxed::Box<crate::model::IntRange>),
4326 /// The regular expression for string parameters.
4327 RegexpPattern(std::boxed::Box<crate::model::RegexpPattern>),
4328 }
4329}
4330
4331/// The allowed set of values for the parameter.
4332#[derive(Clone, Default, PartialEq)]
4333#[non_exhaustive]
4334pub struct AllowedValues {
4335 /// Required. The list of allowed values for the parameter.
4336 pub values: std::vec::Vec<crate::model::ParamValue>,
4337
4338 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4339}
4340
4341impl AllowedValues {
4342 pub fn new() -> Self {
4343 std::default::Default::default()
4344 }
4345
4346 /// Sets the value of [values][crate::model::AllowedValues::values].
4347 ///
4348 /// # Example
4349 /// ```ignore,no_run
4350 /// # use google_cloud_cloudsecuritycompliance_v1::model::AllowedValues;
4351 /// use google_cloud_cloudsecuritycompliance_v1::model::ParamValue;
4352 /// let x = AllowedValues::new()
4353 /// .set_values([
4354 /// ParamValue::default()/* use setters */,
4355 /// ParamValue::default()/* use (different) setters */,
4356 /// ]);
4357 /// ```
4358 pub fn set_values<T, V>(mut self, v: T) -> Self
4359 where
4360 T: std::iter::IntoIterator<Item = V>,
4361 V: std::convert::Into<crate::model::ParamValue>,
4362 {
4363 use std::iter::Iterator;
4364 self.values = v.into_iter().map(|i| i.into()).collect();
4365 self
4366 }
4367}
4368
4369impl wkt::message::Message for AllowedValues {
4370 fn typename() -> &'static str {
4371 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.AllowedValues"
4372 }
4373}
4374
4375/// The regular expression (regex) validator for parameter values.
4376#[derive(Clone, Default, PartialEq)]
4377#[non_exhaustive]
4378pub struct RegexpPattern {
4379 /// Required. The regex pattern to match the values of the parameter with.
4380 pub pattern: std::string::String,
4381
4382 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4383}
4384
4385impl RegexpPattern {
4386 pub fn new() -> Self {
4387 std::default::Default::default()
4388 }
4389
4390 /// Sets the value of [pattern][crate::model::RegexpPattern::pattern].
4391 ///
4392 /// # Example
4393 /// ```ignore,no_run
4394 /// # use google_cloud_cloudsecuritycompliance_v1::model::RegexpPattern;
4395 /// let x = RegexpPattern::new().set_pattern("example");
4396 /// ```
4397 pub fn set_pattern<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4398 self.pattern = v.into();
4399 self
4400 }
4401}
4402
4403impl wkt::message::Message for RegexpPattern {
4404 fn typename() -> &'static str {
4405 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.RegexpPattern"
4406 }
4407}
4408
4409/// The number range for number parameters.
4410#[derive(Clone, Default, PartialEq)]
4411#[non_exhaustive]
4412pub struct IntRange {
4413 /// Required. The minimum permitted value for the numeric parameter
4414 /// (inclusive).
4415 pub min: i64,
4416
4417 /// Required. The maximum permitted value for the numeric parameter
4418 /// (inclusive).
4419 pub max: i64,
4420
4421 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4422}
4423
4424impl IntRange {
4425 pub fn new() -> Self {
4426 std::default::Default::default()
4427 }
4428
4429 /// Sets the value of [min][crate::model::IntRange::min].
4430 ///
4431 /// # Example
4432 /// ```ignore,no_run
4433 /// # use google_cloud_cloudsecuritycompliance_v1::model::IntRange;
4434 /// let x = IntRange::new().set_min(42);
4435 /// ```
4436 pub fn set_min<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4437 self.min = v.into();
4438 self
4439 }
4440
4441 /// Sets the value of [max][crate::model::IntRange::max].
4442 ///
4443 /// # Example
4444 /// ```ignore,no_run
4445 /// # use google_cloud_cloudsecuritycompliance_v1::model::IntRange;
4446 /// let x = IntRange::new().set_max(42);
4447 /// ```
4448 pub fn set_max<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4449 self.max = v.into();
4450 self
4451 }
4452}
4453
4454impl wkt::message::Message for IntRange {
4455 fn typename() -> &'static str {
4456 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.IntRange"
4457 }
4458}
4459
4460/// A list of strings for the parameter value.
4461#[derive(Clone, Default, PartialEq)]
4462#[non_exhaustive]
4463pub struct StringList {
4464 /// Required. The strings in the list.
4465 pub values: std::vec::Vec<std::string::String>,
4466
4467 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4468}
4469
4470impl StringList {
4471 pub fn new() -> Self {
4472 std::default::Default::default()
4473 }
4474
4475 /// Sets the value of [values][crate::model::StringList::values].
4476 ///
4477 /// # Example
4478 /// ```ignore,no_run
4479 /// # use google_cloud_cloudsecuritycompliance_v1::model::StringList;
4480 /// let x = StringList::new().set_values(["a", "b", "c"]);
4481 /// ```
4482 pub fn set_values<T, V>(mut self, v: T) -> Self
4483 where
4484 T: std::iter::IntoIterator<Item = V>,
4485 V: std::convert::Into<std::string::String>,
4486 {
4487 use std::iter::Iterator;
4488 self.values = v.into_iter().map(|i| i.into()).collect();
4489 self
4490 }
4491}
4492
4493impl wkt::message::Message for StringList {
4494 fn typename() -> &'static str {
4495 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.StringList"
4496 }
4497}
4498
4499/// The possible parameter value types.
4500#[derive(Clone, Default, PartialEq)]
4501#[non_exhaustive]
4502pub struct ParamValue {
4503 /// The list of possible parameter value types.
4504 pub kind: std::option::Option<crate::model::param_value::Kind>,
4505
4506 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4507}
4508
4509impl ParamValue {
4510 pub fn new() -> Self {
4511 std::default::Default::default()
4512 }
4513
4514 /// Sets the value of [kind][crate::model::ParamValue::kind].
4515 ///
4516 /// Note that all the setters affecting `kind` are mutually
4517 /// exclusive.
4518 ///
4519 /// # Example
4520 /// ```ignore,no_run
4521 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParamValue;
4522 /// use google_cloud_cloudsecuritycompliance_v1::model::param_value::Kind;
4523 /// let x = ParamValue::new().set_kind(Some(Kind::StringValue("example".to_string())));
4524 /// ```
4525 pub fn set_kind<T: std::convert::Into<std::option::Option<crate::model::param_value::Kind>>>(
4526 mut self,
4527 v: T,
4528 ) -> Self {
4529 self.kind = v.into();
4530 self
4531 }
4532
4533 /// The value of [kind][crate::model::ParamValue::kind]
4534 /// if it holds a `StringValue`, `None` if the field is not set or
4535 /// holds a different branch.
4536 pub fn string_value(&self) -> std::option::Option<&std::string::String> {
4537 #[allow(unreachable_patterns)]
4538 self.kind.as_ref().and_then(|v| match v {
4539 crate::model::param_value::Kind::StringValue(v) => std::option::Option::Some(v),
4540 _ => std::option::Option::None,
4541 })
4542 }
4543
4544 /// Sets the value of [kind][crate::model::ParamValue::kind]
4545 /// to hold a `StringValue`.
4546 ///
4547 /// Note that all the setters affecting `kind` are
4548 /// mutually exclusive.
4549 ///
4550 /// # Example
4551 /// ```ignore,no_run
4552 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParamValue;
4553 /// let x = ParamValue::new().set_string_value("example");
4554 /// assert!(x.string_value().is_some());
4555 /// assert!(x.bool_value().is_none());
4556 /// assert!(x.string_list_value().is_none());
4557 /// assert!(x.number_value().is_none());
4558 /// assert!(x.oneof_value().is_none());
4559 /// ```
4560 pub fn set_string_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4561 self.kind =
4562 std::option::Option::Some(crate::model::param_value::Kind::StringValue(v.into()));
4563 self
4564 }
4565
4566 /// The value of [kind][crate::model::ParamValue::kind]
4567 /// if it holds a `BoolValue`, `None` if the field is not set or
4568 /// holds a different branch.
4569 pub fn bool_value(&self) -> std::option::Option<&bool> {
4570 #[allow(unreachable_patterns)]
4571 self.kind.as_ref().and_then(|v| match v {
4572 crate::model::param_value::Kind::BoolValue(v) => std::option::Option::Some(v),
4573 _ => std::option::Option::None,
4574 })
4575 }
4576
4577 /// Sets the value of [kind][crate::model::ParamValue::kind]
4578 /// to hold a `BoolValue`.
4579 ///
4580 /// Note that all the setters affecting `kind` are
4581 /// mutually exclusive.
4582 ///
4583 /// # Example
4584 /// ```ignore,no_run
4585 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParamValue;
4586 /// let x = ParamValue::new().set_bool_value(true);
4587 /// assert!(x.bool_value().is_some());
4588 /// assert!(x.string_value().is_none());
4589 /// assert!(x.string_list_value().is_none());
4590 /// assert!(x.number_value().is_none());
4591 /// assert!(x.oneof_value().is_none());
4592 /// ```
4593 pub fn set_bool_value<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4594 self.kind = std::option::Option::Some(crate::model::param_value::Kind::BoolValue(v.into()));
4595 self
4596 }
4597
4598 /// The value of [kind][crate::model::ParamValue::kind]
4599 /// if it holds a `StringListValue`, `None` if the field is not set or
4600 /// holds a different branch.
4601 pub fn string_list_value(
4602 &self,
4603 ) -> std::option::Option<&std::boxed::Box<crate::model::StringList>> {
4604 #[allow(unreachable_patterns)]
4605 self.kind.as_ref().and_then(|v| match v {
4606 crate::model::param_value::Kind::StringListValue(v) => std::option::Option::Some(v),
4607 _ => std::option::Option::None,
4608 })
4609 }
4610
4611 /// Sets the value of [kind][crate::model::ParamValue::kind]
4612 /// to hold a `StringListValue`.
4613 ///
4614 /// Note that all the setters affecting `kind` are
4615 /// mutually exclusive.
4616 ///
4617 /// # Example
4618 /// ```ignore,no_run
4619 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParamValue;
4620 /// use google_cloud_cloudsecuritycompliance_v1::model::StringList;
4621 /// let x = ParamValue::new().set_string_list_value(StringList::default()/* use setters */);
4622 /// assert!(x.string_list_value().is_some());
4623 /// assert!(x.string_value().is_none());
4624 /// assert!(x.bool_value().is_none());
4625 /// assert!(x.number_value().is_none());
4626 /// assert!(x.oneof_value().is_none());
4627 /// ```
4628 pub fn set_string_list_value<
4629 T: std::convert::Into<std::boxed::Box<crate::model::StringList>>,
4630 >(
4631 mut self,
4632 v: T,
4633 ) -> Self {
4634 self.kind =
4635 std::option::Option::Some(crate::model::param_value::Kind::StringListValue(v.into()));
4636 self
4637 }
4638
4639 /// The value of [kind][crate::model::ParamValue::kind]
4640 /// if it holds a `NumberValue`, `None` if the field is not set or
4641 /// holds a different branch.
4642 pub fn number_value(&self) -> std::option::Option<&f64> {
4643 #[allow(unreachable_patterns)]
4644 self.kind.as_ref().and_then(|v| match v {
4645 crate::model::param_value::Kind::NumberValue(v) => std::option::Option::Some(v),
4646 _ => std::option::Option::None,
4647 })
4648 }
4649
4650 /// Sets the value of [kind][crate::model::ParamValue::kind]
4651 /// to hold a `NumberValue`.
4652 ///
4653 /// Note that all the setters affecting `kind` are
4654 /// mutually exclusive.
4655 ///
4656 /// # Example
4657 /// ```ignore,no_run
4658 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParamValue;
4659 /// let x = ParamValue::new().set_number_value(42.0);
4660 /// assert!(x.number_value().is_some());
4661 /// assert!(x.string_value().is_none());
4662 /// assert!(x.bool_value().is_none());
4663 /// assert!(x.string_list_value().is_none());
4664 /// assert!(x.oneof_value().is_none());
4665 /// ```
4666 pub fn set_number_value<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
4667 self.kind =
4668 std::option::Option::Some(crate::model::param_value::Kind::NumberValue(v.into()));
4669 self
4670 }
4671
4672 /// The value of [kind][crate::model::ParamValue::kind]
4673 /// if it holds a `OneofValue`, `None` if the field is not set or
4674 /// holds a different branch.
4675 pub fn oneof_value(&self) -> std::option::Option<&std::boxed::Box<crate::model::Parameter>> {
4676 #[allow(unreachable_patterns)]
4677 self.kind.as_ref().and_then(|v| match v {
4678 crate::model::param_value::Kind::OneofValue(v) => std::option::Option::Some(v),
4679 _ => std::option::Option::None,
4680 })
4681 }
4682
4683 /// Sets the value of [kind][crate::model::ParamValue::kind]
4684 /// to hold a `OneofValue`.
4685 ///
4686 /// Note that all the setters affecting `kind` are
4687 /// mutually exclusive.
4688 ///
4689 /// # Example
4690 /// ```ignore,no_run
4691 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParamValue;
4692 /// use google_cloud_cloudsecuritycompliance_v1::model::Parameter;
4693 /// let x = ParamValue::new().set_oneof_value(Parameter::default()/* use setters */);
4694 /// assert!(x.oneof_value().is_some());
4695 /// assert!(x.string_value().is_none());
4696 /// assert!(x.bool_value().is_none());
4697 /// assert!(x.string_list_value().is_none());
4698 /// assert!(x.number_value().is_none());
4699 /// ```
4700 pub fn set_oneof_value<T: std::convert::Into<std::boxed::Box<crate::model::Parameter>>>(
4701 mut self,
4702 v: T,
4703 ) -> Self {
4704 self.kind =
4705 std::option::Option::Some(crate::model::param_value::Kind::OneofValue(v.into()));
4706 self
4707 }
4708}
4709
4710impl wkt::message::Message for ParamValue {
4711 fn typename() -> &'static str {
4712 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ParamValue"
4713 }
4714}
4715
4716/// Defines additional types related to [ParamValue].
4717pub mod param_value {
4718 #[allow(unused_imports)]
4719 use super::*;
4720
4721 /// The list of possible parameter value types.
4722 #[derive(Clone, Debug, PartialEq)]
4723 #[non_exhaustive]
4724 pub enum Kind {
4725 /// A string value.
4726 StringValue(std::string::String),
4727 /// A boolean value.
4728 BoolValue(bool),
4729 /// A repeated string.
4730 StringListValue(std::boxed::Box<crate::model::StringList>),
4731 /// A double value.
4732 NumberValue(f64),
4733 /// Sub-parameter values.
4734 OneofValue(std::boxed::Box<crate::model::Parameter>),
4735 }
4736}
4737
4738/// The parameter substitution rules.
4739#[derive(Clone, Default, PartialEq)]
4740#[non_exhaustive]
4741pub struct ParameterSubstitutionRule {
4742 /// The type of substitution.
4743 pub substitution_type:
4744 std::option::Option<crate::model::parameter_substitution_rule::SubstitutionType>,
4745
4746 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4747}
4748
4749impl ParameterSubstitutionRule {
4750 pub fn new() -> Self {
4751 std::default::Default::default()
4752 }
4753
4754 /// Sets the value of [substitution_type][crate::model::ParameterSubstitutionRule::substitution_type].
4755 ///
4756 /// Note that all the setters affecting `substitution_type` are mutually
4757 /// exclusive.
4758 ///
4759 /// # Example
4760 /// ```ignore,no_run
4761 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSubstitutionRule;
4762 /// use google_cloud_cloudsecuritycompliance_v1::model::PlaceholderSubstitutionRule;
4763 /// let x = ParameterSubstitutionRule::new().set_substitution_type(Some(
4764 /// google_cloud_cloudsecuritycompliance_v1::model::parameter_substitution_rule::SubstitutionType::PlaceholderSubstitutionRule(PlaceholderSubstitutionRule::default().into())));
4765 /// ```
4766 pub fn set_substitution_type<
4767 T: std::convert::Into<
4768 std::option::Option<crate::model::parameter_substitution_rule::SubstitutionType>,
4769 >,
4770 >(
4771 mut self,
4772 v: T,
4773 ) -> Self {
4774 self.substitution_type = v.into();
4775 self
4776 }
4777
4778 /// The value of [substitution_type][crate::model::ParameterSubstitutionRule::substitution_type]
4779 /// if it holds a `PlaceholderSubstitutionRule`, `None` if the field is not set or
4780 /// holds a different branch.
4781 pub fn placeholder_substitution_rule(
4782 &self,
4783 ) -> std::option::Option<&std::boxed::Box<crate::model::PlaceholderSubstitutionRule>> {
4784 #[allow(unreachable_patterns)]
4785 self.substitution_type.as_ref().and_then(|v| match v {
4786 crate::model::parameter_substitution_rule::SubstitutionType::PlaceholderSubstitutionRule(v) => std::option::Option::Some(v),
4787 _ => std::option::Option::None,
4788 })
4789 }
4790
4791 /// Sets the value of [substitution_type][crate::model::ParameterSubstitutionRule::substitution_type]
4792 /// to hold a `PlaceholderSubstitutionRule`.
4793 ///
4794 /// Note that all the setters affecting `substitution_type` are
4795 /// mutually exclusive.
4796 ///
4797 /// # Example
4798 /// ```ignore,no_run
4799 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSubstitutionRule;
4800 /// use google_cloud_cloudsecuritycompliance_v1::model::PlaceholderSubstitutionRule;
4801 /// let x = ParameterSubstitutionRule::new().set_placeholder_substitution_rule(PlaceholderSubstitutionRule::default()/* use setters */);
4802 /// assert!(x.placeholder_substitution_rule().is_some());
4803 /// assert!(x.attribute_substitution_rule().is_none());
4804 /// ```
4805 pub fn set_placeholder_substitution_rule<
4806 T: std::convert::Into<std::boxed::Box<crate::model::PlaceholderSubstitutionRule>>,
4807 >(
4808 mut self,
4809 v: T,
4810 ) -> Self {
4811 self.substitution_type = std::option::Option::Some(
4812 crate::model::parameter_substitution_rule::SubstitutionType::PlaceholderSubstitutionRule(
4813 v.into()
4814 )
4815 );
4816 self
4817 }
4818
4819 /// The value of [substitution_type][crate::model::ParameterSubstitutionRule::substitution_type]
4820 /// if it holds a `AttributeSubstitutionRule`, `None` if the field is not set or
4821 /// holds a different branch.
4822 pub fn attribute_substitution_rule(
4823 &self,
4824 ) -> std::option::Option<&std::boxed::Box<crate::model::AttributeSubstitutionRule>> {
4825 #[allow(unreachable_patterns)]
4826 self.substitution_type.as_ref().and_then(|v| match v {
4827 crate::model::parameter_substitution_rule::SubstitutionType::AttributeSubstitutionRule(v) => std::option::Option::Some(v),
4828 _ => std::option::Option::None,
4829 })
4830 }
4831
4832 /// Sets the value of [substitution_type][crate::model::ParameterSubstitutionRule::substitution_type]
4833 /// to hold a `AttributeSubstitutionRule`.
4834 ///
4835 /// Note that all the setters affecting `substitution_type` are
4836 /// mutually exclusive.
4837 ///
4838 /// # Example
4839 /// ```ignore,no_run
4840 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSubstitutionRule;
4841 /// use google_cloud_cloudsecuritycompliance_v1::model::AttributeSubstitutionRule;
4842 /// let x = ParameterSubstitutionRule::new().set_attribute_substitution_rule(AttributeSubstitutionRule::default()/* use setters */);
4843 /// assert!(x.attribute_substitution_rule().is_some());
4844 /// assert!(x.placeholder_substitution_rule().is_none());
4845 /// ```
4846 pub fn set_attribute_substitution_rule<
4847 T: std::convert::Into<std::boxed::Box<crate::model::AttributeSubstitutionRule>>,
4848 >(
4849 mut self,
4850 v: T,
4851 ) -> Self {
4852 self.substitution_type = std::option::Option::Some(
4853 crate::model::parameter_substitution_rule::SubstitutionType::AttributeSubstitutionRule(
4854 v.into(),
4855 ),
4856 );
4857 self
4858 }
4859}
4860
4861impl wkt::message::Message for ParameterSubstitutionRule {
4862 fn typename() -> &'static str {
4863 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ParameterSubstitutionRule"
4864 }
4865}
4866
4867/// Defines additional types related to [ParameterSubstitutionRule].
4868pub mod parameter_substitution_rule {
4869 #[allow(unused_imports)]
4870 use super::*;
4871
4872 /// The type of substitution.
4873 #[derive(Clone, Debug, PartialEq)]
4874 #[non_exhaustive]
4875 pub enum SubstitutionType {
4876 /// The placeholder substitution rule.
4877 PlaceholderSubstitutionRule(std::boxed::Box<crate::model::PlaceholderSubstitutionRule>),
4878 /// The attribute substitution rule.
4879 AttributeSubstitutionRule(std::boxed::Box<crate::model::AttributeSubstitutionRule>),
4880 }
4881}
4882
4883/// The attribute at the given path that's substituted entirely.
4884#[derive(Clone, Default, PartialEq)]
4885#[non_exhaustive]
4886pub struct AttributeSubstitutionRule {
4887 /// The fully qualified proto attribute path, in dot notation.
4888 /// For example: `rules[0].cel_expression.resource_types_values`
4889 pub attribute: std::string::String,
4890
4891 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4892}
4893
4894impl AttributeSubstitutionRule {
4895 pub fn new() -> Self {
4896 std::default::Default::default()
4897 }
4898
4899 /// Sets the value of [attribute][crate::model::AttributeSubstitutionRule::attribute].
4900 ///
4901 /// # Example
4902 /// ```ignore,no_run
4903 /// # use google_cloud_cloudsecuritycompliance_v1::model::AttributeSubstitutionRule;
4904 /// let x = AttributeSubstitutionRule::new().set_attribute("example");
4905 /// ```
4906 pub fn set_attribute<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4907 self.attribute = v.into();
4908 self
4909 }
4910}
4911
4912impl wkt::message::Message for AttributeSubstitutionRule {
4913 fn typename() -> &'static str {
4914 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.AttributeSubstitutionRule"
4915 }
4916}
4917
4918/// The placeholder that's substituted in the rendered string.
4919#[derive(Clone, Default, PartialEq)]
4920#[non_exhaustive]
4921pub struct PlaceholderSubstitutionRule {
4922 /// The fully qualified proto attribute path, in dot notation.
4923 pub attribute: std::string::String,
4924
4925 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4926}
4927
4928impl PlaceholderSubstitutionRule {
4929 pub fn new() -> Self {
4930 std::default::Default::default()
4931 }
4932
4933 /// Sets the value of [attribute][crate::model::PlaceholderSubstitutionRule::attribute].
4934 ///
4935 /// # Example
4936 /// ```ignore,no_run
4937 /// # use google_cloud_cloudsecuritycompliance_v1::model::PlaceholderSubstitutionRule;
4938 /// let x = PlaceholderSubstitutionRule::new().set_attribute("example");
4939 /// ```
4940 pub fn set_attribute<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4941 self.attribute = v.into();
4942 self
4943 }
4944}
4945
4946impl wkt::message::Message for PlaceholderSubstitutionRule {
4947 fn typename() -> &'static str {
4948 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.PlaceholderSubstitutionRule"
4949 }
4950}
4951
4952/// A rule in the cloud control.
4953#[derive(Clone, Default, PartialEq)]
4954#[non_exhaustive]
4955pub struct Rule {
4956 /// Optional. The rule description. The maximum length is 2000 characters.
4957 pub description: std::string::String,
4958
4959 /// Required. The functionality that's enabled by the rule.
4960 pub rule_action_types: std::vec::Vec<crate::model::RuleActionType>,
4961
4962 /// The rule implementation.
4963 pub implementation: std::option::Option<crate::model::rule::Implementation>,
4964
4965 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4966}
4967
4968impl Rule {
4969 pub fn new() -> Self {
4970 std::default::Default::default()
4971 }
4972
4973 /// Sets the value of [description][crate::model::Rule::description].
4974 ///
4975 /// # Example
4976 /// ```ignore,no_run
4977 /// # use google_cloud_cloudsecuritycompliance_v1::model::Rule;
4978 /// let x = Rule::new().set_description("example");
4979 /// ```
4980 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4981 self.description = v.into();
4982 self
4983 }
4984
4985 /// Sets the value of [rule_action_types][crate::model::Rule::rule_action_types].
4986 ///
4987 /// # Example
4988 /// ```ignore,no_run
4989 /// # use google_cloud_cloudsecuritycompliance_v1::model::Rule;
4990 /// use google_cloud_cloudsecuritycompliance_v1::model::RuleActionType;
4991 /// let x = Rule::new().set_rule_action_types([
4992 /// RuleActionType::Preventive,
4993 /// RuleActionType::Detective,
4994 /// RuleActionType::Audit,
4995 /// ]);
4996 /// ```
4997 pub fn set_rule_action_types<T, V>(mut self, v: T) -> Self
4998 where
4999 T: std::iter::IntoIterator<Item = V>,
5000 V: std::convert::Into<crate::model::RuleActionType>,
5001 {
5002 use std::iter::Iterator;
5003 self.rule_action_types = v.into_iter().map(|i| i.into()).collect();
5004 self
5005 }
5006
5007 /// Sets the value of [implementation][crate::model::Rule::implementation].
5008 ///
5009 /// Note that all the setters affecting `implementation` are mutually
5010 /// exclusive.
5011 ///
5012 /// # Example
5013 /// ```ignore,no_run
5014 /// # use google_cloud_cloudsecuritycompliance_v1::model::Rule;
5015 /// use google_cloud_cloudsecuritycompliance_v1::model::CELExpression;
5016 /// let x = Rule::new().set_implementation(Some(
5017 /// google_cloud_cloudsecuritycompliance_v1::model::rule::Implementation::CelExpression(CELExpression::default().into())));
5018 /// ```
5019 pub fn set_implementation<
5020 T: std::convert::Into<std::option::Option<crate::model::rule::Implementation>>,
5021 >(
5022 mut self,
5023 v: T,
5024 ) -> Self {
5025 self.implementation = v.into();
5026 self
5027 }
5028
5029 /// The value of [implementation][crate::model::Rule::implementation]
5030 /// if it holds a `CelExpression`, `None` if the field is not set or
5031 /// holds a different branch.
5032 pub fn cel_expression(
5033 &self,
5034 ) -> std::option::Option<&std::boxed::Box<crate::model::CELExpression>> {
5035 #[allow(unreachable_patterns)]
5036 self.implementation.as_ref().and_then(|v| match v {
5037 crate::model::rule::Implementation::CelExpression(v) => std::option::Option::Some(v),
5038 _ => std::option::Option::None,
5039 })
5040 }
5041
5042 /// Sets the value of [implementation][crate::model::Rule::implementation]
5043 /// to hold a `CelExpression`.
5044 ///
5045 /// Note that all the setters affecting `implementation` are
5046 /// mutually exclusive.
5047 ///
5048 /// # Example
5049 /// ```ignore,no_run
5050 /// # use google_cloud_cloudsecuritycompliance_v1::model::Rule;
5051 /// use google_cloud_cloudsecuritycompliance_v1::model::CELExpression;
5052 /// let x = Rule::new().set_cel_expression(CELExpression::default()/* use setters */);
5053 /// assert!(x.cel_expression().is_some());
5054 /// ```
5055 pub fn set_cel_expression<
5056 T: std::convert::Into<std::boxed::Box<crate::model::CELExpression>>,
5057 >(
5058 mut self,
5059 v: T,
5060 ) -> Self {
5061 self.implementation =
5062 std::option::Option::Some(crate::model::rule::Implementation::CelExpression(v.into()));
5063 self
5064 }
5065}
5066
5067impl wkt::message::Message for Rule {
5068 fn typename() -> &'static str {
5069 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.Rule"
5070 }
5071}
5072
5073/// Defines additional types related to [Rule].
5074pub mod rule {
5075 #[allow(unused_imports)]
5076 use super::*;
5077
5078 /// The rule implementation.
5079 #[derive(Clone, Debug, PartialEq)]
5080 #[non_exhaustive]
5081 pub enum Implementation {
5082 /// The rule's logic expression in Common Expression Language (CEL).
5083 CelExpression(std::boxed::Box<crate::model::CELExpression>),
5084 }
5085}
5086
5087/// A Common Expression Language (CEL) expression that's used to create a rule.
5088#[derive(Clone, Default, PartialEq)]
5089#[non_exhaustive]
5090pub struct CELExpression {
5091 /// Required. The logical expression in CEL. The maximum length of the
5092 /// condition is 1000 characters. For more information, see [CEL
5093 /// expression](https://cloud.google.com/security-command-center/docs/compliance-manager-write-cel-expressions).
5094 pub expression: std::string::String,
5095
5096 /// The criteria of the CEL expression.
5097 pub criteria: std::option::Option<crate::model::cel_expression::Criteria>,
5098
5099 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5100}
5101
5102impl CELExpression {
5103 pub fn new() -> Self {
5104 std::default::Default::default()
5105 }
5106
5107 /// Sets the value of [expression][crate::model::CELExpression::expression].
5108 ///
5109 /// # Example
5110 /// ```ignore,no_run
5111 /// # use google_cloud_cloudsecuritycompliance_v1::model::CELExpression;
5112 /// let x = CELExpression::new().set_expression("example");
5113 /// ```
5114 pub fn set_expression<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5115 self.expression = v.into();
5116 self
5117 }
5118
5119 /// Sets the value of [criteria][crate::model::CELExpression::criteria].
5120 ///
5121 /// Note that all the setters affecting `criteria` are mutually
5122 /// exclusive.
5123 ///
5124 /// # Example
5125 /// ```ignore,no_run
5126 /// # use google_cloud_cloudsecuritycompliance_v1::model::CELExpression;
5127 /// use google_cloud_cloudsecuritycompliance_v1::model::StringList;
5128 /// let x = CELExpression::new().set_criteria(Some(
5129 /// google_cloud_cloudsecuritycompliance_v1::model::cel_expression::Criteria::ResourceTypesValues(StringList::default().into())));
5130 /// ```
5131 pub fn set_criteria<
5132 T: std::convert::Into<std::option::Option<crate::model::cel_expression::Criteria>>,
5133 >(
5134 mut self,
5135 v: T,
5136 ) -> Self {
5137 self.criteria = v.into();
5138 self
5139 }
5140
5141 /// The value of [criteria][crate::model::CELExpression::criteria]
5142 /// if it holds a `ResourceTypesValues`, `None` if the field is not set or
5143 /// holds a different branch.
5144 pub fn resource_types_values(
5145 &self,
5146 ) -> std::option::Option<&std::boxed::Box<crate::model::StringList>> {
5147 #[allow(unreachable_patterns)]
5148 self.criteria.as_ref().and_then(|v| match v {
5149 crate::model::cel_expression::Criteria::ResourceTypesValues(v) => {
5150 std::option::Option::Some(v)
5151 }
5152 _ => std::option::Option::None,
5153 })
5154 }
5155
5156 /// Sets the value of [criteria][crate::model::CELExpression::criteria]
5157 /// to hold a `ResourceTypesValues`.
5158 ///
5159 /// Note that all the setters affecting `criteria` are
5160 /// mutually exclusive.
5161 ///
5162 /// # Example
5163 /// ```ignore,no_run
5164 /// # use google_cloud_cloudsecuritycompliance_v1::model::CELExpression;
5165 /// use google_cloud_cloudsecuritycompliance_v1::model::StringList;
5166 /// let x = CELExpression::new().set_resource_types_values(StringList::default()/* use setters */);
5167 /// assert!(x.resource_types_values().is_some());
5168 /// ```
5169 pub fn set_resource_types_values<
5170 T: std::convert::Into<std::boxed::Box<crate::model::StringList>>,
5171 >(
5172 mut self,
5173 v: T,
5174 ) -> Self {
5175 self.criteria = std::option::Option::Some(
5176 crate::model::cel_expression::Criteria::ResourceTypesValues(v.into()),
5177 );
5178 self
5179 }
5180}
5181
5182impl wkt::message::Message for CELExpression {
5183 fn typename() -> &'static str {
5184 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CELExpression"
5185 }
5186}
5187
5188/// Defines additional types related to [CELExpression].
5189pub mod cel_expression {
5190 #[allow(unused_imports)]
5191 use super::*;
5192
5193 /// The criteria of the CEL expression.
5194 #[derive(Clone, Debug, PartialEq)]
5195 #[non_exhaustive]
5196 pub enum Criteria {
5197 /// The resource instance types on which this expression is defined.
5198 /// The format is `<SERVICE_NAME>/<type>`.
5199 /// For example: `compute.googleapis.com/Instance`
5200 ResourceTypesValues(std::boxed::Box<crate::model::StringList>),
5201 }
5202}
5203
5204/// The metadata for the long-running operation.
5205#[derive(Clone, Default, PartialEq)]
5206#[non_exhaustive]
5207pub struct OperationMetadata {
5208 /// Output only. The time the operation was created.
5209 pub create_time: std::option::Option<wkt::Timestamp>,
5210
5211 /// Output only. The time the operation finished running.
5212 pub end_time: std::option::Option<wkt::Timestamp>,
5213
5214 /// Output only. The server-defined resource path for the target of the
5215 /// operation.
5216 pub target: std::string::String,
5217
5218 /// Output only. The name of the verb that was executed by the operation.
5219 pub verb: std::string::String,
5220
5221 /// Output only. The human-readable status of the operation, if any.
5222 pub status_message: std::string::String,
5223
5224 /// Output only. Identifies whether the user has requested that the operation
5225 /// be cancelled. If an operation was cancelled successfully, then the field
5226 /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
5227 /// contains the value [google.rpc.Code.CANCELLED][google.rpc.Code.CANCELLED].
5228 ///
5229 /// [google.longrunning.Operation.error]: longrunning::model::Operation::result
5230 pub requested_cancellation: bool,
5231
5232 /// Output only. The API version that was used to start the operation.
5233 pub api_version: std::string::String,
5234
5235 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5236}
5237
5238impl OperationMetadata {
5239 pub fn new() -> Self {
5240 std::default::Default::default()
5241 }
5242
5243 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
5244 ///
5245 /// # Example
5246 /// ```ignore,no_run
5247 /// # use google_cloud_cloudsecuritycompliance_v1::model::OperationMetadata;
5248 /// use wkt::Timestamp;
5249 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
5250 /// ```
5251 pub fn set_create_time<T>(mut self, v: T) -> Self
5252 where
5253 T: std::convert::Into<wkt::Timestamp>,
5254 {
5255 self.create_time = std::option::Option::Some(v.into());
5256 self
5257 }
5258
5259 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
5260 ///
5261 /// # Example
5262 /// ```ignore,no_run
5263 /// # use google_cloud_cloudsecuritycompliance_v1::model::OperationMetadata;
5264 /// use wkt::Timestamp;
5265 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5266 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
5267 /// ```
5268 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5269 where
5270 T: std::convert::Into<wkt::Timestamp>,
5271 {
5272 self.create_time = v.map(|x| x.into());
5273 self
5274 }
5275
5276 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
5277 ///
5278 /// # Example
5279 /// ```ignore,no_run
5280 /// # use google_cloud_cloudsecuritycompliance_v1::model::OperationMetadata;
5281 /// use wkt::Timestamp;
5282 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
5283 /// ```
5284 pub fn set_end_time<T>(mut self, v: T) -> Self
5285 where
5286 T: std::convert::Into<wkt::Timestamp>,
5287 {
5288 self.end_time = std::option::Option::Some(v.into());
5289 self
5290 }
5291
5292 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
5293 ///
5294 /// # Example
5295 /// ```ignore,no_run
5296 /// # use google_cloud_cloudsecuritycompliance_v1::model::OperationMetadata;
5297 /// use wkt::Timestamp;
5298 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
5299 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
5300 /// ```
5301 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
5302 where
5303 T: std::convert::Into<wkt::Timestamp>,
5304 {
5305 self.end_time = v.map(|x| x.into());
5306 self
5307 }
5308
5309 /// Sets the value of [target][crate::model::OperationMetadata::target].
5310 ///
5311 /// # Example
5312 /// ```ignore,no_run
5313 /// # use google_cloud_cloudsecuritycompliance_v1::model::OperationMetadata;
5314 /// let x = OperationMetadata::new().set_target("example");
5315 /// ```
5316 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5317 self.target = v.into();
5318 self
5319 }
5320
5321 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
5322 ///
5323 /// # Example
5324 /// ```ignore,no_run
5325 /// # use google_cloud_cloudsecuritycompliance_v1::model::OperationMetadata;
5326 /// let x = OperationMetadata::new().set_verb("example");
5327 /// ```
5328 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5329 self.verb = v.into();
5330 self
5331 }
5332
5333 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
5334 ///
5335 /// # Example
5336 /// ```ignore,no_run
5337 /// # use google_cloud_cloudsecuritycompliance_v1::model::OperationMetadata;
5338 /// let x = OperationMetadata::new().set_status_message("example");
5339 /// ```
5340 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5341 self.status_message = v.into();
5342 self
5343 }
5344
5345 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
5346 ///
5347 /// # Example
5348 /// ```ignore,no_run
5349 /// # use google_cloud_cloudsecuritycompliance_v1::model::OperationMetadata;
5350 /// let x = OperationMetadata::new().set_requested_cancellation(true);
5351 /// ```
5352 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5353 self.requested_cancellation = v.into();
5354 self
5355 }
5356
5357 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
5358 ///
5359 /// # Example
5360 /// ```ignore,no_run
5361 /// # use google_cloud_cloudsecuritycompliance_v1::model::OperationMetadata;
5362 /// let x = OperationMetadata::new().set_api_version("example");
5363 /// ```
5364 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5365 self.api_version = v.into();
5366 self
5367 }
5368}
5369
5370impl wkt::message::Message for OperationMetadata {
5371 fn typename() -> &'static str {
5372 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.OperationMetadata"
5373 }
5374}
5375
5376/// The regulatory family of the control.
5377#[derive(Clone, Default, PartialEq)]
5378#[non_exhaustive]
5379pub struct ControlFamily {
5380 /// The identifier for the regulatory control family.
5381 pub family_id: std::string::String,
5382
5383 /// The friendly name for the regulatory control family.
5384 pub display_name: std::string::String,
5385
5386 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5387}
5388
5389impl ControlFamily {
5390 pub fn new() -> Self {
5391 std::default::Default::default()
5392 }
5393
5394 /// Sets the value of [family_id][crate::model::ControlFamily::family_id].
5395 ///
5396 /// # Example
5397 /// ```ignore,no_run
5398 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlFamily;
5399 /// let x = ControlFamily::new().set_family_id("example");
5400 /// ```
5401 pub fn set_family_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5402 self.family_id = v.into();
5403 self
5404 }
5405
5406 /// Sets the value of [display_name][crate::model::ControlFamily::display_name].
5407 ///
5408 /// # Example
5409 /// ```ignore,no_run
5410 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlFamily;
5411 /// let x = ControlFamily::new().set_display_name("example");
5412 /// ```
5413 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5414 self.display_name = v.into();
5415 self
5416 }
5417}
5418
5419impl wkt::message::Message for ControlFamily {
5420 fn typename() -> &'static str {
5421 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ControlFamily"
5422 }
5423}
5424
5425/// Request message for [ListFrameworks][].
5426#[derive(Clone, Default, PartialEq)]
5427#[non_exhaustive]
5428pub struct ListFrameworksRequest {
5429 /// Required. The parent resource name, in the format
5430 /// `organizations/{organization}/locations/{location}`.
5431 /// The only supported location is `global`.
5432 pub parent: std::string::String,
5433
5434 /// Optional. The maximum number of frameworks to return. The default value is
5435 /// `500`.
5436 ///
5437 /// If you exceed the maximum value of `1000`, then the service uses the
5438 /// maximum value.
5439 pub page_size: i32,
5440
5441 /// Optional. A pagination token returned from a previous request to list
5442 /// frameworks. Provide this token to retrieve the next page of results.
5443 pub page_token: std::string::String,
5444
5445 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5446}
5447
5448impl ListFrameworksRequest {
5449 pub fn new() -> Self {
5450 std::default::Default::default()
5451 }
5452
5453 /// Sets the value of [parent][crate::model::ListFrameworksRequest::parent].
5454 ///
5455 /// # Example
5456 /// ```ignore,no_run
5457 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworksRequest;
5458 /// let x = ListFrameworksRequest::new().set_parent("example");
5459 /// ```
5460 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5461 self.parent = v.into();
5462 self
5463 }
5464
5465 /// Sets the value of [page_size][crate::model::ListFrameworksRequest::page_size].
5466 ///
5467 /// # Example
5468 /// ```ignore,no_run
5469 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworksRequest;
5470 /// let x = ListFrameworksRequest::new().set_page_size(42);
5471 /// ```
5472 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5473 self.page_size = v.into();
5474 self
5475 }
5476
5477 /// Sets the value of [page_token][crate::model::ListFrameworksRequest::page_token].
5478 ///
5479 /// # Example
5480 /// ```ignore,no_run
5481 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworksRequest;
5482 /// let x = ListFrameworksRequest::new().set_page_token("example");
5483 /// ```
5484 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5485 self.page_token = v.into();
5486 self
5487 }
5488}
5489
5490impl wkt::message::Message for ListFrameworksRequest {
5491 fn typename() -> &'static str {
5492 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFrameworksRequest"
5493 }
5494}
5495
5496/// The response message for [ListFrameworks][].
5497/// Returns a paginated list of Framework resources.
5498#[derive(Clone, Default, PartialEq)]
5499#[non_exhaustive]
5500pub struct ListFrameworksResponse {
5501 /// The list of framework resources.
5502 pub frameworks: std::vec::Vec<crate::model::Framework>,
5503
5504 /// A pagination token. To retrieve the next page of results, call the method
5505 /// again with this token.
5506 pub next_page_token: std::string::String,
5507
5508 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5509}
5510
5511impl ListFrameworksResponse {
5512 pub fn new() -> Self {
5513 std::default::Default::default()
5514 }
5515
5516 /// Sets the value of [frameworks][crate::model::ListFrameworksResponse::frameworks].
5517 ///
5518 /// # Example
5519 /// ```ignore,no_run
5520 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworksResponse;
5521 /// use google_cloud_cloudsecuritycompliance_v1::model::Framework;
5522 /// let x = ListFrameworksResponse::new()
5523 /// .set_frameworks([
5524 /// Framework::default()/* use setters */,
5525 /// Framework::default()/* use (different) setters */,
5526 /// ]);
5527 /// ```
5528 pub fn set_frameworks<T, V>(mut self, v: T) -> Self
5529 where
5530 T: std::iter::IntoIterator<Item = V>,
5531 V: std::convert::Into<crate::model::Framework>,
5532 {
5533 use std::iter::Iterator;
5534 self.frameworks = v.into_iter().map(|i| i.into()).collect();
5535 self
5536 }
5537
5538 /// Sets the value of [next_page_token][crate::model::ListFrameworksResponse::next_page_token].
5539 ///
5540 /// # Example
5541 /// ```ignore,no_run
5542 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworksResponse;
5543 /// let x = ListFrameworksResponse::new().set_next_page_token("example");
5544 /// ```
5545 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5546 self.next_page_token = v.into();
5547 self
5548 }
5549}
5550
5551impl wkt::message::Message for ListFrameworksResponse {
5552 fn typename() -> &'static str {
5553 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFrameworksResponse"
5554 }
5555}
5556
5557#[doc(hidden)]
5558impl gax::paginator::internal::PageableResponse for ListFrameworksResponse {
5559 type PageItem = crate::model::Framework;
5560
5561 fn items(self) -> std::vec::Vec<Self::PageItem> {
5562 self.frameworks
5563 }
5564
5565 fn next_page_token(&self) -> std::string::String {
5566 use std::clone::Clone;
5567 self.next_page_token.clone()
5568 }
5569}
5570
5571/// The request message for [GetFramework][].
5572#[derive(Clone, Default, PartialEq)]
5573#[non_exhaustive]
5574pub struct GetFrameworkRequest {
5575 /// Required. The name of the framework to retrieve, in the format
5576 /// `organizations/{organization}/locations/{location}/frameworks/{framework_id}`
5577 /// The only supported location is `global`.
5578 pub name: std::string::String,
5579
5580 /// Optional. The framework major version to retrieve. If not specified, the
5581 /// most recently updated `revision_id` is retrieved.
5582 pub major_revision_id: i64,
5583
5584 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5585}
5586
5587impl GetFrameworkRequest {
5588 pub fn new() -> Self {
5589 std::default::Default::default()
5590 }
5591
5592 /// Sets the value of [name][crate::model::GetFrameworkRequest::name].
5593 ///
5594 /// # Example
5595 /// ```ignore,no_run
5596 /// # use google_cloud_cloudsecuritycompliance_v1::model::GetFrameworkRequest;
5597 /// let x = GetFrameworkRequest::new().set_name("example");
5598 /// ```
5599 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5600 self.name = v.into();
5601 self
5602 }
5603
5604 /// Sets the value of [major_revision_id][crate::model::GetFrameworkRequest::major_revision_id].
5605 ///
5606 /// # Example
5607 /// ```ignore,no_run
5608 /// # use google_cloud_cloudsecuritycompliance_v1::model::GetFrameworkRequest;
5609 /// let x = GetFrameworkRequest::new().set_major_revision_id(42);
5610 /// ```
5611 pub fn set_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5612 self.major_revision_id = v.into();
5613 self
5614 }
5615}
5616
5617impl wkt::message::Message for GetFrameworkRequest {
5618 fn typename() -> &'static str {
5619 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.GetFrameworkRequest"
5620 }
5621}
5622
5623/// The request message for [CreateFramework][].
5624#[derive(Clone, Default, PartialEq)]
5625#[non_exhaustive]
5626pub struct CreateFrameworkRequest {
5627 /// Required. The parent resource name, in the format
5628 /// `organizations/{organization}/locations/{location}`.
5629 /// The only supported location is `global`.
5630 pub parent: std::string::String,
5631
5632 /// Required. The identifier (ID) of the framework. The ID is not the full name
5633 /// of the framework; it's the last part of the full name of the framework.
5634 pub framework_id: std::string::String,
5635
5636 /// Required. The resource being created.
5637 pub framework: std::option::Option<crate::model::Framework>,
5638
5639 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5640}
5641
5642impl CreateFrameworkRequest {
5643 pub fn new() -> Self {
5644 std::default::Default::default()
5645 }
5646
5647 /// Sets the value of [parent][crate::model::CreateFrameworkRequest::parent].
5648 ///
5649 /// # Example
5650 /// ```ignore,no_run
5651 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkRequest;
5652 /// let x = CreateFrameworkRequest::new().set_parent("example");
5653 /// ```
5654 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5655 self.parent = v.into();
5656 self
5657 }
5658
5659 /// Sets the value of [framework_id][crate::model::CreateFrameworkRequest::framework_id].
5660 ///
5661 /// # Example
5662 /// ```ignore,no_run
5663 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkRequest;
5664 /// let x = CreateFrameworkRequest::new().set_framework_id("example");
5665 /// ```
5666 pub fn set_framework_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5667 self.framework_id = v.into();
5668 self
5669 }
5670
5671 /// Sets the value of [framework][crate::model::CreateFrameworkRequest::framework].
5672 ///
5673 /// # Example
5674 /// ```ignore,no_run
5675 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkRequest;
5676 /// use google_cloud_cloudsecuritycompliance_v1::model::Framework;
5677 /// let x = CreateFrameworkRequest::new().set_framework(Framework::default()/* use setters */);
5678 /// ```
5679 pub fn set_framework<T>(mut self, v: T) -> Self
5680 where
5681 T: std::convert::Into<crate::model::Framework>,
5682 {
5683 self.framework = std::option::Option::Some(v.into());
5684 self
5685 }
5686
5687 /// Sets or clears the value of [framework][crate::model::CreateFrameworkRequest::framework].
5688 ///
5689 /// # Example
5690 /// ```ignore,no_run
5691 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkRequest;
5692 /// use google_cloud_cloudsecuritycompliance_v1::model::Framework;
5693 /// let x = CreateFrameworkRequest::new().set_or_clear_framework(Some(Framework::default()/* use setters */));
5694 /// let x = CreateFrameworkRequest::new().set_or_clear_framework(None::<Framework>);
5695 /// ```
5696 pub fn set_or_clear_framework<T>(mut self, v: std::option::Option<T>) -> Self
5697 where
5698 T: std::convert::Into<crate::model::Framework>,
5699 {
5700 self.framework = v.map(|x| x.into());
5701 self
5702 }
5703}
5704
5705impl wkt::message::Message for CreateFrameworkRequest {
5706 fn typename() -> &'static str {
5707 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CreateFrameworkRequest"
5708 }
5709}
5710
5711/// The request message for [UpdateFramework][].
5712#[derive(Clone, Default, PartialEq)]
5713#[non_exhaustive]
5714pub struct UpdateFrameworkRequest {
5715 /// Optional. A field mask is used to specify the fields to be overwritten in
5716 /// the framework resource by the update. The fields specified in the
5717 /// `update_mask` are relative to the resource, not the full request. A field
5718 /// is overwritten if it is in the mask. If you don't provide a mask then all
5719 /// fields present in the request will be overwritten.
5720 pub update_mask: std::option::Option<wkt::FieldMask>,
5721
5722 /// Required. The resource that is being updated.
5723 pub framework: std::option::Option<crate::model::Framework>,
5724
5725 /// Optional. The major version ID of the framework to update.
5726 pub major_revision_id: i64,
5727
5728 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5729}
5730
5731impl UpdateFrameworkRequest {
5732 pub fn new() -> Self {
5733 std::default::Default::default()
5734 }
5735
5736 /// Sets the value of [update_mask][crate::model::UpdateFrameworkRequest::update_mask].
5737 ///
5738 /// # Example
5739 /// ```ignore,no_run
5740 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateFrameworkRequest;
5741 /// use wkt::FieldMask;
5742 /// let x = UpdateFrameworkRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5743 /// ```
5744 pub fn set_update_mask<T>(mut self, v: T) -> Self
5745 where
5746 T: std::convert::Into<wkt::FieldMask>,
5747 {
5748 self.update_mask = std::option::Option::Some(v.into());
5749 self
5750 }
5751
5752 /// Sets or clears the value of [update_mask][crate::model::UpdateFrameworkRequest::update_mask].
5753 ///
5754 /// # Example
5755 /// ```ignore,no_run
5756 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateFrameworkRequest;
5757 /// use wkt::FieldMask;
5758 /// let x = UpdateFrameworkRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5759 /// let x = UpdateFrameworkRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5760 /// ```
5761 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5762 where
5763 T: std::convert::Into<wkt::FieldMask>,
5764 {
5765 self.update_mask = v.map(|x| x.into());
5766 self
5767 }
5768
5769 /// Sets the value of [framework][crate::model::UpdateFrameworkRequest::framework].
5770 ///
5771 /// # Example
5772 /// ```ignore,no_run
5773 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateFrameworkRequest;
5774 /// use google_cloud_cloudsecuritycompliance_v1::model::Framework;
5775 /// let x = UpdateFrameworkRequest::new().set_framework(Framework::default()/* use setters */);
5776 /// ```
5777 pub fn set_framework<T>(mut self, v: T) -> Self
5778 where
5779 T: std::convert::Into<crate::model::Framework>,
5780 {
5781 self.framework = std::option::Option::Some(v.into());
5782 self
5783 }
5784
5785 /// Sets or clears the value of [framework][crate::model::UpdateFrameworkRequest::framework].
5786 ///
5787 /// # Example
5788 /// ```ignore,no_run
5789 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateFrameworkRequest;
5790 /// use google_cloud_cloudsecuritycompliance_v1::model::Framework;
5791 /// let x = UpdateFrameworkRequest::new().set_or_clear_framework(Some(Framework::default()/* use setters */));
5792 /// let x = UpdateFrameworkRequest::new().set_or_clear_framework(None::<Framework>);
5793 /// ```
5794 pub fn set_or_clear_framework<T>(mut self, v: std::option::Option<T>) -> Self
5795 where
5796 T: std::convert::Into<crate::model::Framework>,
5797 {
5798 self.framework = v.map(|x| x.into());
5799 self
5800 }
5801
5802 /// Sets the value of [major_revision_id][crate::model::UpdateFrameworkRequest::major_revision_id].
5803 ///
5804 /// # Example
5805 /// ```ignore,no_run
5806 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateFrameworkRequest;
5807 /// let x = UpdateFrameworkRequest::new().set_major_revision_id(42);
5808 /// ```
5809 pub fn set_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5810 self.major_revision_id = v.into();
5811 self
5812 }
5813}
5814
5815impl wkt::message::Message for UpdateFrameworkRequest {
5816 fn typename() -> &'static str {
5817 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.UpdateFrameworkRequest"
5818 }
5819}
5820
5821/// Request message for [DeleteFramework][].
5822#[derive(Clone, Default, PartialEq)]
5823#[non_exhaustive]
5824pub struct DeleteFrameworkRequest {
5825 /// Required. The name of the resource, in the format
5826 /// `organizations/{organization}/locations/{location}/frameworks/{framework}`.
5827 /// The only supported location is `global`.
5828 pub name: std::string::String,
5829
5830 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5831}
5832
5833impl DeleteFrameworkRequest {
5834 pub fn new() -> Self {
5835 std::default::Default::default()
5836 }
5837
5838 /// Sets the value of [name][crate::model::DeleteFrameworkRequest::name].
5839 ///
5840 /// # Example
5841 /// ```ignore,no_run
5842 /// # use google_cloud_cloudsecuritycompliance_v1::model::DeleteFrameworkRequest;
5843 /// let x = DeleteFrameworkRequest::new().set_name("example");
5844 /// ```
5845 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5846 self.name = v.into();
5847 self
5848 }
5849}
5850
5851impl wkt::message::Message for DeleteFrameworkRequest {
5852 fn typename() -> &'static str {
5853 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.DeleteFrameworkRequest"
5854 }
5855}
5856
5857/// Request message for [ListCloudControls][].
5858#[derive(Clone, Default, PartialEq)]
5859#[non_exhaustive]
5860pub struct ListCloudControlsRequest {
5861 /// Required. The parent resource name, in the format
5862 /// `organizations/{organization}/locations/{location}`.
5863 /// The only supported location is `global`.
5864 pub parent: std::string::String,
5865
5866 /// Optional. The maximum number of cloud controls to return. The default value
5867 /// is `500`.
5868 ///
5869 /// If you exceed the maximum value of `1000`, then the service uses the
5870 /// maximum value.
5871 pub page_size: i32,
5872
5873 /// Optional. A pagination token that's returned from a previous request to
5874 /// list cloud controls. Provide this token to retrieve the next page of
5875 /// results.
5876 ///
5877 /// When paginating, the parent that you provide to the
5878 /// [ListCloudControls][google.cloud.cloudsecuritycompliance.v1.Config.ListCloudControls]
5879 /// request must match the call that provided the page token.
5880 ///
5881 /// [google.cloud.cloudsecuritycompliance.v1.Config.ListCloudControls]: crate::client::Config::list_cloud_controls
5882 pub page_token: std::string::String,
5883
5884 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5885}
5886
5887impl ListCloudControlsRequest {
5888 pub fn new() -> Self {
5889 std::default::Default::default()
5890 }
5891
5892 /// Sets the value of [parent][crate::model::ListCloudControlsRequest::parent].
5893 ///
5894 /// # Example
5895 /// ```ignore,no_run
5896 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlsRequest;
5897 /// let x = ListCloudControlsRequest::new().set_parent("example");
5898 /// ```
5899 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5900 self.parent = v.into();
5901 self
5902 }
5903
5904 /// Sets the value of [page_size][crate::model::ListCloudControlsRequest::page_size].
5905 ///
5906 /// # Example
5907 /// ```ignore,no_run
5908 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlsRequest;
5909 /// let x = ListCloudControlsRequest::new().set_page_size(42);
5910 /// ```
5911 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5912 self.page_size = v.into();
5913 self
5914 }
5915
5916 /// Sets the value of [page_token][crate::model::ListCloudControlsRequest::page_token].
5917 ///
5918 /// # Example
5919 /// ```ignore,no_run
5920 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlsRequest;
5921 /// let x = ListCloudControlsRequest::new().set_page_token("example");
5922 /// ```
5923 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5924 self.page_token = v.into();
5925 self
5926 }
5927}
5928
5929impl wkt::message::Message for ListCloudControlsRequest {
5930 fn typename() -> &'static str {
5931 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListCloudControlsRequest"
5932 }
5933}
5934
5935/// The response message for [ListCloudControls][].
5936#[derive(Clone, Default, PartialEq)]
5937#[non_exhaustive]
5938pub struct ListCloudControlsResponse {
5939 /// The list of CloudControl resources.
5940 pub cloud_controls: std::vec::Vec<crate::model::CloudControl>,
5941
5942 /// A pagination token. To retrieve the next page of results, call the method
5943 /// again with this token.
5944 pub next_page_token: std::string::String,
5945
5946 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5947}
5948
5949impl ListCloudControlsResponse {
5950 pub fn new() -> Self {
5951 std::default::Default::default()
5952 }
5953
5954 /// Sets the value of [cloud_controls][crate::model::ListCloudControlsResponse::cloud_controls].
5955 ///
5956 /// # Example
5957 /// ```ignore,no_run
5958 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlsResponse;
5959 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
5960 /// let x = ListCloudControlsResponse::new()
5961 /// .set_cloud_controls([
5962 /// CloudControl::default()/* use setters */,
5963 /// CloudControl::default()/* use (different) setters */,
5964 /// ]);
5965 /// ```
5966 pub fn set_cloud_controls<T, V>(mut self, v: T) -> Self
5967 where
5968 T: std::iter::IntoIterator<Item = V>,
5969 V: std::convert::Into<crate::model::CloudControl>,
5970 {
5971 use std::iter::Iterator;
5972 self.cloud_controls = v.into_iter().map(|i| i.into()).collect();
5973 self
5974 }
5975
5976 /// Sets the value of [next_page_token][crate::model::ListCloudControlsResponse::next_page_token].
5977 ///
5978 /// # Example
5979 /// ```ignore,no_run
5980 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlsResponse;
5981 /// let x = ListCloudControlsResponse::new().set_next_page_token("example");
5982 /// ```
5983 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5984 self.next_page_token = v.into();
5985 self
5986 }
5987}
5988
5989impl wkt::message::Message for ListCloudControlsResponse {
5990 fn typename() -> &'static str {
5991 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListCloudControlsResponse"
5992 }
5993}
5994
5995#[doc(hidden)]
5996impl gax::paginator::internal::PageableResponse for ListCloudControlsResponse {
5997 type PageItem = crate::model::CloudControl;
5998
5999 fn items(self) -> std::vec::Vec<Self::PageItem> {
6000 self.cloud_controls
6001 }
6002
6003 fn next_page_token(&self) -> std::string::String {
6004 use std::clone::Clone;
6005 self.next_page_token.clone()
6006 }
6007}
6008
6009/// The request message for [GetCloudControl][].
6010#[derive(Clone, Default, PartialEq)]
6011#[non_exhaustive]
6012pub struct GetCloudControlRequest {
6013 /// Required. The name of the cloud control to retrieve, in the format
6014 /// `organizations/{organization}/locations/{location}/cloudControls/{cloud_control}`.
6015 /// The only supported location is `global`.
6016 pub name: std::string::String,
6017
6018 /// Optional. The major version of the cloud control to retrieve. If not
6019 /// specified, the most recently updated `revision_id` is retrieved.
6020 pub major_revision_id: i64,
6021
6022 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6023}
6024
6025impl GetCloudControlRequest {
6026 pub fn new() -> Self {
6027 std::default::Default::default()
6028 }
6029
6030 /// Sets the value of [name][crate::model::GetCloudControlRequest::name].
6031 ///
6032 /// # Example
6033 /// ```ignore,no_run
6034 /// # use google_cloud_cloudsecuritycompliance_v1::model::GetCloudControlRequest;
6035 /// let x = GetCloudControlRequest::new().set_name("example");
6036 /// ```
6037 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6038 self.name = v.into();
6039 self
6040 }
6041
6042 /// Sets the value of [major_revision_id][crate::model::GetCloudControlRequest::major_revision_id].
6043 ///
6044 /// # Example
6045 /// ```ignore,no_run
6046 /// # use google_cloud_cloudsecuritycompliance_v1::model::GetCloudControlRequest;
6047 /// let x = GetCloudControlRequest::new().set_major_revision_id(42);
6048 /// ```
6049 pub fn set_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6050 self.major_revision_id = v.into();
6051 self
6052 }
6053}
6054
6055impl wkt::message::Message for GetCloudControlRequest {
6056 fn typename() -> &'static str {
6057 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.GetCloudControlRequest"
6058 }
6059}
6060
6061/// The request message for [CreateCloudControl][].
6062#[derive(Clone, Default, PartialEq)]
6063#[non_exhaustive]
6064pub struct CreateCloudControlRequest {
6065 /// Required. The parent resource name, in the format
6066 /// `organizations/{organization}/locations/{location}`.
6067 /// The only supported location is `global`.
6068 pub parent: std::string::String,
6069
6070 /// Required. The identifier for the cloud control, which is the last segment
6071 /// of the cloud control name. The format is
6072 /// `^[a-zA-Z][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]$`.
6073 pub cloud_control_id: std::string::String,
6074
6075 /// Required. The cloud control that's being created.
6076 pub cloud_control: std::option::Option<crate::model::CloudControl>,
6077
6078 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6079}
6080
6081impl CreateCloudControlRequest {
6082 pub fn new() -> Self {
6083 std::default::Default::default()
6084 }
6085
6086 /// Sets the value of [parent][crate::model::CreateCloudControlRequest::parent].
6087 ///
6088 /// # Example
6089 /// ```ignore,no_run
6090 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateCloudControlRequest;
6091 /// let x = CreateCloudControlRequest::new().set_parent("example");
6092 /// ```
6093 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6094 self.parent = v.into();
6095 self
6096 }
6097
6098 /// Sets the value of [cloud_control_id][crate::model::CreateCloudControlRequest::cloud_control_id].
6099 ///
6100 /// # Example
6101 /// ```ignore,no_run
6102 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateCloudControlRequest;
6103 /// let x = CreateCloudControlRequest::new().set_cloud_control_id("example");
6104 /// ```
6105 pub fn set_cloud_control_id<T: std::convert::Into<std::string::String>>(
6106 mut self,
6107 v: T,
6108 ) -> Self {
6109 self.cloud_control_id = v.into();
6110 self
6111 }
6112
6113 /// Sets the value of [cloud_control][crate::model::CreateCloudControlRequest::cloud_control].
6114 ///
6115 /// # Example
6116 /// ```ignore,no_run
6117 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateCloudControlRequest;
6118 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
6119 /// let x = CreateCloudControlRequest::new().set_cloud_control(CloudControl::default()/* use setters */);
6120 /// ```
6121 pub fn set_cloud_control<T>(mut self, v: T) -> Self
6122 where
6123 T: std::convert::Into<crate::model::CloudControl>,
6124 {
6125 self.cloud_control = std::option::Option::Some(v.into());
6126 self
6127 }
6128
6129 /// Sets or clears the value of [cloud_control][crate::model::CreateCloudControlRequest::cloud_control].
6130 ///
6131 /// # Example
6132 /// ```ignore,no_run
6133 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateCloudControlRequest;
6134 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
6135 /// let x = CreateCloudControlRequest::new().set_or_clear_cloud_control(Some(CloudControl::default()/* use setters */));
6136 /// let x = CreateCloudControlRequest::new().set_or_clear_cloud_control(None::<CloudControl>);
6137 /// ```
6138 pub fn set_or_clear_cloud_control<T>(mut self, v: std::option::Option<T>) -> Self
6139 where
6140 T: std::convert::Into<crate::model::CloudControl>,
6141 {
6142 self.cloud_control = v.map(|x| x.into());
6143 self
6144 }
6145}
6146
6147impl wkt::message::Message for CreateCloudControlRequest {
6148 fn typename() -> &'static str {
6149 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CreateCloudControlRequest"
6150 }
6151}
6152
6153/// The request message for [UpdateCloudControl][].
6154#[derive(Clone, Default, PartialEq)]
6155#[non_exhaustive]
6156pub struct UpdateCloudControlRequest {
6157 /// Optional. Use a field mask to specify the fields to be overwritten in the
6158 /// cloud control during the update.
6159 /// The fields that you specify in the `update_mask` are relative to the
6160 /// cloud control, not the full request. A field is overwritten if it is in
6161 /// the mask. If you don't provide a mask, all fields in the request
6162 /// are updated.
6163 ///
6164 /// You can update the following fields:
6165 ///
6166 /// - Display name
6167 /// - Description
6168 /// - Parameters
6169 /// - Rules
6170 /// - Parameter specification
6171 pub update_mask: std::option::Option<wkt::FieldMask>,
6172
6173 /// Required. The cloud control that you're updating.
6174 pub cloud_control: std::option::Option<crate::model::CloudControl>,
6175
6176 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6177}
6178
6179impl UpdateCloudControlRequest {
6180 pub fn new() -> Self {
6181 std::default::Default::default()
6182 }
6183
6184 /// Sets the value of [update_mask][crate::model::UpdateCloudControlRequest::update_mask].
6185 ///
6186 /// # Example
6187 /// ```ignore,no_run
6188 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateCloudControlRequest;
6189 /// use wkt::FieldMask;
6190 /// let x = UpdateCloudControlRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6191 /// ```
6192 pub fn set_update_mask<T>(mut self, v: T) -> Self
6193 where
6194 T: std::convert::Into<wkt::FieldMask>,
6195 {
6196 self.update_mask = std::option::Option::Some(v.into());
6197 self
6198 }
6199
6200 /// Sets or clears the value of [update_mask][crate::model::UpdateCloudControlRequest::update_mask].
6201 ///
6202 /// # Example
6203 /// ```ignore,no_run
6204 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateCloudControlRequest;
6205 /// use wkt::FieldMask;
6206 /// let x = UpdateCloudControlRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6207 /// let x = UpdateCloudControlRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6208 /// ```
6209 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6210 where
6211 T: std::convert::Into<wkt::FieldMask>,
6212 {
6213 self.update_mask = v.map(|x| x.into());
6214 self
6215 }
6216
6217 /// Sets the value of [cloud_control][crate::model::UpdateCloudControlRequest::cloud_control].
6218 ///
6219 /// # Example
6220 /// ```ignore,no_run
6221 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateCloudControlRequest;
6222 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
6223 /// let x = UpdateCloudControlRequest::new().set_cloud_control(CloudControl::default()/* use setters */);
6224 /// ```
6225 pub fn set_cloud_control<T>(mut self, v: T) -> Self
6226 where
6227 T: std::convert::Into<crate::model::CloudControl>,
6228 {
6229 self.cloud_control = std::option::Option::Some(v.into());
6230 self
6231 }
6232
6233 /// Sets or clears the value of [cloud_control][crate::model::UpdateCloudControlRequest::cloud_control].
6234 ///
6235 /// # Example
6236 /// ```ignore,no_run
6237 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateCloudControlRequest;
6238 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
6239 /// let x = UpdateCloudControlRequest::new().set_or_clear_cloud_control(Some(CloudControl::default()/* use setters */));
6240 /// let x = UpdateCloudControlRequest::new().set_or_clear_cloud_control(None::<CloudControl>);
6241 /// ```
6242 pub fn set_or_clear_cloud_control<T>(mut self, v: std::option::Option<T>) -> Self
6243 where
6244 T: std::convert::Into<crate::model::CloudControl>,
6245 {
6246 self.cloud_control = v.map(|x| x.into());
6247 self
6248 }
6249}
6250
6251impl wkt::message::Message for UpdateCloudControlRequest {
6252 fn typename() -> &'static str {
6253 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.UpdateCloudControlRequest"
6254 }
6255}
6256
6257/// The request message for [DeleteCloudControl][].
6258#[derive(Clone, Default, PartialEq)]
6259#[non_exhaustive]
6260pub struct DeleteCloudControlRequest {
6261 /// Required. The name of the cloud control to delete, in the format
6262 /// `organizations/{organization}/locations/{location}/CloudControls/{CloudControl}`.
6263 /// The only supported location is `global`.
6264 pub name: std::string::String,
6265
6266 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6267}
6268
6269impl DeleteCloudControlRequest {
6270 pub fn new() -> Self {
6271 std::default::Default::default()
6272 }
6273
6274 /// Sets the value of [name][crate::model::DeleteCloudControlRequest::name].
6275 ///
6276 /// # Example
6277 /// ```ignore,no_run
6278 /// # use google_cloud_cloudsecuritycompliance_v1::model::DeleteCloudControlRequest;
6279 /// let x = DeleteCloudControlRequest::new().set_name("example");
6280 /// ```
6281 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6282 self.name = v.into();
6283 self
6284 }
6285}
6286
6287impl wkt::message::Message for DeleteCloudControlRequest {
6288 fn typename() -> &'static str {
6289 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.DeleteCloudControlRequest"
6290 }
6291}
6292
6293/// Framework deployments represent the assignment of a framework to a target
6294/// resource. Supported target resources are organizations, folders, and
6295/// projects.
6296#[derive(Clone, Default, PartialEq)]
6297#[non_exhaustive]
6298pub struct FrameworkDeployment {
6299 /// Identifier. The name of the framework deployment, in the format
6300 /// `organizations/{organization}/locations/{location}/frameworkDeployments/{framework_deployment_id}`.
6301 /// The only supported location is `global`.
6302 pub name: std::string::String,
6303
6304 /// Required. The details of the target resource that you want to deploy the
6305 /// framework to. You can specify an existing resource, or create a new one.
6306 pub target_resource_config: std::option::Option<crate::model::TargetResourceConfig>,
6307
6308 /// Output only. The target resource to deploy the framework to, in one the
6309 /// following formats:
6310 ///
6311 /// - `organizations/{organizationID}`
6312 /// - `folders/{folderID}`
6313 /// - `projects/{projectID}`
6314 pub computed_target_resource: std::string::String,
6315
6316 /// Required. A reference to the framework that you're deploying.
6317 pub framework: std::option::Option<crate::model::FrameworkReference>,
6318
6319 /// Optional. A user-provided description of the framework deployment.
6320 pub description: std::string::String,
6321
6322 /// Required. The deployment mode and parameters for each of the cloud controls
6323 /// in the framework. Every cloud control in the framework includes metadata.
6324 pub cloud_control_metadata: std::vec::Vec<crate::model::CloudControlMetadata>,
6325
6326 /// Output only. The state for the framework deployment.
6327 pub deployment_state: crate::model::DeploymentState,
6328
6329 /// Output only. The time at which the resource was created.
6330 pub create_time: std::option::Option<wkt::Timestamp>,
6331
6332 /// Output only. The time at which the resource last updated.
6333 pub update_time: std::option::Option<wkt::Timestamp>,
6334
6335 /// Optional. To prevent concurrent updates from overwriting each other, always
6336 /// provide the `etag` when you update a framework deployment. You can also
6337 /// provide the `etag` when you delete a framework deployment, to help
6338 /// ensure that you're deleting the intended version of the
6339 /// framework deployment.
6340 pub etag: std::string::String,
6341
6342 /// Output only. The display name of the target resource.
6343 pub target_resource_display_name: std::string::String,
6344
6345 /// Output only. The references to the cloud control deployments. The reference
6346 /// includes all the cloud control deployments that are in the framework or in
6347 /// a cloud control group.
6348 ///
6349 /// For example, if a framework deployment deploys two
6350 /// cloud controls, `cc-deployment-1` and `cc-deployment-2`, then the
6351 /// references are:
6352 ///
6353 /// ```norust
6354 /// {
6355 /// cloud_control_deployment_reference: {
6356 /// cloud_control_deployment:
6357 /// "organizations/{organization}/locations/{location}/cloudControlDeployments/cc-deployment-1"
6358 /// },
6359 /// cloud_control_deployment_reference: {
6360 /// cloud_control_deployment:
6361 /// "organizations/{organization}/locations/{location}/cloudControlDeployments/cc-deployment-2"
6362 /// }
6363 /// ```
6364 pub cloud_control_deployment_references:
6365 std::vec::Vec<crate::model::CloudControlDeploymentReference>,
6366
6367 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6368}
6369
6370impl FrameworkDeployment {
6371 pub fn new() -> Self {
6372 std::default::Default::default()
6373 }
6374
6375 /// Sets the value of [name][crate::model::FrameworkDeployment::name].
6376 ///
6377 /// # Example
6378 /// ```ignore,no_run
6379 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
6380 /// let x = FrameworkDeployment::new().set_name("example");
6381 /// ```
6382 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6383 self.name = v.into();
6384 self
6385 }
6386
6387 /// Sets the value of [target_resource_config][crate::model::FrameworkDeployment::target_resource_config].
6388 ///
6389 /// # Example
6390 /// ```ignore,no_run
6391 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
6392 /// use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceConfig;
6393 /// let x = FrameworkDeployment::new().set_target_resource_config(TargetResourceConfig::default()/* use setters */);
6394 /// ```
6395 pub fn set_target_resource_config<T>(mut self, v: T) -> Self
6396 where
6397 T: std::convert::Into<crate::model::TargetResourceConfig>,
6398 {
6399 self.target_resource_config = std::option::Option::Some(v.into());
6400 self
6401 }
6402
6403 /// Sets or clears the value of [target_resource_config][crate::model::FrameworkDeployment::target_resource_config].
6404 ///
6405 /// # Example
6406 /// ```ignore,no_run
6407 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
6408 /// use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceConfig;
6409 /// let x = FrameworkDeployment::new().set_or_clear_target_resource_config(Some(TargetResourceConfig::default()/* use setters */));
6410 /// let x = FrameworkDeployment::new().set_or_clear_target_resource_config(None::<TargetResourceConfig>);
6411 /// ```
6412 pub fn set_or_clear_target_resource_config<T>(mut self, v: std::option::Option<T>) -> Self
6413 where
6414 T: std::convert::Into<crate::model::TargetResourceConfig>,
6415 {
6416 self.target_resource_config = v.map(|x| x.into());
6417 self
6418 }
6419
6420 /// Sets the value of [computed_target_resource][crate::model::FrameworkDeployment::computed_target_resource].
6421 ///
6422 /// # Example
6423 /// ```ignore,no_run
6424 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
6425 /// let x = FrameworkDeployment::new().set_computed_target_resource("example");
6426 /// ```
6427 pub fn set_computed_target_resource<T: std::convert::Into<std::string::String>>(
6428 mut self,
6429 v: T,
6430 ) -> Self {
6431 self.computed_target_resource = v.into();
6432 self
6433 }
6434
6435 /// Sets the value of [framework][crate::model::FrameworkDeployment::framework].
6436 ///
6437 /// # Example
6438 /// ```ignore,no_run
6439 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
6440 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkReference;
6441 /// let x = FrameworkDeployment::new().set_framework(FrameworkReference::default()/* use setters */);
6442 /// ```
6443 pub fn set_framework<T>(mut self, v: T) -> Self
6444 where
6445 T: std::convert::Into<crate::model::FrameworkReference>,
6446 {
6447 self.framework = std::option::Option::Some(v.into());
6448 self
6449 }
6450
6451 /// Sets or clears the value of [framework][crate::model::FrameworkDeployment::framework].
6452 ///
6453 /// # Example
6454 /// ```ignore,no_run
6455 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
6456 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkReference;
6457 /// let x = FrameworkDeployment::new().set_or_clear_framework(Some(FrameworkReference::default()/* use setters */));
6458 /// let x = FrameworkDeployment::new().set_or_clear_framework(None::<FrameworkReference>);
6459 /// ```
6460 pub fn set_or_clear_framework<T>(mut self, v: std::option::Option<T>) -> Self
6461 where
6462 T: std::convert::Into<crate::model::FrameworkReference>,
6463 {
6464 self.framework = v.map(|x| x.into());
6465 self
6466 }
6467
6468 /// Sets the value of [description][crate::model::FrameworkDeployment::description].
6469 ///
6470 /// # Example
6471 /// ```ignore,no_run
6472 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
6473 /// let x = FrameworkDeployment::new().set_description("example");
6474 /// ```
6475 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6476 self.description = v.into();
6477 self
6478 }
6479
6480 /// Sets the value of [cloud_control_metadata][crate::model::FrameworkDeployment::cloud_control_metadata].
6481 ///
6482 /// # Example
6483 /// ```ignore,no_run
6484 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
6485 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlMetadata;
6486 /// let x = FrameworkDeployment::new()
6487 /// .set_cloud_control_metadata([
6488 /// CloudControlMetadata::default()/* use setters */,
6489 /// CloudControlMetadata::default()/* use (different) setters */,
6490 /// ]);
6491 /// ```
6492 pub fn set_cloud_control_metadata<T, V>(mut self, v: T) -> Self
6493 where
6494 T: std::iter::IntoIterator<Item = V>,
6495 V: std::convert::Into<crate::model::CloudControlMetadata>,
6496 {
6497 use std::iter::Iterator;
6498 self.cloud_control_metadata = v.into_iter().map(|i| i.into()).collect();
6499 self
6500 }
6501
6502 /// Sets the value of [deployment_state][crate::model::FrameworkDeployment::deployment_state].
6503 ///
6504 /// # Example
6505 /// ```ignore,no_run
6506 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
6507 /// use google_cloud_cloudsecuritycompliance_v1::model::DeploymentState;
6508 /// let x0 = FrameworkDeployment::new().set_deployment_state(DeploymentState::Validating);
6509 /// let x1 = FrameworkDeployment::new().set_deployment_state(DeploymentState::Creating);
6510 /// let x2 = FrameworkDeployment::new().set_deployment_state(DeploymentState::Deleting);
6511 /// ```
6512 pub fn set_deployment_state<T: std::convert::Into<crate::model::DeploymentState>>(
6513 mut self,
6514 v: T,
6515 ) -> Self {
6516 self.deployment_state = v.into();
6517 self
6518 }
6519
6520 /// Sets the value of [create_time][crate::model::FrameworkDeployment::create_time].
6521 ///
6522 /// # Example
6523 /// ```ignore,no_run
6524 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
6525 /// use wkt::Timestamp;
6526 /// let x = FrameworkDeployment::new().set_create_time(Timestamp::default()/* use setters */);
6527 /// ```
6528 pub fn set_create_time<T>(mut self, v: T) -> Self
6529 where
6530 T: std::convert::Into<wkt::Timestamp>,
6531 {
6532 self.create_time = std::option::Option::Some(v.into());
6533 self
6534 }
6535
6536 /// Sets or clears the value of [create_time][crate::model::FrameworkDeployment::create_time].
6537 ///
6538 /// # Example
6539 /// ```ignore,no_run
6540 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
6541 /// use wkt::Timestamp;
6542 /// let x = FrameworkDeployment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6543 /// let x = FrameworkDeployment::new().set_or_clear_create_time(None::<Timestamp>);
6544 /// ```
6545 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6546 where
6547 T: std::convert::Into<wkt::Timestamp>,
6548 {
6549 self.create_time = v.map(|x| x.into());
6550 self
6551 }
6552
6553 /// Sets the value of [update_time][crate::model::FrameworkDeployment::update_time].
6554 ///
6555 /// # Example
6556 /// ```ignore,no_run
6557 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
6558 /// use wkt::Timestamp;
6559 /// let x = FrameworkDeployment::new().set_update_time(Timestamp::default()/* use setters */);
6560 /// ```
6561 pub fn set_update_time<T>(mut self, v: T) -> Self
6562 where
6563 T: std::convert::Into<wkt::Timestamp>,
6564 {
6565 self.update_time = std::option::Option::Some(v.into());
6566 self
6567 }
6568
6569 /// Sets or clears the value of [update_time][crate::model::FrameworkDeployment::update_time].
6570 ///
6571 /// # Example
6572 /// ```ignore,no_run
6573 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
6574 /// use wkt::Timestamp;
6575 /// let x = FrameworkDeployment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6576 /// let x = FrameworkDeployment::new().set_or_clear_update_time(None::<Timestamp>);
6577 /// ```
6578 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6579 where
6580 T: std::convert::Into<wkt::Timestamp>,
6581 {
6582 self.update_time = v.map(|x| x.into());
6583 self
6584 }
6585
6586 /// Sets the value of [etag][crate::model::FrameworkDeployment::etag].
6587 ///
6588 /// # Example
6589 /// ```ignore,no_run
6590 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
6591 /// let x = FrameworkDeployment::new().set_etag("example");
6592 /// ```
6593 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6594 self.etag = v.into();
6595 self
6596 }
6597
6598 /// Sets the value of [target_resource_display_name][crate::model::FrameworkDeployment::target_resource_display_name].
6599 ///
6600 /// # Example
6601 /// ```ignore,no_run
6602 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
6603 /// let x = FrameworkDeployment::new().set_target_resource_display_name("example");
6604 /// ```
6605 pub fn set_target_resource_display_name<T: std::convert::Into<std::string::String>>(
6606 mut self,
6607 v: T,
6608 ) -> Self {
6609 self.target_resource_display_name = v.into();
6610 self
6611 }
6612
6613 /// Sets the value of [cloud_control_deployment_references][crate::model::FrameworkDeployment::cloud_control_deployment_references].
6614 ///
6615 /// # Example
6616 /// ```ignore,no_run
6617 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
6618 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeploymentReference;
6619 /// let x = FrameworkDeployment::new()
6620 /// .set_cloud_control_deployment_references([
6621 /// CloudControlDeploymentReference::default()/* use setters */,
6622 /// CloudControlDeploymentReference::default()/* use (different) setters */,
6623 /// ]);
6624 /// ```
6625 pub fn set_cloud_control_deployment_references<T, V>(mut self, v: T) -> Self
6626 where
6627 T: std::iter::IntoIterator<Item = V>,
6628 V: std::convert::Into<crate::model::CloudControlDeploymentReference>,
6629 {
6630 use std::iter::Iterator;
6631 self.cloud_control_deployment_references = v.into_iter().map(|i| i.into()).collect();
6632 self
6633 }
6634}
6635
6636impl wkt::message::Message for FrameworkDeployment {
6637 fn typename() -> &'static str {
6638 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FrameworkDeployment"
6639 }
6640}
6641
6642/// A cloud control deployment represents the deployment of a particular cloud
6643/// control on a target resource. Supported target resources are
6644/// `organizations/{organizationID}`, `folders/{folderID}`, and
6645/// `projects/{projectID}`.
6646#[derive(Clone, Default, PartialEq)]
6647#[non_exhaustive]
6648pub struct CloudControlDeployment {
6649 /// Identifier. The name for the cloud control deployment, in the format
6650 /// `organizations/{organization}/locations/{location}/cloudControlDeployments/{cloud_control_deployment_id}`.
6651 /// The only supported location is `global`.
6652 pub name: std::string::String,
6653
6654 /// Required. The details of the target resource that the cloud control is
6655 /// deployed You can use an existing target resource or create a new target.
6656 pub target_resource_config: std::option::Option<crate::model::TargetResourceConfig>,
6657
6658 /// Output only. The resource that the cloud control is deployed on, in one of
6659 /// the following formats:
6660 ///
6661 /// - `organizations/{organizationID}`
6662 /// - `folders/{folderID}`
6663 /// - `projects/{projectID}`
6664 pub target_resource: std::string::String,
6665
6666 /// Required. The deployment mode and parameters for the cloud control.
6667 pub cloud_control_metadata: std::option::Option<crate::model::CloudControlMetadata>,
6668
6669 /// Optional. A friendly description for the cloud control deployment.
6670 pub description: std::string::String,
6671
6672 /// Output only. The state of the cloud control deployment.
6673 pub deployment_state: crate::model::DeploymentState,
6674
6675 /// Output only. The time when the resource was created.
6676 pub create_time: std::option::Option<wkt::Timestamp>,
6677
6678 /// Output only. The time when the resource was last updated.
6679 pub update_time: std::option::Option<wkt::Timestamp>,
6680
6681 /// Optional. To prevent concurrent updates from overwriting each other,
6682 /// provide the `etag` when you update a cloud control deployment. You can also
6683 /// provide the `etag` when you delete a cloud control deployment to help
6684 /// ensure that you're deleting the intended version of the
6685 /// deployment.
6686 pub etag: std::string::String,
6687
6688 /// Output only. The cloud control after the given parameters are substituted.
6689 pub parameter_substituted_cloud_control: std::option::Option<crate::model::CloudControl>,
6690
6691 /// Output only. The references to the framework deployments that this cloud
6692 /// control deployment is part of. A cloud control deployment can be part of
6693 /// multiple framework deployments.
6694 pub framework_deployment_references: std::vec::Vec<crate::model::FrameworkDeploymentReference>,
6695
6696 /// Output only. The display name of the target resource.
6697 pub target_resource_display_name: std::string::String,
6698
6699 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6700}
6701
6702impl CloudControlDeployment {
6703 pub fn new() -> Self {
6704 std::default::Default::default()
6705 }
6706
6707 /// Sets the value of [name][crate::model::CloudControlDeployment::name].
6708 ///
6709 /// # Example
6710 /// ```ignore,no_run
6711 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6712 /// let x = CloudControlDeployment::new().set_name("example");
6713 /// ```
6714 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6715 self.name = v.into();
6716 self
6717 }
6718
6719 /// Sets the value of [target_resource_config][crate::model::CloudControlDeployment::target_resource_config].
6720 ///
6721 /// # Example
6722 /// ```ignore,no_run
6723 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6724 /// use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceConfig;
6725 /// let x = CloudControlDeployment::new().set_target_resource_config(TargetResourceConfig::default()/* use setters */);
6726 /// ```
6727 pub fn set_target_resource_config<T>(mut self, v: T) -> Self
6728 where
6729 T: std::convert::Into<crate::model::TargetResourceConfig>,
6730 {
6731 self.target_resource_config = std::option::Option::Some(v.into());
6732 self
6733 }
6734
6735 /// Sets or clears the value of [target_resource_config][crate::model::CloudControlDeployment::target_resource_config].
6736 ///
6737 /// # Example
6738 /// ```ignore,no_run
6739 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6740 /// use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceConfig;
6741 /// let x = CloudControlDeployment::new().set_or_clear_target_resource_config(Some(TargetResourceConfig::default()/* use setters */));
6742 /// let x = CloudControlDeployment::new().set_or_clear_target_resource_config(None::<TargetResourceConfig>);
6743 /// ```
6744 pub fn set_or_clear_target_resource_config<T>(mut self, v: std::option::Option<T>) -> Self
6745 where
6746 T: std::convert::Into<crate::model::TargetResourceConfig>,
6747 {
6748 self.target_resource_config = v.map(|x| x.into());
6749 self
6750 }
6751
6752 /// Sets the value of [target_resource][crate::model::CloudControlDeployment::target_resource].
6753 ///
6754 /// # Example
6755 /// ```ignore,no_run
6756 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6757 /// let x = CloudControlDeployment::new().set_target_resource("example");
6758 /// ```
6759 pub fn set_target_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6760 self.target_resource = v.into();
6761 self
6762 }
6763
6764 /// Sets the value of [cloud_control_metadata][crate::model::CloudControlDeployment::cloud_control_metadata].
6765 ///
6766 /// # Example
6767 /// ```ignore,no_run
6768 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6769 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlMetadata;
6770 /// let x = CloudControlDeployment::new().set_cloud_control_metadata(CloudControlMetadata::default()/* use setters */);
6771 /// ```
6772 pub fn set_cloud_control_metadata<T>(mut self, v: T) -> Self
6773 where
6774 T: std::convert::Into<crate::model::CloudControlMetadata>,
6775 {
6776 self.cloud_control_metadata = std::option::Option::Some(v.into());
6777 self
6778 }
6779
6780 /// Sets or clears the value of [cloud_control_metadata][crate::model::CloudControlDeployment::cloud_control_metadata].
6781 ///
6782 /// # Example
6783 /// ```ignore,no_run
6784 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6785 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlMetadata;
6786 /// let x = CloudControlDeployment::new().set_or_clear_cloud_control_metadata(Some(CloudControlMetadata::default()/* use setters */));
6787 /// let x = CloudControlDeployment::new().set_or_clear_cloud_control_metadata(None::<CloudControlMetadata>);
6788 /// ```
6789 pub fn set_or_clear_cloud_control_metadata<T>(mut self, v: std::option::Option<T>) -> Self
6790 where
6791 T: std::convert::Into<crate::model::CloudControlMetadata>,
6792 {
6793 self.cloud_control_metadata = v.map(|x| x.into());
6794 self
6795 }
6796
6797 /// Sets the value of [description][crate::model::CloudControlDeployment::description].
6798 ///
6799 /// # Example
6800 /// ```ignore,no_run
6801 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6802 /// let x = CloudControlDeployment::new().set_description("example");
6803 /// ```
6804 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6805 self.description = v.into();
6806 self
6807 }
6808
6809 /// Sets the value of [deployment_state][crate::model::CloudControlDeployment::deployment_state].
6810 ///
6811 /// # Example
6812 /// ```ignore,no_run
6813 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6814 /// use google_cloud_cloudsecuritycompliance_v1::model::DeploymentState;
6815 /// let x0 = CloudControlDeployment::new().set_deployment_state(DeploymentState::Validating);
6816 /// let x1 = CloudControlDeployment::new().set_deployment_state(DeploymentState::Creating);
6817 /// let x2 = CloudControlDeployment::new().set_deployment_state(DeploymentState::Deleting);
6818 /// ```
6819 pub fn set_deployment_state<T: std::convert::Into<crate::model::DeploymentState>>(
6820 mut self,
6821 v: T,
6822 ) -> Self {
6823 self.deployment_state = v.into();
6824 self
6825 }
6826
6827 /// Sets the value of [create_time][crate::model::CloudControlDeployment::create_time].
6828 ///
6829 /// # Example
6830 /// ```ignore,no_run
6831 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6832 /// use wkt::Timestamp;
6833 /// let x = CloudControlDeployment::new().set_create_time(Timestamp::default()/* use setters */);
6834 /// ```
6835 pub fn set_create_time<T>(mut self, v: T) -> Self
6836 where
6837 T: std::convert::Into<wkt::Timestamp>,
6838 {
6839 self.create_time = std::option::Option::Some(v.into());
6840 self
6841 }
6842
6843 /// Sets or clears the value of [create_time][crate::model::CloudControlDeployment::create_time].
6844 ///
6845 /// # Example
6846 /// ```ignore,no_run
6847 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6848 /// use wkt::Timestamp;
6849 /// let x = CloudControlDeployment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6850 /// let x = CloudControlDeployment::new().set_or_clear_create_time(None::<Timestamp>);
6851 /// ```
6852 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6853 where
6854 T: std::convert::Into<wkt::Timestamp>,
6855 {
6856 self.create_time = v.map(|x| x.into());
6857 self
6858 }
6859
6860 /// Sets the value of [update_time][crate::model::CloudControlDeployment::update_time].
6861 ///
6862 /// # Example
6863 /// ```ignore,no_run
6864 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6865 /// use wkt::Timestamp;
6866 /// let x = CloudControlDeployment::new().set_update_time(Timestamp::default()/* use setters */);
6867 /// ```
6868 pub fn set_update_time<T>(mut self, v: T) -> Self
6869 where
6870 T: std::convert::Into<wkt::Timestamp>,
6871 {
6872 self.update_time = std::option::Option::Some(v.into());
6873 self
6874 }
6875
6876 /// Sets or clears the value of [update_time][crate::model::CloudControlDeployment::update_time].
6877 ///
6878 /// # Example
6879 /// ```ignore,no_run
6880 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6881 /// use wkt::Timestamp;
6882 /// let x = CloudControlDeployment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6883 /// let x = CloudControlDeployment::new().set_or_clear_update_time(None::<Timestamp>);
6884 /// ```
6885 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6886 where
6887 T: std::convert::Into<wkt::Timestamp>,
6888 {
6889 self.update_time = v.map(|x| x.into());
6890 self
6891 }
6892
6893 /// Sets the value of [etag][crate::model::CloudControlDeployment::etag].
6894 ///
6895 /// # Example
6896 /// ```ignore,no_run
6897 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6898 /// let x = CloudControlDeployment::new().set_etag("example");
6899 /// ```
6900 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6901 self.etag = v.into();
6902 self
6903 }
6904
6905 /// Sets the value of [parameter_substituted_cloud_control][crate::model::CloudControlDeployment::parameter_substituted_cloud_control].
6906 ///
6907 /// # Example
6908 /// ```ignore,no_run
6909 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6910 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
6911 /// let x = CloudControlDeployment::new().set_parameter_substituted_cloud_control(CloudControl::default()/* use setters */);
6912 /// ```
6913 pub fn set_parameter_substituted_cloud_control<T>(mut self, v: T) -> Self
6914 where
6915 T: std::convert::Into<crate::model::CloudControl>,
6916 {
6917 self.parameter_substituted_cloud_control = std::option::Option::Some(v.into());
6918 self
6919 }
6920
6921 /// Sets or clears the value of [parameter_substituted_cloud_control][crate::model::CloudControlDeployment::parameter_substituted_cloud_control].
6922 ///
6923 /// # Example
6924 /// ```ignore,no_run
6925 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6926 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
6927 /// let x = CloudControlDeployment::new().set_or_clear_parameter_substituted_cloud_control(Some(CloudControl::default()/* use setters */));
6928 /// let x = CloudControlDeployment::new().set_or_clear_parameter_substituted_cloud_control(None::<CloudControl>);
6929 /// ```
6930 pub fn set_or_clear_parameter_substituted_cloud_control<T>(
6931 mut self,
6932 v: std::option::Option<T>,
6933 ) -> Self
6934 where
6935 T: std::convert::Into<crate::model::CloudControl>,
6936 {
6937 self.parameter_substituted_cloud_control = v.map(|x| x.into());
6938 self
6939 }
6940
6941 /// Sets the value of [framework_deployment_references][crate::model::CloudControlDeployment::framework_deployment_references].
6942 ///
6943 /// # Example
6944 /// ```ignore,no_run
6945 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6946 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeploymentReference;
6947 /// let x = CloudControlDeployment::new()
6948 /// .set_framework_deployment_references([
6949 /// FrameworkDeploymentReference::default()/* use setters */,
6950 /// FrameworkDeploymentReference::default()/* use (different) setters */,
6951 /// ]);
6952 /// ```
6953 pub fn set_framework_deployment_references<T, V>(mut self, v: T) -> Self
6954 where
6955 T: std::iter::IntoIterator<Item = V>,
6956 V: std::convert::Into<crate::model::FrameworkDeploymentReference>,
6957 {
6958 use std::iter::Iterator;
6959 self.framework_deployment_references = v.into_iter().map(|i| i.into()).collect();
6960 self
6961 }
6962
6963 /// Sets the value of [target_resource_display_name][crate::model::CloudControlDeployment::target_resource_display_name].
6964 ///
6965 /// # Example
6966 /// ```ignore,no_run
6967 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6968 /// let x = CloudControlDeployment::new().set_target_resource_display_name("example");
6969 /// ```
6970 pub fn set_target_resource_display_name<T: std::convert::Into<std::string::String>>(
6971 mut self,
6972 v: T,
6973 ) -> Self {
6974 self.target_resource_display_name = v.into();
6975 self
6976 }
6977}
6978
6979impl wkt::message::Message for CloudControlDeployment {
6980 fn typename() -> &'static str {
6981 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControlDeployment"
6982 }
6983}
6984
6985/// The name of the target resource or the configuration that's required to
6986/// create a new target resource.
6987#[derive(Clone, Default, PartialEq)]
6988#[non_exhaustive]
6989pub struct TargetResourceConfig {
6990 /// The resource configuration for the target resource.
6991 pub resource_config: std::option::Option<crate::model::target_resource_config::ResourceConfig>,
6992
6993 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6994}
6995
6996impl TargetResourceConfig {
6997 pub fn new() -> Self {
6998 std::default::Default::default()
6999 }
7000
7001 /// Sets the value of [resource_config][crate::model::TargetResourceConfig::resource_config].
7002 ///
7003 /// Note that all the setters affecting `resource_config` are mutually
7004 /// exclusive.
7005 ///
7006 /// # Example
7007 /// ```ignore,no_run
7008 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceConfig;
7009 /// use google_cloud_cloudsecuritycompliance_v1::model::target_resource_config::ResourceConfig;
7010 /// let x = TargetResourceConfig::new().set_resource_config(Some(ResourceConfig::ExistingTargetResource("example".to_string())));
7011 /// ```
7012 pub fn set_resource_config<
7013 T: std::convert::Into<
7014 std::option::Option<crate::model::target_resource_config::ResourceConfig>,
7015 >,
7016 >(
7017 mut self,
7018 v: T,
7019 ) -> Self {
7020 self.resource_config = v.into();
7021 self
7022 }
7023
7024 /// The value of [resource_config][crate::model::TargetResourceConfig::resource_config]
7025 /// if it holds a `ExistingTargetResource`, `None` if the field is not set or
7026 /// holds a different branch.
7027 pub fn existing_target_resource(&self) -> std::option::Option<&std::string::String> {
7028 #[allow(unreachable_patterns)]
7029 self.resource_config.as_ref().and_then(|v| match v {
7030 crate::model::target_resource_config::ResourceConfig::ExistingTargetResource(v) => {
7031 std::option::Option::Some(v)
7032 }
7033 _ => std::option::Option::None,
7034 })
7035 }
7036
7037 /// Sets the value of [resource_config][crate::model::TargetResourceConfig::resource_config]
7038 /// to hold a `ExistingTargetResource`.
7039 ///
7040 /// Note that all the setters affecting `resource_config` are
7041 /// mutually exclusive.
7042 ///
7043 /// # Example
7044 /// ```ignore,no_run
7045 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceConfig;
7046 /// let x = TargetResourceConfig::new().set_existing_target_resource("example");
7047 /// assert!(x.existing_target_resource().is_some());
7048 /// assert!(x.target_resource_creation_config().is_none());
7049 /// ```
7050 pub fn set_existing_target_resource<T: std::convert::Into<std::string::String>>(
7051 mut self,
7052 v: T,
7053 ) -> Self {
7054 self.resource_config = std::option::Option::Some(
7055 crate::model::target_resource_config::ResourceConfig::ExistingTargetResource(v.into()),
7056 );
7057 self
7058 }
7059
7060 /// The value of [resource_config][crate::model::TargetResourceConfig::resource_config]
7061 /// if it holds a `TargetResourceCreationConfig`, `None` if the field is not set or
7062 /// holds a different branch.
7063 pub fn target_resource_creation_config(
7064 &self,
7065 ) -> std::option::Option<&std::boxed::Box<crate::model::TargetResourceCreationConfig>> {
7066 #[allow(unreachable_patterns)]
7067 self.resource_config.as_ref().and_then(|v| match v {
7068 crate::model::target_resource_config::ResourceConfig::TargetResourceCreationConfig(
7069 v,
7070 ) => std::option::Option::Some(v),
7071 _ => std::option::Option::None,
7072 })
7073 }
7074
7075 /// Sets the value of [resource_config][crate::model::TargetResourceConfig::resource_config]
7076 /// to hold a `TargetResourceCreationConfig`.
7077 ///
7078 /// Note that all the setters affecting `resource_config` are
7079 /// mutually exclusive.
7080 ///
7081 /// # Example
7082 /// ```ignore,no_run
7083 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceConfig;
7084 /// use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceCreationConfig;
7085 /// let x = TargetResourceConfig::new().set_target_resource_creation_config(TargetResourceCreationConfig::default()/* use setters */);
7086 /// assert!(x.target_resource_creation_config().is_some());
7087 /// assert!(x.existing_target_resource().is_none());
7088 /// ```
7089 pub fn set_target_resource_creation_config<
7090 T: std::convert::Into<std::boxed::Box<crate::model::TargetResourceCreationConfig>>,
7091 >(
7092 mut self,
7093 v: T,
7094 ) -> Self {
7095 self.resource_config = std::option::Option::Some(
7096 crate::model::target_resource_config::ResourceConfig::TargetResourceCreationConfig(
7097 v.into(),
7098 ),
7099 );
7100 self
7101 }
7102}
7103
7104impl wkt::message::Message for TargetResourceConfig {
7105 fn typename() -> &'static str {
7106 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.TargetResourceConfig"
7107 }
7108}
7109
7110/// Defines additional types related to [TargetResourceConfig].
7111pub mod target_resource_config {
7112 #[allow(unused_imports)]
7113 use super::*;
7114
7115 /// The resource configuration for the target resource.
7116 #[derive(Clone, Debug, PartialEq)]
7117 #[non_exhaustive]
7118 pub enum ResourceConfig {
7119 /// Optional. The resource hierarchy node, in one of the following formats:
7120 ///
7121 /// - `organizations/{organizationID}`
7122 /// - `folders/{folderID}`
7123 /// - `projects/{projectID}`
7124 ExistingTargetResource(std::string::String),
7125 /// Optional. The details that are required to create a resource and use
7126 /// that resource as the target resource for deployment.
7127 TargetResourceCreationConfig(std::boxed::Box<crate::model::TargetResourceCreationConfig>),
7128 }
7129}
7130
7131/// The configuration that's required to create a target resource.
7132#[derive(Clone, Default, PartialEq)]
7133#[non_exhaustive]
7134pub struct TargetResourceCreationConfig {
7135 /// The configuration that's required to create the target resource.
7136 pub resource_creation_config:
7137 std::option::Option<crate::model::target_resource_creation_config::ResourceCreationConfig>,
7138
7139 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7140}
7141
7142impl TargetResourceCreationConfig {
7143 pub fn new() -> Self {
7144 std::default::Default::default()
7145 }
7146
7147 /// Sets the value of [resource_creation_config][crate::model::TargetResourceCreationConfig::resource_creation_config].
7148 ///
7149 /// Note that all the setters affecting `resource_creation_config` are mutually
7150 /// exclusive.
7151 ///
7152 /// # Example
7153 /// ```ignore,no_run
7154 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceCreationConfig;
7155 /// use google_cloud_cloudsecuritycompliance_v1::model::FolderCreationConfig;
7156 /// let x = TargetResourceCreationConfig::new().set_resource_creation_config(Some(
7157 /// google_cloud_cloudsecuritycompliance_v1::model::target_resource_creation_config::ResourceCreationConfig::FolderCreationConfig(FolderCreationConfig::default().into())));
7158 /// ```
7159 pub fn set_resource_creation_config<
7160 T: std::convert::Into<
7161 std::option::Option<
7162 crate::model::target_resource_creation_config::ResourceCreationConfig,
7163 >,
7164 >,
7165 >(
7166 mut self,
7167 v: T,
7168 ) -> Self {
7169 self.resource_creation_config = v.into();
7170 self
7171 }
7172
7173 /// The value of [resource_creation_config][crate::model::TargetResourceCreationConfig::resource_creation_config]
7174 /// if it holds a `FolderCreationConfig`, `None` if the field is not set or
7175 /// holds a different branch.
7176 pub fn folder_creation_config(
7177 &self,
7178 ) -> std::option::Option<&std::boxed::Box<crate::model::FolderCreationConfig>> {
7179 #[allow(unreachable_patterns)]
7180 self.resource_creation_config.as_ref().and_then(|v| match v {
7181 crate::model::target_resource_creation_config::ResourceCreationConfig::FolderCreationConfig(v) => std::option::Option::Some(v),
7182 _ => std::option::Option::None,
7183 })
7184 }
7185
7186 /// Sets the value of [resource_creation_config][crate::model::TargetResourceCreationConfig::resource_creation_config]
7187 /// to hold a `FolderCreationConfig`.
7188 ///
7189 /// Note that all the setters affecting `resource_creation_config` are
7190 /// mutually exclusive.
7191 ///
7192 /// # Example
7193 /// ```ignore,no_run
7194 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceCreationConfig;
7195 /// use google_cloud_cloudsecuritycompliance_v1::model::FolderCreationConfig;
7196 /// let x = TargetResourceCreationConfig::new().set_folder_creation_config(FolderCreationConfig::default()/* use setters */);
7197 /// assert!(x.folder_creation_config().is_some());
7198 /// assert!(x.project_creation_config().is_none());
7199 /// ```
7200 pub fn set_folder_creation_config<
7201 T: std::convert::Into<std::boxed::Box<crate::model::FolderCreationConfig>>,
7202 >(
7203 mut self,
7204 v: T,
7205 ) -> Self {
7206 self.resource_creation_config = std::option::Option::Some(
7207 crate::model::target_resource_creation_config::ResourceCreationConfig::FolderCreationConfig(
7208 v.into()
7209 )
7210 );
7211 self
7212 }
7213
7214 /// The value of [resource_creation_config][crate::model::TargetResourceCreationConfig::resource_creation_config]
7215 /// if it holds a `ProjectCreationConfig`, `None` if the field is not set or
7216 /// holds a different branch.
7217 pub fn project_creation_config(
7218 &self,
7219 ) -> std::option::Option<&std::boxed::Box<crate::model::ProjectCreationConfig>> {
7220 #[allow(unreachable_patterns)]
7221 self.resource_creation_config.as_ref().and_then(|v| match v {
7222 crate::model::target_resource_creation_config::ResourceCreationConfig::ProjectCreationConfig(v) => std::option::Option::Some(v),
7223 _ => std::option::Option::None,
7224 })
7225 }
7226
7227 /// Sets the value of [resource_creation_config][crate::model::TargetResourceCreationConfig::resource_creation_config]
7228 /// to hold a `ProjectCreationConfig`.
7229 ///
7230 /// Note that all the setters affecting `resource_creation_config` are
7231 /// mutually exclusive.
7232 ///
7233 /// # Example
7234 /// ```ignore,no_run
7235 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceCreationConfig;
7236 /// use google_cloud_cloudsecuritycompliance_v1::model::ProjectCreationConfig;
7237 /// let x = TargetResourceCreationConfig::new().set_project_creation_config(ProjectCreationConfig::default()/* use setters */);
7238 /// assert!(x.project_creation_config().is_some());
7239 /// assert!(x.folder_creation_config().is_none());
7240 /// ```
7241 pub fn set_project_creation_config<
7242 T: std::convert::Into<std::boxed::Box<crate::model::ProjectCreationConfig>>,
7243 >(
7244 mut self,
7245 v: T,
7246 ) -> Self {
7247 self.resource_creation_config = std::option::Option::Some(
7248 crate::model::target_resource_creation_config::ResourceCreationConfig::ProjectCreationConfig(
7249 v.into()
7250 )
7251 );
7252 self
7253 }
7254}
7255
7256impl wkt::message::Message for TargetResourceCreationConfig {
7257 fn typename() -> &'static str {
7258 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.TargetResourceCreationConfig"
7259 }
7260}
7261
7262/// Defines additional types related to [TargetResourceCreationConfig].
7263pub mod target_resource_creation_config {
7264 #[allow(unused_imports)]
7265 use super::*;
7266
7267 /// The configuration that's required to create the target resource.
7268 #[derive(Clone, Debug, PartialEq)]
7269 #[non_exhaustive]
7270 pub enum ResourceCreationConfig {
7271 /// Optional. The configuration that's required to create a folder.
7272 FolderCreationConfig(std::boxed::Box<crate::model::FolderCreationConfig>),
7273 /// Optional. The configuration that's required to create a project.
7274 ProjectCreationConfig(std::boxed::Box<crate::model::ProjectCreationConfig>),
7275 }
7276}
7277
7278/// The configuration that's required to create a folder to be used
7279/// as the target resource for a deployment.
7280#[derive(Clone, Default, PartialEq)]
7281#[non_exhaustive]
7282pub struct FolderCreationConfig {
7283 /// Required. The parent of the folder, in the format
7284 /// `organizations/{organizationID}` or `folders/{folderID}`.
7285 pub parent: std::string::String,
7286
7287 /// Required. The display name of the folder.
7288 pub folder_display_name: std::string::String,
7289
7290 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7291}
7292
7293impl FolderCreationConfig {
7294 pub fn new() -> Self {
7295 std::default::Default::default()
7296 }
7297
7298 /// Sets the value of [parent][crate::model::FolderCreationConfig::parent].
7299 ///
7300 /// # Example
7301 /// ```ignore,no_run
7302 /// # use google_cloud_cloudsecuritycompliance_v1::model::FolderCreationConfig;
7303 /// let x = FolderCreationConfig::new().set_parent("example");
7304 /// ```
7305 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7306 self.parent = v.into();
7307 self
7308 }
7309
7310 /// Sets the value of [folder_display_name][crate::model::FolderCreationConfig::folder_display_name].
7311 ///
7312 /// # Example
7313 /// ```ignore,no_run
7314 /// # use google_cloud_cloudsecuritycompliance_v1::model::FolderCreationConfig;
7315 /// let x = FolderCreationConfig::new().set_folder_display_name("example");
7316 /// ```
7317 pub fn set_folder_display_name<T: std::convert::Into<std::string::String>>(
7318 mut self,
7319 v: T,
7320 ) -> Self {
7321 self.folder_display_name = v.into();
7322 self
7323 }
7324}
7325
7326impl wkt::message::Message for FolderCreationConfig {
7327 fn typename() -> &'static str {
7328 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FolderCreationConfig"
7329 }
7330}
7331
7332/// The configuration that's required to create a project to be used
7333/// as the target resource of a deployment.
7334#[derive(Clone, Default, PartialEq)]
7335#[non_exhaustive]
7336pub struct ProjectCreationConfig {
7337 /// Required. The parent of the project, in the format
7338 /// `organizations/{organizationID}` or `folders/{folderID}`.
7339 pub parent: std::string::String,
7340
7341 /// Required. The display name of the project.
7342 pub project_display_name: std::string::String,
7343
7344 /// Required. The billing account ID for the project.
7345 pub billing_account_id: std::string::String,
7346
7347 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7348}
7349
7350impl ProjectCreationConfig {
7351 pub fn new() -> Self {
7352 std::default::Default::default()
7353 }
7354
7355 /// Sets the value of [parent][crate::model::ProjectCreationConfig::parent].
7356 ///
7357 /// # Example
7358 /// ```ignore,no_run
7359 /// # use google_cloud_cloudsecuritycompliance_v1::model::ProjectCreationConfig;
7360 /// let x = ProjectCreationConfig::new().set_parent("example");
7361 /// ```
7362 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7363 self.parent = v.into();
7364 self
7365 }
7366
7367 /// Sets the value of [project_display_name][crate::model::ProjectCreationConfig::project_display_name].
7368 ///
7369 /// # Example
7370 /// ```ignore,no_run
7371 /// # use google_cloud_cloudsecuritycompliance_v1::model::ProjectCreationConfig;
7372 /// let x = ProjectCreationConfig::new().set_project_display_name("example");
7373 /// ```
7374 pub fn set_project_display_name<T: std::convert::Into<std::string::String>>(
7375 mut self,
7376 v: T,
7377 ) -> Self {
7378 self.project_display_name = v.into();
7379 self
7380 }
7381
7382 /// Sets the value of [billing_account_id][crate::model::ProjectCreationConfig::billing_account_id].
7383 ///
7384 /// # Example
7385 /// ```ignore,no_run
7386 /// # use google_cloud_cloudsecuritycompliance_v1::model::ProjectCreationConfig;
7387 /// let x = ProjectCreationConfig::new().set_billing_account_id("example");
7388 /// ```
7389 pub fn set_billing_account_id<T: std::convert::Into<std::string::String>>(
7390 mut self,
7391 v: T,
7392 ) -> Self {
7393 self.billing_account_id = v.into();
7394 self
7395 }
7396}
7397
7398impl wkt::message::Message for ProjectCreationConfig {
7399 fn typename() -> &'static str {
7400 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ProjectCreationConfig"
7401 }
7402}
7403
7404/// The enforcement mode and parameters of a cloud
7405/// control deployment.
7406#[derive(Clone, Default, PartialEq)]
7407#[non_exhaustive]
7408pub struct CloudControlMetadata {
7409 /// Required. The cloud control name and parameters.
7410 pub cloud_control_details: std::option::Option<crate::model::CloudControlDetails>,
7411
7412 /// Required. The enforcement mode of the cloud control.
7413 pub enforcement_mode: crate::model::EnforcementMode,
7414
7415 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7416}
7417
7418impl CloudControlMetadata {
7419 pub fn new() -> Self {
7420 std::default::Default::default()
7421 }
7422
7423 /// Sets the value of [cloud_control_details][crate::model::CloudControlMetadata::cloud_control_details].
7424 ///
7425 /// # Example
7426 /// ```ignore,no_run
7427 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlMetadata;
7428 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDetails;
7429 /// let x = CloudControlMetadata::new().set_cloud_control_details(CloudControlDetails::default()/* use setters */);
7430 /// ```
7431 pub fn set_cloud_control_details<T>(mut self, v: T) -> Self
7432 where
7433 T: std::convert::Into<crate::model::CloudControlDetails>,
7434 {
7435 self.cloud_control_details = std::option::Option::Some(v.into());
7436 self
7437 }
7438
7439 /// Sets or clears the value of [cloud_control_details][crate::model::CloudControlMetadata::cloud_control_details].
7440 ///
7441 /// # Example
7442 /// ```ignore,no_run
7443 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlMetadata;
7444 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDetails;
7445 /// let x = CloudControlMetadata::new().set_or_clear_cloud_control_details(Some(CloudControlDetails::default()/* use setters */));
7446 /// let x = CloudControlMetadata::new().set_or_clear_cloud_control_details(None::<CloudControlDetails>);
7447 /// ```
7448 pub fn set_or_clear_cloud_control_details<T>(mut self, v: std::option::Option<T>) -> Self
7449 where
7450 T: std::convert::Into<crate::model::CloudControlDetails>,
7451 {
7452 self.cloud_control_details = v.map(|x| x.into());
7453 self
7454 }
7455
7456 /// Sets the value of [enforcement_mode][crate::model::CloudControlMetadata::enforcement_mode].
7457 ///
7458 /// # Example
7459 /// ```ignore,no_run
7460 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlMetadata;
7461 /// use google_cloud_cloudsecuritycompliance_v1::model::EnforcementMode;
7462 /// let x0 = CloudControlMetadata::new().set_enforcement_mode(EnforcementMode::Preventive);
7463 /// let x1 = CloudControlMetadata::new().set_enforcement_mode(EnforcementMode::Detective);
7464 /// let x2 = CloudControlMetadata::new().set_enforcement_mode(EnforcementMode::Audit);
7465 /// ```
7466 pub fn set_enforcement_mode<T: std::convert::Into<crate::model::EnforcementMode>>(
7467 mut self,
7468 v: T,
7469 ) -> Self {
7470 self.enforcement_mode = v.into();
7471 self
7472 }
7473}
7474
7475impl wkt::message::Message for CloudControlMetadata {
7476 fn typename() -> &'static str {
7477 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControlMetadata"
7478 }
7479}
7480
7481/// The request message for [CreateFrameworkDeployment][].
7482#[derive(Clone, Default, PartialEq)]
7483#[non_exhaustive]
7484pub struct CreateFrameworkDeploymentRequest {
7485 /// Required. The parent resource of the framework deployment in the format
7486 /// `organizations/{organization}/locations/{location}`.
7487 /// Only the global location is supported.
7488 pub parent: std::string::String,
7489
7490 /// Optional. An identifier for the framework deployment that's unique in scope
7491 /// of the parent. If you don't specify a value, then a random UUID is
7492 /// generated.
7493 pub framework_deployment_id: std::string::String,
7494
7495 /// Required. The framework deployment that you're creating.
7496 pub framework_deployment: std::option::Option<crate::model::FrameworkDeployment>,
7497
7498 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7499}
7500
7501impl CreateFrameworkDeploymentRequest {
7502 pub fn new() -> Self {
7503 std::default::Default::default()
7504 }
7505
7506 /// Sets the value of [parent][crate::model::CreateFrameworkDeploymentRequest::parent].
7507 ///
7508 /// # Example
7509 /// ```ignore,no_run
7510 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkDeploymentRequest;
7511 /// let x = CreateFrameworkDeploymentRequest::new().set_parent("example");
7512 /// ```
7513 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7514 self.parent = v.into();
7515 self
7516 }
7517
7518 /// Sets the value of [framework_deployment_id][crate::model::CreateFrameworkDeploymentRequest::framework_deployment_id].
7519 ///
7520 /// # Example
7521 /// ```ignore,no_run
7522 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkDeploymentRequest;
7523 /// let x = CreateFrameworkDeploymentRequest::new().set_framework_deployment_id("example");
7524 /// ```
7525 pub fn set_framework_deployment_id<T: std::convert::Into<std::string::String>>(
7526 mut self,
7527 v: T,
7528 ) -> Self {
7529 self.framework_deployment_id = v.into();
7530 self
7531 }
7532
7533 /// Sets the value of [framework_deployment][crate::model::CreateFrameworkDeploymentRequest::framework_deployment].
7534 ///
7535 /// # Example
7536 /// ```ignore,no_run
7537 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkDeploymentRequest;
7538 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
7539 /// let x = CreateFrameworkDeploymentRequest::new().set_framework_deployment(FrameworkDeployment::default()/* use setters */);
7540 /// ```
7541 pub fn set_framework_deployment<T>(mut self, v: T) -> Self
7542 where
7543 T: std::convert::Into<crate::model::FrameworkDeployment>,
7544 {
7545 self.framework_deployment = std::option::Option::Some(v.into());
7546 self
7547 }
7548
7549 /// Sets or clears the value of [framework_deployment][crate::model::CreateFrameworkDeploymentRequest::framework_deployment].
7550 ///
7551 /// # Example
7552 /// ```ignore,no_run
7553 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkDeploymentRequest;
7554 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
7555 /// let x = CreateFrameworkDeploymentRequest::new().set_or_clear_framework_deployment(Some(FrameworkDeployment::default()/* use setters */));
7556 /// let x = CreateFrameworkDeploymentRequest::new().set_or_clear_framework_deployment(None::<FrameworkDeployment>);
7557 /// ```
7558 pub fn set_or_clear_framework_deployment<T>(mut self, v: std::option::Option<T>) -> Self
7559 where
7560 T: std::convert::Into<crate::model::FrameworkDeployment>,
7561 {
7562 self.framework_deployment = v.map(|x| x.into());
7563 self
7564 }
7565}
7566
7567impl wkt::message::Message for CreateFrameworkDeploymentRequest {
7568 fn typename() -> &'static str {
7569 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CreateFrameworkDeploymentRequest"
7570 }
7571}
7572
7573/// The request message for [DeleteFrameworkDeployment][].
7574#[derive(Clone, Default, PartialEq)]
7575#[non_exhaustive]
7576pub struct DeleteFrameworkDeploymentRequest {
7577 /// Required. The name of the framework deployment that you want to delete,
7578 /// in the format
7579 /// `organizations/{organization}/locations/{location}/frameworkDeployments/{framework_deployment_id}`.
7580 /// The only supported location is `global`.
7581 pub name: std::string::String,
7582
7583 /// Optional. An opaque identifier for the current version of the resource.
7584 ///
7585 /// If you provide this value, then it must match the existing value. If the
7586 /// values don't match, then the request fails with an
7587 /// [`ABORTED`][google.rpc.Code.ABORTED] error.
7588 ///
7589 /// If you omit this value, then the resource is deleted regardless of its
7590 /// current `etag` value.
7591 pub etag: std::string::String,
7592
7593 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7594}
7595
7596impl DeleteFrameworkDeploymentRequest {
7597 pub fn new() -> Self {
7598 std::default::Default::default()
7599 }
7600
7601 /// Sets the value of [name][crate::model::DeleteFrameworkDeploymentRequest::name].
7602 ///
7603 /// # Example
7604 /// ```ignore,no_run
7605 /// # use google_cloud_cloudsecuritycompliance_v1::model::DeleteFrameworkDeploymentRequest;
7606 /// let x = DeleteFrameworkDeploymentRequest::new().set_name("example");
7607 /// ```
7608 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7609 self.name = v.into();
7610 self
7611 }
7612
7613 /// Sets the value of [etag][crate::model::DeleteFrameworkDeploymentRequest::etag].
7614 ///
7615 /// # Example
7616 /// ```ignore,no_run
7617 /// # use google_cloud_cloudsecuritycompliance_v1::model::DeleteFrameworkDeploymentRequest;
7618 /// let x = DeleteFrameworkDeploymentRequest::new().set_etag("example");
7619 /// ```
7620 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7621 self.etag = v.into();
7622 self
7623 }
7624}
7625
7626impl wkt::message::Message for DeleteFrameworkDeploymentRequest {
7627 fn typename() -> &'static str {
7628 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.DeleteFrameworkDeploymentRequest"
7629 }
7630}
7631
7632/// The request message for [GetFrameworkDeployment][].
7633#[derive(Clone, Default, PartialEq)]
7634#[non_exhaustive]
7635pub struct GetFrameworkDeploymentRequest {
7636 /// Required. The name of the framework deployment, in the format
7637 /// `organizations/{organization}/locations/{location}/frameworkDeployments/{framework_deployment_id}`.
7638 /// The only supported location is `global`.
7639 pub name: std::string::String,
7640
7641 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7642}
7643
7644impl GetFrameworkDeploymentRequest {
7645 pub fn new() -> Self {
7646 std::default::Default::default()
7647 }
7648
7649 /// Sets the value of [name][crate::model::GetFrameworkDeploymentRequest::name].
7650 ///
7651 /// # Example
7652 /// ```ignore,no_run
7653 /// # use google_cloud_cloudsecuritycompliance_v1::model::GetFrameworkDeploymentRequest;
7654 /// let x = GetFrameworkDeploymentRequest::new().set_name("example");
7655 /// ```
7656 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7657 self.name = v.into();
7658 self
7659 }
7660}
7661
7662impl wkt::message::Message for GetFrameworkDeploymentRequest {
7663 fn typename() -> &'static str {
7664 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.GetFrameworkDeploymentRequest"
7665 }
7666}
7667
7668/// The request message for [ListFrameworkDeployments][].
7669#[derive(Clone, Default, PartialEq)]
7670#[non_exhaustive]
7671pub struct ListFrameworkDeploymentsRequest {
7672 /// Required. The parent resource of the framework deployment, in the format
7673 /// `organizations/{organization}/locations/{location}`.
7674 /// The only supported location is `global`.
7675 pub parent: std::string::String,
7676
7677 /// Optional. The requested page size. The server might return fewer items than
7678 /// requested.
7679 /// If unspecified, the server picks an appropriate default.
7680 pub page_size: i32,
7681
7682 /// Optional. A token that identifies a page of results the server should
7683 /// return.
7684 pub page_token: std::string::String,
7685
7686 /// Optional. The filter to be applied on the resource, as defined by
7687 /// [AIP-160: Filtering](https://google.aip.dev/160).
7688 pub filter: std::string::String,
7689
7690 /// Optional. The sort order for the results. The following values are
7691 /// supported:
7692 ///
7693 /// * `name`
7694 /// * `name desc`
7695 ///
7696 /// If you do not specify a value, then the results are not sorted.
7697 pub order_by: std::string::String,
7698
7699 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7700}
7701
7702impl ListFrameworkDeploymentsRequest {
7703 pub fn new() -> Self {
7704 std::default::Default::default()
7705 }
7706
7707 /// Sets the value of [parent][crate::model::ListFrameworkDeploymentsRequest::parent].
7708 ///
7709 /// # Example
7710 /// ```ignore,no_run
7711 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkDeploymentsRequest;
7712 /// let x = ListFrameworkDeploymentsRequest::new().set_parent("example");
7713 /// ```
7714 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7715 self.parent = v.into();
7716 self
7717 }
7718
7719 /// Sets the value of [page_size][crate::model::ListFrameworkDeploymentsRequest::page_size].
7720 ///
7721 /// # Example
7722 /// ```ignore,no_run
7723 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkDeploymentsRequest;
7724 /// let x = ListFrameworkDeploymentsRequest::new().set_page_size(42);
7725 /// ```
7726 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7727 self.page_size = v.into();
7728 self
7729 }
7730
7731 /// Sets the value of [page_token][crate::model::ListFrameworkDeploymentsRequest::page_token].
7732 ///
7733 /// # Example
7734 /// ```ignore,no_run
7735 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkDeploymentsRequest;
7736 /// let x = ListFrameworkDeploymentsRequest::new().set_page_token("example");
7737 /// ```
7738 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7739 self.page_token = v.into();
7740 self
7741 }
7742
7743 /// Sets the value of [filter][crate::model::ListFrameworkDeploymentsRequest::filter].
7744 ///
7745 /// # Example
7746 /// ```ignore,no_run
7747 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkDeploymentsRequest;
7748 /// let x = ListFrameworkDeploymentsRequest::new().set_filter("example");
7749 /// ```
7750 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7751 self.filter = v.into();
7752 self
7753 }
7754
7755 /// Sets the value of [order_by][crate::model::ListFrameworkDeploymentsRequest::order_by].
7756 ///
7757 /// # Example
7758 /// ```ignore,no_run
7759 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkDeploymentsRequest;
7760 /// let x = ListFrameworkDeploymentsRequest::new().set_order_by("example");
7761 /// ```
7762 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7763 self.order_by = v.into();
7764 self
7765 }
7766}
7767
7768impl wkt::message::Message for ListFrameworkDeploymentsRequest {
7769 fn typename() -> &'static str {
7770 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFrameworkDeploymentsRequest"
7771 }
7772}
7773
7774/// The response message for [ListFrameworkDeployments][].
7775#[derive(Clone, Default, PartialEq)]
7776#[non_exhaustive]
7777pub struct ListFrameworkDeploymentsResponse {
7778 /// The list of framework deployments.
7779 pub framework_deployments: std::vec::Vec<crate::model::FrameworkDeployment>,
7780
7781 /// A token that identifies the next page of results that the server
7782 /// should return.
7783 pub next_page_token: std::string::String,
7784
7785 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7786}
7787
7788impl ListFrameworkDeploymentsResponse {
7789 pub fn new() -> Self {
7790 std::default::Default::default()
7791 }
7792
7793 /// Sets the value of [framework_deployments][crate::model::ListFrameworkDeploymentsResponse::framework_deployments].
7794 ///
7795 /// # Example
7796 /// ```ignore,no_run
7797 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkDeploymentsResponse;
7798 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
7799 /// let x = ListFrameworkDeploymentsResponse::new()
7800 /// .set_framework_deployments([
7801 /// FrameworkDeployment::default()/* use setters */,
7802 /// FrameworkDeployment::default()/* use (different) setters */,
7803 /// ]);
7804 /// ```
7805 pub fn set_framework_deployments<T, V>(mut self, v: T) -> Self
7806 where
7807 T: std::iter::IntoIterator<Item = V>,
7808 V: std::convert::Into<crate::model::FrameworkDeployment>,
7809 {
7810 use std::iter::Iterator;
7811 self.framework_deployments = v.into_iter().map(|i| i.into()).collect();
7812 self
7813 }
7814
7815 /// Sets the value of [next_page_token][crate::model::ListFrameworkDeploymentsResponse::next_page_token].
7816 ///
7817 /// # Example
7818 /// ```ignore,no_run
7819 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkDeploymentsResponse;
7820 /// let x = ListFrameworkDeploymentsResponse::new().set_next_page_token("example");
7821 /// ```
7822 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7823 self.next_page_token = v.into();
7824 self
7825 }
7826}
7827
7828impl wkt::message::Message for ListFrameworkDeploymentsResponse {
7829 fn typename() -> &'static str {
7830 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFrameworkDeploymentsResponse"
7831 }
7832}
7833
7834#[doc(hidden)]
7835impl gax::paginator::internal::PageableResponse for ListFrameworkDeploymentsResponse {
7836 type PageItem = crate::model::FrameworkDeployment;
7837
7838 fn items(self) -> std::vec::Vec<Self::PageItem> {
7839 self.framework_deployments
7840 }
7841
7842 fn next_page_token(&self) -> std::string::String {
7843 use std::clone::Clone;
7844 self.next_page_token.clone()
7845 }
7846}
7847
7848/// The request message for [GetCloudControlDeployment][].
7849#[derive(Clone, Default, PartialEq)]
7850#[non_exhaustive]
7851pub struct GetCloudControlDeploymentRequest {
7852 /// Required. The name for the cloud control deployment, in the format
7853 /// `organizations/{organization}/locations/{location}/cloudControlDeployments/{cloud_control_deployment_id}`.
7854 /// The only supported location is `global`.
7855 pub name: std::string::String,
7856
7857 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7858}
7859
7860impl GetCloudControlDeploymentRequest {
7861 pub fn new() -> Self {
7862 std::default::Default::default()
7863 }
7864
7865 /// Sets the value of [name][crate::model::GetCloudControlDeploymentRequest::name].
7866 ///
7867 /// # Example
7868 /// ```ignore,no_run
7869 /// # use google_cloud_cloudsecuritycompliance_v1::model::GetCloudControlDeploymentRequest;
7870 /// let x = GetCloudControlDeploymentRequest::new().set_name("example");
7871 /// ```
7872 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7873 self.name = v.into();
7874 self
7875 }
7876}
7877
7878impl wkt::message::Message for GetCloudControlDeploymentRequest {
7879 fn typename() -> &'static str {
7880 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.GetCloudControlDeploymentRequest"
7881 }
7882}
7883
7884/// The request message for [ListCloudControlDeployments][].
7885#[derive(Clone, Default, PartialEq)]
7886#[non_exhaustive]
7887pub struct ListCloudControlDeploymentsRequest {
7888 /// Required. The parent resource for the cloud control deployment, in the
7889 /// format `organizations/{organization}/locations/{location}`. The only
7890 /// supported location is `global`.
7891 pub parent: std::string::String,
7892
7893 /// Optional. The requested page size. The server might return fewer items than
7894 /// you requested.
7895 /// If unspecified, the server picks an appropriate default.
7896 pub page_size: i32,
7897
7898 /// Optional. A token that identifies the page of results that the server
7899 /// should return.
7900 pub page_token: std::string::String,
7901
7902 /// Optional. The filter to apply on the resource, as defined by
7903 /// [AIP-160: Filtering](https://google.aip.dev/160).
7904 pub filter: std::string::String,
7905
7906 /// Optional. The sort order for the results. The following values are
7907 /// supported:
7908 ///
7909 /// * `name`
7910 /// * `name desc`
7911 ///
7912 /// If you do not specify a value, then the results are not sorted.
7913 pub order_by: std::string::String,
7914
7915 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7916}
7917
7918impl ListCloudControlDeploymentsRequest {
7919 pub fn new() -> Self {
7920 std::default::Default::default()
7921 }
7922
7923 /// Sets the value of [parent][crate::model::ListCloudControlDeploymentsRequest::parent].
7924 ///
7925 /// # Example
7926 /// ```ignore,no_run
7927 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlDeploymentsRequest;
7928 /// let x = ListCloudControlDeploymentsRequest::new().set_parent("example");
7929 /// ```
7930 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7931 self.parent = v.into();
7932 self
7933 }
7934
7935 /// Sets the value of [page_size][crate::model::ListCloudControlDeploymentsRequest::page_size].
7936 ///
7937 /// # Example
7938 /// ```ignore,no_run
7939 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlDeploymentsRequest;
7940 /// let x = ListCloudControlDeploymentsRequest::new().set_page_size(42);
7941 /// ```
7942 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7943 self.page_size = v.into();
7944 self
7945 }
7946
7947 /// Sets the value of [page_token][crate::model::ListCloudControlDeploymentsRequest::page_token].
7948 ///
7949 /// # Example
7950 /// ```ignore,no_run
7951 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlDeploymentsRequest;
7952 /// let x = ListCloudControlDeploymentsRequest::new().set_page_token("example");
7953 /// ```
7954 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7955 self.page_token = v.into();
7956 self
7957 }
7958
7959 /// Sets the value of [filter][crate::model::ListCloudControlDeploymentsRequest::filter].
7960 ///
7961 /// # Example
7962 /// ```ignore,no_run
7963 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlDeploymentsRequest;
7964 /// let x = ListCloudControlDeploymentsRequest::new().set_filter("example");
7965 /// ```
7966 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7967 self.filter = v.into();
7968 self
7969 }
7970
7971 /// Sets the value of [order_by][crate::model::ListCloudControlDeploymentsRequest::order_by].
7972 ///
7973 /// # Example
7974 /// ```ignore,no_run
7975 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlDeploymentsRequest;
7976 /// let x = ListCloudControlDeploymentsRequest::new().set_order_by("example");
7977 /// ```
7978 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7979 self.order_by = v.into();
7980 self
7981 }
7982}
7983
7984impl wkt::message::Message for ListCloudControlDeploymentsRequest {
7985 fn typename() -> &'static str {
7986 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListCloudControlDeploymentsRequest"
7987 }
7988}
7989
7990/// The response message for [ListCloudControlDeployments][].
7991#[derive(Clone, Default, PartialEq)]
7992#[non_exhaustive]
7993pub struct ListCloudControlDeploymentsResponse {
7994 /// The list of cloud control deployments.
7995 pub cloud_control_deployments: std::vec::Vec<crate::model::CloudControlDeployment>,
7996
7997 /// A token that identifies the next page of results that the server
7998 /// should return.
7999 pub next_page_token: std::string::String,
8000
8001 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8002}
8003
8004impl ListCloudControlDeploymentsResponse {
8005 pub fn new() -> Self {
8006 std::default::Default::default()
8007 }
8008
8009 /// Sets the value of [cloud_control_deployments][crate::model::ListCloudControlDeploymentsResponse::cloud_control_deployments].
8010 ///
8011 /// # Example
8012 /// ```ignore,no_run
8013 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlDeploymentsResponse;
8014 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
8015 /// let x = ListCloudControlDeploymentsResponse::new()
8016 /// .set_cloud_control_deployments([
8017 /// CloudControlDeployment::default()/* use setters */,
8018 /// CloudControlDeployment::default()/* use (different) setters */,
8019 /// ]);
8020 /// ```
8021 pub fn set_cloud_control_deployments<T, V>(mut self, v: T) -> Self
8022 where
8023 T: std::iter::IntoIterator<Item = V>,
8024 V: std::convert::Into<crate::model::CloudControlDeployment>,
8025 {
8026 use std::iter::Iterator;
8027 self.cloud_control_deployments = v.into_iter().map(|i| i.into()).collect();
8028 self
8029 }
8030
8031 /// Sets the value of [next_page_token][crate::model::ListCloudControlDeploymentsResponse::next_page_token].
8032 ///
8033 /// # Example
8034 /// ```ignore,no_run
8035 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlDeploymentsResponse;
8036 /// let x = ListCloudControlDeploymentsResponse::new().set_next_page_token("example");
8037 /// ```
8038 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8039 self.next_page_token = v.into();
8040 self
8041 }
8042}
8043
8044impl wkt::message::Message for ListCloudControlDeploymentsResponse {
8045 fn typename() -> &'static str {
8046 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListCloudControlDeploymentsResponse"
8047 }
8048}
8049
8050#[doc(hidden)]
8051impl gax::paginator::internal::PageableResponse for ListCloudControlDeploymentsResponse {
8052 type PageItem = crate::model::CloudControlDeployment;
8053
8054 fn items(self) -> std::vec::Vec<Self::PageItem> {
8055 self.cloud_control_deployments
8056 }
8057
8058 fn next_page_token(&self) -> std::string::String {
8059 use std::clone::Clone;
8060 self.next_page_token.clone()
8061 }
8062}
8063
8064/// The reference to a cloud control deployment.
8065#[derive(Clone, Default, PartialEq)]
8066#[non_exhaustive]
8067pub struct CloudControlDeploymentReference {
8068 /// Output only. The name of the CloudControlDeployment. The format is
8069 /// `organizations/{org}/locations/{location}/cloudControlDeployments/{cloud_control_deployment_id}`.
8070 /// The only supported location is `global`.
8071 pub cloud_control_deployment: std::string::String,
8072
8073 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8074}
8075
8076impl CloudControlDeploymentReference {
8077 pub fn new() -> Self {
8078 std::default::Default::default()
8079 }
8080
8081 /// Sets the value of [cloud_control_deployment][crate::model::CloudControlDeploymentReference::cloud_control_deployment].
8082 ///
8083 /// # Example
8084 /// ```ignore,no_run
8085 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeploymentReference;
8086 /// let x = CloudControlDeploymentReference::new().set_cloud_control_deployment("example");
8087 /// ```
8088 pub fn set_cloud_control_deployment<T: std::convert::Into<std::string::String>>(
8089 mut self,
8090 v: T,
8091 ) -> Self {
8092 self.cloud_control_deployment = v.into();
8093 self
8094 }
8095}
8096
8097impl wkt::message::Message for CloudControlDeploymentReference {
8098 fn typename() -> &'static str {
8099 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControlDeploymentReference"
8100 }
8101}
8102
8103/// The reference to a framework deployment.
8104#[derive(Clone, Default, PartialEq)]
8105#[non_exhaustive]
8106pub struct FrameworkDeploymentReference {
8107 /// Output only. The name of the framework deployment, in the format
8108 /// `organizations/{org}/locations/{location}/frameworkDeployments/{framework_deployment_id}`.
8109 /// The only supported location is `global`.
8110 pub framework_deployment: std::string::String,
8111
8112 /// Optional. The reference to the framework that this deployment is for.
8113 /// For example:
8114 ///
8115 /// ```norust
8116 /// {
8117 /// framework:
8118 /// "organizations/{org}/locations/{location}/frameworks/{framework}",
8119 /// major_revision_id: 1
8120 /// }
8121 /// ```
8122 ///
8123 /// The only supported location is `global`.
8124 pub framework_reference: std::option::Option<crate::model::FrameworkReference>,
8125
8126 /// Optional. The display name of the framework that this framework deployment
8127 /// is for.
8128 pub framework_display_name: std::string::String,
8129
8130 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8131}
8132
8133impl FrameworkDeploymentReference {
8134 pub fn new() -> Self {
8135 std::default::Default::default()
8136 }
8137
8138 /// Sets the value of [framework_deployment][crate::model::FrameworkDeploymentReference::framework_deployment].
8139 ///
8140 /// # Example
8141 /// ```ignore,no_run
8142 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeploymentReference;
8143 /// let x = FrameworkDeploymentReference::new().set_framework_deployment("example");
8144 /// ```
8145 pub fn set_framework_deployment<T: std::convert::Into<std::string::String>>(
8146 mut self,
8147 v: T,
8148 ) -> Self {
8149 self.framework_deployment = v.into();
8150 self
8151 }
8152
8153 /// Sets the value of [framework_reference][crate::model::FrameworkDeploymentReference::framework_reference].
8154 ///
8155 /// # Example
8156 /// ```ignore,no_run
8157 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeploymentReference;
8158 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkReference;
8159 /// let x = FrameworkDeploymentReference::new().set_framework_reference(FrameworkReference::default()/* use setters */);
8160 /// ```
8161 pub fn set_framework_reference<T>(mut self, v: T) -> Self
8162 where
8163 T: std::convert::Into<crate::model::FrameworkReference>,
8164 {
8165 self.framework_reference = std::option::Option::Some(v.into());
8166 self
8167 }
8168
8169 /// Sets or clears the value of [framework_reference][crate::model::FrameworkDeploymentReference::framework_reference].
8170 ///
8171 /// # Example
8172 /// ```ignore,no_run
8173 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeploymentReference;
8174 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkReference;
8175 /// let x = FrameworkDeploymentReference::new().set_or_clear_framework_reference(Some(FrameworkReference::default()/* use setters */));
8176 /// let x = FrameworkDeploymentReference::new().set_or_clear_framework_reference(None::<FrameworkReference>);
8177 /// ```
8178 pub fn set_or_clear_framework_reference<T>(mut self, v: std::option::Option<T>) -> Self
8179 where
8180 T: std::convert::Into<crate::model::FrameworkReference>,
8181 {
8182 self.framework_reference = v.map(|x| x.into());
8183 self
8184 }
8185
8186 /// Sets the value of [framework_display_name][crate::model::FrameworkDeploymentReference::framework_display_name].
8187 ///
8188 /// # Example
8189 /// ```ignore,no_run
8190 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeploymentReference;
8191 /// let x = FrameworkDeploymentReference::new().set_framework_display_name("example");
8192 /// ```
8193 pub fn set_framework_display_name<T: std::convert::Into<std::string::String>>(
8194 mut self,
8195 v: T,
8196 ) -> Self {
8197 self.framework_display_name = v.into();
8198 self
8199 }
8200}
8201
8202impl wkt::message::Message for FrameworkDeploymentReference {
8203 fn typename() -> &'static str {
8204 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FrameworkDeploymentReference"
8205 }
8206}
8207
8208/// The request message for
8209/// [ListFrameworkComplianceSummariesRequest][google.cloud.cloudsecuritycompliance.v1.ListFrameworkComplianceSummariesRequest].
8210///
8211/// [google.cloud.cloudsecuritycompliance.v1.ListFrameworkComplianceSummariesRequest]: crate::model::ListFrameworkComplianceSummariesRequest
8212#[derive(Clone, Default, PartialEq)]
8213#[non_exhaustive]
8214pub struct ListFrameworkComplianceSummariesRequest {
8215 /// Required. The parent scope for the framework compliance summary.
8216 pub parent: std::string::String,
8217
8218 /// Optional. The requested page size. The server might return fewer items than
8219 /// requested. If unspecified, the server picks an appropriate default.
8220 pub page_size: i32,
8221
8222 /// Optional. A token that identifies the page of results that the server
8223 /// should return.
8224 pub page_token: std::string::String,
8225
8226 /// Optional. The filtering results.
8227 pub filter: std::string::String,
8228
8229 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8230}
8231
8232impl ListFrameworkComplianceSummariesRequest {
8233 pub fn new() -> Self {
8234 std::default::Default::default()
8235 }
8236
8237 /// Sets the value of [parent][crate::model::ListFrameworkComplianceSummariesRequest::parent].
8238 ///
8239 /// # Example
8240 /// ```ignore,no_run
8241 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkComplianceSummariesRequest;
8242 /// let x = ListFrameworkComplianceSummariesRequest::new().set_parent("example");
8243 /// ```
8244 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8245 self.parent = v.into();
8246 self
8247 }
8248
8249 /// Sets the value of [page_size][crate::model::ListFrameworkComplianceSummariesRequest::page_size].
8250 ///
8251 /// # Example
8252 /// ```ignore,no_run
8253 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkComplianceSummariesRequest;
8254 /// let x = ListFrameworkComplianceSummariesRequest::new().set_page_size(42);
8255 /// ```
8256 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8257 self.page_size = v.into();
8258 self
8259 }
8260
8261 /// Sets the value of [page_token][crate::model::ListFrameworkComplianceSummariesRequest::page_token].
8262 ///
8263 /// # Example
8264 /// ```ignore,no_run
8265 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkComplianceSummariesRequest;
8266 /// let x = ListFrameworkComplianceSummariesRequest::new().set_page_token("example");
8267 /// ```
8268 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8269 self.page_token = v.into();
8270 self
8271 }
8272
8273 /// Sets the value of [filter][crate::model::ListFrameworkComplianceSummariesRequest::filter].
8274 ///
8275 /// # Example
8276 /// ```ignore,no_run
8277 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkComplianceSummariesRequest;
8278 /// let x = ListFrameworkComplianceSummariesRequest::new().set_filter("example");
8279 /// ```
8280 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8281 self.filter = v.into();
8282 self
8283 }
8284}
8285
8286impl wkt::message::Message for ListFrameworkComplianceSummariesRequest {
8287 fn typename() -> &'static str {
8288 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFrameworkComplianceSummariesRequest"
8289 }
8290}
8291
8292/// The response message for
8293/// [ListFrameworkComplianceSummariesResponse][google.cloud.cloudsecuritycompliance.v1.ListFrameworkComplianceSummariesResponse].
8294///
8295/// [google.cloud.cloudsecuritycompliance.v1.ListFrameworkComplianceSummariesResponse]: crate::model::ListFrameworkComplianceSummariesResponse
8296#[derive(Clone, Default, PartialEq)]
8297#[non_exhaustive]
8298pub struct ListFrameworkComplianceSummariesResponse {
8299 /// The list of framework compliance summaries.
8300 pub framework_compliance_summaries: std::vec::Vec<crate::model::FrameworkComplianceSummary>,
8301
8302 /// Output only. The token to retrieve the next page of results.
8303 pub next_page_token: std::string::String,
8304
8305 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8306}
8307
8308impl ListFrameworkComplianceSummariesResponse {
8309 pub fn new() -> Self {
8310 std::default::Default::default()
8311 }
8312
8313 /// Sets the value of [framework_compliance_summaries][crate::model::ListFrameworkComplianceSummariesResponse::framework_compliance_summaries].
8314 ///
8315 /// # Example
8316 /// ```ignore,no_run
8317 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkComplianceSummariesResponse;
8318 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
8319 /// let x = ListFrameworkComplianceSummariesResponse::new()
8320 /// .set_framework_compliance_summaries([
8321 /// FrameworkComplianceSummary::default()/* use setters */,
8322 /// FrameworkComplianceSummary::default()/* use (different) setters */,
8323 /// ]);
8324 /// ```
8325 pub fn set_framework_compliance_summaries<T, V>(mut self, v: T) -> Self
8326 where
8327 T: std::iter::IntoIterator<Item = V>,
8328 V: std::convert::Into<crate::model::FrameworkComplianceSummary>,
8329 {
8330 use std::iter::Iterator;
8331 self.framework_compliance_summaries = v.into_iter().map(|i| i.into()).collect();
8332 self
8333 }
8334
8335 /// Sets the value of [next_page_token][crate::model::ListFrameworkComplianceSummariesResponse::next_page_token].
8336 ///
8337 /// # Example
8338 /// ```ignore,no_run
8339 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkComplianceSummariesResponse;
8340 /// let x = ListFrameworkComplianceSummariesResponse::new().set_next_page_token("example");
8341 /// ```
8342 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8343 self.next_page_token = v.into();
8344 self
8345 }
8346}
8347
8348impl wkt::message::Message for ListFrameworkComplianceSummariesResponse {
8349 fn typename() -> &'static str {
8350 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFrameworkComplianceSummariesResponse"
8351 }
8352}
8353
8354#[doc(hidden)]
8355impl gax::paginator::internal::PageableResponse for ListFrameworkComplianceSummariesResponse {
8356 type PageItem = crate::model::FrameworkComplianceSummary;
8357
8358 fn items(self) -> std::vec::Vec<Self::PageItem> {
8359 self.framework_compliance_summaries
8360 }
8361
8362 fn next_page_token(&self) -> std::string::String {
8363 use std::clone::Clone;
8364 self.next_page_token.clone()
8365 }
8366}
8367
8368/// The response message for [GetFrameworkComplianceReport][].
8369#[derive(Clone, Default, PartialEq)]
8370#[non_exhaustive]
8371pub struct FrameworkComplianceReport {
8372 /// The name of the framework.
8373 pub framework: std::string::String,
8374
8375 /// The description of the framework.
8376 pub framework_description: std::string::String,
8377
8378 /// Output only. The last updated time of the report.
8379 pub update_time: std::option::Option<wkt::Timestamp>,
8380
8381 /// The control assessment details of the framework.
8382 pub control_assessment_details: std::option::Option<crate::model::ControlAssessmentDetails>,
8383
8384 /// The type of framework.
8385 pub framework_type: crate::model::framework::FrameworkType,
8386
8387 /// The list of cloud providers supported by the framework.
8388 pub supported_cloud_providers: std::vec::Vec<crate::model::CloudProvider>,
8389
8390 /// The list of framework categories supported.
8391 pub framework_categories: std::vec::Vec<crate::model::FrameworkCategory>,
8392
8393 /// Optional. The display name for the framework.
8394 pub framework_display_name: std::string::String,
8395
8396 /// Identifier. The name of the framework compliance report.
8397 pub name: std::string::String,
8398
8399 /// The latest major revision ID of the framework.
8400 pub major_revision_id: i64,
8401
8402 /// The latest minor revision ID of the latest major revision of the framework.
8403 pub minor_revision_id: i64,
8404
8405 /// The target resource details of the framework.
8406 pub target_resource_details: std::vec::Vec<crate::model::TargetResourceDetails>,
8407
8408 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8409}
8410
8411impl FrameworkComplianceReport {
8412 pub fn new() -> Self {
8413 std::default::Default::default()
8414 }
8415
8416 /// Sets the value of [framework][crate::model::FrameworkComplianceReport::framework].
8417 ///
8418 /// # Example
8419 /// ```ignore,no_run
8420 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
8421 /// let x = FrameworkComplianceReport::new().set_framework("example");
8422 /// ```
8423 pub fn set_framework<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8424 self.framework = v.into();
8425 self
8426 }
8427
8428 /// Sets the value of [framework_description][crate::model::FrameworkComplianceReport::framework_description].
8429 ///
8430 /// # Example
8431 /// ```ignore,no_run
8432 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
8433 /// let x = FrameworkComplianceReport::new().set_framework_description("example");
8434 /// ```
8435 pub fn set_framework_description<T: std::convert::Into<std::string::String>>(
8436 mut self,
8437 v: T,
8438 ) -> Self {
8439 self.framework_description = v.into();
8440 self
8441 }
8442
8443 /// Sets the value of [update_time][crate::model::FrameworkComplianceReport::update_time].
8444 ///
8445 /// # Example
8446 /// ```ignore,no_run
8447 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
8448 /// use wkt::Timestamp;
8449 /// let x = FrameworkComplianceReport::new().set_update_time(Timestamp::default()/* use setters */);
8450 /// ```
8451 pub fn set_update_time<T>(mut self, v: T) -> Self
8452 where
8453 T: std::convert::Into<wkt::Timestamp>,
8454 {
8455 self.update_time = std::option::Option::Some(v.into());
8456 self
8457 }
8458
8459 /// Sets or clears the value of [update_time][crate::model::FrameworkComplianceReport::update_time].
8460 ///
8461 /// # Example
8462 /// ```ignore,no_run
8463 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
8464 /// use wkt::Timestamp;
8465 /// let x = FrameworkComplianceReport::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
8466 /// let x = FrameworkComplianceReport::new().set_or_clear_update_time(None::<Timestamp>);
8467 /// ```
8468 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
8469 where
8470 T: std::convert::Into<wkt::Timestamp>,
8471 {
8472 self.update_time = v.map(|x| x.into());
8473 self
8474 }
8475
8476 /// Sets the value of [control_assessment_details][crate::model::FrameworkComplianceReport::control_assessment_details].
8477 ///
8478 /// # Example
8479 /// ```ignore,no_run
8480 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
8481 /// use google_cloud_cloudsecuritycompliance_v1::model::ControlAssessmentDetails;
8482 /// let x = FrameworkComplianceReport::new().set_control_assessment_details(ControlAssessmentDetails::default()/* use setters */);
8483 /// ```
8484 pub fn set_control_assessment_details<T>(mut self, v: T) -> Self
8485 where
8486 T: std::convert::Into<crate::model::ControlAssessmentDetails>,
8487 {
8488 self.control_assessment_details = std::option::Option::Some(v.into());
8489 self
8490 }
8491
8492 /// Sets or clears the value of [control_assessment_details][crate::model::FrameworkComplianceReport::control_assessment_details].
8493 ///
8494 /// # Example
8495 /// ```ignore,no_run
8496 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
8497 /// use google_cloud_cloudsecuritycompliance_v1::model::ControlAssessmentDetails;
8498 /// let x = FrameworkComplianceReport::new().set_or_clear_control_assessment_details(Some(ControlAssessmentDetails::default()/* use setters */));
8499 /// let x = FrameworkComplianceReport::new().set_or_clear_control_assessment_details(None::<ControlAssessmentDetails>);
8500 /// ```
8501 pub fn set_or_clear_control_assessment_details<T>(mut self, v: std::option::Option<T>) -> Self
8502 where
8503 T: std::convert::Into<crate::model::ControlAssessmentDetails>,
8504 {
8505 self.control_assessment_details = v.map(|x| x.into());
8506 self
8507 }
8508
8509 /// Sets the value of [framework_type][crate::model::FrameworkComplianceReport::framework_type].
8510 ///
8511 /// # Example
8512 /// ```ignore,no_run
8513 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
8514 /// use google_cloud_cloudsecuritycompliance_v1::model::framework::FrameworkType;
8515 /// let x0 = FrameworkComplianceReport::new().set_framework_type(FrameworkType::BuiltIn);
8516 /// let x1 = FrameworkComplianceReport::new().set_framework_type(FrameworkType::Custom);
8517 /// ```
8518 pub fn set_framework_type<T: std::convert::Into<crate::model::framework::FrameworkType>>(
8519 mut self,
8520 v: T,
8521 ) -> Self {
8522 self.framework_type = v.into();
8523 self
8524 }
8525
8526 /// Sets the value of [supported_cloud_providers][crate::model::FrameworkComplianceReport::supported_cloud_providers].
8527 ///
8528 /// # Example
8529 /// ```ignore,no_run
8530 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
8531 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudProvider;
8532 /// let x = FrameworkComplianceReport::new().set_supported_cloud_providers([
8533 /// CloudProvider::Aws,
8534 /// CloudProvider::Azure,
8535 /// CloudProvider::Gcp,
8536 /// ]);
8537 /// ```
8538 pub fn set_supported_cloud_providers<T, V>(mut self, v: T) -> Self
8539 where
8540 T: std::iter::IntoIterator<Item = V>,
8541 V: std::convert::Into<crate::model::CloudProvider>,
8542 {
8543 use std::iter::Iterator;
8544 self.supported_cloud_providers = v.into_iter().map(|i| i.into()).collect();
8545 self
8546 }
8547
8548 /// Sets the value of [framework_categories][crate::model::FrameworkComplianceReport::framework_categories].
8549 ///
8550 /// # Example
8551 /// ```ignore,no_run
8552 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
8553 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkCategory;
8554 /// let x = FrameworkComplianceReport::new().set_framework_categories([
8555 /// FrameworkCategory::IndustryDefinedStandard,
8556 /// FrameworkCategory::AssuredWorkloads,
8557 /// FrameworkCategory::DataSecurity,
8558 /// ]);
8559 /// ```
8560 pub fn set_framework_categories<T, V>(mut self, v: T) -> Self
8561 where
8562 T: std::iter::IntoIterator<Item = V>,
8563 V: std::convert::Into<crate::model::FrameworkCategory>,
8564 {
8565 use std::iter::Iterator;
8566 self.framework_categories = v.into_iter().map(|i| i.into()).collect();
8567 self
8568 }
8569
8570 /// Sets the value of [framework_display_name][crate::model::FrameworkComplianceReport::framework_display_name].
8571 ///
8572 /// # Example
8573 /// ```ignore,no_run
8574 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
8575 /// let x = FrameworkComplianceReport::new().set_framework_display_name("example");
8576 /// ```
8577 pub fn set_framework_display_name<T: std::convert::Into<std::string::String>>(
8578 mut self,
8579 v: T,
8580 ) -> Self {
8581 self.framework_display_name = v.into();
8582 self
8583 }
8584
8585 /// Sets the value of [name][crate::model::FrameworkComplianceReport::name].
8586 ///
8587 /// # Example
8588 /// ```ignore,no_run
8589 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
8590 /// let x = FrameworkComplianceReport::new().set_name("example");
8591 /// ```
8592 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8593 self.name = v.into();
8594 self
8595 }
8596
8597 /// Sets the value of [major_revision_id][crate::model::FrameworkComplianceReport::major_revision_id].
8598 ///
8599 /// # Example
8600 /// ```ignore,no_run
8601 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
8602 /// let x = FrameworkComplianceReport::new().set_major_revision_id(42);
8603 /// ```
8604 pub fn set_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8605 self.major_revision_id = v.into();
8606 self
8607 }
8608
8609 /// Sets the value of [minor_revision_id][crate::model::FrameworkComplianceReport::minor_revision_id].
8610 ///
8611 /// # Example
8612 /// ```ignore,no_run
8613 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
8614 /// let x = FrameworkComplianceReport::new().set_minor_revision_id(42);
8615 /// ```
8616 pub fn set_minor_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8617 self.minor_revision_id = v.into();
8618 self
8619 }
8620
8621 /// Sets the value of [target_resource_details][crate::model::FrameworkComplianceReport::target_resource_details].
8622 ///
8623 /// # Example
8624 /// ```ignore,no_run
8625 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
8626 /// use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceDetails;
8627 /// let x = FrameworkComplianceReport::new()
8628 /// .set_target_resource_details([
8629 /// TargetResourceDetails::default()/* use setters */,
8630 /// TargetResourceDetails::default()/* use (different) setters */,
8631 /// ]);
8632 /// ```
8633 pub fn set_target_resource_details<T, V>(mut self, v: T) -> Self
8634 where
8635 T: std::iter::IntoIterator<Item = V>,
8636 V: std::convert::Into<crate::model::TargetResourceDetails>,
8637 {
8638 use std::iter::Iterator;
8639 self.target_resource_details = v.into_iter().map(|i| i.into()).collect();
8640 self
8641 }
8642}
8643
8644impl wkt::message::Message for FrameworkComplianceReport {
8645 fn typename() -> &'static str {
8646 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FrameworkComplianceReport"
8647 }
8648}
8649
8650/// The request message for [FetchFrameworkComplianceReport][].
8651#[derive(Clone, Default, PartialEq)]
8652#[non_exhaustive]
8653pub struct FetchFrameworkComplianceReportRequest {
8654 /// Required. The name of the framework compliance report to retrieve.
8655 pub name: std::string::String,
8656
8657 /// Optional. The end time of the report.
8658 pub end_time: std::option::Option<wkt::Timestamp>,
8659
8660 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8661}
8662
8663impl FetchFrameworkComplianceReportRequest {
8664 pub fn new() -> Self {
8665 std::default::Default::default()
8666 }
8667
8668 /// Sets the value of [name][crate::model::FetchFrameworkComplianceReportRequest::name].
8669 ///
8670 /// # Example
8671 /// ```ignore,no_run
8672 /// # use google_cloud_cloudsecuritycompliance_v1::model::FetchFrameworkComplianceReportRequest;
8673 /// let x = FetchFrameworkComplianceReportRequest::new().set_name("example");
8674 /// ```
8675 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8676 self.name = v.into();
8677 self
8678 }
8679
8680 /// Sets the value of [end_time][crate::model::FetchFrameworkComplianceReportRequest::end_time].
8681 ///
8682 /// # Example
8683 /// ```ignore,no_run
8684 /// # use google_cloud_cloudsecuritycompliance_v1::model::FetchFrameworkComplianceReportRequest;
8685 /// use wkt::Timestamp;
8686 /// let x = FetchFrameworkComplianceReportRequest::new().set_end_time(Timestamp::default()/* use setters */);
8687 /// ```
8688 pub fn set_end_time<T>(mut self, v: T) -> Self
8689 where
8690 T: std::convert::Into<wkt::Timestamp>,
8691 {
8692 self.end_time = std::option::Option::Some(v.into());
8693 self
8694 }
8695
8696 /// Sets or clears the value of [end_time][crate::model::FetchFrameworkComplianceReportRequest::end_time].
8697 ///
8698 /// # Example
8699 /// ```ignore,no_run
8700 /// # use google_cloud_cloudsecuritycompliance_v1::model::FetchFrameworkComplianceReportRequest;
8701 /// use wkt::Timestamp;
8702 /// let x = FetchFrameworkComplianceReportRequest::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
8703 /// let x = FetchFrameworkComplianceReportRequest::new().set_or_clear_end_time(None::<Timestamp>);
8704 /// ```
8705 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8706 where
8707 T: std::convert::Into<wkt::Timestamp>,
8708 {
8709 self.end_time = v.map(|x| x.into());
8710 self
8711 }
8712}
8713
8714impl wkt::message::Message for FetchFrameworkComplianceReportRequest {
8715 fn typename() -> &'static str {
8716 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FetchFrameworkComplianceReportRequest"
8717 }
8718}
8719
8720/// The request message for [ListFindingSummaries][].
8721#[derive(Clone, Default, PartialEq)]
8722#[non_exhaustive]
8723pub struct ListFindingSummariesRequest {
8724 /// Required. The parent scope for the framework overview page.
8725 pub parent: std::string::String,
8726
8727 /// Optional. The requested page size. The server might return fewer items than
8728 /// requested. If unspecified, the server picks an appropriate default.
8729 pub page_size: i32,
8730
8731 /// Optional. A token that identifies the page of results that the server
8732 /// should return.
8733 pub page_token: std::string::String,
8734
8735 /// Optional. The filtering results.
8736 pub filter: std::string::String,
8737
8738 /// Optional. The end time of the finding summary.
8739 #[deprecated]
8740 pub end_time: std::option::Option<wkt::Timestamp>,
8741
8742 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8743}
8744
8745impl ListFindingSummariesRequest {
8746 pub fn new() -> Self {
8747 std::default::Default::default()
8748 }
8749
8750 /// Sets the value of [parent][crate::model::ListFindingSummariesRequest::parent].
8751 ///
8752 /// # Example
8753 /// ```ignore,no_run
8754 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFindingSummariesRequest;
8755 /// let x = ListFindingSummariesRequest::new().set_parent("example");
8756 /// ```
8757 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8758 self.parent = v.into();
8759 self
8760 }
8761
8762 /// Sets the value of [page_size][crate::model::ListFindingSummariesRequest::page_size].
8763 ///
8764 /// # Example
8765 /// ```ignore,no_run
8766 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFindingSummariesRequest;
8767 /// let x = ListFindingSummariesRequest::new().set_page_size(42);
8768 /// ```
8769 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8770 self.page_size = v.into();
8771 self
8772 }
8773
8774 /// Sets the value of [page_token][crate::model::ListFindingSummariesRequest::page_token].
8775 ///
8776 /// # Example
8777 /// ```ignore,no_run
8778 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFindingSummariesRequest;
8779 /// let x = ListFindingSummariesRequest::new().set_page_token("example");
8780 /// ```
8781 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8782 self.page_token = v.into();
8783 self
8784 }
8785
8786 /// Sets the value of [filter][crate::model::ListFindingSummariesRequest::filter].
8787 ///
8788 /// # Example
8789 /// ```ignore,no_run
8790 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFindingSummariesRequest;
8791 /// let x = ListFindingSummariesRequest::new().set_filter("example");
8792 /// ```
8793 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8794 self.filter = v.into();
8795 self
8796 }
8797
8798 /// Sets the value of [end_time][crate::model::ListFindingSummariesRequest::end_time].
8799 ///
8800 /// # Example
8801 /// ```ignore,no_run
8802 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFindingSummariesRequest;
8803 /// use wkt::Timestamp;
8804 /// let x = ListFindingSummariesRequest::new().set_end_time(Timestamp::default()/* use setters */);
8805 /// ```
8806 #[deprecated]
8807 pub fn set_end_time<T>(mut self, v: T) -> Self
8808 where
8809 T: std::convert::Into<wkt::Timestamp>,
8810 {
8811 self.end_time = std::option::Option::Some(v.into());
8812 self
8813 }
8814
8815 /// Sets or clears the value of [end_time][crate::model::ListFindingSummariesRequest::end_time].
8816 ///
8817 /// # Example
8818 /// ```ignore,no_run
8819 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFindingSummariesRequest;
8820 /// use wkt::Timestamp;
8821 /// let x = ListFindingSummariesRequest::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
8822 /// let x = ListFindingSummariesRequest::new().set_or_clear_end_time(None::<Timestamp>);
8823 /// ```
8824 #[deprecated]
8825 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8826 where
8827 T: std::convert::Into<wkt::Timestamp>,
8828 {
8829 self.end_time = v.map(|x| x.into());
8830 self
8831 }
8832}
8833
8834impl wkt::message::Message for ListFindingSummariesRequest {
8835 fn typename() -> &'static str {
8836 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFindingSummariesRequest"
8837 }
8838}
8839
8840/// The response message for [ListFindingSummaries][].
8841#[derive(Clone, Default, PartialEq)]
8842#[non_exhaustive]
8843pub struct ListFindingSummariesResponse {
8844 /// List of finding summary by category.
8845 pub finding_summaries: std::vec::Vec<crate::model::FindingSummary>,
8846
8847 /// Output only. The token to retrieve the next page of results.
8848 pub next_page_token: std::string::String,
8849
8850 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8851}
8852
8853impl ListFindingSummariesResponse {
8854 pub fn new() -> Self {
8855 std::default::Default::default()
8856 }
8857
8858 /// Sets the value of [finding_summaries][crate::model::ListFindingSummariesResponse::finding_summaries].
8859 ///
8860 /// # Example
8861 /// ```ignore,no_run
8862 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFindingSummariesResponse;
8863 /// use google_cloud_cloudsecuritycompliance_v1::model::FindingSummary;
8864 /// let x = ListFindingSummariesResponse::new()
8865 /// .set_finding_summaries([
8866 /// FindingSummary::default()/* use setters */,
8867 /// FindingSummary::default()/* use (different) setters */,
8868 /// ]);
8869 /// ```
8870 pub fn set_finding_summaries<T, V>(mut self, v: T) -> Self
8871 where
8872 T: std::iter::IntoIterator<Item = V>,
8873 V: std::convert::Into<crate::model::FindingSummary>,
8874 {
8875 use std::iter::Iterator;
8876 self.finding_summaries = v.into_iter().map(|i| i.into()).collect();
8877 self
8878 }
8879
8880 /// Sets the value of [next_page_token][crate::model::ListFindingSummariesResponse::next_page_token].
8881 ///
8882 /// # Example
8883 /// ```ignore,no_run
8884 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFindingSummariesResponse;
8885 /// let x = ListFindingSummariesResponse::new().set_next_page_token("example");
8886 /// ```
8887 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8888 self.next_page_token = v.into();
8889 self
8890 }
8891}
8892
8893impl wkt::message::Message for ListFindingSummariesResponse {
8894 fn typename() -> &'static str {
8895 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFindingSummariesResponse"
8896 }
8897}
8898
8899#[doc(hidden)]
8900impl gax::paginator::internal::PageableResponse for ListFindingSummariesResponse {
8901 type PageItem = crate::model::FindingSummary;
8902
8903 fn items(self) -> std::vec::Vec<Self::PageItem> {
8904 self.finding_summaries
8905 }
8906
8907 fn next_page_token(&self) -> std::string::String {
8908 use std::clone::Clone;
8909 self.next_page_token.clone()
8910 }
8911}
8912
8913/// The request message for [ListControlComplianceSummaries][].
8914#[derive(Clone, Default, PartialEq)]
8915#[non_exhaustive]
8916pub struct ListControlComplianceSummariesRequest {
8917 /// Required. The parent scope for the framework overview page.
8918 pub parent: std::string::String,
8919
8920 /// Optional. The end time of the control compliance summary.
8921 #[deprecated]
8922 pub end_time: std::option::Option<wkt::Timestamp>,
8923
8924 /// Optional. The requested page size. The server might return fewer items than
8925 /// requested. If unspecified, the server picks an appropriate default.
8926 pub page_size: i32,
8927
8928 /// Optional. A token that identifies the page of results that the server
8929 /// should return.
8930 pub page_token: std::string::String,
8931
8932 /// Optional. The filtering results.
8933 pub filter: std::string::String,
8934
8935 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8936}
8937
8938impl ListControlComplianceSummariesRequest {
8939 pub fn new() -> Self {
8940 std::default::Default::default()
8941 }
8942
8943 /// Sets the value of [parent][crate::model::ListControlComplianceSummariesRequest::parent].
8944 ///
8945 /// # Example
8946 /// ```ignore,no_run
8947 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListControlComplianceSummariesRequest;
8948 /// let x = ListControlComplianceSummariesRequest::new().set_parent("example");
8949 /// ```
8950 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8951 self.parent = v.into();
8952 self
8953 }
8954
8955 /// Sets the value of [end_time][crate::model::ListControlComplianceSummariesRequest::end_time].
8956 ///
8957 /// # Example
8958 /// ```ignore,no_run
8959 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListControlComplianceSummariesRequest;
8960 /// use wkt::Timestamp;
8961 /// let x = ListControlComplianceSummariesRequest::new().set_end_time(Timestamp::default()/* use setters */);
8962 /// ```
8963 #[deprecated]
8964 pub fn set_end_time<T>(mut self, v: T) -> Self
8965 where
8966 T: std::convert::Into<wkt::Timestamp>,
8967 {
8968 self.end_time = std::option::Option::Some(v.into());
8969 self
8970 }
8971
8972 /// Sets or clears the value of [end_time][crate::model::ListControlComplianceSummariesRequest::end_time].
8973 ///
8974 /// # Example
8975 /// ```ignore,no_run
8976 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListControlComplianceSummariesRequest;
8977 /// use wkt::Timestamp;
8978 /// let x = ListControlComplianceSummariesRequest::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
8979 /// let x = ListControlComplianceSummariesRequest::new().set_or_clear_end_time(None::<Timestamp>);
8980 /// ```
8981 #[deprecated]
8982 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8983 where
8984 T: std::convert::Into<wkt::Timestamp>,
8985 {
8986 self.end_time = v.map(|x| x.into());
8987 self
8988 }
8989
8990 /// Sets the value of [page_size][crate::model::ListControlComplianceSummariesRequest::page_size].
8991 ///
8992 /// # Example
8993 /// ```ignore,no_run
8994 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListControlComplianceSummariesRequest;
8995 /// let x = ListControlComplianceSummariesRequest::new().set_page_size(42);
8996 /// ```
8997 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8998 self.page_size = v.into();
8999 self
9000 }
9001
9002 /// Sets the value of [page_token][crate::model::ListControlComplianceSummariesRequest::page_token].
9003 ///
9004 /// # Example
9005 /// ```ignore,no_run
9006 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListControlComplianceSummariesRequest;
9007 /// let x = ListControlComplianceSummariesRequest::new().set_page_token("example");
9008 /// ```
9009 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9010 self.page_token = v.into();
9011 self
9012 }
9013
9014 /// Sets the value of [filter][crate::model::ListControlComplianceSummariesRequest::filter].
9015 ///
9016 /// # Example
9017 /// ```ignore,no_run
9018 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListControlComplianceSummariesRequest;
9019 /// let x = ListControlComplianceSummariesRequest::new().set_filter("example");
9020 /// ```
9021 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9022 self.filter = v.into();
9023 self
9024 }
9025}
9026
9027impl wkt::message::Message for ListControlComplianceSummariesRequest {
9028 fn typename() -> &'static str {
9029 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListControlComplianceSummariesRequest"
9030 }
9031}
9032
9033/// The response message for [ListControlComplianceSummaries][].
9034#[derive(Clone, Default, PartialEq)]
9035#[non_exhaustive]
9036pub struct ListControlComplianceSummariesResponse {
9037 /// The list of control compliance details.
9038 pub control_compliance_summaries: std::vec::Vec<crate::model::ControlComplianceSummary>,
9039
9040 /// Output only. The token to retrieve the next page of results.
9041 pub next_page_token: std::string::String,
9042
9043 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9044}
9045
9046impl ListControlComplianceSummariesResponse {
9047 pub fn new() -> Self {
9048 std::default::Default::default()
9049 }
9050
9051 /// Sets the value of [control_compliance_summaries][crate::model::ListControlComplianceSummariesResponse::control_compliance_summaries].
9052 ///
9053 /// # Example
9054 /// ```ignore,no_run
9055 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListControlComplianceSummariesResponse;
9056 /// use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
9057 /// let x = ListControlComplianceSummariesResponse::new()
9058 /// .set_control_compliance_summaries([
9059 /// ControlComplianceSummary::default()/* use setters */,
9060 /// ControlComplianceSummary::default()/* use (different) setters */,
9061 /// ]);
9062 /// ```
9063 pub fn set_control_compliance_summaries<T, V>(mut self, v: T) -> Self
9064 where
9065 T: std::iter::IntoIterator<Item = V>,
9066 V: std::convert::Into<crate::model::ControlComplianceSummary>,
9067 {
9068 use std::iter::Iterator;
9069 self.control_compliance_summaries = v.into_iter().map(|i| i.into()).collect();
9070 self
9071 }
9072
9073 /// Sets the value of [next_page_token][crate::model::ListControlComplianceSummariesResponse::next_page_token].
9074 ///
9075 /// # Example
9076 /// ```ignore,no_run
9077 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListControlComplianceSummariesResponse;
9078 /// let x = ListControlComplianceSummariesResponse::new().set_next_page_token("example");
9079 /// ```
9080 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9081 self.next_page_token = v.into();
9082 self
9083 }
9084}
9085
9086impl wkt::message::Message for ListControlComplianceSummariesResponse {
9087 fn typename() -> &'static str {
9088 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListControlComplianceSummariesResponse"
9089 }
9090}
9091
9092#[doc(hidden)]
9093impl gax::paginator::internal::PageableResponse for ListControlComplianceSummariesResponse {
9094 type PageItem = crate::model::ControlComplianceSummary;
9095
9096 fn items(self) -> std::vec::Vec<Self::PageItem> {
9097 self.control_compliance_summaries
9098 }
9099
9100 fn next_page_token(&self) -> std::string::String {
9101 use std::clone::Clone;
9102 self.next_page_token.clone()
9103 }
9104}
9105
9106/// The request message for [AggregateFrameworkComplianceReport][].
9107#[derive(Clone, Default, PartialEq)]
9108#[non_exhaustive]
9109pub struct AggregateFrameworkComplianceReportRequest {
9110 /// Required. The name of the aggregated compliance report over time to
9111 /// retrieve.
9112 ///
9113 /// The supported format is:
9114 /// `organizations/{organization_id}/locations/{location}/frameworkComplianceReports/{framework_compliance_report}`
9115 pub name: std::string::String,
9116
9117 /// Optional. The start and end time range for the aggregated compliance
9118 /// report.
9119 pub interval: std::option::Option<gtype::model::Interval>,
9120
9121 /// Optional. The filtering results.
9122 pub filter: std::string::String,
9123
9124 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9125}
9126
9127impl AggregateFrameworkComplianceReportRequest {
9128 pub fn new() -> Self {
9129 std::default::Default::default()
9130 }
9131
9132 /// Sets the value of [name][crate::model::AggregateFrameworkComplianceReportRequest::name].
9133 ///
9134 /// # Example
9135 /// ```ignore,no_run
9136 /// # use google_cloud_cloudsecuritycompliance_v1::model::AggregateFrameworkComplianceReportRequest;
9137 /// let x = AggregateFrameworkComplianceReportRequest::new().set_name("example");
9138 /// ```
9139 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9140 self.name = v.into();
9141 self
9142 }
9143
9144 /// Sets the value of [interval][crate::model::AggregateFrameworkComplianceReportRequest::interval].
9145 ///
9146 /// # Example
9147 /// ```ignore,no_run
9148 /// # use google_cloud_cloudsecuritycompliance_v1::model::AggregateFrameworkComplianceReportRequest;
9149 /// use gtype::model::Interval;
9150 /// let x = AggregateFrameworkComplianceReportRequest::new().set_interval(Interval::default()/* use setters */);
9151 /// ```
9152 pub fn set_interval<T>(mut self, v: T) -> Self
9153 where
9154 T: std::convert::Into<gtype::model::Interval>,
9155 {
9156 self.interval = std::option::Option::Some(v.into());
9157 self
9158 }
9159
9160 /// Sets or clears the value of [interval][crate::model::AggregateFrameworkComplianceReportRequest::interval].
9161 ///
9162 /// # Example
9163 /// ```ignore,no_run
9164 /// # use google_cloud_cloudsecuritycompliance_v1::model::AggregateFrameworkComplianceReportRequest;
9165 /// use gtype::model::Interval;
9166 /// let x = AggregateFrameworkComplianceReportRequest::new().set_or_clear_interval(Some(Interval::default()/* use setters */));
9167 /// let x = AggregateFrameworkComplianceReportRequest::new().set_or_clear_interval(None::<Interval>);
9168 /// ```
9169 pub fn set_or_clear_interval<T>(mut self, v: std::option::Option<T>) -> Self
9170 where
9171 T: std::convert::Into<gtype::model::Interval>,
9172 {
9173 self.interval = v.map(|x| x.into());
9174 self
9175 }
9176
9177 /// Sets the value of [filter][crate::model::AggregateFrameworkComplianceReportRequest::filter].
9178 ///
9179 /// # Example
9180 /// ```ignore,no_run
9181 /// # use google_cloud_cloudsecuritycompliance_v1::model::AggregateFrameworkComplianceReportRequest;
9182 /// let x = AggregateFrameworkComplianceReportRequest::new().set_filter("example");
9183 /// ```
9184 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9185 self.filter = v.into();
9186 self
9187 }
9188}
9189
9190impl wkt::message::Message for AggregateFrameworkComplianceReportRequest {
9191 fn typename() -> &'static str {
9192 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.AggregateFrameworkComplianceReportRequest"
9193 }
9194}
9195
9196/// The response message for [AggregateFrameworkComplianceReport][].
9197#[derive(Clone, Default, PartialEq)]
9198#[non_exhaustive]
9199pub struct AggregateFrameworkComplianceReportResponse {
9200 /// The list of aggregated compliance reports.
9201 pub aggregated_compliance_reports: std::vec::Vec<crate::model::AggregatedComplianceReport>,
9202
9203 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9204}
9205
9206impl AggregateFrameworkComplianceReportResponse {
9207 pub fn new() -> Self {
9208 std::default::Default::default()
9209 }
9210
9211 /// Sets the value of [aggregated_compliance_reports][crate::model::AggregateFrameworkComplianceReportResponse::aggregated_compliance_reports].
9212 ///
9213 /// # Example
9214 /// ```ignore,no_run
9215 /// # use google_cloud_cloudsecuritycompliance_v1::model::AggregateFrameworkComplianceReportResponse;
9216 /// use google_cloud_cloudsecuritycompliance_v1::model::AggregatedComplianceReport;
9217 /// let x = AggregateFrameworkComplianceReportResponse::new()
9218 /// .set_aggregated_compliance_reports([
9219 /// AggregatedComplianceReport::default()/* use setters */,
9220 /// AggregatedComplianceReport::default()/* use (different) setters */,
9221 /// ]);
9222 /// ```
9223 pub fn set_aggregated_compliance_reports<T, V>(mut self, v: T) -> Self
9224 where
9225 T: std::iter::IntoIterator<Item = V>,
9226 V: std::convert::Into<crate::model::AggregatedComplianceReport>,
9227 {
9228 use std::iter::Iterator;
9229 self.aggregated_compliance_reports = v.into_iter().map(|i| i.into()).collect();
9230 self
9231 }
9232}
9233
9234impl wkt::message::Message for AggregateFrameworkComplianceReportResponse {
9235 fn typename() -> &'static str {
9236 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.AggregateFrameworkComplianceReportResponse"
9237 }
9238}
9239
9240/// The details for a control assessment.
9241#[derive(Clone, Default, PartialEq)]
9242#[non_exhaustive]
9243pub struct ControlAssessmentDetails {
9244 /// The number of controls that are passing or not assessed.
9245 pub passing_controls: i32,
9246
9247 /// The number of controls that are failing.
9248 pub failing_controls: i32,
9249
9250 /// The number of controls that were assessed and are passing.
9251 pub assessed_passing_controls: i32,
9252
9253 /// The number of controls that aren't assessed because they require manual
9254 /// review.
9255 pub not_assessed_controls: i32,
9256
9257 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9258}
9259
9260impl ControlAssessmentDetails {
9261 pub fn new() -> Self {
9262 std::default::Default::default()
9263 }
9264
9265 /// Sets the value of [passing_controls][crate::model::ControlAssessmentDetails::passing_controls].
9266 ///
9267 /// # Example
9268 /// ```ignore,no_run
9269 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlAssessmentDetails;
9270 /// let x = ControlAssessmentDetails::new().set_passing_controls(42);
9271 /// ```
9272 pub fn set_passing_controls<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9273 self.passing_controls = v.into();
9274 self
9275 }
9276
9277 /// Sets the value of [failing_controls][crate::model::ControlAssessmentDetails::failing_controls].
9278 ///
9279 /// # Example
9280 /// ```ignore,no_run
9281 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlAssessmentDetails;
9282 /// let x = ControlAssessmentDetails::new().set_failing_controls(42);
9283 /// ```
9284 pub fn set_failing_controls<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9285 self.failing_controls = v.into();
9286 self
9287 }
9288
9289 /// Sets the value of [assessed_passing_controls][crate::model::ControlAssessmentDetails::assessed_passing_controls].
9290 ///
9291 /// # Example
9292 /// ```ignore,no_run
9293 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlAssessmentDetails;
9294 /// let x = ControlAssessmentDetails::new().set_assessed_passing_controls(42);
9295 /// ```
9296 pub fn set_assessed_passing_controls<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9297 self.assessed_passing_controls = v.into();
9298 self
9299 }
9300
9301 /// Sets the value of [not_assessed_controls][crate::model::ControlAssessmentDetails::not_assessed_controls].
9302 ///
9303 /// # Example
9304 /// ```ignore,no_run
9305 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlAssessmentDetails;
9306 /// let x = ControlAssessmentDetails::new().set_not_assessed_controls(42);
9307 /// ```
9308 pub fn set_not_assessed_controls<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9309 self.not_assessed_controls = v.into();
9310 self
9311 }
9312}
9313
9314impl wkt::message::Message for ControlAssessmentDetails {
9315 fn typename() -> &'static str {
9316 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ControlAssessmentDetails"
9317 }
9318}
9319
9320/// The details for a framework compliance summary.
9321#[derive(Clone, Default, PartialEq)]
9322#[non_exhaustive]
9323pub struct FrameworkComplianceSummary {
9324 /// The name of the framework.
9325 pub framework: std::string::String,
9326
9327 /// The control assessment details of the framework.
9328 pub control_assessment_details: std::option::Option<crate::model::ControlAssessmentDetails>,
9329
9330 /// The type of framework.
9331 pub framework_type: crate::model::framework::FrameworkType,
9332
9333 /// The list of cloud providers supported by the framework.
9334 pub supported_cloud_providers: std::vec::Vec<crate::model::CloudProvider>,
9335
9336 /// The list of framework categories supported by the framework.
9337 pub framework_categories: std::vec::Vec<crate::model::FrameworkCategory>,
9338
9339 /// Optional. The display name for the framework.
9340 pub framework_display_name: std::string::String,
9341
9342 /// Identifier. The name of the framework compliance summary.
9343 pub name: std::string::String,
9344
9345 /// The major revision ID of the framework.
9346 pub major_revision_id: i64,
9347
9348 /// The minor revision ID of the framework.
9349 pub minor_revision_id: i64,
9350
9351 /// The target resource details for the framework.
9352 pub target_resource_details: std::vec::Vec<crate::model::TargetResourceDetails>,
9353
9354 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9355}
9356
9357impl FrameworkComplianceSummary {
9358 pub fn new() -> Self {
9359 std::default::Default::default()
9360 }
9361
9362 /// Sets the value of [framework][crate::model::FrameworkComplianceSummary::framework].
9363 ///
9364 /// # Example
9365 /// ```ignore,no_run
9366 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
9367 /// let x = FrameworkComplianceSummary::new().set_framework("example");
9368 /// ```
9369 pub fn set_framework<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9370 self.framework = v.into();
9371 self
9372 }
9373
9374 /// Sets the value of [control_assessment_details][crate::model::FrameworkComplianceSummary::control_assessment_details].
9375 ///
9376 /// # Example
9377 /// ```ignore,no_run
9378 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
9379 /// use google_cloud_cloudsecuritycompliance_v1::model::ControlAssessmentDetails;
9380 /// let x = FrameworkComplianceSummary::new().set_control_assessment_details(ControlAssessmentDetails::default()/* use setters */);
9381 /// ```
9382 pub fn set_control_assessment_details<T>(mut self, v: T) -> Self
9383 where
9384 T: std::convert::Into<crate::model::ControlAssessmentDetails>,
9385 {
9386 self.control_assessment_details = std::option::Option::Some(v.into());
9387 self
9388 }
9389
9390 /// Sets or clears the value of [control_assessment_details][crate::model::FrameworkComplianceSummary::control_assessment_details].
9391 ///
9392 /// # Example
9393 /// ```ignore,no_run
9394 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
9395 /// use google_cloud_cloudsecuritycompliance_v1::model::ControlAssessmentDetails;
9396 /// let x = FrameworkComplianceSummary::new().set_or_clear_control_assessment_details(Some(ControlAssessmentDetails::default()/* use setters */));
9397 /// let x = FrameworkComplianceSummary::new().set_or_clear_control_assessment_details(None::<ControlAssessmentDetails>);
9398 /// ```
9399 pub fn set_or_clear_control_assessment_details<T>(mut self, v: std::option::Option<T>) -> Self
9400 where
9401 T: std::convert::Into<crate::model::ControlAssessmentDetails>,
9402 {
9403 self.control_assessment_details = v.map(|x| x.into());
9404 self
9405 }
9406
9407 /// Sets the value of [framework_type][crate::model::FrameworkComplianceSummary::framework_type].
9408 ///
9409 /// # Example
9410 /// ```ignore,no_run
9411 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
9412 /// use google_cloud_cloudsecuritycompliance_v1::model::framework::FrameworkType;
9413 /// let x0 = FrameworkComplianceSummary::new().set_framework_type(FrameworkType::BuiltIn);
9414 /// let x1 = FrameworkComplianceSummary::new().set_framework_type(FrameworkType::Custom);
9415 /// ```
9416 pub fn set_framework_type<T: std::convert::Into<crate::model::framework::FrameworkType>>(
9417 mut self,
9418 v: T,
9419 ) -> Self {
9420 self.framework_type = v.into();
9421 self
9422 }
9423
9424 /// Sets the value of [supported_cloud_providers][crate::model::FrameworkComplianceSummary::supported_cloud_providers].
9425 ///
9426 /// # Example
9427 /// ```ignore,no_run
9428 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
9429 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudProvider;
9430 /// let x = FrameworkComplianceSummary::new().set_supported_cloud_providers([
9431 /// CloudProvider::Aws,
9432 /// CloudProvider::Azure,
9433 /// CloudProvider::Gcp,
9434 /// ]);
9435 /// ```
9436 pub fn set_supported_cloud_providers<T, V>(mut self, v: T) -> Self
9437 where
9438 T: std::iter::IntoIterator<Item = V>,
9439 V: std::convert::Into<crate::model::CloudProvider>,
9440 {
9441 use std::iter::Iterator;
9442 self.supported_cloud_providers = v.into_iter().map(|i| i.into()).collect();
9443 self
9444 }
9445
9446 /// Sets the value of [framework_categories][crate::model::FrameworkComplianceSummary::framework_categories].
9447 ///
9448 /// # Example
9449 /// ```ignore,no_run
9450 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
9451 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkCategory;
9452 /// let x = FrameworkComplianceSummary::new().set_framework_categories([
9453 /// FrameworkCategory::IndustryDefinedStandard,
9454 /// FrameworkCategory::AssuredWorkloads,
9455 /// FrameworkCategory::DataSecurity,
9456 /// ]);
9457 /// ```
9458 pub fn set_framework_categories<T, V>(mut self, v: T) -> Self
9459 where
9460 T: std::iter::IntoIterator<Item = V>,
9461 V: std::convert::Into<crate::model::FrameworkCategory>,
9462 {
9463 use std::iter::Iterator;
9464 self.framework_categories = v.into_iter().map(|i| i.into()).collect();
9465 self
9466 }
9467
9468 /// Sets the value of [framework_display_name][crate::model::FrameworkComplianceSummary::framework_display_name].
9469 ///
9470 /// # Example
9471 /// ```ignore,no_run
9472 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
9473 /// let x = FrameworkComplianceSummary::new().set_framework_display_name("example");
9474 /// ```
9475 pub fn set_framework_display_name<T: std::convert::Into<std::string::String>>(
9476 mut self,
9477 v: T,
9478 ) -> Self {
9479 self.framework_display_name = v.into();
9480 self
9481 }
9482
9483 /// Sets the value of [name][crate::model::FrameworkComplianceSummary::name].
9484 ///
9485 /// # Example
9486 /// ```ignore,no_run
9487 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
9488 /// let x = FrameworkComplianceSummary::new().set_name("example");
9489 /// ```
9490 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9491 self.name = v.into();
9492 self
9493 }
9494
9495 /// Sets the value of [major_revision_id][crate::model::FrameworkComplianceSummary::major_revision_id].
9496 ///
9497 /// # Example
9498 /// ```ignore,no_run
9499 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
9500 /// let x = FrameworkComplianceSummary::new().set_major_revision_id(42);
9501 /// ```
9502 pub fn set_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9503 self.major_revision_id = v.into();
9504 self
9505 }
9506
9507 /// Sets the value of [minor_revision_id][crate::model::FrameworkComplianceSummary::minor_revision_id].
9508 ///
9509 /// # Example
9510 /// ```ignore,no_run
9511 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
9512 /// let x = FrameworkComplianceSummary::new().set_minor_revision_id(42);
9513 /// ```
9514 pub fn set_minor_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9515 self.minor_revision_id = v.into();
9516 self
9517 }
9518
9519 /// Sets the value of [target_resource_details][crate::model::FrameworkComplianceSummary::target_resource_details].
9520 ///
9521 /// # Example
9522 /// ```ignore,no_run
9523 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
9524 /// use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceDetails;
9525 /// let x = FrameworkComplianceSummary::new()
9526 /// .set_target_resource_details([
9527 /// TargetResourceDetails::default()/* use setters */,
9528 /// TargetResourceDetails::default()/* use (different) setters */,
9529 /// ]);
9530 /// ```
9531 pub fn set_target_resource_details<T, V>(mut self, v: T) -> Self
9532 where
9533 T: std::iter::IntoIterator<Item = V>,
9534 V: std::convert::Into<crate::model::TargetResourceDetails>,
9535 {
9536 use std::iter::Iterator;
9537 self.target_resource_details = v.into_iter().map(|i| i.into()).collect();
9538 self
9539 }
9540}
9541
9542impl wkt::message::Message for FrameworkComplianceSummary {
9543 fn typename() -> &'static str {
9544 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FrameworkComplianceSummary"
9545 }
9546}
9547
9548/// The details for a finding.
9549#[derive(Clone, Default, PartialEq)]
9550#[non_exhaustive]
9551pub struct FindingSummary {
9552 /// The category of the finding.
9553 pub finding_category: std::string::String,
9554
9555 /// The class of the finding.
9556 pub finding_class: crate::model::FindingClass,
9557
9558 /// The severity of the finding.
9559 pub severity: crate::model::Severity,
9560
9561 /// The count of the finding.
9562 pub finding_count: i64,
9563
9564 /// Output only. The last updated time of the finding.
9565 pub update_time: std::option::Option<wkt::Timestamp>,
9566
9567 /// Optional. The list of compliance frameworks that the finding belongs to.
9568 pub related_frameworks: std::vec::Vec<std::string::String>,
9569
9570 /// Identifier. The name of the finding summary.
9571 pub name: std::string::String,
9572
9573 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9574}
9575
9576impl FindingSummary {
9577 pub fn new() -> Self {
9578 std::default::Default::default()
9579 }
9580
9581 /// Sets the value of [finding_category][crate::model::FindingSummary::finding_category].
9582 ///
9583 /// # Example
9584 /// ```ignore,no_run
9585 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingSummary;
9586 /// let x = FindingSummary::new().set_finding_category("example");
9587 /// ```
9588 pub fn set_finding_category<T: std::convert::Into<std::string::String>>(
9589 mut self,
9590 v: T,
9591 ) -> Self {
9592 self.finding_category = v.into();
9593 self
9594 }
9595
9596 /// Sets the value of [finding_class][crate::model::FindingSummary::finding_class].
9597 ///
9598 /// # Example
9599 /// ```ignore,no_run
9600 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingSummary;
9601 /// use google_cloud_cloudsecuritycompliance_v1::model::FindingClass;
9602 /// let x0 = FindingSummary::new().set_finding_class(FindingClass::Threat);
9603 /// let x1 = FindingSummary::new().set_finding_class(FindingClass::Vulnerability);
9604 /// let x2 = FindingSummary::new().set_finding_class(FindingClass::Misconfiguration);
9605 /// ```
9606 pub fn set_finding_class<T: std::convert::Into<crate::model::FindingClass>>(
9607 mut self,
9608 v: T,
9609 ) -> Self {
9610 self.finding_class = v.into();
9611 self
9612 }
9613
9614 /// Sets the value of [severity][crate::model::FindingSummary::severity].
9615 ///
9616 /// # Example
9617 /// ```ignore,no_run
9618 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingSummary;
9619 /// use google_cloud_cloudsecuritycompliance_v1::model::Severity;
9620 /// let x0 = FindingSummary::new().set_severity(Severity::Critical);
9621 /// let x1 = FindingSummary::new().set_severity(Severity::High);
9622 /// let x2 = FindingSummary::new().set_severity(Severity::Medium);
9623 /// ```
9624 pub fn set_severity<T: std::convert::Into<crate::model::Severity>>(mut self, v: T) -> Self {
9625 self.severity = v.into();
9626 self
9627 }
9628
9629 /// Sets the value of [finding_count][crate::model::FindingSummary::finding_count].
9630 ///
9631 /// # Example
9632 /// ```ignore,no_run
9633 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingSummary;
9634 /// let x = FindingSummary::new().set_finding_count(42);
9635 /// ```
9636 pub fn set_finding_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9637 self.finding_count = v.into();
9638 self
9639 }
9640
9641 /// Sets the value of [update_time][crate::model::FindingSummary::update_time].
9642 ///
9643 /// # Example
9644 /// ```ignore,no_run
9645 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingSummary;
9646 /// use wkt::Timestamp;
9647 /// let x = FindingSummary::new().set_update_time(Timestamp::default()/* use setters */);
9648 /// ```
9649 pub fn set_update_time<T>(mut self, v: T) -> Self
9650 where
9651 T: std::convert::Into<wkt::Timestamp>,
9652 {
9653 self.update_time = std::option::Option::Some(v.into());
9654 self
9655 }
9656
9657 /// Sets or clears the value of [update_time][crate::model::FindingSummary::update_time].
9658 ///
9659 /// # Example
9660 /// ```ignore,no_run
9661 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingSummary;
9662 /// use wkt::Timestamp;
9663 /// let x = FindingSummary::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9664 /// let x = FindingSummary::new().set_or_clear_update_time(None::<Timestamp>);
9665 /// ```
9666 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9667 where
9668 T: std::convert::Into<wkt::Timestamp>,
9669 {
9670 self.update_time = v.map(|x| x.into());
9671 self
9672 }
9673
9674 /// Sets the value of [related_frameworks][crate::model::FindingSummary::related_frameworks].
9675 ///
9676 /// # Example
9677 /// ```ignore,no_run
9678 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingSummary;
9679 /// let x = FindingSummary::new().set_related_frameworks(["a", "b", "c"]);
9680 /// ```
9681 pub fn set_related_frameworks<T, V>(mut self, v: T) -> Self
9682 where
9683 T: std::iter::IntoIterator<Item = V>,
9684 V: std::convert::Into<std::string::String>,
9685 {
9686 use std::iter::Iterator;
9687 self.related_frameworks = v.into_iter().map(|i| i.into()).collect();
9688 self
9689 }
9690
9691 /// Sets the value of [name][crate::model::FindingSummary::name].
9692 ///
9693 /// # Example
9694 /// ```ignore,no_run
9695 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingSummary;
9696 /// let x = FindingSummary::new().set_name("example");
9697 /// ```
9698 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9699 self.name = v.into();
9700 self
9701 }
9702}
9703
9704impl wkt::message::Message for FindingSummary {
9705 fn typename() -> &'static str {
9706 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FindingSummary"
9707 }
9708}
9709
9710/// The details for control compliance.
9711#[derive(Clone, Default, PartialEq)]
9712#[non_exhaustive]
9713pub struct ControlComplianceSummary {
9714 /// The name of the control.
9715 pub control: std::string::String,
9716
9717 /// The display name of the control.
9718 pub display_name: std::string::String,
9719
9720 /// The description of the control.
9721 pub description: std::string::String,
9722
9723 /// Output only. The overall evaluation status of the control.
9724 pub overall_evaluation_state: crate::model::EvaluationState,
9725
9726 /// The total number of findings for the control.
9727 pub total_findings_count: i32,
9728
9729 /// The list of compliance frameworks that the control belongs to.
9730 pub compliance_frameworks: std::vec::Vec<std::string::String>,
9731
9732 /// The list of similar controls.
9733 pub similar_controls: std::vec::Vec<crate::model::SimilarControls>,
9734
9735 /// The list of cloud control reports.
9736 pub cloud_control_reports: std::vec::Vec<crate::model::CloudControlReport>,
9737
9738 /// The responsibility type for the control.
9739 pub control_responsibility_type: crate::model::RegulatoryControlResponsibilityType,
9740
9741 /// Whether the control is a fake control. Fake controls are created
9742 /// and mapped to cloud controls that don't belong to a control group.
9743 pub is_fake_control: bool,
9744
9745 /// Identifier. The name of the control compliance summary.
9746 pub name: std::string::String,
9747
9748 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9749}
9750
9751impl ControlComplianceSummary {
9752 pub fn new() -> Self {
9753 std::default::Default::default()
9754 }
9755
9756 /// Sets the value of [control][crate::model::ControlComplianceSummary::control].
9757 ///
9758 /// # Example
9759 /// ```ignore,no_run
9760 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
9761 /// let x = ControlComplianceSummary::new().set_control("example");
9762 /// ```
9763 pub fn set_control<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9764 self.control = v.into();
9765 self
9766 }
9767
9768 /// Sets the value of [display_name][crate::model::ControlComplianceSummary::display_name].
9769 ///
9770 /// # Example
9771 /// ```ignore,no_run
9772 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
9773 /// let x = ControlComplianceSummary::new().set_display_name("example");
9774 /// ```
9775 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9776 self.display_name = v.into();
9777 self
9778 }
9779
9780 /// Sets the value of [description][crate::model::ControlComplianceSummary::description].
9781 ///
9782 /// # Example
9783 /// ```ignore,no_run
9784 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
9785 /// let x = ControlComplianceSummary::new().set_description("example");
9786 /// ```
9787 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9788 self.description = v.into();
9789 self
9790 }
9791
9792 /// Sets the value of [overall_evaluation_state][crate::model::ControlComplianceSummary::overall_evaluation_state].
9793 ///
9794 /// # Example
9795 /// ```ignore,no_run
9796 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
9797 /// use google_cloud_cloudsecuritycompliance_v1::model::EvaluationState;
9798 /// let x0 = ControlComplianceSummary::new().set_overall_evaluation_state(EvaluationState::Passed);
9799 /// let x1 = ControlComplianceSummary::new().set_overall_evaluation_state(EvaluationState::Failed);
9800 /// let x2 = ControlComplianceSummary::new().set_overall_evaluation_state(EvaluationState::NotAssessed);
9801 /// ```
9802 pub fn set_overall_evaluation_state<T: std::convert::Into<crate::model::EvaluationState>>(
9803 mut self,
9804 v: T,
9805 ) -> Self {
9806 self.overall_evaluation_state = v.into();
9807 self
9808 }
9809
9810 /// Sets the value of [total_findings_count][crate::model::ControlComplianceSummary::total_findings_count].
9811 ///
9812 /// # Example
9813 /// ```ignore,no_run
9814 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
9815 /// let x = ControlComplianceSummary::new().set_total_findings_count(42);
9816 /// ```
9817 pub fn set_total_findings_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9818 self.total_findings_count = v.into();
9819 self
9820 }
9821
9822 /// Sets the value of [compliance_frameworks][crate::model::ControlComplianceSummary::compliance_frameworks].
9823 ///
9824 /// # Example
9825 /// ```ignore,no_run
9826 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
9827 /// let x = ControlComplianceSummary::new().set_compliance_frameworks(["a", "b", "c"]);
9828 /// ```
9829 pub fn set_compliance_frameworks<T, V>(mut self, v: T) -> Self
9830 where
9831 T: std::iter::IntoIterator<Item = V>,
9832 V: std::convert::Into<std::string::String>,
9833 {
9834 use std::iter::Iterator;
9835 self.compliance_frameworks = v.into_iter().map(|i| i.into()).collect();
9836 self
9837 }
9838
9839 /// Sets the value of [similar_controls][crate::model::ControlComplianceSummary::similar_controls].
9840 ///
9841 /// # Example
9842 /// ```ignore,no_run
9843 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
9844 /// use google_cloud_cloudsecuritycompliance_v1::model::SimilarControls;
9845 /// let x = ControlComplianceSummary::new()
9846 /// .set_similar_controls([
9847 /// SimilarControls::default()/* use setters */,
9848 /// SimilarControls::default()/* use (different) setters */,
9849 /// ]);
9850 /// ```
9851 pub fn set_similar_controls<T, V>(mut self, v: T) -> Self
9852 where
9853 T: std::iter::IntoIterator<Item = V>,
9854 V: std::convert::Into<crate::model::SimilarControls>,
9855 {
9856 use std::iter::Iterator;
9857 self.similar_controls = v.into_iter().map(|i| i.into()).collect();
9858 self
9859 }
9860
9861 /// Sets the value of [cloud_control_reports][crate::model::ControlComplianceSummary::cloud_control_reports].
9862 ///
9863 /// # Example
9864 /// ```ignore,no_run
9865 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
9866 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
9867 /// let x = ControlComplianceSummary::new()
9868 /// .set_cloud_control_reports([
9869 /// CloudControlReport::default()/* use setters */,
9870 /// CloudControlReport::default()/* use (different) setters */,
9871 /// ]);
9872 /// ```
9873 pub fn set_cloud_control_reports<T, V>(mut self, v: T) -> Self
9874 where
9875 T: std::iter::IntoIterator<Item = V>,
9876 V: std::convert::Into<crate::model::CloudControlReport>,
9877 {
9878 use std::iter::Iterator;
9879 self.cloud_control_reports = v.into_iter().map(|i| i.into()).collect();
9880 self
9881 }
9882
9883 /// Sets the value of [control_responsibility_type][crate::model::ControlComplianceSummary::control_responsibility_type].
9884 ///
9885 /// # Example
9886 /// ```ignore,no_run
9887 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
9888 /// use google_cloud_cloudsecuritycompliance_v1::model::RegulatoryControlResponsibilityType;
9889 /// let x0 = ControlComplianceSummary::new().set_control_responsibility_type(RegulatoryControlResponsibilityType::Google);
9890 /// let x1 = ControlComplianceSummary::new().set_control_responsibility_type(RegulatoryControlResponsibilityType::Customer);
9891 /// let x2 = ControlComplianceSummary::new().set_control_responsibility_type(RegulatoryControlResponsibilityType::Shared);
9892 /// ```
9893 pub fn set_control_responsibility_type<
9894 T: std::convert::Into<crate::model::RegulatoryControlResponsibilityType>,
9895 >(
9896 mut self,
9897 v: T,
9898 ) -> Self {
9899 self.control_responsibility_type = v.into();
9900 self
9901 }
9902
9903 /// Sets the value of [is_fake_control][crate::model::ControlComplianceSummary::is_fake_control].
9904 ///
9905 /// # Example
9906 /// ```ignore,no_run
9907 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
9908 /// let x = ControlComplianceSummary::new().set_is_fake_control(true);
9909 /// ```
9910 pub fn set_is_fake_control<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9911 self.is_fake_control = v.into();
9912 self
9913 }
9914
9915 /// Sets the value of [name][crate::model::ControlComplianceSummary::name].
9916 ///
9917 /// # Example
9918 /// ```ignore,no_run
9919 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
9920 /// let x = ControlComplianceSummary::new().set_name("example");
9921 /// ```
9922 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9923 self.name = v.into();
9924 self
9925 }
9926}
9927
9928impl wkt::message::Message for ControlComplianceSummary {
9929 fn typename() -> &'static str {
9930 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ControlComplianceSummary"
9931 }
9932}
9933
9934/// The cloud control report.
9935#[derive(Clone, Default, PartialEq)]
9936#[non_exhaustive]
9937pub struct CloudControlReport {
9938 /// The name of the cloud control.
9939 pub cloud_control: std::string::String,
9940
9941 /// The display name of the cloud control.
9942 pub display_name: std::string::String,
9943
9944 /// The description of the cloud control.
9945 pub description: std::string::String,
9946
9947 /// The list of categories for the cloud control.
9948 pub categories: std::vec::Vec<std::string::String>,
9949
9950 /// The list of similar controls.
9951 pub similar_controls: std::vec::Vec<crate::model::SimilarControls>,
9952
9953 /// The type of the cloud control.
9954 pub cloud_control_type: crate::model::cloud_control::Type,
9955
9956 /// The category of the finding.
9957 pub finding_category: std::string::String,
9958
9959 /// The list of rules that correspond to the cloud control.
9960 pub rules: std::vec::Vec<crate::model::Rule>,
9961
9962 /// The severity of the finding.
9963 pub finding_severity: crate::model::Severity,
9964
9965 /// The enforcement mode of the cloud control.
9966 pub enforcement_mode: crate::model::EnforcementMode,
9967
9968 /// The name of the cloud control deployment.
9969 pub cloud_control_deployment: std::string::String,
9970
9971 /// The major revision ID of the cloud control.
9972 pub major_revision_id: i64,
9973
9974 /// The minor revision ID of the cloud control.
9975 pub minor_revision_id: i64,
9976
9977 /// The major revision IDs of the frameworks that the cloud control belongs to.
9978 pub framework_major_revision_ids: std::vec::Vec<i64>,
9979
9980 /// The assessment details of the cloud control.
9981 pub assessment_details:
9982 std::option::Option<crate::model::cloud_control_report::AssessmentDetails>,
9983
9984 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9985}
9986
9987impl CloudControlReport {
9988 pub fn new() -> Self {
9989 std::default::Default::default()
9990 }
9991
9992 /// Sets the value of [cloud_control][crate::model::CloudControlReport::cloud_control].
9993 ///
9994 /// # Example
9995 /// ```ignore,no_run
9996 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
9997 /// let x = CloudControlReport::new().set_cloud_control("example");
9998 /// ```
9999 pub fn set_cloud_control<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10000 self.cloud_control = v.into();
10001 self
10002 }
10003
10004 /// Sets the value of [display_name][crate::model::CloudControlReport::display_name].
10005 ///
10006 /// # Example
10007 /// ```ignore,no_run
10008 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10009 /// let x = CloudControlReport::new().set_display_name("example");
10010 /// ```
10011 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10012 self.display_name = v.into();
10013 self
10014 }
10015
10016 /// Sets the value of [description][crate::model::CloudControlReport::description].
10017 ///
10018 /// # Example
10019 /// ```ignore,no_run
10020 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10021 /// let x = CloudControlReport::new().set_description("example");
10022 /// ```
10023 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10024 self.description = v.into();
10025 self
10026 }
10027
10028 /// Sets the value of [categories][crate::model::CloudControlReport::categories].
10029 ///
10030 /// # Example
10031 /// ```ignore,no_run
10032 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10033 /// let x = CloudControlReport::new().set_categories(["a", "b", "c"]);
10034 /// ```
10035 pub fn set_categories<T, V>(mut self, v: T) -> Self
10036 where
10037 T: std::iter::IntoIterator<Item = V>,
10038 V: std::convert::Into<std::string::String>,
10039 {
10040 use std::iter::Iterator;
10041 self.categories = v.into_iter().map(|i| i.into()).collect();
10042 self
10043 }
10044
10045 /// Sets the value of [similar_controls][crate::model::CloudControlReport::similar_controls].
10046 ///
10047 /// # Example
10048 /// ```ignore,no_run
10049 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10050 /// use google_cloud_cloudsecuritycompliance_v1::model::SimilarControls;
10051 /// let x = CloudControlReport::new()
10052 /// .set_similar_controls([
10053 /// SimilarControls::default()/* use setters */,
10054 /// SimilarControls::default()/* use (different) setters */,
10055 /// ]);
10056 /// ```
10057 pub fn set_similar_controls<T, V>(mut self, v: T) -> Self
10058 where
10059 T: std::iter::IntoIterator<Item = V>,
10060 V: std::convert::Into<crate::model::SimilarControls>,
10061 {
10062 use std::iter::Iterator;
10063 self.similar_controls = v.into_iter().map(|i| i.into()).collect();
10064 self
10065 }
10066
10067 /// Sets the value of [cloud_control_type][crate::model::CloudControlReport::cloud_control_type].
10068 ///
10069 /// # Example
10070 /// ```ignore,no_run
10071 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10072 /// use google_cloud_cloudsecuritycompliance_v1::model::cloud_control::Type;
10073 /// let x0 = CloudControlReport::new().set_cloud_control_type(Type::Custom);
10074 /// let x1 = CloudControlReport::new().set_cloud_control_type(Type::BuiltIn);
10075 /// ```
10076 pub fn set_cloud_control_type<T: std::convert::Into<crate::model::cloud_control::Type>>(
10077 mut self,
10078 v: T,
10079 ) -> Self {
10080 self.cloud_control_type = v.into();
10081 self
10082 }
10083
10084 /// Sets the value of [finding_category][crate::model::CloudControlReport::finding_category].
10085 ///
10086 /// # Example
10087 /// ```ignore,no_run
10088 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10089 /// let x = CloudControlReport::new().set_finding_category("example");
10090 /// ```
10091 pub fn set_finding_category<T: std::convert::Into<std::string::String>>(
10092 mut self,
10093 v: T,
10094 ) -> Self {
10095 self.finding_category = v.into();
10096 self
10097 }
10098
10099 /// Sets the value of [rules][crate::model::CloudControlReport::rules].
10100 ///
10101 /// # Example
10102 /// ```ignore,no_run
10103 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10104 /// use google_cloud_cloudsecuritycompliance_v1::model::Rule;
10105 /// let x = CloudControlReport::new()
10106 /// .set_rules([
10107 /// Rule::default()/* use setters */,
10108 /// Rule::default()/* use (different) setters */,
10109 /// ]);
10110 /// ```
10111 pub fn set_rules<T, V>(mut self, v: T) -> Self
10112 where
10113 T: std::iter::IntoIterator<Item = V>,
10114 V: std::convert::Into<crate::model::Rule>,
10115 {
10116 use std::iter::Iterator;
10117 self.rules = v.into_iter().map(|i| i.into()).collect();
10118 self
10119 }
10120
10121 /// Sets the value of [finding_severity][crate::model::CloudControlReport::finding_severity].
10122 ///
10123 /// # Example
10124 /// ```ignore,no_run
10125 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10126 /// use google_cloud_cloudsecuritycompliance_v1::model::Severity;
10127 /// let x0 = CloudControlReport::new().set_finding_severity(Severity::Critical);
10128 /// let x1 = CloudControlReport::new().set_finding_severity(Severity::High);
10129 /// let x2 = CloudControlReport::new().set_finding_severity(Severity::Medium);
10130 /// ```
10131 pub fn set_finding_severity<T: std::convert::Into<crate::model::Severity>>(
10132 mut self,
10133 v: T,
10134 ) -> Self {
10135 self.finding_severity = v.into();
10136 self
10137 }
10138
10139 /// Sets the value of [enforcement_mode][crate::model::CloudControlReport::enforcement_mode].
10140 ///
10141 /// # Example
10142 /// ```ignore,no_run
10143 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10144 /// use google_cloud_cloudsecuritycompliance_v1::model::EnforcementMode;
10145 /// let x0 = CloudControlReport::new().set_enforcement_mode(EnforcementMode::Preventive);
10146 /// let x1 = CloudControlReport::new().set_enforcement_mode(EnforcementMode::Detective);
10147 /// let x2 = CloudControlReport::new().set_enforcement_mode(EnforcementMode::Audit);
10148 /// ```
10149 pub fn set_enforcement_mode<T: std::convert::Into<crate::model::EnforcementMode>>(
10150 mut self,
10151 v: T,
10152 ) -> Self {
10153 self.enforcement_mode = v.into();
10154 self
10155 }
10156
10157 /// Sets the value of [cloud_control_deployment][crate::model::CloudControlReport::cloud_control_deployment].
10158 ///
10159 /// # Example
10160 /// ```ignore,no_run
10161 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10162 /// let x = CloudControlReport::new().set_cloud_control_deployment("example");
10163 /// ```
10164 pub fn set_cloud_control_deployment<T: std::convert::Into<std::string::String>>(
10165 mut self,
10166 v: T,
10167 ) -> Self {
10168 self.cloud_control_deployment = v.into();
10169 self
10170 }
10171
10172 /// Sets the value of [major_revision_id][crate::model::CloudControlReport::major_revision_id].
10173 ///
10174 /// # Example
10175 /// ```ignore,no_run
10176 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10177 /// let x = CloudControlReport::new().set_major_revision_id(42);
10178 /// ```
10179 pub fn set_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10180 self.major_revision_id = v.into();
10181 self
10182 }
10183
10184 /// Sets the value of [minor_revision_id][crate::model::CloudControlReport::minor_revision_id].
10185 ///
10186 /// # Example
10187 /// ```ignore,no_run
10188 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10189 /// let x = CloudControlReport::new().set_minor_revision_id(42);
10190 /// ```
10191 pub fn set_minor_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10192 self.minor_revision_id = v.into();
10193 self
10194 }
10195
10196 /// Sets the value of [framework_major_revision_ids][crate::model::CloudControlReport::framework_major_revision_ids].
10197 ///
10198 /// # Example
10199 /// ```ignore,no_run
10200 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10201 /// let x = CloudControlReport::new().set_framework_major_revision_ids([1, 2, 3]);
10202 /// ```
10203 pub fn set_framework_major_revision_ids<T, V>(mut self, v: T) -> Self
10204 where
10205 T: std::iter::IntoIterator<Item = V>,
10206 V: std::convert::Into<i64>,
10207 {
10208 use std::iter::Iterator;
10209 self.framework_major_revision_ids = v.into_iter().map(|i| i.into()).collect();
10210 self
10211 }
10212
10213 /// Sets the value of [assessment_details][crate::model::CloudControlReport::assessment_details].
10214 ///
10215 /// Note that all the setters affecting `assessment_details` are mutually
10216 /// exclusive.
10217 ///
10218 /// # Example
10219 /// ```ignore,no_run
10220 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10221 /// use google_cloud_cloudsecuritycompliance_v1::model::ManualCloudControlAssessmentDetails;
10222 /// let x = CloudControlReport::new().set_assessment_details(Some(
10223 /// google_cloud_cloudsecuritycompliance_v1::model::cloud_control_report::AssessmentDetails::ManualCloudControlAssessmentDetails(ManualCloudControlAssessmentDetails::default().into())));
10224 /// ```
10225 pub fn set_assessment_details<
10226 T: std::convert::Into<
10227 std::option::Option<crate::model::cloud_control_report::AssessmentDetails>,
10228 >,
10229 >(
10230 mut self,
10231 v: T,
10232 ) -> Self {
10233 self.assessment_details = v.into();
10234 self
10235 }
10236
10237 /// The value of [assessment_details][crate::model::CloudControlReport::assessment_details]
10238 /// if it holds a `ManualCloudControlAssessmentDetails`, `None` if the field is not set or
10239 /// holds a different branch.
10240 pub fn manual_cloud_control_assessment_details(
10241 &self,
10242 ) -> std::option::Option<&std::boxed::Box<crate::model::ManualCloudControlAssessmentDetails>>
10243 {
10244 #[allow(unreachable_patterns)]
10245 self.assessment_details.as_ref().and_then(|v| match v {
10246 crate::model::cloud_control_report::AssessmentDetails::ManualCloudControlAssessmentDetails(v) => std::option::Option::Some(v),
10247 _ => std::option::Option::None,
10248 })
10249 }
10250
10251 /// Sets the value of [assessment_details][crate::model::CloudControlReport::assessment_details]
10252 /// to hold a `ManualCloudControlAssessmentDetails`.
10253 ///
10254 /// Note that all the setters affecting `assessment_details` are
10255 /// mutually exclusive.
10256 ///
10257 /// # Example
10258 /// ```ignore,no_run
10259 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10260 /// use google_cloud_cloudsecuritycompliance_v1::model::ManualCloudControlAssessmentDetails;
10261 /// let x = CloudControlReport::new().set_manual_cloud_control_assessment_details(ManualCloudControlAssessmentDetails::default()/* use setters */);
10262 /// assert!(x.manual_cloud_control_assessment_details().is_some());
10263 /// assert!(x.cloud_control_assessment_details().is_none());
10264 /// ```
10265 pub fn set_manual_cloud_control_assessment_details<
10266 T: std::convert::Into<std::boxed::Box<crate::model::ManualCloudControlAssessmentDetails>>,
10267 >(
10268 mut self,
10269 v: T,
10270 ) -> Self {
10271 self.assessment_details = std::option::Option::Some(
10272 crate::model::cloud_control_report::AssessmentDetails::ManualCloudControlAssessmentDetails(
10273 v.into()
10274 )
10275 );
10276 self
10277 }
10278
10279 /// The value of [assessment_details][crate::model::CloudControlReport::assessment_details]
10280 /// if it holds a `CloudControlAssessmentDetails`, `None` if the field is not set or
10281 /// holds a different branch.
10282 pub fn cloud_control_assessment_details(
10283 &self,
10284 ) -> std::option::Option<&std::boxed::Box<crate::model::CloudControlAssessmentDetails>> {
10285 #[allow(unreachable_patterns)]
10286 self.assessment_details.as_ref().and_then(|v| match v {
10287 crate::model::cloud_control_report::AssessmentDetails::CloudControlAssessmentDetails(v) => std::option::Option::Some(v),
10288 _ => std::option::Option::None,
10289 })
10290 }
10291
10292 /// Sets the value of [assessment_details][crate::model::CloudControlReport::assessment_details]
10293 /// to hold a `CloudControlAssessmentDetails`.
10294 ///
10295 /// Note that all the setters affecting `assessment_details` are
10296 /// mutually exclusive.
10297 ///
10298 /// # Example
10299 /// ```ignore,no_run
10300 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10301 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAssessmentDetails;
10302 /// let x = CloudControlReport::new().set_cloud_control_assessment_details(CloudControlAssessmentDetails::default()/* use setters */);
10303 /// assert!(x.cloud_control_assessment_details().is_some());
10304 /// assert!(x.manual_cloud_control_assessment_details().is_none());
10305 /// ```
10306 pub fn set_cloud_control_assessment_details<
10307 T: std::convert::Into<std::boxed::Box<crate::model::CloudControlAssessmentDetails>>,
10308 >(
10309 mut self,
10310 v: T,
10311 ) -> Self {
10312 self.assessment_details = std::option::Option::Some(
10313 crate::model::cloud_control_report::AssessmentDetails::CloudControlAssessmentDetails(
10314 v.into(),
10315 ),
10316 );
10317 self
10318 }
10319}
10320
10321impl wkt::message::Message for CloudControlReport {
10322 fn typename() -> &'static str {
10323 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControlReport"
10324 }
10325}
10326
10327/// Defines additional types related to [CloudControlReport].
10328pub mod cloud_control_report {
10329 #[allow(unused_imports)]
10330 use super::*;
10331
10332 /// The assessment details of the cloud control.
10333 #[derive(Clone, Debug, PartialEq)]
10334 #[non_exhaustive]
10335 pub enum AssessmentDetails {
10336 /// The details of a manual cloud control assessment.
10337 ManualCloudControlAssessmentDetails(
10338 std::boxed::Box<crate::model::ManualCloudControlAssessmentDetails>,
10339 ),
10340 /// The details of a cloud control assessment.
10341 CloudControlAssessmentDetails(std::boxed::Box<crate::model::CloudControlAssessmentDetails>),
10342 }
10343}
10344
10345/// The details for a manual cloud control assessment.
10346#[derive(Clone, Default, PartialEq)]
10347#[non_exhaustive]
10348pub struct ManualCloudControlAssessmentDetails {
10349 /// The guide for assessing a cloud control manually.
10350 pub manual_cloud_control_guide: std::vec::Vec<std::string::String>,
10351
10352 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10353}
10354
10355impl ManualCloudControlAssessmentDetails {
10356 pub fn new() -> Self {
10357 std::default::Default::default()
10358 }
10359
10360 /// Sets the value of [manual_cloud_control_guide][crate::model::ManualCloudControlAssessmentDetails::manual_cloud_control_guide].
10361 ///
10362 /// # Example
10363 /// ```ignore,no_run
10364 /// # use google_cloud_cloudsecuritycompliance_v1::model::ManualCloudControlAssessmentDetails;
10365 /// let x = ManualCloudControlAssessmentDetails::new().set_manual_cloud_control_guide(["a", "b", "c"]);
10366 /// ```
10367 pub fn set_manual_cloud_control_guide<T, V>(mut self, v: T) -> Self
10368 where
10369 T: std::iter::IntoIterator<Item = V>,
10370 V: std::convert::Into<std::string::String>,
10371 {
10372 use std::iter::Iterator;
10373 self.manual_cloud_control_guide = v.into_iter().map(|i| i.into()).collect();
10374 self
10375 }
10376}
10377
10378impl wkt::message::Message for ManualCloudControlAssessmentDetails {
10379 fn typename() -> &'static str {
10380 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ManualCloudControlAssessmentDetails"
10381 }
10382}
10383
10384/// The cloud control assessment details for non-manual cloud controls.
10385#[derive(Clone, Default, PartialEq)]
10386#[non_exhaustive]
10387pub struct CloudControlAssessmentDetails {
10388 /// The number of findings for the cloud control.
10389 pub findings_count: i32,
10390
10391 /// Output only. The evaluation status of the cloud control.
10392 pub evaluation_state: crate::model::EvaluationState,
10393
10394 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10395}
10396
10397impl CloudControlAssessmentDetails {
10398 pub fn new() -> Self {
10399 std::default::Default::default()
10400 }
10401
10402 /// Sets the value of [findings_count][crate::model::CloudControlAssessmentDetails::findings_count].
10403 ///
10404 /// # Example
10405 /// ```ignore,no_run
10406 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAssessmentDetails;
10407 /// let x = CloudControlAssessmentDetails::new().set_findings_count(42);
10408 /// ```
10409 pub fn set_findings_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10410 self.findings_count = v.into();
10411 self
10412 }
10413
10414 /// Sets the value of [evaluation_state][crate::model::CloudControlAssessmentDetails::evaluation_state].
10415 ///
10416 /// # Example
10417 /// ```ignore,no_run
10418 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAssessmentDetails;
10419 /// use google_cloud_cloudsecuritycompliance_v1::model::EvaluationState;
10420 /// let x0 = CloudControlAssessmentDetails::new().set_evaluation_state(EvaluationState::Passed);
10421 /// let x1 = CloudControlAssessmentDetails::new().set_evaluation_state(EvaluationState::Failed);
10422 /// let x2 = CloudControlAssessmentDetails::new().set_evaluation_state(EvaluationState::NotAssessed);
10423 /// ```
10424 pub fn set_evaluation_state<T: std::convert::Into<crate::model::EvaluationState>>(
10425 mut self,
10426 v: T,
10427 ) -> Self {
10428 self.evaluation_state = v.into();
10429 self
10430 }
10431}
10432
10433impl wkt::message::Message for CloudControlAssessmentDetails {
10434 fn typename() -> &'static str {
10435 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControlAssessmentDetails"
10436 }
10437}
10438
10439/// The similar controls.
10440#[derive(Clone, Default, PartialEq)]
10441#[non_exhaustive]
10442pub struct SimilarControls {
10443 /// The name of the framework.
10444 pub framework: std::string::String,
10445
10446 /// The ID of the control.
10447 pub control_id: std::string::String,
10448
10449 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10450}
10451
10452impl SimilarControls {
10453 pub fn new() -> Self {
10454 std::default::Default::default()
10455 }
10456
10457 /// Sets the value of [framework][crate::model::SimilarControls::framework].
10458 ///
10459 /// # Example
10460 /// ```ignore,no_run
10461 /// # use google_cloud_cloudsecuritycompliance_v1::model::SimilarControls;
10462 /// let x = SimilarControls::new().set_framework("example");
10463 /// ```
10464 pub fn set_framework<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10465 self.framework = v.into();
10466 self
10467 }
10468
10469 /// Sets the value of [control_id][crate::model::SimilarControls::control_id].
10470 ///
10471 /// # Example
10472 /// ```ignore,no_run
10473 /// # use google_cloud_cloudsecuritycompliance_v1::model::SimilarControls;
10474 /// let x = SimilarControls::new().set_control_id("example");
10475 /// ```
10476 pub fn set_control_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10477 self.control_id = v.into();
10478 self
10479 }
10480}
10481
10482impl wkt::message::Message for SimilarControls {
10483 fn typename() -> &'static str {
10484 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.SimilarControls"
10485 }
10486}
10487
10488/// The aggregated compliance report.
10489#[derive(Clone, Default, PartialEq)]
10490#[non_exhaustive]
10491pub struct AggregatedComplianceReport {
10492 /// The control assessment details of the framework.
10493 pub control_assessment_details: std::option::Option<crate::model::ControlAssessmentDetails>,
10494
10495 /// The report time of the aggregated compliance report.
10496 pub report_time: std::option::Option<wkt::Timestamp>,
10497
10498 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10499}
10500
10501impl AggregatedComplianceReport {
10502 pub fn new() -> Self {
10503 std::default::Default::default()
10504 }
10505
10506 /// Sets the value of [control_assessment_details][crate::model::AggregatedComplianceReport::control_assessment_details].
10507 ///
10508 /// # Example
10509 /// ```ignore,no_run
10510 /// # use google_cloud_cloudsecuritycompliance_v1::model::AggregatedComplianceReport;
10511 /// use google_cloud_cloudsecuritycompliance_v1::model::ControlAssessmentDetails;
10512 /// let x = AggregatedComplianceReport::new().set_control_assessment_details(ControlAssessmentDetails::default()/* use setters */);
10513 /// ```
10514 pub fn set_control_assessment_details<T>(mut self, v: T) -> Self
10515 where
10516 T: std::convert::Into<crate::model::ControlAssessmentDetails>,
10517 {
10518 self.control_assessment_details = std::option::Option::Some(v.into());
10519 self
10520 }
10521
10522 /// Sets or clears the value of [control_assessment_details][crate::model::AggregatedComplianceReport::control_assessment_details].
10523 ///
10524 /// # Example
10525 /// ```ignore,no_run
10526 /// # use google_cloud_cloudsecuritycompliance_v1::model::AggregatedComplianceReport;
10527 /// use google_cloud_cloudsecuritycompliance_v1::model::ControlAssessmentDetails;
10528 /// let x = AggregatedComplianceReport::new().set_or_clear_control_assessment_details(Some(ControlAssessmentDetails::default()/* use setters */));
10529 /// let x = AggregatedComplianceReport::new().set_or_clear_control_assessment_details(None::<ControlAssessmentDetails>);
10530 /// ```
10531 pub fn set_or_clear_control_assessment_details<T>(mut self, v: std::option::Option<T>) -> Self
10532 where
10533 T: std::convert::Into<crate::model::ControlAssessmentDetails>,
10534 {
10535 self.control_assessment_details = v.map(|x| x.into());
10536 self
10537 }
10538
10539 /// Sets the value of [report_time][crate::model::AggregatedComplianceReport::report_time].
10540 ///
10541 /// # Example
10542 /// ```ignore,no_run
10543 /// # use google_cloud_cloudsecuritycompliance_v1::model::AggregatedComplianceReport;
10544 /// use wkt::Timestamp;
10545 /// let x = AggregatedComplianceReport::new().set_report_time(Timestamp::default()/* use setters */);
10546 /// ```
10547 pub fn set_report_time<T>(mut self, v: T) -> Self
10548 where
10549 T: std::convert::Into<wkt::Timestamp>,
10550 {
10551 self.report_time = std::option::Option::Some(v.into());
10552 self
10553 }
10554
10555 /// Sets or clears the value of [report_time][crate::model::AggregatedComplianceReport::report_time].
10556 ///
10557 /// # Example
10558 /// ```ignore,no_run
10559 /// # use google_cloud_cloudsecuritycompliance_v1::model::AggregatedComplianceReport;
10560 /// use wkt::Timestamp;
10561 /// let x = AggregatedComplianceReport::new().set_or_clear_report_time(Some(Timestamp::default()/* use setters */));
10562 /// let x = AggregatedComplianceReport::new().set_or_clear_report_time(None::<Timestamp>);
10563 /// ```
10564 pub fn set_or_clear_report_time<T>(mut self, v: std::option::Option<T>) -> Self
10565 where
10566 T: std::convert::Into<wkt::Timestamp>,
10567 {
10568 self.report_time = v.map(|x| x.into());
10569 self
10570 }
10571}
10572
10573impl wkt::message::Message for AggregatedComplianceReport {
10574 fn typename() -> &'static str {
10575 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.AggregatedComplianceReport"
10576 }
10577}
10578
10579/// The details for a target resource.
10580#[derive(Clone, Default, PartialEq)]
10581#[non_exhaustive]
10582pub struct TargetResourceDetails {
10583 /// The framework deployment name for the target resource.
10584 ///
10585 /// For example,
10586 /// `organizations/{organization_id}/locations/{location}/frameworkDeployments/{framework_deployment_id}`
10587 pub framework_deployment: std::string::String,
10588
10589 /// The display name of the target resource. For example, `google.com`,
10590 /// `staging-project`, or `development-folder`.
10591 pub target_resource_display_name: std::string::String,
10592
10593 /// The target resource. For example, `organizations/1234567890`,
10594 /// `projects/1234567890`, or `folders/1234567890`.
10595 pub target_resource: std::string::String,
10596
10597 /// The create time of the target resource.
10598 pub create_time: std::option::Option<wkt::Timestamp>,
10599
10600 /// The update time of the target resource.
10601 pub update_time: std::option::Option<wkt::Timestamp>,
10602
10603 /// The major revision ID of the framework for the target resource.
10604 pub major_revision_id: i64,
10605
10606 /// The minor revision ID of the framework for the target resource.
10607 pub minor_revision_id: i64,
10608
10609 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10610}
10611
10612impl TargetResourceDetails {
10613 pub fn new() -> Self {
10614 std::default::Default::default()
10615 }
10616
10617 /// Sets the value of [framework_deployment][crate::model::TargetResourceDetails::framework_deployment].
10618 ///
10619 /// # Example
10620 /// ```ignore,no_run
10621 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceDetails;
10622 /// let x = TargetResourceDetails::new().set_framework_deployment("example");
10623 /// ```
10624 pub fn set_framework_deployment<T: std::convert::Into<std::string::String>>(
10625 mut self,
10626 v: T,
10627 ) -> Self {
10628 self.framework_deployment = v.into();
10629 self
10630 }
10631
10632 /// Sets the value of [target_resource_display_name][crate::model::TargetResourceDetails::target_resource_display_name].
10633 ///
10634 /// # Example
10635 /// ```ignore,no_run
10636 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceDetails;
10637 /// let x = TargetResourceDetails::new().set_target_resource_display_name("example");
10638 /// ```
10639 pub fn set_target_resource_display_name<T: std::convert::Into<std::string::String>>(
10640 mut self,
10641 v: T,
10642 ) -> Self {
10643 self.target_resource_display_name = v.into();
10644 self
10645 }
10646
10647 /// Sets the value of [target_resource][crate::model::TargetResourceDetails::target_resource].
10648 ///
10649 /// # Example
10650 /// ```ignore,no_run
10651 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceDetails;
10652 /// let x = TargetResourceDetails::new().set_target_resource("example");
10653 /// ```
10654 pub fn set_target_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10655 self.target_resource = v.into();
10656 self
10657 }
10658
10659 /// Sets the value of [create_time][crate::model::TargetResourceDetails::create_time].
10660 ///
10661 /// # Example
10662 /// ```ignore,no_run
10663 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceDetails;
10664 /// use wkt::Timestamp;
10665 /// let x = TargetResourceDetails::new().set_create_time(Timestamp::default()/* use setters */);
10666 /// ```
10667 pub fn set_create_time<T>(mut self, v: T) -> Self
10668 where
10669 T: std::convert::Into<wkt::Timestamp>,
10670 {
10671 self.create_time = std::option::Option::Some(v.into());
10672 self
10673 }
10674
10675 /// Sets or clears the value of [create_time][crate::model::TargetResourceDetails::create_time].
10676 ///
10677 /// # Example
10678 /// ```ignore,no_run
10679 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceDetails;
10680 /// use wkt::Timestamp;
10681 /// let x = TargetResourceDetails::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
10682 /// let x = TargetResourceDetails::new().set_or_clear_create_time(None::<Timestamp>);
10683 /// ```
10684 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
10685 where
10686 T: std::convert::Into<wkt::Timestamp>,
10687 {
10688 self.create_time = v.map(|x| x.into());
10689 self
10690 }
10691
10692 /// Sets the value of [update_time][crate::model::TargetResourceDetails::update_time].
10693 ///
10694 /// # Example
10695 /// ```ignore,no_run
10696 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceDetails;
10697 /// use wkt::Timestamp;
10698 /// let x = TargetResourceDetails::new().set_update_time(Timestamp::default()/* use setters */);
10699 /// ```
10700 pub fn set_update_time<T>(mut self, v: T) -> Self
10701 where
10702 T: std::convert::Into<wkt::Timestamp>,
10703 {
10704 self.update_time = std::option::Option::Some(v.into());
10705 self
10706 }
10707
10708 /// Sets or clears the value of [update_time][crate::model::TargetResourceDetails::update_time].
10709 ///
10710 /// # Example
10711 /// ```ignore,no_run
10712 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceDetails;
10713 /// use wkt::Timestamp;
10714 /// let x = TargetResourceDetails::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
10715 /// let x = TargetResourceDetails::new().set_or_clear_update_time(None::<Timestamp>);
10716 /// ```
10717 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10718 where
10719 T: std::convert::Into<wkt::Timestamp>,
10720 {
10721 self.update_time = v.map(|x| x.into());
10722 self
10723 }
10724
10725 /// Sets the value of [major_revision_id][crate::model::TargetResourceDetails::major_revision_id].
10726 ///
10727 /// # Example
10728 /// ```ignore,no_run
10729 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceDetails;
10730 /// let x = TargetResourceDetails::new().set_major_revision_id(42);
10731 /// ```
10732 pub fn set_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10733 self.major_revision_id = v.into();
10734 self
10735 }
10736
10737 /// Sets the value of [minor_revision_id][crate::model::TargetResourceDetails::minor_revision_id].
10738 ///
10739 /// # Example
10740 /// ```ignore,no_run
10741 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceDetails;
10742 /// let x = TargetResourceDetails::new().set_minor_revision_id(42);
10743 /// ```
10744 pub fn set_minor_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10745 self.minor_revision_id = v.into();
10746 self
10747 }
10748}
10749
10750impl wkt::message::Message for TargetResourceDetails {
10751 fn typename() -> &'static str {
10752 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.TargetResourceDetails"
10753 }
10754}
10755
10756/// The state of compliance after evaluation is complete.
10757///
10758/// # Working with unknown values
10759///
10760/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10761/// additional enum variants at any time. Adding new variants is not considered
10762/// a breaking change. Applications should write their code in anticipation of:
10763///
10764/// - New values appearing in future releases of the client library, **and**
10765/// - New values received dynamically, without application changes.
10766///
10767/// Please consult the [Working with enums] section in the user guide for some
10768/// guidelines.
10769///
10770/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10771#[derive(Clone, Debug, PartialEq)]
10772#[non_exhaustive]
10773pub enum ComplianceState {
10774 /// Default value. This value is unused.
10775 Unspecified,
10776 /// The resource is compliant.
10777 Compliant,
10778 /// The resource has a violation.
10779 Violation,
10780 /// The resource requires manual review from you.
10781 ManualReviewNeeded,
10782 /// An error occurred while computing the resource status.
10783 Error,
10784 /// The resource can't be audited.
10785 AuditNotSupported,
10786 /// If set, the enum was initialized with an unknown value.
10787 ///
10788 /// Applications can examine the value using [ComplianceState::value] or
10789 /// [ComplianceState::name].
10790 UnknownValue(compliance_state::UnknownValue),
10791}
10792
10793#[doc(hidden)]
10794pub mod compliance_state {
10795 #[allow(unused_imports)]
10796 use super::*;
10797 #[derive(Clone, Debug, PartialEq)]
10798 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10799}
10800
10801impl ComplianceState {
10802 /// Gets the enum value.
10803 ///
10804 /// Returns `None` if the enum contains an unknown value deserialized from
10805 /// the string representation of enums.
10806 pub fn value(&self) -> std::option::Option<i32> {
10807 match self {
10808 Self::Unspecified => std::option::Option::Some(0),
10809 Self::Compliant => std::option::Option::Some(1),
10810 Self::Violation => std::option::Option::Some(2),
10811 Self::ManualReviewNeeded => std::option::Option::Some(3),
10812 Self::Error => std::option::Option::Some(4),
10813 Self::AuditNotSupported => std::option::Option::Some(5),
10814 Self::UnknownValue(u) => u.0.value(),
10815 }
10816 }
10817
10818 /// Gets the enum value as a string.
10819 ///
10820 /// Returns `None` if the enum contains an unknown value deserialized from
10821 /// the integer representation of enums.
10822 pub fn name(&self) -> std::option::Option<&str> {
10823 match self {
10824 Self::Unspecified => std::option::Option::Some("COMPLIANCE_STATE_UNSPECIFIED"),
10825 Self::Compliant => std::option::Option::Some("COMPLIANT"),
10826 Self::Violation => std::option::Option::Some("VIOLATION"),
10827 Self::ManualReviewNeeded => std::option::Option::Some("MANUAL_REVIEW_NEEDED"),
10828 Self::Error => std::option::Option::Some("ERROR"),
10829 Self::AuditNotSupported => std::option::Option::Some("AUDIT_NOT_SUPPORTED"),
10830 Self::UnknownValue(u) => u.0.name(),
10831 }
10832 }
10833}
10834
10835impl std::default::Default for ComplianceState {
10836 fn default() -> Self {
10837 use std::convert::From;
10838 Self::from(0)
10839 }
10840}
10841
10842impl std::fmt::Display for ComplianceState {
10843 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10844 wkt::internal::display_enum(f, self.name(), self.value())
10845 }
10846}
10847
10848impl std::convert::From<i32> for ComplianceState {
10849 fn from(value: i32) -> Self {
10850 match value {
10851 0 => Self::Unspecified,
10852 1 => Self::Compliant,
10853 2 => Self::Violation,
10854 3 => Self::ManualReviewNeeded,
10855 4 => Self::Error,
10856 5 => Self::AuditNotSupported,
10857 _ => Self::UnknownValue(compliance_state::UnknownValue(
10858 wkt::internal::UnknownEnumValue::Integer(value),
10859 )),
10860 }
10861 }
10862}
10863
10864impl std::convert::From<&str> for ComplianceState {
10865 fn from(value: &str) -> Self {
10866 use std::string::ToString;
10867 match value {
10868 "COMPLIANCE_STATE_UNSPECIFIED" => Self::Unspecified,
10869 "COMPLIANT" => Self::Compliant,
10870 "VIOLATION" => Self::Violation,
10871 "MANUAL_REVIEW_NEEDED" => Self::ManualReviewNeeded,
10872 "ERROR" => Self::Error,
10873 "AUDIT_NOT_SUPPORTED" => Self::AuditNotSupported,
10874 _ => Self::UnknownValue(compliance_state::UnknownValue(
10875 wkt::internal::UnknownEnumValue::String(value.to_string()),
10876 )),
10877 }
10878 }
10879}
10880
10881impl serde::ser::Serialize for ComplianceState {
10882 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10883 where
10884 S: serde::Serializer,
10885 {
10886 match self {
10887 Self::Unspecified => serializer.serialize_i32(0),
10888 Self::Compliant => serializer.serialize_i32(1),
10889 Self::Violation => serializer.serialize_i32(2),
10890 Self::ManualReviewNeeded => serializer.serialize_i32(3),
10891 Self::Error => serializer.serialize_i32(4),
10892 Self::AuditNotSupported => serializer.serialize_i32(5),
10893 Self::UnknownValue(u) => u.0.serialize(serializer),
10894 }
10895 }
10896}
10897
10898impl<'de> serde::de::Deserialize<'de> for ComplianceState {
10899 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10900 where
10901 D: serde::Deserializer<'de>,
10902 {
10903 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ComplianceState>::new(
10904 ".google.cloud.cloudsecuritycompliance.v1.ComplianceState",
10905 ))
10906 }
10907}
10908
10909/// The responsibility type for the regulatory control.
10910///
10911/// # Working with unknown values
10912///
10913/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10914/// additional enum variants at any time. Adding new variants is not considered
10915/// a breaking change. Applications should write their code in anticipation of:
10916///
10917/// - New values appearing in future releases of the client library, **and**
10918/// - New values received dynamically, without application changes.
10919///
10920/// Please consult the [Working with enums] section in the user guide for some
10921/// guidelines.
10922///
10923/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10924#[derive(Clone, Debug, PartialEq)]
10925#[non_exhaustive]
10926pub enum RegulatoryControlResponsibilityType {
10927 /// Default value. This value is unused.
10928 Unspecified,
10929 /// Google's responsibility.
10930 Google,
10931 /// Your responsibility.
10932 Customer,
10933 /// Shared responsibility.
10934 Shared,
10935 /// If set, the enum was initialized with an unknown value.
10936 ///
10937 /// Applications can examine the value using [RegulatoryControlResponsibilityType::value] or
10938 /// [RegulatoryControlResponsibilityType::name].
10939 UnknownValue(regulatory_control_responsibility_type::UnknownValue),
10940}
10941
10942#[doc(hidden)]
10943pub mod regulatory_control_responsibility_type {
10944 #[allow(unused_imports)]
10945 use super::*;
10946 #[derive(Clone, Debug, PartialEq)]
10947 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10948}
10949
10950impl RegulatoryControlResponsibilityType {
10951 /// Gets the enum value.
10952 ///
10953 /// Returns `None` if the enum contains an unknown value deserialized from
10954 /// the string representation of enums.
10955 pub fn value(&self) -> std::option::Option<i32> {
10956 match self {
10957 Self::Unspecified => std::option::Option::Some(0),
10958 Self::Google => std::option::Option::Some(1),
10959 Self::Customer => std::option::Option::Some(2),
10960 Self::Shared => std::option::Option::Some(3),
10961 Self::UnknownValue(u) => u.0.value(),
10962 }
10963 }
10964
10965 /// Gets the enum value as a string.
10966 ///
10967 /// Returns `None` if the enum contains an unknown value deserialized from
10968 /// the integer representation of enums.
10969 pub fn name(&self) -> std::option::Option<&str> {
10970 match self {
10971 Self::Unspecified => {
10972 std::option::Option::Some("REGULATORY_CONTROL_RESPONSIBILITY_TYPE_UNSPECIFIED")
10973 }
10974 Self::Google => std::option::Option::Some("GOOGLE"),
10975 Self::Customer => std::option::Option::Some("CUSTOMER"),
10976 Self::Shared => std::option::Option::Some("SHARED"),
10977 Self::UnknownValue(u) => u.0.name(),
10978 }
10979 }
10980}
10981
10982impl std::default::Default for RegulatoryControlResponsibilityType {
10983 fn default() -> Self {
10984 use std::convert::From;
10985 Self::from(0)
10986 }
10987}
10988
10989impl std::fmt::Display for RegulatoryControlResponsibilityType {
10990 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10991 wkt::internal::display_enum(f, self.name(), self.value())
10992 }
10993}
10994
10995impl std::convert::From<i32> for RegulatoryControlResponsibilityType {
10996 fn from(value: i32) -> Self {
10997 match value {
10998 0 => Self::Unspecified,
10999 1 => Self::Google,
11000 2 => Self::Customer,
11001 3 => Self::Shared,
11002 _ => Self::UnknownValue(regulatory_control_responsibility_type::UnknownValue(
11003 wkt::internal::UnknownEnumValue::Integer(value),
11004 )),
11005 }
11006 }
11007}
11008
11009impl std::convert::From<&str> for RegulatoryControlResponsibilityType {
11010 fn from(value: &str) -> Self {
11011 use std::string::ToString;
11012 match value {
11013 "REGULATORY_CONTROL_RESPONSIBILITY_TYPE_UNSPECIFIED" => Self::Unspecified,
11014 "GOOGLE" => Self::Google,
11015 "CUSTOMER" => Self::Customer,
11016 "SHARED" => Self::Shared,
11017 _ => Self::UnknownValue(regulatory_control_responsibility_type::UnknownValue(
11018 wkt::internal::UnknownEnumValue::String(value.to_string()),
11019 )),
11020 }
11021 }
11022}
11023
11024impl serde::ser::Serialize for RegulatoryControlResponsibilityType {
11025 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11026 where
11027 S: serde::Serializer,
11028 {
11029 match self {
11030 Self::Unspecified => serializer.serialize_i32(0),
11031 Self::Google => serializer.serialize_i32(1),
11032 Self::Customer => serializer.serialize_i32(2),
11033 Self::Shared => serializer.serialize_i32(3),
11034 Self::UnknownValue(u) => u.0.serialize(serializer),
11035 }
11036 }
11037}
11038
11039impl<'de> serde::de::Deserialize<'de> for RegulatoryControlResponsibilityType {
11040 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11041 where
11042 D: serde::Deserializer<'de>,
11043 {
11044 deserializer.deserialize_any(wkt::internal::EnumVisitor::<
11045 RegulatoryControlResponsibilityType,
11046 >::new(
11047 ".google.cloud.cloudsecuritycompliance.v1.RegulatoryControlResponsibilityType",
11048 ))
11049 }
11050}
11051
11052/// The enforcement mode for the cloud control.
11053///
11054/// # Working with unknown values
11055///
11056/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11057/// additional enum variants at any time. Adding new variants is not considered
11058/// a breaking change. Applications should write their code in anticipation of:
11059///
11060/// - New values appearing in future releases of the client library, **and**
11061/// - New values received dynamically, without application changes.
11062///
11063/// Please consult the [Working with enums] section in the user guide for some
11064/// guidelines.
11065///
11066/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11067#[derive(Clone, Debug, PartialEq)]
11068#[non_exhaustive]
11069pub enum EnforcementMode {
11070 /// Default value. This value is unused.
11071 Unspecified,
11072 /// The cloud control is enforced to prevent non-compliance.
11073 Preventive,
11074 /// The cloud control is enforced to detect non-compliance.
11075 Detective,
11076 /// The cloud control is enforced to audit for non-compliance.
11077 Audit,
11078 /// If set, the enum was initialized with an unknown value.
11079 ///
11080 /// Applications can examine the value using [EnforcementMode::value] or
11081 /// [EnforcementMode::name].
11082 UnknownValue(enforcement_mode::UnknownValue),
11083}
11084
11085#[doc(hidden)]
11086pub mod enforcement_mode {
11087 #[allow(unused_imports)]
11088 use super::*;
11089 #[derive(Clone, Debug, PartialEq)]
11090 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11091}
11092
11093impl EnforcementMode {
11094 /// Gets the enum value.
11095 ///
11096 /// Returns `None` if the enum contains an unknown value deserialized from
11097 /// the string representation of enums.
11098 pub fn value(&self) -> std::option::Option<i32> {
11099 match self {
11100 Self::Unspecified => std::option::Option::Some(0),
11101 Self::Preventive => std::option::Option::Some(1),
11102 Self::Detective => std::option::Option::Some(2),
11103 Self::Audit => std::option::Option::Some(3),
11104 Self::UnknownValue(u) => u.0.value(),
11105 }
11106 }
11107
11108 /// Gets the enum value as a string.
11109 ///
11110 /// Returns `None` if the enum contains an unknown value deserialized from
11111 /// the integer representation of enums.
11112 pub fn name(&self) -> std::option::Option<&str> {
11113 match self {
11114 Self::Unspecified => std::option::Option::Some("ENFORCEMENT_MODE_UNSPECIFIED"),
11115 Self::Preventive => std::option::Option::Some("PREVENTIVE"),
11116 Self::Detective => std::option::Option::Some("DETECTIVE"),
11117 Self::Audit => std::option::Option::Some("AUDIT"),
11118 Self::UnknownValue(u) => u.0.name(),
11119 }
11120 }
11121}
11122
11123impl std::default::Default for EnforcementMode {
11124 fn default() -> Self {
11125 use std::convert::From;
11126 Self::from(0)
11127 }
11128}
11129
11130impl std::fmt::Display for EnforcementMode {
11131 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11132 wkt::internal::display_enum(f, self.name(), self.value())
11133 }
11134}
11135
11136impl std::convert::From<i32> for EnforcementMode {
11137 fn from(value: i32) -> Self {
11138 match value {
11139 0 => Self::Unspecified,
11140 1 => Self::Preventive,
11141 2 => Self::Detective,
11142 3 => Self::Audit,
11143 _ => Self::UnknownValue(enforcement_mode::UnknownValue(
11144 wkt::internal::UnknownEnumValue::Integer(value),
11145 )),
11146 }
11147 }
11148}
11149
11150impl std::convert::From<&str> for EnforcementMode {
11151 fn from(value: &str) -> Self {
11152 use std::string::ToString;
11153 match value {
11154 "ENFORCEMENT_MODE_UNSPECIFIED" => Self::Unspecified,
11155 "PREVENTIVE" => Self::Preventive,
11156 "DETECTIVE" => Self::Detective,
11157 "AUDIT" => Self::Audit,
11158 _ => Self::UnknownValue(enforcement_mode::UnknownValue(
11159 wkt::internal::UnknownEnumValue::String(value.to_string()),
11160 )),
11161 }
11162 }
11163}
11164
11165impl serde::ser::Serialize for EnforcementMode {
11166 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11167 where
11168 S: serde::Serializer,
11169 {
11170 match self {
11171 Self::Unspecified => serializer.serialize_i32(0),
11172 Self::Preventive => serializer.serialize_i32(1),
11173 Self::Detective => serializer.serialize_i32(2),
11174 Self::Audit => serializer.serialize_i32(3),
11175 Self::UnknownValue(u) => u.0.serialize(serializer),
11176 }
11177 }
11178}
11179
11180impl<'de> serde::de::Deserialize<'de> for EnforcementMode {
11181 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11182 where
11183 D: serde::Deserializer<'de>,
11184 {
11185 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EnforcementMode>::new(
11186 ".google.cloud.cloudsecuritycompliance.v1.EnforcementMode",
11187 ))
11188 }
11189}
11190
11191/// The category for the framework.
11192///
11193/// # Working with unknown values
11194///
11195/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11196/// additional enum variants at any time. Adding new variants is not considered
11197/// a breaking change. Applications should write their code in anticipation of:
11198///
11199/// - New values appearing in future releases of the client library, **and**
11200/// - New values received dynamically, without application changes.
11201///
11202/// Please consult the [Working with enums] section in the user guide for some
11203/// guidelines.
11204///
11205/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11206#[derive(Clone, Debug, PartialEq)]
11207#[non_exhaustive]
11208pub enum FrameworkCategory {
11209 /// Default value. This value is unused.
11210 Unspecified,
11211 /// An industry-defined framework.
11212 IndustryDefinedStandard,
11213 /// An Assured Workloads framework.
11214 AssuredWorkloads,
11215 /// A data security posture framework.
11216 DataSecurity,
11217 /// A Google's best practices framework.
11218 GoogleBestPractices,
11219 /// A user-created framework.
11220 CustomFramework,
11221 /// If set, the enum was initialized with an unknown value.
11222 ///
11223 /// Applications can examine the value using [FrameworkCategory::value] or
11224 /// [FrameworkCategory::name].
11225 UnknownValue(framework_category::UnknownValue),
11226}
11227
11228#[doc(hidden)]
11229pub mod framework_category {
11230 #[allow(unused_imports)]
11231 use super::*;
11232 #[derive(Clone, Debug, PartialEq)]
11233 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11234}
11235
11236impl FrameworkCategory {
11237 /// Gets the enum value.
11238 ///
11239 /// Returns `None` if the enum contains an unknown value deserialized from
11240 /// the string representation of enums.
11241 pub fn value(&self) -> std::option::Option<i32> {
11242 match self {
11243 Self::Unspecified => std::option::Option::Some(0),
11244 Self::IndustryDefinedStandard => std::option::Option::Some(1),
11245 Self::AssuredWorkloads => std::option::Option::Some(2),
11246 Self::DataSecurity => std::option::Option::Some(3),
11247 Self::GoogleBestPractices => std::option::Option::Some(4),
11248 Self::CustomFramework => std::option::Option::Some(5),
11249 Self::UnknownValue(u) => u.0.value(),
11250 }
11251 }
11252
11253 /// Gets the enum value as a string.
11254 ///
11255 /// Returns `None` if the enum contains an unknown value deserialized from
11256 /// the integer representation of enums.
11257 pub fn name(&self) -> std::option::Option<&str> {
11258 match self {
11259 Self::Unspecified => std::option::Option::Some("FRAMEWORK_CATEGORY_UNSPECIFIED"),
11260 Self::IndustryDefinedStandard => std::option::Option::Some("INDUSTRY_DEFINED_STANDARD"),
11261 Self::AssuredWorkloads => std::option::Option::Some("ASSURED_WORKLOADS"),
11262 Self::DataSecurity => std::option::Option::Some("DATA_SECURITY"),
11263 Self::GoogleBestPractices => std::option::Option::Some("GOOGLE_BEST_PRACTICES"),
11264 Self::CustomFramework => std::option::Option::Some("CUSTOM_FRAMEWORK"),
11265 Self::UnknownValue(u) => u.0.name(),
11266 }
11267 }
11268}
11269
11270impl std::default::Default for FrameworkCategory {
11271 fn default() -> Self {
11272 use std::convert::From;
11273 Self::from(0)
11274 }
11275}
11276
11277impl std::fmt::Display for FrameworkCategory {
11278 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11279 wkt::internal::display_enum(f, self.name(), self.value())
11280 }
11281}
11282
11283impl std::convert::From<i32> for FrameworkCategory {
11284 fn from(value: i32) -> Self {
11285 match value {
11286 0 => Self::Unspecified,
11287 1 => Self::IndustryDefinedStandard,
11288 2 => Self::AssuredWorkloads,
11289 3 => Self::DataSecurity,
11290 4 => Self::GoogleBestPractices,
11291 5 => Self::CustomFramework,
11292 _ => Self::UnknownValue(framework_category::UnknownValue(
11293 wkt::internal::UnknownEnumValue::Integer(value),
11294 )),
11295 }
11296 }
11297}
11298
11299impl std::convert::From<&str> for FrameworkCategory {
11300 fn from(value: &str) -> Self {
11301 use std::string::ToString;
11302 match value {
11303 "FRAMEWORK_CATEGORY_UNSPECIFIED" => Self::Unspecified,
11304 "INDUSTRY_DEFINED_STANDARD" => Self::IndustryDefinedStandard,
11305 "ASSURED_WORKLOADS" => Self::AssuredWorkloads,
11306 "DATA_SECURITY" => Self::DataSecurity,
11307 "GOOGLE_BEST_PRACTICES" => Self::GoogleBestPractices,
11308 "CUSTOM_FRAMEWORK" => Self::CustomFramework,
11309 _ => Self::UnknownValue(framework_category::UnknownValue(
11310 wkt::internal::UnknownEnumValue::String(value.to_string()),
11311 )),
11312 }
11313 }
11314}
11315
11316impl serde::ser::Serialize for FrameworkCategory {
11317 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11318 where
11319 S: serde::Serializer,
11320 {
11321 match self {
11322 Self::Unspecified => serializer.serialize_i32(0),
11323 Self::IndustryDefinedStandard => serializer.serialize_i32(1),
11324 Self::AssuredWorkloads => serializer.serialize_i32(2),
11325 Self::DataSecurity => serializer.serialize_i32(3),
11326 Self::GoogleBestPractices => serializer.serialize_i32(4),
11327 Self::CustomFramework => serializer.serialize_i32(5),
11328 Self::UnknownValue(u) => u.0.serialize(serializer),
11329 }
11330 }
11331}
11332
11333impl<'de> serde::de::Deserialize<'de> for FrameworkCategory {
11334 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11335 where
11336 D: serde::Deserializer<'de>,
11337 {
11338 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FrameworkCategory>::new(
11339 ".google.cloud.cloudsecuritycompliance.v1.FrameworkCategory",
11340 ))
11341 }
11342}
11343
11344/// The category for the cloud control.
11345///
11346/// # Working with unknown values
11347///
11348/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11349/// additional enum variants at any time. Adding new variants is not considered
11350/// a breaking change. Applications should write their code in anticipation of:
11351///
11352/// - New values appearing in future releases of the client library, **and**
11353/// - New values received dynamically, without application changes.
11354///
11355/// Please consult the [Working with enums] section in the user guide for some
11356/// guidelines.
11357///
11358/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11359#[derive(Clone, Debug, PartialEq)]
11360#[non_exhaustive]
11361pub enum CloudControlCategory {
11362 /// Default value. This value is unused.
11363 Unspecified,
11364 /// The infrastructure security category.
11365 CcCategoryInfrastructure,
11366 /// The artificial intelligence category.
11367 CcCategoryArtificialIntelligence,
11368 /// The physical security category.
11369 CcCategoryPhysicalSecurity,
11370 /// The data security category.
11371 CcCategoryDataSecurity,
11372 /// The network security category.
11373 CcCategoryNetworkSecurity,
11374 /// The incident management category.
11375 CcCategoryIncidentManagement,
11376 /// The identity and access management category.
11377 CcCategoryIdentityAndAccessManagement,
11378 /// The encryption category.
11379 CcCategoryEncryption,
11380 /// The logs management and infrastructure category.
11381 CcCategoryLogsManagementAndInfrastructure,
11382 /// The HR, admin, and processes category.
11383 CcCategoryHrAdminAndProcesses,
11384 /// The third-party and sub-processor management category.
11385 CcCategoryThirdPartyAndSubProcessorManagement,
11386 /// The legal and disclosures category.
11387 CcCategoryLegalAndDisclosures,
11388 /// The vulnerability management category.
11389 CcCategoryVulnerabilityManagement,
11390 /// The privacy category.
11391 CcCategoryPrivacy,
11392 /// The business continuity and disaster recovery (BCDR) category.
11393 CcCategoryBcdr,
11394 /// If set, the enum was initialized with an unknown value.
11395 ///
11396 /// Applications can examine the value using [CloudControlCategory::value] or
11397 /// [CloudControlCategory::name].
11398 UnknownValue(cloud_control_category::UnknownValue),
11399}
11400
11401#[doc(hidden)]
11402pub mod cloud_control_category {
11403 #[allow(unused_imports)]
11404 use super::*;
11405 #[derive(Clone, Debug, PartialEq)]
11406 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11407}
11408
11409impl CloudControlCategory {
11410 /// Gets the enum value.
11411 ///
11412 /// Returns `None` if the enum contains an unknown value deserialized from
11413 /// the string representation of enums.
11414 pub fn value(&self) -> std::option::Option<i32> {
11415 match self {
11416 Self::Unspecified => std::option::Option::Some(0),
11417 Self::CcCategoryInfrastructure => std::option::Option::Some(1),
11418 Self::CcCategoryArtificialIntelligence => std::option::Option::Some(2),
11419 Self::CcCategoryPhysicalSecurity => std::option::Option::Some(3),
11420 Self::CcCategoryDataSecurity => std::option::Option::Some(4),
11421 Self::CcCategoryNetworkSecurity => std::option::Option::Some(5),
11422 Self::CcCategoryIncidentManagement => std::option::Option::Some(6),
11423 Self::CcCategoryIdentityAndAccessManagement => std::option::Option::Some(7),
11424 Self::CcCategoryEncryption => std::option::Option::Some(8),
11425 Self::CcCategoryLogsManagementAndInfrastructure => std::option::Option::Some(9),
11426 Self::CcCategoryHrAdminAndProcesses => std::option::Option::Some(10),
11427 Self::CcCategoryThirdPartyAndSubProcessorManagement => std::option::Option::Some(11),
11428 Self::CcCategoryLegalAndDisclosures => std::option::Option::Some(12),
11429 Self::CcCategoryVulnerabilityManagement => std::option::Option::Some(13),
11430 Self::CcCategoryPrivacy => std::option::Option::Some(14),
11431 Self::CcCategoryBcdr => std::option::Option::Some(15),
11432 Self::UnknownValue(u) => u.0.value(),
11433 }
11434 }
11435
11436 /// Gets the enum value as a string.
11437 ///
11438 /// Returns `None` if the enum contains an unknown value deserialized from
11439 /// the integer representation of enums.
11440 pub fn name(&self) -> std::option::Option<&str> {
11441 match self {
11442 Self::Unspecified => std::option::Option::Some("CLOUD_CONTROL_CATEGORY_UNSPECIFIED"),
11443 Self::CcCategoryInfrastructure => {
11444 std::option::Option::Some("CC_CATEGORY_INFRASTRUCTURE")
11445 }
11446 Self::CcCategoryArtificialIntelligence => {
11447 std::option::Option::Some("CC_CATEGORY_ARTIFICIAL_INTELLIGENCE")
11448 }
11449 Self::CcCategoryPhysicalSecurity => {
11450 std::option::Option::Some("CC_CATEGORY_PHYSICAL_SECURITY")
11451 }
11452 Self::CcCategoryDataSecurity => std::option::Option::Some("CC_CATEGORY_DATA_SECURITY"),
11453 Self::CcCategoryNetworkSecurity => {
11454 std::option::Option::Some("CC_CATEGORY_NETWORK_SECURITY")
11455 }
11456 Self::CcCategoryIncidentManagement => {
11457 std::option::Option::Some("CC_CATEGORY_INCIDENT_MANAGEMENT")
11458 }
11459 Self::CcCategoryIdentityAndAccessManagement => {
11460 std::option::Option::Some("CC_CATEGORY_IDENTITY_AND_ACCESS_MANAGEMENT")
11461 }
11462 Self::CcCategoryEncryption => std::option::Option::Some("CC_CATEGORY_ENCRYPTION"),
11463 Self::CcCategoryLogsManagementAndInfrastructure => {
11464 std::option::Option::Some("CC_CATEGORY_LOGS_MANAGEMENT_AND_INFRASTRUCTURE")
11465 }
11466 Self::CcCategoryHrAdminAndProcesses => {
11467 std::option::Option::Some("CC_CATEGORY_HR_ADMIN_AND_PROCESSES")
11468 }
11469 Self::CcCategoryThirdPartyAndSubProcessorManagement => {
11470 std::option::Option::Some("CC_CATEGORY_THIRD_PARTY_AND_SUB_PROCESSOR_MANAGEMENT")
11471 }
11472 Self::CcCategoryLegalAndDisclosures => {
11473 std::option::Option::Some("CC_CATEGORY_LEGAL_AND_DISCLOSURES")
11474 }
11475 Self::CcCategoryVulnerabilityManagement => {
11476 std::option::Option::Some("CC_CATEGORY_VULNERABILITY_MANAGEMENT")
11477 }
11478 Self::CcCategoryPrivacy => std::option::Option::Some("CC_CATEGORY_PRIVACY"),
11479 Self::CcCategoryBcdr => std::option::Option::Some("CC_CATEGORY_BCDR"),
11480 Self::UnknownValue(u) => u.0.name(),
11481 }
11482 }
11483}
11484
11485impl std::default::Default for CloudControlCategory {
11486 fn default() -> Self {
11487 use std::convert::From;
11488 Self::from(0)
11489 }
11490}
11491
11492impl std::fmt::Display for CloudControlCategory {
11493 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11494 wkt::internal::display_enum(f, self.name(), self.value())
11495 }
11496}
11497
11498impl std::convert::From<i32> for CloudControlCategory {
11499 fn from(value: i32) -> Self {
11500 match value {
11501 0 => Self::Unspecified,
11502 1 => Self::CcCategoryInfrastructure,
11503 2 => Self::CcCategoryArtificialIntelligence,
11504 3 => Self::CcCategoryPhysicalSecurity,
11505 4 => Self::CcCategoryDataSecurity,
11506 5 => Self::CcCategoryNetworkSecurity,
11507 6 => Self::CcCategoryIncidentManagement,
11508 7 => Self::CcCategoryIdentityAndAccessManagement,
11509 8 => Self::CcCategoryEncryption,
11510 9 => Self::CcCategoryLogsManagementAndInfrastructure,
11511 10 => Self::CcCategoryHrAdminAndProcesses,
11512 11 => Self::CcCategoryThirdPartyAndSubProcessorManagement,
11513 12 => Self::CcCategoryLegalAndDisclosures,
11514 13 => Self::CcCategoryVulnerabilityManagement,
11515 14 => Self::CcCategoryPrivacy,
11516 15 => Self::CcCategoryBcdr,
11517 _ => Self::UnknownValue(cloud_control_category::UnknownValue(
11518 wkt::internal::UnknownEnumValue::Integer(value),
11519 )),
11520 }
11521 }
11522}
11523
11524impl std::convert::From<&str> for CloudControlCategory {
11525 fn from(value: &str) -> Self {
11526 use std::string::ToString;
11527 match value {
11528 "CLOUD_CONTROL_CATEGORY_UNSPECIFIED" => Self::Unspecified,
11529 "CC_CATEGORY_INFRASTRUCTURE" => Self::CcCategoryInfrastructure,
11530 "CC_CATEGORY_ARTIFICIAL_INTELLIGENCE" => Self::CcCategoryArtificialIntelligence,
11531 "CC_CATEGORY_PHYSICAL_SECURITY" => Self::CcCategoryPhysicalSecurity,
11532 "CC_CATEGORY_DATA_SECURITY" => Self::CcCategoryDataSecurity,
11533 "CC_CATEGORY_NETWORK_SECURITY" => Self::CcCategoryNetworkSecurity,
11534 "CC_CATEGORY_INCIDENT_MANAGEMENT" => Self::CcCategoryIncidentManagement,
11535 "CC_CATEGORY_IDENTITY_AND_ACCESS_MANAGEMENT" => {
11536 Self::CcCategoryIdentityAndAccessManagement
11537 }
11538 "CC_CATEGORY_ENCRYPTION" => Self::CcCategoryEncryption,
11539 "CC_CATEGORY_LOGS_MANAGEMENT_AND_INFRASTRUCTURE" => {
11540 Self::CcCategoryLogsManagementAndInfrastructure
11541 }
11542 "CC_CATEGORY_HR_ADMIN_AND_PROCESSES" => Self::CcCategoryHrAdminAndProcesses,
11543 "CC_CATEGORY_THIRD_PARTY_AND_SUB_PROCESSOR_MANAGEMENT" => {
11544 Self::CcCategoryThirdPartyAndSubProcessorManagement
11545 }
11546 "CC_CATEGORY_LEGAL_AND_DISCLOSURES" => Self::CcCategoryLegalAndDisclosures,
11547 "CC_CATEGORY_VULNERABILITY_MANAGEMENT" => Self::CcCategoryVulnerabilityManagement,
11548 "CC_CATEGORY_PRIVACY" => Self::CcCategoryPrivacy,
11549 "CC_CATEGORY_BCDR" => Self::CcCategoryBcdr,
11550 _ => Self::UnknownValue(cloud_control_category::UnknownValue(
11551 wkt::internal::UnknownEnumValue::String(value.to_string()),
11552 )),
11553 }
11554 }
11555}
11556
11557impl serde::ser::Serialize for CloudControlCategory {
11558 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11559 where
11560 S: serde::Serializer,
11561 {
11562 match self {
11563 Self::Unspecified => serializer.serialize_i32(0),
11564 Self::CcCategoryInfrastructure => serializer.serialize_i32(1),
11565 Self::CcCategoryArtificialIntelligence => serializer.serialize_i32(2),
11566 Self::CcCategoryPhysicalSecurity => serializer.serialize_i32(3),
11567 Self::CcCategoryDataSecurity => serializer.serialize_i32(4),
11568 Self::CcCategoryNetworkSecurity => serializer.serialize_i32(5),
11569 Self::CcCategoryIncidentManagement => serializer.serialize_i32(6),
11570 Self::CcCategoryIdentityAndAccessManagement => serializer.serialize_i32(7),
11571 Self::CcCategoryEncryption => serializer.serialize_i32(8),
11572 Self::CcCategoryLogsManagementAndInfrastructure => serializer.serialize_i32(9),
11573 Self::CcCategoryHrAdminAndProcesses => serializer.serialize_i32(10),
11574 Self::CcCategoryThirdPartyAndSubProcessorManagement => serializer.serialize_i32(11),
11575 Self::CcCategoryLegalAndDisclosures => serializer.serialize_i32(12),
11576 Self::CcCategoryVulnerabilityManagement => serializer.serialize_i32(13),
11577 Self::CcCategoryPrivacy => serializer.serialize_i32(14),
11578 Self::CcCategoryBcdr => serializer.serialize_i32(15),
11579 Self::UnknownValue(u) => u.0.serialize(serializer),
11580 }
11581 }
11582}
11583
11584impl<'de> serde::de::Deserialize<'de> for CloudControlCategory {
11585 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11586 where
11587 D: serde::Deserializer<'de>,
11588 {
11589 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CloudControlCategory>::new(
11590 ".google.cloud.cloudsecuritycompliance.v1.CloudControlCategory",
11591 ))
11592 }
11593}
11594
11595/// The cloud provider that's associated with the cloud control.
11596///
11597/// # Working with unknown values
11598///
11599/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11600/// additional enum variants at any time. Adding new variants is not considered
11601/// a breaking change. Applications should write their code in anticipation of:
11602///
11603/// - New values appearing in future releases of the client library, **and**
11604/// - New values received dynamically, without application changes.
11605///
11606/// Please consult the [Working with enums] section in the user guide for some
11607/// guidelines.
11608///
11609/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11610#[derive(Clone, Debug, PartialEq)]
11611#[non_exhaustive]
11612pub enum CloudProvider {
11613 /// Default value. This value is unused.
11614 Unspecified,
11615 /// Amazon Web Services (AWS).
11616 Aws,
11617 /// Microsoft Azure.
11618 Azure,
11619 /// Google Cloud.
11620 Gcp,
11621 /// If set, the enum was initialized with an unknown value.
11622 ///
11623 /// Applications can examine the value using [CloudProvider::value] or
11624 /// [CloudProvider::name].
11625 UnknownValue(cloud_provider::UnknownValue),
11626}
11627
11628#[doc(hidden)]
11629pub mod cloud_provider {
11630 #[allow(unused_imports)]
11631 use super::*;
11632 #[derive(Clone, Debug, PartialEq)]
11633 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11634}
11635
11636impl CloudProvider {
11637 /// Gets the enum value.
11638 ///
11639 /// Returns `None` if the enum contains an unknown value deserialized from
11640 /// the string representation of enums.
11641 pub fn value(&self) -> std::option::Option<i32> {
11642 match self {
11643 Self::Unspecified => std::option::Option::Some(0),
11644 Self::Aws => std::option::Option::Some(1),
11645 Self::Azure => std::option::Option::Some(2),
11646 Self::Gcp => std::option::Option::Some(3),
11647 Self::UnknownValue(u) => u.0.value(),
11648 }
11649 }
11650
11651 /// Gets the enum value as a string.
11652 ///
11653 /// Returns `None` if the enum contains an unknown value deserialized from
11654 /// the integer representation of enums.
11655 pub fn name(&self) -> std::option::Option<&str> {
11656 match self {
11657 Self::Unspecified => std::option::Option::Some("CLOUD_PROVIDER_UNSPECIFIED"),
11658 Self::Aws => std::option::Option::Some("AWS"),
11659 Self::Azure => std::option::Option::Some("AZURE"),
11660 Self::Gcp => std::option::Option::Some("GCP"),
11661 Self::UnknownValue(u) => u.0.name(),
11662 }
11663 }
11664}
11665
11666impl std::default::Default for CloudProvider {
11667 fn default() -> Self {
11668 use std::convert::From;
11669 Self::from(0)
11670 }
11671}
11672
11673impl std::fmt::Display for CloudProvider {
11674 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11675 wkt::internal::display_enum(f, self.name(), self.value())
11676 }
11677}
11678
11679impl std::convert::From<i32> for CloudProvider {
11680 fn from(value: i32) -> Self {
11681 match value {
11682 0 => Self::Unspecified,
11683 1 => Self::Aws,
11684 2 => Self::Azure,
11685 3 => Self::Gcp,
11686 _ => Self::UnknownValue(cloud_provider::UnknownValue(
11687 wkt::internal::UnknownEnumValue::Integer(value),
11688 )),
11689 }
11690 }
11691}
11692
11693impl std::convert::From<&str> for CloudProvider {
11694 fn from(value: &str) -> Self {
11695 use std::string::ToString;
11696 match value {
11697 "CLOUD_PROVIDER_UNSPECIFIED" => Self::Unspecified,
11698 "AWS" => Self::Aws,
11699 "AZURE" => Self::Azure,
11700 "GCP" => Self::Gcp,
11701 _ => Self::UnknownValue(cloud_provider::UnknownValue(
11702 wkt::internal::UnknownEnumValue::String(value.to_string()),
11703 )),
11704 }
11705 }
11706}
11707
11708impl serde::ser::Serialize for CloudProvider {
11709 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11710 where
11711 S: serde::Serializer,
11712 {
11713 match self {
11714 Self::Unspecified => serializer.serialize_i32(0),
11715 Self::Aws => serializer.serialize_i32(1),
11716 Self::Azure => serializer.serialize_i32(2),
11717 Self::Gcp => serializer.serialize_i32(3),
11718 Self::UnknownValue(u) => u.0.serialize(serializer),
11719 }
11720 }
11721}
11722
11723impl<'de> serde::de::Deserialize<'de> for CloudProvider {
11724 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11725 where
11726 D: serde::Deserializer<'de>,
11727 {
11728 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CloudProvider>::new(
11729 ".google.cloud.cloudsecuritycompliance.v1.CloudProvider",
11730 ))
11731 }
11732}
11733
11734/// The severity of the finding.
11735///
11736/// # Working with unknown values
11737///
11738/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11739/// additional enum variants at any time. Adding new variants is not considered
11740/// a breaking change. Applications should write their code in anticipation of:
11741///
11742/// - New values appearing in future releases of the client library, **and**
11743/// - New values received dynamically, without application changes.
11744///
11745/// Please consult the [Working with enums] section in the user guide for some
11746/// guidelines.
11747///
11748/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11749#[derive(Clone, Debug, PartialEq)]
11750#[non_exhaustive]
11751pub enum Severity {
11752 /// Default value. This value is unused.
11753 Unspecified,
11754 /// A critical vulnerability is easily discoverable by an external actor,
11755 /// exploitable, and results in the direct ability to execute arbitrary code,
11756 /// exfiltrate data, and otherwise gain additional access and privileges to
11757 /// cloud resources and workloads. Examples include publicly accessible
11758 /// unprotected user data and public SSH access with weak or no
11759 /// passwords.
11760 ///
11761 /// A critical threat is a threat that can access, modify, or delete data or
11762 /// execute unauthorized code within existing resources.
11763 Critical,
11764 /// A high-risk vulnerability can be easily discovered and exploited in
11765 /// combination with other vulnerabilities to gain direct access and
11766 /// the ability to execute arbitrary code, exfiltrate data, and otherwise
11767 /// gain additional access and privileges to cloud resources and workloads.
11768 /// An example is a database with weak or no passwords that is only
11769 /// accessible internally. This database could easily be compromised by an
11770 /// actor that had access to the internal network.
11771 ///
11772 /// A high-risk threat is a threat that can create new computational
11773 /// resources in an environment but can't access data or execute code in
11774 /// existing resources.
11775 High,
11776 /// A medium-risk vulnerability can be used by an actor to gain access to
11777 /// resources or privileges that enable them to eventually (through multiple
11778 /// steps or a complex exploit) gain access and the ability to execute
11779 /// arbitrary code or exfiltrate data. An example is a service account with
11780 /// access to more projects than it should have. If an actor gains access to
11781 /// the service account, they could potentially use that access to manipulate
11782 /// a project the service account was not intended to.
11783 ///
11784 /// A medium-risk threat can cause operational impact but might not
11785 /// access data or execute unauthorized code.
11786 Medium,
11787 /// A low-risk vulnerability hampers a security organization's ability to
11788 /// detect vulnerabilities or active threats in their deployment, or prevents
11789 /// the root cause investigation of security issues. An example is monitoring
11790 /// and logs being disabled for resource configurations and access.
11791 ///
11792 /// A low-risk threat is a threat that has obtained minimal access to an
11793 /// environment but can't access data, execute code, or create resources.
11794 Low,
11795 /// If set, the enum was initialized with an unknown value.
11796 ///
11797 /// Applications can examine the value using [Severity::value] or
11798 /// [Severity::name].
11799 UnknownValue(severity::UnknownValue),
11800}
11801
11802#[doc(hidden)]
11803pub mod severity {
11804 #[allow(unused_imports)]
11805 use super::*;
11806 #[derive(Clone, Debug, PartialEq)]
11807 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11808}
11809
11810impl Severity {
11811 /// Gets the enum value.
11812 ///
11813 /// Returns `None` if the enum contains an unknown value deserialized from
11814 /// the string representation of enums.
11815 pub fn value(&self) -> std::option::Option<i32> {
11816 match self {
11817 Self::Unspecified => std::option::Option::Some(0),
11818 Self::Critical => std::option::Option::Some(1),
11819 Self::High => std::option::Option::Some(2),
11820 Self::Medium => std::option::Option::Some(3),
11821 Self::Low => std::option::Option::Some(4),
11822 Self::UnknownValue(u) => u.0.value(),
11823 }
11824 }
11825
11826 /// Gets the enum value as a string.
11827 ///
11828 /// Returns `None` if the enum contains an unknown value deserialized from
11829 /// the integer representation of enums.
11830 pub fn name(&self) -> std::option::Option<&str> {
11831 match self {
11832 Self::Unspecified => std::option::Option::Some("SEVERITY_UNSPECIFIED"),
11833 Self::Critical => std::option::Option::Some("CRITICAL"),
11834 Self::High => std::option::Option::Some("HIGH"),
11835 Self::Medium => std::option::Option::Some("MEDIUM"),
11836 Self::Low => std::option::Option::Some("LOW"),
11837 Self::UnknownValue(u) => u.0.name(),
11838 }
11839 }
11840}
11841
11842impl std::default::Default for Severity {
11843 fn default() -> Self {
11844 use std::convert::From;
11845 Self::from(0)
11846 }
11847}
11848
11849impl std::fmt::Display for Severity {
11850 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11851 wkt::internal::display_enum(f, self.name(), self.value())
11852 }
11853}
11854
11855impl std::convert::From<i32> for Severity {
11856 fn from(value: i32) -> Self {
11857 match value {
11858 0 => Self::Unspecified,
11859 1 => Self::Critical,
11860 2 => Self::High,
11861 3 => Self::Medium,
11862 4 => Self::Low,
11863 _ => Self::UnknownValue(severity::UnknownValue(
11864 wkt::internal::UnknownEnumValue::Integer(value),
11865 )),
11866 }
11867 }
11868}
11869
11870impl std::convert::From<&str> for Severity {
11871 fn from(value: &str) -> Self {
11872 use std::string::ToString;
11873 match value {
11874 "SEVERITY_UNSPECIFIED" => Self::Unspecified,
11875 "CRITICAL" => Self::Critical,
11876 "HIGH" => Self::High,
11877 "MEDIUM" => Self::Medium,
11878 "LOW" => Self::Low,
11879 _ => Self::UnknownValue(severity::UnknownValue(
11880 wkt::internal::UnknownEnumValue::String(value.to_string()),
11881 )),
11882 }
11883 }
11884}
11885
11886impl serde::ser::Serialize for Severity {
11887 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11888 where
11889 S: serde::Serializer,
11890 {
11891 match self {
11892 Self::Unspecified => serializer.serialize_i32(0),
11893 Self::Critical => serializer.serialize_i32(1),
11894 Self::High => serializer.serialize_i32(2),
11895 Self::Medium => serializer.serialize_i32(3),
11896 Self::Low => serializer.serialize_i32(4),
11897 Self::UnknownValue(u) => u.0.serialize(serializer),
11898 }
11899 }
11900}
11901
11902impl<'de> serde::de::Deserialize<'de> for Severity {
11903 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11904 where
11905 D: serde::Deserializer<'de>,
11906 {
11907 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Severity>::new(
11908 ".google.cloud.cloudsecuritycompliance.v1.Severity",
11909 ))
11910 }
11911}
11912
11913/// The action type of the rule.
11914///
11915/// # Working with unknown values
11916///
11917/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11918/// additional enum variants at any time. Adding new variants is not considered
11919/// a breaking change. Applications should write their code in anticipation of:
11920///
11921/// - New values appearing in future releases of the client library, **and**
11922/// - New values received dynamically, without application changes.
11923///
11924/// Please consult the [Working with enums] section in the user guide for some
11925/// guidelines.
11926///
11927/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11928#[derive(Clone, Debug, PartialEq)]
11929#[non_exhaustive]
11930pub enum RuleActionType {
11931 /// Default value. This value is unused.
11932 Unspecified,
11933 /// The rule is intended to prevent non-compliance.
11934 Preventive,
11935 /// The rule is intended to detect non-compliance.
11936 Detective,
11937 /// The rule is intended to audit non-compliance.
11938 Audit,
11939 /// If set, the enum was initialized with an unknown value.
11940 ///
11941 /// Applications can examine the value using [RuleActionType::value] or
11942 /// [RuleActionType::name].
11943 UnknownValue(rule_action_type::UnknownValue),
11944}
11945
11946#[doc(hidden)]
11947pub mod rule_action_type {
11948 #[allow(unused_imports)]
11949 use super::*;
11950 #[derive(Clone, Debug, PartialEq)]
11951 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11952}
11953
11954impl RuleActionType {
11955 /// Gets the enum value.
11956 ///
11957 /// Returns `None` if the enum contains an unknown value deserialized from
11958 /// the string representation of enums.
11959 pub fn value(&self) -> std::option::Option<i32> {
11960 match self {
11961 Self::Unspecified => std::option::Option::Some(0),
11962 Self::Preventive => std::option::Option::Some(1),
11963 Self::Detective => std::option::Option::Some(2),
11964 Self::Audit => std::option::Option::Some(3),
11965 Self::UnknownValue(u) => u.0.value(),
11966 }
11967 }
11968
11969 /// Gets the enum value as a string.
11970 ///
11971 /// Returns `None` if the enum contains an unknown value deserialized from
11972 /// the integer representation of enums.
11973 pub fn name(&self) -> std::option::Option<&str> {
11974 match self {
11975 Self::Unspecified => std::option::Option::Some("RULE_ACTION_TYPE_UNSPECIFIED"),
11976 Self::Preventive => std::option::Option::Some("RULE_ACTION_TYPE_PREVENTIVE"),
11977 Self::Detective => std::option::Option::Some("RULE_ACTION_TYPE_DETECTIVE"),
11978 Self::Audit => std::option::Option::Some("RULE_ACTION_TYPE_AUDIT"),
11979 Self::UnknownValue(u) => u.0.name(),
11980 }
11981 }
11982}
11983
11984impl std::default::Default for RuleActionType {
11985 fn default() -> Self {
11986 use std::convert::From;
11987 Self::from(0)
11988 }
11989}
11990
11991impl std::fmt::Display for RuleActionType {
11992 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11993 wkt::internal::display_enum(f, self.name(), self.value())
11994 }
11995}
11996
11997impl std::convert::From<i32> for RuleActionType {
11998 fn from(value: i32) -> Self {
11999 match value {
12000 0 => Self::Unspecified,
12001 1 => Self::Preventive,
12002 2 => Self::Detective,
12003 3 => Self::Audit,
12004 _ => Self::UnknownValue(rule_action_type::UnknownValue(
12005 wkt::internal::UnknownEnumValue::Integer(value),
12006 )),
12007 }
12008 }
12009}
12010
12011impl std::convert::From<&str> for RuleActionType {
12012 fn from(value: &str) -> Self {
12013 use std::string::ToString;
12014 match value {
12015 "RULE_ACTION_TYPE_UNSPECIFIED" => Self::Unspecified,
12016 "RULE_ACTION_TYPE_PREVENTIVE" => Self::Preventive,
12017 "RULE_ACTION_TYPE_DETECTIVE" => Self::Detective,
12018 "RULE_ACTION_TYPE_AUDIT" => Self::Audit,
12019 _ => Self::UnknownValue(rule_action_type::UnknownValue(
12020 wkt::internal::UnknownEnumValue::String(value.to_string()),
12021 )),
12022 }
12023 }
12024}
12025
12026impl serde::ser::Serialize for RuleActionType {
12027 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12028 where
12029 S: serde::Serializer,
12030 {
12031 match self {
12032 Self::Unspecified => serializer.serialize_i32(0),
12033 Self::Preventive => serializer.serialize_i32(1),
12034 Self::Detective => serializer.serialize_i32(2),
12035 Self::Audit => serializer.serialize_i32(3),
12036 Self::UnknownValue(u) => u.0.serialize(serializer),
12037 }
12038 }
12039}
12040
12041impl<'de> serde::de::Deserialize<'de> for RuleActionType {
12042 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12043 where
12044 D: serde::Deserializer<'de>,
12045 {
12046 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RuleActionType>::new(
12047 ".google.cloud.cloudsecuritycompliance.v1.RuleActionType",
12048 ))
12049 }
12050}
12051
12052/// The type of resource that a control or framework can be applied to.
12053///
12054/// # Working with unknown values
12055///
12056/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12057/// additional enum variants at any time. Adding new variants is not considered
12058/// a breaking change. Applications should write their code in anticipation of:
12059///
12060/// - New values appearing in future releases of the client library, **and**
12061/// - New values received dynamically, without application changes.
12062///
12063/// Please consult the [Working with enums] section in the user guide for some
12064/// guidelines.
12065///
12066/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12067#[derive(Clone, Debug, PartialEq)]
12068#[non_exhaustive]
12069pub enum TargetResourceType {
12070 /// Default value. This value is unused.
12071 Unspecified,
12072 /// The target resource is a Google Cloud organization.
12073 TargetResourceCrmTypeOrg,
12074 /// The target resource is a folder.
12075 TargetResourceCrmTypeFolder,
12076 /// The target resource is a project.
12077 TargetResourceCrmTypeProject,
12078 /// The target resource is an application in App Hub.
12079 Application,
12080 /// If set, the enum was initialized with an unknown value.
12081 ///
12082 /// Applications can examine the value using [TargetResourceType::value] or
12083 /// [TargetResourceType::name].
12084 UnknownValue(target_resource_type::UnknownValue),
12085}
12086
12087#[doc(hidden)]
12088pub mod target_resource_type {
12089 #[allow(unused_imports)]
12090 use super::*;
12091 #[derive(Clone, Debug, PartialEq)]
12092 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12093}
12094
12095impl TargetResourceType {
12096 /// Gets the enum value.
12097 ///
12098 /// Returns `None` if the enum contains an unknown value deserialized from
12099 /// the string representation of enums.
12100 pub fn value(&self) -> std::option::Option<i32> {
12101 match self {
12102 Self::Unspecified => std::option::Option::Some(0),
12103 Self::TargetResourceCrmTypeOrg => std::option::Option::Some(1),
12104 Self::TargetResourceCrmTypeFolder => std::option::Option::Some(2),
12105 Self::TargetResourceCrmTypeProject => std::option::Option::Some(3),
12106 Self::Application => std::option::Option::Some(4),
12107 Self::UnknownValue(u) => u.0.value(),
12108 }
12109 }
12110
12111 /// Gets the enum value as a string.
12112 ///
12113 /// Returns `None` if the enum contains an unknown value deserialized from
12114 /// the integer representation of enums.
12115 pub fn name(&self) -> std::option::Option<&str> {
12116 match self {
12117 Self::Unspecified => std::option::Option::Some("TARGET_RESOURCE_TYPE_UNSPECIFIED"),
12118 Self::TargetResourceCrmTypeOrg => {
12119 std::option::Option::Some("TARGET_RESOURCE_CRM_TYPE_ORG")
12120 }
12121 Self::TargetResourceCrmTypeFolder => {
12122 std::option::Option::Some("TARGET_RESOURCE_CRM_TYPE_FOLDER")
12123 }
12124 Self::TargetResourceCrmTypeProject => {
12125 std::option::Option::Some("TARGET_RESOURCE_CRM_TYPE_PROJECT")
12126 }
12127 Self::Application => std::option::Option::Some("TARGET_RESOURCE_TYPE_APPLICATION"),
12128 Self::UnknownValue(u) => u.0.name(),
12129 }
12130 }
12131}
12132
12133impl std::default::Default for TargetResourceType {
12134 fn default() -> Self {
12135 use std::convert::From;
12136 Self::from(0)
12137 }
12138}
12139
12140impl std::fmt::Display for TargetResourceType {
12141 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12142 wkt::internal::display_enum(f, self.name(), self.value())
12143 }
12144}
12145
12146impl std::convert::From<i32> for TargetResourceType {
12147 fn from(value: i32) -> Self {
12148 match value {
12149 0 => Self::Unspecified,
12150 1 => Self::TargetResourceCrmTypeOrg,
12151 2 => Self::TargetResourceCrmTypeFolder,
12152 3 => Self::TargetResourceCrmTypeProject,
12153 4 => Self::Application,
12154 _ => Self::UnknownValue(target_resource_type::UnknownValue(
12155 wkt::internal::UnknownEnumValue::Integer(value),
12156 )),
12157 }
12158 }
12159}
12160
12161impl std::convert::From<&str> for TargetResourceType {
12162 fn from(value: &str) -> Self {
12163 use std::string::ToString;
12164 match value {
12165 "TARGET_RESOURCE_TYPE_UNSPECIFIED" => Self::Unspecified,
12166 "TARGET_RESOURCE_CRM_TYPE_ORG" => Self::TargetResourceCrmTypeOrg,
12167 "TARGET_RESOURCE_CRM_TYPE_FOLDER" => Self::TargetResourceCrmTypeFolder,
12168 "TARGET_RESOURCE_CRM_TYPE_PROJECT" => Self::TargetResourceCrmTypeProject,
12169 "TARGET_RESOURCE_TYPE_APPLICATION" => Self::Application,
12170 _ => Self::UnknownValue(target_resource_type::UnknownValue(
12171 wkt::internal::UnknownEnumValue::String(value.to_string()),
12172 )),
12173 }
12174 }
12175}
12176
12177impl serde::ser::Serialize for TargetResourceType {
12178 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12179 where
12180 S: serde::Serializer,
12181 {
12182 match self {
12183 Self::Unspecified => serializer.serialize_i32(0),
12184 Self::TargetResourceCrmTypeOrg => serializer.serialize_i32(1),
12185 Self::TargetResourceCrmTypeFolder => serializer.serialize_i32(2),
12186 Self::TargetResourceCrmTypeProject => serializer.serialize_i32(3),
12187 Self::Application => serializer.serialize_i32(4),
12188 Self::UnknownValue(u) => u.0.serialize(serializer),
12189 }
12190 }
12191}
12192
12193impl<'de> serde::de::Deserialize<'de> for TargetResourceType {
12194 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12195 where
12196 D: serde::Deserializer<'de>,
12197 {
12198 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TargetResourceType>::new(
12199 ".google.cloud.cloudsecuritycompliance.v1.TargetResourceType",
12200 ))
12201 }
12202}
12203
12204/// The state of the deployment resource.
12205///
12206/// # Working with unknown values
12207///
12208/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12209/// additional enum variants at any time. Adding new variants is not considered
12210/// a breaking change. Applications should write their code in anticipation of:
12211///
12212/// - New values appearing in future releases of the client library, **and**
12213/// - New values received dynamically, without application changes.
12214///
12215/// Please consult the [Working with enums] section in the user guide for some
12216/// guidelines.
12217///
12218/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12219#[derive(Clone, Debug, PartialEq)]
12220#[non_exhaustive]
12221pub enum DeploymentState {
12222 /// Default value. This value is unused.
12223 Unspecified,
12224 /// Validating the deployment.
12225 Validating,
12226 /// Deployment is being created.
12227 Creating,
12228 /// Deployment is being deleted.
12229 Deleting,
12230 /// Deployment has failed. All the changes made by the deployment were
12231 /// successfully rolled back. You can retry or delete a deployment that's
12232 /// in this state.
12233 Failed,
12234 /// Deployment is successful and ready to use.
12235 Ready,
12236 /// Deployment is partially deployed. All the cloud controls weren't deployed
12237 /// successfully. Retrying the operation resumes from the first failed
12238 /// step.
12239 PartiallyDeployed,
12240 /// Deployment is partially deleted. All the cloud control deployments weren't
12241 /// deleted successfully. Retrying the operation resumes from the first
12242 /// failed step.
12243 PartiallyDeleted,
12244 /// If set, the enum was initialized with an unknown value.
12245 ///
12246 /// Applications can examine the value using [DeploymentState::value] or
12247 /// [DeploymentState::name].
12248 UnknownValue(deployment_state::UnknownValue),
12249}
12250
12251#[doc(hidden)]
12252pub mod deployment_state {
12253 #[allow(unused_imports)]
12254 use super::*;
12255 #[derive(Clone, Debug, PartialEq)]
12256 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12257}
12258
12259impl DeploymentState {
12260 /// Gets the enum value.
12261 ///
12262 /// Returns `None` if the enum contains an unknown value deserialized from
12263 /// the string representation of enums.
12264 pub fn value(&self) -> std::option::Option<i32> {
12265 match self {
12266 Self::Unspecified => std::option::Option::Some(0),
12267 Self::Validating => std::option::Option::Some(1),
12268 Self::Creating => std::option::Option::Some(2),
12269 Self::Deleting => std::option::Option::Some(3),
12270 Self::Failed => std::option::Option::Some(4),
12271 Self::Ready => std::option::Option::Some(5),
12272 Self::PartiallyDeployed => std::option::Option::Some(6),
12273 Self::PartiallyDeleted => std::option::Option::Some(7),
12274 Self::UnknownValue(u) => u.0.value(),
12275 }
12276 }
12277
12278 /// Gets the enum value as a string.
12279 ///
12280 /// Returns `None` if the enum contains an unknown value deserialized from
12281 /// the integer representation of enums.
12282 pub fn name(&self) -> std::option::Option<&str> {
12283 match self {
12284 Self::Unspecified => std::option::Option::Some("DEPLOYMENT_STATE_UNSPECIFIED"),
12285 Self::Validating => std::option::Option::Some("DEPLOYMENT_STATE_VALIDATING"),
12286 Self::Creating => std::option::Option::Some("DEPLOYMENT_STATE_CREATING"),
12287 Self::Deleting => std::option::Option::Some("DEPLOYMENT_STATE_DELETING"),
12288 Self::Failed => std::option::Option::Some("DEPLOYMENT_STATE_FAILED"),
12289 Self::Ready => std::option::Option::Some("DEPLOYMENT_STATE_READY"),
12290 Self::PartiallyDeployed => {
12291 std::option::Option::Some("DEPLOYMENT_STATE_PARTIALLY_DEPLOYED")
12292 }
12293 Self::PartiallyDeleted => {
12294 std::option::Option::Some("DEPLOYMENT_STATE_PARTIALLY_DELETED")
12295 }
12296 Self::UnknownValue(u) => u.0.name(),
12297 }
12298 }
12299}
12300
12301impl std::default::Default for DeploymentState {
12302 fn default() -> Self {
12303 use std::convert::From;
12304 Self::from(0)
12305 }
12306}
12307
12308impl std::fmt::Display for DeploymentState {
12309 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12310 wkt::internal::display_enum(f, self.name(), self.value())
12311 }
12312}
12313
12314impl std::convert::From<i32> for DeploymentState {
12315 fn from(value: i32) -> Self {
12316 match value {
12317 0 => Self::Unspecified,
12318 1 => Self::Validating,
12319 2 => Self::Creating,
12320 3 => Self::Deleting,
12321 4 => Self::Failed,
12322 5 => Self::Ready,
12323 6 => Self::PartiallyDeployed,
12324 7 => Self::PartiallyDeleted,
12325 _ => Self::UnknownValue(deployment_state::UnknownValue(
12326 wkt::internal::UnknownEnumValue::Integer(value),
12327 )),
12328 }
12329 }
12330}
12331
12332impl std::convert::From<&str> for DeploymentState {
12333 fn from(value: &str) -> Self {
12334 use std::string::ToString;
12335 match value {
12336 "DEPLOYMENT_STATE_UNSPECIFIED" => Self::Unspecified,
12337 "DEPLOYMENT_STATE_VALIDATING" => Self::Validating,
12338 "DEPLOYMENT_STATE_CREATING" => Self::Creating,
12339 "DEPLOYMENT_STATE_DELETING" => Self::Deleting,
12340 "DEPLOYMENT_STATE_FAILED" => Self::Failed,
12341 "DEPLOYMENT_STATE_READY" => Self::Ready,
12342 "DEPLOYMENT_STATE_PARTIALLY_DEPLOYED" => Self::PartiallyDeployed,
12343 "DEPLOYMENT_STATE_PARTIALLY_DELETED" => Self::PartiallyDeleted,
12344 _ => Self::UnknownValue(deployment_state::UnknownValue(
12345 wkt::internal::UnknownEnumValue::String(value.to_string()),
12346 )),
12347 }
12348 }
12349}
12350
12351impl serde::ser::Serialize for DeploymentState {
12352 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12353 where
12354 S: serde::Serializer,
12355 {
12356 match self {
12357 Self::Unspecified => serializer.serialize_i32(0),
12358 Self::Validating => serializer.serialize_i32(1),
12359 Self::Creating => serializer.serialize_i32(2),
12360 Self::Deleting => serializer.serialize_i32(3),
12361 Self::Failed => serializer.serialize_i32(4),
12362 Self::Ready => serializer.serialize_i32(5),
12363 Self::PartiallyDeployed => serializer.serialize_i32(6),
12364 Self::PartiallyDeleted => serializer.serialize_i32(7),
12365 Self::UnknownValue(u) => u.0.serialize(serializer),
12366 }
12367 }
12368}
12369
12370impl<'de> serde::de::Deserialize<'de> for DeploymentState {
12371 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12372 where
12373 D: serde::Deserializer<'de>,
12374 {
12375 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeploymentState>::new(
12376 ".google.cloud.cloudsecuritycompliance.v1.DeploymentState",
12377 ))
12378 }
12379}
12380
12381/// The evaluation state of the control.
12382///
12383/// # Working with unknown values
12384///
12385/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12386/// additional enum variants at any time. Adding new variants is not considered
12387/// a breaking change. Applications should write their code in anticipation of:
12388///
12389/// - New values appearing in future releases of the client library, **and**
12390/// - New values received dynamically, without application changes.
12391///
12392/// Please consult the [Working with enums] section in the user guide for some
12393/// guidelines.
12394///
12395/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12396#[derive(Clone, Debug, PartialEq)]
12397#[non_exhaustive]
12398pub enum EvaluationState {
12399 /// Default value. This value is unused.
12400 Unspecified,
12401 /// The control is passing.
12402 Passed,
12403 /// The control is failing.
12404 Failed,
12405 /// The control is not assessed.
12406 NotAssessed,
12407 /// If set, the enum was initialized with an unknown value.
12408 ///
12409 /// Applications can examine the value using [EvaluationState::value] or
12410 /// [EvaluationState::name].
12411 UnknownValue(evaluation_state::UnknownValue),
12412}
12413
12414#[doc(hidden)]
12415pub mod evaluation_state {
12416 #[allow(unused_imports)]
12417 use super::*;
12418 #[derive(Clone, Debug, PartialEq)]
12419 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12420}
12421
12422impl EvaluationState {
12423 /// Gets the enum value.
12424 ///
12425 /// Returns `None` if the enum contains an unknown value deserialized from
12426 /// the string representation of enums.
12427 pub fn value(&self) -> std::option::Option<i32> {
12428 match self {
12429 Self::Unspecified => std::option::Option::Some(0),
12430 Self::Passed => std::option::Option::Some(1),
12431 Self::Failed => std::option::Option::Some(2),
12432 Self::NotAssessed => std::option::Option::Some(3),
12433 Self::UnknownValue(u) => u.0.value(),
12434 }
12435 }
12436
12437 /// Gets the enum value as a string.
12438 ///
12439 /// Returns `None` if the enum contains an unknown value deserialized from
12440 /// the integer representation of enums.
12441 pub fn name(&self) -> std::option::Option<&str> {
12442 match self {
12443 Self::Unspecified => std::option::Option::Some("EVALUATION_STATE_UNSPECIFIED"),
12444 Self::Passed => std::option::Option::Some("EVALUATION_STATE_PASSED"),
12445 Self::Failed => std::option::Option::Some("EVALUATION_STATE_FAILED"),
12446 Self::NotAssessed => std::option::Option::Some("EVALUATION_STATE_NOT_ASSESSED"),
12447 Self::UnknownValue(u) => u.0.name(),
12448 }
12449 }
12450}
12451
12452impl std::default::Default for EvaluationState {
12453 fn default() -> Self {
12454 use std::convert::From;
12455 Self::from(0)
12456 }
12457}
12458
12459impl std::fmt::Display for EvaluationState {
12460 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12461 wkt::internal::display_enum(f, self.name(), self.value())
12462 }
12463}
12464
12465impl std::convert::From<i32> for EvaluationState {
12466 fn from(value: i32) -> Self {
12467 match value {
12468 0 => Self::Unspecified,
12469 1 => Self::Passed,
12470 2 => Self::Failed,
12471 3 => Self::NotAssessed,
12472 _ => Self::UnknownValue(evaluation_state::UnknownValue(
12473 wkt::internal::UnknownEnumValue::Integer(value),
12474 )),
12475 }
12476 }
12477}
12478
12479impl std::convert::From<&str> for EvaluationState {
12480 fn from(value: &str) -> Self {
12481 use std::string::ToString;
12482 match value {
12483 "EVALUATION_STATE_UNSPECIFIED" => Self::Unspecified,
12484 "EVALUATION_STATE_PASSED" => Self::Passed,
12485 "EVALUATION_STATE_FAILED" => Self::Failed,
12486 "EVALUATION_STATE_NOT_ASSESSED" => Self::NotAssessed,
12487 _ => Self::UnknownValue(evaluation_state::UnknownValue(
12488 wkt::internal::UnknownEnumValue::String(value.to_string()),
12489 )),
12490 }
12491 }
12492}
12493
12494impl serde::ser::Serialize for EvaluationState {
12495 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12496 where
12497 S: serde::Serializer,
12498 {
12499 match self {
12500 Self::Unspecified => serializer.serialize_i32(0),
12501 Self::Passed => serializer.serialize_i32(1),
12502 Self::Failed => serializer.serialize_i32(2),
12503 Self::NotAssessed => serializer.serialize_i32(3),
12504 Self::UnknownValue(u) => u.0.serialize(serializer),
12505 }
12506 }
12507}
12508
12509impl<'de> serde::de::Deserialize<'de> for EvaluationState {
12510 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12511 where
12512 D: serde::Deserializer<'de>,
12513 {
12514 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EvaluationState>::new(
12515 ".google.cloud.cloudsecuritycompliance.v1.EvaluationState",
12516 ))
12517 }
12518}
12519
12520/// A finding is a record of assessment data like security, risk, health, or
12521/// privacy.
12522///
12523/// # Working with unknown values
12524///
12525/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12526/// additional enum variants at any time. Adding new variants is not considered
12527/// a breaking change. Applications should write their code in anticipation of:
12528///
12529/// - New values appearing in future releases of the client library, **and**
12530/// - New values received dynamically, without application changes.
12531///
12532/// Please consult the [Working with enums] section in the user guide for some
12533/// guidelines.
12534///
12535/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12536#[derive(Clone, Debug, PartialEq)]
12537#[non_exhaustive]
12538pub enum FindingClass {
12539 /// Default value. This value is unused.
12540 Unspecified,
12541 /// The activity is unwanted or malicious.
12542 Threat,
12543 /// A potential weakness in software that increases risk to
12544 /// confidentiality, integrity, and availability.
12545 Vulnerability,
12546 /// A potential weakness in a cloud resource or asset configuration that
12547 /// increases risk.
12548 Misconfiguration,
12549 /// A security observation that is for informational purposes.
12550 Observation,
12551 /// An error that prevents Security Command Center from functioning properly.
12552 SccError,
12553 /// A potential security risk that's due to a change in the security
12554 /// posture.
12555 PostureViolation,
12556 /// A combination of security issues that represent a more severe
12557 /// security problem when taken together.
12558 ToxicCombination,
12559 /// A potential security risk to data assets that contain sensitive
12560 /// data.
12561 SensitiveDataRisk,
12562 /// A resource or resource group where high risk attack paths
12563 /// converge, based on attack path simulations (APS).
12564 Chokepoint,
12565 /// If set, the enum was initialized with an unknown value.
12566 ///
12567 /// Applications can examine the value using [FindingClass::value] or
12568 /// [FindingClass::name].
12569 UnknownValue(finding_class::UnknownValue),
12570}
12571
12572#[doc(hidden)]
12573pub mod finding_class {
12574 #[allow(unused_imports)]
12575 use super::*;
12576 #[derive(Clone, Debug, PartialEq)]
12577 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12578}
12579
12580impl FindingClass {
12581 /// Gets the enum value.
12582 ///
12583 /// Returns `None` if the enum contains an unknown value deserialized from
12584 /// the string representation of enums.
12585 pub fn value(&self) -> std::option::Option<i32> {
12586 match self {
12587 Self::Unspecified => std::option::Option::Some(0),
12588 Self::Threat => std::option::Option::Some(1),
12589 Self::Vulnerability => std::option::Option::Some(2),
12590 Self::Misconfiguration => std::option::Option::Some(3),
12591 Self::Observation => std::option::Option::Some(4),
12592 Self::SccError => std::option::Option::Some(5),
12593 Self::PostureViolation => std::option::Option::Some(6),
12594 Self::ToxicCombination => std::option::Option::Some(7),
12595 Self::SensitiveDataRisk => std::option::Option::Some(8),
12596 Self::Chokepoint => std::option::Option::Some(9),
12597 Self::UnknownValue(u) => u.0.value(),
12598 }
12599 }
12600
12601 /// Gets the enum value as a string.
12602 ///
12603 /// Returns `None` if the enum contains an unknown value deserialized from
12604 /// the integer representation of enums.
12605 pub fn name(&self) -> std::option::Option<&str> {
12606 match self {
12607 Self::Unspecified => std::option::Option::Some("FINDING_CLASS_UNSPECIFIED"),
12608 Self::Threat => std::option::Option::Some("THREAT"),
12609 Self::Vulnerability => std::option::Option::Some("VULNERABILITY"),
12610 Self::Misconfiguration => std::option::Option::Some("MISCONFIGURATION"),
12611 Self::Observation => std::option::Option::Some("OBSERVATION"),
12612 Self::SccError => std::option::Option::Some("SCC_ERROR"),
12613 Self::PostureViolation => std::option::Option::Some("POSTURE_VIOLATION"),
12614 Self::ToxicCombination => std::option::Option::Some("TOXIC_COMBINATION"),
12615 Self::SensitiveDataRisk => std::option::Option::Some("SENSITIVE_DATA_RISK"),
12616 Self::Chokepoint => std::option::Option::Some("CHOKEPOINT"),
12617 Self::UnknownValue(u) => u.0.name(),
12618 }
12619 }
12620}
12621
12622impl std::default::Default for FindingClass {
12623 fn default() -> Self {
12624 use std::convert::From;
12625 Self::from(0)
12626 }
12627}
12628
12629impl std::fmt::Display for FindingClass {
12630 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12631 wkt::internal::display_enum(f, self.name(), self.value())
12632 }
12633}
12634
12635impl std::convert::From<i32> for FindingClass {
12636 fn from(value: i32) -> Self {
12637 match value {
12638 0 => Self::Unspecified,
12639 1 => Self::Threat,
12640 2 => Self::Vulnerability,
12641 3 => Self::Misconfiguration,
12642 4 => Self::Observation,
12643 5 => Self::SccError,
12644 6 => Self::PostureViolation,
12645 7 => Self::ToxicCombination,
12646 8 => Self::SensitiveDataRisk,
12647 9 => Self::Chokepoint,
12648 _ => Self::UnknownValue(finding_class::UnknownValue(
12649 wkt::internal::UnknownEnumValue::Integer(value),
12650 )),
12651 }
12652 }
12653}
12654
12655impl std::convert::From<&str> for FindingClass {
12656 fn from(value: &str) -> Self {
12657 use std::string::ToString;
12658 match value {
12659 "FINDING_CLASS_UNSPECIFIED" => Self::Unspecified,
12660 "THREAT" => Self::Threat,
12661 "VULNERABILITY" => Self::Vulnerability,
12662 "MISCONFIGURATION" => Self::Misconfiguration,
12663 "OBSERVATION" => Self::Observation,
12664 "SCC_ERROR" => Self::SccError,
12665 "POSTURE_VIOLATION" => Self::PostureViolation,
12666 "TOXIC_COMBINATION" => Self::ToxicCombination,
12667 "SENSITIVE_DATA_RISK" => Self::SensitiveDataRisk,
12668 "CHOKEPOINT" => Self::Chokepoint,
12669 _ => Self::UnknownValue(finding_class::UnknownValue(
12670 wkt::internal::UnknownEnumValue::String(value.to_string()),
12671 )),
12672 }
12673 }
12674}
12675
12676impl serde::ser::Serialize for FindingClass {
12677 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12678 where
12679 S: serde::Serializer,
12680 {
12681 match self {
12682 Self::Unspecified => serializer.serialize_i32(0),
12683 Self::Threat => serializer.serialize_i32(1),
12684 Self::Vulnerability => serializer.serialize_i32(2),
12685 Self::Misconfiguration => serializer.serialize_i32(3),
12686 Self::Observation => serializer.serialize_i32(4),
12687 Self::SccError => serializer.serialize_i32(5),
12688 Self::PostureViolation => serializer.serialize_i32(6),
12689 Self::ToxicCombination => serializer.serialize_i32(7),
12690 Self::SensitiveDataRisk => serializer.serialize_i32(8),
12691 Self::Chokepoint => serializer.serialize_i32(9),
12692 Self::UnknownValue(u) => u.0.serialize(serializer),
12693 }
12694 }
12695}
12696
12697impl<'de> serde::de::Deserialize<'de> for FindingClass {
12698 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12699 where
12700 D: serde::Deserializer<'de>,
12701 {
12702 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FindingClass>::new(
12703 ".google.cloud.cloudsecuritycompliance.v1.FindingClass",
12704 ))
12705 }
12706}