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 serde;
29extern crate serde_json;
30extern crate serde_with;
31extern crate std;
32extern crate tracing;
33extern crate wkt;
34
35mod debug;
36mod deserialize;
37mod serialize;
38
39/// The request message for [GenerateFrameworkAuditScopeReport][].
40#[derive(Clone, Default, PartialEq)]
41#[non_exhaustive]
42pub struct GenerateFrameworkAuditScopeReportRequest {
43 /// Required. The organization, folder or project for the audit report.
44 ///
45 /// Supported formats are the following:
46 ///
47 /// * `projects/{project_id}/locations/{location}`
48 /// * `folders/{folder_id}/locations/{location}`
49 /// * `organizations/{organization_id}/locations/{location}`
50 pub scope: std::string::String,
51
52 /// Required. The format that the scope report bytes is returned in.
53 pub report_format: crate::model::generate_framework_audit_scope_report_request::Format,
54
55 /// Required. The compliance framework that the scope report is generated for.
56 pub compliance_framework: std::string::String,
57
58 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
59}
60
61impl GenerateFrameworkAuditScopeReportRequest {
62 /// Creates a new default instance.
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://googleapis.github.io/google-cloud-rust/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 /// Creates a new default instance.
271 pub fn new() -> Self {
272 std::default::Default::default()
273 }
274
275 /// Sets the value of [name][crate::model::GenerateFrameworkAuditScopeReportResponse::name].
276 ///
277 /// # Example
278 /// ```ignore,no_run
279 /// # use google_cloud_cloudsecuritycompliance_v1::model::GenerateFrameworkAuditScopeReportResponse;
280 /// # let project_id = "project_id";
281 /// # let location_id = "location_id";
282 /// # let generate_framework_audit_scope_report_response_id = "generate_framework_audit_scope_report_response_id";
283 /// let x = GenerateFrameworkAuditScopeReportResponse::new().set_name(format!("projects/{project_id}/locations/{location_id}/frameworkAuditScopeReports/{generate_framework_audit_scope_report_response_id}"));
284 /// ```
285 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
286 self.name = v.into();
287 self
288 }
289
290 /// Sets the value of [compliance_framework][crate::model::GenerateFrameworkAuditScopeReportResponse::compliance_framework].
291 ///
292 /// # Example
293 /// ```ignore,no_run
294 /// # use google_cloud_cloudsecuritycompliance_v1::model::GenerateFrameworkAuditScopeReportResponse;
295 /// let x = GenerateFrameworkAuditScopeReportResponse::new().set_compliance_framework("example");
296 /// ```
297 pub fn set_compliance_framework<T: std::convert::Into<std::string::String>>(
298 mut self,
299 v: T,
300 ) -> Self {
301 self.compliance_framework = v.into();
302 self
303 }
304
305 /// Sets the value of [audit_report][crate::model::GenerateFrameworkAuditScopeReportResponse::audit_report].
306 ///
307 /// Note that all the setters affecting `audit_report` are mutually
308 /// exclusive.
309 ///
310 /// # Example
311 /// ```ignore,no_run
312 /// # use google_cloud_cloudsecuritycompliance_v1::model::GenerateFrameworkAuditScopeReportResponse;
313 /// use google_cloud_cloudsecuritycompliance_v1::model::generate_framework_audit_scope_report_response::AuditReport;
314 /// let x = GenerateFrameworkAuditScopeReportResponse::new().set_audit_report(Some(AuditReport::ScopeReportContents(bytes::Bytes::from_static(b"example"))));
315 /// ```
316 pub fn set_audit_report<
317 T: std::convert::Into<
318 std::option::Option<
319 crate::model::generate_framework_audit_scope_report_response::AuditReport,
320 >,
321 >,
322 >(
323 mut self,
324 v: T,
325 ) -> Self {
326 self.audit_report = v.into();
327 self
328 }
329
330 /// The value of [audit_report][crate::model::GenerateFrameworkAuditScopeReportResponse::audit_report]
331 /// if it holds a `ScopeReportContents`, `None` if the field is not set or
332 /// holds a different branch.
333 pub fn scope_report_contents(&self) -> std::option::Option<&::bytes::Bytes> {
334 #[allow(unreachable_patterns)]
335 self.audit_report.as_ref().and_then(|v| match v {
336 crate::model::generate_framework_audit_scope_report_response::AuditReport::ScopeReportContents(v) => std::option::Option::Some(v),
337 _ => std::option::Option::None,
338 })
339 }
340
341 /// Sets the value of [audit_report][crate::model::GenerateFrameworkAuditScopeReportResponse::audit_report]
342 /// to hold a `ScopeReportContents`.
343 ///
344 /// Note that all the setters affecting `audit_report` are
345 /// mutually exclusive.
346 ///
347 /// # Example
348 /// ```ignore,no_run
349 /// # use google_cloud_cloudsecuritycompliance_v1::model::GenerateFrameworkAuditScopeReportResponse;
350 /// let x = GenerateFrameworkAuditScopeReportResponse::new().set_scope_report_contents(bytes::Bytes::from_static(b"example"));
351 /// assert!(x.scope_report_contents().is_some());
352 /// ```
353 pub fn set_scope_report_contents<T: std::convert::Into<::bytes::Bytes>>(
354 mut self,
355 v: T,
356 ) -> Self {
357 self.audit_report = std::option::Option::Some(
358 crate::model::generate_framework_audit_scope_report_response::AuditReport::ScopeReportContents(
359 v.into()
360 )
361 );
362 self
363 }
364}
365
366impl wkt::message::Message for GenerateFrameworkAuditScopeReportResponse {
367 fn typename() -> &'static str {
368 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.GenerateFrameworkAuditScopeReportResponse"
369 }
370}
371
372/// Defines additional types related to [GenerateFrameworkAuditScopeReportResponse].
373pub mod generate_framework_audit_scope_report_response {
374 #[allow(unused_imports)]
375 use super::*;
376
377 /// The set of options that the audit scope report is exported in.
378 #[derive(Clone, Debug, PartialEq)]
379 #[non_exhaustive]
380 pub enum AuditReport {
381 /// The audit scope report content in byte format.
382 ScopeReportContents(::bytes::Bytes),
383 }
384}
385
386/// Additional information for an audit operation.
387#[derive(Clone, Default, PartialEq)]
388#[non_exhaustive]
389pub struct ReportSummary {
390 /// Output only. The total number of checks.
391 pub total_count: i32,
392
393 /// Output only. The number of compliant checks.
394 pub compliant_count: i32,
395
396 /// Output only. The number of checks with violations.
397 pub violation_count: i32,
398
399 /// Output only. The number of checks with "manual review needed" status.
400 pub manual_review_needed_count: i32,
401
402 /// Output only. The number of checks that can't be performed due to errors.
403 pub error_count: i32,
404
405 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
406}
407
408impl ReportSummary {
409 /// Creates a new default instance.
410 pub fn new() -> Self {
411 std::default::Default::default()
412 }
413
414 /// Sets the value of [total_count][crate::model::ReportSummary::total_count].
415 ///
416 /// # Example
417 /// ```ignore,no_run
418 /// # use google_cloud_cloudsecuritycompliance_v1::model::ReportSummary;
419 /// let x = ReportSummary::new().set_total_count(42);
420 /// ```
421 pub fn set_total_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
422 self.total_count = v.into();
423 self
424 }
425
426 /// Sets the value of [compliant_count][crate::model::ReportSummary::compliant_count].
427 ///
428 /// # Example
429 /// ```ignore,no_run
430 /// # use google_cloud_cloudsecuritycompliance_v1::model::ReportSummary;
431 /// let x = ReportSummary::new().set_compliant_count(42);
432 /// ```
433 pub fn set_compliant_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
434 self.compliant_count = v.into();
435 self
436 }
437
438 /// Sets the value of [violation_count][crate::model::ReportSummary::violation_count].
439 ///
440 /// # Example
441 /// ```ignore,no_run
442 /// # use google_cloud_cloudsecuritycompliance_v1::model::ReportSummary;
443 /// let x = ReportSummary::new().set_violation_count(42);
444 /// ```
445 pub fn set_violation_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
446 self.violation_count = v.into();
447 self
448 }
449
450 /// Sets the value of [manual_review_needed_count][crate::model::ReportSummary::manual_review_needed_count].
451 ///
452 /// # Example
453 /// ```ignore,no_run
454 /// # use google_cloud_cloudsecuritycompliance_v1::model::ReportSummary;
455 /// let x = ReportSummary::new().set_manual_review_needed_count(42);
456 /// ```
457 pub fn set_manual_review_needed_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
458 self.manual_review_needed_count = v.into();
459 self
460 }
461
462 /// Sets the value of [error_count][crate::model::ReportSummary::error_count].
463 ///
464 /// # Example
465 /// ```ignore,no_run
466 /// # use google_cloud_cloudsecuritycompliance_v1::model::ReportSummary;
467 /// let x = ReportSummary::new().set_error_count(42);
468 /// ```
469 pub fn set_error_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
470 self.error_count = v.into();
471 self
472 }
473}
474
475impl wkt::message::Message for ReportSummary {
476 fn typename() -> &'static str {
477 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ReportSummary"
478 }
479}
480
481/// The request message for [CreateFrameworkAudit][].
482#[derive(Clone, Default, PartialEq)]
483#[non_exhaustive]
484pub struct CreateFrameworkAuditRequest {
485 /// Required. The parent resource where this framework audit is created.
486 ///
487 /// Supported formats are the following:
488 ///
489 /// * `organizations/{organization_id}/locations/{location}`
490 /// * `folders/{folder_id}/locations/{location}`
491 /// * `projects/{project_id}/locations/{location}`
492 pub parent: std::string::String,
493
494 /// Optional. The ID to use for the framework audit. The ID becomes the final
495 /// component of the framework audit's full resource name.
496 ///
497 /// The ID must be between 4-63 characters, and valid characters
498 /// are `\[a-z][0-9]-\`.
499 pub framework_audit_id: std::string::String,
500
501 /// Required. The framework audit to create.
502 pub framework_audit: std::option::Option<crate::model::FrameworkAudit>,
503
504 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
505}
506
507impl CreateFrameworkAuditRequest {
508 /// Creates a new default instance.
509 pub fn new() -> Self {
510 std::default::Default::default()
511 }
512
513 /// Sets the value of [parent][crate::model::CreateFrameworkAuditRequest::parent].
514 ///
515 /// # Example
516 /// ```ignore,no_run
517 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkAuditRequest;
518 /// # let project_id = "project_id";
519 /// # let location_id = "location_id";
520 /// let x = CreateFrameworkAuditRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
521 /// ```
522 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
523 self.parent = v.into();
524 self
525 }
526
527 /// Sets the value of [framework_audit_id][crate::model::CreateFrameworkAuditRequest::framework_audit_id].
528 ///
529 /// # Example
530 /// ```ignore,no_run
531 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkAuditRequest;
532 /// let x = CreateFrameworkAuditRequest::new().set_framework_audit_id("example");
533 /// ```
534 pub fn set_framework_audit_id<T: std::convert::Into<std::string::String>>(
535 mut self,
536 v: T,
537 ) -> Self {
538 self.framework_audit_id = v.into();
539 self
540 }
541
542 /// Sets the value of [framework_audit][crate::model::CreateFrameworkAuditRequest::framework_audit].
543 ///
544 /// # Example
545 /// ```ignore,no_run
546 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkAuditRequest;
547 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
548 /// let x = CreateFrameworkAuditRequest::new().set_framework_audit(FrameworkAudit::default()/* use setters */);
549 /// ```
550 pub fn set_framework_audit<T>(mut self, v: T) -> Self
551 where
552 T: std::convert::Into<crate::model::FrameworkAudit>,
553 {
554 self.framework_audit = std::option::Option::Some(v.into());
555 self
556 }
557
558 /// Sets or clears the value of [framework_audit][crate::model::CreateFrameworkAuditRequest::framework_audit].
559 ///
560 /// # Example
561 /// ```ignore,no_run
562 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkAuditRequest;
563 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
564 /// let x = CreateFrameworkAuditRequest::new().set_or_clear_framework_audit(Some(FrameworkAudit::default()/* use setters */));
565 /// let x = CreateFrameworkAuditRequest::new().set_or_clear_framework_audit(None::<FrameworkAudit>);
566 /// ```
567 pub fn set_or_clear_framework_audit<T>(mut self, v: std::option::Option<T>) -> Self
568 where
569 T: std::convert::Into<crate::model::FrameworkAudit>,
570 {
571 self.framework_audit = v.map(|x| x.into());
572 self
573 }
574}
575
576impl wkt::message::Message for CreateFrameworkAuditRequest {
577 fn typename() -> &'static str {
578 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CreateFrameworkAuditRequest"
579 }
580}
581
582/// A destination for the framework audit.
583#[derive(Clone, Default, PartialEq)]
584#[non_exhaustive]
585pub struct FrameworkAuditDestination {
586 /// The type of destination.
587 pub destination_type:
588 std::option::Option<crate::model::framework_audit_destination::DestinationType>,
589
590 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
591}
592
593impl FrameworkAuditDestination {
594 /// Creates a new default instance.
595 pub fn new() -> Self {
596 std::default::Default::default()
597 }
598
599 /// Sets the value of [destination_type][crate::model::FrameworkAuditDestination::destination_type].
600 ///
601 /// Note that all the setters affecting `destination_type` are mutually
602 /// exclusive.
603 ///
604 /// # Example
605 /// ```ignore,no_run
606 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAuditDestination;
607 /// use google_cloud_cloudsecuritycompliance_v1::model::BucketDestination;
608 /// let x = FrameworkAuditDestination::new().set_destination_type(Some(
609 /// google_cloud_cloudsecuritycompliance_v1::model::framework_audit_destination::DestinationType::Bucket(BucketDestination::default().into())));
610 /// ```
611 pub fn set_destination_type<
612 T: std::convert::Into<
613 std::option::Option<crate::model::framework_audit_destination::DestinationType>,
614 >,
615 >(
616 mut self,
617 v: T,
618 ) -> Self {
619 self.destination_type = v.into();
620 self
621 }
622
623 /// The value of [destination_type][crate::model::FrameworkAuditDestination::destination_type]
624 /// if it holds a `Bucket`, `None` if the field is not set or
625 /// holds a different branch.
626 pub fn bucket(&self) -> std::option::Option<&std::boxed::Box<crate::model::BucketDestination>> {
627 #[allow(unreachable_patterns)]
628 self.destination_type.as_ref().and_then(|v| match v {
629 crate::model::framework_audit_destination::DestinationType::Bucket(v) => {
630 std::option::Option::Some(v)
631 }
632 _ => std::option::Option::None,
633 })
634 }
635
636 /// Sets the value of [destination_type][crate::model::FrameworkAuditDestination::destination_type]
637 /// to hold a `Bucket`.
638 ///
639 /// Note that all the setters affecting `destination_type` are
640 /// mutually exclusive.
641 ///
642 /// # Example
643 /// ```ignore,no_run
644 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAuditDestination;
645 /// use google_cloud_cloudsecuritycompliance_v1::model::BucketDestination;
646 /// let x = FrameworkAuditDestination::new().set_bucket(BucketDestination::default()/* use setters */);
647 /// assert!(x.bucket().is_some());
648 /// ```
649 pub fn set_bucket<T: std::convert::Into<std::boxed::Box<crate::model::BucketDestination>>>(
650 mut self,
651 v: T,
652 ) -> Self {
653 self.destination_type = std::option::Option::Some(
654 crate::model::framework_audit_destination::DestinationType::Bucket(v.into()),
655 );
656 self
657 }
658}
659
660impl wkt::message::Message for FrameworkAuditDestination {
661 fn typename() -> &'static str {
662 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FrameworkAuditDestination"
663 }
664}
665
666/// Defines additional types related to [FrameworkAuditDestination].
667pub mod framework_audit_destination {
668 #[allow(unused_imports)]
669 use super::*;
670
671 /// The type of destination.
672 #[derive(Clone, Debug, PartialEq)]
673 #[non_exhaustive]
674 pub enum DestinationType {
675 /// The Cloud Storage bucket destination.
676 Bucket(std::boxed::Box<crate::model::BucketDestination>),
677 }
678}
679
680/// A Cloud Storage bucket destination.
681#[derive(Clone, Default, PartialEq)]
682#[non_exhaustive]
683pub struct BucketDestination {
684 /// Required. The URI of the Cloud Storage bucket.
685 pub bucket_uri: std::string::String,
686
687 /// Optional. The format of the framework audit.
688 pub framework_audit_format: crate::model::bucket_destination::Format,
689
690 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
691}
692
693impl BucketDestination {
694 /// Creates a new default instance.
695 pub fn new() -> Self {
696 std::default::Default::default()
697 }
698
699 /// Sets the value of [bucket_uri][crate::model::BucketDestination::bucket_uri].
700 ///
701 /// # Example
702 /// ```ignore,no_run
703 /// # use google_cloud_cloudsecuritycompliance_v1::model::BucketDestination;
704 /// let x = BucketDestination::new().set_bucket_uri("example");
705 /// ```
706 pub fn set_bucket_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
707 self.bucket_uri = v.into();
708 self
709 }
710
711 /// Sets the value of [framework_audit_format][crate::model::BucketDestination::framework_audit_format].
712 ///
713 /// # Example
714 /// ```ignore,no_run
715 /// # use google_cloud_cloudsecuritycompliance_v1::model::BucketDestination;
716 /// use google_cloud_cloudsecuritycompliance_v1::model::bucket_destination::Format;
717 /// let x0 = BucketDestination::new().set_framework_audit_format(Format::Odf);
718 /// ```
719 pub fn set_framework_audit_format<
720 T: std::convert::Into<crate::model::bucket_destination::Format>,
721 >(
722 mut self,
723 v: T,
724 ) -> Self {
725 self.framework_audit_format = v.into();
726 self
727 }
728}
729
730impl wkt::message::Message for BucketDestination {
731 fn typename() -> &'static str {
732 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.BucketDestination"
733 }
734}
735
736/// Defines additional types related to [BucketDestination].
737pub mod bucket_destination {
738 #[allow(unused_imports)]
739 use super::*;
740
741 /// The set of options for the framework audit format.
742 ///
743 /// # Working with unknown values
744 ///
745 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
746 /// additional enum variants at any time. Adding new variants is not considered
747 /// a breaking change. Applications should write their code in anticipation of:
748 ///
749 /// - New values appearing in future releases of the client library, **and**
750 /// - New values received dynamically, without application changes.
751 ///
752 /// Please consult the [Working with enums] section in the user guide for some
753 /// guidelines.
754 ///
755 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
756 #[derive(Clone, Debug, PartialEq)]
757 #[non_exhaustive]
758 pub enum Format {
759 /// Default value. This value is unused.
760 Unspecified,
761 /// The format for the framework audit report is Open Document.
762 Odf,
763 /// If set, the enum was initialized with an unknown value.
764 ///
765 /// Applications can examine the value using [Format::value] or
766 /// [Format::name].
767 UnknownValue(format::UnknownValue),
768 }
769
770 #[doc(hidden)]
771 pub mod format {
772 #[allow(unused_imports)]
773 use super::*;
774 #[derive(Clone, Debug, PartialEq)]
775 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
776 }
777
778 impl Format {
779 /// Gets the enum value.
780 ///
781 /// Returns `None` if the enum contains an unknown value deserialized from
782 /// the string representation of enums.
783 pub fn value(&self) -> std::option::Option<i32> {
784 match self {
785 Self::Unspecified => std::option::Option::Some(0),
786 Self::Odf => std::option::Option::Some(1),
787 Self::UnknownValue(u) => u.0.value(),
788 }
789 }
790
791 /// Gets the enum value as a string.
792 ///
793 /// Returns `None` if the enum contains an unknown value deserialized from
794 /// the integer representation of enums.
795 pub fn name(&self) -> std::option::Option<&str> {
796 match self {
797 Self::Unspecified => std::option::Option::Some("FORMAT_UNSPECIFIED"),
798 Self::Odf => std::option::Option::Some("ODF"),
799 Self::UnknownValue(u) => u.0.name(),
800 }
801 }
802 }
803
804 impl std::default::Default for Format {
805 fn default() -> Self {
806 use std::convert::From;
807 Self::from(0)
808 }
809 }
810
811 impl std::fmt::Display for Format {
812 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
813 wkt::internal::display_enum(f, self.name(), self.value())
814 }
815 }
816
817 impl std::convert::From<i32> for Format {
818 fn from(value: i32) -> Self {
819 match value {
820 0 => Self::Unspecified,
821 1 => Self::Odf,
822 _ => Self::UnknownValue(format::UnknownValue(
823 wkt::internal::UnknownEnumValue::Integer(value),
824 )),
825 }
826 }
827 }
828
829 impl std::convert::From<&str> for Format {
830 fn from(value: &str) -> Self {
831 use std::string::ToString;
832 match value {
833 "FORMAT_UNSPECIFIED" => Self::Unspecified,
834 "ODF" => Self::Odf,
835 _ => Self::UnknownValue(format::UnknownValue(
836 wkt::internal::UnknownEnumValue::String(value.to_string()),
837 )),
838 }
839 }
840 }
841
842 impl serde::ser::Serialize for Format {
843 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
844 where
845 S: serde::Serializer,
846 {
847 match self {
848 Self::Unspecified => serializer.serialize_i32(0),
849 Self::Odf => serializer.serialize_i32(1),
850 Self::UnknownValue(u) => u.0.serialize(serializer),
851 }
852 }
853 }
854
855 impl<'de> serde::de::Deserialize<'de> for Format {
856 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
857 where
858 D: serde::Deserializer<'de>,
859 {
860 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Format>::new(
861 ".google.cloud.cloudsecuritycompliance.v1.BucketDestination.Format",
862 ))
863 }
864 }
865}
866
867/// A framework audit.
868#[derive(Clone, Default, PartialEq)]
869#[non_exhaustive]
870pub struct FrameworkAudit {
871 /// Output only. Identifier. The name of the framework audit.
872 pub name: std::string::String,
873
874 /// Output only. The ID of the framework audit.
875 pub framework_audit_id: std::string::String,
876
877 /// Output only. The compliance framework used for the audit.
878 pub compliance_framework: std::string::String,
879
880 /// Output only. The scope of the audit.
881 pub scope: std::string::String,
882
883 /// Required. The destination for the audit reports.
884 pub framework_audit_destination: std::option::Option<crate::model::FrameworkAuditDestination>,
885
886 /// Output only. The time that the audit started.
887 pub start_time: std::option::Option<wkt::Timestamp>,
888
889 /// Output only. The time that the audit finished.
890 pub finish_time: std::option::Option<wkt::Timestamp>,
891
892 /// Output only. The overall compliance state of the audit.
893 pub compliance_state: crate::model::ComplianceState,
894
895 /// Output only. The summary of the report.
896 pub report_summary: std::option::Option<crate::model::ReportSummary>,
897
898 /// Optional. The details for the cloud control groups within this audit.
899 pub cloud_control_group_audit_details:
900 std::vec::Vec<crate::model::CloudControlGroupAuditDetails>,
901
902 /// Optional. The details for the cloud controls within this audit.
903 pub cloud_control_audit_details: std::vec::Vec<crate::model::CloudControlAuditDetails>,
904
905 /// Output only. The ID of the long-running operation.
906 pub operation_id: std::string::String,
907
908 /// Output only. The framework audit state of the audit.
909 pub state: crate::model::framework_audit::State,
910
911 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
912}
913
914impl FrameworkAudit {
915 /// Creates a new default instance.
916 pub fn new() -> Self {
917 std::default::Default::default()
918 }
919
920 /// Sets the value of [name][crate::model::FrameworkAudit::name].
921 ///
922 /// # Example
923 /// ```ignore,no_run
924 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
925 /// # let project_id = "project_id";
926 /// # let location_id = "location_id";
927 /// # let framework_audit_id = "framework_audit_id";
928 /// let x = FrameworkAudit::new().set_name(format!("projects/{project_id}/locations/{location_id}/frameworkAudits/{framework_audit_id}"));
929 /// ```
930 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
931 self.name = v.into();
932 self
933 }
934
935 /// Sets the value of [framework_audit_id][crate::model::FrameworkAudit::framework_audit_id].
936 ///
937 /// # Example
938 /// ```ignore,no_run
939 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
940 /// let x = FrameworkAudit::new().set_framework_audit_id("example");
941 /// ```
942 pub fn set_framework_audit_id<T: std::convert::Into<std::string::String>>(
943 mut self,
944 v: T,
945 ) -> Self {
946 self.framework_audit_id = v.into();
947 self
948 }
949
950 /// Sets the value of [compliance_framework][crate::model::FrameworkAudit::compliance_framework].
951 ///
952 /// # Example
953 /// ```ignore,no_run
954 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
955 /// let x = FrameworkAudit::new().set_compliance_framework("example");
956 /// ```
957 pub fn set_compliance_framework<T: std::convert::Into<std::string::String>>(
958 mut self,
959 v: T,
960 ) -> Self {
961 self.compliance_framework = v.into();
962 self
963 }
964
965 /// Sets the value of [scope][crate::model::FrameworkAudit::scope].
966 ///
967 /// # Example
968 /// ```ignore,no_run
969 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
970 /// let x = FrameworkAudit::new().set_scope("example");
971 /// ```
972 pub fn set_scope<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
973 self.scope = v.into();
974 self
975 }
976
977 /// Sets the value of [framework_audit_destination][crate::model::FrameworkAudit::framework_audit_destination].
978 ///
979 /// # Example
980 /// ```ignore,no_run
981 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
982 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAuditDestination;
983 /// let x = FrameworkAudit::new().set_framework_audit_destination(FrameworkAuditDestination::default()/* use setters */);
984 /// ```
985 pub fn set_framework_audit_destination<T>(mut self, v: T) -> Self
986 where
987 T: std::convert::Into<crate::model::FrameworkAuditDestination>,
988 {
989 self.framework_audit_destination = std::option::Option::Some(v.into());
990 self
991 }
992
993 /// Sets or clears the value of [framework_audit_destination][crate::model::FrameworkAudit::framework_audit_destination].
994 ///
995 /// # Example
996 /// ```ignore,no_run
997 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
998 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAuditDestination;
999 /// let x = FrameworkAudit::new().set_or_clear_framework_audit_destination(Some(FrameworkAuditDestination::default()/* use setters */));
1000 /// let x = FrameworkAudit::new().set_or_clear_framework_audit_destination(None::<FrameworkAuditDestination>);
1001 /// ```
1002 pub fn set_or_clear_framework_audit_destination<T>(mut self, v: std::option::Option<T>) -> Self
1003 where
1004 T: std::convert::Into<crate::model::FrameworkAuditDestination>,
1005 {
1006 self.framework_audit_destination = v.map(|x| x.into());
1007 self
1008 }
1009
1010 /// Sets the value of [start_time][crate::model::FrameworkAudit::start_time].
1011 ///
1012 /// # Example
1013 /// ```ignore,no_run
1014 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1015 /// use wkt::Timestamp;
1016 /// let x = FrameworkAudit::new().set_start_time(Timestamp::default()/* use setters */);
1017 /// ```
1018 pub fn set_start_time<T>(mut self, v: T) -> Self
1019 where
1020 T: std::convert::Into<wkt::Timestamp>,
1021 {
1022 self.start_time = std::option::Option::Some(v.into());
1023 self
1024 }
1025
1026 /// Sets or clears the value of [start_time][crate::model::FrameworkAudit::start_time].
1027 ///
1028 /// # Example
1029 /// ```ignore,no_run
1030 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1031 /// use wkt::Timestamp;
1032 /// let x = FrameworkAudit::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
1033 /// let x = FrameworkAudit::new().set_or_clear_start_time(None::<Timestamp>);
1034 /// ```
1035 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
1036 where
1037 T: std::convert::Into<wkt::Timestamp>,
1038 {
1039 self.start_time = v.map(|x| x.into());
1040 self
1041 }
1042
1043 /// Sets the value of [finish_time][crate::model::FrameworkAudit::finish_time].
1044 ///
1045 /// # Example
1046 /// ```ignore,no_run
1047 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1048 /// use wkt::Timestamp;
1049 /// let x = FrameworkAudit::new().set_finish_time(Timestamp::default()/* use setters */);
1050 /// ```
1051 pub fn set_finish_time<T>(mut self, v: T) -> Self
1052 where
1053 T: std::convert::Into<wkt::Timestamp>,
1054 {
1055 self.finish_time = std::option::Option::Some(v.into());
1056 self
1057 }
1058
1059 /// Sets or clears the value of [finish_time][crate::model::FrameworkAudit::finish_time].
1060 ///
1061 /// # Example
1062 /// ```ignore,no_run
1063 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1064 /// use wkt::Timestamp;
1065 /// let x = FrameworkAudit::new().set_or_clear_finish_time(Some(Timestamp::default()/* use setters */));
1066 /// let x = FrameworkAudit::new().set_or_clear_finish_time(None::<Timestamp>);
1067 /// ```
1068 pub fn set_or_clear_finish_time<T>(mut self, v: std::option::Option<T>) -> Self
1069 where
1070 T: std::convert::Into<wkt::Timestamp>,
1071 {
1072 self.finish_time = v.map(|x| x.into());
1073 self
1074 }
1075
1076 /// Sets the value of [compliance_state][crate::model::FrameworkAudit::compliance_state].
1077 ///
1078 /// # Example
1079 /// ```ignore,no_run
1080 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1081 /// use google_cloud_cloudsecuritycompliance_v1::model::ComplianceState;
1082 /// let x0 = FrameworkAudit::new().set_compliance_state(ComplianceState::Compliant);
1083 /// let x1 = FrameworkAudit::new().set_compliance_state(ComplianceState::Violation);
1084 /// let x2 = FrameworkAudit::new().set_compliance_state(ComplianceState::ManualReviewNeeded);
1085 /// ```
1086 pub fn set_compliance_state<T: std::convert::Into<crate::model::ComplianceState>>(
1087 mut self,
1088 v: T,
1089 ) -> Self {
1090 self.compliance_state = v.into();
1091 self
1092 }
1093
1094 /// Sets the value of [report_summary][crate::model::FrameworkAudit::report_summary].
1095 ///
1096 /// # Example
1097 /// ```ignore,no_run
1098 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1099 /// use google_cloud_cloudsecuritycompliance_v1::model::ReportSummary;
1100 /// let x = FrameworkAudit::new().set_report_summary(ReportSummary::default()/* use setters */);
1101 /// ```
1102 pub fn set_report_summary<T>(mut self, v: T) -> Self
1103 where
1104 T: std::convert::Into<crate::model::ReportSummary>,
1105 {
1106 self.report_summary = std::option::Option::Some(v.into());
1107 self
1108 }
1109
1110 /// Sets or clears the value of [report_summary][crate::model::FrameworkAudit::report_summary].
1111 ///
1112 /// # Example
1113 /// ```ignore,no_run
1114 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1115 /// use google_cloud_cloudsecuritycompliance_v1::model::ReportSummary;
1116 /// let x = FrameworkAudit::new().set_or_clear_report_summary(Some(ReportSummary::default()/* use setters */));
1117 /// let x = FrameworkAudit::new().set_or_clear_report_summary(None::<ReportSummary>);
1118 /// ```
1119 pub fn set_or_clear_report_summary<T>(mut self, v: std::option::Option<T>) -> Self
1120 where
1121 T: std::convert::Into<crate::model::ReportSummary>,
1122 {
1123 self.report_summary = v.map(|x| x.into());
1124 self
1125 }
1126
1127 /// Sets the value of [cloud_control_group_audit_details][crate::model::FrameworkAudit::cloud_control_group_audit_details].
1128 ///
1129 /// # Example
1130 /// ```ignore,no_run
1131 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1132 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1133 /// let x = FrameworkAudit::new()
1134 /// .set_cloud_control_group_audit_details([
1135 /// CloudControlGroupAuditDetails::default()/* use setters */,
1136 /// CloudControlGroupAuditDetails::default()/* use (different) setters */,
1137 /// ]);
1138 /// ```
1139 pub fn set_cloud_control_group_audit_details<T, V>(mut self, v: T) -> Self
1140 where
1141 T: std::iter::IntoIterator<Item = V>,
1142 V: std::convert::Into<crate::model::CloudControlGroupAuditDetails>,
1143 {
1144 use std::iter::Iterator;
1145 self.cloud_control_group_audit_details = v.into_iter().map(|i| i.into()).collect();
1146 self
1147 }
1148
1149 /// Sets the value of [cloud_control_audit_details][crate::model::FrameworkAudit::cloud_control_audit_details].
1150 ///
1151 /// # Example
1152 /// ```ignore,no_run
1153 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1154 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAuditDetails;
1155 /// let x = FrameworkAudit::new()
1156 /// .set_cloud_control_audit_details([
1157 /// CloudControlAuditDetails::default()/* use setters */,
1158 /// CloudControlAuditDetails::default()/* use (different) setters */,
1159 /// ]);
1160 /// ```
1161 pub fn set_cloud_control_audit_details<T, V>(mut self, v: T) -> Self
1162 where
1163 T: std::iter::IntoIterator<Item = V>,
1164 V: std::convert::Into<crate::model::CloudControlAuditDetails>,
1165 {
1166 use std::iter::Iterator;
1167 self.cloud_control_audit_details = v.into_iter().map(|i| i.into()).collect();
1168 self
1169 }
1170
1171 /// Sets the value of [operation_id][crate::model::FrameworkAudit::operation_id].
1172 ///
1173 /// # Example
1174 /// ```ignore,no_run
1175 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1176 /// let x = FrameworkAudit::new().set_operation_id("example");
1177 /// ```
1178 pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1179 self.operation_id = v.into();
1180 self
1181 }
1182
1183 /// Sets the value of [state][crate::model::FrameworkAudit::state].
1184 ///
1185 /// # Example
1186 /// ```ignore,no_run
1187 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1188 /// use google_cloud_cloudsecuritycompliance_v1::model::framework_audit::State;
1189 /// let x0 = FrameworkAudit::new().set_state(State::Scheduled);
1190 /// let x1 = FrameworkAudit::new().set_state(State::Running);
1191 /// let x2 = FrameworkAudit::new().set_state(State::Uploading);
1192 /// ```
1193 pub fn set_state<T: std::convert::Into<crate::model::framework_audit::State>>(
1194 mut self,
1195 v: T,
1196 ) -> Self {
1197 self.state = v.into();
1198 self
1199 }
1200}
1201
1202impl wkt::message::Message for FrameworkAudit {
1203 fn typename() -> &'static str {
1204 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FrameworkAudit"
1205 }
1206}
1207
1208/// Defines additional types related to [FrameworkAudit].
1209pub mod framework_audit {
1210 #[allow(unused_imports)]
1211 use super::*;
1212
1213 /// The state of the framework audit.
1214 ///
1215 /// # Working with unknown values
1216 ///
1217 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1218 /// additional enum variants at any time. Adding new variants is not considered
1219 /// a breaking change. Applications should write their code in anticipation of:
1220 ///
1221 /// - New values appearing in future releases of the client library, **and**
1222 /// - New values received dynamically, without application changes.
1223 ///
1224 /// Please consult the [Working with enums] section in the user guide for some
1225 /// guidelines.
1226 ///
1227 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1228 #[derive(Clone, Debug, PartialEq)]
1229 #[non_exhaustive]
1230 pub enum State {
1231 /// Default value. This value is unused.
1232 Unspecified,
1233 /// The audit is scheduled.
1234 Scheduled,
1235 /// The audit is running.
1236 Running,
1237 /// The audit results are being uploaded.
1238 Uploading,
1239 /// The audit failed.
1240 Failed,
1241 /// The audit completed successfully.
1242 Succeeded,
1243 /// If set, the enum was initialized with an unknown value.
1244 ///
1245 /// Applications can examine the value using [State::value] or
1246 /// [State::name].
1247 UnknownValue(state::UnknownValue),
1248 }
1249
1250 #[doc(hidden)]
1251 pub mod state {
1252 #[allow(unused_imports)]
1253 use super::*;
1254 #[derive(Clone, Debug, PartialEq)]
1255 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1256 }
1257
1258 impl State {
1259 /// Gets the enum value.
1260 ///
1261 /// Returns `None` if the enum contains an unknown value deserialized from
1262 /// the string representation of enums.
1263 pub fn value(&self) -> std::option::Option<i32> {
1264 match self {
1265 Self::Unspecified => std::option::Option::Some(0),
1266 Self::Scheduled => std::option::Option::Some(1),
1267 Self::Running => std::option::Option::Some(2),
1268 Self::Uploading => std::option::Option::Some(3),
1269 Self::Failed => std::option::Option::Some(4),
1270 Self::Succeeded => std::option::Option::Some(5),
1271 Self::UnknownValue(u) => u.0.value(),
1272 }
1273 }
1274
1275 /// Gets the enum value as a string.
1276 ///
1277 /// Returns `None` if the enum contains an unknown value deserialized from
1278 /// the integer representation of enums.
1279 pub fn name(&self) -> std::option::Option<&str> {
1280 match self {
1281 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1282 Self::Scheduled => std::option::Option::Some("SCHEDULED"),
1283 Self::Running => std::option::Option::Some("RUNNING"),
1284 Self::Uploading => std::option::Option::Some("UPLOADING"),
1285 Self::Failed => std::option::Option::Some("FAILED"),
1286 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
1287 Self::UnknownValue(u) => u.0.name(),
1288 }
1289 }
1290 }
1291
1292 impl std::default::Default for State {
1293 fn default() -> Self {
1294 use std::convert::From;
1295 Self::from(0)
1296 }
1297 }
1298
1299 impl std::fmt::Display for State {
1300 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1301 wkt::internal::display_enum(f, self.name(), self.value())
1302 }
1303 }
1304
1305 impl std::convert::From<i32> for State {
1306 fn from(value: i32) -> Self {
1307 match value {
1308 0 => Self::Unspecified,
1309 1 => Self::Scheduled,
1310 2 => Self::Running,
1311 3 => Self::Uploading,
1312 4 => Self::Failed,
1313 5 => Self::Succeeded,
1314 _ => Self::UnknownValue(state::UnknownValue(
1315 wkt::internal::UnknownEnumValue::Integer(value),
1316 )),
1317 }
1318 }
1319 }
1320
1321 impl std::convert::From<&str> for State {
1322 fn from(value: &str) -> Self {
1323 use std::string::ToString;
1324 match value {
1325 "STATE_UNSPECIFIED" => Self::Unspecified,
1326 "SCHEDULED" => Self::Scheduled,
1327 "RUNNING" => Self::Running,
1328 "UPLOADING" => Self::Uploading,
1329 "FAILED" => Self::Failed,
1330 "SUCCEEDED" => Self::Succeeded,
1331 _ => Self::UnknownValue(state::UnknownValue(
1332 wkt::internal::UnknownEnumValue::String(value.to_string()),
1333 )),
1334 }
1335 }
1336 }
1337
1338 impl serde::ser::Serialize for State {
1339 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1340 where
1341 S: serde::Serializer,
1342 {
1343 match self {
1344 Self::Unspecified => serializer.serialize_i32(0),
1345 Self::Scheduled => serializer.serialize_i32(1),
1346 Self::Running => serializer.serialize_i32(2),
1347 Self::Uploading => serializer.serialize_i32(3),
1348 Self::Failed => serializer.serialize_i32(4),
1349 Self::Succeeded => serializer.serialize_i32(5),
1350 Self::UnknownValue(u) => u.0.serialize(serializer),
1351 }
1352 }
1353 }
1354
1355 impl<'de> serde::de::Deserialize<'de> for State {
1356 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1357 where
1358 D: serde::Deserializer<'de>,
1359 {
1360 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1361 ".google.cloud.cloudsecuritycompliance.v1.FrameworkAudit.State",
1362 ))
1363 }
1364 }
1365}
1366
1367/// The request message for [ListFrameworkAudits][].
1368#[derive(Clone, Default, PartialEq)]
1369#[non_exhaustive]
1370pub struct ListFrameworkAuditsRequest {
1371 /// Required. The parent resource where the framework audits are listed.
1372 ///
1373 /// Supported formats are the following:
1374 ///
1375 /// * `organizations/{organization_id}/locations/{location}`
1376 /// * `folders/{folder_id}/locations/{location}`
1377 /// * `projects/{project_id}/locations/{location}`
1378 pub parent: std::string::String,
1379
1380 /// Optional. The maximum number of framework audits to return. The service
1381 /// might return fewer audits than this value. If unspecified, a maximum of 10
1382 /// framework audits are returned. The maximum value is 50; values above 50 are
1383 /// limited to 50.
1384 pub page_size: i32,
1385
1386 /// Optional. The `next_page_token` value that's returned from a previous list
1387 /// request, if any.
1388 pub page_token: std::string::String,
1389
1390 /// Optional. The filters to apply to the framework audits.
1391 /// Supported filters are `compliance_framework`, `compliance_state`,
1392 /// `create_time,` and `framework_audit_name`. If the filter is invalid, an
1393 /// invalid argument error is returned.
1394 /// For syntax details, see [AIP-160][<https://google.aip.dev/160>].
1395 pub filter: std::string::String,
1396
1397 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1398}
1399
1400impl ListFrameworkAuditsRequest {
1401 /// Creates a new default instance.
1402 pub fn new() -> Self {
1403 std::default::Default::default()
1404 }
1405
1406 /// Sets the value of [parent][crate::model::ListFrameworkAuditsRequest::parent].
1407 ///
1408 /// # Example
1409 /// ```ignore,no_run
1410 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkAuditsRequest;
1411 /// # let project_id = "project_id";
1412 /// # let location_id = "location_id";
1413 /// let x = ListFrameworkAuditsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
1414 /// ```
1415 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1416 self.parent = v.into();
1417 self
1418 }
1419
1420 /// Sets the value of [page_size][crate::model::ListFrameworkAuditsRequest::page_size].
1421 ///
1422 /// # Example
1423 /// ```ignore,no_run
1424 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkAuditsRequest;
1425 /// let x = ListFrameworkAuditsRequest::new().set_page_size(42);
1426 /// ```
1427 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1428 self.page_size = v.into();
1429 self
1430 }
1431
1432 /// Sets the value of [page_token][crate::model::ListFrameworkAuditsRequest::page_token].
1433 ///
1434 /// # Example
1435 /// ```ignore,no_run
1436 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkAuditsRequest;
1437 /// let x = ListFrameworkAuditsRequest::new().set_page_token("example");
1438 /// ```
1439 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1440 self.page_token = v.into();
1441 self
1442 }
1443
1444 /// Sets the value of [filter][crate::model::ListFrameworkAuditsRequest::filter].
1445 ///
1446 /// # Example
1447 /// ```ignore,no_run
1448 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkAuditsRequest;
1449 /// let x = ListFrameworkAuditsRequest::new().set_filter("example");
1450 /// ```
1451 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1452 self.filter = v.into();
1453 self
1454 }
1455}
1456
1457impl wkt::message::Message for ListFrameworkAuditsRequest {
1458 fn typename() -> &'static str {
1459 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFrameworkAuditsRequest"
1460 }
1461}
1462
1463/// The response message for [ListFrameworkAudits][].
1464#[derive(Clone, Default, PartialEq)]
1465#[non_exhaustive]
1466pub struct ListFrameworkAuditsResponse {
1467 /// The framework audits.
1468 pub framework_audits: std::vec::Vec<crate::model::FrameworkAudit>,
1469
1470 /// A token, which you can send as the `page_token` to retrieve the next page.
1471 /// If this field is omitted, there are no subsequent pages.
1472 pub next_page_token: std::string::String,
1473
1474 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1475}
1476
1477impl ListFrameworkAuditsResponse {
1478 /// Creates a new default instance.
1479 pub fn new() -> Self {
1480 std::default::Default::default()
1481 }
1482
1483 /// Sets the value of [framework_audits][crate::model::ListFrameworkAuditsResponse::framework_audits].
1484 ///
1485 /// # Example
1486 /// ```ignore,no_run
1487 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkAuditsResponse;
1488 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkAudit;
1489 /// let x = ListFrameworkAuditsResponse::new()
1490 /// .set_framework_audits([
1491 /// FrameworkAudit::default()/* use setters */,
1492 /// FrameworkAudit::default()/* use (different) setters */,
1493 /// ]);
1494 /// ```
1495 pub fn set_framework_audits<T, V>(mut self, v: T) -> Self
1496 where
1497 T: std::iter::IntoIterator<Item = V>,
1498 V: std::convert::Into<crate::model::FrameworkAudit>,
1499 {
1500 use std::iter::Iterator;
1501 self.framework_audits = v.into_iter().map(|i| i.into()).collect();
1502 self
1503 }
1504
1505 /// Sets the value of [next_page_token][crate::model::ListFrameworkAuditsResponse::next_page_token].
1506 ///
1507 /// # Example
1508 /// ```ignore,no_run
1509 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkAuditsResponse;
1510 /// let x = ListFrameworkAuditsResponse::new().set_next_page_token("example");
1511 /// ```
1512 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1513 self.next_page_token = v.into();
1514 self
1515 }
1516}
1517
1518impl wkt::message::Message for ListFrameworkAuditsResponse {
1519 fn typename() -> &'static str {
1520 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFrameworkAuditsResponse"
1521 }
1522}
1523
1524#[doc(hidden)]
1525impl google_cloud_gax::paginator::internal::PageableResponse for ListFrameworkAuditsResponse {
1526 type PageItem = crate::model::FrameworkAudit;
1527
1528 fn items(self) -> std::vec::Vec<Self::PageItem> {
1529 self.framework_audits
1530 }
1531
1532 fn next_page_token(&self) -> std::string::String {
1533 use std::clone::Clone;
1534 self.next_page_token.clone()
1535 }
1536}
1537
1538/// The request message for [GetFrameworkAudit][].
1539#[derive(Clone, Default, PartialEq)]
1540#[non_exhaustive]
1541pub struct GetFrameworkAuditRequest {
1542 /// Required. The name of the framework audit to retrieve.
1543 ///
1544 /// Supported formats are the following:
1545 ///
1546 /// * `organizations/{organization_id}/locations/{location}/frameworkAudits/{frameworkAuditName}`
1547 /// * `folders/{folder_id}/locations/{location}/frameworkAudits/{frameworkAuditName}`
1548 /// * `projects/{project_id}/locations/{location}/frameworkAudits/{frameworkAuditName}`
1549 pub name: std::string::String,
1550
1551 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1552}
1553
1554impl GetFrameworkAuditRequest {
1555 /// Creates a new default instance.
1556 pub fn new() -> Self {
1557 std::default::Default::default()
1558 }
1559
1560 /// Sets the value of [name][crate::model::GetFrameworkAuditRequest::name].
1561 ///
1562 /// # Example
1563 /// ```ignore,no_run
1564 /// # use google_cloud_cloudsecuritycompliance_v1::model::GetFrameworkAuditRequest;
1565 /// # let project_id = "project_id";
1566 /// # let location_id = "location_id";
1567 /// # let framework_audit_id = "framework_audit_id";
1568 /// let x = GetFrameworkAuditRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/frameworkAudits/{framework_audit_id}"));
1569 /// ```
1570 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1571 self.name = v.into();
1572 self
1573 }
1574}
1575
1576impl wkt::message::Message for GetFrameworkAuditRequest {
1577 fn typename() -> &'static str {
1578 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.GetFrameworkAuditRequest"
1579 }
1580}
1581
1582/// The details for a cloud control group.
1583#[derive(Clone, Default, PartialEq)]
1584#[non_exhaustive]
1585pub struct CloudControlGroupAuditDetails {
1586 /// Output only. The ID of the cloud control group.
1587 pub cloud_control_group_id: std::string::String,
1588
1589 /// Output only. The display name of the cloud control group.
1590 pub display_name: std::string::String,
1591
1592 /// Output only. The description of the cloud control group.
1593 pub description: std::string::String,
1594
1595 /// Output only. The responsibility type.
1596 pub responsibility_type: std::string::String,
1597
1598 /// Output only. The description of Google's responsibility.
1599 pub google_responsibility_description: std::string::String,
1600
1601 /// Output only. The implementation of Google's responsibility.
1602 pub google_responsibility_implementation: std::string::String,
1603
1604 /// Output only. The description of your responsibility.
1605 pub customer_responsibility_description: std::string::String,
1606
1607 /// Output only. The implementation of your responsibility.
1608 pub customer_responsibility_implementation: std::string::String,
1609
1610 /// Output only. The compliance state of the control group.
1611 pub compliance_state: crate::model::ComplianceState,
1612
1613 /// Output only. The ID of the regulatory control.
1614 pub control_id: std::string::String,
1615
1616 /// Output only. The control family.
1617 pub control_family: std::option::Option<crate::model::ControlFamily>,
1618
1619 /// Output only. The details for the cloud controls within this group.
1620 pub cloud_control_details: std::vec::Vec<crate::model::CloudControlAuditDetails>,
1621
1622 /// Output only. The summary of the report.
1623 pub report_summary: std::option::Option<crate::model::ReportSummary>,
1624
1625 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1626}
1627
1628impl CloudControlGroupAuditDetails {
1629 /// Creates a new default instance.
1630 pub fn new() -> Self {
1631 std::default::Default::default()
1632 }
1633
1634 /// Sets the value of [cloud_control_group_id][crate::model::CloudControlGroupAuditDetails::cloud_control_group_id].
1635 ///
1636 /// # Example
1637 /// ```ignore,no_run
1638 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1639 /// let x = CloudControlGroupAuditDetails::new().set_cloud_control_group_id("example");
1640 /// ```
1641 pub fn set_cloud_control_group_id<T: std::convert::Into<std::string::String>>(
1642 mut self,
1643 v: T,
1644 ) -> Self {
1645 self.cloud_control_group_id = v.into();
1646 self
1647 }
1648
1649 /// Sets the value of [display_name][crate::model::CloudControlGroupAuditDetails::display_name].
1650 ///
1651 /// # Example
1652 /// ```ignore,no_run
1653 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1654 /// let x = CloudControlGroupAuditDetails::new().set_display_name("example");
1655 /// ```
1656 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1657 self.display_name = v.into();
1658 self
1659 }
1660
1661 /// Sets the value of [description][crate::model::CloudControlGroupAuditDetails::description].
1662 ///
1663 /// # Example
1664 /// ```ignore,no_run
1665 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1666 /// let x = CloudControlGroupAuditDetails::new().set_description("example");
1667 /// ```
1668 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1669 self.description = v.into();
1670 self
1671 }
1672
1673 /// Sets the value of [responsibility_type][crate::model::CloudControlGroupAuditDetails::responsibility_type].
1674 ///
1675 /// # Example
1676 /// ```ignore,no_run
1677 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1678 /// let x = CloudControlGroupAuditDetails::new().set_responsibility_type("example");
1679 /// ```
1680 pub fn set_responsibility_type<T: std::convert::Into<std::string::String>>(
1681 mut self,
1682 v: T,
1683 ) -> Self {
1684 self.responsibility_type = v.into();
1685 self
1686 }
1687
1688 /// Sets the value of [google_responsibility_description][crate::model::CloudControlGroupAuditDetails::google_responsibility_description].
1689 ///
1690 /// # Example
1691 /// ```ignore,no_run
1692 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1693 /// let x = CloudControlGroupAuditDetails::new().set_google_responsibility_description("example");
1694 /// ```
1695 pub fn set_google_responsibility_description<T: std::convert::Into<std::string::String>>(
1696 mut self,
1697 v: T,
1698 ) -> Self {
1699 self.google_responsibility_description = v.into();
1700 self
1701 }
1702
1703 /// Sets the value of [google_responsibility_implementation][crate::model::CloudControlGroupAuditDetails::google_responsibility_implementation].
1704 ///
1705 /// # Example
1706 /// ```ignore,no_run
1707 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1708 /// let x = CloudControlGroupAuditDetails::new().set_google_responsibility_implementation("example");
1709 /// ```
1710 pub fn set_google_responsibility_implementation<T: std::convert::Into<std::string::String>>(
1711 mut self,
1712 v: T,
1713 ) -> Self {
1714 self.google_responsibility_implementation = v.into();
1715 self
1716 }
1717
1718 /// Sets the value of [customer_responsibility_description][crate::model::CloudControlGroupAuditDetails::customer_responsibility_description].
1719 ///
1720 /// # Example
1721 /// ```ignore,no_run
1722 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1723 /// let x = CloudControlGroupAuditDetails::new().set_customer_responsibility_description("example");
1724 /// ```
1725 pub fn set_customer_responsibility_description<T: std::convert::Into<std::string::String>>(
1726 mut self,
1727 v: T,
1728 ) -> Self {
1729 self.customer_responsibility_description = v.into();
1730 self
1731 }
1732
1733 /// Sets the value of [customer_responsibility_implementation][crate::model::CloudControlGroupAuditDetails::customer_responsibility_implementation].
1734 ///
1735 /// # Example
1736 /// ```ignore,no_run
1737 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1738 /// let x = CloudControlGroupAuditDetails::new().set_customer_responsibility_implementation("example");
1739 /// ```
1740 pub fn set_customer_responsibility_implementation<
1741 T: std::convert::Into<std::string::String>,
1742 >(
1743 mut self,
1744 v: T,
1745 ) -> Self {
1746 self.customer_responsibility_implementation = v.into();
1747 self
1748 }
1749
1750 /// Sets the value of [compliance_state][crate::model::CloudControlGroupAuditDetails::compliance_state].
1751 ///
1752 /// # Example
1753 /// ```ignore,no_run
1754 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1755 /// use google_cloud_cloudsecuritycompliance_v1::model::ComplianceState;
1756 /// let x0 = CloudControlGroupAuditDetails::new().set_compliance_state(ComplianceState::Compliant);
1757 /// let x1 = CloudControlGroupAuditDetails::new().set_compliance_state(ComplianceState::Violation);
1758 /// let x2 = CloudControlGroupAuditDetails::new().set_compliance_state(ComplianceState::ManualReviewNeeded);
1759 /// ```
1760 pub fn set_compliance_state<T: std::convert::Into<crate::model::ComplianceState>>(
1761 mut self,
1762 v: T,
1763 ) -> Self {
1764 self.compliance_state = v.into();
1765 self
1766 }
1767
1768 /// Sets the value of [control_id][crate::model::CloudControlGroupAuditDetails::control_id].
1769 ///
1770 /// # Example
1771 /// ```ignore,no_run
1772 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1773 /// let x = CloudControlGroupAuditDetails::new().set_control_id("example");
1774 /// ```
1775 pub fn set_control_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1776 self.control_id = v.into();
1777 self
1778 }
1779
1780 /// Sets the value of [control_family][crate::model::CloudControlGroupAuditDetails::control_family].
1781 ///
1782 /// # Example
1783 /// ```ignore,no_run
1784 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1785 /// use google_cloud_cloudsecuritycompliance_v1::model::ControlFamily;
1786 /// let x = CloudControlGroupAuditDetails::new().set_control_family(ControlFamily::default()/* use setters */);
1787 /// ```
1788 pub fn set_control_family<T>(mut self, v: T) -> Self
1789 where
1790 T: std::convert::Into<crate::model::ControlFamily>,
1791 {
1792 self.control_family = std::option::Option::Some(v.into());
1793 self
1794 }
1795
1796 /// Sets or clears the value of [control_family][crate::model::CloudControlGroupAuditDetails::control_family].
1797 ///
1798 /// # Example
1799 /// ```ignore,no_run
1800 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1801 /// use google_cloud_cloudsecuritycompliance_v1::model::ControlFamily;
1802 /// let x = CloudControlGroupAuditDetails::new().set_or_clear_control_family(Some(ControlFamily::default()/* use setters */));
1803 /// let x = CloudControlGroupAuditDetails::new().set_or_clear_control_family(None::<ControlFamily>);
1804 /// ```
1805 pub fn set_or_clear_control_family<T>(mut self, v: std::option::Option<T>) -> Self
1806 where
1807 T: std::convert::Into<crate::model::ControlFamily>,
1808 {
1809 self.control_family = v.map(|x| x.into());
1810 self
1811 }
1812
1813 /// Sets the value of [cloud_control_details][crate::model::CloudControlGroupAuditDetails::cloud_control_details].
1814 ///
1815 /// # Example
1816 /// ```ignore,no_run
1817 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1818 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAuditDetails;
1819 /// let x = CloudControlGroupAuditDetails::new()
1820 /// .set_cloud_control_details([
1821 /// CloudControlAuditDetails::default()/* use setters */,
1822 /// CloudControlAuditDetails::default()/* use (different) setters */,
1823 /// ]);
1824 /// ```
1825 pub fn set_cloud_control_details<T, V>(mut self, v: T) -> Self
1826 where
1827 T: std::iter::IntoIterator<Item = V>,
1828 V: std::convert::Into<crate::model::CloudControlAuditDetails>,
1829 {
1830 use std::iter::Iterator;
1831 self.cloud_control_details = v.into_iter().map(|i| i.into()).collect();
1832 self
1833 }
1834
1835 /// Sets the value of [report_summary][crate::model::CloudControlGroupAuditDetails::report_summary].
1836 ///
1837 /// # Example
1838 /// ```ignore,no_run
1839 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1840 /// use google_cloud_cloudsecuritycompliance_v1::model::ReportSummary;
1841 /// let x = CloudControlGroupAuditDetails::new().set_report_summary(ReportSummary::default()/* use setters */);
1842 /// ```
1843 pub fn set_report_summary<T>(mut self, v: T) -> Self
1844 where
1845 T: std::convert::Into<crate::model::ReportSummary>,
1846 {
1847 self.report_summary = std::option::Option::Some(v.into());
1848 self
1849 }
1850
1851 /// Sets or clears the value of [report_summary][crate::model::CloudControlGroupAuditDetails::report_summary].
1852 ///
1853 /// # Example
1854 /// ```ignore,no_run
1855 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlGroupAuditDetails;
1856 /// use google_cloud_cloudsecuritycompliance_v1::model::ReportSummary;
1857 /// let x = CloudControlGroupAuditDetails::new().set_or_clear_report_summary(Some(ReportSummary::default()/* use setters */));
1858 /// let x = CloudControlGroupAuditDetails::new().set_or_clear_report_summary(None::<ReportSummary>);
1859 /// ```
1860 pub fn set_or_clear_report_summary<T>(mut self, v: std::option::Option<T>) -> Self
1861 where
1862 T: std::convert::Into<crate::model::ReportSummary>,
1863 {
1864 self.report_summary = v.map(|x| x.into());
1865 self
1866 }
1867}
1868
1869impl wkt::message::Message for CloudControlGroupAuditDetails {
1870 fn typename() -> &'static str {
1871 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControlGroupAuditDetails"
1872 }
1873}
1874
1875/// The details for a finding.
1876#[derive(Clone, Default, PartialEq)]
1877#[non_exhaustive]
1878pub struct FindingDetails {
1879 /// Output only. The name of the finding.
1880 pub name: std::string::String,
1881
1882 /// Output only. The compliance state of the finding.
1883 pub compliance_state: crate::model::ComplianceState,
1884
1885 /// Output only. The observation details for the finding.
1886 pub observation: std::option::Option<crate::model::ObservationDetails>,
1887
1888 /// Output only. The evidence details for the finding.
1889 pub evidence: std::option::Option<crate::model::EvidenceDetails>,
1890
1891 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1892}
1893
1894impl FindingDetails {
1895 /// Creates a new default instance.
1896 pub fn new() -> Self {
1897 std::default::Default::default()
1898 }
1899
1900 /// Sets the value of [name][crate::model::FindingDetails::name].
1901 ///
1902 /// # Example
1903 /// ```ignore,no_run
1904 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingDetails;
1905 /// let x = FindingDetails::new().set_name("example");
1906 /// ```
1907 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1908 self.name = v.into();
1909 self
1910 }
1911
1912 /// Sets the value of [compliance_state][crate::model::FindingDetails::compliance_state].
1913 ///
1914 /// # Example
1915 /// ```ignore,no_run
1916 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingDetails;
1917 /// use google_cloud_cloudsecuritycompliance_v1::model::ComplianceState;
1918 /// let x0 = FindingDetails::new().set_compliance_state(ComplianceState::Compliant);
1919 /// let x1 = FindingDetails::new().set_compliance_state(ComplianceState::Violation);
1920 /// let x2 = FindingDetails::new().set_compliance_state(ComplianceState::ManualReviewNeeded);
1921 /// ```
1922 pub fn set_compliance_state<T: std::convert::Into<crate::model::ComplianceState>>(
1923 mut self,
1924 v: T,
1925 ) -> Self {
1926 self.compliance_state = v.into();
1927 self
1928 }
1929
1930 /// Sets the value of [observation][crate::model::FindingDetails::observation].
1931 ///
1932 /// # Example
1933 /// ```ignore,no_run
1934 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingDetails;
1935 /// use google_cloud_cloudsecuritycompliance_v1::model::ObservationDetails;
1936 /// let x = FindingDetails::new().set_observation(ObservationDetails::default()/* use setters */);
1937 /// ```
1938 pub fn set_observation<T>(mut self, v: T) -> Self
1939 where
1940 T: std::convert::Into<crate::model::ObservationDetails>,
1941 {
1942 self.observation = std::option::Option::Some(v.into());
1943 self
1944 }
1945
1946 /// Sets or clears the value of [observation][crate::model::FindingDetails::observation].
1947 ///
1948 /// # Example
1949 /// ```ignore,no_run
1950 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingDetails;
1951 /// use google_cloud_cloudsecuritycompliance_v1::model::ObservationDetails;
1952 /// let x = FindingDetails::new().set_or_clear_observation(Some(ObservationDetails::default()/* use setters */));
1953 /// let x = FindingDetails::new().set_or_clear_observation(None::<ObservationDetails>);
1954 /// ```
1955 pub fn set_or_clear_observation<T>(mut self, v: std::option::Option<T>) -> Self
1956 where
1957 T: std::convert::Into<crate::model::ObservationDetails>,
1958 {
1959 self.observation = v.map(|x| x.into());
1960 self
1961 }
1962
1963 /// Sets the value of [evidence][crate::model::FindingDetails::evidence].
1964 ///
1965 /// # Example
1966 /// ```ignore,no_run
1967 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingDetails;
1968 /// use google_cloud_cloudsecuritycompliance_v1::model::EvidenceDetails;
1969 /// let x = FindingDetails::new().set_evidence(EvidenceDetails::default()/* use setters */);
1970 /// ```
1971 pub fn set_evidence<T>(mut self, v: T) -> Self
1972 where
1973 T: std::convert::Into<crate::model::EvidenceDetails>,
1974 {
1975 self.evidence = std::option::Option::Some(v.into());
1976 self
1977 }
1978
1979 /// Sets or clears the value of [evidence][crate::model::FindingDetails::evidence].
1980 ///
1981 /// # Example
1982 /// ```ignore,no_run
1983 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingDetails;
1984 /// use google_cloud_cloudsecuritycompliance_v1::model::EvidenceDetails;
1985 /// let x = FindingDetails::new().set_or_clear_evidence(Some(EvidenceDetails::default()/* use setters */));
1986 /// let x = FindingDetails::new().set_or_clear_evidence(None::<EvidenceDetails>);
1987 /// ```
1988 pub fn set_or_clear_evidence<T>(mut self, v: std::option::Option<T>) -> Self
1989 where
1990 T: std::convert::Into<crate::model::EvidenceDetails>,
1991 {
1992 self.evidence = v.map(|x| x.into());
1993 self
1994 }
1995}
1996
1997impl wkt::message::Message for FindingDetails {
1998 fn typename() -> &'static str {
1999 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FindingDetails"
2000 }
2001}
2002
2003/// The observation details for a finding.
2004#[derive(Clone, Default, PartialEq)]
2005#[non_exhaustive]
2006pub struct ObservationDetails {
2007 /// Output only. The current value.
2008 pub current_value: std::string::String,
2009
2010 /// Optional. The expected value.
2011 pub expected_value: std::string::String,
2012
2013 /// Output only. Any guidance for the observation.
2014 pub guidance: std::string::String,
2015
2016 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2017}
2018
2019impl ObservationDetails {
2020 /// Creates a new default instance.
2021 pub fn new() -> Self {
2022 std::default::Default::default()
2023 }
2024
2025 /// Sets the value of [current_value][crate::model::ObservationDetails::current_value].
2026 ///
2027 /// # Example
2028 /// ```ignore,no_run
2029 /// # use google_cloud_cloudsecuritycompliance_v1::model::ObservationDetails;
2030 /// let x = ObservationDetails::new().set_current_value("example");
2031 /// ```
2032 pub fn set_current_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2033 self.current_value = v.into();
2034 self
2035 }
2036
2037 /// Sets the value of [expected_value][crate::model::ObservationDetails::expected_value].
2038 ///
2039 /// # Example
2040 /// ```ignore,no_run
2041 /// # use google_cloud_cloudsecuritycompliance_v1::model::ObservationDetails;
2042 /// let x = ObservationDetails::new().set_expected_value("example");
2043 /// ```
2044 pub fn set_expected_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2045 self.expected_value = v.into();
2046 self
2047 }
2048
2049 /// Sets the value of [guidance][crate::model::ObservationDetails::guidance].
2050 ///
2051 /// # Example
2052 /// ```ignore,no_run
2053 /// # use google_cloud_cloudsecuritycompliance_v1::model::ObservationDetails;
2054 /// let x = ObservationDetails::new().set_guidance("example");
2055 /// ```
2056 pub fn set_guidance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2057 self.guidance = v.into();
2058 self
2059 }
2060}
2061
2062impl wkt::message::Message for ObservationDetails {
2063 fn typename() -> &'static str {
2064 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ObservationDetails"
2065 }
2066}
2067
2068/// The evidence details for a finding.
2069#[derive(Clone, Default, PartialEq)]
2070#[non_exhaustive]
2071pub struct EvidenceDetails {
2072 /// Output only. The resource identifier.
2073 pub resource: std::string::String,
2074
2075 /// Output only. The service identifier.
2076 pub service: std::string::String,
2077
2078 /// Output only. The path to the evidence.
2079 pub evidence_path: std::string::String,
2080
2081 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2082}
2083
2084impl EvidenceDetails {
2085 /// Creates a new default instance.
2086 pub fn new() -> Self {
2087 std::default::Default::default()
2088 }
2089
2090 /// Sets the value of [resource][crate::model::EvidenceDetails::resource].
2091 ///
2092 /// # Example
2093 /// ```ignore,no_run
2094 /// # use google_cloud_cloudsecuritycompliance_v1::model::EvidenceDetails;
2095 /// let x = EvidenceDetails::new().set_resource("example");
2096 /// ```
2097 pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2098 self.resource = v.into();
2099 self
2100 }
2101
2102 /// Sets the value of [service][crate::model::EvidenceDetails::service].
2103 ///
2104 /// # Example
2105 /// ```ignore,no_run
2106 /// # use google_cloud_cloudsecuritycompliance_v1::model::EvidenceDetails;
2107 /// let x = EvidenceDetails::new().set_service("example");
2108 /// ```
2109 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2110 self.service = v.into();
2111 self
2112 }
2113
2114 /// Sets the value of [evidence_path][crate::model::EvidenceDetails::evidence_path].
2115 ///
2116 /// # Example
2117 /// ```ignore,no_run
2118 /// # use google_cloud_cloudsecuritycompliance_v1::model::EvidenceDetails;
2119 /// let x = EvidenceDetails::new().set_evidence_path("example");
2120 /// ```
2121 pub fn set_evidence_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2122 self.evidence_path = v.into();
2123 self
2124 }
2125}
2126
2127impl wkt::message::Message for EvidenceDetails {
2128 fn typename() -> &'static str {
2129 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.EvidenceDetails"
2130 }
2131}
2132
2133/// The details for a cloud control audit.
2134#[derive(Clone, Default, PartialEq)]
2135#[non_exhaustive]
2136pub struct CloudControlAuditDetails {
2137 /// Output only. The name of the cloud control.
2138 pub cloud_control: std::string::String,
2139
2140 /// Output only. The ID of the cloud control.
2141 pub cloud_control_id: std::string::String,
2142
2143 /// Output only. The description of the cloud control.
2144 pub cloud_control_description: std::string::String,
2145
2146 /// Output only. The overall status of the findings for the control.
2147 pub compliance_state: crate::model::ComplianceState,
2148
2149 /// Output only. The summary of the report.
2150 pub report_summary: std::option::Option<crate::model::ReportSummary>,
2151
2152 /// Output only. The findings for the control.
2153 pub findings: std::vec::Vec<crate::model::FindingDetails>,
2154
2155 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2156}
2157
2158impl CloudControlAuditDetails {
2159 /// Creates a new default instance.
2160 pub fn new() -> Self {
2161 std::default::Default::default()
2162 }
2163
2164 /// Sets the value of [cloud_control][crate::model::CloudControlAuditDetails::cloud_control].
2165 ///
2166 /// # Example
2167 /// ```ignore,no_run
2168 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAuditDetails;
2169 /// let x = CloudControlAuditDetails::new().set_cloud_control("example");
2170 /// ```
2171 pub fn set_cloud_control<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2172 self.cloud_control = v.into();
2173 self
2174 }
2175
2176 /// Sets the value of [cloud_control_id][crate::model::CloudControlAuditDetails::cloud_control_id].
2177 ///
2178 /// # Example
2179 /// ```ignore,no_run
2180 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAuditDetails;
2181 /// let x = CloudControlAuditDetails::new().set_cloud_control_id("example");
2182 /// ```
2183 pub fn set_cloud_control_id<T: std::convert::Into<std::string::String>>(
2184 mut self,
2185 v: T,
2186 ) -> Self {
2187 self.cloud_control_id = v.into();
2188 self
2189 }
2190
2191 /// Sets the value of [cloud_control_description][crate::model::CloudControlAuditDetails::cloud_control_description].
2192 ///
2193 /// # Example
2194 /// ```ignore,no_run
2195 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAuditDetails;
2196 /// let x = CloudControlAuditDetails::new().set_cloud_control_description("example");
2197 /// ```
2198 pub fn set_cloud_control_description<T: std::convert::Into<std::string::String>>(
2199 mut self,
2200 v: T,
2201 ) -> Self {
2202 self.cloud_control_description = v.into();
2203 self
2204 }
2205
2206 /// Sets the value of [compliance_state][crate::model::CloudControlAuditDetails::compliance_state].
2207 ///
2208 /// # Example
2209 /// ```ignore,no_run
2210 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAuditDetails;
2211 /// use google_cloud_cloudsecuritycompliance_v1::model::ComplianceState;
2212 /// let x0 = CloudControlAuditDetails::new().set_compliance_state(ComplianceState::Compliant);
2213 /// let x1 = CloudControlAuditDetails::new().set_compliance_state(ComplianceState::Violation);
2214 /// let x2 = CloudControlAuditDetails::new().set_compliance_state(ComplianceState::ManualReviewNeeded);
2215 /// ```
2216 pub fn set_compliance_state<T: std::convert::Into<crate::model::ComplianceState>>(
2217 mut self,
2218 v: T,
2219 ) -> Self {
2220 self.compliance_state = v.into();
2221 self
2222 }
2223
2224 /// Sets the value of [report_summary][crate::model::CloudControlAuditDetails::report_summary].
2225 ///
2226 /// # Example
2227 /// ```ignore,no_run
2228 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAuditDetails;
2229 /// use google_cloud_cloudsecuritycompliance_v1::model::ReportSummary;
2230 /// let x = CloudControlAuditDetails::new().set_report_summary(ReportSummary::default()/* use setters */);
2231 /// ```
2232 pub fn set_report_summary<T>(mut self, v: T) -> Self
2233 where
2234 T: std::convert::Into<crate::model::ReportSummary>,
2235 {
2236 self.report_summary = std::option::Option::Some(v.into());
2237 self
2238 }
2239
2240 /// Sets or clears the value of [report_summary][crate::model::CloudControlAuditDetails::report_summary].
2241 ///
2242 /// # Example
2243 /// ```ignore,no_run
2244 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAuditDetails;
2245 /// use google_cloud_cloudsecuritycompliance_v1::model::ReportSummary;
2246 /// let x = CloudControlAuditDetails::new().set_or_clear_report_summary(Some(ReportSummary::default()/* use setters */));
2247 /// let x = CloudControlAuditDetails::new().set_or_clear_report_summary(None::<ReportSummary>);
2248 /// ```
2249 pub fn set_or_clear_report_summary<T>(mut self, v: std::option::Option<T>) -> Self
2250 where
2251 T: std::convert::Into<crate::model::ReportSummary>,
2252 {
2253 self.report_summary = v.map(|x| x.into());
2254 self
2255 }
2256
2257 /// Sets the value of [findings][crate::model::CloudControlAuditDetails::findings].
2258 ///
2259 /// # Example
2260 /// ```ignore,no_run
2261 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAuditDetails;
2262 /// use google_cloud_cloudsecuritycompliance_v1::model::FindingDetails;
2263 /// let x = CloudControlAuditDetails::new()
2264 /// .set_findings([
2265 /// FindingDetails::default()/* use setters */,
2266 /// FindingDetails::default()/* use (different) setters */,
2267 /// ]);
2268 /// ```
2269 pub fn set_findings<T, V>(mut self, v: T) -> Self
2270 where
2271 T: std::iter::IntoIterator<Item = V>,
2272 V: std::convert::Into<crate::model::FindingDetails>,
2273 {
2274 use std::iter::Iterator;
2275 self.findings = v.into_iter().map(|i| i.into()).collect();
2276 self
2277 }
2278}
2279
2280impl wkt::message::Message for CloudControlAuditDetails {
2281 fn typename() -> &'static str {
2282 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControlAuditDetails"
2283 }
2284}
2285
2286/// The request message for [UpdateCmEnrollment][].
2287#[derive(Clone, Default, PartialEq)]
2288#[non_exhaustive]
2289pub struct UpdateCmEnrollmentRequest {
2290 /// Required. The Compliance Manager enrollment to update.
2291 /// The `name` field is used to identify the settings that you want to update.
2292 pub cm_enrollment: std::option::Option<crate::model::CmEnrollment>,
2293
2294 /// Optional. The list of fields that you want to update.
2295 pub update_mask: std::option::Option<wkt::FieldMask>,
2296
2297 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2298}
2299
2300impl UpdateCmEnrollmentRequest {
2301 /// Creates a new default instance.
2302 pub fn new() -> Self {
2303 std::default::Default::default()
2304 }
2305
2306 /// Sets the value of [cm_enrollment][crate::model::UpdateCmEnrollmentRequest::cm_enrollment].
2307 ///
2308 /// # Example
2309 /// ```ignore,no_run
2310 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateCmEnrollmentRequest;
2311 /// use google_cloud_cloudsecuritycompliance_v1::model::CmEnrollment;
2312 /// let x = UpdateCmEnrollmentRequest::new().set_cm_enrollment(CmEnrollment::default()/* use setters */);
2313 /// ```
2314 pub fn set_cm_enrollment<T>(mut self, v: T) -> Self
2315 where
2316 T: std::convert::Into<crate::model::CmEnrollment>,
2317 {
2318 self.cm_enrollment = std::option::Option::Some(v.into());
2319 self
2320 }
2321
2322 /// Sets or clears the value of [cm_enrollment][crate::model::UpdateCmEnrollmentRequest::cm_enrollment].
2323 ///
2324 /// # Example
2325 /// ```ignore,no_run
2326 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateCmEnrollmentRequest;
2327 /// use google_cloud_cloudsecuritycompliance_v1::model::CmEnrollment;
2328 /// let x = UpdateCmEnrollmentRequest::new().set_or_clear_cm_enrollment(Some(CmEnrollment::default()/* use setters */));
2329 /// let x = UpdateCmEnrollmentRequest::new().set_or_clear_cm_enrollment(None::<CmEnrollment>);
2330 /// ```
2331 pub fn set_or_clear_cm_enrollment<T>(mut self, v: std::option::Option<T>) -> Self
2332 where
2333 T: std::convert::Into<crate::model::CmEnrollment>,
2334 {
2335 self.cm_enrollment = v.map(|x| x.into());
2336 self
2337 }
2338
2339 /// Sets the value of [update_mask][crate::model::UpdateCmEnrollmentRequest::update_mask].
2340 ///
2341 /// # Example
2342 /// ```ignore,no_run
2343 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateCmEnrollmentRequest;
2344 /// use wkt::FieldMask;
2345 /// let x = UpdateCmEnrollmentRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2346 /// ```
2347 pub fn set_update_mask<T>(mut self, v: T) -> Self
2348 where
2349 T: std::convert::Into<wkt::FieldMask>,
2350 {
2351 self.update_mask = std::option::Option::Some(v.into());
2352 self
2353 }
2354
2355 /// Sets or clears the value of [update_mask][crate::model::UpdateCmEnrollmentRequest::update_mask].
2356 ///
2357 /// # Example
2358 /// ```ignore,no_run
2359 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateCmEnrollmentRequest;
2360 /// use wkt::FieldMask;
2361 /// let x = UpdateCmEnrollmentRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2362 /// let x = UpdateCmEnrollmentRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2363 /// ```
2364 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2365 where
2366 T: std::convert::Into<wkt::FieldMask>,
2367 {
2368 self.update_mask = v.map(|x| x.into());
2369 self
2370 }
2371}
2372
2373impl wkt::message::Message for UpdateCmEnrollmentRequest {
2374 fn typename() -> &'static str {
2375 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.UpdateCmEnrollmentRequest"
2376 }
2377}
2378
2379/// The request message for [CalculateEffectiveCmEnrollment][].
2380#[derive(Clone, Default, PartialEq)]
2381#[non_exhaustive]
2382pub struct CalculateEffectiveCmEnrollmentRequest {
2383 /// Required. The name of the Compliance Manager enrollment to calculate.
2384 ///
2385 /// Supported formats are the following:
2386 ///
2387 /// * `organizations/{organization_id}/locations/{location}/cmEnrollment`
2388 /// * `folders/{folder_id}/locations/{location}/cmEnrollment`
2389 /// * `projects/{project_id}/locations/{location}/cmEnrollment`
2390 pub name: std::string::String,
2391
2392 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2393}
2394
2395impl CalculateEffectiveCmEnrollmentRequest {
2396 /// Creates a new default instance.
2397 pub fn new() -> Self {
2398 std::default::Default::default()
2399 }
2400
2401 /// Sets the value of [name][crate::model::CalculateEffectiveCmEnrollmentRequest::name].
2402 ///
2403 /// # Example
2404 /// ```ignore,no_run
2405 /// # use google_cloud_cloudsecuritycompliance_v1::model::CalculateEffectiveCmEnrollmentRequest;
2406 /// # let organization_id = "organization_id";
2407 /// # let location_id = "location_id";
2408 /// let x = CalculateEffectiveCmEnrollmentRequest::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/cmEnrollment"));
2409 /// ```
2410 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2411 self.name = v.into();
2412 self
2413 }
2414}
2415
2416impl wkt::message::Message for CalculateEffectiveCmEnrollmentRequest {
2417 fn typename() -> &'static str {
2418 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CalculateEffectiveCmEnrollmentRequest"
2419 }
2420}
2421
2422/// The settings for Compliance Manager at a specific resource scope.=
2423#[derive(Clone, Default, PartialEq)]
2424#[non_exhaustive]
2425pub struct CmEnrollment {
2426 /// Identifier. The name of the Compliance Manager enrollment.
2427 ///
2428 /// Supported formats are the following:
2429 ///
2430 /// * `organizations/{organization_id}/locations/{location}/cmEnrollment`
2431 /// * `folders/{folder_id}/locations/{location}/cmEnrollment`
2432 /// * `projects/{project_id}/locations/{location}/cmEnrollment`
2433 pub name: std::string::String,
2434
2435 /// Optional. Whether the resource is enrolled in Compliance Manager.
2436 /// This setting is inherited by all descendants.
2437 pub enrolled: bool,
2438
2439 /// Optional. The audit configuration for Compliance Manager.
2440 /// If set at a scope, this configuration overrides any inherited audit
2441 /// configuration.
2442 pub audit_config: std::option::Option<crate::model::AuditConfig>,
2443
2444 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2445}
2446
2447impl CmEnrollment {
2448 /// Creates a new default instance.
2449 pub fn new() -> Self {
2450 std::default::Default::default()
2451 }
2452
2453 /// Sets the value of [name][crate::model::CmEnrollment::name].
2454 ///
2455 /// # Example
2456 /// ```ignore,no_run
2457 /// # use google_cloud_cloudsecuritycompliance_v1::model::CmEnrollment;
2458 /// # let organization_id = "organization_id";
2459 /// # let location_id = "location_id";
2460 /// let x = CmEnrollment::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/cmEnrollment"));
2461 /// ```
2462 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2463 self.name = v.into();
2464 self
2465 }
2466
2467 /// Sets the value of [enrolled][crate::model::CmEnrollment::enrolled].
2468 ///
2469 /// # Example
2470 /// ```ignore,no_run
2471 /// # use google_cloud_cloudsecuritycompliance_v1::model::CmEnrollment;
2472 /// let x = CmEnrollment::new().set_enrolled(true);
2473 /// ```
2474 pub fn set_enrolled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2475 self.enrolled = v.into();
2476 self
2477 }
2478
2479 /// Sets the value of [audit_config][crate::model::CmEnrollment::audit_config].
2480 ///
2481 /// # Example
2482 /// ```ignore,no_run
2483 /// # use google_cloud_cloudsecuritycompliance_v1::model::CmEnrollment;
2484 /// use google_cloud_cloudsecuritycompliance_v1::model::AuditConfig;
2485 /// let x = CmEnrollment::new().set_audit_config(AuditConfig::default()/* use setters */);
2486 /// ```
2487 pub fn set_audit_config<T>(mut self, v: T) -> Self
2488 where
2489 T: std::convert::Into<crate::model::AuditConfig>,
2490 {
2491 self.audit_config = std::option::Option::Some(v.into());
2492 self
2493 }
2494
2495 /// Sets or clears the value of [audit_config][crate::model::CmEnrollment::audit_config].
2496 ///
2497 /// # Example
2498 /// ```ignore,no_run
2499 /// # use google_cloud_cloudsecuritycompliance_v1::model::CmEnrollment;
2500 /// use google_cloud_cloudsecuritycompliance_v1::model::AuditConfig;
2501 /// let x = CmEnrollment::new().set_or_clear_audit_config(Some(AuditConfig::default()/* use setters */));
2502 /// let x = CmEnrollment::new().set_or_clear_audit_config(None::<AuditConfig>);
2503 /// ```
2504 pub fn set_or_clear_audit_config<T>(mut self, v: std::option::Option<T>) -> Self
2505 where
2506 T: std::convert::Into<crate::model::AuditConfig>,
2507 {
2508 self.audit_config = v.map(|x| x.into());
2509 self
2510 }
2511}
2512
2513impl wkt::message::Message for CmEnrollment {
2514 fn typename() -> &'static str {
2515 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CmEnrollment"
2516 }
2517}
2518
2519/// The response message for [CalculateEffectiveCmEnrollment][].
2520#[derive(Clone, Default, PartialEq)]
2521#[non_exhaustive]
2522pub struct CalculateEffectiveCmEnrollmentResponse {
2523 /// The effective Compliance Manager enrollment for the resource.
2524 pub cm_enrollment: std::option::Option<crate::model::CmEnrollment>,
2525
2526 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2527}
2528
2529impl CalculateEffectiveCmEnrollmentResponse {
2530 /// Creates a new default instance.
2531 pub fn new() -> Self {
2532 std::default::Default::default()
2533 }
2534
2535 /// Sets the value of [cm_enrollment][crate::model::CalculateEffectiveCmEnrollmentResponse::cm_enrollment].
2536 ///
2537 /// # Example
2538 /// ```ignore,no_run
2539 /// # use google_cloud_cloudsecuritycompliance_v1::model::CalculateEffectiveCmEnrollmentResponse;
2540 /// use google_cloud_cloudsecuritycompliance_v1::model::CmEnrollment;
2541 /// let x = CalculateEffectiveCmEnrollmentResponse::new().set_cm_enrollment(CmEnrollment::default()/* use setters */);
2542 /// ```
2543 pub fn set_cm_enrollment<T>(mut self, v: T) -> Self
2544 where
2545 T: std::convert::Into<crate::model::CmEnrollment>,
2546 {
2547 self.cm_enrollment = std::option::Option::Some(v.into());
2548 self
2549 }
2550
2551 /// Sets or clears the value of [cm_enrollment][crate::model::CalculateEffectiveCmEnrollmentResponse::cm_enrollment].
2552 ///
2553 /// # Example
2554 /// ```ignore,no_run
2555 /// # use google_cloud_cloudsecuritycompliance_v1::model::CalculateEffectiveCmEnrollmentResponse;
2556 /// use google_cloud_cloudsecuritycompliance_v1::model::CmEnrollment;
2557 /// let x = CalculateEffectiveCmEnrollmentResponse::new().set_or_clear_cm_enrollment(Some(CmEnrollment::default()/* use setters */));
2558 /// let x = CalculateEffectiveCmEnrollmentResponse::new().set_or_clear_cm_enrollment(None::<CmEnrollment>);
2559 /// ```
2560 pub fn set_or_clear_cm_enrollment<T>(mut self, v: std::option::Option<T>) -> Self
2561 where
2562 T: std::convert::Into<crate::model::CmEnrollment>,
2563 {
2564 self.cm_enrollment = v.map(|x| x.into());
2565 self
2566 }
2567}
2568
2569impl wkt::message::Message for CalculateEffectiveCmEnrollmentResponse {
2570 fn typename() -> &'static str {
2571 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CalculateEffectiveCmEnrollmentResponse"
2572 }
2573}
2574
2575/// The audit configuration for Compliance Manager.
2576#[derive(Clone, Default, PartialEq)]
2577#[non_exhaustive]
2578pub struct AuditConfig {
2579 /// Required. The list of destinations that can be selected for uploading audit
2580 /// reports to.
2581 pub destinations: std::vec::Vec<crate::model::audit_config::CmEligibleDestination>,
2582
2583 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2584}
2585
2586impl AuditConfig {
2587 /// Creates a new default instance.
2588 pub fn new() -> Self {
2589 std::default::Default::default()
2590 }
2591
2592 /// Sets the value of [destinations][crate::model::AuditConfig::destinations].
2593 ///
2594 /// # Example
2595 /// ```ignore,no_run
2596 /// # use google_cloud_cloudsecuritycompliance_v1::model::AuditConfig;
2597 /// use google_cloud_cloudsecuritycompliance_v1::model::audit_config::CmEligibleDestination;
2598 /// let x = AuditConfig::new()
2599 /// .set_destinations([
2600 /// CmEligibleDestination::default()/* use setters */,
2601 /// CmEligibleDestination::default()/* use (different) setters */,
2602 /// ]);
2603 /// ```
2604 pub fn set_destinations<T, V>(mut self, v: T) -> Self
2605 where
2606 T: std::iter::IntoIterator<Item = V>,
2607 V: std::convert::Into<crate::model::audit_config::CmEligibleDestination>,
2608 {
2609 use std::iter::Iterator;
2610 self.destinations = v.into_iter().map(|i| i.into()).collect();
2611 self
2612 }
2613}
2614
2615impl wkt::message::Message for AuditConfig {
2616 fn typename() -> &'static str {
2617 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.AuditConfig"
2618 }
2619}
2620
2621/// Defines additional types related to [AuditConfig].
2622pub mod audit_config {
2623 #[allow(unused_imports)]
2624 use super::*;
2625
2626 /// The destination details where audit reports are
2627 /// uploaded.
2628 #[derive(Clone, Default, PartialEq)]
2629 #[non_exhaustive]
2630 pub struct CmEligibleDestination {
2631 /// Set of options for the report destination location.
2632 pub cm_eligible_destinations: std::option::Option<
2633 crate::model::audit_config::cm_eligible_destination::CmEligibleDestinations,
2634 >,
2635
2636 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2637 }
2638
2639 impl CmEligibleDestination {
2640 /// Creates a new default instance.
2641 pub fn new() -> Self {
2642 std::default::Default::default()
2643 }
2644
2645 /// Sets the value of [cm_eligible_destinations][crate::model::audit_config::CmEligibleDestination::cm_eligible_destinations].
2646 ///
2647 /// Note that all the setters affecting `cm_eligible_destinations` are mutually
2648 /// exclusive.
2649 ///
2650 /// # Example
2651 /// ```ignore,no_run
2652 /// # use google_cloud_cloudsecuritycompliance_v1::model::audit_config::CmEligibleDestination;
2653 /// use google_cloud_cloudsecuritycompliance_v1::model::audit_config::cm_eligible_destination::CmEligibleDestinations;
2654 /// let x = CmEligibleDestination::new().set_cm_eligible_destinations(Some(CmEligibleDestinations::GcsBucket("example".to_string())));
2655 /// ```
2656 pub fn set_cm_eligible_destinations<
2657 T: std::convert::Into<
2658 std::option::Option<
2659 crate::model::audit_config::cm_eligible_destination::CmEligibleDestinations,
2660 >,
2661 >,
2662 >(
2663 mut self,
2664 v: T,
2665 ) -> Self {
2666 self.cm_eligible_destinations = v.into();
2667 self
2668 }
2669
2670 /// The value of [cm_eligible_destinations][crate::model::audit_config::CmEligibleDestination::cm_eligible_destinations]
2671 /// if it holds a `GcsBucket`, `None` if the field is not set or
2672 /// holds a different branch.
2673 pub fn gcs_bucket(&self) -> std::option::Option<&std::string::String> {
2674 #[allow(unreachable_patterns)]
2675 self.cm_eligible_destinations.as_ref().and_then(|v| match v {
2676 crate::model::audit_config::cm_eligible_destination::CmEligibleDestinations::GcsBucket(v) => std::option::Option::Some(v),
2677 _ => std::option::Option::None,
2678 })
2679 }
2680
2681 /// Sets the value of [cm_eligible_destinations][crate::model::audit_config::CmEligibleDestination::cm_eligible_destinations]
2682 /// to hold a `GcsBucket`.
2683 ///
2684 /// Note that all the setters affecting `cm_eligible_destinations` are
2685 /// mutually exclusive.
2686 ///
2687 /// # Example
2688 /// ```ignore,no_run
2689 /// # use google_cloud_cloudsecuritycompliance_v1::model::audit_config::CmEligibleDestination;
2690 /// let x = CmEligibleDestination::new().set_gcs_bucket("example");
2691 /// assert!(x.gcs_bucket().is_some());
2692 /// ```
2693 pub fn set_gcs_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2694 self.cm_eligible_destinations = std::option::Option::Some(
2695 crate::model::audit_config::cm_eligible_destination::CmEligibleDestinations::GcsBucket(
2696 v.into()
2697 )
2698 );
2699 self
2700 }
2701 }
2702
2703 impl wkt::message::Message for CmEligibleDestination {
2704 fn typename() -> &'static str {
2705 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.AuditConfig.CmEligibleDestination"
2706 }
2707 }
2708
2709 /// Defines additional types related to [CmEligibleDestination].
2710 pub mod cm_eligible_destination {
2711 #[allow(unused_imports)]
2712 use super::*;
2713
2714 /// Set of options for the report destination location.
2715 #[derive(Clone, Debug, PartialEq)]
2716 #[non_exhaustive]
2717 pub enum CmEligibleDestinations {
2718 /// The Cloud Storage bucket where audit reports and evidences can be
2719 /// uploaded. The format is `gs://{bucket_name}`.
2720 GcsBucket(std::string::String),
2721 }
2722 }
2723}
2724
2725/// A framework is a collection of cloud controls and regulatory controls
2726/// that represent security best practices or industry-defined standards such as
2727/// FedRAMP or NIST.
2728#[derive(Clone, Default, PartialEq)]
2729#[non_exhaustive]
2730pub struct Framework {
2731 /// Required. Identifier. The name of the framework, in one of the following
2732 /// formats:
2733 /// `organizations/{organization}/locations/{location}/frameworks/{framework}`
2734 /// or
2735 /// `projects/{project}/locations/{location}/frameworks/{framework}`.
2736 ///
2737 /// The only supported location is `global`.
2738 pub name: std::string::String,
2739
2740 /// Output only. The major version of the framework, which is incremented in
2741 /// ascending order.
2742 pub major_revision_id: i64,
2743
2744 /// Optional. The friendly name of the framework. The maximum length is 200
2745 /// characters.
2746 pub display_name: std::string::String,
2747
2748 /// Optional. The description of the framework. The maximum length is 2000
2749 /// characters.
2750 pub description: std::string::String,
2751
2752 /// Output only. The type of framework.
2753 pub r#type: crate::model::framework::FrameworkType,
2754
2755 /// Optional. The cloud control details that are directly added without any
2756 /// grouping in the framework.
2757 pub cloud_control_details: std::vec::Vec<crate::model::CloudControlDetails>,
2758
2759 /// Optional. The category of the framework.
2760 pub category: std::vec::Vec<crate::model::FrameworkCategory>,
2761
2762 /// Output only. The cloud providers that are supported by the framework.
2763 pub supported_cloud_providers: std::vec::Vec<crate::model::CloudProvider>,
2764
2765 /// Output only. The target resource types that are supported by the framework.
2766 pub supported_target_resource_types: std::vec::Vec<crate::model::TargetResourceType>,
2767
2768 /// Output only. The supported enforcement modes of the framework.
2769 pub supported_enforcement_modes: std::vec::Vec<crate::model::EnforcementMode>,
2770
2771 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2772}
2773
2774impl Framework {
2775 /// Creates a new default instance.
2776 pub fn new() -> Self {
2777 std::default::Default::default()
2778 }
2779
2780 /// Sets the value of [name][crate::model::Framework::name].
2781 ///
2782 /// # Example
2783 /// ```ignore,no_run
2784 /// # use google_cloud_cloudsecuritycompliance_v1::model::Framework;
2785 /// # let organization_id = "organization_id";
2786 /// # let location_id = "location_id";
2787 /// # let framework_id = "framework_id";
2788 /// let x = Framework::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/frameworks/{framework_id}"));
2789 /// ```
2790 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2791 self.name = v.into();
2792 self
2793 }
2794
2795 /// Sets the value of [major_revision_id][crate::model::Framework::major_revision_id].
2796 ///
2797 /// # Example
2798 /// ```ignore,no_run
2799 /// # use google_cloud_cloudsecuritycompliance_v1::model::Framework;
2800 /// let x = Framework::new().set_major_revision_id(42);
2801 /// ```
2802 pub fn set_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2803 self.major_revision_id = v.into();
2804 self
2805 }
2806
2807 /// Sets the value of [display_name][crate::model::Framework::display_name].
2808 ///
2809 /// # Example
2810 /// ```ignore,no_run
2811 /// # use google_cloud_cloudsecuritycompliance_v1::model::Framework;
2812 /// let x = Framework::new().set_display_name("example");
2813 /// ```
2814 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2815 self.display_name = v.into();
2816 self
2817 }
2818
2819 /// Sets the value of [description][crate::model::Framework::description].
2820 ///
2821 /// # Example
2822 /// ```ignore,no_run
2823 /// # use google_cloud_cloudsecuritycompliance_v1::model::Framework;
2824 /// let x = Framework::new().set_description("example");
2825 /// ```
2826 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2827 self.description = v.into();
2828 self
2829 }
2830
2831 /// Sets the value of [r#type][crate::model::Framework::type].
2832 ///
2833 /// # Example
2834 /// ```ignore,no_run
2835 /// # use google_cloud_cloudsecuritycompliance_v1::model::Framework;
2836 /// use google_cloud_cloudsecuritycompliance_v1::model::framework::FrameworkType;
2837 /// let x0 = Framework::new().set_type(FrameworkType::BuiltIn);
2838 /// let x1 = Framework::new().set_type(FrameworkType::Custom);
2839 /// ```
2840 pub fn set_type<T: std::convert::Into<crate::model::framework::FrameworkType>>(
2841 mut self,
2842 v: T,
2843 ) -> Self {
2844 self.r#type = v.into();
2845 self
2846 }
2847
2848 /// Sets the value of [cloud_control_details][crate::model::Framework::cloud_control_details].
2849 ///
2850 /// # Example
2851 /// ```ignore,no_run
2852 /// # use google_cloud_cloudsecuritycompliance_v1::model::Framework;
2853 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDetails;
2854 /// let x = Framework::new()
2855 /// .set_cloud_control_details([
2856 /// CloudControlDetails::default()/* use setters */,
2857 /// CloudControlDetails::default()/* use (different) setters */,
2858 /// ]);
2859 /// ```
2860 pub fn set_cloud_control_details<T, V>(mut self, v: T) -> Self
2861 where
2862 T: std::iter::IntoIterator<Item = V>,
2863 V: std::convert::Into<crate::model::CloudControlDetails>,
2864 {
2865 use std::iter::Iterator;
2866 self.cloud_control_details = v.into_iter().map(|i| i.into()).collect();
2867 self
2868 }
2869
2870 /// Sets the value of [category][crate::model::Framework::category].
2871 ///
2872 /// # Example
2873 /// ```ignore,no_run
2874 /// # use google_cloud_cloudsecuritycompliance_v1::model::Framework;
2875 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkCategory;
2876 /// let x = Framework::new().set_category([
2877 /// FrameworkCategory::IndustryDefinedStandard,
2878 /// FrameworkCategory::AssuredWorkloads,
2879 /// FrameworkCategory::DataSecurity,
2880 /// ]);
2881 /// ```
2882 pub fn set_category<T, V>(mut self, v: T) -> Self
2883 where
2884 T: std::iter::IntoIterator<Item = V>,
2885 V: std::convert::Into<crate::model::FrameworkCategory>,
2886 {
2887 use std::iter::Iterator;
2888 self.category = v.into_iter().map(|i| i.into()).collect();
2889 self
2890 }
2891
2892 /// Sets the value of [supported_cloud_providers][crate::model::Framework::supported_cloud_providers].
2893 ///
2894 /// # Example
2895 /// ```ignore,no_run
2896 /// # use google_cloud_cloudsecuritycompliance_v1::model::Framework;
2897 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudProvider;
2898 /// let x = Framework::new().set_supported_cloud_providers([
2899 /// CloudProvider::Aws,
2900 /// CloudProvider::Azure,
2901 /// CloudProvider::Gcp,
2902 /// ]);
2903 /// ```
2904 pub fn set_supported_cloud_providers<T, V>(mut self, v: T) -> Self
2905 where
2906 T: std::iter::IntoIterator<Item = V>,
2907 V: std::convert::Into<crate::model::CloudProvider>,
2908 {
2909 use std::iter::Iterator;
2910 self.supported_cloud_providers = v.into_iter().map(|i| i.into()).collect();
2911 self
2912 }
2913
2914 /// Sets the value of [supported_target_resource_types][crate::model::Framework::supported_target_resource_types].
2915 ///
2916 /// # Example
2917 /// ```ignore,no_run
2918 /// # use google_cloud_cloudsecuritycompliance_v1::model::Framework;
2919 /// use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceType;
2920 /// let x = Framework::new().set_supported_target_resource_types([
2921 /// TargetResourceType::TargetResourceCrmTypeOrg,
2922 /// TargetResourceType::TargetResourceCrmTypeFolder,
2923 /// TargetResourceType::TargetResourceCrmTypeProject,
2924 /// ]);
2925 /// ```
2926 pub fn set_supported_target_resource_types<T, V>(mut self, v: T) -> Self
2927 where
2928 T: std::iter::IntoIterator<Item = V>,
2929 V: std::convert::Into<crate::model::TargetResourceType>,
2930 {
2931 use std::iter::Iterator;
2932 self.supported_target_resource_types = v.into_iter().map(|i| i.into()).collect();
2933 self
2934 }
2935
2936 /// Sets the value of [supported_enforcement_modes][crate::model::Framework::supported_enforcement_modes].
2937 ///
2938 /// # Example
2939 /// ```ignore,no_run
2940 /// # use google_cloud_cloudsecuritycompliance_v1::model::Framework;
2941 /// use google_cloud_cloudsecuritycompliance_v1::model::EnforcementMode;
2942 /// let x = Framework::new().set_supported_enforcement_modes([
2943 /// EnforcementMode::Preventive,
2944 /// EnforcementMode::Detective,
2945 /// EnforcementMode::Audit,
2946 /// ]);
2947 /// ```
2948 pub fn set_supported_enforcement_modes<T, V>(mut self, v: T) -> Self
2949 where
2950 T: std::iter::IntoIterator<Item = V>,
2951 V: std::convert::Into<crate::model::EnforcementMode>,
2952 {
2953 use std::iter::Iterator;
2954 self.supported_enforcement_modes = v.into_iter().map(|i| i.into()).collect();
2955 self
2956 }
2957}
2958
2959impl wkt::message::Message for Framework {
2960 fn typename() -> &'static str {
2961 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.Framework"
2962 }
2963}
2964
2965/// Defines additional types related to [Framework].
2966pub mod framework {
2967 #[allow(unused_imports)]
2968 use super::*;
2969
2970 /// The type of framework.
2971 ///
2972 /// # Working with unknown values
2973 ///
2974 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2975 /// additional enum variants at any time. Adding new variants is not considered
2976 /// a breaking change. Applications should write their code in anticipation of:
2977 ///
2978 /// - New values appearing in future releases of the client library, **and**
2979 /// - New values received dynamically, without application changes.
2980 ///
2981 /// Please consult the [Working with enums] section in the user guide for some
2982 /// guidelines.
2983 ///
2984 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2985 #[derive(Clone, Debug, PartialEq)]
2986 #[non_exhaustive]
2987 pub enum FrameworkType {
2988 /// Default value. This value is unused.
2989 Unspecified,
2990 /// A framework that's provided and managed by Google.
2991 BuiltIn,
2992 /// A framework that's created and managed by you.
2993 Custom,
2994 /// If set, the enum was initialized with an unknown value.
2995 ///
2996 /// Applications can examine the value using [FrameworkType::value] or
2997 /// [FrameworkType::name].
2998 UnknownValue(framework_type::UnknownValue),
2999 }
3000
3001 #[doc(hidden)]
3002 pub mod framework_type {
3003 #[allow(unused_imports)]
3004 use super::*;
3005 #[derive(Clone, Debug, PartialEq)]
3006 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3007 }
3008
3009 impl FrameworkType {
3010 /// Gets the enum value.
3011 ///
3012 /// Returns `None` if the enum contains an unknown value deserialized from
3013 /// the string representation of enums.
3014 pub fn value(&self) -> std::option::Option<i32> {
3015 match self {
3016 Self::Unspecified => std::option::Option::Some(0),
3017 Self::BuiltIn => std::option::Option::Some(1),
3018 Self::Custom => std::option::Option::Some(2),
3019 Self::UnknownValue(u) => u.0.value(),
3020 }
3021 }
3022
3023 /// Gets the enum value as a string.
3024 ///
3025 /// Returns `None` if the enum contains an unknown value deserialized from
3026 /// the integer representation of enums.
3027 pub fn name(&self) -> std::option::Option<&str> {
3028 match self {
3029 Self::Unspecified => std::option::Option::Some("FRAMEWORK_TYPE_UNSPECIFIED"),
3030 Self::BuiltIn => std::option::Option::Some("BUILT_IN"),
3031 Self::Custom => std::option::Option::Some("CUSTOM"),
3032 Self::UnknownValue(u) => u.0.name(),
3033 }
3034 }
3035 }
3036
3037 impl std::default::Default for FrameworkType {
3038 fn default() -> Self {
3039 use std::convert::From;
3040 Self::from(0)
3041 }
3042 }
3043
3044 impl std::fmt::Display for FrameworkType {
3045 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3046 wkt::internal::display_enum(f, self.name(), self.value())
3047 }
3048 }
3049
3050 impl std::convert::From<i32> for FrameworkType {
3051 fn from(value: i32) -> Self {
3052 match value {
3053 0 => Self::Unspecified,
3054 1 => Self::BuiltIn,
3055 2 => Self::Custom,
3056 _ => Self::UnknownValue(framework_type::UnknownValue(
3057 wkt::internal::UnknownEnumValue::Integer(value),
3058 )),
3059 }
3060 }
3061 }
3062
3063 impl std::convert::From<&str> for FrameworkType {
3064 fn from(value: &str) -> Self {
3065 use std::string::ToString;
3066 match value {
3067 "FRAMEWORK_TYPE_UNSPECIFIED" => Self::Unspecified,
3068 "BUILT_IN" => Self::BuiltIn,
3069 "CUSTOM" => Self::Custom,
3070 _ => Self::UnknownValue(framework_type::UnknownValue(
3071 wkt::internal::UnknownEnumValue::String(value.to_string()),
3072 )),
3073 }
3074 }
3075 }
3076
3077 impl serde::ser::Serialize for FrameworkType {
3078 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3079 where
3080 S: serde::Serializer,
3081 {
3082 match self {
3083 Self::Unspecified => serializer.serialize_i32(0),
3084 Self::BuiltIn => serializer.serialize_i32(1),
3085 Self::Custom => serializer.serialize_i32(2),
3086 Self::UnknownValue(u) => u.0.serialize(serializer),
3087 }
3088 }
3089 }
3090
3091 impl<'de> serde::de::Deserialize<'de> for FrameworkType {
3092 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3093 where
3094 D: serde::Deserializer<'de>,
3095 {
3096 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FrameworkType>::new(
3097 ".google.cloud.cloudsecuritycompliance.v1.Framework.FrameworkType",
3098 ))
3099 }
3100 }
3101}
3102
3103/// The details of a cloud control.
3104#[derive(Clone, Default, PartialEq)]
3105#[non_exhaustive]
3106pub struct CloudControlDetails {
3107 /// Required. The name of the cloud control, in one of the following formats:
3108 /// `organizations/{organization}/locations/{location}/cloudControls/{cloud_control}`
3109 /// or
3110 /// `projects/{project}/locations/{location}/cloudControls/{cloud_control}`.
3111 ///
3112 /// The only supported location is `global`.
3113 pub name: std::string::String,
3114
3115 /// Required. The major version of the cloud control.
3116 pub major_revision_id: i64,
3117
3118 /// Optional. Parameters are key-value pairs that let you provide your custom
3119 /// location requirements, environment requirements, or other settings that are
3120 /// relevant to the cloud control. An example parameter is
3121 /// `{"name": "location","value": "us-west-1"}`.
3122 pub parameters: std::vec::Vec<crate::model::Parameter>,
3123
3124 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3125}
3126
3127impl CloudControlDetails {
3128 /// Creates a new default instance.
3129 pub fn new() -> Self {
3130 std::default::Default::default()
3131 }
3132
3133 /// Sets the value of [name][crate::model::CloudControlDetails::name].
3134 ///
3135 /// # Example
3136 /// ```ignore,no_run
3137 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDetails;
3138 /// let x = CloudControlDetails::new().set_name("example");
3139 /// ```
3140 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3141 self.name = v.into();
3142 self
3143 }
3144
3145 /// Sets the value of [major_revision_id][crate::model::CloudControlDetails::major_revision_id].
3146 ///
3147 /// # Example
3148 /// ```ignore,no_run
3149 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDetails;
3150 /// let x = CloudControlDetails::new().set_major_revision_id(42);
3151 /// ```
3152 pub fn set_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3153 self.major_revision_id = v.into();
3154 self
3155 }
3156
3157 /// Sets the value of [parameters][crate::model::CloudControlDetails::parameters].
3158 ///
3159 /// # Example
3160 /// ```ignore,no_run
3161 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDetails;
3162 /// use google_cloud_cloudsecuritycompliance_v1::model::Parameter;
3163 /// let x = CloudControlDetails::new()
3164 /// .set_parameters([
3165 /// Parameter::default()/* use setters */,
3166 /// Parameter::default()/* use (different) setters */,
3167 /// ]);
3168 /// ```
3169 pub fn set_parameters<T, V>(mut self, v: T) -> Self
3170 where
3171 T: std::iter::IntoIterator<Item = V>,
3172 V: std::convert::Into<crate::model::Parameter>,
3173 {
3174 use std::iter::Iterator;
3175 self.parameters = v.into_iter().map(|i| i.into()).collect();
3176 self
3177 }
3178}
3179
3180impl wkt::message::Message for CloudControlDetails {
3181 fn typename() -> &'static str {
3182 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControlDetails"
3183 }
3184}
3185
3186/// The reference of a framework, in one of the following formats:
3187///
3188/// - `organizations/{organization}/locations/{location}/frameworks/{framework}`
3189/// - `projects/{project}/locations/{location}/frameworks/{framework}`.
3190///
3191/// The only supported location is `global`.
3192#[derive(Clone, Default, PartialEq)]
3193#[non_exhaustive]
3194pub struct FrameworkReference {
3195 /// Required. The major version of the framework. If not specified, the version
3196 /// corresponds to the latest version of the framework.
3197 pub framework: std::string::String,
3198
3199 /// Optional. The major version of the framework. If not specified, the version
3200 /// corresponds to the latest version of the framework.
3201 pub major_revision_id: std::option::Option<i64>,
3202
3203 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3204}
3205
3206impl FrameworkReference {
3207 /// Creates a new default instance.
3208 pub fn new() -> Self {
3209 std::default::Default::default()
3210 }
3211
3212 /// Sets the value of [framework][crate::model::FrameworkReference::framework].
3213 ///
3214 /// # Example
3215 /// ```ignore,no_run
3216 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkReference;
3217 /// # let organization_id = "organization_id";
3218 /// # let location_id = "location_id";
3219 /// # let framework_id = "framework_id";
3220 /// let x = FrameworkReference::new().set_framework(format!("organizations/{organization_id}/locations/{location_id}/frameworks/{framework_id}"));
3221 /// ```
3222 pub fn set_framework<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3223 self.framework = v.into();
3224 self
3225 }
3226
3227 /// Sets the value of [major_revision_id][crate::model::FrameworkReference::major_revision_id].
3228 ///
3229 /// # Example
3230 /// ```ignore,no_run
3231 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkReference;
3232 /// let x = FrameworkReference::new().set_major_revision_id(42);
3233 /// ```
3234 pub fn set_major_revision_id<T>(mut self, v: T) -> Self
3235 where
3236 T: std::convert::Into<i64>,
3237 {
3238 self.major_revision_id = std::option::Option::Some(v.into());
3239 self
3240 }
3241
3242 /// Sets or clears the value of [major_revision_id][crate::model::FrameworkReference::major_revision_id].
3243 ///
3244 /// # Example
3245 /// ```ignore,no_run
3246 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkReference;
3247 /// let x = FrameworkReference::new().set_or_clear_major_revision_id(Some(42));
3248 /// let x = FrameworkReference::new().set_or_clear_major_revision_id(None::<i32>);
3249 /// ```
3250 pub fn set_or_clear_major_revision_id<T>(mut self, v: std::option::Option<T>) -> Self
3251 where
3252 T: std::convert::Into<i64>,
3253 {
3254 self.major_revision_id = v.map(|x| x.into());
3255 self
3256 }
3257}
3258
3259impl wkt::message::Message for FrameworkReference {
3260 fn typename() -> &'static str {
3261 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FrameworkReference"
3262 }
3263}
3264
3265/// Parameters are key-value pairs that let you provide your custom location
3266/// requirements, environment requirements, or other settings that are
3267/// relevant to the cloud control.
3268#[derive(Clone, Default, PartialEq)]
3269#[non_exhaustive]
3270pub struct Parameter {
3271 /// Required. The name or key of the parameter.
3272 pub name: std::string::String,
3273
3274 /// Required. The value of the parameter.
3275 pub parameter_value: std::option::Option<std::boxed::Box<crate::model::ParamValue>>,
3276
3277 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3278}
3279
3280impl Parameter {
3281 /// Creates a new default instance.
3282 pub fn new() -> Self {
3283 std::default::Default::default()
3284 }
3285
3286 /// Sets the value of [name][crate::model::Parameter::name].
3287 ///
3288 /// # Example
3289 /// ```ignore,no_run
3290 /// # use google_cloud_cloudsecuritycompliance_v1::model::Parameter;
3291 /// let x = Parameter::new().set_name("example");
3292 /// ```
3293 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3294 self.name = v.into();
3295 self
3296 }
3297
3298 /// Sets the value of [parameter_value][crate::model::Parameter::parameter_value].
3299 ///
3300 /// # Example
3301 /// ```ignore,no_run
3302 /// # use google_cloud_cloudsecuritycompliance_v1::model::Parameter;
3303 /// use google_cloud_cloudsecuritycompliance_v1::model::ParamValue;
3304 /// let x = Parameter::new().set_parameter_value(ParamValue::default()/* use setters */);
3305 /// ```
3306 pub fn set_parameter_value<T>(mut self, v: T) -> Self
3307 where
3308 T: std::convert::Into<crate::model::ParamValue>,
3309 {
3310 self.parameter_value = std::option::Option::Some(std::boxed::Box::new(v.into()));
3311 self
3312 }
3313
3314 /// Sets or clears the value of [parameter_value][crate::model::Parameter::parameter_value].
3315 ///
3316 /// # Example
3317 /// ```ignore,no_run
3318 /// # use google_cloud_cloudsecuritycompliance_v1::model::Parameter;
3319 /// use google_cloud_cloudsecuritycompliance_v1::model::ParamValue;
3320 /// let x = Parameter::new().set_or_clear_parameter_value(Some(ParamValue::default()/* use setters */));
3321 /// let x = Parameter::new().set_or_clear_parameter_value(None::<ParamValue>);
3322 /// ```
3323 pub fn set_or_clear_parameter_value<T>(mut self, v: std::option::Option<T>) -> Self
3324 where
3325 T: std::convert::Into<crate::model::ParamValue>,
3326 {
3327 self.parameter_value = v.map(|x| std::boxed::Box::new(x.into()));
3328 self
3329 }
3330}
3331
3332impl wkt::message::Message for Parameter {
3333 fn typename() -> &'static str {
3334 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.Parameter"
3335 }
3336}
3337
3338/// A cloud control is a set of rules and associated metadata that you can
3339/// use to define your organization's security or compliance intent.
3340#[derive(Clone, Default, PartialEq)]
3341#[non_exhaustive]
3342pub struct CloudControl {
3343 /// Required. Identifier. The name of the cloud control, in either of the
3344 /// formats:
3345 /// `organizations/{organization}/locations/{location}/cloudControls/{cloud_control}`
3346 /// or
3347 /// `projects/{project}/locations/{location}/cloudControls/{cloud_control}`.
3348 ///
3349 /// The only supported location is `global`.
3350 pub name: std::string::String,
3351
3352 /// Output only. The major version of the cloud control, which is incremented
3353 /// in ascending order.
3354 pub major_revision_id: i64,
3355
3356 /// Optional. A description of the cloud control. The maximum length is 2000
3357 /// characters.
3358 pub description: std::string::String,
3359
3360 /// Optional. The friendly name of the cloud control. The maximum length is 200
3361 /// characters.
3362 pub display_name: std::string::String,
3363
3364 /// Output only. The supported enforcement modes for the cloud control.
3365 pub supported_enforcement_modes: std::vec::Vec<crate::model::EnforcementMode>,
3366
3367 /// Optional. The parameter specifications for the cloud control.
3368 pub parameter_spec: std::vec::Vec<crate::model::ParameterSpec>,
3369
3370 /// Optional. The rules that you can enforce to meet your security or
3371 /// compliance intent.
3372 pub rules: std::vec::Vec<crate::model::Rule>,
3373
3374 /// Optional. The severity of the findings that are generated by the cloud
3375 /// control.
3376 pub severity: crate::model::Severity,
3377
3378 /// Optional. The finding category for the cloud control findings. The maximum
3379 /// length is 255 characters.
3380 pub finding_category: std::string::String,
3381
3382 /// Optional. The supported cloud providers.
3383 pub supported_cloud_providers: std::vec::Vec<crate::model::CloudProvider>,
3384
3385 /// Output only. The frameworks that include this cloud control.
3386 pub related_frameworks: std::vec::Vec<std::string::String>,
3387
3388 /// Optional. The remediation steps for the cloud control findings. The
3389 /// maximum length is 400 characters.
3390 pub remediation_steps: std::string::String,
3391
3392 /// Optional. The categories for the cloud control.
3393 pub categories: std::vec::Vec<crate::model::CloudControlCategory>,
3394
3395 /// Output only. The time that the cloud control was last updated.
3396 /// `create_time` is used because a new cloud control is created
3397 /// whenever an existing cloud control is updated.
3398 pub create_time: std::option::Option<wkt::Timestamp>,
3399
3400 /// Optional. The target resource types that are supported by the cloud
3401 /// control.
3402 pub supported_target_resource_types: std::vec::Vec<crate::model::TargetResourceType>,
3403
3404 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3405}
3406
3407impl CloudControl {
3408 /// Creates a new default instance.
3409 pub fn new() -> Self {
3410 std::default::Default::default()
3411 }
3412
3413 /// Sets the value of [name][crate::model::CloudControl::name].
3414 ///
3415 /// # Example
3416 /// ```ignore,no_run
3417 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3418 /// # let organization_id = "organization_id";
3419 /// # let location_id = "location_id";
3420 /// # let cloud_control_id = "cloud_control_id";
3421 /// let x = CloudControl::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/cloudControls/{cloud_control_id}"));
3422 /// ```
3423 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3424 self.name = v.into();
3425 self
3426 }
3427
3428 /// Sets the value of [major_revision_id][crate::model::CloudControl::major_revision_id].
3429 ///
3430 /// # Example
3431 /// ```ignore,no_run
3432 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3433 /// let x = CloudControl::new().set_major_revision_id(42);
3434 /// ```
3435 pub fn set_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3436 self.major_revision_id = v.into();
3437 self
3438 }
3439
3440 /// Sets the value of [description][crate::model::CloudControl::description].
3441 ///
3442 /// # Example
3443 /// ```ignore,no_run
3444 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3445 /// let x = CloudControl::new().set_description("example");
3446 /// ```
3447 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3448 self.description = v.into();
3449 self
3450 }
3451
3452 /// Sets the value of [display_name][crate::model::CloudControl::display_name].
3453 ///
3454 /// # Example
3455 /// ```ignore,no_run
3456 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3457 /// let x = CloudControl::new().set_display_name("example");
3458 /// ```
3459 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3460 self.display_name = v.into();
3461 self
3462 }
3463
3464 /// Sets the value of [supported_enforcement_modes][crate::model::CloudControl::supported_enforcement_modes].
3465 ///
3466 /// # Example
3467 /// ```ignore,no_run
3468 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3469 /// use google_cloud_cloudsecuritycompliance_v1::model::EnforcementMode;
3470 /// let x = CloudControl::new().set_supported_enforcement_modes([
3471 /// EnforcementMode::Preventive,
3472 /// EnforcementMode::Detective,
3473 /// EnforcementMode::Audit,
3474 /// ]);
3475 /// ```
3476 pub fn set_supported_enforcement_modes<T, V>(mut self, v: T) -> Self
3477 where
3478 T: std::iter::IntoIterator<Item = V>,
3479 V: std::convert::Into<crate::model::EnforcementMode>,
3480 {
3481 use std::iter::Iterator;
3482 self.supported_enforcement_modes = v.into_iter().map(|i| i.into()).collect();
3483 self
3484 }
3485
3486 /// Sets the value of [parameter_spec][crate::model::CloudControl::parameter_spec].
3487 ///
3488 /// # Example
3489 /// ```ignore,no_run
3490 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3491 /// use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
3492 /// let x = CloudControl::new()
3493 /// .set_parameter_spec([
3494 /// ParameterSpec::default()/* use setters */,
3495 /// ParameterSpec::default()/* use (different) setters */,
3496 /// ]);
3497 /// ```
3498 pub fn set_parameter_spec<T, V>(mut self, v: T) -> Self
3499 where
3500 T: std::iter::IntoIterator<Item = V>,
3501 V: std::convert::Into<crate::model::ParameterSpec>,
3502 {
3503 use std::iter::Iterator;
3504 self.parameter_spec = v.into_iter().map(|i| i.into()).collect();
3505 self
3506 }
3507
3508 /// Sets the value of [rules][crate::model::CloudControl::rules].
3509 ///
3510 /// # Example
3511 /// ```ignore,no_run
3512 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3513 /// use google_cloud_cloudsecuritycompliance_v1::model::Rule;
3514 /// let x = CloudControl::new()
3515 /// .set_rules([
3516 /// Rule::default()/* use setters */,
3517 /// Rule::default()/* use (different) setters */,
3518 /// ]);
3519 /// ```
3520 pub fn set_rules<T, V>(mut self, v: T) -> Self
3521 where
3522 T: std::iter::IntoIterator<Item = V>,
3523 V: std::convert::Into<crate::model::Rule>,
3524 {
3525 use std::iter::Iterator;
3526 self.rules = v.into_iter().map(|i| i.into()).collect();
3527 self
3528 }
3529
3530 /// Sets the value of [severity][crate::model::CloudControl::severity].
3531 ///
3532 /// # Example
3533 /// ```ignore,no_run
3534 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3535 /// use google_cloud_cloudsecuritycompliance_v1::model::Severity;
3536 /// let x0 = CloudControl::new().set_severity(Severity::Critical);
3537 /// let x1 = CloudControl::new().set_severity(Severity::High);
3538 /// let x2 = CloudControl::new().set_severity(Severity::Medium);
3539 /// ```
3540 pub fn set_severity<T: std::convert::Into<crate::model::Severity>>(mut self, v: T) -> Self {
3541 self.severity = v.into();
3542 self
3543 }
3544
3545 /// Sets the value of [finding_category][crate::model::CloudControl::finding_category].
3546 ///
3547 /// # Example
3548 /// ```ignore,no_run
3549 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3550 /// let x = CloudControl::new().set_finding_category("example");
3551 /// ```
3552 pub fn set_finding_category<T: std::convert::Into<std::string::String>>(
3553 mut self,
3554 v: T,
3555 ) -> Self {
3556 self.finding_category = v.into();
3557 self
3558 }
3559
3560 /// Sets the value of [supported_cloud_providers][crate::model::CloudControl::supported_cloud_providers].
3561 ///
3562 /// # Example
3563 /// ```ignore,no_run
3564 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3565 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudProvider;
3566 /// let x = CloudControl::new().set_supported_cloud_providers([
3567 /// CloudProvider::Aws,
3568 /// CloudProvider::Azure,
3569 /// CloudProvider::Gcp,
3570 /// ]);
3571 /// ```
3572 pub fn set_supported_cloud_providers<T, V>(mut self, v: T) -> Self
3573 where
3574 T: std::iter::IntoIterator<Item = V>,
3575 V: std::convert::Into<crate::model::CloudProvider>,
3576 {
3577 use std::iter::Iterator;
3578 self.supported_cloud_providers = v.into_iter().map(|i| i.into()).collect();
3579 self
3580 }
3581
3582 /// Sets the value of [related_frameworks][crate::model::CloudControl::related_frameworks].
3583 ///
3584 /// # Example
3585 /// ```ignore,no_run
3586 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3587 /// let x = CloudControl::new().set_related_frameworks(["a", "b", "c"]);
3588 /// ```
3589 pub fn set_related_frameworks<T, V>(mut self, v: T) -> Self
3590 where
3591 T: std::iter::IntoIterator<Item = V>,
3592 V: std::convert::Into<std::string::String>,
3593 {
3594 use std::iter::Iterator;
3595 self.related_frameworks = v.into_iter().map(|i| i.into()).collect();
3596 self
3597 }
3598
3599 /// Sets the value of [remediation_steps][crate::model::CloudControl::remediation_steps].
3600 ///
3601 /// # Example
3602 /// ```ignore,no_run
3603 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3604 /// let x = CloudControl::new().set_remediation_steps("example");
3605 /// ```
3606 pub fn set_remediation_steps<T: std::convert::Into<std::string::String>>(
3607 mut self,
3608 v: T,
3609 ) -> Self {
3610 self.remediation_steps = v.into();
3611 self
3612 }
3613
3614 /// Sets the value of [categories][crate::model::CloudControl::categories].
3615 ///
3616 /// # Example
3617 /// ```ignore,no_run
3618 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3619 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlCategory;
3620 /// let x = CloudControl::new().set_categories([
3621 /// CloudControlCategory::CcCategoryInfrastructure,
3622 /// CloudControlCategory::CcCategoryArtificialIntelligence,
3623 /// CloudControlCategory::CcCategoryPhysicalSecurity,
3624 /// ]);
3625 /// ```
3626 pub fn set_categories<T, V>(mut self, v: T) -> Self
3627 where
3628 T: std::iter::IntoIterator<Item = V>,
3629 V: std::convert::Into<crate::model::CloudControlCategory>,
3630 {
3631 use std::iter::Iterator;
3632 self.categories = v.into_iter().map(|i| i.into()).collect();
3633 self
3634 }
3635
3636 /// Sets the value of [create_time][crate::model::CloudControl::create_time].
3637 ///
3638 /// # Example
3639 /// ```ignore,no_run
3640 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3641 /// use wkt::Timestamp;
3642 /// let x = CloudControl::new().set_create_time(Timestamp::default()/* use setters */);
3643 /// ```
3644 pub fn set_create_time<T>(mut self, v: T) -> Self
3645 where
3646 T: std::convert::Into<wkt::Timestamp>,
3647 {
3648 self.create_time = std::option::Option::Some(v.into());
3649 self
3650 }
3651
3652 /// Sets or clears the value of [create_time][crate::model::CloudControl::create_time].
3653 ///
3654 /// # Example
3655 /// ```ignore,no_run
3656 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3657 /// use wkt::Timestamp;
3658 /// let x = CloudControl::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3659 /// let x = CloudControl::new().set_or_clear_create_time(None::<Timestamp>);
3660 /// ```
3661 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3662 where
3663 T: std::convert::Into<wkt::Timestamp>,
3664 {
3665 self.create_time = v.map(|x| x.into());
3666 self
3667 }
3668
3669 /// Sets the value of [supported_target_resource_types][crate::model::CloudControl::supported_target_resource_types].
3670 ///
3671 /// # Example
3672 /// ```ignore,no_run
3673 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
3674 /// use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceType;
3675 /// let x = CloudControl::new().set_supported_target_resource_types([
3676 /// TargetResourceType::TargetResourceCrmTypeOrg,
3677 /// TargetResourceType::TargetResourceCrmTypeFolder,
3678 /// TargetResourceType::TargetResourceCrmTypeProject,
3679 /// ]);
3680 /// ```
3681 pub fn set_supported_target_resource_types<T, V>(mut self, v: T) -> Self
3682 where
3683 T: std::iter::IntoIterator<Item = V>,
3684 V: std::convert::Into<crate::model::TargetResourceType>,
3685 {
3686 use std::iter::Iterator;
3687 self.supported_target_resource_types = v.into_iter().map(|i| i.into()).collect();
3688 self
3689 }
3690}
3691
3692impl wkt::message::Message for CloudControl {
3693 fn typename() -> &'static str {
3694 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControl"
3695 }
3696}
3697
3698/// Defines additional types related to [CloudControl].
3699pub mod cloud_control {
3700 #[allow(unused_imports)]
3701 use super::*;
3702
3703 /// The type of cloud control.
3704 ///
3705 /// # Working with unknown values
3706 ///
3707 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3708 /// additional enum variants at any time. Adding new variants is not considered
3709 /// a breaking change. Applications should write their code in anticipation of:
3710 ///
3711 /// - New values appearing in future releases of the client library, **and**
3712 /// - New values received dynamically, without application changes.
3713 ///
3714 /// Please consult the [Working with enums] section in the user guide for some
3715 /// guidelines.
3716 ///
3717 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3718 #[derive(Clone, Debug, PartialEq)]
3719 #[non_exhaustive]
3720 pub enum Type {
3721 /// Default value. This value is unused.
3722 Unspecified,
3723 /// A cloud control that's created and managed by you.
3724 Custom,
3725 /// A cloud control that's provided and managed by Google.
3726 BuiltIn,
3727 /// If set, the enum was initialized with an unknown value.
3728 ///
3729 /// Applications can examine the value using [Type::value] or
3730 /// [Type::name].
3731 UnknownValue(r#type::UnknownValue),
3732 }
3733
3734 #[doc(hidden)]
3735 pub mod r#type {
3736 #[allow(unused_imports)]
3737 use super::*;
3738 #[derive(Clone, Debug, PartialEq)]
3739 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3740 }
3741
3742 impl Type {
3743 /// Gets the enum value.
3744 ///
3745 /// Returns `None` if the enum contains an unknown value deserialized from
3746 /// the string representation of enums.
3747 pub fn value(&self) -> std::option::Option<i32> {
3748 match self {
3749 Self::Unspecified => std::option::Option::Some(0),
3750 Self::Custom => std::option::Option::Some(1),
3751 Self::BuiltIn => std::option::Option::Some(2),
3752 Self::UnknownValue(u) => u.0.value(),
3753 }
3754 }
3755
3756 /// Gets the enum value as a string.
3757 ///
3758 /// Returns `None` if the enum contains an unknown value deserialized from
3759 /// the integer representation of enums.
3760 pub fn name(&self) -> std::option::Option<&str> {
3761 match self {
3762 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
3763 Self::Custom => std::option::Option::Some("CUSTOM"),
3764 Self::BuiltIn => std::option::Option::Some("BUILT_IN"),
3765 Self::UnknownValue(u) => u.0.name(),
3766 }
3767 }
3768 }
3769
3770 impl std::default::Default for Type {
3771 fn default() -> Self {
3772 use std::convert::From;
3773 Self::from(0)
3774 }
3775 }
3776
3777 impl std::fmt::Display for Type {
3778 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3779 wkt::internal::display_enum(f, self.name(), self.value())
3780 }
3781 }
3782
3783 impl std::convert::From<i32> for Type {
3784 fn from(value: i32) -> Self {
3785 match value {
3786 0 => Self::Unspecified,
3787 1 => Self::Custom,
3788 2 => Self::BuiltIn,
3789 _ => Self::UnknownValue(r#type::UnknownValue(
3790 wkt::internal::UnknownEnumValue::Integer(value),
3791 )),
3792 }
3793 }
3794 }
3795
3796 impl std::convert::From<&str> for Type {
3797 fn from(value: &str) -> Self {
3798 use std::string::ToString;
3799 match value {
3800 "TYPE_UNSPECIFIED" => Self::Unspecified,
3801 "CUSTOM" => Self::Custom,
3802 "BUILT_IN" => Self::BuiltIn,
3803 _ => Self::UnknownValue(r#type::UnknownValue(
3804 wkt::internal::UnknownEnumValue::String(value.to_string()),
3805 )),
3806 }
3807 }
3808 }
3809
3810 impl serde::ser::Serialize for Type {
3811 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3812 where
3813 S: serde::Serializer,
3814 {
3815 match self {
3816 Self::Unspecified => serializer.serialize_i32(0),
3817 Self::Custom => serializer.serialize_i32(1),
3818 Self::BuiltIn => serializer.serialize_i32(2),
3819 Self::UnknownValue(u) => u.0.serialize(serializer),
3820 }
3821 }
3822 }
3823
3824 impl<'de> serde::de::Deserialize<'de> for Type {
3825 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3826 where
3827 D: serde::Deserializer<'de>,
3828 {
3829 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
3830 ".google.cloud.cloudsecuritycompliance.v1.CloudControl.Type",
3831 ))
3832 }
3833 }
3834}
3835
3836/// The parameter specification for the cloud control.
3837#[derive(Clone, Default, PartialEq)]
3838#[non_exhaustive]
3839pub struct ParameterSpec {
3840 /// Required. The name of the parameter.
3841 pub name: std::string::String,
3842
3843 /// Optional. The friendly name of the parameter. The maximum length is 200
3844 /// characters.
3845 pub display_name: std::string::String,
3846
3847 /// Optional. The description of the parameter. The maximum length is 2000
3848 /// characters.
3849 pub description: std::string::String,
3850
3851 /// Required. Whether the parameter is required.
3852 pub is_required: bool,
3853
3854 /// Required. The parameter value type.
3855 pub value_type: crate::model::parameter_spec::ValueType,
3856
3857 /// Optional. The default value of the parameter.
3858 pub default_value: std::option::Option<crate::model::ParamValue>,
3859
3860 /// Optional. The list of parameter substitutions.
3861 pub substitution_rules: std::vec::Vec<crate::model::ParameterSubstitutionRule>,
3862
3863 /// Optional. The parameter specification for `oneOf` attributes.
3864 pub sub_parameters: std::vec::Vec<crate::model::ParameterSpec>,
3865
3866 /// Optional. The permitted set of values for the parameter.
3867 pub validation: std::option::Option<crate::model::Validation>,
3868
3869 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3870}
3871
3872impl ParameterSpec {
3873 /// Creates a new default instance.
3874 pub fn new() -> Self {
3875 std::default::Default::default()
3876 }
3877
3878 /// Sets the value of [name][crate::model::ParameterSpec::name].
3879 ///
3880 /// # Example
3881 /// ```ignore,no_run
3882 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
3883 /// let x = ParameterSpec::new().set_name("example");
3884 /// ```
3885 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3886 self.name = v.into();
3887 self
3888 }
3889
3890 /// Sets the value of [display_name][crate::model::ParameterSpec::display_name].
3891 ///
3892 /// # Example
3893 /// ```ignore,no_run
3894 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
3895 /// let x = ParameterSpec::new().set_display_name("example");
3896 /// ```
3897 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3898 self.display_name = v.into();
3899 self
3900 }
3901
3902 /// Sets the value of [description][crate::model::ParameterSpec::description].
3903 ///
3904 /// # Example
3905 /// ```ignore,no_run
3906 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
3907 /// let x = ParameterSpec::new().set_description("example");
3908 /// ```
3909 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3910 self.description = v.into();
3911 self
3912 }
3913
3914 /// Sets the value of [is_required][crate::model::ParameterSpec::is_required].
3915 ///
3916 /// # Example
3917 /// ```ignore,no_run
3918 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
3919 /// let x = ParameterSpec::new().set_is_required(true);
3920 /// ```
3921 pub fn set_is_required<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3922 self.is_required = v.into();
3923 self
3924 }
3925
3926 /// Sets the value of [value_type][crate::model::ParameterSpec::value_type].
3927 ///
3928 /// # Example
3929 /// ```ignore,no_run
3930 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
3931 /// use google_cloud_cloudsecuritycompliance_v1::model::parameter_spec::ValueType;
3932 /// let x0 = ParameterSpec::new().set_value_type(ValueType::String);
3933 /// let x1 = ParameterSpec::new().set_value_type(ValueType::Boolean);
3934 /// let x2 = ParameterSpec::new().set_value_type(ValueType::Stringlist);
3935 /// ```
3936 pub fn set_value_type<T: std::convert::Into<crate::model::parameter_spec::ValueType>>(
3937 mut self,
3938 v: T,
3939 ) -> Self {
3940 self.value_type = v.into();
3941 self
3942 }
3943
3944 /// Sets the value of [default_value][crate::model::ParameterSpec::default_value].
3945 ///
3946 /// # Example
3947 /// ```ignore,no_run
3948 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
3949 /// use google_cloud_cloudsecuritycompliance_v1::model::ParamValue;
3950 /// let x = ParameterSpec::new().set_default_value(ParamValue::default()/* use setters */);
3951 /// ```
3952 pub fn set_default_value<T>(mut self, v: T) -> Self
3953 where
3954 T: std::convert::Into<crate::model::ParamValue>,
3955 {
3956 self.default_value = std::option::Option::Some(v.into());
3957 self
3958 }
3959
3960 /// Sets or clears the value of [default_value][crate::model::ParameterSpec::default_value].
3961 ///
3962 /// # Example
3963 /// ```ignore,no_run
3964 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
3965 /// use google_cloud_cloudsecuritycompliance_v1::model::ParamValue;
3966 /// let x = ParameterSpec::new().set_or_clear_default_value(Some(ParamValue::default()/* use setters */));
3967 /// let x = ParameterSpec::new().set_or_clear_default_value(None::<ParamValue>);
3968 /// ```
3969 pub fn set_or_clear_default_value<T>(mut self, v: std::option::Option<T>) -> Self
3970 where
3971 T: std::convert::Into<crate::model::ParamValue>,
3972 {
3973 self.default_value = v.map(|x| x.into());
3974 self
3975 }
3976
3977 /// Sets the value of [substitution_rules][crate::model::ParameterSpec::substitution_rules].
3978 ///
3979 /// # Example
3980 /// ```ignore,no_run
3981 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
3982 /// use google_cloud_cloudsecuritycompliance_v1::model::ParameterSubstitutionRule;
3983 /// let x = ParameterSpec::new()
3984 /// .set_substitution_rules([
3985 /// ParameterSubstitutionRule::default()/* use setters */,
3986 /// ParameterSubstitutionRule::default()/* use (different) setters */,
3987 /// ]);
3988 /// ```
3989 pub fn set_substitution_rules<T, V>(mut self, v: T) -> Self
3990 where
3991 T: std::iter::IntoIterator<Item = V>,
3992 V: std::convert::Into<crate::model::ParameterSubstitutionRule>,
3993 {
3994 use std::iter::Iterator;
3995 self.substitution_rules = v.into_iter().map(|i| i.into()).collect();
3996 self
3997 }
3998
3999 /// Sets the value of [sub_parameters][crate::model::ParameterSpec::sub_parameters].
4000 ///
4001 /// # Example
4002 /// ```ignore,no_run
4003 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
4004 /// let x = ParameterSpec::new()
4005 /// .set_sub_parameters([
4006 /// ParameterSpec::default()/* use setters */,
4007 /// ParameterSpec::default()/* use (different) setters */,
4008 /// ]);
4009 /// ```
4010 pub fn set_sub_parameters<T, V>(mut self, v: T) -> Self
4011 where
4012 T: std::iter::IntoIterator<Item = V>,
4013 V: std::convert::Into<crate::model::ParameterSpec>,
4014 {
4015 use std::iter::Iterator;
4016 self.sub_parameters = v.into_iter().map(|i| i.into()).collect();
4017 self
4018 }
4019
4020 /// Sets the value of [validation][crate::model::ParameterSpec::validation].
4021 ///
4022 /// # Example
4023 /// ```ignore,no_run
4024 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
4025 /// use google_cloud_cloudsecuritycompliance_v1::model::Validation;
4026 /// let x = ParameterSpec::new().set_validation(Validation::default()/* use setters */);
4027 /// ```
4028 pub fn set_validation<T>(mut self, v: T) -> Self
4029 where
4030 T: std::convert::Into<crate::model::Validation>,
4031 {
4032 self.validation = std::option::Option::Some(v.into());
4033 self
4034 }
4035
4036 /// Sets or clears the value of [validation][crate::model::ParameterSpec::validation].
4037 ///
4038 /// # Example
4039 /// ```ignore,no_run
4040 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSpec;
4041 /// use google_cloud_cloudsecuritycompliance_v1::model::Validation;
4042 /// let x = ParameterSpec::new().set_or_clear_validation(Some(Validation::default()/* use setters */));
4043 /// let x = ParameterSpec::new().set_or_clear_validation(None::<Validation>);
4044 /// ```
4045 pub fn set_or_clear_validation<T>(mut self, v: std::option::Option<T>) -> Self
4046 where
4047 T: std::convert::Into<crate::model::Validation>,
4048 {
4049 self.validation = v.map(|x| x.into());
4050 self
4051 }
4052}
4053
4054impl wkt::message::Message for ParameterSpec {
4055 fn typename() -> &'static str {
4056 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ParameterSpec"
4057 }
4058}
4059
4060/// Defines additional types related to [ParameterSpec].
4061pub mod parameter_spec {
4062 #[allow(unused_imports)]
4063 use super::*;
4064
4065 /// The type of parameter value.
4066 ///
4067 /// # Working with unknown values
4068 ///
4069 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4070 /// additional enum variants at any time. Adding new variants is not considered
4071 /// a breaking change. Applications should write their code in anticipation of:
4072 ///
4073 /// - New values appearing in future releases of the client library, **and**
4074 /// - New values received dynamically, without application changes.
4075 ///
4076 /// Please consult the [Working with enums] section in the user guide for some
4077 /// guidelines.
4078 ///
4079 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4080 #[derive(Clone, Debug, PartialEq)]
4081 #[non_exhaustive]
4082 pub enum ValueType {
4083 /// Default value. This value is unused.
4084 Unspecified,
4085 /// A string value.
4086 String,
4087 /// A boolean value.
4088 Boolean,
4089 /// A string list value.
4090 Stringlist,
4091 /// A numeric value.
4092 Number,
4093 /// A oneOf value.
4094 Oneof,
4095 /// If set, the enum was initialized with an unknown value.
4096 ///
4097 /// Applications can examine the value using [ValueType::value] or
4098 /// [ValueType::name].
4099 UnknownValue(value_type::UnknownValue),
4100 }
4101
4102 #[doc(hidden)]
4103 pub mod value_type {
4104 #[allow(unused_imports)]
4105 use super::*;
4106 #[derive(Clone, Debug, PartialEq)]
4107 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4108 }
4109
4110 impl ValueType {
4111 /// Gets the enum value.
4112 ///
4113 /// Returns `None` if the enum contains an unknown value deserialized from
4114 /// the string representation of enums.
4115 pub fn value(&self) -> std::option::Option<i32> {
4116 match self {
4117 Self::Unspecified => std::option::Option::Some(0),
4118 Self::String => std::option::Option::Some(3),
4119 Self::Boolean => std::option::Option::Some(4),
4120 Self::Stringlist => std::option::Option::Some(5),
4121 Self::Number => std::option::Option::Some(6),
4122 Self::Oneof => std::option::Option::Some(7),
4123 Self::UnknownValue(u) => u.0.value(),
4124 }
4125 }
4126
4127 /// Gets the enum value as a string.
4128 ///
4129 /// Returns `None` if the enum contains an unknown value deserialized from
4130 /// the integer representation of enums.
4131 pub fn name(&self) -> std::option::Option<&str> {
4132 match self {
4133 Self::Unspecified => std::option::Option::Some("VALUE_TYPE_UNSPECIFIED"),
4134 Self::String => std::option::Option::Some("STRING"),
4135 Self::Boolean => std::option::Option::Some("BOOLEAN"),
4136 Self::Stringlist => std::option::Option::Some("STRINGLIST"),
4137 Self::Number => std::option::Option::Some("NUMBER"),
4138 Self::Oneof => std::option::Option::Some("ONEOF"),
4139 Self::UnknownValue(u) => u.0.name(),
4140 }
4141 }
4142 }
4143
4144 impl std::default::Default for ValueType {
4145 fn default() -> Self {
4146 use std::convert::From;
4147 Self::from(0)
4148 }
4149 }
4150
4151 impl std::fmt::Display for ValueType {
4152 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4153 wkt::internal::display_enum(f, self.name(), self.value())
4154 }
4155 }
4156
4157 impl std::convert::From<i32> for ValueType {
4158 fn from(value: i32) -> Self {
4159 match value {
4160 0 => Self::Unspecified,
4161 3 => Self::String,
4162 4 => Self::Boolean,
4163 5 => Self::Stringlist,
4164 6 => Self::Number,
4165 7 => Self::Oneof,
4166 _ => Self::UnknownValue(value_type::UnknownValue(
4167 wkt::internal::UnknownEnumValue::Integer(value),
4168 )),
4169 }
4170 }
4171 }
4172
4173 impl std::convert::From<&str> for ValueType {
4174 fn from(value: &str) -> Self {
4175 use std::string::ToString;
4176 match value {
4177 "VALUE_TYPE_UNSPECIFIED" => Self::Unspecified,
4178 "STRING" => Self::String,
4179 "BOOLEAN" => Self::Boolean,
4180 "STRINGLIST" => Self::Stringlist,
4181 "NUMBER" => Self::Number,
4182 "ONEOF" => Self::Oneof,
4183 _ => Self::UnknownValue(value_type::UnknownValue(
4184 wkt::internal::UnknownEnumValue::String(value.to_string()),
4185 )),
4186 }
4187 }
4188 }
4189
4190 impl serde::ser::Serialize for ValueType {
4191 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4192 where
4193 S: serde::Serializer,
4194 {
4195 match self {
4196 Self::Unspecified => serializer.serialize_i32(0),
4197 Self::String => serializer.serialize_i32(3),
4198 Self::Boolean => serializer.serialize_i32(4),
4199 Self::Stringlist => serializer.serialize_i32(5),
4200 Self::Number => serializer.serialize_i32(6),
4201 Self::Oneof => serializer.serialize_i32(7),
4202 Self::UnknownValue(u) => u.0.serialize(serializer),
4203 }
4204 }
4205 }
4206
4207 impl<'de> serde::de::Deserialize<'de> for ValueType {
4208 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4209 where
4210 D: serde::Deserializer<'de>,
4211 {
4212 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ValueType>::new(
4213 ".google.cloud.cloudsecuritycompliance.v1.ParameterSpec.ValueType",
4214 ))
4215 }
4216 }
4217}
4218
4219/// The validation of the parameter.
4220#[derive(Clone, Default, PartialEq)]
4221#[non_exhaustive]
4222pub struct Validation {
4223 /// Defines validators for parameter values.
4224 pub constraint: std::option::Option<crate::model::validation::Constraint>,
4225
4226 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4227}
4228
4229impl Validation {
4230 /// Creates a new default instance.
4231 pub fn new() -> Self {
4232 std::default::Default::default()
4233 }
4234
4235 /// Sets the value of [constraint][crate::model::Validation::constraint].
4236 ///
4237 /// Note that all the setters affecting `constraint` are mutually
4238 /// exclusive.
4239 ///
4240 /// # Example
4241 /// ```ignore,no_run
4242 /// # use google_cloud_cloudsecuritycompliance_v1::model::Validation;
4243 /// use google_cloud_cloudsecuritycompliance_v1::model::AllowedValues;
4244 /// let x = Validation::new().set_constraint(Some(
4245 /// google_cloud_cloudsecuritycompliance_v1::model::validation::Constraint::AllowedValues(AllowedValues::default().into())));
4246 /// ```
4247 pub fn set_constraint<
4248 T: std::convert::Into<std::option::Option<crate::model::validation::Constraint>>,
4249 >(
4250 mut self,
4251 v: T,
4252 ) -> Self {
4253 self.constraint = v.into();
4254 self
4255 }
4256
4257 /// The value of [constraint][crate::model::Validation::constraint]
4258 /// if it holds a `AllowedValues`, `None` if the field is not set or
4259 /// holds a different branch.
4260 pub fn allowed_values(
4261 &self,
4262 ) -> std::option::Option<&std::boxed::Box<crate::model::AllowedValues>> {
4263 #[allow(unreachable_patterns)]
4264 self.constraint.as_ref().and_then(|v| match v {
4265 crate::model::validation::Constraint::AllowedValues(v) => std::option::Option::Some(v),
4266 _ => std::option::Option::None,
4267 })
4268 }
4269
4270 /// Sets the value of [constraint][crate::model::Validation::constraint]
4271 /// to hold a `AllowedValues`.
4272 ///
4273 /// Note that all the setters affecting `constraint` are
4274 /// mutually exclusive.
4275 ///
4276 /// # Example
4277 /// ```ignore,no_run
4278 /// # use google_cloud_cloudsecuritycompliance_v1::model::Validation;
4279 /// use google_cloud_cloudsecuritycompliance_v1::model::AllowedValues;
4280 /// let x = Validation::new().set_allowed_values(AllowedValues::default()/* use setters */);
4281 /// assert!(x.allowed_values().is_some());
4282 /// assert!(x.int_range().is_none());
4283 /// assert!(x.regexp_pattern().is_none());
4284 /// ```
4285 pub fn set_allowed_values<
4286 T: std::convert::Into<std::boxed::Box<crate::model::AllowedValues>>,
4287 >(
4288 mut self,
4289 v: T,
4290 ) -> Self {
4291 self.constraint = std::option::Option::Some(
4292 crate::model::validation::Constraint::AllowedValues(v.into()),
4293 );
4294 self
4295 }
4296
4297 /// The value of [constraint][crate::model::Validation::constraint]
4298 /// if it holds a `IntRange`, `None` if the field is not set or
4299 /// holds a different branch.
4300 pub fn int_range(&self) -> std::option::Option<&std::boxed::Box<crate::model::IntRange>> {
4301 #[allow(unreachable_patterns)]
4302 self.constraint.as_ref().and_then(|v| match v {
4303 crate::model::validation::Constraint::IntRange(v) => std::option::Option::Some(v),
4304 _ => std::option::Option::None,
4305 })
4306 }
4307
4308 /// Sets the value of [constraint][crate::model::Validation::constraint]
4309 /// to hold a `IntRange`.
4310 ///
4311 /// Note that all the setters affecting `constraint` are
4312 /// mutually exclusive.
4313 ///
4314 /// # Example
4315 /// ```ignore,no_run
4316 /// # use google_cloud_cloudsecuritycompliance_v1::model::Validation;
4317 /// use google_cloud_cloudsecuritycompliance_v1::model::IntRange;
4318 /// let x = Validation::new().set_int_range(IntRange::default()/* use setters */);
4319 /// assert!(x.int_range().is_some());
4320 /// assert!(x.allowed_values().is_none());
4321 /// assert!(x.regexp_pattern().is_none());
4322 /// ```
4323 pub fn set_int_range<T: std::convert::Into<std::boxed::Box<crate::model::IntRange>>>(
4324 mut self,
4325 v: T,
4326 ) -> Self {
4327 self.constraint =
4328 std::option::Option::Some(crate::model::validation::Constraint::IntRange(v.into()));
4329 self
4330 }
4331
4332 /// The value of [constraint][crate::model::Validation::constraint]
4333 /// if it holds a `RegexpPattern`, `None` if the field is not set or
4334 /// holds a different branch.
4335 pub fn regexp_pattern(
4336 &self,
4337 ) -> std::option::Option<&std::boxed::Box<crate::model::RegexpPattern>> {
4338 #[allow(unreachable_patterns)]
4339 self.constraint.as_ref().and_then(|v| match v {
4340 crate::model::validation::Constraint::RegexpPattern(v) => std::option::Option::Some(v),
4341 _ => std::option::Option::None,
4342 })
4343 }
4344
4345 /// Sets the value of [constraint][crate::model::Validation::constraint]
4346 /// to hold a `RegexpPattern`.
4347 ///
4348 /// Note that all the setters affecting `constraint` are
4349 /// mutually exclusive.
4350 ///
4351 /// # Example
4352 /// ```ignore,no_run
4353 /// # use google_cloud_cloudsecuritycompliance_v1::model::Validation;
4354 /// use google_cloud_cloudsecuritycompliance_v1::model::RegexpPattern;
4355 /// let x = Validation::new().set_regexp_pattern(RegexpPattern::default()/* use setters */);
4356 /// assert!(x.regexp_pattern().is_some());
4357 /// assert!(x.allowed_values().is_none());
4358 /// assert!(x.int_range().is_none());
4359 /// ```
4360 pub fn set_regexp_pattern<
4361 T: std::convert::Into<std::boxed::Box<crate::model::RegexpPattern>>,
4362 >(
4363 mut self,
4364 v: T,
4365 ) -> Self {
4366 self.constraint = std::option::Option::Some(
4367 crate::model::validation::Constraint::RegexpPattern(v.into()),
4368 );
4369 self
4370 }
4371}
4372
4373impl wkt::message::Message for Validation {
4374 fn typename() -> &'static str {
4375 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.Validation"
4376 }
4377}
4378
4379/// Defines additional types related to [Validation].
4380pub mod validation {
4381 #[allow(unused_imports)]
4382 use super::*;
4383
4384 /// Defines validators for parameter values.
4385 #[derive(Clone, Debug, PartialEq)]
4386 #[non_exhaustive]
4387 pub enum Constraint {
4388 /// The permitted set of values for the parameter.
4389 AllowedValues(std::boxed::Box<crate::model::AllowedValues>),
4390 /// The permitted range for numeric parameters.
4391 IntRange(std::boxed::Box<crate::model::IntRange>),
4392 /// The regular expression for string parameters.
4393 RegexpPattern(std::boxed::Box<crate::model::RegexpPattern>),
4394 }
4395}
4396
4397/// The allowed set of values for the parameter.
4398#[derive(Clone, Default, PartialEq)]
4399#[non_exhaustive]
4400pub struct AllowedValues {
4401 /// Required. The list of allowed values for the parameter.
4402 pub values: std::vec::Vec<crate::model::ParamValue>,
4403
4404 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4405}
4406
4407impl AllowedValues {
4408 /// Creates a new default instance.
4409 pub fn new() -> Self {
4410 std::default::Default::default()
4411 }
4412
4413 /// Sets the value of [values][crate::model::AllowedValues::values].
4414 ///
4415 /// # Example
4416 /// ```ignore,no_run
4417 /// # use google_cloud_cloudsecuritycompliance_v1::model::AllowedValues;
4418 /// use google_cloud_cloudsecuritycompliance_v1::model::ParamValue;
4419 /// let x = AllowedValues::new()
4420 /// .set_values([
4421 /// ParamValue::default()/* use setters */,
4422 /// ParamValue::default()/* use (different) setters */,
4423 /// ]);
4424 /// ```
4425 pub fn set_values<T, V>(mut self, v: T) -> Self
4426 where
4427 T: std::iter::IntoIterator<Item = V>,
4428 V: std::convert::Into<crate::model::ParamValue>,
4429 {
4430 use std::iter::Iterator;
4431 self.values = v.into_iter().map(|i| i.into()).collect();
4432 self
4433 }
4434}
4435
4436impl wkt::message::Message for AllowedValues {
4437 fn typename() -> &'static str {
4438 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.AllowedValues"
4439 }
4440}
4441
4442/// The regular expression (regex) validator for parameter values.
4443#[derive(Clone, Default, PartialEq)]
4444#[non_exhaustive]
4445pub struct RegexpPattern {
4446 /// Required. The regex pattern to match the values of the parameter with.
4447 pub pattern: std::string::String,
4448
4449 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4450}
4451
4452impl RegexpPattern {
4453 /// Creates a new default instance.
4454 pub fn new() -> Self {
4455 std::default::Default::default()
4456 }
4457
4458 /// Sets the value of [pattern][crate::model::RegexpPattern::pattern].
4459 ///
4460 /// # Example
4461 /// ```ignore,no_run
4462 /// # use google_cloud_cloudsecuritycompliance_v1::model::RegexpPattern;
4463 /// let x = RegexpPattern::new().set_pattern("example");
4464 /// ```
4465 pub fn set_pattern<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4466 self.pattern = v.into();
4467 self
4468 }
4469}
4470
4471impl wkt::message::Message for RegexpPattern {
4472 fn typename() -> &'static str {
4473 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.RegexpPattern"
4474 }
4475}
4476
4477/// The number range for number parameters.
4478#[derive(Clone, Default, PartialEq)]
4479#[non_exhaustive]
4480pub struct IntRange {
4481 /// Required. The minimum permitted value for the numeric parameter
4482 /// (inclusive).
4483 pub min: i64,
4484
4485 /// Required. The maximum permitted value for the numeric parameter
4486 /// (inclusive).
4487 pub max: i64,
4488
4489 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4490}
4491
4492impl IntRange {
4493 /// Creates a new default instance.
4494 pub fn new() -> Self {
4495 std::default::Default::default()
4496 }
4497
4498 /// Sets the value of [min][crate::model::IntRange::min].
4499 ///
4500 /// # Example
4501 /// ```ignore,no_run
4502 /// # use google_cloud_cloudsecuritycompliance_v1::model::IntRange;
4503 /// let x = IntRange::new().set_min(42);
4504 /// ```
4505 pub fn set_min<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4506 self.min = v.into();
4507 self
4508 }
4509
4510 /// Sets the value of [max][crate::model::IntRange::max].
4511 ///
4512 /// # Example
4513 /// ```ignore,no_run
4514 /// # use google_cloud_cloudsecuritycompliance_v1::model::IntRange;
4515 /// let x = IntRange::new().set_max(42);
4516 /// ```
4517 pub fn set_max<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4518 self.max = v.into();
4519 self
4520 }
4521}
4522
4523impl wkt::message::Message for IntRange {
4524 fn typename() -> &'static str {
4525 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.IntRange"
4526 }
4527}
4528
4529/// A list of strings for the parameter value.
4530#[derive(Clone, Default, PartialEq)]
4531#[non_exhaustive]
4532pub struct StringList {
4533 /// Required. The strings in the list.
4534 pub values: std::vec::Vec<std::string::String>,
4535
4536 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4537}
4538
4539impl StringList {
4540 /// Creates a new default instance.
4541 pub fn new() -> Self {
4542 std::default::Default::default()
4543 }
4544
4545 /// Sets the value of [values][crate::model::StringList::values].
4546 ///
4547 /// # Example
4548 /// ```ignore,no_run
4549 /// # use google_cloud_cloudsecuritycompliance_v1::model::StringList;
4550 /// let x = StringList::new().set_values(["a", "b", "c"]);
4551 /// ```
4552 pub fn set_values<T, V>(mut self, v: T) -> Self
4553 where
4554 T: std::iter::IntoIterator<Item = V>,
4555 V: std::convert::Into<std::string::String>,
4556 {
4557 use std::iter::Iterator;
4558 self.values = v.into_iter().map(|i| i.into()).collect();
4559 self
4560 }
4561}
4562
4563impl wkt::message::Message for StringList {
4564 fn typename() -> &'static str {
4565 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.StringList"
4566 }
4567}
4568
4569/// The possible parameter value types.
4570#[derive(Clone, Default, PartialEq)]
4571#[non_exhaustive]
4572pub struct ParamValue {
4573 /// The list of possible parameter value types.
4574 pub kind: std::option::Option<crate::model::param_value::Kind>,
4575
4576 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4577}
4578
4579impl ParamValue {
4580 /// Creates a new default instance.
4581 pub fn new() -> Self {
4582 std::default::Default::default()
4583 }
4584
4585 /// Sets the value of [kind][crate::model::ParamValue::kind].
4586 ///
4587 /// Note that all the setters affecting `kind` are mutually
4588 /// exclusive.
4589 ///
4590 /// # Example
4591 /// ```ignore,no_run
4592 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParamValue;
4593 /// use google_cloud_cloudsecuritycompliance_v1::model::param_value::Kind;
4594 /// let x = ParamValue::new().set_kind(Some(Kind::StringValue("example".to_string())));
4595 /// ```
4596 pub fn set_kind<T: std::convert::Into<std::option::Option<crate::model::param_value::Kind>>>(
4597 mut self,
4598 v: T,
4599 ) -> Self {
4600 self.kind = v.into();
4601 self
4602 }
4603
4604 /// The value of [kind][crate::model::ParamValue::kind]
4605 /// if it holds a `StringValue`, `None` if the field is not set or
4606 /// holds a different branch.
4607 pub fn string_value(&self) -> std::option::Option<&std::string::String> {
4608 #[allow(unreachable_patterns)]
4609 self.kind.as_ref().and_then(|v| match v {
4610 crate::model::param_value::Kind::StringValue(v) => std::option::Option::Some(v),
4611 _ => std::option::Option::None,
4612 })
4613 }
4614
4615 /// Sets the value of [kind][crate::model::ParamValue::kind]
4616 /// to hold a `StringValue`.
4617 ///
4618 /// Note that all the setters affecting `kind` are
4619 /// mutually exclusive.
4620 ///
4621 /// # Example
4622 /// ```ignore,no_run
4623 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParamValue;
4624 /// let x = ParamValue::new().set_string_value("example");
4625 /// assert!(x.string_value().is_some());
4626 /// assert!(x.bool_value().is_none());
4627 /// assert!(x.string_list_value().is_none());
4628 /// assert!(x.number_value().is_none());
4629 /// assert!(x.oneof_value().is_none());
4630 /// ```
4631 pub fn set_string_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4632 self.kind =
4633 std::option::Option::Some(crate::model::param_value::Kind::StringValue(v.into()));
4634 self
4635 }
4636
4637 /// The value of [kind][crate::model::ParamValue::kind]
4638 /// if it holds a `BoolValue`, `None` if the field is not set or
4639 /// holds a different branch.
4640 pub fn bool_value(&self) -> std::option::Option<&bool> {
4641 #[allow(unreachable_patterns)]
4642 self.kind.as_ref().and_then(|v| match v {
4643 crate::model::param_value::Kind::BoolValue(v) => std::option::Option::Some(v),
4644 _ => std::option::Option::None,
4645 })
4646 }
4647
4648 /// Sets the value of [kind][crate::model::ParamValue::kind]
4649 /// to hold a `BoolValue`.
4650 ///
4651 /// Note that all the setters affecting `kind` are
4652 /// mutually exclusive.
4653 ///
4654 /// # Example
4655 /// ```ignore,no_run
4656 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParamValue;
4657 /// let x = ParamValue::new().set_bool_value(true);
4658 /// assert!(x.bool_value().is_some());
4659 /// assert!(x.string_value().is_none());
4660 /// assert!(x.string_list_value().is_none());
4661 /// assert!(x.number_value().is_none());
4662 /// assert!(x.oneof_value().is_none());
4663 /// ```
4664 pub fn set_bool_value<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4665 self.kind = std::option::Option::Some(crate::model::param_value::Kind::BoolValue(v.into()));
4666 self
4667 }
4668
4669 /// The value of [kind][crate::model::ParamValue::kind]
4670 /// if it holds a `StringListValue`, `None` if the field is not set or
4671 /// holds a different branch.
4672 pub fn string_list_value(
4673 &self,
4674 ) -> std::option::Option<&std::boxed::Box<crate::model::StringList>> {
4675 #[allow(unreachable_patterns)]
4676 self.kind.as_ref().and_then(|v| match v {
4677 crate::model::param_value::Kind::StringListValue(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 `StringListValue`.
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::StringList;
4692 /// let x = ParamValue::new().set_string_list_value(StringList::default()/* use setters */);
4693 /// assert!(x.string_list_value().is_some());
4694 /// assert!(x.string_value().is_none());
4695 /// assert!(x.bool_value().is_none());
4696 /// assert!(x.number_value().is_none());
4697 /// assert!(x.oneof_value().is_none());
4698 /// ```
4699 pub fn set_string_list_value<
4700 T: std::convert::Into<std::boxed::Box<crate::model::StringList>>,
4701 >(
4702 mut self,
4703 v: T,
4704 ) -> Self {
4705 self.kind =
4706 std::option::Option::Some(crate::model::param_value::Kind::StringListValue(v.into()));
4707 self
4708 }
4709
4710 /// The value of [kind][crate::model::ParamValue::kind]
4711 /// if it holds a `NumberValue`, `None` if the field is not set or
4712 /// holds a different branch.
4713 pub fn number_value(&self) -> std::option::Option<&f64> {
4714 #[allow(unreachable_patterns)]
4715 self.kind.as_ref().and_then(|v| match v {
4716 crate::model::param_value::Kind::NumberValue(v) => std::option::Option::Some(v),
4717 _ => std::option::Option::None,
4718 })
4719 }
4720
4721 /// Sets the value of [kind][crate::model::ParamValue::kind]
4722 /// to hold a `NumberValue`.
4723 ///
4724 /// Note that all the setters affecting `kind` are
4725 /// mutually exclusive.
4726 ///
4727 /// # Example
4728 /// ```ignore,no_run
4729 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParamValue;
4730 /// let x = ParamValue::new().set_number_value(42.0);
4731 /// assert!(x.number_value().is_some());
4732 /// assert!(x.string_value().is_none());
4733 /// assert!(x.bool_value().is_none());
4734 /// assert!(x.string_list_value().is_none());
4735 /// assert!(x.oneof_value().is_none());
4736 /// ```
4737 pub fn set_number_value<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
4738 self.kind =
4739 std::option::Option::Some(crate::model::param_value::Kind::NumberValue(v.into()));
4740 self
4741 }
4742
4743 /// The value of [kind][crate::model::ParamValue::kind]
4744 /// if it holds a `OneofValue`, `None` if the field is not set or
4745 /// holds a different branch.
4746 pub fn oneof_value(&self) -> std::option::Option<&std::boxed::Box<crate::model::Parameter>> {
4747 #[allow(unreachable_patterns)]
4748 self.kind.as_ref().and_then(|v| match v {
4749 crate::model::param_value::Kind::OneofValue(v) => std::option::Option::Some(v),
4750 _ => std::option::Option::None,
4751 })
4752 }
4753
4754 /// Sets the value of [kind][crate::model::ParamValue::kind]
4755 /// to hold a `OneofValue`.
4756 ///
4757 /// Note that all the setters affecting `kind` are
4758 /// mutually exclusive.
4759 ///
4760 /// # Example
4761 /// ```ignore,no_run
4762 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParamValue;
4763 /// use google_cloud_cloudsecuritycompliance_v1::model::Parameter;
4764 /// let x = ParamValue::new().set_oneof_value(Parameter::default()/* use setters */);
4765 /// assert!(x.oneof_value().is_some());
4766 /// assert!(x.string_value().is_none());
4767 /// assert!(x.bool_value().is_none());
4768 /// assert!(x.string_list_value().is_none());
4769 /// assert!(x.number_value().is_none());
4770 /// ```
4771 pub fn set_oneof_value<T: std::convert::Into<std::boxed::Box<crate::model::Parameter>>>(
4772 mut self,
4773 v: T,
4774 ) -> Self {
4775 self.kind =
4776 std::option::Option::Some(crate::model::param_value::Kind::OneofValue(v.into()));
4777 self
4778 }
4779}
4780
4781impl wkt::message::Message for ParamValue {
4782 fn typename() -> &'static str {
4783 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ParamValue"
4784 }
4785}
4786
4787/// Defines additional types related to [ParamValue].
4788pub mod param_value {
4789 #[allow(unused_imports)]
4790 use super::*;
4791
4792 /// The list of possible parameter value types.
4793 #[derive(Clone, Debug, PartialEq)]
4794 #[non_exhaustive]
4795 pub enum Kind {
4796 /// Optional. A string value.
4797 StringValue(std::string::String),
4798 /// Optional. A boolean value.
4799 BoolValue(bool),
4800 /// Optional. A repeated string.
4801 StringListValue(std::boxed::Box<crate::model::StringList>),
4802 /// Optional. A double value.
4803 NumberValue(f64),
4804 /// Optional. Sub-parameter values.
4805 OneofValue(std::boxed::Box<crate::model::Parameter>),
4806 }
4807}
4808
4809/// The parameter substitution rules.
4810#[derive(Clone, Default, PartialEq)]
4811#[non_exhaustive]
4812pub struct ParameterSubstitutionRule {
4813 /// The type of substitution.
4814 pub substitution_type:
4815 std::option::Option<crate::model::parameter_substitution_rule::SubstitutionType>,
4816
4817 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4818}
4819
4820impl ParameterSubstitutionRule {
4821 /// Creates a new default instance.
4822 pub fn new() -> Self {
4823 std::default::Default::default()
4824 }
4825
4826 /// Sets the value of [substitution_type][crate::model::ParameterSubstitutionRule::substitution_type].
4827 ///
4828 /// Note that all the setters affecting `substitution_type` are mutually
4829 /// exclusive.
4830 ///
4831 /// # Example
4832 /// ```ignore,no_run
4833 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSubstitutionRule;
4834 /// use google_cloud_cloudsecuritycompliance_v1::model::PlaceholderSubstitutionRule;
4835 /// let x = ParameterSubstitutionRule::new().set_substitution_type(Some(
4836 /// google_cloud_cloudsecuritycompliance_v1::model::parameter_substitution_rule::SubstitutionType::PlaceholderSubstitutionRule(PlaceholderSubstitutionRule::default().into())));
4837 /// ```
4838 pub fn set_substitution_type<
4839 T: std::convert::Into<
4840 std::option::Option<crate::model::parameter_substitution_rule::SubstitutionType>,
4841 >,
4842 >(
4843 mut self,
4844 v: T,
4845 ) -> Self {
4846 self.substitution_type = v.into();
4847 self
4848 }
4849
4850 /// The value of [substitution_type][crate::model::ParameterSubstitutionRule::substitution_type]
4851 /// if it holds a `PlaceholderSubstitutionRule`, `None` if the field is not set or
4852 /// holds a different branch.
4853 pub fn placeholder_substitution_rule(
4854 &self,
4855 ) -> std::option::Option<&std::boxed::Box<crate::model::PlaceholderSubstitutionRule>> {
4856 #[allow(unreachable_patterns)]
4857 self.substitution_type.as_ref().and_then(|v| match v {
4858 crate::model::parameter_substitution_rule::SubstitutionType::PlaceholderSubstitutionRule(v) => std::option::Option::Some(v),
4859 _ => std::option::Option::None,
4860 })
4861 }
4862
4863 /// Sets the value of [substitution_type][crate::model::ParameterSubstitutionRule::substitution_type]
4864 /// to hold a `PlaceholderSubstitutionRule`.
4865 ///
4866 /// Note that all the setters affecting `substitution_type` are
4867 /// mutually exclusive.
4868 ///
4869 /// # Example
4870 /// ```ignore,no_run
4871 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSubstitutionRule;
4872 /// use google_cloud_cloudsecuritycompliance_v1::model::PlaceholderSubstitutionRule;
4873 /// let x = ParameterSubstitutionRule::new().set_placeholder_substitution_rule(PlaceholderSubstitutionRule::default()/* use setters */);
4874 /// assert!(x.placeholder_substitution_rule().is_some());
4875 /// assert!(x.attribute_substitution_rule().is_none());
4876 /// ```
4877 pub fn set_placeholder_substitution_rule<
4878 T: std::convert::Into<std::boxed::Box<crate::model::PlaceholderSubstitutionRule>>,
4879 >(
4880 mut self,
4881 v: T,
4882 ) -> Self {
4883 self.substitution_type = std::option::Option::Some(
4884 crate::model::parameter_substitution_rule::SubstitutionType::PlaceholderSubstitutionRule(
4885 v.into()
4886 )
4887 );
4888 self
4889 }
4890
4891 /// The value of [substitution_type][crate::model::ParameterSubstitutionRule::substitution_type]
4892 /// if it holds a `AttributeSubstitutionRule`, `None` if the field is not set or
4893 /// holds a different branch.
4894 pub fn attribute_substitution_rule(
4895 &self,
4896 ) -> std::option::Option<&std::boxed::Box<crate::model::AttributeSubstitutionRule>> {
4897 #[allow(unreachable_patterns)]
4898 self.substitution_type.as_ref().and_then(|v| match v {
4899 crate::model::parameter_substitution_rule::SubstitutionType::AttributeSubstitutionRule(v) => std::option::Option::Some(v),
4900 _ => std::option::Option::None,
4901 })
4902 }
4903
4904 /// Sets the value of [substitution_type][crate::model::ParameterSubstitutionRule::substitution_type]
4905 /// to hold a `AttributeSubstitutionRule`.
4906 ///
4907 /// Note that all the setters affecting `substitution_type` are
4908 /// mutually exclusive.
4909 ///
4910 /// # Example
4911 /// ```ignore,no_run
4912 /// # use google_cloud_cloudsecuritycompliance_v1::model::ParameterSubstitutionRule;
4913 /// use google_cloud_cloudsecuritycompliance_v1::model::AttributeSubstitutionRule;
4914 /// let x = ParameterSubstitutionRule::new().set_attribute_substitution_rule(AttributeSubstitutionRule::default()/* use setters */);
4915 /// assert!(x.attribute_substitution_rule().is_some());
4916 /// assert!(x.placeholder_substitution_rule().is_none());
4917 /// ```
4918 pub fn set_attribute_substitution_rule<
4919 T: std::convert::Into<std::boxed::Box<crate::model::AttributeSubstitutionRule>>,
4920 >(
4921 mut self,
4922 v: T,
4923 ) -> Self {
4924 self.substitution_type = std::option::Option::Some(
4925 crate::model::parameter_substitution_rule::SubstitutionType::AttributeSubstitutionRule(
4926 v.into(),
4927 ),
4928 );
4929 self
4930 }
4931}
4932
4933impl wkt::message::Message for ParameterSubstitutionRule {
4934 fn typename() -> &'static str {
4935 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ParameterSubstitutionRule"
4936 }
4937}
4938
4939/// Defines additional types related to [ParameterSubstitutionRule].
4940pub mod parameter_substitution_rule {
4941 #[allow(unused_imports)]
4942 use super::*;
4943
4944 /// The type of substitution.
4945 #[derive(Clone, Debug, PartialEq)]
4946 #[non_exhaustive]
4947 pub enum SubstitutionType {
4948 /// The placeholder substitution rule.
4949 PlaceholderSubstitutionRule(std::boxed::Box<crate::model::PlaceholderSubstitutionRule>),
4950 /// The attribute substitution rule.
4951 AttributeSubstitutionRule(std::boxed::Box<crate::model::AttributeSubstitutionRule>),
4952 }
4953}
4954
4955/// The attribute at the given path that's substituted entirely.
4956#[derive(Clone, Default, PartialEq)]
4957#[non_exhaustive]
4958pub struct AttributeSubstitutionRule {
4959 /// The fully qualified proto attribute path, in dot notation.
4960 /// For example: `rules[0].cel_expression.resource_types_values`
4961 pub attribute: std::string::String,
4962
4963 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4964}
4965
4966impl AttributeSubstitutionRule {
4967 /// Creates a new default instance.
4968 pub fn new() -> Self {
4969 std::default::Default::default()
4970 }
4971
4972 /// Sets the value of [attribute][crate::model::AttributeSubstitutionRule::attribute].
4973 ///
4974 /// # Example
4975 /// ```ignore,no_run
4976 /// # use google_cloud_cloudsecuritycompliance_v1::model::AttributeSubstitutionRule;
4977 /// let x = AttributeSubstitutionRule::new().set_attribute("example");
4978 /// ```
4979 pub fn set_attribute<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4980 self.attribute = v.into();
4981 self
4982 }
4983}
4984
4985impl wkt::message::Message for AttributeSubstitutionRule {
4986 fn typename() -> &'static str {
4987 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.AttributeSubstitutionRule"
4988 }
4989}
4990
4991/// The placeholder that's substituted in the rendered string.
4992#[derive(Clone, Default, PartialEq)]
4993#[non_exhaustive]
4994pub struct PlaceholderSubstitutionRule {
4995 /// The fully qualified proto attribute path, in dot notation.
4996 pub attribute: std::string::String,
4997
4998 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4999}
5000
5001impl PlaceholderSubstitutionRule {
5002 /// Creates a new default instance.
5003 pub fn new() -> Self {
5004 std::default::Default::default()
5005 }
5006
5007 /// Sets the value of [attribute][crate::model::PlaceholderSubstitutionRule::attribute].
5008 ///
5009 /// # Example
5010 /// ```ignore,no_run
5011 /// # use google_cloud_cloudsecuritycompliance_v1::model::PlaceholderSubstitutionRule;
5012 /// let x = PlaceholderSubstitutionRule::new().set_attribute("example");
5013 /// ```
5014 pub fn set_attribute<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5015 self.attribute = v.into();
5016 self
5017 }
5018}
5019
5020impl wkt::message::Message for PlaceholderSubstitutionRule {
5021 fn typename() -> &'static str {
5022 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.PlaceholderSubstitutionRule"
5023 }
5024}
5025
5026/// A rule in the cloud control.
5027#[derive(Clone, Default, PartialEq)]
5028#[non_exhaustive]
5029pub struct Rule {
5030 /// Optional. The rule description. The maximum length is 2000 characters.
5031 pub description: std::string::String,
5032
5033 /// Required. The functionality that's enabled by the rule.
5034 pub rule_action_types: std::vec::Vec<crate::model::RuleActionType>,
5035
5036 /// The rule implementation.
5037 pub implementation: std::option::Option<crate::model::rule::Implementation>,
5038
5039 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5040}
5041
5042impl Rule {
5043 /// Creates a new default instance.
5044 pub fn new() -> Self {
5045 std::default::Default::default()
5046 }
5047
5048 /// Sets the value of [description][crate::model::Rule::description].
5049 ///
5050 /// # Example
5051 /// ```ignore,no_run
5052 /// # use google_cloud_cloudsecuritycompliance_v1::model::Rule;
5053 /// let x = Rule::new().set_description("example");
5054 /// ```
5055 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5056 self.description = v.into();
5057 self
5058 }
5059
5060 /// Sets the value of [rule_action_types][crate::model::Rule::rule_action_types].
5061 ///
5062 /// # Example
5063 /// ```ignore,no_run
5064 /// # use google_cloud_cloudsecuritycompliance_v1::model::Rule;
5065 /// use google_cloud_cloudsecuritycompliance_v1::model::RuleActionType;
5066 /// let x = Rule::new().set_rule_action_types([
5067 /// RuleActionType::Preventive,
5068 /// RuleActionType::Detective,
5069 /// RuleActionType::Audit,
5070 /// ]);
5071 /// ```
5072 pub fn set_rule_action_types<T, V>(mut self, v: T) -> Self
5073 where
5074 T: std::iter::IntoIterator<Item = V>,
5075 V: std::convert::Into<crate::model::RuleActionType>,
5076 {
5077 use std::iter::Iterator;
5078 self.rule_action_types = v.into_iter().map(|i| i.into()).collect();
5079 self
5080 }
5081
5082 /// Sets the value of [implementation][crate::model::Rule::implementation].
5083 ///
5084 /// Note that all the setters affecting `implementation` are mutually
5085 /// exclusive.
5086 ///
5087 /// # Example
5088 /// ```ignore,no_run
5089 /// # use google_cloud_cloudsecuritycompliance_v1::model::Rule;
5090 /// use google_cloud_cloudsecuritycompliance_v1::model::CELExpression;
5091 /// let x = Rule::new().set_implementation(Some(
5092 /// google_cloud_cloudsecuritycompliance_v1::model::rule::Implementation::CelExpression(CELExpression::default().into())));
5093 /// ```
5094 pub fn set_implementation<
5095 T: std::convert::Into<std::option::Option<crate::model::rule::Implementation>>,
5096 >(
5097 mut self,
5098 v: T,
5099 ) -> Self {
5100 self.implementation = v.into();
5101 self
5102 }
5103
5104 /// The value of [implementation][crate::model::Rule::implementation]
5105 /// if it holds a `CelExpression`, `None` if the field is not set or
5106 /// holds a different branch.
5107 pub fn cel_expression(
5108 &self,
5109 ) -> std::option::Option<&std::boxed::Box<crate::model::CELExpression>> {
5110 #[allow(unreachable_patterns)]
5111 self.implementation.as_ref().and_then(|v| match v {
5112 crate::model::rule::Implementation::CelExpression(v) => std::option::Option::Some(v),
5113 _ => std::option::Option::None,
5114 })
5115 }
5116
5117 /// Sets the value of [implementation][crate::model::Rule::implementation]
5118 /// to hold a `CelExpression`.
5119 ///
5120 /// Note that all the setters affecting `implementation` are
5121 /// mutually exclusive.
5122 ///
5123 /// # Example
5124 /// ```ignore,no_run
5125 /// # use google_cloud_cloudsecuritycompliance_v1::model::Rule;
5126 /// use google_cloud_cloudsecuritycompliance_v1::model::CELExpression;
5127 /// let x = Rule::new().set_cel_expression(CELExpression::default()/* use setters */);
5128 /// assert!(x.cel_expression().is_some());
5129 /// ```
5130 pub fn set_cel_expression<
5131 T: std::convert::Into<std::boxed::Box<crate::model::CELExpression>>,
5132 >(
5133 mut self,
5134 v: T,
5135 ) -> Self {
5136 self.implementation =
5137 std::option::Option::Some(crate::model::rule::Implementation::CelExpression(v.into()));
5138 self
5139 }
5140}
5141
5142impl wkt::message::Message for Rule {
5143 fn typename() -> &'static str {
5144 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.Rule"
5145 }
5146}
5147
5148/// Defines additional types related to [Rule].
5149pub mod rule {
5150 #[allow(unused_imports)]
5151 use super::*;
5152
5153 /// The rule implementation.
5154 #[derive(Clone, Debug, PartialEq)]
5155 #[non_exhaustive]
5156 pub enum Implementation {
5157 /// The rule's logic expression in Common Expression Language (CEL).
5158 CelExpression(std::boxed::Box<crate::model::CELExpression>),
5159 }
5160}
5161
5162/// A Common Expression Language (CEL) expression that's used to create a rule.
5163#[derive(Clone, Default, PartialEq)]
5164#[non_exhaustive]
5165pub struct CELExpression {
5166 /// Required. The logical expression in CEL. The maximum length of the
5167 /// condition is 1000 characters. For more information, see [CEL
5168 /// expression](https://cloud.google.com/security-command-center/docs/compliance-manager-write-cel-expressions).
5169 pub expression: std::string::String,
5170
5171 /// The criteria of the CEL expression.
5172 pub criteria: std::option::Option<crate::model::cel_expression::Criteria>,
5173
5174 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5175}
5176
5177impl CELExpression {
5178 /// Creates a new default instance.
5179 pub fn new() -> Self {
5180 std::default::Default::default()
5181 }
5182
5183 /// Sets the value of [expression][crate::model::CELExpression::expression].
5184 ///
5185 /// # Example
5186 /// ```ignore,no_run
5187 /// # use google_cloud_cloudsecuritycompliance_v1::model::CELExpression;
5188 /// let x = CELExpression::new().set_expression("example");
5189 /// ```
5190 pub fn set_expression<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5191 self.expression = v.into();
5192 self
5193 }
5194
5195 /// Sets the value of [criteria][crate::model::CELExpression::criteria].
5196 ///
5197 /// Note that all the setters affecting `criteria` are mutually
5198 /// exclusive.
5199 ///
5200 /// # Example
5201 /// ```ignore,no_run
5202 /// # use google_cloud_cloudsecuritycompliance_v1::model::CELExpression;
5203 /// use google_cloud_cloudsecuritycompliance_v1::model::StringList;
5204 /// let x = CELExpression::new().set_criteria(Some(
5205 /// google_cloud_cloudsecuritycompliance_v1::model::cel_expression::Criteria::ResourceTypesValues(StringList::default().into())));
5206 /// ```
5207 pub fn set_criteria<
5208 T: std::convert::Into<std::option::Option<crate::model::cel_expression::Criteria>>,
5209 >(
5210 mut self,
5211 v: T,
5212 ) -> Self {
5213 self.criteria = v.into();
5214 self
5215 }
5216
5217 /// The value of [criteria][crate::model::CELExpression::criteria]
5218 /// if it holds a `ResourceTypesValues`, `None` if the field is not set or
5219 /// holds a different branch.
5220 pub fn resource_types_values(
5221 &self,
5222 ) -> std::option::Option<&std::boxed::Box<crate::model::StringList>> {
5223 #[allow(unreachable_patterns)]
5224 self.criteria.as_ref().and_then(|v| match v {
5225 crate::model::cel_expression::Criteria::ResourceTypesValues(v) => {
5226 std::option::Option::Some(v)
5227 }
5228 _ => std::option::Option::None,
5229 })
5230 }
5231
5232 /// Sets the value of [criteria][crate::model::CELExpression::criteria]
5233 /// to hold a `ResourceTypesValues`.
5234 ///
5235 /// Note that all the setters affecting `criteria` are
5236 /// mutually exclusive.
5237 ///
5238 /// # Example
5239 /// ```ignore,no_run
5240 /// # use google_cloud_cloudsecuritycompliance_v1::model::CELExpression;
5241 /// use google_cloud_cloudsecuritycompliance_v1::model::StringList;
5242 /// let x = CELExpression::new().set_resource_types_values(StringList::default()/* use setters */);
5243 /// assert!(x.resource_types_values().is_some());
5244 /// ```
5245 pub fn set_resource_types_values<
5246 T: std::convert::Into<std::boxed::Box<crate::model::StringList>>,
5247 >(
5248 mut self,
5249 v: T,
5250 ) -> Self {
5251 self.criteria = std::option::Option::Some(
5252 crate::model::cel_expression::Criteria::ResourceTypesValues(v.into()),
5253 );
5254 self
5255 }
5256}
5257
5258impl wkt::message::Message for CELExpression {
5259 fn typename() -> &'static str {
5260 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CELExpression"
5261 }
5262}
5263
5264/// Defines additional types related to [CELExpression].
5265pub mod cel_expression {
5266 #[allow(unused_imports)]
5267 use super::*;
5268
5269 /// The criteria of the CEL expression.
5270 #[derive(Clone, Debug, PartialEq)]
5271 #[non_exhaustive]
5272 pub enum Criteria {
5273 /// The resource instance types on which this expression is defined.
5274 /// The format is `<SERVICE_NAME>/<type>`.
5275 /// For example: `compute.googleapis.com/Instance`
5276 ResourceTypesValues(std::boxed::Box<crate::model::StringList>),
5277 }
5278}
5279
5280/// The metadata for the long-running operation.
5281#[derive(Clone, Default, PartialEq)]
5282#[non_exhaustive]
5283pub struct OperationMetadata {
5284 /// Output only. The time the operation was created.
5285 pub create_time: std::option::Option<wkt::Timestamp>,
5286
5287 /// Output only. The time the operation finished running.
5288 pub end_time: std::option::Option<wkt::Timestamp>,
5289
5290 /// Output only. The server-defined resource path for the target of the
5291 /// operation.
5292 pub target: std::string::String,
5293
5294 /// Output only. The name of the verb that was executed by the operation.
5295 pub verb: std::string::String,
5296
5297 /// Output only. The human-readable status of the operation, if any.
5298 pub status_message: std::string::String,
5299
5300 /// Output only. Identifies whether the user has requested that the operation
5301 /// be cancelled. If an operation was cancelled successfully, then the field
5302 /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
5303 /// contains the value [google.rpc.Code.CANCELLED][google.rpc.Code.CANCELLED].
5304 ///
5305 /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
5306 pub requested_cancellation: bool,
5307
5308 /// Output only. The API version that was used to start the operation.
5309 pub api_version: std::string::String,
5310
5311 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5312}
5313
5314impl OperationMetadata {
5315 /// Creates a new default instance.
5316 pub fn new() -> Self {
5317 std::default::Default::default()
5318 }
5319
5320 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
5321 ///
5322 /// # Example
5323 /// ```ignore,no_run
5324 /// # use google_cloud_cloudsecuritycompliance_v1::model::OperationMetadata;
5325 /// use wkt::Timestamp;
5326 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
5327 /// ```
5328 pub fn set_create_time<T>(mut self, v: T) -> Self
5329 where
5330 T: std::convert::Into<wkt::Timestamp>,
5331 {
5332 self.create_time = std::option::Option::Some(v.into());
5333 self
5334 }
5335
5336 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
5337 ///
5338 /// # Example
5339 /// ```ignore,no_run
5340 /// # use google_cloud_cloudsecuritycompliance_v1::model::OperationMetadata;
5341 /// use wkt::Timestamp;
5342 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5343 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
5344 /// ```
5345 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5346 where
5347 T: std::convert::Into<wkt::Timestamp>,
5348 {
5349 self.create_time = v.map(|x| x.into());
5350 self
5351 }
5352
5353 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
5354 ///
5355 /// # Example
5356 /// ```ignore,no_run
5357 /// # use google_cloud_cloudsecuritycompliance_v1::model::OperationMetadata;
5358 /// use wkt::Timestamp;
5359 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
5360 /// ```
5361 pub fn set_end_time<T>(mut self, v: T) -> Self
5362 where
5363 T: std::convert::Into<wkt::Timestamp>,
5364 {
5365 self.end_time = std::option::Option::Some(v.into());
5366 self
5367 }
5368
5369 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
5370 ///
5371 /// # Example
5372 /// ```ignore,no_run
5373 /// # use google_cloud_cloudsecuritycompliance_v1::model::OperationMetadata;
5374 /// use wkt::Timestamp;
5375 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
5376 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
5377 /// ```
5378 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
5379 where
5380 T: std::convert::Into<wkt::Timestamp>,
5381 {
5382 self.end_time = v.map(|x| x.into());
5383 self
5384 }
5385
5386 /// Sets the value of [target][crate::model::OperationMetadata::target].
5387 ///
5388 /// # Example
5389 /// ```ignore,no_run
5390 /// # use google_cloud_cloudsecuritycompliance_v1::model::OperationMetadata;
5391 /// let x = OperationMetadata::new().set_target("example");
5392 /// ```
5393 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5394 self.target = v.into();
5395 self
5396 }
5397
5398 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
5399 ///
5400 /// # Example
5401 /// ```ignore,no_run
5402 /// # use google_cloud_cloudsecuritycompliance_v1::model::OperationMetadata;
5403 /// let x = OperationMetadata::new().set_verb("example");
5404 /// ```
5405 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5406 self.verb = v.into();
5407 self
5408 }
5409
5410 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
5411 ///
5412 /// # Example
5413 /// ```ignore,no_run
5414 /// # use google_cloud_cloudsecuritycompliance_v1::model::OperationMetadata;
5415 /// let x = OperationMetadata::new().set_status_message("example");
5416 /// ```
5417 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5418 self.status_message = v.into();
5419 self
5420 }
5421
5422 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
5423 ///
5424 /// # Example
5425 /// ```ignore,no_run
5426 /// # use google_cloud_cloudsecuritycompliance_v1::model::OperationMetadata;
5427 /// let x = OperationMetadata::new().set_requested_cancellation(true);
5428 /// ```
5429 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5430 self.requested_cancellation = v.into();
5431 self
5432 }
5433
5434 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
5435 ///
5436 /// # Example
5437 /// ```ignore,no_run
5438 /// # use google_cloud_cloudsecuritycompliance_v1::model::OperationMetadata;
5439 /// let x = OperationMetadata::new().set_api_version("example");
5440 /// ```
5441 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5442 self.api_version = v.into();
5443 self
5444 }
5445}
5446
5447impl wkt::message::Message for OperationMetadata {
5448 fn typename() -> &'static str {
5449 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.OperationMetadata"
5450 }
5451}
5452
5453/// The regulatory control.
5454#[derive(Clone, Default, PartialEq)]
5455#[non_exhaustive]
5456pub struct Control {
5457 /// Output only. The name of a regulatory control, in one of the following
5458 /// formats:
5459 ///
5460 /// - `organizations/{organization}/locations/{location}/controls/{control}`
5461 /// - `projects/{project}/locations/{location}/controls/{control}`.
5462 ///
5463 /// The only supported location is `global`.
5464 pub name: std::string::String,
5465
5466 /// Output only. The friendly name for the regulatory control.
5467 pub display_name: std::string::String,
5468
5469 /// Output only. The description of the regulatory control.
5470 pub description: std::string::String,
5471
5472 /// Output only. The regulatory group that the control belongs to.
5473 pub family: crate::model::control::Family,
5474
5475 /// Output only. The regulatory family that the control belongs to.
5476 pub control_family: std::option::Option<crate::model::ControlFamily>,
5477
5478 /// Output only. The entity that's responsible for the control, whether Google,
5479 /// you as the customer, or both.
5480 pub responsibility_type: crate::model::RegulatoryControlResponsibilityType,
5481
5482 /// Output only. A description of Google's responsibility for the regulatory
5483 /// control.
5484 pub google_responsibility_description: std::string::String,
5485
5486 /// Output only. A description of Google's responsibility for implementing the
5487 /// regulatory control.
5488 pub google_responsibility_implementation: std::string::String,
5489
5490 /// Output only. A description of your responsibility for the regulatory
5491 /// control.
5492 pub customer_responsibility_description: std::string::String,
5493
5494 /// Output only. A description of the your responsibility for implementing the
5495 /// regulatory control.
5496 pub customer_responsibility_implementation: std::string::String,
5497
5498 /// Output only. A description of the responsibility that's shared between
5499 /// Google and you in implementing this control.
5500 pub shared_responsibility_description: std::string::String,
5501
5502 /// Output only. A link to the documentation that's related to this control.
5503 pub additional_content_uri: std::string::String,
5504
5505 /// Output only. The frameworks that include this control.
5506 pub related_frameworks: std::vec::Vec<std::string::String>,
5507
5508 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5509}
5510
5511impl Control {
5512 /// Creates a new default instance.
5513 pub fn new() -> Self {
5514 std::default::Default::default()
5515 }
5516
5517 /// Sets the value of [name][crate::model::Control::name].
5518 ///
5519 /// # Example
5520 /// ```ignore,no_run
5521 /// # use google_cloud_cloudsecuritycompliance_v1::model::Control;
5522 /// # let organization_id = "organization_id";
5523 /// # let location_id = "location_id";
5524 /// # let control_id = "control_id";
5525 /// let x = Control::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/controls/{control_id}"));
5526 /// ```
5527 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5528 self.name = v.into();
5529 self
5530 }
5531
5532 /// Sets the value of [display_name][crate::model::Control::display_name].
5533 ///
5534 /// # Example
5535 /// ```ignore,no_run
5536 /// # use google_cloud_cloudsecuritycompliance_v1::model::Control;
5537 /// let x = Control::new().set_display_name("example");
5538 /// ```
5539 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5540 self.display_name = v.into();
5541 self
5542 }
5543
5544 /// Sets the value of [description][crate::model::Control::description].
5545 ///
5546 /// # Example
5547 /// ```ignore,no_run
5548 /// # use google_cloud_cloudsecuritycompliance_v1::model::Control;
5549 /// let x = Control::new().set_description("example");
5550 /// ```
5551 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5552 self.description = v.into();
5553 self
5554 }
5555
5556 /// Sets the value of [family][crate::model::Control::family].
5557 ///
5558 /// # Example
5559 /// ```ignore,no_run
5560 /// # use google_cloud_cloudsecuritycompliance_v1::model::Control;
5561 /// use google_cloud_cloudsecuritycompliance_v1::model::control::Family;
5562 /// let x0 = Control::new().set_family(Family::Ac);
5563 /// let x1 = Control::new().set_family(Family::At);
5564 /// let x2 = Control::new().set_family(Family::Au);
5565 /// ```
5566 pub fn set_family<T: std::convert::Into<crate::model::control::Family>>(
5567 mut self,
5568 v: T,
5569 ) -> Self {
5570 self.family = v.into();
5571 self
5572 }
5573
5574 /// Sets the value of [control_family][crate::model::Control::control_family].
5575 ///
5576 /// # Example
5577 /// ```ignore,no_run
5578 /// # use google_cloud_cloudsecuritycompliance_v1::model::Control;
5579 /// use google_cloud_cloudsecuritycompliance_v1::model::ControlFamily;
5580 /// let x = Control::new().set_control_family(ControlFamily::default()/* use setters */);
5581 /// ```
5582 pub fn set_control_family<T>(mut self, v: T) -> Self
5583 where
5584 T: std::convert::Into<crate::model::ControlFamily>,
5585 {
5586 self.control_family = std::option::Option::Some(v.into());
5587 self
5588 }
5589
5590 /// Sets or clears the value of [control_family][crate::model::Control::control_family].
5591 ///
5592 /// # Example
5593 /// ```ignore,no_run
5594 /// # use google_cloud_cloudsecuritycompliance_v1::model::Control;
5595 /// use google_cloud_cloudsecuritycompliance_v1::model::ControlFamily;
5596 /// let x = Control::new().set_or_clear_control_family(Some(ControlFamily::default()/* use setters */));
5597 /// let x = Control::new().set_or_clear_control_family(None::<ControlFamily>);
5598 /// ```
5599 pub fn set_or_clear_control_family<T>(mut self, v: std::option::Option<T>) -> Self
5600 where
5601 T: std::convert::Into<crate::model::ControlFamily>,
5602 {
5603 self.control_family = v.map(|x| x.into());
5604 self
5605 }
5606
5607 /// Sets the value of [responsibility_type][crate::model::Control::responsibility_type].
5608 ///
5609 /// # Example
5610 /// ```ignore,no_run
5611 /// # use google_cloud_cloudsecuritycompliance_v1::model::Control;
5612 /// use google_cloud_cloudsecuritycompliance_v1::model::RegulatoryControlResponsibilityType;
5613 /// let x0 = Control::new().set_responsibility_type(RegulatoryControlResponsibilityType::Google);
5614 /// let x1 = Control::new().set_responsibility_type(RegulatoryControlResponsibilityType::Customer);
5615 /// let x2 = Control::new().set_responsibility_type(RegulatoryControlResponsibilityType::Shared);
5616 /// ```
5617 pub fn set_responsibility_type<
5618 T: std::convert::Into<crate::model::RegulatoryControlResponsibilityType>,
5619 >(
5620 mut self,
5621 v: T,
5622 ) -> Self {
5623 self.responsibility_type = v.into();
5624 self
5625 }
5626
5627 /// Sets the value of [google_responsibility_description][crate::model::Control::google_responsibility_description].
5628 ///
5629 /// # Example
5630 /// ```ignore,no_run
5631 /// # use google_cloud_cloudsecuritycompliance_v1::model::Control;
5632 /// let x = Control::new().set_google_responsibility_description("example");
5633 /// ```
5634 pub fn set_google_responsibility_description<T: std::convert::Into<std::string::String>>(
5635 mut self,
5636 v: T,
5637 ) -> Self {
5638 self.google_responsibility_description = v.into();
5639 self
5640 }
5641
5642 /// Sets the value of [google_responsibility_implementation][crate::model::Control::google_responsibility_implementation].
5643 ///
5644 /// # Example
5645 /// ```ignore,no_run
5646 /// # use google_cloud_cloudsecuritycompliance_v1::model::Control;
5647 /// let x = Control::new().set_google_responsibility_implementation("example");
5648 /// ```
5649 pub fn set_google_responsibility_implementation<T: std::convert::Into<std::string::String>>(
5650 mut self,
5651 v: T,
5652 ) -> Self {
5653 self.google_responsibility_implementation = v.into();
5654 self
5655 }
5656
5657 /// Sets the value of [customer_responsibility_description][crate::model::Control::customer_responsibility_description].
5658 ///
5659 /// # Example
5660 /// ```ignore,no_run
5661 /// # use google_cloud_cloudsecuritycompliance_v1::model::Control;
5662 /// let x = Control::new().set_customer_responsibility_description("example");
5663 /// ```
5664 pub fn set_customer_responsibility_description<T: std::convert::Into<std::string::String>>(
5665 mut self,
5666 v: T,
5667 ) -> Self {
5668 self.customer_responsibility_description = v.into();
5669 self
5670 }
5671
5672 /// Sets the value of [customer_responsibility_implementation][crate::model::Control::customer_responsibility_implementation].
5673 ///
5674 /// # Example
5675 /// ```ignore,no_run
5676 /// # use google_cloud_cloudsecuritycompliance_v1::model::Control;
5677 /// let x = Control::new().set_customer_responsibility_implementation("example");
5678 /// ```
5679 pub fn set_customer_responsibility_implementation<
5680 T: std::convert::Into<std::string::String>,
5681 >(
5682 mut self,
5683 v: T,
5684 ) -> Self {
5685 self.customer_responsibility_implementation = v.into();
5686 self
5687 }
5688
5689 /// Sets the value of [shared_responsibility_description][crate::model::Control::shared_responsibility_description].
5690 ///
5691 /// # Example
5692 /// ```ignore,no_run
5693 /// # use google_cloud_cloudsecuritycompliance_v1::model::Control;
5694 /// let x = Control::new().set_shared_responsibility_description("example");
5695 /// ```
5696 pub fn set_shared_responsibility_description<T: std::convert::Into<std::string::String>>(
5697 mut self,
5698 v: T,
5699 ) -> Self {
5700 self.shared_responsibility_description = v.into();
5701 self
5702 }
5703
5704 /// Sets the value of [additional_content_uri][crate::model::Control::additional_content_uri].
5705 ///
5706 /// # Example
5707 /// ```ignore,no_run
5708 /// # use google_cloud_cloudsecuritycompliance_v1::model::Control;
5709 /// let x = Control::new().set_additional_content_uri("example");
5710 /// ```
5711 pub fn set_additional_content_uri<T: std::convert::Into<std::string::String>>(
5712 mut self,
5713 v: T,
5714 ) -> Self {
5715 self.additional_content_uri = v.into();
5716 self
5717 }
5718
5719 /// Sets the value of [related_frameworks][crate::model::Control::related_frameworks].
5720 ///
5721 /// # Example
5722 /// ```ignore,no_run
5723 /// # use google_cloud_cloudsecuritycompliance_v1::model::Control;
5724 /// let x = Control::new().set_related_frameworks(["a", "b", "c"]);
5725 /// ```
5726 pub fn set_related_frameworks<T, V>(mut self, v: T) -> Self
5727 where
5728 T: std::iter::IntoIterator<Item = V>,
5729 V: std::convert::Into<std::string::String>,
5730 {
5731 use std::iter::Iterator;
5732 self.related_frameworks = v.into_iter().map(|i| i.into()).collect();
5733 self
5734 }
5735}
5736
5737impl wkt::message::Message for Control {
5738 fn typename() -> &'static str {
5739 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.Control"
5740 }
5741}
5742
5743/// Defines additional types related to [Control].
5744pub mod control {
5745 #[allow(unused_imports)]
5746 use super::*;
5747
5748 /// The regulatory control family.
5749 ///
5750 /// # Working with unknown values
5751 ///
5752 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5753 /// additional enum variants at any time. Adding new variants is not considered
5754 /// a breaking change. Applications should write their code in anticipation of:
5755 ///
5756 /// - New values appearing in future releases of the client library, **and**
5757 /// - New values received dynamically, without application changes.
5758 ///
5759 /// Please consult the [Working with enums] section in the user guide for some
5760 /// guidelines.
5761 ///
5762 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5763 #[derive(Clone, Debug, PartialEq)]
5764 #[non_exhaustive]
5765 pub enum Family {
5766 /// Default value. This value is unused.
5767 Unspecified,
5768 /// Access control
5769 Ac,
5770 /// Awareness and araining
5771 At,
5772 /// Audit and accountability
5773 Au,
5774 /// Certification, accreditation, and security assessments
5775 Ca,
5776 /// Configuration management
5777 Cm,
5778 /// Contingency planning
5779 Cp,
5780 /// Identification and authentication
5781 Ia,
5782 /// Incident response
5783 Ir,
5784 /// Maintenance
5785 Ma,
5786 /// Media protection
5787 Mp,
5788 /// Physical and environmental protection
5789 Pe,
5790 /// Security planning
5791 Pl,
5792 /// Personnel aecurity
5793 Ps,
5794 /// Risk assessment
5795 Ra,
5796 /// System services and acquisition
5797 Sa,
5798 /// System and communications protection
5799 Sc,
5800 /// System and information integrity
5801 Si,
5802 /// Supply chain risk management
5803 Sr,
5804 /// If set, the enum was initialized with an unknown value.
5805 ///
5806 /// Applications can examine the value using [Family::value] or
5807 /// [Family::name].
5808 UnknownValue(family::UnknownValue),
5809 }
5810
5811 #[doc(hidden)]
5812 pub mod family {
5813 #[allow(unused_imports)]
5814 use super::*;
5815 #[derive(Clone, Debug, PartialEq)]
5816 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5817 }
5818
5819 impl Family {
5820 /// Gets the enum value.
5821 ///
5822 /// Returns `None` if the enum contains an unknown value deserialized from
5823 /// the string representation of enums.
5824 pub fn value(&self) -> std::option::Option<i32> {
5825 match self {
5826 Self::Unspecified => std::option::Option::Some(0),
5827 Self::Ac => std::option::Option::Some(1),
5828 Self::At => std::option::Option::Some(2),
5829 Self::Au => std::option::Option::Some(3),
5830 Self::Ca => std::option::Option::Some(4),
5831 Self::Cm => std::option::Option::Some(5),
5832 Self::Cp => std::option::Option::Some(6),
5833 Self::Ia => std::option::Option::Some(7),
5834 Self::Ir => std::option::Option::Some(8),
5835 Self::Ma => std::option::Option::Some(9),
5836 Self::Mp => std::option::Option::Some(10),
5837 Self::Pe => std::option::Option::Some(11),
5838 Self::Pl => std::option::Option::Some(12),
5839 Self::Ps => std::option::Option::Some(13),
5840 Self::Ra => std::option::Option::Some(14),
5841 Self::Sa => std::option::Option::Some(15),
5842 Self::Sc => std::option::Option::Some(16),
5843 Self::Si => std::option::Option::Some(17),
5844 Self::Sr => std::option::Option::Some(18),
5845 Self::UnknownValue(u) => u.0.value(),
5846 }
5847 }
5848
5849 /// Gets the enum value as a string.
5850 ///
5851 /// Returns `None` if the enum contains an unknown value deserialized from
5852 /// the integer representation of enums.
5853 pub fn name(&self) -> std::option::Option<&str> {
5854 match self {
5855 Self::Unspecified => std::option::Option::Some("FAMILY_UNSPECIFIED"),
5856 Self::Ac => std::option::Option::Some("AC"),
5857 Self::At => std::option::Option::Some("AT"),
5858 Self::Au => std::option::Option::Some("AU"),
5859 Self::Ca => std::option::Option::Some("CA"),
5860 Self::Cm => std::option::Option::Some("CM"),
5861 Self::Cp => std::option::Option::Some("CP"),
5862 Self::Ia => std::option::Option::Some("IA"),
5863 Self::Ir => std::option::Option::Some("IR"),
5864 Self::Ma => std::option::Option::Some("MA"),
5865 Self::Mp => std::option::Option::Some("MP"),
5866 Self::Pe => std::option::Option::Some("PE"),
5867 Self::Pl => std::option::Option::Some("PL"),
5868 Self::Ps => std::option::Option::Some("PS"),
5869 Self::Ra => std::option::Option::Some("RA"),
5870 Self::Sa => std::option::Option::Some("SA"),
5871 Self::Sc => std::option::Option::Some("SC"),
5872 Self::Si => std::option::Option::Some("SI"),
5873 Self::Sr => std::option::Option::Some("SR"),
5874 Self::UnknownValue(u) => u.0.name(),
5875 }
5876 }
5877 }
5878
5879 impl std::default::Default for Family {
5880 fn default() -> Self {
5881 use std::convert::From;
5882 Self::from(0)
5883 }
5884 }
5885
5886 impl std::fmt::Display for Family {
5887 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5888 wkt::internal::display_enum(f, self.name(), self.value())
5889 }
5890 }
5891
5892 impl std::convert::From<i32> for Family {
5893 fn from(value: i32) -> Self {
5894 match value {
5895 0 => Self::Unspecified,
5896 1 => Self::Ac,
5897 2 => Self::At,
5898 3 => Self::Au,
5899 4 => Self::Ca,
5900 5 => Self::Cm,
5901 6 => Self::Cp,
5902 7 => Self::Ia,
5903 8 => Self::Ir,
5904 9 => Self::Ma,
5905 10 => Self::Mp,
5906 11 => Self::Pe,
5907 12 => Self::Pl,
5908 13 => Self::Ps,
5909 14 => Self::Ra,
5910 15 => Self::Sa,
5911 16 => Self::Sc,
5912 17 => Self::Si,
5913 18 => Self::Sr,
5914 _ => Self::UnknownValue(family::UnknownValue(
5915 wkt::internal::UnknownEnumValue::Integer(value),
5916 )),
5917 }
5918 }
5919 }
5920
5921 impl std::convert::From<&str> for Family {
5922 fn from(value: &str) -> Self {
5923 use std::string::ToString;
5924 match value {
5925 "FAMILY_UNSPECIFIED" => Self::Unspecified,
5926 "AC" => Self::Ac,
5927 "AT" => Self::At,
5928 "AU" => Self::Au,
5929 "CA" => Self::Ca,
5930 "CM" => Self::Cm,
5931 "CP" => Self::Cp,
5932 "IA" => Self::Ia,
5933 "IR" => Self::Ir,
5934 "MA" => Self::Ma,
5935 "MP" => Self::Mp,
5936 "PE" => Self::Pe,
5937 "PL" => Self::Pl,
5938 "PS" => Self::Ps,
5939 "RA" => Self::Ra,
5940 "SA" => Self::Sa,
5941 "SC" => Self::Sc,
5942 "SI" => Self::Si,
5943 "SR" => Self::Sr,
5944 _ => Self::UnknownValue(family::UnknownValue(
5945 wkt::internal::UnknownEnumValue::String(value.to_string()),
5946 )),
5947 }
5948 }
5949 }
5950
5951 impl serde::ser::Serialize for Family {
5952 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5953 where
5954 S: serde::Serializer,
5955 {
5956 match self {
5957 Self::Unspecified => serializer.serialize_i32(0),
5958 Self::Ac => serializer.serialize_i32(1),
5959 Self::At => serializer.serialize_i32(2),
5960 Self::Au => serializer.serialize_i32(3),
5961 Self::Ca => serializer.serialize_i32(4),
5962 Self::Cm => serializer.serialize_i32(5),
5963 Self::Cp => serializer.serialize_i32(6),
5964 Self::Ia => serializer.serialize_i32(7),
5965 Self::Ir => serializer.serialize_i32(8),
5966 Self::Ma => serializer.serialize_i32(9),
5967 Self::Mp => serializer.serialize_i32(10),
5968 Self::Pe => serializer.serialize_i32(11),
5969 Self::Pl => serializer.serialize_i32(12),
5970 Self::Ps => serializer.serialize_i32(13),
5971 Self::Ra => serializer.serialize_i32(14),
5972 Self::Sa => serializer.serialize_i32(15),
5973 Self::Sc => serializer.serialize_i32(16),
5974 Self::Si => serializer.serialize_i32(17),
5975 Self::Sr => serializer.serialize_i32(18),
5976 Self::UnknownValue(u) => u.0.serialize(serializer),
5977 }
5978 }
5979 }
5980
5981 impl<'de> serde::de::Deserialize<'de> for Family {
5982 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5983 where
5984 D: serde::Deserializer<'de>,
5985 {
5986 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Family>::new(
5987 ".google.cloud.cloudsecuritycompliance.v1.Control.Family",
5988 ))
5989 }
5990 }
5991}
5992
5993/// The regulatory family of the control.
5994#[derive(Clone, Default, PartialEq)]
5995#[non_exhaustive]
5996pub struct ControlFamily {
5997 /// The identifier for the regulatory control family.
5998 pub family_id: std::string::String,
5999
6000 /// The friendly name for the regulatory control family.
6001 pub display_name: std::string::String,
6002
6003 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6004}
6005
6006impl ControlFamily {
6007 /// Creates a new default instance.
6008 pub fn new() -> Self {
6009 std::default::Default::default()
6010 }
6011
6012 /// Sets the value of [family_id][crate::model::ControlFamily::family_id].
6013 ///
6014 /// # Example
6015 /// ```ignore,no_run
6016 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlFamily;
6017 /// let x = ControlFamily::new().set_family_id("example");
6018 /// ```
6019 pub fn set_family_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6020 self.family_id = v.into();
6021 self
6022 }
6023
6024 /// Sets the value of [display_name][crate::model::ControlFamily::display_name].
6025 ///
6026 /// # Example
6027 /// ```ignore,no_run
6028 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlFamily;
6029 /// let x = ControlFamily::new().set_display_name("example");
6030 /// ```
6031 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6032 self.display_name = v.into();
6033 self
6034 }
6035}
6036
6037impl wkt::message::Message for ControlFamily {
6038 fn typename() -> &'static str {
6039 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ControlFamily"
6040 }
6041}
6042
6043/// Request message for [ListFrameworks][].
6044#[derive(Clone, Default, PartialEq)]
6045#[non_exhaustive]
6046pub struct ListFrameworksRequest {
6047 /// Required. The parent resource name, in one of the following formats:
6048 ///
6049 /// - `organizations/{organization}/locations/{location}`
6050 /// - `projects/{project}/locations/{location}`.
6051 ///
6052 /// The only supported location is `global`.
6053 pub parent: std::string::String,
6054
6055 /// Optional. The maximum number of frameworks to return. The default value is
6056 /// `500`.
6057 ///
6058 /// If you exceed the maximum value of `1000`, then the service uses the
6059 /// maximum value.
6060 pub page_size: i32,
6061
6062 /// Optional. A pagination token returned from a previous request to list
6063 /// frameworks. Provide this token to retrieve the next page of results.
6064 pub page_token: std::string::String,
6065
6066 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6067}
6068
6069impl ListFrameworksRequest {
6070 /// Creates a new default instance.
6071 pub fn new() -> Self {
6072 std::default::Default::default()
6073 }
6074
6075 /// Sets the value of [parent][crate::model::ListFrameworksRequest::parent].
6076 ///
6077 /// # Example
6078 /// ```ignore,no_run
6079 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworksRequest;
6080 /// # let organization_id = "organization_id";
6081 /// # let location_id = "location_id";
6082 /// let x = ListFrameworksRequest::new().set_parent(format!("organizations/{organization_id}/locations/{location_id}"));
6083 /// ```
6084 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6085 self.parent = v.into();
6086 self
6087 }
6088
6089 /// Sets the value of [page_size][crate::model::ListFrameworksRequest::page_size].
6090 ///
6091 /// # Example
6092 /// ```ignore,no_run
6093 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworksRequest;
6094 /// let x = ListFrameworksRequest::new().set_page_size(42);
6095 /// ```
6096 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6097 self.page_size = v.into();
6098 self
6099 }
6100
6101 /// Sets the value of [page_token][crate::model::ListFrameworksRequest::page_token].
6102 ///
6103 /// # Example
6104 /// ```ignore,no_run
6105 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworksRequest;
6106 /// let x = ListFrameworksRequest::new().set_page_token("example");
6107 /// ```
6108 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6109 self.page_token = v.into();
6110 self
6111 }
6112}
6113
6114impl wkt::message::Message for ListFrameworksRequest {
6115 fn typename() -> &'static str {
6116 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFrameworksRequest"
6117 }
6118}
6119
6120/// The response message for [ListFrameworks][].
6121/// Returns a paginated list of Framework resources.
6122#[derive(Clone, Default, PartialEq)]
6123#[non_exhaustive]
6124pub struct ListFrameworksResponse {
6125 /// The list of framework resources.
6126 pub frameworks: std::vec::Vec<crate::model::Framework>,
6127
6128 /// A pagination token. To retrieve the next page of results, call the method
6129 /// again with this token.
6130 pub next_page_token: std::string::String,
6131
6132 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6133}
6134
6135impl ListFrameworksResponse {
6136 /// Creates a new default instance.
6137 pub fn new() -> Self {
6138 std::default::Default::default()
6139 }
6140
6141 /// Sets the value of [frameworks][crate::model::ListFrameworksResponse::frameworks].
6142 ///
6143 /// # Example
6144 /// ```ignore,no_run
6145 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworksResponse;
6146 /// use google_cloud_cloudsecuritycompliance_v1::model::Framework;
6147 /// let x = ListFrameworksResponse::new()
6148 /// .set_frameworks([
6149 /// Framework::default()/* use setters */,
6150 /// Framework::default()/* use (different) setters */,
6151 /// ]);
6152 /// ```
6153 pub fn set_frameworks<T, V>(mut self, v: T) -> Self
6154 where
6155 T: std::iter::IntoIterator<Item = V>,
6156 V: std::convert::Into<crate::model::Framework>,
6157 {
6158 use std::iter::Iterator;
6159 self.frameworks = v.into_iter().map(|i| i.into()).collect();
6160 self
6161 }
6162
6163 /// Sets the value of [next_page_token][crate::model::ListFrameworksResponse::next_page_token].
6164 ///
6165 /// # Example
6166 /// ```ignore,no_run
6167 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworksResponse;
6168 /// let x = ListFrameworksResponse::new().set_next_page_token("example");
6169 /// ```
6170 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6171 self.next_page_token = v.into();
6172 self
6173 }
6174}
6175
6176impl wkt::message::Message for ListFrameworksResponse {
6177 fn typename() -> &'static str {
6178 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFrameworksResponse"
6179 }
6180}
6181
6182#[doc(hidden)]
6183impl google_cloud_gax::paginator::internal::PageableResponse for ListFrameworksResponse {
6184 type PageItem = crate::model::Framework;
6185
6186 fn items(self) -> std::vec::Vec<Self::PageItem> {
6187 self.frameworks
6188 }
6189
6190 fn next_page_token(&self) -> std::string::String {
6191 use std::clone::Clone;
6192 self.next_page_token.clone()
6193 }
6194}
6195
6196/// The request message for [GetFramework][].
6197#[derive(Clone, Default, PartialEq)]
6198#[non_exhaustive]
6199pub struct GetFrameworkRequest {
6200 /// Required. The name of the framework to retrieve, in one of the following
6201 /// formats:
6202 /// `organizations/{organization}/locations/{location}/frameworks/{framework}`
6203 /// or
6204 /// `projects/{project}/locations/{location}/frameworks/{framework}`.
6205 ///
6206 /// The only supported location is `global`.
6207 pub name: std::string::String,
6208
6209 /// Optional. The framework major version to retrieve. If not specified, the
6210 /// most recently updated `revision_id` is retrieved.
6211 pub major_revision_id: i64,
6212
6213 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6214}
6215
6216impl GetFrameworkRequest {
6217 /// Creates a new default instance.
6218 pub fn new() -> Self {
6219 std::default::Default::default()
6220 }
6221
6222 /// Sets the value of [name][crate::model::GetFrameworkRequest::name].
6223 ///
6224 /// # Example
6225 /// ```ignore,no_run
6226 /// # use google_cloud_cloudsecuritycompliance_v1::model::GetFrameworkRequest;
6227 /// # let organization_id = "organization_id";
6228 /// # let location_id = "location_id";
6229 /// # let framework_id = "framework_id";
6230 /// let x = GetFrameworkRequest::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/frameworks/{framework_id}"));
6231 /// ```
6232 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6233 self.name = v.into();
6234 self
6235 }
6236
6237 /// Sets the value of [major_revision_id][crate::model::GetFrameworkRequest::major_revision_id].
6238 ///
6239 /// # Example
6240 /// ```ignore,no_run
6241 /// # use google_cloud_cloudsecuritycompliance_v1::model::GetFrameworkRequest;
6242 /// let x = GetFrameworkRequest::new().set_major_revision_id(42);
6243 /// ```
6244 pub fn set_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6245 self.major_revision_id = v.into();
6246 self
6247 }
6248}
6249
6250impl wkt::message::Message for GetFrameworkRequest {
6251 fn typename() -> &'static str {
6252 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.GetFrameworkRequest"
6253 }
6254}
6255
6256/// The request message for [CreateFramework][].
6257#[derive(Clone, Default, PartialEq)]
6258#[non_exhaustive]
6259pub struct CreateFrameworkRequest {
6260 /// Required. The parent resource name, in one of the following formats:
6261 ///
6262 /// - `organizations/{organization}/locations/{location}`
6263 /// - `projects/{project}/locations/{location}`.
6264 ///
6265 /// The only supported location is `global`.
6266 pub parent: std::string::String,
6267
6268 /// Required. The identifier (ID) of the framework. The ID is not the full name
6269 /// of the framework; it's the last part of the full name of the framework.
6270 pub framework_id: std::string::String,
6271
6272 /// Required. The resource being created.
6273 pub framework: std::option::Option<crate::model::Framework>,
6274
6275 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6276}
6277
6278impl CreateFrameworkRequest {
6279 /// Creates a new default instance.
6280 pub fn new() -> Self {
6281 std::default::Default::default()
6282 }
6283
6284 /// Sets the value of [parent][crate::model::CreateFrameworkRequest::parent].
6285 ///
6286 /// # Example
6287 /// ```ignore,no_run
6288 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkRequest;
6289 /// # let organization_id = "organization_id";
6290 /// # let location_id = "location_id";
6291 /// let x = CreateFrameworkRequest::new().set_parent(format!("organizations/{organization_id}/locations/{location_id}"));
6292 /// ```
6293 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6294 self.parent = v.into();
6295 self
6296 }
6297
6298 /// Sets the value of [framework_id][crate::model::CreateFrameworkRequest::framework_id].
6299 ///
6300 /// # Example
6301 /// ```ignore,no_run
6302 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkRequest;
6303 /// let x = CreateFrameworkRequest::new().set_framework_id("example");
6304 /// ```
6305 pub fn set_framework_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6306 self.framework_id = v.into();
6307 self
6308 }
6309
6310 /// Sets the value of [framework][crate::model::CreateFrameworkRequest::framework].
6311 ///
6312 /// # Example
6313 /// ```ignore,no_run
6314 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkRequest;
6315 /// use google_cloud_cloudsecuritycompliance_v1::model::Framework;
6316 /// let x = CreateFrameworkRequest::new().set_framework(Framework::default()/* use setters */);
6317 /// ```
6318 pub fn set_framework<T>(mut self, v: T) -> Self
6319 where
6320 T: std::convert::Into<crate::model::Framework>,
6321 {
6322 self.framework = std::option::Option::Some(v.into());
6323 self
6324 }
6325
6326 /// Sets or clears the value of [framework][crate::model::CreateFrameworkRequest::framework].
6327 ///
6328 /// # Example
6329 /// ```ignore,no_run
6330 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkRequest;
6331 /// use google_cloud_cloudsecuritycompliance_v1::model::Framework;
6332 /// let x = CreateFrameworkRequest::new().set_or_clear_framework(Some(Framework::default()/* use setters */));
6333 /// let x = CreateFrameworkRequest::new().set_or_clear_framework(None::<Framework>);
6334 /// ```
6335 pub fn set_or_clear_framework<T>(mut self, v: std::option::Option<T>) -> Self
6336 where
6337 T: std::convert::Into<crate::model::Framework>,
6338 {
6339 self.framework = v.map(|x| x.into());
6340 self
6341 }
6342}
6343
6344impl wkt::message::Message for CreateFrameworkRequest {
6345 fn typename() -> &'static str {
6346 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CreateFrameworkRequest"
6347 }
6348}
6349
6350/// The request message for [UpdateFramework][].
6351#[derive(Clone, Default, PartialEq)]
6352#[non_exhaustive]
6353pub struct UpdateFrameworkRequest {
6354 /// Optional. A field mask is used to specify the fields to be overwritten in
6355 /// the framework resource by the update. The fields specified in the
6356 /// `update_mask` are relative to the resource, not the full request. A field
6357 /// is overwritten if it is in the mask. If you don't provide a mask then all
6358 /// fields present in the request will be overwritten.
6359 pub update_mask: std::option::Option<wkt::FieldMask>,
6360
6361 /// Required. The resource that is being updated.
6362 pub framework: std::option::Option<crate::model::Framework>,
6363
6364 /// Optional. The major version ID of the framework to update.
6365 pub major_revision_id: i64,
6366
6367 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6368}
6369
6370impl UpdateFrameworkRequest {
6371 /// Creates a new default instance.
6372 pub fn new() -> Self {
6373 std::default::Default::default()
6374 }
6375
6376 /// Sets the value of [update_mask][crate::model::UpdateFrameworkRequest::update_mask].
6377 ///
6378 /// # Example
6379 /// ```ignore,no_run
6380 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateFrameworkRequest;
6381 /// use wkt::FieldMask;
6382 /// let x = UpdateFrameworkRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6383 /// ```
6384 pub fn set_update_mask<T>(mut self, v: T) -> Self
6385 where
6386 T: std::convert::Into<wkt::FieldMask>,
6387 {
6388 self.update_mask = std::option::Option::Some(v.into());
6389 self
6390 }
6391
6392 /// Sets or clears the value of [update_mask][crate::model::UpdateFrameworkRequest::update_mask].
6393 ///
6394 /// # Example
6395 /// ```ignore,no_run
6396 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateFrameworkRequest;
6397 /// use wkt::FieldMask;
6398 /// let x = UpdateFrameworkRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6399 /// let x = UpdateFrameworkRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6400 /// ```
6401 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6402 where
6403 T: std::convert::Into<wkt::FieldMask>,
6404 {
6405 self.update_mask = v.map(|x| x.into());
6406 self
6407 }
6408
6409 /// Sets the value of [framework][crate::model::UpdateFrameworkRequest::framework].
6410 ///
6411 /// # Example
6412 /// ```ignore,no_run
6413 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateFrameworkRequest;
6414 /// use google_cloud_cloudsecuritycompliance_v1::model::Framework;
6415 /// let x = UpdateFrameworkRequest::new().set_framework(Framework::default()/* use setters */);
6416 /// ```
6417 pub fn set_framework<T>(mut self, v: T) -> Self
6418 where
6419 T: std::convert::Into<crate::model::Framework>,
6420 {
6421 self.framework = std::option::Option::Some(v.into());
6422 self
6423 }
6424
6425 /// Sets or clears the value of [framework][crate::model::UpdateFrameworkRequest::framework].
6426 ///
6427 /// # Example
6428 /// ```ignore,no_run
6429 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateFrameworkRequest;
6430 /// use google_cloud_cloudsecuritycompliance_v1::model::Framework;
6431 /// let x = UpdateFrameworkRequest::new().set_or_clear_framework(Some(Framework::default()/* use setters */));
6432 /// let x = UpdateFrameworkRequest::new().set_or_clear_framework(None::<Framework>);
6433 /// ```
6434 pub fn set_or_clear_framework<T>(mut self, v: std::option::Option<T>) -> Self
6435 where
6436 T: std::convert::Into<crate::model::Framework>,
6437 {
6438 self.framework = v.map(|x| x.into());
6439 self
6440 }
6441
6442 /// Sets the value of [major_revision_id][crate::model::UpdateFrameworkRequest::major_revision_id].
6443 ///
6444 /// # Example
6445 /// ```ignore,no_run
6446 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateFrameworkRequest;
6447 /// let x = UpdateFrameworkRequest::new().set_major_revision_id(42);
6448 /// ```
6449 pub fn set_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6450 self.major_revision_id = v.into();
6451 self
6452 }
6453}
6454
6455impl wkt::message::Message for UpdateFrameworkRequest {
6456 fn typename() -> &'static str {
6457 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.UpdateFrameworkRequest"
6458 }
6459}
6460
6461/// Request message for [DeleteFramework][].
6462#[derive(Clone, Default, PartialEq)]
6463#[non_exhaustive]
6464pub struct DeleteFrameworkRequest {
6465 /// Required. The name of the resource, in one of the following formats:
6466 /// `organizations/{organization}/locations/{location}/frameworks/{framework}`
6467 /// or
6468 /// `projects/{project}/locations/{location}/frameworks/{framework}`.
6469 ///
6470 /// The only supported location is `global`.
6471 pub name: std::string::String,
6472
6473 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6474}
6475
6476impl DeleteFrameworkRequest {
6477 /// Creates a new default instance.
6478 pub fn new() -> Self {
6479 std::default::Default::default()
6480 }
6481
6482 /// Sets the value of [name][crate::model::DeleteFrameworkRequest::name].
6483 ///
6484 /// # Example
6485 /// ```ignore,no_run
6486 /// # use google_cloud_cloudsecuritycompliance_v1::model::DeleteFrameworkRequest;
6487 /// # let organization_id = "organization_id";
6488 /// # let location_id = "location_id";
6489 /// # let framework_id = "framework_id";
6490 /// let x = DeleteFrameworkRequest::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/frameworks/{framework_id}"));
6491 /// ```
6492 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6493 self.name = v.into();
6494 self
6495 }
6496}
6497
6498impl wkt::message::Message for DeleteFrameworkRequest {
6499 fn typename() -> &'static str {
6500 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.DeleteFrameworkRequest"
6501 }
6502}
6503
6504/// Request message for [ListCloudControls][].
6505#[derive(Clone, Default, PartialEq)]
6506#[non_exhaustive]
6507pub struct ListCloudControlsRequest {
6508 /// Required. The parent resource name, in one of the following formats:
6509 ///
6510 /// - `organizations/{organization}/locations/{location}`
6511 /// - `projects/{project}/locations/{location}`.
6512 ///
6513 /// The only supported location is `global`.
6514 pub parent: std::string::String,
6515
6516 /// Optional. The maximum number of cloud controls to return. The default value
6517 /// is `500`.
6518 ///
6519 /// If you exceed the maximum value of `1000`, then the service uses the
6520 /// maximum value.
6521 pub page_size: i32,
6522
6523 /// Optional. A pagination token that's returned from a previous request to
6524 /// list cloud controls. Provide this token to retrieve the next page of
6525 /// results.
6526 ///
6527 /// When paginating, the parent that you provide to the
6528 /// [ListCloudControls][google.cloud.cloudsecuritycompliance.v1.Config.ListCloudControls]
6529 /// request must match the call that provided the page token.
6530 ///
6531 /// [google.cloud.cloudsecuritycompliance.v1.Config.ListCloudControls]: crate::client::Config::list_cloud_controls
6532 pub page_token: std::string::String,
6533
6534 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6535}
6536
6537impl ListCloudControlsRequest {
6538 /// Creates a new default instance.
6539 pub fn new() -> Self {
6540 std::default::Default::default()
6541 }
6542
6543 /// Sets the value of [parent][crate::model::ListCloudControlsRequest::parent].
6544 ///
6545 /// # Example
6546 /// ```ignore,no_run
6547 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlsRequest;
6548 /// # let organization_id = "organization_id";
6549 /// # let location_id = "location_id";
6550 /// let x = ListCloudControlsRequest::new().set_parent(format!("organizations/{organization_id}/locations/{location_id}"));
6551 /// ```
6552 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6553 self.parent = v.into();
6554 self
6555 }
6556
6557 /// Sets the value of [page_size][crate::model::ListCloudControlsRequest::page_size].
6558 ///
6559 /// # Example
6560 /// ```ignore,no_run
6561 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlsRequest;
6562 /// let x = ListCloudControlsRequest::new().set_page_size(42);
6563 /// ```
6564 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6565 self.page_size = v.into();
6566 self
6567 }
6568
6569 /// Sets the value of [page_token][crate::model::ListCloudControlsRequest::page_token].
6570 ///
6571 /// # Example
6572 /// ```ignore,no_run
6573 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlsRequest;
6574 /// let x = ListCloudControlsRequest::new().set_page_token("example");
6575 /// ```
6576 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6577 self.page_token = v.into();
6578 self
6579 }
6580}
6581
6582impl wkt::message::Message for ListCloudControlsRequest {
6583 fn typename() -> &'static str {
6584 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListCloudControlsRequest"
6585 }
6586}
6587
6588/// The response message for [ListCloudControls][].
6589#[derive(Clone, Default, PartialEq)]
6590#[non_exhaustive]
6591pub struct ListCloudControlsResponse {
6592 /// The list of CloudControl resources.
6593 pub cloud_controls: std::vec::Vec<crate::model::CloudControl>,
6594
6595 /// A pagination token. To retrieve the next page of results, call the method
6596 /// again with this token.
6597 pub next_page_token: std::string::String,
6598
6599 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6600}
6601
6602impl ListCloudControlsResponse {
6603 /// Creates a new default instance.
6604 pub fn new() -> Self {
6605 std::default::Default::default()
6606 }
6607
6608 /// Sets the value of [cloud_controls][crate::model::ListCloudControlsResponse::cloud_controls].
6609 ///
6610 /// # Example
6611 /// ```ignore,no_run
6612 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlsResponse;
6613 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
6614 /// let x = ListCloudControlsResponse::new()
6615 /// .set_cloud_controls([
6616 /// CloudControl::default()/* use setters */,
6617 /// CloudControl::default()/* use (different) setters */,
6618 /// ]);
6619 /// ```
6620 pub fn set_cloud_controls<T, V>(mut self, v: T) -> Self
6621 where
6622 T: std::iter::IntoIterator<Item = V>,
6623 V: std::convert::Into<crate::model::CloudControl>,
6624 {
6625 use std::iter::Iterator;
6626 self.cloud_controls = v.into_iter().map(|i| i.into()).collect();
6627 self
6628 }
6629
6630 /// Sets the value of [next_page_token][crate::model::ListCloudControlsResponse::next_page_token].
6631 ///
6632 /// # Example
6633 /// ```ignore,no_run
6634 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlsResponse;
6635 /// let x = ListCloudControlsResponse::new().set_next_page_token("example");
6636 /// ```
6637 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6638 self.next_page_token = v.into();
6639 self
6640 }
6641}
6642
6643impl wkt::message::Message for ListCloudControlsResponse {
6644 fn typename() -> &'static str {
6645 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListCloudControlsResponse"
6646 }
6647}
6648
6649#[doc(hidden)]
6650impl google_cloud_gax::paginator::internal::PageableResponse for ListCloudControlsResponse {
6651 type PageItem = crate::model::CloudControl;
6652
6653 fn items(self) -> std::vec::Vec<Self::PageItem> {
6654 self.cloud_controls
6655 }
6656
6657 fn next_page_token(&self) -> std::string::String {
6658 use std::clone::Clone;
6659 self.next_page_token.clone()
6660 }
6661}
6662
6663/// The request message for [GetCloudControl][].
6664#[derive(Clone, Default, PartialEq)]
6665#[non_exhaustive]
6666pub struct GetCloudControlRequest {
6667 /// Required. The name of the cloud control to retrieve, in one of the
6668 /// following formats:
6669 /// `organizations/{organization}/locations/{location}/cloudControls/{cloud_control}`
6670 /// or
6671 /// `projects/{project}/locations/{location}/cloudControls/{cloud_control}`.
6672 ///
6673 /// The only supported location is `global`.
6674 pub name: std::string::String,
6675
6676 /// Optional. The major version of the cloud control to retrieve. If not
6677 /// specified, the most recently updated `revision_id` is retrieved.
6678 pub major_revision_id: i64,
6679
6680 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6681}
6682
6683impl GetCloudControlRequest {
6684 /// Creates a new default instance.
6685 pub fn new() -> Self {
6686 std::default::Default::default()
6687 }
6688
6689 /// Sets the value of [name][crate::model::GetCloudControlRequest::name].
6690 ///
6691 /// # Example
6692 /// ```ignore,no_run
6693 /// # use google_cloud_cloudsecuritycompliance_v1::model::GetCloudControlRequest;
6694 /// # let organization_id = "organization_id";
6695 /// # let location_id = "location_id";
6696 /// # let cloud_control_id = "cloud_control_id";
6697 /// let x = GetCloudControlRequest::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/cloudControls/{cloud_control_id}"));
6698 /// ```
6699 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6700 self.name = v.into();
6701 self
6702 }
6703
6704 /// Sets the value of [major_revision_id][crate::model::GetCloudControlRequest::major_revision_id].
6705 ///
6706 /// # Example
6707 /// ```ignore,no_run
6708 /// # use google_cloud_cloudsecuritycompliance_v1::model::GetCloudControlRequest;
6709 /// let x = GetCloudControlRequest::new().set_major_revision_id(42);
6710 /// ```
6711 pub fn set_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
6712 self.major_revision_id = v.into();
6713 self
6714 }
6715}
6716
6717impl wkt::message::Message for GetCloudControlRequest {
6718 fn typename() -> &'static str {
6719 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.GetCloudControlRequest"
6720 }
6721}
6722
6723/// The request message for [CreateCloudControl][].
6724#[derive(Clone, Default, PartialEq)]
6725#[non_exhaustive]
6726pub struct CreateCloudControlRequest {
6727 /// Required. The parent resource name, in one of the following formats:
6728 ///
6729 /// - `organizations/{organization}/locations/{location}`.
6730 /// - `projects/{project}/locations/{location}`.
6731 ///
6732 /// The only supported location is `global`.
6733 pub parent: std::string::String,
6734
6735 /// Required. The identifier for the cloud control, which is the last segment
6736 /// of the cloud control name. The format is
6737 /// `^[a-zA-Z][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]$`.
6738 pub cloud_control_id: std::string::String,
6739
6740 /// Required. The cloud control that's being created.
6741 pub cloud_control: std::option::Option<crate::model::CloudControl>,
6742
6743 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6744}
6745
6746impl CreateCloudControlRequest {
6747 /// Creates a new default instance.
6748 pub fn new() -> Self {
6749 std::default::Default::default()
6750 }
6751
6752 /// Sets the value of [parent][crate::model::CreateCloudControlRequest::parent].
6753 ///
6754 /// # Example
6755 /// ```ignore,no_run
6756 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateCloudControlRequest;
6757 /// # let organization_id = "organization_id";
6758 /// # let location_id = "location_id";
6759 /// let x = CreateCloudControlRequest::new().set_parent(format!("organizations/{organization_id}/locations/{location_id}"));
6760 /// ```
6761 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6762 self.parent = v.into();
6763 self
6764 }
6765
6766 /// Sets the value of [cloud_control_id][crate::model::CreateCloudControlRequest::cloud_control_id].
6767 ///
6768 /// # Example
6769 /// ```ignore,no_run
6770 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateCloudControlRequest;
6771 /// let x = CreateCloudControlRequest::new().set_cloud_control_id("example");
6772 /// ```
6773 pub fn set_cloud_control_id<T: std::convert::Into<std::string::String>>(
6774 mut self,
6775 v: T,
6776 ) -> Self {
6777 self.cloud_control_id = v.into();
6778 self
6779 }
6780
6781 /// Sets the value of [cloud_control][crate::model::CreateCloudControlRequest::cloud_control].
6782 ///
6783 /// # Example
6784 /// ```ignore,no_run
6785 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateCloudControlRequest;
6786 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
6787 /// let x = CreateCloudControlRequest::new().set_cloud_control(CloudControl::default()/* use setters */);
6788 /// ```
6789 pub fn set_cloud_control<T>(mut self, v: T) -> Self
6790 where
6791 T: std::convert::Into<crate::model::CloudControl>,
6792 {
6793 self.cloud_control = std::option::Option::Some(v.into());
6794 self
6795 }
6796
6797 /// Sets or clears the value of [cloud_control][crate::model::CreateCloudControlRequest::cloud_control].
6798 ///
6799 /// # Example
6800 /// ```ignore,no_run
6801 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateCloudControlRequest;
6802 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
6803 /// let x = CreateCloudControlRequest::new().set_or_clear_cloud_control(Some(CloudControl::default()/* use setters */));
6804 /// let x = CreateCloudControlRequest::new().set_or_clear_cloud_control(None::<CloudControl>);
6805 /// ```
6806 pub fn set_or_clear_cloud_control<T>(mut self, v: std::option::Option<T>) -> Self
6807 where
6808 T: std::convert::Into<crate::model::CloudControl>,
6809 {
6810 self.cloud_control = v.map(|x| x.into());
6811 self
6812 }
6813}
6814
6815impl wkt::message::Message for CreateCloudControlRequest {
6816 fn typename() -> &'static str {
6817 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CreateCloudControlRequest"
6818 }
6819}
6820
6821/// The request message for [UpdateCloudControl][].
6822#[derive(Clone, Default, PartialEq)]
6823#[non_exhaustive]
6824pub struct UpdateCloudControlRequest {
6825 /// Optional. Use a field mask to specify the fields to be overwritten in the
6826 /// cloud control during the update.
6827 /// The fields that you specify in the `update_mask` are relative to the
6828 /// cloud control, not the full request. A field is overwritten if it is in
6829 /// the mask. If you don't provide a mask, all fields in the request
6830 /// are updated.
6831 ///
6832 /// You can update the following fields:
6833 ///
6834 /// - Display name
6835 /// - Description
6836 /// - Parameters
6837 /// - Rules
6838 /// - Parameter specification
6839 pub update_mask: std::option::Option<wkt::FieldMask>,
6840
6841 /// Required. The cloud control that you're updating.
6842 pub cloud_control: std::option::Option<crate::model::CloudControl>,
6843
6844 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6845}
6846
6847impl UpdateCloudControlRequest {
6848 /// Creates a new default instance.
6849 pub fn new() -> Self {
6850 std::default::Default::default()
6851 }
6852
6853 /// Sets the value of [update_mask][crate::model::UpdateCloudControlRequest::update_mask].
6854 ///
6855 /// # Example
6856 /// ```ignore,no_run
6857 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateCloudControlRequest;
6858 /// use wkt::FieldMask;
6859 /// let x = UpdateCloudControlRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6860 /// ```
6861 pub fn set_update_mask<T>(mut self, v: T) -> Self
6862 where
6863 T: std::convert::Into<wkt::FieldMask>,
6864 {
6865 self.update_mask = std::option::Option::Some(v.into());
6866 self
6867 }
6868
6869 /// Sets or clears the value of [update_mask][crate::model::UpdateCloudControlRequest::update_mask].
6870 ///
6871 /// # Example
6872 /// ```ignore,no_run
6873 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateCloudControlRequest;
6874 /// use wkt::FieldMask;
6875 /// let x = UpdateCloudControlRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6876 /// let x = UpdateCloudControlRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6877 /// ```
6878 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6879 where
6880 T: std::convert::Into<wkt::FieldMask>,
6881 {
6882 self.update_mask = v.map(|x| x.into());
6883 self
6884 }
6885
6886 /// Sets the value of [cloud_control][crate::model::UpdateCloudControlRequest::cloud_control].
6887 ///
6888 /// # Example
6889 /// ```ignore,no_run
6890 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateCloudControlRequest;
6891 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
6892 /// let x = UpdateCloudControlRequest::new().set_cloud_control(CloudControl::default()/* use setters */);
6893 /// ```
6894 pub fn set_cloud_control<T>(mut self, v: T) -> Self
6895 where
6896 T: std::convert::Into<crate::model::CloudControl>,
6897 {
6898 self.cloud_control = std::option::Option::Some(v.into());
6899 self
6900 }
6901
6902 /// Sets or clears the value of [cloud_control][crate::model::UpdateCloudControlRequest::cloud_control].
6903 ///
6904 /// # Example
6905 /// ```ignore,no_run
6906 /// # use google_cloud_cloudsecuritycompliance_v1::model::UpdateCloudControlRequest;
6907 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
6908 /// let x = UpdateCloudControlRequest::new().set_or_clear_cloud_control(Some(CloudControl::default()/* use setters */));
6909 /// let x = UpdateCloudControlRequest::new().set_or_clear_cloud_control(None::<CloudControl>);
6910 /// ```
6911 pub fn set_or_clear_cloud_control<T>(mut self, v: std::option::Option<T>) -> Self
6912 where
6913 T: std::convert::Into<crate::model::CloudControl>,
6914 {
6915 self.cloud_control = v.map(|x| x.into());
6916 self
6917 }
6918}
6919
6920impl wkt::message::Message for UpdateCloudControlRequest {
6921 fn typename() -> &'static str {
6922 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.UpdateCloudControlRequest"
6923 }
6924}
6925
6926/// The request message for [DeleteCloudControl][].
6927#[derive(Clone, Default, PartialEq)]
6928#[non_exhaustive]
6929pub struct DeleteCloudControlRequest {
6930 /// Required. The name of the cloud control to delete, in one of the following
6931 /// formats:
6932 /// `organizations/{organization}/locations/{location}/CloudControls/{CloudControl}`
6933 /// or
6934 /// `projects/{project}/locations/{location}/CloudControls/{CloudControl}`.
6935 ///
6936 /// The only supported location is `global`.
6937 pub name: std::string::String,
6938
6939 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6940}
6941
6942impl DeleteCloudControlRequest {
6943 /// Creates a new default instance.
6944 pub fn new() -> Self {
6945 std::default::Default::default()
6946 }
6947
6948 /// Sets the value of [name][crate::model::DeleteCloudControlRequest::name].
6949 ///
6950 /// # Example
6951 /// ```ignore,no_run
6952 /// # use google_cloud_cloudsecuritycompliance_v1::model::DeleteCloudControlRequest;
6953 /// # let organization_id = "organization_id";
6954 /// # let location_id = "location_id";
6955 /// # let cloud_control_id = "cloud_control_id";
6956 /// let x = DeleteCloudControlRequest::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/cloudControls/{cloud_control_id}"));
6957 /// ```
6958 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6959 self.name = v.into();
6960 self
6961 }
6962}
6963
6964impl wkt::message::Message for DeleteCloudControlRequest {
6965 fn typename() -> &'static str {
6966 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.DeleteCloudControlRequest"
6967 }
6968}
6969
6970/// Framework deployments represent the assignment of a framework to a target
6971/// resource. Supported target resources are organizations, folders, and
6972/// projects.
6973#[derive(Clone, Default, PartialEq)]
6974#[non_exhaustive]
6975pub struct FrameworkDeployment {
6976 /// Identifier. The name of the framework deployment, in the format
6977 /// `organizations/{organization}/locations/{location}/frameworkDeployments/{framework_deployment}`
6978 /// or
6979 /// `projects/{project}/locations/{location}/frameworkDeployments/{framework_deployment}`.
6980 /// The only supported location is `global`.
6981 pub name: std::string::String,
6982
6983 /// Required. The details of the target resource that you want to deploy the
6984 /// framework to. You can specify an existing resource, or create a new one.
6985 pub target_resource_config: std::option::Option<crate::model::TargetResourceConfig>,
6986
6987 /// Output only. The target resource to deploy the framework to, in one the
6988 /// following formats:
6989 ///
6990 /// - `organizations/{organizationID}`
6991 /// - `folders/{folderID}`
6992 /// - `projects/{projectID}`
6993 pub computed_target_resource: std::string::String,
6994
6995 /// Required. A reference to the framework that you're deploying.
6996 pub framework: std::option::Option<crate::model::FrameworkReference>,
6997
6998 /// Optional. A user-provided description of the framework deployment.
6999 pub description: std::string::String,
7000
7001 /// Required. The deployment mode and parameters for each of the cloud controls
7002 /// in the framework. Every cloud control in the framework includes metadata.
7003 pub cloud_control_metadata: std::vec::Vec<crate::model::CloudControlMetadata>,
7004
7005 /// Output only. The state for the framework deployment.
7006 pub deployment_state: crate::model::DeploymentState,
7007
7008 /// Output only. The time at which the resource was created.
7009 pub create_time: std::option::Option<wkt::Timestamp>,
7010
7011 /// Output only. The time at which the resource last updated.
7012 pub update_time: std::option::Option<wkt::Timestamp>,
7013
7014 /// Optional. To prevent concurrent updates from overwriting each other, always
7015 /// provide the `etag` when you update a framework deployment. You can also
7016 /// provide the `etag` when you delete a framework deployment, to help
7017 /// ensure that you're deleting the intended version of the
7018 /// framework deployment.
7019 pub etag: std::string::String,
7020
7021 /// Output only. The display name of the target resource.
7022 pub target_resource_display_name: std::string::String,
7023
7024 /// Output only. The references to the cloud control deployments. The reference
7025 /// includes all the cloud control deployments that are in the framework or in
7026 /// a cloud control group.
7027 ///
7028 /// For example, if a framework deployment deploys two
7029 /// cloud controls, `cc-deployment-1` and `cc-deployment-2`, then the
7030 /// references are:
7031 ///
7032 /// ```norust
7033 /// {
7034 /// cloud_control_deployment_reference: {
7035 /// cloud_control_deployment:
7036 /// "organizations/{organization}/locations/{location}/cloudControlDeployments/cc-deployment-1"
7037 /// },
7038 /// cloud_control_deployment_reference: {
7039 /// cloud_control_deployment:
7040 /// "organizations/{organization}/locations/{location}/cloudControlDeployments/cc-deployment-2"
7041 /// }
7042 /// ```
7043 pub cloud_control_deployment_references:
7044 std::vec::Vec<crate::model::CloudControlDeploymentReference>,
7045
7046 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7047}
7048
7049impl FrameworkDeployment {
7050 /// Creates a new default instance.
7051 pub fn new() -> Self {
7052 std::default::Default::default()
7053 }
7054
7055 /// Sets the value of [name][crate::model::FrameworkDeployment::name].
7056 ///
7057 /// # Example
7058 /// ```ignore,no_run
7059 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
7060 /// # let organization_id = "organization_id";
7061 /// # let location_id = "location_id";
7062 /// # let framework_deployment_id = "framework_deployment_id";
7063 /// let x = FrameworkDeployment::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/frameworkDeployments/{framework_deployment_id}"));
7064 /// ```
7065 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7066 self.name = v.into();
7067 self
7068 }
7069
7070 /// Sets the value of [target_resource_config][crate::model::FrameworkDeployment::target_resource_config].
7071 ///
7072 /// # Example
7073 /// ```ignore,no_run
7074 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
7075 /// use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceConfig;
7076 /// let x = FrameworkDeployment::new().set_target_resource_config(TargetResourceConfig::default()/* use setters */);
7077 /// ```
7078 pub fn set_target_resource_config<T>(mut self, v: T) -> Self
7079 where
7080 T: std::convert::Into<crate::model::TargetResourceConfig>,
7081 {
7082 self.target_resource_config = std::option::Option::Some(v.into());
7083 self
7084 }
7085
7086 /// Sets or clears the value of [target_resource_config][crate::model::FrameworkDeployment::target_resource_config].
7087 ///
7088 /// # Example
7089 /// ```ignore,no_run
7090 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
7091 /// use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceConfig;
7092 /// let x = FrameworkDeployment::new().set_or_clear_target_resource_config(Some(TargetResourceConfig::default()/* use setters */));
7093 /// let x = FrameworkDeployment::new().set_or_clear_target_resource_config(None::<TargetResourceConfig>);
7094 /// ```
7095 pub fn set_or_clear_target_resource_config<T>(mut self, v: std::option::Option<T>) -> Self
7096 where
7097 T: std::convert::Into<crate::model::TargetResourceConfig>,
7098 {
7099 self.target_resource_config = v.map(|x| x.into());
7100 self
7101 }
7102
7103 /// Sets the value of [computed_target_resource][crate::model::FrameworkDeployment::computed_target_resource].
7104 ///
7105 /// # Example
7106 /// ```ignore,no_run
7107 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
7108 /// let x = FrameworkDeployment::new().set_computed_target_resource("example");
7109 /// ```
7110 pub fn set_computed_target_resource<T: std::convert::Into<std::string::String>>(
7111 mut self,
7112 v: T,
7113 ) -> Self {
7114 self.computed_target_resource = v.into();
7115 self
7116 }
7117
7118 /// Sets the value of [framework][crate::model::FrameworkDeployment::framework].
7119 ///
7120 /// # Example
7121 /// ```ignore,no_run
7122 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
7123 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkReference;
7124 /// let x = FrameworkDeployment::new().set_framework(FrameworkReference::default()/* use setters */);
7125 /// ```
7126 pub fn set_framework<T>(mut self, v: T) -> Self
7127 where
7128 T: std::convert::Into<crate::model::FrameworkReference>,
7129 {
7130 self.framework = std::option::Option::Some(v.into());
7131 self
7132 }
7133
7134 /// Sets or clears the value of [framework][crate::model::FrameworkDeployment::framework].
7135 ///
7136 /// # Example
7137 /// ```ignore,no_run
7138 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
7139 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkReference;
7140 /// let x = FrameworkDeployment::new().set_or_clear_framework(Some(FrameworkReference::default()/* use setters */));
7141 /// let x = FrameworkDeployment::new().set_or_clear_framework(None::<FrameworkReference>);
7142 /// ```
7143 pub fn set_or_clear_framework<T>(mut self, v: std::option::Option<T>) -> Self
7144 where
7145 T: std::convert::Into<crate::model::FrameworkReference>,
7146 {
7147 self.framework = v.map(|x| x.into());
7148 self
7149 }
7150
7151 /// Sets the value of [description][crate::model::FrameworkDeployment::description].
7152 ///
7153 /// # Example
7154 /// ```ignore,no_run
7155 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
7156 /// let x = FrameworkDeployment::new().set_description("example");
7157 /// ```
7158 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7159 self.description = v.into();
7160 self
7161 }
7162
7163 /// Sets the value of [cloud_control_metadata][crate::model::FrameworkDeployment::cloud_control_metadata].
7164 ///
7165 /// # Example
7166 /// ```ignore,no_run
7167 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
7168 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlMetadata;
7169 /// let x = FrameworkDeployment::new()
7170 /// .set_cloud_control_metadata([
7171 /// CloudControlMetadata::default()/* use setters */,
7172 /// CloudControlMetadata::default()/* use (different) setters */,
7173 /// ]);
7174 /// ```
7175 pub fn set_cloud_control_metadata<T, V>(mut self, v: T) -> Self
7176 where
7177 T: std::iter::IntoIterator<Item = V>,
7178 V: std::convert::Into<crate::model::CloudControlMetadata>,
7179 {
7180 use std::iter::Iterator;
7181 self.cloud_control_metadata = v.into_iter().map(|i| i.into()).collect();
7182 self
7183 }
7184
7185 /// Sets the value of [deployment_state][crate::model::FrameworkDeployment::deployment_state].
7186 ///
7187 /// # Example
7188 /// ```ignore,no_run
7189 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
7190 /// use google_cloud_cloudsecuritycompliance_v1::model::DeploymentState;
7191 /// let x0 = FrameworkDeployment::new().set_deployment_state(DeploymentState::Validating);
7192 /// let x1 = FrameworkDeployment::new().set_deployment_state(DeploymentState::Creating);
7193 /// let x2 = FrameworkDeployment::new().set_deployment_state(DeploymentState::Deleting);
7194 /// ```
7195 pub fn set_deployment_state<T: std::convert::Into<crate::model::DeploymentState>>(
7196 mut self,
7197 v: T,
7198 ) -> Self {
7199 self.deployment_state = v.into();
7200 self
7201 }
7202
7203 /// Sets the value of [create_time][crate::model::FrameworkDeployment::create_time].
7204 ///
7205 /// # Example
7206 /// ```ignore,no_run
7207 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
7208 /// use wkt::Timestamp;
7209 /// let x = FrameworkDeployment::new().set_create_time(Timestamp::default()/* use setters */);
7210 /// ```
7211 pub fn set_create_time<T>(mut self, v: T) -> Self
7212 where
7213 T: std::convert::Into<wkt::Timestamp>,
7214 {
7215 self.create_time = std::option::Option::Some(v.into());
7216 self
7217 }
7218
7219 /// Sets or clears the value of [create_time][crate::model::FrameworkDeployment::create_time].
7220 ///
7221 /// # Example
7222 /// ```ignore,no_run
7223 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
7224 /// use wkt::Timestamp;
7225 /// let x = FrameworkDeployment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7226 /// let x = FrameworkDeployment::new().set_or_clear_create_time(None::<Timestamp>);
7227 /// ```
7228 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7229 where
7230 T: std::convert::Into<wkt::Timestamp>,
7231 {
7232 self.create_time = v.map(|x| x.into());
7233 self
7234 }
7235
7236 /// Sets the value of [update_time][crate::model::FrameworkDeployment::update_time].
7237 ///
7238 /// # Example
7239 /// ```ignore,no_run
7240 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
7241 /// use wkt::Timestamp;
7242 /// let x = FrameworkDeployment::new().set_update_time(Timestamp::default()/* use setters */);
7243 /// ```
7244 pub fn set_update_time<T>(mut self, v: T) -> Self
7245 where
7246 T: std::convert::Into<wkt::Timestamp>,
7247 {
7248 self.update_time = std::option::Option::Some(v.into());
7249 self
7250 }
7251
7252 /// Sets or clears the value of [update_time][crate::model::FrameworkDeployment::update_time].
7253 ///
7254 /// # Example
7255 /// ```ignore,no_run
7256 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
7257 /// use wkt::Timestamp;
7258 /// let x = FrameworkDeployment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7259 /// let x = FrameworkDeployment::new().set_or_clear_update_time(None::<Timestamp>);
7260 /// ```
7261 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7262 where
7263 T: std::convert::Into<wkt::Timestamp>,
7264 {
7265 self.update_time = v.map(|x| x.into());
7266 self
7267 }
7268
7269 /// Sets the value of [etag][crate::model::FrameworkDeployment::etag].
7270 ///
7271 /// # Example
7272 /// ```ignore,no_run
7273 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
7274 /// let x = FrameworkDeployment::new().set_etag("example");
7275 /// ```
7276 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7277 self.etag = v.into();
7278 self
7279 }
7280
7281 /// Sets the value of [target_resource_display_name][crate::model::FrameworkDeployment::target_resource_display_name].
7282 ///
7283 /// # Example
7284 /// ```ignore,no_run
7285 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
7286 /// let x = FrameworkDeployment::new().set_target_resource_display_name("example");
7287 /// ```
7288 pub fn set_target_resource_display_name<T: std::convert::Into<std::string::String>>(
7289 mut self,
7290 v: T,
7291 ) -> Self {
7292 self.target_resource_display_name = v.into();
7293 self
7294 }
7295
7296 /// Sets the value of [cloud_control_deployment_references][crate::model::FrameworkDeployment::cloud_control_deployment_references].
7297 ///
7298 /// # Example
7299 /// ```ignore,no_run
7300 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
7301 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeploymentReference;
7302 /// let x = FrameworkDeployment::new()
7303 /// .set_cloud_control_deployment_references([
7304 /// CloudControlDeploymentReference::default()/* use setters */,
7305 /// CloudControlDeploymentReference::default()/* use (different) setters */,
7306 /// ]);
7307 /// ```
7308 pub fn set_cloud_control_deployment_references<T, V>(mut self, v: T) -> Self
7309 where
7310 T: std::iter::IntoIterator<Item = V>,
7311 V: std::convert::Into<crate::model::CloudControlDeploymentReference>,
7312 {
7313 use std::iter::Iterator;
7314 self.cloud_control_deployment_references = v.into_iter().map(|i| i.into()).collect();
7315 self
7316 }
7317}
7318
7319impl wkt::message::Message for FrameworkDeployment {
7320 fn typename() -> &'static str {
7321 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FrameworkDeployment"
7322 }
7323}
7324
7325/// A cloud control deployment represents the deployment of a particular cloud
7326/// control on a target resource. Supported target resources are
7327/// `organizations/{organizationID}`, `folders/{folderID}`, and
7328/// `projects/{projectID}`.
7329#[derive(Clone, Default, PartialEq)]
7330#[non_exhaustive]
7331pub struct CloudControlDeployment {
7332 /// Identifier. The name for the cloud control deployment, in the format
7333 /// `organizations/{organization}/locations/{location}/cloudControlDeployments/{cloud_control_deployment}`
7334 /// or
7335 /// `projects/{project}/locations/{location}/cloudControlDeployments/{cloud_control_deployment}`.
7336 /// The only supported location is `global`.
7337 pub name: std::string::String,
7338
7339 /// Required. The details of the target resource that the cloud control is
7340 /// deployed You can use an existing target resource or create a new target.
7341 pub target_resource_config: std::option::Option<crate::model::TargetResourceConfig>,
7342
7343 /// Output only. The resource that the cloud control is deployed on, in one of
7344 /// the following formats:
7345 ///
7346 /// - `organizations/{organizationID}`
7347 /// - `folders/{folderID}`
7348 /// - `projects/{projectID}`
7349 pub target_resource: std::string::String,
7350
7351 /// Required. The deployment mode and parameters for the cloud control.
7352 pub cloud_control_metadata: std::option::Option<crate::model::CloudControlMetadata>,
7353
7354 /// Optional. A friendly description for the cloud control deployment.
7355 pub description: std::string::String,
7356
7357 /// Output only. The state of the cloud control deployment.
7358 pub deployment_state: crate::model::DeploymentState,
7359
7360 /// Output only. The time when the resource was created.
7361 pub create_time: std::option::Option<wkt::Timestamp>,
7362
7363 /// Output only. The time when the resource was last updated.
7364 pub update_time: std::option::Option<wkt::Timestamp>,
7365
7366 /// Optional. To prevent concurrent updates from overwriting each other,
7367 /// provide the `etag` when you update a cloud control deployment. You can also
7368 /// provide the `etag` when you delete a cloud control deployment to help
7369 /// ensure that you're deleting the intended version of the
7370 /// deployment.
7371 pub etag: std::string::String,
7372
7373 /// Output only. The cloud control after the given parameters are substituted.
7374 pub parameter_substituted_cloud_control: std::option::Option<crate::model::CloudControl>,
7375
7376 /// Output only. The references to the framework deployments that this cloud
7377 /// control deployment is part of. A cloud control deployment can be part of
7378 /// multiple framework deployments.
7379 pub framework_deployment_references: std::vec::Vec<crate::model::FrameworkDeploymentReference>,
7380
7381 /// Output only. The display name of the target resource.
7382 pub target_resource_display_name: std::string::String,
7383
7384 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7385}
7386
7387impl CloudControlDeployment {
7388 /// Creates a new default instance.
7389 pub fn new() -> Self {
7390 std::default::Default::default()
7391 }
7392
7393 /// Sets the value of [name][crate::model::CloudControlDeployment::name].
7394 ///
7395 /// # Example
7396 /// ```ignore,no_run
7397 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
7398 /// # let organization_id = "organization_id";
7399 /// # let location_id = "location_id";
7400 /// # let cloud_control_deployment_id = "cloud_control_deployment_id";
7401 /// let x = CloudControlDeployment::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/cloudControlDeployments/{cloud_control_deployment_id}"));
7402 /// ```
7403 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7404 self.name = v.into();
7405 self
7406 }
7407
7408 /// Sets the value of [target_resource_config][crate::model::CloudControlDeployment::target_resource_config].
7409 ///
7410 /// # Example
7411 /// ```ignore,no_run
7412 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
7413 /// use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceConfig;
7414 /// let x = CloudControlDeployment::new().set_target_resource_config(TargetResourceConfig::default()/* use setters */);
7415 /// ```
7416 pub fn set_target_resource_config<T>(mut self, v: T) -> Self
7417 where
7418 T: std::convert::Into<crate::model::TargetResourceConfig>,
7419 {
7420 self.target_resource_config = std::option::Option::Some(v.into());
7421 self
7422 }
7423
7424 /// Sets or clears the value of [target_resource_config][crate::model::CloudControlDeployment::target_resource_config].
7425 ///
7426 /// # Example
7427 /// ```ignore,no_run
7428 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
7429 /// use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceConfig;
7430 /// let x = CloudControlDeployment::new().set_or_clear_target_resource_config(Some(TargetResourceConfig::default()/* use setters */));
7431 /// let x = CloudControlDeployment::new().set_or_clear_target_resource_config(None::<TargetResourceConfig>);
7432 /// ```
7433 pub fn set_or_clear_target_resource_config<T>(mut self, v: std::option::Option<T>) -> Self
7434 where
7435 T: std::convert::Into<crate::model::TargetResourceConfig>,
7436 {
7437 self.target_resource_config = v.map(|x| x.into());
7438 self
7439 }
7440
7441 /// Sets the value of [target_resource][crate::model::CloudControlDeployment::target_resource].
7442 ///
7443 /// # Example
7444 /// ```ignore,no_run
7445 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
7446 /// let x = CloudControlDeployment::new().set_target_resource("example");
7447 /// ```
7448 pub fn set_target_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7449 self.target_resource = v.into();
7450 self
7451 }
7452
7453 /// Sets the value of [cloud_control_metadata][crate::model::CloudControlDeployment::cloud_control_metadata].
7454 ///
7455 /// # Example
7456 /// ```ignore,no_run
7457 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
7458 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlMetadata;
7459 /// let x = CloudControlDeployment::new().set_cloud_control_metadata(CloudControlMetadata::default()/* use setters */);
7460 /// ```
7461 pub fn set_cloud_control_metadata<T>(mut self, v: T) -> Self
7462 where
7463 T: std::convert::Into<crate::model::CloudControlMetadata>,
7464 {
7465 self.cloud_control_metadata = std::option::Option::Some(v.into());
7466 self
7467 }
7468
7469 /// Sets or clears the value of [cloud_control_metadata][crate::model::CloudControlDeployment::cloud_control_metadata].
7470 ///
7471 /// # Example
7472 /// ```ignore,no_run
7473 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
7474 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlMetadata;
7475 /// let x = CloudControlDeployment::new().set_or_clear_cloud_control_metadata(Some(CloudControlMetadata::default()/* use setters */));
7476 /// let x = CloudControlDeployment::new().set_or_clear_cloud_control_metadata(None::<CloudControlMetadata>);
7477 /// ```
7478 pub fn set_or_clear_cloud_control_metadata<T>(mut self, v: std::option::Option<T>) -> Self
7479 where
7480 T: std::convert::Into<crate::model::CloudControlMetadata>,
7481 {
7482 self.cloud_control_metadata = v.map(|x| x.into());
7483 self
7484 }
7485
7486 /// Sets the value of [description][crate::model::CloudControlDeployment::description].
7487 ///
7488 /// # Example
7489 /// ```ignore,no_run
7490 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
7491 /// let x = CloudControlDeployment::new().set_description("example");
7492 /// ```
7493 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7494 self.description = v.into();
7495 self
7496 }
7497
7498 /// Sets the value of [deployment_state][crate::model::CloudControlDeployment::deployment_state].
7499 ///
7500 /// # Example
7501 /// ```ignore,no_run
7502 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
7503 /// use google_cloud_cloudsecuritycompliance_v1::model::DeploymentState;
7504 /// let x0 = CloudControlDeployment::new().set_deployment_state(DeploymentState::Validating);
7505 /// let x1 = CloudControlDeployment::new().set_deployment_state(DeploymentState::Creating);
7506 /// let x2 = CloudControlDeployment::new().set_deployment_state(DeploymentState::Deleting);
7507 /// ```
7508 pub fn set_deployment_state<T: std::convert::Into<crate::model::DeploymentState>>(
7509 mut self,
7510 v: T,
7511 ) -> Self {
7512 self.deployment_state = v.into();
7513 self
7514 }
7515
7516 /// Sets the value of [create_time][crate::model::CloudControlDeployment::create_time].
7517 ///
7518 /// # Example
7519 /// ```ignore,no_run
7520 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
7521 /// use wkt::Timestamp;
7522 /// let x = CloudControlDeployment::new().set_create_time(Timestamp::default()/* use setters */);
7523 /// ```
7524 pub fn set_create_time<T>(mut self, v: T) -> Self
7525 where
7526 T: std::convert::Into<wkt::Timestamp>,
7527 {
7528 self.create_time = std::option::Option::Some(v.into());
7529 self
7530 }
7531
7532 /// Sets or clears the value of [create_time][crate::model::CloudControlDeployment::create_time].
7533 ///
7534 /// # Example
7535 /// ```ignore,no_run
7536 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
7537 /// use wkt::Timestamp;
7538 /// let x = CloudControlDeployment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7539 /// let x = CloudControlDeployment::new().set_or_clear_create_time(None::<Timestamp>);
7540 /// ```
7541 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7542 where
7543 T: std::convert::Into<wkt::Timestamp>,
7544 {
7545 self.create_time = v.map(|x| x.into());
7546 self
7547 }
7548
7549 /// Sets the value of [update_time][crate::model::CloudControlDeployment::update_time].
7550 ///
7551 /// # Example
7552 /// ```ignore,no_run
7553 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
7554 /// use wkt::Timestamp;
7555 /// let x = CloudControlDeployment::new().set_update_time(Timestamp::default()/* use setters */);
7556 /// ```
7557 pub fn set_update_time<T>(mut self, v: T) -> Self
7558 where
7559 T: std::convert::Into<wkt::Timestamp>,
7560 {
7561 self.update_time = std::option::Option::Some(v.into());
7562 self
7563 }
7564
7565 /// Sets or clears the value of [update_time][crate::model::CloudControlDeployment::update_time].
7566 ///
7567 /// # Example
7568 /// ```ignore,no_run
7569 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
7570 /// use wkt::Timestamp;
7571 /// let x = CloudControlDeployment::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7572 /// let x = CloudControlDeployment::new().set_or_clear_update_time(None::<Timestamp>);
7573 /// ```
7574 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7575 where
7576 T: std::convert::Into<wkt::Timestamp>,
7577 {
7578 self.update_time = v.map(|x| x.into());
7579 self
7580 }
7581
7582 /// Sets the value of [etag][crate::model::CloudControlDeployment::etag].
7583 ///
7584 /// # Example
7585 /// ```ignore,no_run
7586 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
7587 /// let x = CloudControlDeployment::new().set_etag("example");
7588 /// ```
7589 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7590 self.etag = v.into();
7591 self
7592 }
7593
7594 /// Sets the value of [parameter_substituted_cloud_control][crate::model::CloudControlDeployment::parameter_substituted_cloud_control].
7595 ///
7596 /// # Example
7597 /// ```ignore,no_run
7598 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
7599 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
7600 /// let x = CloudControlDeployment::new().set_parameter_substituted_cloud_control(CloudControl::default()/* use setters */);
7601 /// ```
7602 pub fn set_parameter_substituted_cloud_control<T>(mut self, v: T) -> Self
7603 where
7604 T: std::convert::Into<crate::model::CloudControl>,
7605 {
7606 self.parameter_substituted_cloud_control = std::option::Option::Some(v.into());
7607 self
7608 }
7609
7610 /// Sets or clears the value of [parameter_substituted_cloud_control][crate::model::CloudControlDeployment::parameter_substituted_cloud_control].
7611 ///
7612 /// # Example
7613 /// ```ignore,no_run
7614 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
7615 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControl;
7616 /// let x = CloudControlDeployment::new().set_or_clear_parameter_substituted_cloud_control(Some(CloudControl::default()/* use setters */));
7617 /// let x = CloudControlDeployment::new().set_or_clear_parameter_substituted_cloud_control(None::<CloudControl>);
7618 /// ```
7619 pub fn set_or_clear_parameter_substituted_cloud_control<T>(
7620 mut self,
7621 v: std::option::Option<T>,
7622 ) -> Self
7623 where
7624 T: std::convert::Into<crate::model::CloudControl>,
7625 {
7626 self.parameter_substituted_cloud_control = v.map(|x| x.into());
7627 self
7628 }
7629
7630 /// Sets the value of [framework_deployment_references][crate::model::CloudControlDeployment::framework_deployment_references].
7631 ///
7632 /// # Example
7633 /// ```ignore,no_run
7634 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
7635 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeploymentReference;
7636 /// let x = CloudControlDeployment::new()
7637 /// .set_framework_deployment_references([
7638 /// FrameworkDeploymentReference::default()/* use setters */,
7639 /// FrameworkDeploymentReference::default()/* use (different) setters */,
7640 /// ]);
7641 /// ```
7642 pub fn set_framework_deployment_references<T, V>(mut self, v: T) -> Self
7643 where
7644 T: std::iter::IntoIterator<Item = V>,
7645 V: std::convert::Into<crate::model::FrameworkDeploymentReference>,
7646 {
7647 use std::iter::Iterator;
7648 self.framework_deployment_references = v.into_iter().map(|i| i.into()).collect();
7649 self
7650 }
7651
7652 /// Sets the value of [target_resource_display_name][crate::model::CloudControlDeployment::target_resource_display_name].
7653 ///
7654 /// # Example
7655 /// ```ignore,no_run
7656 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
7657 /// let x = CloudControlDeployment::new().set_target_resource_display_name("example");
7658 /// ```
7659 pub fn set_target_resource_display_name<T: std::convert::Into<std::string::String>>(
7660 mut self,
7661 v: T,
7662 ) -> Self {
7663 self.target_resource_display_name = v.into();
7664 self
7665 }
7666}
7667
7668impl wkt::message::Message for CloudControlDeployment {
7669 fn typename() -> &'static str {
7670 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControlDeployment"
7671 }
7672}
7673
7674/// The name of the target resource or the configuration that's required to
7675/// create a new target resource.
7676#[derive(Clone, Default, PartialEq)]
7677#[non_exhaustive]
7678pub struct TargetResourceConfig {
7679 /// The resource configuration for the target resource.
7680 pub resource_config: std::option::Option<crate::model::target_resource_config::ResourceConfig>,
7681
7682 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7683}
7684
7685impl TargetResourceConfig {
7686 /// Creates a new default instance.
7687 pub fn new() -> Self {
7688 std::default::Default::default()
7689 }
7690
7691 /// Sets the value of [resource_config][crate::model::TargetResourceConfig::resource_config].
7692 ///
7693 /// Note that all the setters affecting `resource_config` are mutually
7694 /// exclusive.
7695 ///
7696 /// # Example
7697 /// ```ignore,no_run
7698 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceConfig;
7699 /// use google_cloud_cloudsecuritycompliance_v1::model::target_resource_config::ResourceConfig;
7700 /// let x = TargetResourceConfig::new().set_resource_config(Some(ResourceConfig::ExistingTargetResource("example".to_string())));
7701 /// ```
7702 pub fn set_resource_config<
7703 T: std::convert::Into<
7704 std::option::Option<crate::model::target_resource_config::ResourceConfig>,
7705 >,
7706 >(
7707 mut self,
7708 v: T,
7709 ) -> Self {
7710 self.resource_config = v.into();
7711 self
7712 }
7713
7714 /// The value of [resource_config][crate::model::TargetResourceConfig::resource_config]
7715 /// if it holds a `ExistingTargetResource`, `None` if the field is not set or
7716 /// holds a different branch.
7717 pub fn existing_target_resource(&self) -> std::option::Option<&std::string::String> {
7718 #[allow(unreachable_patterns)]
7719 self.resource_config.as_ref().and_then(|v| match v {
7720 crate::model::target_resource_config::ResourceConfig::ExistingTargetResource(v) => {
7721 std::option::Option::Some(v)
7722 }
7723 _ => std::option::Option::None,
7724 })
7725 }
7726
7727 /// Sets the value of [resource_config][crate::model::TargetResourceConfig::resource_config]
7728 /// to hold a `ExistingTargetResource`.
7729 ///
7730 /// Note that all the setters affecting `resource_config` are
7731 /// mutually exclusive.
7732 ///
7733 /// # Example
7734 /// ```ignore,no_run
7735 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceConfig;
7736 /// let x = TargetResourceConfig::new().set_existing_target_resource("example");
7737 /// assert!(x.existing_target_resource().is_some());
7738 /// assert!(x.target_resource_creation_config().is_none());
7739 /// ```
7740 pub fn set_existing_target_resource<T: std::convert::Into<std::string::String>>(
7741 mut self,
7742 v: T,
7743 ) -> Self {
7744 self.resource_config = std::option::Option::Some(
7745 crate::model::target_resource_config::ResourceConfig::ExistingTargetResource(v.into()),
7746 );
7747 self
7748 }
7749
7750 /// The value of [resource_config][crate::model::TargetResourceConfig::resource_config]
7751 /// if it holds a `TargetResourceCreationConfig`, `None` if the field is not set or
7752 /// holds a different branch.
7753 pub fn target_resource_creation_config(
7754 &self,
7755 ) -> std::option::Option<&std::boxed::Box<crate::model::TargetResourceCreationConfig>> {
7756 #[allow(unreachable_patterns)]
7757 self.resource_config.as_ref().and_then(|v| match v {
7758 crate::model::target_resource_config::ResourceConfig::TargetResourceCreationConfig(
7759 v,
7760 ) => std::option::Option::Some(v),
7761 _ => std::option::Option::None,
7762 })
7763 }
7764
7765 /// Sets the value of [resource_config][crate::model::TargetResourceConfig::resource_config]
7766 /// to hold a `TargetResourceCreationConfig`.
7767 ///
7768 /// Note that all the setters affecting `resource_config` are
7769 /// mutually exclusive.
7770 ///
7771 /// # Example
7772 /// ```ignore,no_run
7773 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceConfig;
7774 /// use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceCreationConfig;
7775 /// let x = TargetResourceConfig::new().set_target_resource_creation_config(TargetResourceCreationConfig::default()/* use setters */);
7776 /// assert!(x.target_resource_creation_config().is_some());
7777 /// assert!(x.existing_target_resource().is_none());
7778 /// ```
7779 pub fn set_target_resource_creation_config<
7780 T: std::convert::Into<std::boxed::Box<crate::model::TargetResourceCreationConfig>>,
7781 >(
7782 mut self,
7783 v: T,
7784 ) -> Self {
7785 self.resource_config = std::option::Option::Some(
7786 crate::model::target_resource_config::ResourceConfig::TargetResourceCreationConfig(
7787 v.into(),
7788 ),
7789 );
7790 self
7791 }
7792}
7793
7794impl wkt::message::Message for TargetResourceConfig {
7795 fn typename() -> &'static str {
7796 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.TargetResourceConfig"
7797 }
7798}
7799
7800/// Defines additional types related to [TargetResourceConfig].
7801pub mod target_resource_config {
7802 #[allow(unused_imports)]
7803 use super::*;
7804
7805 /// The resource configuration for the target resource.
7806 #[derive(Clone, Debug, PartialEq)]
7807 #[non_exhaustive]
7808 pub enum ResourceConfig {
7809 /// Optional. The resource hierarchy node, in one of the following formats:
7810 ///
7811 /// - `organizations/{organizationID}`
7812 /// - `folders/{folderID}`
7813 /// - `projects/{projectID}`
7814 ExistingTargetResource(std::string::String),
7815 /// Optional. The details that are required to create a resource and use
7816 /// that resource as the target resource for deployment.
7817 TargetResourceCreationConfig(std::boxed::Box<crate::model::TargetResourceCreationConfig>),
7818 }
7819}
7820
7821/// The configuration that's required to create a target resource.
7822#[derive(Clone, Default, PartialEq)]
7823#[non_exhaustive]
7824pub struct TargetResourceCreationConfig {
7825 /// The configuration that's required to create the target resource.
7826 pub resource_creation_config:
7827 std::option::Option<crate::model::target_resource_creation_config::ResourceCreationConfig>,
7828
7829 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7830}
7831
7832impl TargetResourceCreationConfig {
7833 /// Creates a new default instance.
7834 pub fn new() -> Self {
7835 std::default::Default::default()
7836 }
7837
7838 /// Sets the value of [resource_creation_config][crate::model::TargetResourceCreationConfig::resource_creation_config].
7839 ///
7840 /// Note that all the setters affecting `resource_creation_config` are mutually
7841 /// exclusive.
7842 ///
7843 /// # Example
7844 /// ```ignore,no_run
7845 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceCreationConfig;
7846 /// use google_cloud_cloudsecuritycompliance_v1::model::FolderCreationConfig;
7847 /// let x = TargetResourceCreationConfig::new().set_resource_creation_config(Some(
7848 /// google_cloud_cloudsecuritycompliance_v1::model::target_resource_creation_config::ResourceCreationConfig::FolderCreationConfig(FolderCreationConfig::default().into())));
7849 /// ```
7850 pub fn set_resource_creation_config<
7851 T: std::convert::Into<
7852 std::option::Option<
7853 crate::model::target_resource_creation_config::ResourceCreationConfig,
7854 >,
7855 >,
7856 >(
7857 mut self,
7858 v: T,
7859 ) -> Self {
7860 self.resource_creation_config = v.into();
7861 self
7862 }
7863
7864 /// The value of [resource_creation_config][crate::model::TargetResourceCreationConfig::resource_creation_config]
7865 /// if it holds a `FolderCreationConfig`, `None` if the field is not set or
7866 /// holds a different branch.
7867 pub fn folder_creation_config(
7868 &self,
7869 ) -> std::option::Option<&std::boxed::Box<crate::model::FolderCreationConfig>> {
7870 #[allow(unreachable_patterns)]
7871 self.resource_creation_config.as_ref().and_then(|v| match v {
7872 crate::model::target_resource_creation_config::ResourceCreationConfig::FolderCreationConfig(v) => std::option::Option::Some(v),
7873 _ => std::option::Option::None,
7874 })
7875 }
7876
7877 /// Sets the value of [resource_creation_config][crate::model::TargetResourceCreationConfig::resource_creation_config]
7878 /// to hold a `FolderCreationConfig`.
7879 ///
7880 /// Note that all the setters affecting `resource_creation_config` are
7881 /// mutually exclusive.
7882 ///
7883 /// # Example
7884 /// ```ignore,no_run
7885 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceCreationConfig;
7886 /// use google_cloud_cloudsecuritycompliance_v1::model::FolderCreationConfig;
7887 /// let x = TargetResourceCreationConfig::new().set_folder_creation_config(FolderCreationConfig::default()/* use setters */);
7888 /// assert!(x.folder_creation_config().is_some());
7889 /// assert!(x.project_creation_config().is_none());
7890 /// ```
7891 pub fn set_folder_creation_config<
7892 T: std::convert::Into<std::boxed::Box<crate::model::FolderCreationConfig>>,
7893 >(
7894 mut self,
7895 v: T,
7896 ) -> Self {
7897 self.resource_creation_config = std::option::Option::Some(
7898 crate::model::target_resource_creation_config::ResourceCreationConfig::FolderCreationConfig(
7899 v.into()
7900 )
7901 );
7902 self
7903 }
7904
7905 /// The value of [resource_creation_config][crate::model::TargetResourceCreationConfig::resource_creation_config]
7906 /// if it holds a `ProjectCreationConfig`, `None` if the field is not set or
7907 /// holds a different branch.
7908 pub fn project_creation_config(
7909 &self,
7910 ) -> std::option::Option<&std::boxed::Box<crate::model::ProjectCreationConfig>> {
7911 #[allow(unreachable_patterns)]
7912 self.resource_creation_config.as_ref().and_then(|v| match v {
7913 crate::model::target_resource_creation_config::ResourceCreationConfig::ProjectCreationConfig(v) => std::option::Option::Some(v),
7914 _ => std::option::Option::None,
7915 })
7916 }
7917
7918 /// Sets the value of [resource_creation_config][crate::model::TargetResourceCreationConfig::resource_creation_config]
7919 /// to hold a `ProjectCreationConfig`.
7920 ///
7921 /// Note that all the setters affecting `resource_creation_config` are
7922 /// mutually exclusive.
7923 ///
7924 /// # Example
7925 /// ```ignore,no_run
7926 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceCreationConfig;
7927 /// use google_cloud_cloudsecuritycompliance_v1::model::ProjectCreationConfig;
7928 /// let x = TargetResourceCreationConfig::new().set_project_creation_config(ProjectCreationConfig::default()/* use setters */);
7929 /// assert!(x.project_creation_config().is_some());
7930 /// assert!(x.folder_creation_config().is_none());
7931 /// ```
7932 pub fn set_project_creation_config<
7933 T: std::convert::Into<std::boxed::Box<crate::model::ProjectCreationConfig>>,
7934 >(
7935 mut self,
7936 v: T,
7937 ) -> Self {
7938 self.resource_creation_config = std::option::Option::Some(
7939 crate::model::target_resource_creation_config::ResourceCreationConfig::ProjectCreationConfig(
7940 v.into()
7941 )
7942 );
7943 self
7944 }
7945}
7946
7947impl wkt::message::Message for TargetResourceCreationConfig {
7948 fn typename() -> &'static str {
7949 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.TargetResourceCreationConfig"
7950 }
7951}
7952
7953/// Defines additional types related to [TargetResourceCreationConfig].
7954pub mod target_resource_creation_config {
7955 #[allow(unused_imports)]
7956 use super::*;
7957
7958 /// The configuration that's required to create the target resource.
7959 #[derive(Clone, Debug, PartialEq)]
7960 #[non_exhaustive]
7961 pub enum ResourceCreationConfig {
7962 /// Optional. The configuration that's required to create a folder.
7963 FolderCreationConfig(std::boxed::Box<crate::model::FolderCreationConfig>),
7964 /// Optional. The configuration that's required to create a project.
7965 ProjectCreationConfig(std::boxed::Box<crate::model::ProjectCreationConfig>),
7966 }
7967}
7968
7969/// The configuration that's required to create a folder to be used
7970/// as the target resource for a deployment.
7971#[derive(Clone, Default, PartialEq)]
7972#[non_exhaustive]
7973pub struct FolderCreationConfig {
7974 /// Required. The parent of the folder, in the format
7975 /// `organizations/{organizationID}` or `folders/{folderID}`.
7976 pub parent: std::string::String,
7977
7978 /// Required. The display name of the folder.
7979 pub folder_display_name: std::string::String,
7980
7981 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7982}
7983
7984impl FolderCreationConfig {
7985 /// Creates a new default instance.
7986 pub fn new() -> Self {
7987 std::default::Default::default()
7988 }
7989
7990 /// Sets the value of [parent][crate::model::FolderCreationConfig::parent].
7991 ///
7992 /// # Example
7993 /// ```ignore,no_run
7994 /// # use google_cloud_cloudsecuritycompliance_v1::model::FolderCreationConfig;
7995 /// let x = FolderCreationConfig::new().set_parent("example");
7996 /// ```
7997 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7998 self.parent = v.into();
7999 self
8000 }
8001
8002 /// Sets the value of [folder_display_name][crate::model::FolderCreationConfig::folder_display_name].
8003 ///
8004 /// # Example
8005 /// ```ignore,no_run
8006 /// # use google_cloud_cloudsecuritycompliance_v1::model::FolderCreationConfig;
8007 /// let x = FolderCreationConfig::new().set_folder_display_name("example");
8008 /// ```
8009 pub fn set_folder_display_name<T: std::convert::Into<std::string::String>>(
8010 mut self,
8011 v: T,
8012 ) -> Self {
8013 self.folder_display_name = v.into();
8014 self
8015 }
8016}
8017
8018impl wkt::message::Message for FolderCreationConfig {
8019 fn typename() -> &'static str {
8020 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FolderCreationConfig"
8021 }
8022}
8023
8024/// The configuration that's required to create a project to be used
8025/// as the target resource of a deployment.
8026#[derive(Clone, Default, PartialEq)]
8027#[non_exhaustive]
8028pub struct ProjectCreationConfig {
8029 /// Required. The parent of the project, in the format
8030 /// `organizations/{organizationID}` or `folders/{folderID}`.
8031 pub parent: std::string::String,
8032
8033 /// Required. The display name of the project.
8034 pub project_display_name: std::string::String,
8035
8036 /// Required. The billing account ID for the project.
8037 pub billing_account_id: std::string::String,
8038
8039 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8040}
8041
8042impl ProjectCreationConfig {
8043 /// Creates a new default instance.
8044 pub fn new() -> Self {
8045 std::default::Default::default()
8046 }
8047
8048 /// Sets the value of [parent][crate::model::ProjectCreationConfig::parent].
8049 ///
8050 /// # Example
8051 /// ```ignore,no_run
8052 /// # use google_cloud_cloudsecuritycompliance_v1::model::ProjectCreationConfig;
8053 /// let x = ProjectCreationConfig::new().set_parent("example");
8054 /// ```
8055 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8056 self.parent = v.into();
8057 self
8058 }
8059
8060 /// Sets the value of [project_display_name][crate::model::ProjectCreationConfig::project_display_name].
8061 ///
8062 /// # Example
8063 /// ```ignore,no_run
8064 /// # use google_cloud_cloudsecuritycompliance_v1::model::ProjectCreationConfig;
8065 /// let x = ProjectCreationConfig::new().set_project_display_name("example");
8066 /// ```
8067 pub fn set_project_display_name<T: std::convert::Into<std::string::String>>(
8068 mut self,
8069 v: T,
8070 ) -> Self {
8071 self.project_display_name = v.into();
8072 self
8073 }
8074
8075 /// Sets the value of [billing_account_id][crate::model::ProjectCreationConfig::billing_account_id].
8076 ///
8077 /// # Example
8078 /// ```ignore,no_run
8079 /// # use google_cloud_cloudsecuritycompliance_v1::model::ProjectCreationConfig;
8080 /// let x = ProjectCreationConfig::new().set_billing_account_id("example");
8081 /// ```
8082 pub fn set_billing_account_id<T: std::convert::Into<std::string::String>>(
8083 mut self,
8084 v: T,
8085 ) -> Self {
8086 self.billing_account_id = v.into();
8087 self
8088 }
8089}
8090
8091impl wkt::message::Message for ProjectCreationConfig {
8092 fn typename() -> &'static str {
8093 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ProjectCreationConfig"
8094 }
8095}
8096
8097/// The enforcement mode and parameters of a cloud
8098/// control deployment.
8099#[derive(Clone, Default, PartialEq)]
8100#[non_exhaustive]
8101pub struct CloudControlMetadata {
8102 /// Required. The cloud control name and parameters.
8103 pub cloud_control_details: std::option::Option<crate::model::CloudControlDetails>,
8104
8105 /// Required. The enforcement mode of the cloud control.
8106 pub enforcement_mode: crate::model::EnforcementMode,
8107
8108 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8109}
8110
8111impl CloudControlMetadata {
8112 /// Creates a new default instance.
8113 pub fn new() -> Self {
8114 std::default::Default::default()
8115 }
8116
8117 /// Sets the value of [cloud_control_details][crate::model::CloudControlMetadata::cloud_control_details].
8118 ///
8119 /// # Example
8120 /// ```ignore,no_run
8121 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlMetadata;
8122 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDetails;
8123 /// let x = CloudControlMetadata::new().set_cloud_control_details(CloudControlDetails::default()/* use setters */);
8124 /// ```
8125 pub fn set_cloud_control_details<T>(mut self, v: T) -> Self
8126 where
8127 T: std::convert::Into<crate::model::CloudControlDetails>,
8128 {
8129 self.cloud_control_details = std::option::Option::Some(v.into());
8130 self
8131 }
8132
8133 /// Sets or clears the value of [cloud_control_details][crate::model::CloudControlMetadata::cloud_control_details].
8134 ///
8135 /// # Example
8136 /// ```ignore,no_run
8137 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlMetadata;
8138 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDetails;
8139 /// let x = CloudControlMetadata::new().set_or_clear_cloud_control_details(Some(CloudControlDetails::default()/* use setters */));
8140 /// let x = CloudControlMetadata::new().set_or_clear_cloud_control_details(None::<CloudControlDetails>);
8141 /// ```
8142 pub fn set_or_clear_cloud_control_details<T>(mut self, v: std::option::Option<T>) -> Self
8143 where
8144 T: std::convert::Into<crate::model::CloudControlDetails>,
8145 {
8146 self.cloud_control_details = v.map(|x| x.into());
8147 self
8148 }
8149
8150 /// Sets the value of [enforcement_mode][crate::model::CloudControlMetadata::enforcement_mode].
8151 ///
8152 /// # Example
8153 /// ```ignore,no_run
8154 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlMetadata;
8155 /// use google_cloud_cloudsecuritycompliance_v1::model::EnforcementMode;
8156 /// let x0 = CloudControlMetadata::new().set_enforcement_mode(EnforcementMode::Preventive);
8157 /// let x1 = CloudControlMetadata::new().set_enforcement_mode(EnforcementMode::Detective);
8158 /// let x2 = CloudControlMetadata::new().set_enforcement_mode(EnforcementMode::Audit);
8159 /// ```
8160 pub fn set_enforcement_mode<T: std::convert::Into<crate::model::EnforcementMode>>(
8161 mut self,
8162 v: T,
8163 ) -> Self {
8164 self.enforcement_mode = v.into();
8165 self
8166 }
8167}
8168
8169impl wkt::message::Message for CloudControlMetadata {
8170 fn typename() -> &'static str {
8171 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControlMetadata"
8172 }
8173}
8174
8175/// The request message for [CreateFrameworkDeployment][].
8176#[derive(Clone, Default, PartialEq)]
8177#[non_exhaustive]
8178pub struct CreateFrameworkDeploymentRequest {
8179 /// Required. The parent resource of the framework deployment in the format
8180 /// `organizations/{organization}/locations/{location}`
8181 /// or
8182 /// `projects/{project}/locations/{location}`.
8183 /// Only the global location is supported.
8184 pub parent: std::string::String,
8185
8186 /// Optional. An identifier for the framework deployment that's unique in scope
8187 /// of the parent. If you don't specify a value, then a random UUID is
8188 /// generated.
8189 pub framework_deployment_id: std::string::String,
8190
8191 /// Required. The framework deployment that you're creating.
8192 pub framework_deployment: std::option::Option<crate::model::FrameworkDeployment>,
8193
8194 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8195}
8196
8197impl CreateFrameworkDeploymentRequest {
8198 /// Creates a new default instance.
8199 pub fn new() -> Self {
8200 std::default::Default::default()
8201 }
8202
8203 /// Sets the value of [parent][crate::model::CreateFrameworkDeploymentRequest::parent].
8204 ///
8205 /// # Example
8206 /// ```ignore,no_run
8207 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkDeploymentRequest;
8208 /// # let organization_id = "organization_id";
8209 /// # let location_id = "location_id";
8210 /// let x = CreateFrameworkDeploymentRequest::new().set_parent(format!("organizations/{organization_id}/locations/{location_id}"));
8211 /// ```
8212 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8213 self.parent = v.into();
8214 self
8215 }
8216
8217 /// Sets the value of [framework_deployment_id][crate::model::CreateFrameworkDeploymentRequest::framework_deployment_id].
8218 ///
8219 /// # Example
8220 /// ```ignore,no_run
8221 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkDeploymentRequest;
8222 /// let x = CreateFrameworkDeploymentRequest::new().set_framework_deployment_id("example");
8223 /// ```
8224 pub fn set_framework_deployment_id<T: std::convert::Into<std::string::String>>(
8225 mut self,
8226 v: T,
8227 ) -> Self {
8228 self.framework_deployment_id = v.into();
8229 self
8230 }
8231
8232 /// Sets the value of [framework_deployment][crate::model::CreateFrameworkDeploymentRequest::framework_deployment].
8233 ///
8234 /// # Example
8235 /// ```ignore,no_run
8236 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkDeploymentRequest;
8237 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
8238 /// let x = CreateFrameworkDeploymentRequest::new().set_framework_deployment(FrameworkDeployment::default()/* use setters */);
8239 /// ```
8240 pub fn set_framework_deployment<T>(mut self, v: T) -> Self
8241 where
8242 T: std::convert::Into<crate::model::FrameworkDeployment>,
8243 {
8244 self.framework_deployment = std::option::Option::Some(v.into());
8245 self
8246 }
8247
8248 /// Sets or clears the value of [framework_deployment][crate::model::CreateFrameworkDeploymentRequest::framework_deployment].
8249 ///
8250 /// # Example
8251 /// ```ignore,no_run
8252 /// # use google_cloud_cloudsecuritycompliance_v1::model::CreateFrameworkDeploymentRequest;
8253 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
8254 /// let x = CreateFrameworkDeploymentRequest::new().set_or_clear_framework_deployment(Some(FrameworkDeployment::default()/* use setters */));
8255 /// let x = CreateFrameworkDeploymentRequest::new().set_or_clear_framework_deployment(None::<FrameworkDeployment>);
8256 /// ```
8257 pub fn set_or_clear_framework_deployment<T>(mut self, v: std::option::Option<T>) -> Self
8258 where
8259 T: std::convert::Into<crate::model::FrameworkDeployment>,
8260 {
8261 self.framework_deployment = v.map(|x| x.into());
8262 self
8263 }
8264}
8265
8266impl wkt::message::Message for CreateFrameworkDeploymentRequest {
8267 fn typename() -> &'static str {
8268 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CreateFrameworkDeploymentRequest"
8269 }
8270}
8271
8272/// The request message for [DeleteFrameworkDeployment][].
8273#[derive(Clone, Default, PartialEq)]
8274#[non_exhaustive]
8275pub struct DeleteFrameworkDeploymentRequest {
8276 /// Required. The name of the framework deployment that you want to delete,
8277 /// in the format
8278 /// `organizations/{organization}/locations/{location}/frameworkDeployments/{framework_deployment}`
8279 /// or
8280 /// `projects/{project}/locations/{location}/frameworkDeployments/{framework_deployment}`.
8281 /// The only supported location is `global`.
8282 pub name: std::string::String,
8283
8284 /// Optional. An opaque identifier for the current version of the resource.
8285 ///
8286 /// If you provide this value, then it must match the existing value. If the
8287 /// values don't match, then the request fails with an
8288 /// [`ABORTED`][google.rpc.Code.ABORTED] error.
8289 ///
8290 /// If you omit this value, then the resource is deleted regardless of its
8291 /// current `etag` value.
8292 pub etag: std::string::String,
8293
8294 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8295}
8296
8297impl DeleteFrameworkDeploymentRequest {
8298 /// Creates a new default instance.
8299 pub fn new() -> Self {
8300 std::default::Default::default()
8301 }
8302
8303 /// Sets the value of [name][crate::model::DeleteFrameworkDeploymentRequest::name].
8304 ///
8305 /// # Example
8306 /// ```ignore,no_run
8307 /// # use google_cloud_cloudsecuritycompliance_v1::model::DeleteFrameworkDeploymentRequest;
8308 /// # let organization_id = "organization_id";
8309 /// # let location_id = "location_id";
8310 /// # let framework_deployment_id = "framework_deployment_id";
8311 /// let x = DeleteFrameworkDeploymentRequest::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/frameworkDeployments/{framework_deployment_id}"));
8312 /// ```
8313 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8314 self.name = v.into();
8315 self
8316 }
8317
8318 /// Sets the value of [etag][crate::model::DeleteFrameworkDeploymentRequest::etag].
8319 ///
8320 /// # Example
8321 /// ```ignore,no_run
8322 /// # use google_cloud_cloudsecuritycompliance_v1::model::DeleteFrameworkDeploymentRequest;
8323 /// let x = DeleteFrameworkDeploymentRequest::new().set_etag("example");
8324 /// ```
8325 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8326 self.etag = v.into();
8327 self
8328 }
8329}
8330
8331impl wkt::message::Message for DeleteFrameworkDeploymentRequest {
8332 fn typename() -> &'static str {
8333 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.DeleteFrameworkDeploymentRequest"
8334 }
8335}
8336
8337/// The request message for [GetFrameworkDeployment][].
8338#[derive(Clone, Default, PartialEq)]
8339#[non_exhaustive]
8340pub struct GetFrameworkDeploymentRequest {
8341 /// Required. The name of the framework deployment, in the format
8342 /// `organizations/{organization}/locations/{location}/frameworkDeployments/{framework_deployment}`
8343 /// or
8344 /// `projects/{project}/locations/{location}/frameworkDeployments/{framework_deployment}`.
8345 /// The only supported location is `global`.
8346 pub name: std::string::String,
8347
8348 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8349}
8350
8351impl GetFrameworkDeploymentRequest {
8352 /// Creates a new default instance.
8353 pub fn new() -> Self {
8354 std::default::Default::default()
8355 }
8356
8357 /// Sets the value of [name][crate::model::GetFrameworkDeploymentRequest::name].
8358 ///
8359 /// # Example
8360 /// ```ignore,no_run
8361 /// # use google_cloud_cloudsecuritycompliance_v1::model::GetFrameworkDeploymentRequest;
8362 /// # let organization_id = "organization_id";
8363 /// # let location_id = "location_id";
8364 /// # let framework_deployment_id = "framework_deployment_id";
8365 /// let x = GetFrameworkDeploymentRequest::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/frameworkDeployments/{framework_deployment_id}"));
8366 /// ```
8367 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8368 self.name = v.into();
8369 self
8370 }
8371}
8372
8373impl wkt::message::Message for GetFrameworkDeploymentRequest {
8374 fn typename() -> &'static str {
8375 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.GetFrameworkDeploymentRequest"
8376 }
8377}
8378
8379/// The request message for [ListFrameworkDeployments][].
8380#[derive(Clone, Default, PartialEq)]
8381#[non_exhaustive]
8382pub struct ListFrameworkDeploymentsRequest {
8383 /// Required. The parent resource of the framework deployment, in the format
8384 /// `organizations/{organization}/locations/{location}`
8385 /// or
8386 /// `projects/{project}/locations/{location}`.
8387 /// The only supported location is `global`.
8388 pub parent: std::string::String,
8389
8390 /// Optional. The requested page size. The server might return fewer items than
8391 /// requested.
8392 /// If unspecified, the server picks an appropriate default.
8393 pub page_size: i32,
8394
8395 /// Optional. A token that identifies a page of results the server should
8396 /// return.
8397 pub page_token: std::string::String,
8398
8399 /// Optional. The filter to be applied on the resource, as defined by
8400 /// [AIP-160: Filtering](https://google.aip.dev/160).
8401 pub filter: std::string::String,
8402
8403 /// Optional. The sort order for the results. The following values are
8404 /// supported:
8405 ///
8406 /// * `name`
8407 /// * `name desc`
8408 ///
8409 /// If you do not specify a value, then the results are not sorted.
8410 pub order_by: std::string::String,
8411
8412 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8413}
8414
8415impl ListFrameworkDeploymentsRequest {
8416 /// Creates a new default instance.
8417 pub fn new() -> Self {
8418 std::default::Default::default()
8419 }
8420
8421 /// Sets the value of [parent][crate::model::ListFrameworkDeploymentsRequest::parent].
8422 ///
8423 /// # Example
8424 /// ```ignore,no_run
8425 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkDeploymentsRequest;
8426 /// # let organization_id = "organization_id";
8427 /// # let location_id = "location_id";
8428 /// let x = ListFrameworkDeploymentsRequest::new().set_parent(format!("organizations/{organization_id}/locations/{location_id}"));
8429 /// ```
8430 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8431 self.parent = v.into();
8432 self
8433 }
8434
8435 /// Sets the value of [page_size][crate::model::ListFrameworkDeploymentsRequest::page_size].
8436 ///
8437 /// # Example
8438 /// ```ignore,no_run
8439 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkDeploymentsRequest;
8440 /// let x = ListFrameworkDeploymentsRequest::new().set_page_size(42);
8441 /// ```
8442 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8443 self.page_size = v.into();
8444 self
8445 }
8446
8447 /// Sets the value of [page_token][crate::model::ListFrameworkDeploymentsRequest::page_token].
8448 ///
8449 /// # Example
8450 /// ```ignore,no_run
8451 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkDeploymentsRequest;
8452 /// let x = ListFrameworkDeploymentsRequest::new().set_page_token("example");
8453 /// ```
8454 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8455 self.page_token = v.into();
8456 self
8457 }
8458
8459 /// Sets the value of [filter][crate::model::ListFrameworkDeploymentsRequest::filter].
8460 ///
8461 /// # Example
8462 /// ```ignore,no_run
8463 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkDeploymentsRequest;
8464 /// let x = ListFrameworkDeploymentsRequest::new().set_filter("example");
8465 /// ```
8466 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8467 self.filter = v.into();
8468 self
8469 }
8470
8471 /// Sets the value of [order_by][crate::model::ListFrameworkDeploymentsRequest::order_by].
8472 ///
8473 /// # Example
8474 /// ```ignore,no_run
8475 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkDeploymentsRequest;
8476 /// let x = ListFrameworkDeploymentsRequest::new().set_order_by("example");
8477 /// ```
8478 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8479 self.order_by = v.into();
8480 self
8481 }
8482}
8483
8484impl wkt::message::Message for ListFrameworkDeploymentsRequest {
8485 fn typename() -> &'static str {
8486 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFrameworkDeploymentsRequest"
8487 }
8488}
8489
8490/// The response message for [ListFrameworkDeployments][].
8491#[derive(Clone, Default, PartialEq)]
8492#[non_exhaustive]
8493pub struct ListFrameworkDeploymentsResponse {
8494 /// The list of framework deployments.
8495 pub framework_deployments: std::vec::Vec<crate::model::FrameworkDeployment>,
8496
8497 /// A token that identifies the next page of results that the server
8498 /// should return.
8499 pub next_page_token: std::string::String,
8500
8501 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8502}
8503
8504impl ListFrameworkDeploymentsResponse {
8505 /// Creates a new default instance.
8506 pub fn new() -> Self {
8507 std::default::Default::default()
8508 }
8509
8510 /// Sets the value of [framework_deployments][crate::model::ListFrameworkDeploymentsResponse::framework_deployments].
8511 ///
8512 /// # Example
8513 /// ```ignore,no_run
8514 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkDeploymentsResponse;
8515 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeployment;
8516 /// let x = ListFrameworkDeploymentsResponse::new()
8517 /// .set_framework_deployments([
8518 /// FrameworkDeployment::default()/* use setters */,
8519 /// FrameworkDeployment::default()/* use (different) setters */,
8520 /// ]);
8521 /// ```
8522 pub fn set_framework_deployments<T, V>(mut self, v: T) -> Self
8523 where
8524 T: std::iter::IntoIterator<Item = V>,
8525 V: std::convert::Into<crate::model::FrameworkDeployment>,
8526 {
8527 use std::iter::Iterator;
8528 self.framework_deployments = v.into_iter().map(|i| i.into()).collect();
8529 self
8530 }
8531
8532 /// Sets the value of [next_page_token][crate::model::ListFrameworkDeploymentsResponse::next_page_token].
8533 ///
8534 /// # Example
8535 /// ```ignore,no_run
8536 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkDeploymentsResponse;
8537 /// let x = ListFrameworkDeploymentsResponse::new().set_next_page_token("example");
8538 /// ```
8539 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8540 self.next_page_token = v.into();
8541 self
8542 }
8543}
8544
8545impl wkt::message::Message for ListFrameworkDeploymentsResponse {
8546 fn typename() -> &'static str {
8547 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFrameworkDeploymentsResponse"
8548 }
8549}
8550
8551#[doc(hidden)]
8552impl google_cloud_gax::paginator::internal::PageableResponse for ListFrameworkDeploymentsResponse {
8553 type PageItem = crate::model::FrameworkDeployment;
8554
8555 fn items(self) -> std::vec::Vec<Self::PageItem> {
8556 self.framework_deployments
8557 }
8558
8559 fn next_page_token(&self) -> std::string::String {
8560 use std::clone::Clone;
8561 self.next_page_token.clone()
8562 }
8563}
8564
8565/// The request message for [GetCloudControlDeployment][].
8566#[derive(Clone, Default, PartialEq)]
8567#[non_exhaustive]
8568pub struct GetCloudControlDeploymentRequest {
8569 /// Required. The name for the cloud control deployment, in the format
8570 /// `organizations/{organization}/locations/{location}/cloudControlDeployments/{cloud_control_deployment}`
8571 /// or
8572 /// `projects/{project}/locations/{location}/cloudControlDeployments/{cloud_control_deployment}`.
8573 /// The only supported location is `global`.
8574 pub name: std::string::String,
8575
8576 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8577}
8578
8579impl GetCloudControlDeploymentRequest {
8580 /// Creates a new default instance.
8581 pub fn new() -> Self {
8582 std::default::Default::default()
8583 }
8584
8585 /// Sets the value of [name][crate::model::GetCloudControlDeploymentRequest::name].
8586 ///
8587 /// # Example
8588 /// ```ignore,no_run
8589 /// # use google_cloud_cloudsecuritycompliance_v1::model::GetCloudControlDeploymentRequest;
8590 /// # let organization_id = "organization_id";
8591 /// # let location_id = "location_id";
8592 /// # let cloud_control_deployment_id = "cloud_control_deployment_id";
8593 /// let x = GetCloudControlDeploymentRequest::new().set_name(format!("organizations/{organization_id}/locations/{location_id}/cloudControlDeployments/{cloud_control_deployment_id}"));
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
8601impl wkt::message::Message for GetCloudControlDeploymentRequest {
8602 fn typename() -> &'static str {
8603 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.GetCloudControlDeploymentRequest"
8604 }
8605}
8606
8607/// The request message for [ListCloudControlDeployments][].
8608#[derive(Clone, Default, PartialEq)]
8609#[non_exhaustive]
8610pub struct ListCloudControlDeploymentsRequest {
8611 /// Required. The parent resource for the cloud control deployment, in the
8612 /// format `organizations/{organization}/locations/{location}` or
8613 /// `projects/{project}/locations/{location}`.
8614 /// The only supported location is `global`.
8615 pub parent: std::string::String,
8616
8617 /// Optional. The requested page size. The server might return fewer items than
8618 /// you requested.
8619 /// If unspecified, the server picks an appropriate default.
8620 pub page_size: i32,
8621
8622 /// Optional. A token that identifies the page of results that the server
8623 /// should return.
8624 pub page_token: std::string::String,
8625
8626 /// Optional. The filter to apply on the resource, as defined by
8627 /// [AIP-160: Filtering](https://google.aip.dev/160).
8628 pub filter: std::string::String,
8629
8630 /// Optional. The sort order for the results. The following values are
8631 /// supported:
8632 ///
8633 /// * `name`
8634 /// * `name desc`
8635 ///
8636 /// If you do not specify a value, then the results are not sorted.
8637 pub order_by: std::string::String,
8638
8639 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8640}
8641
8642impl ListCloudControlDeploymentsRequest {
8643 /// Creates a new default instance.
8644 pub fn new() -> Self {
8645 std::default::Default::default()
8646 }
8647
8648 /// Sets the value of [parent][crate::model::ListCloudControlDeploymentsRequest::parent].
8649 ///
8650 /// # Example
8651 /// ```ignore,no_run
8652 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlDeploymentsRequest;
8653 /// # let organization_id = "organization_id";
8654 /// # let location_id = "location_id";
8655 /// let x = ListCloudControlDeploymentsRequest::new().set_parent(format!("organizations/{organization_id}/locations/{location_id}"));
8656 /// ```
8657 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8658 self.parent = v.into();
8659 self
8660 }
8661
8662 /// Sets the value of [page_size][crate::model::ListCloudControlDeploymentsRequest::page_size].
8663 ///
8664 /// # Example
8665 /// ```ignore,no_run
8666 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlDeploymentsRequest;
8667 /// let x = ListCloudControlDeploymentsRequest::new().set_page_size(42);
8668 /// ```
8669 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8670 self.page_size = v.into();
8671 self
8672 }
8673
8674 /// Sets the value of [page_token][crate::model::ListCloudControlDeploymentsRequest::page_token].
8675 ///
8676 /// # Example
8677 /// ```ignore,no_run
8678 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlDeploymentsRequest;
8679 /// let x = ListCloudControlDeploymentsRequest::new().set_page_token("example");
8680 /// ```
8681 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8682 self.page_token = v.into();
8683 self
8684 }
8685
8686 /// Sets the value of [filter][crate::model::ListCloudControlDeploymentsRequest::filter].
8687 ///
8688 /// # Example
8689 /// ```ignore,no_run
8690 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlDeploymentsRequest;
8691 /// let x = ListCloudControlDeploymentsRequest::new().set_filter("example");
8692 /// ```
8693 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8694 self.filter = v.into();
8695 self
8696 }
8697
8698 /// Sets the value of [order_by][crate::model::ListCloudControlDeploymentsRequest::order_by].
8699 ///
8700 /// # Example
8701 /// ```ignore,no_run
8702 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlDeploymentsRequest;
8703 /// let x = ListCloudControlDeploymentsRequest::new().set_order_by("example");
8704 /// ```
8705 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8706 self.order_by = v.into();
8707 self
8708 }
8709}
8710
8711impl wkt::message::Message for ListCloudControlDeploymentsRequest {
8712 fn typename() -> &'static str {
8713 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListCloudControlDeploymentsRequest"
8714 }
8715}
8716
8717/// The response message for [ListCloudControlDeployments][].
8718#[derive(Clone, Default, PartialEq)]
8719#[non_exhaustive]
8720pub struct ListCloudControlDeploymentsResponse {
8721 /// The list of cloud control deployments.
8722 pub cloud_control_deployments: std::vec::Vec<crate::model::CloudControlDeployment>,
8723
8724 /// A token that identifies the next page of results that the server
8725 /// should return.
8726 pub next_page_token: std::string::String,
8727
8728 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8729}
8730
8731impl ListCloudControlDeploymentsResponse {
8732 /// Creates a new default instance.
8733 pub fn new() -> Self {
8734 std::default::Default::default()
8735 }
8736
8737 /// Sets the value of [cloud_control_deployments][crate::model::ListCloudControlDeploymentsResponse::cloud_control_deployments].
8738 ///
8739 /// # Example
8740 /// ```ignore,no_run
8741 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlDeploymentsResponse;
8742 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeployment;
8743 /// let x = ListCloudControlDeploymentsResponse::new()
8744 /// .set_cloud_control_deployments([
8745 /// CloudControlDeployment::default()/* use setters */,
8746 /// CloudControlDeployment::default()/* use (different) setters */,
8747 /// ]);
8748 /// ```
8749 pub fn set_cloud_control_deployments<T, V>(mut self, v: T) -> Self
8750 where
8751 T: std::iter::IntoIterator<Item = V>,
8752 V: std::convert::Into<crate::model::CloudControlDeployment>,
8753 {
8754 use std::iter::Iterator;
8755 self.cloud_control_deployments = v.into_iter().map(|i| i.into()).collect();
8756 self
8757 }
8758
8759 /// Sets the value of [next_page_token][crate::model::ListCloudControlDeploymentsResponse::next_page_token].
8760 ///
8761 /// # Example
8762 /// ```ignore,no_run
8763 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListCloudControlDeploymentsResponse;
8764 /// let x = ListCloudControlDeploymentsResponse::new().set_next_page_token("example");
8765 /// ```
8766 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8767 self.next_page_token = v.into();
8768 self
8769 }
8770}
8771
8772impl wkt::message::Message for ListCloudControlDeploymentsResponse {
8773 fn typename() -> &'static str {
8774 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListCloudControlDeploymentsResponse"
8775 }
8776}
8777
8778#[doc(hidden)]
8779impl google_cloud_gax::paginator::internal::PageableResponse
8780 for ListCloudControlDeploymentsResponse
8781{
8782 type PageItem = crate::model::CloudControlDeployment;
8783
8784 fn items(self) -> std::vec::Vec<Self::PageItem> {
8785 self.cloud_control_deployments
8786 }
8787
8788 fn next_page_token(&self) -> std::string::String {
8789 use std::clone::Clone;
8790 self.next_page_token.clone()
8791 }
8792}
8793
8794/// The reference to a cloud control deployment.
8795#[derive(Clone, Default, PartialEq)]
8796#[non_exhaustive]
8797pub struct CloudControlDeploymentReference {
8798 /// Output only. The name of the CloudControlDeployment. The format is
8799 /// `organizations/{organization}/locations/{location}/cloudControlDeployments/{cloud_control_deployment}`
8800 /// or
8801 /// `projects/{project}/locations/{location}/cloudControlDeployments/{cloud_control_deployment}`.
8802 /// The only supported location is `global`.
8803 pub cloud_control_deployment: std::string::String,
8804
8805 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8806}
8807
8808impl CloudControlDeploymentReference {
8809 /// Creates a new default instance.
8810 pub fn new() -> Self {
8811 std::default::Default::default()
8812 }
8813
8814 /// Sets the value of [cloud_control_deployment][crate::model::CloudControlDeploymentReference::cloud_control_deployment].
8815 ///
8816 /// # Example
8817 /// ```ignore,no_run
8818 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlDeploymentReference;
8819 /// # let organization_id = "organization_id";
8820 /// # let location_id = "location_id";
8821 /// # let cloud_control_deployment_id = "cloud_control_deployment_id";
8822 /// let x = CloudControlDeploymentReference::new().set_cloud_control_deployment(format!("organizations/{organization_id}/locations/{location_id}/cloudControlDeployments/{cloud_control_deployment_id}"));
8823 /// ```
8824 pub fn set_cloud_control_deployment<T: std::convert::Into<std::string::String>>(
8825 mut self,
8826 v: T,
8827 ) -> Self {
8828 self.cloud_control_deployment = v.into();
8829 self
8830 }
8831}
8832
8833impl wkt::message::Message for CloudControlDeploymentReference {
8834 fn typename() -> &'static str {
8835 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControlDeploymentReference"
8836 }
8837}
8838
8839/// The reference to a framework deployment.
8840#[derive(Clone, Default, PartialEq)]
8841#[non_exhaustive]
8842pub struct FrameworkDeploymentReference {
8843 /// Output only. The name of the framework deployment, in the format
8844 /// `organizations/{organization}/locations/{location}/frameworkDeployments/{framework_deployment}`
8845 /// or
8846 /// `projects/{project}/locations/{location}/frameworkDeployments/{framework_deployment}`.
8847 /// The only supported location is `global`.
8848 pub framework_deployment: std::string::String,
8849
8850 /// Optional. The reference to the framework that this deployment is for.
8851 /// For example:
8852 ///
8853 /// ```norust
8854 /// {
8855 /// framework:
8856 /// "organizations/{organization}/locations/{location}/frameworks/{framework}",
8857 /// major_revision_id: 1
8858 /// }
8859 /// ```
8860 ///
8861 /// The only supported location is `global`.
8862 pub framework_reference: std::option::Option<crate::model::FrameworkReference>,
8863
8864 /// Optional. The display name of the framework that this framework deployment
8865 /// is for.
8866 pub framework_display_name: std::string::String,
8867
8868 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8869}
8870
8871impl FrameworkDeploymentReference {
8872 /// Creates a new default instance.
8873 pub fn new() -> Self {
8874 std::default::Default::default()
8875 }
8876
8877 /// Sets the value of [framework_deployment][crate::model::FrameworkDeploymentReference::framework_deployment].
8878 ///
8879 /// # Example
8880 /// ```ignore,no_run
8881 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeploymentReference;
8882 /// # let organization_id = "organization_id";
8883 /// # let location_id = "location_id";
8884 /// # let framework_deployment_id = "framework_deployment_id";
8885 /// let x = FrameworkDeploymentReference::new().set_framework_deployment(format!("organizations/{organization_id}/locations/{location_id}/frameworkDeployments/{framework_deployment_id}"));
8886 /// ```
8887 pub fn set_framework_deployment<T: std::convert::Into<std::string::String>>(
8888 mut self,
8889 v: T,
8890 ) -> Self {
8891 self.framework_deployment = v.into();
8892 self
8893 }
8894
8895 /// Sets the value of [framework_reference][crate::model::FrameworkDeploymentReference::framework_reference].
8896 ///
8897 /// # Example
8898 /// ```ignore,no_run
8899 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeploymentReference;
8900 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkReference;
8901 /// let x = FrameworkDeploymentReference::new().set_framework_reference(FrameworkReference::default()/* use setters */);
8902 /// ```
8903 pub fn set_framework_reference<T>(mut self, v: T) -> Self
8904 where
8905 T: std::convert::Into<crate::model::FrameworkReference>,
8906 {
8907 self.framework_reference = std::option::Option::Some(v.into());
8908 self
8909 }
8910
8911 /// Sets or clears the value of [framework_reference][crate::model::FrameworkDeploymentReference::framework_reference].
8912 ///
8913 /// # Example
8914 /// ```ignore,no_run
8915 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeploymentReference;
8916 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkReference;
8917 /// let x = FrameworkDeploymentReference::new().set_or_clear_framework_reference(Some(FrameworkReference::default()/* use setters */));
8918 /// let x = FrameworkDeploymentReference::new().set_or_clear_framework_reference(None::<FrameworkReference>);
8919 /// ```
8920 pub fn set_or_clear_framework_reference<T>(mut self, v: std::option::Option<T>) -> Self
8921 where
8922 T: std::convert::Into<crate::model::FrameworkReference>,
8923 {
8924 self.framework_reference = v.map(|x| x.into());
8925 self
8926 }
8927
8928 /// Sets the value of [framework_display_name][crate::model::FrameworkDeploymentReference::framework_display_name].
8929 ///
8930 /// # Example
8931 /// ```ignore,no_run
8932 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkDeploymentReference;
8933 /// let x = FrameworkDeploymentReference::new().set_framework_display_name("example");
8934 /// ```
8935 pub fn set_framework_display_name<T: std::convert::Into<std::string::String>>(
8936 mut self,
8937 v: T,
8938 ) -> Self {
8939 self.framework_display_name = v.into();
8940 self
8941 }
8942}
8943
8944impl wkt::message::Message for FrameworkDeploymentReference {
8945 fn typename() -> &'static str {
8946 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FrameworkDeploymentReference"
8947 }
8948}
8949
8950/// The request message for
8951/// [ListFrameworkComplianceSummariesRequest][google.cloud.cloudsecuritycompliance.v1.ListFrameworkComplianceSummariesRequest].
8952///
8953/// [google.cloud.cloudsecuritycompliance.v1.ListFrameworkComplianceSummariesRequest]: crate::model::ListFrameworkComplianceSummariesRequest
8954#[derive(Clone, Default, PartialEq)]
8955#[non_exhaustive]
8956pub struct ListFrameworkComplianceSummariesRequest {
8957 /// Required. The parent scope for the framework compliance summary.
8958 pub parent: std::string::String,
8959
8960 /// Optional. The requested page size. The server might return fewer items than
8961 /// requested. If unspecified, the server picks an appropriate default.
8962 pub page_size: i32,
8963
8964 /// Optional. A token that identifies the page of results that the server
8965 /// should return.
8966 pub page_token: std::string::String,
8967
8968 /// Optional. The filtering results.
8969 pub filter: std::string::String,
8970
8971 /// Optional. Specifies the level of detail to return in the response.
8972 pub view: crate::model::FrameworkComplianceSummaryView,
8973
8974 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8975}
8976
8977impl ListFrameworkComplianceSummariesRequest {
8978 /// Creates a new default instance.
8979 pub fn new() -> Self {
8980 std::default::Default::default()
8981 }
8982
8983 /// Sets the value of [parent][crate::model::ListFrameworkComplianceSummariesRequest::parent].
8984 ///
8985 /// # Example
8986 /// ```ignore,no_run
8987 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkComplianceSummariesRequest;
8988 /// # let project_id = "project_id";
8989 /// # let location_id = "location_id";
8990 /// let x = ListFrameworkComplianceSummariesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
8991 /// ```
8992 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8993 self.parent = v.into();
8994 self
8995 }
8996
8997 /// Sets the value of [page_size][crate::model::ListFrameworkComplianceSummariesRequest::page_size].
8998 ///
8999 /// # Example
9000 /// ```ignore,no_run
9001 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkComplianceSummariesRequest;
9002 /// let x = ListFrameworkComplianceSummariesRequest::new().set_page_size(42);
9003 /// ```
9004 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9005 self.page_size = v.into();
9006 self
9007 }
9008
9009 /// Sets the value of [page_token][crate::model::ListFrameworkComplianceSummariesRequest::page_token].
9010 ///
9011 /// # Example
9012 /// ```ignore,no_run
9013 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkComplianceSummariesRequest;
9014 /// let x = ListFrameworkComplianceSummariesRequest::new().set_page_token("example");
9015 /// ```
9016 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9017 self.page_token = v.into();
9018 self
9019 }
9020
9021 /// Sets the value of [filter][crate::model::ListFrameworkComplianceSummariesRequest::filter].
9022 ///
9023 /// # Example
9024 /// ```ignore,no_run
9025 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkComplianceSummariesRequest;
9026 /// let x = ListFrameworkComplianceSummariesRequest::new().set_filter("example");
9027 /// ```
9028 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9029 self.filter = v.into();
9030 self
9031 }
9032
9033 /// Sets the value of [view][crate::model::ListFrameworkComplianceSummariesRequest::view].
9034 ///
9035 /// # Example
9036 /// ```ignore,no_run
9037 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkComplianceSummariesRequest;
9038 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummaryView;
9039 /// let x0 = ListFrameworkComplianceSummariesRequest::new().set_view(FrameworkComplianceSummaryView::Basic);
9040 /// let x1 = ListFrameworkComplianceSummariesRequest::new().set_view(FrameworkComplianceSummaryView::Full);
9041 /// ```
9042 pub fn set_view<T: std::convert::Into<crate::model::FrameworkComplianceSummaryView>>(
9043 mut self,
9044 v: T,
9045 ) -> Self {
9046 self.view = v.into();
9047 self
9048 }
9049}
9050
9051impl wkt::message::Message for ListFrameworkComplianceSummariesRequest {
9052 fn typename() -> &'static str {
9053 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFrameworkComplianceSummariesRequest"
9054 }
9055}
9056
9057/// The response message for
9058/// [ListFrameworkComplianceSummariesResponse][google.cloud.cloudsecuritycompliance.v1.ListFrameworkComplianceSummariesResponse].
9059///
9060/// [google.cloud.cloudsecuritycompliance.v1.ListFrameworkComplianceSummariesResponse]: crate::model::ListFrameworkComplianceSummariesResponse
9061#[derive(Clone, Default, PartialEq)]
9062#[non_exhaustive]
9063pub struct ListFrameworkComplianceSummariesResponse {
9064 /// The list of framework compliance summaries.
9065 pub framework_compliance_summaries: std::vec::Vec<crate::model::FrameworkComplianceSummary>,
9066
9067 /// Output only. The token to retrieve the next page of results.
9068 pub next_page_token: std::string::String,
9069
9070 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9071}
9072
9073impl ListFrameworkComplianceSummariesResponse {
9074 /// Creates a new default instance.
9075 pub fn new() -> Self {
9076 std::default::Default::default()
9077 }
9078
9079 /// Sets the value of [framework_compliance_summaries][crate::model::ListFrameworkComplianceSummariesResponse::framework_compliance_summaries].
9080 ///
9081 /// # Example
9082 /// ```ignore,no_run
9083 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkComplianceSummariesResponse;
9084 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
9085 /// let x = ListFrameworkComplianceSummariesResponse::new()
9086 /// .set_framework_compliance_summaries([
9087 /// FrameworkComplianceSummary::default()/* use setters */,
9088 /// FrameworkComplianceSummary::default()/* use (different) setters */,
9089 /// ]);
9090 /// ```
9091 pub fn set_framework_compliance_summaries<T, V>(mut self, v: T) -> Self
9092 where
9093 T: std::iter::IntoIterator<Item = V>,
9094 V: std::convert::Into<crate::model::FrameworkComplianceSummary>,
9095 {
9096 use std::iter::Iterator;
9097 self.framework_compliance_summaries = v.into_iter().map(|i| i.into()).collect();
9098 self
9099 }
9100
9101 /// Sets the value of [next_page_token][crate::model::ListFrameworkComplianceSummariesResponse::next_page_token].
9102 ///
9103 /// # Example
9104 /// ```ignore,no_run
9105 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFrameworkComplianceSummariesResponse;
9106 /// let x = ListFrameworkComplianceSummariesResponse::new().set_next_page_token("example");
9107 /// ```
9108 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9109 self.next_page_token = v.into();
9110 self
9111 }
9112}
9113
9114impl wkt::message::Message for ListFrameworkComplianceSummariesResponse {
9115 fn typename() -> &'static str {
9116 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFrameworkComplianceSummariesResponse"
9117 }
9118}
9119
9120#[doc(hidden)]
9121impl google_cloud_gax::paginator::internal::PageableResponse
9122 for ListFrameworkComplianceSummariesResponse
9123{
9124 type PageItem = crate::model::FrameworkComplianceSummary;
9125
9126 fn items(self) -> std::vec::Vec<Self::PageItem> {
9127 self.framework_compliance_summaries
9128 }
9129
9130 fn next_page_token(&self) -> std::string::String {
9131 use std::clone::Clone;
9132 self.next_page_token.clone()
9133 }
9134}
9135
9136/// The response message for [GetFrameworkComplianceReport][].
9137#[derive(Clone, Default, PartialEq)]
9138#[non_exhaustive]
9139pub struct FrameworkComplianceReport {
9140 /// The name of the framework.
9141 pub framework: std::string::String,
9142
9143 /// The description of the framework.
9144 pub framework_description: std::string::String,
9145
9146 /// Output only. The last updated time of the report.
9147 pub update_time: std::option::Option<wkt::Timestamp>,
9148
9149 /// The control assessment details of the framework.
9150 pub control_assessment_details: std::option::Option<crate::model::ControlAssessmentDetails>,
9151
9152 /// The type of framework.
9153 pub framework_type: crate::model::framework::FrameworkType,
9154
9155 /// The list of cloud providers supported by the framework.
9156 pub supported_cloud_providers: std::vec::Vec<crate::model::CloudProvider>,
9157
9158 /// The list of framework categories supported.
9159 pub framework_categories: std::vec::Vec<crate::model::FrameworkCategory>,
9160
9161 /// Optional. The display name for the framework.
9162 pub framework_display_name: std::string::String,
9163
9164 /// Identifier. The name of the framework compliance report.
9165 pub name: std::string::String,
9166
9167 /// The latest major revision ID of the framework.
9168 pub major_revision_id: i64,
9169
9170 /// The latest minor revision ID of the latest major revision of the framework.
9171 pub minor_revision_id: i64,
9172
9173 /// The target resource details of the framework.
9174 pub target_resource_details: std::vec::Vec<crate::model::TargetResourceDetails>,
9175
9176 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9177}
9178
9179impl FrameworkComplianceReport {
9180 /// Creates a new default instance.
9181 pub fn new() -> Self {
9182 std::default::Default::default()
9183 }
9184
9185 /// Sets the value of [framework][crate::model::FrameworkComplianceReport::framework].
9186 ///
9187 /// # Example
9188 /// ```ignore,no_run
9189 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
9190 /// let x = FrameworkComplianceReport::new().set_framework("example");
9191 /// ```
9192 pub fn set_framework<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9193 self.framework = v.into();
9194 self
9195 }
9196
9197 /// Sets the value of [framework_description][crate::model::FrameworkComplianceReport::framework_description].
9198 ///
9199 /// # Example
9200 /// ```ignore,no_run
9201 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
9202 /// let x = FrameworkComplianceReport::new().set_framework_description("example");
9203 /// ```
9204 pub fn set_framework_description<T: std::convert::Into<std::string::String>>(
9205 mut self,
9206 v: T,
9207 ) -> Self {
9208 self.framework_description = v.into();
9209 self
9210 }
9211
9212 /// Sets the value of [update_time][crate::model::FrameworkComplianceReport::update_time].
9213 ///
9214 /// # Example
9215 /// ```ignore,no_run
9216 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
9217 /// use wkt::Timestamp;
9218 /// let x = FrameworkComplianceReport::new().set_update_time(Timestamp::default()/* use setters */);
9219 /// ```
9220 pub fn set_update_time<T>(mut self, v: T) -> Self
9221 where
9222 T: std::convert::Into<wkt::Timestamp>,
9223 {
9224 self.update_time = std::option::Option::Some(v.into());
9225 self
9226 }
9227
9228 /// Sets or clears the value of [update_time][crate::model::FrameworkComplianceReport::update_time].
9229 ///
9230 /// # Example
9231 /// ```ignore,no_run
9232 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
9233 /// use wkt::Timestamp;
9234 /// let x = FrameworkComplianceReport::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9235 /// let x = FrameworkComplianceReport::new().set_or_clear_update_time(None::<Timestamp>);
9236 /// ```
9237 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9238 where
9239 T: std::convert::Into<wkt::Timestamp>,
9240 {
9241 self.update_time = v.map(|x| x.into());
9242 self
9243 }
9244
9245 /// Sets the value of [control_assessment_details][crate::model::FrameworkComplianceReport::control_assessment_details].
9246 ///
9247 /// # Example
9248 /// ```ignore,no_run
9249 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
9250 /// use google_cloud_cloudsecuritycompliance_v1::model::ControlAssessmentDetails;
9251 /// let x = FrameworkComplianceReport::new().set_control_assessment_details(ControlAssessmentDetails::default()/* use setters */);
9252 /// ```
9253 pub fn set_control_assessment_details<T>(mut self, v: T) -> Self
9254 where
9255 T: std::convert::Into<crate::model::ControlAssessmentDetails>,
9256 {
9257 self.control_assessment_details = std::option::Option::Some(v.into());
9258 self
9259 }
9260
9261 /// Sets or clears the value of [control_assessment_details][crate::model::FrameworkComplianceReport::control_assessment_details].
9262 ///
9263 /// # Example
9264 /// ```ignore,no_run
9265 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
9266 /// use google_cloud_cloudsecuritycompliance_v1::model::ControlAssessmentDetails;
9267 /// let x = FrameworkComplianceReport::new().set_or_clear_control_assessment_details(Some(ControlAssessmentDetails::default()/* use setters */));
9268 /// let x = FrameworkComplianceReport::new().set_or_clear_control_assessment_details(None::<ControlAssessmentDetails>);
9269 /// ```
9270 pub fn set_or_clear_control_assessment_details<T>(mut self, v: std::option::Option<T>) -> Self
9271 where
9272 T: std::convert::Into<crate::model::ControlAssessmentDetails>,
9273 {
9274 self.control_assessment_details = v.map(|x| x.into());
9275 self
9276 }
9277
9278 /// Sets the value of [framework_type][crate::model::FrameworkComplianceReport::framework_type].
9279 ///
9280 /// # Example
9281 /// ```ignore,no_run
9282 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
9283 /// use google_cloud_cloudsecuritycompliance_v1::model::framework::FrameworkType;
9284 /// let x0 = FrameworkComplianceReport::new().set_framework_type(FrameworkType::BuiltIn);
9285 /// let x1 = FrameworkComplianceReport::new().set_framework_type(FrameworkType::Custom);
9286 /// ```
9287 pub fn set_framework_type<T: std::convert::Into<crate::model::framework::FrameworkType>>(
9288 mut self,
9289 v: T,
9290 ) -> Self {
9291 self.framework_type = v.into();
9292 self
9293 }
9294
9295 /// Sets the value of [supported_cloud_providers][crate::model::FrameworkComplianceReport::supported_cloud_providers].
9296 ///
9297 /// # Example
9298 /// ```ignore,no_run
9299 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
9300 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudProvider;
9301 /// let x = FrameworkComplianceReport::new().set_supported_cloud_providers([
9302 /// CloudProvider::Aws,
9303 /// CloudProvider::Azure,
9304 /// CloudProvider::Gcp,
9305 /// ]);
9306 /// ```
9307 pub fn set_supported_cloud_providers<T, V>(mut self, v: T) -> Self
9308 where
9309 T: std::iter::IntoIterator<Item = V>,
9310 V: std::convert::Into<crate::model::CloudProvider>,
9311 {
9312 use std::iter::Iterator;
9313 self.supported_cloud_providers = v.into_iter().map(|i| i.into()).collect();
9314 self
9315 }
9316
9317 /// Sets the value of [framework_categories][crate::model::FrameworkComplianceReport::framework_categories].
9318 ///
9319 /// # Example
9320 /// ```ignore,no_run
9321 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
9322 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkCategory;
9323 /// let x = FrameworkComplianceReport::new().set_framework_categories([
9324 /// FrameworkCategory::IndustryDefinedStandard,
9325 /// FrameworkCategory::AssuredWorkloads,
9326 /// FrameworkCategory::DataSecurity,
9327 /// ]);
9328 /// ```
9329 pub fn set_framework_categories<T, V>(mut self, v: T) -> Self
9330 where
9331 T: std::iter::IntoIterator<Item = V>,
9332 V: std::convert::Into<crate::model::FrameworkCategory>,
9333 {
9334 use std::iter::Iterator;
9335 self.framework_categories = v.into_iter().map(|i| i.into()).collect();
9336 self
9337 }
9338
9339 /// Sets the value of [framework_display_name][crate::model::FrameworkComplianceReport::framework_display_name].
9340 ///
9341 /// # Example
9342 /// ```ignore,no_run
9343 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
9344 /// let x = FrameworkComplianceReport::new().set_framework_display_name("example");
9345 /// ```
9346 pub fn set_framework_display_name<T: std::convert::Into<std::string::String>>(
9347 mut self,
9348 v: T,
9349 ) -> Self {
9350 self.framework_display_name = v.into();
9351 self
9352 }
9353
9354 /// Sets the value of [name][crate::model::FrameworkComplianceReport::name].
9355 ///
9356 /// # Example
9357 /// ```ignore,no_run
9358 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
9359 /// # let project_id = "project_id";
9360 /// # let location_id = "location_id";
9361 /// # let framework_compliance_report_id = "framework_compliance_report_id";
9362 /// let x = FrameworkComplianceReport::new().set_name(format!("projects/{project_id}/locations/{location_id}/frameworkComplianceReports/{framework_compliance_report_id}"));
9363 /// ```
9364 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9365 self.name = v.into();
9366 self
9367 }
9368
9369 /// Sets the value of [major_revision_id][crate::model::FrameworkComplianceReport::major_revision_id].
9370 ///
9371 /// # Example
9372 /// ```ignore,no_run
9373 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
9374 /// let x = FrameworkComplianceReport::new().set_major_revision_id(42);
9375 /// ```
9376 pub fn set_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9377 self.major_revision_id = v.into();
9378 self
9379 }
9380
9381 /// Sets the value of [minor_revision_id][crate::model::FrameworkComplianceReport::minor_revision_id].
9382 ///
9383 /// # Example
9384 /// ```ignore,no_run
9385 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
9386 /// let x = FrameworkComplianceReport::new().set_minor_revision_id(42);
9387 /// ```
9388 pub fn set_minor_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9389 self.minor_revision_id = v.into();
9390 self
9391 }
9392
9393 /// Sets the value of [target_resource_details][crate::model::FrameworkComplianceReport::target_resource_details].
9394 ///
9395 /// # Example
9396 /// ```ignore,no_run
9397 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceReport;
9398 /// use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceDetails;
9399 /// let x = FrameworkComplianceReport::new()
9400 /// .set_target_resource_details([
9401 /// TargetResourceDetails::default()/* use setters */,
9402 /// TargetResourceDetails::default()/* use (different) setters */,
9403 /// ]);
9404 /// ```
9405 pub fn set_target_resource_details<T, V>(mut self, v: T) -> Self
9406 where
9407 T: std::iter::IntoIterator<Item = V>,
9408 V: std::convert::Into<crate::model::TargetResourceDetails>,
9409 {
9410 use std::iter::Iterator;
9411 self.target_resource_details = v.into_iter().map(|i| i.into()).collect();
9412 self
9413 }
9414}
9415
9416impl wkt::message::Message for FrameworkComplianceReport {
9417 fn typename() -> &'static str {
9418 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FrameworkComplianceReport"
9419 }
9420}
9421
9422/// The request message for [FetchFrameworkComplianceReport][].
9423#[derive(Clone, Default, PartialEq)]
9424#[non_exhaustive]
9425pub struct FetchFrameworkComplianceReportRequest {
9426 /// Required. The name of the framework compliance report to retrieve.
9427 pub name: std::string::String,
9428
9429 /// Optional. The end time of the report.
9430 pub end_time: std::option::Option<wkt::Timestamp>,
9431
9432 /// Optional. The filtering results.
9433 pub filter: std::string::String,
9434
9435 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9436}
9437
9438impl FetchFrameworkComplianceReportRequest {
9439 /// Creates a new default instance.
9440 pub fn new() -> Self {
9441 std::default::Default::default()
9442 }
9443
9444 /// Sets the value of [name][crate::model::FetchFrameworkComplianceReportRequest::name].
9445 ///
9446 /// # Example
9447 /// ```ignore,no_run
9448 /// # use google_cloud_cloudsecuritycompliance_v1::model::FetchFrameworkComplianceReportRequest;
9449 /// # let project_id = "project_id";
9450 /// # let location_id = "location_id";
9451 /// # let framework_compliance_report_id = "framework_compliance_report_id";
9452 /// let x = FetchFrameworkComplianceReportRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/frameworkComplianceReports/{framework_compliance_report_id}"));
9453 /// ```
9454 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9455 self.name = v.into();
9456 self
9457 }
9458
9459 /// Sets the value of [end_time][crate::model::FetchFrameworkComplianceReportRequest::end_time].
9460 ///
9461 /// # Example
9462 /// ```ignore,no_run
9463 /// # use google_cloud_cloudsecuritycompliance_v1::model::FetchFrameworkComplianceReportRequest;
9464 /// use wkt::Timestamp;
9465 /// let x = FetchFrameworkComplianceReportRequest::new().set_end_time(Timestamp::default()/* use setters */);
9466 /// ```
9467 pub fn set_end_time<T>(mut self, v: T) -> Self
9468 where
9469 T: std::convert::Into<wkt::Timestamp>,
9470 {
9471 self.end_time = std::option::Option::Some(v.into());
9472 self
9473 }
9474
9475 /// Sets or clears the value of [end_time][crate::model::FetchFrameworkComplianceReportRequest::end_time].
9476 ///
9477 /// # Example
9478 /// ```ignore,no_run
9479 /// # use google_cloud_cloudsecuritycompliance_v1::model::FetchFrameworkComplianceReportRequest;
9480 /// use wkt::Timestamp;
9481 /// let x = FetchFrameworkComplianceReportRequest::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
9482 /// let x = FetchFrameworkComplianceReportRequest::new().set_or_clear_end_time(None::<Timestamp>);
9483 /// ```
9484 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
9485 where
9486 T: std::convert::Into<wkt::Timestamp>,
9487 {
9488 self.end_time = v.map(|x| x.into());
9489 self
9490 }
9491
9492 /// Sets the value of [filter][crate::model::FetchFrameworkComplianceReportRequest::filter].
9493 ///
9494 /// # Example
9495 /// ```ignore,no_run
9496 /// # use google_cloud_cloudsecuritycompliance_v1::model::FetchFrameworkComplianceReportRequest;
9497 /// let x = FetchFrameworkComplianceReportRequest::new().set_filter("example");
9498 /// ```
9499 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9500 self.filter = v.into();
9501 self
9502 }
9503}
9504
9505impl wkt::message::Message for FetchFrameworkComplianceReportRequest {
9506 fn typename() -> &'static str {
9507 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FetchFrameworkComplianceReportRequest"
9508 }
9509}
9510
9511/// The request message for [ListFindingSummaries][].
9512#[derive(Clone, Default, PartialEq)]
9513#[non_exhaustive]
9514pub struct ListFindingSummariesRequest {
9515 /// Required. The parent scope for the framework overview page.
9516 pub parent: std::string::String,
9517
9518 /// Optional. The requested page size. The server might return fewer items than
9519 /// requested. If unspecified, the server picks an appropriate default.
9520 pub page_size: i32,
9521
9522 /// Optional. A token that identifies the page of results that the server
9523 /// should return.
9524 pub page_token: std::string::String,
9525
9526 /// Optional. The filtering results.
9527 pub filter: std::string::String,
9528
9529 /// Optional. The end time of the finding summary.
9530 #[deprecated]
9531 pub end_time: std::option::Option<wkt::Timestamp>,
9532
9533 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9534}
9535
9536impl ListFindingSummariesRequest {
9537 /// Creates a new default instance.
9538 pub fn new() -> Self {
9539 std::default::Default::default()
9540 }
9541
9542 /// Sets the value of [parent][crate::model::ListFindingSummariesRequest::parent].
9543 ///
9544 /// # Example
9545 /// ```ignore,no_run
9546 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFindingSummariesRequest;
9547 /// # let project_id = "project_id";
9548 /// # let location_id = "location_id";
9549 /// let x = ListFindingSummariesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
9550 /// ```
9551 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9552 self.parent = v.into();
9553 self
9554 }
9555
9556 /// Sets the value of [page_size][crate::model::ListFindingSummariesRequest::page_size].
9557 ///
9558 /// # Example
9559 /// ```ignore,no_run
9560 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFindingSummariesRequest;
9561 /// let x = ListFindingSummariesRequest::new().set_page_size(42);
9562 /// ```
9563 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9564 self.page_size = v.into();
9565 self
9566 }
9567
9568 /// Sets the value of [page_token][crate::model::ListFindingSummariesRequest::page_token].
9569 ///
9570 /// # Example
9571 /// ```ignore,no_run
9572 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFindingSummariesRequest;
9573 /// let x = ListFindingSummariesRequest::new().set_page_token("example");
9574 /// ```
9575 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9576 self.page_token = v.into();
9577 self
9578 }
9579
9580 /// Sets the value of [filter][crate::model::ListFindingSummariesRequest::filter].
9581 ///
9582 /// # Example
9583 /// ```ignore,no_run
9584 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFindingSummariesRequest;
9585 /// let x = ListFindingSummariesRequest::new().set_filter("example");
9586 /// ```
9587 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9588 self.filter = v.into();
9589 self
9590 }
9591
9592 /// Sets the value of [end_time][crate::model::ListFindingSummariesRequest::end_time].
9593 ///
9594 /// # Example
9595 /// ```ignore,no_run
9596 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFindingSummariesRequest;
9597 /// use wkt::Timestamp;
9598 /// let x = ListFindingSummariesRequest::new().set_end_time(Timestamp::default()/* use setters */);
9599 /// ```
9600 #[deprecated]
9601 pub fn set_end_time<T>(mut self, v: T) -> Self
9602 where
9603 T: std::convert::Into<wkt::Timestamp>,
9604 {
9605 self.end_time = std::option::Option::Some(v.into());
9606 self
9607 }
9608
9609 /// Sets or clears the value of [end_time][crate::model::ListFindingSummariesRequest::end_time].
9610 ///
9611 /// # Example
9612 /// ```ignore,no_run
9613 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFindingSummariesRequest;
9614 /// use wkt::Timestamp;
9615 /// let x = ListFindingSummariesRequest::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
9616 /// let x = ListFindingSummariesRequest::new().set_or_clear_end_time(None::<Timestamp>);
9617 /// ```
9618 #[deprecated]
9619 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
9620 where
9621 T: std::convert::Into<wkt::Timestamp>,
9622 {
9623 self.end_time = v.map(|x| x.into());
9624 self
9625 }
9626}
9627
9628impl wkt::message::Message for ListFindingSummariesRequest {
9629 fn typename() -> &'static str {
9630 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFindingSummariesRequest"
9631 }
9632}
9633
9634/// The response message for [ListFindingSummaries][].
9635#[derive(Clone, Default, PartialEq)]
9636#[non_exhaustive]
9637pub struct ListFindingSummariesResponse {
9638 /// List of finding summary by category.
9639 pub finding_summaries: std::vec::Vec<crate::model::FindingSummary>,
9640
9641 /// Output only. The token to retrieve the next page of results.
9642 pub next_page_token: std::string::String,
9643
9644 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9645}
9646
9647impl ListFindingSummariesResponse {
9648 /// Creates a new default instance.
9649 pub fn new() -> Self {
9650 std::default::Default::default()
9651 }
9652
9653 /// Sets the value of [finding_summaries][crate::model::ListFindingSummariesResponse::finding_summaries].
9654 ///
9655 /// # Example
9656 /// ```ignore,no_run
9657 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFindingSummariesResponse;
9658 /// use google_cloud_cloudsecuritycompliance_v1::model::FindingSummary;
9659 /// let x = ListFindingSummariesResponse::new()
9660 /// .set_finding_summaries([
9661 /// FindingSummary::default()/* use setters */,
9662 /// FindingSummary::default()/* use (different) setters */,
9663 /// ]);
9664 /// ```
9665 pub fn set_finding_summaries<T, V>(mut self, v: T) -> Self
9666 where
9667 T: std::iter::IntoIterator<Item = V>,
9668 V: std::convert::Into<crate::model::FindingSummary>,
9669 {
9670 use std::iter::Iterator;
9671 self.finding_summaries = v.into_iter().map(|i| i.into()).collect();
9672 self
9673 }
9674
9675 /// Sets the value of [next_page_token][crate::model::ListFindingSummariesResponse::next_page_token].
9676 ///
9677 /// # Example
9678 /// ```ignore,no_run
9679 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListFindingSummariesResponse;
9680 /// let x = ListFindingSummariesResponse::new().set_next_page_token("example");
9681 /// ```
9682 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9683 self.next_page_token = v.into();
9684 self
9685 }
9686}
9687
9688impl wkt::message::Message for ListFindingSummariesResponse {
9689 fn typename() -> &'static str {
9690 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListFindingSummariesResponse"
9691 }
9692}
9693
9694#[doc(hidden)]
9695impl google_cloud_gax::paginator::internal::PageableResponse for ListFindingSummariesResponse {
9696 type PageItem = crate::model::FindingSummary;
9697
9698 fn items(self) -> std::vec::Vec<Self::PageItem> {
9699 self.finding_summaries
9700 }
9701
9702 fn next_page_token(&self) -> std::string::String {
9703 use std::clone::Clone;
9704 self.next_page_token.clone()
9705 }
9706}
9707
9708/// The request message for [ListControlComplianceSummaries][].
9709#[derive(Clone, Default, PartialEq)]
9710#[non_exhaustive]
9711pub struct ListControlComplianceSummariesRequest {
9712 /// Required. The parent scope for the framework overview page.
9713 pub parent: std::string::String,
9714
9715 /// Optional. The end time of the control compliance summary.
9716 #[deprecated]
9717 pub end_time: std::option::Option<wkt::Timestamp>,
9718
9719 /// Optional. The requested page size. The server might return fewer items than
9720 /// requested. If unspecified, the server picks an appropriate default.
9721 pub page_size: i32,
9722
9723 /// Optional. A token that identifies the page of results that the server
9724 /// should return.
9725 pub page_token: std::string::String,
9726
9727 /// Optional. The filtering results.
9728 pub filter: std::string::String,
9729
9730 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9731}
9732
9733impl ListControlComplianceSummariesRequest {
9734 /// Creates a new default instance.
9735 pub fn new() -> Self {
9736 std::default::Default::default()
9737 }
9738
9739 /// Sets the value of [parent][crate::model::ListControlComplianceSummariesRequest::parent].
9740 ///
9741 /// # Example
9742 /// ```ignore,no_run
9743 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListControlComplianceSummariesRequest;
9744 /// # let project_id = "project_id";
9745 /// # let location_id = "location_id";
9746 /// # let framework_compliance_report_id = "framework_compliance_report_id";
9747 /// let x = ListControlComplianceSummariesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/frameworkComplianceReports/{framework_compliance_report_id}"));
9748 /// ```
9749 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9750 self.parent = v.into();
9751 self
9752 }
9753
9754 /// Sets the value of [end_time][crate::model::ListControlComplianceSummariesRequest::end_time].
9755 ///
9756 /// # Example
9757 /// ```ignore,no_run
9758 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListControlComplianceSummariesRequest;
9759 /// use wkt::Timestamp;
9760 /// let x = ListControlComplianceSummariesRequest::new().set_end_time(Timestamp::default()/* use setters */);
9761 /// ```
9762 #[deprecated]
9763 pub fn set_end_time<T>(mut self, v: T) -> Self
9764 where
9765 T: std::convert::Into<wkt::Timestamp>,
9766 {
9767 self.end_time = std::option::Option::Some(v.into());
9768 self
9769 }
9770
9771 /// Sets or clears the value of [end_time][crate::model::ListControlComplianceSummariesRequest::end_time].
9772 ///
9773 /// # Example
9774 /// ```ignore,no_run
9775 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListControlComplianceSummariesRequest;
9776 /// use wkt::Timestamp;
9777 /// let x = ListControlComplianceSummariesRequest::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
9778 /// let x = ListControlComplianceSummariesRequest::new().set_or_clear_end_time(None::<Timestamp>);
9779 /// ```
9780 #[deprecated]
9781 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
9782 where
9783 T: std::convert::Into<wkt::Timestamp>,
9784 {
9785 self.end_time = v.map(|x| x.into());
9786 self
9787 }
9788
9789 /// Sets the value of [page_size][crate::model::ListControlComplianceSummariesRequest::page_size].
9790 ///
9791 /// # Example
9792 /// ```ignore,no_run
9793 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListControlComplianceSummariesRequest;
9794 /// let x = ListControlComplianceSummariesRequest::new().set_page_size(42);
9795 /// ```
9796 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9797 self.page_size = v.into();
9798 self
9799 }
9800
9801 /// Sets the value of [page_token][crate::model::ListControlComplianceSummariesRequest::page_token].
9802 ///
9803 /// # Example
9804 /// ```ignore,no_run
9805 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListControlComplianceSummariesRequest;
9806 /// let x = ListControlComplianceSummariesRequest::new().set_page_token("example");
9807 /// ```
9808 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9809 self.page_token = v.into();
9810 self
9811 }
9812
9813 /// Sets the value of [filter][crate::model::ListControlComplianceSummariesRequest::filter].
9814 ///
9815 /// # Example
9816 /// ```ignore,no_run
9817 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListControlComplianceSummariesRequest;
9818 /// let x = ListControlComplianceSummariesRequest::new().set_filter("example");
9819 /// ```
9820 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9821 self.filter = v.into();
9822 self
9823 }
9824}
9825
9826impl wkt::message::Message for ListControlComplianceSummariesRequest {
9827 fn typename() -> &'static str {
9828 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListControlComplianceSummariesRequest"
9829 }
9830}
9831
9832/// The response message for [ListControlComplianceSummaries][].
9833#[derive(Clone, Default, PartialEq)]
9834#[non_exhaustive]
9835pub struct ListControlComplianceSummariesResponse {
9836 /// The list of control compliance details.
9837 pub control_compliance_summaries: std::vec::Vec<crate::model::ControlComplianceSummary>,
9838
9839 /// Output only. The token to retrieve the next page of results.
9840 pub next_page_token: std::string::String,
9841
9842 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9843}
9844
9845impl ListControlComplianceSummariesResponse {
9846 /// Creates a new default instance.
9847 pub fn new() -> Self {
9848 std::default::Default::default()
9849 }
9850
9851 /// Sets the value of [control_compliance_summaries][crate::model::ListControlComplianceSummariesResponse::control_compliance_summaries].
9852 ///
9853 /// # Example
9854 /// ```ignore,no_run
9855 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListControlComplianceSummariesResponse;
9856 /// use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
9857 /// let x = ListControlComplianceSummariesResponse::new()
9858 /// .set_control_compliance_summaries([
9859 /// ControlComplianceSummary::default()/* use setters */,
9860 /// ControlComplianceSummary::default()/* use (different) setters */,
9861 /// ]);
9862 /// ```
9863 pub fn set_control_compliance_summaries<T, V>(mut self, v: T) -> Self
9864 where
9865 T: std::iter::IntoIterator<Item = V>,
9866 V: std::convert::Into<crate::model::ControlComplianceSummary>,
9867 {
9868 use std::iter::Iterator;
9869 self.control_compliance_summaries = v.into_iter().map(|i| i.into()).collect();
9870 self
9871 }
9872
9873 /// Sets the value of [next_page_token][crate::model::ListControlComplianceSummariesResponse::next_page_token].
9874 ///
9875 /// # Example
9876 /// ```ignore,no_run
9877 /// # use google_cloud_cloudsecuritycompliance_v1::model::ListControlComplianceSummariesResponse;
9878 /// let x = ListControlComplianceSummariesResponse::new().set_next_page_token("example");
9879 /// ```
9880 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9881 self.next_page_token = v.into();
9882 self
9883 }
9884}
9885
9886impl wkt::message::Message for ListControlComplianceSummariesResponse {
9887 fn typename() -> &'static str {
9888 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ListControlComplianceSummariesResponse"
9889 }
9890}
9891
9892#[doc(hidden)]
9893impl google_cloud_gax::paginator::internal::PageableResponse
9894 for ListControlComplianceSummariesResponse
9895{
9896 type PageItem = crate::model::ControlComplianceSummary;
9897
9898 fn items(self) -> std::vec::Vec<Self::PageItem> {
9899 self.control_compliance_summaries
9900 }
9901
9902 fn next_page_token(&self) -> std::string::String {
9903 use std::clone::Clone;
9904 self.next_page_token.clone()
9905 }
9906}
9907
9908/// The request message for [AggregateFrameworkComplianceReport][].
9909#[derive(Clone, Default, PartialEq)]
9910#[non_exhaustive]
9911pub struct AggregateFrameworkComplianceReportRequest {
9912 /// Required. The name of the aggregated compliance report over time to
9913 /// retrieve.
9914 ///
9915 /// The supported format is:
9916 /// `organizations/{organization_id}/locations/{location}/frameworkComplianceReports/{framework_compliance_report}`
9917 pub name: std::string::String,
9918
9919 /// Optional. The start and end time range for the aggregated compliance
9920 /// report.
9921 pub interval: std::option::Option<google_cloud_type::model::Interval>,
9922
9923 /// Optional. The filtering results.
9924 pub filter: std::string::String,
9925
9926 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9927}
9928
9929impl AggregateFrameworkComplianceReportRequest {
9930 /// Creates a new default instance.
9931 pub fn new() -> Self {
9932 std::default::Default::default()
9933 }
9934
9935 /// Sets the value of [name][crate::model::AggregateFrameworkComplianceReportRequest::name].
9936 ///
9937 /// # Example
9938 /// ```ignore,no_run
9939 /// # use google_cloud_cloudsecuritycompliance_v1::model::AggregateFrameworkComplianceReportRequest;
9940 /// # let project_id = "project_id";
9941 /// # let location_id = "location_id";
9942 /// # let framework_compliance_report_id = "framework_compliance_report_id";
9943 /// let x = AggregateFrameworkComplianceReportRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/frameworkComplianceReports/{framework_compliance_report_id}"));
9944 /// ```
9945 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9946 self.name = v.into();
9947 self
9948 }
9949
9950 /// Sets the value of [interval][crate::model::AggregateFrameworkComplianceReportRequest::interval].
9951 ///
9952 /// # Example
9953 /// ```ignore,no_run
9954 /// # use google_cloud_cloudsecuritycompliance_v1::model::AggregateFrameworkComplianceReportRequest;
9955 /// use google_cloud_type::model::Interval;
9956 /// let x = AggregateFrameworkComplianceReportRequest::new().set_interval(Interval::default()/* use setters */);
9957 /// ```
9958 pub fn set_interval<T>(mut self, v: T) -> Self
9959 where
9960 T: std::convert::Into<google_cloud_type::model::Interval>,
9961 {
9962 self.interval = std::option::Option::Some(v.into());
9963 self
9964 }
9965
9966 /// Sets or clears the value of [interval][crate::model::AggregateFrameworkComplianceReportRequest::interval].
9967 ///
9968 /// # Example
9969 /// ```ignore,no_run
9970 /// # use google_cloud_cloudsecuritycompliance_v1::model::AggregateFrameworkComplianceReportRequest;
9971 /// use google_cloud_type::model::Interval;
9972 /// let x = AggregateFrameworkComplianceReportRequest::new().set_or_clear_interval(Some(Interval::default()/* use setters */));
9973 /// let x = AggregateFrameworkComplianceReportRequest::new().set_or_clear_interval(None::<Interval>);
9974 /// ```
9975 pub fn set_or_clear_interval<T>(mut self, v: std::option::Option<T>) -> Self
9976 where
9977 T: std::convert::Into<google_cloud_type::model::Interval>,
9978 {
9979 self.interval = v.map(|x| x.into());
9980 self
9981 }
9982
9983 /// Sets the value of [filter][crate::model::AggregateFrameworkComplianceReportRequest::filter].
9984 ///
9985 /// # Example
9986 /// ```ignore,no_run
9987 /// # use google_cloud_cloudsecuritycompliance_v1::model::AggregateFrameworkComplianceReportRequest;
9988 /// let x = AggregateFrameworkComplianceReportRequest::new().set_filter("example");
9989 /// ```
9990 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9991 self.filter = v.into();
9992 self
9993 }
9994}
9995
9996impl wkt::message::Message for AggregateFrameworkComplianceReportRequest {
9997 fn typename() -> &'static str {
9998 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.AggregateFrameworkComplianceReportRequest"
9999 }
10000}
10001
10002/// The response message for [AggregateFrameworkComplianceReport][].
10003#[derive(Clone, Default, PartialEq)]
10004#[non_exhaustive]
10005pub struct AggregateFrameworkComplianceReportResponse {
10006 /// The list of aggregated compliance reports.
10007 pub aggregated_compliance_reports: std::vec::Vec<crate::model::AggregatedComplianceReport>,
10008
10009 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10010}
10011
10012impl AggregateFrameworkComplianceReportResponse {
10013 /// Creates a new default instance.
10014 pub fn new() -> Self {
10015 std::default::Default::default()
10016 }
10017
10018 /// Sets the value of [aggregated_compliance_reports][crate::model::AggregateFrameworkComplianceReportResponse::aggregated_compliance_reports].
10019 ///
10020 /// # Example
10021 /// ```ignore,no_run
10022 /// # use google_cloud_cloudsecuritycompliance_v1::model::AggregateFrameworkComplianceReportResponse;
10023 /// use google_cloud_cloudsecuritycompliance_v1::model::AggregatedComplianceReport;
10024 /// let x = AggregateFrameworkComplianceReportResponse::new()
10025 /// .set_aggregated_compliance_reports([
10026 /// AggregatedComplianceReport::default()/* use setters */,
10027 /// AggregatedComplianceReport::default()/* use (different) setters */,
10028 /// ]);
10029 /// ```
10030 pub fn set_aggregated_compliance_reports<T, V>(mut self, v: T) -> Self
10031 where
10032 T: std::iter::IntoIterator<Item = V>,
10033 V: std::convert::Into<crate::model::AggregatedComplianceReport>,
10034 {
10035 use std::iter::Iterator;
10036 self.aggregated_compliance_reports = v.into_iter().map(|i| i.into()).collect();
10037 self
10038 }
10039}
10040
10041impl wkt::message::Message for AggregateFrameworkComplianceReportResponse {
10042 fn typename() -> &'static str {
10043 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.AggregateFrameworkComplianceReportResponse"
10044 }
10045}
10046
10047/// The details for a control assessment.
10048#[derive(Clone, Default, PartialEq)]
10049#[non_exhaustive]
10050pub struct ControlAssessmentDetails {
10051 /// The number of controls that are passing or not assessed.
10052 pub passing_controls: i32,
10053
10054 /// The number of controls that are failing.
10055 pub failing_controls: i32,
10056
10057 /// The number of controls that were assessed and are passing.
10058 pub assessed_passing_controls: i32,
10059
10060 /// The number of controls that aren't assessed because they require manual
10061 /// review.
10062 pub not_assessed_controls: i32,
10063
10064 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10065}
10066
10067impl ControlAssessmentDetails {
10068 /// Creates a new default instance.
10069 pub fn new() -> Self {
10070 std::default::Default::default()
10071 }
10072
10073 /// Sets the value of [passing_controls][crate::model::ControlAssessmentDetails::passing_controls].
10074 ///
10075 /// # Example
10076 /// ```ignore,no_run
10077 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlAssessmentDetails;
10078 /// let x = ControlAssessmentDetails::new().set_passing_controls(42);
10079 /// ```
10080 pub fn set_passing_controls<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10081 self.passing_controls = v.into();
10082 self
10083 }
10084
10085 /// Sets the value of [failing_controls][crate::model::ControlAssessmentDetails::failing_controls].
10086 ///
10087 /// # Example
10088 /// ```ignore,no_run
10089 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlAssessmentDetails;
10090 /// let x = ControlAssessmentDetails::new().set_failing_controls(42);
10091 /// ```
10092 pub fn set_failing_controls<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10093 self.failing_controls = v.into();
10094 self
10095 }
10096
10097 /// Sets the value of [assessed_passing_controls][crate::model::ControlAssessmentDetails::assessed_passing_controls].
10098 ///
10099 /// # Example
10100 /// ```ignore,no_run
10101 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlAssessmentDetails;
10102 /// let x = ControlAssessmentDetails::new().set_assessed_passing_controls(42);
10103 /// ```
10104 pub fn set_assessed_passing_controls<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10105 self.assessed_passing_controls = v.into();
10106 self
10107 }
10108
10109 /// Sets the value of [not_assessed_controls][crate::model::ControlAssessmentDetails::not_assessed_controls].
10110 ///
10111 /// # Example
10112 /// ```ignore,no_run
10113 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlAssessmentDetails;
10114 /// let x = ControlAssessmentDetails::new().set_not_assessed_controls(42);
10115 /// ```
10116 pub fn set_not_assessed_controls<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10117 self.not_assessed_controls = v.into();
10118 self
10119 }
10120}
10121
10122impl wkt::message::Message for ControlAssessmentDetails {
10123 fn typename() -> &'static str {
10124 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ControlAssessmentDetails"
10125 }
10126}
10127
10128/// The details for a framework compliance summary.
10129#[derive(Clone, Default, PartialEq)]
10130#[non_exhaustive]
10131pub struct FrameworkComplianceSummary {
10132 /// The name of the framework.
10133 pub framework: std::string::String,
10134
10135 /// The control assessment details of the framework.
10136 pub control_assessment_details: std::option::Option<crate::model::ControlAssessmentDetails>,
10137
10138 /// The type of framework.
10139 pub framework_type: crate::model::framework::FrameworkType,
10140
10141 /// The list of cloud providers supported by the framework.
10142 pub supported_cloud_providers: std::vec::Vec<crate::model::CloudProvider>,
10143
10144 /// The list of framework categories supported by the framework.
10145 pub framework_categories: std::vec::Vec<crate::model::FrameworkCategory>,
10146
10147 /// Optional. The display name for the framework.
10148 pub framework_display_name: std::string::String,
10149
10150 /// Identifier. The name of the framework compliance summary.
10151 pub name: std::string::String,
10152
10153 /// The major revision ID of the framework.
10154 pub major_revision_id: i64,
10155
10156 /// The minor revision ID of the framework.
10157 pub minor_revision_id: i64,
10158
10159 /// The target resource details for the framework.
10160 pub target_resource_details: std::vec::Vec<crate::model::TargetResourceDetails>,
10161
10162 /// Output only. The count of the findings generated against the framework.
10163 pub finding_count: i64,
10164
10165 /// Output only. The trend of controls that are passing for the given duration.
10166 pub controls_passing_trend: std::option::Option<crate::model::Trend>,
10167
10168 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10169}
10170
10171impl FrameworkComplianceSummary {
10172 /// Creates a new default instance.
10173 pub fn new() -> Self {
10174 std::default::Default::default()
10175 }
10176
10177 /// Sets the value of [framework][crate::model::FrameworkComplianceSummary::framework].
10178 ///
10179 /// # Example
10180 /// ```ignore,no_run
10181 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
10182 /// let x = FrameworkComplianceSummary::new().set_framework("example");
10183 /// ```
10184 pub fn set_framework<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10185 self.framework = v.into();
10186 self
10187 }
10188
10189 /// Sets the value of [control_assessment_details][crate::model::FrameworkComplianceSummary::control_assessment_details].
10190 ///
10191 /// # Example
10192 /// ```ignore,no_run
10193 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
10194 /// use google_cloud_cloudsecuritycompliance_v1::model::ControlAssessmentDetails;
10195 /// let x = FrameworkComplianceSummary::new().set_control_assessment_details(ControlAssessmentDetails::default()/* use setters */);
10196 /// ```
10197 pub fn set_control_assessment_details<T>(mut self, v: T) -> Self
10198 where
10199 T: std::convert::Into<crate::model::ControlAssessmentDetails>,
10200 {
10201 self.control_assessment_details = std::option::Option::Some(v.into());
10202 self
10203 }
10204
10205 /// Sets or clears the value of [control_assessment_details][crate::model::FrameworkComplianceSummary::control_assessment_details].
10206 ///
10207 /// # Example
10208 /// ```ignore,no_run
10209 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
10210 /// use google_cloud_cloudsecuritycompliance_v1::model::ControlAssessmentDetails;
10211 /// let x = FrameworkComplianceSummary::new().set_or_clear_control_assessment_details(Some(ControlAssessmentDetails::default()/* use setters */));
10212 /// let x = FrameworkComplianceSummary::new().set_or_clear_control_assessment_details(None::<ControlAssessmentDetails>);
10213 /// ```
10214 pub fn set_or_clear_control_assessment_details<T>(mut self, v: std::option::Option<T>) -> Self
10215 where
10216 T: std::convert::Into<crate::model::ControlAssessmentDetails>,
10217 {
10218 self.control_assessment_details = v.map(|x| x.into());
10219 self
10220 }
10221
10222 /// Sets the value of [framework_type][crate::model::FrameworkComplianceSummary::framework_type].
10223 ///
10224 /// # Example
10225 /// ```ignore,no_run
10226 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
10227 /// use google_cloud_cloudsecuritycompliance_v1::model::framework::FrameworkType;
10228 /// let x0 = FrameworkComplianceSummary::new().set_framework_type(FrameworkType::BuiltIn);
10229 /// let x1 = FrameworkComplianceSummary::new().set_framework_type(FrameworkType::Custom);
10230 /// ```
10231 pub fn set_framework_type<T: std::convert::Into<crate::model::framework::FrameworkType>>(
10232 mut self,
10233 v: T,
10234 ) -> Self {
10235 self.framework_type = v.into();
10236 self
10237 }
10238
10239 /// Sets the value of [supported_cloud_providers][crate::model::FrameworkComplianceSummary::supported_cloud_providers].
10240 ///
10241 /// # Example
10242 /// ```ignore,no_run
10243 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
10244 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudProvider;
10245 /// let x = FrameworkComplianceSummary::new().set_supported_cloud_providers([
10246 /// CloudProvider::Aws,
10247 /// CloudProvider::Azure,
10248 /// CloudProvider::Gcp,
10249 /// ]);
10250 /// ```
10251 pub fn set_supported_cloud_providers<T, V>(mut self, v: T) -> Self
10252 where
10253 T: std::iter::IntoIterator<Item = V>,
10254 V: std::convert::Into<crate::model::CloudProvider>,
10255 {
10256 use std::iter::Iterator;
10257 self.supported_cloud_providers = v.into_iter().map(|i| i.into()).collect();
10258 self
10259 }
10260
10261 /// Sets the value of [framework_categories][crate::model::FrameworkComplianceSummary::framework_categories].
10262 ///
10263 /// # Example
10264 /// ```ignore,no_run
10265 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
10266 /// use google_cloud_cloudsecuritycompliance_v1::model::FrameworkCategory;
10267 /// let x = FrameworkComplianceSummary::new().set_framework_categories([
10268 /// FrameworkCategory::IndustryDefinedStandard,
10269 /// FrameworkCategory::AssuredWorkloads,
10270 /// FrameworkCategory::DataSecurity,
10271 /// ]);
10272 /// ```
10273 pub fn set_framework_categories<T, V>(mut self, v: T) -> Self
10274 where
10275 T: std::iter::IntoIterator<Item = V>,
10276 V: std::convert::Into<crate::model::FrameworkCategory>,
10277 {
10278 use std::iter::Iterator;
10279 self.framework_categories = v.into_iter().map(|i| i.into()).collect();
10280 self
10281 }
10282
10283 /// Sets the value of [framework_display_name][crate::model::FrameworkComplianceSummary::framework_display_name].
10284 ///
10285 /// # Example
10286 /// ```ignore,no_run
10287 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
10288 /// let x = FrameworkComplianceSummary::new().set_framework_display_name("example");
10289 /// ```
10290 pub fn set_framework_display_name<T: std::convert::Into<std::string::String>>(
10291 mut self,
10292 v: T,
10293 ) -> Self {
10294 self.framework_display_name = v.into();
10295 self
10296 }
10297
10298 /// Sets the value of [name][crate::model::FrameworkComplianceSummary::name].
10299 ///
10300 /// # Example
10301 /// ```ignore,no_run
10302 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
10303 /// # let project_id = "project_id";
10304 /// # let location_id = "location_id";
10305 /// # let framework_compliance_summary_id = "framework_compliance_summary_id";
10306 /// let x = FrameworkComplianceSummary::new().set_name(format!("projects/{project_id}/locations/{location_id}/frameworkComplianceSummaries/{framework_compliance_summary_id}"));
10307 /// ```
10308 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10309 self.name = v.into();
10310 self
10311 }
10312
10313 /// Sets the value of [major_revision_id][crate::model::FrameworkComplianceSummary::major_revision_id].
10314 ///
10315 /// # Example
10316 /// ```ignore,no_run
10317 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
10318 /// let x = FrameworkComplianceSummary::new().set_major_revision_id(42);
10319 /// ```
10320 pub fn set_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10321 self.major_revision_id = v.into();
10322 self
10323 }
10324
10325 /// Sets the value of [minor_revision_id][crate::model::FrameworkComplianceSummary::minor_revision_id].
10326 ///
10327 /// # Example
10328 /// ```ignore,no_run
10329 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
10330 /// let x = FrameworkComplianceSummary::new().set_minor_revision_id(42);
10331 /// ```
10332 pub fn set_minor_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10333 self.minor_revision_id = v.into();
10334 self
10335 }
10336
10337 /// Sets the value of [target_resource_details][crate::model::FrameworkComplianceSummary::target_resource_details].
10338 ///
10339 /// # Example
10340 /// ```ignore,no_run
10341 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
10342 /// use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceDetails;
10343 /// let x = FrameworkComplianceSummary::new()
10344 /// .set_target_resource_details([
10345 /// TargetResourceDetails::default()/* use setters */,
10346 /// TargetResourceDetails::default()/* use (different) setters */,
10347 /// ]);
10348 /// ```
10349 pub fn set_target_resource_details<T, V>(mut self, v: T) -> Self
10350 where
10351 T: std::iter::IntoIterator<Item = V>,
10352 V: std::convert::Into<crate::model::TargetResourceDetails>,
10353 {
10354 use std::iter::Iterator;
10355 self.target_resource_details = v.into_iter().map(|i| i.into()).collect();
10356 self
10357 }
10358
10359 /// Sets the value of [finding_count][crate::model::FrameworkComplianceSummary::finding_count].
10360 ///
10361 /// # Example
10362 /// ```ignore,no_run
10363 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
10364 /// let x = FrameworkComplianceSummary::new().set_finding_count(42);
10365 /// ```
10366 pub fn set_finding_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10367 self.finding_count = v.into();
10368 self
10369 }
10370
10371 /// Sets the value of [controls_passing_trend][crate::model::FrameworkComplianceSummary::controls_passing_trend].
10372 ///
10373 /// # Example
10374 /// ```ignore,no_run
10375 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
10376 /// use google_cloud_cloudsecuritycompliance_v1::model::Trend;
10377 /// let x = FrameworkComplianceSummary::new().set_controls_passing_trend(Trend::default()/* use setters */);
10378 /// ```
10379 pub fn set_controls_passing_trend<T>(mut self, v: T) -> Self
10380 where
10381 T: std::convert::Into<crate::model::Trend>,
10382 {
10383 self.controls_passing_trend = std::option::Option::Some(v.into());
10384 self
10385 }
10386
10387 /// Sets or clears the value of [controls_passing_trend][crate::model::FrameworkComplianceSummary::controls_passing_trend].
10388 ///
10389 /// # Example
10390 /// ```ignore,no_run
10391 /// # use google_cloud_cloudsecuritycompliance_v1::model::FrameworkComplianceSummary;
10392 /// use google_cloud_cloudsecuritycompliance_v1::model::Trend;
10393 /// let x = FrameworkComplianceSummary::new().set_or_clear_controls_passing_trend(Some(Trend::default()/* use setters */));
10394 /// let x = FrameworkComplianceSummary::new().set_or_clear_controls_passing_trend(None::<Trend>);
10395 /// ```
10396 pub fn set_or_clear_controls_passing_trend<T>(mut self, v: std::option::Option<T>) -> Self
10397 where
10398 T: std::convert::Into<crate::model::Trend>,
10399 {
10400 self.controls_passing_trend = v.map(|x| x.into());
10401 self
10402 }
10403}
10404
10405impl wkt::message::Message for FrameworkComplianceSummary {
10406 fn typename() -> &'static str {
10407 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FrameworkComplianceSummary"
10408 }
10409}
10410
10411/// The details for a finding.
10412#[derive(Clone, Default, PartialEq)]
10413#[non_exhaustive]
10414pub struct FindingSummary {
10415 /// The category of the finding.
10416 pub finding_category: std::string::String,
10417
10418 /// The class of the finding.
10419 pub finding_class: crate::model::FindingClass,
10420
10421 /// The severity of the finding.
10422 pub severity: crate::model::Severity,
10423
10424 /// The count of the finding.
10425 pub finding_count: i64,
10426
10427 /// Output only. The last updated time of the finding.
10428 pub update_time: std::option::Option<wkt::Timestamp>,
10429
10430 /// Optional. The list of compliance frameworks that the finding belongs to.
10431 pub related_frameworks: std::vec::Vec<std::string::String>,
10432
10433 /// Identifier. The name of the finding summary.
10434 pub name: std::string::String,
10435
10436 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10437}
10438
10439impl FindingSummary {
10440 /// Creates a new default instance.
10441 pub fn new() -> Self {
10442 std::default::Default::default()
10443 }
10444
10445 /// Sets the value of [finding_category][crate::model::FindingSummary::finding_category].
10446 ///
10447 /// # Example
10448 /// ```ignore,no_run
10449 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingSummary;
10450 /// let x = FindingSummary::new().set_finding_category("example");
10451 /// ```
10452 pub fn set_finding_category<T: std::convert::Into<std::string::String>>(
10453 mut self,
10454 v: T,
10455 ) -> Self {
10456 self.finding_category = v.into();
10457 self
10458 }
10459
10460 /// Sets the value of [finding_class][crate::model::FindingSummary::finding_class].
10461 ///
10462 /// # Example
10463 /// ```ignore,no_run
10464 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingSummary;
10465 /// use google_cloud_cloudsecuritycompliance_v1::model::FindingClass;
10466 /// let x0 = FindingSummary::new().set_finding_class(FindingClass::Threat);
10467 /// let x1 = FindingSummary::new().set_finding_class(FindingClass::Vulnerability);
10468 /// let x2 = FindingSummary::new().set_finding_class(FindingClass::Misconfiguration);
10469 /// ```
10470 pub fn set_finding_class<T: std::convert::Into<crate::model::FindingClass>>(
10471 mut self,
10472 v: T,
10473 ) -> Self {
10474 self.finding_class = v.into();
10475 self
10476 }
10477
10478 /// Sets the value of [severity][crate::model::FindingSummary::severity].
10479 ///
10480 /// # Example
10481 /// ```ignore,no_run
10482 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingSummary;
10483 /// use google_cloud_cloudsecuritycompliance_v1::model::Severity;
10484 /// let x0 = FindingSummary::new().set_severity(Severity::Critical);
10485 /// let x1 = FindingSummary::new().set_severity(Severity::High);
10486 /// let x2 = FindingSummary::new().set_severity(Severity::Medium);
10487 /// ```
10488 pub fn set_severity<T: std::convert::Into<crate::model::Severity>>(mut self, v: T) -> Self {
10489 self.severity = v.into();
10490 self
10491 }
10492
10493 /// Sets the value of [finding_count][crate::model::FindingSummary::finding_count].
10494 ///
10495 /// # Example
10496 /// ```ignore,no_run
10497 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingSummary;
10498 /// let x = FindingSummary::new().set_finding_count(42);
10499 /// ```
10500 pub fn set_finding_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10501 self.finding_count = v.into();
10502 self
10503 }
10504
10505 /// Sets the value of [update_time][crate::model::FindingSummary::update_time].
10506 ///
10507 /// # Example
10508 /// ```ignore,no_run
10509 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingSummary;
10510 /// use wkt::Timestamp;
10511 /// let x = FindingSummary::new().set_update_time(Timestamp::default()/* use setters */);
10512 /// ```
10513 pub fn set_update_time<T>(mut self, v: T) -> Self
10514 where
10515 T: std::convert::Into<wkt::Timestamp>,
10516 {
10517 self.update_time = std::option::Option::Some(v.into());
10518 self
10519 }
10520
10521 /// Sets or clears the value of [update_time][crate::model::FindingSummary::update_time].
10522 ///
10523 /// # Example
10524 /// ```ignore,no_run
10525 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingSummary;
10526 /// use wkt::Timestamp;
10527 /// let x = FindingSummary::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
10528 /// let x = FindingSummary::new().set_or_clear_update_time(None::<Timestamp>);
10529 /// ```
10530 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10531 where
10532 T: std::convert::Into<wkt::Timestamp>,
10533 {
10534 self.update_time = v.map(|x| x.into());
10535 self
10536 }
10537
10538 /// Sets the value of [related_frameworks][crate::model::FindingSummary::related_frameworks].
10539 ///
10540 /// # Example
10541 /// ```ignore,no_run
10542 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingSummary;
10543 /// let x = FindingSummary::new().set_related_frameworks(["a", "b", "c"]);
10544 /// ```
10545 pub fn set_related_frameworks<T, V>(mut self, v: T) -> Self
10546 where
10547 T: std::iter::IntoIterator<Item = V>,
10548 V: std::convert::Into<std::string::String>,
10549 {
10550 use std::iter::Iterator;
10551 self.related_frameworks = v.into_iter().map(|i| i.into()).collect();
10552 self
10553 }
10554
10555 /// Sets the value of [name][crate::model::FindingSummary::name].
10556 ///
10557 /// # Example
10558 /// ```ignore,no_run
10559 /// # use google_cloud_cloudsecuritycompliance_v1::model::FindingSummary;
10560 /// # let project_id = "project_id";
10561 /// # let location_id = "location_id";
10562 /// # let finding_summary_id = "finding_summary_id";
10563 /// let x = FindingSummary::new().set_name(format!("projects/{project_id}/locations/{location_id}/findingSummaries/{finding_summary_id}"));
10564 /// ```
10565 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10566 self.name = v.into();
10567 self
10568 }
10569}
10570
10571impl wkt::message::Message for FindingSummary {
10572 fn typename() -> &'static str {
10573 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.FindingSummary"
10574 }
10575}
10576
10577/// The details for control compliance.
10578#[derive(Clone, Default, PartialEq)]
10579#[non_exhaustive]
10580pub struct ControlComplianceSummary {
10581 /// The name of the control.
10582 pub control: std::string::String,
10583
10584 /// The display name of the control.
10585 pub display_name: std::string::String,
10586
10587 /// The description of the control.
10588 pub description: std::string::String,
10589
10590 /// Output only. The overall evaluation status of the control.
10591 pub overall_evaluation_state: crate::model::EvaluationState,
10592
10593 /// The total number of findings for the control.
10594 pub total_findings_count: i32,
10595
10596 /// The list of compliance frameworks that the control belongs to.
10597 pub compliance_frameworks: std::vec::Vec<std::string::String>,
10598
10599 /// The list of similar controls.
10600 pub similar_controls: std::vec::Vec<crate::model::SimilarControls>,
10601
10602 /// The list of cloud control reports.
10603 pub cloud_control_reports: std::vec::Vec<crate::model::CloudControlReport>,
10604
10605 /// The responsibility type for the control.
10606 pub control_responsibility_type: crate::model::RegulatoryControlResponsibilityType,
10607
10608 /// Whether the control is a fake control. Fake controls are created
10609 /// and mapped to cloud controls that don't belong to a control group.
10610 pub is_fake_control: bool,
10611
10612 /// Identifier. The name of the control compliance summary.
10613 pub name: std::string::String,
10614
10615 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10616}
10617
10618impl ControlComplianceSummary {
10619 /// Creates a new default instance.
10620 pub fn new() -> Self {
10621 std::default::Default::default()
10622 }
10623
10624 /// Sets the value of [control][crate::model::ControlComplianceSummary::control].
10625 ///
10626 /// # Example
10627 /// ```ignore,no_run
10628 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
10629 /// let x = ControlComplianceSummary::new().set_control("example");
10630 /// ```
10631 pub fn set_control<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10632 self.control = v.into();
10633 self
10634 }
10635
10636 /// Sets the value of [display_name][crate::model::ControlComplianceSummary::display_name].
10637 ///
10638 /// # Example
10639 /// ```ignore,no_run
10640 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
10641 /// let x = ControlComplianceSummary::new().set_display_name("example");
10642 /// ```
10643 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10644 self.display_name = v.into();
10645 self
10646 }
10647
10648 /// Sets the value of [description][crate::model::ControlComplianceSummary::description].
10649 ///
10650 /// # Example
10651 /// ```ignore,no_run
10652 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
10653 /// let x = ControlComplianceSummary::new().set_description("example");
10654 /// ```
10655 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10656 self.description = v.into();
10657 self
10658 }
10659
10660 /// Sets the value of [overall_evaluation_state][crate::model::ControlComplianceSummary::overall_evaluation_state].
10661 ///
10662 /// # Example
10663 /// ```ignore,no_run
10664 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
10665 /// use google_cloud_cloudsecuritycompliance_v1::model::EvaluationState;
10666 /// let x0 = ControlComplianceSummary::new().set_overall_evaluation_state(EvaluationState::Passed);
10667 /// let x1 = ControlComplianceSummary::new().set_overall_evaluation_state(EvaluationState::Failed);
10668 /// let x2 = ControlComplianceSummary::new().set_overall_evaluation_state(EvaluationState::NotAssessed);
10669 /// ```
10670 pub fn set_overall_evaluation_state<T: std::convert::Into<crate::model::EvaluationState>>(
10671 mut self,
10672 v: T,
10673 ) -> Self {
10674 self.overall_evaluation_state = v.into();
10675 self
10676 }
10677
10678 /// Sets the value of [total_findings_count][crate::model::ControlComplianceSummary::total_findings_count].
10679 ///
10680 /// # Example
10681 /// ```ignore,no_run
10682 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
10683 /// let x = ControlComplianceSummary::new().set_total_findings_count(42);
10684 /// ```
10685 pub fn set_total_findings_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10686 self.total_findings_count = v.into();
10687 self
10688 }
10689
10690 /// Sets the value of [compliance_frameworks][crate::model::ControlComplianceSummary::compliance_frameworks].
10691 ///
10692 /// # Example
10693 /// ```ignore,no_run
10694 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
10695 /// let x = ControlComplianceSummary::new().set_compliance_frameworks(["a", "b", "c"]);
10696 /// ```
10697 pub fn set_compliance_frameworks<T, V>(mut self, v: T) -> Self
10698 where
10699 T: std::iter::IntoIterator<Item = V>,
10700 V: std::convert::Into<std::string::String>,
10701 {
10702 use std::iter::Iterator;
10703 self.compliance_frameworks = v.into_iter().map(|i| i.into()).collect();
10704 self
10705 }
10706
10707 /// Sets the value of [similar_controls][crate::model::ControlComplianceSummary::similar_controls].
10708 ///
10709 /// # Example
10710 /// ```ignore,no_run
10711 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
10712 /// use google_cloud_cloudsecuritycompliance_v1::model::SimilarControls;
10713 /// let x = ControlComplianceSummary::new()
10714 /// .set_similar_controls([
10715 /// SimilarControls::default()/* use setters */,
10716 /// SimilarControls::default()/* use (different) setters */,
10717 /// ]);
10718 /// ```
10719 pub fn set_similar_controls<T, V>(mut self, v: T) -> Self
10720 where
10721 T: std::iter::IntoIterator<Item = V>,
10722 V: std::convert::Into<crate::model::SimilarControls>,
10723 {
10724 use std::iter::Iterator;
10725 self.similar_controls = v.into_iter().map(|i| i.into()).collect();
10726 self
10727 }
10728
10729 /// Sets the value of [cloud_control_reports][crate::model::ControlComplianceSummary::cloud_control_reports].
10730 ///
10731 /// # Example
10732 /// ```ignore,no_run
10733 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
10734 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10735 /// let x = ControlComplianceSummary::new()
10736 /// .set_cloud_control_reports([
10737 /// CloudControlReport::default()/* use setters */,
10738 /// CloudControlReport::default()/* use (different) setters */,
10739 /// ]);
10740 /// ```
10741 pub fn set_cloud_control_reports<T, V>(mut self, v: T) -> Self
10742 where
10743 T: std::iter::IntoIterator<Item = V>,
10744 V: std::convert::Into<crate::model::CloudControlReport>,
10745 {
10746 use std::iter::Iterator;
10747 self.cloud_control_reports = v.into_iter().map(|i| i.into()).collect();
10748 self
10749 }
10750
10751 /// Sets the value of [control_responsibility_type][crate::model::ControlComplianceSummary::control_responsibility_type].
10752 ///
10753 /// # Example
10754 /// ```ignore,no_run
10755 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
10756 /// use google_cloud_cloudsecuritycompliance_v1::model::RegulatoryControlResponsibilityType;
10757 /// let x0 = ControlComplianceSummary::new().set_control_responsibility_type(RegulatoryControlResponsibilityType::Google);
10758 /// let x1 = ControlComplianceSummary::new().set_control_responsibility_type(RegulatoryControlResponsibilityType::Customer);
10759 /// let x2 = ControlComplianceSummary::new().set_control_responsibility_type(RegulatoryControlResponsibilityType::Shared);
10760 /// ```
10761 pub fn set_control_responsibility_type<
10762 T: std::convert::Into<crate::model::RegulatoryControlResponsibilityType>,
10763 >(
10764 mut self,
10765 v: T,
10766 ) -> Self {
10767 self.control_responsibility_type = v.into();
10768 self
10769 }
10770
10771 /// Sets the value of [is_fake_control][crate::model::ControlComplianceSummary::is_fake_control].
10772 ///
10773 /// # Example
10774 /// ```ignore,no_run
10775 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
10776 /// let x = ControlComplianceSummary::new().set_is_fake_control(true);
10777 /// ```
10778 pub fn set_is_fake_control<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10779 self.is_fake_control = v.into();
10780 self
10781 }
10782
10783 /// Sets the value of [name][crate::model::ControlComplianceSummary::name].
10784 ///
10785 /// # Example
10786 /// ```ignore,no_run
10787 /// # use google_cloud_cloudsecuritycompliance_v1::model::ControlComplianceSummary;
10788 /// # let project_id = "project_id";
10789 /// # let location_id = "location_id";
10790 /// # let framework_compliance_report_id = "framework_compliance_report_id";
10791 /// # let control_compliance_summary_id = "control_compliance_summary_id";
10792 /// let x = ControlComplianceSummary::new().set_name(format!("projects/{project_id}/locations/{location_id}/frameworkComplianceReports/{framework_compliance_report_id}/controlComplianceSummaries/{control_compliance_summary_id}"));
10793 /// ```
10794 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10795 self.name = v.into();
10796 self
10797 }
10798}
10799
10800impl wkt::message::Message for ControlComplianceSummary {
10801 fn typename() -> &'static str {
10802 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ControlComplianceSummary"
10803 }
10804}
10805
10806/// The cloud control report.
10807#[derive(Clone, Default, PartialEq)]
10808#[non_exhaustive]
10809pub struct CloudControlReport {
10810 /// The name of the cloud control.
10811 pub cloud_control: std::string::String,
10812
10813 /// The display name of the cloud control.
10814 pub display_name: std::string::String,
10815
10816 /// The description of the cloud control.
10817 pub description: std::string::String,
10818
10819 /// The list of categories for the cloud control.
10820 pub categories: std::vec::Vec<std::string::String>,
10821
10822 /// The list of similar controls.
10823 pub similar_controls: std::vec::Vec<crate::model::SimilarControls>,
10824
10825 /// The type of the cloud control.
10826 pub cloud_control_type: crate::model::cloud_control::Type,
10827
10828 /// The category of the finding.
10829 pub finding_category: std::string::String,
10830
10831 /// The list of rules that correspond to the cloud control.
10832 pub rules: std::vec::Vec<crate::model::Rule>,
10833
10834 /// The severity of the finding.
10835 pub finding_severity: crate::model::Severity,
10836
10837 /// The enforcement mode of the cloud control.
10838 pub enforcement_mode: crate::model::EnforcementMode,
10839
10840 /// The name of the cloud control deployment.
10841 pub cloud_control_deployment: std::string::String,
10842
10843 /// The major revision ID of the cloud control.
10844 pub major_revision_id: i64,
10845
10846 /// The minor revision ID of the cloud control.
10847 pub minor_revision_id: i64,
10848
10849 /// The major revision IDs of the frameworks that the cloud control belongs to.
10850 pub framework_major_revision_ids: std::vec::Vec<i64>,
10851
10852 /// The assessment details of the cloud control.
10853 pub assessment_details:
10854 std::option::Option<crate::model::cloud_control_report::AssessmentDetails>,
10855
10856 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10857}
10858
10859impl CloudControlReport {
10860 /// Creates a new default instance.
10861 pub fn new() -> Self {
10862 std::default::Default::default()
10863 }
10864
10865 /// Sets the value of [cloud_control][crate::model::CloudControlReport::cloud_control].
10866 ///
10867 /// # Example
10868 /// ```ignore,no_run
10869 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10870 /// let x = CloudControlReport::new().set_cloud_control("example");
10871 /// ```
10872 pub fn set_cloud_control<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10873 self.cloud_control = v.into();
10874 self
10875 }
10876
10877 /// Sets the value of [display_name][crate::model::CloudControlReport::display_name].
10878 ///
10879 /// # Example
10880 /// ```ignore,no_run
10881 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10882 /// let x = CloudControlReport::new().set_display_name("example");
10883 /// ```
10884 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10885 self.display_name = v.into();
10886 self
10887 }
10888
10889 /// Sets the value of [description][crate::model::CloudControlReport::description].
10890 ///
10891 /// # Example
10892 /// ```ignore,no_run
10893 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10894 /// let x = CloudControlReport::new().set_description("example");
10895 /// ```
10896 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10897 self.description = v.into();
10898 self
10899 }
10900
10901 /// Sets the value of [categories][crate::model::CloudControlReport::categories].
10902 ///
10903 /// # Example
10904 /// ```ignore,no_run
10905 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10906 /// let x = CloudControlReport::new().set_categories(["a", "b", "c"]);
10907 /// ```
10908 pub fn set_categories<T, V>(mut self, v: T) -> Self
10909 where
10910 T: std::iter::IntoIterator<Item = V>,
10911 V: std::convert::Into<std::string::String>,
10912 {
10913 use std::iter::Iterator;
10914 self.categories = v.into_iter().map(|i| i.into()).collect();
10915 self
10916 }
10917
10918 /// Sets the value of [similar_controls][crate::model::CloudControlReport::similar_controls].
10919 ///
10920 /// # Example
10921 /// ```ignore,no_run
10922 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10923 /// use google_cloud_cloudsecuritycompliance_v1::model::SimilarControls;
10924 /// let x = CloudControlReport::new()
10925 /// .set_similar_controls([
10926 /// SimilarControls::default()/* use setters */,
10927 /// SimilarControls::default()/* use (different) setters */,
10928 /// ]);
10929 /// ```
10930 pub fn set_similar_controls<T, V>(mut self, v: T) -> Self
10931 where
10932 T: std::iter::IntoIterator<Item = V>,
10933 V: std::convert::Into<crate::model::SimilarControls>,
10934 {
10935 use std::iter::Iterator;
10936 self.similar_controls = v.into_iter().map(|i| i.into()).collect();
10937 self
10938 }
10939
10940 /// Sets the value of [cloud_control_type][crate::model::CloudControlReport::cloud_control_type].
10941 ///
10942 /// # Example
10943 /// ```ignore,no_run
10944 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10945 /// use google_cloud_cloudsecuritycompliance_v1::model::cloud_control::Type;
10946 /// let x0 = CloudControlReport::new().set_cloud_control_type(Type::Custom);
10947 /// let x1 = CloudControlReport::new().set_cloud_control_type(Type::BuiltIn);
10948 /// ```
10949 pub fn set_cloud_control_type<T: std::convert::Into<crate::model::cloud_control::Type>>(
10950 mut self,
10951 v: T,
10952 ) -> Self {
10953 self.cloud_control_type = v.into();
10954 self
10955 }
10956
10957 /// Sets the value of [finding_category][crate::model::CloudControlReport::finding_category].
10958 ///
10959 /// # Example
10960 /// ```ignore,no_run
10961 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10962 /// let x = CloudControlReport::new().set_finding_category("example");
10963 /// ```
10964 pub fn set_finding_category<T: std::convert::Into<std::string::String>>(
10965 mut self,
10966 v: T,
10967 ) -> Self {
10968 self.finding_category = v.into();
10969 self
10970 }
10971
10972 /// Sets the value of [rules][crate::model::CloudControlReport::rules].
10973 ///
10974 /// # Example
10975 /// ```ignore,no_run
10976 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10977 /// use google_cloud_cloudsecuritycompliance_v1::model::Rule;
10978 /// let x = CloudControlReport::new()
10979 /// .set_rules([
10980 /// Rule::default()/* use setters */,
10981 /// Rule::default()/* use (different) setters */,
10982 /// ]);
10983 /// ```
10984 pub fn set_rules<T, V>(mut self, v: T) -> Self
10985 where
10986 T: std::iter::IntoIterator<Item = V>,
10987 V: std::convert::Into<crate::model::Rule>,
10988 {
10989 use std::iter::Iterator;
10990 self.rules = v.into_iter().map(|i| i.into()).collect();
10991 self
10992 }
10993
10994 /// Sets the value of [finding_severity][crate::model::CloudControlReport::finding_severity].
10995 ///
10996 /// # Example
10997 /// ```ignore,no_run
10998 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
10999 /// use google_cloud_cloudsecuritycompliance_v1::model::Severity;
11000 /// let x0 = CloudControlReport::new().set_finding_severity(Severity::Critical);
11001 /// let x1 = CloudControlReport::new().set_finding_severity(Severity::High);
11002 /// let x2 = CloudControlReport::new().set_finding_severity(Severity::Medium);
11003 /// ```
11004 pub fn set_finding_severity<T: std::convert::Into<crate::model::Severity>>(
11005 mut self,
11006 v: T,
11007 ) -> Self {
11008 self.finding_severity = v.into();
11009 self
11010 }
11011
11012 /// Sets the value of [enforcement_mode][crate::model::CloudControlReport::enforcement_mode].
11013 ///
11014 /// # Example
11015 /// ```ignore,no_run
11016 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
11017 /// use google_cloud_cloudsecuritycompliance_v1::model::EnforcementMode;
11018 /// let x0 = CloudControlReport::new().set_enforcement_mode(EnforcementMode::Preventive);
11019 /// let x1 = CloudControlReport::new().set_enforcement_mode(EnforcementMode::Detective);
11020 /// let x2 = CloudControlReport::new().set_enforcement_mode(EnforcementMode::Audit);
11021 /// ```
11022 pub fn set_enforcement_mode<T: std::convert::Into<crate::model::EnforcementMode>>(
11023 mut self,
11024 v: T,
11025 ) -> Self {
11026 self.enforcement_mode = v.into();
11027 self
11028 }
11029
11030 /// Sets the value of [cloud_control_deployment][crate::model::CloudControlReport::cloud_control_deployment].
11031 ///
11032 /// # Example
11033 /// ```ignore,no_run
11034 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
11035 /// let x = CloudControlReport::new().set_cloud_control_deployment("example");
11036 /// ```
11037 pub fn set_cloud_control_deployment<T: std::convert::Into<std::string::String>>(
11038 mut self,
11039 v: T,
11040 ) -> Self {
11041 self.cloud_control_deployment = v.into();
11042 self
11043 }
11044
11045 /// Sets the value of [major_revision_id][crate::model::CloudControlReport::major_revision_id].
11046 ///
11047 /// # Example
11048 /// ```ignore,no_run
11049 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
11050 /// let x = CloudControlReport::new().set_major_revision_id(42);
11051 /// ```
11052 pub fn set_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11053 self.major_revision_id = v.into();
11054 self
11055 }
11056
11057 /// Sets the value of [minor_revision_id][crate::model::CloudControlReport::minor_revision_id].
11058 ///
11059 /// # Example
11060 /// ```ignore,no_run
11061 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
11062 /// let x = CloudControlReport::new().set_minor_revision_id(42);
11063 /// ```
11064 pub fn set_minor_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11065 self.minor_revision_id = v.into();
11066 self
11067 }
11068
11069 /// Sets the value of [framework_major_revision_ids][crate::model::CloudControlReport::framework_major_revision_ids].
11070 ///
11071 /// # Example
11072 /// ```ignore,no_run
11073 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
11074 /// let x = CloudControlReport::new().set_framework_major_revision_ids([1, 2, 3]);
11075 /// ```
11076 pub fn set_framework_major_revision_ids<T, V>(mut self, v: T) -> Self
11077 where
11078 T: std::iter::IntoIterator<Item = V>,
11079 V: std::convert::Into<i64>,
11080 {
11081 use std::iter::Iterator;
11082 self.framework_major_revision_ids = v.into_iter().map(|i| i.into()).collect();
11083 self
11084 }
11085
11086 /// Sets the value of [assessment_details][crate::model::CloudControlReport::assessment_details].
11087 ///
11088 /// Note that all the setters affecting `assessment_details` are mutually
11089 /// exclusive.
11090 ///
11091 /// # Example
11092 /// ```ignore,no_run
11093 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
11094 /// use google_cloud_cloudsecuritycompliance_v1::model::ManualCloudControlAssessmentDetails;
11095 /// let x = CloudControlReport::new().set_assessment_details(Some(
11096 /// google_cloud_cloudsecuritycompliance_v1::model::cloud_control_report::AssessmentDetails::ManualCloudControlAssessmentDetails(ManualCloudControlAssessmentDetails::default().into())));
11097 /// ```
11098 pub fn set_assessment_details<
11099 T: std::convert::Into<
11100 std::option::Option<crate::model::cloud_control_report::AssessmentDetails>,
11101 >,
11102 >(
11103 mut self,
11104 v: T,
11105 ) -> Self {
11106 self.assessment_details = v.into();
11107 self
11108 }
11109
11110 /// The value of [assessment_details][crate::model::CloudControlReport::assessment_details]
11111 /// if it holds a `ManualCloudControlAssessmentDetails`, `None` if the field is not set or
11112 /// holds a different branch.
11113 pub fn manual_cloud_control_assessment_details(
11114 &self,
11115 ) -> std::option::Option<&std::boxed::Box<crate::model::ManualCloudControlAssessmentDetails>>
11116 {
11117 #[allow(unreachable_patterns)]
11118 self.assessment_details.as_ref().and_then(|v| match v {
11119 crate::model::cloud_control_report::AssessmentDetails::ManualCloudControlAssessmentDetails(v) => std::option::Option::Some(v),
11120 _ => std::option::Option::None,
11121 })
11122 }
11123
11124 /// Sets the value of [assessment_details][crate::model::CloudControlReport::assessment_details]
11125 /// to hold a `ManualCloudControlAssessmentDetails`.
11126 ///
11127 /// Note that all the setters affecting `assessment_details` are
11128 /// mutually exclusive.
11129 ///
11130 /// # Example
11131 /// ```ignore,no_run
11132 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
11133 /// use google_cloud_cloudsecuritycompliance_v1::model::ManualCloudControlAssessmentDetails;
11134 /// let x = CloudControlReport::new().set_manual_cloud_control_assessment_details(ManualCloudControlAssessmentDetails::default()/* use setters */);
11135 /// assert!(x.manual_cloud_control_assessment_details().is_some());
11136 /// assert!(x.cloud_control_assessment_details().is_none());
11137 /// ```
11138 pub fn set_manual_cloud_control_assessment_details<
11139 T: std::convert::Into<std::boxed::Box<crate::model::ManualCloudControlAssessmentDetails>>,
11140 >(
11141 mut self,
11142 v: T,
11143 ) -> Self {
11144 self.assessment_details = std::option::Option::Some(
11145 crate::model::cloud_control_report::AssessmentDetails::ManualCloudControlAssessmentDetails(
11146 v.into()
11147 )
11148 );
11149 self
11150 }
11151
11152 /// The value of [assessment_details][crate::model::CloudControlReport::assessment_details]
11153 /// if it holds a `CloudControlAssessmentDetails`, `None` if the field is not set or
11154 /// holds a different branch.
11155 pub fn cloud_control_assessment_details(
11156 &self,
11157 ) -> std::option::Option<&std::boxed::Box<crate::model::CloudControlAssessmentDetails>> {
11158 #[allow(unreachable_patterns)]
11159 self.assessment_details.as_ref().and_then(|v| match v {
11160 crate::model::cloud_control_report::AssessmentDetails::CloudControlAssessmentDetails(v) => std::option::Option::Some(v),
11161 _ => std::option::Option::None,
11162 })
11163 }
11164
11165 /// Sets the value of [assessment_details][crate::model::CloudControlReport::assessment_details]
11166 /// to hold a `CloudControlAssessmentDetails`.
11167 ///
11168 /// Note that all the setters affecting `assessment_details` are
11169 /// mutually exclusive.
11170 ///
11171 /// # Example
11172 /// ```ignore,no_run
11173 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlReport;
11174 /// use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAssessmentDetails;
11175 /// let x = CloudControlReport::new().set_cloud_control_assessment_details(CloudControlAssessmentDetails::default()/* use setters */);
11176 /// assert!(x.cloud_control_assessment_details().is_some());
11177 /// assert!(x.manual_cloud_control_assessment_details().is_none());
11178 /// ```
11179 pub fn set_cloud_control_assessment_details<
11180 T: std::convert::Into<std::boxed::Box<crate::model::CloudControlAssessmentDetails>>,
11181 >(
11182 mut self,
11183 v: T,
11184 ) -> Self {
11185 self.assessment_details = std::option::Option::Some(
11186 crate::model::cloud_control_report::AssessmentDetails::CloudControlAssessmentDetails(
11187 v.into(),
11188 ),
11189 );
11190 self
11191 }
11192}
11193
11194impl wkt::message::Message for CloudControlReport {
11195 fn typename() -> &'static str {
11196 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControlReport"
11197 }
11198}
11199
11200/// Defines additional types related to [CloudControlReport].
11201pub mod cloud_control_report {
11202 #[allow(unused_imports)]
11203 use super::*;
11204
11205 /// The assessment details of the cloud control.
11206 #[derive(Clone, Debug, PartialEq)]
11207 #[non_exhaustive]
11208 pub enum AssessmentDetails {
11209 /// The details of a manual cloud control assessment.
11210 ManualCloudControlAssessmentDetails(
11211 std::boxed::Box<crate::model::ManualCloudControlAssessmentDetails>,
11212 ),
11213 /// The details of a cloud control assessment.
11214 CloudControlAssessmentDetails(std::boxed::Box<crate::model::CloudControlAssessmentDetails>),
11215 }
11216}
11217
11218/// The details for a manual cloud control assessment.
11219#[derive(Clone, Default, PartialEq)]
11220#[non_exhaustive]
11221pub struct ManualCloudControlAssessmentDetails {
11222 /// The guide for assessing a cloud control manually.
11223 pub manual_cloud_control_guide: std::vec::Vec<std::string::String>,
11224
11225 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11226}
11227
11228impl ManualCloudControlAssessmentDetails {
11229 /// Creates a new default instance.
11230 pub fn new() -> Self {
11231 std::default::Default::default()
11232 }
11233
11234 /// Sets the value of [manual_cloud_control_guide][crate::model::ManualCloudControlAssessmentDetails::manual_cloud_control_guide].
11235 ///
11236 /// # Example
11237 /// ```ignore,no_run
11238 /// # use google_cloud_cloudsecuritycompliance_v1::model::ManualCloudControlAssessmentDetails;
11239 /// let x = ManualCloudControlAssessmentDetails::new().set_manual_cloud_control_guide(["a", "b", "c"]);
11240 /// ```
11241 pub fn set_manual_cloud_control_guide<T, V>(mut self, v: T) -> Self
11242 where
11243 T: std::iter::IntoIterator<Item = V>,
11244 V: std::convert::Into<std::string::String>,
11245 {
11246 use std::iter::Iterator;
11247 self.manual_cloud_control_guide = v.into_iter().map(|i| i.into()).collect();
11248 self
11249 }
11250}
11251
11252impl wkt::message::Message for ManualCloudControlAssessmentDetails {
11253 fn typename() -> &'static str {
11254 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.ManualCloudControlAssessmentDetails"
11255 }
11256}
11257
11258/// The cloud control assessment details for non-manual cloud controls.
11259#[derive(Clone, Default, PartialEq)]
11260#[non_exhaustive]
11261pub struct CloudControlAssessmentDetails {
11262 /// The number of findings for the cloud control.
11263 pub findings_count: i32,
11264
11265 /// Output only. The evaluation status of the cloud control.
11266 pub evaluation_state: crate::model::EvaluationState,
11267
11268 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11269}
11270
11271impl CloudControlAssessmentDetails {
11272 /// Creates a new default instance.
11273 pub fn new() -> Self {
11274 std::default::Default::default()
11275 }
11276
11277 /// Sets the value of [findings_count][crate::model::CloudControlAssessmentDetails::findings_count].
11278 ///
11279 /// # Example
11280 /// ```ignore,no_run
11281 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAssessmentDetails;
11282 /// let x = CloudControlAssessmentDetails::new().set_findings_count(42);
11283 /// ```
11284 pub fn set_findings_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11285 self.findings_count = v.into();
11286 self
11287 }
11288
11289 /// Sets the value of [evaluation_state][crate::model::CloudControlAssessmentDetails::evaluation_state].
11290 ///
11291 /// # Example
11292 /// ```ignore,no_run
11293 /// # use google_cloud_cloudsecuritycompliance_v1::model::CloudControlAssessmentDetails;
11294 /// use google_cloud_cloudsecuritycompliance_v1::model::EvaluationState;
11295 /// let x0 = CloudControlAssessmentDetails::new().set_evaluation_state(EvaluationState::Passed);
11296 /// let x1 = CloudControlAssessmentDetails::new().set_evaluation_state(EvaluationState::Failed);
11297 /// let x2 = CloudControlAssessmentDetails::new().set_evaluation_state(EvaluationState::NotAssessed);
11298 /// ```
11299 pub fn set_evaluation_state<T: std::convert::Into<crate::model::EvaluationState>>(
11300 mut self,
11301 v: T,
11302 ) -> Self {
11303 self.evaluation_state = v.into();
11304 self
11305 }
11306}
11307
11308impl wkt::message::Message for CloudControlAssessmentDetails {
11309 fn typename() -> &'static str {
11310 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.CloudControlAssessmentDetails"
11311 }
11312}
11313
11314/// The similar controls.
11315#[derive(Clone, Default, PartialEq)]
11316#[non_exhaustive]
11317pub struct SimilarControls {
11318 /// The name of the framework.
11319 pub framework: std::string::String,
11320
11321 /// The ID of the control.
11322 pub control_id: std::string::String,
11323
11324 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11325}
11326
11327impl SimilarControls {
11328 /// Creates a new default instance.
11329 pub fn new() -> Self {
11330 std::default::Default::default()
11331 }
11332
11333 /// Sets the value of [framework][crate::model::SimilarControls::framework].
11334 ///
11335 /// # Example
11336 /// ```ignore,no_run
11337 /// # use google_cloud_cloudsecuritycompliance_v1::model::SimilarControls;
11338 /// let x = SimilarControls::new().set_framework("example");
11339 /// ```
11340 pub fn set_framework<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11341 self.framework = v.into();
11342 self
11343 }
11344
11345 /// Sets the value of [control_id][crate::model::SimilarControls::control_id].
11346 ///
11347 /// # Example
11348 /// ```ignore,no_run
11349 /// # use google_cloud_cloudsecuritycompliance_v1::model::SimilarControls;
11350 /// let x = SimilarControls::new().set_control_id("example");
11351 /// ```
11352 pub fn set_control_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11353 self.control_id = v.into();
11354 self
11355 }
11356}
11357
11358impl wkt::message::Message for SimilarControls {
11359 fn typename() -> &'static str {
11360 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.SimilarControls"
11361 }
11362}
11363
11364/// The aggregated compliance report.
11365#[derive(Clone, Default, PartialEq)]
11366#[non_exhaustive]
11367pub struct AggregatedComplianceReport {
11368 /// The control assessment details of the framework.
11369 pub control_assessment_details: std::option::Option<crate::model::ControlAssessmentDetails>,
11370
11371 /// The report time of the aggregated compliance report.
11372 pub report_time: std::option::Option<wkt::Timestamp>,
11373
11374 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11375}
11376
11377impl AggregatedComplianceReport {
11378 /// Creates a new default instance.
11379 pub fn new() -> Self {
11380 std::default::Default::default()
11381 }
11382
11383 /// Sets the value of [control_assessment_details][crate::model::AggregatedComplianceReport::control_assessment_details].
11384 ///
11385 /// # Example
11386 /// ```ignore,no_run
11387 /// # use google_cloud_cloudsecuritycompliance_v1::model::AggregatedComplianceReport;
11388 /// use google_cloud_cloudsecuritycompliance_v1::model::ControlAssessmentDetails;
11389 /// let x = AggregatedComplianceReport::new().set_control_assessment_details(ControlAssessmentDetails::default()/* use setters */);
11390 /// ```
11391 pub fn set_control_assessment_details<T>(mut self, v: T) -> Self
11392 where
11393 T: std::convert::Into<crate::model::ControlAssessmentDetails>,
11394 {
11395 self.control_assessment_details = std::option::Option::Some(v.into());
11396 self
11397 }
11398
11399 /// Sets or clears the value of [control_assessment_details][crate::model::AggregatedComplianceReport::control_assessment_details].
11400 ///
11401 /// # Example
11402 /// ```ignore,no_run
11403 /// # use google_cloud_cloudsecuritycompliance_v1::model::AggregatedComplianceReport;
11404 /// use google_cloud_cloudsecuritycompliance_v1::model::ControlAssessmentDetails;
11405 /// let x = AggregatedComplianceReport::new().set_or_clear_control_assessment_details(Some(ControlAssessmentDetails::default()/* use setters */));
11406 /// let x = AggregatedComplianceReport::new().set_or_clear_control_assessment_details(None::<ControlAssessmentDetails>);
11407 /// ```
11408 pub fn set_or_clear_control_assessment_details<T>(mut self, v: std::option::Option<T>) -> Self
11409 where
11410 T: std::convert::Into<crate::model::ControlAssessmentDetails>,
11411 {
11412 self.control_assessment_details = v.map(|x| x.into());
11413 self
11414 }
11415
11416 /// Sets the value of [report_time][crate::model::AggregatedComplianceReport::report_time].
11417 ///
11418 /// # Example
11419 /// ```ignore,no_run
11420 /// # use google_cloud_cloudsecuritycompliance_v1::model::AggregatedComplianceReport;
11421 /// use wkt::Timestamp;
11422 /// let x = AggregatedComplianceReport::new().set_report_time(Timestamp::default()/* use setters */);
11423 /// ```
11424 pub fn set_report_time<T>(mut self, v: T) -> Self
11425 where
11426 T: std::convert::Into<wkt::Timestamp>,
11427 {
11428 self.report_time = std::option::Option::Some(v.into());
11429 self
11430 }
11431
11432 /// Sets or clears the value of [report_time][crate::model::AggregatedComplianceReport::report_time].
11433 ///
11434 /// # Example
11435 /// ```ignore,no_run
11436 /// # use google_cloud_cloudsecuritycompliance_v1::model::AggregatedComplianceReport;
11437 /// use wkt::Timestamp;
11438 /// let x = AggregatedComplianceReport::new().set_or_clear_report_time(Some(Timestamp::default()/* use setters */));
11439 /// let x = AggregatedComplianceReport::new().set_or_clear_report_time(None::<Timestamp>);
11440 /// ```
11441 pub fn set_or_clear_report_time<T>(mut self, v: std::option::Option<T>) -> Self
11442 where
11443 T: std::convert::Into<wkt::Timestamp>,
11444 {
11445 self.report_time = v.map(|x| x.into());
11446 self
11447 }
11448}
11449
11450impl wkt::message::Message for AggregatedComplianceReport {
11451 fn typename() -> &'static str {
11452 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.AggregatedComplianceReport"
11453 }
11454}
11455
11456/// The details for a target resource.
11457#[derive(Clone, Default, PartialEq)]
11458#[non_exhaustive]
11459pub struct TargetResourceDetails {
11460 /// The framework deployment name for the target resource.
11461 ///
11462 /// For example,
11463 /// `organizations/{organization_id}/locations/{location}/frameworkDeployments/{framework_deployment_id}`
11464 pub framework_deployment: std::string::String,
11465
11466 /// The display name of the target resource. For example, `google.com`,
11467 /// `staging-project`, or `development-folder`.
11468 pub target_resource_display_name: std::string::String,
11469
11470 /// The target resource. For example, `organizations/1234567890`,
11471 /// `projects/1234567890`, or `folders/1234567890`.
11472 pub target_resource: std::string::String,
11473
11474 /// The create time of the target resource.
11475 pub create_time: std::option::Option<wkt::Timestamp>,
11476
11477 /// The update time of the target resource.
11478 pub update_time: std::option::Option<wkt::Timestamp>,
11479
11480 /// The major revision ID of the framework for the target resource.
11481 pub major_revision_id: i64,
11482
11483 /// The minor revision ID of the framework for the target resource.
11484 pub minor_revision_id: i64,
11485
11486 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11487}
11488
11489impl TargetResourceDetails {
11490 /// Creates a new default instance.
11491 pub fn new() -> Self {
11492 std::default::Default::default()
11493 }
11494
11495 /// Sets the value of [framework_deployment][crate::model::TargetResourceDetails::framework_deployment].
11496 ///
11497 /// # Example
11498 /// ```ignore,no_run
11499 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceDetails;
11500 /// let x = TargetResourceDetails::new().set_framework_deployment("example");
11501 /// ```
11502 pub fn set_framework_deployment<T: std::convert::Into<std::string::String>>(
11503 mut self,
11504 v: T,
11505 ) -> Self {
11506 self.framework_deployment = v.into();
11507 self
11508 }
11509
11510 /// Sets the value of [target_resource_display_name][crate::model::TargetResourceDetails::target_resource_display_name].
11511 ///
11512 /// # Example
11513 /// ```ignore,no_run
11514 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceDetails;
11515 /// let x = TargetResourceDetails::new().set_target_resource_display_name("example");
11516 /// ```
11517 pub fn set_target_resource_display_name<T: std::convert::Into<std::string::String>>(
11518 mut self,
11519 v: T,
11520 ) -> Self {
11521 self.target_resource_display_name = v.into();
11522 self
11523 }
11524
11525 /// Sets the value of [target_resource][crate::model::TargetResourceDetails::target_resource].
11526 ///
11527 /// # Example
11528 /// ```ignore,no_run
11529 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceDetails;
11530 /// let x = TargetResourceDetails::new().set_target_resource("example");
11531 /// ```
11532 pub fn set_target_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11533 self.target_resource = v.into();
11534 self
11535 }
11536
11537 /// Sets the value of [create_time][crate::model::TargetResourceDetails::create_time].
11538 ///
11539 /// # Example
11540 /// ```ignore,no_run
11541 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceDetails;
11542 /// use wkt::Timestamp;
11543 /// let x = TargetResourceDetails::new().set_create_time(Timestamp::default()/* use setters */);
11544 /// ```
11545 pub fn set_create_time<T>(mut self, v: T) -> Self
11546 where
11547 T: std::convert::Into<wkt::Timestamp>,
11548 {
11549 self.create_time = std::option::Option::Some(v.into());
11550 self
11551 }
11552
11553 /// Sets or clears the value of [create_time][crate::model::TargetResourceDetails::create_time].
11554 ///
11555 /// # Example
11556 /// ```ignore,no_run
11557 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceDetails;
11558 /// use wkt::Timestamp;
11559 /// let x = TargetResourceDetails::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11560 /// let x = TargetResourceDetails::new().set_or_clear_create_time(None::<Timestamp>);
11561 /// ```
11562 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11563 where
11564 T: std::convert::Into<wkt::Timestamp>,
11565 {
11566 self.create_time = v.map(|x| x.into());
11567 self
11568 }
11569
11570 /// Sets the value of [update_time][crate::model::TargetResourceDetails::update_time].
11571 ///
11572 /// # Example
11573 /// ```ignore,no_run
11574 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceDetails;
11575 /// use wkt::Timestamp;
11576 /// let x = TargetResourceDetails::new().set_update_time(Timestamp::default()/* use setters */);
11577 /// ```
11578 pub fn set_update_time<T>(mut self, v: T) -> Self
11579 where
11580 T: std::convert::Into<wkt::Timestamp>,
11581 {
11582 self.update_time = std::option::Option::Some(v.into());
11583 self
11584 }
11585
11586 /// Sets or clears the value of [update_time][crate::model::TargetResourceDetails::update_time].
11587 ///
11588 /// # Example
11589 /// ```ignore,no_run
11590 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceDetails;
11591 /// use wkt::Timestamp;
11592 /// let x = TargetResourceDetails::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
11593 /// let x = TargetResourceDetails::new().set_or_clear_update_time(None::<Timestamp>);
11594 /// ```
11595 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
11596 where
11597 T: std::convert::Into<wkt::Timestamp>,
11598 {
11599 self.update_time = v.map(|x| x.into());
11600 self
11601 }
11602
11603 /// Sets the value of [major_revision_id][crate::model::TargetResourceDetails::major_revision_id].
11604 ///
11605 /// # Example
11606 /// ```ignore,no_run
11607 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceDetails;
11608 /// let x = TargetResourceDetails::new().set_major_revision_id(42);
11609 /// ```
11610 pub fn set_major_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11611 self.major_revision_id = v.into();
11612 self
11613 }
11614
11615 /// Sets the value of [minor_revision_id][crate::model::TargetResourceDetails::minor_revision_id].
11616 ///
11617 /// # Example
11618 /// ```ignore,no_run
11619 /// # use google_cloud_cloudsecuritycompliance_v1::model::TargetResourceDetails;
11620 /// let x = TargetResourceDetails::new().set_minor_revision_id(42);
11621 /// ```
11622 pub fn set_minor_revision_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11623 self.minor_revision_id = v.into();
11624 self
11625 }
11626}
11627
11628impl wkt::message::Message for TargetResourceDetails {
11629 fn typename() -> &'static str {
11630 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.TargetResourceDetails"
11631 }
11632}
11633
11634/// The trend of a compliance metric.
11635#[derive(Clone, Default, PartialEq)]
11636#[non_exhaustive]
11637pub struct Trend {
11638 /// Output only. The duration for the trend.
11639 pub duration: std::option::Option<wkt::Duration>,
11640
11641 /// Output only. The trend value as a percentage. The value can be positive or
11642 /// negative.
11643 pub value_percent: f64,
11644
11645 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11646}
11647
11648impl Trend {
11649 /// Creates a new default instance.
11650 pub fn new() -> Self {
11651 std::default::Default::default()
11652 }
11653
11654 /// Sets the value of [duration][crate::model::Trend::duration].
11655 ///
11656 /// # Example
11657 /// ```ignore,no_run
11658 /// # use google_cloud_cloudsecuritycompliance_v1::model::Trend;
11659 /// use wkt::Duration;
11660 /// let x = Trend::new().set_duration(Duration::default()/* use setters */);
11661 /// ```
11662 pub fn set_duration<T>(mut self, v: T) -> Self
11663 where
11664 T: std::convert::Into<wkt::Duration>,
11665 {
11666 self.duration = std::option::Option::Some(v.into());
11667 self
11668 }
11669
11670 /// Sets or clears the value of [duration][crate::model::Trend::duration].
11671 ///
11672 /// # Example
11673 /// ```ignore,no_run
11674 /// # use google_cloud_cloudsecuritycompliance_v1::model::Trend;
11675 /// use wkt::Duration;
11676 /// let x = Trend::new().set_or_clear_duration(Some(Duration::default()/* use setters */));
11677 /// let x = Trend::new().set_or_clear_duration(None::<Duration>);
11678 /// ```
11679 pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
11680 where
11681 T: std::convert::Into<wkt::Duration>,
11682 {
11683 self.duration = v.map(|x| x.into());
11684 self
11685 }
11686
11687 /// Sets the value of [value_percent][crate::model::Trend::value_percent].
11688 ///
11689 /// # Example
11690 /// ```ignore,no_run
11691 /// # use google_cloud_cloudsecuritycompliance_v1::model::Trend;
11692 /// let x = Trend::new().set_value_percent(42.0);
11693 /// ```
11694 pub fn set_value_percent<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11695 self.value_percent = v.into();
11696 self
11697 }
11698}
11699
11700impl wkt::message::Message for Trend {
11701 fn typename() -> &'static str {
11702 "type.googleapis.com/google.cloud.cloudsecuritycompliance.v1.Trend"
11703 }
11704}
11705
11706/// The state of compliance after evaluation is complete.
11707///
11708/// # Working with unknown values
11709///
11710/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11711/// additional enum variants at any time. Adding new variants is not considered
11712/// a breaking change. Applications should write their code in anticipation of:
11713///
11714/// - New values appearing in future releases of the client library, **and**
11715/// - New values received dynamically, without application changes.
11716///
11717/// Please consult the [Working with enums] section in the user guide for some
11718/// guidelines.
11719///
11720/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11721#[derive(Clone, Debug, PartialEq)]
11722#[non_exhaustive]
11723pub enum ComplianceState {
11724 /// Default value. This value is unused.
11725 Unspecified,
11726 /// The resource is compliant.
11727 Compliant,
11728 /// The resource has a violation.
11729 Violation,
11730 /// The resource requires manual review from you.
11731 ManualReviewNeeded,
11732 /// An error occurred while computing the resource status.
11733 Error,
11734 /// The resource can't be audited.
11735 AuditNotSupported,
11736 /// If set, the enum was initialized with an unknown value.
11737 ///
11738 /// Applications can examine the value using [ComplianceState::value] or
11739 /// [ComplianceState::name].
11740 UnknownValue(compliance_state::UnknownValue),
11741}
11742
11743#[doc(hidden)]
11744pub mod compliance_state {
11745 #[allow(unused_imports)]
11746 use super::*;
11747 #[derive(Clone, Debug, PartialEq)]
11748 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11749}
11750
11751impl ComplianceState {
11752 /// Gets the enum value.
11753 ///
11754 /// Returns `None` if the enum contains an unknown value deserialized from
11755 /// the string representation of enums.
11756 pub fn value(&self) -> std::option::Option<i32> {
11757 match self {
11758 Self::Unspecified => std::option::Option::Some(0),
11759 Self::Compliant => std::option::Option::Some(1),
11760 Self::Violation => std::option::Option::Some(2),
11761 Self::ManualReviewNeeded => std::option::Option::Some(3),
11762 Self::Error => std::option::Option::Some(4),
11763 Self::AuditNotSupported => std::option::Option::Some(5),
11764 Self::UnknownValue(u) => u.0.value(),
11765 }
11766 }
11767
11768 /// Gets the enum value as a string.
11769 ///
11770 /// Returns `None` if the enum contains an unknown value deserialized from
11771 /// the integer representation of enums.
11772 pub fn name(&self) -> std::option::Option<&str> {
11773 match self {
11774 Self::Unspecified => std::option::Option::Some("COMPLIANCE_STATE_UNSPECIFIED"),
11775 Self::Compliant => std::option::Option::Some("COMPLIANT"),
11776 Self::Violation => std::option::Option::Some("VIOLATION"),
11777 Self::ManualReviewNeeded => std::option::Option::Some("MANUAL_REVIEW_NEEDED"),
11778 Self::Error => std::option::Option::Some("ERROR"),
11779 Self::AuditNotSupported => std::option::Option::Some("AUDIT_NOT_SUPPORTED"),
11780 Self::UnknownValue(u) => u.0.name(),
11781 }
11782 }
11783}
11784
11785impl std::default::Default for ComplianceState {
11786 fn default() -> Self {
11787 use std::convert::From;
11788 Self::from(0)
11789 }
11790}
11791
11792impl std::fmt::Display for ComplianceState {
11793 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11794 wkt::internal::display_enum(f, self.name(), self.value())
11795 }
11796}
11797
11798impl std::convert::From<i32> for ComplianceState {
11799 fn from(value: i32) -> Self {
11800 match value {
11801 0 => Self::Unspecified,
11802 1 => Self::Compliant,
11803 2 => Self::Violation,
11804 3 => Self::ManualReviewNeeded,
11805 4 => Self::Error,
11806 5 => Self::AuditNotSupported,
11807 _ => Self::UnknownValue(compliance_state::UnknownValue(
11808 wkt::internal::UnknownEnumValue::Integer(value),
11809 )),
11810 }
11811 }
11812}
11813
11814impl std::convert::From<&str> for ComplianceState {
11815 fn from(value: &str) -> Self {
11816 use std::string::ToString;
11817 match value {
11818 "COMPLIANCE_STATE_UNSPECIFIED" => Self::Unspecified,
11819 "COMPLIANT" => Self::Compliant,
11820 "VIOLATION" => Self::Violation,
11821 "MANUAL_REVIEW_NEEDED" => Self::ManualReviewNeeded,
11822 "ERROR" => Self::Error,
11823 "AUDIT_NOT_SUPPORTED" => Self::AuditNotSupported,
11824 _ => Self::UnknownValue(compliance_state::UnknownValue(
11825 wkt::internal::UnknownEnumValue::String(value.to_string()),
11826 )),
11827 }
11828 }
11829}
11830
11831impl serde::ser::Serialize for ComplianceState {
11832 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11833 where
11834 S: serde::Serializer,
11835 {
11836 match self {
11837 Self::Unspecified => serializer.serialize_i32(0),
11838 Self::Compliant => serializer.serialize_i32(1),
11839 Self::Violation => serializer.serialize_i32(2),
11840 Self::ManualReviewNeeded => serializer.serialize_i32(3),
11841 Self::Error => serializer.serialize_i32(4),
11842 Self::AuditNotSupported => serializer.serialize_i32(5),
11843 Self::UnknownValue(u) => u.0.serialize(serializer),
11844 }
11845 }
11846}
11847
11848impl<'de> serde::de::Deserialize<'de> for ComplianceState {
11849 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11850 where
11851 D: serde::Deserializer<'de>,
11852 {
11853 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ComplianceState>::new(
11854 ".google.cloud.cloudsecuritycompliance.v1.ComplianceState",
11855 ))
11856 }
11857}
11858
11859/// The responsibility type for the regulatory control.
11860///
11861/// # Working with unknown values
11862///
11863/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11864/// additional enum variants at any time. Adding new variants is not considered
11865/// a breaking change. Applications should write their code in anticipation of:
11866///
11867/// - New values appearing in future releases of the client library, **and**
11868/// - New values received dynamically, without application changes.
11869///
11870/// Please consult the [Working with enums] section in the user guide for some
11871/// guidelines.
11872///
11873/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11874#[derive(Clone, Debug, PartialEq)]
11875#[non_exhaustive]
11876pub enum RegulatoryControlResponsibilityType {
11877 /// Default value. This value is unused.
11878 Unspecified,
11879 /// Google's responsibility.
11880 Google,
11881 /// Your responsibility.
11882 Customer,
11883 /// Shared responsibility.
11884 Shared,
11885 /// If set, the enum was initialized with an unknown value.
11886 ///
11887 /// Applications can examine the value using [RegulatoryControlResponsibilityType::value] or
11888 /// [RegulatoryControlResponsibilityType::name].
11889 UnknownValue(regulatory_control_responsibility_type::UnknownValue),
11890}
11891
11892#[doc(hidden)]
11893pub mod regulatory_control_responsibility_type {
11894 #[allow(unused_imports)]
11895 use super::*;
11896 #[derive(Clone, Debug, PartialEq)]
11897 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11898}
11899
11900impl RegulatoryControlResponsibilityType {
11901 /// Gets the enum value.
11902 ///
11903 /// Returns `None` if the enum contains an unknown value deserialized from
11904 /// the string representation of enums.
11905 pub fn value(&self) -> std::option::Option<i32> {
11906 match self {
11907 Self::Unspecified => std::option::Option::Some(0),
11908 Self::Google => std::option::Option::Some(1),
11909 Self::Customer => std::option::Option::Some(2),
11910 Self::Shared => std::option::Option::Some(3),
11911 Self::UnknownValue(u) => u.0.value(),
11912 }
11913 }
11914
11915 /// Gets the enum value as a string.
11916 ///
11917 /// Returns `None` if the enum contains an unknown value deserialized from
11918 /// the integer representation of enums.
11919 pub fn name(&self) -> std::option::Option<&str> {
11920 match self {
11921 Self::Unspecified => {
11922 std::option::Option::Some("REGULATORY_CONTROL_RESPONSIBILITY_TYPE_UNSPECIFIED")
11923 }
11924 Self::Google => std::option::Option::Some("GOOGLE"),
11925 Self::Customer => std::option::Option::Some("CUSTOMER"),
11926 Self::Shared => std::option::Option::Some("SHARED"),
11927 Self::UnknownValue(u) => u.0.name(),
11928 }
11929 }
11930}
11931
11932impl std::default::Default for RegulatoryControlResponsibilityType {
11933 fn default() -> Self {
11934 use std::convert::From;
11935 Self::from(0)
11936 }
11937}
11938
11939impl std::fmt::Display for RegulatoryControlResponsibilityType {
11940 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11941 wkt::internal::display_enum(f, self.name(), self.value())
11942 }
11943}
11944
11945impl std::convert::From<i32> for RegulatoryControlResponsibilityType {
11946 fn from(value: i32) -> Self {
11947 match value {
11948 0 => Self::Unspecified,
11949 1 => Self::Google,
11950 2 => Self::Customer,
11951 3 => Self::Shared,
11952 _ => Self::UnknownValue(regulatory_control_responsibility_type::UnknownValue(
11953 wkt::internal::UnknownEnumValue::Integer(value),
11954 )),
11955 }
11956 }
11957}
11958
11959impl std::convert::From<&str> for RegulatoryControlResponsibilityType {
11960 fn from(value: &str) -> Self {
11961 use std::string::ToString;
11962 match value {
11963 "REGULATORY_CONTROL_RESPONSIBILITY_TYPE_UNSPECIFIED" => Self::Unspecified,
11964 "GOOGLE" => Self::Google,
11965 "CUSTOMER" => Self::Customer,
11966 "SHARED" => Self::Shared,
11967 _ => Self::UnknownValue(regulatory_control_responsibility_type::UnknownValue(
11968 wkt::internal::UnknownEnumValue::String(value.to_string()),
11969 )),
11970 }
11971 }
11972}
11973
11974impl serde::ser::Serialize for RegulatoryControlResponsibilityType {
11975 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11976 where
11977 S: serde::Serializer,
11978 {
11979 match self {
11980 Self::Unspecified => serializer.serialize_i32(0),
11981 Self::Google => serializer.serialize_i32(1),
11982 Self::Customer => serializer.serialize_i32(2),
11983 Self::Shared => serializer.serialize_i32(3),
11984 Self::UnknownValue(u) => u.0.serialize(serializer),
11985 }
11986 }
11987}
11988
11989impl<'de> serde::de::Deserialize<'de> for RegulatoryControlResponsibilityType {
11990 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11991 where
11992 D: serde::Deserializer<'de>,
11993 {
11994 deserializer.deserialize_any(wkt::internal::EnumVisitor::<
11995 RegulatoryControlResponsibilityType,
11996 >::new(
11997 ".google.cloud.cloudsecuritycompliance.v1.RegulatoryControlResponsibilityType",
11998 ))
11999 }
12000}
12001
12002/// The enforcement mode for the cloud control.
12003///
12004/// # Working with unknown values
12005///
12006/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12007/// additional enum variants at any time. Adding new variants is not considered
12008/// a breaking change. Applications should write their code in anticipation of:
12009///
12010/// - New values appearing in future releases of the client library, **and**
12011/// - New values received dynamically, without application changes.
12012///
12013/// Please consult the [Working with enums] section in the user guide for some
12014/// guidelines.
12015///
12016/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12017#[derive(Clone, Debug, PartialEq)]
12018#[non_exhaustive]
12019pub enum EnforcementMode {
12020 /// Default value. This value is unused.
12021 Unspecified,
12022 /// The cloud control is enforced to prevent non-compliance.
12023 Preventive,
12024 /// The cloud control is enforced to detect non-compliance.
12025 Detective,
12026 /// The cloud control is enforced to audit for non-compliance.
12027 Audit,
12028 /// If set, the enum was initialized with an unknown value.
12029 ///
12030 /// Applications can examine the value using [EnforcementMode::value] or
12031 /// [EnforcementMode::name].
12032 UnknownValue(enforcement_mode::UnknownValue),
12033}
12034
12035#[doc(hidden)]
12036pub mod enforcement_mode {
12037 #[allow(unused_imports)]
12038 use super::*;
12039 #[derive(Clone, Debug, PartialEq)]
12040 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12041}
12042
12043impl EnforcementMode {
12044 /// Gets the enum value.
12045 ///
12046 /// Returns `None` if the enum contains an unknown value deserialized from
12047 /// the string representation of enums.
12048 pub fn value(&self) -> std::option::Option<i32> {
12049 match self {
12050 Self::Unspecified => std::option::Option::Some(0),
12051 Self::Preventive => std::option::Option::Some(1),
12052 Self::Detective => std::option::Option::Some(2),
12053 Self::Audit => std::option::Option::Some(3),
12054 Self::UnknownValue(u) => u.0.value(),
12055 }
12056 }
12057
12058 /// Gets the enum value as a string.
12059 ///
12060 /// Returns `None` if the enum contains an unknown value deserialized from
12061 /// the integer representation of enums.
12062 pub fn name(&self) -> std::option::Option<&str> {
12063 match self {
12064 Self::Unspecified => std::option::Option::Some("ENFORCEMENT_MODE_UNSPECIFIED"),
12065 Self::Preventive => std::option::Option::Some("PREVENTIVE"),
12066 Self::Detective => std::option::Option::Some("DETECTIVE"),
12067 Self::Audit => std::option::Option::Some("AUDIT"),
12068 Self::UnknownValue(u) => u.0.name(),
12069 }
12070 }
12071}
12072
12073impl std::default::Default for EnforcementMode {
12074 fn default() -> Self {
12075 use std::convert::From;
12076 Self::from(0)
12077 }
12078}
12079
12080impl std::fmt::Display for EnforcementMode {
12081 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12082 wkt::internal::display_enum(f, self.name(), self.value())
12083 }
12084}
12085
12086impl std::convert::From<i32> for EnforcementMode {
12087 fn from(value: i32) -> Self {
12088 match value {
12089 0 => Self::Unspecified,
12090 1 => Self::Preventive,
12091 2 => Self::Detective,
12092 3 => Self::Audit,
12093 _ => Self::UnknownValue(enforcement_mode::UnknownValue(
12094 wkt::internal::UnknownEnumValue::Integer(value),
12095 )),
12096 }
12097 }
12098}
12099
12100impl std::convert::From<&str> for EnforcementMode {
12101 fn from(value: &str) -> Self {
12102 use std::string::ToString;
12103 match value {
12104 "ENFORCEMENT_MODE_UNSPECIFIED" => Self::Unspecified,
12105 "PREVENTIVE" => Self::Preventive,
12106 "DETECTIVE" => Self::Detective,
12107 "AUDIT" => Self::Audit,
12108 _ => Self::UnknownValue(enforcement_mode::UnknownValue(
12109 wkt::internal::UnknownEnumValue::String(value.to_string()),
12110 )),
12111 }
12112 }
12113}
12114
12115impl serde::ser::Serialize for EnforcementMode {
12116 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12117 where
12118 S: serde::Serializer,
12119 {
12120 match self {
12121 Self::Unspecified => serializer.serialize_i32(0),
12122 Self::Preventive => serializer.serialize_i32(1),
12123 Self::Detective => serializer.serialize_i32(2),
12124 Self::Audit => serializer.serialize_i32(3),
12125 Self::UnknownValue(u) => u.0.serialize(serializer),
12126 }
12127 }
12128}
12129
12130impl<'de> serde::de::Deserialize<'de> for EnforcementMode {
12131 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12132 where
12133 D: serde::Deserializer<'de>,
12134 {
12135 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EnforcementMode>::new(
12136 ".google.cloud.cloudsecuritycompliance.v1.EnforcementMode",
12137 ))
12138 }
12139}
12140
12141/// The category for the framework.
12142///
12143/// # Working with unknown values
12144///
12145/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12146/// additional enum variants at any time. Adding new variants is not considered
12147/// a breaking change. Applications should write their code in anticipation of:
12148///
12149/// - New values appearing in future releases of the client library, **and**
12150/// - New values received dynamically, without application changes.
12151///
12152/// Please consult the [Working with enums] section in the user guide for some
12153/// guidelines.
12154///
12155/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12156#[derive(Clone, Debug, PartialEq)]
12157#[non_exhaustive]
12158pub enum FrameworkCategory {
12159 /// Default value. This value is unused.
12160 Unspecified,
12161 /// An industry-defined framework.
12162 IndustryDefinedStandard,
12163 /// An Assured Workloads framework.
12164 AssuredWorkloads,
12165 /// A data security posture framework.
12166 DataSecurity,
12167 /// A Google's best practices framework.
12168 GoogleBestPractices,
12169 /// A user-created framework.
12170 CustomFramework,
12171 /// If set, the enum was initialized with an unknown value.
12172 ///
12173 /// Applications can examine the value using [FrameworkCategory::value] or
12174 /// [FrameworkCategory::name].
12175 UnknownValue(framework_category::UnknownValue),
12176}
12177
12178#[doc(hidden)]
12179pub mod framework_category {
12180 #[allow(unused_imports)]
12181 use super::*;
12182 #[derive(Clone, Debug, PartialEq)]
12183 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12184}
12185
12186impl FrameworkCategory {
12187 /// Gets the enum value.
12188 ///
12189 /// Returns `None` if the enum contains an unknown value deserialized from
12190 /// the string representation of enums.
12191 pub fn value(&self) -> std::option::Option<i32> {
12192 match self {
12193 Self::Unspecified => std::option::Option::Some(0),
12194 Self::IndustryDefinedStandard => std::option::Option::Some(1),
12195 Self::AssuredWorkloads => std::option::Option::Some(2),
12196 Self::DataSecurity => std::option::Option::Some(3),
12197 Self::GoogleBestPractices => std::option::Option::Some(4),
12198 Self::CustomFramework => std::option::Option::Some(5),
12199 Self::UnknownValue(u) => u.0.value(),
12200 }
12201 }
12202
12203 /// Gets the enum value as a string.
12204 ///
12205 /// Returns `None` if the enum contains an unknown value deserialized from
12206 /// the integer representation of enums.
12207 pub fn name(&self) -> std::option::Option<&str> {
12208 match self {
12209 Self::Unspecified => std::option::Option::Some("FRAMEWORK_CATEGORY_UNSPECIFIED"),
12210 Self::IndustryDefinedStandard => std::option::Option::Some("INDUSTRY_DEFINED_STANDARD"),
12211 Self::AssuredWorkloads => std::option::Option::Some("ASSURED_WORKLOADS"),
12212 Self::DataSecurity => std::option::Option::Some("DATA_SECURITY"),
12213 Self::GoogleBestPractices => std::option::Option::Some("GOOGLE_BEST_PRACTICES"),
12214 Self::CustomFramework => std::option::Option::Some("CUSTOM_FRAMEWORK"),
12215 Self::UnknownValue(u) => u.0.name(),
12216 }
12217 }
12218}
12219
12220impl std::default::Default for FrameworkCategory {
12221 fn default() -> Self {
12222 use std::convert::From;
12223 Self::from(0)
12224 }
12225}
12226
12227impl std::fmt::Display for FrameworkCategory {
12228 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12229 wkt::internal::display_enum(f, self.name(), self.value())
12230 }
12231}
12232
12233impl std::convert::From<i32> for FrameworkCategory {
12234 fn from(value: i32) -> Self {
12235 match value {
12236 0 => Self::Unspecified,
12237 1 => Self::IndustryDefinedStandard,
12238 2 => Self::AssuredWorkloads,
12239 3 => Self::DataSecurity,
12240 4 => Self::GoogleBestPractices,
12241 5 => Self::CustomFramework,
12242 _ => Self::UnknownValue(framework_category::UnknownValue(
12243 wkt::internal::UnknownEnumValue::Integer(value),
12244 )),
12245 }
12246 }
12247}
12248
12249impl std::convert::From<&str> for FrameworkCategory {
12250 fn from(value: &str) -> Self {
12251 use std::string::ToString;
12252 match value {
12253 "FRAMEWORK_CATEGORY_UNSPECIFIED" => Self::Unspecified,
12254 "INDUSTRY_DEFINED_STANDARD" => Self::IndustryDefinedStandard,
12255 "ASSURED_WORKLOADS" => Self::AssuredWorkloads,
12256 "DATA_SECURITY" => Self::DataSecurity,
12257 "GOOGLE_BEST_PRACTICES" => Self::GoogleBestPractices,
12258 "CUSTOM_FRAMEWORK" => Self::CustomFramework,
12259 _ => Self::UnknownValue(framework_category::UnknownValue(
12260 wkt::internal::UnknownEnumValue::String(value.to_string()),
12261 )),
12262 }
12263 }
12264}
12265
12266impl serde::ser::Serialize for FrameworkCategory {
12267 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12268 where
12269 S: serde::Serializer,
12270 {
12271 match self {
12272 Self::Unspecified => serializer.serialize_i32(0),
12273 Self::IndustryDefinedStandard => serializer.serialize_i32(1),
12274 Self::AssuredWorkloads => serializer.serialize_i32(2),
12275 Self::DataSecurity => serializer.serialize_i32(3),
12276 Self::GoogleBestPractices => serializer.serialize_i32(4),
12277 Self::CustomFramework => serializer.serialize_i32(5),
12278 Self::UnknownValue(u) => u.0.serialize(serializer),
12279 }
12280 }
12281}
12282
12283impl<'de> serde::de::Deserialize<'de> for FrameworkCategory {
12284 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12285 where
12286 D: serde::Deserializer<'de>,
12287 {
12288 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FrameworkCategory>::new(
12289 ".google.cloud.cloudsecuritycompliance.v1.FrameworkCategory",
12290 ))
12291 }
12292}
12293
12294/// The category for the cloud control.
12295///
12296/// # Working with unknown values
12297///
12298/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12299/// additional enum variants at any time. Adding new variants is not considered
12300/// a breaking change. Applications should write their code in anticipation of:
12301///
12302/// - New values appearing in future releases of the client library, **and**
12303/// - New values received dynamically, without application changes.
12304///
12305/// Please consult the [Working with enums] section in the user guide for some
12306/// guidelines.
12307///
12308/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12309#[derive(Clone, Debug, PartialEq)]
12310#[non_exhaustive]
12311pub enum CloudControlCategory {
12312 /// Default value. This value is unused.
12313 Unspecified,
12314 /// The infrastructure security category.
12315 CcCategoryInfrastructure,
12316 /// The artificial intelligence category.
12317 CcCategoryArtificialIntelligence,
12318 /// The physical security category.
12319 CcCategoryPhysicalSecurity,
12320 /// The data security category.
12321 CcCategoryDataSecurity,
12322 /// The network security category.
12323 CcCategoryNetworkSecurity,
12324 /// The incident management category.
12325 CcCategoryIncidentManagement,
12326 /// The identity and access management category.
12327 CcCategoryIdentityAndAccessManagement,
12328 /// The encryption category.
12329 CcCategoryEncryption,
12330 /// The logs management and infrastructure category.
12331 CcCategoryLogsManagementAndInfrastructure,
12332 /// The HR, admin, and processes category.
12333 CcCategoryHrAdminAndProcesses,
12334 /// The third-party and sub-processor management category.
12335 CcCategoryThirdPartyAndSubProcessorManagement,
12336 /// The legal and disclosures category.
12337 CcCategoryLegalAndDisclosures,
12338 /// The vulnerability management category.
12339 CcCategoryVulnerabilityManagement,
12340 /// The privacy category.
12341 CcCategoryPrivacy,
12342 /// The business continuity and disaster recovery (BCDR) category.
12343 CcCategoryBcdr,
12344 /// The admin access category.
12345 CcCategoryAdminAccess,
12346 /// DRZ (Data Residency).
12347 CcCategoryDataResidency,
12348 /// RUR (Resource Usage Restriction).
12349 CcCategoryResourceUsageRestriction,
12350 /// SERVICE SPECIFIC
12351 CcCategoryServiceSpecific,
12352 /// If set, the enum was initialized with an unknown value.
12353 ///
12354 /// Applications can examine the value using [CloudControlCategory::value] or
12355 /// [CloudControlCategory::name].
12356 UnknownValue(cloud_control_category::UnknownValue),
12357}
12358
12359#[doc(hidden)]
12360pub mod cloud_control_category {
12361 #[allow(unused_imports)]
12362 use super::*;
12363 #[derive(Clone, Debug, PartialEq)]
12364 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12365}
12366
12367impl CloudControlCategory {
12368 /// Gets the enum value.
12369 ///
12370 /// Returns `None` if the enum contains an unknown value deserialized from
12371 /// the string representation of enums.
12372 pub fn value(&self) -> std::option::Option<i32> {
12373 match self {
12374 Self::Unspecified => std::option::Option::Some(0),
12375 Self::CcCategoryInfrastructure => std::option::Option::Some(1),
12376 Self::CcCategoryArtificialIntelligence => std::option::Option::Some(2),
12377 Self::CcCategoryPhysicalSecurity => std::option::Option::Some(3),
12378 Self::CcCategoryDataSecurity => std::option::Option::Some(4),
12379 Self::CcCategoryNetworkSecurity => std::option::Option::Some(5),
12380 Self::CcCategoryIncidentManagement => std::option::Option::Some(6),
12381 Self::CcCategoryIdentityAndAccessManagement => std::option::Option::Some(7),
12382 Self::CcCategoryEncryption => std::option::Option::Some(8),
12383 Self::CcCategoryLogsManagementAndInfrastructure => std::option::Option::Some(9),
12384 Self::CcCategoryHrAdminAndProcesses => std::option::Option::Some(10),
12385 Self::CcCategoryThirdPartyAndSubProcessorManagement => std::option::Option::Some(11),
12386 Self::CcCategoryLegalAndDisclosures => std::option::Option::Some(12),
12387 Self::CcCategoryVulnerabilityManagement => std::option::Option::Some(13),
12388 Self::CcCategoryPrivacy => std::option::Option::Some(14),
12389 Self::CcCategoryBcdr => std::option::Option::Some(15),
12390 Self::CcCategoryAdminAccess => std::option::Option::Some(16),
12391 Self::CcCategoryDataResidency => std::option::Option::Some(17),
12392 Self::CcCategoryResourceUsageRestriction => std::option::Option::Some(18),
12393 Self::CcCategoryServiceSpecific => std::option::Option::Some(19),
12394 Self::UnknownValue(u) => u.0.value(),
12395 }
12396 }
12397
12398 /// Gets the enum value as a string.
12399 ///
12400 /// Returns `None` if the enum contains an unknown value deserialized from
12401 /// the integer representation of enums.
12402 pub fn name(&self) -> std::option::Option<&str> {
12403 match self {
12404 Self::Unspecified => std::option::Option::Some("CLOUD_CONTROL_CATEGORY_UNSPECIFIED"),
12405 Self::CcCategoryInfrastructure => {
12406 std::option::Option::Some("CC_CATEGORY_INFRASTRUCTURE")
12407 }
12408 Self::CcCategoryArtificialIntelligence => {
12409 std::option::Option::Some("CC_CATEGORY_ARTIFICIAL_INTELLIGENCE")
12410 }
12411 Self::CcCategoryPhysicalSecurity => {
12412 std::option::Option::Some("CC_CATEGORY_PHYSICAL_SECURITY")
12413 }
12414 Self::CcCategoryDataSecurity => std::option::Option::Some("CC_CATEGORY_DATA_SECURITY"),
12415 Self::CcCategoryNetworkSecurity => {
12416 std::option::Option::Some("CC_CATEGORY_NETWORK_SECURITY")
12417 }
12418 Self::CcCategoryIncidentManagement => {
12419 std::option::Option::Some("CC_CATEGORY_INCIDENT_MANAGEMENT")
12420 }
12421 Self::CcCategoryIdentityAndAccessManagement => {
12422 std::option::Option::Some("CC_CATEGORY_IDENTITY_AND_ACCESS_MANAGEMENT")
12423 }
12424 Self::CcCategoryEncryption => std::option::Option::Some("CC_CATEGORY_ENCRYPTION"),
12425 Self::CcCategoryLogsManagementAndInfrastructure => {
12426 std::option::Option::Some("CC_CATEGORY_LOGS_MANAGEMENT_AND_INFRASTRUCTURE")
12427 }
12428 Self::CcCategoryHrAdminAndProcesses => {
12429 std::option::Option::Some("CC_CATEGORY_HR_ADMIN_AND_PROCESSES")
12430 }
12431 Self::CcCategoryThirdPartyAndSubProcessorManagement => {
12432 std::option::Option::Some("CC_CATEGORY_THIRD_PARTY_AND_SUB_PROCESSOR_MANAGEMENT")
12433 }
12434 Self::CcCategoryLegalAndDisclosures => {
12435 std::option::Option::Some("CC_CATEGORY_LEGAL_AND_DISCLOSURES")
12436 }
12437 Self::CcCategoryVulnerabilityManagement => {
12438 std::option::Option::Some("CC_CATEGORY_VULNERABILITY_MANAGEMENT")
12439 }
12440 Self::CcCategoryPrivacy => std::option::Option::Some("CC_CATEGORY_PRIVACY"),
12441 Self::CcCategoryBcdr => std::option::Option::Some("CC_CATEGORY_BCDR"),
12442 Self::CcCategoryAdminAccess => std::option::Option::Some("CC_CATEGORY_ADMIN_ACCESS"),
12443 Self::CcCategoryDataResidency => {
12444 std::option::Option::Some("CC_CATEGORY_DATA_RESIDENCY")
12445 }
12446 Self::CcCategoryResourceUsageRestriction => {
12447 std::option::Option::Some("CC_CATEGORY_RESOURCE_USAGE_RESTRICTION")
12448 }
12449 Self::CcCategoryServiceSpecific => {
12450 std::option::Option::Some("CC_CATEGORY_SERVICE_SPECIFIC")
12451 }
12452 Self::UnknownValue(u) => u.0.name(),
12453 }
12454 }
12455}
12456
12457impl std::default::Default for CloudControlCategory {
12458 fn default() -> Self {
12459 use std::convert::From;
12460 Self::from(0)
12461 }
12462}
12463
12464impl std::fmt::Display for CloudControlCategory {
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 CloudControlCategory {
12471 fn from(value: i32) -> Self {
12472 match value {
12473 0 => Self::Unspecified,
12474 1 => Self::CcCategoryInfrastructure,
12475 2 => Self::CcCategoryArtificialIntelligence,
12476 3 => Self::CcCategoryPhysicalSecurity,
12477 4 => Self::CcCategoryDataSecurity,
12478 5 => Self::CcCategoryNetworkSecurity,
12479 6 => Self::CcCategoryIncidentManagement,
12480 7 => Self::CcCategoryIdentityAndAccessManagement,
12481 8 => Self::CcCategoryEncryption,
12482 9 => Self::CcCategoryLogsManagementAndInfrastructure,
12483 10 => Self::CcCategoryHrAdminAndProcesses,
12484 11 => Self::CcCategoryThirdPartyAndSubProcessorManagement,
12485 12 => Self::CcCategoryLegalAndDisclosures,
12486 13 => Self::CcCategoryVulnerabilityManagement,
12487 14 => Self::CcCategoryPrivacy,
12488 15 => Self::CcCategoryBcdr,
12489 16 => Self::CcCategoryAdminAccess,
12490 17 => Self::CcCategoryDataResidency,
12491 18 => Self::CcCategoryResourceUsageRestriction,
12492 19 => Self::CcCategoryServiceSpecific,
12493 _ => Self::UnknownValue(cloud_control_category::UnknownValue(
12494 wkt::internal::UnknownEnumValue::Integer(value),
12495 )),
12496 }
12497 }
12498}
12499
12500impl std::convert::From<&str> for CloudControlCategory {
12501 fn from(value: &str) -> Self {
12502 use std::string::ToString;
12503 match value {
12504 "CLOUD_CONTROL_CATEGORY_UNSPECIFIED" => Self::Unspecified,
12505 "CC_CATEGORY_INFRASTRUCTURE" => Self::CcCategoryInfrastructure,
12506 "CC_CATEGORY_ARTIFICIAL_INTELLIGENCE" => Self::CcCategoryArtificialIntelligence,
12507 "CC_CATEGORY_PHYSICAL_SECURITY" => Self::CcCategoryPhysicalSecurity,
12508 "CC_CATEGORY_DATA_SECURITY" => Self::CcCategoryDataSecurity,
12509 "CC_CATEGORY_NETWORK_SECURITY" => Self::CcCategoryNetworkSecurity,
12510 "CC_CATEGORY_INCIDENT_MANAGEMENT" => Self::CcCategoryIncidentManagement,
12511 "CC_CATEGORY_IDENTITY_AND_ACCESS_MANAGEMENT" => {
12512 Self::CcCategoryIdentityAndAccessManagement
12513 }
12514 "CC_CATEGORY_ENCRYPTION" => Self::CcCategoryEncryption,
12515 "CC_CATEGORY_LOGS_MANAGEMENT_AND_INFRASTRUCTURE" => {
12516 Self::CcCategoryLogsManagementAndInfrastructure
12517 }
12518 "CC_CATEGORY_HR_ADMIN_AND_PROCESSES" => Self::CcCategoryHrAdminAndProcesses,
12519 "CC_CATEGORY_THIRD_PARTY_AND_SUB_PROCESSOR_MANAGEMENT" => {
12520 Self::CcCategoryThirdPartyAndSubProcessorManagement
12521 }
12522 "CC_CATEGORY_LEGAL_AND_DISCLOSURES" => Self::CcCategoryLegalAndDisclosures,
12523 "CC_CATEGORY_VULNERABILITY_MANAGEMENT" => Self::CcCategoryVulnerabilityManagement,
12524 "CC_CATEGORY_PRIVACY" => Self::CcCategoryPrivacy,
12525 "CC_CATEGORY_BCDR" => Self::CcCategoryBcdr,
12526 "CC_CATEGORY_ADMIN_ACCESS" => Self::CcCategoryAdminAccess,
12527 "CC_CATEGORY_DATA_RESIDENCY" => Self::CcCategoryDataResidency,
12528 "CC_CATEGORY_RESOURCE_USAGE_RESTRICTION" => Self::CcCategoryResourceUsageRestriction,
12529 "CC_CATEGORY_SERVICE_SPECIFIC" => Self::CcCategoryServiceSpecific,
12530 _ => Self::UnknownValue(cloud_control_category::UnknownValue(
12531 wkt::internal::UnknownEnumValue::String(value.to_string()),
12532 )),
12533 }
12534 }
12535}
12536
12537impl serde::ser::Serialize for CloudControlCategory {
12538 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12539 where
12540 S: serde::Serializer,
12541 {
12542 match self {
12543 Self::Unspecified => serializer.serialize_i32(0),
12544 Self::CcCategoryInfrastructure => serializer.serialize_i32(1),
12545 Self::CcCategoryArtificialIntelligence => serializer.serialize_i32(2),
12546 Self::CcCategoryPhysicalSecurity => serializer.serialize_i32(3),
12547 Self::CcCategoryDataSecurity => serializer.serialize_i32(4),
12548 Self::CcCategoryNetworkSecurity => serializer.serialize_i32(5),
12549 Self::CcCategoryIncidentManagement => serializer.serialize_i32(6),
12550 Self::CcCategoryIdentityAndAccessManagement => serializer.serialize_i32(7),
12551 Self::CcCategoryEncryption => serializer.serialize_i32(8),
12552 Self::CcCategoryLogsManagementAndInfrastructure => serializer.serialize_i32(9),
12553 Self::CcCategoryHrAdminAndProcesses => serializer.serialize_i32(10),
12554 Self::CcCategoryThirdPartyAndSubProcessorManagement => serializer.serialize_i32(11),
12555 Self::CcCategoryLegalAndDisclosures => serializer.serialize_i32(12),
12556 Self::CcCategoryVulnerabilityManagement => serializer.serialize_i32(13),
12557 Self::CcCategoryPrivacy => serializer.serialize_i32(14),
12558 Self::CcCategoryBcdr => serializer.serialize_i32(15),
12559 Self::CcCategoryAdminAccess => serializer.serialize_i32(16),
12560 Self::CcCategoryDataResidency => serializer.serialize_i32(17),
12561 Self::CcCategoryResourceUsageRestriction => serializer.serialize_i32(18),
12562 Self::CcCategoryServiceSpecific => serializer.serialize_i32(19),
12563 Self::UnknownValue(u) => u.0.serialize(serializer),
12564 }
12565 }
12566}
12567
12568impl<'de> serde::de::Deserialize<'de> for CloudControlCategory {
12569 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12570 where
12571 D: serde::Deserializer<'de>,
12572 {
12573 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CloudControlCategory>::new(
12574 ".google.cloud.cloudsecuritycompliance.v1.CloudControlCategory",
12575 ))
12576 }
12577}
12578
12579/// The cloud provider that's associated with the cloud control.
12580///
12581/// # Working with unknown values
12582///
12583/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12584/// additional enum variants at any time. Adding new variants is not considered
12585/// a breaking change. Applications should write their code in anticipation of:
12586///
12587/// - New values appearing in future releases of the client library, **and**
12588/// - New values received dynamically, without application changes.
12589///
12590/// Please consult the [Working with enums] section in the user guide for some
12591/// guidelines.
12592///
12593/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12594#[derive(Clone, Debug, PartialEq)]
12595#[non_exhaustive]
12596pub enum CloudProvider {
12597 /// Default value. This value is unused.
12598 Unspecified,
12599 /// Amazon Web Services (AWS).
12600 Aws,
12601 /// Microsoft Azure.
12602 Azure,
12603 /// Google Cloud.
12604 Gcp,
12605 /// If set, the enum was initialized with an unknown value.
12606 ///
12607 /// Applications can examine the value using [CloudProvider::value] or
12608 /// [CloudProvider::name].
12609 UnknownValue(cloud_provider::UnknownValue),
12610}
12611
12612#[doc(hidden)]
12613pub mod cloud_provider {
12614 #[allow(unused_imports)]
12615 use super::*;
12616 #[derive(Clone, Debug, PartialEq)]
12617 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12618}
12619
12620impl CloudProvider {
12621 /// Gets the enum value.
12622 ///
12623 /// Returns `None` if the enum contains an unknown value deserialized from
12624 /// the string representation of enums.
12625 pub fn value(&self) -> std::option::Option<i32> {
12626 match self {
12627 Self::Unspecified => std::option::Option::Some(0),
12628 Self::Aws => std::option::Option::Some(1),
12629 Self::Azure => std::option::Option::Some(2),
12630 Self::Gcp => std::option::Option::Some(3),
12631 Self::UnknownValue(u) => u.0.value(),
12632 }
12633 }
12634
12635 /// Gets the enum value as a string.
12636 ///
12637 /// Returns `None` if the enum contains an unknown value deserialized from
12638 /// the integer representation of enums.
12639 pub fn name(&self) -> std::option::Option<&str> {
12640 match self {
12641 Self::Unspecified => std::option::Option::Some("CLOUD_PROVIDER_UNSPECIFIED"),
12642 Self::Aws => std::option::Option::Some("AWS"),
12643 Self::Azure => std::option::Option::Some("AZURE"),
12644 Self::Gcp => std::option::Option::Some("GCP"),
12645 Self::UnknownValue(u) => u.0.name(),
12646 }
12647 }
12648}
12649
12650impl std::default::Default for CloudProvider {
12651 fn default() -> Self {
12652 use std::convert::From;
12653 Self::from(0)
12654 }
12655}
12656
12657impl std::fmt::Display for CloudProvider {
12658 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12659 wkt::internal::display_enum(f, self.name(), self.value())
12660 }
12661}
12662
12663impl std::convert::From<i32> for CloudProvider {
12664 fn from(value: i32) -> Self {
12665 match value {
12666 0 => Self::Unspecified,
12667 1 => Self::Aws,
12668 2 => Self::Azure,
12669 3 => Self::Gcp,
12670 _ => Self::UnknownValue(cloud_provider::UnknownValue(
12671 wkt::internal::UnknownEnumValue::Integer(value),
12672 )),
12673 }
12674 }
12675}
12676
12677impl std::convert::From<&str> for CloudProvider {
12678 fn from(value: &str) -> Self {
12679 use std::string::ToString;
12680 match value {
12681 "CLOUD_PROVIDER_UNSPECIFIED" => Self::Unspecified,
12682 "AWS" => Self::Aws,
12683 "AZURE" => Self::Azure,
12684 "GCP" => Self::Gcp,
12685 _ => Self::UnknownValue(cloud_provider::UnknownValue(
12686 wkt::internal::UnknownEnumValue::String(value.to_string()),
12687 )),
12688 }
12689 }
12690}
12691
12692impl serde::ser::Serialize for CloudProvider {
12693 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12694 where
12695 S: serde::Serializer,
12696 {
12697 match self {
12698 Self::Unspecified => serializer.serialize_i32(0),
12699 Self::Aws => serializer.serialize_i32(1),
12700 Self::Azure => serializer.serialize_i32(2),
12701 Self::Gcp => serializer.serialize_i32(3),
12702 Self::UnknownValue(u) => u.0.serialize(serializer),
12703 }
12704 }
12705}
12706
12707impl<'de> serde::de::Deserialize<'de> for CloudProvider {
12708 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12709 where
12710 D: serde::Deserializer<'de>,
12711 {
12712 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CloudProvider>::new(
12713 ".google.cloud.cloudsecuritycompliance.v1.CloudProvider",
12714 ))
12715 }
12716}
12717
12718/// The severity of the finding.
12719///
12720/// # Working with unknown values
12721///
12722/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12723/// additional enum variants at any time. Adding new variants is not considered
12724/// a breaking change. Applications should write their code in anticipation of:
12725///
12726/// - New values appearing in future releases of the client library, **and**
12727/// - New values received dynamically, without application changes.
12728///
12729/// Please consult the [Working with enums] section in the user guide for some
12730/// guidelines.
12731///
12732/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12733#[derive(Clone, Debug, PartialEq)]
12734#[non_exhaustive]
12735pub enum Severity {
12736 /// Default value. This value is unused.
12737 Unspecified,
12738 /// A critical vulnerability is easily discoverable by an external actor,
12739 /// exploitable, and results in the direct ability to execute arbitrary code,
12740 /// exfiltrate data, and otherwise gain additional access and privileges to
12741 /// cloud resources and workloads. Examples include publicly accessible
12742 /// unprotected user data and public SSH access with weak or no
12743 /// passwords.
12744 ///
12745 /// A critical threat is a threat that can access, modify, or delete data or
12746 /// execute unauthorized code within existing resources.
12747 Critical,
12748 /// A high-risk vulnerability can be easily discovered and exploited in
12749 /// combination with other vulnerabilities to gain direct access and
12750 /// the ability to execute arbitrary code, exfiltrate data, and otherwise
12751 /// gain additional access and privileges to cloud resources and workloads.
12752 /// An example is a database with weak or no passwords that is only
12753 /// accessible internally. This database could easily be compromised by an
12754 /// actor that had access to the internal network.
12755 ///
12756 /// A high-risk threat is a threat that can create new computational
12757 /// resources in an environment but can't access data or execute code in
12758 /// existing resources.
12759 High,
12760 /// A medium-risk vulnerability can be used by an actor to gain access to
12761 /// resources or privileges that enable them to eventually (through multiple
12762 /// steps or a complex exploit) gain access and the ability to execute
12763 /// arbitrary code or exfiltrate data. An example is a service account with
12764 /// access to more projects than it should have. If an actor gains access to
12765 /// the service account, they could potentially use that access to manipulate
12766 /// a project the service account was not intended to.
12767 ///
12768 /// A medium-risk threat can cause operational impact but might not
12769 /// access data or execute unauthorized code.
12770 Medium,
12771 /// A low-risk vulnerability hampers a security organization's ability to
12772 /// detect vulnerabilities or active threats in their deployment, or prevents
12773 /// the root cause investigation of security issues. An example is monitoring
12774 /// and logs being disabled for resource configurations and access.
12775 ///
12776 /// A low-risk threat is a threat that has obtained minimal access to an
12777 /// environment but can't access data, execute code, or create resources.
12778 Low,
12779 /// If set, the enum was initialized with an unknown value.
12780 ///
12781 /// Applications can examine the value using [Severity::value] or
12782 /// [Severity::name].
12783 UnknownValue(severity::UnknownValue),
12784}
12785
12786#[doc(hidden)]
12787pub mod severity {
12788 #[allow(unused_imports)]
12789 use super::*;
12790 #[derive(Clone, Debug, PartialEq)]
12791 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12792}
12793
12794impl Severity {
12795 /// Gets the enum value.
12796 ///
12797 /// Returns `None` if the enum contains an unknown value deserialized from
12798 /// the string representation of enums.
12799 pub fn value(&self) -> std::option::Option<i32> {
12800 match self {
12801 Self::Unspecified => std::option::Option::Some(0),
12802 Self::Critical => std::option::Option::Some(1),
12803 Self::High => std::option::Option::Some(2),
12804 Self::Medium => std::option::Option::Some(3),
12805 Self::Low => std::option::Option::Some(4),
12806 Self::UnknownValue(u) => u.0.value(),
12807 }
12808 }
12809
12810 /// Gets the enum value as a string.
12811 ///
12812 /// Returns `None` if the enum contains an unknown value deserialized from
12813 /// the integer representation of enums.
12814 pub fn name(&self) -> std::option::Option<&str> {
12815 match self {
12816 Self::Unspecified => std::option::Option::Some("SEVERITY_UNSPECIFIED"),
12817 Self::Critical => std::option::Option::Some("CRITICAL"),
12818 Self::High => std::option::Option::Some("HIGH"),
12819 Self::Medium => std::option::Option::Some("MEDIUM"),
12820 Self::Low => std::option::Option::Some("LOW"),
12821 Self::UnknownValue(u) => u.0.name(),
12822 }
12823 }
12824}
12825
12826impl std::default::Default for Severity {
12827 fn default() -> Self {
12828 use std::convert::From;
12829 Self::from(0)
12830 }
12831}
12832
12833impl std::fmt::Display for Severity {
12834 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12835 wkt::internal::display_enum(f, self.name(), self.value())
12836 }
12837}
12838
12839impl std::convert::From<i32> for Severity {
12840 fn from(value: i32) -> Self {
12841 match value {
12842 0 => Self::Unspecified,
12843 1 => Self::Critical,
12844 2 => Self::High,
12845 3 => Self::Medium,
12846 4 => Self::Low,
12847 _ => Self::UnknownValue(severity::UnknownValue(
12848 wkt::internal::UnknownEnumValue::Integer(value),
12849 )),
12850 }
12851 }
12852}
12853
12854impl std::convert::From<&str> for Severity {
12855 fn from(value: &str) -> Self {
12856 use std::string::ToString;
12857 match value {
12858 "SEVERITY_UNSPECIFIED" => Self::Unspecified,
12859 "CRITICAL" => Self::Critical,
12860 "HIGH" => Self::High,
12861 "MEDIUM" => Self::Medium,
12862 "LOW" => Self::Low,
12863 _ => Self::UnknownValue(severity::UnknownValue(
12864 wkt::internal::UnknownEnumValue::String(value.to_string()),
12865 )),
12866 }
12867 }
12868}
12869
12870impl serde::ser::Serialize for Severity {
12871 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12872 where
12873 S: serde::Serializer,
12874 {
12875 match self {
12876 Self::Unspecified => serializer.serialize_i32(0),
12877 Self::Critical => serializer.serialize_i32(1),
12878 Self::High => serializer.serialize_i32(2),
12879 Self::Medium => serializer.serialize_i32(3),
12880 Self::Low => serializer.serialize_i32(4),
12881 Self::UnknownValue(u) => u.0.serialize(serializer),
12882 }
12883 }
12884}
12885
12886impl<'de> serde::de::Deserialize<'de> for Severity {
12887 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12888 where
12889 D: serde::Deserializer<'de>,
12890 {
12891 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Severity>::new(
12892 ".google.cloud.cloudsecuritycompliance.v1.Severity",
12893 ))
12894 }
12895}
12896
12897/// The action type of the rule.
12898///
12899/// # Working with unknown values
12900///
12901/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12902/// additional enum variants at any time. Adding new variants is not considered
12903/// a breaking change. Applications should write their code in anticipation of:
12904///
12905/// - New values appearing in future releases of the client library, **and**
12906/// - New values received dynamically, without application changes.
12907///
12908/// Please consult the [Working with enums] section in the user guide for some
12909/// guidelines.
12910///
12911/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12912#[derive(Clone, Debug, PartialEq)]
12913#[non_exhaustive]
12914pub enum RuleActionType {
12915 /// Default value. This value is unused.
12916 Unspecified,
12917 /// The rule is intended to prevent non-compliance.
12918 Preventive,
12919 /// The rule is intended to detect non-compliance.
12920 Detective,
12921 /// The rule is intended to audit non-compliance.
12922 Audit,
12923 /// If set, the enum was initialized with an unknown value.
12924 ///
12925 /// Applications can examine the value using [RuleActionType::value] or
12926 /// [RuleActionType::name].
12927 UnknownValue(rule_action_type::UnknownValue),
12928}
12929
12930#[doc(hidden)]
12931pub mod rule_action_type {
12932 #[allow(unused_imports)]
12933 use super::*;
12934 #[derive(Clone, Debug, PartialEq)]
12935 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12936}
12937
12938impl RuleActionType {
12939 /// Gets the enum value.
12940 ///
12941 /// Returns `None` if the enum contains an unknown value deserialized from
12942 /// the string representation of enums.
12943 pub fn value(&self) -> std::option::Option<i32> {
12944 match self {
12945 Self::Unspecified => std::option::Option::Some(0),
12946 Self::Preventive => std::option::Option::Some(1),
12947 Self::Detective => std::option::Option::Some(2),
12948 Self::Audit => std::option::Option::Some(3),
12949 Self::UnknownValue(u) => u.0.value(),
12950 }
12951 }
12952
12953 /// Gets the enum value as a string.
12954 ///
12955 /// Returns `None` if the enum contains an unknown value deserialized from
12956 /// the integer representation of enums.
12957 pub fn name(&self) -> std::option::Option<&str> {
12958 match self {
12959 Self::Unspecified => std::option::Option::Some("RULE_ACTION_TYPE_UNSPECIFIED"),
12960 Self::Preventive => std::option::Option::Some("RULE_ACTION_TYPE_PREVENTIVE"),
12961 Self::Detective => std::option::Option::Some("RULE_ACTION_TYPE_DETECTIVE"),
12962 Self::Audit => std::option::Option::Some("RULE_ACTION_TYPE_AUDIT"),
12963 Self::UnknownValue(u) => u.0.name(),
12964 }
12965 }
12966}
12967
12968impl std::default::Default for RuleActionType {
12969 fn default() -> Self {
12970 use std::convert::From;
12971 Self::from(0)
12972 }
12973}
12974
12975impl std::fmt::Display for RuleActionType {
12976 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12977 wkt::internal::display_enum(f, self.name(), self.value())
12978 }
12979}
12980
12981impl std::convert::From<i32> for RuleActionType {
12982 fn from(value: i32) -> Self {
12983 match value {
12984 0 => Self::Unspecified,
12985 1 => Self::Preventive,
12986 2 => Self::Detective,
12987 3 => Self::Audit,
12988 _ => Self::UnknownValue(rule_action_type::UnknownValue(
12989 wkt::internal::UnknownEnumValue::Integer(value),
12990 )),
12991 }
12992 }
12993}
12994
12995impl std::convert::From<&str> for RuleActionType {
12996 fn from(value: &str) -> Self {
12997 use std::string::ToString;
12998 match value {
12999 "RULE_ACTION_TYPE_UNSPECIFIED" => Self::Unspecified,
13000 "RULE_ACTION_TYPE_PREVENTIVE" => Self::Preventive,
13001 "RULE_ACTION_TYPE_DETECTIVE" => Self::Detective,
13002 "RULE_ACTION_TYPE_AUDIT" => Self::Audit,
13003 _ => Self::UnknownValue(rule_action_type::UnknownValue(
13004 wkt::internal::UnknownEnumValue::String(value.to_string()),
13005 )),
13006 }
13007 }
13008}
13009
13010impl serde::ser::Serialize for RuleActionType {
13011 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13012 where
13013 S: serde::Serializer,
13014 {
13015 match self {
13016 Self::Unspecified => serializer.serialize_i32(0),
13017 Self::Preventive => serializer.serialize_i32(1),
13018 Self::Detective => serializer.serialize_i32(2),
13019 Self::Audit => serializer.serialize_i32(3),
13020 Self::UnknownValue(u) => u.0.serialize(serializer),
13021 }
13022 }
13023}
13024
13025impl<'de> serde::de::Deserialize<'de> for RuleActionType {
13026 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13027 where
13028 D: serde::Deserializer<'de>,
13029 {
13030 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RuleActionType>::new(
13031 ".google.cloud.cloudsecuritycompliance.v1.RuleActionType",
13032 ))
13033 }
13034}
13035
13036/// The type of resource that a control or framework can be applied to.
13037///
13038/// # Working with unknown values
13039///
13040/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13041/// additional enum variants at any time. Adding new variants is not considered
13042/// a breaking change. Applications should write their code in anticipation of:
13043///
13044/// - New values appearing in future releases of the client library, **and**
13045/// - New values received dynamically, without application changes.
13046///
13047/// Please consult the [Working with enums] section in the user guide for some
13048/// guidelines.
13049///
13050/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13051#[derive(Clone, Debug, PartialEq)]
13052#[non_exhaustive]
13053pub enum TargetResourceType {
13054 /// Default value. This value is unused.
13055 Unspecified,
13056 /// The target resource is a Google Cloud organization.
13057 TargetResourceCrmTypeOrg,
13058 /// The target resource is a folder.
13059 TargetResourceCrmTypeFolder,
13060 /// The target resource is a project.
13061 TargetResourceCrmTypeProject,
13062 /// The target resource is an application in App Hub.
13063 Application,
13064 /// If set, the enum was initialized with an unknown value.
13065 ///
13066 /// Applications can examine the value using [TargetResourceType::value] or
13067 /// [TargetResourceType::name].
13068 UnknownValue(target_resource_type::UnknownValue),
13069}
13070
13071#[doc(hidden)]
13072pub mod target_resource_type {
13073 #[allow(unused_imports)]
13074 use super::*;
13075 #[derive(Clone, Debug, PartialEq)]
13076 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13077}
13078
13079impl TargetResourceType {
13080 /// Gets the enum value.
13081 ///
13082 /// Returns `None` if the enum contains an unknown value deserialized from
13083 /// the string representation of enums.
13084 pub fn value(&self) -> std::option::Option<i32> {
13085 match self {
13086 Self::Unspecified => std::option::Option::Some(0),
13087 Self::TargetResourceCrmTypeOrg => std::option::Option::Some(1),
13088 Self::TargetResourceCrmTypeFolder => std::option::Option::Some(2),
13089 Self::TargetResourceCrmTypeProject => std::option::Option::Some(3),
13090 Self::Application => std::option::Option::Some(4),
13091 Self::UnknownValue(u) => u.0.value(),
13092 }
13093 }
13094
13095 /// Gets the enum value as a string.
13096 ///
13097 /// Returns `None` if the enum contains an unknown value deserialized from
13098 /// the integer representation of enums.
13099 pub fn name(&self) -> std::option::Option<&str> {
13100 match self {
13101 Self::Unspecified => std::option::Option::Some("TARGET_RESOURCE_TYPE_UNSPECIFIED"),
13102 Self::TargetResourceCrmTypeOrg => {
13103 std::option::Option::Some("TARGET_RESOURCE_CRM_TYPE_ORG")
13104 }
13105 Self::TargetResourceCrmTypeFolder => {
13106 std::option::Option::Some("TARGET_RESOURCE_CRM_TYPE_FOLDER")
13107 }
13108 Self::TargetResourceCrmTypeProject => {
13109 std::option::Option::Some("TARGET_RESOURCE_CRM_TYPE_PROJECT")
13110 }
13111 Self::Application => std::option::Option::Some("TARGET_RESOURCE_TYPE_APPLICATION"),
13112 Self::UnknownValue(u) => u.0.name(),
13113 }
13114 }
13115}
13116
13117impl std::default::Default for TargetResourceType {
13118 fn default() -> Self {
13119 use std::convert::From;
13120 Self::from(0)
13121 }
13122}
13123
13124impl std::fmt::Display for TargetResourceType {
13125 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13126 wkt::internal::display_enum(f, self.name(), self.value())
13127 }
13128}
13129
13130impl std::convert::From<i32> for TargetResourceType {
13131 fn from(value: i32) -> Self {
13132 match value {
13133 0 => Self::Unspecified,
13134 1 => Self::TargetResourceCrmTypeOrg,
13135 2 => Self::TargetResourceCrmTypeFolder,
13136 3 => Self::TargetResourceCrmTypeProject,
13137 4 => Self::Application,
13138 _ => Self::UnknownValue(target_resource_type::UnknownValue(
13139 wkt::internal::UnknownEnumValue::Integer(value),
13140 )),
13141 }
13142 }
13143}
13144
13145impl std::convert::From<&str> for TargetResourceType {
13146 fn from(value: &str) -> Self {
13147 use std::string::ToString;
13148 match value {
13149 "TARGET_RESOURCE_TYPE_UNSPECIFIED" => Self::Unspecified,
13150 "TARGET_RESOURCE_CRM_TYPE_ORG" => Self::TargetResourceCrmTypeOrg,
13151 "TARGET_RESOURCE_CRM_TYPE_FOLDER" => Self::TargetResourceCrmTypeFolder,
13152 "TARGET_RESOURCE_CRM_TYPE_PROJECT" => Self::TargetResourceCrmTypeProject,
13153 "TARGET_RESOURCE_TYPE_APPLICATION" => Self::Application,
13154 _ => Self::UnknownValue(target_resource_type::UnknownValue(
13155 wkt::internal::UnknownEnumValue::String(value.to_string()),
13156 )),
13157 }
13158 }
13159}
13160
13161impl serde::ser::Serialize for TargetResourceType {
13162 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13163 where
13164 S: serde::Serializer,
13165 {
13166 match self {
13167 Self::Unspecified => serializer.serialize_i32(0),
13168 Self::TargetResourceCrmTypeOrg => serializer.serialize_i32(1),
13169 Self::TargetResourceCrmTypeFolder => serializer.serialize_i32(2),
13170 Self::TargetResourceCrmTypeProject => serializer.serialize_i32(3),
13171 Self::Application => serializer.serialize_i32(4),
13172 Self::UnknownValue(u) => u.0.serialize(serializer),
13173 }
13174 }
13175}
13176
13177impl<'de> serde::de::Deserialize<'de> for TargetResourceType {
13178 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13179 where
13180 D: serde::Deserializer<'de>,
13181 {
13182 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TargetResourceType>::new(
13183 ".google.cloud.cloudsecuritycompliance.v1.TargetResourceType",
13184 ))
13185 }
13186}
13187
13188/// The state of the deployment resource.
13189///
13190/// # Working with unknown values
13191///
13192/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13193/// additional enum variants at any time. Adding new variants is not considered
13194/// a breaking change. Applications should write their code in anticipation of:
13195///
13196/// - New values appearing in future releases of the client library, **and**
13197/// - New values received dynamically, without application changes.
13198///
13199/// Please consult the [Working with enums] section in the user guide for some
13200/// guidelines.
13201///
13202/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13203#[derive(Clone, Debug, PartialEq)]
13204#[non_exhaustive]
13205pub enum DeploymentState {
13206 /// Default value. This value is unused.
13207 Unspecified,
13208 /// Validating the deployment.
13209 Validating,
13210 /// Deployment is being created.
13211 Creating,
13212 /// Deployment is being deleted.
13213 Deleting,
13214 /// Deployment is being updated.
13215 Updating,
13216 /// Deployment has failed. All the changes made by the deployment were
13217 /// successfully rolled back. You can retry or delete a deployment that's
13218 /// in this state.
13219 Failed,
13220 /// Deployment is successful and ready to use.
13221 Ready,
13222 /// Deployment is partially deployed. All the cloud controls weren't deployed
13223 /// successfully. Retrying the operation resumes from the first failed
13224 /// step.
13225 PartiallyDeployed,
13226 /// Deployment is partially deleted. All the cloud control deployments weren't
13227 /// deleted successfully. Retrying the operation resumes from the first
13228 /// failed step.
13229 PartiallyDeleted,
13230 /// If set, the enum was initialized with an unknown value.
13231 ///
13232 /// Applications can examine the value using [DeploymentState::value] or
13233 /// [DeploymentState::name].
13234 UnknownValue(deployment_state::UnknownValue),
13235}
13236
13237#[doc(hidden)]
13238pub mod deployment_state {
13239 #[allow(unused_imports)]
13240 use super::*;
13241 #[derive(Clone, Debug, PartialEq)]
13242 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13243}
13244
13245impl DeploymentState {
13246 /// Gets the enum value.
13247 ///
13248 /// Returns `None` if the enum contains an unknown value deserialized from
13249 /// the string representation of enums.
13250 pub fn value(&self) -> std::option::Option<i32> {
13251 match self {
13252 Self::Unspecified => std::option::Option::Some(0),
13253 Self::Validating => std::option::Option::Some(1),
13254 Self::Creating => std::option::Option::Some(2),
13255 Self::Deleting => std::option::Option::Some(3),
13256 Self::Updating => std::option::Option::Some(8),
13257 Self::Failed => std::option::Option::Some(4),
13258 Self::Ready => std::option::Option::Some(5),
13259 Self::PartiallyDeployed => std::option::Option::Some(6),
13260 Self::PartiallyDeleted => std::option::Option::Some(7),
13261 Self::UnknownValue(u) => u.0.value(),
13262 }
13263 }
13264
13265 /// Gets the enum value as a string.
13266 ///
13267 /// Returns `None` if the enum contains an unknown value deserialized from
13268 /// the integer representation of enums.
13269 pub fn name(&self) -> std::option::Option<&str> {
13270 match self {
13271 Self::Unspecified => std::option::Option::Some("DEPLOYMENT_STATE_UNSPECIFIED"),
13272 Self::Validating => std::option::Option::Some("DEPLOYMENT_STATE_VALIDATING"),
13273 Self::Creating => std::option::Option::Some("DEPLOYMENT_STATE_CREATING"),
13274 Self::Deleting => std::option::Option::Some("DEPLOYMENT_STATE_DELETING"),
13275 Self::Updating => std::option::Option::Some("DEPLOYMENT_STATE_UPDATING"),
13276 Self::Failed => std::option::Option::Some("DEPLOYMENT_STATE_FAILED"),
13277 Self::Ready => std::option::Option::Some("DEPLOYMENT_STATE_READY"),
13278 Self::PartiallyDeployed => {
13279 std::option::Option::Some("DEPLOYMENT_STATE_PARTIALLY_DEPLOYED")
13280 }
13281 Self::PartiallyDeleted => {
13282 std::option::Option::Some("DEPLOYMENT_STATE_PARTIALLY_DELETED")
13283 }
13284 Self::UnknownValue(u) => u.0.name(),
13285 }
13286 }
13287}
13288
13289impl std::default::Default for DeploymentState {
13290 fn default() -> Self {
13291 use std::convert::From;
13292 Self::from(0)
13293 }
13294}
13295
13296impl std::fmt::Display for DeploymentState {
13297 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13298 wkt::internal::display_enum(f, self.name(), self.value())
13299 }
13300}
13301
13302impl std::convert::From<i32> for DeploymentState {
13303 fn from(value: i32) -> Self {
13304 match value {
13305 0 => Self::Unspecified,
13306 1 => Self::Validating,
13307 2 => Self::Creating,
13308 3 => Self::Deleting,
13309 4 => Self::Failed,
13310 5 => Self::Ready,
13311 6 => Self::PartiallyDeployed,
13312 7 => Self::PartiallyDeleted,
13313 8 => Self::Updating,
13314 _ => Self::UnknownValue(deployment_state::UnknownValue(
13315 wkt::internal::UnknownEnumValue::Integer(value),
13316 )),
13317 }
13318 }
13319}
13320
13321impl std::convert::From<&str> for DeploymentState {
13322 fn from(value: &str) -> Self {
13323 use std::string::ToString;
13324 match value {
13325 "DEPLOYMENT_STATE_UNSPECIFIED" => Self::Unspecified,
13326 "DEPLOYMENT_STATE_VALIDATING" => Self::Validating,
13327 "DEPLOYMENT_STATE_CREATING" => Self::Creating,
13328 "DEPLOYMENT_STATE_DELETING" => Self::Deleting,
13329 "DEPLOYMENT_STATE_UPDATING" => Self::Updating,
13330 "DEPLOYMENT_STATE_FAILED" => Self::Failed,
13331 "DEPLOYMENT_STATE_READY" => Self::Ready,
13332 "DEPLOYMENT_STATE_PARTIALLY_DEPLOYED" => Self::PartiallyDeployed,
13333 "DEPLOYMENT_STATE_PARTIALLY_DELETED" => Self::PartiallyDeleted,
13334 _ => Self::UnknownValue(deployment_state::UnknownValue(
13335 wkt::internal::UnknownEnumValue::String(value.to_string()),
13336 )),
13337 }
13338 }
13339}
13340
13341impl serde::ser::Serialize for DeploymentState {
13342 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13343 where
13344 S: serde::Serializer,
13345 {
13346 match self {
13347 Self::Unspecified => serializer.serialize_i32(0),
13348 Self::Validating => serializer.serialize_i32(1),
13349 Self::Creating => serializer.serialize_i32(2),
13350 Self::Deleting => serializer.serialize_i32(3),
13351 Self::Updating => serializer.serialize_i32(8),
13352 Self::Failed => serializer.serialize_i32(4),
13353 Self::Ready => serializer.serialize_i32(5),
13354 Self::PartiallyDeployed => serializer.serialize_i32(6),
13355 Self::PartiallyDeleted => serializer.serialize_i32(7),
13356 Self::UnknownValue(u) => u.0.serialize(serializer),
13357 }
13358 }
13359}
13360
13361impl<'de> serde::de::Deserialize<'de> for DeploymentState {
13362 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13363 where
13364 D: serde::Deserializer<'de>,
13365 {
13366 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeploymentState>::new(
13367 ".google.cloud.cloudsecuritycompliance.v1.DeploymentState",
13368 ))
13369 }
13370}
13371
13372/// The evaluation state of the control.
13373///
13374/// # Working with unknown values
13375///
13376/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13377/// additional enum variants at any time. Adding new variants is not considered
13378/// a breaking change. Applications should write their code in anticipation of:
13379///
13380/// - New values appearing in future releases of the client library, **and**
13381/// - New values received dynamically, without application changes.
13382///
13383/// Please consult the [Working with enums] section in the user guide for some
13384/// guidelines.
13385///
13386/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13387#[derive(Clone, Debug, PartialEq)]
13388#[non_exhaustive]
13389pub enum EvaluationState {
13390 /// Default value. This value is unused.
13391 Unspecified,
13392 /// The control is passing.
13393 Passed,
13394 /// The control is failing.
13395 Failed,
13396 /// The control is not assessed.
13397 NotAssessed,
13398 /// If set, the enum was initialized with an unknown value.
13399 ///
13400 /// Applications can examine the value using [EvaluationState::value] or
13401 /// [EvaluationState::name].
13402 UnknownValue(evaluation_state::UnknownValue),
13403}
13404
13405#[doc(hidden)]
13406pub mod evaluation_state {
13407 #[allow(unused_imports)]
13408 use super::*;
13409 #[derive(Clone, Debug, PartialEq)]
13410 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13411}
13412
13413impl EvaluationState {
13414 /// Gets the enum value.
13415 ///
13416 /// Returns `None` if the enum contains an unknown value deserialized from
13417 /// the string representation of enums.
13418 pub fn value(&self) -> std::option::Option<i32> {
13419 match self {
13420 Self::Unspecified => std::option::Option::Some(0),
13421 Self::Passed => std::option::Option::Some(1),
13422 Self::Failed => std::option::Option::Some(2),
13423 Self::NotAssessed => std::option::Option::Some(3),
13424 Self::UnknownValue(u) => u.0.value(),
13425 }
13426 }
13427
13428 /// Gets the enum value as a string.
13429 ///
13430 /// Returns `None` if the enum contains an unknown value deserialized from
13431 /// the integer representation of enums.
13432 pub fn name(&self) -> std::option::Option<&str> {
13433 match self {
13434 Self::Unspecified => std::option::Option::Some("EVALUATION_STATE_UNSPECIFIED"),
13435 Self::Passed => std::option::Option::Some("EVALUATION_STATE_PASSED"),
13436 Self::Failed => std::option::Option::Some("EVALUATION_STATE_FAILED"),
13437 Self::NotAssessed => std::option::Option::Some("EVALUATION_STATE_NOT_ASSESSED"),
13438 Self::UnknownValue(u) => u.0.name(),
13439 }
13440 }
13441}
13442
13443impl std::default::Default for EvaluationState {
13444 fn default() -> Self {
13445 use std::convert::From;
13446 Self::from(0)
13447 }
13448}
13449
13450impl std::fmt::Display for EvaluationState {
13451 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13452 wkt::internal::display_enum(f, self.name(), self.value())
13453 }
13454}
13455
13456impl std::convert::From<i32> for EvaluationState {
13457 fn from(value: i32) -> Self {
13458 match value {
13459 0 => Self::Unspecified,
13460 1 => Self::Passed,
13461 2 => Self::Failed,
13462 3 => Self::NotAssessed,
13463 _ => Self::UnknownValue(evaluation_state::UnknownValue(
13464 wkt::internal::UnknownEnumValue::Integer(value),
13465 )),
13466 }
13467 }
13468}
13469
13470impl std::convert::From<&str> for EvaluationState {
13471 fn from(value: &str) -> Self {
13472 use std::string::ToString;
13473 match value {
13474 "EVALUATION_STATE_UNSPECIFIED" => Self::Unspecified,
13475 "EVALUATION_STATE_PASSED" => Self::Passed,
13476 "EVALUATION_STATE_FAILED" => Self::Failed,
13477 "EVALUATION_STATE_NOT_ASSESSED" => Self::NotAssessed,
13478 _ => Self::UnknownValue(evaluation_state::UnknownValue(
13479 wkt::internal::UnknownEnumValue::String(value.to_string()),
13480 )),
13481 }
13482 }
13483}
13484
13485impl serde::ser::Serialize for EvaluationState {
13486 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13487 where
13488 S: serde::Serializer,
13489 {
13490 match self {
13491 Self::Unspecified => serializer.serialize_i32(0),
13492 Self::Passed => serializer.serialize_i32(1),
13493 Self::Failed => serializer.serialize_i32(2),
13494 Self::NotAssessed => serializer.serialize_i32(3),
13495 Self::UnknownValue(u) => u.0.serialize(serializer),
13496 }
13497 }
13498}
13499
13500impl<'de> serde::de::Deserialize<'de> for EvaluationState {
13501 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13502 where
13503 D: serde::Deserializer<'de>,
13504 {
13505 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EvaluationState>::new(
13506 ".google.cloud.cloudsecuritycompliance.v1.EvaluationState",
13507 ))
13508 }
13509}
13510
13511/// A finding is a record of assessment data like security, risk, health, or
13512/// privacy.
13513///
13514/// # Working with unknown values
13515///
13516/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13517/// additional enum variants at any time. Adding new variants is not considered
13518/// a breaking change. Applications should write their code in anticipation of:
13519///
13520/// - New values appearing in future releases of the client library, **and**
13521/// - New values received dynamically, without application changes.
13522///
13523/// Please consult the [Working with enums] section in the user guide for some
13524/// guidelines.
13525///
13526/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13527#[derive(Clone, Debug, PartialEq)]
13528#[non_exhaustive]
13529pub enum FindingClass {
13530 /// Default value. This value is unused.
13531 Unspecified,
13532 /// The activity is unwanted or malicious.
13533 Threat,
13534 /// A potential weakness in software that increases risk to
13535 /// confidentiality, integrity, and availability.
13536 Vulnerability,
13537 /// A potential weakness in a cloud resource or asset configuration that
13538 /// increases risk.
13539 Misconfiguration,
13540 /// A security observation that is for informational purposes.
13541 Observation,
13542 /// An error that prevents Security Command Center from functioning properly.
13543 SccError,
13544 /// A potential security risk that's due to a change in the security
13545 /// posture.
13546 PostureViolation,
13547 /// A combination of security issues that represent a more severe
13548 /// security problem when taken together.
13549 ToxicCombination,
13550 /// A potential security risk to data assets that contain sensitive
13551 /// data.
13552 SensitiveDataRisk,
13553 /// A resource or resource group where high risk attack paths
13554 /// converge, based on attack path simulations (APS).
13555 Chokepoint,
13556 /// If set, the enum was initialized with an unknown value.
13557 ///
13558 /// Applications can examine the value using [FindingClass::value] or
13559 /// [FindingClass::name].
13560 UnknownValue(finding_class::UnknownValue),
13561}
13562
13563#[doc(hidden)]
13564pub mod finding_class {
13565 #[allow(unused_imports)]
13566 use super::*;
13567 #[derive(Clone, Debug, PartialEq)]
13568 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13569}
13570
13571impl FindingClass {
13572 /// Gets the enum value.
13573 ///
13574 /// Returns `None` if the enum contains an unknown value deserialized from
13575 /// the string representation of enums.
13576 pub fn value(&self) -> std::option::Option<i32> {
13577 match self {
13578 Self::Unspecified => std::option::Option::Some(0),
13579 Self::Threat => std::option::Option::Some(1),
13580 Self::Vulnerability => std::option::Option::Some(2),
13581 Self::Misconfiguration => std::option::Option::Some(3),
13582 Self::Observation => std::option::Option::Some(4),
13583 Self::SccError => std::option::Option::Some(5),
13584 Self::PostureViolation => std::option::Option::Some(6),
13585 Self::ToxicCombination => std::option::Option::Some(7),
13586 Self::SensitiveDataRisk => std::option::Option::Some(8),
13587 Self::Chokepoint => std::option::Option::Some(9),
13588 Self::UnknownValue(u) => u.0.value(),
13589 }
13590 }
13591
13592 /// Gets the enum value as a string.
13593 ///
13594 /// Returns `None` if the enum contains an unknown value deserialized from
13595 /// the integer representation of enums.
13596 pub fn name(&self) -> std::option::Option<&str> {
13597 match self {
13598 Self::Unspecified => std::option::Option::Some("FINDING_CLASS_UNSPECIFIED"),
13599 Self::Threat => std::option::Option::Some("THREAT"),
13600 Self::Vulnerability => std::option::Option::Some("VULNERABILITY"),
13601 Self::Misconfiguration => std::option::Option::Some("MISCONFIGURATION"),
13602 Self::Observation => std::option::Option::Some("OBSERVATION"),
13603 Self::SccError => std::option::Option::Some("SCC_ERROR"),
13604 Self::PostureViolation => std::option::Option::Some("POSTURE_VIOLATION"),
13605 Self::ToxicCombination => std::option::Option::Some("TOXIC_COMBINATION"),
13606 Self::SensitiveDataRisk => std::option::Option::Some("SENSITIVE_DATA_RISK"),
13607 Self::Chokepoint => std::option::Option::Some("CHOKEPOINT"),
13608 Self::UnknownValue(u) => u.0.name(),
13609 }
13610 }
13611}
13612
13613impl std::default::Default for FindingClass {
13614 fn default() -> Self {
13615 use std::convert::From;
13616 Self::from(0)
13617 }
13618}
13619
13620impl std::fmt::Display for FindingClass {
13621 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13622 wkt::internal::display_enum(f, self.name(), self.value())
13623 }
13624}
13625
13626impl std::convert::From<i32> for FindingClass {
13627 fn from(value: i32) -> Self {
13628 match value {
13629 0 => Self::Unspecified,
13630 1 => Self::Threat,
13631 2 => Self::Vulnerability,
13632 3 => Self::Misconfiguration,
13633 4 => Self::Observation,
13634 5 => Self::SccError,
13635 6 => Self::PostureViolation,
13636 7 => Self::ToxicCombination,
13637 8 => Self::SensitiveDataRisk,
13638 9 => Self::Chokepoint,
13639 _ => Self::UnknownValue(finding_class::UnknownValue(
13640 wkt::internal::UnknownEnumValue::Integer(value),
13641 )),
13642 }
13643 }
13644}
13645
13646impl std::convert::From<&str> for FindingClass {
13647 fn from(value: &str) -> Self {
13648 use std::string::ToString;
13649 match value {
13650 "FINDING_CLASS_UNSPECIFIED" => Self::Unspecified,
13651 "THREAT" => Self::Threat,
13652 "VULNERABILITY" => Self::Vulnerability,
13653 "MISCONFIGURATION" => Self::Misconfiguration,
13654 "OBSERVATION" => Self::Observation,
13655 "SCC_ERROR" => Self::SccError,
13656 "POSTURE_VIOLATION" => Self::PostureViolation,
13657 "TOXIC_COMBINATION" => Self::ToxicCombination,
13658 "SENSITIVE_DATA_RISK" => Self::SensitiveDataRisk,
13659 "CHOKEPOINT" => Self::Chokepoint,
13660 _ => Self::UnknownValue(finding_class::UnknownValue(
13661 wkt::internal::UnknownEnumValue::String(value.to_string()),
13662 )),
13663 }
13664 }
13665}
13666
13667impl serde::ser::Serialize for FindingClass {
13668 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13669 where
13670 S: serde::Serializer,
13671 {
13672 match self {
13673 Self::Unspecified => serializer.serialize_i32(0),
13674 Self::Threat => serializer.serialize_i32(1),
13675 Self::Vulnerability => serializer.serialize_i32(2),
13676 Self::Misconfiguration => serializer.serialize_i32(3),
13677 Self::Observation => serializer.serialize_i32(4),
13678 Self::SccError => serializer.serialize_i32(5),
13679 Self::PostureViolation => serializer.serialize_i32(6),
13680 Self::ToxicCombination => serializer.serialize_i32(7),
13681 Self::SensitiveDataRisk => serializer.serialize_i32(8),
13682 Self::Chokepoint => serializer.serialize_i32(9),
13683 Self::UnknownValue(u) => u.0.serialize(serializer),
13684 }
13685 }
13686}
13687
13688impl<'de> serde::de::Deserialize<'de> for FindingClass {
13689 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13690 where
13691 D: serde::Deserializer<'de>,
13692 {
13693 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FindingClass>::new(
13694 ".google.cloud.cloudsecuritycompliance.v1.FindingClass",
13695 ))
13696 }
13697}
13698
13699/// Specifies the view of the framework compliance summary to be returned.
13700/// New values may be added in the future.
13701///
13702/// # Working with unknown values
13703///
13704/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13705/// additional enum variants at any time. Adding new variants is not considered
13706/// a breaking change. Applications should write their code in anticipation of:
13707///
13708/// - New values appearing in future releases of the client library, **and**
13709/// - New values received dynamically, without application changes.
13710///
13711/// Please consult the [Working with enums] section in the user guide for some
13712/// guidelines.
13713///
13714/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13715#[derive(Clone, Debug, PartialEq)]
13716#[non_exhaustive]
13717pub enum FrameworkComplianceSummaryView {
13718 /// The default / unset value. The API will default to the BASIC view.
13719 Unspecified,
13720 /// Includes basic compliance metadata, but omits trend data.
13721 Basic,
13722 /// Includes all information, including
13723 /// [finding_count][google.cloud.cloudsecuritycompliance.v1main.FrameworkComplianceSummary.finding_count]
13724 /// and
13725 /// [controls_passing_trend][google.cloud.cloudsecuritycompliance.v1main.FrameworkComplianceSummary.controls_passing_trend].
13726 /// Trend data is provided for the last 30 days.
13727 Full,
13728 /// If set, the enum was initialized with an unknown value.
13729 ///
13730 /// Applications can examine the value using [FrameworkComplianceSummaryView::value] or
13731 /// [FrameworkComplianceSummaryView::name].
13732 UnknownValue(framework_compliance_summary_view::UnknownValue),
13733}
13734
13735#[doc(hidden)]
13736pub mod framework_compliance_summary_view {
13737 #[allow(unused_imports)]
13738 use super::*;
13739 #[derive(Clone, Debug, PartialEq)]
13740 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13741}
13742
13743impl FrameworkComplianceSummaryView {
13744 /// Gets the enum value.
13745 ///
13746 /// Returns `None` if the enum contains an unknown value deserialized from
13747 /// the string representation of enums.
13748 pub fn value(&self) -> std::option::Option<i32> {
13749 match self {
13750 Self::Unspecified => std::option::Option::Some(0),
13751 Self::Basic => std::option::Option::Some(1),
13752 Self::Full => std::option::Option::Some(2),
13753 Self::UnknownValue(u) => u.0.value(),
13754 }
13755 }
13756
13757 /// Gets the enum value as a string.
13758 ///
13759 /// Returns `None` if the enum contains an unknown value deserialized from
13760 /// the integer representation of enums.
13761 pub fn name(&self) -> std::option::Option<&str> {
13762 match self {
13763 Self::Unspecified => {
13764 std::option::Option::Some("FRAMEWORK_COMPLIANCE_SUMMARY_VIEW_UNSPECIFIED")
13765 }
13766 Self::Basic => std::option::Option::Some("FRAMEWORK_COMPLIANCE_SUMMARY_VIEW_BASIC"),
13767 Self::Full => std::option::Option::Some("FRAMEWORK_COMPLIANCE_SUMMARY_VIEW_FULL"),
13768 Self::UnknownValue(u) => u.0.name(),
13769 }
13770 }
13771}
13772
13773impl std::default::Default for FrameworkComplianceSummaryView {
13774 fn default() -> Self {
13775 use std::convert::From;
13776 Self::from(0)
13777 }
13778}
13779
13780impl std::fmt::Display for FrameworkComplianceSummaryView {
13781 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13782 wkt::internal::display_enum(f, self.name(), self.value())
13783 }
13784}
13785
13786impl std::convert::From<i32> for FrameworkComplianceSummaryView {
13787 fn from(value: i32) -> Self {
13788 match value {
13789 0 => Self::Unspecified,
13790 1 => Self::Basic,
13791 2 => Self::Full,
13792 _ => Self::UnknownValue(framework_compliance_summary_view::UnknownValue(
13793 wkt::internal::UnknownEnumValue::Integer(value),
13794 )),
13795 }
13796 }
13797}
13798
13799impl std::convert::From<&str> for FrameworkComplianceSummaryView {
13800 fn from(value: &str) -> Self {
13801 use std::string::ToString;
13802 match value {
13803 "FRAMEWORK_COMPLIANCE_SUMMARY_VIEW_UNSPECIFIED" => Self::Unspecified,
13804 "FRAMEWORK_COMPLIANCE_SUMMARY_VIEW_BASIC" => Self::Basic,
13805 "FRAMEWORK_COMPLIANCE_SUMMARY_VIEW_FULL" => Self::Full,
13806 _ => Self::UnknownValue(framework_compliance_summary_view::UnknownValue(
13807 wkt::internal::UnknownEnumValue::String(value.to_string()),
13808 )),
13809 }
13810 }
13811}
13812
13813impl serde::ser::Serialize for FrameworkComplianceSummaryView {
13814 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13815 where
13816 S: serde::Serializer,
13817 {
13818 match self {
13819 Self::Unspecified => serializer.serialize_i32(0),
13820 Self::Basic => serializer.serialize_i32(1),
13821 Self::Full => serializer.serialize_i32(2),
13822 Self::UnknownValue(u) => u.0.serialize(serializer),
13823 }
13824 }
13825}
13826
13827impl<'de> serde::de::Deserialize<'de> for FrameworkComplianceSummaryView {
13828 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13829 where
13830 D: serde::Deserializer<'de>,
13831 {
13832 deserializer.deserialize_any(
13833 wkt::internal::EnumVisitor::<FrameworkComplianceSummaryView>::new(
13834 ".google.cloud.cloudsecuritycompliance.v1.FrameworkComplianceSummaryView",
13835 ),
13836 )
13837 }
13838}