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 gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_location;
25extern crate google_cloud_longrunning;
26extern crate google_cloud_lro;
27extern crate google_cloud_type;
28extern crate lazy_static;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40/// The request message for [GenerateFrameworkAuditScopeReport][].
41#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct GenerateFrameworkAuditScopeReportRequest {
44 /// Required. The organization, folder or project for the audit report.
45 ///
46 /// Supported formats are the following:
47 ///
48 /// * `projects/{project_id}/locations/{location}`
49 /// * `folders/{folder_id}/locations/{location}`
50 /// * `organizations/{organization_id}/locations/{location}`
51 pub scope: std::string::String,
52
53 /// Required. The format that the scope report bytes is returned in.
54 pub report_format: crate::model::generate_framework_audit_scope_report_request::Format,
55
56 /// Required. The compliance framework that the scope report is generated for.
57 pub compliance_framework: std::string::String,
58
59 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
60}
61
62impl GenerateFrameworkAuditScopeReportRequest {
63 pub fn new() -> Self {
64 std::default::Default::default()
65 }
66
67 /// Sets the value of [scope][crate::model::GenerateFrameworkAuditScopeReportRequest::scope].
68 ///
69 /// # Example
70 /// ```ignore,no_run
71 /// # use google_cloud_cloudsecuritycompliance_v1::model::GenerateFrameworkAuditScopeReportRequest;
72 /// let x = GenerateFrameworkAuditScopeReportRequest::new().set_scope("example");
73 /// ```
74 pub fn set_scope<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
75 self.scope = v.into();
76 self
77 }
78
79 /// Sets the value of [report_format][crate::model::GenerateFrameworkAuditScopeReportRequest::report_format].
80 ///
81 /// # Example
82 /// ```ignore,no_run
83 /// # use google_cloud_cloudsecuritycompliance_v1::model::GenerateFrameworkAuditScopeReportRequest;
84 /// use google_cloud_cloudsecuritycompliance_v1::model::generate_framework_audit_scope_report_request::Format;
85 /// let x0 = GenerateFrameworkAuditScopeReportRequest::new().set_report_format(Format::Odf);
86 /// ```
87 pub fn set_report_format<
88 T: std::convert::Into<crate::model::generate_framework_audit_scope_report_request::Format>,
89 >(
90 mut self,
91 v: T,
92 ) -> Self {
93 self.report_format = v.into();
94 self
95 }
96
97 /// Sets the value of [compliance_framework][crate::model::GenerateFrameworkAuditScopeReportRequest::compliance_framework].
98 ///
99 /// # Example
100 /// ```ignore,no_run
101 /// # use google_cloud_cloudsecuritycompliance_v1::model::GenerateFrameworkAuditScopeReportRequest;
102 /// let x = GenerateFrameworkAuditScopeReportRequest::new().set_compliance_framework("example");
103 /// ```
104 pub fn set_compliance_framework<T: std::convert::Into<std::string::String>>(
105 mut self,
106 v: T,
107 ) -> Self {
108 self.compliance_framework = v.into();
109 self
110 }
111}
112
113impl wkt::message::Message for GenerateFrameworkAuditScopeReportRequest {
114 fn typename() -> &'static str {
115 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.GenerateFrameworkAuditScopeReportRequest"
116 }
117}
118
119/// Defines additional types related to [GenerateFrameworkAuditScopeReportRequest].
120pub mod generate_framework_audit_scope_report_request {
121 #[allow(unused_imports)]
122 use super::*;
123
124 /// The set of options for the audit scope report format.
125 ///
126 /// # Working with unknown values
127 ///
128 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
129 /// additional enum variants at any time. Adding new variants is not considered
130 /// a breaking change. Applications should write their code in anticipation of:
131 ///
132 /// - New values appearing in future releases of the client library, **and**
133 /// - New values received dynamically, without application changes.
134 ///
135 /// Please consult the [Working with enums] section in the user guide for some
136 /// guidelines.
137 ///
138 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
139 #[derive(Clone, Debug, PartialEq)]
140 #[non_exhaustive]
141 pub enum Format {
142 /// Default value. This value is unused.
143 Unspecified,
144 /// The report format is the Open Document Format (ODF).
145 Odf,
146 /// If set, the enum was initialized with an unknown value.
147 ///
148 /// Applications can examine the value using [Format::value] or
149 /// [Format::name].
150 UnknownValue(format::UnknownValue),
151 }
152
153 #[doc(hidden)]
154 pub mod format {
155 #[allow(unused_imports)]
156 use super::*;
157 #[derive(Clone, Debug, PartialEq)]
158 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
159 }
160
161 impl Format {
162 /// Gets the enum value.
163 ///
164 /// Returns `None` if the enum contains an unknown value deserialized from
165 /// the string representation of enums.
166 pub fn value(&self) -> std::option::Option<i32> {
167 match self {
168 Self::Unspecified => std::option::Option::Some(0),
169 Self::Odf => std::option::Option::Some(1),
170 Self::UnknownValue(u) => u.0.value(),
171 }
172 }
173
174 /// Gets the enum value as a string.
175 ///
176 /// Returns `None` if the enum contains an unknown value deserialized from
177 /// the integer representation of enums.
178 pub fn name(&self) -> std::option::Option<&str> {
179 match self {
180 Self::Unspecified => std::option::Option::Some("FORMAT_UNSPECIFIED"),
181 Self::Odf => std::option::Option::Some("ODF"),
182 Self::UnknownValue(u) => u.0.name(),
183 }
184 }
185 }
186
187 impl std::default::Default for Format {
188 fn default() -> Self {
189 use std::convert::From;
190 Self::from(0)
191 }
192 }
193
194 impl std::fmt::Display for Format {
195 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
196 wkt::internal::display_enum(f, self.name(), self.value())
197 }
198 }
199
200 impl std::convert::From<i32> for Format {
201 fn from(value: i32) -> Self {
202 match value {
203 0 => Self::Unspecified,
204 1 => Self::Odf,
205 _ => Self::UnknownValue(format::UnknownValue(
206 wkt::internal::UnknownEnumValue::Integer(value),
207 )),
208 }
209 }
210 }
211
212 impl std::convert::From<&str> for Format {
213 fn from(value: &str) -> Self {
214 use std::string::ToString;
215 match value {
216 "FORMAT_UNSPECIFIED" => Self::Unspecified,
217 "ODF" => Self::Odf,
218 _ => Self::UnknownValue(format::UnknownValue(
219 wkt::internal::UnknownEnumValue::String(value.to_string()),
220 )),
221 }
222 }
223 }
224
225 impl serde::ser::Serialize for Format {
226 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
227 where
228 S: serde::Serializer,
229 {
230 match self {
231 Self::Unspecified => serializer.serialize_i32(0),
232 Self::Odf => serializer.serialize_i32(1),
233 Self::UnknownValue(u) => u.0.serialize(serializer),
234 }
235 }
236 }
237
238 impl<'de> serde::de::Deserialize<'de> for Format {
239 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
240 where
241 D: serde::Deserializer<'de>,
242 {
243 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Format>::new(
244 ".google.cloud.cloudsecuritycompliance.v1.GenerateFrameworkAuditScopeReportRequest.Format"))
245 }
246 }
247}
248
249/// The response message for [GenerateFrameworkAuditScopeReport][].
250#[derive(Clone, Default, PartialEq)]
251#[non_exhaustive]
252pub struct GenerateFrameworkAuditScopeReportResponse {
253 /// Identifier. The name of the audit report, in the format that was
254 /// given in the request.
255 pub name: std::string::String,
256
257 /// Required. The compliance framework that the audit scope report is generated
258 /// for.
259 pub compliance_framework: std::string::String,
260
261 /// The set of options that the audit scope report is exported in.
262 pub audit_report: std::option::Option<
263 crate::model::generate_framework_audit_scope_report_response::AuditReport,
264 >,
265
266 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
267}
268
269impl GenerateFrameworkAuditScopeReportResponse {
270 pub fn new() -> Self {
271 std::default::Default::default()
272 }
273
274 /// Sets the value of [name][crate::model::GenerateFrameworkAuditScopeReportResponse::name].
275 ///
276 /// # Example
277 /// ```ignore,no_run
278 /// # use google_cloud_cloudsecuritycompliance_v1::model::GenerateFrameworkAuditScopeReportResponse;
279 /// let x = GenerateFrameworkAuditScopeReportResponse::new().set_name("example");
280 /// ```
281 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
282 self.name = v.into();
283 self
284 }
285
286 /// Sets the value of [compliance_framework][crate::model::GenerateFrameworkAuditScopeReportResponse::compliance_framework].
287 ///
288 /// # Example
289 /// ```ignore,no_run
290 /// # use google_cloud_cloudsecuritycompliance_v1::model::GenerateFrameworkAuditScopeReportResponse;
291 /// let x = GenerateFrameworkAuditScopeReportResponse::new().set_compliance_framework("example");
292 /// ```
293 pub fn set_compliance_framework<T: std::convert::Into<std::string::String>>(
294 mut self,
295 v: T,
296 ) -> Self {
297 self.compliance_framework = v.into();
298 self
299 }
300
301 /// Sets the value of [audit_report][crate::model::GenerateFrameworkAuditScopeReportResponse::audit_report].
302 ///
303 /// Note that all the setters affecting `audit_report` are mutually
304 /// exclusive.
305 ///
306 /// # Example
307 /// ```ignore,no_run
308 /// # use google_cloud_cloudsecuritycompliance_v1::model::GenerateFrameworkAuditScopeReportResponse;
309 /// use google_cloud_cloudsecuritycompliance_v1::model::generate_framework_audit_scope_report_response::AuditReport;
310 /// let x = GenerateFrameworkAuditScopeReportResponse::new().set_audit_report(Some(AuditReport::ScopeReportContents(bytes::Bytes::from_static(b"example"))));
311 /// ```
312 pub fn set_audit_report<
313 T: std::convert::Into<
314 std::option::Option<
315 crate::model::generate_framework_audit_scope_report_response::AuditReport,
316 >,
317 >,
318 >(
319 mut self,
320 v: T,
321 ) -> Self {
322 self.audit_report = v.into();
323 self
324 }
325
326 /// The value of [audit_report][crate::model::GenerateFrameworkAuditScopeReportResponse::audit_report]
327 /// if it holds a `ScopeReportContents`, `None` if the field is not set or
328 /// holds a different branch.
329 pub fn scope_report_contents(&self) -> std::option::Option<&::bytes::Bytes> {
330 #[allow(unreachable_patterns)]
331 self.audit_report.as_ref().and_then(|v| match v {
332 crate::model::generate_framework_audit_scope_report_response::AuditReport::ScopeReportContents(v) => std::option::Option::Some(v),
333 _ => std::option::Option::None,
334 })
335 }
336
337 /// Sets the value of [audit_report][crate::model::GenerateFrameworkAuditScopeReportResponse::audit_report]
338 /// to hold a `ScopeReportContents`.
339 ///
340 /// Note that all the setters affecting `audit_report` are
341 /// mutually exclusive.
342 ///
343 /// # Example
344 /// ```ignore,no_run
345 /// # use google_cloud_cloudsecuritycompliance_v1::model::GenerateFrameworkAuditScopeReportResponse;
346 /// let x = GenerateFrameworkAuditScopeReportResponse::new().set_scope_report_contents(bytes::Bytes::from_static(b"example"));
347 /// assert!(x.scope_report_contents().is_some());
348 /// ```
349 pub fn set_scope_report_contents<T: std::convert::Into<::bytes::Bytes>>(
350 mut self,
351 v: T,
352 ) -> Self {
353 self.audit_report = std::option::Option::Some(
354 crate::model::generate_framework_audit_scope_report_response::AuditReport::ScopeReportContents(
355 v.into()
356 )
357 );
358 self
359 }
360}
361
362impl wkt::message::Message for GenerateFrameworkAuditScopeReportResponse {
363 fn typename() -> &'static str {
364 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.GenerateFrameworkAuditScopeReportResponse"
365 }
366}
367
368/// Defines additional types related to [GenerateFrameworkAuditScopeReportResponse].
369pub mod generate_framework_audit_scope_report_response {
370 #[allow(unused_imports)]
371 use super::*;
372
373 /// The set of options that the audit scope report is exported in.
374 #[derive(Clone, Debug, PartialEq)]
375 #[non_exhaustive]
376 pub enum AuditReport {
377 /// The audit scope report content in byte format.
378 ScopeReportContents(::bytes::Bytes),
379 }
380}
381
382/// Additional information for an audit operation.
383#[derive(Clone, Default, PartialEq)]
384#[non_exhaustive]
385pub struct ReportSummary {
386 /// Output only. The total number of checks.
387 pub total_count: i32,
388
389 /// Output only. The number of compliant checks.
390 pub compliant_count: i32,
391
392 /// Output only. The number of checks with violations.
393 pub violation_count: i32,
394
395 /// Output only. The number of checks with "manual review needed" status.
396 pub manual_review_needed_count: i32,
397
398 /// Output only. The number of checks that can't be performed due to errors.
399 pub error_count: i32,
400
401 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
402}
403
404impl ReportSummary {
405 pub fn new() -> Self {
406 std::default::Default::default()
407 }
408
409 /// Sets the value of [total_count][crate::model::ReportSummary::total_count].
410 ///
411 /// # Example
412 /// ```ignore,no_run
413 /// # use google_cloud_cloudsecuritycompliance_v1::model::ReportSummary;
414 /// let x = ReportSummary::new().set_total_count(42);
415 /// ```
416 pub fn set_total_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
417 self.total_count = v.into();
418 self
419 }
420
421 /// Sets the value of [compliant_count][crate::model::ReportSummary::compliant_count].
422 ///
423 /// # Example
424 /// ```ignore,no_run
425 /// # use google_cloud_cloudsecuritycompliance_v1::model::ReportSummary;
426 /// let x = ReportSummary::new().set_compliant_count(42);
427 /// ```
428 pub fn set_compliant_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
429 self.compliant_count = v.into();
430 self
431 }
432
433 /// Sets the value of [violation_count][crate::model::ReportSummary::violation_count].
434 ///
435 /// # Example
436 /// ```ignore,no_run
437 /// # use google_cloud_cloudsecuritycompliance_v1::model::ReportSummary;
438 /// let x = ReportSummary::new().set_violation_count(42);
439 /// ```
440 pub fn set_violation_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
441 self.violation_count = v.into();
442 self
443 }
444
445 /// Sets the value of [manual_review_needed_count][crate::model::ReportSummary::manual_review_needed_count].
446 ///
447 /// # Example
448 /// ```ignore,no_run
449 /// # use google_cloud_cloudsecuritycompliance_v1::model::ReportSummary;
450 /// let x = ReportSummary::new().set_manual_review_needed_count(42);
451 /// ```
452 pub fn set_manual_review_needed_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
453 self.manual_review_needed_count = v.into();
454 self
455 }
456
457 /// Sets the value of [error_count][crate::model::ReportSummary::error_count].
458 ///
459 /// # Example
460 /// ```ignore,no_run
461 /// # use google_cloud_cloudsecuritycompliance_v1::model::ReportSummary;
462 /// let x = ReportSummary::new().set_error_count(42);
463 /// ```
464 pub fn set_error_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
465 self.error_count = v.into();
466 self
467 }
468}
469
470impl wkt::message::Message for ReportSummary {
471 fn typename() -> &'static str {
472 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ReportSummary"
473 }
474}
475
476/// The request message for [CreateFrameworkAudit][].
477#[derive(Clone, Default, PartialEq)]
478#[non_exhaustive]
479pub struct CreateFrameworkAuditRequest {
480 /// Required. The parent resource where this framework audit is created.
481 ///
482 /// Supported formats are the following:
483 ///
484 /// * `organizations/{organization_id}/locations/{location}`
485 /// * `folders/{folder_id}/locations/{location}`
486 /// * `projects/{project_id}/locations/{location}`
487 pub parent: std::string::String,
488
489 /// Optional. The ID to use for the framework audit. The ID becomes the final
490 /// component of the framework audit's full resource name.
491 ///
492 /// The ID must be between 4-63 characters, and valid characters
493 /// are `\[a-z][0-9]-\`.
494 pub framework_audit_id: std::string::String,
495
496 /// Required. The framework audit to create.
497 pub framework_audit: std::option::Option<crate::model::FrameworkAudit>,
498
499 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
500}
501
502impl CreateFrameworkAuditRequest {
503 pub fn new() -> Self {
504 std::default::Default::default()
505 }
506
507 /// Sets the value of [parent][crate::model::CreateFrameworkAuditRequest::parent].
508 ///
509 /// # Example
510 /// ```ignore,no_run
511 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkAuditRequest;
512 /// let x = CreateFrameworkAuditRequest::new().set_parent("example");
513 /// ```
514 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
515 self.parent = v.into();
516 self
517 }
518
519 /// Sets the value of [framework_audit_id][crate::model::CreateFrameworkAuditRequest::framework_audit_id].
520 ///
521 /// # Example
522 /// ```ignore,no_run
523 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkAuditRequest;
524 /// let x = CreateFrameworkAuditRequest::new().set_framework_audit_id("example");
525 /// ```
526 pub fn set_framework_audit_id<T: std::convert::Into<std::string::String>>(
527 mut self,
528 v: T,
529 ) -> Self {
530 self.framework_audit_id = v.into();
531 self
532 }
533
534 /// Sets the value of [framework_audit][crate::model::CreateFrameworkAuditRequest::framework_audit].
535 ///
536 /// # Example
537 /// ```ignore,no_run
538 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkAuditRequest;
539 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
540 /// let x = CreateFrameworkAuditRequest::new().set_framework_audit(FrameworkAudit::default()/* use setters */);
541 /// ```
542 pub fn set_framework_audit<T>(mut self, v: T) -> Self
543 where
544 T: std::convert::Into<crate::model::FrameworkAudit>,
545 {
546 self.framework_audit = std::option::Option::Some(v.into());
547 self
548 }
549
550 /// Sets or clears the value of [framework_audit][crate::model::CreateFrameworkAuditRequest::framework_audit].
551 ///
552 /// # Example
553 /// ```ignore,no_run
554 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkAuditRequest;
555 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
556 /// let x = CreateFrameworkAuditRequest::new().set_or_clear_framework_audit(Some(FrameworkAudit::default()/* use setters */));
557 /// let x = CreateFrameworkAuditRequest::new().set_or_clear_framework_audit(None::<FrameworkAudit>);
558 /// ```
559 pub fn set_or_clear_framework_audit<T>(mut self, v: std::option::Option<T>) -> Self
560 where
561 T: std::convert::Into<crate::model::FrameworkAudit>,
562 {
563 self.framework_audit = v.map(|x| x.into());
564 self
565 }
566}
567
568impl wkt::message::Message for CreateFrameworkAuditRequest {
569 fn typename() -> &'static str {
570 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CreateFrameworkAuditRequest"
571 }
572}
573
574/// A destination for the framework audit.
575#[derive(Clone, Default, PartialEq)]
576#[non_exhaustive]
577pub struct FrameworkAuditDestination {
578 /// The type of destination.
579 pub destination_type:
580 std::option::Option<crate::model::framework_audit_destination::DestinationType>,
581
582 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
583}
584
585impl FrameworkAuditDestination {
586 pub fn new() -> Self {
587 std::default::Default::default()
588 }
589
590 /// Sets the value of [destination_type][crate::model::FrameworkAuditDestination::destination_type].
591 ///
592 /// Note that all the setters affecting `destination_type` are mutually
593 /// exclusive.
594 ///
595 /// # Example
596 /// ```ignore,no_run
597 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAuditDestination;
598 /// use google_cloud_cloudsecuritycompliance_v1::model::BucketDestination;
599 /// let x = FrameworkAuditDestination::new().set_destination_type(Some(
600 /// google_cloud_cloudsecuritycompliance_v1::model::framework_audit_destination::DestinationType::Bucket(BucketDestination::default().into())));
601 /// ```
602 pub fn set_destination_type<
603 T: std::convert::Into<
604 std::option::Option<crate::model::framework_audit_destination::DestinationType>,
605 >,
606 >(
607 mut self,
608 v: T,
609 ) -> Self {
610 self.destination_type = v.into();
611 self
612 }
613
614 /// The value of [destination_type][crate::model::FrameworkAuditDestination::destination_type]
615 /// if it holds a `Bucket`, `None` if the field is not set or
616 /// holds a different branch.
617 pub fn bucket(&self) -> std::option::Option<&std::boxed::Box<crate::model::BucketDestination>> {
618 #[allow(unreachable_patterns)]
619 self.destination_type.as_ref().and_then(|v| match v {
620 crate::model::framework_audit_destination::DestinationType::Bucket(v) => {
621 std::option::Option::Some(v)
622 }
623 _ => std::option::Option::None,
624 })
625 }
626
627 /// Sets the value of [destination_type][crate::model::FrameworkAuditDestination::destination_type]
628 /// to hold a `Bucket`.
629 ///
630 /// Note that all the setters affecting `destination_type` are
631 /// mutually exclusive.
632 ///
633 /// # Example
634 /// ```ignore,no_run
635 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAuditDestination;
636 /// use google_cloud_cloudsecuritycompliance_v1::model::BucketDestination;
637 /// let x = FrameworkAuditDestination::new().set_bucket(BucketDestination::default()/* use setters */);
638 /// assert!(x.bucket().is_some());
639 /// ```
640 pub fn set_bucket<T: std::convert::Into<std::boxed::Box<crate::model::BucketDestination>>>(
641 mut self,
642 v: T,
643 ) -> Self {
644 self.destination_type = std::option::Option::Some(
645 crate::model::framework_audit_destination::DestinationType::Bucket(v.into()),
646 );
647 self
648 }
649}
650
651impl wkt::message::Message for FrameworkAuditDestination {
652 fn typename() -> &'static str {
653 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FrameworkAuditDestination"
654 }
655}
656
657/// Defines additional types related to [FrameworkAuditDestination].
658pub mod framework_audit_destination {
659 #[allow(unused_imports)]
660 use super::*;
661
662 /// The type of destination.
663 #[derive(Clone, Debug, PartialEq)]
664 #[non_exhaustive]
665 pub enum DestinationType {
666 /// The Cloud Storage bucket destination.
667 Bucket(std::boxed::Box<crate::model::BucketDestination>),
668 }
669}
670
671/// A Cloud Storage bucket destination.
672#[derive(Clone, Default, PartialEq)]
673#[non_exhaustive]
674pub struct BucketDestination {
675 /// Required. The URI of the Cloud Storage bucket.
676 pub bucket_uri: std::string::String,
677
678 /// Optional. The format of the framework audit.
679 pub framework_audit_format: crate::model::bucket_destination::Format,
680
681 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
682}
683
684impl BucketDestination {
685 pub fn new() -> Self {
686 std::default::Default::default()
687 }
688
689 /// Sets the value of [bucket_uri][crate::model::BucketDestination::bucket_uri].
690 ///
691 /// # Example
692 /// ```ignore,no_run
693 /// # use google_cloud_cloudsecuritycompliance_v1::model::BucketDestination;
694 /// let x = BucketDestination::new().set_bucket_uri("example");
695 /// ```
696 pub fn set_bucket_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
697 self.bucket_uri = v.into();
698 self
699 }
700
701 /// Sets the value of [framework_audit_format][crate::model::BucketDestination::framework_audit_format].
702 ///
703 /// # Example
704 /// ```ignore,no_run
705 /// # use google_cloud_cloudsecuritycompliance_v1::model::BucketDestination;
706 /// use google_cloud_cloudsecuritycompliance_v1::model::bucket_destination::Format;
707 /// let x0 = BucketDestination::new().set_framework_audit_format(Format::Odf);
708 /// ```
709 pub fn set_framework_audit_format<
710 T: std::convert::Into<crate::model::bucket_destination::Format>,
711 >(
712 mut self,
713 v: T,
714 ) -> Self {
715 self.framework_audit_format = v.into();
716 self
717 }
718}
719
720impl wkt::message::Message for BucketDestination {
721 fn typename() -> &'static str {
722 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.BucketDestination"
723 }
724}
725
726/// Defines additional types related to [BucketDestination].
727pub mod bucket_destination {
728 #[allow(unused_imports)]
729 use super::*;
730
731 /// The set of options for the framework audit format.
732 ///
733 /// # Working with unknown values
734 ///
735 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
736 /// additional enum variants at any time. Adding new variants is not considered
737 /// a breaking change. Applications should write their code in anticipation of:
738 ///
739 /// - New values appearing in future releases of the client library, **and**
740 /// - New values received dynamically, without application changes.
741 ///
742 /// Please consult the [Working with enums] section in the user guide for some
743 /// guidelines.
744 ///
745 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
746 #[derive(Clone, Debug, PartialEq)]
747 #[non_exhaustive]
748 pub enum Format {
749 /// Default value. This value is unused.
750 Unspecified,
751 /// The format for the framework audit report is Open Document.
752 Odf,
753 /// If set, the enum was initialized with an unknown value.
754 ///
755 /// Applications can examine the value using [Format::value] or
756 /// [Format::name].
757 UnknownValue(format::UnknownValue),
758 }
759
760 #[doc(hidden)]
761 pub mod format {
762 #[allow(unused_imports)]
763 use super::*;
764 #[derive(Clone, Debug, PartialEq)]
765 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
766 }
767
768 impl Format {
769 /// Gets the enum value.
770 ///
771 /// Returns `None` if the enum contains an unknown value deserialized from
772 /// the string representation of enums.
773 pub fn value(&self) -> std::option::Option<i32> {
774 match self {
775 Self::Unspecified => std::option::Option::Some(0),
776 Self::Odf => std::option::Option::Some(1),
777 Self::UnknownValue(u) => u.0.value(),
778 }
779 }
780
781 /// Gets the enum value as a string.
782 ///
783 /// Returns `None` if the enum contains an unknown value deserialized from
784 /// the integer representation of enums.
785 pub fn name(&self) -> std::option::Option<&str> {
786 match self {
787 Self::Unspecified => std::option::Option::Some("FORMAT_UNSPECIFIED"),
788 Self::Odf => std::option::Option::Some("ODF"),
789 Self::UnknownValue(u) => u.0.name(),
790 }
791 }
792 }
793
794 impl std::default::Default for Format {
795 fn default() -> Self {
796 use std::convert::From;
797 Self::from(0)
798 }
799 }
800
801 impl std::fmt::Display for Format {
802 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
803 wkt::internal::display_enum(f, self.name(), self.value())
804 }
805 }
806
807 impl std::convert::From<i32> for Format {
808 fn from(value: i32) -> Self {
809 match value {
810 0 => Self::Unspecified,
811 1 => Self::Odf,
812 _ => Self::UnknownValue(format::UnknownValue(
813 wkt::internal::UnknownEnumValue::Integer(value),
814 )),
815 }
816 }
817 }
818
819 impl std::convert::From<&str> for Format {
820 fn from(value: &str) -> Self {
821 use std::string::ToString;
822 match value {
823 "FORMAT_UNSPECIFIED" => Self::Unspecified,
824 "ODF" => Self::Odf,
825 _ => Self::UnknownValue(format::UnknownValue(
826 wkt::internal::UnknownEnumValue::String(value.to_string()),
827 )),
828 }
829 }
830 }
831
832 impl serde::ser::Serialize for Format {
833 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
834 where
835 S: serde::Serializer,
836 {
837 match self {
838 Self::Unspecified => serializer.serialize_i32(0),
839 Self::Odf => serializer.serialize_i32(1),
840 Self::UnknownValue(u) => u.0.serialize(serializer),
841 }
842 }
843 }
844
845 impl<'de> serde::de::Deserialize<'de> for Format {
846 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
847 where
848 D: serde::Deserializer<'de>,
849 {
850 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Format>::new(
851 ".google.cloud.cloudsecuritycompliance.v1.BucketDestination.Format",
852 ))
853 }
854 }
855}
856
857/// A framework audit.
858#[derive(Clone, Default, PartialEq)]
859#[non_exhaustive]
860pub struct FrameworkAudit {
861 /// Output only. Identifier. The name of the framework audit.
862 pub name: std::string::String,
863
864 /// Output only. The ID of the framework audit.
865 pub framework_audit_id: std::string::String,
866
867 /// Output only. The compliance framework used for the audit.
868 pub compliance_framework: std::string::String,
869
870 /// Output only. The scope of the audit.
871 pub scope: std::string::String,
872
873 /// Required. The destination for the audit reports.
874 pub framework_audit_destination: std::option::Option<crate::model::FrameworkAuditDestination>,
875
876 /// Output only. The time that the audit started.
877 pub start_time: std::option::Option<wkt::Timestamp>,
878
879 /// Output only. The time that the audit finished.
880 pub finish_time: std::option::Option<wkt::Timestamp>,
881
882 /// Output only. The overall compliance state of the audit.
883 pub compliance_state: crate::model::ComplianceState,
884
885 /// Output only. The summary of the report.
886 pub report_summary: std::option::Option<crate::model::ReportSummary>,
887
888 /// Optional. The details for the cloud control groups within this audit.
889 pub cloud_control_group_audit_details:
890 std::vec::Vec<crate::model::CloudControlGroupAuditDetails>,
891
892 /// Optional. The details for the cloud controls within this audit.
893 pub cloud_control_audit_details: std::vec::Vec<crate::model::CloudControlAuditDetails>,
894
895 /// Output only. The ID of the long-running operation.
896 pub operation_id: std::string::String,
897
898 /// Output only. The framework audit state of the audit.
899 pub state: crate::model::framework_audit::State,
900
901 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
902}
903
904impl FrameworkAudit {
905 pub fn new() -> Self {
906 std::default::Default::default()
907 }
908
909 /// Sets the value of [name][crate::model::FrameworkAudit::name].
910 ///
911 /// # Example
912 /// ```ignore,no_run
913 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
914 /// let x = FrameworkAudit::new().set_name("example");
915 /// ```
916 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
917 self.name = v.into();
918 self
919 }
920
921 /// Sets the value of [framework_audit_id][crate::model::FrameworkAudit::framework_audit_id].
922 ///
923 /// # Example
924 /// ```ignore,no_run
925 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
926 /// let x = FrameworkAudit::new().set_framework_audit_id("example");
927 /// ```
928 pub fn set_framework_audit_id<T: std::convert::Into<std::string::String>>(
929 mut self,
930 v: T,
931 ) -> Self {
932 self.framework_audit_id = v.into();
933 self
934 }
935
936 /// Sets the value of [compliance_framework][crate::model::FrameworkAudit::compliance_framework].
937 ///
938 /// # Example
939 /// ```ignore,no_run
940 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
941 /// let x = FrameworkAudit::new().set_compliance_framework("example");
942 /// ```
943 pub fn set_compliance_framework<T: std::convert::Into<std::string::String>>(
944 mut self,
945 v: T,
946 ) -> Self {
947 self.compliance_framework = v.into();
948 self
949 }
950
951 /// Sets the value of [scope][crate::model::FrameworkAudit::scope].
952 ///
953 /// # Example
954 /// ```ignore,no_run
955 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
956 /// let x = FrameworkAudit::new().set_scope("example");
957 /// ```
958 pub fn set_scope<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
959 self.scope = v.into();
960 self
961 }
962
963 /// Sets the value of [framework_audit_destination][crate::model::FrameworkAudit::framework_audit_destination].
964 ///
965 /// # Example
966 /// ```ignore,no_run
967 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
968 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAuditDestination;
969 /// let x = FrameworkAudit::new().set_framework_audit_destination(FrameworkAuditDestination::default()/* use setters */);
970 /// ```
971 pub fn set_framework_audit_destination<T>(mut self, v: T) -> Self
972 where
973 T: std::convert::Into<crate::model::FrameworkAuditDestination>,
974 {
975 self.framework_audit_destination = std::option::Option::Some(v.into());
976 self
977 }
978
979 /// Sets or clears the value of [framework_audit_destination][crate::model::FrameworkAudit::framework_audit_destination].
980 ///
981 /// # Example
982 /// ```ignore,no_run
983 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
984 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAuditDestination;
985 /// let x = FrameworkAudit::new().set_or_clear_framework_audit_destination(Some(FrameworkAuditDestination::default()/* use setters */));
986 /// let x = FrameworkAudit::new().set_or_clear_framework_audit_destination(None::<FrameworkAuditDestination>);
987 /// ```
988 pub fn set_or_clear_framework_audit_destination<T>(mut self, v: std::option::Option<T>) -> Self
989 where
990 T: std::convert::Into<crate::model::FrameworkAuditDestination>,
991 {
992 self.framework_audit_destination = v.map(|x| x.into());
993 self
994 }
995
996 /// Sets the value of [start_time][crate::model::FrameworkAudit::start_time].
997 ///
998 /// # Example
999 /// ```ignore,no_run
1000 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1001 /// use wkt::Timestamp;
1002 /// let x = FrameworkAudit::new().set_start_time(Timestamp::default()/* use setters */);
1003 /// ```
1004 pub fn set_start_time<T>(mut self, v: T) -> Self
1005 where
1006 T: std::convert::Into<wkt::Timestamp>,
1007 {
1008 self.start_time = std::option::Option::Some(v.into());
1009 self
1010 }
1011
1012 /// Sets or clears the value of [start_time][crate::model::FrameworkAudit::start_time].
1013 ///
1014 /// # Example
1015 /// ```ignore,no_run
1016 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1017 /// use wkt::Timestamp;
1018 /// let x = FrameworkAudit::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
1019 /// let x = FrameworkAudit::new().set_or_clear_start_time(None::<Timestamp>);
1020 /// ```
1021 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
1022 where
1023 T: std::convert::Into<wkt::Timestamp>,
1024 {
1025 self.start_time = v.map(|x| x.into());
1026 self
1027 }
1028
1029 /// Sets the value of [finish_time][crate::model::FrameworkAudit::finish_time].
1030 ///
1031 /// # Example
1032 /// ```ignore,no_run
1033 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1034 /// use wkt::Timestamp;
1035 /// let x = FrameworkAudit::new().set_finish_time(Timestamp::default()/* use setters */);
1036 /// ```
1037 pub fn set_finish_time<T>(mut self, v: T) -> Self
1038 where
1039 T: std::convert::Into<wkt::Timestamp>,
1040 {
1041 self.finish_time = std::option::Option::Some(v.into());
1042 self
1043 }
1044
1045 /// Sets or clears the value of [finish_time][crate::model::FrameworkAudit::finish_time].
1046 ///
1047 /// # Example
1048 /// ```ignore,no_run
1049 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1050 /// use wkt::Timestamp;
1051 /// let x = FrameworkAudit::new().set_or_clear_finish_time(Some(Timestamp::default()/* use setters */));
1052 /// let x = FrameworkAudit::new().set_or_clear_finish_time(None::<Timestamp>);
1053 /// ```
1054 pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
1055 where
1056 T: std::convert::Into<wkt::Timestamp>,
1057 {
1058 self.finish_time = v.map(|x| x.into());
1059 self
1060 }
1061
1062 /// Sets the value of [compliance_state][crate::model::FrameworkAudit::compliance_state].
1063 ///
1064 /// # Example
1065 /// ```ignore,no_run
1066 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1067 /// use google_cloud_cloudsecuritycompliance_v1::model::ComplianceState;
1068 /// let x0 = FrameworkAudit::new().set_compliance_state(ComplianceState::Compliant);
1069 /// let x1 = FrameworkAudit::new().set_compliance_state(ComplianceState::Violation);
1070 /// let x2 = FrameworkAudit::new().set_compliance_state(ComplianceState::ManualReviewNeeded);
1071 /// ```
1072 pub fn set_compliance_state<T: std::convert::Into<crate::model::ComplianceState>>(
1073 mut self,
1074 v: T,
1075 ) -> Self {
1076 self.compliance_state = v.into();
1077 self
1078 }
1079
1080 /// Sets the value of [report_summary][crate::model::FrameworkAudit::report_summary].
1081 ///
1082 /// # Example
1083 /// ```ignore,no_run
1084 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1085 /// use google_cloud_cloudsecuritycompliance_v1::model::ReportSummary;
1086 /// let x = FrameworkAudit::new().set_report_summary(ReportSummary::default()/* use setters */);
1087 /// ```
1088 pub fn set_report_summary<T>(mut self, v: T) -> Self
1089 where
1090 T: std::convert::Into<crate::model::ReportSummary>,
1091 {
1092 self.report_summary = std::option::Option::Some(v.into());
1093 self
1094 }
1095
1096 /// Sets or clears the value of [report_summary][crate::model::FrameworkAudit::report_summary].
1097 ///
1098 /// # Example
1099 /// ```ignore,no_run
1100 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1101 /// use google_cloud_cloudsecuritycompliance_v1::model::ReportSummary;
1102 /// let x = FrameworkAudit::new().set_or_clear_report_summary(Some(ReportSummary::default()/* use setters */));
1103 /// let x = FrameworkAudit::new().set_or_clear_report_summary(None::<ReportSummary>);
1104 /// ```
1105 pub fn set_or_clear_report_summary<T>(mut self, v: std::option::Option<T>) -> Self
1106 where
1107 T: std::convert::Into<crate::model::ReportSummary>,
1108 {
1109 self.report_summary = v.map(|x| x.into());
1110 self
1111 }
1112
1113 /// Sets the value of [cloud_control_group_audit_details][crate::model::FrameworkAudit::cloud_control_group_audit_details].
1114 ///
1115 /// # Example
1116 /// ```ignore,no_run
1117 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1118 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1119 /// let x = FrameworkAudit::new()
1120 /// .set_cloud_control_group_audit_details([
1121 /// CloudControlGroupAuditDetails::default()/* use setters */,
1122 /// CloudControlGroupAuditDetails::default()/* use (different) setters */,
1123 /// ]);
1124 /// ```
1125 pub fn set_cloud_control_group_audit_details<T, V>(mut self, v: T) -> Self
1126 where
1127 T: std::iter::IntoIterator<Item = V>,
1128 V: std::convert::Into<crate::model::CloudControlGroupAuditDetails>,
1129 {
1130 use std::iter::Iterator;
1131 self.cloud_control_group_audit_details = v.into_iter().map(|i| i.into()).collect();
1132 self
1133 }
1134
1135 /// Sets the value of [cloud_control_audit_details][crate::model::FrameworkAudit::cloud_control_audit_details].
1136 ///
1137 /// # Example
1138 /// ```ignore,no_run
1139 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1140 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAuditDetails;
1141 /// let x = FrameworkAudit::new()
1142 /// .set_cloud_control_audit_details([
1143 /// CloudControlAuditDetails::default()/* use setters */,
1144 /// CloudControlAuditDetails::default()/* use (different) setters */,
1145 /// ]);
1146 /// ```
1147 pub fn set_cloud_control_audit_details<T, V>(mut self, v: T) -> Self
1148 where
1149 T: std::iter::IntoIterator<Item = V>,
1150 V: std::convert::Into<crate::model::CloudControlAuditDetails>,
1151 {
1152 use std::iter::Iterator;
1153 self.cloud_control_audit_details = v.into_iter().map(|i| i.into()).collect();
1154 self
1155 }
1156
1157 /// Sets the value of [operation_id][crate::model::FrameworkAudit::operation_id].
1158 ///
1159 /// # Example
1160 /// ```ignore,no_run
1161 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1162 /// let x = FrameworkAudit::new().set_operation_id("example");
1163 /// ```
1164 pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1165 self.operation_id = v.into();
1166 self
1167 }
1168
1169 /// Sets the value of [state][crate::model::FrameworkAudit::state].
1170 ///
1171 /// # Example
1172 /// ```ignore,no_run
1173 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1174 /// use google_cloud_cloudsecuritycompliance_v1::model::framework_audit::State;
1175 /// let x0 = FrameworkAudit::new().set_state(State::Scheduled);
1176 /// let x1 = FrameworkAudit::new().set_state(State::Running);
1177 /// let x2 = FrameworkAudit::new().set_state(State::Uploading);
1178 /// ```
1179 pub fn set_state<T: std::convert::Into<crate::model::framework_audit::State>>(
1180 mut self,
1181 v: T,
1182 ) -> Self {
1183 self.state = v.into();
1184 self
1185 }
1186}
1187
1188impl wkt::message::Message for FrameworkAudit {
1189 fn typename() -> &'static str {
1190 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FrameworkAudit"
1191 }
1192}
1193
1194/// Defines additional types related to [FrameworkAudit].
1195pub mod framework_audit {
1196 #[allow(unused_imports)]
1197 use super::*;
1198
1199 /// The state of the framework audit.
1200 ///
1201 /// # Working with unknown values
1202 ///
1203 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1204 /// additional enum variants at any time. Adding new variants is not considered
1205 /// a breaking change. Applications should write their code in anticipation of:
1206 ///
1207 /// - New values appearing in future releases of the client library, **and**
1208 /// - New values received dynamically, without application changes.
1209 ///
1210 /// Please consult the [Working with enums] section in the user guide for some
1211 /// guidelines.
1212 ///
1213 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1214 #[derive(Clone, Debug, PartialEq)]
1215 #[non_exhaustive]
1216 pub enum State {
1217 /// Default value. This value is unused.
1218 Unspecified,
1219 /// The audit is scheduled.
1220 Scheduled,
1221 /// The audit is running.
1222 Running,
1223 /// The audit results are being uploaded.
1224 Uploading,
1225 /// The audit failed.
1226 Failed,
1227 /// The audit completed successfully.
1228 Succeeded,
1229 /// If set, the enum was initialized with an unknown value.
1230 ///
1231 /// Applications can examine the value using [State::value] or
1232 /// [State::name].
1233 UnknownValue(state::UnknownValue),
1234 }
1235
1236 #[doc(hidden)]
1237 pub mod state {
1238 #[allow(unused_imports)]
1239 use super::*;
1240 #[derive(Clone, Debug, PartialEq)]
1241 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1242 }
1243
1244 impl State {
1245 /// Gets the enum value.
1246 ///
1247 /// Returns `None` if the enum contains an unknown value deserialized from
1248 /// the string representation of enums.
1249 pub fn value(&self) -> std::option::Option<i32> {
1250 match self {
1251 Self::Unspecified => std::option::Option::Some(0),
1252 Self::Scheduled => std::option::Option::Some(1),
1253 Self::Running => std::option::Option::Some(2),
1254 Self::Uploading => std::option::Option::Some(3),
1255 Self::Failed => std::option::Option::Some(4),
1256 Self::Succeeded => std::option::Option::Some(5),
1257 Self::UnknownValue(u) => u.0.value(),
1258 }
1259 }
1260
1261 /// Gets the enum value as a string.
1262 ///
1263 /// Returns `None` if the enum contains an unknown value deserialized from
1264 /// the integer representation of enums.
1265 pub fn name(&self) -> std::option::Option<&str> {
1266 match self {
1267 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1268 Self::Scheduled => std::option::Option::Some("SCHEDULED"),
1269 Self::Running => std::option::Option::Some("RUNNING"),
1270 Self::Uploading => std::option::Option::Some("UPLOADING"),
1271 Self::Failed => std::option::Option::Some("FAILED"),
1272 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
1273 Self::UnknownValue(u) => u.0.name(),
1274 }
1275 }
1276 }
1277
1278 impl std::default::Default for State {
1279 fn default() -> Self {
1280 use std::convert::From;
1281 Self::from(0)
1282 }
1283 }
1284
1285 impl std::fmt::Display for State {
1286 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1287 wkt::internal::display_enum(f, self.name(), self.value())
1288 }
1289 }
1290
1291 impl std::convert::From<i32> for State {
1292 fn from(value: i32) -> Self {
1293 match value {
1294 0 => Self::Unspecified,
1295 1 => Self::Scheduled,
1296 2 => Self::Running,
1297 3 => Self::Uploading,
1298 4 => Self::Failed,
1299 5 => Self::Succeeded,
1300 _ => Self::UnknownValue(state::UnknownValue(
1301 wkt::internal::UnknownEnumValue::Integer(value),
1302 )),
1303 }
1304 }
1305 }
1306
1307 impl std::convert::From<&str> for State {
1308 fn from(value: &str) -> Self {
1309 use std::string::ToString;
1310 match value {
1311 "STATE_UNSPECIFIED" => Self::Unspecified,
1312 "SCHEDULED" => Self::Scheduled,
1313 "RUNNING" => Self::Running,
1314 "UPLOADING" => Self::Uploading,
1315 "FAILED" => Self::Failed,
1316 "SUCCEEDED" => Self::Succeeded,
1317 _ => Self::UnknownValue(state::UnknownValue(
1318 wkt::internal::UnknownEnumValue::String(value.to_string()),
1319 )),
1320 }
1321 }
1322 }
1323
1324 impl serde::ser::Serialize for State {
1325 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1326 where
1327 S: serde::Serializer,
1328 {
1329 match self {
1330 Self::Unspecified => serializer.serialize_i32(0),
1331 Self::Scheduled => serializer.serialize_i32(1),
1332 Self::Running => serializer.serialize_i32(2),
1333 Self::Uploading => serializer.serialize_i32(3),
1334 Self::Failed => serializer.serialize_i32(4),
1335 Self::Succeeded => serializer.serialize_i32(5),
1336 Self::UnknownValue(u) => u.0.serialize(serializer),
1337 }
1338 }
1339 }
1340
1341 impl<'de> serde::de::Deserialize<'de> for State {
1342 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1343 where
1344 D: serde::Deserializer<'de>,
1345 {
1346 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1347 ".google.cloud.cloudsecuritycompliance.v1.FrameworkAudit.State",
1348 ))
1349 }
1350 }
1351}
1352
1353/// The request message for [ListFrameworkAudits][].
1354#[derive(Clone, Default, PartialEq)]
1355#[non_exhaustive]
1356pub struct ListFrameworkAuditsRequest {
1357 /// Required. The parent resource where the framework audits are listed.
1358 ///
1359 /// Supported formats are the following:
1360 ///
1361 /// * `organizations/{organization_id}/locations/{location}`
1362 /// * `folders/{folder_id}/locations/{location}`
1363 /// * `projects/{project_id}/locations/{location}`
1364 pub parent: std::string::String,
1365
1366 /// Optional. The maximum number of framework audits to return. The service
1367 /// might return fewer audits than this value. If unspecified, a maximum of 10
1368 /// framework audits are returned. The maximum value is 50; values above 50 are
1369 /// limited to 50.
1370 pub page_size: i32,
1371
1372 /// Optional. The `next_page_token` value that's returned from a previous list
1373 /// request, if any.
1374 pub page_token: std::string::String,
1375
1376 /// Optional. The filters to apply to the framework audits.
1377 /// Supported filters are `compliance_framework`, `compliance_state`,
1378 /// `create_time,` and `framework_audit_name`. If the filter is invalid, an
1379 /// invalid argument error is returned.
1380 /// For syntax details, see [AIP-160][<https://google.aip.dev/160>].
1381 pub filter: std::string::String,
1382
1383 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1384}
1385
1386impl ListFrameworkAuditsRequest {
1387 pub fn new() -> Self {
1388 std::default::Default::default()
1389 }
1390
1391 /// Sets the value of [parent][crate::model::ListFrameworkAuditsRequest::parent].
1392 ///
1393 /// # Example
1394 /// ```ignore,no_run
1395 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkAuditsRequest;
1396 /// let x = ListFrameworkAuditsRequest::new().set_parent("example");
1397 /// ```
1398 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1399 self.parent = v.into();
1400 self
1401 }
1402
1403 /// Sets the value of [page_size][crate::model::ListFrameworkAuditsRequest::page_size].
1404 ///
1405 /// # Example
1406 /// ```ignore,no_run
1407 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkAuditsRequest;
1408 /// let x = ListFrameworkAuditsRequest::new().set_page_size(42);
1409 /// ```
1410 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1411 self.page_size = v.into();
1412 self
1413 }
1414
1415 /// Sets the value of [page_token][crate::model::ListFrameworkAuditsRequest::page_token].
1416 ///
1417 /// # Example
1418 /// ```ignore,no_run
1419 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkAuditsRequest;
1420 /// let x = ListFrameworkAuditsRequest::new().set_page_token("example");
1421 /// ```
1422 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1423 self.page_token = v.into();
1424 self
1425 }
1426
1427 /// Sets the value of [filter][crate::model::ListFrameworkAuditsRequest::filter].
1428 ///
1429 /// # Example
1430 /// ```ignore,no_run
1431 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkAuditsRequest;
1432 /// let x = ListFrameworkAuditsRequest::new().set_filter("example");
1433 /// ```
1434 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1435 self.filter = v.into();
1436 self
1437 }
1438}
1439
1440impl wkt::message::Message for ListFrameworkAuditsRequest {
1441 fn typename() -> &'static str {
1442 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFrameworkAuditsRequest"
1443 }
1444}
1445
1446/// The response message for [ListFrameworkAudits][].
1447#[derive(Clone, Default, PartialEq)]
1448#[non_exhaustive]
1449pub struct ListFrameworkAuditsResponse {
1450 /// The framework audits.
1451 pub framework_audits: std::vec::Vec<crate::model::FrameworkAudit>,
1452
1453 /// A token, which you can send as the `page_token` to retrieve the next page.
1454 /// If this field is omitted, there are no subsequent pages.
1455 pub next_page_token: std::string::String,
1456
1457 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1458}
1459
1460impl ListFrameworkAuditsResponse {
1461 pub fn new() -> Self {
1462 std::default::Default::default()
1463 }
1464
1465 /// Sets the value of [framework_audits][crate::model::ListFrameworkAuditsResponse::framework_audits].
1466 ///
1467 /// # Example
1468 /// ```ignore,no_run
1469 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkAuditsResponse;
1470 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1471 /// let x = ListFrameworkAuditsResponse::new()
1472 /// .set_framework_audits([
1473 /// FrameworkAudit::default()/* use setters */,
1474 /// FrameworkAudit::default()/* use (different) setters */,
1475 /// ]);
1476 /// ```
1477 pub fn set_framework_audits<T, V>(mut self, v: T) -> Self
1478 where
1479 T: std::iter::IntoIterator<Item = V>,
1480 V: std::convert::Into<crate::model::FrameworkAudit>,
1481 {
1482 use std::iter::Iterator;
1483 self.framework_audits = v.into_iter().map(|i| i.into()).collect();
1484 self
1485 }
1486
1487 /// Sets the value of [next_page_token][crate::model::ListFrameworkAuditsResponse::next_page_token].
1488 ///
1489 /// # Example
1490 /// ```ignore,no_run
1491 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkAuditsResponse;
1492 /// let x = ListFrameworkAuditsResponse::new().set_next_page_token("example");
1493 /// ```
1494 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1495 self.next_page_token = v.into();
1496 self
1497 }
1498}
1499
1500impl wkt::message::Message for ListFrameworkAuditsResponse {
1501 fn typename() -> &'static str {
1502 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFrameworkAuditsResponse"
1503 }
1504}
1505
1506#[doc(hidden)]
1507impl google_cloud_gax::paginator::internal::PageableResponse for ListFrameworkAuditsResponse {
1508 type PageItem = crate::model::FrameworkAudit;
1509
1510 fn items(self) -> std::vec::Vec<Self::PageItem> {
1511 self.framework_audits
1512 }
1513
1514 fn next_page_token(&self) -> std::string::String {
1515 use std::clone::Clone;
1516 self.next_page_token.clone()
1517 }
1518}
1519
1520/// The request message for [GetFrameworkAudit][].
1521#[derive(Clone, Default, PartialEq)]
1522#[non_exhaustive]
1523pub struct GetFrameworkAuditRequest {
1524 /// Required. The name of the framework audit to retrieve.
1525 ///
1526 /// Supported formats are the following:
1527 ///
1528 /// * `organizations/{organization_id}/locations/{location}/frameworkAudits/{frameworkAuditName}`
1529 /// * `folders/{folder_id}/locations/{location}/frameworkAudits/{frameworkAuditName}`
1530 /// * `projects/{project_id}/locations/{location}/frameworkAudits/{frameworkAuditName}`
1531 pub name: std::string::String,
1532
1533 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1534}
1535
1536impl GetFrameworkAuditRequest {
1537 pub fn new() -> Self {
1538 std::default::Default::default()
1539 }
1540
1541 /// Sets the value of [name][crate::model::GetFrameworkAuditRequest::name].
1542 ///
1543 /// # Example
1544 /// ```ignore,no_run
1545 /// # use google_cloud_cloudsecuritycompliance_v1::model::GetFrameworkAuditRequest;
1546 /// let x = GetFrameworkAuditRequest::new().set_name("example");
1547 /// ```
1548 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1549 self.name = v.into();
1550 self
1551 }
1552}
1553
1554impl wkt::message::Message for GetFrameworkAuditRequest {
1555 fn typename() -> &'static str {
1556 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.GetFrameworkAuditRequest"
1557 }
1558}
1559
1560/// The details for a cloud control group.
1561#[derive(Clone, Default, PartialEq)]
1562#[non_exhaustive]
1563pub struct CloudControlGroupAuditDetails {
1564 /// Output only. The ID of the cloud control group.
1565 pub cloud_control_group_id: std::string::String,
1566
1567 /// Output only. The display name of the cloud control group.
1568 pub display_name: std::string::String,
1569
1570 /// Output only. The description of the cloud control group.
1571 pub description: std::string::String,
1572
1573 /// Output only. The responsibility type.
1574 pub responsibility_type: std::string::String,
1575
1576 /// Output only. The description of Google's responsibility.
1577 pub google_responsibility_description: std::string::String,
1578
1579 /// Output only. The implementation of Google's responsibility.
1580 pub google_responsibility_implementation: std::string::String,
1581
1582 /// Output only. The description of your responsibility.
1583 pub customer_responsibility_description: std::string::String,
1584
1585 /// Output only. The implementation of your responsibility.
1586 pub customer_responsibility_implementation: std::string::String,
1587
1588 /// Output only. The compliance state of the control group.
1589 pub compliance_state: crate::model::ComplianceState,
1590
1591 /// Output only. The ID of the regulatory control.
1592 pub control_id: std::string::String,
1593
1594 /// Output only. The control family.
1595 pub control_family: std::option::Option<crate::model::ControlFamily>,
1596
1597 /// Output only. The details for the cloud controls within this group.
1598 pub cloud_control_details: std::vec::Vec<crate::model::CloudControlAuditDetails>,
1599
1600 /// Output only. The summary of the report.
1601 pub report_summary: std::option::Option<crate::model::ReportSummary>,
1602
1603 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1604}
1605
1606impl CloudControlGroupAuditDetails {
1607 pub fn new() -> Self {
1608 std::default::Default::default()
1609 }
1610
1611 /// Sets the value of [cloud_control_group_id][crate::model::CloudControlGroupAuditDetails::cloud_control_group_id].
1612 ///
1613 /// # Example
1614 /// ```ignore,no_run
1615 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1616 /// let x = CloudControlGroupAuditDetails::new().set_cloud_control_group_id("example");
1617 /// ```
1618 pub fn set_cloud_control_group_id<T: std::convert::Into<std::string::String>>(
1619 mut self,
1620 v: T,
1621 ) -> Self {
1622 self.cloud_control_group_id = v.into();
1623 self
1624 }
1625
1626 /// Sets the value of [display_name][crate::model::CloudControlGroupAuditDetails::display_name].
1627 ///
1628 /// # Example
1629 /// ```ignore,no_run
1630 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1631 /// let x = CloudControlGroupAuditDetails::new().set_display_name("example");
1632 /// ```
1633 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1634 self.display_name = v.into();
1635 self
1636 }
1637
1638 /// Sets the value of [description][crate::model::CloudControlGroupAuditDetails::description].
1639 ///
1640 /// # Example
1641 /// ```ignore,no_run
1642 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1643 /// let x = CloudControlGroupAuditDetails::new().set_description("example");
1644 /// ```
1645 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1646 self.description = v.into();
1647 self
1648 }
1649
1650 /// Sets the value of [responsibility_type][crate::model::CloudControlGroupAuditDetails::responsibility_type].
1651 ///
1652 /// # Example
1653 /// ```ignore,no_run
1654 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1655 /// let x = CloudControlGroupAuditDetails::new().set_responsibility_type("example");
1656 /// ```
1657 pub fn set_responsibility_type<T: std::convert::Into<std::string::String>>(
1658 mut self,
1659 v: T,
1660 ) -> Self {
1661 self.responsibility_type = v.into();
1662 self
1663 }
1664
1665 /// Sets the value of [google_responsibility_description][crate::model::CloudControlGroupAuditDetails::google_responsibility_description].
1666 ///
1667 /// # Example
1668 /// ```ignore,no_run
1669 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1670 /// let x = CloudControlGroupAuditDetails::new().set_google_responsibility_description("example");
1671 /// ```
1672 pub fn set_google_responsibility_description<T: std::convert::Into<std::string::String>>(
1673 mut self,
1674 v: T,
1675 ) -> Self {
1676 self.google_responsibility_description = v.into();
1677 self
1678 }
1679
1680 /// Sets the value of [google_responsibility_implementation][crate::model::CloudControlGroupAuditDetails::google_responsibility_implementation].
1681 ///
1682 /// # Example
1683 /// ```ignore,no_run
1684 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1685 /// let x = CloudControlGroupAuditDetails::new().set_google_responsibility_implementation("example");
1686 /// ```
1687 pub fn set_google_responsibility_implementation<T: std::convert::Into<std::string::String>>(
1688 mut self,
1689 v: T,
1690 ) -> Self {
1691 self.google_responsibility_implementation = v.into();
1692 self
1693 }
1694
1695 /// Sets the value of [customer_responsibility_description][crate::model::CloudControlGroupAuditDetails::customer_responsibility_description].
1696 ///
1697 /// # Example
1698 /// ```ignore,no_run
1699 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1700 /// let x = CloudControlGroupAuditDetails::new().set_customer_responsibility_description("example");
1701 /// ```
1702 pub fn set_customer_responsibility_description<T: std::convert::Into<std::string::String>>(
1703 mut self,
1704 v: T,
1705 ) -> Self {
1706 self.customer_responsibility_description = v.into();
1707 self
1708 }
1709
1710 /// Sets the value of [customer_responsibility_implementation][crate::model::CloudControlGroupAuditDetails::customer_responsibility_implementation].
1711 ///
1712 /// # Example
1713 /// ```ignore,no_run
1714 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1715 /// let x = CloudControlGroupAuditDetails::new().set_customer_responsibility_implementation("example");
1716 /// ```
1717 pub fn set_customer_responsibility_implementation<
1718 T: std::convert::Into<std::string::String>,
1719 >(
1720 mut self,
1721 v: T,
1722 ) -> Self {
1723 self.customer_responsibility_implementation = v.into();
1724 self
1725 }
1726
1727 /// Sets the value of [compliance_state][crate::model::CloudControlGroupAuditDetails::compliance_state].
1728 ///
1729 /// # Example
1730 /// ```ignore,no_run
1731 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1732 /// use google_cloud_cloudsecuritycompliance_v1::model::ComplianceState;
1733 /// let x0 = CloudControlGroupAuditDetails::new().set_compliance_state(ComplianceState::Compliant);
1734 /// let x1 = CloudControlGroupAuditDetails::new().set_compliance_state(ComplianceState::Violation);
1735 /// let x2 = CloudControlGroupAuditDetails::new().set_compliance_state(ComplianceState::ManualReviewNeeded);
1736 /// ```
1737 pub fn set_compliance_state<T: std::convert::Into<crate::model::ComplianceState>>(
1738 mut self,
1739 v: T,
1740 ) -> Self {
1741 self.compliance_state = v.into();
1742 self
1743 }
1744
1745 /// Sets the value of [control_id][crate::model::CloudControlGroupAuditDetails::control_id].
1746 ///
1747 /// # Example
1748 /// ```ignore,no_run
1749 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1750 /// let x = CloudControlGroupAuditDetails::new().set_control_id("example");
1751 /// ```
1752 pub fn set_control_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1753 self.control_id = v.into();
1754 self
1755 }
1756
1757 /// Sets the value of [control_family][crate::model::CloudControlGroupAuditDetails::control_family].
1758 ///
1759 /// # Example
1760 /// ```ignore,no_run
1761 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1762 /// use google_cloud_cloudsecuritycompliance_v1::model::ControlFamily;
1763 /// let x = CloudControlGroupAuditDetails::new().set_control_family(ControlFamily::default()/* use setters */);
1764 /// ```
1765 pub fn set_control_family<T>(mut self, v: T) -> Self
1766 where
1767 T: std::convert::Into<crate::model::ControlFamily>,
1768 {
1769 self.control_family = std::option::Option::Some(v.into());
1770 self
1771 }
1772
1773 /// Sets or clears the value of [control_family][crate::model::CloudControlGroupAuditDetails::control_family].
1774 ///
1775 /// # Example
1776 /// ```ignore,no_run
1777 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1778 /// use google_cloud_cloudsecuritycompliance_v1::model::ControlFamily;
1779 /// let x = CloudControlGroupAuditDetails::new().set_or_clear_control_family(Some(ControlFamily::default()/* use setters */));
1780 /// let x = CloudControlGroupAuditDetails::new().set_or_clear_control_family(None::<ControlFamily>);
1781 /// ```
1782 pub fn set_or_clear_control_family<T>(mut self, v: std::option::Option<T>) -> Self
1783 where
1784 T: std::convert::Into<crate::model::ControlFamily>,
1785 {
1786 self.control_family = v.map(|x| x.into());
1787 self
1788 }
1789
1790 /// Sets the value of [cloud_control_details][crate::model::CloudControlGroupAuditDetails::cloud_control_details].
1791 ///
1792 /// # Example
1793 /// ```ignore,no_run
1794 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1795 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAuditDetails;
1796 /// let x = CloudControlGroupAuditDetails::new()
1797 /// .set_cloud_control_details([
1798 /// CloudControlAuditDetails::default()/* use setters */,
1799 /// CloudControlAuditDetails::default()/* use (different) setters */,
1800 /// ]);
1801 /// ```
1802 pub fn set_cloud_control_details<T, V>(mut self, v: T) -> Self
1803 where
1804 T: std::iter::IntoIterator<Item = V>,
1805 V: std::convert::Into<crate::model::CloudControlAuditDetails>,
1806 {
1807 use std::iter::Iterator;
1808 self.cloud_control_details = v.into_iter().map(|i| i.into()).collect();
1809 self
1810 }
1811
1812 /// Sets the value of [report_summary][crate::model::CloudControlGroupAuditDetails::report_summary].
1813 ///
1814 /// # Example
1815 /// ```ignore,no_run
1816 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1817 /// use google_cloud_cloudsecuritycompliance_v1::model::ReportSummary;
1818 /// let x = CloudControlGroupAuditDetails::new().set_report_summary(ReportSummary::default()/* use setters */);
1819 /// ```
1820 pub fn set_report_summary<T>(mut self, v: T) -> Self
1821 where
1822 T: std::convert::Into<crate::model::ReportSummary>,
1823 {
1824 self.report_summary = std::option::Option::Some(v.into());
1825 self
1826 }
1827
1828 /// Sets or clears the value of [report_summary][crate::model::CloudControlGroupAuditDetails::report_summary].
1829 ///
1830 /// # Example
1831 /// ```ignore,no_run
1832 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1833 /// use google_cloud_cloudsecuritycompliance_v1::model::ReportSummary;
1834 /// let x = CloudControlGroupAuditDetails::new().set_or_clear_report_summary(Some(ReportSummary::default()/* use setters */));
1835 /// let x = CloudControlGroupAuditDetails::new().set_or_clear_report_summary(None::<ReportSummary>);
1836 /// ```
1837 pub fn set_or_clear_report_summary<T>(mut self, v: std::option::Option<T>) -> Self
1838 where
1839 T: std::convert::Into<crate::model::ReportSummary>,
1840 {
1841 self.report_summary = v.map(|x| x.into());
1842 self
1843 }
1844}
1845
1846impl wkt::message::Message for CloudControlGroupAuditDetails {
1847 fn typename() -> &'static str {
1848 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControlGroupAuditDetails"
1849 }
1850}
1851
1852/// The details for a finding.
1853#[derive(Clone, Default, PartialEq)]
1854#[non_exhaustive]
1855pub struct FindingDetails {
1856 /// Output only. The name of the finding.
1857 pub name: std::string::String,
1858
1859 /// Output only. The compliance state of the finding.
1860 pub compliance_state: crate::model::ComplianceState,
1861
1862 /// Output only. The observation details for the finding.
1863 pub observation: std::option::Option<crate::model::ObservationDetails>,
1864
1865 /// Output only. The evidence details for the finding.
1866 pub evidence: std::option::Option<crate::model::EvidenceDetails>,
1867
1868 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1869}
1870
1871impl FindingDetails {
1872 pub fn new() -> Self {
1873 std::default::Default::default()
1874 }
1875
1876 /// Sets the value of [name][crate::model::FindingDetails::name].
1877 ///
1878 /// # Example
1879 /// ```ignore,no_run
1880 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingDetails;
1881 /// let x = FindingDetails::new().set_name("example");
1882 /// ```
1883 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1884 self.name = v.into();
1885 self
1886 }
1887
1888 /// Sets the value of [compliance_state][crate::model::FindingDetails::compliance_state].
1889 ///
1890 /// # Example
1891 /// ```ignore,no_run
1892 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingDetails;
1893 /// use google_cloud_cloudsecuritycompliance_v1::model::ComplianceState;
1894 /// let x0 = FindingDetails::new().set_compliance_state(ComplianceState::Compliant);
1895 /// let x1 = FindingDetails::new().set_compliance_state(ComplianceState::Violation);
1896 /// let x2 = FindingDetails::new().set_compliance_state(ComplianceState::ManualReviewNeeded);
1897 /// ```
1898 pub fn set_compliance_state<T: std::convert::Into<crate::model::ComplianceState>>(
1899 mut self,
1900 v: T,
1901 ) -> Self {
1902 self.compliance_state = v.into();
1903 self
1904 }
1905
1906 /// Sets the value of [observation][crate::model::FindingDetails::observation].
1907 ///
1908 /// # Example
1909 /// ```ignore,no_run
1910 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingDetails;
1911 /// use google_cloud_cloudsecuritycompliance_v1::model::ObservationDetails;
1912 /// let x = FindingDetails::new().set_observation(ObservationDetails::default()/* use setters */);
1913 /// ```
1914 pub fn set_observation<T>(mut self, v: T) -> Self
1915 where
1916 T: std::convert::Into<crate::model::ObservationDetails>,
1917 {
1918 self.observation = std::option::Option::Some(v.into());
1919 self
1920 }
1921
1922 /// Sets or clears the value of [observation][crate::model::FindingDetails::observation].
1923 ///
1924 /// # Example
1925 /// ```ignore,no_run
1926 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingDetails;
1927 /// use google_cloud_cloudsecuritycompliance_v1::model::ObservationDetails;
1928 /// let x = FindingDetails::new().set_or_clear_observation(Some(ObservationDetails::default()/* use setters */));
1929 /// let x = FindingDetails::new().set_or_clear_observation(None::<ObservationDetails>);
1930 /// ```
1931 pub fn set_or_clear_observation<T>(mut self, v: std::option::Option<T>) -> Self
1932 where
1933 T: std::convert::Into<crate::model::ObservationDetails>,
1934 {
1935 self.observation = v.map(|x| x.into());
1936 self
1937 }
1938
1939 /// Sets the value of [evidence][crate::model::FindingDetails::evidence].
1940 ///
1941 /// # Example
1942 /// ```ignore,no_run
1943 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingDetails;
1944 /// use google_cloud_cloudsecuritycompliance_v1::model::EvidenceDetails;
1945 /// let x = FindingDetails::new().set_evidence(EvidenceDetails::default()/* use setters */);
1946 /// ```
1947 pub fn set_evidence<T>(mut self, v: T) -> Self
1948 where
1949 T: std::convert::Into<crate::model::EvidenceDetails>,
1950 {
1951 self.evidence = std::option::Option::Some(v.into());
1952 self
1953 }
1954
1955 /// Sets or clears the value of [evidence][crate::model::FindingDetails::evidence].
1956 ///
1957 /// # Example
1958 /// ```ignore,no_run
1959 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingDetails;
1960 /// use google_cloud_cloudsecuritycompliance_v1::model::EvidenceDetails;
1961 /// let x = FindingDetails::new().set_or_clear_evidence(Some(EvidenceDetails::default()/* use setters */));
1962 /// let x = FindingDetails::new().set_or_clear_evidence(None::<EvidenceDetails>);
1963 /// ```
1964 pub fn set_or_clear_evidence<T>(mut self, v: std::option::Option<T>) -> Self
1965 where
1966 T: std::convert::Into<crate::model::EvidenceDetails>,
1967 {
1968 self.evidence = v.map(|x| x.into());
1969 self
1970 }
1971}
1972
1973impl wkt::message::Message for FindingDetails {
1974 fn typename() -> &'static str {
1975 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FindingDetails"
1976 }
1977}
1978
1979/// The observation details for a finding.
1980#[derive(Clone, Default, PartialEq)]
1981#[non_exhaustive]
1982pub struct ObservationDetails {
1983 /// Output only. The current value.
1984 pub current_value: std::string::String,
1985
1986 /// Optional. The expected value.
1987 pub expected_value: std::string::String,
1988
1989 /// Output only. Any guidance for the observation.
1990 pub guidance: std::string::String,
1991
1992 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1993}
1994
1995impl ObservationDetails {
1996 pub fn new() -> Self {
1997 std::default::Default::default()
1998 }
1999
2000 /// Sets the value of [current_value][crate::model::ObservationDetails::current_value].
2001 ///
2002 /// # Example
2003 /// ```ignore,no_run
2004 /// # use google_cloud_cloudsecuritycompliance_v1::model::ObservationDetails;
2005 /// let x = ObservationDetails::new().set_current_value("example");
2006 /// ```
2007 pub fn set_current_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2008 self.current_value = v.into();
2009 self
2010 }
2011
2012 /// Sets the value of [expected_value][crate::model::ObservationDetails::expected_value].
2013 ///
2014 /// # Example
2015 /// ```ignore,no_run
2016 /// # use google_cloud_cloudsecuritycompliance_v1::model::ObservationDetails;
2017 /// let x = ObservationDetails::new().set_expected_value("example");
2018 /// ```
2019 pub fn set_expected_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2020 self.expected_value = v.into();
2021 self
2022 }
2023
2024 /// Sets the value of [guidance][crate::model::ObservationDetails::guidance].
2025 ///
2026 /// # Example
2027 /// ```ignore,no_run
2028 /// # use google_cloud_cloudsecuritycompliance_v1::model::ObservationDetails;
2029 /// let x = ObservationDetails::new().set_guidance("example");
2030 /// ```
2031 pub fn set_guidance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2032 self.guidance = v.into();
2033 self
2034 }
2035}
2036
2037impl wkt::message::Message for ObservationDetails {
2038 fn typename() -> &'static str {
2039 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ObservationDetails"
2040 }
2041}
2042
2043/// The evidence details for a finding.
2044#[derive(Clone, Default, PartialEq)]
2045#[non_exhaustive]
2046pub struct EvidenceDetails {
2047 /// Output only. The resource identifier.
2048 pub resource: std::string::String,
2049
2050 /// Output only. The service identifier.
2051 pub service: std::string::String,
2052
2053 /// Output only. The path to the evidence.
2054 pub evidence_path: std::string::String,
2055
2056 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2057}
2058
2059impl EvidenceDetails {
2060 pub fn new() -> Self {
2061 std::default::Default::default()
2062 }
2063
2064 /// Sets the value of [resource][crate::model::EvidenceDetails::resource].
2065 ///
2066 /// # Example
2067 /// ```ignore,no_run
2068 /// # use google_cloud_cloudsecuritycompliance_v1::model::EvidenceDetails;
2069 /// let x = EvidenceDetails::new().set_resource("example");
2070 /// ```
2071 pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2072 self.resource = v.into();
2073 self
2074 }
2075
2076 /// Sets the value of [service][crate::model::EvidenceDetails::service].
2077 ///
2078 /// # Example
2079 /// ```ignore,no_run
2080 /// # use google_cloud_cloudsecuritycompliance_v1::model::EvidenceDetails;
2081 /// let x = EvidenceDetails::new().set_service("example");
2082 /// ```
2083 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2084 self.service = v.into();
2085 self
2086 }
2087
2088 /// Sets the value of [evidence_path][crate::model::EvidenceDetails::evidence_path].
2089 ///
2090 /// # Example
2091 /// ```ignore,no_run
2092 /// # use google_cloud_cloudsecuritycompliance_v1::model::EvidenceDetails;
2093 /// let x = EvidenceDetails::new().set_evidence_path("example");
2094 /// ```
2095 pub fn set_evidence_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2096 self.evidence_path = v.into();
2097 self
2098 }
2099}
2100
2101impl wkt::message::Message for EvidenceDetails {
2102 fn typename() -> &'static str {
2103 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.EvidenceDetails"
2104 }
2105}
2106
2107/// The details for a cloud control audit.
2108#[derive(Clone, Default, PartialEq)]
2109#[non_exhaustive]
2110pub struct CloudControlAuditDetails {
2111 /// Output only. The name of the cloud control.
2112 pub cloud_control: std::string::String,
2113
2114 /// Output only. The ID of the cloud control.
2115 pub cloud_control_id: std::string::String,
2116
2117 /// Output only. The description of the cloud control.
2118 pub cloud_control_description: std::string::String,
2119
2120 /// Output only. The overall status of the findings for the control.
2121 pub compliance_state: crate::model::ComplianceState,
2122
2123 /// Output only. The summary of the report.
2124 pub report_summary: std::option::Option<crate::model::ReportSummary>,
2125
2126 /// Output only. The findings for the control.
2127 pub findings: std::vec::Vec<crate::model::FindingDetails>,
2128
2129 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2130}
2131
2132impl CloudControlAuditDetails {
2133 pub fn new() -> Self {
2134 std::default::Default::default()
2135 }
2136
2137 /// Sets the value of [cloud_control][crate::model::CloudControlAuditDetails::cloud_control].
2138 ///
2139 /// # Example
2140 /// ```ignore,no_run
2141 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAuditDetails;
2142 /// let x = CloudControlAuditDetails::new().set_cloud_control("example");
2143 /// ```
2144 pub fn set_cloud_control<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2145 self.cloud_control = v.into();
2146 self
2147 }
2148
2149 /// Sets the value of [cloud_control_id][crate::model::CloudControlAuditDetails::cloud_control_id].
2150 ///
2151 /// # Example
2152 /// ```ignore,no_run
2153 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAuditDetails;
2154 /// let x = CloudControlAuditDetails::new().set_cloud_control_id("example");
2155 /// ```
2156 pub fn set_cloud_control_id<T: std::convert::Into<std::string::String>>(
2157 mut self,
2158 v: T,
2159 ) -> Self {
2160 self.cloud_control_id = v.into();
2161 self
2162 }
2163
2164 /// Sets the value of [cloud_control_description][crate::model::CloudControlAuditDetails::cloud_control_description].
2165 ///
2166 /// # Example
2167 /// ```ignore,no_run
2168 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAuditDetails;
2169 /// let x = CloudControlAuditDetails::new().set_cloud_control_description("example");
2170 /// ```
2171 pub fn set_cloud_control_description<T: std::convert::Into<std::string::String>>(
2172 mut self,
2173 v: T,
2174 ) -> Self {
2175 self.cloud_control_description = v.into();
2176 self
2177 }
2178
2179 /// Sets the value of [compliance_state][crate::model::CloudControlAuditDetails::compliance_state].
2180 ///
2181 /// # Example
2182 /// ```ignore,no_run
2183 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAuditDetails;
2184 /// use google_cloud_cloudsecuritycompliance_v1::model::ComplianceState;
2185 /// let x0 = CloudControlAuditDetails::new().set_compliance_state(ComplianceState::Compliant);
2186 /// let x1 = CloudControlAuditDetails::new().set_compliance_state(ComplianceState::Violation);
2187 /// let x2 = CloudControlAuditDetails::new().set_compliance_state(ComplianceState::ManualReviewNeeded);
2188 /// ```
2189 pub fn set_compliance_state<T: std::convert::Into<crate::model::ComplianceState>>(
2190 mut self,
2191 v: T,
2192 ) -> Self {
2193 self.compliance_state = v.into();
2194 self
2195 }
2196
2197 /// Sets the value of [report_summary][crate::model::CloudControlAuditDetails::report_summary].
2198 ///
2199 /// # Example
2200 /// ```ignore,no_run
2201 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAuditDetails;
2202 /// use google_cloud_cloudsecuritycompliance_v1::model::ReportSummary;
2203 /// let x = CloudControlAuditDetails::new().set_report_summary(ReportSummary::default()/* use setters */);
2204 /// ```
2205 pub fn set_report_summary<T>(mut self, v: T) -> Self
2206 where
2207 T: std::convert::Into<crate::model::ReportSummary>,
2208 {
2209 self.report_summary = std::option::Option::Some(v.into());
2210 self
2211 }
2212
2213 /// Sets or clears the value of [report_summary][crate::model::CloudControlAuditDetails::report_summary].
2214 ///
2215 /// # Example
2216 /// ```ignore,no_run
2217 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAuditDetails;
2218 /// use google_cloud_cloudsecuritycompliance_v1::model::ReportSummary;
2219 /// let x = CloudControlAuditDetails::new().set_or_clear_report_summary(Some(ReportSummary::default()/* use setters */));
2220 /// let x = CloudControlAuditDetails::new().set_or_clear_report_summary(None::<ReportSummary>);
2221 /// ```
2222 pub fn set_or_clear_report_summary<T>(mut self, v: std::option::Option<T>) -> Self
2223 where
2224 T: std::convert::Into<crate::model::ReportSummary>,
2225 {
2226 self.report_summary = v.map(|x| x.into());
2227 self
2228 }
2229
2230 /// Sets the value of [findings][crate::model::CloudControlAuditDetails::findings].
2231 ///
2232 /// # Example
2233 /// ```ignore,no_run
2234 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAuditDetails;
2235 /// use google_cloud_cloudsecuritycompliance_v1::model::FindingDetails;
2236 /// let x = CloudControlAuditDetails::new()
2237 /// .set_findings([
2238 /// FindingDetails::default()/* use setters */,
2239 /// FindingDetails::default()/* use (different) setters */,
2240 /// ]);
2241 /// ```
2242 pub fn set_findings<T, V>(mut self, v: T) -> Self
2243 where
2244 T: std::iter::IntoIterator<Item = V>,
2245 V: std::convert::Into<crate::model::FindingDetails>,
2246 {
2247 use std::iter::Iterator;
2248 self.findings = v.into_iter().map(|i| i.into()).collect();
2249 self
2250 }
2251}
2252
2253impl wkt::message::Message for CloudControlAuditDetails {
2254 fn typename() -> &'static str {
2255 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControlAuditDetails"
2256 }
2257}
2258
2259/// The request message for [UpdateCmEnrollment][].
2260#[derive(Clone, Default, PartialEq)]
2261#[non_exhaustive]
2262pub struct UpdateCmEnrollmentRequest {
2263 /// Required. The Compliance Manager enrollment to update.
2264 /// The `name` field is used to identify the settings that you want to update.
2265 pub cm_enrollment: std::option::Option<crate::model::CmEnrollment>,
2266
2267 /// Optional. The list of fields that you want to update.
2268 pub update_mask: std::option::Option<wkt::FieldMask>,
2269
2270 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2271}
2272
2273impl UpdateCmEnrollmentRequest {
2274 pub fn new() -> Self {
2275 std::default::Default::default()
2276 }
2277
2278 /// Sets the value of [cm_enrollment][crate::model::UpdateCmEnrollmentRequest::cm_enrollment].
2279 ///
2280 /// # Example
2281 /// ```ignore,no_run
2282 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateCmEnrollmentRequest;
2283 /// use google_cloud_cloudsecuritycompliance_v1::model::CmEnrollment;
2284 /// let x = UpdateCmEnrollmentRequest::new().set_cm_enrollment(CmEnrollment::default()/* use setters */);
2285 /// ```
2286 pub fn set_cm_enrollment<T>(mut self, v: T) -> Self
2287 where
2288 T: std::convert::Into<crate::model::CmEnrollment>,
2289 {
2290 self.cm_enrollment = std::option::Option::Some(v.into());
2291 self
2292 }
2293
2294 /// Sets or clears the value of [cm_enrollment][crate::model::UpdateCmEnrollmentRequest::cm_enrollment].
2295 ///
2296 /// # Example
2297 /// ```ignore,no_run
2298 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateCmEnrollmentRequest;
2299 /// use google_cloud_cloudsecuritycompliance_v1::model::CmEnrollment;
2300 /// let x = UpdateCmEnrollmentRequest::new().set_or_clear_cm_enrollment(Some(CmEnrollment::default()/* use setters */));
2301 /// let x = UpdateCmEnrollmentRequest::new().set_or_clear_cm_enrollment(None::<CmEnrollment>);
2302 /// ```
2303 pub fn set_or_clear_cm_enrollment<T>(mut self, v: std::option::Option<T>) -> Self
2304 where
2305 T: std::convert::Into<crate::model::CmEnrollment>,
2306 {
2307 self.cm_enrollment = v.map(|x| x.into());
2308 self
2309 }
2310
2311 /// Sets the value of [update_mask][crate::model::UpdateCmEnrollmentRequest::update_mask].
2312 ///
2313 /// # Example
2314 /// ```ignore,no_run
2315 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateCmEnrollmentRequest;
2316 /// use wkt::FieldMask;
2317 /// let x = UpdateCmEnrollmentRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2318 /// ```
2319 pub fn set_update_mask<T>(mut self, v: T) -> Self
2320 where
2321 T: std::convert::Into<wkt::FieldMask>,
2322 {
2323 self.update_mask = std::option::Option::Some(v.into());
2324 self
2325 }
2326
2327 /// Sets or clears the value of [update_mask][crate::model::UpdateCmEnrollmentRequest::update_mask].
2328 ///
2329 /// # Example
2330 /// ```ignore,no_run
2331 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateCmEnrollmentRequest;
2332 /// use wkt::FieldMask;
2333 /// let x = UpdateCmEnrollmentRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2334 /// let x = UpdateCmEnrollmentRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2335 /// ```
2336 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2337 where
2338 T: std::convert::Into<wkt::FieldMask>,
2339 {
2340 self.update_mask = v.map(|x| x.into());
2341 self
2342 }
2343}
2344
2345impl wkt::message::Message for UpdateCmEnrollmentRequest {
2346 fn typename() -> &'static str {
2347 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.UpdateCmEnrollmentRequest"
2348 }
2349}
2350
2351/// The request message for [CalculateEffectiveCmEnrollment][].
2352#[derive(Clone, Default, PartialEq)]
2353#[non_exhaustive]
2354pub struct CalculateEffectiveCmEnrollmentRequest {
2355 /// Required. The name of the Compliance Manager enrollment to calculate.
2356 ///
2357 /// Supported formats are the following:
2358 ///
2359 /// * `organizations/{organization_id}/locations/{location}/cmEnrollment`
2360 /// * `folders/{folder_id}/locations/{location}/cmEnrollment`
2361 /// * `projects/{project_id}/locations/{location}/cmEnrollment`
2362 pub name: std::string::String,
2363
2364 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2365}
2366
2367impl CalculateEffectiveCmEnrollmentRequest {
2368 pub fn new() -> Self {
2369 std::default::Default::default()
2370 }
2371
2372 /// Sets the value of [name][crate::model::CalculateEffectiveCmEnrollmentRequest::name].
2373 ///
2374 /// # Example
2375 /// ```ignore,no_run
2376 /// # use google_cloud_cloudsecuritycompliance_v1::model::CalculateEffectiveCmEnrollmentRequest;
2377 /// let x = CalculateEffectiveCmEnrollmentRequest::new().set_name("example");
2378 /// ```
2379 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2380 self.name = v.into();
2381 self
2382 }
2383}
2384
2385impl wkt::message::Message for CalculateEffectiveCmEnrollmentRequest {
2386 fn typename() -> &'static str {
2387 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CalculateEffectiveCmEnrollmentRequest"
2388 }
2389}
2390
2391/// The settings for Compliance Manager at a specific resource scope.=
2392#[derive(Clone, Default, PartialEq)]
2393#[non_exhaustive]
2394pub struct CmEnrollment {
2395 /// Identifier. The name of the Compliance Manager enrollment.
2396 ///
2397 /// Supported formats are the following:
2398 ///
2399 /// * `organizations/{organization_id}/locations/{location}/cmEnrollment`
2400 /// * `folders/{folder_id}/locations/{location}/cmEnrollment`
2401 /// * `projects/{project_id}/locations/{location}/cmEnrollment`
2402 pub name: std::string::String,
2403
2404 /// Optional. Whether the resource is enrolled in Compliance Manager.
2405 /// This setting is inherited by all descendants.
2406 pub enrolled: bool,
2407
2408 /// Optional. The audit configuration for Compliance Manager.
2409 /// If set at a scope, this configuration overrides any inherited audit
2410 /// configuration.
2411 pub audit_config: std::option::Option<crate::model::AuditConfig>,
2412
2413 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2414}
2415
2416impl CmEnrollment {
2417 pub fn new() -> Self {
2418 std::default::Default::default()
2419 }
2420
2421 /// Sets the value of [name][crate::model::CmEnrollment::name].
2422 ///
2423 /// # Example
2424 /// ```ignore,no_run
2425 /// # use google_cloud_cloudsecuritycompliance_v1::model::CmEnrollment;
2426 /// let x = CmEnrollment::new().set_name("example");
2427 /// ```
2428 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2429 self.name = v.into();
2430 self
2431 }
2432
2433 /// Sets the value of [enrolled][crate::model::CmEnrollment::enrolled].
2434 ///
2435 /// # Example
2436 /// ```ignore,no_run
2437 /// # use google_cloud_cloudsecuritycompliance_v1::model::CmEnrollment;
2438 /// let x = CmEnrollment::new().set_enrolled(true);
2439 /// ```
2440 pub fn set_enrolled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2441 self.enrolled = v.into();
2442 self
2443 }
2444
2445 /// Sets the value of [audit_config][crate::model::CmEnrollment::audit_config].
2446 ///
2447 /// # Example
2448 /// ```ignore,no_run
2449 /// # use google_cloud_cloudsecuritycompliance_v1::model::CmEnrollment;
2450 /// use google_cloud_cloudsecuritycompliance_v1::model::AuditConfig;
2451 /// let x = CmEnrollment::new().set_audit_config(AuditConfig::default()/* use setters */);
2452 /// ```
2453 pub fn set_audit_config<T>(mut self, v: T) -> Self
2454 where
2455 T: std::convert::Into<crate::model::AuditConfig>,
2456 {
2457 self.audit_config = std::option::Option::Some(v.into());
2458 self
2459 }
2460
2461 /// Sets or clears the value of [audit_config][crate::model::CmEnrollment::audit_config].
2462 ///
2463 /// # Example
2464 /// ```ignore,no_run
2465 /// # use google_cloud_cloudsecuritycompliance_v1::model::CmEnrollment;
2466 /// use google_cloud_cloudsecuritycompliance_v1::model::AuditConfig;
2467 /// let x = CmEnrollment::new().set_or_clear_audit_config(Some(AuditConfig::default()/* use setters */));
2468 /// let x = CmEnrollment::new().set_or_clear_audit_config(None::<AuditConfig>);
2469 /// ```
2470 pub fn set_or_clear_audit_config<T>(mut self, v: std::option::Option<T>) -> Self
2471 where
2472 T: std::convert::Into<crate::model::AuditConfig>,
2473 {
2474 self.audit_config = v.map(|x| x.into());
2475 self
2476 }
2477}
2478
2479impl wkt::message::Message for CmEnrollment {
2480 fn typename() -> &'static str {
2481 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CmEnrollment"
2482 }
2483}
2484
2485/// The response message for [CalculateEffectiveCmEnrollment][].
2486#[derive(Clone, Default, PartialEq)]
2487#[non_exhaustive]
2488pub struct CalculateEffectiveCmEnrollmentResponse {
2489 /// The effective Compliance Manager enrollment for the resource.
2490 pub cm_enrollment: std::option::Option<crate::model::CmEnrollment>,
2491
2492 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2493}
2494
2495impl CalculateEffectiveCmEnrollmentResponse {
2496 pub fn new() -> Self {
2497 std::default::Default::default()
2498 }
2499
2500 /// Sets the value of [cm_enrollment][crate::model::CalculateEffectiveCmEnrollmentResponse::cm_enrollment].
2501 ///
2502 /// # Example
2503 /// ```ignore,no_run
2504 /// # use google_cloud_cloudsecuritycompliance_v1::model::CalculateEffectiveCmEnrollmentResponse;
2505 /// use google_cloud_cloudsecuritycompliance_v1::model::CmEnrollment;
2506 /// let x = CalculateEffectiveCmEnrollmentResponse::new().set_cm_enrollment(CmEnrollment::default()/* use setters */);
2507 /// ```
2508 pub fn set_cm_enrollment<T>(mut self, v: T) -> Self
2509 where
2510 T: std::convert::Into<crate::model::CmEnrollment>,
2511 {
2512 self.cm_enrollment = std::option::Option::Some(v.into());
2513 self
2514 }
2515
2516 /// Sets or clears the value of [cm_enrollment][crate::model::CalculateEffectiveCmEnrollmentResponse::cm_enrollment].
2517 ///
2518 /// # Example
2519 /// ```ignore,no_run
2520 /// # use google_cloud_cloudsecuritycompliance_v1::model::CalculateEffectiveCmEnrollmentResponse;
2521 /// use google_cloud_cloudsecuritycompliance_v1::model::CmEnrollment;
2522 /// let x = CalculateEffectiveCmEnrollmentResponse::new().set_or_clear_cm_enrollment(Some(CmEnrollment::default()/* use setters */));
2523 /// let x = CalculateEffectiveCmEnrollmentResponse::new().set_or_clear_cm_enrollment(None::<CmEnrollment>);
2524 /// ```
2525 pub fn set_or_clear_cm_enrollment<T>(mut self, v: std::option::Option<T>) -> Self
2526 where
2527 T: std::convert::Into<crate::model::CmEnrollment>,
2528 {
2529 self.cm_enrollment = v.map(|x| x.into());
2530 self
2531 }
2532}
2533
2534impl wkt::message::Message for CalculateEffectiveCmEnrollmentResponse {
2535 fn typename() -> &'static str {
2536 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CalculateEffectiveCmEnrollmentResponse"
2537 }
2538}
2539
2540/// The audit configuration for Compliance Manager.
2541#[derive(Clone, Default, PartialEq)]
2542#[non_exhaustive]
2543pub struct AuditConfig {
2544 /// Required. The list of destinations that can be selected for uploading audit
2545 /// reports to.
2546 pub destinations: std::vec::Vec<crate::model::audit_config::CmEligibleDestination>,
2547
2548 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2549}
2550
2551impl AuditConfig {
2552 pub fn new() -> Self {
2553 std::default::Default::default()
2554 }
2555
2556 /// Sets the value of [destinations][crate::model::AuditConfig::destinations].
2557 ///
2558 /// # Example
2559 /// ```ignore,no_run
2560 /// # use google_cloud_cloudsecuritycompliance_v1::model::AuditConfig;
2561 /// use google_cloud_cloudsecuritycompliance_v1::model::audit_config::CmEligibleDestination;
2562 /// let x = AuditConfig::new()
2563 /// .set_destinations([
2564 /// CmEligibleDestination::default()/* use setters */,
2565 /// CmEligibleDestination::default()/* use (different) setters */,
2566 /// ]);
2567 /// ```
2568 pub fn set_destinations<T, V>(mut self, v: T) -> Self
2569 where
2570 T: std::iter::IntoIterator<Item = V>,
2571 V: std::convert::Into<crate::model::audit_config::CmEligibleDestination>,
2572 {
2573 use std::iter::Iterator;
2574 self.destinations = v.into_iter().map(|i| i.into()).collect();
2575 self
2576 }
2577}
2578
2579impl wkt::message::Message for AuditConfig {
2580 fn typename() -> &'static str {
2581 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.AuditConfig"
2582 }
2583}
2584
2585/// Defines additional types related to [AuditConfig].
2586pub mod audit_config {
2587 #[allow(unused_imports)]
2588 use super::*;
2589
2590 /// The destination details where audit reports are
2591 /// uploaded.
2592 #[derive(Clone, Default, PartialEq)]
2593 #[non_exhaustive]
2594 pub struct CmEligibleDestination {
2595 /// Set of options for the report destination location.
2596 pub cm_eligible_destinations: std::option::Option<
2597 crate::model::audit_config::cm_eligible_destination::CmEligibleDestinations,
2598 >,
2599
2600 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2601 }
2602
2603 impl CmEligibleDestination {
2604 pub fn new() -> Self {
2605 std::default::Default::default()
2606 }
2607
2608 /// Sets the value of [cm_eligible_destinations][crate::model::audit_config::CmEligibleDestination::cm_eligible_destinations].
2609 ///
2610 /// Note that all the setters affecting `cm_eligible_destinations` are mutually
2611 /// exclusive.
2612 ///
2613 /// # Example
2614 /// ```ignore,no_run
2615 /// # use google_cloud_cloudsecuritycompliance_v1::model::audit_config::CmEligibleDestination;
2616 /// use google_cloud_cloudsecuritycompliance_v1::model::audit_config::cm_eligible_destination::CmEligibleDestinations;
2617 /// let x = CmEligibleDestination::new().set_cm_eligible_destinations(Some(CmEligibleDestinations::GcsBucket("example".to_string())));
2618 /// ```
2619 pub fn set_cm_eligible_destinations<
2620 T: std::convert::Into<
2621 std::option::Option<
2622 crate::model::audit_config::cm_eligible_destination::CmEligibleDestinations,
2623 >,
2624 >,
2625 >(
2626 mut self,
2627 v: T,
2628 ) -> Self {
2629 self.cm_eligible_destinations = v.into();
2630 self
2631 }
2632
2633 /// The value of [cm_eligible_destinations][crate::model::audit_config::CmEligibleDestination::cm_eligible_destinations]
2634 /// if it holds a `GcsBucket`, `None` if the field is not set or
2635 /// holds a different branch.
2636 pub fn gcs_bucket(&self) -> std::option::Option<&std::string::String> {
2637 #[allow(unreachable_patterns)]
2638 self.cm_eligible_destinations.as_ref().and_then(|v| match v {
2639 crate::model::audit_config::cm_eligible_destination::CmEligibleDestinations::GcsBucket(v) => std::option::Option::Some(v),
2640 _ => std::option::Option::None,
2641 })
2642 }
2643
2644 /// Sets the value of [cm_eligible_destinations][crate::model::audit_config::CmEligibleDestination::cm_eligible_destinations]
2645 /// to hold a `GcsBucket`.
2646 ///
2647 /// Note that all the setters affecting `cm_eligible_destinations` are
2648 /// mutually exclusive.
2649 ///
2650 /// # Example
2651 /// ```ignore,no_run
2652 /// # use google_cloud_cloudsecuritycompliance_v1::model::audit_config::CmEligibleDestination;
2653 /// let x = CmEligibleDestination::new().set_gcs_bucket("example");
2654 /// assert!(x.gcs_bucket().is_some());
2655 /// ```
2656 pub fn set_gcs_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2657 self.cm_eligible_destinations = std::option::Option::Some(
2658 crate::model::audit_config::cm_eligible_destination::CmEligibleDestinations::GcsBucket(
2659 v.into()
2660 )
2661 );
2662 self
2663 }
2664 }
2665
2666 impl wkt::message::Message for CmEligibleDestination {
2667 fn typename() -> &'static str {
2668 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.AuditConfig.CmEligibleDestination"
2669 }
2670 }
2671
2672 /// Defines additional types related to [CmEligibleDestination].
2673 pub mod cm_eligible_destination {
2674 #[allow(unused_imports)]
2675 use super::*;
2676
2677 /// Set of options for the report destination location.
2678 #[derive(Clone, Debug, PartialEq)]
2679 #[non_exhaustive]
2680 pub enum CmEligibleDestinations {
2681 /// The Cloud Storage bucket where audit reports and evidences can be
2682 /// uploaded. The format is `gs://{bucket_name}`.
2683 GcsBucket(std::string::String),
2684 }
2685 }
2686}
2687
2688/// A framework is a collection of cloud controls and regulatory controls
2689/// that represent security best practices or industry-defined standards such as
2690/// FedRAMP or NIST.
2691#[derive(Clone, Default, PartialEq)]
2692#[non_exhaustive]
2693pub struct Framework {
2694 /// Required. Identifier. The name of the framework, in the format
2695 /// `organizations/{organization}/locations/{location}/frameworks/{framework_id}`.
2696 /// The only supported location is `global`.
2697 pub name: std::string::String,
2698
2699 /// Output only. The major version of the framework, which is incremented in
2700 /// ascending order.
2701 pub major_revision_id: i64,
2702
2703 /// Optional. The friendly name of the framework. The maximum length is 200
2704 /// characters.
2705 pub display_name: std::string::String,
2706
2707 /// Optional. The description of the framework. The maximum length is 2000
2708 /// characters.
2709 pub description: std::string::String,
2710
2711 /// Output only. The type of framework.
2712 pub r#type: crate::model::framework::FrameworkType,
2713
2714 /// Optional. The cloud control details that are directly added without any
2715 /// grouping in the framework.
2716 pub cloud_control_details: std::vec::Vec<crate::model::CloudControlDetails>,
2717
2718 /// Optional. The category of the framework.
2719 pub category: std::vec::Vec<crate::model::FrameworkCategory>,
2720
2721 /// Output only. The cloud providers that are supported by the framework.
2722 pub supported_cloud_providers: std::vec::Vec<crate::model::CloudProvider>,
2723
2724 /// Output only. The target resource types that are supported by the framework.
2725 pub supported_target_resource_types: std::vec::Vec<crate::model::TargetResourceType>,
2726
2727 /// Output only. The supported enforcement modes of the framework.
2728 pub supported_enforcement_modes: std::vec::Vec<crate::model::EnforcementMode>,
2729
2730 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2731}
2732
2733impl Framework {
2734 pub fn new() -> Self {
2735 std::default::Default::default()
2736 }
2737
2738 /// Sets the value of [name][crate::model::Framework::name].
2739 ///
2740 /// # Example
2741 /// ```ignore,no_run
2742 /// # use google_cloud_cloudsecuritycompliance_v1::model::Framework;
2743 /// let x = Framework::new().set_name("example");
2744 /// ```
2745 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2746 self.name = v.into();
2747 self
2748 }
2749
2750 /// Sets the value of [major_revision_id][crate::model::Framework::major_revision_id].
2751 ///
2752 /// # Example
2753 /// ```ignore,no_run
2754 /// # use google_cloud_cloudsecuritycompliance_v1::model::Framework;
2755 /// let x = Framework::new().set_major_revision_id(42);
2756 /// ```
2757 pub fn set_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2758 self.major_revision_id = v.into();
2759 self
2760 }
2761
2762 /// Sets the value of [display_name][crate::model::Framework::display_name].
2763 ///
2764 /// # Example
2765 /// ```ignore,no_run
2766 /// # use google_cloud_cloudsecuritycompliance_v1::model::Framework;
2767 /// let x = Framework::new().set_display_name("example");
2768 /// ```
2769 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2770 self.display_name = v.into();
2771 self
2772 }
2773
2774 /// Sets the value of [description][crate::model::Framework::description].
2775 ///
2776 /// # Example
2777 /// ```ignore,no_run
2778 /// # use google_cloud_cloudsecuritycompliance_v1::model::Framework;
2779 /// let x = Framework::new().set_description("example");
2780 /// ```
2781 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2782 self.description = v.into();
2783 self
2784 }
2785
2786 /// Sets the value of [r#type][crate::model::Framework::type].
2787 ///
2788 /// # Example
2789 /// ```ignore,no_run
2790 /// # use google_cloud_cloudsecuritycompliance_v1::model::Framework;
2791 /// use google_cloud_cloudsecuritycompliance_v1::model::framework::FrameworkType;
2792 /// let x0 = Framework::new().set_type(FrameworkType::BuiltIn);
2793 /// let x1 = Framework::new().set_type(FrameworkType::Custom);
2794 /// ```
2795 pub fn set_type<T: std::convert::Into<crate::model::framework::FrameworkType>>(
2796 mut self,
2797 v: T,
2798 ) -> Self {
2799 self.r#type = v.into();
2800 self
2801 }
2802
2803 /// Sets the value of [cloud_control_details][crate::model::Framework::cloud_control_details].
2804 ///
2805 /// # Example
2806 /// ```ignore,no_run
2807 /// # use google_cloud_cloudsecuritycompliance_v1::model::Framework;
2808 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDetails;
2809 /// let x = Framework::new()
2810 /// .set_cloud_control_details([
2811 /// CloudControlDetails::default()/* use setters */,
2812 /// CloudControlDetails::default()/* use (different) setters */,
2813 /// ]);
2814 /// ```
2815 pub fn set_cloud_control_details<T, V>(mut self, v: T) -> Self
2816 where
2817 T: std::iter::IntoIterator<Item = V>,
2818 V: std::convert::Into<crate::model::CloudControlDetails>,
2819 {
2820 use std::iter::Iterator;
2821 self.cloud_control_details = v.into_iter().map(|i| i.into()).collect();
2822 self
2823 }
2824
2825 /// Sets the value of [category][crate::model::Framework::category].
2826 ///
2827 /// # Example
2828 /// ```ignore,no_run
2829 /// # use google_cloud_cloudsecuritycompliance_v1::model::Framework;
2830 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkCategory;
2831 /// let x = Framework::new().set_category([
2832 /// FrameworkCategory::IndustryDefinedStandard,
2833 /// FrameworkCategory::AssuredWorkloads,
2834 /// FrameworkCategory::DataSecurity,
2835 /// ]);
2836 /// ```
2837 pub fn set_category<T, V>(mut self, v: T) -> Self
2838 where
2839 T: std::iter::IntoIterator<Item = V>,
2840 V: std::convert::Into<crate::model::FrameworkCategory>,
2841 {
2842 use std::iter::Iterator;
2843 self.category = v.into_iter().map(|i| i.into()).collect();
2844 self
2845 }
2846
2847 /// Sets the value of [supported_cloud_providers][crate::model::Framework::supported_cloud_providers].
2848 ///
2849 /// # Example
2850 /// ```ignore,no_run
2851 /// # use google_cloud_cloudsecuritycompliance_v1::model::Framework;
2852 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudProvider;
2853 /// let x = Framework::new().set_supported_cloud_providers([
2854 /// CloudProvider::Aws,
2855 /// CloudProvider::Azure,
2856 /// CloudProvider::Gcp,
2857 /// ]);
2858 /// ```
2859 pub fn set_supported_cloud_providers<T, V>(mut self, v: T) -> Self
2860 where
2861 T: std::iter::IntoIterator<Item = V>,
2862 V: std::convert::Into<crate::model::CloudProvider>,
2863 {
2864 use std::iter::Iterator;
2865 self.supported_cloud_providers = v.into_iter().map(|i| i.into()).collect();
2866 self
2867 }
2868
2869 /// Sets the value of [supported_target_resource_types][crate::model::Framework::supported_target_resource_types].
2870 ///
2871 /// # Example
2872 /// ```ignore,no_run
2873 /// # use google_cloud_cloudsecuritycompliance_v1::model::Framework;
2874 /// use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceType;
2875 /// let x = Framework::new().set_supported_target_resource_types([
2876 /// TargetResourceType::TargetResourceCrmTypeOrg,
2877 /// TargetResourceType::TargetResourceCrmTypeFolder,
2878 /// TargetResourceType::TargetResourceCrmTypeProject,
2879 /// ]);
2880 /// ```
2881 pub fn set_supported_target_resource_types<T, V>(mut self, v: T) -> Self
2882 where
2883 T: std::iter::IntoIterator<Item = V>,
2884 V: std::convert::Into<crate::model::TargetResourceType>,
2885 {
2886 use std::iter::Iterator;
2887 self.supported_target_resource_types = v.into_iter().map(|i| i.into()).collect();
2888 self
2889 }
2890
2891 /// Sets the value of [supported_enforcement_modes][crate::model::Framework::supported_enforcement_modes].
2892 ///
2893 /// # Example
2894 /// ```ignore,no_run
2895 /// # use google_cloud_cloudsecuritycompliance_v1::model::Framework;
2896 /// use google_cloud_cloudsecuritycompliance_v1::model::EnforcementMode;
2897 /// let x = Framework::new().set_supported_enforcement_modes([
2898 /// EnforcementMode::Preventive,
2899 /// EnforcementMode::Detective,
2900 /// EnforcementMode::Audit,
2901 /// ]);
2902 /// ```
2903 pub fn set_supported_enforcement_modes<T, V>(mut self, v: T) -> Self
2904 where
2905 T: std::iter::IntoIterator<Item = V>,
2906 V: std::convert::Into<crate::model::EnforcementMode>,
2907 {
2908 use std::iter::Iterator;
2909 self.supported_enforcement_modes = v.into_iter().map(|i| i.into()).collect();
2910 self
2911 }
2912}
2913
2914impl wkt::message::Message for Framework {
2915 fn typename() -> &'static str {
2916 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.Framework"
2917 }
2918}
2919
2920/// Defines additional types related to [Framework].
2921pub mod framework {
2922 #[allow(unused_imports)]
2923 use super::*;
2924
2925 /// The type of framework.
2926 ///
2927 /// # Working with unknown values
2928 ///
2929 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2930 /// additional enum variants at any time. Adding new variants is not considered
2931 /// a breaking change. Applications should write their code in anticipation of:
2932 ///
2933 /// - New values appearing in future releases of the client library, **and**
2934 /// - New values received dynamically, without application changes.
2935 ///
2936 /// Please consult the [Working with enums] section in the user guide for some
2937 /// guidelines.
2938 ///
2939 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2940 #[derive(Clone, Debug, PartialEq)]
2941 #[non_exhaustive]
2942 pub enum FrameworkType {
2943 /// Default value. This value is unused.
2944 Unspecified,
2945 /// A framework that's provided and managed by Google.
2946 BuiltIn,
2947 /// A framework that's created and managed by you.
2948 Custom,
2949 /// If set, the enum was initialized with an unknown value.
2950 ///
2951 /// Applications can examine the value using [FrameworkType::value] or
2952 /// [FrameworkType::name].
2953 UnknownValue(framework_type::UnknownValue),
2954 }
2955
2956 #[doc(hidden)]
2957 pub mod framework_type {
2958 #[allow(unused_imports)]
2959 use super::*;
2960 #[derive(Clone, Debug, PartialEq)]
2961 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2962 }
2963
2964 impl FrameworkType {
2965 /// Gets the enum value.
2966 ///
2967 /// Returns `None` if the enum contains an unknown value deserialized from
2968 /// the string representation of enums.
2969 pub fn value(&self) -> std::option::Option<i32> {
2970 match self {
2971 Self::Unspecified => std::option::Option::Some(0),
2972 Self::BuiltIn => std::option::Option::Some(1),
2973 Self::Custom => std::option::Option::Some(2),
2974 Self::UnknownValue(u) => u.0.value(),
2975 }
2976 }
2977
2978 /// Gets the enum value as a string.
2979 ///
2980 /// Returns `None` if the enum contains an unknown value deserialized from
2981 /// the integer representation of enums.
2982 pub fn name(&self) -> std::option::Option<&str> {
2983 match self {
2984 Self::Unspecified => std::option::Option::Some("FRAMEWORK_TYPE_UNSPECIFIED"),
2985 Self::BuiltIn => std::option::Option::Some("BUILT_IN"),
2986 Self::Custom => std::option::Option::Some("CUSTOM"),
2987 Self::UnknownValue(u) => u.0.name(),
2988 }
2989 }
2990 }
2991
2992 impl std::default::Default for FrameworkType {
2993 fn default() -> Self {
2994 use std::convert::From;
2995 Self::from(0)
2996 }
2997 }
2998
2999 impl std::fmt::Display for FrameworkType {
3000 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3001 wkt::internal::display_enum(f, self.name(), self.value())
3002 }
3003 }
3004
3005 impl std::convert::From<i32> for FrameworkType {
3006 fn from(value: i32) -> Self {
3007 match value {
3008 0 => Self::Unspecified,
3009 1 => Self::BuiltIn,
3010 2 => Self::Custom,
3011 _ => Self::UnknownValue(framework_type::UnknownValue(
3012 wkt::internal::UnknownEnumValue::Integer(value),
3013 )),
3014 }
3015 }
3016 }
3017
3018 impl std::convert::From<&str> for FrameworkType {
3019 fn from(value: &str) -> Self {
3020 use std::string::ToString;
3021 match value {
3022 "FRAMEWORK_TYPE_UNSPECIFIED" => Self::Unspecified,
3023 "BUILT_IN" => Self::BuiltIn,
3024 "CUSTOM" => Self::Custom,
3025 _ => Self::UnknownValue(framework_type::UnknownValue(
3026 wkt::internal::UnknownEnumValue::String(value.to_string()),
3027 )),
3028 }
3029 }
3030 }
3031
3032 impl serde::ser::Serialize for FrameworkType {
3033 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3034 where
3035 S: serde::Serializer,
3036 {
3037 match self {
3038 Self::Unspecified => serializer.serialize_i32(0),
3039 Self::BuiltIn => serializer.serialize_i32(1),
3040 Self::Custom => serializer.serialize_i32(2),
3041 Self::UnknownValue(u) => u.0.serialize(serializer),
3042 }
3043 }
3044 }
3045
3046 impl<'de> serde::de::Deserialize<'de> for FrameworkType {
3047 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3048 where
3049 D: serde::Deserializer<'de>,
3050 {
3051 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FrameworkType>::new(
3052 ".google.cloud.cloudsecuritycompliance.v1.Framework.FrameworkType",
3053 ))
3054 }
3055 }
3056}
3057
3058/// The details of a cloud control.
3059#[derive(Clone, Default, PartialEq)]
3060#[non_exhaustive]
3061pub struct CloudControlDetails {
3062 /// Required. The name of the cloud control, in the format
3063 /// `organizations/{organization}/locations/{location}/cloudControls/{cloud-control}`.
3064 /// The only supported location is `global`.
3065 pub name: std::string::String,
3066
3067 /// Required. The major version of the cloud control.
3068 pub major_revision_id: i64,
3069
3070 /// Optional. Parameters are key-value pairs that let you provide your custom
3071 /// location requirements, environment requirements, or other settings that are
3072 /// relevant to the cloud control. An example parameter is
3073 /// `{"name": "location","value": "us-west-1"}`.
3074 pub parameters: std::vec::Vec<crate::model::Parameter>,
3075
3076 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3077}
3078
3079impl CloudControlDetails {
3080 pub fn new() -> Self {
3081 std::default::Default::default()
3082 }
3083
3084 /// Sets the value of [name][crate::model::CloudControlDetails::name].
3085 ///
3086 /// # Example
3087 /// ```ignore,no_run
3088 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDetails;
3089 /// let x = CloudControlDetails::new().set_name("example");
3090 /// ```
3091 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3092 self.name = v.into();
3093 self
3094 }
3095
3096 /// Sets the value of [major_revision_id][crate::model::CloudControlDetails::major_revision_id].
3097 ///
3098 /// # Example
3099 /// ```ignore,no_run
3100 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDetails;
3101 /// let x = CloudControlDetails::new().set_major_revision_id(42);
3102 /// ```
3103 pub fn set_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3104 self.major_revision_id = v.into();
3105 self
3106 }
3107
3108 /// Sets the value of [parameters][crate::model::CloudControlDetails::parameters].
3109 ///
3110 /// # Example
3111 /// ```ignore,no_run
3112 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDetails;
3113 /// use google_cloud_cloudsecuritycompliance_v1::model::Parameter;
3114 /// let x = CloudControlDetails::new()
3115 /// .set_parameters([
3116 /// Parameter::default()/* use setters */,
3117 /// Parameter::default()/* use (different) setters */,
3118 /// ]);
3119 /// ```
3120 pub fn set_parameters<T, V>(mut self, v: T) -> Self
3121 where
3122 T: std::iter::IntoIterator<Item = V>,
3123 V: std::convert::Into<crate::model::Parameter>,
3124 {
3125 use std::iter::Iterator;
3126 self.parameters = v.into_iter().map(|i| i.into()).collect();
3127 self
3128 }
3129}
3130
3131impl wkt::message::Message for CloudControlDetails {
3132 fn typename() -> &'static str {
3133 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControlDetails"
3134 }
3135}
3136
3137/// The reference of a framework, in the format
3138/// `organizations/{organization}/locations/{location}/frameworks/{framework}`.
3139/// The only supported location is `global`.
3140#[derive(Clone, Default, PartialEq)]
3141#[non_exhaustive]
3142pub struct FrameworkReference {
3143 /// Required. The major version of the framework. If not specified, the version
3144 /// corresponds to the latest version of the framework.
3145 pub framework: std::string::String,
3146
3147 /// Optional. The major version of the framework. If not specified, the version
3148 /// corresponds to the latest version of the framework.
3149 pub major_revision_id: std::option::Option<i64>,
3150
3151 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3152}
3153
3154impl FrameworkReference {
3155 pub fn new() -> Self {
3156 std::default::Default::default()
3157 }
3158
3159 /// Sets the value of [framework][crate::model::FrameworkReference::framework].
3160 ///
3161 /// # Example
3162 /// ```ignore,no_run
3163 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkReference;
3164 /// let x = FrameworkReference::new().set_framework("example");
3165 /// ```
3166 pub fn set_framework<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3167 self.framework = v.into();
3168 self
3169 }
3170
3171 /// Sets the value of [major_revision_id][crate::model::FrameworkReference::major_revision_id].
3172 ///
3173 /// # Example
3174 /// ```ignore,no_run
3175 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkReference;
3176 /// let x = FrameworkReference::new().set_major_revision_id(42);
3177 /// ```
3178 pub fn set_major_revision_id<T>(mut self, v: T) -> Self
3179 where
3180 T: std::convert::Into<i64>,
3181 {
3182 self.major_revision_id = std::option::Option::Some(v.into());
3183 self
3184 }
3185
3186 /// Sets or clears the value of [major_revision_id][crate::model::FrameworkReference::major_revision_id].
3187 ///
3188 /// # Example
3189 /// ```ignore,no_run
3190 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkReference;
3191 /// let x = FrameworkReference::new().set_or_clear_major_revision_id(Some(42));
3192 /// let x = FrameworkReference::new().set_or_clear_major_revision_id(None::<i32>);
3193 /// ```
3194 pub fn set_or_clear_major_revision_id<T>(mut self, v: std::option::Option<T>) -> Self
3195 where
3196 T: std::convert::Into<i64>,
3197 {
3198 self.major_revision_id = v.map(|x| x.into());
3199 self
3200 }
3201}
3202
3203impl wkt::message::Message for FrameworkReference {
3204 fn typename() -> &'static str {
3205 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FrameworkReference"
3206 }
3207}
3208
3209/// Parameters are key-value pairs that let you provide your custom location
3210/// requirements, environment requirements, or other settings that are
3211/// relevant to the cloud control.
3212#[derive(Clone, Default, PartialEq)]
3213#[non_exhaustive]
3214pub struct Parameter {
3215 /// Required. The name or key of the parameter.
3216 pub name: std::string::String,
3217
3218 /// Required. The value of the parameter.
3219 pub parameter_value: std::option::Option<std::boxed::Box<crate::model::ParamValue>>,
3220
3221 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3222}
3223
3224impl Parameter {
3225 pub fn new() -> Self {
3226 std::default::Default::default()
3227 }
3228
3229 /// Sets the value of [name][crate::model::Parameter::name].
3230 ///
3231 /// # Example
3232 /// ```ignore,no_run
3233 /// # use google_cloud_cloudsecuritycompliance_v1::model::Parameter;
3234 /// let x = Parameter::new().set_name("example");
3235 /// ```
3236 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3237 self.name = v.into();
3238 self
3239 }
3240
3241 /// Sets the value of [parameter_value][crate::model::Parameter::parameter_value].
3242 ///
3243 /// # Example
3244 /// ```ignore,no_run
3245 /// # use google_cloud_cloudsecuritycompliance_v1::model::Parameter;
3246 /// use google_cloud_cloudsecuritycompliance_v1::model::ParamValue;
3247 /// let x = Parameter::new().set_parameter_value(ParamValue::default()/* use setters */);
3248 /// ```
3249 pub fn set_parameter_value<T>(mut self, v: T) -> Self
3250 where
3251 T: std::convert::Into<crate::model::ParamValue>,
3252 {
3253 self.parameter_value = std::option::Option::Some(std::boxed::Box::new(v.into()));
3254 self
3255 }
3256
3257 /// Sets or clears the value of [parameter_value][crate::model::Parameter::parameter_value].
3258 ///
3259 /// # Example
3260 /// ```ignore,no_run
3261 /// # use google_cloud_cloudsecuritycompliance_v1::model::Parameter;
3262 /// use google_cloud_cloudsecuritycompliance_v1::model::ParamValue;
3263 /// let x = Parameter::new().set_or_clear_parameter_value(Some(ParamValue::default()/* use setters */));
3264 /// let x = Parameter::new().set_or_clear_parameter_value(None::<ParamValue>);
3265 /// ```
3266 pub fn set_or_clear_parameter_value<T>(mut self, v: std::option::Option<T>) -> Self
3267 where
3268 T: std::convert::Into<crate::model::ParamValue>,
3269 {
3270 self.parameter_value = v.map(|x| std::boxed::Box::new(x.into()));
3271 self
3272 }
3273}
3274
3275impl wkt::message::Message for Parameter {
3276 fn typename() -> &'static str {
3277 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.Parameter"
3278 }
3279}
3280
3281/// A cloud control is a set of rules and associated metadata that you can
3282/// use to define your organization's security or compliance intent.
3283#[derive(Clone, Default, PartialEq)]
3284#[non_exhaustive]
3285pub struct CloudControl {
3286 /// Required. Identifier. The name of the cloud control, in the format
3287 /// `organizations/{organization}/locations/{location}/cloudControls/{cloud_control_id}`.
3288 /// The only supported location is `global`.
3289 pub name: std::string::String,
3290
3291 /// Output only. The major version of the cloud control, which is incremented
3292 /// in ascending order.
3293 pub major_revision_id: i64,
3294
3295 /// Optional. A description of the cloud control. The maximum length is 2000
3296 /// characters.
3297 pub description: std::string::String,
3298
3299 /// Optional. The friendly name of the cloud control. The maximum length is 200
3300 /// characters.
3301 pub display_name: std::string::String,
3302
3303 /// Output only. The supported enforcement modes for the cloud control.
3304 pub supported_enforcement_modes: std::vec::Vec<crate::model::EnforcementMode>,
3305
3306 /// Optional. The parameter specifications for the cloud control.
3307 pub parameter_spec: std::vec::Vec<crate::model::ParameterSpec>,
3308
3309 /// Optional. The rules that you can enforce to meet your security or
3310 /// compliance intent.
3311 pub rules: std::vec::Vec<crate::model::Rule>,
3312
3313 /// Optional. The severity of the findings that are generated by the cloud
3314 /// control.
3315 pub severity: crate::model::Severity,
3316
3317 /// Optional. The finding category for the cloud control findings. The maximum
3318 /// length is 255 characters.
3319 pub finding_category: std::string::String,
3320
3321 /// Optional. The supported cloud providers.
3322 pub supported_cloud_providers: std::vec::Vec<crate::model::CloudProvider>,
3323
3324 /// Output only. The frameworks that include this cloud control.
3325 pub related_frameworks: std::vec::Vec<std::string::String>,
3326
3327 /// Optional. The remediation steps for the cloud control findings. The
3328 /// maximum length is 400 characters.
3329 pub remediation_steps: std::string::String,
3330
3331 /// Optional. The categories for the cloud control.
3332 pub categories: std::vec::Vec<crate::model::CloudControlCategory>,
3333
3334 /// Output only. The time that the cloud control was last updated.
3335 /// `create_time` is used because a new cloud control is created
3336 /// whenever an existing cloud control is updated.
3337 pub create_time: std::option::Option<wkt::Timestamp>,
3338
3339 /// Optional. The target resource types that are supported by the cloud
3340 /// control.
3341 pub supported_target_resource_types: std::vec::Vec<crate::model::TargetResourceType>,
3342
3343 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3344}
3345
3346impl CloudControl {
3347 pub fn new() -> Self {
3348 std::default::Default::default()
3349 }
3350
3351 /// Sets the value of [name][crate::model::CloudControl::name].
3352 ///
3353 /// # Example
3354 /// ```ignore,no_run
3355 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3356 /// let x = CloudControl::new().set_name("example");
3357 /// ```
3358 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3359 self.name = v.into();
3360 self
3361 }
3362
3363 /// Sets the value of [major_revision_id][crate::model::CloudControl::major_revision_id].
3364 ///
3365 /// # Example
3366 /// ```ignore,no_run
3367 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3368 /// let x = CloudControl::new().set_major_revision_id(42);
3369 /// ```
3370 pub fn set_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3371 self.major_revision_id = v.into();
3372 self
3373 }
3374
3375 /// Sets the value of [description][crate::model::CloudControl::description].
3376 ///
3377 /// # Example
3378 /// ```ignore,no_run
3379 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3380 /// let x = CloudControl::new().set_description("example");
3381 /// ```
3382 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3383 self.description = v.into();
3384 self
3385 }
3386
3387 /// Sets the value of [display_name][crate::model::CloudControl::display_name].
3388 ///
3389 /// # Example
3390 /// ```ignore,no_run
3391 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3392 /// let x = CloudControl::new().set_display_name("example");
3393 /// ```
3394 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3395 self.display_name = v.into();
3396 self
3397 }
3398
3399 /// Sets the value of [supported_enforcement_modes][crate::model::CloudControl::supported_enforcement_modes].
3400 ///
3401 /// # Example
3402 /// ```ignore,no_run
3403 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3404 /// use google_cloud_cloudsecuritycompliance_v1::model::EnforcementMode;
3405 /// let x = CloudControl::new().set_supported_enforcement_modes([
3406 /// EnforcementMode::Preventive,
3407 /// EnforcementMode::Detective,
3408 /// EnforcementMode::Audit,
3409 /// ]);
3410 /// ```
3411 pub fn set_supported_enforcement_modes<T, V>(mut self, v: T) -> Self
3412 where
3413 T: std::iter::IntoIterator<Item = V>,
3414 V: std::convert::Into<crate::model::EnforcementMode>,
3415 {
3416 use std::iter::Iterator;
3417 self.supported_enforcement_modes = v.into_iter().map(|i| i.into()).collect();
3418 self
3419 }
3420
3421 /// Sets the value of [parameter_spec][crate::model::CloudControl::parameter_spec].
3422 ///
3423 /// # Example
3424 /// ```ignore,no_run
3425 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3426 /// use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
3427 /// let x = CloudControl::new()
3428 /// .set_parameter_spec([
3429 /// ParameterSpec::default()/* use setters */,
3430 /// ParameterSpec::default()/* use (different) setters */,
3431 /// ]);
3432 /// ```
3433 pub fn set_parameter_spec<T, V>(mut self, v: T) -> Self
3434 where
3435 T: std::iter::IntoIterator<Item = V>,
3436 V: std::convert::Into<crate::model::ParameterSpec>,
3437 {
3438 use std::iter::Iterator;
3439 self.parameter_spec = v.into_iter().map(|i| i.into()).collect();
3440 self
3441 }
3442
3443 /// Sets the value of [rules][crate::model::CloudControl::rules].
3444 ///
3445 /// # Example
3446 /// ```ignore,no_run
3447 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3448 /// use google_cloud_cloudsecuritycompliance_v1::model::Rule;
3449 /// let x = CloudControl::new()
3450 /// .set_rules([
3451 /// Rule::default()/* use setters */,
3452 /// Rule::default()/* use (different) setters */,
3453 /// ]);
3454 /// ```
3455 pub fn set_rules<T, V>(mut self, v: T) -> Self
3456 where
3457 T: std::iter::IntoIterator<Item = V>,
3458 V: std::convert::Into<crate::model::Rule>,
3459 {
3460 use std::iter::Iterator;
3461 self.rules = v.into_iter().map(|i| i.into()).collect();
3462 self
3463 }
3464
3465 /// Sets the value of [severity][crate::model::CloudControl::severity].
3466 ///
3467 /// # Example
3468 /// ```ignore,no_run
3469 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3470 /// use google_cloud_cloudsecuritycompliance_v1::model::Severity;
3471 /// let x0 = CloudControl::new().set_severity(Severity::Critical);
3472 /// let x1 = CloudControl::new().set_severity(Severity::High);
3473 /// let x2 = CloudControl::new().set_severity(Severity::Medium);
3474 /// ```
3475 pub fn set_severity<T: std::convert::Into<crate::model::Severity>>(mut self, v: T) -> Self {
3476 self.severity = v.into();
3477 self
3478 }
3479
3480 /// Sets the value of [finding_category][crate::model::CloudControl::finding_category].
3481 ///
3482 /// # Example
3483 /// ```ignore,no_run
3484 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3485 /// let x = CloudControl::new().set_finding_category("example");
3486 /// ```
3487 pub fn set_finding_category<T: std::convert::Into<std::string::String>>(
3488 mut self,
3489 v: T,
3490 ) -> Self {
3491 self.finding_category = v.into();
3492 self
3493 }
3494
3495 /// Sets the value of [supported_cloud_providers][crate::model::CloudControl::supported_cloud_providers].
3496 ///
3497 /// # Example
3498 /// ```ignore,no_run
3499 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3500 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudProvider;
3501 /// let x = CloudControl::new().set_supported_cloud_providers([
3502 /// CloudProvider::Aws,
3503 /// CloudProvider::Azure,
3504 /// CloudProvider::Gcp,
3505 /// ]);
3506 /// ```
3507 pub fn set_supported_cloud_providers<T, V>(mut self, v: T) -> Self
3508 where
3509 T: std::iter::IntoIterator<Item = V>,
3510 V: std::convert::Into<crate::model::CloudProvider>,
3511 {
3512 use std::iter::Iterator;
3513 self.supported_cloud_providers = v.into_iter().map(|i| i.into()).collect();
3514 self
3515 }
3516
3517 /// Sets the value of [related_frameworks][crate::model::CloudControl::related_frameworks].
3518 ///
3519 /// # Example
3520 /// ```ignore,no_run
3521 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3522 /// let x = CloudControl::new().set_related_frameworks(["a", "b", "c"]);
3523 /// ```
3524 pub fn set_related_frameworks<T, V>(mut self, v: T) -> Self
3525 where
3526 T: std::iter::IntoIterator<Item = V>,
3527 V: std::convert::Into<std::string::String>,
3528 {
3529 use std::iter::Iterator;
3530 self.related_frameworks = v.into_iter().map(|i| i.into()).collect();
3531 self
3532 }
3533
3534 /// Sets the value of [remediation_steps][crate::model::CloudControl::remediation_steps].
3535 ///
3536 /// # Example
3537 /// ```ignore,no_run
3538 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3539 /// let x = CloudControl::new().set_remediation_steps("example");
3540 /// ```
3541 pub fn set_remediation_steps<T: std::convert::Into<std::string::String>>(
3542 mut self,
3543 v: T,
3544 ) -> Self {
3545 self.remediation_steps = v.into();
3546 self
3547 }
3548
3549 /// Sets the value of [categories][crate::model::CloudControl::categories].
3550 ///
3551 /// # Example
3552 /// ```ignore,no_run
3553 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3554 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlCategory;
3555 /// let x = CloudControl::new().set_categories([
3556 /// CloudControlCategory::CcCategoryInfrastructure,
3557 /// CloudControlCategory::CcCategoryArtificialIntelligence,
3558 /// CloudControlCategory::CcCategoryPhysicalSecurity,
3559 /// ]);
3560 /// ```
3561 pub fn set_categories<T, V>(mut self, v: T) -> Self
3562 where
3563 T: std::iter::IntoIterator<Item = V>,
3564 V: std::convert::Into<crate::model::CloudControlCategory>,
3565 {
3566 use std::iter::Iterator;
3567 self.categories = v.into_iter().map(|i| i.into()).collect();
3568 self
3569 }
3570
3571 /// Sets the value of [create_time][crate::model::CloudControl::create_time].
3572 ///
3573 /// # Example
3574 /// ```ignore,no_run
3575 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3576 /// use wkt::Timestamp;
3577 /// let x = CloudControl::new().set_create_time(Timestamp::default()/* use setters */);
3578 /// ```
3579 pub fn set_create_time<T>(mut self, v: T) -> Self
3580 where
3581 T: std::convert::Into<wkt::Timestamp>,
3582 {
3583 self.create_time = std::option::Option::Some(v.into());
3584 self
3585 }
3586
3587 /// Sets or clears the value of [create_time][crate::model::CloudControl::create_time].
3588 ///
3589 /// # Example
3590 /// ```ignore,no_run
3591 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3592 /// use wkt::Timestamp;
3593 /// let x = CloudControl::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3594 /// let x = CloudControl::new().set_or_clear_create_time(None::<Timestamp>);
3595 /// ```
3596 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3597 where
3598 T: std::convert::Into<wkt::Timestamp>,
3599 {
3600 self.create_time = v.map(|x| x.into());
3601 self
3602 }
3603
3604 /// Sets the value of [supported_target_resource_types][crate::model::CloudControl::supported_target_resource_types].
3605 ///
3606 /// # Example
3607 /// ```ignore,no_run
3608 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3609 /// use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceType;
3610 /// let x = CloudControl::new().set_supported_target_resource_types([
3611 /// TargetResourceType::TargetResourceCrmTypeOrg,
3612 /// TargetResourceType::TargetResourceCrmTypeFolder,
3613 /// TargetResourceType::TargetResourceCrmTypeProject,
3614 /// ]);
3615 /// ```
3616 pub fn set_supported_target_resource_types<T, V>(mut self, v: T) -> Self
3617 where
3618 T: std::iter::IntoIterator<Item = V>,
3619 V: std::convert::Into<crate::model::TargetResourceType>,
3620 {
3621 use std::iter::Iterator;
3622 self.supported_target_resource_types = v.into_iter().map(|i| i.into()).collect();
3623 self
3624 }
3625}
3626
3627impl wkt::message::Message for CloudControl {
3628 fn typename() -> &'static str {
3629 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControl"
3630 }
3631}
3632
3633/// Defines additional types related to [CloudControl].
3634pub mod cloud_control {
3635 #[allow(unused_imports)]
3636 use super::*;
3637
3638 /// The type of cloud control.
3639 ///
3640 /// # Working with unknown values
3641 ///
3642 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3643 /// additional enum variants at any time. Adding new variants is not considered
3644 /// a breaking change. Applications should write their code in anticipation of:
3645 ///
3646 /// - New values appearing in future releases of the client library, **and**
3647 /// - New values received dynamically, without application changes.
3648 ///
3649 /// Please consult the [Working with enums] section in the user guide for some
3650 /// guidelines.
3651 ///
3652 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3653 #[derive(Clone, Debug, PartialEq)]
3654 #[non_exhaustive]
3655 pub enum Type {
3656 /// Default value. This value is unused.
3657 Unspecified,
3658 /// A cloud control that's created and managed by you.
3659 Custom,
3660 /// A cloud control that's provided and managed by Google.
3661 BuiltIn,
3662 /// If set, the enum was initialized with an unknown value.
3663 ///
3664 /// Applications can examine the value using [Type::value] or
3665 /// [Type::name].
3666 UnknownValue(r#type::UnknownValue),
3667 }
3668
3669 #[doc(hidden)]
3670 pub mod r#type {
3671 #[allow(unused_imports)]
3672 use super::*;
3673 #[derive(Clone, Debug, PartialEq)]
3674 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3675 }
3676
3677 impl Type {
3678 /// Gets the enum value.
3679 ///
3680 /// Returns `None` if the enum contains an unknown value deserialized from
3681 /// the string representation of enums.
3682 pub fn value(&self) -> std::option::Option<i32> {
3683 match self {
3684 Self::Unspecified => std::option::Option::Some(0),
3685 Self::Custom => std::option::Option::Some(1),
3686 Self::BuiltIn => std::option::Option::Some(2),
3687 Self::UnknownValue(u) => u.0.value(),
3688 }
3689 }
3690
3691 /// Gets the enum value as a string.
3692 ///
3693 /// Returns `None` if the enum contains an unknown value deserialized from
3694 /// the integer representation of enums.
3695 pub fn name(&self) -> std::option::Option<&str> {
3696 match self {
3697 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
3698 Self::Custom => std::option::Option::Some("CUSTOM"),
3699 Self::BuiltIn => std::option::Option::Some("BUILT_IN"),
3700 Self::UnknownValue(u) => u.0.name(),
3701 }
3702 }
3703 }
3704
3705 impl std::default::Default for Type {
3706 fn default() -> Self {
3707 use std::convert::From;
3708 Self::from(0)
3709 }
3710 }
3711
3712 impl std::fmt::Display for Type {
3713 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3714 wkt::internal::display_enum(f, self.name(), self.value())
3715 }
3716 }
3717
3718 impl std::convert::From<i32> for Type {
3719 fn from(value: i32) -> Self {
3720 match value {
3721 0 => Self::Unspecified,
3722 1 => Self::Custom,
3723 2 => Self::BuiltIn,
3724 _ => Self::UnknownValue(r#type::UnknownValue(
3725 wkt::internal::UnknownEnumValue::Integer(value),
3726 )),
3727 }
3728 }
3729 }
3730
3731 impl std::convert::From<&str> for Type {
3732 fn from(value: &str) -> Self {
3733 use std::string::ToString;
3734 match value {
3735 "TYPE_UNSPECIFIED" => Self::Unspecified,
3736 "CUSTOM" => Self::Custom,
3737 "BUILT_IN" => Self::BuiltIn,
3738 _ => Self::UnknownValue(r#type::UnknownValue(
3739 wkt::internal::UnknownEnumValue::String(value.to_string()),
3740 )),
3741 }
3742 }
3743 }
3744
3745 impl serde::ser::Serialize for Type {
3746 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3747 where
3748 S: serde::Serializer,
3749 {
3750 match self {
3751 Self::Unspecified => serializer.serialize_i32(0),
3752 Self::Custom => serializer.serialize_i32(1),
3753 Self::BuiltIn => serializer.serialize_i32(2),
3754 Self::UnknownValue(u) => u.0.serialize(serializer),
3755 }
3756 }
3757 }
3758
3759 impl<'de> serde::de::Deserialize<'de> for Type {
3760 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3761 where
3762 D: serde::Deserializer<'de>,
3763 {
3764 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
3765 ".google.cloud.cloudsecuritycompliance.v1.CloudControl.Type",
3766 ))
3767 }
3768 }
3769}
3770
3771/// The parameter specification for the cloud control.
3772#[derive(Clone, Default, PartialEq)]
3773#[non_exhaustive]
3774pub struct ParameterSpec {
3775 /// Required. The name of the parameter.
3776 pub name: std::string::String,
3777
3778 /// Optional. The friendly name of the parameter. The maximum length is 200
3779 /// characters.
3780 pub display_name: std::string::String,
3781
3782 /// Optional. The description of the parameter. The maximum length is 2000
3783 /// characters.
3784 pub description: std::string::String,
3785
3786 /// Required. Whether the parameter is required.
3787 pub is_required: bool,
3788
3789 /// Required. The parameter value type.
3790 pub value_type: crate::model::parameter_spec::ValueType,
3791
3792 /// Optional. The default value of the parameter.
3793 pub default_value: std::option::Option<crate::model::ParamValue>,
3794
3795 /// Optional. The list of parameter substitutions.
3796 pub substitution_rules: std::vec::Vec<crate::model::ParameterSubstitutionRule>,
3797
3798 /// Optional. The parameter specification for `oneOf` attributes.
3799 pub sub_parameters: std::vec::Vec<crate::model::ParameterSpec>,
3800
3801 /// Optional. The permitted set of values for the parameter.
3802 pub validation: std::option::Option<crate::model::Validation>,
3803
3804 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3805}
3806
3807impl ParameterSpec {
3808 pub fn new() -> Self {
3809 std::default::Default::default()
3810 }
3811
3812 /// Sets the value of [name][crate::model::ParameterSpec::name].
3813 ///
3814 /// # Example
3815 /// ```ignore,no_run
3816 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
3817 /// let x = ParameterSpec::new().set_name("example");
3818 /// ```
3819 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3820 self.name = v.into();
3821 self
3822 }
3823
3824 /// Sets the value of [display_name][crate::model::ParameterSpec::display_name].
3825 ///
3826 /// # Example
3827 /// ```ignore,no_run
3828 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
3829 /// let x = ParameterSpec::new().set_display_name("example");
3830 /// ```
3831 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3832 self.display_name = v.into();
3833 self
3834 }
3835
3836 /// Sets the value of [description][crate::model::ParameterSpec::description].
3837 ///
3838 /// # Example
3839 /// ```ignore,no_run
3840 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
3841 /// let x = ParameterSpec::new().set_description("example");
3842 /// ```
3843 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3844 self.description = v.into();
3845 self
3846 }
3847
3848 /// Sets the value of [is_required][crate::model::ParameterSpec::is_required].
3849 ///
3850 /// # Example
3851 /// ```ignore,no_run
3852 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
3853 /// let x = ParameterSpec::new().set_is_required(true);
3854 /// ```
3855 pub fn set_is_required<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3856 self.is_required = v.into();
3857 self
3858 }
3859
3860 /// Sets the value of [value_type][crate::model::ParameterSpec::value_type].
3861 ///
3862 /// # Example
3863 /// ```ignore,no_run
3864 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
3865 /// use google_cloud_cloudsecuritycompliance_v1::model::parameter_spec::ValueType;
3866 /// let x0 = ParameterSpec::new().set_value_type(ValueType::String);
3867 /// let x1 = ParameterSpec::new().set_value_type(ValueType::Boolean);
3868 /// let x2 = ParameterSpec::new().set_value_type(ValueType::Stringlist);
3869 /// ```
3870 pub fn set_value_type<T: std::convert::Into<crate::model::parameter_spec::ValueType>>(
3871 mut self,
3872 v: T,
3873 ) -> Self {
3874 self.value_type = v.into();
3875 self
3876 }
3877
3878 /// Sets the value of [default_value][crate::model::ParameterSpec::default_value].
3879 ///
3880 /// # Example
3881 /// ```ignore,no_run
3882 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
3883 /// use google_cloud_cloudsecuritycompliance_v1::model::ParamValue;
3884 /// let x = ParameterSpec::new().set_default_value(ParamValue::default()/* use setters */);
3885 /// ```
3886 pub fn set_default_value<T>(mut self, v: T) -> Self
3887 where
3888 T: std::convert::Into<crate::model::ParamValue>,
3889 {
3890 self.default_value = std::option::Option::Some(v.into());
3891 self
3892 }
3893
3894 /// Sets or clears the value of [default_value][crate::model::ParameterSpec::default_value].
3895 ///
3896 /// # Example
3897 /// ```ignore,no_run
3898 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
3899 /// use google_cloud_cloudsecuritycompliance_v1::model::ParamValue;
3900 /// let x = ParameterSpec::new().set_or_clear_default_value(Some(ParamValue::default()/* use setters */));
3901 /// let x = ParameterSpec::new().set_or_clear_default_value(None::<ParamValue>);
3902 /// ```
3903 pub fn set_or_clear_default_value<T>(mut self, v: std::option::Option<T>) -> Self
3904 where
3905 T: std::convert::Into<crate::model::ParamValue>,
3906 {
3907 self.default_value = v.map(|x| x.into());
3908 self
3909 }
3910
3911 /// Sets the value of [substitution_rules][crate::model::ParameterSpec::substitution_rules].
3912 ///
3913 /// # Example
3914 /// ```ignore,no_run
3915 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
3916 /// use google_cloud_cloudsecuritycompliance_v1::model::ParameterSubstitutionRule;
3917 /// let x = ParameterSpec::new()
3918 /// .set_substitution_rules([
3919 /// ParameterSubstitutionRule::default()/* use setters */,
3920 /// ParameterSubstitutionRule::default()/* use (different) setters */,
3921 /// ]);
3922 /// ```
3923 pub fn set_substitution_rules<T, V>(mut self, v: T) -> Self
3924 where
3925 T: std::iter::IntoIterator<Item = V>,
3926 V: std::convert::Into<crate::model::ParameterSubstitutionRule>,
3927 {
3928 use std::iter::Iterator;
3929 self.substitution_rules = v.into_iter().map(|i| i.into()).collect();
3930 self
3931 }
3932
3933 /// Sets the value of [sub_parameters][crate::model::ParameterSpec::sub_parameters].
3934 ///
3935 /// # Example
3936 /// ```ignore,no_run
3937 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
3938 /// let x = ParameterSpec::new()
3939 /// .set_sub_parameters([
3940 /// ParameterSpec::default()/* use setters */,
3941 /// ParameterSpec::default()/* use (different) setters */,
3942 /// ]);
3943 /// ```
3944 pub fn set_sub_parameters<T, V>(mut self, v: T) -> Self
3945 where
3946 T: std::iter::IntoIterator<Item = V>,
3947 V: std::convert::Into<crate::model::ParameterSpec>,
3948 {
3949 use std::iter::Iterator;
3950 self.sub_parameters = v.into_iter().map(|i| i.into()).collect();
3951 self
3952 }
3953
3954 /// Sets the value of [validation][crate::model::ParameterSpec::validation].
3955 ///
3956 /// # Example
3957 /// ```ignore,no_run
3958 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
3959 /// use google_cloud_cloudsecuritycompliance_v1::model::Validation;
3960 /// let x = ParameterSpec::new().set_validation(Validation::default()/* use setters */);
3961 /// ```
3962 pub fn set_validation<T>(mut self, v: T) -> Self
3963 where
3964 T: std::convert::Into<crate::model::Validation>,
3965 {
3966 self.validation = std::option::Option::Some(v.into());
3967 self
3968 }
3969
3970 /// Sets or clears the value of [validation][crate::model::ParameterSpec::validation].
3971 ///
3972 /// # Example
3973 /// ```ignore,no_run
3974 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
3975 /// use google_cloud_cloudsecuritycompliance_v1::model::Validation;
3976 /// let x = ParameterSpec::new().set_or_clear_validation(Some(Validation::default()/* use setters */));
3977 /// let x = ParameterSpec::new().set_or_clear_validation(None::<Validation>);
3978 /// ```
3979 pub fn set_or_clear_validation<T>(mut self, v: std::option::Option<T>) -> Self
3980 where
3981 T: std::convert::Into<crate::model::Validation>,
3982 {
3983 self.validation = v.map(|x| x.into());
3984 self
3985 }
3986}
3987
3988impl wkt::message::Message for ParameterSpec {
3989 fn typename() -> &'static str {
3990 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ParameterSpec"
3991 }
3992}
3993
3994/// Defines additional types related to [ParameterSpec].
3995pub mod parameter_spec {
3996 #[allow(unused_imports)]
3997 use super::*;
3998
3999 /// The type of parameter value.
4000 ///
4001 /// # Working with unknown values
4002 ///
4003 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4004 /// additional enum variants at any time. Adding new variants is not considered
4005 /// a breaking change. Applications should write their code in anticipation of:
4006 ///
4007 /// - New values appearing in future releases of the client library, **and**
4008 /// - New values received dynamically, without application changes.
4009 ///
4010 /// Please consult the [Working with enums] section in the user guide for some
4011 /// guidelines.
4012 ///
4013 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4014 #[derive(Clone, Debug, PartialEq)]
4015 #[non_exhaustive]
4016 pub enum ValueType {
4017 /// Default value. This value is unused.
4018 Unspecified,
4019 /// A string value.
4020 String,
4021 /// A boolean value.
4022 Boolean,
4023 /// A string list value.
4024 Stringlist,
4025 /// A numeric value.
4026 Number,
4027 /// A oneOf value.
4028 Oneof,
4029 /// If set, the enum was initialized with an unknown value.
4030 ///
4031 /// Applications can examine the value using [ValueType::value] or
4032 /// [ValueType::name].
4033 UnknownValue(value_type::UnknownValue),
4034 }
4035
4036 #[doc(hidden)]
4037 pub mod value_type {
4038 #[allow(unused_imports)]
4039 use super::*;
4040 #[derive(Clone, Debug, PartialEq)]
4041 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4042 }
4043
4044 impl ValueType {
4045 /// Gets the enum value.
4046 ///
4047 /// Returns `None` if the enum contains an unknown value deserialized from
4048 /// the string representation of enums.
4049 pub fn value(&self) -> std::option::Option<i32> {
4050 match self {
4051 Self::Unspecified => std::option::Option::Some(0),
4052 Self::String => std::option::Option::Some(3),
4053 Self::Boolean => std::option::Option::Some(4),
4054 Self::Stringlist => std::option::Option::Some(5),
4055 Self::Number => std::option::Option::Some(6),
4056 Self::Oneof => std::option::Option::Some(7),
4057 Self::UnknownValue(u) => u.0.value(),
4058 }
4059 }
4060
4061 /// Gets the enum value as a string.
4062 ///
4063 /// Returns `None` if the enum contains an unknown value deserialized from
4064 /// the integer representation of enums.
4065 pub fn name(&self) -> std::option::Option<&str> {
4066 match self {
4067 Self::Unspecified => std::option::Option::Some("VALUE_TYPE_UNSPECIFIED"),
4068 Self::String => std::option::Option::Some("STRING"),
4069 Self::Boolean => std::option::Option::Some("BOOLEAN"),
4070 Self::Stringlist => std::option::Option::Some("STRINGLIST"),
4071 Self::Number => std::option::Option::Some("NUMBER"),
4072 Self::Oneof => std::option::Option::Some("ONEOF"),
4073 Self::UnknownValue(u) => u.0.name(),
4074 }
4075 }
4076 }
4077
4078 impl std::default::Default for ValueType {
4079 fn default() -> Self {
4080 use std::convert::From;
4081 Self::from(0)
4082 }
4083 }
4084
4085 impl std::fmt::Display for ValueType {
4086 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4087 wkt::internal::display_enum(f, self.name(), self.value())
4088 }
4089 }
4090
4091 impl std::convert::From<i32> for ValueType {
4092 fn from(value: i32) -> Self {
4093 match value {
4094 0 => Self::Unspecified,
4095 3 => Self::String,
4096 4 => Self::Boolean,
4097 5 => Self::Stringlist,
4098 6 => Self::Number,
4099 7 => Self::Oneof,
4100 _ => Self::UnknownValue(value_type::UnknownValue(
4101 wkt::internal::UnknownEnumValue::Integer(value),
4102 )),
4103 }
4104 }
4105 }
4106
4107 impl std::convert::From<&str> for ValueType {
4108 fn from(value: &str) -> Self {
4109 use std::string::ToString;
4110 match value {
4111 "VALUE_TYPE_UNSPECIFIED" => Self::Unspecified,
4112 "STRING" => Self::String,
4113 "BOOLEAN" => Self::Boolean,
4114 "STRINGLIST" => Self::Stringlist,
4115 "NUMBER" => Self::Number,
4116 "ONEOF" => Self::Oneof,
4117 _ => Self::UnknownValue(value_type::UnknownValue(
4118 wkt::internal::UnknownEnumValue::String(value.to_string()),
4119 )),
4120 }
4121 }
4122 }
4123
4124 impl serde::ser::Serialize for ValueType {
4125 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4126 where
4127 S: serde::Serializer,
4128 {
4129 match self {
4130 Self::Unspecified => serializer.serialize_i32(0),
4131 Self::String => serializer.serialize_i32(3),
4132 Self::Boolean => serializer.serialize_i32(4),
4133 Self::Stringlist => serializer.serialize_i32(5),
4134 Self::Number => serializer.serialize_i32(6),
4135 Self::Oneof => serializer.serialize_i32(7),
4136 Self::UnknownValue(u) => u.0.serialize(serializer),
4137 }
4138 }
4139 }
4140
4141 impl<'de> serde::de::Deserialize<'de> for ValueType {
4142 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4143 where
4144 D: serde::Deserializer<'de>,
4145 {
4146 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ValueType>::new(
4147 ".google.cloud.cloudsecuritycompliance.v1.ParameterSpec.ValueType",
4148 ))
4149 }
4150 }
4151}
4152
4153/// The validation of the parameter.
4154#[derive(Clone, Default, PartialEq)]
4155#[non_exhaustive]
4156pub struct Validation {
4157 /// Defines validators for parameter values.
4158 pub constraint: std::option::Option<crate::model::validation::Constraint>,
4159
4160 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4161}
4162
4163impl Validation {
4164 pub fn new() -> Self {
4165 std::default::Default::default()
4166 }
4167
4168 /// Sets the value of [constraint][crate::model::Validation::constraint].
4169 ///
4170 /// Note that all the setters affecting `constraint` are mutually
4171 /// exclusive.
4172 ///
4173 /// # Example
4174 /// ```ignore,no_run
4175 /// # use google_cloud_cloudsecuritycompliance_v1::model::Validation;
4176 /// use google_cloud_cloudsecuritycompliance_v1::model::AllowedValues;
4177 /// let x = Validation::new().set_constraint(Some(
4178 /// google_cloud_cloudsecuritycompliance_v1::model::validation::Constraint::AllowedValues(AllowedValues::default().into())));
4179 /// ```
4180 pub fn set_constraint<
4181 T: std::convert::Into<std::option::Option<crate::model::validation::Constraint>>,
4182 >(
4183 mut self,
4184 v: T,
4185 ) -> Self {
4186 self.constraint = v.into();
4187 self
4188 }
4189
4190 /// The value of [constraint][crate::model::Validation::constraint]
4191 /// if it holds a `AllowedValues`, `None` if the field is not set or
4192 /// holds a different branch.
4193 pub fn allowed_values(
4194 &self,
4195 ) -> std::option::Option<&std::boxed::Box<crate::model::AllowedValues>> {
4196 #[allow(unreachable_patterns)]
4197 self.constraint.as_ref().and_then(|v| match v {
4198 crate::model::validation::Constraint::AllowedValues(v) => std::option::Option::Some(v),
4199 _ => std::option::Option::None,
4200 })
4201 }
4202
4203 /// Sets the value of [constraint][crate::model::Validation::constraint]
4204 /// to hold a `AllowedValues`.
4205 ///
4206 /// Note that all the setters affecting `constraint` are
4207 /// mutually exclusive.
4208 ///
4209 /// # Example
4210 /// ```ignore,no_run
4211 /// # use google_cloud_cloudsecuritycompliance_v1::model::Validation;
4212 /// use google_cloud_cloudsecuritycompliance_v1::model::AllowedValues;
4213 /// let x = Validation::new().set_allowed_values(AllowedValues::default()/* use setters */);
4214 /// assert!(x.allowed_values().is_some());
4215 /// assert!(x.int_range().is_none());
4216 /// assert!(x.regexp_pattern().is_none());
4217 /// ```
4218 pub fn set_allowed_values<
4219 T: std::convert::Into<std::boxed::Box<crate::model::AllowedValues>>,
4220 >(
4221 mut self,
4222 v: T,
4223 ) -> Self {
4224 self.constraint = std::option::Option::Some(
4225 crate::model::validation::Constraint::AllowedValues(v.into()),
4226 );
4227 self
4228 }
4229
4230 /// The value of [constraint][crate::model::Validation::constraint]
4231 /// if it holds a `IntRange`, `None` if the field is not set or
4232 /// holds a different branch.
4233 pub fn int_range(&self) -> std::option::Option<&std::boxed::Box<crate::model::IntRange>> {
4234 #[allow(unreachable_patterns)]
4235 self.constraint.as_ref().and_then(|v| match v {
4236 crate::model::validation::Constraint::IntRange(v) => std::option::Option::Some(v),
4237 _ => std::option::Option::None,
4238 })
4239 }
4240
4241 /// Sets the value of [constraint][crate::model::Validation::constraint]
4242 /// to hold a `IntRange`.
4243 ///
4244 /// Note that all the setters affecting `constraint` are
4245 /// mutually exclusive.
4246 ///
4247 /// # Example
4248 /// ```ignore,no_run
4249 /// # use google_cloud_cloudsecuritycompliance_v1::model::Validation;
4250 /// use google_cloud_cloudsecuritycompliance_v1::model::IntRange;
4251 /// let x = Validation::new().set_int_range(IntRange::default()/* use setters */);
4252 /// assert!(x.int_range().is_some());
4253 /// assert!(x.allowed_values().is_none());
4254 /// assert!(x.regexp_pattern().is_none());
4255 /// ```
4256 pub fn set_int_range<T: std::convert::Into<std::boxed::Box<crate::model::IntRange>>>(
4257 mut self,
4258 v: T,
4259 ) -> Self {
4260 self.constraint =
4261 std::option::Option::Some(crate::model::validation::Constraint::IntRange(v.into()));
4262 self
4263 }
4264
4265 /// The value of [constraint][crate::model::Validation::constraint]
4266 /// if it holds a `RegexpPattern`, `None` if the field is not set or
4267 /// holds a different branch.
4268 pub fn regexp_pattern(
4269 &self,
4270 ) -> std::option::Option<&std::boxed::Box<crate::model::RegexpPattern>> {
4271 #[allow(unreachable_patterns)]
4272 self.constraint.as_ref().and_then(|v| match v {
4273 crate::model::validation::Constraint::RegexpPattern(v) => std::option::Option::Some(v),
4274 _ => std::option::Option::None,
4275 })
4276 }
4277
4278 /// Sets the value of [constraint][crate::model::Validation::constraint]
4279 /// to hold a `RegexpPattern`.
4280 ///
4281 /// Note that all the setters affecting `constraint` are
4282 /// mutually exclusive.
4283 ///
4284 /// # Example
4285 /// ```ignore,no_run
4286 /// # use google_cloud_cloudsecuritycompliance_v1::model::Validation;
4287 /// use google_cloud_cloudsecuritycompliance_v1::model::RegexpPattern;
4288 /// let x = Validation::new().set_regexp_pattern(RegexpPattern::default()/* use setters */);
4289 /// assert!(x.regexp_pattern().is_some());
4290 /// assert!(x.allowed_values().is_none());
4291 /// assert!(x.int_range().is_none());
4292 /// ```
4293 pub fn set_regexp_pattern<
4294 T: std::convert::Into<std::boxed::Box<crate::model::RegexpPattern>>,
4295 >(
4296 mut self,
4297 v: T,
4298 ) -> Self {
4299 self.constraint = std::option::Option::Some(
4300 crate::model::validation::Constraint::RegexpPattern(v.into()),
4301 );
4302 self
4303 }
4304}
4305
4306impl wkt::message::Message for Validation {
4307 fn typename() -> &'static str {
4308 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.Validation"
4309 }
4310}
4311
4312/// Defines additional types related to [Validation].
4313pub mod validation {
4314 #[allow(unused_imports)]
4315 use super::*;
4316
4317 /// Defines validators for parameter values.
4318 #[derive(Clone, Debug, PartialEq)]
4319 #[non_exhaustive]
4320 pub enum Constraint {
4321 /// The permitted set of values for the parameter.
4322 AllowedValues(std::boxed::Box<crate::model::AllowedValues>),
4323 /// The permitted range for numeric parameters.
4324 IntRange(std::boxed::Box<crate::model::IntRange>),
4325 /// The regular expression for string parameters.
4326 RegexpPattern(std::boxed::Box<crate::model::RegexpPattern>),
4327 }
4328}
4329
4330/// The allowed set of values for the parameter.
4331#[derive(Clone, Default, PartialEq)]
4332#[non_exhaustive]
4333pub struct AllowedValues {
4334 /// Required. The list of allowed values for the parameter.
4335 pub values: std::vec::Vec<crate::model::ParamValue>,
4336
4337 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4338}
4339
4340impl AllowedValues {
4341 pub fn new() -> Self {
4342 std::default::Default::default()
4343 }
4344
4345 /// Sets the value of [values][crate::model::AllowedValues::values].
4346 ///
4347 /// # Example
4348 /// ```ignore,no_run
4349 /// # use google_cloud_cloudsecuritycompliance_v1::model::AllowedValues;
4350 /// use google_cloud_cloudsecuritycompliance_v1::model::ParamValue;
4351 /// let x = AllowedValues::new()
4352 /// .set_values([
4353 /// ParamValue::default()/* use setters */,
4354 /// ParamValue::default()/* use (different) setters */,
4355 /// ]);
4356 /// ```
4357 pub fn set_values<T, V>(mut self, v: T) -> Self
4358 where
4359 T: std::iter::IntoIterator<Item = V>,
4360 V: std::convert::Into<crate::model::ParamValue>,
4361 {
4362 use std::iter::Iterator;
4363 self.values = v.into_iter().map(|i| i.into()).collect();
4364 self
4365 }
4366}
4367
4368impl wkt::message::Message for AllowedValues {
4369 fn typename() -> &'static str {
4370 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.AllowedValues"
4371 }
4372}
4373
4374/// The regular expression (regex) validator for parameter values.
4375#[derive(Clone, Default, PartialEq)]
4376#[non_exhaustive]
4377pub struct RegexpPattern {
4378 /// Required. The regex pattern to match the values of the parameter with.
4379 pub pattern: std::string::String,
4380
4381 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4382}
4383
4384impl RegexpPattern {
4385 pub fn new() -> Self {
4386 std::default::Default::default()
4387 }
4388
4389 /// Sets the value of [pattern][crate::model::RegexpPattern::pattern].
4390 ///
4391 /// # Example
4392 /// ```ignore,no_run
4393 /// # use google_cloud_cloudsecuritycompliance_v1::model::RegexpPattern;
4394 /// let x = RegexpPattern::new().set_pattern("example");
4395 /// ```
4396 pub fn set_pattern<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4397 self.pattern = v.into();
4398 self
4399 }
4400}
4401
4402impl wkt::message::Message for RegexpPattern {
4403 fn typename() -> &'static str {
4404 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.RegexpPattern"
4405 }
4406}
4407
4408/// The number range for number parameters.
4409#[derive(Clone, Default, PartialEq)]
4410#[non_exhaustive]
4411pub struct IntRange {
4412 /// Required. The minimum permitted value for the numeric parameter
4413 /// (inclusive).
4414 pub min: i64,
4415
4416 /// Required. The maximum permitted value for the numeric parameter
4417 /// (inclusive).
4418 pub max: i64,
4419
4420 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4421}
4422
4423impl IntRange {
4424 pub fn new() -> Self {
4425 std::default::Default::default()
4426 }
4427
4428 /// Sets the value of [min][crate::model::IntRange::min].
4429 ///
4430 /// # Example
4431 /// ```ignore,no_run
4432 /// # use google_cloud_cloudsecuritycompliance_v1::model::IntRange;
4433 /// let x = IntRange::new().set_min(42);
4434 /// ```
4435 pub fn set_min<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4436 self.min = v.into();
4437 self
4438 }
4439
4440 /// Sets the value of [max][crate::model::IntRange::max].
4441 ///
4442 /// # Example
4443 /// ```ignore,no_run
4444 /// # use google_cloud_cloudsecuritycompliance_v1::model::IntRange;
4445 /// let x = IntRange::new().set_max(42);
4446 /// ```
4447 pub fn set_max<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4448 self.max = v.into();
4449 self
4450 }
4451}
4452
4453impl wkt::message::Message for IntRange {
4454 fn typename() -> &'static str {
4455 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.IntRange"
4456 }
4457}
4458
4459/// A list of strings for the parameter value.
4460#[derive(Clone, Default, PartialEq)]
4461#[non_exhaustive]
4462pub struct StringList {
4463 /// Required. The strings in the list.
4464 pub values: std::vec::Vec<std::string::String>,
4465
4466 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4467}
4468
4469impl StringList {
4470 pub fn new() -> Self {
4471 std::default::Default::default()
4472 }
4473
4474 /// Sets the value of [values][crate::model::StringList::values].
4475 ///
4476 /// # Example
4477 /// ```ignore,no_run
4478 /// # use google_cloud_cloudsecuritycompliance_v1::model::StringList;
4479 /// let x = StringList::new().set_values(["a", "b", "c"]);
4480 /// ```
4481 pub fn set_values<T, V>(mut self, v: T) -> Self
4482 where
4483 T: std::iter::IntoIterator<Item = V>,
4484 V: std::convert::Into<std::string::String>,
4485 {
4486 use std::iter::Iterator;
4487 self.values = v.into_iter().map(|i| i.into()).collect();
4488 self
4489 }
4490}
4491
4492impl wkt::message::Message for StringList {
4493 fn typename() -> &'static str {
4494 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.StringList"
4495 }
4496}
4497
4498/// The possible parameter value types.
4499#[derive(Clone, Default, PartialEq)]
4500#[non_exhaustive]
4501pub struct ParamValue {
4502 /// The list of possible parameter value types.
4503 pub kind: std::option::Option<crate::model::param_value::Kind>,
4504
4505 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4506}
4507
4508impl ParamValue {
4509 pub fn new() -> Self {
4510 std::default::Default::default()
4511 }
4512
4513 /// Sets the value of [kind][crate::model::ParamValue::kind].
4514 ///
4515 /// Note that all the setters affecting `kind` are mutually
4516 /// exclusive.
4517 ///
4518 /// # Example
4519 /// ```ignore,no_run
4520 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParamValue;
4521 /// use google_cloud_cloudsecuritycompliance_v1::model::param_value::Kind;
4522 /// let x = ParamValue::new().set_kind(Some(Kind::StringValue("example".to_string())));
4523 /// ```
4524 pub fn set_kind<T: std::convert::Into<std::option::Option<crate::model::param_value::Kind>>>(
4525 mut self,
4526 v: T,
4527 ) -> Self {
4528 self.kind = v.into();
4529 self
4530 }
4531
4532 /// The value of [kind][crate::model::ParamValue::kind]
4533 /// if it holds a `StringValue`, `None` if the field is not set or
4534 /// holds a different branch.
4535 pub fn string_value(&self) -> std::option::Option<&std::string::String> {
4536 #[allow(unreachable_patterns)]
4537 self.kind.as_ref().and_then(|v| match v {
4538 crate::model::param_value::Kind::StringValue(v) => std::option::Option::Some(v),
4539 _ => std::option::Option::None,
4540 })
4541 }
4542
4543 /// Sets the value of [kind][crate::model::ParamValue::kind]
4544 /// to hold a `StringValue`.
4545 ///
4546 /// Note that all the setters affecting `kind` are
4547 /// mutually exclusive.
4548 ///
4549 /// # Example
4550 /// ```ignore,no_run
4551 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParamValue;
4552 /// let x = ParamValue::new().set_string_value("example");
4553 /// assert!(x.string_value().is_some());
4554 /// assert!(x.bool_value().is_none());
4555 /// assert!(x.string_list_value().is_none());
4556 /// assert!(x.number_value().is_none());
4557 /// assert!(x.oneof_value().is_none());
4558 /// ```
4559 pub fn set_string_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4560 self.kind =
4561 std::option::Option::Some(crate::model::param_value::Kind::StringValue(v.into()));
4562 self
4563 }
4564
4565 /// The value of [kind][crate::model::ParamValue::kind]
4566 /// if it holds a `BoolValue`, `None` if the field is not set or
4567 /// holds a different branch.
4568 pub fn bool_value(&self) -> std::option::Option<&bool> {
4569 #[allow(unreachable_patterns)]
4570 self.kind.as_ref().and_then(|v| match v {
4571 crate::model::param_value::Kind::BoolValue(v) => std::option::Option::Some(v),
4572 _ => std::option::Option::None,
4573 })
4574 }
4575
4576 /// Sets the value of [kind][crate::model::ParamValue::kind]
4577 /// to hold a `BoolValue`.
4578 ///
4579 /// Note that all the setters affecting `kind` are
4580 /// mutually exclusive.
4581 ///
4582 /// # Example
4583 /// ```ignore,no_run
4584 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParamValue;
4585 /// let x = ParamValue::new().set_bool_value(true);
4586 /// assert!(x.bool_value().is_some());
4587 /// assert!(x.string_value().is_none());
4588 /// assert!(x.string_list_value().is_none());
4589 /// assert!(x.number_value().is_none());
4590 /// assert!(x.oneof_value().is_none());
4591 /// ```
4592 pub fn set_bool_value<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4593 self.kind = std::option::Option::Some(crate::model::param_value::Kind::BoolValue(v.into()));
4594 self
4595 }
4596
4597 /// The value of [kind][crate::model::ParamValue::kind]
4598 /// if it holds a `StringListValue`, `None` if the field is not set or
4599 /// holds a different branch.
4600 pub fn string_list_value(
4601 &self,
4602 ) -> std::option::Option<&std::boxed::Box<crate::model::StringList>> {
4603 #[allow(unreachable_patterns)]
4604 self.kind.as_ref().and_then(|v| match v {
4605 crate::model::param_value::Kind::StringListValue(v) => std::option::Option::Some(v),
4606 _ => std::option::Option::None,
4607 })
4608 }
4609
4610 /// Sets the value of [kind][crate::model::ParamValue::kind]
4611 /// to hold a `StringListValue`.
4612 ///
4613 /// Note that all the setters affecting `kind` are
4614 /// mutually exclusive.
4615 ///
4616 /// # Example
4617 /// ```ignore,no_run
4618 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParamValue;
4619 /// use google_cloud_cloudsecuritycompliance_v1::model::StringList;
4620 /// let x = ParamValue::new().set_string_list_value(StringList::default()/* use setters */);
4621 /// assert!(x.string_list_value().is_some());
4622 /// assert!(x.string_value().is_none());
4623 /// assert!(x.bool_value().is_none());
4624 /// assert!(x.number_value().is_none());
4625 /// assert!(x.oneof_value().is_none());
4626 /// ```
4627 pub fn set_string_list_value<
4628 T: std::convert::Into<std::boxed::Box<crate::model::StringList>>,
4629 >(
4630 mut self,
4631 v: T,
4632 ) -> Self {
4633 self.kind =
4634 std::option::Option::Some(crate::model::param_value::Kind::StringListValue(v.into()));
4635 self
4636 }
4637
4638 /// The value of [kind][crate::model::ParamValue::kind]
4639 /// if it holds a `NumberValue`, `None` if the field is not set or
4640 /// holds a different branch.
4641 pub fn number_value(&self) -> std::option::Option<&f64> {
4642 #[allow(unreachable_patterns)]
4643 self.kind.as_ref().and_then(|v| match v {
4644 crate::model::param_value::Kind::NumberValue(v) => std::option::Option::Some(v),
4645 _ => std::option::Option::None,
4646 })
4647 }
4648
4649 /// Sets the value of [kind][crate::model::ParamValue::kind]
4650 /// to hold a `NumberValue`.
4651 ///
4652 /// Note that all the setters affecting `kind` are
4653 /// mutually exclusive.
4654 ///
4655 /// # Example
4656 /// ```ignore,no_run
4657 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParamValue;
4658 /// let x = ParamValue::new().set_number_value(42.0);
4659 /// assert!(x.number_value().is_some());
4660 /// assert!(x.string_value().is_none());
4661 /// assert!(x.bool_value().is_none());
4662 /// assert!(x.string_list_value().is_none());
4663 /// assert!(x.oneof_value().is_none());
4664 /// ```
4665 pub fn set_number_value<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
4666 self.kind =
4667 std::option::Option::Some(crate::model::param_value::Kind::NumberValue(v.into()));
4668 self
4669 }
4670
4671 /// The value of [kind][crate::model::ParamValue::kind]
4672 /// if it holds a `OneofValue`, `None` if the field is not set or
4673 /// holds a different branch.
4674 pub fn oneof_value(&self) -> std::option::Option<&std::boxed::Box<crate::model::Parameter>> {
4675 #[allow(unreachable_patterns)]
4676 self.kind.as_ref().and_then(|v| match v {
4677 crate::model::param_value::Kind::OneofValue(v) => std::option::Option::Some(v),
4678 _ => std::option::Option::None,
4679 })
4680 }
4681
4682 /// Sets the value of [kind][crate::model::ParamValue::kind]
4683 /// to hold a `OneofValue`.
4684 ///
4685 /// Note that all the setters affecting `kind` are
4686 /// mutually exclusive.
4687 ///
4688 /// # Example
4689 /// ```ignore,no_run
4690 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParamValue;
4691 /// use google_cloud_cloudsecuritycompliance_v1::model::Parameter;
4692 /// let x = ParamValue::new().set_oneof_value(Parameter::default()/* use setters */);
4693 /// assert!(x.oneof_value().is_some());
4694 /// assert!(x.string_value().is_none());
4695 /// assert!(x.bool_value().is_none());
4696 /// assert!(x.string_list_value().is_none());
4697 /// assert!(x.number_value().is_none());
4698 /// ```
4699 pub fn set_oneof_value<T: std::convert::Into<std::boxed::Box<crate::model::Parameter>>>(
4700 mut self,
4701 v: T,
4702 ) -> Self {
4703 self.kind =
4704 std::option::Option::Some(crate::model::param_value::Kind::OneofValue(v.into()));
4705 self
4706 }
4707}
4708
4709impl wkt::message::Message for ParamValue {
4710 fn typename() -> &'static str {
4711 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ParamValue"
4712 }
4713}
4714
4715/// Defines additional types related to [ParamValue].
4716pub mod param_value {
4717 #[allow(unused_imports)]
4718 use super::*;
4719
4720 /// The list of possible parameter value types.
4721 #[derive(Clone, Debug, PartialEq)]
4722 #[non_exhaustive]
4723 pub enum Kind {
4724 /// A string value.
4725 StringValue(std::string::String),
4726 /// A boolean value.
4727 BoolValue(bool),
4728 /// A repeated string.
4729 StringListValue(std::boxed::Box<crate::model::StringList>),
4730 /// A double value.
4731 NumberValue(f64),
4732 /// Sub-parameter values.
4733 OneofValue(std::boxed::Box<crate::model::Parameter>),
4734 }
4735}
4736
4737/// The parameter substitution rules.
4738#[derive(Clone, Default, PartialEq)]
4739#[non_exhaustive]
4740pub struct ParameterSubstitutionRule {
4741 /// The type of substitution.
4742 pub substitution_type:
4743 std::option::Option<crate::model::parameter_substitution_rule::SubstitutionType>,
4744
4745 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4746}
4747
4748impl ParameterSubstitutionRule {
4749 pub fn new() -> Self {
4750 std::default::Default::default()
4751 }
4752
4753 /// Sets the value of [substitution_type][crate::model::ParameterSubstitutionRule::substitution_type].
4754 ///
4755 /// Note that all the setters affecting `substitution_type` are mutually
4756 /// exclusive.
4757 ///
4758 /// # Example
4759 /// ```ignore,no_run
4760 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSubstitutionRule;
4761 /// use google_cloud_cloudsecuritycompliance_v1::model::PlaceholderSubstitutionRule;
4762 /// let x = ParameterSubstitutionRule::new().set_substitution_type(Some(
4763 /// google_cloud_cloudsecuritycompliance_v1::model::parameter_substitution_rule::SubstitutionType::PlaceholderSubstitutionRule(PlaceholderSubstitutionRule::default().into())));
4764 /// ```
4765 pub fn set_substitution_type<
4766 T: std::convert::Into<
4767 std::option::Option<crate::model::parameter_substitution_rule::SubstitutionType>,
4768 >,
4769 >(
4770 mut self,
4771 v: T,
4772 ) -> Self {
4773 self.substitution_type = v.into();
4774 self
4775 }
4776
4777 /// The value of [substitution_type][crate::model::ParameterSubstitutionRule::substitution_type]
4778 /// if it holds a `PlaceholderSubstitutionRule`, `None` if the field is not set or
4779 /// holds a different branch.
4780 pub fn placeholder_substitution_rule(
4781 &self,
4782 ) -> std::option::Option<&std::boxed::Box<crate::model::PlaceholderSubstitutionRule>> {
4783 #[allow(unreachable_patterns)]
4784 self.substitution_type.as_ref().and_then(|v| match v {
4785 crate::model::parameter_substitution_rule::SubstitutionType::PlaceholderSubstitutionRule(v) => std::option::Option::Some(v),
4786 _ => std::option::Option::None,
4787 })
4788 }
4789
4790 /// Sets the value of [substitution_type][crate::model::ParameterSubstitutionRule::substitution_type]
4791 /// to hold a `PlaceholderSubstitutionRule`.
4792 ///
4793 /// Note that all the setters affecting `substitution_type` are
4794 /// mutually exclusive.
4795 ///
4796 /// # Example
4797 /// ```ignore,no_run
4798 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSubstitutionRule;
4799 /// use google_cloud_cloudsecuritycompliance_v1::model::PlaceholderSubstitutionRule;
4800 /// let x = ParameterSubstitutionRule::new().set_placeholder_substitution_rule(PlaceholderSubstitutionRule::default()/* use setters */);
4801 /// assert!(x.placeholder_substitution_rule().is_some());
4802 /// assert!(x.attribute_substitution_rule().is_none());
4803 /// ```
4804 pub fn set_placeholder_substitution_rule<
4805 T: std::convert::Into<std::boxed::Box<crate::model::PlaceholderSubstitutionRule>>,
4806 >(
4807 mut self,
4808 v: T,
4809 ) -> Self {
4810 self.substitution_type = std::option::Option::Some(
4811 crate::model::parameter_substitution_rule::SubstitutionType::PlaceholderSubstitutionRule(
4812 v.into()
4813 )
4814 );
4815 self
4816 }
4817
4818 /// The value of [substitution_type][crate::model::ParameterSubstitutionRule::substitution_type]
4819 /// if it holds a `AttributeSubstitutionRule`, `None` if the field is not set or
4820 /// holds a different branch.
4821 pub fn attribute_substitution_rule(
4822 &self,
4823 ) -> std::option::Option<&std::boxed::Box<crate::model::AttributeSubstitutionRule>> {
4824 #[allow(unreachable_patterns)]
4825 self.substitution_type.as_ref().and_then(|v| match v {
4826 crate::model::parameter_substitution_rule::SubstitutionType::AttributeSubstitutionRule(v) => std::option::Option::Some(v),
4827 _ => std::option::Option::None,
4828 })
4829 }
4830
4831 /// Sets the value of [substitution_type][crate::model::ParameterSubstitutionRule::substitution_type]
4832 /// to hold a `AttributeSubstitutionRule`.
4833 ///
4834 /// Note that all the setters affecting `substitution_type` are
4835 /// mutually exclusive.
4836 ///
4837 /// # Example
4838 /// ```ignore,no_run
4839 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSubstitutionRule;
4840 /// use google_cloud_cloudsecuritycompliance_v1::model::AttributeSubstitutionRule;
4841 /// let x = ParameterSubstitutionRule::new().set_attribute_substitution_rule(AttributeSubstitutionRule::default()/* use setters */);
4842 /// assert!(x.attribute_substitution_rule().is_some());
4843 /// assert!(x.placeholder_substitution_rule().is_none());
4844 /// ```
4845 pub fn set_attribute_substitution_rule<
4846 T: std::convert::Into<std::boxed::Box<crate::model::AttributeSubstitutionRule>>,
4847 >(
4848 mut self,
4849 v: T,
4850 ) -> Self {
4851 self.substitution_type = std::option::Option::Some(
4852 crate::model::parameter_substitution_rule::SubstitutionType::AttributeSubstitutionRule(
4853 v.into(),
4854 ),
4855 );
4856 self
4857 }
4858}
4859
4860impl wkt::message::Message for ParameterSubstitutionRule {
4861 fn typename() -> &'static str {
4862 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ParameterSubstitutionRule"
4863 }
4864}
4865
4866/// Defines additional types related to [ParameterSubstitutionRule].
4867pub mod parameter_substitution_rule {
4868 #[allow(unused_imports)]
4869 use super::*;
4870
4871 /// The type of substitution.
4872 #[derive(Clone, Debug, PartialEq)]
4873 #[non_exhaustive]
4874 pub enum SubstitutionType {
4875 /// The placeholder substitution rule.
4876 PlaceholderSubstitutionRule(std::boxed::Box<crate::model::PlaceholderSubstitutionRule>),
4877 /// The attribute substitution rule.
4878 AttributeSubstitutionRule(std::boxed::Box<crate::model::AttributeSubstitutionRule>),
4879 }
4880}
4881
4882/// The attribute at the given path that's substituted entirely.
4883#[derive(Clone, Default, PartialEq)]
4884#[non_exhaustive]
4885pub struct AttributeSubstitutionRule {
4886 /// The fully qualified proto attribute path, in dot notation.
4887 /// For example: `rules[0].cel_expression.resource_types_values`
4888 pub attribute: std::string::String,
4889
4890 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4891}
4892
4893impl AttributeSubstitutionRule {
4894 pub fn new() -> Self {
4895 std::default::Default::default()
4896 }
4897
4898 /// Sets the value of [attribute][crate::model::AttributeSubstitutionRule::attribute].
4899 ///
4900 /// # Example
4901 /// ```ignore,no_run
4902 /// # use google_cloud_cloudsecuritycompliance_v1::model::AttributeSubstitutionRule;
4903 /// let x = AttributeSubstitutionRule::new().set_attribute("example");
4904 /// ```
4905 pub fn set_attribute<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4906 self.attribute = v.into();
4907 self
4908 }
4909}
4910
4911impl wkt::message::Message for AttributeSubstitutionRule {
4912 fn typename() -> &'static str {
4913 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.AttributeSubstitutionRule"
4914 }
4915}
4916
4917/// The placeholder that's substituted in the rendered string.
4918#[derive(Clone, Default, PartialEq)]
4919#[non_exhaustive]
4920pub struct PlaceholderSubstitutionRule {
4921 /// The fully qualified proto attribute path, in dot notation.
4922 pub attribute: std::string::String,
4923
4924 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4925}
4926
4927impl PlaceholderSubstitutionRule {
4928 pub fn new() -> Self {
4929 std::default::Default::default()
4930 }
4931
4932 /// Sets the value of [attribute][crate::model::PlaceholderSubstitutionRule::attribute].
4933 ///
4934 /// # Example
4935 /// ```ignore,no_run
4936 /// # use google_cloud_cloudsecuritycompliance_v1::model::PlaceholderSubstitutionRule;
4937 /// let x = PlaceholderSubstitutionRule::new().set_attribute("example");
4938 /// ```
4939 pub fn set_attribute<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4940 self.attribute = v.into();
4941 self
4942 }
4943}
4944
4945impl wkt::message::Message for PlaceholderSubstitutionRule {
4946 fn typename() -> &'static str {
4947 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.PlaceholderSubstitutionRule"
4948 }
4949}
4950
4951/// A rule in the cloud control.
4952#[derive(Clone, Default, PartialEq)]
4953#[non_exhaustive]
4954pub struct Rule {
4955 /// Optional. The rule description. The maximum length is 2000 characters.
4956 pub description: std::string::String,
4957
4958 /// Required. The functionality that's enabled by the rule.
4959 pub rule_action_types: std::vec::Vec<crate::model::RuleActionType>,
4960
4961 /// The rule implementation.
4962 pub implementation: std::option::Option<crate::model::rule::Implementation>,
4963
4964 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4965}
4966
4967impl Rule {
4968 pub fn new() -> Self {
4969 std::default::Default::default()
4970 }
4971
4972 /// Sets the value of [description][crate::model::Rule::description].
4973 ///
4974 /// # Example
4975 /// ```ignore,no_run
4976 /// # use google_cloud_cloudsecuritycompliance_v1::model::Rule;
4977 /// let x = Rule::new().set_description("example");
4978 /// ```
4979 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4980 self.description = v.into();
4981 self
4982 }
4983
4984 /// Sets the value of [rule_action_types][crate::model::Rule::rule_action_types].
4985 ///
4986 /// # Example
4987 /// ```ignore,no_run
4988 /// # use google_cloud_cloudsecuritycompliance_v1::model::Rule;
4989 /// use google_cloud_cloudsecuritycompliance_v1::model::RuleActionType;
4990 /// let x = Rule::new().set_rule_action_types([
4991 /// RuleActionType::Preventive,
4992 /// RuleActionType::Detective,
4993 /// RuleActionType::Audit,
4994 /// ]);
4995 /// ```
4996 pub fn set_rule_action_types<T, V>(mut self, v: T) -> Self
4997 where
4998 T: std::iter::IntoIterator<Item = V>,
4999 V: std::convert::Into<crate::model::RuleActionType>,
5000 {
5001 use std::iter::Iterator;
5002 self.rule_action_types = v.into_iter().map(|i| i.into()).collect();
5003 self
5004 }
5005
5006 /// Sets the value of [implementation][crate::model::Rule::implementation].
5007 ///
5008 /// Note that all the setters affecting `implementation` are mutually
5009 /// exclusive.
5010 ///
5011 /// # Example
5012 /// ```ignore,no_run
5013 /// # use google_cloud_cloudsecuritycompliance_v1::model::Rule;
5014 /// use google_cloud_cloudsecuritycompliance_v1::model::CELExpression;
5015 /// let x = Rule::new().set_implementation(Some(
5016 /// google_cloud_cloudsecuritycompliance_v1::model::rule::Implementation::CelExpression(CELExpression::default().into())));
5017 /// ```
5018 pub fn set_implementation<
5019 T: std::convert::Into<std::option::Option<crate::model::rule::Implementation>>,
5020 >(
5021 mut self,
5022 v: T,
5023 ) -> Self {
5024 self.implementation = v.into();
5025 self
5026 }
5027
5028 /// The value of [implementation][crate::model::Rule::implementation]
5029 /// if it holds a `CelExpression`, `None` if the field is not set or
5030 /// holds a different branch.
5031 pub fn cel_expression(
5032 &self,
5033 ) -> std::option::Option<&std::boxed::Box<crate::model::CELExpression>> {
5034 #[allow(unreachable_patterns)]
5035 self.implementation.as_ref().and_then(|v| match v {
5036 crate::model::rule::Implementation::CelExpression(v) => std::option::Option::Some(v),
5037 _ => std::option::Option::None,
5038 })
5039 }
5040
5041 /// Sets the value of [implementation][crate::model::Rule::implementation]
5042 /// to hold a `CelExpression`.
5043 ///
5044 /// Note that all the setters affecting `implementation` are
5045 /// mutually exclusive.
5046 ///
5047 /// # Example
5048 /// ```ignore,no_run
5049 /// # use google_cloud_cloudsecuritycompliance_v1::model::Rule;
5050 /// use google_cloud_cloudsecuritycompliance_v1::model::CELExpression;
5051 /// let x = Rule::new().set_cel_expression(CELExpression::default()/* use setters */);
5052 /// assert!(x.cel_expression().is_some());
5053 /// ```
5054 pub fn set_cel_expression<
5055 T: std::convert::Into<std::boxed::Box<crate::model::CELExpression>>,
5056 >(
5057 mut self,
5058 v: T,
5059 ) -> Self {
5060 self.implementation =
5061 std::option::Option::Some(crate::model::rule::Implementation::CelExpression(v.into()));
5062 self
5063 }
5064}
5065
5066impl wkt::message::Message for Rule {
5067 fn typename() -> &'static str {
5068 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.Rule"
5069 }
5070}
5071
5072/// Defines additional types related to [Rule].
5073pub mod rule {
5074 #[allow(unused_imports)]
5075 use super::*;
5076
5077 /// The rule implementation.
5078 #[derive(Clone, Debug, PartialEq)]
5079 #[non_exhaustive]
5080 pub enum Implementation {
5081 /// The rule's logic expression in Common Expression Language (CEL).
5082 CelExpression(std::boxed::Box<crate::model::CELExpression>),
5083 }
5084}
5085
5086/// A Common Expression Language (CEL) expression that's used to create a rule.
5087#[derive(Clone, Default, PartialEq)]
5088#[non_exhaustive]
5089pub struct CELExpression {
5090 /// Required. The logical expression in CEL. The maximum length of the
5091 /// condition is 1000 characters. For more information, see [CEL
5092 /// expression](https://cloud.google.com/security-command-center/docs/compliance-manager-write-cel-expressions).
5093 pub expression: std::string::String,
5094
5095 /// The criteria of the CEL expression.
5096 pub criteria: std::option::Option<crate::model::cel_expression::Criteria>,
5097
5098 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5099}
5100
5101impl CELExpression {
5102 pub fn new() -> Self {
5103 std::default::Default::default()
5104 }
5105
5106 /// Sets the value of [expression][crate::model::CELExpression::expression].
5107 ///
5108 /// # Example
5109 /// ```ignore,no_run
5110 /// # use google_cloud_cloudsecuritycompliance_v1::model::CELExpression;
5111 /// let x = CELExpression::new().set_expression("example");
5112 /// ```
5113 pub fn set_expression<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5114 self.expression = v.into();
5115 self
5116 }
5117
5118 /// Sets the value of [criteria][crate::model::CELExpression::criteria].
5119 ///
5120 /// Note that all the setters affecting `criteria` are mutually
5121 /// exclusive.
5122 ///
5123 /// # Example
5124 /// ```ignore,no_run
5125 /// # use google_cloud_cloudsecuritycompliance_v1::model::CELExpression;
5126 /// use google_cloud_cloudsecuritycompliance_v1::model::StringList;
5127 /// let x = CELExpression::new().set_criteria(Some(
5128 /// google_cloud_cloudsecuritycompliance_v1::model::cel_expression::Criteria::ResourceTypesValues(StringList::default().into())));
5129 /// ```
5130 pub fn set_criteria<
5131 T: std::convert::Into<std::option::Option<crate::model::cel_expression::Criteria>>,
5132 >(
5133 mut self,
5134 v: T,
5135 ) -> Self {
5136 self.criteria = v.into();
5137 self
5138 }
5139
5140 /// The value of [criteria][crate::model::CELExpression::criteria]
5141 /// if it holds a `ResourceTypesValues`, `None` if the field is not set or
5142 /// holds a different branch.
5143 pub fn resource_types_values(
5144 &self,
5145 ) -> std::option::Option<&std::boxed::Box<crate::model::StringList>> {
5146 #[allow(unreachable_patterns)]
5147 self.criteria.as_ref().and_then(|v| match v {
5148 crate::model::cel_expression::Criteria::ResourceTypesValues(v) => {
5149 std::option::Option::Some(v)
5150 }
5151 _ => std::option::Option::None,
5152 })
5153 }
5154
5155 /// Sets the value of [criteria][crate::model::CELExpression::criteria]
5156 /// to hold a `ResourceTypesValues`.
5157 ///
5158 /// Note that all the setters affecting `criteria` are
5159 /// mutually exclusive.
5160 ///
5161 /// # Example
5162 /// ```ignore,no_run
5163 /// # use google_cloud_cloudsecuritycompliance_v1::model::CELExpression;
5164 /// use google_cloud_cloudsecuritycompliance_v1::model::StringList;
5165 /// let x = CELExpression::new().set_resource_types_values(StringList::default()/* use setters */);
5166 /// assert!(x.resource_types_values().is_some());
5167 /// ```
5168 pub fn set_resource_types_values<
5169 T: std::convert::Into<std::boxed::Box<crate::model::StringList>>,
5170 >(
5171 mut self,
5172 v: T,
5173 ) -> Self {
5174 self.criteria = std::option::Option::Some(
5175 crate::model::cel_expression::Criteria::ResourceTypesValues(v.into()),
5176 );
5177 self
5178 }
5179}
5180
5181impl wkt::message::Message for CELExpression {
5182 fn typename() -> &'static str {
5183 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CELExpression"
5184 }
5185}
5186
5187/// Defines additional types related to [CELExpression].
5188pub mod cel_expression {
5189 #[allow(unused_imports)]
5190 use super::*;
5191
5192 /// The criteria of the CEL expression.
5193 #[derive(Clone, Debug, PartialEq)]
5194 #[non_exhaustive]
5195 pub enum Criteria {
5196 /// The resource instance types on which this expression is defined.
5197 /// The format is `<SERVICE_NAME>/<type>`.
5198 /// For example: `compute.googleapis.com/Instance`
5199 ResourceTypesValues(std::boxed::Box<crate::model::StringList>),
5200 }
5201}
5202
5203/// The metadata for the long-running operation.
5204#[derive(Clone, Default, PartialEq)]
5205#[non_exhaustive]
5206pub struct OperationMetadata {
5207 /// Output only. The time the operation was created.
5208 pub create_time: std::option::Option<wkt::Timestamp>,
5209
5210 /// Output only. The time the operation finished running.
5211 pub end_time: std::option::Option<wkt::Timestamp>,
5212
5213 /// Output only. The server-defined resource path for the target of the
5214 /// operation.
5215 pub target: std::string::String,
5216
5217 /// Output only. The name of the verb that was executed by the operation.
5218 pub verb: std::string::String,
5219
5220 /// Output only. The human-readable status of the operation, if any.
5221 pub status_message: std::string::String,
5222
5223 /// Output only. Identifies whether the user has requested that the operation
5224 /// be cancelled. If an operation was cancelled successfully, then the field
5225 /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
5226 /// contains the value [google.rpc.Code.CANCELLED][google.rpc.Code.CANCELLED].
5227 ///
5228 /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
5229 pub requested_cancellation: bool,
5230
5231 /// Output only. The API version that was used to start the operation.
5232 pub api_version: std::string::String,
5233
5234 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5235}
5236
5237impl OperationMetadata {
5238 pub fn new() -> Self {
5239 std::default::Default::default()
5240 }
5241
5242 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
5243 ///
5244 /// # Example
5245 /// ```ignore,no_run
5246 /// # use google_cloud_cloudsecuritycompliance_v1::model::OperationMetadata;
5247 /// use wkt::Timestamp;
5248 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
5249 /// ```
5250 pub fn set_create_time<T>(mut self, v: T) -> Self
5251 where
5252 T: std::convert::Into<wkt::Timestamp>,
5253 {
5254 self.create_time = std::option::Option::Some(v.into());
5255 self
5256 }
5257
5258 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
5259 ///
5260 /// # Example
5261 /// ```ignore,no_run
5262 /// # use google_cloud_cloudsecuritycompliance_v1::model::OperationMetadata;
5263 /// use wkt::Timestamp;
5264 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5265 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
5266 /// ```
5267 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5268 where
5269 T: std::convert::Into<wkt::Timestamp>,
5270 {
5271 self.create_time = v.map(|x| x.into());
5272 self
5273 }
5274
5275 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
5276 ///
5277 /// # Example
5278 /// ```ignore,no_run
5279 /// # use google_cloud_cloudsecuritycompliance_v1::model::OperationMetadata;
5280 /// use wkt::Timestamp;
5281 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
5282 /// ```
5283 pub fn set_end_time<T>(mut self, v: T) -> Self
5284 where
5285 T: std::convert::Into<wkt::Timestamp>,
5286 {
5287 self.end_time = std::option::Option::Some(v.into());
5288 self
5289 }
5290
5291 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
5292 ///
5293 /// # Example
5294 /// ```ignore,no_run
5295 /// # use google_cloud_cloudsecuritycompliance_v1::model::OperationMetadata;
5296 /// use wkt::Timestamp;
5297 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
5298 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
5299 /// ```
5300 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
5301 where
5302 T: std::convert::Into<wkt::Timestamp>,
5303 {
5304 self.end_time = v.map(|x| x.into());
5305 self
5306 }
5307
5308 /// Sets the value of [target][crate::model::OperationMetadata::target].
5309 ///
5310 /// # Example
5311 /// ```ignore,no_run
5312 /// # use google_cloud_cloudsecuritycompliance_v1::model::OperationMetadata;
5313 /// let x = OperationMetadata::new().set_target("example");
5314 /// ```
5315 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5316 self.target = v.into();
5317 self
5318 }
5319
5320 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
5321 ///
5322 /// # Example
5323 /// ```ignore,no_run
5324 /// # use google_cloud_cloudsecuritycompliance_v1::model::OperationMetadata;
5325 /// let x = OperationMetadata::new().set_verb("example");
5326 /// ```
5327 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5328 self.verb = v.into();
5329 self
5330 }
5331
5332 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
5333 ///
5334 /// # Example
5335 /// ```ignore,no_run
5336 /// # use google_cloud_cloudsecuritycompliance_v1::model::OperationMetadata;
5337 /// let x = OperationMetadata::new().set_status_message("example");
5338 /// ```
5339 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5340 self.status_message = v.into();
5341 self
5342 }
5343
5344 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
5345 ///
5346 /// # Example
5347 /// ```ignore,no_run
5348 /// # use google_cloud_cloudsecuritycompliance_v1::model::OperationMetadata;
5349 /// let x = OperationMetadata::new().set_requested_cancellation(true);
5350 /// ```
5351 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5352 self.requested_cancellation = v.into();
5353 self
5354 }
5355
5356 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
5357 ///
5358 /// # Example
5359 /// ```ignore,no_run
5360 /// # use google_cloud_cloudsecuritycompliance_v1::model::OperationMetadata;
5361 /// let x = OperationMetadata::new().set_api_version("example");
5362 /// ```
5363 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5364 self.api_version = v.into();
5365 self
5366 }
5367}
5368
5369impl wkt::message::Message for OperationMetadata {
5370 fn typename() -> &'static str {
5371 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.OperationMetadata"
5372 }
5373}
5374
5375/// The regulatory family of the control.
5376#[derive(Clone, Default, PartialEq)]
5377#[non_exhaustive]
5378pub struct ControlFamily {
5379 /// The identifier for the regulatory control family.
5380 pub family_id: std::string::String,
5381
5382 /// The friendly name for the regulatory control family.
5383 pub display_name: std::string::String,
5384
5385 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5386}
5387
5388impl ControlFamily {
5389 pub fn new() -> Self {
5390 std::default::Default::default()
5391 }
5392
5393 /// Sets the value of [family_id][crate::model::ControlFamily::family_id].
5394 ///
5395 /// # Example
5396 /// ```ignore,no_run
5397 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlFamily;
5398 /// let x = ControlFamily::new().set_family_id("example");
5399 /// ```
5400 pub fn set_family_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5401 self.family_id = v.into();
5402 self
5403 }
5404
5405 /// Sets the value of [display_name][crate::model::ControlFamily::display_name].
5406 ///
5407 /// # Example
5408 /// ```ignore,no_run
5409 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlFamily;
5410 /// let x = ControlFamily::new().set_display_name("example");
5411 /// ```
5412 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5413 self.display_name = v.into();
5414 self
5415 }
5416}
5417
5418impl wkt::message::Message for ControlFamily {
5419 fn typename() -> &'static str {
5420 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ControlFamily"
5421 }
5422}
5423
5424/// Request message for [ListFrameworks][].
5425#[derive(Clone, Default, PartialEq)]
5426#[non_exhaustive]
5427pub struct ListFrameworksRequest {
5428 /// Required. The parent resource name, in the format
5429 /// `organizations/{organization}/locations/{location}`.
5430 /// The only supported location is `global`.
5431 pub parent: std::string::String,
5432
5433 /// Optional. The maximum number of frameworks to return. The default value is
5434 /// `500`.
5435 ///
5436 /// If you exceed the maximum value of `1000`, then the service uses the
5437 /// maximum value.
5438 pub page_size: i32,
5439
5440 /// Optional. A pagination token returned from a previous request to list
5441 /// frameworks. Provide this token to retrieve the next page of results.
5442 pub page_token: std::string::String,
5443
5444 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5445}
5446
5447impl ListFrameworksRequest {
5448 pub fn new() -> Self {
5449 std::default::Default::default()
5450 }
5451
5452 /// Sets the value of [parent][crate::model::ListFrameworksRequest::parent].
5453 ///
5454 /// # Example
5455 /// ```ignore,no_run
5456 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworksRequest;
5457 /// let x = ListFrameworksRequest::new().set_parent("example");
5458 /// ```
5459 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5460 self.parent = v.into();
5461 self
5462 }
5463
5464 /// Sets the value of [page_size][crate::model::ListFrameworksRequest::page_size].
5465 ///
5466 /// # Example
5467 /// ```ignore,no_run
5468 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworksRequest;
5469 /// let x = ListFrameworksRequest::new().set_page_size(42);
5470 /// ```
5471 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5472 self.page_size = v.into();
5473 self
5474 }
5475
5476 /// Sets the value of [page_token][crate::model::ListFrameworksRequest::page_token].
5477 ///
5478 /// # Example
5479 /// ```ignore,no_run
5480 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworksRequest;
5481 /// let x = ListFrameworksRequest::new().set_page_token("example");
5482 /// ```
5483 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5484 self.page_token = v.into();
5485 self
5486 }
5487}
5488
5489impl wkt::message::Message for ListFrameworksRequest {
5490 fn typename() -> &'static str {
5491 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFrameworksRequest"
5492 }
5493}
5494
5495/// The response message for [ListFrameworks][].
5496/// Returns a paginated list of Framework resources.
5497#[derive(Clone, Default, PartialEq)]
5498#[non_exhaustive]
5499pub struct ListFrameworksResponse {
5500 /// The list of framework resources.
5501 pub frameworks: std::vec::Vec<crate::model::Framework>,
5502
5503 /// A pagination token. To retrieve the next page of results, call the method
5504 /// again with this token.
5505 pub next_page_token: std::string::String,
5506
5507 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5508}
5509
5510impl ListFrameworksResponse {
5511 pub fn new() -> Self {
5512 std::default::Default::default()
5513 }
5514
5515 /// Sets the value of [frameworks][crate::model::ListFrameworksResponse::frameworks].
5516 ///
5517 /// # Example
5518 /// ```ignore,no_run
5519 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworksResponse;
5520 /// use google_cloud_cloudsecuritycompliance_v1::model::Framework;
5521 /// let x = ListFrameworksResponse::new()
5522 /// .set_frameworks([
5523 /// Framework::default()/* use setters */,
5524 /// Framework::default()/* use (different) setters */,
5525 /// ]);
5526 /// ```
5527 pub fn set_frameworks<T, V>(mut self, v: T) -> Self
5528 where
5529 T: std::iter::IntoIterator<Item = V>,
5530 V: std::convert::Into<crate::model::Framework>,
5531 {
5532 use std::iter::Iterator;
5533 self.frameworks = v.into_iter().map(|i| i.into()).collect();
5534 self
5535 }
5536
5537 /// Sets the value of [next_page_token][crate::model::ListFrameworksResponse::next_page_token].
5538 ///
5539 /// # Example
5540 /// ```ignore,no_run
5541 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworksResponse;
5542 /// let x = ListFrameworksResponse::new().set_next_page_token("example");
5543 /// ```
5544 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5545 self.next_page_token = v.into();
5546 self
5547 }
5548}
5549
5550impl wkt::message::Message for ListFrameworksResponse {
5551 fn typename() -> &'static str {
5552 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFrameworksResponse"
5553 }
5554}
5555
5556#[doc(hidden)]
5557impl google_cloud_gax::paginator::internal::PageableResponse for ListFrameworksResponse {
5558 type PageItem = crate::model::Framework;
5559
5560 fn items(self) -> std::vec::Vec<Self::PageItem> {
5561 self.frameworks
5562 }
5563
5564 fn next_page_token(&self) -> std::string::String {
5565 use std::clone::Clone;
5566 self.next_page_token.clone()
5567 }
5568}
5569
5570/// The request message for [GetFramework][].
5571#[derive(Clone, Default, PartialEq)]
5572#[non_exhaustive]
5573pub struct GetFrameworkRequest {
5574 /// Required. The name of the framework to retrieve, in the format
5575 /// `organizations/{organization}/locations/{location}/frameworks/{framework_id}`
5576 /// The only supported location is `global`.
5577 pub name: std::string::String,
5578
5579 /// Optional. The framework major version to retrieve. If not specified, the
5580 /// most recently updated `revision_id` is retrieved.
5581 pub major_revision_id: i64,
5582
5583 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5584}
5585
5586impl GetFrameworkRequest {
5587 pub fn new() -> Self {
5588 std::default::Default::default()
5589 }
5590
5591 /// Sets the value of [name][crate::model::GetFrameworkRequest::name].
5592 ///
5593 /// # Example
5594 /// ```ignore,no_run
5595 /// # use google_cloud_cloudsecuritycompliance_v1::model::GetFrameworkRequest;
5596 /// let x = GetFrameworkRequest::new().set_name("example");
5597 /// ```
5598 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5599 self.name = v.into();
5600 self
5601 }
5602
5603 /// Sets the value of [major_revision_id][crate::model::GetFrameworkRequest::major_revision_id].
5604 ///
5605 /// # Example
5606 /// ```ignore,no_run
5607 /// # use google_cloud_cloudsecuritycompliance_v1::model::GetFrameworkRequest;
5608 /// let x = GetFrameworkRequest::new().set_major_revision_id(42);
5609 /// ```
5610 pub fn set_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5611 self.major_revision_id = v.into();
5612 self
5613 }
5614}
5615
5616impl wkt::message::Message for GetFrameworkRequest {
5617 fn typename() -> &'static str {
5618 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.GetFrameworkRequest"
5619 }
5620}
5621
5622/// The request message for [CreateFramework][].
5623#[derive(Clone, Default, PartialEq)]
5624#[non_exhaustive]
5625pub struct CreateFrameworkRequest {
5626 /// Required. The parent resource name, in the format
5627 /// `organizations/{organization}/locations/{location}`.
5628 /// The only supported location is `global`.
5629 pub parent: std::string::String,
5630
5631 /// Required. The identifier (ID) of the framework. The ID is not the full name
5632 /// of the framework; it's the last part of the full name of the framework.
5633 pub framework_id: std::string::String,
5634
5635 /// Required. The resource being created.
5636 pub framework: std::option::Option<crate::model::Framework>,
5637
5638 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5639}
5640
5641impl CreateFrameworkRequest {
5642 pub fn new() -> Self {
5643 std::default::Default::default()
5644 }
5645
5646 /// Sets the value of [parent][crate::model::CreateFrameworkRequest::parent].
5647 ///
5648 /// # Example
5649 /// ```ignore,no_run
5650 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkRequest;
5651 /// let x = CreateFrameworkRequest::new().set_parent("example");
5652 /// ```
5653 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5654 self.parent = v.into();
5655 self
5656 }
5657
5658 /// Sets the value of [framework_id][crate::model::CreateFrameworkRequest::framework_id].
5659 ///
5660 /// # Example
5661 /// ```ignore,no_run
5662 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkRequest;
5663 /// let x = CreateFrameworkRequest::new().set_framework_id("example");
5664 /// ```
5665 pub fn set_framework_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5666 self.framework_id = v.into();
5667 self
5668 }
5669
5670 /// Sets the value of [framework][crate::model::CreateFrameworkRequest::framework].
5671 ///
5672 /// # Example
5673 /// ```ignore,no_run
5674 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkRequest;
5675 /// use google_cloud_cloudsecuritycompliance_v1::model::Framework;
5676 /// let x = CreateFrameworkRequest::new().set_framework(Framework::default()/* use setters */);
5677 /// ```
5678 pub fn set_framework<T>(mut self, v: T) -> Self
5679 where
5680 T: std::convert::Into<crate::model::Framework>,
5681 {
5682 self.framework = std::option::Option::Some(v.into());
5683 self
5684 }
5685
5686 /// Sets or clears the value of [framework][crate::model::CreateFrameworkRequest::framework].
5687 ///
5688 /// # Example
5689 /// ```ignore,no_run
5690 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkRequest;
5691 /// use google_cloud_cloudsecuritycompliance_v1::model::Framework;
5692 /// let x = CreateFrameworkRequest::new().set_or_clear_framework(Some(Framework::default()/* use setters */));
5693 /// let x = CreateFrameworkRequest::new().set_or_clear_framework(None::<Framework>);
5694 /// ```
5695 pub fn set_or_clear_framework<T>(mut self, v: std::option::Option<T>) -> Self
5696 where
5697 T: std::convert::Into<crate::model::Framework>,
5698 {
5699 self.framework = v.map(|x| x.into());
5700 self
5701 }
5702}
5703
5704impl wkt::message::Message for CreateFrameworkRequest {
5705 fn typename() -> &'static str {
5706 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CreateFrameworkRequest"
5707 }
5708}
5709
5710/// The request message for [UpdateFramework][].
5711#[derive(Clone, Default, PartialEq)]
5712#[non_exhaustive]
5713pub struct UpdateFrameworkRequest {
5714 /// Optional. A field mask is used to specify the fields to be overwritten in
5715 /// the framework resource by the update. The fields specified in the
5716 /// `update_mask` are relative to the resource, not the full request. A field
5717 /// is overwritten if it is in the mask. If you don't provide a mask then all
5718 /// fields present in the request will be overwritten.
5719 pub update_mask: std::option::Option<wkt::FieldMask>,
5720
5721 /// Required. The resource that is being updated.
5722 pub framework: std::option::Option<crate::model::Framework>,
5723
5724 /// Optional. The major version ID of the framework to update.
5725 pub major_revision_id: i64,
5726
5727 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5728}
5729
5730impl UpdateFrameworkRequest {
5731 pub fn new() -> Self {
5732 std::default::Default::default()
5733 }
5734
5735 /// Sets the value of [update_mask][crate::model::UpdateFrameworkRequest::update_mask].
5736 ///
5737 /// # Example
5738 /// ```ignore,no_run
5739 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateFrameworkRequest;
5740 /// use wkt::FieldMask;
5741 /// let x = UpdateFrameworkRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5742 /// ```
5743 pub fn set_update_mask<T>(mut self, v: T) -> Self
5744 where
5745 T: std::convert::Into<wkt::FieldMask>,
5746 {
5747 self.update_mask = std::option::Option::Some(v.into());
5748 self
5749 }
5750
5751 /// Sets or clears the value of [update_mask][crate::model::UpdateFrameworkRequest::update_mask].
5752 ///
5753 /// # Example
5754 /// ```ignore,no_run
5755 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateFrameworkRequest;
5756 /// use wkt::FieldMask;
5757 /// let x = UpdateFrameworkRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5758 /// let x = UpdateFrameworkRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5759 /// ```
5760 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5761 where
5762 T: std::convert::Into<wkt::FieldMask>,
5763 {
5764 self.update_mask = v.map(|x| x.into());
5765 self
5766 }
5767
5768 /// Sets the value of [framework][crate::model::UpdateFrameworkRequest::framework].
5769 ///
5770 /// # Example
5771 /// ```ignore,no_run
5772 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateFrameworkRequest;
5773 /// use google_cloud_cloudsecuritycompliance_v1::model::Framework;
5774 /// let x = UpdateFrameworkRequest::new().set_framework(Framework::default()/* use setters */);
5775 /// ```
5776 pub fn set_framework<T>(mut self, v: T) -> Self
5777 where
5778 T: std::convert::Into<crate::model::Framework>,
5779 {
5780 self.framework = std::option::Option::Some(v.into());
5781 self
5782 }
5783
5784 /// Sets or clears the value of [framework][crate::model::UpdateFrameworkRequest::framework].
5785 ///
5786 /// # Example
5787 /// ```ignore,no_run
5788 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateFrameworkRequest;
5789 /// use google_cloud_cloudsecuritycompliance_v1::model::Framework;
5790 /// let x = UpdateFrameworkRequest::new().set_or_clear_framework(Some(Framework::default()/* use setters */));
5791 /// let x = UpdateFrameworkRequest::new().set_or_clear_framework(None::<Framework>);
5792 /// ```
5793 pub fn set_or_clear_framework<T>(mut self, v: std::option::Option<T>) -> Self
5794 where
5795 T: std::convert::Into<crate::model::Framework>,
5796 {
5797 self.framework = v.map(|x| x.into());
5798 self
5799 }
5800
5801 /// Sets the value of [major_revision_id][crate::model::UpdateFrameworkRequest::major_revision_id].
5802 ///
5803 /// # Example
5804 /// ```ignore,no_run
5805 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateFrameworkRequest;
5806 /// let x = UpdateFrameworkRequest::new().set_major_revision_id(42);
5807 /// ```
5808 pub fn set_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5809 self.major_revision_id = v.into();
5810 self
5811 }
5812}
5813
5814impl wkt::message::Message for UpdateFrameworkRequest {
5815 fn typename() -> &'static str {
5816 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.UpdateFrameworkRequest"
5817 }
5818}
5819
5820/// Request message for [DeleteFramework][].
5821#[derive(Clone, Default, PartialEq)]
5822#[non_exhaustive]
5823pub struct DeleteFrameworkRequest {
5824 /// Required. The name of the resource, in the format
5825 /// `organizations/{organization}/locations/{location}/frameworks/{framework}`.
5826 /// The only supported location is `global`.
5827 pub name: std::string::String,
5828
5829 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5830}
5831
5832impl DeleteFrameworkRequest {
5833 pub fn new() -> Self {
5834 std::default::Default::default()
5835 }
5836
5837 /// Sets the value of [name][crate::model::DeleteFrameworkRequest::name].
5838 ///
5839 /// # Example
5840 /// ```ignore,no_run
5841 /// # use google_cloud_cloudsecuritycompliance_v1::model::DeleteFrameworkRequest;
5842 /// let x = DeleteFrameworkRequest::new().set_name("example");
5843 /// ```
5844 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5845 self.name = v.into();
5846 self
5847 }
5848}
5849
5850impl wkt::message::Message for DeleteFrameworkRequest {
5851 fn typename() -> &'static str {
5852 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.DeleteFrameworkRequest"
5853 }
5854}
5855
5856/// Request message for [ListCloudControls][].
5857#[derive(Clone, Default, PartialEq)]
5858#[non_exhaustive]
5859pub struct ListCloudControlsRequest {
5860 /// Required. The parent resource name, in the format
5861 /// `organizations/{organization}/locations/{location}`.
5862 /// The only supported location is `global`.
5863 pub parent: std::string::String,
5864
5865 /// Optional. The maximum number of cloud controls to return. The default value
5866 /// is `500`.
5867 ///
5868 /// If you exceed the maximum value of `1000`, then the service uses the
5869 /// maximum value.
5870 pub page_size: i32,
5871
5872 /// Optional. A pagination token that's returned from a previous request to
5873 /// list cloud controls. Provide this token to retrieve the next page of
5874 /// results.
5875 ///
5876 /// When paginating, the parent that you provide to the
5877 /// [ListCloudControls][google.cloud.cloudsecuritycompliance.v1.Config.ListCloudControls]
5878 /// request must match the call that provided the page token.
5879 ///
5880 /// [google.cloud.cloudsecuritycompliance.v1.Config.ListCloudControls]: crate::client::Config::list_cloud_controls
5881 pub page_token: std::string::String,
5882
5883 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5884}
5885
5886impl ListCloudControlsRequest {
5887 pub fn new() -> Self {
5888 std::default::Default::default()
5889 }
5890
5891 /// Sets the value of [parent][crate::model::ListCloudControlsRequest::parent].
5892 ///
5893 /// # Example
5894 /// ```ignore,no_run
5895 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlsRequest;
5896 /// let x = ListCloudControlsRequest::new().set_parent("example");
5897 /// ```
5898 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5899 self.parent = v.into();
5900 self
5901 }
5902
5903 /// Sets the value of [page_size][crate::model::ListCloudControlsRequest::page_size].
5904 ///
5905 /// # Example
5906 /// ```ignore,no_run
5907 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlsRequest;
5908 /// let x = ListCloudControlsRequest::new().set_page_size(42);
5909 /// ```
5910 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5911 self.page_size = v.into();
5912 self
5913 }
5914
5915 /// Sets the value of [page_token][crate::model::ListCloudControlsRequest::page_token].
5916 ///
5917 /// # Example
5918 /// ```ignore,no_run
5919 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlsRequest;
5920 /// let x = ListCloudControlsRequest::new().set_page_token("example");
5921 /// ```
5922 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5923 self.page_token = v.into();
5924 self
5925 }
5926}
5927
5928impl wkt::message::Message for ListCloudControlsRequest {
5929 fn typename() -> &'static str {
5930 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListCloudControlsRequest"
5931 }
5932}
5933
5934/// The response message for [ListCloudControls][].
5935#[derive(Clone, Default, PartialEq)]
5936#[non_exhaustive]
5937pub struct ListCloudControlsResponse {
5938 /// The list of CloudControl resources.
5939 pub cloud_controls: std::vec::Vec<crate::model::CloudControl>,
5940
5941 /// A pagination token. To retrieve the next page of results, call the method
5942 /// again with this token.
5943 pub next_page_token: std::string::String,
5944
5945 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5946}
5947
5948impl ListCloudControlsResponse {
5949 pub fn new() -> Self {
5950 std::default::Default::default()
5951 }
5952
5953 /// Sets the value of [cloud_controls][crate::model::ListCloudControlsResponse::cloud_controls].
5954 ///
5955 /// # Example
5956 /// ```ignore,no_run
5957 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlsResponse;
5958 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
5959 /// let x = ListCloudControlsResponse::new()
5960 /// .set_cloud_controls([
5961 /// CloudControl::default()/* use setters */,
5962 /// CloudControl::default()/* use (different) setters */,
5963 /// ]);
5964 /// ```
5965 pub fn set_cloud_controls<T, V>(mut self, v: T) -> Self
5966 where
5967 T: std::iter::IntoIterator<Item = V>,
5968 V: std::convert::Into<crate::model::CloudControl>,
5969 {
5970 use std::iter::Iterator;
5971 self.cloud_controls = v.into_iter().map(|i| i.into()).collect();
5972 self
5973 }
5974
5975 /// Sets the value of [next_page_token][crate::model::ListCloudControlsResponse::next_page_token].
5976 ///
5977 /// # Example
5978 /// ```ignore,no_run
5979 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlsResponse;
5980 /// let x = ListCloudControlsResponse::new().set_next_page_token("example");
5981 /// ```
5982 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5983 self.next_page_token = v.into();
5984 self
5985 }
5986}
5987
5988impl wkt::message::Message for ListCloudControlsResponse {
5989 fn typename() -> &'static str {
5990 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListCloudControlsResponse"
5991 }
5992}
5993
5994#[doc(hidden)]
5995impl google_cloud_gax::paginator::internal::PageableResponse for ListCloudControlsResponse {
5996 type PageItem = crate::model::CloudControl;
5997
5998 fn items(self) -> std::vec::Vec<Self::PageItem> {
5999 self.cloud_controls
6000 }
6001
6002 fn next_page_token(&self) -> std::string::String {
6003 use std::clone::Clone;
6004 self.next_page_token.clone()
6005 }
6006}
6007
6008/// The request message for [GetCloudControl][].
6009#[derive(Clone, Default, PartialEq)]
6010#[non_exhaustive]
6011pub struct GetCloudControlRequest {
6012 /// Required. The name of the cloud control to retrieve, in the format
6013 /// `organizations/{organization}/locations/{location}/cloudControls/{cloud_control}`.
6014 /// The only supported location is `global`.
6015 pub name: std::string::String,
6016
6017 /// Optional. The major version of the cloud control to retrieve. If not
6018 /// specified, the most recently updated `revision_id` is retrieved.
6019 pub major_revision_id: i64,
6020
6021 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6022}
6023
6024impl GetCloudControlRequest {
6025 pub fn new() -> Self {
6026 std::default::Default::default()
6027 }
6028
6029 /// Sets the value of [name][crate::model::GetCloudControlRequest::name].
6030 ///
6031 /// # Example
6032 /// ```ignore,no_run
6033 /// # use google_cloud_cloudsecuritycompliance_v1::model::GetCloudControlRequest;
6034 /// let x = GetCloudControlRequest::new().set_name("example");
6035 /// ```
6036 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6037 self.name = v.into();
6038 self
6039 }
6040
6041 /// Sets the value of [major_revision_id][crate::model::GetCloudControlRequest::major_revision_id].
6042 ///
6043 /// # Example
6044 /// ```ignore,no_run
6045 /// # use google_cloud_cloudsecuritycompliance_v1::model::GetCloudControlRequest;
6046 /// let x = GetCloudControlRequest::new().set_major_revision_id(42);
6047 /// ```
6048 pub fn set_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6049 self.major_revision_id = v.into();
6050 self
6051 }
6052}
6053
6054impl wkt::message::Message for GetCloudControlRequest {
6055 fn typename() -> &'static str {
6056 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.GetCloudControlRequest"
6057 }
6058}
6059
6060/// The request message for [CreateCloudControl][].
6061#[derive(Clone, Default, PartialEq)]
6062#[non_exhaustive]
6063pub struct CreateCloudControlRequest {
6064 /// Required. The parent resource name, in the format
6065 /// `organizations/{organization}/locations/{location}`.
6066 /// The only supported location is `global`.
6067 pub parent: std::string::String,
6068
6069 /// Required. The identifier for the cloud control, which is the last segment
6070 /// of the cloud control name. The format is
6071 /// `^[a-zA-Z][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]$`.
6072 pub cloud_control_id: std::string::String,
6073
6074 /// Required. The cloud control that's being created.
6075 pub cloud_control: std::option::Option<crate::model::CloudControl>,
6076
6077 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6078}
6079
6080impl CreateCloudControlRequest {
6081 pub fn new() -> Self {
6082 std::default::Default::default()
6083 }
6084
6085 /// Sets the value of [parent][crate::model::CreateCloudControlRequest::parent].
6086 ///
6087 /// # Example
6088 /// ```ignore,no_run
6089 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateCloudControlRequest;
6090 /// let x = CreateCloudControlRequest::new().set_parent("example");
6091 /// ```
6092 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6093 self.parent = v.into();
6094 self
6095 }
6096
6097 /// Sets the value of [cloud_control_id][crate::model::CreateCloudControlRequest::cloud_control_id].
6098 ///
6099 /// # Example
6100 /// ```ignore,no_run
6101 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateCloudControlRequest;
6102 /// let x = CreateCloudControlRequest::new().set_cloud_control_id("example");
6103 /// ```
6104 pub fn set_cloud_control_id<T: std::convert::Into<std::string::String>>(
6105 mut self,
6106 v: T,
6107 ) -> Self {
6108 self.cloud_control_id = v.into();
6109 self
6110 }
6111
6112 /// Sets the value of [cloud_control][crate::model::CreateCloudControlRequest::cloud_control].
6113 ///
6114 /// # Example
6115 /// ```ignore,no_run
6116 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateCloudControlRequest;
6117 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
6118 /// let x = CreateCloudControlRequest::new().set_cloud_control(CloudControl::default()/* use setters */);
6119 /// ```
6120 pub fn set_cloud_control<T>(mut self, v: T) -> Self
6121 where
6122 T: std::convert::Into<crate::model::CloudControl>,
6123 {
6124 self.cloud_control = std::option::Option::Some(v.into());
6125 self
6126 }
6127
6128 /// Sets or clears the value of [cloud_control][crate::model::CreateCloudControlRequest::cloud_control].
6129 ///
6130 /// # Example
6131 /// ```ignore,no_run
6132 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateCloudControlRequest;
6133 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
6134 /// let x = CreateCloudControlRequest::new().set_or_clear_cloud_control(Some(CloudControl::default()/* use setters */));
6135 /// let x = CreateCloudControlRequest::new().set_or_clear_cloud_control(None::<CloudControl>);
6136 /// ```
6137 pub fn set_or_clear_cloud_control<T>(mut self, v: std::option::Option<T>) -> Self
6138 where
6139 T: std::convert::Into<crate::model::CloudControl>,
6140 {
6141 self.cloud_control = v.map(|x| x.into());
6142 self
6143 }
6144}
6145
6146impl wkt::message::Message for CreateCloudControlRequest {
6147 fn typename() -> &'static str {
6148 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CreateCloudControlRequest"
6149 }
6150}
6151
6152/// The request message for [UpdateCloudControl][].
6153#[derive(Clone, Default, PartialEq)]
6154#[non_exhaustive]
6155pub struct UpdateCloudControlRequest {
6156 /// Optional. Use a field mask to specify the fields to be overwritten in the
6157 /// cloud control during the update.
6158 /// The fields that you specify in the `update_mask` are relative to the
6159 /// cloud control, not the full request. A field is overwritten if it is in
6160 /// the mask. If you don't provide a mask, all fields in the request
6161 /// are updated.
6162 ///
6163 /// You can update the following fields:
6164 ///
6165 /// - Display name
6166 /// - Description
6167 /// - Parameters
6168 /// - Rules
6169 /// - Parameter specification
6170 pub update_mask: std::option::Option<wkt::FieldMask>,
6171
6172 /// Required. The cloud control that you're updating.
6173 pub cloud_control: std::option::Option<crate::model::CloudControl>,
6174
6175 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6176}
6177
6178impl UpdateCloudControlRequest {
6179 pub fn new() -> Self {
6180 std::default::Default::default()
6181 }
6182
6183 /// Sets the value of [update_mask][crate::model::UpdateCloudControlRequest::update_mask].
6184 ///
6185 /// # Example
6186 /// ```ignore,no_run
6187 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateCloudControlRequest;
6188 /// use wkt::FieldMask;
6189 /// let x = UpdateCloudControlRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6190 /// ```
6191 pub fn set_update_mask<T>(mut self, v: T) -> Self
6192 where
6193 T: std::convert::Into<wkt::FieldMask>,
6194 {
6195 self.update_mask = std::option::Option::Some(v.into());
6196 self
6197 }
6198
6199 /// Sets or clears the value of [update_mask][crate::model::UpdateCloudControlRequest::update_mask].
6200 ///
6201 /// # Example
6202 /// ```ignore,no_run
6203 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateCloudControlRequest;
6204 /// use wkt::FieldMask;
6205 /// let x = UpdateCloudControlRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6206 /// let x = UpdateCloudControlRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6207 /// ```
6208 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6209 where
6210 T: std::convert::Into<wkt::FieldMask>,
6211 {
6212 self.update_mask = v.map(|x| x.into());
6213 self
6214 }
6215
6216 /// Sets the value of [cloud_control][crate::model::UpdateCloudControlRequest::cloud_control].
6217 ///
6218 /// # Example
6219 /// ```ignore,no_run
6220 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateCloudControlRequest;
6221 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
6222 /// let x = UpdateCloudControlRequest::new().set_cloud_control(CloudControl::default()/* use setters */);
6223 /// ```
6224 pub fn set_cloud_control<T>(mut self, v: T) -> Self
6225 where
6226 T: std::convert::Into<crate::model::CloudControl>,
6227 {
6228 self.cloud_control = std::option::Option::Some(v.into());
6229 self
6230 }
6231
6232 /// Sets or clears the value of [cloud_control][crate::model::UpdateCloudControlRequest::cloud_control].
6233 ///
6234 /// # Example
6235 /// ```ignore,no_run
6236 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateCloudControlRequest;
6237 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
6238 /// let x = UpdateCloudControlRequest::new().set_or_clear_cloud_control(Some(CloudControl::default()/* use setters */));
6239 /// let x = UpdateCloudControlRequest::new().set_or_clear_cloud_control(None::<CloudControl>);
6240 /// ```
6241 pub fn set_or_clear_cloud_control<T>(mut self, v: std::option::Option<T>) -> Self
6242 where
6243 T: std::convert::Into<crate::model::CloudControl>,
6244 {
6245 self.cloud_control = v.map(|x| x.into());
6246 self
6247 }
6248}
6249
6250impl wkt::message::Message for UpdateCloudControlRequest {
6251 fn typename() -> &'static str {
6252 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.UpdateCloudControlRequest"
6253 }
6254}
6255
6256/// The request message for [DeleteCloudControl][].
6257#[derive(Clone, Default, PartialEq)]
6258#[non_exhaustive]
6259pub struct DeleteCloudControlRequest {
6260 /// Required. The name of the cloud control to delete, in the format
6261 /// `organizations/{organization}/locations/{location}/CloudControls/{CloudControl}`.
6262 /// The only supported location is `global`.
6263 pub name: std::string::String,
6264
6265 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6266}
6267
6268impl DeleteCloudControlRequest {
6269 pub fn new() -> Self {
6270 std::default::Default::default()
6271 }
6272
6273 /// Sets the value of [name][crate::model::DeleteCloudControlRequest::name].
6274 ///
6275 /// # Example
6276 /// ```ignore,no_run
6277 /// # use google_cloud_cloudsecuritycompliance_v1::model::DeleteCloudControlRequest;
6278 /// let x = DeleteCloudControlRequest::new().set_name("example");
6279 /// ```
6280 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6281 self.name = v.into();
6282 self
6283 }
6284}
6285
6286impl wkt::message::Message for DeleteCloudControlRequest {
6287 fn typename() -> &'static str {
6288 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.DeleteCloudControlRequest"
6289 }
6290}
6291
6292/// Framework deployments represent the assignment of a framework to a target
6293/// resource. Supported target resources are organizations, folders, and
6294/// projects.
6295#[derive(Clone, Default, PartialEq)]
6296#[non_exhaustive]
6297pub struct FrameworkDeployment {
6298 /// Identifier. The name of the framework deployment, in the format
6299 /// `organizations/{organization}/locations/{location}/frameworkDeployments/{framework_deployment_id}`.
6300 /// The only supported location is `global`.
6301 pub name: std::string::String,
6302
6303 /// Required. The details of the target resource that you want to deploy the
6304 /// framework to. You can specify an existing resource, or create a new one.
6305 pub target_resource_config: std::option::Option<crate::model::TargetResourceConfig>,
6306
6307 /// Output only. The target resource to deploy the framework to, in one the
6308 /// following formats:
6309 ///
6310 /// - `organizations/{organizationID}`
6311 /// - `folders/{folderID}`
6312 /// - `projects/{projectID}`
6313 pub computed_target_resource: std::string::String,
6314
6315 /// Required. A reference to the framework that you're deploying.
6316 pub framework: std::option::Option<crate::model::FrameworkReference>,
6317
6318 /// Optional. A user-provided description of the framework deployment.
6319 pub description: std::string::String,
6320
6321 /// Required. The deployment mode and parameters for each of the cloud controls
6322 /// in the framework. Every cloud control in the framework includes metadata.
6323 pub cloud_control_metadata: std::vec::Vec<crate::model::CloudControlMetadata>,
6324
6325 /// Output only. The state for the framework deployment.
6326 pub deployment_state: crate::model::DeploymentState,
6327
6328 /// Output only. The time at which the resource was created.
6329 pub create_time: std::option::Option<wkt::Timestamp>,
6330
6331 /// Output only. The time at which the resource last updated.
6332 pub update_time: std::option::Option<wkt::Timestamp>,
6333
6334 /// Optional. To prevent concurrent updates from overwriting each other, always
6335 /// provide the `etag` when you update a framework deployment. You can also
6336 /// provide the `etag` when you delete a framework deployment, to help
6337 /// ensure that you're deleting the intended version of the
6338 /// framework deployment.
6339 pub etag: std::string::String,
6340
6341 /// Output only. The display name of the target resource.
6342 pub target_resource_display_name: std::string::String,
6343
6344 /// Output only. The references to the cloud control deployments. The reference
6345 /// includes all the cloud control deployments that are in the framework or in
6346 /// a cloud control group.
6347 ///
6348 /// For example, if a framework deployment deploys two
6349 /// cloud controls, `cc-deployment-1` and `cc-deployment-2`, then the
6350 /// references are:
6351 ///
6352 /// ```norust
6353 /// {
6354 /// cloud_control_deployment_reference: {
6355 /// cloud_control_deployment:
6356 /// "organizations/{organization}/locations/{location}/cloudControlDeployments/cc-deployment-1"
6357 /// },
6358 /// cloud_control_deployment_reference: {
6359 /// cloud_control_deployment:
6360 /// "organizations/{organization}/locations/{location}/cloudControlDeployments/cc-deployment-2"
6361 /// }
6362 /// ```
6363 pub cloud_control_deployment_references:
6364 std::vec::Vec<crate::model::CloudControlDeploymentReference>,
6365
6366 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6367}
6368
6369impl FrameworkDeployment {
6370 pub fn new() -> Self {
6371 std::default::Default::default()
6372 }
6373
6374 /// Sets the value of [name][crate::model::FrameworkDeployment::name].
6375 ///
6376 /// # Example
6377 /// ```ignore,no_run
6378 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
6379 /// let x = FrameworkDeployment::new().set_name("example");
6380 /// ```
6381 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6382 self.name = v.into();
6383 self
6384 }
6385
6386 /// Sets the value of [target_resource_config][crate::model::FrameworkDeployment::target_resource_config].
6387 ///
6388 /// # Example
6389 /// ```ignore,no_run
6390 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
6391 /// use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceConfig;
6392 /// let x = FrameworkDeployment::new().set_target_resource_config(TargetResourceConfig::default()/* use setters */);
6393 /// ```
6394 pub fn set_target_resource_config<T>(mut self, v: T) -> Self
6395 where
6396 T: std::convert::Into<crate::model::TargetResourceConfig>,
6397 {
6398 self.target_resource_config = std::option::Option::Some(v.into());
6399 self
6400 }
6401
6402 /// Sets or clears the value of [target_resource_config][crate::model::FrameworkDeployment::target_resource_config].
6403 ///
6404 /// # Example
6405 /// ```ignore,no_run
6406 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
6407 /// use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceConfig;
6408 /// let x = FrameworkDeployment::new().set_or_clear_target_resource_config(Some(TargetResourceConfig::default()/* use setters */));
6409 /// let x = FrameworkDeployment::new().set_or_clear_target_resource_config(None::<TargetResourceConfig>);
6410 /// ```
6411 pub fn set_or_clear_target_resource_config<T>(mut self, v: std::option::Option<T>) -> Self
6412 where
6413 T: std::convert::Into<crate::model::TargetResourceConfig>,
6414 {
6415 self.target_resource_config = v.map(|x| x.into());
6416 self
6417 }
6418
6419 /// Sets the value of [computed_target_resource][crate::model::FrameworkDeployment::computed_target_resource].
6420 ///
6421 /// # Example
6422 /// ```ignore,no_run
6423 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
6424 /// let x = FrameworkDeployment::new().set_computed_target_resource("example");
6425 /// ```
6426 pub fn set_computed_target_resource<T: std::convert::Into<std::string::String>>(
6427 mut self,
6428 v: T,
6429 ) -> Self {
6430 self.computed_target_resource = v.into();
6431 self
6432 }
6433
6434 /// Sets the value of [framework][crate::model::FrameworkDeployment::framework].
6435 ///
6436 /// # Example
6437 /// ```ignore,no_run
6438 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
6439 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkReference;
6440 /// let x = FrameworkDeployment::new().set_framework(FrameworkReference::default()/* use setters */);
6441 /// ```
6442 pub fn set_framework<T>(mut self, v: T) -> Self
6443 where
6444 T: std::convert::Into<crate::model::FrameworkReference>,
6445 {
6446 self.framework = std::option::Option::Some(v.into());
6447 self
6448 }
6449
6450 /// Sets or clears the value of [framework][crate::model::FrameworkDeployment::framework].
6451 ///
6452 /// # Example
6453 /// ```ignore,no_run
6454 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
6455 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkReference;
6456 /// let x = FrameworkDeployment::new().set_or_clear_framework(Some(FrameworkReference::default()/* use setters */));
6457 /// let x = FrameworkDeployment::new().set_or_clear_framework(None::<FrameworkReference>);
6458 /// ```
6459 pub fn set_or_clear_framework<T>(mut self, v: std::option::Option<T>) -> Self
6460 where
6461 T: std::convert::Into<crate::model::FrameworkReference>,
6462 {
6463 self.framework = v.map(|x| x.into());
6464 self
6465 }
6466
6467 /// Sets the value of [description][crate::model::FrameworkDeployment::description].
6468 ///
6469 /// # Example
6470 /// ```ignore,no_run
6471 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
6472 /// let x = FrameworkDeployment::new().set_description("example");
6473 /// ```
6474 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6475 self.description = v.into();
6476 self
6477 }
6478
6479 /// Sets the value of [cloud_control_metadata][crate::model::FrameworkDeployment::cloud_control_metadata].
6480 ///
6481 /// # Example
6482 /// ```ignore,no_run
6483 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
6484 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlMetadata;
6485 /// let x = FrameworkDeployment::new()
6486 /// .set_cloud_control_metadata([
6487 /// CloudControlMetadata::default()/* use setters */,
6488 /// CloudControlMetadata::default()/* use (different) setters */,
6489 /// ]);
6490 /// ```
6491 pub fn set_cloud_control_metadata<T, V>(mut self, v: T) -> Self
6492 where
6493 T: std::iter::IntoIterator<Item = V>,
6494 V: std::convert::Into<crate::model::CloudControlMetadata>,
6495 {
6496 use std::iter::Iterator;
6497 self.cloud_control_metadata = v.into_iter().map(|i| i.into()).collect();
6498 self
6499 }
6500
6501 /// Sets the value of [deployment_state][crate::model::FrameworkDeployment::deployment_state].
6502 ///
6503 /// # Example
6504 /// ```ignore,no_run
6505 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
6506 /// use google_cloud_cloudsecuritycompliance_v1::model::DeploymentState;
6507 /// let x0 = FrameworkDeployment::new().set_deployment_state(DeploymentState::Validating);
6508 /// let x1 = FrameworkDeployment::new().set_deployment_state(DeploymentState::Creating);
6509 /// let x2 = FrameworkDeployment::new().set_deployment_state(DeploymentState::Deleting);
6510 /// ```
6511 pub fn set_deployment_state<T: std::convert::Into<crate::model::DeploymentState>>(
6512 mut self,
6513 v: T,
6514 ) -> Self {
6515 self.deployment_state = v.into();
6516 self
6517 }
6518
6519 /// Sets the value of [create_time][crate::model::FrameworkDeployment::create_time].
6520 ///
6521 /// # Example
6522 /// ```ignore,no_run
6523 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
6524 /// use wkt::Timestamp;
6525 /// let x = FrameworkDeployment::new().set_create_time(Timestamp::default()/* use setters */);
6526 /// ```
6527 pub fn set_create_time<T>(mut self, v: T) -> Self
6528 where
6529 T: std::convert::Into<wkt::Timestamp>,
6530 {
6531 self.create_time = std::option::Option::Some(v.into());
6532 self
6533 }
6534
6535 /// Sets or clears the value of [create_time][crate::model::FrameworkDeployment::create_time].
6536 ///
6537 /// # Example
6538 /// ```ignore,no_run
6539 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
6540 /// use wkt::Timestamp;
6541 /// let x = FrameworkDeployment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6542 /// let x = FrameworkDeployment::new().set_or_clear_create_time(None::<Timestamp>);
6543 /// ```
6544 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6545 where
6546 T: std::convert::Into<wkt::Timestamp>,
6547 {
6548 self.create_time = v.map(|x| x.into());
6549 self
6550 }
6551
6552 /// Sets the value of [update_time][crate::model::FrameworkDeployment::update_time].
6553 ///
6554 /// # Example
6555 /// ```ignore,no_run
6556 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
6557 /// use wkt::Timestamp;
6558 /// let x = FrameworkDeployment::new().set_update_time(Timestamp::default()/* use setters */);
6559 /// ```
6560 pub fn set_update_time<T>(mut self, v: T) -> Self
6561 where
6562 T: std::convert::Into<wkt::Timestamp>,
6563 {
6564 self.update_time = std::option::Option::Some(v.into());
6565 self
6566 }
6567
6568 /// Sets or clears the value of [update_time][crate::model::FrameworkDeployment::update_time].
6569 ///
6570 /// # Example
6571 /// ```ignore,no_run
6572 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
6573 /// use wkt::Timestamp;
6574 /// let x = FrameworkDeployment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6575 /// let x = FrameworkDeployment::new().set_or_clear_update_time(None::<Timestamp>);
6576 /// ```
6577 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6578 where
6579 T: std::convert::Into<wkt::Timestamp>,
6580 {
6581 self.update_time = v.map(|x| x.into());
6582 self
6583 }
6584
6585 /// Sets the value of [etag][crate::model::FrameworkDeployment::etag].
6586 ///
6587 /// # Example
6588 /// ```ignore,no_run
6589 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
6590 /// let x = FrameworkDeployment::new().set_etag("example");
6591 /// ```
6592 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6593 self.etag = v.into();
6594 self
6595 }
6596
6597 /// Sets the value of [target_resource_display_name][crate::model::FrameworkDeployment::target_resource_display_name].
6598 ///
6599 /// # Example
6600 /// ```ignore,no_run
6601 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
6602 /// let x = FrameworkDeployment::new().set_target_resource_display_name("example");
6603 /// ```
6604 pub fn set_target_resource_display_name<T: std::convert::Into<std::string::String>>(
6605 mut self,
6606 v: T,
6607 ) -> Self {
6608 self.target_resource_display_name = v.into();
6609 self
6610 }
6611
6612 /// Sets the value of [cloud_control_deployment_references][crate::model::FrameworkDeployment::cloud_control_deployment_references].
6613 ///
6614 /// # Example
6615 /// ```ignore,no_run
6616 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
6617 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeploymentReference;
6618 /// let x = FrameworkDeployment::new()
6619 /// .set_cloud_control_deployment_references([
6620 /// CloudControlDeploymentReference::default()/* use setters */,
6621 /// CloudControlDeploymentReference::default()/* use (different) setters */,
6622 /// ]);
6623 /// ```
6624 pub fn set_cloud_control_deployment_references<T, V>(mut self, v: T) -> Self
6625 where
6626 T: std::iter::IntoIterator<Item = V>,
6627 V: std::convert::Into<crate::model::CloudControlDeploymentReference>,
6628 {
6629 use std::iter::Iterator;
6630 self.cloud_control_deployment_references = v.into_iter().map(|i| i.into()).collect();
6631 self
6632 }
6633}
6634
6635impl wkt::message::Message for FrameworkDeployment {
6636 fn typename() -> &'static str {
6637 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FrameworkDeployment"
6638 }
6639}
6640
6641/// A cloud control deployment represents the deployment of a particular cloud
6642/// control on a target resource. Supported target resources are
6643/// `organizations/{organizationID}`, `folders/{folderID}`, and
6644/// `projects/{projectID}`.
6645#[derive(Clone, Default, PartialEq)]
6646#[non_exhaustive]
6647pub struct CloudControlDeployment {
6648 /// Identifier. The name for the cloud control deployment, in the format
6649 /// `organizations/{organization}/locations/{location}/cloudControlDeployments/{cloud_control_deployment_id}`.
6650 /// The only supported location is `global`.
6651 pub name: std::string::String,
6652
6653 /// Required. The details of the target resource that the cloud control is
6654 /// deployed You can use an existing target resource or create a new target.
6655 pub target_resource_config: std::option::Option<crate::model::TargetResourceConfig>,
6656
6657 /// Output only. The resource that the cloud control is deployed on, in one of
6658 /// the following formats:
6659 ///
6660 /// - `organizations/{organizationID}`
6661 /// - `folders/{folderID}`
6662 /// - `projects/{projectID}`
6663 pub target_resource: std::string::String,
6664
6665 /// Required. The deployment mode and parameters for the cloud control.
6666 pub cloud_control_metadata: std::option::Option<crate::model::CloudControlMetadata>,
6667
6668 /// Optional. A friendly description for the cloud control deployment.
6669 pub description: std::string::String,
6670
6671 /// Output only. The state of the cloud control deployment.
6672 pub deployment_state: crate::model::DeploymentState,
6673
6674 /// Output only. The time when the resource was created.
6675 pub create_time: std::option::Option<wkt::Timestamp>,
6676
6677 /// Output only. The time when the resource was last updated.
6678 pub update_time: std::option::Option<wkt::Timestamp>,
6679
6680 /// Optional. To prevent concurrent updates from overwriting each other,
6681 /// provide the `etag` when you update a cloud control deployment. You can also
6682 /// provide the `etag` when you delete a cloud control deployment to help
6683 /// ensure that you're deleting the intended version of the
6684 /// deployment.
6685 pub etag: std::string::String,
6686
6687 /// Output only. The cloud control after the given parameters are substituted.
6688 pub parameter_substituted_cloud_control: std::option::Option<crate::model::CloudControl>,
6689
6690 /// Output only. The references to the framework deployments that this cloud
6691 /// control deployment is part of. A cloud control deployment can be part of
6692 /// multiple framework deployments.
6693 pub framework_deployment_references: std::vec::Vec<crate::model::FrameworkDeploymentReference>,
6694
6695 /// Output only. The display name of the target resource.
6696 pub target_resource_display_name: std::string::String,
6697
6698 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6699}
6700
6701impl CloudControlDeployment {
6702 pub fn new() -> Self {
6703 std::default::Default::default()
6704 }
6705
6706 /// Sets the value of [name][crate::model::CloudControlDeployment::name].
6707 ///
6708 /// # Example
6709 /// ```ignore,no_run
6710 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6711 /// let x = CloudControlDeployment::new().set_name("example");
6712 /// ```
6713 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6714 self.name = v.into();
6715 self
6716 }
6717
6718 /// Sets the value of [target_resource_config][crate::model::CloudControlDeployment::target_resource_config].
6719 ///
6720 /// # Example
6721 /// ```ignore,no_run
6722 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6723 /// use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceConfig;
6724 /// let x = CloudControlDeployment::new().set_target_resource_config(TargetResourceConfig::default()/* use setters */);
6725 /// ```
6726 pub fn set_target_resource_config<T>(mut self, v: T) -> Self
6727 where
6728 T: std::convert::Into<crate::model::TargetResourceConfig>,
6729 {
6730 self.target_resource_config = std::option::Option::Some(v.into());
6731 self
6732 }
6733
6734 /// Sets or clears the value of [target_resource_config][crate::model::CloudControlDeployment::target_resource_config].
6735 ///
6736 /// # Example
6737 /// ```ignore,no_run
6738 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6739 /// use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceConfig;
6740 /// let x = CloudControlDeployment::new().set_or_clear_target_resource_config(Some(TargetResourceConfig::default()/* use setters */));
6741 /// let x = CloudControlDeployment::new().set_or_clear_target_resource_config(None::<TargetResourceConfig>);
6742 /// ```
6743 pub fn set_or_clear_target_resource_config<T>(mut self, v: std::option::Option<T>) -> Self
6744 where
6745 T: std::convert::Into<crate::model::TargetResourceConfig>,
6746 {
6747 self.target_resource_config = v.map(|x| x.into());
6748 self
6749 }
6750
6751 /// Sets the value of [target_resource][crate::model::CloudControlDeployment::target_resource].
6752 ///
6753 /// # Example
6754 /// ```ignore,no_run
6755 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6756 /// let x = CloudControlDeployment::new().set_target_resource("example");
6757 /// ```
6758 pub fn set_target_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6759 self.target_resource = v.into();
6760 self
6761 }
6762
6763 /// Sets the value of [cloud_control_metadata][crate::model::CloudControlDeployment::cloud_control_metadata].
6764 ///
6765 /// # Example
6766 /// ```ignore,no_run
6767 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6768 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlMetadata;
6769 /// let x = CloudControlDeployment::new().set_cloud_control_metadata(CloudControlMetadata::default()/* use setters */);
6770 /// ```
6771 pub fn set_cloud_control_metadata<T>(mut self, v: T) -> Self
6772 where
6773 T: std::convert::Into<crate::model::CloudControlMetadata>,
6774 {
6775 self.cloud_control_metadata = std::option::Option::Some(v.into());
6776 self
6777 }
6778
6779 /// Sets or clears the value of [cloud_control_metadata][crate::model::CloudControlDeployment::cloud_control_metadata].
6780 ///
6781 /// # Example
6782 /// ```ignore,no_run
6783 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6784 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlMetadata;
6785 /// let x = CloudControlDeployment::new().set_or_clear_cloud_control_metadata(Some(CloudControlMetadata::default()/* use setters */));
6786 /// let x = CloudControlDeployment::new().set_or_clear_cloud_control_metadata(None::<CloudControlMetadata>);
6787 /// ```
6788 pub fn set_or_clear_cloud_control_metadata<T>(mut self, v: std::option::Option<T>) -> Self
6789 where
6790 T: std::convert::Into<crate::model::CloudControlMetadata>,
6791 {
6792 self.cloud_control_metadata = v.map(|x| x.into());
6793 self
6794 }
6795
6796 /// Sets the value of [description][crate::model::CloudControlDeployment::description].
6797 ///
6798 /// # Example
6799 /// ```ignore,no_run
6800 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6801 /// let x = CloudControlDeployment::new().set_description("example");
6802 /// ```
6803 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6804 self.description = v.into();
6805 self
6806 }
6807
6808 /// Sets the value of [deployment_state][crate::model::CloudControlDeployment::deployment_state].
6809 ///
6810 /// # Example
6811 /// ```ignore,no_run
6812 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6813 /// use google_cloud_cloudsecuritycompliance_v1::model::DeploymentState;
6814 /// let x0 = CloudControlDeployment::new().set_deployment_state(DeploymentState::Validating);
6815 /// let x1 = CloudControlDeployment::new().set_deployment_state(DeploymentState::Creating);
6816 /// let x2 = CloudControlDeployment::new().set_deployment_state(DeploymentState::Deleting);
6817 /// ```
6818 pub fn set_deployment_state<T: std::convert::Into<crate::model::DeploymentState>>(
6819 mut self,
6820 v: T,
6821 ) -> Self {
6822 self.deployment_state = v.into();
6823 self
6824 }
6825
6826 /// Sets the value of [create_time][crate::model::CloudControlDeployment::create_time].
6827 ///
6828 /// # Example
6829 /// ```ignore,no_run
6830 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6831 /// use wkt::Timestamp;
6832 /// let x = CloudControlDeployment::new().set_create_time(Timestamp::default()/* use setters */);
6833 /// ```
6834 pub fn set_create_time<T>(mut self, v: T) -> Self
6835 where
6836 T: std::convert::Into<wkt::Timestamp>,
6837 {
6838 self.create_time = std::option::Option::Some(v.into());
6839 self
6840 }
6841
6842 /// Sets or clears the value of [create_time][crate::model::CloudControlDeployment::create_time].
6843 ///
6844 /// # Example
6845 /// ```ignore,no_run
6846 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6847 /// use wkt::Timestamp;
6848 /// let x = CloudControlDeployment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6849 /// let x = CloudControlDeployment::new().set_or_clear_create_time(None::<Timestamp>);
6850 /// ```
6851 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6852 where
6853 T: std::convert::Into<wkt::Timestamp>,
6854 {
6855 self.create_time = v.map(|x| x.into());
6856 self
6857 }
6858
6859 /// Sets the value of [update_time][crate::model::CloudControlDeployment::update_time].
6860 ///
6861 /// # Example
6862 /// ```ignore,no_run
6863 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6864 /// use wkt::Timestamp;
6865 /// let x = CloudControlDeployment::new().set_update_time(Timestamp::default()/* use setters */);
6866 /// ```
6867 pub fn set_update_time<T>(mut self, v: T) -> Self
6868 where
6869 T: std::convert::Into<wkt::Timestamp>,
6870 {
6871 self.update_time = std::option::Option::Some(v.into());
6872 self
6873 }
6874
6875 /// Sets or clears the value of [update_time][crate::model::CloudControlDeployment::update_time].
6876 ///
6877 /// # Example
6878 /// ```ignore,no_run
6879 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6880 /// use wkt::Timestamp;
6881 /// let x = CloudControlDeployment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6882 /// let x = CloudControlDeployment::new().set_or_clear_update_time(None::<Timestamp>);
6883 /// ```
6884 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6885 where
6886 T: std::convert::Into<wkt::Timestamp>,
6887 {
6888 self.update_time = v.map(|x| x.into());
6889 self
6890 }
6891
6892 /// Sets the value of [etag][crate::model::CloudControlDeployment::etag].
6893 ///
6894 /// # Example
6895 /// ```ignore,no_run
6896 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6897 /// let x = CloudControlDeployment::new().set_etag("example");
6898 /// ```
6899 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6900 self.etag = v.into();
6901 self
6902 }
6903
6904 /// Sets the value of [parameter_substituted_cloud_control][crate::model::CloudControlDeployment::parameter_substituted_cloud_control].
6905 ///
6906 /// # Example
6907 /// ```ignore,no_run
6908 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6909 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
6910 /// let x = CloudControlDeployment::new().set_parameter_substituted_cloud_control(CloudControl::default()/* use setters */);
6911 /// ```
6912 pub fn set_parameter_substituted_cloud_control<T>(mut self, v: T) -> Self
6913 where
6914 T: std::convert::Into<crate::model::CloudControl>,
6915 {
6916 self.parameter_substituted_cloud_control = std::option::Option::Some(v.into());
6917 self
6918 }
6919
6920 /// Sets or clears the value of [parameter_substituted_cloud_control][crate::model::CloudControlDeployment::parameter_substituted_cloud_control].
6921 ///
6922 /// # Example
6923 /// ```ignore,no_run
6924 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6925 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
6926 /// let x = CloudControlDeployment::new().set_or_clear_parameter_substituted_cloud_control(Some(CloudControl::default()/* use setters */));
6927 /// let x = CloudControlDeployment::new().set_or_clear_parameter_substituted_cloud_control(None::<CloudControl>);
6928 /// ```
6929 pub fn set_or_clear_parameter_substituted_cloud_control<T>(
6930 mut self,
6931 v: std::option::Option<T>,
6932 ) -> Self
6933 where
6934 T: std::convert::Into<crate::model::CloudControl>,
6935 {
6936 self.parameter_substituted_cloud_control = v.map(|x| x.into());
6937 self
6938 }
6939
6940 /// Sets the value of [framework_deployment_references][crate::model::CloudControlDeployment::framework_deployment_references].
6941 ///
6942 /// # Example
6943 /// ```ignore,no_run
6944 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6945 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeploymentReference;
6946 /// let x = CloudControlDeployment::new()
6947 /// .set_framework_deployment_references([
6948 /// FrameworkDeploymentReference::default()/* use setters */,
6949 /// FrameworkDeploymentReference::default()/* use (different) setters */,
6950 /// ]);
6951 /// ```
6952 pub fn set_framework_deployment_references<T, V>(mut self, v: T) -> Self
6953 where
6954 T: std::iter::IntoIterator<Item = V>,
6955 V: std::convert::Into<crate::model::FrameworkDeploymentReference>,
6956 {
6957 use std::iter::Iterator;
6958 self.framework_deployment_references = v.into_iter().map(|i| i.into()).collect();
6959 self
6960 }
6961
6962 /// Sets the value of [target_resource_display_name][crate::model::CloudControlDeployment::target_resource_display_name].
6963 ///
6964 /// # Example
6965 /// ```ignore,no_run
6966 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
6967 /// let x = CloudControlDeployment::new().set_target_resource_display_name("example");
6968 /// ```
6969 pub fn set_target_resource_display_name<T: std::convert::Into<std::string::String>>(
6970 mut self,
6971 v: T,
6972 ) -> Self {
6973 self.target_resource_display_name = v.into();
6974 self
6975 }
6976}
6977
6978impl wkt::message::Message for CloudControlDeployment {
6979 fn typename() -> &'static str {
6980 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControlDeployment"
6981 }
6982}
6983
6984/// The name of the target resource or the configuration that's required to
6985/// create a new target resource.
6986#[derive(Clone, Default, PartialEq)]
6987#[non_exhaustive]
6988pub struct TargetResourceConfig {
6989 /// The resource configuration for the target resource.
6990 pub resource_config: std::option::Option<crate::model::target_resource_config::ResourceConfig>,
6991
6992 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6993}
6994
6995impl TargetResourceConfig {
6996 pub fn new() -> Self {
6997 std::default::Default::default()
6998 }
6999
7000 /// Sets the value of [resource_config][crate::model::TargetResourceConfig::resource_config].
7001 ///
7002 /// Note that all the setters affecting `resource_config` are mutually
7003 /// exclusive.
7004 ///
7005 /// # Example
7006 /// ```ignore,no_run
7007 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceConfig;
7008 /// use google_cloud_cloudsecuritycompliance_v1::model::target_resource_config::ResourceConfig;
7009 /// let x = TargetResourceConfig::new().set_resource_config(Some(ResourceConfig::ExistingTargetResource("example".to_string())));
7010 /// ```
7011 pub fn set_resource_config<
7012 T: std::convert::Into<
7013 std::option::Option<crate::model::target_resource_config::ResourceConfig>,
7014 >,
7015 >(
7016 mut self,
7017 v: T,
7018 ) -> Self {
7019 self.resource_config = v.into();
7020 self
7021 }
7022
7023 /// The value of [resource_config][crate::model::TargetResourceConfig::resource_config]
7024 /// if it holds a `ExistingTargetResource`, `None` if the field is not set or
7025 /// holds a different branch.
7026 pub fn existing_target_resource(&self) -> std::option::Option<&std::string::String> {
7027 #[allow(unreachable_patterns)]
7028 self.resource_config.as_ref().and_then(|v| match v {
7029 crate::model::target_resource_config::ResourceConfig::ExistingTargetResource(v) => {
7030 std::option::Option::Some(v)
7031 }
7032 _ => std::option::Option::None,
7033 })
7034 }
7035
7036 /// Sets the value of [resource_config][crate::model::TargetResourceConfig::resource_config]
7037 /// to hold a `ExistingTargetResource`.
7038 ///
7039 /// Note that all the setters affecting `resource_config` are
7040 /// mutually exclusive.
7041 ///
7042 /// # Example
7043 /// ```ignore,no_run
7044 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceConfig;
7045 /// let x = TargetResourceConfig::new().set_existing_target_resource("example");
7046 /// assert!(x.existing_target_resource().is_some());
7047 /// assert!(x.target_resource_creation_config().is_none());
7048 /// ```
7049 pub fn set_existing_target_resource<T: std::convert::Into<std::string::String>>(
7050 mut self,
7051 v: T,
7052 ) -> Self {
7053 self.resource_config = std::option::Option::Some(
7054 crate::model::target_resource_config::ResourceConfig::ExistingTargetResource(v.into()),
7055 );
7056 self
7057 }
7058
7059 /// The value of [resource_config][crate::model::TargetResourceConfig::resource_config]
7060 /// if it holds a `TargetResourceCreationConfig`, `None` if the field is not set or
7061 /// holds a different branch.
7062 pub fn target_resource_creation_config(
7063 &self,
7064 ) -> std::option::Option<&std::boxed::Box<crate::model::TargetResourceCreationConfig>> {
7065 #[allow(unreachable_patterns)]
7066 self.resource_config.as_ref().and_then(|v| match v {
7067 crate::model::target_resource_config::ResourceConfig::TargetResourceCreationConfig(
7068 v,
7069 ) => std::option::Option::Some(v),
7070 _ => std::option::Option::None,
7071 })
7072 }
7073
7074 /// Sets the value of [resource_config][crate::model::TargetResourceConfig::resource_config]
7075 /// to hold a `TargetResourceCreationConfig`.
7076 ///
7077 /// Note that all the setters affecting `resource_config` are
7078 /// mutually exclusive.
7079 ///
7080 /// # Example
7081 /// ```ignore,no_run
7082 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceConfig;
7083 /// use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceCreationConfig;
7084 /// let x = TargetResourceConfig::new().set_target_resource_creation_config(TargetResourceCreationConfig::default()/* use setters */);
7085 /// assert!(x.target_resource_creation_config().is_some());
7086 /// assert!(x.existing_target_resource().is_none());
7087 /// ```
7088 pub fn set_target_resource_creation_config<
7089 T: std::convert::Into<std::boxed::Box<crate::model::TargetResourceCreationConfig>>,
7090 >(
7091 mut self,
7092 v: T,
7093 ) -> Self {
7094 self.resource_config = std::option::Option::Some(
7095 crate::model::target_resource_config::ResourceConfig::TargetResourceCreationConfig(
7096 v.into(),
7097 ),
7098 );
7099 self
7100 }
7101}
7102
7103impl wkt::message::Message for TargetResourceConfig {
7104 fn typename() -> &'static str {
7105 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.TargetResourceConfig"
7106 }
7107}
7108
7109/// Defines additional types related to [TargetResourceConfig].
7110pub mod target_resource_config {
7111 #[allow(unused_imports)]
7112 use super::*;
7113
7114 /// The resource configuration for the target resource.
7115 #[derive(Clone, Debug, PartialEq)]
7116 #[non_exhaustive]
7117 pub enum ResourceConfig {
7118 /// Optional. The resource hierarchy node, in one of the following formats:
7119 ///
7120 /// - `organizations/{organizationID}`
7121 /// - `folders/{folderID}`
7122 /// - `projects/{projectID}`
7123 ExistingTargetResource(std::string::String),
7124 /// Optional. The details that are required to create a resource and use
7125 /// that resource as the target resource for deployment.
7126 TargetResourceCreationConfig(std::boxed::Box<crate::model::TargetResourceCreationConfig>),
7127 }
7128}
7129
7130/// The configuration that's required to create a target resource.
7131#[derive(Clone, Default, PartialEq)]
7132#[non_exhaustive]
7133pub struct TargetResourceCreationConfig {
7134 /// The configuration that's required to create the target resource.
7135 pub resource_creation_config:
7136 std::option::Option<crate::model::target_resource_creation_config::ResourceCreationConfig>,
7137
7138 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7139}
7140
7141impl TargetResourceCreationConfig {
7142 pub fn new() -> Self {
7143 std::default::Default::default()
7144 }
7145
7146 /// Sets the value of [resource_creation_config][crate::model::TargetResourceCreationConfig::resource_creation_config].
7147 ///
7148 /// Note that all the setters affecting `resource_creation_config` are mutually
7149 /// exclusive.
7150 ///
7151 /// # Example
7152 /// ```ignore,no_run
7153 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceCreationConfig;
7154 /// use google_cloud_cloudsecuritycompliance_v1::model::FolderCreationConfig;
7155 /// let x = TargetResourceCreationConfig::new().set_resource_creation_config(Some(
7156 /// google_cloud_cloudsecuritycompliance_v1::model::target_resource_creation_config::ResourceCreationConfig::FolderCreationConfig(FolderCreationConfig::default().into())));
7157 /// ```
7158 pub fn set_resource_creation_config<
7159 T: std::convert::Into<
7160 std::option::Option<
7161 crate::model::target_resource_creation_config::ResourceCreationConfig,
7162 >,
7163 >,
7164 >(
7165 mut self,
7166 v: T,
7167 ) -> Self {
7168 self.resource_creation_config = v.into();
7169 self
7170 }
7171
7172 /// The value of [resource_creation_config][crate::model::TargetResourceCreationConfig::resource_creation_config]
7173 /// if it holds a `FolderCreationConfig`, `None` if the field is not set or
7174 /// holds a different branch.
7175 pub fn folder_creation_config(
7176 &self,
7177 ) -> std::option::Option<&std::boxed::Box<crate::model::FolderCreationConfig>> {
7178 #[allow(unreachable_patterns)]
7179 self.resource_creation_config.as_ref().and_then(|v| match v {
7180 crate::model::target_resource_creation_config::ResourceCreationConfig::FolderCreationConfig(v) => std::option::Option::Some(v),
7181 _ => std::option::Option::None,
7182 })
7183 }
7184
7185 /// Sets the value of [resource_creation_config][crate::model::TargetResourceCreationConfig::resource_creation_config]
7186 /// to hold a `FolderCreationConfig`.
7187 ///
7188 /// Note that all the setters affecting `resource_creation_config` are
7189 /// mutually exclusive.
7190 ///
7191 /// # Example
7192 /// ```ignore,no_run
7193 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceCreationConfig;
7194 /// use google_cloud_cloudsecuritycompliance_v1::model::FolderCreationConfig;
7195 /// let x = TargetResourceCreationConfig::new().set_folder_creation_config(FolderCreationConfig::default()/* use setters */);
7196 /// assert!(x.folder_creation_config().is_some());
7197 /// assert!(x.project_creation_config().is_none());
7198 /// ```
7199 pub fn set_folder_creation_config<
7200 T: std::convert::Into<std::boxed::Box<crate::model::FolderCreationConfig>>,
7201 >(
7202 mut self,
7203 v: T,
7204 ) -> Self {
7205 self.resource_creation_config = std::option::Option::Some(
7206 crate::model::target_resource_creation_config::ResourceCreationConfig::FolderCreationConfig(
7207 v.into()
7208 )
7209 );
7210 self
7211 }
7212
7213 /// The value of [resource_creation_config][crate::model::TargetResourceCreationConfig::resource_creation_config]
7214 /// if it holds a `ProjectCreationConfig`, `None` if the field is not set or
7215 /// holds a different branch.
7216 pub fn project_creation_config(
7217 &self,
7218 ) -> std::option::Option<&std::boxed::Box<crate::model::ProjectCreationConfig>> {
7219 #[allow(unreachable_patterns)]
7220 self.resource_creation_config.as_ref().and_then(|v| match v {
7221 crate::model::target_resource_creation_config::ResourceCreationConfig::ProjectCreationConfig(v) => std::option::Option::Some(v),
7222 _ => std::option::Option::None,
7223 })
7224 }
7225
7226 /// Sets the value of [resource_creation_config][crate::model::TargetResourceCreationConfig::resource_creation_config]
7227 /// to hold a `ProjectCreationConfig`.
7228 ///
7229 /// Note that all the setters affecting `resource_creation_config` are
7230 /// mutually exclusive.
7231 ///
7232 /// # Example
7233 /// ```ignore,no_run
7234 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceCreationConfig;
7235 /// use google_cloud_cloudsecuritycompliance_v1::model::ProjectCreationConfig;
7236 /// let x = TargetResourceCreationConfig::new().set_project_creation_config(ProjectCreationConfig::default()/* use setters */);
7237 /// assert!(x.project_creation_config().is_some());
7238 /// assert!(x.folder_creation_config().is_none());
7239 /// ```
7240 pub fn set_project_creation_config<
7241 T: std::convert::Into<std::boxed::Box<crate::model::ProjectCreationConfig>>,
7242 >(
7243 mut self,
7244 v: T,
7245 ) -> Self {
7246 self.resource_creation_config = std::option::Option::Some(
7247 crate::model::target_resource_creation_config::ResourceCreationConfig::ProjectCreationConfig(
7248 v.into()
7249 )
7250 );
7251 self
7252 }
7253}
7254
7255impl wkt::message::Message for TargetResourceCreationConfig {
7256 fn typename() -> &'static str {
7257 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.TargetResourceCreationConfig"
7258 }
7259}
7260
7261/// Defines additional types related to [TargetResourceCreationConfig].
7262pub mod target_resource_creation_config {
7263 #[allow(unused_imports)]
7264 use super::*;
7265
7266 /// The configuration that's required to create the target resource.
7267 #[derive(Clone, Debug, PartialEq)]
7268 #[non_exhaustive]
7269 pub enum ResourceCreationConfig {
7270 /// Optional. The configuration that's required to create a folder.
7271 FolderCreationConfig(std::boxed::Box<crate::model::FolderCreationConfig>),
7272 /// Optional. The configuration that's required to create a project.
7273 ProjectCreationConfig(std::boxed::Box<crate::model::ProjectCreationConfig>),
7274 }
7275}
7276
7277/// The configuration that's required to create a folder to be used
7278/// as the target resource for a deployment.
7279#[derive(Clone, Default, PartialEq)]
7280#[non_exhaustive]
7281pub struct FolderCreationConfig {
7282 /// Required. The parent of the folder, in the format
7283 /// `organizations/{organizationID}` or `folders/{folderID}`.
7284 pub parent: std::string::String,
7285
7286 /// Required. The display name of the folder.
7287 pub folder_display_name: std::string::String,
7288
7289 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7290}
7291
7292impl FolderCreationConfig {
7293 pub fn new() -> Self {
7294 std::default::Default::default()
7295 }
7296
7297 /// Sets the value of [parent][crate::model::FolderCreationConfig::parent].
7298 ///
7299 /// # Example
7300 /// ```ignore,no_run
7301 /// # use google_cloud_cloudsecuritycompliance_v1::model::FolderCreationConfig;
7302 /// let x = FolderCreationConfig::new().set_parent("example");
7303 /// ```
7304 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7305 self.parent = v.into();
7306 self
7307 }
7308
7309 /// Sets the value of [folder_display_name][crate::model::FolderCreationConfig::folder_display_name].
7310 ///
7311 /// # Example
7312 /// ```ignore,no_run
7313 /// # use google_cloud_cloudsecuritycompliance_v1::model::FolderCreationConfig;
7314 /// let x = FolderCreationConfig::new().set_folder_display_name("example");
7315 /// ```
7316 pub fn set_folder_display_name<T: std::convert::Into<std::string::String>>(
7317 mut self,
7318 v: T,
7319 ) -> Self {
7320 self.folder_display_name = v.into();
7321 self
7322 }
7323}
7324
7325impl wkt::message::Message for FolderCreationConfig {
7326 fn typename() -> &'static str {
7327 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FolderCreationConfig"
7328 }
7329}
7330
7331/// The configuration that's required to create a project to be used
7332/// as the target resource of a deployment.
7333#[derive(Clone, Default, PartialEq)]
7334#[non_exhaustive]
7335pub struct ProjectCreationConfig {
7336 /// Required. The parent of the project, in the format
7337 /// `organizations/{organizationID}` or `folders/{folderID}`.
7338 pub parent: std::string::String,
7339
7340 /// Required. The display name of the project.
7341 pub project_display_name: std::string::String,
7342
7343 /// Required. The billing account ID for the project.
7344 pub billing_account_id: std::string::String,
7345
7346 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7347}
7348
7349impl ProjectCreationConfig {
7350 pub fn new() -> Self {
7351 std::default::Default::default()
7352 }
7353
7354 /// Sets the value of [parent][crate::model::ProjectCreationConfig::parent].
7355 ///
7356 /// # Example
7357 /// ```ignore,no_run
7358 /// # use google_cloud_cloudsecuritycompliance_v1::model::ProjectCreationConfig;
7359 /// let x = ProjectCreationConfig::new().set_parent("example");
7360 /// ```
7361 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7362 self.parent = v.into();
7363 self
7364 }
7365
7366 /// Sets the value of [project_display_name][crate::model::ProjectCreationConfig::project_display_name].
7367 ///
7368 /// # Example
7369 /// ```ignore,no_run
7370 /// # use google_cloud_cloudsecuritycompliance_v1::model::ProjectCreationConfig;
7371 /// let x = ProjectCreationConfig::new().set_project_display_name("example");
7372 /// ```
7373 pub fn set_project_display_name<T: std::convert::Into<std::string::String>>(
7374 mut self,
7375 v: T,
7376 ) -> Self {
7377 self.project_display_name = v.into();
7378 self
7379 }
7380
7381 /// Sets the value of [billing_account_id][crate::model::ProjectCreationConfig::billing_account_id].
7382 ///
7383 /// # Example
7384 /// ```ignore,no_run
7385 /// # use google_cloud_cloudsecuritycompliance_v1::model::ProjectCreationConfig;
7386 /// let x = ProjectCreationConfig::new().set_billing_account_id("example");
7387 /// ```
7388 pub fn set_billing_account_id<T: std::convert::Into<std::string::String>>(
7389 mut self,
7390 v: T,
7391 ) -> Self {
7392 self.billing_account_id = v.into();
7393 self
7394 }
7395}
7396
7397impl wkt::message::Message for ProjectCreationConfig {
7398 fn typename() -> &'static str {
7399 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ProjectCreationConfig"
7400 }
7401}
7402
7403/// The enforcement mode and parameters of a cloud
7404/// control deployment.
7405#[derive(Clone, Default, PartialEq)]
7406#[non_exhaustive]
7407pub struct CloudControlMetadata {
7408 /// Required. The cloud control name and parameters.
7409 pub cloud_control_details: std::option::Option<crate::model::CloudControlDetails>,
7410
7411 /// Required. The enforcement mode of the cloud control.
7412 pub enforcement_mode: crate::model::EnforcementMode,
7413
7414 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7415}
7416
7417impl CloudControlMetadata {
7418 pub fn new() -> Self {
7419 std::default::Default::default()
7420 }
7421
7422 /// Sets the value of [cloud_control_details][crate::model::CloudControlMetadata::cloud_control_details].
7423 ///
7424 /// # Example
7425 /// ```ignore,no_run
7426 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlMetadata;
7427 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDetails;
7428 /// let x = CloudControlMetadata::new().set_cloud_control_details(CloudControlDetails::default()/* use setters */);
7429 /// ```
7430 pub fn set_cloud_control_details<T>(mut self, v: T) -> Self
7431 where
7432 T: std::convert::Into<crate::model::CloudControlDetails>,
7433 {
7434 self.cloud_control_details = std::option::Option::Some(v.into());
7435 self
7436 }
7437
7438 /// Sets or clears the value of [cloud_control_details][crate::model::CloudControlMetadata::cloud_control_details].
7439 ///
7440 /// # Example
7441 /// ```ignore,no_run
7442 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlMetadata;
7443 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDetails;
7444 /// let x = CloudControlMetadata::new().set_or_clear_cloud_control_details(Some(CloudControlDetails::default()/* use setters */));
7445 /// let x = CloudControlMetadata::new().set_or_clear_cloud_control_details(None::<CloudControlDetails>);
7446 /// ```
7447 pub fn set_or_clear_cloud_control_details<T>(mut self, v: std::option::Option<T>) -> Self
7448 where
7449 T: std::convert::Into<crate::model::CloudControlDetails>,
7450 {
7451 self.cloud_control_details = v.map(|x| x.into());
7452 self
7453 }
7454
7455 /// Sets the value of [enforcement_mode][crate::model::CloudControlMetadata::enforcement_mode].
7456 ///
7457 /// # Example
7458 /// ```ignore,no_run
7459 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlMetadata;
7460 /// use google_cloud_cloudsecuritycompliance_v1::model::EnforcementMode;
7461 /// let x0 = CloudControlMetadata::new().set_enforcement_mode(EnforcementMode::Preventive);
7462 /// let x1 = CloudControlMetadata::new().set_enforcement_mode(EnforcementMode::Detective);
7463 /// let x2 = CloudControlMetadata::new().set_enforcement_mode(EnforcementMode::Audit);
7464 /// ```
7465 pub fn set_enforcement_mode<T: std::convert::Into<crate::model::EnforcementMode>>(
7466 mut self,
7467 v: T,
7468 ) -> Self {
7469 self.enforcement_mode = v.into();
7470 self
7471 }
7472}
7473
7474impl wkt::message::Message for CloudControlMetadata {
7475 fn typename() -> &'static str {
7476 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControlMetadata"
7477 }
7478}
7479
7480/// The request message for [CreateFrameworkDeployment][].
7481#[derive(Clone, Default, PartialEq)]
7482#[non_exhaustive]
7483pub struct CreateFrameworkDeploymentRequest {
7484 /// Required. The parent resource of the framework deployment in the format
7485 /// `organizations/{organization}/locations/{location}`.
7486 /// Only the global location is supported.
7487 pub parent: std::string::String,
7488
7489 /// Optional. An identifier for the framework deployment that's unique in scope
7490 /// of the parent. If you don't specify a value, then a random UUID is
7491 /// generated.
7492 pub framework_deployment_id: std::string::String,
7493
7494 /// Required. The framework deployment that you're creating.
7495 pub framework_deployment: std::option::Option<crate::model::FrameworkDeployment>,
7496
7497 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7498}
7499
7500impl CreateFrameworkDeploymentRequest {
7501 pub fn new() -> Self {
7502 std::default::Default::default()
7503 }
7504
7505 /// Sets the value of [parent][crate::model::CreateFrameworkDeploymentRequest::parent].
7506 ///
7507 /// # Example
7508 /// ```ignore,no_run
7509 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkDeploymentRequest;
7510 /// let x = CreateFrameworkDeploymentRequest::new().set_parent("example");
7511 /// ```
7512 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7513 self.parent = v.into();
7514 self
7515 }
7516
7517 /// Sets the value of [framework_deployment_id][crate::model::CreateFrameworkDeploymentRequest::framework_deployment_id].
7518 ///
7519 /// # Example
7520 /// ```ignore,no_run
7521 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkDeploymentRequest;
7522 /// let x = CreateFrameworkDeploymentRequest::new().set_framework_deployment_id("example");
7523 /// ```
7524 pub fn set_framework_deployment_id<T: std::convert::Into<std::string::String>>(
7525 mut self,
7526 v: T,
7527 ) -> Self {
7528 self.framework_deployment_id = v.into();
7529 self
7530 }
7531
7532 /// Sets the value of [framework_deployment][crate::model::CreateFrameworkDeploymentRequest::framework_deployment].
7533 ///
7534 /// # Example
7535 /// ```ignore,no_run
7536 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkDeploymentRequest;
7537 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
7538 /// let x = CreateFrameworkDeploymentRequest::new().set_framework_deployment(FrameworkDeployment::default()/* use setters */);
7539 /// ```
7540 pub fn set_framework_deployment<T>(mut self, v: T) -> Self
7541 where
7542 T: std::convert::Into<crate::model::FrameworkDeployment>,
7543 {
7544 self.framework_deployment = std::option::Option::Some(v.into());
7545 self
7546 }
7547
7548 /// Sets or clears the value of [framework_deployment][crate::model::CreateFrameworkDeploymentRequest::framework_deployment].
7549 ///
7550 /// # Example
7551 /// ```ignore,no_run
7552 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkDeploymentRequest;
7553 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
7554 /// let x = CreateFrameworkDeploymentRequest::new().set_or_clear_framework_deployment(Some(FrameworkDeployment::default()/* use setters */));
7555 /// let x = CreateFrameworkDeploymentRequest::new().set_or_clear_framework_deployment(None::<FrameworkDeployment>);
7556 /// ```
7557 pub fn set_or_clear_framework_deployment<T>(mut self, v: std::option::Option<T>) -> Self
7558 where
7559 T: std::convert::Into<crate::model::FrameworkDeployment>,
7560 {
7561 self.framework_deployment = v.map(|x| x.into());
7562 self
7563 }
7564}
7565
7566impl wkt::message::Message for CreateFrameworkDeploymentRequest {
7567 fn typename() -> &'static str {
7568 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CreateFrameworkDeploymentRequest"
7569 }
7570}
7571
7572/// The request message for [DeleteFrameworkDeployment][].
7573#[derive(Clone, Default, PartialEq)]
7574#[non_exhaustive]
7575pub struct DeleteFrameworkDeploymentRequest {
7576 /// Required. The name of the framework deployment that you want to delete,
7577 /// in the format
7578 /// `organizations/{organization}/locations/{location}/frameworkDeployments/{framework_deployment_id}`.
7579 /// The only supported location is `global`.
7580 pub name: std::string::String,
7581
7582 /// Optional. An opaque identifier for the current version of the resource.
7583 ///
7584 /// If you provide this value, then it must match the existing value. If the
7585 /// values don't match, then the request fails with an
7586 /// [`ABORTED`][google.rpc.Code.ABORTED] error.
7587 ///
7588 /// If you omit this value, then the resource is deleted regardless of its
7589 /// current `etag` value.
7590 pub etag: std::string::String,
7591
7592 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7593}
7594
7595impl DeleteFrameworkDeploymentRequest {
7596 pub fn new() -> Self {
7597 std::default::Default::default()
7598 }
7599
7600 /// Sets the value of [name][crate::model::DeleteFrameworkDeploymentRequest::name].
7601 ///
7602 /// # Example
7603 /// ```ignore,no_run
7604 /// # use google_cloud_cloudsecuritycompliance_v1::model::DeleteFrameworkDeploymentRequest;
7605 /// let x = DeleteFrameworkDeploymentRequest::new().set_name("example");
7606 /// ```
7607 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7608 self.name = v.into();
7609 self
7610 }
7611
7612 /// Sets the value of [etag][crate::model::DeleteFrameworkDeploymentRequest::etag].
7613 ///
7614 /// # Example
7615 /// ```ignore,no_run
7616 /// # use google_cloud_cloudsecuritycompliance_v1::model::DeleteFrameworkDeploymentRequest;
7617 /// let x = DeleteFrameworkDeploymentRequest::new().set_etag("example");
7618 /// ```
7619 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7620 self.etag = v.into();
7621 self
7622 }
7623}
7624
7625impl wkt::message::Message for DeleteFrameworkDeploymentRequest {
7626 fn typename() -> &'static str {
7627 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.DeleteFrameworkDeploymentRequest"
7628 }
7629}
7630
7631/// The request message for [GetFrameworkDeployment][].
7632#[derive(Clone, Default, PartialEq)]
7633#[non_exhaustive]
7634pub struct GetFrameworkDeploymentRequest {
7635 /// Required. The name of the framework deployment, in the format
7636 /// `organizations/{organization}/locations/{location}/frameworkDeployments/{framework_deployment_id}`.
7637 /// The only supported location is `global`.
7638 pub name: std::string::String,
7639
7640 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7641}
7642
7643impl GetFrameworkDeploymentRequest {
7644 pub fn new() -> Self {
7645 std::default::Default::default()
7646 }
7647
7648 /// Sets the value of [name][crate::model::GetFrameworkDeploymentRequest::name].
7649 ///
7650 /// # Example
7651 /// ```ignore,no_run
7652 /// # use google_cloud_cloudsecuritycompliance_v1::model::GetFrameworkDeploymentRequest;
7653 /// let x = GetFrameworkDeploymentRequest::new().set_name("example");
7654 /// ```
7655 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7656 self.name = v.into();
7657 self
7658 }
7659}
7660
7661impl wkt::message::Message for GetFrameworkDeploymentRequest {
7662 fn typename() -> &'static str {
7663 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.GetFrameworkDeploymentRequest"
7664 }
7665}
7666
7667/// The request message for [ListFrameworkDeployments][].
7668#[derive(Clone, Default, PartialEq)]
7669#[non_exhaustive]
7670pub struct ListFrameworkDeploymentsRequest {
7671 /// Required. The parent resource of the framework deployment, in the format
7672 /// `organizations/{organization}/locations/{location}`.
7673 /// The only supported location is `global`.
7674 pub parent: std::string::String,
7675
7676 /// Optional. The requested page size. The server might return fewer items than
7677 /// requested.
7678 /// If unspecified, the server picks an appropriate default.
7679 pub page_size: i32,
7680
7681 /// Optional. A token that identifies a page of results the server should
7682 /// return.
7683 pub page_token: std::string::String,
7684
7685 /// Optional. The filter to be applied on the resource, as defined by
7686 /// [AIP-160: Filtering](https://google.aip.dev/160).
7687 pub filter: std::string::String,
7688
7689 /// Optional. The sort order for the results. The following values are
7690 /// supported:
7691 ///
7692 /// * `name`
7693 /// * `name desc`
7694 ///
7695 /// If you do not specify a value, then the results are not sorted.
7696 pub order_by: std::string::String,
7697
7698 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7699}
7700
7701impl ListFrameworkDeploymentsRequest {
7702 pub fn new() -> Self {
7703 std::default::Default::default()
7704 }
7705
7706 /// Sets the value of [parent][crate::model::ListFrameworkDeploymentsRequest::parent].
7707 ///
7708 /// # Example
7709 /// ```ignore,no_run
7710 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkDeploymentsRequest;
7711 /// let x = ListFrameworkDeploymentsRequest::new().set_parent("example");
7712 /// ```
7713 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7714 self.parent = v.into();
7715 self
7716 }
7717
7718 /// Sets the value of [page_size][crate::model::ListFrameworkDeploymentsRequest::page_size].
7719 ///
7720 /// # Example
7721 /// ```ignore,no_run
7722 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkDeploymentsRequest;
7723 /// let x = ListFrameworkDeploymentsRequest::new().set_page_size(42);
7724 /// ```
7725 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7726 self.page_size = v.into();
7727 self
7728 }
7729
7730 /// Sets the value of [page_token][crate::model::ListFrameworkDeploymentsRequest::page_token].
7731 ///
7732 /// # Example
7733 /// ```ignore,no_run
7734 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkDeploymentsRequest;
7735 /// let x = ListFrameworkDeploymentsRequest::new().set_page_token("example");
7736 /// ```
7737 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7738 self.page_token = v.into();
7739 self
7740 }
7741
7742 /// Sets the value of [filter][crate::model::ListFrameworkDeploymentsRequest::filter].
7743 ///
7744 /// # Example
7745 /// ```ignore,no_run
7746 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkDeploymentsRequest;
7747 /// let x = ListFrameworkDeploymentsRequest::new().set_filter("example");
7748 /// ```
7749 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7750 self.filter = v.into();
7751 self
7752 }
7753
7754 /// Sets the value of [order_by][crate::model::ListFrameworkDeploymentsRequest::order_by].
7755 ///
7756 /// # Example
7757 /// ```ignore,no_run
7758 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkDeploymentsRequest;
7759 /// let x = ListFrameworkDeploymentsRequest::new().set_order_by("example");
7760 /// ```
7761 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7762 self.order_by = v.into();
7763 self
7764 }
7765}
7766
7767impl wkt::message::Message for ListFrameworkDeploymentsRequest {
7768 fn typename() -> &'static str {
7769 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFrameworkDeploymentsRequest"
7770 }
7771}
7772
7773/// The response message for [ListFrameworkDeployments][].
7774#[derive(Clone, Default, PartialEq)]
7775#[non_exhaustive]
7776pub struct ListFrameworkDeploymentsResponse {
7777 /// The list of framework deployments.
7778 pub framework_deployments: std::vec::Vec<crate::model::FrameworkDeployment>,
7779
7780 /// A token that identifies the next page of results that the server
7781 /// should return.
7782 pub next_page_token: std::string::String,
7783
7784 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7785}
7786
7787impl ListFrameworkDeploymentsResponse {
7788 pub fn new() -> Self {
7789 std::default::Default::default()
7790 }
7791
7792 /// Sets the value of [framework_deployments][crate::model::ListFrameworkDeploymentsResponse::framework_deployments].
7793 ///
7794 /// # Example
7795 /// ```ignore,no_run
7796 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkDeploymentsResponse;
7797 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
7798 /// let x = ListFrameworkDeploymentsResponse::new()
7799 /// .set_framework_deployments([
7800 /// FrameworkDeployment::default()/* use setters */,
7801 /// FrameworkDeployment::default()/* use (different) setters */,
7802 /// ]);
7803 /// ```
7804 pub fn set_framework_deployments<T, V>(mut self, v: T) -> Self
7805 where
7806 T: std::iter::IntoIterator<Item = V>,
7807 V: std::convert::Into<crate::model::FrameworkDeployment>,
7808 {
7809 use std::iter::Iterator;
7810 self.framework_deployments = v.into_iter().map(|i| i.into()).collect();
7811 self
7812 }
7813
7814 /// Sets the value of [next_page_token][crate::model::ListFrameworkDeploymentsResponse::next_page_token].
7815 ///
7816 /// # Example
7817 /// ```ignore,no_run
7818 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkDeploymentsResponse;
7819 /// let x = ListFrameworkDeploymentsResponse::new().set_next_page_token("example");
7820 /// ```
7821 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7822 self.next_page_token = v.into();
7823 self
7824 }
7825}
7826
7827impl wkt::message::Message for ListFrameworkDeploymentsResponse {
7828 fn typename() -> &'static str {
7829 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFrameworkDeploymentsResponse"
7830 }
7831}
7832
7833#[doc(hidden)]
7834impl google_cloud_gax::paginator::internal::PageableResponse for ListFrameworkDeploymentsResponse {
7835 type PageItem = crate::model::FrameworkDeployment;
7836
7837 fn items(self) -> std::vec::Vec<Self::PageItem> {
7838 self.framework_deployments
7839 }
7840
7841 fn next_page_token(&self) -> std::string::String {
7842 use std::clone::Clone;
7843 self.next_page_token.clone()
7844 }
7845}
7846
7847/// The request message for [GetCloudControlDeployment][].
7848#[derive(Clone, Default, PartialEq)]
7849#[non_exhaustive]
7850pub struct GetCloudControlDeploymentRequest {
7851 /// Required. The name for the cloud control deployment, in the format
7852 /// `organizations/{organization}/locations/{location}/cloudControlDeployments/{cloud_control_deployment_id}`.
7853 /// The only supported location is `global`.
7854 pub name: std::string::String,
7855
7856 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7857}
7858
7859impl GetCloudControlDeploymentRequest {
7860 pub fn new() -> Self {
7861 std::default::Default::default()
7862 }
7863
7864 /// Sets the value of [name][crate::model::GetCloudControlDeploymentRequest::name].
7865 ///
7866 /// # Example
7867 /// ```ignore,no_run
7868 /// # use google_cloud_cloudsecuritycompliance_v1::model::GetCloudControlDeploymentRequest;
7869 /// let x = GetCloudControlDeploymentRequest::new().set_name("example");
7870 /// ```
7871 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7872 self.name = v.into();
7873 self
7874 }
7875}
7876
7877impl wkt::message::Message for GetCloudControlDeploymentRequest {
7878 fn typename() -> &'static str {
7879 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.GetCloudControlDeploymentRequest"
7880 }
7881}
7882
7883/// The request message for [ListCloudControlDeployments][].
7884#[derive(Clone, Default, PartialEq)]
7885#[non_exhaustive]
7886pub struct ListCloudControlDeploymentsRequest {
7887 /// Required. The parent resource for the cloud control deployment, in the
7888 /// format `organizations/{organization}/locations/{location}`. The only
7889 /// supported location is `global`.
7890 pub parent: std::string::String,
7891
7892 /// Optional. The requested page size. The server might return fewer items than
7893 /// you requested.
7894 /// If unspecified, the server picks an appropriate default.
7895 pub page_size: i32,
7896
7897 /// Optional. A token that identifies the page of results that the server
7898 /// should return.
7899 pub page_token: std::string::String,
7900
7901 /// Optional. The filter to apply on the resource, as defined by
7902 /// [AIP-160: Filtering](https://google.aip.dev/160).
7903 pub filter: std::string::String,
7904
7905 /// Optional. The sort order for the results. The following values are
7906 /// supported:
7907 ///
7908 /// * `name`
7909 /// * `name desc`
7910 ///
7911 /// If you do not specify a value, then the results are not sorted.
7912 pub order_by: std::string::String,
7913
7914 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7915}
7916
7917impl ListCloudControlDeploymentsRequest {
7918 pub fn new() -> Self {
7919 std::default::Default::default()
7920 }
7921
7922 /// Sets the value of [parent][crate::model::ListCloudControlDeploymentsRequest::parent].
7923 ///
7924 /// # Example
7925 /// ```ignore,no_run
7926 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlDeploymentsRequest;
7927 /// let x = ListCloudControlDeploymentsRequest::new().set_parent("example");
7928 /// ```
7929 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7930 self.parent = v.into();
7931 self
7932 }
7933
7934 /// Sets the value of [page_size][crate::model::ListCloudControlDeploymentsRequest::page_size].
7935 ///
7936 /// # Example
7937 /// ```ignore,no_run
7938 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlDeploymentsRequest;
7939 /// let x = ListCloudControlDeploymentsRequest::new().set_page_size(42);
7940 /// ```
7941 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7942 self.page_size = v.into();
7943 self
7944 }
7945
7946 /// Sets the value of [page_token][crate::model::ListCloudControlDeploymentsRequest::page_token].
7947 ///
7948 /// # Example
7949 /// ```ignore,no_run
7950 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlDeploymentsRequest;
7951 /// let x = ListCloudControlDeploymentsRequest::new().set_page_token("example");
7952 /// ```
7953 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7954 self.page_token = v.into();
7955 self
7956 }
7957
7958 /// Sets the value of [filter][crate::model::ListCloudControlDeploymentsRequest::filter].
7959 ///
7960 /// # Example
7961 /// ```ignore,no_run
7962 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlDeploymentsRequest;
7963 /// let x = ListCloudControlDeploymentsRequest::new().set_filter("example");
7964 /// ```
7965 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7966 self.filter = v.into();
7967 self
7968 }
7969
7970 /// Sets the value of [order_by][crate::model::ListCloudControlDeploymentsRequest::order_by].
7971 ///
7972 /// # Example
7973 /// ```ignore,no_run
7974 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlDeploymentsRequest;
7975 /// let x = ListCloudControlDeploymentsRequest::new().set_order_by("example");
7976 /// ```
7977 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7978 self.order_by = v.into();
7979 self
7980 }
7981}
7982
7983impl wkt::message::Message for ListCloudControlDeploymentsRequest {
7984 fn typename() -> &'static str {
7985 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListCloudControlDeploymentsRequest"
7986 }
7987}
7988
7989/// The response message for [ListCloudControlDeployments][].
7990#[derive(Clone, Default, PartialEq)]
7991#[non_exhaustive]
7992pub struct ListCloudControlDeploymentsResponse {
7993 /// The list of cloud control deployments.
7994 pub cloud_control_deployments: std::vec::Vec<crate::model::CloudControlDeployment>,
7995
7996 /// A token that identifies the next page of results that the server
7997 /// should return.
7998 pub next_page_token: std::string::String,
7999
8000 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8001}
8002
8003impl ListCloudControlDeploymentsResponse {
8004 pub fn new() -> Self {
8005 std::default::Default::default()
8006 }
8007
8008 /// Sets the value of [cloud_control_deployments][crate::model::ListCloudControlDeploymentsResponse::cloud_control_deployments].
8009 ///
8010 /// # Example
8011 /// ```ignore,no_run
8012 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlDeploymentsResponse;
8013 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
8014 /// let x = ListCloudControlDeploymentsResponse::new()
8015 /// .set_cloud_control_deployments([
8016 /// CloudControlDeployment::default()/* use setters */,
8017 /// CloudControlDeployment::default()/* use (different) setters */,
8018 /// ]);
8019 /// ```
8020 pub fn set_cloud_control_deployments<T, V>(mut self, v: T) -> Self
8021 where
8022 T: std::iter::IntoIterator<Item = V>,
8023 V: std::convert::Into<crate::model::CloudControlDeployment>,
8024 {
8025 use std::iter::Iterator;
8026 self.cloud_control_deployments = v.into_iter().map(|i| i.into()).collect();
8027 self
8028 }
8029
8030 /// Sets the value of [next_page_token][crate::model::ListCloudControlDeploymentsResponse::next_page_token].
8031 ///
8032 /// # Example
8033 /// ```ignore,no_run
8034 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlDeploymentsResponse;
8035 /// let x = ListCloudControlDeploymentsResponse::new().set_next_page_token("example");
8036 /// ```
8037 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8038 self.next_page_token = v.into();
8039 self
8040 }
8041}
8042
8043impl wkt::message::Message for ListCloudControlDeploymentsResponse {
8044 fn typename() -> &'static str {
8045 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListCloudControlDeploymentsResponse"
8046 }
8047}
8048
8049#[doc(hidden)]
8050impl google_cloud_gax::paginator::internal::PageableResponse
8051 for ListCloudControlDeploymentsResponse
8052{
8053 type PageItem = crate::model::CloudControlDeployment;
8054
8055 fn items(self) -> std::vec::Vec<Self::PageItem> {
8056 self.cloud_control_deployments
8057 }
8058
8059 fn next_page_token(&self) -> std::string::String {
8060 use std::clone::Clone;
8061 self.next_page_token.clone()
8062 }
8063}
8064
8065/// The reference to a cloud control deployment.
8066#[derive(Clone, Default, PartialEq)]
8067#[non_exhaustive]
8068pub struct CloudControlDeploymentReference {
8069 /// Output only. The name of the CloudControlDeployment. The format is
8070 /// `organizations/{org}/locations/{location}/cloudControlDeployments/{cloud_control_deployment_id}`.
8071 /// The only supported location is `global`.
8072 pub cloud_control_deployment: std::string::String,
8073
8074 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8075}
8076
8077impl CloudControlDeploymentReference {
8078 pub fn new() -> Self {
8079 std::default::Default::default()
8080 }
8081
8082 /// Sets the value of [cloud_control_deployment][crate::model::CloudControlDeploymentReference::cloud_control_deployment].
8083 ///
8084 /// # Example
8085 /// ```ignore,no_run
8086 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeploymentReference;
8087 /// let x = CloudControlDeploymentReference::new().set_cloud_control_deployment("example");
8088 /// ```
8089 pub fn set_cloud_control_deployment<T: std::convert::Into<std::string::String>>(
8090 mut self,
8091 v: T,
8092 ) -> Self {
8093 self.cloud_control_deployment = v.into();
8094 self
8095 }
8096}
8097
8098impl wkt::message::Message for CloudControlDeploymentReference {
8099 fn typename() -> &'static str {
8100 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControlDeploymentReference"
8101 }
8102}
8103
8104/// The reference to a framework deployment.
8105#[derive(Clone, Default, PartialEq)]
8106#[non_exhaustive]
8107pub struct FrameworkDeploymentReference {
8108 /// Output only. The name of the framework deployment, in the format
8109 /// `organizations/{org}/locations/{location}/frameworkDeployments/{framework_deployment_id}`.
8110 /// The only supported location is `global`.
8111 pub framework_deployment: std::string::String,
8112
8113 /// Optional. The reference to the framework that this deployment is for.
8114 /// For example:
8115 ///
8116 /// ```norust
8117 /// {
8118 /// framework:
8119 /// "organizations/{org}/locations/{location}/frameworks/{framework}",
8120 /// major_revision_id: 1
8121 /// }
8122 /// ```
8123 ///
8124 /// The only supported location is `global`.
8125 pub framework_reference: std::option::Option<crate::model::FrameworkReference>,
8126
8127 /// Optional. The display name of the framework that this framework deployment
8128 /// is for.
8129 pub framework_display_name: std::string::String,
8130
8131 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8132}
8133
8134impl FrameworkDeploymentReference {
8135 pub fn new() -> Self {
8136 std::default::Default::default()
8137 }
8138
8139 /// Sets the value of [framework_deployment][crate::model::FrameworkDeploymentReference::framework_deployment].
8140 ///
8141 /// # Example
8142 /// ```ignore,no_run
8143 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeploymentReference;
8144 /// let x = FrameworkDeploymentReference::new().set_framework_deployment("example");
8145 /// ```
8146 pub fn set_framework_deployment<T: std::convert::Into<std::string::String>>(
8147 mut self,
8148 v: T,
8149 ) -> Self {
8150 self.framework_deployment = v.into();
8151 self
8152 }
8153
8154 /// Sets the value of [framework_reference][crate::model::FrameworkDeploymentReference::framework_reference].
8155 ///
8156 /// # Example
8157 /// ```ignore,no_run
8158 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeploymentReference;
8159 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkReference;
8160 /// let x = FrameworkDeploymentReference::new().set_framework_reference(FrameworkReference::default()/* use setters */);
8161 /// ```
8162 pub fn set_framework_reference<T>(mut self, v: T) -> Self
8163 where
8164 T: std::convert::Into<crate::model::FrameworkReference>,
8165 {
8166 self.framework_reference = std::option::Option::Some(v.into());
8167 self
8168 }
8169
8170 /// Sets or clears the value of [framework_reference][crate::model::FrameworkDeploymentReference::framework_reference].
8171 ///
8172 /// # Example
8173 /// ```ignore,no_run
8174 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeploymentReference;
8175 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkReference;
8176 /// let x = FrameworkDeploymentReference::new().set_or_clear_framework_reference(Some(FrameworkReference::default()/* use setters */));
8177 /// let x = FrameworkDeploymentReference::new().set_or_clear_framework_reference(None::<FrameworkReference>);
8178 /// ```
8179 pub fn set_or_clear_framework_reference<T>(mut self, v: std::option::Option<T>) -> Self
8180 where
8181 T: std::convert::Into<crate::model::FrameworkReference>,
8182 {
8183 self.framework_reference = v.map(|x| x.into());
8184 self
8185 }
8186
8187 /// Sets the value of [framework_display_name][crate::model::FrameworkDeploymentReference::framework_display_name].
8188 ///
8189 /// # Example
8190 /// ```ignore,no_run
8191 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeploymentReference;
8192 /// let x = FrameworkDeploymentReference::new().set_framework_display_name("example");
8193 /// ```
8194 pub fn set_framework_display_name<T: std::convert::Into<std::string::String>>(
8195 mut self,
8196 v: T,
8197 ) -> Self {
8198 self.framework_display_name = v.into();
8199 self
8200 }
8201}
8202
8203impl wkt::message::Message for FrameworkDeploymentReference {
8204 fn typename() -> &'static str {
8205 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FrameworkDeploymentReference"
8206 }
8207}
8208
8209/// The request message for
8210/// [ListFrameworkComplianceSummariesRequest][google.cloud.cloudsecuritycompliance.v1.ListFrameworkComplianceSummariesRequest].
8211///
8212/// [google.cloud.cloudsecuritycompliance.v1.ListFrameworkComplianceSummariesRequest]: crate::model::ListFrameworkComplianceSummariesRequest
8213#[derive(Clone, Default, PartialEq)]
8214#[non_exhaustive]
8215pub struct ListFrameworkComplianceSummariesRequest {
8216 /// Required. The parent scope for the framework compliance summary.
8217 pub parent: std::string::String,
8218
8219 /// Optional. The requested page size. The server might return fewer items than
8220 /// requested. If unspecified, the server picks an appropriate default.
8221 pub page_size: i32,
8222
8223 /// Optional. A token that identifies the page of results that the server
8224 /// should return.
8225 pub page_token: std::string::String,
8226
8227 /// Optional. The filtering results.
8228 pub filter: std::string::String,
8229
8230 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8231}
8232
8233impl ListFrameworkComplianceSummariesRequest {
8234 pub fn new() -> Self {
8235 std::default::Default::default()
8236 }
8237
8238 /// Sets the value of [parent][crate::model::ListFrameworkComplianceSummariesRequest::parent].
8239 ///
8240 /// # Example
8241 /// ```ignore,no_run
8242 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkComplianceSummariesRequest;
8243 /// let x = ListFrameworkComplianceSummariesRequest::new().set_parent("example");
8244 /// ```
8245 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8246 self.parent = v.into();
8247 self
8248 }
8249
8250 /// Sets the value of [page_size][crate::model::ListFrameworkComplianceSummariesRequest::page_size].
8251 ///
8252 /// # Example
8253 /// ```ignore,no_run
8254 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkComplianceSummariesRequest;
8255 /// let x = ListFrameworkComplianceSummariesRequest::new().set_page_size(42);
8256 /// ```
8257 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8258 self.page_size = v.into();
8259 self
8260 }
8261
8262 /// Sets the value of [page_token][crate::model::ListFrameworkComplianceSummariesRequest::page_token].
8263 ///
8264 /// # Example
8265 /// ```ignore,no_run
8266 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkComplianceSummariesRequest;
8267 /// let x = ListFrameworkComplianceSummariesRequest::new().set_page_token("example");
8268 /// ```
8269 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8270 self.page_token = v.into();
8271 self
8272 }
8273
8274 /// Sets the value of [filter][crate::model::ListFrameworkComplianceSummariesRequest::filter].
8275 ///
8276 /// # Example
8277 /// ```ignore,no_run
8278 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkComplianceSummariesRequest;
8279 /// let x = ListFrameworkComplianceSummariesRequest::new().set_filter("example");
8280 /// ```
8281 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8282 self.filter = v.into();
8283 self
8284 }
8285}
8286
8287impl wkt::message::Message for ListFrameworkComplianceSummariesRequest {
8288 fn typename() -> &'static str {
8289 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFrameworkComplianceSummariesRequest"
8290 }
8291}
8292
8293/// The response message for
8294/// [ListFrameworkComplianceSummariesResponse][google.cloud.cloudsecuritycompliance.v1.ListFrameworkComplianceSummariesResponse].
8295///
8296/// [google.cloud.cloudsecuritycompliance.v1.ListFrameworkComplianceSummariesResponse]: crate::model::ListFrameworkComplianceSummariesResponse
8297#[derive(Clone, Default, PartialEq)]
8298#[non_exhaustive]
8299pub struct ListFrameworkComplianceSummariesResponse {
8300 /// The list of framework compliance summaries.
8301 pub framework_compliance_summaries: std::vec::Vec<crate::model::FrameworkComplianceSummary>,
8302
8303 /// Output only. The token to retrieve the next page of results.
8304 pub next_page_token: std::string::String,
8305
8306 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8307}
8308
8309impl ListFrameworkComplianceSummariesResponse {
8310 pub fn new() -> Self {
8311 std::default::Default::default()
8312 }
8313
8314 /// Sets the value of [framework_compliance_summaries][crate::model::ListFrameworkComplianceSummariesResponse::framework_compliance_summaries].
8315 ///
8316 /// # Example
8317 /// ```ignore,no_run
8318 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkComplianceSummariesResponse;
8319 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
8320 /// let x = ListFrameworkComplianceSummariesResponse::new()
8321 /// .set_framework_compliance_summaries([
8322 /// FrameworkComplianceSummary::default()/* use setters */,
8323 /// FrameworkComplianceSummary::default()/* use (different) setters */,
8324 /// ]);
8325 /// ```
8326 pub fn set_framework_compliance_summaries<T, V>(mut self, v: T) -> Self
8327 where
8328 T: std::iter::IntoIterator<Item = V>,
8329 V: std::convert::Into<crate::model::FrameworkComplianceSummary>,
8330 {
8331 use std::iter::Iterator;
8332 self.framework_compliance_summaries = v.into_iter().map(|i| i.into()).collect();
8333 self
8334 }
8335
8336 /// Sets the value of [next_page_token][crate::model::ListFrameworkComplianceSummariesResponse::next_page_token].
8337 ///
8338 /// # Example
8339 /// ```ignore,no_run
8340 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkComplianceSummariesResponse;
8341 /// let x = ListFrameworkComplianceSummariesResponse::new().set_next_page_token("example");
8342 /// ```
8343 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8344 self.next_page_token = v.into();
8345 self
8346 }
8347}
8348
8349impl wkt::message::Message for ListFrameworkComplianceSummariesResponse {
8350 fn typename() -> &'static str {
8351 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFrameworkComplianceSummariesResponse"
8352 }
8353}
8354
8355#[doc(hidden)]
8356impl google_cloud_gax::paginator::internal::PageableResponse
8357 for ListFrameworkComplianceSummariesResponse
8358{
8359 type PageItem = crate::model::FrameworkComplianceSummary;
8360
8361 fn items(self) -> std::vec::Vec<Self::PageItem> {
8362 self.framework_compliance_summaries
8363 }
8364
8365 fn next_page_token(&self) -> std::string::String {
8366 use std::clone::Clone;
8367 self.next_page_token.clone()
8368 }
8369}
8370
8371/// The response message for [GetFrameworkComplianceReport][].
8372#[derive(Clone, Default, PartialEq)]
8373#[non_exhaustive]
8374pub struct FrameworkComplianceReport {
8375 /// The name of the framework.
8376 pub framework: std::string::String,
8377
8378 /// The description of the framework.
8379 pub framework_description: std::string::String,
8380
8381 /// Output only. The last updated time of the report.
8382 pub update_time: std::option::Option<wkt::Timestamp>,
8383
8384 /// The control assessment details of the framework.
8385 pub control_assessment_details: std::option::Option<crate::model::ControlAssessmentDetails>,
8386
8387 /// The type of framework.
8388 pub framework_type: crate::model::framework::FrameworkType,
8389
8390 /// The list of cloud providers supported by the framework.
8391 pub supported_cloud_providers: std::vec::Vec<crate::model::CloudProvider>,
8392
8393 /// The list of framework categories supported.
8394 pub framework_categories: std::vec::Vec<crate::model::FrameworkCategory>,
8395
8396 /// Optional. The display name for the framework.
8397 pub framework_display_name: std::string::String,
8398
8399 /// Identifier. The name of the framework compliance report.
8400 pub name: std::string::String,
8401
8402 /// The latest major revision ID of the framework.
8403 pub major_revision_id: i64,
8404
8405 /// The latest minor revision ID of the latest major revision of the framework.
8406 pub minor_revision_id: i64,
8407
8408 /// The target resource details of the framework.
8409 pub target_resource_details: std::vec::Vec<crate::model::TargetResourceDetails>,
8410
8411 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8412}
8413
8414impl FrameworkComplianceReport {
8415 pub fn new() -> Self {
8416 std::default::Default::default()
8417 }
8418
8419 /// Sets the value of [framework][crate::model::FrameworkComplianceReport::framework].
8420 ///
8421 /// # Example
8422 /// ```ignore,no_run
8423 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
8424 /// let x = FrameworkComplianceReport::new().set_framework("example");
8425 /// ```
8426 pub fn set_framework<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8427 self.framework = v.into();
8428 self
8429 }
8430
8431 /// Sets the value of [framework_description][crate::model::FrameworkComplianceReport::framework_description].
8432 ///
8433 /// # Example
8434 /// ```ignore,no_run
8435 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
8436 /// let x = FrameworkComplianceReport::new().set_framework_description("example");
8437 /// ```
8438 pub fn set_framework_description<T: std::convert::Into<std::string::String>>(
8439 mut self,
8440 v: T,
8441 ) -> Self {
8442 self.framework_description = v.into();
8443 self
8444 }
8445
8446 /// Sets the value of [update_time][crate::model::FrameworkComplianceReport::update_time].
8447 ///
8448 /// # Example
8449 /// ```ignore,no_run
8450 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
8451 /// use wkt::Timestamp;
8452 /// let x = FrameworkComplianceReport::new().set_update_time(Timestamp::default()/* use setters */);
8453 /// ```
8454 pub fn set_update_time<T>(mut self, v: T) -> Self
8455 where
8456 T: std::convert::Into<wkt::Timestamp>,
8457 {
8458 self.update_time = std::option::Option::Some(v.into());
8459 self
8460 }
8461
8462 /// Sets or clears the value of [update_time][crate::model::FrameworkComplianceReport::update_time].
8463 ///
8464 /// # Example
8465 /// ```ignore,no_run
8466 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
8467 /// use wkt::Timestamp;
8468 /// let x = FrameworkComplianceReport::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
8469 /// let x = FrameworkComplianceReport::new().set_or_clear_update_time(None::<Timestamp>);
8470 /// ```
8471 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
8472 where
8473 T: std::convert::Into<wkt::Timestamp>,
8474 {
8475 self.update_time = v.map(|x| x.into());
8476 self
8477 }
8478
8479 /// Sets the value of [control_assessment_details][crate::model::FrameworkComplianceReport::control_assessment_details].
8480 ///
8481 /// # Example
8482 /// ```ignore,no_run
8483 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
8484 /// use google_cloud_cloudsecuritycompliance_v1::model::ControlAssessmentDetails;
8485 /// let x = FrameworkComplianceReport::new().set_control_assessment_details(ControlAssessmentDetails::default()/* use setters */);
8486 /// ```
8487 pub fn set_control_assessment_details<T>(mut self, v: T) -> Self
8488 where
8489 T: std::convert::Into<crate::model::ControlAssessmentDetails>,
8490 {
8491 self.control_assessment_details = std::option::Option::Some(v.into());
8492 self
8493 }
8494
8495 /// Sets or clears the value of [control_assessment_details][crate::model::FrameworkComplianceReport::control_assessment_details].
8496 ///
8497 /// # Example
8498 /// ```ignore,no_run
8499 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
8500 /// use google_cloud_cloudsecuritycompliance_v1::model::ControlAssessmentDetails;
8501 /// let x = FrameworkComplianceReport::new().set_or_clear_control_assessment_details(Some(ControlAssessmentDetails::default()/* use setters */));
8502 /// let x = FrameworkComplianceReport::new().set_or_clear_control_assessment_details(None::<ControlAssessmentDetails>);
8503 /// ```
8504 pub fn set_or_clear_control_assessment_details<T>(mut self, v: std::option::Option<T>) -> Self
8505 where
8506 T: std::convert::Into<crate::model::ControlAssessmentDetails>,
8507 {
8508 self.control_assessment_details = v.map(|x| x.into());
8509 self
8510 }
8511
8512 /// Sets the value of [framework_type][crate::model::FrameworkComplianceReport::framework_type].
8513 ///
8514 /// # Example
8515 /// ```ignore,no_run
8516 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
8517 /// use google_cloud_cloudsecuritycompliance_v1::model::framework::FrameworkType;
8518 /// let x0 = FrameworkComplianceReport::new().set_framework_type(FrameworkType::BuiltIn);
8519 /// let x1 = FrameworkComplianceReport::new().set_framework_type(FrameworkType::Custom);
8520 /// ```
8521 pub fn set_framework_type<T: std::convert::Into<crate::model::framework::FrameworkType>>(
8522 mut self,
8523 v: T,
8524 ) -> Self {
8525 self.framework_type = v.into();
8526 self
8527 }
8528
8529 /// Sets the value of [supported_cloud_providers][crate::model::FrameworkComplianceReport::supported_cloud_providers].
8530 ///
8531 /// # Example
8532 /// ```ignore,no_run
8533 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
8534 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudProvider;
8535 /// let x = FrameworkComplianceReport::new().set_supported_cloud_providers([
8536 /// CloudProvider::Aws,
8537 /// CloudProvider::Azure,
8538 /// CloudProvider::Gcp,
8539 /// ]);
8540 /// ```
8541 pub fn set_supported_cloud_providers<T, V>(mut self, v: T) -> Self
8542 where
8543 T: std::iter::IntoIterator<Item = V>,
8544 V: std::convert::Into<crate::model::CloudProvider>,
8545 {
8546 use std::iter::Iterator;
8547 self.supported_cloud_providers = v.into_iter().map(|i| i.into()).collect();
8548 self
8549 }
8550
8551 /// Sets the value of [framework_categories][crate::model::FrameworkComplianceReport::framework_categories].
8552 ///
8553 /// # Example
8554 /// ```ignore,no_run
8555 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
8556 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkCategory;
8557 /// let x = FrameworkComplianceReport::new().set_framework_categories([
8558 /// FrameworkCategory::IndustryDefinedStandard,
8559 /// FrameworkCategory::AssuredWorkloads,
8560 /// FrameworkCategory::DataSecurity,
8561 /// ]);
8562 /// ```
8563 pub fn set_framework_categories<T, V>(mut self, v: T) -> Self
8564 where
8565 T: std::iter::IntoIterator<Item = V>,
8566 V: std::convert::Into<crate::model::FrameworkCategory>,
8567 {
8568 use std::iter::Iterator;
8569 self.framework_categories = v.into_iter().map(|i| i.into()).collect();
8570 self
8571 }
8572
8573 /// Sets the value of [framework_display_name][crate::model::FrameworkComplianceReport::framework_display_name].
8574 ///
8575 /// # Example
8576 /// ```ignore,no_run
8577 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
8578 /// let x = FrameworkComplianceReport::new().set_framework_display_name("example");
8579 /// ```
8580 pub fn set_framework_display_name<T: std::convert::Into<std::string::String>>(
8581 mut self,
8582 v: T,
8583 ) -> Self {
8584 self.framework_display_name = v.into();
8585 self
8586 }
8587
8588 /// Sets the value of [name][crate::model::FrameworkComplianceReport::name].
8589 ///
8590 /// # Example
8591 /// ```ignore,no_run
8592 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
8593 /// let x = FrameworkComplianceReport::new().set_name("example");
8594 /// ```
8595 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8596 self.name = v.into();
8597 self
8598 }
8599
8600 /// Sets the value of [major_revision_id][crate::model::FrameworkComplianceReport::major_revision_id].
8601 ///
8602 /// # Example
8603 /// ```ignore,no_run
8604 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
8605 /// let x = FrameworkComplianceReport::new().set_major_revision_id(42);
8606 /// ```
8607 pub fn set_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8608 self.major_revision_id = v.into();
8609 self
8610 }
8611
8612 /// Sets the value of [minor_revision_id][crate::model::FrameworkComplianceReport::minor_revision_id].
8613 ///
8614 /// # Example
8615 /// ```ignore,no_run
8616 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
8617 /// let x = FrameworkComplianceReport::new().set_minor_revision_id(42);
8618 /// ```
8619 pub fn set_minor_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8620 self.minor_revision_id = v.into();
8621 self
8622 }
8623
8624 /// Sets the value of [target_resource_details][crate::model::FrameworkComplianceReport::target_resource_details].
8625 ///
8626 /// # Example
8627 /// ```ignore,no_run
8628 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
8629 /// use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceDetails;
8630 /// let x = FrameworkComplianceReport::new()
8631 /// .set_target_resource_details([
8632 /// TargetResourceDetails::default()/* use setters */,
8633 /// TargetResourceDetails::default()/* use (different) setters */,
8634 /// ]);
8635 /// ```
8636 pub fn set_target_resource_details<T, V>(mut self, v: T) -> Self
8637 where
8638 T: std::iter::IntoIterator<Item = V>,
8639 V: std::convert::Into<crate::model::TargetResourceDetails>,
8640 {
8641 use std::iter::Iterator;
8642 self.target_resource_details = v.into_iter().map(|i| i.into()).collect();
8643 self
8644 }
8645}
8646
8647impl wkt::message::Message for FrameworkComplianceReport {
8648 fn typename() -> &'static str {
8649 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FrameworkComplianceReport"
8650 }
8651}
8652
8653/// The request message for [FetchFrameworkComplianceReport][].
8654#[derive(Clone, Default, PartialEq)]
8655#[non_exhaustive]
8656pub struct FetchFrameworkComplianceReportRequest {
8657 /// Required. The name of the framework compliance report to retrieve.
8658 pub name: std::string::String,
8659
8660 /// Optional. The end time of the report.
8661 pub end_time: std::option::Option<wkt::Timestamp>,
8662
8663 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8664}
8665
8666impl FetchFrameworkComplianceReportRequest {
8667 pub fn new() -> Self {
8668 std::default::Default::default()
8669 }
8670
8671 /// Sets the value of [name][crate::model::FetchFrameworkComplianceReportRequest::name].
8672 ///
8673 /// # Example
8674 /// ```ignore,no_run
8675 /// # use google_cloud_cloudsecuritycompliance_v1::model::FetchFrameworkComplianceReportRequest;
8676 /// let x = FetchFrameworkComplianceReportRequest::new().set_name("example");
8677 /// ```
8678 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8679 self.name = v.into();
8680 self
8681 }
8682
8683 /// Sets the value of [end_time][crate::model::FetchFrameworkComplianceReportRequest::end_time].
8684 ///
8685 /// # Example
8686 /// ```ignore,no_run
8687 /// # use google_cloud_cloudsecuritycompliance_v1::model::FetchFrameworkComplianceReportRequest;
8688 /// use wkt::Timestamp;
8689 /// let x = FetchFrameworkComplianceReportRequest::new().set_end_time(Timestamp::default()/* use setters */);
8690 /// ```
8691 pub fn set_end_time<T>(mut self, v: T) -> Self
8692 where
8693 T: std::convert::Into<wkt::Timestamp>,
8694 {
8695 self.end_time = std::option::Option::Some(v.into());
8696 self
8697 }
8698
8699 /// Sets or clears the value of [end_time][crate::model::FetchFrameworkComplianceReportRequest::end_time].
8700 ///
8701 /// # Example
8702 /// ```ignore,no_run
8703 /// # use google_cloud_cloudsecuritycompliance_v1::model::FetchFrameworkComplianceReportRequest;
8704 /// use wkt::Timestamp;
8705 /// let x = FetchFrameworkComplianceReportRequest::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
8706 /// let x = FetchFrameworkComplianceReportRequest::new().set_or_clear_end_time(None::<Timestamp>);
8707 /// ```
8708 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8709 where
8710 T: std::convert::Into<wkt::Timestamp>,
8711 {
8712 self.end_time = v.map(|x| x.into());
8713 self
8714 }
8715}
8716
8717impl wkt::message::Message for FetchFrameworkComplianceReportRequest {
8718 fn typename() -> &'static str {
8719 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FetchFrameworkComplianceReportRequest"
8720 }
8721}
8722
8723/// The request message for [ListFindingSummaries][].
8724#[derive(Clone, Default, PartialEq)]
8725#[non_exhaustive]
8726pub struct ListFindingSummariesRequest {
8727 /// Required. The parent scope for the framework overview page.
8728 pub parent: std::string::String,
8729
8730 /// Optional. The requested page size. The server might return fewer items than
8731 /// requested. If unspecified, the server picks an appropriate default.
8732 pub page_size: i32,
8733
8734 /// Optional. A token that identifies the page of results that the server
8735 /// should return.
8736 pub page_token: std::string::String,
8737
8738 /// Optional. The filtering results.
8739 pub filter: std::string::String,
8740
8741 /// Optional. The end time of the finding summary.
8742 #[deprecated]
8743 pub end_time: std::option::Option<wkt::Timestamp>,
8744
8745 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8746}
8747
8748impl ListFindingSummariesRequest {
8749 pub fn new() -> Self {
8750 std::default::Default::default()
8751 }
8752
8753 /// Sets the value of [parent][crate::model::ListFindingSummariesRequest::parent].
8754 ///
8755 /// # Example
8756 /// ```ignore,no_run
8757 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFindingSummariesRequest;
8758 /// let x = ListFindingSummariesRequest::new().set_parent("example");
8759 /// ```
8760 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8761 self.parent = v.into();
8762 self
8763 }
8764
8765 /// Sets the value of [page_size][crate::model::ListFindingSummariesRequest::page_size].
8766 ///
8767 /// # Example
8768 /// ```ignore,no_run
8769 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFindingSummariesRequest;
8770 /// let x = ListFindingSummariesRequest::new().set_page_size(42);
8771 /// ```
8772 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8773 self.page_size = v.into();
8774 self
8775 }
8776
8777 /// Sets the value of [page_token][crate::model::ListFindingSummariesRequest::page_token].
8778 ///
8779 /// # Example
8780 /// ```ignore,no_run
8781 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFindingSummariesRequest;
8782 /// let x = ListFindingSummariesRequest::new().set_page_token("example");
8783 /// ```
8784 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8785 self.page_token = v.into();
8786 self
8787 }
8788
8789 /// Sets the value of [filter][crate::model::ListFindingSummariesRequest::filter].
8790 ///
8791 /// # Example
8792 /// ```ignore,no_run
8793 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFindingSummariesRequest;
8794 /// let x = ListFindingSummariesRequest::new().set_filter("example");
8795 /// ```
8796 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8797 self.filter = v.into();
8798 self
8799 }
8800
8801 /// Sets the value of [end_time][crate::model::ListFindingSummariesRequest::end_time].
8802 ///
8803 /// # Example
8804 /// ```ignore,no_run
8805 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFindingSummariesRequest;
8806 /// use wkt::Timestamp;
8807 /// let x = ListFindingSummariesRequest::new().set_end_time(Timestamp::default()/* use setters */);
8808 /// ```
8809 #[deprecated]
8810 pub fn set_end_time<T>(mut self, v: T) -> Self
8811 where
8812 T: std::convert::Into<wkt::Timestamp>,
8813 {
8814 self.end_time = std::option::Option::Some(v.into());
8815 self
8816 }
8817
8818 /// Sets or clears the value of [end_time][crate::model::ListFindingSummariesRequest::end_time].
8819 ///
8820 /// # Example
8821 /// ```ignore,no_run
8822 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFindingSummariesRequest;
8823 /// use wkt::Timestamp;
8824 /// let x = ListFindingSummariesRequest::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
8825 /// let x = ListFindingSummariesRequest::new().set_or_clear_end_time(None::<Timestamp>);
8826 /// ```
8827 #[deprecated]
8828 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8829 where
8830 T: std::convert::Into<wkt::Timestamp>,
8831 {
8832 self.end_time = v.map(|x| x.into());
8833 self
8834 }
8835}
8836
8837impl wkt::message::Message for ListFindingSummariesRequest {
8838 fn typename() -> &'static str {
8839 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFindingSummariesRequest"
8840 }
8841}
8842
8843/// The response message for [ListFindingSummaries][].
8844#[derive(Clone, Default, PartialEq)]
8845#[non_exhaustive]
8846pub struct ListFindingSummariesResponse {
8847 /// List of finding summary by category.
8848 pub finding_summaries: std::vec::Vec<crate::model::FindingSummary>,
8849
8850 /// Output only. The token to retrieve the next page of results.
8851 pub next_page_token: std::string::String,
8852
8853 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8854}
8855
8856impl ListFindingSummariesResponse {
8857 pub fn new() -> Self {
8858 std::default::Default::default()
8859 }
8860
8861 /// Sets the value of [finding_summaries][crate::model::ListFindingSummariesResponse::finding_summaries].
8862 ///
8863 /// # Example
8864 /// ```ignore,no_run
8865 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFindingSummariesResponse;
8866 /// use google_cloud_cloudsecuritycompliance_v1::model::FindingSummary;
8867 /// let x = ListFindingSummariesResponse::new()
8868 /// .set_finding_summaries([
8869 /// FindingSummary::default()/* use setters */,
8870 /// FindingSummary::default()/* use (different) setters */,
8871 /// ]);
8872 /// ```
8873 pub fn set_finding_summaries<T, V>(mut self, v: T) -> Self
8874 where
8875 T: std::iter::IntoIterator<Item = V>,
8876 V: std::convert::Into<crate::model::FindingSummary>,
8877 {
8878 use std::iter::Iterator;
8879 self.finding_summaries = v.into_iter().map(|i| i.into()).collect();
8880 self
8881 }
8882
8883 /// Sets the value of [next_page_token][crate::model::ListFindingSummariesResponse::next_page_token].
8884 ///
8885 /// # Example
8886 /// ```ignore,no_run
8887 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFindingSummariesResponse;
8888 /// let x = ListFindingSummariesResponse::new().set_next_page_token("example");
8889 /// ```
8890 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8891 self.next_page_token = v.into();
8892 self
8893 }
8894}
8895
8896impl wkt::message::Message for ListFindingSummariesResponse {
8897 fn typename() -> &'static str {
8898 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFindingSummariesResponse"
8899 }
8900}
8901
8902#[doc(hidden)]
8903impl google_cloud_gax::paginator::internal::PageableResponse for ListFindingSummariesResponse {
8904 type PageItem = crate::model::FindingSummary;
8905
8906 fn items(self) -> std::vec::Vec<Self::PageItem> {
8907 self.finding_summaries
8908 }
8909
8910 fn next_page_token(&self) -> std::string::String {
8911 use std::clone::Clone;
8912 self.next_page_token.clone()
8913 }
8914}
8915
8916/// The request message for [ListControlComplianceSummaries][].
8917#[derive(Clone, Default, PartialEq)]
8918#[non_exhaustive]
8919pub struct ListControlComplianceSummariesRequest {
8920 /// Required. The parent scope for the framework overview page.
8921 pub parent: std::string::String,
8922
8923 /// Optional. The end time of the control compliance summary.
8924 #[deprecated]
8925 pub end_time: std::option::Option<wkt::Timestamp>,
8926
8927 /// Optional. The requested page size. The server might return fewer items than
8928 /// requested. If unspecified, the server picks an appropriate default.
8929 pub page_size: i32,
8930
8931 /// Optional. A token that identifies the page of results that the server
8932 /// should return.
8933 pub page_token: std::string::String,
8934
8935 /// Optional. The filtering results.
8936 pub filter: std::string::String,
8937
8938 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8939}
8940
8941impl ListControlComplianceSummariesRequest {
8942 pub fn new() -> Self {
8943 std::default::Default::default()
8944 }
8945
8946 /// Sets the value of [parent][crate::model::ListControlComplianceSummariesRequest::parent].
8947 ///
8948 /// # Example
8949 /// ```ignore,no_run
8950 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListControlComplianceSummariesRequest;
8951 /// let x = ListControlComplianceSummariesRequest::new().set_parent("example");
8952 /// ```
8953 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8954 self.parent = v.into();
8955 self
8956 }
8957
8958 /// Sets the value of [end_time][crate::model::ListControlComplianceSummariesRequest::end_time].
8959 ///
8960 /// # Example
8961 /// ```ignore,no_run
8962 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListControlComplianceSummariesRequest;
8963 /// use wkt::Timestamp;
8964 /// let x = ListControlComplianceSummariesRequest::new().set_end_time(Timestamp::default()/* use setters */);
8965 /// ```
8966 #[deprecated]
8967 pub fn set_end_time<T>(mut self, v: T) -> Self
8968 where
8969 T: std::convert::Into<wkt::Timestamp>,
8970 {
8971 self.end_time = std::option::Option::Some(v.into());
8972 self
8973 }
8974
8975 /// Sets or clears the value of [end_time][crate::model::ListControlComplianceSummariesRequest::end_time].
8976 ///
8977 /// # Example
8978 /// ```ignore,no_run
8979 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListControlComplianceSummariesRequest;
8980 /// use wkt::Timestamp;
8981 /// let x = ListControlComplianceSummariesRequest::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
8982 /// let x = ListControlComplianceSummariesRequest::new().set_or_clear_end_time(None::<Timestamp>);
8983 /// ```
8984 #[deprecated]
8985 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8986 where
8987 T: std::convert::Into<wkt::Timestamp>,
8988 {
8989 self.end_time = v.map(|x| x.into());
8990 self
8991 }
8992
8993 /// Sets the value of [page_size][crate::model::ListControlComplianceSummariesRequest::page_size].
8994 ///
8995 /// # Example
8996 /// ```ignore,no_run
8997 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListControlComplianceSummariesRequest;
8998 /// let x = ListControlComplianceSummariesRequest::new().set_page_size(42);
8999 /// ```
9000 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9001 self.page_size = v.into();
9002 self
9003 }
9004
9005 /// Sets the value of [page_token][crate::model::ListControlComplianceSummariesRequest::page_token].
9006 ///
9007 /// # Example
9008 /// ```ignore,no_run
9009 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListControlComplianceSummariesRequest;
9010 /// let x = ListControlComplianceSummariesRequest::new().set_page_token("example");
9011 /// ```
9012 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9013 self.page_token = v.into();
9014 self
9015 }
9016
9017 /// Sets the value of [filter][crate::model::ListControlComplianceSummariesRequest::filter].
9018 ///
9019 /// # Example
9020 /// ```ignore,no_run
9021 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListControlComplianceSummariesRequest;
9022 /// let x = ListControlComplianceSummariesRequest::new().set_filter("example");
9023 /// ```
9024 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9025 self.filter = v.into();
9026 self
9027 }
9028}
9029
9030impl wkt::message::Message for ListControlComplianceSummariesRequest {
9031 fn typename() -> &'static str {
9032 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListControlComplianceSummariesRequest"
9033 }
9034}
9035
9036/// The response message for [ListControlComplianceSummaries][].
9037#[derive(Clone, Default, PartialEq)]
9038#[non_exhaustive]
9039pub struct ListControlComplianceSummariesResponse {
9040 /// The list of control compliance details.
9041 pub control_compliance_summaries: std::vec::Vec<crate::model::ControlComplianceSummary>,
9042
9043 /// Output only. The token to retrieve the next page of results.
9044 pub next_page_token: std::string::String,
9045
9046 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9047}
9048
9049impl ListControlComplianceSummariesResponse {
9050 pub fn new() -> Self {
9051 std::default::Default::default()
9052 }
9053
9054 /// Sets the value of [control_compliance_summaries][crate::model::ListControlComplianceSummariesResponse::control_compliance_summaries].
9055 ///
9056 /// # Example
9057 /// ```ignore,no_run
9058 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListControlComplianceSummariesResponse;
9059 /// use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
9060 /// let x = ListControlComplianceSummariesResponse::new()
9061 /// .set_control_compliance_summaries([
9062 /// ControlComplianceSummary::default()/* use setters */,
9063 /// ControlComplianceSummary::default()/* use (different) setters */,
9064 /// ]);
9065 /// ```
9066 pub fn set_control_compliance_summaries<T, V>(mut self, v: T) -> Self
9067 where
9068 T: std::iter::IntoIterator<Item = V>,
9069 V: std::convert::Into<crate::model::ControlComplianceSummary>,
9070 {
9071 use std::iter::Iterator;
9072 self.control_compliance_summaries = v.into_iter().map(|i| i.into()).collect();
9073 self
9074 }
9075
9076 /// Sets the value of [next_page_token][crate::model::ListControlComplianceSummariesResponse::next_page_token].
9077 ///
9078 /// # Example
9079 /// ```ignore,no_run
9080 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListControlComplianceSummariesResponse;
9081 /// let x = ListControlComplianceSummariesResponse::new().set_next_page_token("example");
9082 /// ```
9083 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9084 self.next_page_token = v.into();
9085 self
9086 }
9087}
9088
9089impl wkt::message::Message for ListControlComplianceSummariesResponse {
9090 fn typename() -> &'static str {
9091 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListControlComplianceSummariesResponse"
9092 }
9093}
9094
9095#[doc(hidden)]
9096impl google_cloud_gax::paginator::internal::PageableResponse
9097 for ListControlComplianceSummariesResponse
9098{
9099 type PageItem = crate::model::ControlComplianceSummary;
9100
9101 fn items(self) -> std::vec::Vec<Self::PageItem> {
9102 self.control_compliance_summaries
9103 }
9104
9105 fn next_page_token(&self) -> std::string::String {
9106 use std::clone::Clone;
9107 self.next_page_token.clone()
9108 }
9109}
9110
9111/// The request message for [AggregateFrameworkComplianceReport][].
9112#[derive(Clone, Default, PartialEq)]
9113#[non_exhaustive]
9114pub struct AggregateFrameworkComplianceReportRequest {
9115 /// Required. The name of the aggregated compliance report over time to
9116 /// retrieve.
9117 ///
9118 /// The supported format is:
9119 /// `organizations/{organization_id}/locations/{location}/frameworkComplianceReports/{framework_compliance_report}`
9120 pub name: std::string::String,
9121
9122 /// Optional. The start and end time range for the aggregated compliance
9123 /// report.
9124 pub interval: std::option::Option<google_cloud_type::model::Interval>,
9125
9126 /// Optional. The filtering results.
9127 pub filter: std::string::String,
9128
9129 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9130}
9131
9132impl AggregateFrameworkComplianceReportRequest {
9133 pub fn new() -> Self {
9134 std::default::Default::default()
9135 }
9136
9137 /// Sets the value of [name][crate::model::AggregateFrameworkComplianceReportRequest::name].
9138 ///
9139 /// # Example
9140 /// ```ignore,no_run
9141 /// # use google_cloud_cloudsecuritycompliance_v1::model::AggregateFrameworkComplianceReportRequest;
9142 /// let x = AggregateFrameworkComplianceReportRequest::new().set_name("example");
9143 /// ```
9144 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9145 self.name = v.into();
9146 self
9147 }
9148
9149 /// Sets the value of [interval][crate::model::AggregateFrameworkComplianceReportRequest::interval].
9150 ///
9151 /// # Example
9152 /// ```ignore,no_run
9153 /// # use google_cloud_cloudsecuritycompliance_v1::model::AggregateFrameworkComplianceReportRequest;
9154 /// use google_cloud_type::model::Interval;
9155 /// let x = AggregateFrameworkComplianceReportRequest::new().set_interval(Interval::default()/* use setters */);
9156 /// ```
9157 pub fn set_interval<T>(mut self, v: T) -> Self
9158 where
9159 T: std::convert::Into<google_cloud_type::model::Interval>,
9160 {
9161 self.interval = std::option::Option::Some(v.into());
9162 self
9163 }
9164
9165 /// Sets or clears the value of [interval][crate::model::AggregateFrameworkComplianceReportRequest::interval].
9166 ///
9167 /// # Example
9168 /// ```ignore,no_run
9169 /// # use google_cloud_cloudsecuritycompliance_v1::model::AggregateFrameworkComplianceReportRequest;
9170 /// use google_cloud_type::model::Interval;
9171 /// let x = AggregateFrameworkComplianceReportRequest::new().set_or_clear_interval(Some(Interval::default()/* use setters */));
9172 /// let x = AggregateFrameworkComplianceReportRequest::new().set_or_clear_interval(None::<Interval>);
9173 /// ```
9174 pub fn set_or_clear_interval<T>(mut self, v: std::option::Option<T>) -> Self
9175 where
9176 T: std::convert::Into<google_cloud_type::model::Interval>,
9177 {
9178 self.interval = v.map(|x| x.into());
9179 self
9180 }
9181
9182 /// Sets the value of [filter][crate::model::AggregateFrameworkComplianceReportRequest::filter].
9183 ///
9184 /// # Example
9185 /// ```ignore,no_run
9186 /// # use google_cloud_cloudsecuritycompliance_v1::model::AggregateFrameworkComplianceReportRequest;
9187 /// let x = AggregateFrameworkComplianceReportRequest::new().set_filter("example");
9188 /// ```
9189 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9190 self.filter = v.into();
9191 self
9192 }
9193}
9194
9195impl wkt::message::Message for AggregateFrameworkComplianceReportRequest {
9196 fn typename() -> &'static str {
9197 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.AggregateFrameworkComplianceReportRequest"
9198 }
9199}
9200
9201/// The response message for [AggregateFrameworkComplianceReport][].
9202#[derive(Clone, Default, PartialEq)]
9203#[non_exhaustive]
9204pub struct AggregateFrameworkComplianceReportResponse {
9205 /// The list of aggregated compliance reports.
9206 pub aggregated_compliance_reports: std::vec::Vec<crate::model::AggregatedComplianceReport>,
9207
9208 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9209}
9210
9211impl AggregateFrameworkComplianceReportResponse {
9212 pub fn new() -> Self {
9213 std::default::Default::default()
9214 }
9215
9216 /// Sets the value of [aggregated_compliance_reports][crate::model::AggregateFrameworkComplianceReportResponse::aggregated_compliance_reports].
9217 ///
9218 /// # Example
9219 /// ```ignore,no_run
9220 /// # use google_cloud_cloudsecuritycompliance_v1::model::AggregateFrameworkComplianceReportResponse;
9221 /// use google_cloud_cloudsecuritycompliance_v1::model::AggregatedComplianceReport;
9222 /// let x = AggregateFrameworkComplianceReportResponse::new()
9223 /// .set_aggregated_compliance_reports([
9224 /// AggregatedComplianceReport::default()/* use setters */,
9225 /// AggregatedComplianceReport::default()/* use (different) setters */,
9226 /// ]);
9227 /// ```
9228 pub fn set_aggregated_compliance_reports<T, V>(mut self, v: T) -> Self
9229 where
9230 T: std::iter::IntoIterator<Item = V>,
9231 V: std::convert::Into<crate::model::AggregatedComplianceReport>,
9232 {
9233 use std::iter::Iterator;
9234 self.aggregated_compliance_reports = v.into_iter().map(|i| i.into()).collect();
9235 self
9236 }
9237}
9238
9239impl wkt::message::Message for AggregateFrameworkComplianceReportResponse {
9240 fn typename() -> &'static str {
9241 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.AggregateFrameworkComplianceReportResponse"
9242 }
9243}
9244
9245/// The details for a control assessment.
9246#[derive(Clone, Default, PartialEq)]
9247#[non_exhaustive]
9248pub struct ControlAssessmentDetails {
9249 /// The number of controls that are passing or not assessed.
9250 pub passing_controls: i32,
9251
9252 /// The number of controls that are failing.
9253 pub failing_controls: i32,
9254
9255 /// The number of controls that were assessed and are passing.
9256 pub assessed_passing_controls: i32,
9257
9258 /// The number of controls that aren't assessed because they require manual
9259 /// review.
9260 pub not_assessed_controls: i32,
9261
9262 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9263}
9264
9265impl ControlAssessmentDetails {
9266 pub fn new() -> Self {
9267 std::default::Default::default()
9268 }
9269
9270 /// Sets the value of [passing_controls][crate::model::ControlAssessmentDetails::passing_controls].
9271 ///
9272 /// # Example
9273 /// ```ignore,no_run
9274 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlAssessmentDetails;
9275 /// let x = ControlAssessmentDetails::new().set_passing_controls(42);
9276 /// ```
9277 pub fn set_passing_controls<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9278 self.passing_controls = v.into();
9279 self
9280 }
9281
9282 /// Sets the value of [failing_controls][crate::model::ControlAssessmentDetails::failing_controls].
9283 ///
9284 /// # Example
9285 /// ```ignore,no_run
9286 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlAssessmentDetails;
9287 /// let x = ControlAssessmentDetails::new().set_failing_controls(42);
9288 /// ```
9289 pub fn set_failing_controls<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9290 self.failing_controls = v.into();
9291 self
9292 }
9293
9294 /// Sets the value of [assessed_passing_controls][crate::model::ControlAssessmentDetails::assessed_passing_controls].
9295 ///
9296 /// # Example
9297 /// ```ignore,no_run
9298 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlAssessmentDetails;
9299 /// let x = ControlAssessmentDetails::new().set_assessed_passing_controls(42);
9300 /// ```
9301 pub fn set_assessed_passing_controls<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9302 self.assessed_passing_controls = v.into();
9303 self
9304 }
9305
9306 /// Sets the value of [not_assessed_controls][crate::model::ControlAssessmentDetails::not_assessed_controls].
9307 ///
9308 /// # Example
9309 /// ```ignore,no_run
9310 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlAssessmentDetails;
9311 /// let x = ControlAssessmentDetails::new().set_not_assessed_controls(42);
9312 /// ```
9313 pub fn set_not_assessed_controls<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9314 self.not_assessed_controls = v.into();
9315 self
9316 }
9317}
9318
9319impl wkt::message::Message for ControlAssessmentDetails {
9320 fn typename() -> &'static str {
9321 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ControlAssessmentDetails"
9322 }
9323}
9324
9325/// The details for a framework compliance summary.
9326#[derive(Clone, Default, PartialEq)]
9327#[non_exhaustive]
9328pub struct FrameworkComplianceSummary {
9329 /// The name of the framework.
9330 pub framework: std::string::String,
9331
9332 /// The control assessment details of the framework.
9333 pub control_assessment_details: std::option::Option<crate::model::ControlAssessmentDetails>,
9334
9335 /// The type of framework.
9336 pub framework_type: crate::model::framework::FrameworkType,
9337
9338 /// The list of cloud providers supported by the framework.
9339 pub supported_cloud_providers: std::vec::Vec<crate::model::CloudProvider>,
9340
9341 /// The list of framework categories supported by the framework.
9342 pub framework_categories: std::vec::Vec<crate::model::FrameworkCategory>,
9343
9344 /// Optional. The display name for the framework.
9345 pub framework_display_name: std::string::String,
9346
9347 /// Identifier. The name of the framework compliance summary.
9348 pub name: std::string::String,
9349
9350 /// The major revision ID of the framework.
9351 pub major_revision_id: i64,
9352
9353 /// The minor revision ID of the framework.
9354 pub minor_revision_id: i64,
9355
9356 /// The target resource details for the framework.
9357 pub target_resource_details: std::vec::Vec<crate::model::TargetResourceDetails>,
9358
9359 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9360}
9361
9362impl FrameworkComplianceSummary {
9363 pub fn new() -> Self {
9364 std::default::Default::default()
9365 }
9366
9367 /// Sets the value of [framework][crate::model::FrameworkComplianceSummary::framework].
9368 ///
9369 /// # Example
9370 /// ```ignore,no_run
9371 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
9372 /// let x = FrameworkComplianceSummary::new().set_framework("example");
9373 /// ```
9374 pub fn set_framework<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9375 self.framework = v.into();
9376 self
9377 }
9378
9379 /// Sets the value of [control_assessment_details][crate::model::FrameworkComplianceSummary::control_assessment_details].
9380 ///
9381 /// # Example
9382 /// ```ignore,no_run
9383 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
9384 /// use google_cloud_cloudsecuritycompliance_v1::model::ControlAssessmentDetails;
9385 /// let x = FrameworkComplianceSummary::new().set_control_assessment_details(ControlAssessmentDetails::default()/* use setters */);
9386 /// ```
9387 pub fn set_control_assessment_details<T>(mut self, v: T) -> Self
9388 where
9389 T: std::convert::Into<crate::model::ControlAssessmentDetails>,
9390 {
9391 self.control_assessment_details = std::option::Option::Some(v.into());
9392 self
9393 }
9394
9395 /// Sets or clears the value of [control_assessment_details][crate::model::FrameworkComplianceSummary::control_assessment_details].
9396 ///
9397 /// # Example
9398 /// ```ignore,no_run
9399 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
9400 /// use google_cloud_cloudsecuritycompliance_v1::model::ControlAssessmentDetails;
9401 /// let x = FrameworkComplianceSummary::new().set_or_clear_control_assessment_details(Some(ControlAssessmentDetails::default()/* use setters */));
9402 /// let x = FrameworkComplianceSummary::new().set_or_clear_control_assessment_details(None::<ControlAssessmentDetails>);
9403 /// ```
9404 pub fn set_or_clear_control_assessment_details<T>(mut self, v: std::option::Option<T>) -> Self
9405 where
9406 T: std::convert::Into<crate::model::ControlAssessmentDetails>,
9407 {
9408 self.control_assessment_details = v.map(|x| x.into());
9409 self
9410 }
9411
9412 /// Sets the value of [framework_type][crate::model::FrameworkComplianceSummary::framework_type].
9413 ///
9414 /// # Example
9415 /// ```ignore,no_run
9416 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
9417 /// use google_cloud_cloudsecuritycompliance_v1::model::framework::FrameworkType;
9418 /// let x0 = FrameworkComplianceSummary::new().set_framework_type(FrameworkType::BuiltIn);
9419 /// let x1 = FrameworkComplianceSummary::new().set_framework_type(FrameworkType::Custom);
9420 /// ```
9421 pub fn set_framework_type<T: std::convert::Into<crate::model::framework::FrameworkType>>(
9422 mut self,
9423 v: T,
9424 ) -> Self {
9425 self.framework_type = v.into();
9426 self
9427 }
9428
9429 /// Sets the value of [supported_cloud_providers][crate::model::FrameworkComplianceSummary::supported_cloud_providers].
9430 ///
9431 /// # Example
9432 /// ```ignore,no_run
9433 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
9434 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudProvider;
9435 /// let x = FrameworkComplianceSummary::new().set_supported_cloud_providers([
9436 /// CloudProvider::Aws,
9437 /// CloudProvider::Azure,
9438 /// CloudProvider::Gcp,
9439 /// ]);
9440 /// ```
9441 pub fn set_supported_cloud_providers<T, V>(mut self, v: T) -> Self
9442 where
9443 T: std::iter::IntoIterator<Item = V>,
9444 V: std::convert::Into<crate::model::CloudProvider>,
9445 {
9446 use std::iter::Iterator;
9447 self.supported_cloud_providers = v.into_iter().map(|i| i.into()).collect();
9448 self
9449 }
9450
9451 /// Sets the value of [framework_categories][crate::model::FrameworkComplianceSummary::framework_categories].
9452 ///
9453 /// # Example
9454 /// ```ignore,no_run
9455 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
9456 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkCategory;
9457 /// let x = FrameworkComplianceSummary::new().set_framework_categories([
9458 /// FrameworkCategory::IndustryDefinedStandard,
9459 /// FrameworkCategory::AssuredWorkloads,
9460 /// FrameworkCategory::DataSecurity,
9461 /// ]);
9462 /// ```
9463 pub fn set_framework_categories<T, V>(mut self, v: T) -> Self
9464 where
9465 T: std::iter::IntoIterator<Item = V>,
9466 V: std::convert::Into<crate::model::FrameworkCategory>,
9467 {
9468 use std::iter::Iterator;
9469 self.framework_categories = v.into_iter().map(|i| i.into()).collect();
9470 self
9471 }
9472
9473 /// Sets the value of [framework_display_name][crate::model::FrameworkComplianceSummary::framework_display_name].
9474 ///
9475 /// # Example
9476 /// ```ignore,no_run
9477 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
9478 /// let x = FrameworkComplianceSummary::new().set_framework_display_name("example");
9479 /// ```
9480 pub fn set_framework_display_name<T: std::convert::Into<std::string::String>>(
9481 mut self,
9482 v: T,
9483 ) -> Self {
9484 self.framework_display_name = v.into();
9485 self
9486 }
9487
9488 /// Sets the value of [name][crate::model::FrameworkComplianceSummary::name].
9489 ///
9490 /// # Example
9491 /// ```ignore,no_run
9492 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
9493 /// let x = FrameworkComplianceSummary::new().set_name("example");
9494 /// ```
9495 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9496 self.name = v.into();
9497 self
9498 }
9499
9500 /// Sets the value of [major_revision_id][crate::model::FrameworkComplianceSummary::major_revision_id].
9501 ///
9502 /// # Example
9503 /// ```ignore,no_run
9504 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
9505 /// let x = FrameworkComplianceSummary::new().set_major_revision_id(42);
9506 /// ```
9507 pub fn set_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9508 self.major_revision_id = v.into();
9509 self
9510 }
9511
9512 /// Sets the value of [minor_revision_id][crate::model::FrameworkComplianceSummary::minor_revision_id].
9513 ///
9514 /// # Example
9515 /// ```ignore,no_run
9516 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
9517 /// let x = FrameworkComplianceSummary::new().set_minor_revision_id(42);
9518 /// ```
9519 pub fn set_minor_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9520 self.minor_revision_id = v.into();
9521 self
9522 }
9523
9524 /// Sets the value of [target_resource_details][crate::model::FrameworkComplianceSummary::target_resource_details].
9525 ///
9526 /// # Example
9527 /// ```ignore,no_run
9528 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
9529 /// use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceDetails;
9530 /// let x = FrameworkComplianceSummary::new()
9531 /// .set_target_resource_details([
9532 /// TargetResourceDetails::default()/* use setters */,
9533 /// TargetResourceDetails::default()/* use (different) setters */,
9534 /// ]);
9535 /// ```
9536 pub fn set_target_resource_details<T, V>(mut self, v: T) -> Self
9537 where
9538 T: std::iter::IntoIterator<Item = V>,
9539 V: std::convert::Into<crate::model::TargetResourceDetails>,
9540 {
9541 use std::iter::Iterator;
9542 self.target_resource_details = v.into_iter().map(|i| i.into()).collect();
9543 self
9544 }
9545}
9546
9547impl wkt::message::Message for FrameworkComplianceSummary {
9548 fn typename() -> &'static str {
9549 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FrameworkComplianceSummary"
9550 }
9551}
9552
9553/// The details for a finding.
9554#[derive(Clone, Default, PartialEq)]
9555#[non_exhaustive]
9556pub struct FindingSummary {
9557 /// The category of the finding.
9558 pub finding_category: std::string::String,
9559
9560 /// The class of the finding.
9561 pub finding_class: crate::model::FindingClass,
9562
9563 /// The severity of the finding.
9564 pub severity: crate::model::Severity,
9565
9566 /// The count of the finding.
9567 pub finding_count: i64,
9568
9569 /// Output only. The last updated time of the finding.
9570 pub update_time: std::option::Option<wkt::Timestamp>,
9571
9572 /// Optional. The list of compliance frameworks that the finding belongs to.
9573 pub related_frameworks: std::vec::Vec<std::string::String>,
9574
9575 /// Identifier. The name of the finding summary.
9576 pub name: std::string::String,
9577
9578 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9579}
9580
9581impl FindingSummary {
9582 pub fn new() -> Self {
9583 std::default::Default::default()
9584 }
9585
9586 /// Sets the value of [finding_category][crate::model::FindingSummary::finding_category].
9587 ///
9588 /// # Example
9589 /// ```ignore,no_run
9590 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingSummary;
9591 /// let x = FindingSummary::new().set_finding_category("example");
9592 /// ```
9593 pub fn set_finding_category<T: std::convert::Into<std::string::String>>(
9594 mut self,
9595 v: T,
9596 ) -> Self {
9597 self.finding_category = v.into();
9598 self
9599 }
9600
9601 /// Sets the value of [finding_class][crate::model::FindingSummary::finding_class].
9602 ///
9603 /// # Example
9604 /// ```ignore,no_run
9605 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingSummary;
9606 /// use google_cloud_cloudsecuritycompliance_v1::model::FindingClass;
9607 /// let x0 = FindingSummary::new().set_finding_class(FindingClass::Threat);
9608 /// let x1 = FindingSummary::new().set_finding_class(FindingClass::Vulnerability);
9609 /// let x2 = FindingSummary::new().set_finding_class(FindingClass::Misconfiguration);
9610 /// ```
9611 pub fn set_finding_class<T: std::convert::Into<crate::model::FindingClass>>(
9612 mut self,
9613 v: T,
9614 ) -> Self {
9615 self.finding_class = v.into();
9616 self
9617 }
9618
9619 /// Sets the value of [severity][crate::model::FindingSummary::severity].
9620 ///
9621 /// # Example
9622 /// ```ignore,no_run
9623 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingSummary;
9624 /// use google_cloud_cloudsecuritycompliance_v1::model::Severity;
9625 /// let x0 = FindingSummary::new().set_severity(Severity::Critical);
9626 /// let x1 = FindingSummary::new().set_severity(Severity::High);
9627 /// let x2 = FindingSummary::new().set_severity(Severity::Medium);
9628 /// ```
9629 pub fn set_severity<T: std::convert::Into<crate::model::Severity>>(mut self, v: T) -> Self {
9630 self.severity = v.into();
9631 self
9632 }
9633
9634 /// Sets the value of [finding_count][crate::model::FindingSummary::finding_count].
9635 ///
9636 /// # Example
9637 /// ```ignore,no_run
9638 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingSummary;
9639 /// let x = FindingSummary::new().set_finding_count(42);
9640 /// ```
9641 pub fn set_finding_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9642 self.finding_count = v.into();
9643 self
9644 }
9645
9646 /// Sets the value of [update_time][crate::model::FindingSummary::update_time].
9647 ///
9648 /// # Example
9649 /// ```ignore,no_run
9650 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingSummary;
9651 /// use wkt::Timestamp;
9652 /// let x = FindingSummary::new().set_update_time(Timestamp::default()/* use setters */);
9653 /// ```
9654 pub fn set_update_time<T>(mut self, v: T) -> Self
9655 where
9656 T: std::convert::Into<wkt::Timestamp>,
9657 {
9658 self.update_time = std::option::Option::Some(v.into());
9659 self
9660 }
9661
9662 /// Sets or clears the value of [update_time][crate::model::FindingSummary::update_time].
9663 ///
9664 /// # Example
9665 /// ```ignore,no_run
9666 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingSummary;
9667 /// use wkt::Timestamp;
9668 /// let x = FindingSummary::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9669 /// let x = FindingSummary::new().set_or_clear_update_time(None::<Timestamp>);
9670 /// ```
9671 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9672 where
9673 T: std::convert::Into<wkt::Timestamp>,
9674 {
9675 self.update_time = v.map(|x| x.into());
9676 self
9677 }
9678
9679 /// Sets the value of [related_frameworks][crate::model::FindingSummary::related_frameworks].
9680 ///
9681 /// # Example
9682 /// ```ignore,no_run
9683 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingSummary;
9684 /// let x = FindingSummary::new().set_related_frameworks(["a", "b", "c"]);
9685 /// ```
9686 pub fn set_related_frameworks<T, V>(mut self, v: T) -> Self
9687 where
9688 T: std::iter::IntoIterator<Item = V>,
9689 V: std::convert::Into<std::string::String>,
9690 {
9691 use std::iter::Iterator;
9692 self.related_frameworks = v.into_iter().map(|i| i.into()).collect();
9693 self
9694 }
9695
9696 /// Sets the value of [name][crate::model::FindingSummary::name].
9697 ///
9698 /// # Example
9699 /// ```ignore,no_run
9700 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingSummary;
9701 /// let x = FindingSummary::new().set_name("example");
9702 /// ```
9703 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9704 self.name = v.into();
9705 self
9706 }
9707}
9708
9709impl wkt::message::Message for FindingSummary {
9710 fn typename() -> &'static str {
9711 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FindingSummary"
9712 }
9713}
9714
9715/// The details for control compliance.
9716#[derive(Clone, Default, PartialEq)]
9717#[non_exhaustive]
9718pub struct ControlComplianceSummary {
9719 /// The name of the control.
9720 pub control: std::string::String,
9721
9722 /// The display name of the control.
9723 pub display_name: std::string::String,
9724
9725 /// The description of the control.
9726 pub description: std::string::String,
9727
9728 /// Output only. The overall evaluation status of the control.
9729 pub overall_evaluation_state: crate::model::EvaluationState,
9730
9731 /// The total number of findings for the control.
9732 pub total_findings_count: i32,
9733
9734 /// The list of compliance frameworks that the control belongs to.
9735 pub compliance_frameworks: std::vec::Vec<std::string::String>,
9736
9737 /// The list of similar controls.
9738 pub similar_controls: std::vec::Vec<crate::model::SimilarControls>,
9739
9740 /// The list of cloud control reports.
9741 pub cloud_control_reports: std::vec::Vec<crate::model::CloudControlReport>,
9742
9743 /// The responsibility type for the control.
9744 pub control_responsibility_type: crate::model::RegulatoryControlResponsibilityType,
9745
9746 /// Whether the control is a fake control. Fake controls are created
9747 /// and mapped to cloud controls that don't belong to a control group.
9748 pub is_fake_control: bool,
9749
9750 /// Identifier. The name of the control compliance summary.
9751 pub name: std::string::String,
9752
9753 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9754}
9755
9756impl ControlComplianceSummary {
9757 pub fn new() -> Self {
9758 std::default::Default::default()
9759 }
9760
9761 /// Sets the value of [control][crate::model::ControlComplianceSummary::control].
9762 ///
9763 /// # Example
9764 /// ```ignore,no_run
9765 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
9766 /// let x = ControlComplianceSummary::new().set_control("example");
9767 /// ```
9768 pub fn set_control<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9769 self.control = v.into();
9770 self
9771 }
9772
9773 /// Sets the value of [display_name][crate::model::ControlComplianceSummary::display_name].
9774 ///
9775 /// # Example
9776 /// ```ignore,no_run
9777 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
9778 /// let x = ControlComplianceSummary::new().set_display_name("example");
9779 /// ```
9780 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9781 self.display_name = v.into();
9782 self
9783 }
9784
9785 /// Sets the value of [description][crate::model::ControlComplianceSummary::description].
9786 ///
9787 /// # Example
9788 /// ```ignore,no_run
9789 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
9790 /// let x = ControlComplianceSummary::new().set_description("example");
9791 /// ```
9792 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9793 self.description = v.into();
9794 self
9795 }
9796
9797 /// Sets the value of [overall_evaluation_state][crate::model::ControlComplianceSummary::overall_evaluation_state].
9798 ///
9799 /// # Example
9800 /// ```ignore,no_run
9801 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
9802 /// use google_cloud_cloudsecuritycompliance_v1::model::EvaluationState;
9803 /// let x0 = ControlComplianceSummary::new().set_overall_evaluation_state(EvaluationState::Passed);
9804 /// let x1 = ControlComplianceSummary::new().set_overall_evaluation_state(EvaluationState::Failed);
9805 /// let x2 = ControlComplianceSummary::new().set_overall_evaluation_state(EvaluationState::NotAssessed);
9806 /// ```
9807 pub fn set_overall_evaluation_state<T: std::convert::Into<crate::model::EvaluationState>>(
9808 mut self,
9809 v: T,
9810 ) -> Self {
9811 self.overall_evaluation_state = v.into();
9812 self
9813 }
9814
9815 /// Sets the value of [total_findings_count][crate::model::ControlComplianceSummary::total_findings_count].
9816 ///
9817 /// # Example
9818 /// ```ignore,no_run
9819 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
9820 /// let x = ControlComplianceSummary::new().set_total_findings_count(42);
9821 /// ```
9822 pub fn set_total_findings_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9823 self.total_findings_count = v.into();
9824 self
9825 }
9826
9827 /// Sets the value of [compliance_frameworks][crate::model::ControlComplianceSummary::compliance_frameworks].
9828 ///
9829 /// # Example
9830 /// ```ignore,no_run
9831 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
9832 /// let x = ControlComplianceSummary::new().set_compliance_frameworks(["a", "b", "c"]);
9833 /// ```
9834 pub fn set_compliance_frameworks<T, V>(mut self, v: T) -> Self
9835 where
9836 T: std::iter::IntoIterator<Item = V>,
9837 V: std::convert::Into<std::string::String>,
9838 {
9839 use std::iter::Iterator;
9840 self.compliance_frameworks = v.into_iter().map(|i| i.into()).collect();
9841 self
9842 }
9843
9844 /// Sets the value of [similar_controls][crate::model::ControlComplianceSummary::similar_controls].
9845 ///
9846 /// # Example
9847 /// ```ignore,no_run
9848 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
9849 /// use google_cloud_cloudsecuritycompliance_v1::model::SimilarControls;
9850 /// let x = ControlComplianceSummary::new()
9851 /// .set_similar_controls([
9852 /// SimilarControls::default()/* use setters */,
9853 /// SimilarControls::default()/* use (different) setters */,
9854 /// ]);
9855 /// ```
9856 pub fn set_similar_controls<T, V>(mut self, v: T) -> Self
9857 where
9858 T: std::iter::IntoIterator<Item = V>,
9859 V: std::convert::Into<crate::model::SimilarControls>,
9860 {
9861 use std::iter::Iterator;
9862 self.similar_controls = v.into_iter().map(|i| i.into()).collect();
9863 self
9864 }
9865
9866 /// Sets the value of [cloud_control_reports][crate::model::ControlComplianceSummary::cloud_control_reports].
9867 ///
9868 /// # Example
9869 /// ```ignore,no_run
9870 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
9871 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
9872 /// let x = ControlComplianceSummary::new()
9873 /// .set_cloud_control_reports([
9874 /// CloudControlReport::default()/* use setters */,
9875 /// CloudControlReport::default()/* use (different) setters */,
9876 /// ]);
9877 /// ```
9878 pub fn set_cloud_control_reports<T, V>(mut self, v: T) -> Self
9879 where
9880 T: std::iter::IntoIterator<Item = V>,
9881 V: std::convert::Into<crate::model::CloudControlReport>,
9882 {
9883 use std::iter::Iterator;
9884 self.cloud_control_reports = v.into_iter().map(|i| i.into()).collect();
9885 self
9886 }
9887
9888 /// Sets the value of [control_responsibility_type][crate::model::ControlComplianceSummary::control_responsibility_type].
9889 ///
9890 /// # Example
9891 /// ```ignore,no_run
9892 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
9893 /// use google_cloud_cloudsecuritycompliance_v1::model::RegulatoryControlResponsibilityType;
9894 /// let x0 = ControlComplianceSummary::new().set_control_responsibility_type(RegulatoryControlResponsibilityType::Google);
9895 /// let x1 = ControlComplianceSummary::new().set_control_responsibility_type(RegulatoryControlResponsibilityType::Customer);
9896 /// let x2 = ControlComplianceSummary::new().set_control_responsibility_type(RegulatoryControlResponsibilityType::Shared);
9897 /// ```
9898 pub fn set_control_responsibility_type<
9899 T: std::convert::Into<crate::model::RegulatoryControlResponsibilityType>,
9900 >(
9901 mut self,
9902 v: T,
9903 ) -> Self {
9904 self.control_responsibility_type = v.into();
9905 self
9906 }
9907
9908 /// Sets the value of [is_fake_control][crate::model::ControlComplianceSummary::is_fake_control].
9909 ///
9910 /// # Example
9911 /// ```ignore,no_run
9912 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
9913 /// let x = ControlComplianceSummary::new().set_is_fake_control(true);
9914 /// ```
9915 pub fn set_is_fake_control<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9916 self.is_fake_control = v.into();
9917 self
9918 }
9919
9920 /// Sets the value of [name][crate::model::ControlComplianceSummary::name].
9921 ///
9922 /// # Example
9923 /// ```ignore,no_run
9924 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
9925 /// let x = ControlComplianceSummary::new().set_name("example");
9926 /// ```
9927 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9928 self.name = v.into();
9929 self
9930 }
9931}
9932
9933impl wkt::message::Message for ControlComplianceSummary {
9934 fn typename() -> &'static str {
9935 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ControlComplianceSummary"
9936 }
9937}
9938
9939/// The cloud control report.
9940#[derive(Clone, Default, PartialEq)]
9941#[non_exhaustive]
9942pub struct CloudControlReport {
9943 /// The name of the cloud control.
9944 pub cloud_control: std::string::String,
9945
9946 /// The display name of the cloud control.
9947 pub display_name: std::string::String,
9948
9949 /// The description of the cloud control.
9950 pub description: std::string::String,
9951
9952 /// The list of categories for the cloud control.
9953 pub categories: std::vec::Vec<std::string::String>,
9954
9955 /// The list of similar controls.
9956 pub similar_controls: std::vec::Vec<crate::model::SimilarControls>,
9957
9958 /// The type of the cloud control.
9959 pub cloud_control_type: crate::model::cloud_control::Type,
9960
9961 /// The category of the finding.
9962 pub finding_category: std::string::String,
9963
9964 /// The list of rules that correspond to the cloud control.
9965 pub rules: std::vec::Vec<crate::model::Rule>,
9966
9967 /// The severity of the finding.
9968 pub finding_severity: crate::model::Severity,
9969
9970 /// The enforcement mode of the cloud control.
9971 pub enforcement_mode: crate::model::EnforcementMode,
9972
9973 /// The name of the cloud control deployment.
9974 pub cloud_control_deployment: std::string::String,
9975
9976 /// The major revision ID of the cloud control.
9977 pub major_revision_id: i64,
9978
9979 /// The minor revision ID of the cloud control.
9980 pub minor_revision_id: i64,
9981
9982 /// The major revision IDs of the frameworks that the cloud control belongs to.
9983 pub framework_major_revision_ids: std::vec::Vec<i64>,
9984
9985 /// The assessment details of the cloud control.
9986 pub assessment_details:
9987 std::option::Option<crate::model::cloud_control_report::AssessmentDetails>,
9988
9989 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9990}
9991
9992impl CloudControlReport {
9993 pub fn new() -> Self {
9994 std::default::Default::default()
9995 }
9996
9997 /// Sets the value of [cloud_control][crate::model::CloudControlReport::cloud_control].
9998 ///
9999 /// # Example
10000 /// ```ignore,no_run
10001 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10002 /// let x = CloudControlReport::new().set_cloud_control("example");
10003 /// ```
10004 pub fn set_cloud_control<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10005 self.cloud_control = v.into();
10006 self
10007 }
10008
10009 /// Sets the value of [display_name][crate::model::CloudControlReport::display_name].
10010 ///
10011 /// # Example
10012 /// ```ignore,no_run
10013 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10014 /// let x = CloudControlReport::new().set_display_name("example");
10015 /// ```
10016 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10017 self.display_name = v.into();
10018 self
10019 }
10020
10021 /// Sets the value of [description][crate::model::CloudControlReport::description].
10022 ///
10023 /// # Example
10024 /// ```ignore,no_run
10025 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10026 /// let x = CloudControlReport::new().set_description("example");
10027 /// ```
10028 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10029 self.description = v.into();
10030 self
10031 }
10032
10033 /// Sets the value of [categories][crate::model::CloudControlReport::categories].
10034 ///
10035 /// # Example
10036 /// ```ignore,no_run
10037 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10038 /// let x = CloudControlReport::new().set_categories(["a", "b", "c"]);
10039 /// ```
10040 pub fn set_categories<T, V>(mut self, v: T) -> Self
10041 where
10042 T: std::iter::IntoIterator<Item = V>,
10043 V: std::convert::Into<std::string::String>,
10044 {
10045 use std::iter::Iterator;
10046 self.categories = v.into_iter().map(|i| i.into()).collect();
10047 self
10048 }
10049
10050 /// Sets the value of [similar_controls][crate::model::CloudControlReport::similar_controls].
10051 ///
10052 /// # Example
10053 /// ```ignore,no_run
10054 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10055 /// use google_cloud_cloudsecuritycompliance_v1::model::SimilarControls;
10056 /// let x = CloudControlReport::new()
10057 /// .set_similar_controls([
10058 /// SimilarControls::default()/* use setters */,
10059 /// SimilarControls::default()/* use (different) setters */,
10060 /// ]);
10061 /// ```
10062 pub fn set_similar_controls<T, V>(mut self, v: T) -> Self
10063 where
10064 T: std::iter::IntoIterator<Item = V>,
10065 V: std::convert::Into<crate::model::SimilarControls>,
10066 {
10067 use std::iter::Iterator;
10068 self.similar_controls = v.into_iter().map(|i| i.into()).collect();
10069 self
10070 }
10071
10072 /// Sets the value of [cloud_control_type][crate::model::CloudControlReport::cloud_control_type].
10073 ///
10074 /// # Example
10075 /// ```ignore,no_run
10076 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10077 /// use google_cloud_cloudsecuritycompliance_v1::model::cloud_control::Type;
10078 /// let x0 = CloudControlReport::new().set_cloud_control_type(Type::Custom);
10079 /// let x1 = CloudControlReport::new().set_cloud_control_type(Type::BuiltIn);
10080 /// ```
10081 pub fn set_cloud_control_type<T: std::convert::Into<crate::model::cloud_control::Type>>(
10082 mut self,
10083 v: T,
10084 ) -> Self {
10085 self.cloud_control_type = v.into();
10086 self
10087 }
10088
10089 /// Sets the value of [finding_category][crate::model::CloudControlReport::finding_category].
10090 ///
10091 /// # Example
10092 /// ```ignore,no_run
10093 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10094 /// let x = CloudControlReport::new().set_finding_category("example");
10095 /// ```
10096 pub fn set_finding_category<T: std::convert::Into<std::string::String>>(
10097 mut self,
10098 v: T,
10099 ) -> Self {
10100 self.finding_category = v.into();
10101 self
10102 }
10103
10104 /// Sets the value of [rules][crate::model::CloudControlReport::rules].
10105 ///
10106 /// # Example
10107 /// ```ignore,no_run
10108 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10109 /// use google_cloud_cloudsecuritycompliance_v1::model::Rule;
10110 /// let x = CloudControlReport::new()
10111 /// .set_rules([
10112 /// Rule::default()/* use setters */,
10113 /// Rule::default()/* use (different) setters */,
10114 /// ]);
10115 /// ```
10116 pub fn set_rules<T, V>(mut self, v: T) -> Self
10117 where
10118 T: std::iter::IntoIterator<Item = V>,
10119 V: std::convert::Into<crate::model::Rule>,
10120 {
10121 use std::iter::Iterator;
10122 self.rules = v.into_iter().map(|i| i.into()).collect();
10123 self
10124 }
10125
10126 /// Sets the value of [finding_severity][crate::model::CloudControlReport::finding_severity].
10127 ///
10128 /// # Example
10129 /// ```ignore,no_run
10130 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10131 /// use google_cloud_cloudsecuritycompliance_v1::model::Severity;
10132 /// let x0 = CloudControlReport::new().set_finding_severity(Severity::Critical);
10133 /// let x1 = CloudControlReport::new().set_finding_severity(Severity::High);
10134 /// let x2 = CloudControlReport::new().set_finding_severity(Severity::Medium);
10135 /// ```
10136 pub fn set_finding_severity<T: std::convert::Into<crate::model::Severity>>(
10137 mut self,
10138 v: T,
10139 ) -> Self {
10140 self.finding_severity = v.into();
10141 self
10142 }
10143
10144 /// Sets the value of [enforcement_mode][crate::model::CloudControlReport::enforcement_mode].
10145 ///
10146 /// # Example
10147 /// ```ignore,no_run
10148 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10149 /// use google_cloud_cloudsecuritycompliance_v1::model::EnforcementMode;
10150 /// let x0 = CloudControlReport::new().set_enforcement_mode(EnforcementMode::Preventive);
10151 /// let x1 = CloudControlReport::new().set_enforcement_mode(EnforcementMode::Detective);
10152 /// let x2 = CloudControlReport::new().set_enforcement_mode(EnforcementMode::Audit);
10153 /// ```
10154 pub fn set_enforcement_mode<T: std::convert::Into<crate::model::EnforcementMode>>(
10155 mut self,
10156 v: T,
10157 ) -> Self {
10158 self.enforcement_mode = v.into();
10159 self
10160 }
10161
10162 /// Sets the value of [cloud_control_deployment][crate::model::CloudControlReport::cloud_control_deployment].
10163 ///
10164 /// # Example
10165 /// ```ignore,no_run
10166 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10167 /// let x = CloudControlReport::new().set_cloud_control_deployment("example");
10168 /// ```
10169 pub fn set_cloud_control_deployment<T: std::convert::Into<std::string::String>>(
10170 mut self,
10171 v: T,
10172 ) -> Self {
10173 self.cloud_control_deployment = v.into();
10174 self
10175 }
10176
10177 /// Sets the value of [major_revision_id][crate::model::CloudControlReport::major_revision_id].
10178 ///
10179 /// # Example
10180 /// ```ignore,no_run
10181 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10182 /// let x = CloudControlReport::new().set_major_revision_id(42);
10183 /// ```
10184 pub fn set_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10185 self.major_revision_id = v.into();
10186 self
10187 }
10188
10189 /// Sets the value of [minor_revision_id][crate::model::CloudControlReport::minor_revision_id].
10190 ///
10191 /// # Example
10192 /// ```ignore,no_run
10193 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10194 /// let x = CloudControlReport::new().set_minor_revision_id(42);
10195 /// ```
10196 pub fn set_minor_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10197 self.minor_revision_id = v.into();
10198 self
10199 }
10200
10201 /// Sets the value of [framework_major_revision_ids][crate::model::CloudControlReport::framework_major_revision_ids].
10202 ///
10203 /// # Example
10204 /// ```ignore,no_run
10205 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10206 /// let x = CloudControlReport::new().set_framework_major_revision_ids([1, 2, 3]);
10207 /// ```
10208 pub fn set_framework_major_revision_ids<T, V>(mut self, v: T) -> Self
10209 where
10210 T: std::iter::IntoIterator<Item = V>,
10211 V: std::convert::Into<i64>,
10212 {
10213 use std::iter::Iterator;
10214 self.framework_major_revision_ids = v.into_iter().map(|i| i.into()).collect();
10215 self
10216 }
10217
10218 /// Sets the value of [assessment_details][crate::model::CloudControlReport::assessment_details].
10219 ///
10220 /// Note that all the setters affecting `assessment_details` are mutually
10221 /// exclusive.
10222 ///
10223 /// # Example
10224 /// ```ignore,no_run
10225 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10226 /// use google_cloud_cloudsecuritycompliance_v1::model::ManualCloudControlAssessmentDetails;
10227 /// let x = CloudControlReport::new().set_assessment_details(Some(
10228 /// google_cloud_cloudsecuritycompliance_v1::model::cloud_control_report::AssessmentDetails::ManualCloudControlAssessmentDetails(ManualCloudControlAssessmentDetails::default().into())));
10229 /// ```
10230 pub fn set_assessment_details<
10231 T: std::convert::Into<
10232 std::option::Option<crate::model::cloud_control_report::AssessmentDetails>,
10233 >,
10234 >(
10235 mut self,
10236 v: T,
10237 ) -> Self {
10238 self.assessment_details = v.into();
10239 self
10240 }
10241
10242 /// The value of [assessment_details][crate::model::CloudControlReport::assessment_details]
10243 /// if it holds a `ManualCloudControlAssessmentDetails`, `None` if the field is not set or
10244 /// holds a different branch.
10245 pub fn manual_cloud_control_assessment_details(
10246 &self,
10247 ) -> std::option::Option<&std::boxed::Box<crate::model::ManualCloudControlAssessmentDetails>>
10248 {
10249 #[allow(unreachable_patterns)]
10250 self.assessment_details.as_ref().and_then(|v| match v {
10251 crate::model::cloud_control_report::AssessmentDetails::ManualCloudControlAssessmentDetails(v) => std::option::Option::Some(v),
10252 _ => std::option::Option::None,
10253 })
10254 }
10255
10256 /// Sets the value of [assessment_details][crate::model::CloudControlReport::assessment_details]
10257 /// to hold a `ManualCloudControlAssessmentDetails`.
10258 ///
10259 /// Note that all the setters affecting `assessment_details` are
10260 /// mutually exclusive.
10261 ///
10262 /// # Example
10263 /// ```ignore,no_run
10264 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10265 /// use google_cloud_cloudsecuritycompliance_v1::model::ManualCloudControlAssessmentDetails;
10266 /// let x = CloudControlReport::new().set_manual_cloud_control_assessment_details(ManualCloudControlAssessmentDetails::default()/* use setters */);
10267 /// assert!(x.manual_cloud_control_assessment_details().is_some());
10268 /// assert!(x.cloud_control_assessment_details().is_none());
10269 /// ```
10270 pub fn set_manual_cloud_control_assessment_details<
10271 T: std::convert::Into<std::boxed::Box<crate::model::ManualCloudControlAssessmentDetails>>,
10272 >(
10273 mut self,
10274 v: T,
10275 ) -> Self {
10276 self.assessment_details = std::option::Option::Some(
10277 crate::model::cloud_control_report::AssessmentDetails::ManualCloudControlAssessmentDetails(
10278 v.into()
10279 )
10280 );
10281 self
10282 }
10283
10284 /// The value of [assessment_details][crate::model::CloudControlReport::assessment_details]
10285 /// if it holds a `CloudControlAssessmentDetails`, `None` if the field is not set or
10286 /// holds a different branch.
10287 pub fn cloud_control_assessment_details(
10288 &self,
10289 ) -> std::option::Option<&std::boxed::Box<crate::model::CloudControlAssessmentDetails>> {
10290 #[allow(unreachable_patterns)]
10291 self.assessment_details.as_ref().and_then(|v| match v {
10292 crate::model::cloud_control_report::AssessmentDetails::CloudControlAssessmentDetails(v) => std::option::Option::Some(v),
10293 _ => std::option::Option::None,
10294 })
10295 }
10296
10297 /// Sets the value of [assessment_details][crate::model::CloudControlReport::assessment_details]
10298 /// to hold a `CloudControlAssessmentDetails`.
10299 ///
10300 /// Note that all the setters affecting `assessment_details` are
10301 /// mutually exclusive.
10302 ///
10303 /// # Example
10304 /// ```ignore,no_run
10305 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10306 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAssessmentDetails;
10307 /// let x = CloudControlReport::new().set_cloud_control_assessment_details(CloudControlAssessmentDetails::default()/* use setters */);
10308 /// assert!(x.cloud_control_assessment_details().is_some());
10309 /// assert!(x.manual_cloud_control_assessment_details().is_none());
10310 /// ```
10311 pub fn set_cloud_control_assessment_details<
10312 T: std::convert::Into<std::boxed::Box<crate::model::CloudControlAssessmentDetails>>,
10313 >(
10314 mut self,
10315 v: T,
10316 ) -> Self {
10317 self.assessment_details = std::option::Option::Some(
10318 crate::model::cloud_control_report::AssessmentDetails::CloudControlAssessmentDetails(
10319 v.into(),
10320 ),
10321 );
10322 self
10323 }
10324}
10325
10326impl wkt::message::Message for CloudControlReport {
10327 fn typename() -> &'static str {
10328 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControlReport"
10329 }
10330}
10331
10332/// Defines additional types related to [CloudControlReport].
10333pub mod cloud_control_report {
10334 #[allow(unused_imports)]
10335 use super::*;
10336
10337 /// The assessment details of the cloud control.
10338 #[derive(Clone, Debug, PartialEq)]
10339 #[non_exhaustive]
10340 pub enum AssessmentDetails {
10341 /// The details of a manual cloud control assessment.
10342 ManualCloudControlAssessmentDetails(
10343 std::boxed::Box<crate::model::ManualCloudControlAssessmentDetails>,
10344 ),
10345 /// The details of a cloud control assessment.
10346 CloudControlAssessmentDetails(std::boxed::Box<crate::model::CloudControlAssessmentDetails>),
10347 }
10348}
10349
10350/// The details for a manual cloud control assessment.
10351#[derive(Clone, Default, PartialEq)]
10352#[non_exhaustive]
10353pub struct ManualCloudControlAssessmentDetails {
10354 /// The guide for assessing a cloud control manually.
10355 pub manual_cloud_control_guide: std::vec::Vec<std::string::String>,
10356
10357 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10358}
10359
10360impl ManualCloudControlAssessmentDetails {
10361 pub fn new() -> Self {
10362 std::default::Default::default()
10363 }
10364
10365 /// Sets the value of [manual_cloud_control_guide][crate::model::ManualCloudControlAssessmentDetails::manual_cloud_control_guide].
10366 ///
10367 /// # Example
10368 /// ```ignore,no_run
10369 /// # use google_cloud_cloudsecuritycompliance_v1::model::ManualCloudControlAssessmentDetails;
10370 /// let x = ManualCloudControlAssessmentDetails::new().set_manual_cloud_control_guide(["a", "b", "c"]);
10371 /// ```
10372 pub fn set_manual_cloud_control_guide<T, V>(mut self, v: T) -> Self
10373 where
10374 T: std::iter::IntoIterator<Item = V>,
10375 V: std::convert::Into<std::string::String>,
10376 {
10377 use std::iter::Iterator;
10378 self.manual_cloud_control_guide = v.into_iter().map(|i| i.into()).collect();
10379 self
10380 }
10381}
10382
10383impl wkt::message::Message for ManualCloudControlAssessmentDetails {
10384 fn typename() -> &'static str {
10385 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ManualCloudControlAssessmentDetails"
10386 }
10387}
10388
10389/// The cloud control assessment details for non-manual cloud controls.
10390#[derive(Clone, Default, PartialEq)]
10391#[non_exhaustive]
10392pub struct CloudControlAssessmentDetails {
10393 /// The number of findings for the cloud control.
10394 pub findings_count: i32,
10395
10396 /// Output only. The evaluation status of the cloud control.
10397 pub evaluation_state: crate::model::EvaluationState,
10398
10399 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10400}
10401
10402impl CloudControlAssessmentDetails {
10403 pub fn new() -> Self {
10404 std::default::Default::default()
10405 }
10406
10407 /// Sets the value of [findings_count][crate::model::CloudControlAssessmentDetails::findings_count].
10408 ///
10409 /// # Example
10410 /// ```ignore,no_run
10411 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAssessmentDetails;
10412 /// let x = CloudControlAssessmentDetails::new().set_findings_count(42);
10413 /// ```
10414 pub fn set_findings_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10415 self.findings_count = v.into();
10416 self
10417 }
10418
10419 /// Sets the value of [evaluation_state][crate::model::CloudControlAssessmentDetails::evaluation_state].
10420 ///
10421 /// # Example
10422 /// ```ignore,no_run
10423 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAssessmentDetails;
10424 /// use google_cloud_cloudsecuritycompliance_v1::model::EvaluationState;
10425 /// let x0 = CloudControlAssessmentDetails::new().set_evaluation_state(EvaluationState::Passed);
10426 /// let x1 = CloudControlAssessmentDetails::new().set_evaluation_state(EvaluationState::Failed);
10427 /// let x2 = CloudControlAssessmentDetails::new().set_evaluation_state(EvaluationState::NotAssessed);
10428 /// ```
10429 pub fn set_evaluation_state<T: std::convert::Into<crate::model::EvaluationState>>(
10430 mut self,
10431 v: T,
10432 ) -> Self {
10433 self.evaluation_state = v.into();
10434 self
10435 }
10436}
10437
10438impl wkt::message::Message for CloudControlAssessmentDetails {
10439 fn typename() -> &'static str {
10440 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControlAssessmentDetails"
10441 }
10442}
10443
10444/// The similar controls.
10445#[derive(Clone, Default, PartialEq)]
10446#[non_exhaustive]
10447pub struct SimilarControls {
10448 /// The name of the framework.
10449 pub framework: std::string::String,
10450
10451 /// The ID of the control.
10452 pub control_id: std::string::String,
10453
10454 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10455}
10456
10457impl SimilarControls {
10458 pub fn new() -> Self {
10459 std::default::Default::default()
10460 }
10461
10462 /// Sets the value of [framework][crate::model::SimilarControls::framework].
10463 ///
10464 /// # Example
10465 /// ```ignore,no_run
10466 /// # use google_cloud_cloudsecuritycompliance_v1::model::SimilarControls;
10467 /// let x = SimilarControls::new().set_framework("example");
10468 /// ```
10469 pub fn set_framework<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10470 self.framework = v.into();
10471 self
10472 }
10473
10474 /// Sets the value of [control_id][crate::model::SimilarControls::control_id].
10475 ///
10476 /// # Example
10477 /// ```ignore,no_run
10478 /// # use google_cloud_cloudsecuritycompliance_v1::model::SimilarControls;
10479 /// let x = SimilarControls::new().set_control_id("example");
10480 /// ```
10481 pub fn set_control_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10482 self.control_id = v.into();
10483 self
10484 }
10485}
10486
10487impl wkt::message::Message for SimilarControls {
10488 fn typename() -> &'static str {
10489 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.SimilarControls"
10490 }
10491}
10492
10493/// The aggregated compliance report.
10494#[derive(Clone, Default, PartialEq)]
10495#[non_exhaustive]
10496pub struct AggregatedComplianceReport {
10497 /// The control assessment details of the framework.
10498 pub control_assessment_details: std::option::Option<crate::model::ControlAssessmentDetails>,
10499
10500 /// The report time of the aggregated compliance report.
10501 pub report_time: std::option::Option<wkt::Timestamp>,
10502
10503 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10504}
10505
10506impl AggregatedComplianceReport {
10507 pub fn new() -> Self {
10508 std::default::Default::default()
10509 }
10510
10511 /// Sets the value of [control_assessment_details][crate::model::AggregatedComplianceReport::control_assessment_details].
10512 ///
10513 /// # Example
10514 /// ```ignore,no_run
10515 /// # use google_cloud_cloudsecuritycompliance_v1::model::AggregatedComplianceReport;
10516 /// use google_cloud_cloudsecuritycompliance_v1::model::ControlAssessmentDetails;
10517 /// let x = AggregatedComplianceReport::new().set_control_assessment_details(ControlAssessmentDetails::default()/* use setters */);
10518 /// ```
10519 pub fn set_control_assessment_details<T>(mut self, v: T) -> Self
10520 where
10521 T: std::convert::Into<crate::model::ControlAssessmentDetails>,
10522 {
10523 self.control_assessment_details = std::option::Option::Some(v.into());
10524 self
10525 }
10526
10527 /// Sets or clears the value of [control_assessment_details][crate::model::AggregatedComplianceReport::control_assessment_details].
10528 ///
10529 /// # Example
10530 /// ```ignore,no_run
10531 /// # use google_cloud_cloudsecuritycompliance_v1::model::AggregatedComplianceReport;
10532 /// use google_cloud_cloudsecuritycompliance_v1::model::ControlAssessmentDetails;
10533 /// let x = AggregatedComplianceReport::new().set_or_clear_control_assessment_details(Some(ControlAssessmentDetails::default()/* use setters */));
10534 /// let x = AggregatedComplianceReport::new().set_or_clear_control_assessment_details(None::<ControlAssessmentDetails>);
10535 /// ```
10536 pub fn set_or_clear_control_assessment_details<T>(mut self, v: std::option::Option<T>) -> Self
10537 where
10538 T: std::convert::Into<crate::model::ControlAssessmentDetails>,
10539 {
10540 self.control_assessment_details = v.map(|x| x.into());
10541 self
10542 }
10543
10544 /// Sets the value of [report_time][crate::model::AggregatedComplianceReport::report_time].
10545 ///
10546 /// # Example
10547 /// ```ignore,no_run
10548 /// # use google_cloud_cloudsecuritycompliance_v1::model::AggregatedComplianceReport;
10549 /// use wkt::Timestamp;
10550 /// let x = AggregatedComplianceReport::new().set_report_time(Timestamp::default()/* use setters */);
10551 /// ```
10552 pub fn set_report_time<T>(mut self, v: T) -> Self
10553 where
10554 T: std::convert::Into<wkt::Timestamp>,
10555 {
10556 self.report_time = std::option::Option::Some(v.into());
10557 self
10558 }
10559
10560 /// Sets or clears the value of [report_time][crate::model::AggregatedComplianceReport::report_time].
10561 ///
10562 /// # Example
10563 /// ```ignore,no_run
10564 /// # use google_cloud_cloudsecuritycompliance_v1::model::AggregatedComplianceReport;
10565 /// use wkt::Timestamp;
10566 /// let x = AggregatedComplianceReport::new().set_or_clear_report_time(Some(Timestamp::default()/* use setters */));
10567 /// let x = AggregatedComplianceReport::new().set_or_clear_report_time(None::<Timestamp>);
10568 /// ```
10569 pub fn set_or_clear_report_time<T>(mut self, v: std::option::Option<T>) -> Self
10570 where
10571 T: std::convert::Into<wkt::Timestamp>,
10572 {
10573 self.report_time = v.map(|x| x.into());
10574 self
10575 }
10576}
10577
10578impl wkt::message::Message for AggregatedComplianceReport {
10579 fn typename() -> &'static str {
10580 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.AggregatedComplianceReport"
10581 }
10582}
10583
10584/// The details for a target resource.
10585#[derive(Clone, Default, PartialEq)]
10586#[non_exhaustive]
10587pub struct TargetResourceDetails {
10588 /// The framework deployment name for the target resource.
10589 ///
10590 /// For example,
10591 /// `organizations/{organization_id}/locations/{location}/frameworkDeployments/{framework_deployment_id}`
10592 pub framework_deployment: std::string::String,
10593
10594 /// The display name of the target resource. For example, `google.com`,
10595 /// `staging-project`, or `development-folder`.
10596 pub target_resource_display_name: std::string::String,
10597
10598 /// The target resource. For example, `organizations/1234567890`,
10599 /// `projects/1234567890`, or `folders/1234567890`.
10600 pub target_resource: std::string::String,
10601
10602 /// The create time of the target resource.
10603 pub create_time: std::option::Option<wkt::Timestamp>,
10604
10605 /// The update time of the target resource.
10606 pub update_time: std::option::Option<wkt::Timestamp>,
10607
10608 /// The major revision ID of the framework for the target resource.
10609 pub major_revision_id: i64,
10610
10611 /// The minor revision ID of the framework for the target resource.
10612 pub minor_revision_id: i64,
10613
10614 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10615}
10616
10617impl TargetResourceDetails {
10618 pub fn new() -> Self {
10619 std::default::Default::default()
10620 }
10621
10622 /// Sets the value of [framework_deployment][crate::model::TargetResourceDetails::framework_deployment].
10623 ///
10624 /// # Example
10625 /// ```ignore,no_run
10626 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceDetails;
10627 /// let x = TargetResourceDetails::new().set_framework_deployment("example");
10628 /// ```
10629 pub fn set_framework_deployment<T: std::convert::Into<std::string::String>>(
10630 mut self,
10631 v: T,
10632 ) -> Self {
10633 self.framework_deployment = v.into();
10634 self
10635 }
10636
10637 /// Sets the value of [target_resource_display_name][crate::model::TargetResourceDetails::target_resource_display_name].
10638 ///
10639 /// # Example
10640 /// ```ignore,no_run
10641 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceDetails;
10642 /// let x = TargetResourceDetails::new().set_target_resource_display_name("example");
10643 /// ```
10644 pub fn set_target_resource_display_name<T: std::convert::Into<std::string::String>>(
10645 mut self,
10646 v: T,
10647 ) -> Self {
10648 self.target_resource_display_name = v.into();
10649 self
10650 }
10651
10652 /// Sets the value of [target_resource][crate::model::TargetResourceDetails::target_resource].
10653 ///
10654 /// # Example
10655 /// ```ignore,no_run
10656 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceDetails;
10657 /// let x = TargetResourceDetails::new().set_target_resource("example");
10658 /// ```
10659 pub fn set_target_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10660 self.target_resource = v.into();
10661 self
10662 }
10663
10664 /// Sets the value of [create_time][crate::model::TargetResourceDetails::create_time].
10665 ///
10666 /// # Example
10667 /// ```ignore,no_run
10668 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceDetails;
10669 /// use wkt::Timestamp;
10670 /// let x = TargetResourceDetails::new().set_create_time(Timestamp::default()/* use setters */);
10671 /// ```
10672 pub fn set_create_time<T>(mut self, v: T) -> Self
10673 where
10674 T: std::convert::Into<wkt::Timestamp>,
10675 {
10676 self.create_time = std::option::Option::Some(v.into());
10677 self
10678 }
10679
10680 /// Sets or clears the value of [create_time][crate::model::TargetResourceDetails::create_time].
10681 ///
10682 /// # Example
10683 /// ```ignore,no_run
10684 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceDetails;
10685 /// use wkt::Timestamp;
10686 /// let x = TargetResourceDetails::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
10687 /// let x = TargetResourceDetails::new().set_or_clear_create_time(None::<Timestamp>);
10688 /// ```
10689 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
10690 where
10691 T: std::convert::Into<wkt::Timestamp>,
10692 {
10693 self.create_time = v.map(|x| x.into());
10694 self
10695 }
10696
10697 /// Sets the value of [update_time][crate::model::TargetResourceDetails::update_time].
10698 ///
10699 /// # Example
10700 /// ```ignore,no_run
10701 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceDetails;
10702 /// use wkt::Timestamp;
10703 /// let x = TargetResourceDetails::new().set_update_time(Timestamp::default()/* use setters */);
10704 /// ```
10705 pub fn set_update_time<T>(mut self, v: T) -> Self
10706 where
10707 T: std::convert::Into<wkt::Timestamp>,
10708 {
10709 self.update_time = std::option::Option::Some(v.into());
10710 self
10711 }
10712
10713 /// Sets or clears the value of [update_time][crate::model::TargetResourceDetails::update_time].
10714 ///
10715 /// # Example
10716 /// ```ignore,no_run
10717 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceDetails;
10718 /// use wkt::Timestamp;
10719 /// let x = TargetResourceDetails::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
10720 /// let x = TargetResourceDetails::new().set_or_clear_update_time(None::<Timestamp>);
10721 /// ```
10722 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10723 where
10724 T: std::convert::Into<wkt::Timestamp>,
10725 {
10726 self.update_time = v.map(|x| x.into());
10727 self
10728 }
10729
10730 /// Sets the value of [major_revision_id][crate::model::TargetResourceDetails::major_revision_id].
10731 ///
10732 /// # Example
10733 /// ```ignore,no_run
10734 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceDetails;
10735 /// let x = TargetResourceDetails::new().set_major_revision_id(42);
10736 /// ```
10737 pub fn set_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10738 self.major_revision_id = v.into();
10739 self
10740 }
10741
10742 /// Sets the value of [minor_revision_id][crate::model::TargetResourceDetails::minor_revision_id].
10743 ///
10744 /// # Example
10745 /// ```ignore,no_run
10746 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceDetails;
10747 /// let x = TargetResourceDetails::new().set_minor_revision_id(42);
10748 /// ```
10749 pub fn set_minor_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10750 self.minor_revision_id = v.into();
10751 self
10752 }
10753}
10754
10755impl wkt::message::Message for TargetResourceDetails {
10756 fn typename() -> &'static str {
10757 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.TargetResourceDetails"
10758 }
10759}
10760
10761/// The state of compliance after evaluation is complete.
10762///
10763/// # Working with unknown values
10764///
10765/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10766/// additional enum variants at any time. Adding new variants is not considered
10767/// a breaking change. Applications should write their code in anticipation of:
10768///
10769/// - New values appearing in future releases of the client library, **and**
10770/// - New values received dynamically, without application changes.
10771///
10772/// Please consult the [Working with enums] section in the user guide for some
10773/// guidelines.
10774///
10775/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10776#[derive(Clone, Debug, PartialEq)]
10777#[non_exhaustive]
10778pub enum ComplianceState {
10779 /// Default value. This value is unused.
10780 Unspecified,
10781 /// The resource is compliant.
10782 Compliant,
10783 /// The resource has a violation.
10784 Violation,
10785 /// The resource requires manual review from you.
10786 ManualReviewNeeded,
10787 /// An error occurred while computing the resource status.
10788 Error,
10789 /// The resource can't be audited.
10790 AuditNotSupported,
10791 /// If set, the enum was initialized with an unknown value.
10792 ///
10793 /// Applications can examine the value using [ComplianceState::value] or
10794 /// [ComplianceState::name].
10795 UnknownValue(compliance_state::UnknownValue),
10796}
10797
10798#[doc(hidden)]
10799pub mod compliance_state {
10800 #[allow(unused_imports)]
10801 use super::*;
10802 #[derive(Clone, Debug, PartialEq)]
10803 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10804}
10805
10806impl ComplianceState {
10807 /// Gets the enum value.
10808 ///
10809 /// Returns `None` if the enum contains an unknown value deserialized from
10810 /// the string representation of enums.
10811 pub fn value(&self) -> std::option::Option<i32> {
10812 match self {
10813 Self::Unspecified => std::option::Option::Some(0),
10814 Self::Compliant => std::option::Option::Some(1),
10815 Self::Violation => std::option::Option::Some(2),
10816 Self::ManualReviewNeeded => std::option::Option::Some(3),
10817 Self::Error => std::option::Option::Some(4),
10818 Self::AuditNotSupported => std::option::Option::Some(5),
10819 Self::UnknownValue(u) => u.0.value(),
10820 }
10821 }
10822
10823 /// Gets the enum value as a string.
10824 ///
10825 /// Returns `None` if the enum contains an unknown value deserialized from
10826 /// the integer representation of enums.
10827 pub fn name(&self) -> std::option::Option<&str> {
10828 match self {
10829 Self::Unspecified => std::option::Option::Some("COMPLIANCE_STATE_UNSPECIFIED"),
10830 Self::Compliant => std::option::Option::Some("COMPLIANT"),
10831 Self::Violation => std::option::Option::Some("VIOLATION"),
10832 Self::ManualReviewNeeded => std::option::Option::Some("MANUAL_REVIEW_NEEDED"),
10833 Self::Error => std::option::Option::Some("ERROR"),
10834 Self::AuditNotSupported => std::option::Option::Some("AUDIT_NOT_SUPPORTED"),
10835 Self::UnknownValue(u) => u.0.name(),
10836 }
10837 }
10838}
10839
10840impl std::default::Default for ComplianceState {
10841 fn default() -> Self {
10842 use std::convert::From;
10843 Self::from(0)
10844 }
10845}
10846
10847impl std::fmt::Display for ComplianceState {
10848 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10849 wkt::internal::display_enum(f, self.name(), self.value())
10850 }
10851}
10852
10853impl std::convert::From<i32> for ComplianceState {
10854 fn from(value: i32) -> Self {
10855 match value {
10856 0 => Self::Unspecified,
10857 1 => Self::Compliant,
10858 2 => Self::Violation,
10859 3 => Self::ManualReviewNeeded,
10860 4 => Self::Error,
10861 5 => Self::AuditNotSupported,
10862 _ => Self::UnknownValue(compliance_state::UnknownValue(
10863 wkt::internal::UnknownEnumValue::Integer(value),
10864 )),
10865 }
10866 }
10867}
10868
10869impl std::convert::From<&str> for ComplianceState {
10870 fn from(value: &str) -> Self {
10871 use std::string::ToString;
10872 match value {
10873 "COMPLIANCE_STATE_UNSPECIFIED" => Self::Unspecified,
10874 "COMPLIANT" => Self::Compliant,
10875 "VIOLATION" => Self::Violation,
10876 "MANUAL_REVIEW_NEEDED" => Self::ManualReviewNeeded,
10877 "ERROR" => Self::Error,
10878 "AUDIT_NOT_SUPPORTED" => Self::AuditNotSupported,
10879 _ => Self::UnknownValue(compliance_state::UnknownValue(
10880 wkt::internal::UnknownEnumValue::String(value.to_string()),
10881 )),
10882 }
10883 }
10884}
10885
10886impl serde::ser::Serialize for ComplianceState {
10887 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10888 where
10889 S: serde::Serializer,
10890 {
10891 match self {
10892 Self::Unspecified => serializer.serialize_i32(0),
10893 Self::Compliant => serializer.serialize_i32(1),
10894 Self::Violation => serializer.serialize_i32(2),
10895 Self::ManualReviewNeeded => serializer.serialize_i32(3),
10896 Self::Error => serializer.serialize_i32(4),
10897 Self::AuditNotSupported => serializer.serialize_i32(5),
10898 Self::UnknownValue(u) => u.0.serialize(serializer),
10899 }
10900 }
10901}
10902
10903impl<'de> serde::de::Deserialize<'de> for ComplianceState {
10904 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10905 where
10906 D: serde::Deserializer<'de>,
10907 {
10908 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ComplianceState>::new(
10909 ".google.cloud.cloudsecuritycompliance.v1.ComplianceState",
10910 ))
10911 }
10912}
10913
10914/// The responsibility type for the regulatory control.
10915///
10916/// # Working with unknown values
10917///
10918/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10919/// additional enum variants at any time. Adding new variants is not considered
10920/// a breaking change. Applications should write their code in anticipation of:
10921///
10922/// - New values appearing in future releases of the client library, **and**
10923/// - New values received dynamically, without application changes.
10924///
10925/// Please consult the [Working with enums] section in the user guide for some
10926/// guidelines.
10927///
10928/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10929#[derive(Clone, Debug, PartialEq)]
10930#[non_exhaustive]
10931pub enum RegulatoryControlResponsibilityType {
10932 /// Default value. This value is unused.
10933 Unspecified,
10934 /// Google's responsibility.
10935 Google,
10936 /// Your responsibility.
10937 Customer,
10938 /// Shared responsibility.
10939 Shared,
10940 /// If set, the enum was initialized with an unknown value.
10941 ///
10942 /// Applications can examine the value using [RegulatoryControlResponsibilityType::value] or
10943 /// [RegulatoryControlResponsibilityType::name].
10944 UnknownValue(regulatory_control_responsibility_type::UnknownValue),
10945}
10946
10947#[doc(hidden)]
10948pub mod regulatory_control_responsibility_type {
10949 #[allow(unused_imports)]
10950 use super::*;
10951 #[derive(Clone, Debug, PartialEq)]
10952 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10953}
10954
10955impl RegulatoryControlResponsibilityType {
10956 /// Gets the enum value.
10957 ///
10958 /// Returns `None` if the enum contains an unknown value deserialized from
10959 /// the string representation of enums.
10960 pub fn value(&self) -> std::option::Option<i32> {
10961 match self {
10962 Self::Unspecified => std::option::Option::Some(0),
10963 Self::Google => std::option::Option::Some(1),
10964 Self::Customer => std::option::Option::Some(2),
10965 Self::Shared => std::option::Option::Some(3),
10966 Self::UnknownValue(u) => u.0.value(),
10967 }
10968 }
10969
10970 /// Gets the enum value as a string.
10971 ///
10972 /// Returns `None` if the enum contains an unknown value deserialized from
10973 /// the integer representation of enums.
10974 pub fn name(&self) -> std::option::Option<&str> {
10975 match self {
10976 Self::Unspecified => {
10977 std::option::Option::Some("REGULATORY_CONTROL_RESPONSIBILITY_TYPE_UNSPECIFIED")
10978 }
10979 Self::Google => std::option::Option::Some("GOOGLE"),
10980 Self::Customer => std::option::Option::Some("CUSTOMER"),
10981 Self::Shared => std::option::Option::Some("SHARED"),
10982 Self::UnknownValue(u) => u.0.name(),
10983 }
10984 }
10985}
10986
10987impl std::default::Default for RegulatoryControlResponsibilityType {
10988 fn default() -> Self {
10989 use std::convert::From;
10990 Self::from(0)
10991 }
10992}
10993
10994impl std::fmt::Display for RegulatoryControlResponsibilityType {
10995 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10996 wkt::internal::display_enum(f, self.name(), self.value())
10997 }
10998}
10999
11000impl std::convert::From<i32> for RegulatoryControlResponsibilityType {
11001 fn from(value: i32) -> Self {
11002 match value {
11003 0 => Self::Unspecified,
11004 1 => Self::Google,
11005 2 => Self::Customer,
11006 3 => Self::Shared,
11007 _ => Self::UnknownValue(regulatory_control_responsibility_type::UnknownValue(
11008 wkt::internal::UnknownEnumValue::Integer(value),
11009 )),
11010 }
11011 }
11012}
11013
11014impl std::convert::From<&str> for RegulatoryControlResponsibilityType {
11015 fn from(value: &str) -> Self {
11016 use std::string::ToString;
11017 match value {
11018 "REGULATORY_CONTROL_RESPONSIBILITY_TYPE_UNSPECIFIED" => Self::Unspecified,
11019 "GOOGLE" => Self::Google,
11020 "CUSTOMER" => Self::Customer,
11021 "SHARED" => Self::Shared,
11022 _ => Self::UnknownValue(regulatory_control_responsibility_type::UnknownValue(
11023 wkt::internal::UnknownEnumValue::String(value.to_string()),
11024 )),
11025 }
11026 }
11027}
11028
11029impl serde::ser::Serialize for RegulatoryControlResponsibilityType {
11030 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11031 where
11032 S: serde::Serializer,
11033 {
11034 match self {
11035 Self::Unspecified => serializer.serialize_i32(0),
11036 Self::Google => serializer.serialize_i32(1),
11037 Self::Customer => serializer.serialize_i32(2),
11038 Self::Shared => serializer.serialize_i32(3),
11039 Self::UnknownValue(u) => u.0.serialize(serializer),
11040 }
11041 }
11042}
11043
11044impl<'de> serde::de::Deserialize<'de> for RegulatoryControlResponsibilityType {
11045 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11046 where
11047 D: serde::Deserializer<'de>,
11048 {
11049 deserializer.deserialize_any(wkt::internal::EnumVisitor::<
11050 RegulatoryControlResponsibilityType,
11051 >::new(
11052 ".google.cloud.cloudsecuritycompliance.v1.RegulatoryControlResponsibilityType",
11053 ))
11054 }
11055}
11056
11057/// The enforcement mode for the cloud control.
11058///
11059/// # Working with unknown values
11060///
11061/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11062/// additional enum variants at any time. Adding new variants is not considered
11063/// a breaking change. Applications should write their code in anticipation of:
11064///
11065/// - New values appearing in future releases of the client library, **and**
11066/// - New values received dynamically, without application changes.
11067///
11068/// Please consult the [Working with enums] section in the user guide for some
11069/// guidelines.
11070///
11071/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11072#[derive(Clone, Debug, PartialEq)]
11073#[non_exhaustive]
11074pub enum EnforcementMode {
11075 /// Default value. This value is unused.
11076 Unspecified,
11077 /// The cloud control is enforced to prevent non-compliance.
11078 Preventive,
11079 /// The cloud control is enforced to detect non-compliance.
11080 Detective,
11081 /// The cloud control is enforced to audit for non-compliance.
11082 Audit,
11083 /// If set, the enum was initialized with an unknown value.
11084 ///
11085 /// Applications can examine the value using [EnforcementMode::value] or
11086 /// [EnforcementMode::name].
11087 UnknownValue(enforcement_mode::UnknownValue),
11088}
11089
11090#[doc(hidden)]
11091pub mod enforcement_mode {
11092 #[allow(unused_imports)]
11093 use super::*;
11094 #[derive(Clone, Debug, PartialEq)]
11095 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11096}
11097
11098impl EnforcementMode {
11099 /// Gets the enum value.
11100 ///
11101 /// Returns `None` if the enum contains an unknown value deserialized from
11102 /// the string representation of enums.
11103 pub fn value(&self) -> std::option::Option<i32> {
11104 match self {
11105 Self::Unspecified => std::option::Option::Some(0),
11106 Self::Preventive => std::option::Option::Some(1),
11107 Self::Detective => std::option::Option::Some(2),
11108 Self::Audit => std::option::Option::Some(3),
11109 Self::UnknownValue(u) => u.0.value(),
11110 }
11111 }
11112
11113 /// Gets the enum value as a string.
11114 ///
11115 /// Returns `None` if the enum contains an unknown value deserialized from
11116 /// the integer representation of enums.
11117 pub fn name(&self) -> std::option::Option<&str> {
11118 match self {
11119 Self::Unspecified => std::option::Option::Some("ENFORCEMENT_MODE_UNSPECIFIED"),
11120 Self::Preventive => std::option::Option::Some("PREVENTIVE"),
11121 Self::Detective => std::option::Option::Some("DETECTIVE"),
11122 Self::Audit => std::option::Option::Some("AUDIT"),
11123 Self::UnknownValue(u) => u.0.name(),
11124 }
11125 }
11126}
11127
11128impl std::default::Default for EnforcementMode {
11129 fn default() -> Self {
11130 use std::convert::From;
11131 Self::from(0)
11132 }
11133}
11134
11135impl std::fmt::Display for EnforcementMode {
11136 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11137 wkt::internal::display_enum(f, self.name(), self.value())
11138 }
11139}
11140
11141impl std::convert::From<i32> for EnforcementMode {
11142 fn from(value: i32) -> Self {
11143 match value {
11144 0 => Self::Unspecified,
11145 1 => Self::Preventive,
11146 2 => Self::Detective,
11147 3 => Self::Audit,
11148 _ => Self::UnknownValue(enforcement_mode::UnknownValue(
11149 wkt::internal::UnknownEnumValue::Integer(value),
11150 )),
11151 }
11152 }
11153}
11154
11155impl std::convert::From<&str> for EnforcementMode {
11156 fn from(value: &str) -> Self {
11157 use std::string::ToString;
11158 match value {
11159 "ENFORCEMENT_MODE_UNSPECIFIED" => Self::Unspecified,
11160 "PREVENTIVE" => Self::Preventive,
11161 "DETECTIVE" => Self::Detective,
11162 "AUDIT" => Self::Audit,
11163 _ => Self::UnknownValue(enforcement_mode::UnknownValue(
11164 wkt::internal::UnknownEnumValue::String(value.to_string()),
11165 )),
11166 }
11167 }
11168}
11169
11170impl serde::ser::Serialize for EnforcementMode {
11171 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11172 where
11173 S: serde::Serializer,
11174 {
11175 match self {
11176 Self::Unspecified => serializer.serialize_i32(0),
11177 Self::Preventive => serializer.serialize_i32(1),
11178 Self::Detective => serializer.serialize_i32(2),
11179 Self::Audit => serializer.serialize_i32(3),
11180 Self::UnknownValue(u) => u.0.serialize(serializer),
11181 }
11182 }
11183}
11184
11185impl<'de> serde::de::Deserialize<'de> for EnforcementMode {
11186 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11187 where
11188 D: serde::Deserializer<'de>,
11189 {
11190 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EnforcementMode>::new(
11191 ".google.cloud.cloudsecuritycompliance.v1.EnforcementMode",
11192 ))
11193 }
11194}
11195
11196/// The category for the framework.
11197///
11198/// # Working with unknown values
11199///
11200/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11201/// additional enum variants at any time. Adding new variants is not considered
11202/// a breaking change. Applications should write their code in anticipation of:
11203///
11204/// - New values appearing in future releases of the client library, **and**
11205/// - New values received dynamically, without application changes.
11206///
11207/// Please consult the [Working with enums] section in the user guide for some
11208/// guidelines.
11209///
11210/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11211#[derive(Clone, Debug, PartialEq)]
11212#[non_exhaustive]
11213pub enum FrameworkCategory {
11214 /// Default value. This value is unused.
11215 Unspecified,
11216 /// An industry-defined framework.
11217 IndustryDefinedStandard,
11218 /// An Assured Workloads framework.
11219 AssuredWorkloads,
11220 /// A data security posture framework.
11221 DataSecurity,
11222 /// A Google's best practices framework.
11223 GoogleBestPractices,
11224 /// A user-created framework.
11225 CustomFramework,
11226 /// If set, the enum was initialized with an unknown value.
11227 ///
11228 /// Applications can examine the value using [FrameworkCategory::value] or
11229 /// [FrameworkCategory::name].
11230 UnknownValue(framework_category::UnknownValue),
11231}
11232
11233#[doc(hidden)]
11234pub mod framework_category {
11235 #[allow(unused_imports)]
11236 use super::*;
11237 #[derive(Clone, Debug, PartialEq)]
11238 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11239}
11240
11241impl FrameworkCategory {
11242 /// Gets the enum value.
11243 ///
11244 /// Returns `None` if the enum contains an unknown value deserialized from
11245 /// the string representation of enums.
11246 pub fn value(&self) -> std::option::Option<i32> {
11247 match self {
11248 Self::Unspecified => std::option::Option::Some(0),
11249 Self::IndustryDefinedStandard => std::option::Option::Some(1),
11250 Self::AssuredWorkloads => std::option::Option::Some(2),
11251 Self::DataSecurity => std::option::Option::Some(3),
11252 Self::GoogleBestPractices => std::option::Option::Some(4),
11253 Self::CustomFramework => std::option::Option::Some(5),
11254 Self::UnknownValue(u) => u.0.value(),
11255 }
11256 }
11257
11258 /// Gets the enum value as a string.
11259 ///
11260 /// Returns `None` if the enum contains an unknown value deserialized from
11261 /// the integer representation of enums.
11262 pub fn name(&self) -> std::option::Option<&str> {
11263 match self {
11264 Self::Unspecified => std::option::Option::Some("FRAMEWORK_CATEGORY_UNSPECIFIED"),
11265 Self::IndustryDefinedStandard => std::option::Option::Some("INDUSTRY_DEFINED_STANDARD"),
11266 Self::AssuredWorkloads => std::option::Option::Some("ASSURED_WORKLOADS"),
11267 Self::DataSecurity => std::option::Option::Some("DATA_SECURITY"),
11268 Self::GoogleBestPractices => std::option::Option::Some("GOOGLE_BEST_PRACTICES"),
11269 Self::CustomFramework => std::option::Option::Some("CUSTOM_FRAMEWORK"),
11270 Self::UnknownValue(u) => u.0.name(),
11271 }
11272 }
11273}
11274
11275impl std::default::Default for FrameworkCategory {
11276 fn default() -> Self {
11277 use std::convert::From;
11278 Self::from(0)
11279 }
11280}
11281
11282impl std::fmt::Display for FrameworkCategory {
11283 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11284 wkt::internal::display_enum(f, self.name(), self.value())
11285 }
11286}
11287
11288impl std::convert::From<i32> for FrameworkCategory {
11289 fn from(value: i32) -> Self {
11290 match value {
11291 0 => Self::Unspecified,
11292 1 => Self::IndustryDefinedStandard,
11293 2 => Self::AssuredWorkloads,
11294 3 => Self::DataSecurity,
11295 4 => Self::GoogleBestPractices,
11296 5 => Self::CustomFramework,
11297 _ => Self::UnknownValue(framework_category::UnknownValue(
11298 wkt::internal::UnknownEnumValue::Integer(value),
11299 )),
11300 }
11301 }
11302}
11303
11304impl std::convert::From<&str> for FrameworkCategory {
11305 fn from(value: &str) -> Self {
11306 use std::string::ToString;
11307 match value {
11308 "FRAMEWORK_CATEGORY_UNSPECIFIED" => Self::Unspecified,
11309 "INDUSTRY_DEFINED_STANDARD" => Self::IndustryDefinedStandard,
11310 "ASSURED_WORKLOADS" => Self::AssuredWorkloads,
11311 "DATA_SECURITY" => Self::DataSecurity,
11312 "GOOGLE_BEST_PRACTICES" => Self::GoogleBestPractices,
11313 "CUSTOM_FRAMEWORK" => Self::CustomFramework,
11314 _ => Self::UnknownValue(framework_category::UnknownValue(
11315 wkt::internal::UnknownEnumValue::String(value.to_string()),
11316 )),
11317 }
11318 }
11319}
11320
11321impl serde::ser::Serialize for FrameworkCategory {
11322 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11323 where
11324 S: serde::Serializer,
11325 {
11326 match self {
11327 Self::Unspecified => serializer.serialize_i32(0),
11328 Self::IndustryDefinedStandard => serializer.serialize_i32(1),
11329 Self::AssuredWorkloads => serializer.serialize_i32(2),
11330 Self::DataSecurity => serializer.serialize_i32(3),
11331 Self::GoogleBestPractices => serializer.serialize_i32(4),
11332 Self::CustomFramework => serializer.serialize_i32(5),
11333 Self::UnknownValue(u) => u.0.serialize(serializer),
11334 }
11335 }
11336}
11337
11338impl<'de> serde::de::Deserialize<'de> for FrameworkCategory {
11339 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11340 where
11341 D: serde::Deserializer<'de>,
11342 {
11343 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FrameworkCategory>::new(
11344 ".google.cloud.cloudsecuritycompliance.v1.FrameworkCategory",
11345 ))
11346 }
11347}
11348
11349/// The category for the cloud control.
11350///
11351/// # Working with unknown values
11352///
11353/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11354/// additional enum variants at any time. Adding new variants is not considered
11355/// a breaking change. Applications should write their code in anticipation of:
11356///
11357/// - New values appearing in future releases of the client library, **and**
11358/// - New values received dynamically, without application changes.
11359///
11360/// Please consult the [Working with enums] section in the user guide for some
11361/// guidelines.
11362///
11363/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11364#[derive(Clone, Debug, PartialEq)]
11365#[non_exhaustive]
11366pub enum CloudControlCategory {
11367 /// Default value. This value is unused.
11368 Unspecified,
11369 /// The infrastructure security category.
11370 CcCategoryInfrastructure,
11371 /// The artificial intelligence category.
11372 CcCategoryArtificialIntelligence,
11373 /// The physical security category.
11374 CcCategoryPhysicalSecurity,
11375 /// The data security category.
11376 CcCategoryDataSecurity,
11377 /// The network security category.
11378 CcCategoryNetworkSecurity,
11379 /// The incident management category.
11380 CcCategoryIncidentManagement,
11381 /// The identity and access management category.
11382 CcCategoryIdentityAndAccessManagement,
11383 /// The encryption category.
11384 CcCategoryEncryption,
11385 /// The logs management and infrastructure category.
11386 CcCategoryLogsManagementAndInfrastructure,
11387 /// The HR, admin, and processes category.
11388 CcCategoryHrAdminAndProcesses,
11389 /// The third-party and sub-processor management category.
11390 CcCategoryThirdPartyAndSubProcessorManagement,
11391 /// The legal and disclosures category.
11392 CcCategoryLegalAndDisclosures,
11393 /// The vulnerability management category.
11394 CcCategoryVulnerabilityManagement,
11395 /// The privacy category.
11396 CcCategoryPrivacy,
11397 /// The business continuity and disaster recovery (BCDR) category.
11398 CcCategoryBcdr,
11399 /// If set, the enum was initialized with an unknown value.
11400 ///
11401 /// Applications can examine the value using [CloudControlCategory::value] or
11402 /// [CloudControlCategory::name].
11403 UnknownValue(cloud_control_category::UnknownValue),
11404}
11405
11406#[doc(hidden)]
11407pub mod cloud_control_category {
11408 #[allow(unused_imports)]
11409 use super::*;
11410 #[derive(Clone, Debug, PartialEq)]
11411 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11412}
11413
11414impl CloudControlCategory {
11415 /// Gets the enum value.
11416 ///
11417 /// Returns `None` if the enum contains an unknown value deserialized from
11418 /// the string representation of enums.
11419 pub fn value(&self) -> std::option::Option<i32> {
11420 match self {
11421 Self::Unspecified => std::option::Option::Some(0),
11422 Self::CcCategoryInfrastructure => std::option::Option::Some(1),
11423 Self::CcCategoryArtificialIntelligence => std::option::Option::Some(2),
11424 Self::CcCategoryPhysicalSecurity => std::option::Option::Some(3),
11425 Self::CcCategoryDataSecurity => std::option::Option::Some(4),
11426 Self::CcCategoryNetworkSecurity => std::option::Option::Some(5),
11427 Self::CcCategoryIncidentManagement => std::option::Option::Some(6),
11428 Self::CcCategoryIdentityAndAccessManagement => std::option::Option::Some(7),
11429 Self::CcCategoryEncryption => std::option::Option::Some(8),
11430 Self::CcCategoryLogsManagementAndInfrastructure => std::option::Option::Some(9),
11431 Self::CcCategoryHrAdminAndProcesses => std::option::Option::Some(10),
11432 Self::CcCategoryThirdPartyAndSubProcessorManagement => std::option::Option::Some(11),
11433 Self::CcCategoryLegalAndDisclosures => std::option::Option::Some(12),
11434 Self::CcCategoryVulnerabilityManagement => std::option::Option::Some(13),
11435 Self::CcCategoryPrivacy => std::option::Option::Some(14),
11436 Self::CcCategoryBcdr => std::option::Option::Some(15),
11437 Self::UnknownValue(u) => u.0.value(),
11438 }
11439 }
11440
11441 /// Gets the enum value as a string.
11442 ///
11443 /// Returns `None` if the enum contains an unknown value deserialized from
11444 /// the integer representation of enums.
11445 pub fn name(&self) -> std::option::Option<&str> {
11446 match self {
11447 Self::Unspecified => std::option::Option::Some("CLOUD_CONTROL_CATEGORY_UNSPECIFIED"),
11448 Self::CcCategoryInfrastructure => {
11449 std::option::Option::Some("CC_CATEGORY_INFRASTRUCTURE")
11450 }
11451 Self::CcCategoryArtificialIntelligence => {
11452 std::option::Option::Some("CC_CATEGORY_ARTIFICIAL_INTELLIGENCE")
11453 }
11454 Self::CcCategoryPhysicalSecurity => {
11455 std::option::Option::Some("CC_CATEGORY_PHYSICAL_SECURITY")
11456 }
11457 Self::CcCategoryDataSecurity => std::option::Option::Some("CC_CATEGORY_DATA_SECURITY"),
11458 Self::CcCategoryNetworkSecurity => {
11459 std::option::Option::Some("CC_CATEGORY_NETWORK_SECURITY")
11460 }
11461 Self::CcCategoryIncidentManagement => {
11462 std::option::Option::Some("CC_CATEGORY_INCIDENT_MANAGEMENT")
11463 }
11464 Self::CcCategoryIdentityAndAccessManagement => {
11465 std::option::Option::Some("CC_CATEGORY_IDENTITY_AND_ACCESS_MANAGEMENT")
11466 }
11467 Self::CcCategoryEncryption => std::option::Option::Some("CC_CATEGORY_ENCRYPTION"),
11468 Self::CcCategoryLogsManagementAndInfrastructure => {
11469 std::option::Option::Some("CC_CATEGORY_LOGS_MANAGEMENT_AND_INFRASTRUCTURE")
11470 }
11471 Self::CcCategoryHrAdminAndProcesses => {
11472 std::option::Option::Some("CC_CATEGORY_HR_ADMIN_AND_PROCESSES")
11473 }
11474 Self::CcCategoryThirdPartyAndSubProcessorManagement => {
11475 std::option::Option::Some("CC_CATEGORY_THIRD_PARTY_AND_SUB_PROCESSOR_MANAGEMENT")
11476 }
11477 Self::CcCategoryLegalAndDisclosures => {
11478 std::option::Option::Some("CC_CATEGORY_LEGAL_AND_DISCLOSURES")
11479 }
11480 Self::CcCategoryVulnerabilityManagement => {
11481 std::option::Option::Some("CC_CATEGORY_VULNERABILITY_MANAGEMENT")
11482 }
11483 Self::CcCategoryPrivacy => std::option::Option::Some("CC_CATEGORY_PRIVACY"),
11484 Self::CcCategoryBcdr => std::option::Option::Some("CC_CATEGORY_BCDR"),
11485 Self::UnknownValue(u) => u.0.name(),
11486 }
11487 }
11488}
11489
11490impl std::default::Default for CloudControlCategory {
11491 fn default() -> Self {
11492 use std::convert::From;
11493 Self::from(0)
11494 }
11495}
11496
11497impl std::fmt::Display for CloudControlCategory {
11498 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11499 wkt::internal::display_enum(f, self.name(), self.value())
11500 }
11501}
11502
11503impl std::convert::From<i32> for CloudControlCategory {
11504 fn from(value: i32) -> Self {
11505 match value {
11506 0 => Self::Unspecified,
11507 1 => Self::CcCategoryInfrastructure,
11508 2 => Self::CcCategoryArtificialIntelligence,
11509 3 => Self::CcCategoryPhysicalSecurity,
11510 4 => Self::CcCategoryDataSecurity,
11511 5 => Self::CcCategoryNetworkSecurity,
11512 6 => Self::CcCategoryIncidentManagement,
11513 7 => Self::CcCategoryIdentityAndAccessManagement,
11514 8 => Self::CcCategoryEncryption,
11515 9 => Self::CcCategoryLogsManagementAndInfrastructure,
11516 10 => Self::CcCategoryHrAdminAndProcesses,
11517 11 => Self::CcCategoryThirdPartyAndSubProcessorManagement,
11518 12 => Self::CcCategoryLegalAndDisclosures,
11519 13 => Self::CcCategoryVulnerabilityManagement,
11520 14 => Self::CcCategoryPrivacy,
11521 15 => Self::CcCategoryBcdr,
11522 _ => Self::UnknownValue(cloud_control_category::UnknownValue(
11523 wkt::internal::UnknownEnumValue::Integer(value),
11524 )),
11525 }
11526 }
11527}
11528
11529impl std::convert::From<&str> for CloudControlCategory {
11530 fn from(value: &str) -> Self {
11531 use std::string::ToString;
11532 match value {
11533 "CLOUD_CONTROL_CATEGORY_UNSPECIFIED" => Self::Unspecified,
11534 "CC_CATEGORY_INFRASTRUCTURE" => Self::CcCategoryInfrastructure,
11535 "CC_CATEGORY_ARTIFICIAL_INTELLIGENCE" => Self::CcCategoryArtificialIntelligence,
11536 "CC_CATEGORY_PHYSICAL_SECURITY" => Self::CcCategoryPhysicalSecurity,
11537 "CC_CATEGORY_DATA_SECURITY" => Self::CcCategoryDataSecurity,
11538 "CC_CATEGORY_NETWORK_SECURITY" => Self::CcCategoryNetworkSecurity,
11539 "CC_CATEGORY_INCIDENT_MANAGEMENT" => Self::CcCategoryIncidentManagement,
11540 "CC_CATEGORY_IDENTITY_AND_ACCESS_MANAGEMENT" => {
11541 Self::CcCategoryIdentityAndAccessManagement
11542 }
11543 "CC_CATEGORY_ENCRYPTION" => Self::CcCategoryEncryption,
11544 "CC_CATEGORY_LOGS_MANAGEMENT_AND_INFRASTRUCTURE" => {
11545 Self::CcCategoryLogsManagementAndInfrastructure
11546 }
11547 "CC_CATEGORY_HR_ADMIN_AND_PROCESSES" => Self::CcCategoryHrAdminAndProcesses,
11548 "CC_CATEGORY_THIRD_PARTY_AND_SUB_PROCESSOR_MANAGEMENT" => {
11549 Self::CcCategoryThirdPartyAndSubProcessorManagement
11550 }
11551 "CC_CATEGORY_LEGAL_AND_DISCLOSURES" => Self::CcCategoryLegalAndDisclosures,
11552 "CC_CATEGORY_VULNERABILITY_MANAGEMENT" => Self::CcCategoryVulnerabilityManagement,
11553 "CC_CATEGORY_PRIVACY" => Self::CcCategoryPrivacy,
11554 "CC_CATEGORY_BCDR" => Self::CcCategoryBcdr,
11555 _ => Self::UnknownValue(cloud_control_category::UnknownValue(
11556 wkt::internal::UnknownEnumValue::String(value.to_string()),
11557 )),
11558 }
11559 }
11560}
11561
11562impl serde::ser::Serialize for CloudControlCategory {
11563 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11564 where
11565 S: serde::Serializer,
11566 {
11567 match self {
11568 Self::Unspecified => serializer.serialize_i32(0),
11569 Self::CcCategoryInfrastructure => serializer.serialize_i32(1),
11570 Self::CcCategoryArtificialIntelligence => serializer.serialize_i32(2),
11571 Self::CcCategoryPhysicalSecurity => serializer.serialize_i32(3),
11572 Self::CcCategoryDataSecurity => serializer.serialize_i32(4),
11573 Self::CcCategoryNetworkSecurity => serializer.serialize_i32(5),
11574 Self::CcCategoryIncidentManagement => serializer.serialize_i32(6),
11575 Self::CcCategoryIdentityAndAccessManagement => serializer.serialize_i32(7),
11576 Self::CcCategoryEncryption => serializer.serialize_i32(8),
11577 Self::CcCategoryLogsManagementAndInfrastructure => serializer.serialize_i32(9),
11578 Self::CcCategoryHrAdminAndProcesses => serializer.serialize_i32(10),
11579 Self::CcCategoryThirdPartyAndSubProcessorManagement => serializer.serialize_i32(11),
11580 Self::CcCategoryLegalAndDisclosures => serializer.serialize_i32(12),
11581 Self::CcCategoryVulnerabilityManagement => serializer.serialize_i32(13),
11582 Self::CcCategoryPrivacy => serializer.serialize_i32(14),
11583 Self::CcCategoryBcdr => serializer.serialize_i32(15),
11584 Self::UnknownValue(u) => u.0.serialize(serializer),
11585 }
11586 }
11587}
11588
11589impl<'de> serde::de::Deserialize<'de> for CloudControlCategory {
11590 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11591 where
11592 D: serde::Deserializer<'de>,
11593 {
11594 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CloudControlCategory>::new(
11595 ".google.cloud.cloudsecuritycompliance.v1.CloudControlCategory",
11596 ))
11597 }
11598}
11599
11600/// The cloud provider that's associated with the cloud control.
11601///
11602/// # Working with unknown values
11603///
11604/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11605/// additional enum variants at any time. Adding new variants is not considered
11606/// a breaking change. Applications should write their code in anticipation of:
11607///
11608/// - New values appearing in future releases of the client library, **and**
11609/// - New values received dynamically, without application changes.
11610///
11611/// Please consult the [Working with enums] section in the user guide for some
11612/// guidelines.
11613///
11614/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11615#[derive(Clone, Debug, PartialEq)]
11616#[non_exhaustive]
11617pub enum CloudProvider {
11618 /// Default value. This value is unused.
11619 Unspecified,
11620 /// Amazon Web Services (AWS).
11621 Aws,
11622 /// Microsoft Azure.
11623 Azure,
11624 /// Google Cloud.
11625 Gcp,
11626 /// If set, the enum was initialized with an unknown value.
11627 ///
11628 /// Applications can examine the value using [CloudProvider::value] or
11629 /// [CloudProvider::name].
11630 UnknownValue(cloud_provider::UnknownValue),
11631}
11632
11633#[doc(hidden)]
11634pub mod cloud_provider {
11635 #[allow(unused_imports)]
11636 use super::*;
11637 #[derive(Clone, Debug, PartialEq)]
11638 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11639}
11640
11641impl CloudProvider {
11642 /// Gets the enum value.
11643 ///
11644 /// Returns `None` if the enum contains an unknown value deserialized from
11645 /// the string representation of enums.
11646 pub fn value(&self) -> std::option::Option<i32> {
11647 match self {
11648 Self::Unspecified => std::option::Option::Some(0),
11649 Self::Aws => std::option::Option::Some(1),
11650 Self::Azure => std::option::Option::Some(2),
11651 Self::Gcp => std::option::Option::Some(3),
11652 Self::UnknownValue(u) => u.0.value(),
11653 }
11654 }
11655
11656 /// Gets the enum value as a string.
11657 ///
11658 /// Returns `None` if the enum contains an unknown value deserialized from
11659 /// the integer representation of enums.
11660 pub fn name(&self) -> std::option::Option<&str> {
11661 match self {
11662 Self::Unspecified => std::option::Option::Some("CLOUD_PROVIDER_UNSPECIFIED"),
11663 Self::Aws => std::option::Option::Some("AWS"),
11664 Self::Azure => std::option::Option::Some("AZURE"),
11665 Self::Gcp => std::option::Option::Some("GCP"),
11666 Self::UnknownValue(u) => u.0.name(),
11667 }
11668 }
11669}
11670
11671impl std::default::Default for CloudProvider {
11672 fn default() -> Self {
11673 use std::convert::From;
11674 Self::from(0)
11675 }
11676}
11677
11678impl std::fmt::Display for CloudProvider {
11679 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11680 wkt::internal::display_enum(f, self.name(), self.value())
11681 }
11682}
11683
11684impl std::convert::From<i32> for CloudProvider {
11685 fn from(value: i32) -> Self {
11686 match value {
11687 0 => Self::Unspecified,
11688 1 => Self::Aws,
11689 2 => Self::Azure,
11690 3 => Self::Gcp,
11691 _ => Self::UnknownValue(cloud_provider::UnknownValue(
11692 wkt::internal::UnknownEnumValue::Integer(value),
11693 )),
11694 }
11695 }
11696}
11697
11698impl std::convert::From<&str> for CloudProvider {
11699 fn from(value: &str) -> Self {
11700 use std::string::ToString;
11701 match value {
11702 "CLOUD_PROVIDER_UNSPECIFIED" => Self::Unspecified,
11703 "AWS" => Self::Aws,
11704 "AZURE" => Self::Azure,
11705 "GCP" => Self::Gcp,
11706 _ => Self::UnknownValue(cloud_provider::UnknownValue(
11707 wkt::internal::UnknownEnumValue::String(value.to_string()),
11708 )),
11709 }
11710 }
11711}
11712
11713impl serde::ser::Serialize for CloudProvider {
11714 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11715 where
11716 S: serde::Serializer,
11717 {
11718 match self {
11719 Self::Unspecified => serializer.serialize_i32(0),
11720 Self::Aws => serializer.serialize_i32(1),
11721 Self::Azure => serializer.serialize_i32(2),
11722 Self::Gcp => serializer.serialize_i32(3),
11723 Self::UnknownValue(u) => u.0.serialize(serializer),
11724 }
11725 }
11726}
11727
11728impl<'de> serde::de::Deserialize<'de> for CloudProvider {
11729 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11730 where
11731 D: serde::Deserializer<'de>,
11732 {
11733 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CloudProvider>::new(
11734 ".google.cloud.cloudsecuritycompliance.v1.CloudProvider",
11735 ))
11736 }
11737}
11738
11739/// The severity of the finding.
11740///
11741/// # Working with unknown values
11742///
11743/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11744/// additional enum variants at any time. Adding new variants is not considered
11745/// a breaking change. Applications should write their code in anticipation of:
11746///
11747/// - New values appearing in future releases of the client library, **and**
11748/// - New values received dynamically, without application changes.
11749///
11750/// Please consult the [Working with enums] section in the user guide for some
11751/// guidelines.
11752///
11753/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11754#[derive(Clone, Debug, PartialEq)]
11755#[non_exhaustive]
11756pub enum Severity {
11757 /// Default value. This value is unused.
11758 Unspecified,
11759 /// A critical vulnerability is easily discoverable by an external actor,
11760 /// exploitable, and results in the direct ability to execute arbitrary code,
11761 /// exfiltrate data, and otherwise gain additional access and privileges to
11762 /// cloud resources and workloads. Examples include publicly accessible
11763 /// unprotected user data and public SSH access with weak or no
11764 /// passwords.
11765 ///
11766 /// A critical threat is a threat that can access, modify, or delete data or
11767 /// execute unauthorized code within existing resources.
11768 Critical,
11769 /// A high-risk vulnerability can be easily discovered and exploited in
11770 /// combination with other vulnerabilities to gain direct access and
11771 /// the ability to execute arbitrary code, exfiltrate data, and otherwise
11772 /// gain additional access and privileges to cloud resources and workloads.
11773 /// An example is a database with weak or no passwords that is only
11774 /// accessible internally. This database could easily be compromised by an
11775 /// actor that had access to the internal network.
11776 ///
11777 /// A high-risk threat is a threat that can create new computational
11778 /// resources in an environment but can't access data or execute code in
11779 /// existing resources.
11780 High,
11781 /// A medium-risk vulnerability can be used by an actor to gain access to
11782 /// resources or privileges that enable them to eventually (through multiple
11783 /// steps or a complex exploit) gain access and the ability to execute
11784 /// arbitrary code or exfiltrate data. An example is a service account with
11785 /// access to more projects than it should have. If an actor gains access to
11786 /// the service account, they could potentially use that access to manipulate
11787 /// a project the service account was not intended to.
11788 ///
11789 /// A medium-risk threat can cause operational impact but might not
11790 /// access data or execute unauthorized code.
11791 Medium,
11792 /// A low-risk vulnerability hampers a security organization's ability to
11793 /// detect vulnerabilities or active threats in their deployment, or prevents
11794 /// the root cause investigation of security issues. An example is monitoring
11795 /// and logs being disabled for resource configurations and access.
11796 ///
11797 /// A low-risk threat is a threat that has obtained minimal access to an
11798 /// environment but can't access data, execute code, or create resources.
11799 Low,
11800 /// If set, the enum was initialized with an unknown value.
11801 ///
11802 /// Applications can examine the value using [Severity::value] or
11803 /// [Severity::name].
11804 UnknownValue(severity::UnknownValue),
11805}
11806
11807#[doc(hidden)]
11808pub mod severity {
11809 #[allow(unused_imports)]
11810 use super::*;
11811 #[derive(Clone, Debug, PartialEq)]
11812 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11813}
11814
11815impl Severity {
11816 /// Gets the enum value.
11817 ///
11818 /// Returns `None` if the enum contains an unknown value deserialized from
11819 /// the string representation of enums.
11820 pub fn value(&self) -> std::option::Option<i32> {
11821 match self {
11822 Self::Unspecified => std::option::Option::Some(0),
11823 Self::Critical => std::option::Option::Some(1),
11824 Self::High => std::option::Option::Some(2),
11825 Self::Medium => std::option::Option::Some(3),
11826 Self::Low => std::option::Option::Some(4),
11827 Self::UnknownValue(u) => u.0.value(),
11828 }
11829 }
11830
11831 /// Gets the enum value as a string.
11832 ///
11833 /// Returns `None` if the enum contains an unknown value deserialized from
11834 /// the integer representation of enums.
11835 pub fn name(&self) -> std::option::Option<&str> {
11836 match self {
11837 Self::Unspecified => std::option::Option::Some("SEVERITY_UNSPECIFIED"),
11838 Self::Critical => std::option::Option::Some("CRITICAL"),
11839 Self::High => std::option::Option::Some("HIGH"),
11840 Self::Medium => std::option::Option::Some("MEDIUM"),
11841 Self::Low => std::option::Option::Some("LOW"),
11842 Self::UnknownValue(u) => u.0.name(),
11843 }
11844 }
11845}
11846
11847impl std::default::Default for Severity {
11848 fn default() -> Self {
11849 use std::convert::From;
11850 Self::from(0)
11851 }
11852}
11853
11854impl std::fmt::Display for Severity {
11855 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11856 wkt::internal::display_enum(f, self.name(), self.value())
11857 }
11858}
11859
11860impl std::convert::From<i32> for Severity {
11861 fn from(value: i32) -> Self {
11862 match value {
11863 0 => Self::Unspecified,
11864 1 => Self::Critical,
11865 2 => Self::High,
11866 3 => Self::Medium,
11867 4 => Self::Low,
11868 _ => Self::UnknownValue(severity::UnknownValue(
11869 wkt::internal::UnknownEnumValue::Integer(value),
11870 )),
11871 }
11872 }
11873}
11874
11875impl std::convert::From<&str> for Severity {
11876 fn from(value: &str) -> Self {
11877 use std::string::ToString;
11878 match value {
11879 "SEVERITY_UNSPECIFIED" => Self::Unspecified,
11880 "CRITICAL" => Self::Critical,
11881 "HIGH" => Self::High,
11882 "MEDIUM" => Self::Medium,
11883 "LOW" => Self::Low,
11884 _ => Self::UnknownValue(severity::UnknownValue(
11885 wkt::internal::UnknownEnumValue::String(value.to_string()),
11886 )),
11887 }
11888 }
11889}
11890
11891impl serde::ser::Serialize for Severity {
11892 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11893 where
11894 S: serde::Serializer,
11895 {
11896 match self {
11897 Self::Unspecified => serializer.serialize_i32(0),
11898 Self::Critical => serializer.serialize_i32(1),
11899 Self::High => serializer.serialize_i32(2),
11900 Self::Medium => serializer.serialize_i32(3),
11901 Self::Low => serializer.serialize_i32(4),
11902 Self::UnknownValue(u) => u.0.serialize(serializer),
11903 }
11904 }
11905}
11906
11907impl<'de> serde::de::Deserialize<'de> for Severity {
11908 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11909 where
11910 D: serde::Deserializer<'de>,
11911 {
11912 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Severity>::new(
11913 ".google.cloud.cloudsecuritycompliance.v1.Severity",
11914 ))
11915 }
11916}
11917
11918/// The action type of the rule.
11919///
11920/// # Working with unknown values
11921///
11922/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11923/// additional enum variants at any time. Adding new variants is not considered
11924/// a breaking change. Applications should write their code in anticipation of:
11925///
11926/// - New values appearing in future releases of the client library, **and**
11927/// - New values received dynamically, without application changes.
11928///
11929/// Please consult the [Working with enums] section in the user guide for some
11930/// guidelines.
11931///
11932/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11933#[derive(Clone, Debug, PartialEq)]
11934#[non_exhaustive]
11935pub enum RuleActionType {
11936 /// Default value. This value is unused.
11937 Unspecified,
11938 /// The rule is intended to prevent non-compliance.
11939 Preventive,
11940 /// The rule is intended to detect non-compliance.
11941 Detective,
11942 /// The rule is intended to audit non-compliance.
11943 Audit,
11944 /// If set, the enum was initialized with an unknown value.
11945 ///
11946 /// Applications can examine the value using [RuleActionType::value] or
11947 /// [RuleActionType::name].
11948 UnknownValue(rule_action_type::UnknownValue),
11949}
11950
11951#[doc(hidden)]
11952pub mod rule_action_type {
11953 #[allow(unused_imports)]
11954 use super::*;
11955 #[derive(Clone, Debug, PartialEq)]
11956 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11957}
11958
11959impl RuleActionType {
11960 /// Gets the enum value.
11961 ///
11962 /// Returns `None` if the enum contains an unknown value deserialized from
11963 /// the string representation of enums.
11964 pub fn value(&self) -> std::option::Option<i32> {
11965 match self {
11966 Self::Unspecified => std::option::Option::Some(0),
11967 Self::Preventive => std::option::Option::Some(1),
11968 Self::Detective => std::option::Option::Some(2),
11969 Self::Audit => std::option::Option::Some(3),
11970 Self::UnknownValue(u) => u.0.value(),
11971 }
11972 }
11973
11974 /// Gets the enum value as a string.
11975 ///
11976 /// Returns `None` if the enum contains an unknown value deserialized from
11977 /// the integer representation of enums.
11978 pub fn name(&self) -> std::option::Option<&str> {
11979 match self {
11980 Self::Unspecified => std::option::Option::Some("RULE_ACTION_TYPE_UNSPECIFIED"),
11981 Self::Preventive => std::option::Option::Some("RULE_ACTION_TYPE_PREVENTIVE"),
11982 Self::Detective => std::option::Option::Some("RULE_ACTION_TYPE_DETECTIVE"),
11983 Self::Audit => std::option::Option::Some("RULE_ACTION_TYPE_AUDIT"),
11984 Self::UnknownValue(u) => u.0.name(),
11985 }
11986 }
11987}
11988
11989impl std::default::Default for RuleActionType {
11990 fn default() -> Self {
11991 use std::convert::From;
11992 Self::from(0)
11993 }
11994}
11995
11996impl std::fmt::Display for RuleActionType {
11997 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11998 wkt::internal::display_enum(f, self.name(), self.value())
11999 }
12000}
12001
12002impl std::convert::From<i32> for RuleActionType {
12003 fn from(value: i32) -> Self {
12004 match value {
12005 0 => Self::Unspecified,
12006 1 => Self::Preventive,
12007 2 => Self::Detective,
12008 3 => Self::Audit,
12009 _ => Self::UnknownValue(rule_action_type::UnknownValue(
12010 wkt::internal::UnknownEnumValue::Integer(value),
12011 )),
12012 }
12013 }
12014}
12015
12016impl std::convert::From<&str> for RuleActionType {
12017 fn from(value: &str) -> Self {
12018 use std::string::ToString;
12019 match value {
12020 "RULE_ACTION_TYPE_UNSPECIFIED" => Self::Unspecified,
12021 "RULE_ACTION_TYPE_PREVENTIVE" => Self::Preventive,
12022 "RULE_ACTION_TYPE_DETECTIVE" => Self::Detective,
12023 "RULE_ACTION_TYPE_AUDIT" => Self::Audit,
12024 _ => Self::UnknownValue(rule_action_type::UnknownValue(
12025 wkt::internal::UnknownEnumValue::String(value.to_string()),
12026 )),
12027 }
12028 }
12029}
12030
12031impl serde::ser::Serialize for RuleActionType {
12032 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12033 where
12034 S: serde::Serializer,
12035 {
12036 match self {
12037 Self::Unspecified => serializer.serialize_i32(0),
12038 Self::Preventive => serializer.serialize_i32(1),
12039 Self::Detective => serializer.serialize_i32(2),
12040 Self::Audit => serializer.serialize_i32(3),
12041 Self::UnknownValue(u) => u.0.serialize(serializer),
12042 }
12043 }
12044}
12045
12046impl<'de> serde::de::Deserialize<'de> for RuleActionType {
12047 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12048 where
12049 D: serde::Deserializer<'de>,
12050 {
12051 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RuleActionType>::new(
12052 ".google.cloud.cloudsecuritycompliance.v1.RuleActionType",
12053 ))
12054 }
12055}
12056
12057/// The type of resource that a control or framework can be applied to.
12058///
12059/// # Working with unknown values
12060///
12061/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12062/// additional enum variants at any time. Adding new variants is not considered
12063/// a breaking change. Applications should write their code in anticipation of:
12064///
12065/// - New values appearing in future releases of the client library, **and**
12066/// - New values received dynamically, without application changes.
12067///
12068/// Please consult the [Working with enums] section in the user guide for some
12069/// guidelines.
12070///
12071/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12072#[derive(Clone, Debug, PartialEq)]
12073#[non_exhaustive]
12074pub enum TargetResourceType {
12075 /// Default value. This value is unused.
12076 Unspecified,
12077 /// The target resource is a Google Cloud organization.
12078 TargetResourceCrmTypeOrg,
12079 /// The target resource is a folder.
12080 TargetResourceCrmTypeFolder,
12081 /// The target resource is a project.
12082 TargetResourceCrmTypeProject,
12083 /// The target resource is an application in App Hub.
12084 Application,
12085 /// If set, the enum was initialized with an unknown value.
12086 ///
12087 /// Applications can examine the value using [TargetResourceType::value] or
12088 /// [TargetResourceType::name].
12089 UnknownValue(target_resource_type::UnknownValue),
12090}
12091
12092#[doc(hidden)]
12093pub mod target_resource_type {
12094 #[allow(unused_imports)]
12095 use super::*;
12096 #[derive(Clone, Debug, PartialEq)]
12097 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12098}
12099
12100impl TargetResourceType {
12101 /// Gets the enum value.
12102 ///
12103 /// Returns `None` if the enum contains an unknown value deserialized from
12104 /// the string representation of enums.
12105 pub fn value(&self) -> std::option::Option<i32> {
12106 match self {
12107 Self::Unspecified => std::option::Option::Some(0),
12108 Self::TargetResourceCrmTypeOrg => std::option::Option::Some(1),
12109 Self::TargetResourceCrmTypeFolder => std::option::Option::Some(2),
12110 Self::TargetResourceCrmTypeProject => std::option::Option::Some(3),
12111 Self::Application => std::option::Option::Some(4),
12112 Self::UnknownValue(u) => u.0.value(),
12113 }
12114 }
12115
12116 /// Gets the enum value as a string.
12117 ///
12118 /// Returns `None` if the enum contains an unknown value deserialized from
12119 /// the integer representation of enums.
12120 pub fn name(&self) -> std::option::Option<&str> {
12121 match self {
12122 Self::Unspecified => std::option::Option::Some("TARGET_RESOURCE_TYPE_UNSPECIFIED"),
12123 Self::TargetResourceCrmTypeOrg => {
12124 std::option::Option::Some("TARGET_RESOURCE_CRM_TYPE_ORG")
12125 }
12126 Self::TargetResourceCrmTypeFolder => {
12127 std::option::Option::Some("TARGET_RESOURCE_CRM_TYPE_FOLDER")
12128 }
12129 Self::TargetResourceCrmTypeProject => {
12130 std::option::Option::Some("TARGET_RESOURCE_CRM_TYPE_PROJECT")
12131 }
12132 Self::Application => std::option::Option::Some("TARGET_RESOURCE_TYPE_APPLICATION"),
12133 Self::UnknownValue(u) => u.0.name(),
12134 }
12135 }
12136}
12137
12138impl std::default::Default for TargetResourceType {
12139 fn default() -> Self {
12140 use std::convert::From;
12141 Self::from(0)
12142 }
12143}
12144
12145impl std::fmt::Display for TargetResourceType {
12146 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12147 wkt::internal::display_enum(f, self.name(), self.value())
12148 }
12149}
12150
12151impl std::convert::From<i32> for TargetResourceType {
12152 fn from(value: i32) -> Self {
12153 match value {
12154 0 => Self::Unspecified,
12155 1 => Self::TargetResourceCrmTypeOrg,
12156 2 => Self::TargetResourceCrmTypeFolder,
12157 3 => Self::TargetResourceCrmTypeProject,
12158 4 => Self::Application,
12159 _ => Self::UnknownValue(target_resource_type::UnknownValue(
12160 wkt::internal::UnknownEnumValue::Integer(value),
12161 )),
12162 }
12163 }
12164}
12165
12166impl std::convert::From<&str> for TargetResourceType {
12167 fn from(value: &str) -> Self {
12168 use std::string::ToString;
12169 match value {
12170 "TARGET_RESOURCE_TYPE_UNSPECIFIED" => Self::Unspecified,
12171 "TARGET_RESOURCE_CRM_TYPE_ORG" => Self::TargetResourceCrmTypeOrg,
12172 "TARGET_RESOURCE_CRM_TYPE_FOLDER" => Self::TargetResourceCrmTypeFolder,
12173 "TARGET_RESOURCE_CRM_TYPE_PROJECT" => Self::TargetResourceCrmTypeProject,
12174 "TARGET_RESOURCE_TYPE_APPLICATION" => Self::Application,
12175 _ => Self::UnknownValue(target_resource_type::UnknownValue(
12176 wkt::internal::UnknownEnumValue::String(value.to_string()),
12177 )),
12178 }
12179 }
12180}
12181
12182impl serde::ser::Serialize for TargetResourceType {
12183 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12184 where
12185 S: serde::Serializer,
12186 {
12187 match self {
12188 Self::Unspecified => serializer.serialize_i32(0),
12189 Self::TargetResourceCrmTypeOrg => serializer.serialize_i32(1),
12190 Self::TargetResourceCrmTypeFolder => serializer.serialize_i32(2),
12191 Self::TargetResourceCrmTypeProject => serializer.serialize_i32(3),
12192 Self::Application => serializer.serialize_i32(4),
12193 Self::UnknownValue(u) => u.0.serialize(serializer),
12194 }
12195 }
12196}
12197
12198impl<'de> serde::de::Deserialize<'de> for TargetResourceType {
12199 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12200 where
12201 D: serde::Deserializer<'de>,
12202 {
12203 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TargetResourceType>::new(
12204 ".google.cloud.cloudsecuritycompliance.v1.TargetResourceType",
12205 ))
12206 }
12207}
12208
12209/// The state of the deployment resource.
12210///
12211/// # Working with unknown values
12212///
12213/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12214/// additional enum variants at any time. Adding new variants is not considered
12215/// a breaking change. Applications should write their code in anticipation of:
12216///
12217/// - New values appearing in future releases of the client library, **and**
12218/// - New values received dynamically, without application changes.
12219///
12220/// Please consult the [Working with enums] section in the user guide for some
12221/// guidelines.
12222///
12223/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12224#[derive(Clone, Debug, PartialEq)]
12225#[non_exhaustive]
12226pub enum DeploymentState {
12227 /// Default value. This value is unused.
12228 Unspecified,
12229 /// Validating the deployment.
12230 Validating,
12231 /// Deployment is being created.
12232 Creating,
12233 /// Deployment is being deleted.
12234 Deleting,
12235 /// Deployment has failed. All the changes made by the deployment were
12236 /// successfully rolled back. You can retry or delete a deployment that's
12237 /// in this state.
12238 Failed,
12239 /// Deployment is successful and ready to use.
12240 Ready,
12241 /// Deployment is partially deployed. All the cloud controls weren't deployed
12242 /// successfully. Retrying the operation resumes from the first failed
12243 /// step.
12244 PartiallyDeployed,
12245 /// Deployment is partially deleted. All the cloud control deployments weren't
12246 /// deleted successfully. Retrying the operation resumes from the first
12247 /// failed step.
12248 PartiallyDeleted,
12249 /// If set, the enum was initialized with an unknown value.
12250 ///
12251 /// Applications can examine the value using [DeploymentState::value] or
12252 /// [DeploymentState::name].
12253 UnknownValue(deployment_state::UnknownValue),
12254}
12255
12256#[doc(hidden)]
12257pub mod deployment_state {
12258 #[allow(unused_imports)]
12259 use super::*;
12260 #[derive(Clone, Debug, PartialEq)]
12261 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12262}
12263
12264impl DeploymentState {
12265 /// Gets the enum value.
12266 ///
12267 /// Returns `None` if the enum contains an unknown value deserialized from
12268 /// the string representation of enums.
12269 pub fn value(&self) -> std::option::Option<i32> {
12270 match self {
12271 Self::Unspecified => std::option::Option::Some(0),
12272 Self::Validating => std::option::Option::Some(1),
12273 Self::Creating => std::option::Option::Some(2),
12274 Self::Deleting => std::option::Option::Some(3),
12275 Self::Failed => std::option::Option::Some(4),
12276 Self::Ready => std::option::Option::Some(5),
12277 Self::PartiallyDeployed => std::option::Option::Some(6),
12278 Self::PartiallyDeleted => std::option::Option::Some(7),
12279 Self::UnknownValue(u) => u.0.value(),
12280 }
12281 }
12282
12283 /// Gets the enum value as a string.
12284 ///
12285 /// Returns `None` if the enum contains an unknown value deserialized from
12286 /// the integer representation of enums.
12287 pub fn name(&self) -> std::option::Option<&str> {
12288 match self {
12289 Self::Unspecified => std::option::Option::Some("DEPLOYMENT_STATE_UNSPECIFIED"),
12290 Self::Validating => std::option::Option::Some("DEPLOYMENT_STATE_VALIDATING"),
12291 Self::Creating => std::option::Option::Some("DEPLOYMENT_STATE_CREATING"),
12292 Self::Deleting => std::option::Option::Some("DEPLOYMENT_STATE_DELETING"),
12293 Self::Failed => std::option::Option::Some("DEPLOYMENT_STATE_FAILED"),
12294 Self::Ready => std::option::Option::Some("DEPLOYMENT_STATE_READY"),
12295 Self::PartiallyDeployed => {
12296 std::option::Option::Some("DEPLOYMENT_STATE_PARTIALLY_DEPLOYED")
12297 }
12298 Self::PartiallyDeleted => {
12299 std::option::Option::Some("DEPLOYMENT_STATE_PARTIALLY_DELETED")
12300 }
12301 Self::UnknownValue(u) => u.0.name(),
12302 }
12303 }
12304}
12305
12306impl std::default::Default for DeploymentState {
12307 fn default() -> Self {
12308 use std::convert::From;
12309 Self::from(0)
12310 }
12311}
12312
12313impl std::fmt::Display for DeploymentState {
12314 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12315 wkt::internal::display_enum(f, self.name(), self.value())
12316 }
12317}
12318
12319impl std::convert::From<i32> for DeploymentState {
12320 fn from(value: i32) -> Self {
12321 match value {
12322 0 => Self::Unspecified,
12323 1 => Self::Validating,
12324 2 => Self::Creating,
12325 3 => Self::Deleting,
12326 4 => Self::Failed,
12327 5 => Self::Ready,
12328 6 => Self::PartiallyDeployed,
12329 7 => Self::PartiallyDeleted,
12330 _ => Self::UnknownValue(deployment_state::UnknownValue(
12331 wkt::internal::UnknownEnumValue::Integer(value),
12332 )),
12333 }
12334 }
12335}
12336
12337impl std::convert::From<&str> for DeploymentState {
12338 fn from(value: &str) -> Self {
12339 use std::string::ToString;
12340 match value {
12341 "DEPLOYMENT_STATE_UNSPECIFIED" => Self::Unspecified,
12342 "DEPLOYMENT_STATE_VALIDATING" => Self::Validating,
12343 "DEPLOYMENT_STATE_CREATING" => Self::Creating,
12344 "DEPLOYMENT_STATE_DELETING" => Self::Deleting,
12345 "DEPLOYMENT_STATE_FAILED" => Self::Failed,
12346 "DEPLOYMENT_STATE_READY" => Self::Ready,
12347 "DEPLOYMENT_STATE_PARTIALLY_DEPLOYED" => Self::PartiallyDeployed,
12348 "DEPLOYMENT_STATE_PARTIALLY_DELETED" => Self::PartiallyDeleted,
12349 _ => Self::UnknownValue(deployment_state::UnknownValue(
12350 wkt::internal::UnknownEnumValue::String(value.to_string()),
12351 )),
12352 }
12353 }
12354}
12355
12356impl serde::ser::Serialize for DeploymentState {
12357 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12358 where
12359 S: serde::Serializer,
12360 {
12361 match self {
12362 Self::Unspecified => serializer.serialize_i32(0),
12363 Self::Validating => serializer.serialize_i32(1),
12364 Self::Creating => serializer.serialize_i32(2),
12365 Self::Deleting => serializer.serialize_i32(3),
12366 Self::Failed => serializer.serialize_i32(4),
12367 Self::Ready => serializer.serialize_i32(5),
12368 Self::PartiallyDeployed => serializer.serialize_i32(6),
12369 Self::PartiallyDeleted => serializer.serialize_i32(7),
12370 Self::UnknownValue(u) => u.0.serialize(serializer),
12371 }
12372 }
12373}
12374
12375impl<'de> serde::de::Deserialize<'de> for DeploymentState {
12376 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12377 where
12378 D: serde::Deserializer<'de>,
12379 {
12380 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeploymentState>::new(
12381 ".google.cloud.cloudsecuritycompliance.v1.DeploymentState",
12382 ))
12383 }
12384}
12385
12386/// The evaluation state of the control.
12387///
12388/// # Working with unknown values
12389///
12390/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12391/// additional enum variants at any time. Adding new variants is not considered
12392/// a breaking change. Applications should write their code in anticipation of:
12393///
12394/// - New values appearing in future releases of the client library, **and**
12395/// - New values received dynamically, without application changes.
12396///
12397/// Please consult the [Working with enums] section in the user guide for some
12398/// guidelines.
12399///
12400/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12401#[derive(Clone, Debug, PartialEq)]
12402#[non_exhaustive]
12403pub enum EvaluationState {
12404 /// Default value. This value is unused.
12405 Unspecified,
12406 /// The control is passing.
12407 Passed,
12408 /// The control is failing.
12409 Failed,
12410 /// The control is not assessed.
12411 NotAssessed,
12412 /// If set, the enum was initialized with an unknown value.
12413 ///
12414 /// Applications can examine the value using [EvaluationState::value] or
12415 /// [EvaluationState::name].
12416 UnknownValue(evaluation_state::UnknownValue),
12417}
12418
12419#[doc(hidden)]
12420pub mod evaluation_state {
12421 #[allow(unused_imports)]
12422 use super::*;
12423 #[derive(Clone, Debug, PartialEq)]
12424 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12425}
12426
12427impl EvaluationState {
12428 /// Gets the enum value.
12429 ///
12430 /// Returns `None` if the enum contains an unknown value deserialized from
12431 /// the string representation of enums.
12432 pub fn value(&self) -> std::option::Option<i32> {
12433 match self {
12434 Self::Unspecified => std::option::Option::Some(0),
12435 Self::Passed => std::option::Option::Some(1),
12436 Self::Failed => std::option::Option::Some(2),
12437 Self::NotAssessed => std::option::Option::Some(3),
12438 Self::UnknownValue(u) => u.0.value(),
12439 }
12440 }
12441
12442 /// Gets the enum value as a string.
12443 ///
12444 /// Returns `None` if the enum contains an unknown value deserialized from
12445 /// the integer representation of enums.
12446 pub fn name(&self) -> std::option::Option<&str> {
12447 match self {
12448 Self::Unspecified => std::option::Option::Some("EVALUATION_STATE_UNSPECIFIED"),
12449 Self::Passed => std::option::Option::Some("EVALUATION_STATE_PASSED"),
12450 Self::Failed => std::option::Option::Some("EVALUATION_STATE_FAILED"),
12451 Self::NotAssessed => std::option::Option::Some("EVALUATION_STATE_NOT_ASSESSED"),
12452 Self::UnknownValue(u) => u.0.name(),
12453 }
12454 }
12455}
12456
12457impl std::default::Default for EvaluationState {
12458 fn default() -> Self {
12459 use std::convert::From;
12460 Self::from(0)
12461 }
12462}
12463
12464impl std::fmt::Display for EvaluationState {
12465 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12466 wkt::internal::display_enum(f, self.name(), self.value())
12467 }
12468}
12469
12470impl std::convert::From<i32> for EvaluationState {
12471 fn from(value: i32) -> Self {
12472 match value {
12473 0 => Self::Unspecified,
12474 1 => Self::Passed,
12475 2 => Self::Failed,
12476 3 => Self::NotAssessed,
12477 _ => Self::UnknownValue(evaluation_state::UnknownValue(
12478 wkt::internal::UnknownEnumValue::Integer(value),
12479 )),
12480 }
12481 }
12482}
12483
12484impl std::convert::From<&str> for EvaluationState {
12485 fn from(value: &str) -> Self {
12486 use std::string::ToString;
12487 match value {
12488 "EVALUATION_STATE_UNSPECIFIED" => Self::Unspecified,
12489 "EVALUATION_STATE_PASSED" => Self::Passed,
12490 "EVALUATION_STATE_FAILED" => Self::Failed,
12491 "EVALUATION_STATE_NOT_ASSESSED" => Self::NotAssessed,
12492 _ => Self::UnknownValue(evaluation_state::UnknownValue(
12493 wkt::internal::UnknownEnumValue::String(value.to_string()),
12494 )),
12495 }
12496 }
12497}
12498
12499impl serde::ser::Serialize for EvaluationState {
12500 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12501 where
12502 S: serde::Serializer,
12503 {
12504 match self {
12505 Self::Unspecified => serializer.serialize_i32(0),
12506 Self::Passed => serializer.serialize_i32(1),
12507 Self::Failed => serializer.serialize_i32(2),
12508 Self::NotAssessed => serializer.serialize_i32(3),
12509 Self::UnknownValue(u) => u.0.serialize(serializer),
12510 }
12511 }
12512}
12513
12514impl<'de> serde::de::Deserialize<'de> for EvaluationState {
12515 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12516 where
12517 D: serde::Deserializer<'de>,
12518 {
12519 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EvaluationState>::new(
12520 ".google.cloud.cloudsecuritycompliance.v1.EvaluationState",
12521 ))
12522 }
12523}
12524
12525/// A finding is a record of assessment data like security, risk, health, or
12526/// privacy.
12527///
12528/// # Working with unknown values
12529///
12530/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12531/// additional enum variants at any time. Adding new variants is not considered
12532/// a breaking change. Applications should write their code in anticipation of:
12533///
12534/// - New values appearing in future releases of the client library, **and**
12535/// - New values received dynamically, without application changes.
12536///
12537/// Please consult the [Working with enums] section in the user guide for some
12538/// guidelines.
12539///
12540/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12541#[derive(Clone, Debug, PartialEq)]
12542#[non_exhaustive]
12543pub enum FindingClass {
12544 /// Default value. This value is unused.
12545 Unspecified,
12546 /// The activity is unwanted or malicious.
12547 Threat,
12548 /// A potential weakness in software that increases risk to
12549 /// confidentiality, integrity, and availability.
12550 Vulnerability,
12551 /// A potential weakness in a cloud resource or asset configuration that
12552 /// increases risk.
12553 Misconfiguration,
12554 /// A security observation that is for informational purposes.
12555 Observation,
12556 /// An error that prevents Security Command Center from functioning properly.
12557 SccError,
12558 /// A potential security risk that's due to a change in the security
12559 /// posture.
12560 PostureViolation,
12561 /// A combination of security issues that represent a more severe
12562 /// security problem when taken together.
12563 ToxicCombination,
12564 /// A potential security risk to data assets that contain sensitive
12565 /// data.
12566 SensitiveDataRisk,
12567 /// A resource or resource group where high risk attack paths
12568 /// converge, based on attack path simulations (APS).
12569 Chokepoint,
12570 /// If set, the enum was initialized with an unknown value.
12571 ///
12572 /// Applications can examine the value using [FindingClass::value] or
12573 /// [FindingClass::name].
12574 UnknownValue(finding_class::UnknownValue),
12575}
12576
12577#[doc(hidden)]
12578pub mod finding_class {
12579 #[allow(unused_imports)]
12580 use super::*;
12581 #[derive(Clone, Debug, PartialEq)]
12582 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12583}
12584
12585impl FindingClass {
12586 /// Gets the enum value.
12587 ///
12588 /// Returns `None` if the enum contains an unknown value deserialized from
12589 /// the string representation of enums.
12590 pub fn value(&self) -> std::option::Option<i32> {
12591 match self {
12592 Self::Unspecified => std::option::Option::Some(0),
12593 Self::Threat => std::option::Option::Some(1),
12594 Self::Vulnerability => std::option::Option::Some(2),
12595 Self::Misconfiguration => std::option::Option::Some(3),
12596 Self::Observation => std::option::Option::Some(4),
12597 Self::SccError => std::option::Option::Some(5),
12598 Self::PostureViolation => std::option::Option::Some(6),
12599 Self::ToxicCombination => std::option::Option::Some(7),
12600 Self::SensitiveDataRisk => std::option::Option::Some(8),
12601 Self::Chokepoint => std::option::Option::Some(9),
12602 Self::UnknownValue(u) => u.0.value(),
12603 }
12604 }
12605
12606 /// Gets the enum value as a string.
12607 ///
12608 /// Returns `None` if the enum contains an unknown value deserialized from
12609 /// the integer representation of enums.
12610 pub fn name(&self) -> std::option::Option<&str> {
12611 match self {
12612 Self::Unspecified => std::option::Option::Some("FINDING_CLASS_UNSPECIFIED"),
12613 Self::Threat => std::option::Option::Some("THREAT"),
12614 Self::Vulnerability => std::option::Option::Some("VULNERABILITY"),
12615 Self::Misconfiguration => std::option::Option::Some("MISCONFIGURATION"),
12616 Self::Observation => std::option::Option::Some("OBSERVATION"),
12617 Self::SccError => std::option::Option::Some("SCC_ERROR"),
12618 Self::PostureViolation => std::option::Option::Some("POSTURE_VIOLATION"),
12619 Self::ToxicCombination => std::option::Option::Some("TOXIC_COMBINATION"),
12620 Self::SensitiveDataRisk => std::option::Option::Some("SENSITIVE_DATA_RISK"),
12621 Self::Chokepoint => std::option::Option::Some("CHOKEPOINT"),
12622 Self::UnknownValue(u) => u.0.name(),
12623 }
12624 }
12625}
12626
12627impl std::default::Default for FindingClass {
12628 fn default() -> Self {
12629 use std::convert::From;
12630 Self::from(0)
12631 }
12632}
12633
12634impl std::fmt::Display for FindingClass {
12635 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12636 wkt::internal::display_enum(f, self.name(), self.value())
12637 }
12638}
12639
12640impl std::convert::From<i32> for FindingClass {
12641 fn from(value: i32) -> Self {
12642 match value {
12643 0 => Self::Unspecified,
12644 1 => Self::Threat,
12645 2 => Self::Vulnerability,
12646 3 => Self::Misconfiguration,
12647 4 => Self::Observation,
12648 5 => Self::SccError,
12649 6 => Self::PostureViolation,
12650 7 => Self::ToxicCombination,
12651 8 => Self::SensitiveDataRisk,
12652 9 => Self::Chokepoint,
12653 _ => Self::UnknownValue(finding_class::UnknownValue(
12654 wkt::internal::UnknownEnumValue::Integer(value),
12655 )),
12656 }
12657 }
12658}
12659
12660impl std::convert::From<&str> for FindingClass {
12661 fn from(value: &str) -> Self {
12662 use std::string::ToString;
12663 match value {
12664 "FINDING_CLASS_UNSPECIFIED" => Self::Unspecified,
12665 "THREAT" => Self::Threat,
12666 "VULNERABILITY" => Self::Vulnerability,
12667 "MISCONFIGURATION" => Self::Misconfiguration,
12668 "OBSERVATION" => Self::Observation,
12669 "SCC_ERROR" => Self::SccError,
12670 "POSTURE_VIOLATION" => Self::PostureViolation,
12671 "TOXIC_COMBINATION" => Self::ToxicCombination,
12672 "SENSITIVE_DATA_RISK" => Self::SensitiveDataRisk,
12673 "CHOKEPOINT" => Self::Chokepoint,
12674 _ => Self::UnknownValue(finding_class::UnknownValue(
12675 wkt::internal::UnknownEnumValue::String(value.to_string()),
12676 )),
12677 }
12678 }
12679}
12680
12681impl serde::ser::Serialize for FindingClass {
12682 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12683 where
12684 S: serde::Serializer,
12685 {
12686 match self {
12687 Self::Unspecified => serializer.serialize_i32(0),
12688 Self::Threat => serializer.serialize_i32(1),
12689 Self::Vulnerability => serializer.serialize_i32(2),
12690 Self::Misconfiguration => serializer.serialize_i32(3),
12691 Self::Observation => serializer.serialize_i32(4),
12692 Self::SccError => serializer.serialize_i32(5),
12693 Self::PostureViolation => serializer.serialize_i32(6),
12694 Self::ToxicCombination => serializer.serialize_i32(7),
12695 Self::SensitiveDataRisk => serializer.serialize_i32(8),
12696 Self::Chokepoint => serializer.serialize_i32(9),
12697 Self::UnknownValue(u) => u.0.serialize(serializer),
12698 }
12699 }
12700}
12701
12702impl<'de> serde::de::Deserialize<'de> for FindingClass {
12703 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12704 where
12705 D: serde::Deserializer<'de>,
12706 {
12707 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FindingClass>::new(
12708 ".google.cloud.cloudsecuritycompliance.v1.FindingClass",
12709 ))
12710 }
12711}