google_cloud_securitycenter_v2/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate iam_v1;
25extern crate lazy_static;
26extern crate longrunning;
27extern crate lro;
28extern crate reqwest;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40/// Represents an access event.
41#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct Access {
44 /// Associated email, such as "foo@google.com".
45 ///
46 /// The email address of the authenticated user or a service account acting on
47 /// behalf of a third party principal making the request. For third party
48 /// identity callers, the `principal_subject` field is populated instead of
49 /// this field. For privacy reasons, the principal email address is sometimes
50 /// redacted. For more information, see [Caller identities in audit
51 /// logs](https://cloud.google.com/logging/docs/audit#user-id).
52 pub principal_email: std::string::String,
53
54 /// Caller's IP address, such as "1.1.1.1".
55 pub caller_ip: std::string::String,
56
57 /// The caller IP's geolocation, which identifies where the call came from.
58 pub caller_ip_geo: std::option::Option<crate::model::Geolocation>,
59
60 /// Type of user agent associated with the finding. For example, an operating
61 /// system shell or an embedded or standalone application.
62 pub user_agent_family: std::string::String,
63
64 /// The caller's user agent string associated with the finding.
65 pub user_agent: std::string::String,
66
67 /// This is the API service that the service account made a call to, e.g.
68 /// "iam.googleapis.com"
69 pub service_name: std::string::String,
70
71 /// The method that the service account called, e.g. "SetIamPolicy".
72 pub method_name: std::string::String,
73
74 /// A string that represents the principal_subject that is associated with the
75 /// identity. Unlike `principal_email`, `principal_subject` supports principals
76 /// that aren't associated with email addresses, such as third party
77 /// principals. For most identities, the format is
78 /// `principal://iam.googleapis.com/{identity pool name}/subject/{subject}`.
79 /// Some GKE identities, such as GKE_WORKLOAD, FREEFORM, and GKE_HUB_WORKLOAD,
80 /// still use the legacy format `serviceAccount:{identity pool
81 /// name}[{subject}]`.
82 pub principal_subject: std::string::String,
83
84 /// The name of the service account key that was used to create or exchange
85 /// credentials when authenticating the service account that made the request.
86 /// This is a scheme-less URI full resource name. For example:
87 ///
88 /// "//iam.googleapis.com/projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}".
89 pub service_account_key_name: std::string::String,
90
91 /// The identity delegation history of an authenticated service account that
92 /// made the request. The `serviceAccountDelegationInfo[]` object contains
93 /// information about the real authorities that try to access Google Cloud
94 /// resources by delegating on a service account. When multiple authorities are
95 /// present, they are guaranteed to be sorted based on the original ordering of
96 /// the identity delegation events.
97 pub service_account_delegation_info: std::vec::Vec<crate::model::ServiceAccountDelegationInfo>,
98
99 /// A string that represents a username. The username provided depends on the
100 /// type of the finding and is likely not an IAM principal. For example, this
101 /// can be a system username if the finding is related to a virtual machine, or
102 /// it can be an application login username.
103 pub user_name: std::string::String,
104
105 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
106}
107
108impl Access {
109 pub fn new() -> Self {
110 std::default::Default::default()
111 }
112
113 /// Sets the value of [principal_email][crate::model::Access::principal_email].
114 ///
115 /// # Example
116 /// ```ignore,no_run
117 /// # use google_cloud_securitycenter_v2::model::Access;
118 /// let x = Access::new().set_principal_email("example");
119 /// ```
120 pub fn set_principal_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
121 self.principal_email = v.into();
122 self
123 }
124
125 /// Sets the value of [caller_ip][crate::model::Access::caller_ip].
126 ///
127 /// # Example
128 /// ```ignore,no_run
129 /// # use google_cloud_securitycenter_v2::model::Access;
130 /// let x = Access::new().set_caller_ip("example");
131 /// ```
132 pub fn set_caller_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
133 self.caller_ip = v.into();
134 self
135 }
136
137 /// Sets the value of [caller_ip_geo][crate::model::Access::caller_ip_geo].
138 ///
139 /// # Example
140 /// ```ignore,no_run
141 /// # use google_cloud_securitycenter_v2::model::Access;
142 /// use google_cloud_securitycenter_v2::model::Geolocation;
143 /// let x = Access::new().set_caller_ip_geo(Geolocation::default()/* use setters */);
144 /// ```
145 pub fn set_caller_ip_geo<T>(mut self, v: T) -> Self
146 where
147 T: std::convert::Into<crate::model::Geolocation>,
148 {
149 self.caller_ip_geo = std::option::Option::Some(v.into());
150 self
151 }
152
153 /// Sets or clears the value of [caller_ip_geo][crate::model::Access::caller_ip_geo].
154 ///
155 /// # Example
156 /// ```ignore,no_run
157 /// # use google_cloud_securitycenter_v2::model::Access;
158 /// use google_cloud_securitycenter_v2::model::Geolocation;
159 /// let x = Access::new().set_or_clear_caller_ip_geo(Some(Geolocation::default()/* use setters */));
160 /// let x = Access::new().set_or_clear_caller_ip_geo(None::<Geolocation>);
161 /// ```
162 pub fn set_or_clear_caller_ip_geo<T>(mut self, v: std::option::Option<T>) -> Self
163 where
164 T: std::convert::Into<crate::model::Geolocation>,
165 {
166 self.caller_ip_geo = v.map(|x| x.into());
167 self
168 }
169
170 /// Sets the value of [user_agent_family][crate::model::Access::user_agent_family].
171 ///
172 /// # Example
173 /// ```ignore,no_run
174 /// # use google_cloud_securitycenter_v2::model::Access;
175 /// let x = Access::new().set_user_agent_family("example");
176 /// ```
177 pub fn set_user_agent_family<T: std::convert::Into<std::string::String>>(
178 mut self,
179 v: T,
180 ) -> Self {
181 self.user_agent_family = v.into();
182 self
183 }
184
185 /// Sets the value of [user_agent][crate::model::Access::user_agent].
186 ///
187 /// # Example
188 /// ```ignore,no_run
189 /// # use google_cloud_securitycenter_v2::model::Access;
190 /// let x = Access::new().set_user_agent("example");
191 /// ```
192 pub fn set_user_agent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
193 self.user_agent = v.into();
194 self
195 }
196
197 /// Sets the value of [service_name][crate::model::Access::service_name].
198 ///
199 /// # Example
200 /// ```ignore,no_run
201 /// # use google_cloud_securitycenter_v2::model::Access;
202 /// let x = Access::new().set_service_name("example");
203 /// ```
204 pub fn set_service_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
205 self.service_name = v.into();
206 self
207 }
208
209 /// Sets the value of [method_name][crate::model::Access::method_name].
210 ///
211 /// # Example
212 /// ```ignore,no_run
213 /// # use google_cloud_securitycenter_v2::model::Access;
214 /// let x = Access::new().set_method_name("example");
215 /// ```
216 pub fn set_method_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
217 self.method_name = v.into();
218 self
219 }
220
221 /// Sets the value of [principal_subject][crate::model::Access::principal_subject].
222 ///
223 /// # Example
224 /// ```ignore,no_run
225 /// # use google_cloud_securitycenter_v2::model::Access;
226 /// let x = Access::new().set_principal_subject("example");
227 /// ```
228 pub fn set_principal_subject<T: std::convert::Into<std::string::String>>(
229 mut self,
230 v: T,
231 ) -> Self {
232 self.principal_subject = v.into();
233 self
234 }
235
236 /// Sets the value of [service_account_key_name][crate::model::Access::service_account_key_name].
237 ///
238 /// # Example
239 /// ```ignore,no_run
240 /// # use google_cloud_securitycenter_v2::model::Access;
241 /// let x = Access::new().set_service_account_key_name("example");
242 /// ```
243 pub fn set_service_account_key_name<T: std::convert::Into<std::string::String>>(
244 mut self,
245 v: T,
246 ) -> Self {
247 self.service_account_key_name = v.into();
248 self
249 }
250
251 /// Sets the value of [service_account_delegation_info][crate::model::Access::service_account_delegation_info].
252 ///
253 /// # Example
254 /// ```ignore,no_run
255 /// # use google_cloud_securitycenter_v2::model::Access;
256 /// use google_cloud_securitycenter_v2::model::ServiceAccountDelegationInfo;
257 /// let x = Access::new()
258 /// .set_service_account_delegation_info([
259 /// ServiceAccountDelegationInfo::default()/* use setters */,
260 /// ServiceAccountDelegationInfo::default()/* use (different) setters */,
261 /// ]);
262 /// ```
263 pub fn set_service_account_delegation_info<T, V>(mut self, v: T) -> Self
264 where
265 T: std::iter::IntoIterator<Item = V>,
266 V: std::convert::Into<crate::model::ServiceAccountDelegationInfo>,
267 {
268 use std::iter::Iterator;
269 self.service_account_delegation_info = v.into_iter().map(|i| i.into()).collect();
270 self
271 }
272
273 /// Sets the value of [user_name][crate::model::Access::user_name].
274 ///
275 /// # Example
276 /// ```ignore,no_run
277 /// # use google_cloud_securitycenter_v2::model::Access;
278 /// let x = Access::new().set_user_name("example");
279 /// ```
280 pub fn set_user_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
281 self.user_name = v.into();
282 self
283 }
284}
285
286impl wkt::message::Message for Access {
287 fn typename() -> &'static str {
288 "type.googleapis.com/google.cloud.securitycenter.v2.Access"
289 }
290}
291
292/// Identity delegation history of an authenticated service account.
293#[derive(Clone, Default, PartialEq)]
294#[non_exhaustive]
295pub struct ServiceAccountDelegationInfo {
296 /// The email address of a Google account.
297 pub principal_email: std::string::String,
298
299 /// A string representing the principal_subject associated with the identity.
300 /// As compared to `principal_email`, supports principals that aren't
301 /// associated with email addresses, such as third party principals. For most
302 /// identities, the format will be `principal://iam.googleapis.com/{identity
303 /// pool name}/subjects/{subject}` except for some GKE identities
304 /// (GKE_WORKLOAD, FREEFORM, GKE_HUB_WORKLOAD) that are still in the legacy
305 /// format `serviceAccount:{identity pool name}[{subject}]`
306 pub principal_subject: std::string::String,
307
308 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
309}
310
311impl ServiceAccountDelegationInfo {
312 pub fn new() -> Self {
313 std::default::Default::default()
314 }
315
316 /// Sets the value of [principal_email][crate::model::ServiceAccountDelegationInfo::principal_email].
317 ///
318 /// # Example
319 /// ```ignore,no_run
320 /// # use google_cloud_securitycenter_v2::model::ServiceAccountDelegationInfo;
321 /// let x = ServiceAccountDelegationInfo::new().set_principal_email("example");
322 /// ```
323 pub fn set_principal_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
324 self.principal_email = v.into();
325 self
326 }
327
328 /// Sets the value of [principal_subject][crate::model::ServiceAccountDelegationInfo::principal_subject].
329 ///
330 /// # Example
331 /// ```ignore,no_run
332 /// # use google_cloud_securitycenter_v2::model::ServiceAccountDelegationInfo;
333 /// let x = ServiceAccountDelegationInfo::new().set_principal_subject("example");
334 /// ```
335 pub fn set_principal_subject<T: std::convert::Into<std::string::String>>(
336 mut self,
337 v: T,
338 ) -> Self {
339 self.principal_subject = v.into();
340 self
341 }
342}
343
344impl wkt::message::Message for ServiceAccountDelegationInfo {
345 fn typename() -> &'static str {
346 "type.googleapis.com/google.cloud.securitycenter.v2.ServiceAccountDelegationInfo"
347 }
348}
349
350/// Represents a geographical location for a given access.
351#[derive(Clone, Default, PartialEq)]
352#[non_exhaustive]
353pub struct Geolocation {
354 /// A CLDR.
355 pub region_code: std::string::String,
356
357 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
358}
359
360impl Geolocation {
361 pub fn new() -> Self {
362 std::default::Default::default()
363 }
364
365 /// Sets the value of [region_code][crate::model::Geolocation::region_code].
366 ///
367 /// # Example
368 /// ```ignore,no_run
369 /// # use google_cloud_securitycenter_v2::model::Geolocation;
370 /// let x = Geolocation::new().set_region_code("example");
371 /// ```
372 pub fn set_region_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
373 self.region_code = v.into();
374 self
375 }
376}
377
378impl wkt::message::Message for Geolocation {
379 fn typename() -> &'static str {
380 "type.googleapis.com/google.cloud.securitycenter.v2.Geolocation"
381 }
382}
383
384/// Details about resources affected by this finding.
385#[derive(Clone, Default, PartialEq)]
386#[non_exhaustive]
387pub struct AffectedResources {
388 /// The count of resources affected by the finding.
389 pub count: i64,
390
391 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
392}
393
394impl AffectedResources {
395 pub fn new() -> Self {
396 std::default::Default::default()
397 }
398
399 /// Sets the value of [count][crate::model::AffectedResources::count].
400 ///
401 /// # Example
402 /// ```ignore,no_run
403 /// # use google_cloud_securitycenter_v2::model::AffectedResources;
404 /// let x = AffectedResources::new().set_count(42);
405 /// ```
406 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
407 self.count = v.into();
408 self
409 }
410}
411
412impl wkt::message::Message for AffectedResources {
413 fn typename() -> &'static str {
414 "type.googleapis.com/google.cloud.securitycenter.v2.AffectedResources"
415 }
416}
417
418/// Contains information about the AI model associated with the finding.
419#[derive(Clone, Default, PartialEq)]
420#[non_exhaustive]
421pub struct AiModel {
422 /// The name of the AI model, for example, "gemini:1.0.0".
423 pub name: std::string::String,
424
425 /// The domain of the model, for example, “image-classification”.
426 pub domain: std::string::String,
427
428 /// The name of the model library, for example, “transformers”.
429 pub library: std::string::String,
430
431 /// The region in which the model is used, for example, “us-central1”.
432 pub location: std::string::String,
433
434 /// The publisher of the model, for example, “google” or “nvidia”.
435 pub publisher: std::string::String,
436
437 /// The platform on which the model is deployed.
438 pub deployment_platform: crate::model::ai_model::DeploymentPlatform,
439
440 /// The user defined display name of model. Ex. baseline-classification-model
441 pub display_name: std::string::String,
442
443 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
444}
445
446impl AiModel {
447 pub fn new() -> Self {
448 std::default::Default::default()
449 }
450
451 /// Sets the value of [name][crate::model::AiModel::name].
452 ///
453 /// # Example
454 /// ```ignore,no_run
455 /// # use google_cloud_securitycenter_v2::model::AiModel;
456 /// let x = AiModel::new().set_name("example");
457 /// ```
458 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
459 self.name = v.into();
460 self
461 }
462
463 /// Sets the value of [domain][crate::model::AiModel::domain].
464 ///
465 /// # Example
466 /// ```ignore,no_run
467 /// # use google_cloud_securitycenter_v2::model::AiModel;
468 /// let x = AiModel::new().set_domain("example");
469 /// ```
470 pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
471 self.domain = v.into();
472 self
473 }
474
475 /// Sets the value of [library][crate::model::AiModel::library].
476 ///
477 /// # Example
478 /// ```ignore,no_run
479 /// # use google_cloud_securitycenter_v2::model::AiModel;
480 /// let x = AiModel::new().set_library("example");
481 /// ```
482 pub fn set_library<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
483 self.library = v.into();
484 self
485 }
486
487 /// Sets the value of [location][crate::model::AiModel::location].
488 ///
489 /// # Example
490 /// ```ignore,no_run
491 /// # use google_cloud_securitycenter_v2::model::AiModel;
492 /// let x = AiModel::new().set_location("example");
493 /// ```
494 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
495 self.location = v.into();
496 self
497 }
498
499 /// Sets the value of [publisher][crate::model::AiModel::publisher].
500 ///
501 /// # Example
502 /// ```ignore,no_run
503 /// # use google_cloud_securitycenter_v2::model::AiModel;
504 /// let x = AiModel::new().set_publisher("example");
505 /// ```
506 pub fn set_publisher<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
507 self.publisher = v.into();
508 self
509 }
510
511 /// Sets the value of [deployment_platform][crate::model::AiModel::deployment_platform].
512 ///
513 /// # Example
514 /// ```ignore,no_run
515 /// # use google_cloud_securitycenter_v2::model::AiModel;
516 /// use google_cloud_securitycenter_v2::model::ai_model::DeploymentPlatform;
517 /// let x0 = AiModel::new().set_deployment_platform(DeploymentPlatform::VertexAi);
518 /// let x1 = AiModel::new().set_deployment_platform(DeploymentPlatform::Gke);
519 /// let x2 = AiModel::new().set_deployment_platform(DeploymentPlatform::Gce);
520 /// ```
521 pub fn set_deployment_platform<
522 T: std::convert::Into<crate::model::ai_model::DeploymentPlatform>,
523 >(
524 mut self,
525 v: T,
526 ) -> Self {
527 self.deployment_platform = v.into();
528 self
529 }
530
531 /// Sets the value of [display_name][crate::model::AiModel::display_name].
532 ///
533 /// # Example
534 /// ```ignore,no_run
535 /// # use google_cloud_securitycenter_v2::model::AiModel;
536 /// let x = AiModel::new().set_display_name("example");
537 /// ```
538 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
539 self.display_name = v.into();
540 self
541 }
542}
543
544impl wkt::message::Message for AiModel {
545 fn typename() -> &'static str {
546 "type.googleapis.com/google.cloud.securitycenter.v2.AiModel"
547 }
548}
549
550/// Defines additional types related to [AiModel].
551pub mod ai_model {
552 #[allow(unused_imports)]
553 use super::*;
554
555 /// The platform on which the model is deployed.
556 ///
557 /// # Working with unknown values
558 ///
559 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
560 /// additional enum variants at any time. Adding new variants is not considered
561 /// a breaking change. Applications should write their code in anticipation of:
562 ///
563 /// - New values appearing in future releases of the client library, **and**
564 /// - New values received dynamically, without application changes.
565 ///
566 /// Please consult the [Working with enums] section in the user guide for some
567 /// guidelines.
568 ///
569 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
570 #[derive(Clone, Debug, PartialEq)]
571 #[non_exhaustive]
572 pub enum DeploymentPlatform {
573 /// Unspecified deployment platform.
574 Unspecified,
575 /// Vertex AI.
576 VertexAi,
577 /// Google Kubernetes Engine.
578 Gke,
579 /// Google Compute Engine.
580 Gce,
581 /// Fine tuned model.
582 FineTunedModel,
583 /// If set, the enum was initialized with an unknown value.
584 ///
585 /// Applications can examine the value using [DeploymentPlatform::value] or
586 /// [DeploymentPlatform::name].
587 UnknownValue(deployment_platform::UnknownValue),
588 }
589
590 #[doc(hidden)]
591 pub mod deployment_platform {
592 #[allow(unused_imports)]
593 use super::*;
594 #[derive(Clone, Debug, PartialEq)]
595 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
596 }
597
598 impl DeploymentPlatform {
599 /// Gets the enum value.
600 ///
601 /// Returns `None` if the enum contains an unknown value deserialized from
602 /// the string representation of enums.
603 pub fn value(&self) -> std::option::Option<i32> {
604 match self {
605 Self::Unspecified => std::option::Option::Some(0),
606 Self::VertexAi => std::option::Option::Some(1),
607 Self::Gke => std::option::Option::Some(2),
608 Self::Gce => std::option::Option::Some(3),
609 Self::FineTunedModel => std::option::Option::Some(4),
610 Self::UnknownValue(u) => u.0.value(),
611 }
612 }
613
614 /// Gets the enum value as a string.
615 ///
616 /// Returns `None` if the enum contains an unknown value deserialized from
617 /// the integer representation of enums.
618 pub fn name(&self) -> std::option::Option<&str> {
619 match self {
620 Self::Unspecified => std::option::Option::Some("DEPLOYMENT_PLATFORM_UNSPECIFIED"),
621 Self::VertexAi => std::option::Option::Some("VERTEX_AI"),
622 Self::Gke => std::option::Option::Some("GKE"),
623 Self::Gce => std::option::Option::Some("GCE"),
624 Self::FineTunedModel => std::option::Option::Some("FINE_TUNED_MODEL"),
625 Self::UnknownValue(u) => u.0.name(),
626 }
627 }
628 }
629
630 impl std::default::Default for DeploymentPlatform {
631 fn default() -> Self {
632 use std::convert::From;
633 Self::from(0)
634 }
635 }
636
637 impl std::fmt::Display for DeploymentPlatform {
638 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
639 wkt::internal::display_enum(f, self.name(), self.value())
640 }
641 }
642
643 impl std::convert::From<i32> for DeploymentPlatform {
644 fn from(value: i32) -> Self {
645 match value {
646 0 => Self::Unspecified,
647 1 => Self::VertexAi,
648 2 => Self::Gke,
649 3 => Self::Gce,
650 4 => Self::FineTunedModel,
651 _ => Self::UnknownValue(deployment_platform::UnknownValue(
652 wkt::internal::UnknownEnumValue::Integer(value),
653 )),
654 }
655 }
656 }
657
658 impl std::convert::From<&str> for DeploymentPlatform {
659 fn from(value: &str) -> Self {
660 use std::string::ToString;
661 match value {
662 "DEPLOYMENT_PLATFORM_UNSPECIFIED" => Self::Unspecified,
663 "VERTEX_AI" => Self::VertexAi,
664 "GKE" => Self::Gke,
665 "GCE" => Self::Gce,
666 "FINE_TUNED_MODEL" => Self::FineTunedModel,
667 _ => Self::UnknownValue(deployment_platform::UnknownValue(
668 wkt::internal::UnknownEnumValue::String(value.to_string()),
669 )),
670 }
671 }
672 }
673
674 impl serde::ser::Serialize for DeploymentPlatform {
675 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
676 where
677 S: serde::Serializer,
678 {
679 match self {
680 Self::Unspecified => serializer.serialize_i32(0),
681 Self::VertexAi => serializer.serialize_i32(1),
682 Self::Gke => serializer.serialize_i32(2),
683 Self::Gce => serializer.serialize_i32(3),
684 Self::FineTunedModel => serializer.serialize_i32(4),
685 Self::UnknownValue(u) => u.0.serialize(serializer),
686 }
687 }
688 }
689
690 impl<'de> serde::de::Deserialize<'de> for DeploymentPlatform {
691 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
692 where
693 D: serde::Deserializer<'de>,
694 {
695 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeploymentPlatform>::new(
696 ".google.cloud.securitycenter.v2.AiModel.DeploymentPlatform",
697 ))
698 }
699 }
700}
701
702/// Represents an application associated with a finding.
703#[derive(Clone, Default, PartialEq)]
704#[non_exhaustive]
705pub struct Application {
706 /// The base URI that identifies the network location of the application in
707 /// which the vulnerability was detected. For example, `<http://example.com>`.
708 pub base_uri: std::string::String,
709
710 /// The full URI with payload that could be used to reproduce the
711 /// vulnerability. For example, `<http://example.com>?p=aMmYgI6H`.
712 pub full_uri: std::string::String,
713
714 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
715}
716
717impl Application {
718 pub fn new() -> Self {
719 std::default::Default::default()
720 }
721
722 /// Sets the value of [base_uri][crate::model::Application::base_uri].
723 ///
724 /// # Example
725 /// ```ignore,no_run
726 /// # use google_cloud_securitycenter_v2::model::Application;
727 /// let x = Application::new().set_base_uri("example");
728 /// ```
729 pub fn set_base_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
730 self.base_uri = v.into();
731 self
732 }
733
734 /// Sets the value of [full_uri][crate::model::Application::full_uri].
735 ///
736 /// # Example
737 /// ```ignore,no_run
738 /// # use google_cloud_securitycenter_v2::model::Application;
739 /// let x = Application::new().set_full_uri("example");
740 /// ```
741 pub fn set_full_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
742 self.full_uri = v.into();
743 self
744 }
745}
746
747impl wkt::message::Message for Application {
748 fn typename() -> &'static str {
749 "type.googleapis.com/google.cloud.securitycenter.v2.Application"
750 }
751}
752
753/// An attack exposure contains the results of an attack path simulation run.
754#[derive(Clone, Default, PartialEq)]
755#[non_exhaustive]
756pub struct AttackExposure {
757 /// A number between 0 (inclusive) and infinity that represents how important
758 /// this finding is to remediate. The higher the score, the more important it
759 /// is to remediate.
760 pub score: f64,
761
762 /// The most recent time the attack exposure was updated on this finding.
763 pub latest_calculation_time: std::option::Option<wkt::Timestamp>,
764
765 /// The resource name of the attack path simulation result that contains the
766 /// details regarding this attack exposure score.
767 /// Example: `organizations/123/simulations/456/attackExposureResults/789`
768 pub attack_exposure_result: std::string::String,
769
770 /// Output only. What state this AttackExposure is in. This captures whether or
771 /// not an attack exposure has been calculated or not.
772 pub state: crate::model::attack_exposure::State,
773
774 /// The number of high value resources that are exposed as a result of this
775 /// finding.
776 pub exposed_high_value_resources_count: i32,
777
778 /// The number of medium value resources that are exposed as a result of this
779 /// finding.
780 pub exposed_medium_value_resources_count: i32,
781
782 /// The number of high value resources that are exposed as a result of this
783 /// finding.
784 pub exposed_low_value_resources_count: i32,
785
786 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
787}
788
789impl AttackExposure {
790 pub fn new() -> Self {
791 std::default::Default::default()
792 }
793
794 /// Sets the value of [score][crate::model::AttackExposure::score].
795 ///
796 /// # Example
797 /// ```ignore,no_run
798 /// # use google_cloud_securitycenter_v2::model::AttackExposure;
799 /// let x = AttackExposure::new().set_score(42.0);
800 /// ```
801 pub fn set_score<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
802 self.score = v.into();
803 self
804 }
805
806 /// Sets the value of [latest_calculation_time][crate::model::AttackExposure::latest_calculation_time].
807 ///
808 /// # Example
809 /// ```ignore,no_run
810 /// # use google_cloud_securitycenter_v2::model::AttackExposure;
811 /// use wkt::Timestamp;
812 /// let x = AttackExposure::new().set_latest_calculation_time(Timestamp::default()/* use setters */);
813 /// ```
814 pub fn set_latest_calculation_time<T>(mut self, v: T) -> Self
815 where
816 T: std::convert::Into<wkt::Timestamp>,
817 {
818 self.latest_calculation_time = std::option::Option::Some(v.into());
819 self
820 }
821
822 /// Sets or clears the value of [latest_calculation_time][crate::model::AttackExposure::latest_calculation_time].
823 ///
824 /// # Example
825 /// ```ignore,no_run
826 /// # use google_cloud_securitycenter_v2::model::AttackExposure;
827 /// use wkt::Timestamp;
828 /// let x = AttackExposure::new().set_or_clear_latest_calculation_time(Some(Timestamp::default()/* use setters */));
829 /// let x = AttackExposure::new().set_or_clear_latest_calculation_time(None::<Timestamp>);
830 /// ```
831 pub fn set_or_clear_latest_calculation_time<T>(mut self, v: std::option::Option<T>) -> Self
832 where
833 T: std::convert::Into<wkt::Timestamp>,
834 {
835 self.latest_calculation_time = v.map(|x| x.into());
836 self
837 }
838
839 /// Sets the value of [attack_exposure_result][crate::model::AttackExposure::attack_exposure_result].
840 ///
841 /// # Example
842 /// ```ignore,no_run
843 /// # use google_cloud_securitycenter_v2::model::AttackExposure;
844 /// let x = AttackExposure::new().set_attack_exposure_result("example");
845 /// ```
846 pub fn set_attack_exposure_result<T: std::convert::Into<std::string::String>>(
847 mut self,
848 v: T,
849 ) -> Self {
850 self.attack_exposure_result = v.into();
851 self
852 }
853
854 /// Sets the value of [state][crate::model::AttackExposure::state].
855 ///
856 /// # Example
857 /// ```ignore,no_run
858 /// # use google_cloud_securitycenter_v2::model::AttackExposure;
859 /// use google_cloud_securitycenter_v2::model::attack_exposure::State;
860 /// let x0 = AttackExposure::new().set_state(State::Calculated);
861 /// let x1 = AttackExposure::new().set_state(State::NotCalculated);
862 /// ```
863 pub fn set_state<T: std::convert::Into<crate::model::attack_exposure::State>>(
864 mut self,
865 v: T,
866 ) -> Self {
867 self.state = v.into();
868 self
869 }
870
871 /// Sets the value of [exposed_high_value_resources_count][crate::model::AttackExposure::exposed_high_value_resources_count].
872 ///
873 /// # Example
874 /// ```ignore,no_run
875 /// # use google_cloud_securitycenter_v2::model::AttackExposure;
876 /// let x = AttackExposure::new().set_exposed_high_value_resources_count(42);
877 /// ```
878 pub fn set_exposed_high_value_resources_count<T: std::convert::Into<i32>>(
879 mut self,
880 v: T,
881 ) -> Self {
882 self.exposed_high_value_resources_count = v.into();
883 self
884 }
885
886 /// Sets the value of [exposed_medium_value_resources_count][crate::model::AttackExposure::exposed_medium_value_resources_count].
887 ///
888 /// # Example
889 /// ```ignore,no_run
890 /// # use google_cloud_securitycenter_v2::model::AttackExposure;
891 /// let x = AttackExposure::new().set_exposed_medium_value_resources_count(42);
892 /// ```
893 pub fn set_exposed_medium_value_resources_count<T: std::convert::Into<i32>>(
894 mut self,
895 v: T,
896 ) -> Self {
897 self.exposed_medium_value_resources_count = v.into();
898 self
899 }
900
901 /// Sets the value of [exposed_low_value_resources_count][crate::model::AttackExposure::exposed_low_value_resources_count].
902 ///
903 /// # Example
904 /// ```ignore,no_run
905 /// # use google_cloud_securitycenter_v2::model::AttackExposure;
906 /// let x = AttackExposure::new().set_exposed_low_value_resources_count(42);
907 /// ```
908 pub fn set_exposed_low_value_resources_count<T: std::convert::Into<i32>>(
909 mut self,
910 v: T,
911 ) -> Self {
912 self.exposed_low_value_resources_count = v.into();
913 self
914 }
915}
916
917impl wkt::message::Message for AttackExposure {
918 fn typename() -> &'static str {
919 "type.googleapis.com/google.cloud.securitycenter.v2.AttackExposure"
920 }
921}
922
923/// Defines additional types related to [AttackExposure].
924pub mod attack_exposure {
925 #[allow(unused_imports)]
926 use super::*;
927
928 /// This enum defines the various states an AttackExposure can be in.
929 ///
930 /// # Working with unknown values
931 ///
932 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
933 /// additional enum variants at any time. Adding new variants is not considered
934 /// a breaking change. Applications should write their code in anticipation of:
935 ///
936 /// - New values appearing in future releases of the client library, **and**
937 /// - New values received dynamically, without application changes.
938 ///
939 /// Please consult the [Working with enums] section in the user guide for some
940 /// guidelines.
941 ///
942 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
943 #[derive(Clone, Debug, PartialEq)]
944 #[non_exhaustive]
945 pub enum State {
946 /// The state is not specified.
947 Unspecified,
948 /// The attack exposure has been calculated.
949 Calculated,
950 /// The attack exposure has not been calculated.
951 NotCalculated,
952 /// If set, the enum was initialized with an unknown value.
953 ///
954 /// Applications can examine the value using [State::value] or
955 /// [State::name].
956 UnknownValue(state::UnknownValue),
957 }
958
959 #[doc(hidden)]
960 pub mod state {
961 #[allow(unused_imports)]
962 use super::*;
963 #[derive(Clone, Debug, PartialEq)]
964 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
965 }
966
967 impl State {
968 /// Gets the enum value.
969 ///
970 /// Returns `None` if the enum contains an unknown value deserialized from
971 /// the string representation of enums.
972 pub fn value(&self) -> std::option::Option<i32> {
973 match self {
974 Self::Unspecified => std::option::Option::Some(0),
975 Self::Calculated => std::option::Option::Some(1),
976 Self::NotCalculated => std::option::Option::Some(2),
977 Self::UnknownValue(u) => u.0.value(),
978 }
979 }
980
981 /// Gets the enum value as a string.
982 ///
983 /// Returns `None` if the enum contains an unknown value deserialized from
984 /// the integer representation of enums.
985 pub fn name(&self) -> std::option::Option<&str> {
986 match self {
987 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
988 Self::Calculated => std::option::Option::Some("CALCULATED"),
989 Self::NotCalculated => std::option::Option::Some("NOT_CALCULATED"),
990 Self::UnknownValue(u) => u.0.name(),
991 }
992 }
993 }
994
995 impl std::default::Default for State {
996 fn default() -> Self {
997 use std::convert::From;
998 Self::from(0)
999 }
1000 }
1001
1002 impl std::fmt::Display for State {
1003 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1004 wkt::internal::display_enum(f, self.name(), self.value())
1005 }
1006 }
1007
1008 impl std::convert::From<i32> for State {
1009 fn from(value: i32) -> Self {
1010 match value {
1011 0 => Self::Unspecified,
1012 1 => Self::Calculated,
1013 2 => Self::NotCalculated,
1014 _ => Self::UnknownValue(state::UnknownValue(
1015 wkt::internal::UnknownEnumValue::Integer(value),
1016 )),
1017 }
1018 }
1019 }
1020
1021 impl std::convert::From<&str> for State {
1022 fn from(value: &str) -> Self {
1023 use std::string::ToString;
1024 match value {
1025 "STATE_UNSPECIFIED" => Self::Unspecified,
1026 "CALCULATED" => Self::Calculated,
1027 "NOT_CALCULATED" => Self::NotCalculated,
1028 _ => Self::UnknownValue(state::UnknownValue(
1029 wkt::internal::UnknownEnumValue::String(value.to_string()),
1030 )),
1031 }
1032 }
1033 }
1034
1035 impl serde::ser::Serialize for State {
1036 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1037 where
1038 S: serde::Serializer,
1039 {
1040 match self {
1041 Self::Unspecified => serializer.serialize_i32(0),
1042 Self::Calculated => serializer.serialize_i32(1),
1043 Self::NotCalculated => serializer.serialize_i32(2),
1044 Self::UnknownValue(u) => u.0.serialize(serializer),
1045 }
1046 }
1047 }
1048
1049 impl<'de> serde::de::Deserialize<'de> for State {
1050 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1051 where
1052 D: serde::Deserializer<'de>,
1053 {
1054 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1055 ".google.cloud.securitycenter.v2.AttackExposure.State",
1056 ))
1057 }
1058 }
1059}
1060
1061/// A path that an attacker could take to reach an exposed resource.
1062#[derive(Clone, Default, PartialEq)]
1063#[non_exhaustive]
1064pub struct AttackPath {
1065 /// The attack path name, for example,
1066 /// `organizations/12/simulations/34/valuedResources/56/attackPaths/78`
1067 pub name: std::string::String,
1068
1069 /// A list of nodes that exist in this attack path.
1070 pub path_nodes: std::vec::Vec<crate::model::attack_path::AttackPathNode>,
1071
1072 /// A list of the edges between nodes in this attack path.
1073 pub edges: std::vec::Vec<crate::model::attack_path::AttackPathEdge>,
1074
1075 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1076}
1077
1078impl AttackPath {
1079 pub fn new() -> Self {
1080 std::default::Default::default()
1081 }
1082
1083 /// Sets the value of [name][crate::model::AttackPath::name].
1084 ///
1085 /// # Example
1086 /// ```ignore,no_run
1087 /// # use google_cloud_securitycenter_v2::model::AttackPath;
1088 /// let x = AttackPath::new().set_name("example");
1089 /// ```
1090 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1091 self.name = v.into();
1092 self
1093 }
1094
1095 /// Sets the value of [path_nodes][crate::model::AttackPath::path_nodes].
1096 ///
1097 /// # Example
1098 /// ```ignore,no_run
1099 /// # use google_cloud_securitycenter_v2::model::AttackPath;
1100 /// use google_cloud_securitycenter_v2::model::attack_path::AttackPathNode;
1101 /// let x = AttackPath::new()
1102 /// .set_path_nodes([
1103 /// AttackPathNode::default()/* use setters */,
1104 /// AttackPathNode::default()/* use (different) setters */,
1105 /// ]);
1106 /// ```
1107 pub fn set_path_nodes<T, V>(mut self, v: T) -> Self
1108 where
1109 T: std::iter::IntoIterator<Item = V>,
1110 V: std::convert::Into<crate::model::attack_path::AttackPathNode>,
1111 {
1112 use std::iter::Iterator;
1113 self.path_nodes = v.into_iter().map(|i| i.into()).collect();
1114 self
1115 }
1116
1117 /// Sets the value of [edges][crate::model::AttackPath::edges].
1118 ///
1119 /// # Example
1120 /// ```ignore,no_run
1121 /// # use google_cloud_securitycenter_v2::model::AttackPath;
1122 /// use google_cloud_securitycenter_v2::model::attack_path::AttackPathEdge;
1123 /// let x = AttackPath::new()
1124 /// .set_edges([
1125 /// AttackPathEdge::default()/* use setters */,
1126 /// AttackPathEdge::default()/* use (different) setters */,
1127 /// ]);
1128 /// ```
1129 pub fn set_edges<T, V>(mut self, v: T) -> Self
1130 where
1131 T: std::iter::IntoIterator<Item = V>,
1132 V: std::convert::Into<crate::model::attack_path::AttackPathEdge>,
1133 {
1134 use std::iter::Iterator;
1135 self.edges = v.into_iter().map(|i| i.into()).collect();
1136 self
1137 }
1138}
1139
1140impl wkt::message::Message for AttackPath {
1141 fn typename() -> &'static str {
1142 "type.googleapis.com/google.cloud.securitycenter.v2.AttackPath"
1143 }
1144}
1145
1146/// Defines additional types related to [AttackPath].
1147pub mod attack_path {
1148 #[allow(unused_imports)]
1149 use super::*;
1150
1151 /// Represents one point that an attacker passes through in this attack path.
1152 #[derive(Clone, Default, PartialEq)]
1153 #[non_exhaustive]
1154 pub struct AttackPathNode {
1155 /// The name of the resource at this point in the attack path.
1156 /// The format of the name follows the Cloud Asset Inventory [resource
1157 /// name
1158 /// format](https://cloud.google.com/asset-inventory/docs/resource-name-format)
1159 pub resource: std::string::String,
1160
1161 /// The [supported resource
1162 /// type](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
1163 pub resource_type: std::string::String,
1164
1165 /// Human-readable name of this resource.
1166 pub display_name: std::string::String,
1167
1168 /// The findings associated with this node in the attack path.
1169 pub associated_findings:
1170 std::vec::Vec<crate::model::attack_path::attack_path_node::PathNodeAssociatedFinding>,
1171
1172 /// Unique id of the attack path node.
1173 pub uuid: std::string::String,
1174
1175 /// A list of attack step nodes that exist in this attack path node.
1176 pub attack_steps:
1177 std::vec::Vec<crate::model::attack_path::attack_path_node::AttackStepNode>,
1178
1179 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1180 }
1181
1182 impl AttackPathNode {
1183 pub fn new() -> Self {
1184 std::default::Default::default()
1185 }
1186
1187 /// Sets the value of [resource][crate::model::attack_path::AttackPathNode::resource].
1188 ///
1189 /// # Example
1190 /// ```ignore,no_run
1191 /// # use google_cloud_securitycenter_v2::model::attack_path::AttackPathNode;
1192 /// let x = AttackPathNode::new().set_resource("example");
1193 /// ```
1194 pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1195 self.resource = v.into();
1196 self
1197 }
1198
1199 /// Sets the value of [resource_type][crate::model::attack_path::AttackPathNode::resource_type].
1200 ///
1201 /// # Example
1202 /// ```ignore,no_run
1203 /// # use google_cloud_securitycenter_v2::model::attack_path::AttackPathNode;
1204 /// let x = AttackPathNode::new().set_resource_type("example");
1205 /// ```
1206 pub fn set_resource_type<T: std::convert::Into<std::string::String>>(
1207 mut self,
1208 v: T,
1209 ) -> Self {
1210 self.resource_type = v.into();
1211 self
1212 }
1213
1214 /// Sets the value of [display_name][crate::model::attack_path::AttackPathNode::display_name].
1215 ///
1216 /// # Example
1217 /// ```ignore,no_run
1218 /// # use google_cloud_securitycenter_v2::model::attack_path::AttackPathNode;
1219 /// let x = AttackPathNode::new().set_display_name("example");
1220 /// ```
1221 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
1222 mut self,
1223 v: T,
1224 ) -> Self {
1225 self.display_name = v.into();
1226 self
1227 }
1228
1229 /// Sets the value of [associated_findings][crate::model::attack_path::AttackPathNode::associated_findings].
1230 ///
1231 /// # Example
1232 /// ```ignore,no_run
1233 /// # use google_cloud_securitycenter_v2::model::attack_path::AttackPathNode;
1234 /// use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::PathNodeAssociatedFinding;
1235 /// let x = AttackPathNode::new()
1236 /// .set_associated_findings([
1237 /// PathNodeAssociatedFinding::default()/* use setters */,
1238 /// PathNodeAssociatedFinding::default()/* use (different) setters */,
1239 /// ]);
1240 /// ```
1241 pub fn set_associated_findings<T, V>(mut self, v: T) -> Self
1242 where
1243 T: std::iter::IntoIterator<Item = V>,
1244 V: std::convert::Into<
1245 crate::model::attack_path::attack_path_node::PathNodeAssociatedFinding,
1246 >,
1247 {
1248 use std::iter::Iterator;
1249 self.associated_findings = v.into_iter().map(|i| i.into()).collect();
1250 self
1251 }
1252
1253 /// Sets the value of [uuid][crate::model::attack_path::AttackPathNode::uuid].
1254 ///
1255 /// # Example
1256 /// ```ignore,no_run
1257 /// # use google_cloud_securitycenter_v2::model::attack_path::AttackPathNode;
1258 /// let x = AttackPathNode::new().set_uuid("example");
1259 /// ```
1260 pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1261 self.uuid = v.into();
1262 self
1263 }
1264
1265 /// Sets the value of [attack_steps][crate::model::attack_path::AttackPathNode::attack_steps].
1266 ///
1267 /// # Example
1268 /// ```ignore,no_run
1269 /// # use google_cloud_securitycenter_v2::model::attack_path::AttackPathNode;
1270 /// use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::AttackStepNode;
1271 /// let x = AttackPathNode::new()
1272 /// .set_attack_steps([
1273 /// AttackStepNode::default()/* use setters */,
1274 /// AttackStepNode::default()/* use (different) setters */,
1275 /// ]);
1276 /// ```
1277 pub fn set_attack_steps<T, V>(mut self, v: T) -> Self
1278 where
1279 T: std::iter::IntoIterator<Item = V>,
1280 V: std::convert::Into<crate::model::attack_path::attack_path_node::AttackStepNode>,
1281 {
1282 use std::iter::Iterator;
1283 self.attack_steps = v.into_iter().map(|i| i.into()).collect();
1284 self
1285 }
1286 }
1287
1288 impl wkt::message::Message for AttackPathNode {
1289 fn typename() -> &'static str {
1290 "type.googleapis.com/google.cloud.securitycenter.v2.AttackPath.AttackPathNode"
1291 }
1292 }
1293
1294 /// Defines additional types related to [AttackPathNode].
1295 pub mod attack_path_node {
1296 #[allow(unused_imports)]
1297 use super::*;
1298
1299 /// A finding that is associated with this node in the attack path.
1300 #[derive(Clone, Default, PartialEq)]
1301 #[non_exhaustive]
1302 pub struct PathNodeAssociatedFinding {
1303 /// Canonical name of the associated findings. Example:
1304 /// `organizations/123/sources/456/findings/789`
1305 pub canonical_finding: std::string::String,
1306
1307 /// The additional taxonomy group within findings from a given source.
1308 pub finding_category: std::string::String,
1309
1310 /// Full resource name of the finding.
1311 pub name: std::string::String,
1312
1313 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1314 }
1315
1316 impl PathNodeAssociatedFinding {
1317 pub fn new() -> Self {
1318 std::default::Default::default()
1319 }
1320
1321 /// Sets the value of [canonical_finding][crate::model::attack_path::attack_path_node::PathNodeAssociatedFinding::canonical_finding].
1322 ///
1323 /// # Example
1324 /// ```ignore,no_run
1325 /// # use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::PathNodeAssociatedFinding;
1326 /// let x = PathNodeAssociatedFinding::new().set_canonical_finding("example");
1327 /// ```
1328 pub fn set_canonical_finding<T: std::convert::Into<std::string::String>>(
1329 mut self,
1330 v: T,
1331 ) -> Self {
1332 self.canonical_finding = v.into();
1333 self
1334 }
1335
1336 /// Sets the value of [finding_category][crate::model::attack_path::attack_path_node::PathNodeAssociatedFinding::finding_category].
1337 ///
1338 /// # Example
1339 /// ```ignore,no_run
1340 /// # use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::PathNodeAssociatedFinding;
1341 /// let x = PathNodeAssociatedFinding::new().set_finding_category("example");
1342 /// ```
1343 pub fn set_finding_category<T: std::convert::Into<std::string::String>>(
1344 mut self,
1345 v: T,
1346 ) -> Self {
1347 self.finding_category = v.into();
1348 self
1349 }
1350
1351 /// Sets the value of [name][crate::model::attack_path::attack_path_node::PathNodeAssociatedFinding::name].
1352 ///
1353 /// # Example
1354 /// ```ignore,no_run
1355 /// # use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::PathNodeAssociatedFinding;
1356 /// let x = PathNodeAssociatedFinding::new().set_name("example");
1357 /// ```
1358 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1359 self.name = v.into();
1360 self
1361 }
1362 }
1363
1364 impl wkt::message::Message for PathNodeAssociatedFinding {
1365 fn typename() -> &'static str {
1366 "type.googleapis.com/google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding"
1367 }
1368 }
1369
1370 /// Detailed steps the attack can take between path nodes.
1371 #[derive(Clone, Default, PartialEq)]
1372 #[non_exhaustive]
1373 pub struct AttackStepNode {
1374 /// Unique ID for one Node
1375 pub uuid: std::string::String,
1376
1377 /// Attack step type. Can be either AND, OR or DEFENSE
1378 pub r#type: crate::model::attack_path::attack_path_node::NodeType,
1379
1380 /// User friendly name of the attack step
1381 pub display_name: std::string::String,
1382
1383 /// Attack step labels for metadata
1384 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1385
1386 /// Attack step description
1387 pub description: std::string::String,
1388
1389 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1390 }
1391
1392 impl AttackStepNode {
1393 pub fn new() -> Self {
1394 std::default::Default::default()
1395 }
1396
1397 /// Sets the value of [uuid][crate::model::attack_path::attack_path_node::AttackStepNode::uuid].
1398 ///
1399 /// # Example
1400 /// ```ignore,no_run
1401 /// # use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::AttackStepNode;
1402 /// let x = AttackStepNode::new().set_uuid("example");
1403 /// ```
1404 pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1405 self.uuid = v.into();
1406 self
1407 }
1408
1409 /// Sets the value of [r#type][crate::model::attack_path::attack_path_node::AttackStepNode::type].
1410 ///
1411 /// # Example
1412 /// ```ignore,no_run
1413 /// # use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::AttackStepNode;
1414 /// use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::NodeType;
1415 /// let x0 = AttackStepNode::new().set_type(NodeType::And);
1416 /// let x1 = AttackStepNode::new().set_type(NodeType::Or);
1417 /// let x2 = AttackStepNode::new().set_type(NodeType::Defense);
1418 /// ```
1419 pub fn set_type<
1420 T: std::convert::Into<crate::model::attack_path::attack_path_node::NodeType>,
1421 >(
1422 mut self,
1423 v: T,
1424 ) -> Self {
1425 self.r#type = v.into();
1426 self
1427 }
1428
1429 /// Sets the value of [display_name][crate::model::attack_path::attack_path_node::AttackStepNode::display_name].
1430 ///
1431 /// # Example
1432 /// ```ignore,no_run
1433 /// # use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::AttackStepNode;
1434 /// let x = AttackStepNode::new().set_display_name("example");
1435 /// ```
1436 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
1437 mut self,
1438 v: T,
1439 ) -> Self {
1440 self.display_name = v.into();
1441 self
1442 }
1443
1444 /// Sets the value of [labels][crate::model::attack_path::attack_path_node::AttackStepNode::labels].
1445 ///
1446 /// # Example
1447 /// ```ignore,no_run
1448 /// # use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::AttackStepNode;
1449 /// let x = AttackStepNode::new().set_labels([
1450 /// ("key0", "abc"),
1451 /// ("key1", "xyz"),
1452 /// ]);
1453 /// ```
1454 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1455 where
1456 T: std::iter::IntoIterator<Item = (K, V)>,
1457 K: std::convert::Into<std::string::String>,
1458 V: std::convert::Into<std::string::String>,
1459 {
1460 use std::iter::Iterator;
1461 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1462 self
1463 }
1464
1465 /// Sets the value of [description][crate::model::attack_path::attack_path_node::AttackStepNode::description].
1466 ///
1467 /// # Example
1468 /// ```ignore,no_run
1469 /// # use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::AttackStepNode;
1470 /// let x = AttackStepNode::new().set_description("example");
1471 /// ```
1472 pub fn set_description<T: std::convert::Into<std::string::String>>(
1473 mut self,
1474 v: T,
1475 ) -> Self {
1476 self.description = v.into();
1477 self
1478 }
1479 }
1480
1481 impl wkt::message::Message for AttackStepNode {
1482 fn typename() -> &'static str {
1483 "type.googleapis.com/google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode"
1484 }
1485 }
1486
1487 /// The type of the incoming attack step node.
1488 ///
1489 /// # Working with unknown values
1490 ///
1491 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1492 /// additional enum variants at any time. Adding new variants is not considered
1493 /// a breaking change. Applications should write their code in anticipation of:
1494 ///
1495 /// - New values appearing in future releases of the client library, **and**
1496 /// - New values received dynamically, without application changes.
1497 ///
1498 /// Please consult the [Working with enums] section in the user guide for some
1499 /// guidelines.
1500 ///
1501 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1502 #[derive(Clone, Debug, PartialEq)]
1503 #[non_exhaustive]
1504 pub enum NodeType {
1505 /// Type not specified
1506 Unspecified,
1507 /// Incoming edge joined with AND
1508 And,
1509 /// Incoming edge joined with OR
1510 Or,
1511 /// Incoming edge is defense
1512 Defense,
1513 /// Incoming edge is attacker
1514 Attacker,
1515 /// If set, the enum was initialized with an unknown value.
1516 ///
1517 /// Applications can examine the value using [NodeType::value] or
1518 /// [NodeType::name].
1519 UnknownValue(node_type::UnknownValue),
1520 }
1521
1522 #[doc(hidden)]
1523 pub mod node_type {
1524 #[allow(unused_imports)]
1525 use super::*;
1526 #[derive(Clone, Debug, PartialEq)]
1527 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1528 }
1529
1530 impl NodeType {
1531 /// Gets the enum value.
1532 ///
1533 /// Returns `None` if the enum contains an unknown value deserialized from
1534 /// the string representation of enums.
1535 pub fn value(&self) -> std::option::Option<i32> {
1536 match self {
1537 Self::Unspecified => std::option::Option::Some(0),
1538 Self::And => std::option::Option::Some(1),
1539 Self::Or => std::option::Option::Some(2),
1540 Self::Defense => std::option::Option::Some(3),
1541 Self::Attacker => std::option::Option::Some(4),
1542 Self::UnknownValue(u) => u.0.value(),
1543 }
1544 }
1545
1546 /// Gets the enum value as a string.
1547 ///
1548 /// Returns `None` if the enum contains an unknown value deserialized from
1549 /// the integer representation of enums.
1550 pub fn name(&self) -> std::option::Option<&str> {
1551 match self {
1552 Self::Unspecified => std::option::Option::Some("NODE_TYPE_UNSPECIFIED"),
1553 Self::And => std::option::Option::Some("NODE_TYPE_AND"),
1554 Self::Or => std::option::Option::Some("NODE_TYPE_OR"),
1555 Self::Defense => std::option::Option::Some("NODE_TYPE_DEFENSE"),
1556 Self::Attacker => std::option::Option::Some("NODE_TYPE_ATTACKER"),
1557 Self::UnknownValue(u) => u.0.name(),
1558 }
1559 }
1560 }
1561
1562 impl std::default::Default for NodeType {
1563 fn default() -> Self {
1564 use std::convert::From;
1565 Self::from(0)
1566 }
1567 }
1568
1569 impl std::fmt::Display for NodeType {
1570 fn fmt(
1571 &self,
1572 f: &mut std::fmt::Formatter<'_>,
1573 ) -> std::result::Result<(), std::fmt::Error> {
1574 wkt::internal::display_enum(f, self.name(), self.value())
1575 }
1576 }
1577
1578 impl std::convert::From<i32> for NodeType {
1579 fn from(value: i32) -> Self {
1580 match value {
1581 0 => Self::Unspecified,
1582 1 => Self::And,
1583 2 => Self::Or,
1584 3 => Self::Defense,
1585 4 => Self::Attacker,
1586 _ => Self::UnknownValue(node_type::UnknownValue(
1587 wkt::internal::UnknownEnumValue::Integer(value),
1588 )),
1589 }
1590 }
1591 }
1592
1593 impl std::convert::From<&str> for NodeType {
1594 fn from(value: &str) -> Self {
1595 use std::string::ToString;
1596 match value {
1597 "NODE_TYPE_UNSPECIFIED" => Self::Unspecified,
1598 "NODE_TYPE_AND" => Self::And,
1599 "NODE_TYPE_OR" => Self::Or,
1600 "NODE_TYPE_DEFENSE" => Self::Defense,
1601 "NODE_TYPE_ATTACKER" => Self::Attacker,
1602 _ => Self::UnknownValue(node_type::UnknownValue(
1603 wkt::internal::UnknownEnumValue::String(value.to_string()),
1604 )),
1605 }
1606 }
1607 }
1608
1609 impl serde::ser::Serialize for NodeType {
1610 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1611 where
1612 S: serde::Serializer,
1613 {
1614 match self {
1615 Self::Unspecified => serializer.serialize_i32(0),
1616 Self::And => serializer.serialize_i32(1),
1617 Self::Or => serializer.serialize_i32(2),
1618 Self::Defense => serializer.serialize_i32(3),
1619 Self::Attacker => serializer.serialize_i32(4),
1620 Self::UnknownValue(u) => u.0.serialize(serializer),
1621 }
1622 }
1623 }
1624
1625 impl<'de> serde::de::Deserialize<'de> for NodeType {
1626 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1627 where
1628 D: serde::Deserializer<'de>,
1629 {
1630 deserializer.deserialize_any(wkt::internal::EnumVisitor::<NodeType>::new(
1631 ".google.cloud.securitycenter.v2.AttackPath.AttackPathNode.NodeType",
1632 ))
1633 }
1634 }
1635 }
1636
1637 /// Represents a connection between a source node and a destination node in
1638 /// this attack path.
1639 #[derive(Clone, Default, PartialEq)]
1640 #[non_exhaustive]
1641 pub struct AttackPathEdge {
1642 /// The attack node uuid of the source node.
1643 pub source: std::string::String,
1644
1645 /// The attack node uuid of the destination node.
1646 pub destination: std::string::String,
1647
1648 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1649 }
1650
1651 impl AttackPathEdge {
1652 pub fn new() -> Self {
1653 std::default::Default::default()
1654 }
1655
1656 /// Sets the value of [source][crate::model::attack_path::AttackPathEdge::source].
1657 ///
1658 /// # Example
1659 /// ```ignore,no_run
1660 /// # use google_cloud_securitycenter_v2::model::attack_path::AttackPathEdge;
1661 /// let x = AttackPathEdge::new().set_source("example");
1662 /// ```
1663 pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1664 self.source = v.into();
1665 self
1666 }
1667
1668 /// Sets the value of [destination][crate::model::attack_path::AttackPathEdge::destination].
1669 ///
1670 /// # Example
1671 /// ```ignore,no_run
1672 /// # use google_cloud_securitycenter_v2::model::attack_path::AttackPathEdge;
1673 /// let x = AttackPathEdge::new().set_destination("example");
1674 /// ```
1675 pub fn set_destination<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1676 self.destination = v.into();
1677 self
1678 }
1679 }
1680
1681 impl wkt::message::Message for AttackPathEdge {
1682 fn typename() -> &'static str {
1683 "type.googleapis.com/google.cloud.securitycenter.v2.AttackPath.AttackPathEdge"
1684 }
1685 }
1686}
1687
1688/// Information related to Google Cloud Backup and DR Service findings.
1689#[derive(Clone, Default, PartialEq)]
1690#[non_exhaustive]
1691pub struct BackupDisasterRecovery {
1692 /// The name of a Backup and DR template which comprises one or more backup
1693 /// policies. See the [Backup and DR
1694 /// documentation](https://cloud.google.com/backup-disaster-recovery/docs/concepts/backup-plan#temp)
1695 /// for more information. For example, `snap-ov`.
1696 pub backup_template: std::string::String,
1697
1698 /// The names of Backup and DR policies that are associated with a template
1699 /// and that define when to run a backup, how frequently to run a backup, and
1700 /// how long to retain the backup image. For example, `onvaults`.
1701 pub policies: std::vec::Vec<std::string::String>,
1702
1703 /// The name of a Backup and DR host, which is managed by the backup and
1704 /// recovery appliance and known to the management console. The host can be of
1705 /// type Generic (for example, Compute Engine, SQL Server, Oracle DB, SMB file
1706 /// system, etc.), vCenter, or an ESX server. See the [Backup and DR
1707 /// documentation on
1708 /// hosts](https://cloud.google.com/backup-disaster-recovery/docs/configuration/manage-hosts-and-their-applications)
1709 /// for more information. For example, `centos7-01`.
1710 pub host: std::string::String,
1711
1712 /// The names of Backup and DR applications. An application is a VM, database,
1713 /// or file system on a managed host monitored by a backup and recovery
1714 /// appliance. For example, `centos7-01-vol00`, `centos7-01-vol01`,
1715 /// `centos7-01-vol02`.
1716 pub applications: std::vec::Vec<std::string::String>,
1717
1718 /// The name of the Backup and DR storage pool that the backup and recovery
1719 /// appliance is storing data in. The storage pool could be of type Cloud,
1720 /// Primary, Snapshot, or OnVault. See the [Backup and DR documentation on
1721 /// storage
1722 /// pools](https://cloud.google.com/backup-disaster-recovery/docs/concepts/storage-pools).
1723 /// For example, `DiskPoolOne`.
1724 pub storage_pool: std::string::String,
1725
1726 /// The names of Backup and DR advanced policy options of a policy applying to
1727 /// an application. See the [Backup and DR documentation on policy
1728 /// options](https://cloud.google.com/backup-disaster-recovery/docs/create-plan/policy-settings).
1729 /// For example, `skipofflineappsincongrp, nounmap`.
1730 pub policy_options: std::vec::Vec<std::string::String>,
1731
1732 /// The name of the Backup and DR resource profile that specifies the storage
1733 /// media for backups of application and VM data. See the [Backup and DR
1734 /// documentation on
1735 /// profiles](https://cloud.google.com/backup-disaster-recovery/docs/concepts/backup-plan#profile).
1736 /// For example, `GCP`.
1737 pub profile: std::string::String,
1738
1739 /// The name of the Backup and DR appliance that captures, moves, and manages
1740 /// the lifecycle of backup data. For example, `backup-server-57137`.
1741 pub appliance: std::string::String,
1742
1743 /// The backup type of the Backup and DR image.
1744 /// For example, `Snapshot`, `Remote Snapshot`, `OnVault`.
1745 pub backup_type: std::string::String,
1746
1747 /// The timestamp at which the Backup and DR backup was created.
1748 pub backup_create_time: std::option::Option<wkt::Timestamp>,
1749
1750 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1751}
1752
1753impl BackupDisasterRecovery {
1754 pub fn new() -> Self {
1755 std::default::Default::default()
1756 }
1757
1758 /// Sets the value of [backup_template][crate::model::BackupDisasterRecovery::backup_template].
1759 ///
1760 /// # Example
1761 /// ```ignore,no_run
1762 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1763 /// let x = BackupDisasterRecovery::new().set_backup_template("example");
1764 /// ```
1765 pub fn set_backup_template<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1766 self.backup_template = v.into();
1767 self
1768 }
1769
1770 /// Sets the value of [policies][crate::model::BackupDisasterRecovery::policies].
1771 ///
1772 /// # Example
1773 /// ```ignore,no_run
1774 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1775 /// let x = BackupDisasterRecovery::new().set_policies(["a", "b", "c"]);
1776 /// ```
1777 pub fn set_policies<T, V>(mut self, v: T) -> Self
1778 where
1779 T: std::iter::IntoIterator<Item = V>,
1780 V: std::convert::Into<std::string::String>,
1781 {
1782 use std::iter::Iterator;
1783 self.policies = v.into_iter().map(|i| i.into()).collect();
1784 self
1785 }
1786
1787 /// Sets the value of [host][crate::model::BackupDisasterRecovery::host].
1788 ///
1789 /// # Example
1790 /// ```ignore,no_run
1791 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1792 /// let x = BackupDisasterRecovery::new().set_host("example");
1793 /// ```
1794 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1795 self.host = v.into();
1796 self
1797 }
1798
1799 /// Sets the value of [applications][crate::model::BackupDisasterRecovery::applications].
1800 ///
1801 /// # Example
1802 /// ```ignore,no_run
1803 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1804 /// let x = BackupDisasterRecovery::new().set_applications(["a", "b", "c"]);
1805 /// ```
1806 pub fn set_applications<T, V>(mut self, v: T) -> Self
1807 where
1808 T: std::iter::IntoIterator<Item = V>,
1809 V: std::convert::Into<std::string::String>,
1810 {
1811 use std::iter::Iterator;
1812 self.applications = v.into_iter().map(|i| i.into()).collect();
1813 self
1814 }
1815
1816 /// Sets the value of [storage_pool][crate::model::BackupDisasterRecovery::storage_pool].
1817 ///
1818 /// # Example
1819 /// ```ignore,no_run
1820 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1821 /// let x = BackupDisasterRecovery::new().set_storage_pool("example");
1822 /// ```
1823 pub fn set_storage_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1824 self.storage_pool = v.into();
1825 self
1826 }
1827
1828 /// Sets the value of [policy_options][crate::model::BackupDisasterRecovery::policy_options].
1829 ///
1830 /// # Example
1831 /// ```ignore,no_run
1832 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1833 /// let x = BackupDisasterRecovery::new().set_policy_options(["a", "b", "c"]);
1834 /// ```
1835 pub fn set_policy_options<T, V>(mut self, v: T) -> Self
1836 where
1837 T: std::iter::IntoIterator<Item = V>,
1838 V: std::convert::Into<std::string::String>,
1839 {
1840 use std::iter::Iterator;
1841 self.policy_options = v.into_iter().map(|i| i.into()).collect();
1842 self
1843 }
1844
1845 /// Sets the value of [profile][crate::model::BackupDisasterRecovery::profile].
1846 ///
1847 /// # Example
1848 /// ```ignore,no_run
1849 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1850 /// let x = BackupDisasterRecovery::new().set_profile("example");
1851 /// ```
1852 pub fn set_profile<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1853 self.profile = v.into();
1854 self
1855 }
1856
1857 /// Sets the value of [appliance][crate::model::BackupDisasterRecovery::appliance].
1858 ///
1859 /// # Example
1860 /// ```ignore,no_run
1861 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1862 /// let x = BackupDisasterRecovery::new().set_appliance("example");
1863 /// ```
1864 pub fn set_appliance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1865 self.appliance = v.into();
1866 self
1867 }
1868
1869 /// Sets the value of [backup_type][crate::model::BackupDisasterRecovery::backup_type].
1870 ///
1871 /// # Example
1872 /// ```ignore,no_run
1873 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1874 /// let x = BackupDisasterRecovery::new().set_backup_type("example");
1875 /// ```
1876 pub fn set_backup_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1877 self.backup_type = v.into();
1878 self
1879 }
1880
1881 /// Sets the value of [backup_create_time][crate::model::BackupDisasterRecovery::backup_create_time].
1882 ///
1883 /// # Example
1884 /// ```ignore,no_run
1885 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1886 /// use wkt::Timestamp;
1887 /// let x = BackupDisasterRecovery::new().set_backup_create_time(Timestamp::default()/* use setters */);
1888 /// ```
1889 pub fn set_backup_create_time<T>(mut self, v: T) -> Self
1890 where
1891 T: std::convert::Into<wkt::Timestamp>,
1892 {
1893 self.backup_create_time = std::option::Option::Some(v.into());
1894 self
1895 }
1896
1897 /// Sets or clears the value of [backup_create_time][crate::model::BackupDisasterRecovery::backup_create_time].
1898 ///
1899 /// # Example
1900 /// ```ignore,no_run
1901 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1902 /// use wkt::Timestamp;
1903 /// let x = BackupDisasterRecovery::new().set_or_clear_backup_create_time(Some(Timestamp::default()/* use setters */));
1904 /// let x = BackupDisasterRecovery::new().set_or_clear_backup_create_time(None::<Timestamp>);
1905 /// ```
1906 pub fn set_or_clear_backup_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1907 where
1908 T: std::convert::Into<wkt::Timestamp>,
1909 {
1910 self.backup_create_time = v.map(|x| x.into());
1911 self
1912 }
1913}
1914
1915impl wkt::message::Message for BackupDisasterRecovery {
1916 fn typename() -> &'static str {
1917 "type.googleapis.com/google.cloud.securitycenter.v2.BackupDisasterRecovery"
1918 }
1919}
1920
1921/// Configures how to deliver Findings to BigQuery Instance.
1922#[derive(Clone, Default, PartialEq)]
1923#[non_exhaustive]
1924pub struct BigQueryExport {
1925 /// Identifier. The relative resource name of this export. See:
1926 /// <https://cloud.google.com/apis/design/resource_names#relative_resource_name>.
1927 /// The following list shows some examples:
1928 ///
1929 ///
1930 /// `organizations/{organization_id}/locations/{location_id}/bigQueryExports/{export_id}`
1931 ///
1932 /// + `folders/{folder_id}/locations/{location_id}/bigQueryExports/{export_id}`
1933 ///
1934 /// `projects/{project_id}/locations/{location_id}/bigQueryExports/{export_id}`
1935 ///
1936 /// This field is provided in responses, and is ignored when provided in create
1937 /// requests.
1938 pub name: std::string::String,
1939
1940 /// The description of the export (max of 1024 characters).
1941 pub description: std::string::String,
1942
1943 /// Expression that defines the filter to apply across create/update events
1944 /// of findings. The expression is a list of zero or more restrictions combined
1945 /// via logical operators `AND` and `OR`. Parentheses are supported, and `OR`
1946 /// has higher precedence than `AND`.
1947 ///
1948 /// Restrictions have the form `<field> <operator> <value>` and may have a
1949 /// `-` character in front of them to indicate negation. The fields map to
1950 /// those defined in the corresponding resource.
1951 ///
1952 /// The supported operators are:
1953 ///
1954 /// * `=` for all value types.
1955 /// * `>`, `<`, `>=`, `<=` for integer values.
1956 /// * `:`, meaning substring matching, for strings.
1957 ///
1958 /// The supported value types are:
1959 ///
1960 /// * string literals in quotes.
1961 /// * integer literals without quotes.
1962 /// * boolean literals `true` and `false` without quotes.
1963 pub filter: std::string::String,
1964
1965 /// The dataset to write findings' updates to. Its format is
1966 /// "projects/[project_id]/datasets/[bigquery_dataset_id]".
1967 /// BigQuery dataset unique ID must contain only letters (a-z, A-Z), numbers
1968 /// (0-9), or underscores (_).
1969 pub dataset: std::string::String,
1970
1971 /// Output only. The time at which the BigQuery export was created.
1972 /// This field is set by the server and will be ignored if provided on export
1973 /// on creation.
1974 pub create_time: std::option::Option<wkt::Timestamp>,
1975
1976 /// Output only. The most recent time at which the BigQuery export was updated.
1977 /// This field is set by the server and will be ignored if provided on export
1978 /// creation or update.
1979 pub update_time: std::option::Option<wkt::Timestamp>,
1980
1981 /// Output only. Email address of the user who last edited the BigQuery export.
1982 /// This field is set by the server and will be ignored if provided on export
1983 /// creation or update.
1984 pub most_recent_editor: std::string::String,
1985
1986 /// Output only. The service account that needs permission to create table and
1987 /// upload data to the BigQuery dataset.
1988 pub principal: std::string::String,
1989
1990 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1991}
1992
1993impl BigQueryExport {
1994 pub fn new() -> Self {
1995 std::default::Default::default()
1996 }
1997
1998 /// Sets the value of [name][crate::model::BigQueryExport::name].
1999 ///
2000 /// # Example
2001 /// ```ignore,no_run
2002 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2003 /// let x = BigQueryExport::new().set_name("example");
2004 /// ```
2005 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2006 self.name = v.into();
2007 self
2008 }
2009
2010 /// Sets the value of [description][crate::model::BigQueryExport::description].
2011 ///
2012 /// # Example
2013 /// ```ignore,no_run
2014 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2015 /// let x = BigQueryExport::new().set_description("example");
2016 /// ```
2017 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2018 self.description = v.into();
2019 self
2020 }
2021
2022 /// Sets the value of [filter][crate::model::BigQueryExport::filter].
2023 ///
2024 /// # Example
2025 /// ```ignore,no_run
2026 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2027 /// let x = BigQueryExport::new().set_filter("example");
2028 /// ```
2029 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2030 self.filter = v.into();
2031 self
2032 }
2033
2034 /// Sets the value of [dataset][crate::model::BigQueryExport::dataset].
2035 ///
2036 /// # Example
2037 /// ```ignore,no_run
2038 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2039 /// let x = BigQueryExport::new().set_dataset("example");
2040 /// ```
2041 pub fn set_dataset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2042 self.dataset = v.into();
2043 self
2044 }
2045
2046 /// Sets the value of [create_time][crate::model::BigQueryExport::create_time].
2047 ///
2048 /// # Example
2049 /// ```ignore,no_run
2050 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2051 /// use wkt::Timestamp;
2052 /// let x = BigQueryExport::new().set_create_time(Timestamp::default()/* use setters */);
2053 /// ```
2054 pub fn set_create_time<T>(mut self, v: T) -> Self
2055 where
2056 T: std::convert::Into<wkt::Timestamp>,
2057 {
2058 self.create_time = std::option::Option::Some(v.into());
2059 self
2060 }
2061
2062 /// Sets or clears the value of [create_time][crate::model::BigQueryExport::create_time].
2063 ///
2064 /// # Example
2065 /// ```ignore,no_run
2066 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2067 /// use wkt::Timestamp;
2068 /// let x = BigQueryExport::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2069 /// let x = BigQueryExport::new().set_or_clear_create_time(None::<Timestamp>);
2070 /// ```
2071 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2072 where
2073 T: std::convert::Into<wkt::Timestamp>,
2074 {
2075 self.create_time = v.map(|x| x.into());
2076 self
2077 }
2078
2079 /// Sets the value of [update_time][crate::model::BigQueryExport::update_time].
2080 ///
2081 /// # Example
2082 /// ```ignore,no_run
2083 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2084 /// use wkt::Timestamp;
2085 /// let x = BigQueryExport::new().set_update_time(Timestamp::default()/* use setters */);
2086 /// ```
2087 pub fn set_update_time<T>(mut self, v: T) -> Self
2088 where
2089 T: std::convert::Into<wkt::Timestamp>,
2090 {
2091 self.update_time = std::option::Option::Some(v.into());
2092 self
2093 }
2094
2095 /// Sets or clears the value of [update_time][crate::model::BigQueryExport::update_time].
2096 ///
2097 /// # Example
2098 /// ```ignore,no_run
2099 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2100 /// use wkt::Timestamp;
2101 /// let x = BigQueryExport::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2102 /// let x = BigQueryExport::new().set_or_clear_update_time(None::<Timestamp>);
2103 /// ```
2104 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2105 where
2106 T: std::convert::Into<wkt::Timestamp>,
2107 {
2108 self.update_time = v.map(|x| x.into());
2109 self
2110 }
2111
2112 /// Sets the value of [most_recent_editor][crate::model::BigQueryExport::most_recent_editor].
2113 ///
2114 /// # Example
2115 /// ```ignore,no_run
2116 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2117 /// let x = BigQueryExport::new().set_most_recent_editor("example");
2118 /// ```
2119 pub fn set_most_recent_editor<T: std::convert::Into<std::string::String>>(
2120 mut self,
2121 v: T,
2122 ) -> Self {
2123 self.most_recent_editor = v.into();
2124 self
2125 }
2126
2127 /// Sets the value of [principal][crate::model::BigQueryExport::principal].
2128 ///
2129 /// # Example
2130 /// ```ignore,no_run
2131 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2132 /// let x = BigQueryExport::new().set_principal("example");
2133 /// ```
2134 pub fn set_principal<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2135 self.principal = v.into();
2136 self
2137 }
2138}
2139
2140impl wkt::message::Message for BigQueryExport {
2141 fn typename() -> &'static str {
2142 "type.googleapis.com/google.cloud.securitycenter.v2.BigQueryExport"
2143 }
2144}
2145
2146/// Contains details about a chokepoint, which is a resource or resource group
2147/// where high-risk attack paths converge, based on [attack path simulations]
2148/// (<https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_path_simulations>).
2149#[derive(Clone, Default, PartialEq)]
2150#[non_exhaustive]
2151pub struct Chokepoint {
2152 /// List of resource names of findings associated with this chokepoint.
2153 /// For example, organizations/123/sources/456/findings/789.
2154 /// This list will have at most 100 findings.
2155 pub related_findings: std::vec::Vec<std::string::String>,
2156
2157 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2158}
2159
2160impl Chokepoint {
2161 pub fn new() -> Self {
2162 std::default::Default::default()
2163 }
2164
2165 /// Sets the value of [related_findings][crate::model::Chokepoint::related_findings].
2166 ///
2167 /// # Example
2168 /// ```ignore,no_run
2169 /// # use google_cloud_securitycenter_v2::model::Chokepoint;
2170 /// let x = Chokepoint::new().set_related_findings(["a", "b", "c"]);
2171 /// ```
2172 pub fn set_related_findings<T, V>(mut self, v: T) -> Self
2173 where
2174 T: std::iter::IntoIterator<Item = V>,
2175 V: std::convert::Into<std::string::String>,
2176 {
2177 use std::iter::Iterator;
2178 self.related_findings = v.into_iter().map(|i| i.into()).collect();
2179 self
2180 }
2181}
2182
2183impl wkt::message::Message for Chokepoint {
2184 fn typename() -> &'static str {
2185 "type.googleapis.com/google.cloud.securitycenter.v2.Chokepoint"
2186 }
2187}
2188
2189/// Fields related to Google Cloud Armor findings.
2190#[derive(Clone, Default, PartialEq)]
2191#[non_exhaustive]
2192pub struct CloudArmor {
2193 /// Information about the [Google Cloud Armor security
2194 /// policy](https://cloud.google.com/armor/docs/security-policy-overview)
2195 /// relevant to the finding.
2196 pub security_policy: std::option::Option<crate::model::SecurityPolicy>,
2197
2198 /// Information about incoming requests evaluated by [Google Cloud Armor
2199 /// security
2200 /// policies](https://cloud.google.com/armor/docs/security-policy-overview).
2201 pub requests: std::option::Option<crate::model::Requests>,
2202
2203 /// Information about potential Layer 7 DDoS attacks identified by [Google
2204 /// Cloud Armor Adaptive
2205 /// Protection](https://cloud.google.com/armor/docs/adaptive-protection-overview).
2206 pub adaptive_protection: std::option::Option<crate::model::AdaptiveProtection>,
2207
2208 /// Information about DDoS attack volume and classification.
2209 pub attack: std::option::Option<crate::model::Attack>,
2210
2211 /// Distinguish between volumetric & protocol DDoS attack and
2212 /// application layer attacks. For example, "L3_4" for Layer 3 and Layer 4 DDoS
2213 /// attacks, or "L_7" for Layer 7 DDoS attacks.
2214 pub threat_vector: std::string::String,
2215
2216 /// Duration of attack from the start until the current moment (updated every 5
2217 /// minutes).
2218 pub duration: std::option::Option<wkt::Duration>,
2219
2220 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2221}
2222
2223impl CloudArmor {
2224 pub fn new() -> Self {
2225 std::default::Default::default()
2226 }
2227
2228 /// Sets the value of [security_policy][crate::model::CloudArmor::security_policy].
2229 ///
2230 /// # Example
2231 /// ```ignore,no_run
2232 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2233 /// use google_cloud_securitycenter_v2::model::SecurityPolicy;
2234 /// let x = CloudArmor::new().set_security_policy(SecurityPolicy::default()/* use setters */);
2235 /// ```
2236 pub fn set_security_policy<T>(mut self, v: T) -> Self
2237 where
2238 T: std::convert::Into<crate::model::SecurityPolicy>,
2239 {
2240 self.security_policy = std::option::Option::Some(v.into());
2241 self
2242 }
2243
2244 /// Sets or clears the value of [security_policy][crate::model::CloudArmor::security_policy].
2245 ///
2246 /// # Example
2247 /// ```ignore,no_run
2248 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2249 /// use google_cloud_securitycenter_v2::model::SecurityPolicy;
2250 /// let x = CloudArmor::new().set_or_clear_security_policy(Some(SecurityPolicy::default()/* use setters */));
2251 /// let x = CloudArmor::new().set_or_clear_security_policy(None::<SecurityPolicy>);
2252 /// ```
2253 pub fn set_or_clear_security_policy<T>(mut self, v: std::option::Option<T>) -> Self
2254 where
2255 T: std::convert::Into<crate::model::SecurityPolicy>,
2256 {
2257 self.security_policy = v.map(|x| x.into());
2258 self
2259 }
2260
2261 /// Sets the value of [requests][crate::model::CloudArmor::requests].
2262 ///
2263 /// # Example
2264 /// ```ignore,no_run
2265 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2266 /// use google_cloud_securitycenter_v2::model::Requests;
2267 /// let x = CloudArmor::new().set_requests(Requests::default()/* use setters */);
2268 /// ```
2269 pub fn set_requests<T>(mut self, v: T) -> Self
2270 where
2271 T: std::convert::Into<crate::model::Requests>,
2272 {
2273 self.requests = std::option::Option::Some(v.into());
2274 self
2275 }
2276
2277 /// Sets or clears the value of [requests][crate::model::CloudArmor::requests].
2278 ///
2279 /// # Example
2280 /// ```ignore,no_run
2281 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2282 /// use google_cloud_securitycenter_v2::model::Requests;
2283 /// let x = CloudArmor::new().set_or_clear_requests(Some(Requests::default()/* use setters */));
2284 /// let x = CloudArmor::new().set_or_clear_requests(None::<Requests>);
2285 /// ```
2286 pub fn set_or_clear_requests<T>(mut self, v: std::option::Option<T>) -> Self
2287 where
2288 T: std::convert::Into<crate::model::Requests>,
2289 {
2290 self.requests = v.map(|x| x.into());
2291 self
2292 }
2293
2294 /// Sets the value of [adaptive_protection][crate::model::CloudArmor::adaptive_protection].
2295 ///
2296 /// # Example
2297 /// ```ignore,no_run
2298 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2299 /// use google_cloud_securitycenter_v2::model::AdaptiveProtection;
2300 /// let x = CloudArmor::new().set_adaptive_protection(AdaptiveProtection::default()/* use setters */);
2301 /// ```
2302 pub fn set_adaptive_protection<T>(mut self, v: T) -> Self
2303 where
2304 T: std::convert::Into<crate::model::AdaptiveProtection>,
2305 {
2306 self.adaptive_protection = std::option::Option::Some(v.into());
2307 self
2308 }
2309
2310 /// Sets or clears the value of [adaptive_protection][crate::model::CloudArmor::adaptive_protection].
2311 ///
2312 /// # Example
2313 /// ```ignore,no_run
2314 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2315 /// use google_cloud_securitycenter_v2::model::AdaptiveProtection;
2316 /// let x = CloudArmor::new().set_or_clear_adaptive_protection(Some(AdaptiveProtection::default()/* use setters */));
2317 /// let x = CloudArmor::new().set_or_clear_adaptive_protection(None::<AdaptiveProtection>);
2318 /// ```
2319 pub fn set_or_clear_adaptive_protection<T>(mut self, v: std::option::Option<T>) -> Self
2320 where
2321 T: std::convert::Into<crate::model::AdaptiveProtection>,
2322 {
2323 self.adaptive_protection = v.map(|x| x.into());
2324 self
2325 }
2326
2327 /// Sets the value of [attack][crate::model::CloudArmor::attack].
2328 ///
2329 /// # Example
2330 /// ```ignore,no_run
2331 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2332 /// use google_cloud_securitycenter_v2::model::Attack;
2333 /// let x = CloudArmor::new().set_attack(Attack::default()/* use setters */);
2334 /// ```
2335 pub fn set_attack<T>(mut self, v: T) -> Self
2336 where
2337 T: std::convert::Into<crate::model::Attack>,
2338 {
2339 self.attack = std::option::Option::Some(v.into());
2340 self
2341 }
2342
2343 /// Sets or clears the value of [attack][crate::model::CloudArmor::attack].
2344 ///
2345 /// # Example
2346 /// ```ignore,no_run
2347 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2348 /// use google_cloud_securitycenter_v2::model::Attack;
2349 /// let x = CloudArmor::new().set_or_clear_attack(Some(Attack::default()/* use setters */));
2350 /// let x = CloudArmor::new().set_or_clear_attack(None::<Attack>);
2351 /// ```
2352 pub fn set_or_clear_attack<T>(mut self, v: std::option::Option<T>) -> Self
2353 where
2354 T: std::convert::Into<crate::model::Attack>,
2355 {
2356 self.attack = v.map(|x| x.into());
2357 self
2358 }
2359
2360 /// Sets the value of [threat_vector][crate::model::CloudArmor::threat_vector].
2361 ///
2362 /// # Example
2363 /// ```ignore,no_run
2364 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2365 /// let x = CloudArmor::new().set_threat_vector("example");
2366 /// ```
2367 pub fn set_threat_vector<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2368 self.threat_vector = v.into();
2369 self
2370 }
2371
2372 /// Sets the value of [duration][crate::model::CloudArmor::duration].
2373 ///
2374 /// # Example
2375 /// ```ignore,no_run
2376 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2377 /// use wkt::Duration;
2378 /// let x = CloudArmor::new().set_duration(Duration::default()/* use setters */);
2379 /// ```
2380 pub fn set_duration<T>(mut self, v: T) -> Self
2381 where
2382 T: std::convert::Into<wkt::Duration>,
2383 {
2384 self.duration = std::option::Option::Some(v.into());
2385 self
2386 }
2387
2388 /// Sets or clears the value of [duration][crate::model::CloudArmor::duration].
2389 ///
2390 /// # Example
2391 /// ```ignore,no_run
2392 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2393 /// use wkt::Duration;
2394 /// let x = CloudArmor::new().set_or_clear_duration(Some(Duration::default()/* use setters */));
2395 /// let x = CloudArmor::new().set_or_clear_duration(None::<Duration>);
2396 /// ```
2397 pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
2398 where
2399 T: std::convert::Into<wkt::Duration>,
2400 {
2401 self.duration = v.map(|x| x.into());
2402 self
2403 }
2404}
2405
2406impl wkt::message::Message for CloudArmor {
2407 fn typename() -> &'static str {
2408 "type.googleapis.com/google.cloud.securitycenter.v2.CloudArmor"
2409 }
2410}
2411
2412/// Information about the [Google Cloud Armor security
2413/// policy](https://cloud.google.com/armor/docs/security-policy-overview)
2414/// relevant to the finding.
2415#[derive(Clone, Default, PartialEq)]
2416#[non_exhaustive]
2417pub struct SecurityPolicy {
2418 /// The name of the Google Cloud Armor security policy, for example,
2419 /// "my-security-policy".
2420 pub name: std::string::String,
2421
2422 /// The type of Google Cloud Armor security policy for example, 'backend
2423 /// security policy', 'edge security policy', 'network edge security policy',
2424 /// or 'always-on DDoS protection'.
2425 pub r#type: std::string::String,
2426
2427 /// Whether or not the associated rule or policy is in preview mode.
2428 pub preview: bool,
2429
2430 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2431}
2432
2433impl SecurityPolicy {
2434 pub fn new() -> Self {
2435 std::default::Default::default()
2436 }
2437
2438 /// Sets the value of [name][crate::model::SecurityPolicy::name].
2439 ///
2440 /// # Example
2441 /// ```ignore,no_run
2442 /// # use google_cloud_securitycenter_v2::model::SecurityPolicy;
2443 /// let x = SecurityPolicy::new().set_name("example");
2444 /// ```
2445 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2446 self.name = v.into();
2447 self
2448 }
2449
2450 /// Sets the value of [r#type][crate::model::SecurityPolicy::type].
2451 ///
2452 /// # Example
2453 /// ```ignore,no_run
2454 /// # use google_cloud_securitycenter_v2::model::SecurityPolicy;
2455 /// let x = SecurityPolicy::new().set_type("example");
2456 /// ```
2457 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2458 self.r#type = v.into();
2459 self
2460 }
2461
2462 /// Sets the value of [preview][crate::model::SecurityPolicy::preview].
2463 ///
2464 /// # Example
2465 /// ```ignore,no_run
2466 /// # use google_cloud_securitycenter_v2::model::SecurityPolicy;
2467 /// let x = SecurityPolicy::new().set_preview(true);
2468 /// ```
2469 pub fn set_preview<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2470 self.preview = v.into();
2471 self
2472 }
2473}
2474
2475impl wkt::message::Message for SecurityPolicy {
2476 fn typename() -> &'static str {
2477 "type.googleapis.com/google.cloud.securitycenter.v2.SecurityPolicy"
2478 }
2479}
2480
2481/// Information about the requests relevant to the finding.
2482#[derive(Clone, Default, PartialEq)]
2483#[non_exhaustive]
2484pub struct Requests {
2485 /// For 'Increasing deny ratio', the ratio is the denied traffic divided by the
2486 /// allowed traffic. For 'Allowed traffic spike', the ratio is the allowed
2487 /// traffic in the short term divided by allowed traffic in the long term.
2488 pub ratio: f64,
2489
2490 /// Allowed RPS (requests per second) in the short term.
2491 pub short_term_allowed: i32,
2492
2493 /// Allowed RPS (requests per second) over the long term.
2494 pub long_term_allowed: i32,
2495
2496 /// Denied RPS (requests per second) over the long term.
2497 pub long_term_denied: i32,
2498
2499 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2500}
2501
2502impl Requests {
2503 pub fn new() -> Self {
2504 std::default::Default::default()
2505 }
2506
2507 /// Sets the value of [ratio][crate::model::Requests::ratio].
2508 ///
2509 /// # Example
2510 /// ```ignore,no_run
2511 /// # use google_cloud_securitycenter_v2::model::Requests;
2512 /// let x = Requests::new().set_ratio(42.0);
2513 /// ```
2514 pub fn set_ratio<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
2515 self.ratio = v.into();
2516 self
2517 }
2518
2519 /// Sets the value of [short_term_allowed][crate::model::Requests::short_term_allowed].
2520 ///
2521 /// # Example
2522 /// ```ignore,no_run
2523 /// # use google_cloud_securitycenter_v2::model::Requests;
2524 /// let x = Requests::new().set_short_term_allowed(42);
2525 /// ```
2526 pub fn set_short_term_allowed<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2527 self.short_term_allowed = v.into();
2528 self
2529 }
2530
2531 /// Sets the value of [long_term_allowed][crate::model::Requests::long_term_allowed].
2532 ///
2533 /// # Example
2534 /// ```ignore,no_run
2535 /// # use google_cloud_securitycenter_v2::model::Requests;
2536 /// let x = Requests::new().set_long_term_allowed(42);
2537 /// ```
2538 pub fn set_long_term_allowed<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2539 self.long_term_allowed = v.into();
2540 self
2541 }
2542
2543 /// Sets the value of [long_term_denied][crate::model::Requests::long_term_denied].
2544 ///
2545 /// # Example
2546 /// ```ignore,no_run
2547 /// # use google_cloud_securitycenter_v2::model::Requests;
2548 /// let x = Requests::new().set_long_term_denied(42);
2549 /// ```
2550 pub fn set_long_term_denied<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2551 self.long_term_denied = v.into();
2552 self
2553 }
2554}
2555
2556impl wkt::message::Message for Requests {
2557 fn typename() -> &'static str {
2558 "type.googleapis.com/google.cloud.securitycenter.v2.Requests"
2559 }
2560}
2561
2562/// Information about [Google Cloud Armor Adaptive
2563/// Protection](https://cloud.google.com/armor/docs/cloud-armor-overview#google-cloud-armor-adaptive-protection).
2564#[derive(Clone, Default, PartialEq)]
2565#[non_exhaustive]
2566pub struct AdaptiveProtection {
2567 /// A score of 0 means that there is low confidence that the detected event is
2568 /// an actual attack. A score of 1 means that there is high confidence that the
2569 /// detected event is an attack. See the [Adaptive Protection
2570 /// documentation](https://cloud.google.com/armor/docs/adaptive-protection-overview#configure-alert-tuning)
2571 /// for further explanation.
2572 pub confidence: f64,
2573
2574 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2575}
2576
2577impl AdaptiveProtection {
2578 pub fn new() -> Self {
2579 std::default::Default::default()
2580 }
2581
2582 /// Sets the value of [confidence][crate::model::AdaptiveProtection::confidence].
2583 ///
2584 /// # Example
2585 /// ```ignore,no_run
2586 /// # use google_cloud_securitycenter_v2::model::AdaptiveProtection;
2587 /// let x = AdaptiveProtection::new().set_confidence(42.0);
2588 /// ```
2589 pub fn set_confidence<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
2590 self.confidence = v.into();
2591 self
2592 }
2593}
2594
2595impl wkt::message::Message for AdaptiveProtection {
2596 fn typename() -> &'static str {
2597 "type.googleapis.com/google.cloud.securitycenter.v2.AdaptiveProtection"
2598 }
2599}
2600
2601/// Information about DDoS attack volume and classification.
2602#[derive(Clone, Default, PartialEq)]
2603#[non_exhaustive]
2604pub struct Attack {
2605 /// Total PPS (packets per second) volume of attack.
2606 pub volume_pps_long: i64,
2607
2608 /// Total BPS (bytes per second) volume of attack.
2609 pub volume_bps_long: i64,
2610
2611 /// Type of attack, for example, 'SYN-flood', 'NTP-udp', or 'CHARGEN-udp'.
2612 pub classification: std::string::String,
2613
2614 /// Total PPS (packets per second) volume of attack. Deprecated - refer to
2615 /// volume_pps_long instead.
2616 #[deprecated]
2617 pub volume_pps: i32,
2618
2619 /// Total BPS (bytes per second) volume of attack. Deprecated - refer to
2620 /// volume_bps_long instead.
2621 #[deprecated]
2622 pub volume_bps: i32,
2623
2624 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2625}
2626
2627impl Attack {
2628 pub fn new() -> Self {
2629 std::default::Default::default()
2630 }
2631
2632 /// Sets the value of [volume_pps_long][crate::model::Attack::volume_pps_long].
2633 ///
2634 /// # Example
2635 /// ```ignore,no_run
2636 /// # use google_cloud_securitycenter_v2::model::Attack;
2637 /// let x = Attack::new().set_volume_pps_long(42);
2638 /// ```
2639 pub fn set_volume_pps_long<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2640 self.volume_pps_long = v.into();
2641 self
2642 }
2643
2644 /// Sets the value of [volume_bps_long][crate::model::Attack::volume_bps_long].
2645 ///
2646 /// # Example
2647 /// ```ignore,no_run
2648 /// # use google_cloud_securitycenter_v2::model::Attack;
2649 /// let x = Attack::new().set_volume_bps_long(42);
2650 /// ```
2651 pub fn set_volume_bps_long<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2652 self.volume_bps_long = v.into();
2653 self
2654 }
2655
2656 /// Sets the value of [classification][crate::model::Attack::classification].
2657 ///
2658 /// # Example
2659 /// ```ignore,no_run
2660 /// # use google_cloud_securitycenter_v2::model::Attack;
2661 /// let x = Attack::new().set_classification("example");
2662 /// ```
2663 pub fn set_classification<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2664 self.classification = v.into();
2665 self
2666 }
2667
2668 /// Sets the value of [volume_pps][crate::model::Attack::volume_pps].
2669 ///
2670 /// # Example
2671 /// ```ignore,no_run
2672 /// # use google_cloud_securitycenter_v2::model::Attack;
2673 /// let x = Attack::new().set_volume_pps(42);
2674 /// ```
2675 #[deprecated]
2676 pub fn set_volume_pps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2677 self.volume_pps = v.into();
2678 self
2679 }
2680
2681 /// Sets the value of [volume_bps][crate::model::Attack::volume_bps].
2682 ///
2683 /// # Example
2684 /// ```ignore,no_run
2685 /// # use google_cloud_securitycenter_v2::model::Attack;
2686 /// let x = Attack::new().set_volume_bps(42);
2687 /// ```
2688 #[deprecated]
2689 pub fn set_volume_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2690 self.volume_bps = v.into();
2691 self
2692 }
2693}
2694
2695impl wkt::message::Message for Attack {
2696 fn typename() -> &'static str {
2697 "type.googleapis.com/google.cloud.securitycenter.v2.Attack"
2698 }
2699}
2700
2701/// The [data profile](https://cloud.google.com/dlp/docs/data-profiles)
2702/// associated with the finding.
2703#[derive(Clone, Default, PartialEq)]
2704#[non_exhaustive]
2705pub struct CloudDlpDataProfile {
2706 /// Name of the data profile, for example,
2707 /// `projects/123/locations/europe/tableProfiles/8383929`.
2708 pub data_profile: std::string::String,
2709
2710 /// The resource hierarchy level at which the data profile was generated.
2711 pub parent_type: crate::model::cloud_dlp_data_profile::ParentType,
2712
2713 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2714}
2715
2716impl CloudDlpDataProfile {
2717 pub fn new() -> Self {
2718 std::default::Default::default()
2719 }
2720
2721 /// Sets the value of [data_profile][crate::model::CloudDlpDataProfile::data_profile].
2722 ///
2723 /// # Example
2724 /// ```ignore,no_run
2725 /// # use google_cloud_securitycenter_v2::model::CloudDlpDataProfile;
2726 /// let x = CloudDlpDataProfile::new().set_data_profile("example");
2727 /// ```
2728 pub fn set_data_profile<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2729 self.data_profile = v.into();
2730 self
2731 }
2732
2733 /// Sets the value of [parent_type][crate::model::CloudDlpDataProfile::parent_type].
2734 ///
2735 /// # Example
2736 /// ```ignore,no_run
2737 /// # use google_cloud_securitycenter_v2::model::CloudDlpDataProfile;
2738 /// use google_cloud_securitycenter_v2::model::cloud_dlp_data_profile::ParentType;
2739 /// let x0 = CloudDlpDataProfile::new().set_parent_type(ParentType::Organization);
2740 /// let x1 = CloudDlpDataProfile::new().set_parent_type(ParentType::Project);
2741 /// ```
2742 pub fn set_parent_type<
2743 T: std::convert::Into<crate::model::cloud_dlp_data_profile::ParentType>,
2744 >(
2745 mut self,
2746 v: T,
2747 ) -> Self {
2748 self.parent_type = v.into();
2749 self
2750 }
2751}
2752
2753impl wkt::message::Message for CloudDlpDataProfile {
2754 fn typename() -> &'static str {
2755 "type.googleapis.com/google.cloud.securitycenter.v2.CloudDlpDataProfile"
2756 }
2757}
2758
2759/// Defines additional types related to [CloudDlpDataProfile].
2760pub mod cloud_dlp_data_profile {
2761 #[allow(unused_imports)]
2762 use super::*;
2763
2764 /// Parents for configurations that produce data profile findings.
2765 ///
2766 /// # Working with unknown values
2767 ///
2768 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2769 /// additional enum variants at any time. Adding new variants is not considered
2770 /// a breaking change. Applications should write their code in anticipation of:
2771 ///
2772 /// - New values appearing in future releases of the client library, **and**
2773 /// - New values received dynamically, without application changes.
2774 ///
2775 /// Please consult the [Working with enums] section in the user guide for some
2776 /// guidelines.
2777 ///
2778 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2779 #[derive(Clone, Debug, PartialEq)]
2780 #[non_exhaustive]
2781 pub enum ParentType {
2782 /// Unspecified parent type.
2783 Unspecified,
2784 /// Organization-level configurations.
2785 Organization,
2786 /// Project-level configurations.
2787 Project,
2788 /// If set, the enum was initialized with an unknown value.
2789 ///
2790 /// Applications can examine the value using [ParentType::value] or
2791 /// [ParentType::name].
2792 UnknownValue(parent_type::UnknownValue),
2793 }
2794
2795 #[doc(hidden)]
2796 pub mod parent_type {
2797 #[allow(unused_imports)]
2798 use super::*;
2799 #[derive(Clone, Debug, PartialEq)]
2800 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2801 }
2802
2803 impl ParentType {
2804 /// Gets the enum value.
2805 ///
2806 /// Returns `None` if the enum contains an unknown value deserialized from
2807 /// the string representation of enums.
2808 pub fn value(&self) -> std::option::Option<i32> {
2809 match self {
2810 Self::Unspecified => std::option::Option::Some(0),
2811 Self::Organization => std::option::Option::Some(1),
2812 Self::Project => std::option::Option::Some(2),
2813 Self::UnknownValue(u) => u.0.value(),
2814 }
2815 }
2816
2817 /// Gets the enum value as a string.
2818 ///
2819 /// Returns `None` if the enum contains an unknown value deserialized from
2820 /// the integer representation of enums.
2821 pub fn name(&self) -> std::option::Option<&str> {
2822 match self {
2823 Self::Unspecified => std::option::Option::Some("PARENT_TYPE_UNSPECIFIED"),
2824 Self::Organization => std::option::Option::Some("ORGANIZATION"),
2825 Self::Project => std::option::Option::Some("PROJECT"),
2826 Self::UnknownValue(u) => u.0.name(),
2827 }
2828 }
2829 }
2830
2831 impl std::default::Default for ParentType {
2832 fn default() -> Self {
2833 use std::convert::From;
2834 Self::from(0)
2835 }
2836 }
2837
2838 impl std::fmt::Display for ParentType {
2839 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2840 wkt::internal::display_enum(f, self.name(), self.value())
2841 }
2842 }
2843
2844 impl std::convert::From<i32> for ParentType {
2845 fn from(value: i32) -> Self {
2846 match value {
2847 0 => Self::Unspecified,
2848 1 => Self::Organization,
2849 2 => Self::Project,
2850 _ => Self::UnknownValue(parent_type::UnknownValue(
2851 wkt::internal::UnknownEnumValue::Integer(value),
2852 )),
2853 }
2854 }
2855 }
2856
2857 impl std::convert::From<&str> for ParentType {
2858 fn from(value: &str) -> Self {
2859 use std::string::ToString;
2860 match value {
2861 "PARENT_TYPE_UNSPECIFIED" => Self::Unspecified,
2862 "ORGANIZATION" => Self::Organization,
2863 "PROJECT" => Self::Project,
2864 _ => Self::UnknownValue(parent_type::UnknownValue(
2865 wkt::internal::UnknownEnumValue::String(value.to_string()),
2866 )),
2867 }
2868 }
2869 }
2870
2871 impl serde::ser::Serialize for ParentType {
2872 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2873 where
2874 S: serde::Serializer,
2875 {
2876 match self {
2877 Self::Unspecified => serializer.serialize_i32(0),
2878 Self::Organization => serializer.serialize_i32(1),
2879 Self::Project => serializer.serialize_i32(2),
2880 Self::UnknownValue(u) => u.0.serialize(serializer),
2881 }
2882 }
2883 }
2884
2885 impl<'de> serde::de::Deserialize<'de> for ParentType {
2886 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2887 where
2888 D: serde::Deserializer<'de>,
2889 {
2890 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ParentType>::new(
2891 ".google.cloud.securitycenter.v2.CloudDlpDataProfile.ParentType",
2892 ))
2893 }
2894 }
2895}
2896
2897/// Details about the Cloud Data Loss Prevention (Cloud DLP) [inspection
2898/// job](https://cloud.google.com/dlp/docs/concepts-job-triggers) that produced
2899/// the finding.
2900#[derive(Clone, Default, PartialEq)]
2901#[non_exhaustive]
2902pub struct CloudDlpInspection {
2903 /// Name of the inspection job, for example,
2904 /// `projects/123/locations/europe/dlpJobs/i-8383929`.
2905 pub inspect_job: std::string::String,
2906
2907 /// The type of information (or
2908 /// *[infoType](https://cloud.google.com/dlp/docs/infotypes-reference)*) found,
2909 /// for example, `EMAIL_ADDRESS` or `STREET_ADDRESS`.
2910 pub info_type: std::string::String,
2911
2912 /// The number of times Cloud DLP found this infoType within this job
2913 /// and resource.
2914 pub info_type_count: i64,
2915
2916 /// Whether Cloud DLP scanned the complete resource or a sampled subset.
2917 pub full_scan: bool,
2918
2919 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2920}
2921
2922impl CloudDlpInspection {
2923 pub fn new() -> Self {
2924 std::default::Default::default()
2925 }
2926
2927 /// Sets the value of [inspect_job][crate::model::CloudDlpInspection::inspect_job].
2928 ///
2929 /// # Example
2930 /// ```ignore,no_run
2931 /// # use google_cloud_securitycenter_v2::model::CloudDlpInspection;
2932 /// let x = CloudDlpInspection::new().set_inspect_job("example");
2933 /// ```
2934 pub fn set_inspect_job<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2935 self.inspect_job = v.into();
2936 self
2937 }
2938
2939 /// Sets the value of [info_type][crate::model::CloudDlpInspection::info_type].
2940 ///
2941 /// # Example
2942 /// ```ignore,no_run
2943 /// # use google_cloud_securitycenter_v2::model::CloudDlpInspection;
2944 /// let x = CloudDlpInspection::new().set_info_type("example");
2945 /// ```
2946 pub fn set_info_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2947 self.info_type = v.into();
2948 self
2949 }
2950
2951 /// Sets the value of [info_type_count][crate::model::CloudDlpInspection::info_type_count].
2952 ///
2953 /// # Example
2954 /// ```ignore,no_run
2955 /// # use google_cloud_securitycenter_v2::model::CloudDlpInspection;
2956 /// let x = CloudDlpInspection::new().set_info_type_count(42);
2957 /// ```
2958 pub fn set_info_type_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2959 self.info_type_count = v.into();
2960 self
2961 }
2962
2963 /// Sets the value of [full_scan][crate::model::CloudDlpInspection::full_scan].
2964 ///
2965 /// # Example
2966 /// ```ignore,no_run
2967 /// # use google_cloud_securitycenter_v2::model::CloudDlpInspection;
2968 /// let x = CloudDlpInspection::new().set_full_scan(true);
2969 /// ```
2970 pub fn set_full_scan<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2971 self.full_scan = v.into();
2972 self
2973 }
2974}
2975
2976impl wkt::message::Message for CloudDlpInspection {
2977 fn typename() -> &'static str {
2978 "type.googleapis.com/google.cloud.securitycenter.v2.CloudDlpInspection"
2979 }
2980}
2981
2982/// Contains compliance information about a security standard indicating unmet
2983/// recommendations.
2984#[derive(Clone, Default, PartialEq)]
2985#[non_exhaustive]
2986pub struct Compliance {
2987 /// Industry-wide compliance standards or benchmarks, such as CIS, PCI, and
2988 /// OWASP.
2989 pub standard: std::string::String,
2990
2991 /// Version of the standard or benchmark, for example, 1.1
2992 pub version: std::string::String,
2993
2994 /// Policies within the standard or benchmark, for example, A.12.4.1
2995 pub ids: std::vec::Vec<std::string::String>,
2996
2997 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2998}
2999
3000impl Compliance {
3001 pub fn new() -> Self {
3002 std::default::Default::default()
3003 }
3004
3005 /// Sets the value of [standard][crate::model::Compliance::standard].
3006 ///
3007 /// # Example
3008 /// ```ignore,no_run
3009 /// # use google_cloud_securitycenter_v2::model::Compliance;
3010 /// let x = Compliance::new().set_standard("example");
3011 /// ```
3012 pub fn set_standard<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3013 self.standard = v.into();
3014 self
3015 }
3016
3017 /// Sets the value of [version][crate::model::Compliance::version].
3018 ///
3019 /// # Example
3020 /// ```ignore,no_run
3021 /// # use google_cloud_securitycenter_v2::model::Compliance;
3022 /// let x = Compliance::new().set_version("example");
3023 /// ```
3024 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3025 self.version = v.into();
3026 self
3027 }
3028
3029 /// Sets the value of [ids][crate::model::Compliance::ids].
3030 ///
3031 /// # Example
3032 /// ```ignore,no_run
3033 /// # use google_cloud_securitycenter_v2::model::Compliance;
3034 /// let x = Compliance::new().set_ids(["a", "b", "c"]);
3035 /// ```
3036 pub fn set_ids<T, V>(mut self, v: T) -> Self
3037 where
3038 T: std::iter::IntoIterator<Item = V>,
3039 V: std::convert::Into<std::string::String>,
3040 {
3041 use std::iter::Iterator;
3042 self.ids = v.into_iter().map(|i| i.into()).collect();
3043 self
3044 }
3045}
3046
3047impl wkt::message::Message for Compliance {
3048 fn typename() -> &'static str {
3049 "type.googleapis.com/google.cloud.securitycenter.v2.Compliance"
3050 }
3051}
3052
3053/// Contains information about the IP connection associated with the finding.
3054#[derive(Clone, Default, PartialEq)]
3055#[non_exhaustive]
3056pub struct Connection {
3057 /// Destination IP address. Not present for sockets that are listening and not
3058 /// connected.
3059 pub destination_ip: std::string::String,
3060
3061 /// Destination port. Not present for sockets that are listening and not
3062 /// connected.
3063 pub destination_port: i32,
3064
3065 /// Source IP address.
3066 pub source_ip: std::string::String,
3067
3068 /// Source port.
3069 pub source_port: i32,
3070
3071 /// IANA Internet Protocol Number such as TCP(6) and UDP(17).
3072 pub protocol: crate::model::connection::Protocol,
3073
3074 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3075}
3076
3077impl Connection {
3078 pub fn new() -> Self {
3079 std::default::Default::default()
3080 }
3081
3082 /// Sets the value of [destination_ip][crate::model::Connection::destination_ip].
3083 ///
3084 /// # Example
3085 /// ```ignore,no_run
3086 /// # use google_cloud_securitycenter_v2::model::Connection;
3087 /// let x = Connection::new().set_destination_ip("example");
3088 /// ```
3089 pub fn set_destination_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3090 self.destination_ip = v.into();
3091 self
3092 }
3093
3094 /// Sets the value of [destination_port][crate::model::Connection::destination_port].
3095 ///
3096 /// # Example
3097 /// ```ignore,no_run
3098 /// # use google_cloud_securitycenter_v2::model::Connection;
3099 /// let x = Connection::new().set_destination_port(42);
3100 /// ```
3101 pub fn set_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3102 self.destination_port = v.into();
3103 self
3104 }
3105
3106 /// Sets the value of [source_ip][crate::model::Connection::source_ip].
3107 ///
3108 /// # Example
3109 /// ```ignore,no_run
3110 /// # use google_cloud_securitycenter_v2::model::Connection;
3111 /// let x = Connection::new().set_source_ip("example");
3112 /// ```
3113 pub fn set_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3114 self.source_ip = v.into();
3115 self
3116 }
3117
3118 /// Sets the value of [source_port][crate::model::Connection::source_port].
3119 ///
3120 /// # Example
3121 /// ```ignore,no_run
3122 /// # use google_cloud_securitycenter_v2::model::Connection;
3123 /// let x = Connection::new().set_source_port(42);
3124 /// ```
3125 pub fn set_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3126 self.source_port = v.into();
3127 self
3128 }
3129
3130 /// Sets the value of [protocol][crate::model::Connection::protocol].
3131 ///
3132 /// # Example
3133 /// ```ignore,no_run
3134 /// # use google_cloud_securitycenter_v2::model::Connection;
3135 /// use google_cloud_securitycenter_v2::model::connection::Protocol;
3136 /// let x0 = Connection::new().set_protocol(Protocol::Icmp);
3137 /// let x1 = Connection::new().set_protocol(Protocol::Tcp);
3138 /// let x2 = Connection::new().set_protocol(Protocol::Udp);
3139 /// ```
3140 pub fn set_protocol<T: std::convert::Into<crate::model::connection::Protocol>>(
3141 mut self,
3142 v: T,
3143 ) -> Self {
3144 self.protocol = v.into();
3145 self
3146 }
3147}
3148
3149impl wkt::message::Message for Connection {
3150 fn typename() -> &'static str {
3151 "type.googleapis.com/google.cloud.securitycenter.v2.Connection"
3152 }
3153}
3154
3155/// Defines additional types related to [Connection].
3156pub mod connection {
3157 #[allow(unused_imports)]
3158 use super::*;
3159
3160 /// IANA Internet Protocol Number such as TCP(6) and UDP(17).
3161 ///
3162 /// # Working with unknown values
3163 ///
3164 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3165 /// additional enum variants at any time. Adding new variants is not considered
3166 /// a breaking change. Applications should write their code in anticipation of:
3167 ///
3168 /// - New values appearing in future releases of the client library, **and**
3169 /// - New values received dynamically, without application changes.
3170 ///
3171 /// Please consult the [Working with enums] section in the user guide for some
3172 /// guidelines.
3173 ///
3174 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3175 #[derive(Clone, Debug, PartialEq)]
3176 #[non_exhaustive]
3177 pub enum Protocol {
3178 /// Unspecified protocol (not HOPOPT).
3179 Unspecified,
3180 /// Internet Control Message Protocol.
3181 Icmp,
3182 /// Transmission Control Protocol.
3183 Tcp,
3184 /// User Datagram Protocol.
3185 Udp,
3186 /// Generic Routing Encapsulation.
3187 Gre,
3188 /// Encap Security Payload.
3189 Esp,
3190 /// If set, the enum was initialized with an unknown value.
3191 ///
3192 /// Applications can examine the value using [Protocol::value] or
3193 /// [Protocol::name].
3194 UnknownValue(protocol::UnknownValue),
3195 }
3196
3197 #[doc(hidden)]
3198 pub mod protocol {
3199 #[allow(unused_imports)]
3200 use super::*;
3201 #[derive(Clone, Debug, PartialEq)]
3202 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3203 }
3204
3205 impl Protocol {
3206 /// Gets the enum value.
3207 ///
3208 /// Returns `None` if the enum contains an unknown value deserialized from
3209 /// the string representation of enums.
3210 pub fn value(&self) -> std::option::Option<i32> {
3211 match self {
3212 Self::Unspecified => std::option::Option::Some(0),
3213 Self::Icmp => std::option::Option::Some(1),
3214 Self::Tcp => std::option::Option::Some(6),
3215 Self::Udp => std::option::Option::Some(17),
3216 Self::Gre => std::option::Option::Some(47),
3217 Self::Esp => std::option::Option::Some(50),
3218 Self::UnknownValue(u) => u.0.value(),
3219 }
3220 }
3221
3222 /// Gets the enum value as a string.
3223 ///
3224 /// Returns `None` if the enum contains an unknown value deserialized from
3225 /// the integer representation of enums.
3226 pub fn name(&self) -> std::option::Option<&str> {
3227 match self {
3228 Self::Unspecified => std::option::Option::Some("PROTOCOL_UNSPECIFIED"),
3229 Self::Icmp => std::option::Option::Some("ICMP"),
3230 Self::Tcp => std::option::Option::Some("TCP"),
3231 Self::Udp => std::option::Option::Some("UDP"),
3232 Self::Gre => std::option::Option::Some("GRE"),
3233 Self::Esp => std::option::Option::Some("ESP"),
3234 Self::UnknownValue(u) => u.0.name(),
3235 }
3236 }
3237 }
3238
3239 impl std::default::Default for Protocol {
3240 fn default() -> Self {
3241 use std::convert::From;
3242 Self::from(0)
3243 }
3244 }
3245
3246 impl std::fmt::Display for Protocol {
3247 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3248 wkt::internal::display_enum(f, self.name(), self.value())
3249 }
3250 }
3251
3252 impl std::convert::From<i32> for Protocol {
3253 fn from(value: i32) -> Self {
3254 match value {
3255 0 => Self::Unspecified,
3256 1 => Self::Icmp,
3257 6 => Self::Tcp,
3258 17 => Self::Udp,
3259 47 => Self::Gre,
3260 50 => Self::Esp,
3261 _ => Self::UnknownValue(protocol::UnknownValue(
3262 wkt::internal::UnknownEnumValue::Integer(value),
3263 )),
3264 }
3265 }
3266 }
3267
3268 impl std::convert::From<&str> for Protocol {
3269 fn from(value: &str) -> Self {
3270 use std::string::ToString;
3271 match value {
3272 "PROTOCOL_UNSPECIFIED" => Self::Unspecified,
3273 "ICMP" => Self::Icmp,
3274 "TCP" => Self::Tcp,
3275 "UDP" => Self::Udp,
3276 "GRE" => Self::Gre,
3277 "ESP" => Self::Esp,
3278 _ => Self::UnknownValue(protocol::UnknownValue(
3279 wkt::internal::UnknownEnumValue::String(value.to_string()),
3280 )),
3281 }
3282 }
3283 }
3284
3285 impl serde::ser::Serialize for Protocol {
3286 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3287 where
3288 S: serde::Serializer,
3289 {
3290 match self {
3291 Self::Unspecified => serializer.serialize_i32(0),
3292 Self::Icmp => serializer.serialize_i32(1),
3293 Self::Tcp => serializer.serialize_i32(6),
3294 Self::Udp => serializer.serialize_i32(17),
3295 Self::Gre => serializer.serialize_i32(47),
3296 Self::Esp => serializer.serialize_i32(50),
3297 Self::UnknownValue(u) => u.0.serialize(serializer),
3298 }
3299 }
3300 }
3301
3302 impl<'de> serde::de::Deserialize<'de> for Protocol {
3303 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3304 where
3305 D: serde::Deserializer<'de>,
3306 {
3307 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Protocol>::new(
3308 ".google.cloud.securitycenter.v2.Connection.Protocol",
3309 ))
3310 }
3311 }
3312}
3313
3314/// Details about specific contacts
3315#[derive(Clone, Default, PartialEq)]
3316#[non_exhaustive]
3317pub struct ContactDetails {
3318 /// A list of contacts
3319 pub contacts: std::vec::Vec<crate::model::Contact>,
3320
3321 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3322}
3323
3324impl ContactDetails {
3325 pub fn new() -> Self {
3326 std::default::Default::default()
3327 }
3328
3329 /// Sets the value of [contacts][crate::model::ContactDetails::contacts].
3330 ///
3331 /// # Example
3332 /// ```ignore,no_run
3333 /// # use google_cloud_securitycenter_v2::model::ContactDetails;
3334 /// use google_cloud_securitycenter_v2::model::Contact;
3335 /// let x = ContactDetails::new()
3336 /// .set_contacts([
3337 /// Contact::default()/* use setters */,
3338 /// Contact::default()/* use (different) setters */,
3339 /// ]);
3340 /// ```
3341 pub fn set_contacts<T, V>(mut self, v: T) -> Self
3342 where
3343 T: std::iter::IntoIterator<Item = V>,
3344 V: std::convert::Into<crate::model::Contact>,
3345 {
3346 use std::iter::Iterator;
3347 self.contacts = v.into_iter().map(|i| i.into()).collect();
3348 self
3349 }
3350}
3351
3352impl wkt::message::Message for ContactDetails {
3353 fn typename() -> &'static str {
3354 "type.googleapis.com/google.cloud.securitycenter.v2.ContactDetails"
3355 }
3356}
3357
3358/// The email address of a contact.
3359#[derive(Clone, Default, PartialEq)]
3360#[non_exhaustive]
3361pub struct Contact {
3362 /// An email address. For example, "`person123@company.com`".
3363 pub email: std::string::String,
3364
3365 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3366}
3367
3368impl Contact {
3369 pub fn new() -> Self {
3370 std::default::Default::default()
3371 }
3372
3373 /// Sets the value of [email][crate::model::Contact::email].
3374 ///
3375 /// # Example
3376 /// ```ignore,no_run
3377 /// # use google_cloud_securitycenter_v2::model::Contact;
3378 /// let x = Contact::new().set_email("example");
3379 /// ```
3380 pub fn set_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3381 self.email = v.into();
3382 self
3383 }
3384}
3385
3386impl wkt::message::Message for Contact {
3387 fn typename() -> &'static str {
3388 "type.googleapis.com/google.cloud.securitycenter.v2.Contact"
3389 }
3390}
3391
3392/// Container associated with the finding.
3393#[derive(Clone, Default, PartialEq)]
3394#[non_exhaustive]
3395pub struct Container {
3396 /// Name of the container.
3397 pub name: std::string::String,
3398
3399 /// Container image URI provided when configuring a pod or container. This
3400 /// string can identify a container image version using mutable tags.
3401 pub uri: std::string::String,
3402
3403 /// Optional container image ID, if provided by the container runtime. Uniquely
3404 /// identifies the container image launched using a container image digest.
3405 pub image_id: std::string::String,
3406
3407 /// Container labels, as provided by the container runtime.
3408 pub labels: std::vec::Vec<crate::model::Label>,
3409
3410 /// The time that the container was created.
3411 pub create_time: std::option::Option<wkt::Timestamp>,
3412
3413 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3414}
3415
3416impl Container {
3417 pub fn new() -> Self {
3418 std::default::Default::default()
3419 }
3420
3421 /// Sets the value of [name][crate::model::Container::name].
3422 ///
3423 /// # Example
3424 /// ```ignore,no_run
3425 /// # use google_cloud_securitycenter_v2::model::Container;
3426 /// let x = Container::new().set_name("example");
3427 /// ```
3428 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3429 self.name = v.into();
3430 self
3431 }
3432
3433 /// Sets the value of [uri][crate::model::Container::uri].
3434 ///
3435 /// # Example
3436 /// ```ignore,no_run
3437 /// # use google_cloud_securitycenter_v2::model::Container;
3438 /// let x = Container::new().set_uri("example");
3439 /// ```
3440 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3441 self.uri = v.into();
3442 self
3443 }
3444
3445 /// Sets the value of [image_id][crate::model::Container::image_id].
3446 ///
3447 /// # Example
3448 /// ```ignore,no_run
3449 /// # use google_cloud_securitycenter_v2::model::Container;
3450 /// let x = Container::new().set_image_id("example");
3451 /// ```
3452 pub fn set_image_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3453 self.image_id = v.into();
3454 self
3455 }
3456
3457 /// Sets the value of [labels][crate::model::Container::labels].
3458 ///
3459 /// # Example
3460 /// ```ignore,no_run
3461 /// # use google_cloud_securitycenter_v2::model::Container;
3462 /// use google_cloud_securitycenter_v2::model::Label;
3463 /// let x = Container::new()
3464 /// .set_labels([
3465 /// Label::default()/* use setters */,
3466 /// Label::default()/* use (different) setters */,
3467 /// ]);
3468 /// ```
3469 pub fn set_labels<T, V>(mut self, v: T) -> Self
3470 where
3471 T: std::iter::IntoIterator<Item = V>,
3472 V: std::convert::Into<crate::model::Label>,
3473 {
3474 use std::iter::Iterator;
3475 self.labels = v.into_iter().map(|i| i.into()).collect();
3476 self
3477 }
3478
3479 /// Sets the value of [create_time][crate::model::Container::create_time].
3480 ///
3481 /// # Example
3482 /// ```ignore,no_run
3483 /// # use google_cloud_securitycenter_v2::model::Container;
3484 /// use wkt::Timestamp;
3485 /// let x = Container::new().set_create_time(Timestamp::default()/* use setters */);
3486 /// ```
3487 pub fn set_create_time<T>(mut self, v: T) -> Self
3488 where
3489 T: std::convert::Into<wkt::Timestamp>,
3490 {
3491 self.create_time = std::option::Option::Some(v.into());
3492 self
3493 }
3494
3495 /// Sets or clears the value of [create_time][crate::model::Container::create_time].
3496 ///
3497 /// # Example
3498 /// ```ignore,no_run
3499 /// # use google_cloud_securitycenter_v2::model::Container;
3500 /// use wkt::Timestamp;
3501 /// let x = Container::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3502 /// let x = Container::new().set_or_clear_create_time(None::<Timestamp>);
3503 /// ```
3504 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3505 where
3506 T: std::convert::Into<wkt::Timestamp>,
3507 {
3508 self.create_time = v.map(|x| x.into());
3509 self
3510 }
3511}
3512
3513impl wkt::message::Message for Container {
3514 fn typename() -> &'static str {
3515 "type.googleapis.com/google.cloud.securitycenter.v2.Container"
3516 }
3517}
3518
3519/// Details about a data access attempt made by a principal not authorized under
3520/// applicable data security policy.
3521#[derive(Clone, Default, PartialEq)]
3522#[non_exhaustive]
3523pub struct DataAccessEvent {
3524 /// Unique identifier for data access event.
3525 pub event_id: std::string::String,
3526
3527 /// The email address of the principal that accessed the data. The principal
3528 /// could be a user account, service account, Google group, or other.
3529 pub principal_email: std::string::String,
3530
3531 /// The operation performed by the principal to access the data.
3532 pub operation: crate::model::data_access_event::Operation,
3533
3534 /// Timestamp of data access event.
3535 pub event_time: std::option::Option<wkt::Timestamp>,
3536
3537 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3538}
3539
3540impl DataAccessEvent {
3541 pub fn new() -> Self {
3542 std::default::Default::default()
3543 }
3544
3545 /// Sets the value of [event_id][crate::model::DataAccessEvent::event_id].
3546 ///
3547 /// # Example
3548 /// ```ignore,no_run
3549 /// # use google_cloud_securitycenter_v2::model::DataAccessEvent;
3550 /// let x = DataAccessEvent::new().set_event_id("example");
3551 /// ```
3552 pub fn set_event_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3553 self.event_id = v.into();
3554 self
3555 }
3556
3557 /// Sets the value of [principal_email][crate::model::DataAccessEvent::principal_email].
3558 ///
3559 /// # Example
3560 /// ```ignore,no_run
3561 /// # use google_cloud_securitycenter_v2::model::DataAccessEvent;
3562 /// let x = DataAccessEvent::new().set_principal_email("example");
3563 /// ```
3564 pub fn set_principal_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3565 self.principal_email = v.into();
3566 self
3567 }
3568
3569 /// Sets the value of [operation][crate::model::DataAccessEvent::operation].
3570 ///
3571 /// # Example
3572 /// ```ignore,no_run
3573 /// # use google_cloud_securitycenter_v2::model::DataAccessEvent;
3574 /// use google_cloud_securitycenter_v2::model::data_access_event::Operation;
3575 /// let x0 = DataAccessEvent::new().set_operation(Operation::Read);
3576 /// let x1 = DataAccessEvent::new().set_operation(Operation::Move);
3577 /// let x2 = DataAccessEvent::new().set_operation(Operation::Copy);
3578 /// ```
3579 pub fn set_operation<T: std::convert::Into<crate::model::data_access_event::Operation>>(
3580 mut self,
3581 v: T,
3582 ) -> Self {
3583 self.operation = v.into();
3584 self
3585 }
3586
3587 /// Sets the value of [event_time][crate::model::DataAccessEvent::event_time].
3588 ///
3589 /// # Example
3590 /// ```ignore,no_run
3591 /// # use google_cloud_securitycenter_v2::model::DataAccessEvent;
3592 /// use wkt::Timestamp;
3593 /// let x = DataAccessEvent::new().set_event_time(Timestamp::default()/* use setters */);
3594 /// ```
3595 pub fn set_event_time<T>(mut self, v: T) -> Self
3596 where
3597 T: std::convert::Into<wkt::Timestamp>,
3598 {
3599 self.event_time = std::option::Option::Some(v.into());
3600 self
3601 }
3602
3603 /// Sets or clears the value of [event_time][crate::model::DataAccessEvent::event_time].
3604 ///
3605 /// # Example
3606 /// ```ignore,no_run
3607 /// # use google_cloud_securitycenter_v2::model::DataAccessEvent;
3608 /// use wkt::Timestamp;
3609 /// let x = DataAccessEvent::new().set_or_clear_event_time(Some(Timestamp::default()/* use setters */));
3610 /// let x = DataAccessEvent::new().set_or_clear_event_time(None::<Timestamp>);
3611 /// ```
3612 pub fn set_or_clear_event_time<T>(mut self, v: std::option::Option<T>) -> Self
3613 where
3614 T: std::convert::Into<wkt::Timestamp>,
3615 {
3616 self.event_time = v.map(|x| x.into());
3617 self
3618 }
3619}
3620
3621impl wkt::message::Message for DataAccessEvent {
3622 fn typename() -> &'static str {
3623 "type.googleapis.com/google.cloud.securitycenter.v2.DataAccessEvent"
3624 }
3625}
3626
3627/// Defines additional types related to [DataAccessEvent].
3628pub mod data_access_event {
3629 #[allow(unused_imports)]
3630 use super::*;
3631
3632 /// The operation of a data access event.
3633 ///
3634 /// # Working with unknown values
3635 ///
3636 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3637 /// additional enum variants at any time. Adding new variants is not considered
3638 /// a breaking change. Applications should write their code in anticipation of:
3639 ///
3640 /// - New values appearing in future releases of the client library, **and**
3641 /// - New values received dynamically, without application changes.
3642 ///
3643 /// Please consult the [Working with enums] section in the user guide for some
3644 /// guidelines.
3645 ///
3646 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3647 #[derive(Clone, Debug, PartialEq)]
3648 #[non_exhaustive]
3649 pub enum Operation {
3650 /// The operation is unspecified.
3651 Unspecified,
3652 /// Represents a read operation.
3653 Read,
3654 /// Represents a move operation.
3655 Move,
3656 /// Represents a copy operation.
3657 Copy,
3658 /// If set, the enum was initialized with an unknown value.
3659 ///
3660 /// Applications can examine the value using [Operation::value] or
3661 /// [Operation::name].
3662 UnknownValue(operation::UnknownValue),
3663 }
3664
3665 #[doc(hidden)]
3666 pub mod operation {
3667 #[allow(unused_imports)]
3668 use super::*;
3669 #[derive(Clone, Debug, PartialEq)]
3670 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3671 }
3672
3673 impl Operation {
3674 /// Gets the enum value.
3675 ///
3676 /// Returns `None` if the enum contains an unknown value deserialized from
3677 /// the string representation of enums.
3678 pub fn value(&self) -> std::option::Option<i32> {
3679 match self {
3680 Self::Unspecified => std::option::Option::Some(0),
3681 Self::Read => std::option::Option::Some(1),
3682 Self::Move => std::option::Option::Some(2),
3683 Self::Copy => std::option::Option::Some(3),
3684 Self::UnknownValue(u) => u.0.value(),
3685 }
3686 }
3687
3688 /// Gets the enum value as a string.
3689 ///
3690 /// Returns `None` if the enum contains an unknown value deserialized from
3691 /// the integer representation of enums.
3692 pub fn name(&self) -> std::option::Option<&str> {
3693 match self {
3694 Self::Unspecified => std::option::Option::Some("OPERATION_UNSPECIFIED"),
3695 Self::Read => std::option::Option::Some("READ"),
3696 Self::Move => std::option::Option::Some("MOVE"),
3697 Self::Copy => std::option::Option::Some("COPY"),
3698 Self::UnknownValue(u) => u.0.name(),
3699 }
3700 }
3701 }
3702
3703 impl std::default::Default for Operation {
3704 fn default() -> Self {
3705 use std::convert::From;
3706 Self::from(0)
3707 }
3708 }
3709
3710 impl std::fmt::Display for Operation {
3711 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3712 wkt::internal::display_enum(f, self.name(), self.value())
3713 }
3714 }
3715
3716 impl std::convert::From<i32> for Operation {
3717 fn from(value: i32) -> Self {
3718 match value {
3719 0 => Self::Unspecified,
3720 1 => Self::Read,
3721 2 => Self::Move,
3722 3 => Self::Copy,
3723 _ => Self::UnknownValue(operation::UnknownValue(
3724 wkt::internal::UnknownEnumValue::Integer(value),
3725 )),
3726 }
3727 }
3728 }
3729
3730 impl std::convert::From<&str> for Operation {
3731 fn from(value: &str) -> Self {
3732 use std::string::ToString;
3733 match value {
3734 "OPERATION_UNSPECIFIED" => Self::Unspecified,
3735 "READ" => Self::Read,
3736 "MOVE" => Self::Move,
3737 "COPY" => Self::Copy,
3738 _ => Self::UnknownValue(operation::UnknownValue(
3739 wkt::internal::UnknownEnumValue::String(value.to_string()),
3740 )),
3741 }
3742 }
3743 }
3744
3745 impl serde::ser::Serialize for Operation {
3746 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3747 where
3748 S: serde::Serializer,
3749 {
3750 match self {
3751 Self::Unspecified => serializer.serialize_i32(0),
3752 Self::Read => serializer.serialize_i32(1),
3753 Self::Move => serializer.serialize_i32(2),
3754 Self::Copy => serializer.serialize_i32(3),
3755 Self::UnknownValue(u) => u.0.serialize(serializer),
3756 }
3757 }
3758 }
3759
3760 impl<'de> serde::de::Deserialize<'de> for Operation {
3761 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3762 where
3763 D: serde::Deserializer<'de>,
3764 {
3765 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Operation>::new(
3766 ".google.cloud.securitycenter.v2.DataAccessEvent.Operation",
3767 ))
3768 }
3769 }
3770}
3771
3772/// Details about a data flow event, in which either the data is moved to or is
3773/// accessed from a non-compliant geo-location, as defined in the applicable data
3774/// security policy.
3775#[derive(Clone, Default, PartialEq)]
3776#[non_exhaustive]
3777pub struct DataFlowEvent {
3778 /// Unique identifier for data flow event.
3779 pub event_id: std::string::String,
3780
3781 /// The email address of the principal that initiated the data flow event. The
3782 /// principal could be a user account, service account, Google group, or other.
3783 pub principal_email: std::string::String,
3784
3785 /// The operation performed by the principal for the data flow event.
3786 pub operation: crate::model::data_flow_event::Operation,
3787
3788 /// Non-compliant location of the principal or the data destination.
3789 pub violated_location: std::string::String,
3790
3791 /// Timestamp of data flow event.
3792 pub event_time: std::option::Option<wkt::Timestamp>,
3793
3794 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3795}
3796
3797impl DataFlowEvent {
3798 pub fn new() -> Self {
3799 std::default::Default::default()
3800 }
3801
3802 /// Sets the value of [event_id][crate::model::DataFlowEvent::event_id].
3803 ///
3804 /// # Example
3805 /// ```ignore,no_run
3806 /// # use google_cloud_securitycenter_v2::model::DataFlowEvent;
3807 /// let x = DataFlowEvent::new().set_event_id("example");
3808 /// ```
3809 pub fn set_event_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3810 self.event_id = v.into();
3811 self
3812 }
3813
3814 /// Sets the value of [principal_email][crate::model::DataFlowEvent::principal_email].
3815 ///
3816 /// # Example
3817 /// ```ignore,no_run
3818 /// # use google_cloud_securitycenter_v2::model::DataFlowEvent;
3819 /// let x = DataFlowEvent::new().set_principal_email("example");
3820 /// ```
3821 pub fn set_principal_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3822 self.principal_email = v.into();
3823 self
3824 }
3825
3826 /// Sets the value of [operation][crate::model::DataFlowEvent::operation].
3827 ///
3828 /// # Example
3829 /// ```ignore,no_run
3830 /// # use google_cloud_securitycenter_v2::model::DataFlowEvent;
3831 /// use google_cloud_securitycenter_v2::model::data_flow_event::Operation;
3832 /// let x0 = DataFlowEvent::new().set_operation(Operation::Read);
3833 /// let x1 = DataFlowEvent::new().set_operation(Operation::Move);
3834 /// let x2 = DataFlowEvent::new().set_operation(Operation::Copy);
3835 /// ```
3836 pub fn set_operation<T: std::convert::Into<crate::model::data_flow_event::Operation>>(
3837 mut self,
3838 v: T,
3839 ) -> Self {
3840 self.operation = v.into();
3841 self
3842 }
3843
3844 /// Sets the value of [violated_location][crate::model::DataFlowEvent::violated_location].
3845 ///
3846 /// # Example
3847 /// ```ignore,no_run
3848 /// # use google_cloud_securitycenter_v2::model::DataFlowEvent;
3849 /// let x = DataFlowEvent::new().set_violated_location("example");
3850 /// ```
3851 pub fn set_violated_location<T: std::convert::Into<std::string::String>>(
3852 mut self,
3853 v: T,
3854 ) -> Self {
3855 self.violated_location = v.into();
3856 self
3857 }
3858
3859 /// Sets the value of [event_time][crate::model::DataFlowEvent::event_time].
3860 ///
3861 /// # Example
3862 /// ```ignore,no_run
3863 /// # use google_cloud_securitycenter_v2::model::DataFlowEvent;
3864 /// use wkt::Timestamp;
3865 /// let x = DataFlowEvent::new().set_event_time(Timestamp::default()/* use setters */);
3866 /// ```
3867 pub fn set_event_time<T>(mut self, v: T) -> Self
3868 where
3869 T: std::convert::Into<wkt::Timestamp>,
3870 {
3871 self.event_time = std::option::Option::Some(v.into());
3872 self
3873 }
3874
3875 /// Sets or clears the value of [event_time][crate::model::DataFlowEvent::event_time].
3876 ///
3877 /// # Example
3878 /// ```ignore,no_run
3879 /// # use google_cloud_securitycenter_v2::model::DataFlowEvent;
3880 /// use wkt::Timestamp;
3881 /// let x = DataFlowEvent::new().set_or_clear_event_time(Some(Timestamp::default()/* use setters */));
3882 /// let x = DataFlowEvent::new().set_or_clear_event_time(None::<Timestamp>);
3883 /// ```
3884 pub fn set_or_clear_event_time<T>(mut self, v: std::option::Option<T>) -> Self
3885 where
3886 T: std::convert::Into<wkt::Timestamp>,
3887 {
3888 self.event_time = v.map(|x| x.into());
3889 self
3890 }
3891}
3892
3893impl wkt::message::Message for DataFlowEvent {
3894 fn typename() -> &'static str {
3895 "type.googleapis.com/google.cloud.securitycenter.v2.DataFlowEvent"
3896 }
3897}
3898
3899/// Defines additional types related to [DataFlowEvent].
3900pub mod data_flow_event {
3901 #[allow(unused_imports)]
3902 use super::*;
3903
3904 /// The operation of a data flow event.
3905 ///
3906 /// # Working with unknown values
3907 ///
3908 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3909 /// additional enum variants at any time. Adding new variants is not considered
3910 /// a breaking change. Applications should write their code in anticipation of:
3911 ///
3912 /// - New values appearing in future releases of the client library, **and**
3913 /// - New values received dynamically, without application changes.
3914 ///
3915 /// Please consult the [Working with enums] section in the user guide for some
3916 /// guidelines.
3917 ///
3918 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3919 #[derive(Clone, Debug, PartialEq)]
3920 #[non_exhaustive]
3921 pub enum Operation {
3922 /// The operation is unspecified.
3923 Unspecified,
3924 /// Represents a read operation.
3925 Read,
3926 /// Represents a move operation.
3927 Move,
3928 /// Represents a copy operation.
3929 Copy,
3930 /// If set, the enum was initialized with an unknown value.
3931 ///
3932 /// Applications can examine the value using [Operation::value] or
3933 /// [Operation::name].
3934 UnknownValue(operation::UnknownValue),
3935 }
3936
3937 #[doc(hidden)]
3938 pub mod operation {
3939 #[allow(unused_imports)]
3940 use super::*;
3941 #[derive(Clone, Debug, PartialEq)]
3942 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3943 }
3944
3945 impl Operation {
3946 /// Gets the enum value.
3947 ///
3948 /// Returns `None` if the enum contains an unknown value deserialized from
3949 /// the string representation of enums.
3950 pub fn value(&self) -> std::option::Option<i32> {
3951 match self {
3952 Self::Unspecified => std::option::Option::Some(0),
3953 Self::Read => std::option::Option::Some(1),
3954 Self::Move => std::option::Option::Some(2),
3955 Self::Copy => std::option::Option::Some(3),
3956 Self::UnknownValue(u) => u.0.value(),
3957 }
3958 }
3959
3960 /// Gets the enum value as a string.
3961 ///
3962 /// Returns `None` if the enum contains an unknown value deserialized from
3963 /// the integer representation of enums.
3964 pub fn name(&self) -> std::option::Option<&str> {
3965 match self {
3966 Self::Unspecified => std::option::Option::Some("OPERATION_UNSPECIFIED"),
3967 Self::Read => std::option::Option::Some("READ"),
3968 Self::Move => std::option::Option::Some("MOVE"),
3969 Self::Copy => std::option::Option::Some("COPY"),
3970 Self::UnknownValue(u) => u.0.name(),
3971 }
3972 }
3973 }
3974
3975 impl std::default::Default for Operation {
3976 fn default() -> Self {
3977 use std::convert::From;
3978 Self::from(0)
3979 }
3980 }
3981
3982 impl std::fmt::Display for Operation {
3983 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3984 wkt::internal::display_enum(f, self.name(), self.value())
3985 }
3986 }
3987
3988 impl std::convert::From<i32> for Operation {
3989 fn from(value: i32) -> Self {
3990 match value {
3991 0 => Self::Unspecified,
3992 1 => Self::Read,
3993 2 => Self::Move,
3994 3 => Self::Copy,
3995 _ => Self::UnknownValue(operation::UnknownValue(
3996 wkt::internal::UnknownEnumValue::Integer(value),
3997 )),
3998 }
3999 }
4000 }
4001
4002 impl std::convert::From<&str> for Operation {
4003 fn from(value: &str) -> Self {
4004 use std::string::ToString;
4005 match value {
4006 "OPERATION_UNSPECIFIED" => Self::Unspecified,
4007 "READ" => Self::Read,
4008 "MOVE" => Self::Move,
4009 "COPY" => Self::Copy,
4010 _ => Self::UnknownValue(operation::UnknownValue(
4011 wkt::internal::UnknownEnumValue::String(value.to_string()),
4012 )),
4013 }
4014 }
4015 }
4016
4017 impl serde::ser::Serialize for Operation {
4018 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4019 where
4020 S: serde::Serializer,
4021 {
4022 match self {
4023 Self::Unspecified => serializer.serialize_i32(0),
4024 Self::Read => serializer.serialize_i32(1),
4025 Self::Move => serializer.serialize_i32(2),
4026 Self::Copy => serializer.serialize_i32(3),
4027 Self::UnknownValue(u) => u.0.serialize(serializer),
4028 }
4029 }
4030 }
4031
4032 impl<'de> serde::de::Deserialize<'de> for Operation {
4033 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4034 where
4035 D: serde::Deserializer<'de>,
4036 {
4037 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Operation>::new(
4038 ".google.cloud.securitycenter.v2.DataFlowEvent.Operation",
4039 ))
4040 }
4041 }
4042}
4043
4044/// Details about data retention deletion violations, in which the data is
4045/// non-compliant based on their retention or deletion time, as defined in the
4046/// applicable data security policy. The Data Retention Deletion (DRD) control is
4047/// a control of the DSPM (Data Security Posture Management) suite that enables
4048/// organizations to manage data retention and deletion policies in compliance
4049/// with regulations, such as GDPR and CRPA. DRD supports two primary policy
4050/// types: maximum storage length (max TTL) and minimum storage length (min TTL).
4051/// Both are aimed at helping organizations meet regulatory and data management
4052/// commitments.
4053#[derive(Clone, Default, PartialEq)]
4054#[non_exhaustive]
4055pub struct DataRetentionDeletionEvent {
4056 /// Timestamp indicating when the event was detected.
4057 pub event_detection_time: std::option::Option<wkt::Timestamp>,
4058
4059 /// Number of objects that violated the policy for this resource. If the number
4060 /// is less than 1,000, then the value of this field is the exact number. If
4061 /// the number of objects that violated the policy is greater than or equal to
4062 /// 1,000, then the value of this field is 1000.
4063 pub data_object_count: i64,
4064
4065 /// Maximum duration of retention allowed from the DRD control. This comes
4066 /// from the DRD control where users set a max TTL for their data. For example,
4067 /// suppose that a user sets the max TTL for a Cloud Storage bucket to 90 days.
4068 /// However, an object in that bucket is 100 days old. In this case, a
4069 /// DataRetentionDeletionEvent will be generated for that Cloud Storage bucket,
4070 /// and the max_retention_allowed is 90 days.
4071 pub max_retention_allowed: std::option::Option<wkt::Duration>,
4072
4073 /// Type of the DRD event.
4074 pub event_type: crate::model::data_retention_deletion_event::EventType,
4075
4076 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4077}
4078
4079impl DataRetentionDeletionEvent {
4080 pub fn new() -> Self {
4081 std::default::Default::default()
4082 }
4083
4084 /// Sets the value of [event_detection_time][crate::model::DataRetentionDeletionEvent::event_detection_time].
4085 ///
4086 /// # Example
4087 /// ```ignore,no_run
4088 /// # use google_cloud_securitycenter_v2::model::DataRetentionDeletionEvent;
4089 /// use wkt::Timestamp;
4090 /// let x = DataRetentionDeletionEvent::new().set_event_detection_time(Timestamp::default()/* use setters */);
4091 /// ```
4092 pub fn set_event_detection_time<T>(mut self, v: T) -> Self
4093 where
4094 T: std::convert::Into<wkt::Timestamp>,
4095 {
4096 self.event_detection_time = std::option::Option::Some(v.into());
4097 self
4098 }
4099
4100 /// Sets or clears the value of [event_detection_time][crate::model::DataRetentionDeletionEvent::event_detection_time].
4101 ///
4102 /// # Example
4103 /// ```ignore,no_run
4104 /// # use google_cloud_securitycenter_v2::model::DataRetentionDeletionEvent;
4105 /// use wkt::Timestamp;
4106 /// let x = DataRetentionDeletionEvent::new().set_or_clear_event_detection_time(Some(Timestamp::default()/* use setters */));
4107 /// let x = DataRetentionDeletionEvent::new().set_or_clear_event_detection_time(None::<Timestamp>);
4108 /// ```
4109 pub fn set_or_clear_event_detection_time<T>(mut self, v: std::option::Option<T>) -> Self
4110 where
4111 T: std::convert::Into<wkt::Timestamp>,
4112 {
4113 self.event_detection_time = v.map(|x| x.into());
4114 self
4115 }
4116
4117 /// Sets the value of [data_object_count][crate::model::DataRetentionDeletionEvent::data_object_count].
4118 ///
4119 /// # Example
4120 /// ```ignore,no_run
4121 /// # use google_cloud_securitycenter_v2::model::DataRetentionDeletionEvent;
4122 /// let x = DataRetentionDeletionEvent::new().set_data_object_count(42);
4123 /// ```
4124 pub fn set_data_object_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4125 self.data_object_count = v.into();
4126 self
4127 }
4128
4129 /// Sets the value of [max_retention_allowed][crate::model::DataRetentionDeletionEvent::max_retention_allowed].
4130 ///
4131 /// # Example
4132 /// ```ignore,no_run
4133 /// # use google_cloud_securitycenter_v2::model::DataRetentionDeletionEvent;
4134 /// use wkt::Duration;
4135 /// let x = DataRetentionDeletionEvent::new().set_max_retention_allowed(Duration::default()/* use setters */);
4136 /// ```
4137 pub fn set_max_retention_allowed<T>(mut self, v: T) -> Self
4138 where
4139 T: std::convert::Into<wkt::Duration>,
4140 {
4141 self.max_retention_allowed = std::option::Option::Some(v.into());
4142 self
4143 }
4144
4145 /// Sets or clears the value of [max_retention_allowed][crate::model::DataRetentionDeletionEvent::max_retention_allowed].
4146 ///
4147 /// # Example
4148 /// ```ignore,no_run
4149 /// # use google_cloud_securitycenter_v2::model::DataRetentionDeletionEvent;
4150 /// use wkt::Duration;
4151 /// let x = DataRetentionDeletionEvent::new().set_or_clear_max_retention_allowed(Some(Duration::default()/* use setters */));
4152 /// let x = DataRetentionDeletionEvent::new().set_or_clear_max_retention_allowed(None::<Duration>);
4153 /// ```
4154 pub fn set_or_clear_max_retention_allowed<T>(mut self, v: std::option::Option<T>) -> Self
4155 where
4156 T: std::convert::Into<wkt::Duration>,
4157 {
4158 self.max_retention_allowed = v.map(|x| x.into());
4159 self
4160 }
4161
4162 /// Sets the value of [event_type][crate::model::DataRetentionDeletionEvent::event_type].
4163 ///
4164 /// # Example
4165 /// ```ignore,no_run
4166 /// # use google_cloud_securitycenter_v2::model::DataRetentionDeletionEvent;
4167 /// use google_cloud_securitycenter_v2::model::data_retention_deletion_event::EventType;
4168 /// let x0 = DataRetentionDeletionEvent::new().set_event_type(EventType::MaxTtlExceeded);
4169 /// ```
4170 pub fn set_event_type<
4171 T: std::convert::Into<crate::model::data_retention_deletion_event::EventType>,
4172 >(
4173 mut self,
4174 v: T,
4175 ) -> Self {
4176 self.event_type = v.into();
4177 self
4178 }
4179}
4180
4181impl wkt::message::Message for DataRetentionDeletionEvent {
4182 fn typename() -> &'static str {
4183 "type.googleapis.com/google.cloud.securitycenter.v2.DataRetentionDeletionEvent"
4184 }
4185}
4186
4187/// Defines additional types related to [DataRetentionDeletionEvent].
4188pub mod data_retention_deletion_event {
4189 #[allow(unused_imports)]
4190 use super::*;
4191
4192 /// Type of the DRD event.
4193 ///
4194 /// # Working with unknown values
4195 ///
4196 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4197 /// additional enum variants at any time. Adding new variants is not considered
4198 /// a breaking change. Applications should write their code in anticipation of:
4199 ///
4200 /// - New values appearing in future releases of the client library, **and**
4201 /// - New values received dynamically, without application changes.
4202 ///
4203 /// Please consult the [Working with enums] section in the user guide for some
4204 /// guidelines.
4205 ///
4206 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4207 #[derive(Clone, Debug, PartialEq)]
4208 #[non_exhaustive]
4209 pub enum EventType {
4210 /// Unspecified event type.
4211 Unspecified,
4212 /// The maximum retention time has been exceeded.
4213 MaxTtlExceeded,
4214 /// If set, the enum was initialized with an unknown value.
4215 ///
4216 /// Applications can examine the value using [EventType::value] or
4217 /// [EventType::name].
4218 UnknownValue(event_type::UnknownValue),
4219 }
4220
4221 #[doc(hidden)]
4222 pub mod event_type {
4223 #[allow(unused_imports)]
4224 use super::*;
4225 #[derive(Clone, Debug, PartialEq)]
4226 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4227 }
4228
4229 impl EventType {
4230 /// Gets the enum value.
4231 ///
4232 /// Returns `None` if the enum contains an unknown value deserialized from
4233 /// the string representation of enums.
4234 pub fn value(&self) -> std::option::Option<i32> {
4235 match self {
4236 Self::Unspecified => std::option::Option::Some(0),
4237 Self::MaxTtlExceeded => std::option::Option::Some(1),
4238 Self::UnknownValue(u) => u.0.value(),
4239 }
4240 }
4241
4242 /// Gets the enum value as a string.
4243 ///
4244 /// Returns `None` if the enum contains an unknown value deserialized from
4245 /// the integer representation of enums.
4246 pub fn name(&self) -> std::option::Option<&str> {
4247 match self {
4248 Self::Unspecified => std::option::Option::Some("EVENT_TYPE_UNSPECIFIED"),
4249 Self::MaxTtlExceeded => std::option::Option::Some("EVENT_TYPE_MAX_TTL_EXCEEDED"),
4250 Self::UnknownValue(u) => u.0.name(),
4251 }
4252 }
4253 }
4254
4255 impl std::default::Default for EventType {
4256 fn default() -> Self {
4257 use std::convert::From;
4258 Self::from(0)
4259 }
4260 }
4261
4262 impl std::fmt::Display for EventType {
4263 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4264 wkt::internal::display_enum(f, self.name(), self.value())
4265 }
4266 }
4267
4268 impl std::convert::From<i32> for EventType {
4269 fn from(value: i32) -> Self {
4270 match value {
4271 0 => Self::Unspecified,
4272 1 => Self::MaxTtlExceeded,
4273 _ => Self::UnknownValue(event_type::UnknownValue(
4274 wkt::internal::UnknownEnumValue::Integer(value),
4275 )),
4276 }
4277 }
4278 }
4279
4280 impl std::convert::From<&str> for EventType {
4281 fn from(value: &str) -> Self {
4282 use std::string::ToString;
4283 match value {
4284 "EVENT_TYPE_UNSPECIFIED" => Self::Unspecified,
4285 "EVENT_TYPE_MAX_TTL_EXCEEDED" => Self::MaxTtlExceeded,
4286 _ => Self::UnknownValue(event_type::UnknownValue(
4287 wkt::internal::UnknownEnumValue::String(value.to_string()),
4288 )),
4289 }
4290 }
4291 }
4292
4293 impl serde::ser::Serialize for EventType {
4294 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4295 where
4296 S: serde::Serializer,
4297 {
4298 match self {
4299 Self::Unspecified => serializer.serialize_i32(0),
4300 Self::MaxTtlExceeded => serializer.serialize_i32(1),
4301 Self::UnknownValue(u) => u.0.serialize(serializer),
4302 }
4303 }
4304 }
4305
4306 impl<'de> serde::de::Deserialize<'de> for EventType {
4307 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4308 where
4309 D: serde::Deserializer<'de>,
4310 {
4311 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EventType>::new(
4312 ".google.cloud.securitycenter.v2.DataRetentionDeletionEvent.EventType",
4313 ))
4314 }
4315 }
4316}
4317
4318/// Represents database access information, such as queries. A database may be a
4319/// sub-resource of an instance (as in the case of Cloud SQL instances or Cloud
4320/// Spanner instances), or the database instance itself. Some database resources
4321/// might not have the [full resource
4322/// name](https://google.aip.dev/122#full-resource-names) populated because these
4323/// resource types, such as Cloud SQL databases, are not yet supported by Cloud
4324/// Asset Inventory. In these cases only the display name is provided.
4325#[derive(Clone, Default, PartialEq)]
4326#[non_exhaustive]
4327pub struct Database {
4328 /// Some database resources may not have the [full resource
4329 /// name](https://google.aip.dev/122#full-resource-names) populated because
4330 /// these resource types are not yet supported by Cloud Asset Inventory (e.g.
4331 /// Cloud SQL databases). In these cases only the display name will be
4332 /// provided.
4333 /// The [full resource name](https://google.aip.dev/122#full-resource-names) of
4334 /// the database that the user connected to, if it is supported by Cloud Asset
4335 /// Inventory.
4336 pub name: std::string::String,
4337
4338 /// The human-readable name of the database that the user connected to.
4339 pub display_name: std::string::String,
4340
4341 /// The username used to connect to the database. The username might not be an
4342 /// IAM principal and does not have a set format.
4343 pub user_name: std::string::String,
4344
4345 /// The SQL statement that is associated with the database access.
4346 pub query: std::string::String,
4347
4348 /// The target usernames, roles, or groups of an SQL privilege grant, which is
4349 /// not an IAM policy change.
4350 pub grantees: std::vec::Vec<std::string::String>,
4351
4352 /// The version of the database, for example, POSTGRES_14.
4353 /// See [the complete
4354 /// list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
4355 pub version: std::string::String,
4356
4357 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4358}
4359
4360impl Database {
4361 pub fn new() -> Self {
4362 std::default::Default::default()
4363 }
4364
4365 /// Sets the value of [name][crate::model::Database::name].
4366 ///
4367 /// # Example
4368 /// ```ignore,no_run
4369 /// # use google_cloud_securitycenter_v2::model::Database;
4370 /// let x = Database::new().set_name("example");
4371 /// ```
4372 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4373 self.name = v.into();
4374 self
4375 }
4376
4377 /// Sets the value of [display_name][crate::model::Database::display_name].
4378 ///
4379 /// # Example
4380 /// ```ignore,no_run
4381 /// # use google_cloud_securitycenter_v2::model::Database;
4382 /// let x = Database::new().set_display_name("example");
4383 /// ```
4384 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4385 self.display_name = v.into();
4386 self
4387 }
4388
4389 /// Sets the value of [user_name][crate::model::Database::user_name].
4390 ///
4391 /// # Example
4392 /// ```ignore,no_run
4393 /// # use google_cloud_securitycenter_v2::model::Database;
4394 /// let x = Database::new().set_user_name("example");
4395 /// ```
4396 pub fn set_user_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4397 self.user_name = v.into();
4398 self
4399 }
4400
4401 /// Sets the value of [query][crate::model::Database::query].
4402 ///
4403 /// # Example
4404 /// ```ignore,no_run
4405 /// # use google_cloud_securitycenter_v2::model::Database;
4406 /// let x = Database::new().set_query("example");
4407 /// ```
4408 pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4409 self.query = v.into();
4410 self
4411 }
4412
4413 /// Sets the value of [grantees][crate::model::Database::grantees].
4414 ///
4415 /// # Example
4416 /// ```ignore,no_run
4417 /// # use google_cloud_securitycenter_v2::model::Database;
4418 /// let x = Database::new().set_grantees(["a", "b", "c"]);
4419 /// ```
4420 pub fn set_grantees<T, V>(mut self, v: T) -> Self
4421 where
4422 T: std::iter::IntoIterator<Item = V>,
4423 V: std::convert::Into<std::string::String>,
4424 {
4425 use std::iter::Iterator;
4426 self.grantees = v.into_iter().map(|i| i.into()).collect();
4427 self
4428 }
4429
4430 /// Sets the value of [version][crate::model::Database::version].
4431 ///
4432 /// # Example
4433 /// ```ignore,no_run
4434 /// # use google_cloud_securitycenter_v2::model::Database;
4435 /// let x = Database::new().set_version("example");
4436 /// ```
4437 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4438 self.version = v.into();
4439 self
4440 }
4441}
4442
4443impl wkt::message::Message for Database {
4444 fn typename() -> &'static str {
4445 "type.googleapis.com/google.cloud.securitycenter.v2.Database"
4446 }
4447}
4448
4449/// Contains information about the disk associated with the finding.
4450#[derive(Clone, Default, PartialEq)]
4451#[non_exhaustive]
4452pub struct Disk {
4453 /// The name of the disk, for example,
4454 /// `https://www.googleapis.com/compute/v1/projects/{project-id}/zones/{zone-id}/disks/{disk-id}`.
4455 pub name: std::string::String,
4456
4457 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4458}
4459
4460impl Disk {
4461 pub fn new() -> Self {
4462 std::default::Default::default()
4463 }
4464
4465 /// Sets the value of [name][crate::model::Disk::name].
4466 ///
4467 /// # Example
4468 /// ```ignore,no_run
4469 /// # use google_cloud_securitycenter_v2::model::Disk;
4470 /// let x = Disk::new().set_name("example");
4471 /// ```
4472 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4473 self.name = v.into();
4474 self
4475 }
4476}
4477
4478impl wkt::message::Message for Disk {
4479 fn typename() -> &'static str {
4480 "type.googleapis.com/google.cloud.securitycenter.v2.Disk"
4481 }
4482}
4483
4484/// Exfiltration represents a data exfiltration attempt from one or more sources
4485/// to one or more targets. The `sources` attribute lists the sources of the
4486/// exfiltrated data. The `targets` attribute lists the destinations the data was
4487/// copied to.
4488#[derive(Clone, Default, PartialEq)]
4489#[non_exhaustive]
4490pub struct Exfiltration {
4491 /// If there are multiple sources, then the data is considered "joined" between
4492 /// them. For instance, BigQuery can join multiple tables, and each
4493 /// table would be considered a source.
4494 pub sources: std::vec::Vec<crate::model::ExfilResource>,
4495
4496 /// If there are multiple targets, each target would get a complete copy of the
4497 /// "joined" source data.
4498 pub targets: std::vec::Vec<crate::model::ExfilResource>,
4499
4500 /// Total exfiltrated bytes processed for the entire job.
4501 pub total_exfiltrated_bytes: i64,
4502
4503 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4504}
4505
4506impl Exfiltration {
4507 pub fn new() -> Self {
4508 std::default::Default::default()
4509 }
4510
4511 /// Sets the value of [sources][crate::model::Exfiltration::sources].
4512 ///
4513 /// # Example
4514 /// ```ignore,no_run
4515 /// # use google_cloud_securitycenter_v2::model::Exfiltration;
4516 /// use google_cloud_securitycenter_v2::model::ExfilResource;
4517 /// let x = Exfiltration::new()
4518 /// .set_sources([
4519 /// ExfilResource::default()/* use setters */,
4520 /// ExfilResource::default()/* use (different) setters */,
4521 /// ]);
4522 /// ```
4523 pub fn set_sources<T, V>(mut self, v: T) -> Self
4524 where
4525 T: std::iter::IntoIterator<Item = V>,
4526 V: std::convert::Into<crate::model::ExfilResource>,
4527 {
4528 use std::iter::Iterator;
4529 self.sources = v.into_iter().map(|i| i.into()).collect();
4530 self
4531 }
4532
4533 /// Sets the value of [targets][crate::model::Exfiltration::targets].
4534 ///
4535 /// # Example
4536 /// ```ignore,no_run
4537 /// # use google_cloud_securitycenter_v2::model::Exfiltration;
4538 /// use google_cloud_securitycenter_v2::model::ExfilResource;
4539 /// let x = Exfiltration::new()
4540 /// .set_targets([
4541 /// ExfilResource::default()/* use setters */,
4542 /// ExfilResource::default()/* use (different) setters */,
4543 /// ]);
4544 /// ```
4545 pub fn set_targets<T, V>(mut self, v: T) -> Self
4546 where
4547 T: std::iter::IntoIterator<Item = V>,
4548 V: std::convert::Into<crate::model::ExfilResource>,
4549 {
4550 use std::iter::Iterator;
4551 self.targets = v.into_iter().map(|i| i.into()).collect();
4552 self
4553 }
4554
4555 /// Sets the value of [total_exfiltrated_bytes][crate::model::Exfiltration::total_exfiltrated_bytes].
4556 ///
4557 /// # Example
4558 /// ```ignore,no_run
4559 /// # use google_cloud_securitycenter_v2::model::Exfiltration;
4560 /// let x = Exfiltration::new().set_total_exfiltrated_bytes(42);
4561 /// ```
4562 pub fn set_total_exfiltrated_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4563 self.total_exfiltrated_bytes = v.into();
4564 self
4565 }
4566}
4567
4568impl wkt::message::Message for Exfiltration {
4569 fn typename() -> &'static str {
4570 "type.googleapis.com/google.cloud.securitycenter.v2.Exfiltration"
4571 }
4572}
4573
4574/// Resource where data was exfiltrated from or exfiltrated to.
4575#[derive(Clone, Default, PartialEq)]
4576#[non_exhaustive]
4577pub struct ExfilResource {
4578 /// The resource's [full resource
4579 /// name](https://cloud.google.com/apis/design/resource_names#full_resource_name).
4580 pub name: std::string::String,
4581
4582 /// Subcomponents of the asset that was exfiltrated, like URIs used during
4583 /// exfiltration, table names, databases, and filenames. For example, multiple
4584 /// tables might have been exfiltrated from the same Cloud SQL instance, or
4585 /// multiple files might have been exfiltrated from the same Cloud Storage
4586 /// bucket.
4587 pub components: std::vec::Vec<std::string::String>,
4588
4589 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4590}
4591
4592impl ExfilResource {
4593 pub fn new() -> Self {
4594 std::default::Default::default()
4595 }
4596
4597 /// Sets the value of [name][crate::model::ExfilResource::name].
4598 ///
4599 /// # Example
4600 /// ```ignore,no_run
4601 /// # use google_cloud_securitycenter_v2::model::ExfilResource;
4602 /// let x = ExfilResource::new().set_name("example");
4603 /// ```
4604 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4605 self.name = v.into();
4606 self
4607 }
4608
4609 /// Sets the value of [components][crate::model::ExfilResource::components].
4610 ///
4611 /// # Example
4612 /// ```ignore,no_run
4613 /// # use google_cloud_securitycenter_v2::model::ExfilResource;
4614 /// let x = ExfilResource::new().set_components(["a", "b", "c"]);
4615 /// ```
4616 pub fn set_components<T, V>(mut self, v: T) -> Self
4617 where
4618 T: std::iter::IntoIterator<Item = V>,
4619 V: std::convert::Into<std::string::String>,
4620 {
4621 use std::iter::Iterator;
4622 self.components = v.into_iter().map(|i| i.into()).collect();
4623 self
4624 }
4625}
4626
4627impl wkt::message::Message for ExfilResource {
4628 fn typename() -> &'static str {
4629 "type.googleapis.com/google.cloud.securitycenter.v2.ExfilResource"
4630 }
4631}
4632
4633/// Representation of third party SIEM/SOAR fields within SCC.
4634#[derive(Clone, Default, PartialEq)]
4635#[non_exhaustive]
4636pub struct ExternalSystem {
4637 /// Full resource name of the external system. The following list
4638 /// shows some examples:
4639 ///
4640 /// + `organizations/1234/sources/5678/findings/123456/externalSystems/jira`
4641 ///
4642 /// `organizations/1234/sources/5678/locations/us/findings/123456/externalSystems/jira`
4643 ///
4644 /// + `folders/1234/sources/5678/findings/123456/externalSystems/jira`
4645 ///
4646 /// `folders/1234/sources/5678/locations/us/findings/123456/externalSystems/jira`
4647 ///
4648 /// + `projects/1234/sources/5678/findings/123456/externalSystems/jira`
4649 ///
4650 /// `projects/1234/sources/5678/locations/us/findings/123456/externalSystems/jira`
4651 pub name: std::string::String,
4652
4653 /// References primary/secondary etc assignees in the external system.
4654 pub assignees: std::vec::Vec<std::string::String>,
4655
4656 /// The identifier that's used to track the finding's corresponding case in the
4657 /// external system.
4658 pub external_uid: std::string::String,
4659
4660 /// The most recent status of the finding's corresponding case, as reported by
4661 /// the external system.
4662 pub status: std::string::String,
4663
4664 /// The time when the case was last updated, as reported by the external
4665 /// system.
4666 pub external_system_update_time: std::option::Option<wkt::Timestamp>,
4667
4668 /// The link to the finding's corresponding case in the external system.
4669 pub case_uri: std::string::String,
4670
4671 /// The priority of the finding's corresponding case in the external system.
4672 pub case_priority: std::string::String,
4673
4674 /// The SLA of the finding's corresponding case in the external system.
4675 pub case_sla: std::option::Option<wkt::Timestamp>,
4676
4677 /// The time when the case was created, as reported by the external system.
4678 pub case_create_time: std::option::Option<wkt::Timestamp>,
4679
4680 /// The time when the case was closed, as reported by the external system.
4681 pub case_close_time: std::option::Option<wkt::Timestamp>,
4682
4683 /// Information about the ticket, if any, that is being used to track the
4684 /// resolution of the issue that is identified by this finding.
4685 pub ticket_info: std::option::Option<crate::model::external_system::TicketInfo>,
4686
4687 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4688}
4689
4690impl ExternalSystem {
4691 pub fn new() -> Self {
4692 std::default::Default::default()
4693 }
4694
4695 /// Sets the value of [name][crate::model::ExternalSystem::name].
4696 ///
4697 /// # Example
4698 /// ```ignore,no_run
4699 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4700 /// let x = ExternalSystem::new().set_name("example");
4701 /// ```
4702 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4703 self.name = v.into();
4704 self
4705 }
4706
4707 /// Sets the value of [assignees][crate::model::ExternalSystem::assignees].
4708 ///
4709 /// # Example
4710 /// ```ignore,no_run
4711 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4712 /// let x = ExternalSystem::new().set_assignees(["a", "b", "c"]);
4713 /// ```
4714 pub fn set_assignees<T, V>(mut self, v: T) -> Self
4715 where
4716 T: std::iter::IntoIterator<Item = V>,
4717 V: std::convert::Into<std::string::String>,
4718 {
4719 use std::iter::Iterator;
4720 self.assignees = v.into_iter().map(|i| i.into()).collect();
4721 self
4722 }
4723
4724 /// Sets the value of [external_uid][crate::model::ExternalSystem::external_uid].
4725 ///
4726 /// # Example
4727 /// ```ignore,no_run
4728 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4729 /// let x = ExternalSystem::new().set_external_uid("example");
4730 /// ```
4731 pub fn set_external_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4732 self.external_uid = v.into();
4733 self
4734 }
4735
4736 /// Sets the value of [status][crate::model::ExternalSystem::status].
4737 ///
4738 /// # Example
4739 /// ```ignore,no_run
4740 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4741 /// let x = ExternalSystem::new().set_status("example");
4742 /// ```
4743 pub fn set_status<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4744 self.status = v.into();
4745 self
4746 }
4747
4748 /// Sets the value of [external_system_update_time][crate::model::ExternalSystem::external_system_update_time].
4749 ///
4750 /// # Example
4751 /// ```ignore,no_run
4752 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4753 /// use wkt::Timestamp;
4754 /// let x = ExternalSystem::new().set_external_system_update_time(Timestamp::default()/* use setters */);
4755 /// ```
4756 pub fn set_external_system_update_time<T>(mut self, v: T) -> Self
4757 where
4758 T: std::convert::Into<wkt::Timestamp>,
4759 {
4760 self.external_system_update_time = std::option::Option::Some(v.into());
4761 self
4762 }
4763
4764 /// Sets or clears the value of [external_system_update_time][crate::model::ExternalSystem::external_system_update_time].
4765 ///
4766 /// # Example
4767 /// ```ignore,no_run
4768 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4769 /// use wkt::Timestamp;
4770 /// let x = ExternalSystem::new().set_or_clear_external_system_update_time(Some(Timestamp::default()/* use setters */));
4771 /// let x = ExternalSystem::new().set_or_clear_external_system_update_time(None::<Timestamp>);
4772 /// ```
4773 pub fn set_or_clear_external_system_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4774 where
4775 T: std::convert::Into<wkt::Timestamp>,
4776 {
4777 self.external_system_update_time = v.map(|x| x.into());
4778 self
4779 }
4780
4781 /// Sets the value of [case_uri][crate::model::ExternalSystem::case_uri].
4782 ///
4783 /// # Example
4784 /// ```ignore,no_run
4785 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4786 /// let x = ExternalSystem::new().set_case_uri("example");
4787 /// ```
4788 pub fn set_case_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4789 self.case_uri = v.into();
4790 self
4791 }
4792
4793 /// Sets the value of [case_priority][crate::model::ExternalSystem::case_priority].
4794 ///
4795 /// # Example
4796 /// ```ignore,no_run
4797 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4798 /// let x = ExternalSystem::new().set_case_priority("example");
4799 /// ```
4800 pub fn set_case_priority<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4801 self.case_priority = v.into();
4802 self
4803 }
4804
4805 /// Sets the value of [case_sla][crate::model::ExternalSystem::case_sla].
4806 ///
4807 /// # Example
4808 /// ```ignore,no_run
4809 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4810 /// use wkt::Timestamp;
4811 /// let x = ExternalSystem::new().set_case_sla(Timestamp::default()/* use setters */);
4812 /// ```
4813 pub fn set_case_sla<T>(mut self, v: T) -> Self
4814 where
4815 T: std::convert::Into<wkt::Timestamp>,
4816 {
4817 self.case_sla = std::option::Option::Some(v.into());
4818 self
4819 }
4820
4821 /// Sets or clears the value of [case_sla][crate::model::ExternalSystem::case_sla].
4822 ///
4823 /// # Example
4824 /// ```ignore,no_run
4825 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4826 /// use wkt::Timestamp;
4827 /// let x = ExternalSystem::new().set_or_clear_case_sla(Some(Timestamp::default()/* use setters */));
4828 /// let x = ExternalSystem::new().set_or_clear_case_sla(None::<Timestamp>);
4829 /// ```
4830 pub fn set_or_clear_case_sla<T>(mut self, v: std::option::Option<T>) -> Self
4831 where
4832 T: std::convert::Into<wkt::Timestamp>,
4833 {
4834 self.case_sla = v.map(|x| x.into());
4835 self
4836 }
4837
4838 /// Sets the value of [case_create_time][crate::model::ExternalSystem::case_create_time].
4839 ///
4840 /// # Example
4841 /// ```ignore,no_run
4842 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4843 /// use wkt::Timestamp;
4844 /// let x = ExternalSystem::new().set_case_create_time(Timestamp::default()/* use setters */);
4845 /// ```
4846 pub fn set_case_create_time<T>(mut self, v: T) -> Self
4847 where
4848 T: std::convert::Into<wkt::Timestamp>,
4849 {
4850 self.case_create_time = std::option::Option::Some(v.into());
4851 self
4852 }
4853
4854 /// Sets or clears the value of [case_create_time][crate::model::ExternalSystem::case_create_time].
4855 ///
4856 /// # Example
4857 /// ```ignore,no_run
4858 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4859 /// use wkt::Timestamp;
4860 /// let x = ExternalSystem::new().set_or_clear_case_create_time(Some(Timestamp::default()/* use setters */));
4861 /// let x = ExternalSystem::new().set_or_clear_case_create_time(None::<Timestamp>);
4862 /// ```
4863 pub fn set_or_clear_case_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4864 where
4865 T: std::convert::Into<wkt::Timestamp>,
4866 {
4867 self.case_create_time = v.map(|x| x.into());
4868 self
4869 }
4870
4871 /// Sets the value of [case_close_time][crate::model::ExternalSystem::case_close_time].
4872 ///
4873 /// # Example
4874 /// ```ignore,no_run
4875 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4876 /// use wkt::Timestamp;
4877 /// let x = ExternalSystem::new().set_case_close_time(Timestamp::default()/* use setters */);
4878 /// ```
4879 pub fn set_case_close_time<T>(mut self, v: T) -> Self
4880 where
4881 T: std::convert::Into<wkt::Timestamp>,
4882 {
4883 self.case_close_time = std::option::Option::Some(v.into());
4884 self
4885 }
4886
4887 /// Sets or clears the value of [case_close_time][crate::model::ExternalSystem::case_close_time].
4888 ///
4889 /// # Example
4890 /// ```ignore,no_run
4891 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4892 /// use wkt::Timestamp;
4893 /// let x = ExternalSystem::new().set_or_clear_case_close_time(Some(Timestamp::default()/* use setters */));
4894 /// let x = ExternalSystem::new().set_or_clear_case_close_time(None::<Timestamp>);
4895 /// ```
4896 pub fn set_or_clear_case_close_time<T>(mut self, v: std::option::Option<T>) -> Self
4897 where
4898 T: std::convert::Into<wkt::Timestamp>,
4899 {
4900 self.case_close_time = v.map(|x| x.into());
4901 self
4902 }
4903
4904 /// Sets the value of [ticket_info][crate::model::ExternalSystem::ticket_info].
4905 ///
4906 /// # Example
4907 /// ```ignore,no_run
4908 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4909 /// use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
4910 /// let x = ExternalSystem::new().set_ticket_info(TicketInfo::default()/* use setters */);
4911 /// ```
4912 pub fn set_ticket_info<T>(mut self, v: T) -> Self
4913 where
4914 T: std::convert::Into<crate::model::external_system::TicketInfo>,
4915 {
4916 self.ticket_info = std::option::Option::Some(v.into());
4917 self
4918 }
4919
4920 /// Sets or clears the value of [ticket_info][crate::model::ExternalSystem::ticket_info].
4921 ///
4922 /// # Example
4923 /// ```ignore,no_run
4924 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4925 /// use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
4926 /// let x = ExternalSystem::new().set_or_clear_ticket_info(Some(TicketInfo::default()/* use setters */));
4927 /// let x = ExternalSystem::new().set_or_clear_ticket_info(None::<TicketInfo>);
4928 /// ```
4929 pub fn set_or_clear_ticket_info<T>(mut self, v: std::option::Option<T>) -> Self
4930 where
4931 T: std::convert::Into<crate::model::external_system::TicketInfo>,
4932 {
4933 self.ticket_info = v.map(|x| x.into());
4934 self
4935 }
4936}
4937
4938impl wkt::message::Message for ExternalSystem {
4939 fn typename() -> &'static str {
4940 "type.googleapis.com/google.cloud.securitycenter.v2.ExternalSystem"
4941 }
4942}
4943
4944/// Defines additional types related to [ExternalSystem].
4945pub mod external_system {
4946 #[allow(unused_imports)]
4947 use super::*;
4948
4949 /// Information about the ticket, if any, that is being used to track the
4950 /// resolution of the issue that is identified by this finding.
4951 #[derive(Clone, Default, PartialEq)]
4952 #[non_exhaustive]
4953 pub struct TicketInfo {
4954 /// The identifier of the ticket in the ticket system.
4955 pub id: std::string::String,
4956
4957 /// The assignee of the ticket in the ticket system.
4958 pub assignee: std::string::String,
4959
4960 /// The description of the ticket in the ticket system.
4961 pub description: std::string::String,
4962
4963 /// The link to the ticket in the ticket system.
4964 pub uri: std::string::String,
4965
4966 /// The latest status of the ticket, as reported by the ticket system.
4967 pub status: std::string::String,
4968
4969 /// The time when the ticket was last updated, as reported by the ticket
4970 /// system.
4971 pub update_time: std::option::Option<wkt::Timestamp>,
4972
4973 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4974 }
4975
4976 impl TicketInfo {
4977 pub fn new() -> Self {
4978 std::default::Default::default()
4979 }
4980
4981 /// Sets the value of [id][crate::model::external_system::TicketInfo::id].
4982 ///
4983 /// # Example
4984 /// ```ignore,no_run
4985 /// # use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
4986 /// let x = TicketInfo::new().set_id("example");
4987 /// ```
4988 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4989 self.id = v.into();
4990 self
4991 }
4992
4993 /// Sets the value of [assignee][crate::model::external_system::TicketInfo::assignee].
4994 ///
4995 /// # Example
4996 /// ```ignore,no_run
4997 /// # use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
4998 /// let x = TicketInfo::new().set_assignee("example");
4999 /// ```
5000 pub fn set_assignee<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5001 self.assignee = v.into();
5002 self
5003 }
5004
5005 /// Sets the value of [description][crate::model::external_system::TicketInfo::description].
5006 ///
5007 /// # Example
5008 /// ```ignore,no_run
5009 /// # use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
5010 /// let x = TicketInfo::new().set_description("example");
5011 /// ```
5012 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5013 self.description = v.into();
5014 self
5015 }
5016
5017 /// Sets the value of [uri][crate::model::external_system::TicketInfo::uri].
5018 ///
5019 /// # Example
5020 /// ```ignore,no_run
5021 /// # use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
5022 /// let x = TicketInfo::new().set_uri("example");
5023 /// ```
5024 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5025 self.uri = v.into();
5026 self
5027 }
5028
5029 /// Sets the value of [status][crate::model::external_system::TicketInfo::status].
5030 ///
5031 /// # Example
5032 /// ```ignore,no_run
5033 /// # use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
5034 /// let x = TicketInfo::new().set_status("example");
5035 /// ```
5036 pub fn set_status<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5037 self.status = v.into();
5038 self
5039 }
5040
5041 /// Sets the value of [update_time][crate::model::external_system::TicketInfo::update_time].
5042 ///
5043 /// # Example
5044 /// ```ignore,no_run
5045 /// # use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
5046 /// use wkt::Timestamp;
5047 /// let x = TicketInfo::new().set_update_time(Timestamp::default()/* use setters */);
5048 /// ```
5049 pub fn set_update_time<T>(mut self, v: T) -> Self
5050 where
5051 T: std::convert::Into<wkt::Timestamp>,
5052 {
5053 self.update_time = std::option::Option::Some(v.into());
5054 self
5055 }
5056
5057 /// Sets or clears the value of [update_time][crate::model::external_system::TicketInfo::update_time].
5058 ///
5059 /// # Example
5060 /// ```ignore,no_run
5061 /// # use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
5062 /// use wkt::Timestamp;
5063 /// let x = TicketInfo::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
5064 /// let x = TicketInfo::new().set_or_clear_update_time(None::<Timestamp>);
5065 /// ```
5066 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5067 where
5068 T: std::convert::Into<wkt::Timestamp>,
5069 {
5070 self.update_time = v.map(|x| x.into());
5071 self
5072 }
5073 }
5074
5075 impl wkt::message::Message for TicketInfo {
5076 fn typename() -> &'static str {
5077 "type.googleapis.com/google.cloud.securitycenter.v2.ExternalSystem.TicketInfo"
5078 }
5079 }
5080}
5081
5082/// File information about the related binary/library used by an executable, or
5083/// the script used by a script interpreter
5084#[derive(Clone, Default, PartialEq)]
5085#[non_exhaustive]
5086pub struct File {
5087 /// Absolute path of the file as a JSON encoded string.
5088 pub path: std::string::String,
5089
5090 /// Size of the file in bytes.
5091 pub size: i64,
5092
5093 /// SHA256 hash of the first hashed_size bytes of the file encoded as a
5094 /// hex string. If hashed_size == size, sha256 represents the SHA256 hash
5095 /// of the entire file.
5096 pub sha256: std::string::String,
5097
5098 /// The length in bytes of the file prefix that was hashed. If
5099 /// hashed_size == size, any hashes reported represent the entire
5100 /// file.
5101 pub hashed_size: i64,
5102
5103 /// True when the hash covers only a prefix of the file.
5104 pub partially_hashed: bool,
5105
5106 /// Prefix of the file contents as a JSON-encoded string.
5107 pub contents: std::string::String,
5108
5109 /// Path of the file in terms of underlying disk/partition identifiers.
5110 pub disk_path: std::option::Option<crate::model::file::DiskPath>,
5111
5112 /// Operation(s) performed on a file.
5113 pub operations: std::vec::Vec<crate::model::file::FileOperation>,
5114
5115 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5116}
5117
5118impl File {
5119 pub fn new() -> Self {
5120 std::default::Default::default()
5121 }
5122
5123 /// Sets the value of [path][crate::model::File::path].
5124 ///
5125 /// # Example
5126 /// ```ignore,no_run
5127 /// # use google_cloud_securitycenter_v2::model::File;
5128 /// let x = File::new().set_path("example");
5129 /// ```
5130 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5131 self.path = v.into();
5132 self
5133 }
5134
5135 /// Sets the value of [size][crate::model::File::size].
5136 ///
5137 /// # Example
5138 /// ```ignore,no_run
5139 /// # use google_cloud_securitycenter_v2::model::File;
5140 /// let x = File::new().set_size(42);
5141 /// ```
5142 pub fn set_size<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5143 self.size = v.into();
5144 self
5145 }
5146
5147 /// Sets the value of [sha256][crate::model::File::sha256].
5148 ///
5149 /// # Example
5150 /// ```ignore,no_run
5151 /// # use google_cloud_securitycenter_v2::model::File;
5152 /// let x = File::new().set_sha256("example");
5153 /// ```
5154 pub fn set_sha256<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5155 self.sha256 = v.into();
5156 self
5157 }
5158
5159 /// Sets the value of [hashed_size][crate::model::File::hashed_size].
5160 ///
5161 /// # Example
5162 /// ```ignore,no_run
5163 /// # use google_cloud_securitycenter_v2::model::File;
5164 /// let x = File::new().set_hashed_size(42);
5165 /// ```
5166 pub fn set_hashed_size<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5167 self.hashed_size = v.into();
5168 self
5169 }
5170
5171 /// Sets the value of [partially_hashed][crate::model::File::partially_hashed].
5172 ///
5173 /// # Example
5174 /// ```ignore,no_run
5175 /// # use google_cloud_securitycenter_v2::model::File;
5176 /// let x = File::new().set_partially_hashed(true);
5177 /// ```
5178 pub fn set_partially_hashed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5179 self.partially_hashed = v.into();
5180 self
5181 }
5182
5183 /// Sets the value of [contents][crate::model::File::contents].
5184 ///
5185 /// # Example
5186 /// ```ignore,no_run
5187 /// # use google_cloud_securitycenter_v2::model::File;
5188 /// let x = File::new().set_contents("example");
5189 /// ```
5190 pub fn set_contents<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5191 self.contents = v.into();
5192 self
5193 }
5194
5195 /// Sets the value of [disk_path][crate::model::File::disk_path].
5196 ///
5197 /// # Example
5198 /// ```ignore,no_run
5199 /// # use google_cloud_securitycenter_v2::model::File;
5200 /// use google_cloud_securitycenter_v2::model::file::DiskPath;
5201 /// let x = File::new().set_disk_path(DiskPath::default()/* use setters */);
5202 /// ```
5203 pub fn set_disk_path<T>(mut self, v: T) -> Self
5204 where
5205 T: std::convert::Into<crate::model::file::DiskPath>,
5206 {
5207 self.disk_path = std::option::Option::Some(v.into());
5208 self
5209 }
5210
5211 /// Sets or clears the value of [disk_path][crate::model::File::disk_path].
5212 ///
5213 /// # Example
5214 /// ```ignore,no_run
5215 /// # use google_cloud_securitycenter_v2::model::File;
5216 /// use google_cloud_securitycenter_v2::model::file::DiskPath;
5217 /// let x = File::new().set_or_clear_disk_path(Some(DiskPath::default()/* use setters */));
5218 /// let x = File::new().set_or_clear_disk_path(None::<DiskPath>);
5219 /// ```
5220 pub fn set_or_clear_disk_path<T>(mut self, v: std::option::Option<T>) -> Self
5221 where
5222 T: std::convert::Into<crate::model::file::DiskPath>,
5223 {
5224 self.disk_path = v.map(|x| x.into());
5225 self
5226 }
5227
5228 /// Sets the value of [operations][crate::model::File::operations].
5229 ///
5230 /// # Example
5231 /// ```ignore,no_run
5232 /// # use google_cloud_securitycenter_v2::model::File;
5233 /// use google_cloud_securitycenter_v2::model::file::FileOperation;
5234 /// let x = File::new()
5235 /// .set_operations([
5236 /// FileOperation::default()/* use setters */,
5237 /// FileOperation::default()/* use (different) setters */,
5238 /// ]);
5239 /// ```
5240 pub fn set_operations<T, V>(mut self, v: T) -> Self
5241 where
5242 T: std::iter::IntoIterator<Item = V>,
5243 V: std::convert::Into<crate::model::file::FileOperation>,
5244 {
5245 use std::iter::Iterator;
5246 self.operations = v.into_iter().map(|i| i.into()).collect();
5247 self
5248 }
5249}
5250
5251impl wkt::message::Message for File {
5252 fn typename() -> &'static str {
5253 "type.googleapis.com/google.cloud.securitycenter.v2.File"
5254 }
5255}
5256
5257/// Defines additional types related to [File].
5258pub mod file {
5259 #[allow(unused_imports)]
5260 use super::*;
5261
5262 /// Path of the file in terms of underlying disk/partition identifiers.
5263 #[derive(Clone, Default, PartialEq)]
5264 #[non_exhaustive]
5265 pub struct DiskPath {
5266 /// UUID of the partition (format
5267 /// <https://wiki.archlinux.org/title/persistent_block_device_naming#by-uuid>)
5268 pub partition_uuid: std::string::String,
5269
5270 /// Relative path of the file in the partition as a JSON encoded string.
5271 /// Example: /home/user1/executable_file.sh
5272 pub relative_path: std::string::String,
5273
5274 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5275 }
5276
5277 impl DiskPath {
5278 pub fn new() -> Self {
5279 std::default::Default::default()
5280 }
5281
5282 /// Sets the value of [partition_uuid][crate::model::file::DiskPath::partition_uuid].
5283 ///
5284 /// # Example
5285 /// ```ignore,no_run
5286 /// # use google_cloud_securitycenter_v2::model::file::DiskPath;
5287 /// let x = DiskPath::new().set_partition_uuid("example");
5288 /// ```
5289 pub fn set_partition_uuid<T: std::convert::Into<std::string::String>>(
5290 mut self,
5291 v: T,
5292 ) -> Self {
5293 self.partition_uuid = v.into();
5294 self
5295 }
5296
5297 /// Sets the value of [relative_path][crate::model::file::DiskPath::relative_path].
5298 ///
5299 /// # Example
5300 /// ```ignore,no_run
5301 /// # use google_cloud_securitycenter_v2::model::file::DiskPath;
5302 /// let x = DiskPath::new().set_relative_path("example");
5303 /// ```
5304 pub fn set_relative_path<T: std::convert::Into<std::string::String>>(
5305 mut self,
5306 v: T,
5307 ) -> Self {
5308 self.relative_path = v.into();
5309 self
5310 }
5311 }
5312
5313 impl wkt::message::Message for DiskPath {
5314 fn typename() -> &'static str {
5315 "type.googleapis.com/google.cloud.securitycenter.v2.File.DiskPath"
5316 }
5317 }
5318
5319 /// Operation(s) performed on a file.
5320 #[derive(Clone, Default, PartialEq)]
5321 #[non_exhaustive]
5322 pub struct FileOperation {
5323 /// The type of the operation
5324 pub r#type: crate::model::file::file_operation::OperationType,
5325
5326 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5327 }
5328
5329 impl FileOperation {
5330 pub fn new() -> Self {
5331 std::default::Default::default()
5332 }
5333
5334 /// Sets the value of [r#type][crate::model::file::FileOperation::type].
5335 ///
5336 /// # Example
5337 /// ```ignore,no_run
5338 /// # use google_cloud_securitycenter_v2::model::file::FileOperation;
5339 /// use google_cloud_securitycenter_v2::model::file::file_operation::OperationType;
5340 /// let x0 = FileOperation::new().set_type(OperationType::Open);
5341 /// let x1 = FileOperation::new().set_type(OperationType::Read);
5342 /// let x2 = FileOperation::new().set_type(OperationType::Rename);
5343 /// ```
5344 pub fn set_type<
5345 T: std::convert::Into<crate::model::file::file_operation::OperationType>,
5346 >(
5347 mut self,
5348 v: T,
5349 ) -> Self {
5350 self.r#type = v.into();
5351 self
5352 }
5353 }
5354
5355 impl wkt::message::Message for FileOperation {
5356 fn typename() -> &'static str {
5357 "type.googleapis.com/google.cloud.securitycenter.v2.File.FileOperation"
5358 }
5359 }
5360
5361 /// Defines additional types related to [FileOperation].
5362 pub mod file_operation {
5363 #[allow(unused_imports)]
5364 use super::*;
5365
5366 /// The type of the operation
5367 ///
5368 /// # Working with unknown values
5369 ///
5370 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5371 /// additional enum variants at any time. Adding new variants is not considered
5372 /// a breaking change. Applications should write their code in anticipation of:
5373 ///
5374 /// - New values appearing in future releases of the client library, **and**
5375 /// - New values received dynamically, without application changes.
5376 ///
5377 /// Please consult the [Working with enums] section in the user guide for some
5378 /// guidelines.
5379 ///
5380 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5381 #[derive(Clone, Debug, PartialEq)]
5382 #[non_exhaustive]
5383 pub enum OperationType {
5384 /// The operation is unspecified.
5385 Unspecified,
5386 /// Represents an open operation.
5387 Open,
5388 /// Represents a read operation.
5389 Read,
5390 /// Represents a rename operation.
5391 Rename,
5392 /// Represents a write operation.
5393 Write,
5394 /// Represents an execute operation.
5395 Execute,
5396 /// If set, the enum was initialized with an unknown value.
5397 ///
5398 /// Applications can examine the value using [OperationType::value] or
5399 /// [OperationType::name].
5400 UnknownValue(operation_type::UnknownValue),
5401 }
5402
5403 #[doc(hidden)]
5404 pub mod operation_type {
5405 #[allow(unused_imports)]
5406 use super::*;
5407 #[derive(Clone, Debug, PartialEq)]
5408 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5409 }
5410
5411 impl OperationType {
5412 /// Gets the enum value.
5413 ///
5414 /// Returns `None` if the enum contains an unknown value deserialized from
5415 /// the string representation of enums.
5416 pub fn value(&self) -> std::option::Option<i32> {
5417 match self {
5418 Self::Unspecified => std::option::Option::Some(0),
5419 Self::Open => std::option::Option::Some(1),
5420 Self::Read => std::option::Option::Some(2),
5421 Self::Rename => std::option::Option::Some(3),
5422 Self::Write => std::option::Option::Some(4),
5423 Self::Execute => std::option::Option::Some(5),
5424 Self::UnknownValue(u) => u.0.value(),
5425 }
5426 }
5427
5428 /// Gets the enum value as a string.
5429 ///
5430 /// Returns `None` if the enum contains an unknown value deserialized from
5431 /// the integer representation of enums.
5432 pub fn name(&self) -> std::option::Option<&str> {
5433 match self {
5434 Self::Unspecified => std::option::Option::Some("OPERATION_TYPE_UNSPECIFIED"),
5435 Self::Open => std::option::Option::Some("OPEN"),
5436 Self::Read => std::option::Option::Some("READ"),
5437 Self::Rename => std::option::Option::Some("RENAME"),
5438 Self::Write => std::option::Option::Some("WRITE"),
5439 Self::Execute => std::option::Option::Some("EXECUTE"),
5440 Self::UnknownValue(u) => u.0.name(),
5441 }
5442 }
5443 }
5444
5445 impl std::default::Default for OperationType {
5446 fn default() -> Self {
5447 use std::convert::From;
5448 Self::from(0)
5449 }
5450 }
5451
5452 impl std::fmt::Display for OperationType {
5453 fn fmt(
5454 &self,
5455 f: &mut std::fmt::Formatter<'_>,
5456 ) -> std::result::Result<(), std::fmt::Error> {
5457 wkt::internal::display_enum(f, self.name(), self.value())
5458 }
5459 }
5460
5461 impl std::convert::From<i32> for OperationType {
5462 fn from(value: i32) -> Self {
5463 match value {
5464 0 => Self::Unspecified,
5465 1 => Self::Open,
5466 2 => Self::Read,
5467 3 => Self::Rename,
5468 4 => Self::Write,
5469 5 => Self::Execute,
5470 _ => Self::UnknownValue(operation_type::UnknownValue(
5471 wkt::internal::UnknownEnumValue::Integer(value),
5472 )),
5473 }
5474 }
5475 }
5476
5477 impl std::convert::From<&str> for OperationType {
5478 fn from(value: &str) -> Self {
5479 use std::string::ToString;
5480 match value {
5481 "OPERATION_TYPE_UNSPECIFIED" => Self::Unspecified,
5482 "OPEN" => Self::Open,
5483 "READ" => Self::Read,
5484 "RENAME" => Self::Rename,
5485 "WRITE" => Self::Write,
5486 "EXECUTE" => Self::Execute,
5487 _ => Self::UnknownValue(operation_type::UnknownValue(
5488 wkt::internal::UnknownEnumValue::String(value.to_string()),
5489 )),
5490 }
5491 }
5492 }
5493
5494 impl serde::ser::Serialize for OperationType {
5495 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5496 where
5497 S: serde::Serializer,
5498 {
5499 match self {
5500 Self::Unspecified => serializer.serialize_i32(0),
5501 Self::Open => serializer.serialize_i32(1),
5502 Self::Read => serializer.serialize_i32(2),
5503 Self::Rename => serializer.serialize_i32(3),
5504 Self::Write => serializer.serialize_i32(4),
5505 Self::Execute => serializer.serialize_i32(5),
5506 Self::UnknownValue(u) => u.0.serialize(serializer),
5507 }
5508 }
5509 }
5510
5511 impl<'de> serde::de::Deserialize<'de> for OperationType {
5512 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5513 where
5514 D: serde::Deserializer<'de>,
5515 {
5516 deserializer.deserialize_any(wkt::internal::EnumVisitor::<OperationType>::new(
5517 ".google.cloud.securitycenter.v2.File.FileOperation.OperationType",
5518 ))
5519 }
5520 }
5521 }
5522}
5523
5524/// Security Command Center finding.
5525///
5526/// A finding is a record of assessment data like security, risk, health, or
5527/// privacy, that is ingested into Security Command Center for presentation,
5528/// notification, analysis, policy testing, and enforcement. For example, a
5529/// cross-site scripting (XSS) vulnerability in an App Engine application is a
5530/// finding.
5531#[derive(Clone, Default, PartialEq)]
5532#[non_exhaustive]
5533pub struct Finding {
5534 /// Identifier. The [relative resource
5535 /// name](https://cloud.google.com/apis/design/resource_names#relative_resource_name)
5536 /// of the finding. The following list shows some examples:
5537 ///
5538 ///
5539 /// `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`
5540 /// +
5541 /// `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
5542 ///
5543 /// + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`
5544 ///
5545 /// `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
5546 ///
5547 /// + `projects/{project_id}/sources/{source_id}/findings/{finding_id}`
5548 ///
5549 /// `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
5550 pub name: std::string::String,
5551
5552 /// Output only. The canonical name of the finding. The following list shows
5553 /// some examples:
5554 ///
5555 ///
5556 /// `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`
5557 /// +
5558 /// `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
5559 ///
5560 /// + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`
5561 ///
5562 /// `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
5563 ///
5564 /// + `projects/{project_id}/sources/{source_id}/findings/{finding_id}`
5565 ///
5566 /// `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
5567 ///
5568 /// The prefix is the closest CRM ancestor of the resource associated with the
5569 /// finding.
5570 pub canonical_name: std::string::String,
5571
5572 /// The relative resource name of the source and location the finding belongs
5573 /// to. See:
5574 /// <https://cloud.google.com/apis/design/resource_names#relative_resource_name>
5575 /// This field is immutable after creation time. The following list shows some
5576 /// examples:
5577 ///
5578 /// + `organizations/{organization_id}/sources/{source_id}`
5579 /// + `folders/{folders_id}/sources/{source_id}`
5580 /// + `projects/{projects_id}/sources/{source_id}`
5581 ///
5582 /// `organizations/{organization_id}/sources/{source_id}/locations/{location_id}`
5583 ///
5584 /// + `folders/{folders_id}/sources/{source_id}/locations/{location_id}`
5585 /// + `projects/{projects_id}/sources/{source_id}/locations/{location_id}`
5586 pub parent: std::string::String,
5587
5588 /// Immutable. For findings on Google Cloud resources, the full resource
5589 /// name of the Google Cloud resource this finding is for. See:
5590 /// <https://cloud.google.com/apis/design/resource_names#full_resource_name>
5591 /// When the finding is for a non-Google Cloud resource, the resourceName can
5592 /// be a customer or partner defined string.
5593 pub resource_name: std::string::String,
5594
5595 /// Output only. The state of the finding.
5596 pub state: crate::model::finding::State,
5597
5598 /// Immutable. The additional taxonomy group within findings from a given
5599 /// source. Example: "XSS_FLASH_INJECTION"
5600 pub category: std::string::String,
5601
5602 /// The URI that, if available, points to a web page outside of Security
5603 /// Command Center where additional information about the finding can be found.
5604 /// This field is guaranteed to be either empty or a well formed URL.
5605 pub external_uri: std::string::String,
5606
5607 /// Source specific properties. These properties are managed by the source
5608 /// that writes the finding. The key names in the source_properties map must be
5609 /// between 1 and 255 characters, and must start with a letter and contain
5610 /// alphanumeric characters or underscores only.
5611 pub source_properties: std::collections::HashMap<std::string::String, wkt::Value>,
5612
5613 /// Output only. User specified security marks. These marks are entirely
5614 /// managed by the user and come from the SecurityMarks resource that belongs
5615 /// to the finding.
5616 pub security_marks: std::option::Option<crate::model::SecurityMarks>,
5617
5618 /// The time the finding was first detected. If an existing finding is updated,
5619 /// then this is the time the update occurred.
5620 /// For example, if the finding represents an open firewall, this property
5621 /// captures the time the detector believes the firewall became open. The
5622 /// accuracy is determined by the detector. If the finding is later resolved,
5623 /// then this time reflects when the finding was resolved. This must not
5624 /// be set to a value greater than the current timestamp.
5625 pub event_time: std::option::Option<wkt::Timestamp>,
5626
5627 /// Output only. The time at which the finding was created in Security Command
5628 /// Center.
5629 pub create_time: std::option::Option<wkt::Timestamp>,
5630
5631 /// The severity of the finding. This field is managed by the source that
5632 /// writes the finding.
5633 pub severity: crate::model::finding::Severity,
5634
5635 /// Indicates the mute state of a finding (either muted, unmuted
5636 /// or undefined). Unlike other attributes of a finding, a finding provider
5637 /// shouldn't set the value of mute.
5638 pub mute: crate::model::finding::Mute,
5639
5640 /// Output only. The mute information regarding this finding.
5641 pub mute_info: std::option::Option<crate::model::finding::MuteInfo>,
5642
5643 /// The class of the finding.
5644 pub finding_class: crate::model::finding::FindingClass,
5645
5646 /// Represents what's commonly known as an *indicator of compromise* (IoC) in
5647 /// computer forensics. This is an artifact observed on a network or in an
5648 /// operating system that, with high confidence, indicates a computer
5649 /// intrusion. For more information, see [Indicator of
5650 /// compromise](https://en.wikipedia.org/wiki/Indicator_of_compromise).
5651 pub indicator: std::option::Option<crate::model::Indicator>,
5652
5653 /// Represents vulnerability-specific fields like CVE and CVSS scores.
5654 /// CVE stands for Common Vulnerabilities and Exposures
5655 /// (<https://cve.mitre.org/about/>)
5656 pub vulnerability: std::option::Option<crate::model::Vulnerability>,
5657
5658 /// Output only. The most recent time this finding was muted or unmuted.
5659 pub mute_update_time: std::option::Option<wkt::Timestamp>,
5660
5661 /// Output only. Third party SIEM/SOAR fields within SCC, contains external
5662 /// system information and external system finding fields.
5663 pub external_systems:
5664 std::collections::HashMap<std::string::String, crate::model::ExternalSystem>,
5665
5666 /// MITRE ATT&CK tactics and techniques related to this finding.
5667 /// See: <https://attack.mitre.org>
5668 pub mitre_attack: std::option::Option<crate::model::MitreAttack>,
5669
5670 /// Access details associated with the finding, such as more information on the
5671 /// caller, which method was accessed, and from where.
5672 pub access: std::option::Option<crate::model::Access>,
5673
5674 /// Contains information about the IP connection associated with the finding.
5675 pub connections: std::vec::Vec<crate::model::Connection>,
5676
5677 /// Records additional information about the mute operation, for example, the
5678 /// [mute
5679 /// configuration](https://cloud.google.com/security-command-center/docs/how-to-mute-findings)
5680 /// that muted the finding and the user who muted the finding.
5681 pub mute_initiator: std::string::String,
5682
5683 /// Represents operating system processes associated with the Finding.
5684 pub processes: std::vec::Vec<crate::model::Process>,
5685
5686 /// Output only. Map containing the points of contact for the given finding.
5687 /// The key represents the type of contact, while the value contains a list of
5688 /// all the contacts that pertain. Please refer to:
5689 /// <https://cloud.google.com/resource-manager/docs/managing-notification-contacts#notification-categories>
5690 ///
5691 /// ```norust
5692 /// {
5693 /// "security": {
5694 /// "contacts": [
5695 /// {
5696 /// "email": "person1@company.com"
5697 /// },
5698 /// {
5699 /// "email": "person2@company.com"
5700 /// }
5701 /// ]
5702 /// }
5703 /// }
5704 /// ```
5705 pub contacts: std::collections::HashMap<std::string::String, crate::model::ContactDetails>,
5706
5707 /// Contains compliance information for security standards associated to the
5708 /// finding.
5709 pub compliances: std::vec::Vec<crate::model::Compliance>,
5710
5711 /// Output only. The human readable display name of the finding source such as
5712 /// "Event Threat Detection" or "Security Health Analytics".
5713 pub parent_display_name: std::string::String,
5714
5715 /// Contains more details about the finding.
5716 pub description: std::string::String,
5717
5718 /// Represents exfiltrations associated with the finding.
5719 pub exfiltration: std::option::Option<crate::model::Exfiltration>,
5720
5721 /// Represents IAM bindings associated with the finding.
5722 pub iam_bindings: std::vec::Vec<crate::model::IamBinding>,
5723
5724 /// Steps to address the finding.
5725 pub next_steps: std::string::String,
5726
5727 /// Unique identifier of the module which generated the finding.
5728 /// Example:
5729 /// folders/598186756061/securityHealthAnalyticsSettings/customModules/56799441161885
5730 pub module_name: std::string::String,
5731
5732 /// Containers associated with the finding. This field provides information for
5733 /// both Kubernetes and non-Kubernetes containers.
5734 pub containers: std::vec::Vec<crate::model::Container>,
5735
5736 /// Kubernetes resources associated with the finding.
5737 pub kubernetes: std::option::Option<crate::model::Kubernetes>,
5738
5739 /// Database associated with the finding.
5740 pub database: std::option::Option<crate::model::Database>,
5741
5742 /// The results of an attack path simulation relevant to this finding.
5743 pub attack_exposure: std::option::Option<crate::model::AttackExposure>,
5744
5745 /// File associated with the finding.
5746 pub files: std::vec::Vec<crate::model::File>,
5747
5748 /// Cloud Data Loss Prevention (Cloud DLP) inspection results that are
5749 /// associated with the finding.
5750 pub cloud_dlp_inspection: std::option::Option<crate::model::CloudDlpInspection>,
5751
5752 /// Cloud DLP data profile that is associated with the finding.
5753 pub cloud_dlp_data_profile: std::option::Option<crate::model::CloudDlpDataProfile>,
5754
5755 /// Signature of the kernel rootkit.
5756 pub kernel_rootkit: std::option::Option<crate::model::KernelRootkit>,
5757
5758 /// Contains information about the org policies associated with the finding.
5759 pub org_policies: std::vec::Vec<crate::model::OrgPolicy>,
5760
5761 /// Job associated with the finding.
5762 pub job: std::option::Option<crate::model::Job>,
5763
5764 /// Represents an application associated with the finding.
5765 pub application: std::option::Option<crate::model::Application>,
5766
5767 /// IP rules associated with the finding.
5768 pub ip_rules: std::option::Option<crate::model::IpRules>,
5769
5770 /// Fields related to Backup and DR findings.
5771 pub backup_disaster_recovery: std::option::Option<crate::model::BackupDisasterRecovery>,
5772
5773 /// The security posture associated with the finding.
5774 pub security_posture: std::option::Option<crate::model::SecurityPosture>,
5775
5776 /// Log entries that are relevant to the finding.
5777 pub log_entries: std::vec::Vec<crate::model::LogEntry>,
5778
5779 /// The load balancers associated with the finding.
5780 pub load_balancers: std::vec::Vec<crate::model::LoadBalancer>,
5781
5782 /// Fields related to Cloud Armor findings.
5783 pub cloud_armor: std::option::Option<crate::model::CloudArmor>,
5784
5785 /// Notebook associated with the finding.
5786 pub notebook: std::option::Option<crate::model::Notebook>,
5787
5788 /// Contains details about a group of security issues that, when the issues
5789 /// occur together, represent a greater risk than when the issues occur
5790 /// independently. A group of such issues is referred to as a toxic
5791 /// combination.
5792 /// This field cannot be updated. Its value is ignored in all update requests.
5793 pub toxic_combination: std::option::Option<crate::model::ToxicCombination>,
5794
5795 /// Contains details about groups of which this finding is a member. A group is
5796 /// a collection of findings that are related in some way.
5797 /// This field cannot be updated. Its value is ignored in all update requests.
5798 pub group_memberships: std::vec::Vec<crate::model::GroupMembership>,
5799
5800 /// Disk associated with the finding.
5801 pub disk: std::option::Option<crate::model::Disk>,
5802
5803 /// Data access events associated with the finding.
5804 pub data_access_events: std::vec::Vec<crate::model::DataAccessEvent>,
5805
5806 /// Data flow events associated with the finding.
5807 pub data_flow_events: std::vec::Vec<crate::model::DataFlowEvent>,
5808
5809 /// Represents the VPC networks that the resource is attached to.
5810 pub networks: std::vec::Vec<crate::model::Network>,
5811
5812 /// Data retention deletion events associated with the finding.
5813 pub data_retention_deletion_events: std::vec::Vec<crate::model::DataRetentionDeletionEvent>,
5814
5815 /// AffectedResources associated with the finding.
5816 pub affected_resources: std::option::Option<crate::model::AffectedResources>,
5817
5818 /// The AI model associated with the finding.
5819 pub ai_model: std::option::Option<crate::model::AiModel>,
5820
5821 /// Contains details about a chokepoint, which is a resource or resource group
5822 /// where high-risk attack paths converge, based on [attack path simulations]
5823 /// (<https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_path_simulations>).
5824 /// This field cannot be updated. Its value is ignored in all update requests.
5825 pub chokepoint: std::option::Option<crate::model::Chokepoint>,
5826
5827 /// VertexAi associated with the finding.
5828 pub vertex_ai: std::option::Option<crate::model::VertexAi>,
5829
5830 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5831}
5832
5833impl Finding {
5834 pub fn new() -> Self {
5835 std::default::Default::default()
5836 }
5837
5838 /// Sets the value of [name][crate::model::Finding::name].
5839 ///
5840 /// # Example
5841 /// ```ignore,no_run
5842 /// # use google_cloud_securitycenter_v2::model::Finding;
5843 /// let x = Finding::new().set_name("example");
5844 /// ```
5845 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5846 self.name = v.into();
5847 self
5848 }
5849
5850 /// Sets the value of [canonical_name][crate::model::Finding::canonical_name].
5851 ///
5852 /// # Example
5853 /// ```ignore,no_run
5854 /// # use google_cloud_securitycenter_v2::model::Finding;
5855 /// let x = Finding::new().set_canonical_name("example");
5856 /// ```
5857 pub fn set_canonical_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5858 self.canonical_name = v.into();
5859 self
5860 }
5861
5862 /// Sets the value of [parent][crate::model::Finding::parent].
5863 ///
5864 /// # Example
5865 /// ```ignore,no_run
5866 /// # use google_cloud_securitycenter_v2::model::Finding;
5867 /// let x = Finding::new().set_parent("example");
5868 /// ```
5869 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5870 self.parent = v.into();
5871 self
5872 }
5873
5874 /// Sets the value of [resource_name][crate::model::Finding::resource_name].
5875 ///
5876 /// # Example
5877 /// ```ignore,no_run
5878 /// # use google_cloud_securitycenter_v2::model::Finding;
5879 /// let x = Finding::new().set_resource_name("example");
5880 /// ```
5881 pub fn set_resource_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5882 self.resource_name = v.into();
5883 self
5884 }
5885
5886 /// Sets the value of [state][crate::model::Finding::state].
5887 ///
5888 /// # Example
5889 /// ```ignore,no_run
5890 /// # use google_cloud_securitycenter_v2::model::Finding;
5891 /// use google_cloud_securitycenter_v2::model::finding::State;
5892 /// let x0 = Finding::new().set_state(State::Active);
5893 /// let x1 = Finding::new().set_state(State::Inactive);
5894 /// ```
5895 pub fn set_state<T: std::convert::Into<crate::model::finding::State>>(mut self, v: T) -> Self {
5896 self.state = v.into();
5897 self
5898 }
5899
5900 /// Sets the value of [category][crate::model::Finding::category].
5901 ///
5902 /// # Example
5903 /// ```ignore,no_run
5904 /// # use google_cloud_securitycenter_v2::model::Finding;
5905 /// let x = Finding::new().set_category("example");
5906 /// ```
5907 pub fn set_category<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5908 self.category = v.into();
5909 self
5910 }
5911
5912 /// Sets the value of [external_uri][crate::model::Finding::external_uri].
5913 ///
5914 /// # Example
5915 /// ```ignore,no_run
5916 /// # use google_cloud_securitycenter_v2::model::Finding;
5917 /// let x = Finding::new().set_external_uri("example");
5918 /// ```
5919 pub fn set_external_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5920 self.external_uri = v.into();
5921 self
5922 }
5923
5924 /// Sets the value of [source_properties][crate::model::Finding::source_properties].
5925 ///
5926 /// # Example
5927 /// ```ignore,no_run
5928 /// # use google_cloud_securitycenter_v2::model::Finding;
5929 /// use wkt::Value;
5930 /// let x = Finding::new().set_source_properties([
5931 /// ("key0", Value::default()/* use setters */),
5932 /// ("key1", Value::default()/* use (different) setters */),
5933 /// ]);
5934 /// ```
5935 pub fn set_source_properties<T, K, V>(mut self, v: T) -> Self
5936 where
5937 T: std::iter::IntoIterator<Item = (K, V)>,
5938 K: std::convert::Into<std::string::String>,
5939 V: std::convert::Into<wkt::Value>,
5940 {
5941 use std::iter::Iterator;
5942 self.source_properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5943 self
5944 }
5945
5946 /// Sets the value of [security_marks][crate::model::Finding::security_marks].
5947 ///
5948 /// # Example
5949 /// ```ignore,no_run
5950 /// # use google_cloud_securitycenter_v2::model::Finding;
5951 /// use google_cloud_securitycenter_v2::model::SecurityMarks;
5952 /// let x = Finding::new().set_security_marks(SecurityMarks::default()/* use setters */);
5953 /// ```
5954 pub fn set_security_marks<T>(mut self, v: T) -> Self
5955 where
5956 T: std::convert::Into<crate::model::SecurityMarks>,
5957 {
5958 self.security_marks = std::option::Option::Some(v.into());
5959 self
5960 }
5961
5962 /// Sets or clears the value of [security_marks][crate::model::Finding::security_marks].
5963 ///
5964 /// # Example
5965 /// ```ignore,no_run
5966 /// # use google_cloud_securitycenter_v2::model::Finding;
5967 /// use google_cloud_securitycenter_v2::model::SecurityMarks;
5968 /// let x = Finding::new().set_or_clear_security_marks(Some(SecurityMarks::default()/* use setters */));
5969 /// let x = Finding::new().set_or_clear_security_marks(None::<SecurityMarks>);
5970 /// ```
5971 pub fn set_or_clear_security_marks<T>(mut self, v: std::option::Option<T>) -> Self
5972 where
5973 T: std::convert::Into<crate::model::SecurityMarks>,
5974 {
5975 self.security_marks = v.map(|x| x.into());
5976 self
5977 }
5978
5979 /// Sets the value of [event_time][crate::model::Finding::event_time].
5980 ///
5981 /// # Example
5982 /// ```ignore,no_run
5983 /// # use google_cloud_securitycenter_v2::model::Finding;
5984 /// use wkt::Timestamp;
5985 /// let x = Finding::new().set_event_time(Timestamp::default()/* use setters */);
5986 /// ```
5987 pub fn set_event_time<T>(mut self, v: T) -> Self
5988 where
5989 T: std::convert::Into<wkt::Timestamp>,
5990 {
5991 self.event_time = std::option::Option::Some(v.into());
5992 self
5993 }
5994
5995 /// Sets or clears the value of [event_time][crate::model::Finding::event_time].
5996 ///
5997 /// # Example
5998 /// ```ignore,no_run
5999 /// # use google_cloud_securitycenter_v2::model::Finding;
6000 /// use wkt::Timestamp;
6001 /// let x = Finding::new().set_or_clear_event_time(Some(Timestamp::default()/* use setters */));
6002 /// let x = Finding::new().set_or_clear_event_time(None::<Timestamp>);
6003 /// ```
6004 pub fn set_or_clear_event_time<T>(mut self, v: std::option::Option<T>) -> Self
6005 where
6006 T: std::convert::Into<wkt::Timestamp>,
6007 {
6008 self.event_time = v.map(|x| x.into());
6009 self
6010 }
6011
6012 /// Sets the value of [create_time][crate::model::Finding::create_time].
6013 ///
6014 /// # Example
6015 /// ```ignore,no_run
6016 /// # use google_cloud_securitycenter_v2::model::Finding;
6017 /// use wkt::Timestamp;
6018 /// let x = Finding::new().set_create_time(Timestamp::default()/* use setters */);
6019 /// ```
6020 pub fn set_create_time<T>(mut self, v: T) -> Self
6021 where
6022 T: std::convert::Into<wkt::Timestamp>,
6023 {
6024 self.create_time = std::option::Option::Some(v.into());
6025 self
6026 }
6027
6028 /// Sets or clears the value of [create_time][crate::model::Finding::create_time].
6029 ///
6030 /// # Example
6031 /// ```ignore,no_run
6032 /// # use google_cloud_securitycenter_v2::model::Finding;
6033 /// use wkt::Timestamp;
6034 /// let x = Finding::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6035 /// let x = Finding::new().set_or_clear_create_time(None::<Timestamp>);
6036 /// ```
6037 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6038 where
6039 T: std::convert::Into<wkt::Timestamp>,
6040 {
6041 self.create_time = v.map(|x| x.into());
6042 self
6043 }
6044
6045 /// Sets the value of [severity][crate::model::Finding::severity].
6046 ///
6047 /// # Example
6048 /// ```ignore,no_run
6049 /// # use google_cloud_securitycenter_v2::model::Finding;
6050 /// use google_cloud_securitycenter_v2::model::finding::Severity;
6051 /// let x0 = Finding::new().set_severity(Severity::Critical);
6052 /// let x1 = Finding::new().set_severity(Severity::High);
6053 /// let x2 = Finding::new().set_severity(Severity::Medium);
6054 /// ```
6055 pub fn set_severity<T: std::convert::Into<crate::model::finding::Severity>>(
6056 mut self,
6057 v: T,
6058 ) -> Self {
6059 self.severity = v.into();
6060 self
6061 }
6062
6063 /// Sets the value of [mute][crate::model::Finding::mute].
6064 ///
6065 /// # Example
6066 /// ```ignore,no_run
6067 /// # use google_cloud_securitycenter_v2::model::Finding;
6068 /// use google_cloud_securitycenter_v2::model::finding::Mute;
6069 /// let x0 = Finding::new().set_mute(Mute::Muted);
6070 /// let x1 = Finding::new().set_mute(Mute::Unmuted);
6071 /// let x2 = Finding::new().set_mute(Mute::Undefined);
6072 /// ```
6073 pub fn set_mute<T: std::convert::Into<crate::model::finding::Mute>>(mut self, v: T) -> Self {
6074 self.mute = v.into();
6075 self
6076 }
6077
6078 /// Sets the value of [mute_info][crate::model::Finding::mute_info].
6079 ///
6080 /// # Example
6081 /// ```ignore,no_run
6082 /// # use google_cloud_securitycenter_v2::model::Finding;
6083 /// use google_cloud_securitycenter_v2::model::finding::MuteInfo;
6084 /// let x = Finding::new().set_mute_info(MuteInfo::default()/* use setters */);
6085 /// ```
6086 pub fn set_mute_info<T>(mut self, v: T) -> Self
6087 where
6088 T: std::convert::Into<crate::model::finding::MuteInfo>,
6089 {
6090 self.mute_info = std::option::Option::Some(v.into());
6091 self
6092 }
6093
6094 /// Sets or clears the value of [mute_info][crate::model::Finding::mute_info].
6095 ///
6096 /// # Example
6097 /// ```ignore,no_run
6098 /// # use google_cloud_securitycenter_v2::model::Finding;
6099 /// use google_cloud_securitycenter_v2::model::finding::MuteInfo;
6100 /// let x = Finding::new().set_or_clear_mute_info(Some(MuteInfo::default()/* use setters */));
6101 /// let x = Finding::new().set_or_clear_mute_info(None::<MuteInfo>);
6102 /// ```
6103 pub fn set_or_clear_mute_info<T>(mut self, v: std::option::Option<T>) -> Self
6104 where
6105 T: std::convert::Into<crate::model::finding::MuteInfo>,
6106 {
6107 self.mute_info = v.map(|x| x.into());
6108 self
6109 }
6110
6111 /// Sets the value of [finding_class][crate::model::Finding::finding_class].
6112 ///
6113 /// # Example
6114 /// ```ignore,no_run
6115 /// # use google_cloud_securitycenter_v2::model::Finding;
6116 /// use google_cloud_securitycenter_v2::model::finding::FindingClass;
6117 /// let x0 = Finding::new().set_finding_class(FindingClass::Threat);
6118 /// let x1 = Finding::new().set_finding_class(FindingClass::Vulnerability);
6119 /// let x2 = Finding::new().set_finding_class(FindingClass::Misconfiguration);
6120 /// ```
6121 pub fn set_finding_class<T: std::convert::Into<crate::model::finding::FindingClass>>(
6122 mut self,
6123 v: T,
6124 ) -> Self {
6125 self.finding_class = v.into();
6126 self
6127 }
6128
6129 /// Sets the value of [indicator][crate::model::Finding::indicator].
6130 ///
6131 /// # Example
6132 /// ```ignore,no_run
6133 /// # use google_cloud_securitycenter_v2::model::Finding;
6134 /// use google_cloud_securitycenter_v2::model::Indicator;
6135 /// let x = Finding::new().set_indicator(Indicator::default()/* use setters */);
6136 /// ```
6137 pub fn set_indicator<T>(mut self, v: T) -> Self
6138 where
6139 T: std::convert::Into<crate::model::Indicator>,
6140 {
6141 self.indicator = std::option::Option::Some(v.into());
6142 self
6143 }
6144
6145 /// Sets or clears the value of [indicator][crate::model::Finding::indicator].
6146 ///
6147 /// # Example
6148 /// ```ignore,no_run
6149 /// # use google_cloud_securitycenter_v2::model::Finding;
6150 /// use google_cloud_securitycenter_v2::model::Indicator;
6151 /// let x = Finding::new().set_or_clear_indicator(Some(Indicator::default()/* use setters */));
6152 /// let x = Finding::new().set_or_clear_indicator(None::<Indicator>);
6153 /// ```
6154 pub fn set_or_clear_indicator<T>(mut self, v: std::option::Option<T>) -> Self
6155 where
6156 T: std::convert::Into<crate::model::Indicator>,
6157 {
6158 self.indicator = v.map(|x| x.into());
6159 self
6160 }
6161
6162 /// Sets the value of [vulnerability][crate::model::Finding::vulnerability].
6163 ///
6164 /// # Example
6165 /// ```ignore,no_run
6166 /// # use google_cloud_securitycenter_v2::model::Finding;
6167 /// use google_cloud_securitycenter_v2::model::Vulnerability;
6168 /// let x = Finding::new().set_vulnerability(Vulnerability::default()/* use setters */);
6169 /// ```
6170 pub fn set_vulnerability<T>(mut self, v: T) -> Self
6171 where
6172 T: std::convert::Into<crate::model::Vulnerability>,
6173 {
6174 self.vulnerability = std::option::Option::Some(v.into());
6175 self
6176 }
6177
6178 /// Sets or clears the value of [vulnerability][crate::model::Finding::vulnerability].
6179 ///
6180 /// # Example
6181 /// ```ignore,no_run
6182 /// # use google_cloud_securitycenter_v2::model::Finding;
6183 /// use google_cloud_securitycenter_v2::model::Vulnerability;
6184 /// let x = Finding::new().set_or_clear_vulnerability(Some(Vulnerability::default()/* use setters */));
6185 /// let x = Finding::new().set_or_clear_vulnerability(None::<Vulnerability>);
6186 /// ```
6187 pub fn set_or_clear_vulnerability<T>(mut self, v: std::option::Option<T>) -> Self
6188 where
6189 T: std::convert::Into<crate::model::Vulnerability>,
6190 {
6191 self.vulnerability = v.map(|x| x.into());
6192 self
6193 }
6194
6195 /// Sets the value of [mute_update_time][crate::model::Finding::mute_update_time].
6196 ///
6197 /// # Example
6198 /// ```ignore,no_run
6199 /// # use google_cloud_securitycenter_v2::model::Finding;
6200 /// use wkt::Timestamp;
6201 /// let x = Finding::new().set_mute_update_time(Timestamp::default()/* use setters */);
6202 /// ```
6203 pub fn set_mute_update_time<T>(mut self, v: T) -> Self
6204 where
6205 T: std::convert::Into<wkt::Timestamp>,
6206 {
6207 self.mute_update_time = std::option::Option::Some(v.into());
6208 self
6209 }
6210
6211 /// Sets or clears the value of [mute_update_time][crate::model::Finding::mute_update_time].
6212 ///
6213 /// # Example
6214 /// ```ignore,no_run
6215 /// # use google_cloud_securitycenter_v2::model::Finding;
6216 /// use wkt::Timestamp;
6217 /// let x = Finding::new().set_or_clear_mute_update_time(Some(Timestamp::default()/* use setters */));
6218 /// let x = Finding::new().set_or_clear_mute_update_time(None::<Timestamp>);
6219 /// ```
6220 pub fn set_or_clear_mute_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6221 where
6222 T: std::convert::Into<wkt::Timestamp>,
6223 {
6224 self.mute_update_time = v.map(|x| x.into());
6225 self
6226 }
6227
6228 /// Sets the value of [external_systems][crate::model::Finding::external_systems].
6229 ///
6230 /// # Example
6231 /// ```ignore,no_run
6232 /// # use google_cloud_securitycenter_v2::model::Finding;
6233 /// use google_cloud_securitycenter_v2::model::ExternalSystem;
6234 /// let x = Finding::new().set_external_systems([
6235 /// ("key0", ExternalSystem::default()/* use setters */),
6236 /// ("key1", ExternalSystem::default()/* use (different) setters */),
6237 /// ]);
6238 /// ```
6239 pub fn set_external_systems<T, K, V>(mut self, v: T) -> Self
6240 where
6241 T: std::iter::IntoIterator<Item = (K, V)>,
6242 K: std::convert::Into<std::string::String>,
6243 V: std::convert::Into<crate::model::ExternalSystem>,
6244 {
6245 use std::iter::Iterator;
6246 self.external_systems = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6247 self
6248 }
6249
6250 /// Sets the value of [mitre_attack][crate::model::Finding::mitre_attack].
6251 ///
6252 /// # Example
6253 /// ```ignore,no_run
6254 /// # use google_cloud_securitycenter_v2::model::Finding;
6255 /// use google_cloud_securitycenter_v2::model::MitreAttack;
6256 /// let x = Finding::new().set_mitre_attack(MitreAttack::default()/* use setters */);
6257 /// ```
6258 pub fn set_mitre_attack<T>(mut self, v: T) -> Self
6259 where
6260 T: std::convert::Into<crate::model::MitreAttack>,
6261 {
6262 self.mitre_attack = std::option::Option::Some(v.into());
6263 self
6264 }
6265
6266 /// Sets or clears the value of [mitre_attack][crate::model::Finding::mitre_attack].
6267 ///
6268 /// # Example
6269 /// ```ignore,no_run
6270 /// # use google_cloud_securitycenter_v2::model::Finding;
6271 /// use google_cloud_securitycenter_v2::model::MitreAttack;
6272 /// let x = Finding::new().set_or_clear_mitre_attack(Some(MitreAttack::default()/* use setters */));
6273 /// let x = Finding::new().set_or_clear_mitre_attack(None::<MitreAttack>);
6274 /// ```
6275 pub fn set_or_clear_mitre_attack<T>(mut self, v: std::option::Option<T>) -> Self
6276 where
6277 T: std::convert::Into<crate::model::MitreAttack>,
6278 {
6279 self.mitre_attack = v.map(|x| x.into());
6280 self
6281 }
6282
6283 /// Sets the value of [access][crate::model::Finding::access].
6284 ///
6285 /// # Example
6286 /// ```ignore,no_run
6287 /// # use google_cloud_securitycenter_v2::model::Finding;
6288 /// use google_cloud_securitycenter_v2::model::Access;
6289 /// let x = Finding::new().set_access(Access::default()/* use setters */);
6290 /// ```
6291 pub fn set_access<T>(mut self, v: T) -> Self
6292 where
6293 T: std::convert::Into<crate::model::Access>,
6294 {
6295 self.access = std::option::Option::Some(v.into());
6296 self
6297 }
6298
6299 /// Sets or clears the value of [access][crate::model::Finding::access].
6300 ///
6301 /// # Example
6302 /// ```ignore,no_run
6303 /// # use google_cloud_securitycenter_v2::model::Finding;
6304 /// use google_cloud_securitycenter_v2::model::Access;
6305 /// let x = Finding::new().set_or_clear_access(Some(Access::default()/* use setters */));
6306 /// let x = Finding::new().set_or_clear_access(None::<Access>);
6307 /// ```
6308 pub fn set_or_clear_access<T>(mut self, v: std::option::Option<T>) -> Self
6309 where
6310 T: std::convert::Into<crate::model::Access>,
6311 {
6312 self.access = v.map(|x| x.into());
6313 self
6314 }
6315
6316 /// Sets the value of [connections][crate::model::Finding::connections].
6317 ///
6318 /// # Example
6319 /// ```ignore,no_run
6320 /// # use google_cloud_securitycenter_v2::model::Finding;
6321 /// use google_cloud_securitycenter_v2::model::Connection;
6322 /// let x = Finding::new()
6323 /// .set_connections([
6324 /// Connection::default()/* use setters */,
6325 /// Connection::default()/* use (different) setters */,
6326 /// ]);
6327 /// ```
6328 pub fn set_connections<T, V>(mut self, v: T) -> Self
6329 where
6330 T: std::iter::IntoIterator<Item = V>,
6331 V: std::convert::Into<crate::model::Connection>,
6332 {
6333 use std::iter::Iterator;
6334 self.connections = v.into_iter().map(|i| i.into()).collect();
6335 self
6336 }
6337
6338 /// Sets the value of [mute_initiator][crate::model::Finding::mute_initiator].
6339 ///
6340 /// # Example
6341 /// ```ignore,no_run
6342 /// # use google_cloud_securitycenter_v2::model::Finding;
6343 /// let x = Finding::new().set_mute_initiator("example");
6344 /// ```
6345 pub fn set_mute_initiator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6346 self.mute_initiator = v.into();
6347 self
6348 }
6349
6350 /// Sets the value of [processes][crate::model::Finding::processes].
6351 ///
6352 /// # Example
6353 /// ```ignore,no_run
6354 /// # use google_cloud_securitycenter_v2::model::Finding;
6355 /// use google_cloud_securitycenter_v2::model::Process;
6356 /// let x = Finding::new()
6357 /// .set_processes([
6358 /// Process::default()/* use setters */,
6359 /// Process::default()/* use (different) setters */,
6360 /// ]);
6361 /// ```
6362 pub fn set_processes<T, V>(mut self, v: T) -> Self
6363 where
6364 T: std::iter::IntoIterator<Item = V>,
6365 V: std::convert::Into<crate::model::Process>,
6366 {
6367 use std::iter::Iterator;
6368 self.processes = v.into_iter().map(|i| i.into()).collect();
6369 self
6370 }
6371
6372 /// Sets the value of [contacts][crate::model::Finding::contacts].
6373 ///
6374 /// # Example
6375 /// ```ignore,no_run
6376 /// # use google_cloud_securitycenter_v2::model::Finding;
6377 /// use google_cloud_securitycenter_v2::model::ContactDetails;
6378 /// let x = Finding::new().set_contacts([
6379 /// ("key0", ContactDetails::default()/* use setters */),
6380 /// ("key1", ContactDetails::default()/* use (different) setters */),
6381 /// ]);
6382 /// ```
6383 pub fn set_contacts<T, K, V>(mut self, v: T) -> Self
6384 where
6385 T: std::iter::IntoIterator<Item = (K, V)>,
6386 K: std::convert::Into<std::string::String>,
6387 V: std::convert::Into<crate::model::ContactDetails>,
6388 {
6389 use std::iter::Iterator;
6390 self.contacts = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6391 self
6392 }
6393
6394 /// Sets the value of [compliances][crate::model::Finding::compliances].
6395 ///
6396 /// # Example
6397 /// ```ignore,no_run
6398 /// # use google_cloud_securitycenter_v2::model::Finding;
6399 /// use google_cloud_securitycenter_v2::model::Compliance;
6400 /// let x = Finding::new()
6401 /// .set_compliances([
6402 /// Compliance::default()/* use setters */,
6403 /// Compliance::default()/* use (different) setters */,
6404 /// ]);
6405 /// ```
6406 pub fn set_compliances<T, V>(mut self, v: T) -> Self
6407 where
6408 T: std::iter::IntoIterator<Item = V>,
6409 V: std::convert::Into<crate::model::Compliance>,
6410 {
6411 use std::iter::Iterator;
6412 self.compliances = v.into_iter().map(|i| i.into()).collect();
6413 self
6414 }
6415
6416 /// Sets the value of [parent_display_name][crate::model::Finding::parent_display_name].
6417 ///
6418 /// # Example
6419 /// ```ignore,no_run
6420 /// # use google_cloud_securitycenter_v2::model::Finding;
6421 /// let x = Finding::new().set_parent_display_name("example");
6422 /// ```
6423 pub fn set_parent_display_name<T: std::convert::Into<std::string::String>>(
6424 mut self,
6425 v: T,
6426 ) -> Self {
6427 self.parent_display_name = v.into();
6428 self
6429 }
6430
6431 /// Sets the value of [description][crate::model::Finding::description].
6432 ///
6433 /// # Example
6434 /// ```ignore,no_run
6435 /// # use google_cloud_securitycenter_v2::model::Finding;
6436 /// let x = Finding::new().set_description("example");
6437 /// ```
6438 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6439 self.description = v.into();
6440 self
6441 }
6442
6443 /// Sets the value of [exfiltration][crate::model::Finding::exfiltration].
6444 ///
6445 /// # Example
6446 /// ```ignore,no_run
6447 /// # use google_cloud_securitycenter_v2::model::Finding;
6448 /// use google_cloud_securitycenter_v2::model::Exfiltration;
6449 /// let x = Finding::new().set_exfiltration(Exfiltration::default()/* use setters */);
6450 /// ```
6451 pub fn set_exfiltration<T>(mut self, v: T) -> Self
6452 where
6453 T: std::convert::Into<crate::model::Exfiltration>,
6454 {
6455 self.exfiltration = std::option::Option::Some(v.into());
6456 self
6457 }
6458
6459 /// Sets or clears the value of [exfiltration][crate::model::Finding::exfiltration].
6460 ///
6461 /// # Example
6462 /// ```ignore,no_run
6463 /// # use google_cloud_securitycenter_v2::model::Finding;
6464 /// use google_cloud_securitycenter_v2::model::Exfiltration;
6465 /// let x = Finding::new().set_or_clear_exfiltration(Some(Exfiltration::default()/* use setters */));
6466 /// let x = Finding::new().set_or_clear_exfiltration(None::<Exfiltration>);
6467 /// ```
6468 pub fn set_or_clear_exfiltration<T>(mut self, v: std::option::Option<T>) -> Self
6469 where
6470 T: std::convert::Into<crate::model::Exfiltration>,
6471 {
6472 self.exfiltration = v.map(|x| x.into());
6473 self
6474 }
6475
6476 /// Sets the value of [iam_bindings][crate::model::Finding::iam_bindings].
6477 ///
6478 /// # Example
6479 /// ```ignore,no_run
6480 /// # use google_cloud_securitycenter_v2::model::Finding;
6481 /// use google_cloud_securitycenter_v2::model::IamBinding;
6482 /// let x = Finding::new()
6483 /// .set_iam_bindings([
6484 /// IamBinding::default()/* use setters */,
6485 /// IamBinding::default()/* use (different) setters */,
6486 /// ]);
6487 /// ```
6488 pub fn set_iam_bindings<T, V>(mut self, v: T) -> Self
6489 where
6490 T: std::iter::IntoIterator<Item = V>,
6491 V: std::convert::Into<crate::model::IamBinding>,
6492 {
6493 use std::iter::Iterator;
6494 self.iam_bindings = v.into_iter().map(|i| i.into()).collect();
6495 self
6496 }
6497
6498 /// Sets the value of [next_steps][crate::model::Finding::next_steps].
6499 ///
6500 /// # Example
6501 /// ```ignore,no_run
6502 /// # use google_cloud_securitycenter_v2::model::Finding;
6503 /// let x = Finding::new().set_next_steps("example");
6504 /// ```
6505 pub fn set_next_steps<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6506 self.next_steps = v.into();
6507 self
6508 }
6509
6510 /// Sets the value of [module_name][crate::model::Finding::module_name].
6511 ///
6512 /// # Example
6513 /// ```ignore,no_run
6514 /// # use google_cloud_securitycenter_v2::model::Finding;
6515 /// let x = Finding::new().set_module_name("example");
6516 /// ```
6517 pub fn set_module_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6518 self.module_name = v.into();
6519 self
6520 }
6521
6522 /// Sets the value of [containers][crate::model::Finding::containers].
6523 ///
6524 /// # Example
6525 /// ```ignore,no_run
6526 /// # use google_cloud_securitycenter_v2::model::Finding;
6527 /// use google_cloud_securitycenter_v2::model::Container;
6528 /// let x = Finding::new()
6529 /// .set_containers([
6530 /// Container::default()/* use setters */,
6531 /// Container::default()/* use (different) setters */,
6532 /// ]);
6533 /// ```
6534 pub fn set_containers<T, V>(mut self, v: T) -> Self
6535 where
6536 T: std::iter::IntoIterator<Item = V>,
6537 V: std::convert::Into<crate::model::Container>,
6538 {
6539 use std::iter::Iterator;
6540 self.containers = v.into_iter().map(|i| i.into()).collect();
6541 self
6542 }
6543
6544 /// Sets the value of [kubernetes][crate::model::Finding::kubernetes].
6545 ///
6546 /// # Example
6547 /// ```ignore,no_run
6548 /// # use google_cloud_securitycenter_v2::model::Finding;
6549 /// use google_cloud_securitycenter_v2::model::Kubernetes;
6550 /// let x = Finding::new().set_kubernetes(Kubernetes::default()/* use setters */);
6551 /// ```
6552 pub fn set_kubernetes<T>(mut self, v: T) -> Self
6553 where
6554 T: std::convert::Into<crate::model::Kubernetes>,
6555 {
6556 self.kubernetes = std::option::Option::Some(v.into());
6557 self
6558 }
6559
6560 /// Sets or clears the value of [kubernetes][crate::model::Finding::kubernetes].
6561 ///
6562 /// # Example
6563 /// ```ignore,no_run
6564 /// # use google_cloud_securitycenter_v2::model::Finding;
6565 /// use google_cloud_securitycenter_v2::model::Kubernetes;
6566 /// let x = Finding::new().set_or_clear_kubernetes(Some(Kubernetes::default()/* use setters */));
6567 /// let x = Finding::new().set_or_clear_kubernetes(None::<Kubernetes>);
6568 /// ```
6569 pub fn set_or_clear_kubernetes<T>(mut self, v: std::option::Option<T>) -> Self
6570 where
6571 T: std::convert::Into<crate::model::Kubernetes>,
6572 {
6573 self.kubernetes = v.map(|x| x.into());
6574 self
6575 }
6576
6577 /// Sets the value of [database][crate::model::Finding::database].
6578 ///
6579 /// # Example
6580 /// ```ignore,no_run
6581 /// # use google_cloud_securitycenter_v2::model::Finding;
6582 /// use google_cloud_securitycenter_v2::model::Database;
6583 /// let x = Finding::new().set_database(Database::default()/* use setters */);
6584 /// ```
6585 pub fn set_database<T>(mut self, v: T) -> Self
6586 where
6587 T: std::convert::Into<crate::model::Database>,
6588 {
6589 self.database = std::option::Option::Some(v.into());
6590 self
6591 }
6592
6593 /// Sets or clears the value of [database][crate::model::Finding::database].
6594 ///
6595 /// # Example
6596 /// ```ignore,no_run
6597 /// # use google_cloud_securitycenter_v2::model::Finding;
6598 /// use google_cloud_securitycenter_v2::model::Database;
6599 /// let x = Finding::new().set_or_clear_database(Some(Database::default()/* use setters */));
6600 /// let x = Finding::new().set_or_clear_database(None::<Database>);
6601 /// ```
6602 pub fn set_or_clear_database<T>(mut self, v: std::option::Option<T>) -> Self
6603 where
6604 T: std::convert::Into<crate::model::Database>,
6605 {
6606 self.database = v.map(|x| x.into());
6607 self
6608 }
6609
6610 /// Sets the value of [attack_exposure][crate::model::Finding::attack_exposure].
6611 ///
6612 /// # Example
6613 /// ```ignore,no_run
6614 /// # use google_cloud_securitycenter_v2::model::Finding;
6615 /// use google_cloud_securitycenter_v2::model::AttackExposure;
6616 /// let x = Finding::new().set_attack_exposure(AttackExposure::default()/* use setters */);
6617 /// ```
6618 pub fn set_attack_exposure<T>(mut self, v: T) -> Self
6619 where
6620 T: std::convert::Into<crate::model::AttackExposure>,
6621 {
6622 self.attack_exposure = std::option::Option::Some(v.into());
6623 self
6624 }
6625
6626 /// Sets or clears the value of [attack_exposure][crate::model::Finding::attack_exposure].
6627 ///
6628 /// # Example
6629 /// ```ignore,no_run
6630 /// # use google_cloud_securitycenter_v2::model::Finding;
6631 /// use google_cloud_securitycenter_v2::model::AttackExposure;
6632 /// let x = Finding::new().set_or_clear_attack_exposure(Some(AttackExposure::default()/* use setters */));
6633 /// let x = Finding::new().set_or_clear_attack_exposure(None::<AttackExposure>);
6634 /// ```
6635 pub fn set_or_clear_attack_exposure<T>(mut self, v: std::option::Option<T>) -> Self
6636 where
6637 T: std::convert::Into<crate::model::AttackExposure>,
6638 {
6639 self.attack_exposure = v.map(|x| x.into());
6640 self
6641 }
6642
6643 /// Sets the value of [files][crate::model::Finding::files].
6644 ///
6645 /// # Example
6646 /// ```ignore,no_run
6647 /// # use google_cloud_securitycenter_v2::model::Finding;
6648 /// use google_cloud_securitycenter_v2::model::File;
6649 /// let x = Finding::new()
6650 /// .set_files([
6651 /// File::default()/* use setters */,
6652 /// File::default()/* use (different) setters */,
6653 /// ]);
6654 /// ```
6655 pub fn set_files<T, V>(mut self, v: T) -> Self
6656 where
6657 T: std::iter::IntoIterator<Item = V>,
6658 V: std::convert::Into<crate::model::File>,
6659 {
6660 use std::iter::Iterator;
6661 self.files = v.into_iter().map(|i| i.into()).collect();
6662 self
6663 }
6664
6665 /// Sets the value of [cloud_dlp_inspection][crate::model::Finding::cloud_dlp_inspection].
6666 ///
6667 /// # Example
6668 /// ```ignore,no_run
6669 /// # use google_cloud_securitycenter_v2::model::Finding;
6670 /// use google_cloud_securitycenter_v2::model::CloudDlpInspection;
6671 /// let x = Finding::new().set_cloud_dlp_inspection(CloudDlpInspection::default()/* use setters */);
6672 /// ```
6673 pub fn set_cloud_dlp_inspection<T>(mut self, v: T) -> Self
6674 where
6675 T: std::convert::Into<crate::model::CloudDlpInspection>,
6676 {
6677 self.cloud_dlp_inspection = std::option::Option::Some(v.into());
6678 self
6679 }
6680
6681 /// Sets or clears the value of [cloud_dlp_inspection][crate::model::Finding::cloud_dlp_inspection].
6682 ///
6683 /// # Example
6684 /// ```ignore,no_run
6685 /// # use google_cloud_securitycenter_v2::model::Finding;
6686 /// use google_cloud_securitycenter_v2::model::CloudDlpInspection;
6687 /// let x = Finding::new().set_or_clear_cloud_dlp_inspection(Some(CloudDlpInspection::default()/* use setters */));
6688 /// let x = Finding::new().set_or_clear_cloud_dlp_inspection(None::<CloudDlpInspection>);
6689 /// ```
6690 pub fn set_or_clear_cloud_dlp_inspection<T>(mut self, v: std::option::Option<T>) -> Self
6691 where
6692 T: std::convert::Into<crate::model::CloudDlpInspection>,
6693 {
6694 self.cloud_dlp_inspection = v.map(|x| x.into());
6695 self
6696 }
6697
6698 /// Sets the value of [cloud_dlp_data_profile][crate::model::Finding::cloud_dlp_data_profile].
6699 ///
6700 /// # Example
6701 /// ```ignore,no_run
6702 /// # use google_cloud_securitycenter_v2::model::Finding;
6703 /// use google_cloud_securitycenter_v2::model::CloudDlpDataProfile;
6704 /// let x = Finding::new().set_cloud_dlp_data_profile(CloudDlpDataProfile::default()/* use setters */);
6705 /// ```
6706 pub fn set_cloud_dlp_data_profile<T>(mut self, v: T) -> Self
6707 where
6708 T: std::convert::Into<crate::model::CloudDlpDataProfile>,
6709 {
6710 self.cloud_dlp_data_profile = std::option::Option::Some(v.into());
6711 self
6712 }
6713
6714 /// Sets or clears the value of [cloud_dlp_data_profile][crate::model::Finding::cloud_dlp_data_profile].
6715 ///
6716 /// # Example
6717 /// ```ignore,no_run
6718 /// # use google_cloud_securitycenter_v2::model::Finding;
6719 /// use google_cloud_securitycenter_v2::model::CloudDlpDataProfile;
6720 /// let x = Finding::new().set_or_clear_cloud_dlp_data_profile(Some(CloudDlpDataProfile::default()/* use setters */));
6721 /// let x = Finding::new().set_or_clear_cloud_dlp_data_profile(None::<CloudDlpDataProfile>);
6722 /// ```
6723 pub fn set_or_clear_cloud_dlp_data_profile<T>(mut self, v: std::option::Option<T>) -> Self
6724 where
6725 T: std::convert::Into<crate::model::CloudDlpDataProfile>,
6726 {
6727 self.cloud_dlp_data_profile = v.map(|x| x.into());
6728 self
6729 }
6730
6731 /// Sets the value of [kernel_rootkit][crate::model::Finding::kernel_rootkit].
6732 ///
6733 /// # Example
6734 /// ```ignore,no_run
6735 /// # use google_cloud_securitycenter_v2::model::Finding;
6736 /// use google_cloud_securitycenter_v2::model::KernelRootkit;
6737 /// let x = Finding::new().set_kernel_rootkit(KernelRootkit::default()/* use setters */);
6738 /// ```
6739 pub fn set_kernel_rootkit<T>(mut self, v: T) -> Self
6740 where
6741 T: std::convert::Into<crate::model::KernelRootkit>,
6742 {
6743 self.kernel_rootkit = std::option::Option::Some(v.into());
6744 self
6745 }
6746
6747 /// Sets or clears the value of [kernel_rootkit][crate::model::Finding::kernel_rootkit].
6748 ///
6749 /// # Example
6750 /// ```ignore,no_run
6751 /// # use google_cloud_securitycenter_v2::model::Finding;
6752 /// use google_cloud_securitycenter_v2::model::KernelRootkit;
6753 /// let x = Finding::new().set_or_clear_kernel_rootkit(Some(KernelRootkit::default()/* use setters */));
6754 /// let x = Finding::new().set_or_clear_kernel_rootkit(None::<KernelRootkit>);
6755 /// ```
6756 pub fn set_or_clear_kernel_rootkit<T>(mut self, v: std::option::Option<T>) -> Self
6757 where
6758 T: std::convert::Into<crate::model::KernelRootkit>,
6759 {
6760 self.kernel_rootkit = v.map(|x| x.into());
6761 self
6762 }
6763
6764 /// Sets the value of [org_policies][crate::model::Finding::org_policies].
6765 ///
6766 /// # Example
6767 /// ```ignore,no_run
6768 /// # use google_cloud_securitycenter_v2::model::Finding;
6769 /// use google_cloud_securitycenter_v2::model::OrgPolicy;
6770 /// let x = Finding::new()
6771 /// .set_org_policies([
6772 /// OrgPolicy::default()/* use setters */,
6773 /// OrgPolicy::default()/* use (different) setters */,
6774 /// ]);
6775 /// ```
6776 pub fn set_org_policies<T, V>(mut self, v: T) -> Self
6777 where
6778 T: std::iter::IntoIterator<Item = V>,
6779 V: std::convert::Into<crate::model::OrgPolicy>,
6780 {
6781 use std::iter::Iterator;
6782 self.org_policies = v.into_iter().map(|i| i.into()).collect();
6783 self
6784 }
6785
6786 /// Sets the value of [job][crate::model::Finding::job].
6787 ///
6788 /// # Example
6789 /// ```ignore,no_run
6790 /// # use google_cloud_securitycenter_v2::model::Finding;
6791 /// use google_cloud_securitycenter_v2::model::Job;
6792 /// let x = Finding::new().set_job(Job::default()/* use setters */);
6793 /// ```
6794 pub fn set_job<T>(mut self, v: T) -> Self
6795 where
6796 T: std::convert::Into<crate::model::Job>,
6797 {
6798 self.job = std::option::Option::Some(v.into());
6799 self
6800 }
6801
6802 /// Sets or clears the value of [job][crate::model::Finding::job].
6803 ///
6804 /// # Example
6805 /// ```ignore,no_run
6806 /// # use google_cloud_securitycenter_v2::model::Finding;
6807 /// use google_cloud_securitycenter_v2::model::Job;
6808 /// let x = Finding::new().set_or_clear_job(Some(Job::default()/* use setters */));
6809 /// let x = Finding::new().set_or_clear_job(None::<Job>);
6810 /// ```
6811 pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
6812 where
6813 T: std::convert::Into<crate::model::Job>,
6814 {
6815 self.job = v.map(|x| x.into());
6816 self
6817 }
6818
6819 /// Sets the value of [application][crate::model::Finding::application].
6820 ///
6821 /// # Example
6822 /// ```ignore,no_run
6823 /// # use google_cloud_securitycenter_v2::model::Finding;
6824 /// use google_cloud_securitycenter_v2::model::Application;
6825 /// let x = Finding::new().set_application(Application::default()/* use setters */);
6826 /// ```
6827 pub fn set_application<T>(mut self, v: T) -> Self
6828 where
6829 T: std::convert::Into<crate::model::Application>,
6830 {
6831 self.application = std::option::Option::Some(v.into());
6832 self
6833 }
6834
6835 /// Sets or clears the value of [application][crate::model::Finding::application].
6836 ///
6837 /// # Example
6838 /// ```ignore,no_run
6839 /// # use google_cloud_securitycenter_v2::model::Finding;
6840 /// use google_cloud_securitycenter_v2::model::Application;
6841 /// let x = Finding::new().set_or_clear_application(Some(Application::default()/* use setters */));
6842 /// let x = Finding::new().set_or_clear_application(None::<Application>);
6843 /// ```
6844 pub fn set_or_clear_application<T>(mut self, v: std::option::Option<T>) -> Self
6845 where
6846 T: std::convert::Into<crate::model::Application>,
6847 {
6848 self.application = v.map(|x| x.into());
6849 self
6850 }
6851
6852 /// Sets the value of [ip_rules][crate::model::Finding::ip_rules].
6853 ///
6854 /// # Example
6855 /// ```ignore,no_run
6856 /// # use google_cloud_securitycenter_v2::model::Finding;
6857 /// use google_cloud_securitycenter_v2::model::IpRules;
6858 /// let x = Finding::new().set_ip_rules(IpRules::default()/* use setters */);
6859 /// ```
6860 pub fn set_ip_rules<T>(mut self, v: T) -> Self
6861 where
6862 T: std::convert::Into<crate::model::IpRules>,
6863 {
6864 self.ip_rules = std::option::Option::Some(v.into());
6865 self
6866 }
6867
6868 /// Sets or clears the value of [ip_rules][crate::model::Finding::ip_rules].
6869 ///
6870 /// # Example
6871 /// ```ignore,no_run
6872 /// # use google_cloud_securitycenter_v2::model::Finding;
6873 /// use google_cloud_securitycenter_v2::model::IpRules;
6874 /// let x = Finding::new().set_or_clear_ip_rules(Some(IpRules::default()/* use setters */));
6875 /// let x = Finding::new().set_or_clear_ip_rules(None::<IpRules>);
6876 /// ```
6877 pub fn set_or_clear_ip_rules<T>(mut self, v: std::option::Option<T>) -> Self
6878 where
6879 T: std::convert::Into<crate::model::IpRules>,
6880 {
6881 self.ip_rules = v.map(|x| x.into());
6882 self
6883 }
6884
6885 /// Sets the value of [backup_disaster_recovery][crate::model::Finding::backup_disaster_recovery].
6886 ///
6887 /// # Example
6888 /// ```ignore,no_run
6889 /// # use google_cloud_securitycenter_v2::model::Finding;
6890 /// use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
6891 /// let x = Finding::new().set_backup_disaster_recovery(BackupDisasterRecovery::default()/* use setters */);
6892 /// ```
6893 pub fn set_backup_disaster_recovery<T>(mut self, v: T) -> Self
6894 where
6895 T: std::convert::Into<crate::model::BackupDisasterRecovery>,
6896 {
6897 self.backup_disaster_recovery = std::option::Option::Some(v.into());
6898 self
6899 }
6900
6901 /// Sets or clears the value of [backup_disaster_recovery][crate::model::Finding::backup_disaster_recovery].
6902 ///
6903 /// # Example
6904 /// ```ignore,no_run
6905 /// # use google_cloud_securitycenter_v2::model::Finding;
6906 /// use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
6907 /// let x = Finding::new().set_or_clear_backup_disaster_recovery(Some(BackupDisasterRecovery::default()/* use setters */));
6908 /// let x = Finding::new().set_or_clear_backup_disaster_recovery(None::<BackupDisasterRecovery>);
6909 /// ```
6910 pub fn set_or_clear_backup_disaster_recovery<T>(mut self, v: std::option::Option<T>) -> Self
6911 where
6912 T: std::convert::Into<crate::model::BackupDisasterRecovery>,
6913 {
6914 self.backup_disaster_recovery = v.map(|x| x.into());
6915 self
6916 }
6917
6918 /// Sets the value of [security_posture][crate::model::Finding::security_posture].
6919 ///
6920 /// # Example
6921 /// ```ignore,no_run
6922 /// # use google_cloud_securitycenter_v2::model::Finding;
6923 /// use google_cloud_securitycenter_v2::model::SecurityPosture;
6924 /// let x = Finding::new().set_security_posture(SecurityPosture::default()/* use setters */);
6925 /// ```
6926 pub fn set_security_posture<T>(mut self, v: T) -> Self
6927 where
6928 T: std::convert::Into<crate::model::SecurityPosture>,
6929 {
6930 self.security_posture = std::option::Option::Some(v.into());
6931 self
6932 }
6933
6934 /// Sets or clears the value of [security_posture][crate::model::Finding::security_posture].
6935 ///
6936 /// # Example
6937 /// ```ignore,no_run
6938 /// # use google_cloud_securitycenter_v2::model::Finding;
6939 /// use google_cloud_securitycenter_v2::model::SecurityPosture;
6940 /// let x = Finding::new().set_or_clear_security_posture(Some(SecurityPosture::default()/* use setters */));
6941 /// let x = Finding::new().set_or_clear_security_posture(None::<SecurityPosture>);
6942 /// ```
6943 pub fn set_or_clear_security_posture<T>(mut self, v: std::option::Option<T>) -> Self
6944 where
6945 T: std::convert::Into<crate::model::SecurityPosture>,
6946 {
6947 self.security_posture = v.map(|x| x.into());
6948 self
6949 }
6950
6951 /// Sets the value of [log_entries][crate::model::Finding::log_entries].
6952 ///
6953 /// # Example
6954 /// ```ignore,no_run
6955 /// # use google_cloud_securitycenter_v2::model::Finding;
6956 /// use google_cloud_securitycenter_v2::model::LogEntry;
6957 /// let x = Finding::new()
6958 /// .set_log_entries([
6959 /// LogEntry::default()/* use setters */,
6960 /// LogEntry::default()/* use (different) setters */,
6961 /// ]);
6962 /// ```
6963 pub fn set_log_entries<T, V>(mut self, v: T) -> Self
6964 where
6965 T: std::iter::IntoIterator<Item = V>,
6966 V: std::convert::Into<crate::model::LogEntry>,
6967 {
6968 use std::iter::Iterator;
6969 self.log_entries = v.into_iter().map(|i| i.into()).collect();
6970 self
6971 }
6972
6973 /// Sets the value of [load_balancers][crate::model::Finding::load_balancers].
6974 ///
6975 /// # Example
6976 /// ```ignore,no_run
6977 /// # use google_cloud_securitycenter_v2::model::Finding;
6978 /// use google_cloud_securitycenter_v2::model::LoadBalancer;
6979 /// let x = Finding::new()
6980 /// .set_load_balancers([
6981 /// LoadBalancer::default()/* use setters */,
6982 /// LoadBalancer::default()/* use (different) setters */,
6983 /// ]);
6984 /// ```
6985 pub fn set_load_balancers<T, V>(mut self, v: T) -> Self
6986 where
6987 T: std::iter::IntoIterator<Item = V>,
6988 V: std::convert::Into<crate::model::LoadBalancer>,
6989 {
6990 use std::iter::Iterator;
6991 self.load_balancers = v.into_iter().map(|i| i.into()).collect();
6992 self
6993 }
6994
6995 /// Sets the value of [cloud_armor][crate::model::Finding::cloud_armor].
6996 ///
6997 /// # Example
6998 /// ```ignore,no_run
6999 /// # use google_cloud_securitycenter_v2::model::Finding;
7000 /// use google_cloud_securitycenter_v2::model::CloudArmor;
7001 /// let x = Finding::new().set_cloud_armor(CloudArmor::default()/* use setters */);
7002 /// ```
7003 pub fn set_cloud_armor<T>(mut self, v: T) -> Self
7004 where
7005 T: std::convert::Into<crate::model::CloudArmor>,
7006 {
7007 self.cloud_armor = std::option::Option::Some(v.into());
7008 self
7009 }
7010
7011 /// Sets or clears the value of [cloud_armor][crate::model::Finding::cloud_armor].
7012 ///
7013 /// # Example
7014 /// ```ignore,no_run
7015 /// # use google_cloud_securitycenter_v2::model::Finding;
7016 /// use google_cloud_securitycenter_v2::model::CloudArmor;
7017 /// let x = Finding::new().set_or_clear_cloud_armor(Some(CloudArmor::default()/* use setters */));
7018 /// let x = Finding::new().set_or_clear_cloud_armor(None::<CloudArmor>);
7019 /// ```
7020 pub fn set_or_clear_cloud_armor<T>(mut self, v: std::option::Option<T>) -> Self
7021 where
7022 T: std::convert::Into<crate::model::CloudArmor>,
7023 {
7024 self.cloud_armor = v.map(|x| x.into());
7025 self
7026 }
7027
7028 /// Sets the value of [notebook][crate::model::Finding::notebook].
7029 ///
7030 /// # Example
7031 /// ```ignore,no_run
7032 /// # use google_cloud_securitycenter_v2::model::Finding;
7033 /// use google_cloud_securitycenter_v2::model::Notebook;
7034 /// let x = Finding::new().set_notebook(Notebook::default()/* use setters */);
7035 /// ```
7036 pub fn set_notebook<T>(mut self, v: T) -> Self
7037 where
7038 T: std::convert::Into<crate::model::Notebook>,
7039 {
7040 self.notebook = std::option::Option::Some(v.into());
7041 self
7042 }
7043
7044 /// Sets or clears the value of [notebook][crate::model::Finding::notebook].
7045 ///
7046 /// # Example
7047 /// ```ignore,no_run
7048 /// # use google_cloud_securitycenter_v2::model::Finding;
7049 /// use google_cloud_securitycenter_v2::model::Notebook;
7050 /// let x = Finding::new().set_or_clear_notebook(Some(Notebook::default()/* use setters */));
7051 /// let x = Finding::new().set_or_clear_notebook(None::<Notebook>);
7052 /// ```
7053 pub fn set_or_clear_notebook<T>(mut self, v: std::option::Option<T>) -> Self
7054 where
7055 T: std::convert::Into<crate::model::Notebook>,
7056 {
7057 self.notebook = v.map(|x| x.into());
7058 self
7059 }
7060
7061 /// Sets the value of [toxic_combination][crate::model::Finding::toxic_combination].
7062 ///
7063 /// # Example
7064 /// ```ignore,no_run
7065 /// # use google_cloud_securitycenter_v2::model::Finding;
7066 /// use google_cloud_securitycenter_v2::model::ToxicCombination;
7067 /// let x = Finding::new().set_toxic_combination(ToxicCombination::default()/* use setters */);
7068 /// ```
7069 pub fn set_toxic_combination<T>(mut self, v: T) -> Self
7070 where
7071 T: std::convert::Into<crate::model::ToxicCombination>,
7072 {
7073 self.toxic_combination = std::option::Option::Some(v.into());
7074 self
7075 }
7076
7077 /// Sets or clears the value of [toxic_combination][crate::model::Finding::toxic_combination].
7078 ///
7079 /// # Example
7080 /// ```ignore,no_run
7081 /// # use google_cloud_securitycenter_v2::model::Finding;
7082 /// use google_cloud_securitycenter_v2::model::ToxicCombination;
7083 /// let x = Finding::new().set_or_clear_toxic_combination(Some(ToxicCombination::default()/* use setters */));
7084 /// let x = Finding::new().set_or_clear_toxic_combination(None::<ToxicCombination>);
7085 /// ```
7086 pub fn set_or_clear_toxic_combination<T>(mut self, v: std::option::Option<T>) -> Self
7087 where
7088 T: std::convert::Into<crate::model::ToxicCombination>,
7089 {
7090 self.toxic_combination = v.map(|x| x.into());
7091 self
7092 }
7093
7094 /// Sets the value of [group_memberships][crate::model::Finding::group_memberships].
7095 ///
7096 /// # Example
7097 /// ```ignore,no_run
7098 /// # use google_cloud_securitycenter_v2::model::Finding;
7099 /// use google_cloud_securitycenter_v2::model::GroupMembership;
7100 /// let x = Finding::new()
7101 /// .set_group_memberships([
7102 /// GroupMembership::default()/* use setters */,
7103 /// GroupMembership::default()/* use (different) setters */,
7104 /// ]);
7105 /// ```
7106 pub fn set_group_memberships<T, V>(mut self, v: T) -> Self
7107 where
7108 T: std::iter::IntoIterator<Item = V>,
7109 V: std::convert::Into<crate::model::GroupMembership>,
7110 {
7111 use std::iter::Iterator;
7112 self.group_memberships = v.into_iter().map(|i| i.into()).collect();
7113 self
7114 }
7115
7116 /// Sets the value of [disk][crate::model::Finding::disk].
7117 ///
7118 /// # Example
7119 /// ```ignore,no_run
7120 /// # use google_cloud_securitycenter_v2::model::Finding;
7121 /// use google_cloud_securitycenter_v2::model::Disk;
7122 /// let x = Finding::new().set_disk(Disk::default()/* use setters */);
7123 /// ```
7124 pub fn set_disk<T>(mut self, v: T) -> Self
7125 where
7126 T: std::convert::Into<crate::model::Disk>,
7127 {
7128 self.disk = std::option::Option::Some(v.into());
7129 self
7130 }
7131
7132 /// Sets or clears the value of [disk][crate::model::Finding::disk].
7133 ///
7134 /// # Example
7135 /// ```ignore,no_run
7136 /// # use google_cloud_securitycenter_v2::model::Finding;
7137 /// use google_cloud_securitycenter_v2::model::Disk;
7138 /// let x = Finding::new().set_or_clear_disk(Some(Disk::default()/* use setters */));
7139 /// let x = Finding::new().set_or_clear_disk(None::<Disk>);
7140 /// ```
7141 pub fn set_or_clear_disk<T>(mut self, v: std::option::Option<T>) -> Self
7142 where
7143 T: std::convert::Into<crate::model::Disk>,
7144 {
7145 self.disk = v.map(|x| x.into());
7146 self
7147 }
7148
7149 /// Sets the value of [data_access_events][crate::model::Finding::data_access_events].
7150 ///
7151 /// # Example
7152 /// ```ignore,no_run
7153 /// # use google_cloud_securitycenter_v2::model::Finding;
7154 /// use google_cloud_securitycenter_v2::model::DataAccessEvent;
7155 /// let x = Finding::new()
7156 /// .set_data_access_events([
7157 /// DataAccessEvent::default()/* use setters */,
7158 /// DataAccessEvent::default()/* use (different) setters */,
7159 /// ]);
7160 /// ```
7161 pub fn set_data_access_events<T, V>(mut self, v: T) -> Self
7162 where
7163 T: std::iter::IntoIterator<Item = V>,
7164 V: std::convert::Into<crate::model::DataAccessEvent>,
7165 {
7166 use std::iter::Iterator;
7167 self.data_access_events = v.into_iter().map(|i| i.into()).collect();
7168 self
7169 }
7170
7171 /// Sets the value of [data_flow_events][crate::model::Finding::data_flow_events].
7172 ///
7173 /// # Example
7174 /// ```ignore,no_run
7175 /// # use google_cloud_securitycenter_v2::model::Finding;
7176 /// use google_cloud_securitycenter_v2::model::DataFlowEvent;
7177 /// let x = Finding::new()
7178 /// .set_data_flow_events([
7179 /// DataFlowEvent::default()/* use setters */,
7180 /// DataFlowEvent::default()/* use (different) setters */,
7181 /// ]);
7182 /// ```
7183 pub fn set_data_flow_events<T, V>(mut self, v: T) -> Self
7184 where
7185 T: std::iter::IntoIterator<Item = V>,
7186 V: std::convert::Into<crate::model::DataFlowEvent>,
7187 {
7188 use std::iter::Iterator;
7189 self.data_flow_events = v.into_iter().map(|i| i.into()).collect();
7190 self
7191 }
7192
7193 /// Sets the value of [networks][crate::model::Finding::networks].
7194 ///
7195 /// # Example
7196 /// ```ignore,no_run
7197 /// # use google_cloud_securitycenter_v2::model::Finding;
7198 /// use google_cloud_securitycenter_v2::model::Network;
7199 /// let x = Finding::new()
7200 /// .set_networks([
7201 /// Network::default()/* use setters */,
7202 /// Network::default()/* use (different) setters */,
7203 /// ]);
7204 /// ```
7205 pub fn set_networks<T, V>(mut self, v: T) -> Self
7206 where
7207 T: std::iter::IntoIterator<Item = V>,
7208 V: std::convert::Into<crate::model::Network>,
7209 {
7210 use std::iter::Iterator;
7211 self.networks = v.into_iter().map(|i| i.into()).collect();
7212 self
7213 }
7214
7215 /// Sets the value of [data_retention_deletion_events][crate::model::Finding::data_retention_deletion_events].
7216 ///
7217 /// # Example
7218 /// ```ignore,no_run
7219 /// # use google_cloud_securitycenter_v2::model::Finding;
7220 /// use google_cloud_securitycenter_v2::model::DataRetentionDeletionEvent;
7221 /// let x = Finding::new()
7222 /// .set_data_retention_deletion_events([
7223 /// DataRetentionDeletionEvent::default()/* use setters */,
7224 /// DataRetentionDeletionEvent::default()/* use (different) setters */,
7225 /// ]);
7226 /// ```
7227 pub fn set_data_retention_deletion_events<T, V>(mut self, v: T) -> Self
7228 where
7229 T: std::iter::IntoIterator<Item = V>,
7230 V: std::convert::Into<crate::model::DataRetentionDeletionEvent>,
7231 {
7232 use std::iter::Iterator;
7233 self.data_retention_deletion_events = v.into_iter().map(|i| i.into()).collect();
7234 self
7235 }
7236
7237 /// Sets the value of [affected_resources][crate::model::Finding::affected_resources].
7238 ///
7239 /// # Example
7240 /// ```ignore,no_run
7241 /// # use google_cloud_securitycenter_v2::model::Finding;
7242 /// use google_cloud_securitycenter_v2::model::AffectedResources;
7243 /// let x = Finding::new().set_affected_resources(AffectedResources::default()/* use setters */);
7244 /// ```
7245 pub fn set_affected_resources<T>(mut self, v: T) -> Self
7246 where
7247 T: std::convert::Into<crate::model::AffectedResources>,
7248 {
7249 self.affected_resources = std::option::Option::Some(v.into());
7250 self
7251 }
7252
7253 /// Sets or clears the value of [affected_resources][crate::model::Finding::affected_resources].
7254 ///
7255 /// # Example
7256 /// ```ignore,no_run
7257 /// # use google_cloud_securitycenter_v2::model::Finding;
7258 /// use google_cloud_securitycenter_v2::model::AffectedResources;
7259 /// let x = Finding::new().set_or_clear_affected_resources(Some(AffectedResources::default()/* use setters */));
7260 /// let x = Finding::new().set_or_clear_affected_resources(None::<AffectedResources>);
7261 /// ```
7262 pub fn set_or_clear_affected_resources<T>(mut self, v: std::option::Option<T>) -> Self
7263 where
7264 T: std::convert::Into<crate::model::AffectedResources>,
7265 {
7266 self.affected_resources = v.map(|x| x.into());
7267 self
7268 }
7269
7270 /// Sets the value of [ai_model][crate::model::Finding::ai_model].
7271 ///
7272 /// # Example
7273 /// ```ignore,no_run
7274 /// # use google_cloud_securitycenter_v2::model::Finding;
7275 /// use google_cloud_securitycenter_v2::model::AiModel;
7276 /// let x = Finding::new().set_ai_model(AiModel::default()/* use setters */);
7277 /// ```
7278 pub fn set_ai_model<T>(mut self, v: T) -> Self
7279 where
7280 T: std::convert::Into<crate::model::AiModel>,
7281 {
7282 self.ai_model = std::option::Option::Some(v.into());
7283 self
7284 }
7285
7286 /// Sets or clears the value of [ai_model][crate::model::Finding::ai_model].
7287 ///
7288 /// # Example
7289 /// ```ignore,no_run
7290 /// # use google_cloud_securitycenter_v2::model::Finding;
7291 /// use google_cloud_securitycenter_v2::model::AiModel;
7292 /// let x = Finding::new().set_or_clear_ai_model(Some(AiModel::default()/* use setters */));
7293 /// let x = Finding::new().set_or_clear_ai_model(None::<AiModel>);
7294 /// ```
7295 pub fn set_or_clear_ai_model<T>(mut self, v: std::option::Option<T>) -> Self
7296 where
7297 T: std::convert::Into<crate::model::AiModel>,
7298 {
7299 self.ai_model = v.map(|x| x.into());
7300 self
7301 }
7302
7303 /// Sets the value of [chokepoint][crate::model::Finding::chokepoint].
7304 ///
7305 /// # Example
7306 /// ```ignore,no_run
7307 /// # use google_cloud_securitycenter_v2::model::Finding;
7308 /// use google_cloud_securitycenter_v2::model::Chokepoint;
7309 /// let x = Finding::new().set_chokepoint(Chokepoint::default()/* use setters */);
7310 /// ```
7311 pub fn set_chokepoint<T>(mut self, v: T) -> Self
7312 where
7313 T: std::convert::Into<crate::model::Chokepoint>,
7314 {
7315 self.chokepoint = std::option::Option::Some(v.into());
7316 self
7317 }
7318
7319 /// Sets or clears the value of [chokepoint][crate::model::Finding::chokepoint].
7320 ///
7321 /// # Example
7322 /// ```ignore,no_run
7323 /// # use google_cloud_securitycenter_v2::model::Finding;
7324 /// use google_cloud_securitycenter_v2::model::Chokepoint;
7325 /// let x = Finding::new().set_or_clear_chokepoint(Some(Chokepoint::default()/* use setters */));
7326 /// let x = Finding::new().set_or_clear_chokepoint(None::<Chokepoint>);
7327 /// ```
7328 pub fn set_or_clear_chokepoint<T>(mut self, v: std::option::Option<T>) -> Self
7329 where
7330 T: std::convert::Into<crate::model::Chokepoint>,
7331 {
7332 self.chokepoint = v.map(|x| x.into());
7333 self
7334 }
7335
7336 /// Sets the value of [vertex_ai][crate::model::Finding::vertex_ai].
7337 ///
7338 /// # Example
7339 /// ```ignore,no_run
7340 /// # use google_cloud_securitycenter_v2::model::Finding;
7341 /// use google_cloud_securitycenter_v2::model::VertexAi;
7342 /// let x = Finding::new().set_vertex_ai(VertexAi::default()/* use setters */);
7343 /// ```
7344 pub fn set_vertex_ai<T>(mut self, v: T) -> Self
7345 where
7346 T: std::convert::Into<crate::model::VertexAi>,
7347 {
7348 self.vertex_ai = std::option::Option::Some(v.into());
7349 self
7350 }
7351
7352 /// Sets or clears the value of [vertex_ai][crate::model::Finding::vertex_ai].
7353 ///
7354 /// # Example
7355 /// ```ignore,no_run
7356 /// # use google_cloud_securitycenter_v2::model::Finding;
7357 /// use google_cloud_securitycenter_v2::model::VertexAi;
7358 /// let x = Finding::new().set_or_clear_vertex_ai(Some(VertexAi::default()/* use setters */));
7359 /// let x = Finding::new().set_or_clear_vertex_ai(None::<VertexAi>);
7360 /// ```
7361 pub fn set_or_clear_vertex_ai<T>(mut self, v: std::option::Option<T>) -> Self
7362 where
7363 T: std::convert::Into<crate::model::VertexAi>,
7364 {
7365 self.vertex_ai = v.map(|x| x.into());
7366 self
7367 }
7368}
7369
7370impl wkt::message::Message for Finding {
7371 fn typename() -> &'static str {
7372 "type.googleapis.com/google.cloud.securitycenter.v2.Finding"
7373 }
7374}
7375
7376/// Defines additional types related to [Finding].
7377pub mod finding {
7378 #[allow(unused_imports)]
7379 use super::*;
7380
7381 /// Mute information about the finding, including whether the finding has a
7382 /// static mute or any matching dynamic mute rules.
7383 #[derive(Clone, Default, PartialEq)]
7384 #[non_exhaustive]
7385 pub struct MuteInfo {
7386 /// If set, the static mute applied to this finding. Static mutes override
7387 /// dynamic mutes. If unset, there is no static mute.
7388 pub static_mute: std::option::Option<crate::model::finding::mute_info::StaticMute>,
7389
7390 /// The list of dynamic mute rules that currently match the finding.
7391 pub dynamic_mute_records:
7392 std::vec::Vec<crate::model::finding::mute_info::DynamicMuteRecord>,
7393
7394 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7395 }
7396
7397 impl MuteInfo {
7398 pub fn new() -> Self {
7399 std::default::Default::default()
7400 }
7401
7402 /// Sets the value of [static_mute][crate::model::finding::MuteInfo::static_mute].
7403 ///
7404 /// # Example
7405 /// ```ignore,no_run
7406 /// # use google_cloud_securitycenter_v2::model::finding::MuteInfo;
7407 /// use google_cloud_securitycenter_v2::model::finding::mute_info::StaticMute;
7408 /// let x = MuteInfo::new().set_static_mute(StaticMute::default()/* use setters */);
7409 /// ```
7410 pub fn set_static_mute<T>(mut self, v: T) -> Self
7411 where
7412 T: std::convert::Into<crate::model::finding::mute_info::StaticMute>,
7413 {
7414 self.static_mute = std::option::Option::Some(v.into());
7415 self
7416 }
7417
7418 /// Sets or clears the value of [static_mute][crate::model::finding::MuteInfo::static_mute].
7419 ///
7420 /// # Example
7421 /// ```ignore,no_run
7422 /// # use google_cloud_securitycenter_v2::model::finding::MuteInfo;
7423 /// use google_cloud_securitycenter_v2::model::finding::mute_info::StaticMute;
7424 /// let x = MuteInfo::new().set_or_clear_static_mute(Some(StaticMute::default()/* use setters */));
7425 /// let x = MuteInfo::new().set_or_clear_static_mute(None::<StaticMute>);
7426 /// ```
7427 pub fn set_or_clear_static_mute<T>(mut self, v: std::option::Option<T>) -> Self
7428 where
7429 T: std::convert::Into<crate::model::finding::mute_info::StaticMute>,
7430 {
7431 self.static_mute = v.map(|x| x.into());
7432 self
7433 }
7434
7435 /// Sets the value of [dynamic_mute_records][crate::model::finding::MuteInfo::dynamic_mute_records].
7436 ///
7437 /// # Example
7438 /// ```ignore,no_run
7439 /// # use google_cloud_securitycenter_v2::model::finding::MuteInfo;
7440 /// use google_cloud_securitycenter_v2::model::finding::mute_info::DynamicMuteRecord;
7441 /// let x = MuteInfo::new()
7442 /// .set_dynamic_mute_records([
7443 /// DynamicMuteRecord::default()/* use setters */,
7444 /// DynamicMuteRecord::default()/* use (different) setters */,
7445 /// ]);
7446 /// ```
7447 pub fn set_dynamic_mute_records<T, V>(mut self, v: T) -> Self
7448 where
7449 T: std::iter::IntoIterator<Item = V>,
7450 V: std::convert::Into<crate::model::finding::mute_info::DynamicMuteRecord>,
7451 {
7452 use std::iter::Iterator;
7453 self.dynamic_mute_records = v.into_iter().map(|i| i.into()).collect();
7454 self
7455 }
7456 }
7457
7458 impl wkt::message::Message for MuteInfo {
7459 fn typename() -> &'static str {
7460 "type.googleapis.com/google.cloud.securitycenter.v2.Finding.MuteInfo"
7461 }
7462 }
7463
7464 /// Defines additional types related to [MuteInfo].
7465 pub mod mute_info {
7466 #[allow(unused_imports)]
7467 use super::*;
7468
7469 /// Information about the static mute state. A static mute state overrides
7470 /// any dynamic mute rules that apply to this finding. The static mute state
7471 /// can be set by a static mute rule or by muting the finding directly.
7472 #[derive(Clone, Default, PartialEq)]
7473 #[non_exhaustive]
7474 pub struct StaticMute {
7475 /// The static mute state. If the value is `MUTED` or `UNMUTED`, then the
7476 /// finding's overall mute state will have the same value.
7477 pub state: crate::model::finding::Mute,
7478
7479 /// When the static mute was applied.
7480 pub apply_time: std::option::Option<wkt::Timestamp>,
7481
7482 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7483 }
7484
7485 impl StaticMute {
7486 pub fn new() -> Self {
7487 std::default::Default::default()
7488 }
7489
7490 /// Sets the value of [state][crate::model::finding::mute_info::StaticMute::state].
7491 ///
7492 /// # Example
7493 /// ```ignore,no_run
7494 /// # use google_cloud_securitycenter_v2::model::finding::mute_info::StaticMute;
7495 /// use google_cloud_securitycenter_v2::model::finding::Mute;
7496 /// let x0 = StaticMute::new().set_state(Mute::Muted);
7497 /// let x1 = StaticMute::new().set_state(Mute::Unmuted);
7498 /// let x2 = StaticMute::new().set_state(Mute::Undefined);
7499 /// ```
7500 pub fn set_state<T: std::convert::Into<crate::model::finding::Mute>>(
7501 mut self,
7502 v: T,
7503 ) -> Self {
7504 self.state = v.into();
7505 self
7506 }
7507
7508 /// Sets the value of [apply_time][crate::model::finding::mute_info::StaticMute::apply_time].
7509 ///
7510 /// # Example
7511 /// ```ignore,no_run
7512 /// # use google_cloud_securitycenter_v2::model::finding::mute_info::StaticMute;
7513 /// use wkt::Timestamp;
7514 /// let x = StaticMute::new().set_apply_time(Timestamp::default()/* use setters */);
7515 /// ```
7516 pub fn set_apply_time<T>(mut self, v: T) -> Self
7517 where
7518 T: std::convert::Into<wkt::Timestamp>,
7519 {
7520 self.apply_time = std::option::Option::Some(v.into());
7521 self
7522 }
7523
7524 /// Sets or clears the value of [apply_time][crate::model::finding::mute_info::StaticMute::apply_time].
7525 ///
7526 /// # Example
7527 /// ```ignore,no_run
7528 /// # use google_cloud_securitycenter_v2::model::finding::mute_info::StaticMute;
7529 /// use wkt::Timestamp;
7530 /// let x = StaticMute::new().set_or_clear_apply_time(Some(Timestamp::default()/* use setters */));
7531 /// let x = StaticMute::new().set_or_clear_apply_time(None::<Timestamp>);
7532 /// ```
7533 pub fn set_or_clear_apply_time<T>(mut self, v: std::option::Option<T>) -> Self
7534 where
7535 T: std::convert::Into<wkt::Timestamp>,
7536 {
7537 self.apply_time = v.map(|x| x.into());
7538 self
7539 }
7540 }
7541
7542 impl wkt::message::Message for StaticMute {
7543 fn typename() -> &'static str {
7544 "type.googleapis.com/google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute"
7545 }
7546 }
7547
7548 /// The record of a dynamic mute rule that matches the finding.
7549 #[derive(Clone, Default, PartialEq)]
7550 #[non_exhaustive]
7551 pub struct DynamicMuteRecord {
7552 /// The relative resource name of the mute rule, represented by a mute
7553 /// config, that created this record, for example
7554 /// `organizations/123/muteConfigs/mymuteconfig` or
7555 /// `organizations/123/locations/global/muteConfigs/mymuteconfig`.
7556 pub mute_config: std::string::String,
7557
7558 /// When the dynamic mute rule first matched the finding.
7559 pub match_time: std::option::Option<wkt::Timestamp>,
7560
7561 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7562 }
7563
7564 impl DynamicMuteRecord {
7565 pub fn new() -> Self {
7566 std::default::Default::default()
7567 }
7568
7569 /// Sets the value of [mute_config][crate::model::finding::mute_info::DynamicMuteRecord::mute_config].
7570 ///
7571 /// # Example
7572 /// ```ignore,no_run
7573 /// # use google_cloud_securitycenter_v2::model::finding::mute_info::DynamicMuteRecord;
7574 /// let x = DynamicMuteRecord::new().set_mute_config("example");
7575 /// ```
7576 pub fn set_mute_config<T: std::convert::Into<std::string::String>>(
7577 mut self,
7578 v: T,
7579 ) -> Self {
7580 self.mute_config = v.into();
7581 self
7582 }
7583
7584 /// Sets the value of [match_time][crate::model::finding::mute_info::DynamicMuteRecord::match_time].
7585 ///
7586 /// # Example
7587 /// ```ignore,no_run
7588 /// # use google_cloud_securitycenter_v2::model::finding::mute_info::DynamicMuteRecord;
7589 /// use wkt::Timestamp;
7590 /// let x = DynamicMuteRecord::new().set_match_time(Timestamp::default()/* use setters */);
7591 /// ```
7592 pub fn set_match_time<T>(mut self, v: T) -> Self
7593 where
7594 T: std::convert::Into<wkt::Timestamp>,
7595 {
7596 self.match_time = std::option::Option::Some(v.into());
7597 self
7598 }
7599
7600 /// Sets or clears the value of [match_time][crate::model::finding::mute_info::DynamicMuteRecord::match_time].
7601 ///
7602 /// # Example
7603 /// ```ignore,no_run
7604 /// # use google_cloud_securitycenter_v2::model::finding::mute_info::DynamicMuteRecord;
7605 /// use wkt::Timestamp;
7606 /// let x = DynamicMuteRecord::new().set_or_clear_match_time(Some(Timestamp::default()/* use setters */));
7607 /// let x = DynamicMuteRecord::new().set_or_clear_match_time(None::<Timestamp>);
7608 /// ```
7609 pub fn set_or_clear_match_time<T>(mut self, v: std::option::Option<T>) -> Self
7610 where
7611 T: std::convert::Into<wkt::Timestamp>,
7612 {
7613 self.match_time = v.map(|x| x.into());
7614 self
7615 }
7616 }
7617
7618 impl wkt::message::Message for DynamicMuteRecord {
7619 fn typename() -> &'static str {
7620 "type.googleapis.com/google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord"
7621 }
7622 }
7623 }
7624
7625 /// The state of the finding.
7626 ///
7627 /// # Working with unknown values
7628 ///
7629 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7630 /// additional enum variants at any time. Adding new variants is not considered
7631 /// a breaking change. Applications should write their code in anticipation of:
7632 ///
7633 /// - New values appearing in future releases of the client library, **and**
7634 /// - New values received dynamically, without application changes.
7635 ///
7636 /// Please consult the [Working with enums] section in the user guide for some
7637 /// guidelines.
7638 ///
7639 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7640 #[derive(Clone, Debug, PartialEq)]
7641 #[non_exhaustive]
7642 pub enum State {
7643 /// Unspecified state.
7644 Unspecified,
7645 /// The finding requires attention and has not been addressed yet.
7646 Active,
7647 /// The finding has been fixed, triaged as a non-issue or otherwise addressed
7648 /// and is no longer active.
7649 Inactive,
7650 /// If set, the enum was initialized with an unknown value.
7651 ///
7652 /// Applications can examine the value using [State::value] or
7653 /// [State::name].
7654 UnknownValue(state::UnknownValue),
7655 }
7656
7657 #[doc(hidden)]
7658 pub mod state {
7659 #[allow(unused_imports)]
7660 use super::*;
7661 #[derive(Clone, Debug, PartialEq)]
7662 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7663 }
7664
7665 impl State {
7666 /// Gets the enum value.
7667 ///
7668 /// Returns `None` if the enum contains an unknown value deserialized from
7669 /// the string representation of enums.
7670 pub fn value(&self) -> std::option::Option<i32> {
7671 match self {
7672 Self::Unspecified => std::option::Option::Some(0),
7673 Self::Active => std::option::Option::Some(1),
7674 Self::Inactive => std::option::Option::Some(2),
7675 Self::UnknownValue(u) => u.0.value(),
7676 }
7677 }
7678
7679 /// Gets the enum value as a string.
7680 ///
7681 /// Returns `None` if the enum contains an unknown value deserialized from
7682 /// the integer representation of enums.
7683 pub fn name(&self) -> std::option::Option<&str> {
7684 match self {
7685 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
7686 Self::Active => std::option::Option::Some("ACTIVE"),
7687 Self::Inactive => std::option::Option::Some("INACTIVE"),
7688 Self::UnknownValue(u) => u.0.name(),
7689 }
7690 }
7691 }
7692
7693 impl std::default::Default for State {
7694 fn default() -> Self {
7695 use std::convert::From;
7696 Self::from(0)
7697 }
7698 }
7699
7700 impl std::fmt::Display for State {
7701 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7702 wkt::internal::display_enum(f, self.name(), self.value())
7703 }
7704 }
7705
7706 impl std::convert::From<i32> for State {
7707 fn from(value: i32) -> Self {
7708 match value {
7709 0 => Self::Unspecified,
7710 1 => Self::Active,
7711 2 => Self::Inactive,
7712 _ => Self::UnknownValue(state::UnknownValue(
7713 wkt::internal::UnknownEnumValue::Integer(value),
7714 )),
7715 }
7716 }
7717 }
7718
7719 impl std::convert::From<&str> for State {
7720 fn from(value: &str) -> Self {
7721 use std::string::ToString;
7722 match value {
7723 "STATE_UNSPECIFIED" => Self::Unspecified,
7724 "ACTIVE" => Self::Active,
7725 "INACTIVE" => Self::Inactive,
7726 _ => Self::UnknownValue(state::UnknownValue(
7727 wkt::internal::UnknownEnumValue::String(value.to_string()),
7728 )),
7729 }
7730 }
7731 }
7732
7733 impl serde::ser::Serialize for State {
7734 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7735 where
7736 S: serde::Serializer,
7737 {
7738 match self {
7739 Self::Unspecified => serializer.serialize_i32(0),
7740 Self::Active => serializer.serialize_i32(1),
7741 Self::Inactive => serializer.serialize_i32(2),
7742 Self::UnknownValue(u) => u.0.serialize(serializer),
7743 }
7744 }
7745 }
7746
7747 impl<'de> serde::de::Deserialize<'de> for State {
7748 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7749 where
7750 D: serde::Deserializer<'de>,
7751 {
7752 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
7753 ".google.cloud.securitycenter.v2.Finding.State",
7754 ))
7755 }
7756 }
7757
7758 /// The severity of the finding.
7759 ///
7760 /// # Working with unknown values
7761 ///
7762 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7763 /// additional enum variants at any time. Adding new variants is not considered
7764 /// a breaking change. Applications should write their code in anticipation of:
7765 ///
7766 /// - New values appearing in future releases of the client library, **and**
7767 /// - New values received dynamically, without application changes.
7768 ///
7769 /// Please consult the [Working with enums] section in the user guide for some
7770 /// guidelines.
7771 ///
7772 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7773 #[derive(Clone, Debug, PartialEq)]
7774 #[non_exhaustive]
7775 pub enum Severity {
7776 /// This value is used for findings when a source doesn't write a severity
7777 /// value.
7778 Unspecified,
7779 /// Vulnerability:
7780 /// A critical vulnerability is easily discoverable by an external actor,
7781 /// exploitable, and results in the direct ability to execute arbitrary code,
7782 /// exfiltrate data, and otherwise gain additional access and privileges to
7783 /// cloud resources and workloads. Examples include publicly accessible
7784 /// unprotected user data and public SSH access with weak or no
7785 /// passwords.
7786 ///
7787 /// Threat:
7788 /// Indicates a threat that is able to access, modify, or delete data or
7789 /// execute unauthorized code within existing resources.
7790 Critical,
7791 /// Vulnerability:
7792 /// A high risk vulnerability can be easily discovered and exploited in
7793 /// combination with other vulnerabilities in order to gain direct access and
7794 /// the ability to execute arbitrary code, exfiltrate data, and otherwise
7795 /// gain additional access and privileges to cloud resources and workloads.
7796 /// An example is a database with weak or no passwords that is only
7797 /// accessible internally. This database could easily be compromised by an
7798 /// actor that had access to the internal network.
7799 ///
7800 /// Threat:
7801 /// Indicates a threat that is able to create new computational resources in
7802 /// an environment but not able to access data or execute code in existing
7803 /// resources.
7804 High,
7805 /// Vulnerability:
7806 /// A medium risk vulnerability could be used by an actor to gain access to
7807 /// resources or privileges that enable them to eventually (through multiple
7808 /// steps or a complex exploit) gain access and the ability to execute
7809 /// arbitrary code or exfiltrate data. An example is a service account with
7810 /// access to more projects than it should have. If an actor gains access to
7811 /// the service account, they could potentially use that access to manipulate
7812 /// a project the service account was not intended to.
7813 ///
7814 /// Threat:
7815 /// Indicates a threat that is able to cause operational impact but may not
7816 /// access data or execute unauthorized code.
7817 Medium,
7818 /// Vulnerability:
7819 /// A low risk vulnerability hampers a security organization's ability to
7820 /// detect vulnerabilities or active threats in their deployment, or prevents
7821 /// the root cause investigation of security issues. An example is monitoring
7822 /// and logs being disabled for resource configurations and access.
7823 ///
7824 /// Threat:
7825 /// Indicates a threat that has obtained minimal access to an environment but
7826 /// is not able to access data, execute code, or create resources.
7827 Low,
7828 /// If set, the enum was initialized with an unknown value.
7829 ///
7830 /// Applications can examine the value using [Severity::value] or
7831 /// [Severity::name].
7832 UnknownValue(severity::UnknownValue),
7833 }
7834
7835 #[doc(hidden)]
7836 pub mod severity {
7837 #[allow(unused_imports)]
7838 use super::*;
7839 #[derive(Clone, Debug, PartialEq)]
7840 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7841 }
7842
7843 impl Severity {
7844 /// Gets the enum value.
7845 ///
7846 /// Returns `None` if the enum contains an unknown value deserialized from
7847 /// the string representation of enums.
7848 pub fn value(&self) -> std::option::Option<i32> {
7849 match self {
7850 Self::Unspecified => std::option::Option::Some(0),
7851 Self::Critical => std::option::Option::Some(1),
7852 Self::High => std::option::Option::Some(2),
7853 Self::Medium => std::option::Option::Some(3),
7854 Self::Low => std::option::Option::Some(4),
7855 Self::UnknownValue(u) => u.0.value(),
7856 }
7857 }
7858
7859 /// Gets the enum value as a string.
7860 ///
7861 /// Returns `None` if the enum contains an unknown value deserialized from
7862 /// the integer representation of enums.
7863 pub fn name(&self) -> std::option::Option<&str> {
7864 match self {
7865 Self::Unspecified => std::option::Option::Some("SEVERITY_UNSPECIFIED"),
7866 Self::Critical => std::option::Option::Some("CRITICAL"),
7867 Self::High => std::option::Option::Some("HIGH"),
7868 Self::Medium => std::option::Option::Some("MEDIUM"),
7869 Self::Low => std::option::Option::Some("LOW"),
7870 Self::UnknownValue(u) => u.0.name(),
7871 }
7872 }
7873 }
7874
7875 impl std::default::Default for Severity {
7876 fn default() -> Self {
7877 use std::convert::From;
7878 Self::from(0)
7879 }
7880 }
7881
7882 impl std::fmt::Display for Severity {
7883 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7884 wkt::internal::display_enum(f, self.name(), self.value())
7885 }
7886 }
7887
7888 impl std::convert::From<i32> for Severity {
7889 fn from(value: i32) -> Self {
7890 match value {
7891 0 => Self::Unspecified,
7892 1 => Self::Critical,
7893 2 => Self::High,
7894 3 => Self::Medium,
7895 4 => Self::Low,
7896 _ => Self::UnknownValue(severity::UnknownValue(
7897 wkt::internal::UnknownEnumValue::Integer(value),
7898 )),
7899 }
7900 }
7901 }
7902
7903 impl std::convert::From<&str> for Severity {
7904 fn from(value: &str) -> Self {
7905 use std::string::ToString;
7906 match value {
7907 "SEVERITY_UNSPECIFIED" => Self::Unspecified,
7908 "CRITICAL" => Self::Critical,
7909 "HIGH" => Self::High,
7910 "MEDIUM" => Self::Medium,
7911 "LOW" => Self::Low,
7912 _ => Self::UnknownValue(severity::UnknownValue(
7913 wkt::internal::UnknownEnumValue::String(value.to_string()),
7914 )),
7915 }
7916 }
7917 }
7918
7919 impl serde::ser::Serialize for Severity {
7920 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7921 where
7922 S: serde::Serializer,
7923 {
7924 match self {
7925 Self::Unspecified => serializer.serialize_i32(0),
7926 Self::Critical => serializer.serialize_i32(1),
7927 Self::High => serializer.serialize_i32(2),
7928 Self::Medium => serializer.serialize_i32(3),
7929 Self::Low => serializer.serialize_i32(4),
7930 Self::UnknownValue(u) => u.0.serialize(serializer),
7931 }
7932 }
7933 }
7934
7935 impl<'de> serde::de::Deserialize<'de> for Severity {
7936 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7937 where
7938 D: serde::Deserializer<'de>,
7939 {
7940 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Severity>::new(
7941 ".google.cloud.securitycenter.v2.Finding.Severity",
7942 ))
7943 }
7944 }
7945
7946 /// Mute state a finding can be in.
7947 ///
7948 /// # Working with unknown values
7949 ///
7950 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7951 /// additional enum variants at any time. Adding new variants is not considered
7952 /// a breaking change. Applications should write their code in anticipation of:
7953 ///
7954 /// - New values appearing in future releases of the client library, **and**
7955 /// - New values received dynamically, without application changes.
7956 ///
7957 /// Please consult the [Working with enums] section in the user guide for some
7958 /// guidelines.
7959 ///
7960 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7961 #[derive(Clone, Debug, PartialEq)]
7962 #[non_exhaustive]
7963 pub enum Mute {
7964 /// Unspecified.
7965 Unspecified,
7966 /// Finding has been muted.
7967 Muted,
7968 /// Finding has been unmuted.
7969 Unmuted,
7970 /// Finding has never been muted/unmuted.
7971 Undefined,
7972 /// If set, the enum was initialized with an unknown value.
7973 ///
7974 /// Applications can examine the value using [Mute::value] or
7975 /// [Mute::name].
7976 UnknownValue(mute::UnknownValue),
7977 }
7978
7979 #[doc(hidden)]
7980 pub mod mute {
7981 #[allow(unused_imports)]
7982 use super::*;
7983 #[derive(Clone, Debug, PartialEq)]
7984 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7985 }
7986
7987 impl Mute {
7988 /// Gets the enum value.
7989 ///
7990 /// Returns `None` if the enum contains an unknown value deserialized from
7991 /// the string representation of enums.
7992 pub fn value(&self) -> std::option::Option<i32> {
7993 match self {
7994 Self::Unspecified => std::option::Option::Some(0),
7995 Self::Muted => std::option::Option::Some(1),
7996 Self::Unmuted => std::option::Option::Some(2),
7997 Self::Undefined => std::option::Option::Some(3),
7998 Self::UnknownValue(u) => u.0.value(),
7999 }
8000 }
8001
8002 /// Gets the enum value as a string.
8003 ///
8004 /// Returns `None` if the enum contains an unknown value deserialized from
8005 /// the integer representation of enums.
8006 pub fn name(&self) -> std::option::Option<&str> {
8007 match self {
8008 Self::Unspecified => std::option::Option::Some("MUTE_UNSPECIFIED"),
8009 Self::Muted => std::option::Option::Some("MUTED"),
8010 Self::Unmuted => std::option::Option::Some("UNMUTED"),
8011 Self::Undefined => std::option::Option::Some("UNDEFINED"),
8012 Self::UnknownValue(u) => u.0.name(),
8013 }
8014 }
8015 }
8016
8017 impl std::default::Default for Mute {
8018 fn default() -> Self {
8019 use std::convert::From;
8020 Self::from(0)
8021 }
8022 }
8023
8024 impl std::fmt::Display for Mute {
8025 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8026 wkt::internal::display_enum(f, self.name(), self.value())
8027 }
8028 }
8029
8030 impl std::convert::From<i32> for Mute {
8031 fn from(value: i32) -> Self {
8032 match value {
8033 0 => Self::Unspecified,
8034 1 => Self::Muted,
8035 2 => Self::Unmuted,
8036 3 => Self::Undefined,
8037 _ => Self::UnknownValue(mute::UnknownValue(
8038 wkt::internal::UnknownEnumValue::Integer(value),
8039 )),
8040 }
8041 }
8042 }
8043
8044 impl std::convert::From<&str> for Mute {
8045 fn from(value: &str) -> Self {
8046 use std::string::ToString;
8047 match value {
8048 "MUTE_UNSPECIFIED" => Self::Unspecified,
8049 "MUTED" => Self::Muted,
8050 "UNMUTED" => Self::Unmuted,
8051 "UNDEFINED" => Self::Undefined,
8052 _ => Self::UnknownValue(mute::UnknownValue(
8053 wkt::internal::UnknownEnumValue::String(value.to_string()),
8054 )),
8055 }
8056 }
8057 }
8058
8059 impl serde::ser::Serialize for Mute {
8060 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8061 where
8062 S: serde::Serializer,
8063 {
8064 match self {
8065 Self::Unspecified => serializer.serialize_i32(0),
8066 Self::Muted => serializer.serialize_i32(1),
8067 Self::Unmuted => serializer.serialize_i32(2),
8068 Self::Undefined => serializer.serialize_i32(3),
8069 Self::UnknownValue(u) => u.0.serialize(serializer),
8070 }
8071 }
8072 }
8073
8074 impl<'de> serde::de::Deserialize<'de> for Mute {
8075 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8076 where
8077 D: serde::Deserializer<'de>,
8078 {
8079 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mute>::new(
8080 ".google.cloud.securitycenter.v2.Finding.Mute",
8081 ))
8082 }
8083 }
8084
8085 /// Represents what kind of Finding it is.
8086 ///
8087 /// # Working with unknown values
8088 ///
8089 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8090 /// additional enum variants at any time. Adding new variants is not considered
8091 /// a breaking change. Applications should write their code in anticipation of:
8092 ///
8093 /// - New values appearing in future releases of the client library, **and**
8094 /// - New values received dynamically, without application changes.
8095 ///
8096 /// Please consult the [Working with enums] section in the user guide for some
8097 /// guidelines.
8098 ///
8099 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8100 #[derive(Clone, Debug, PartialEq)]
8101 #[non_exhaustive]
8102 pub enum FindingClass {
8103 /// Unspecified finding class.
8104 Unspecified,
8105 /// Describes unwanted or malicious activity.
8106 Threat,
8107 /// Describes a potential weakness in software that increases risk to
8108 /// Confidentiality & Integrity & Availability.
8109 Vulnerability,
8110 /// Describes a potential weakness in cloud resource/asset configuration that
8111 /// increases risk.
8112 Misconfiguration,
8113 /// Describes a security observation that is for informational purposes.
8114 Observation,
8115 /// Describes an error that prevents some SCC functionality.
8116 SccError,
8117 /// Describes a potential security risk due to a change in the security
8118 /// posture.
8119 PostureViolation,
8120 /// Describes a combination of security issues that represent a more severe
8121 /// security problem when taken together.
8122 ToxicCombination,
8123 /// Describes a potential security risk to data assets that contain sensitive
8124 /// data.
8125 SensitiveDataRisk,
8126 /// Describes a resource or resource group where high risk attack paths
8127 /// converge, based on attack path simulations (APS).
8128 Chokepoint,
8129 /// If set, the enum was initialized with an unknown value.
8130 ///
8131 /// Applications can examine the value using [FindingClass::value] or
8132 /// [FindingClass::name].
8133 UnknownValue(finding_class::UnknownValue),
8134 }
8135
8136 #[doc(hidden)]
8137 pub mod finding_class {
8138 #[allow(unused_imports)]
8139 use super::*;
8140 #[derive(Clone, Debug, PartialEq)]
8141 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8142 }
8143
8144 impl FindingClass {
8145 /// Gets the enum value.
8146 ///
8147 /// Returns `None` if the enum contains an unknown value deserialized from
8148 /// the string representation of enums.
8149 pub fn value(&self) -> std::option::Option<i32> {
8150 match self {
8151 Self::Unspecified => std::option::Option::Some(0),
8152 Self::Threat => std::option::Option::Some(1),
8153 Self::Vulnerability => std::option::Option::Some(2),
8154 Self::Misconfiguration => std::option::Option::Some(3),
8155 Self::Observation => std::option::Option::Some(4),
8156 Self::SccError => std::option::Option::Some(5),
8157 Self::PostureViolation => std::option::Option::Some(6),
8158 Self::ToxicCombination => std::option::Option::Some(7),
8159 Self::SensitiveDataRisk => std::option::Option::Some(8),
8160 Self::Chokepoint => std::option::Option::Some(9),
8161 Self::UnknownValue(u) => u.0.value(),
8162 }
8163 }
8164
8165 /// Gets the enum value as a string.
8166 ///
8167 /// Returns `None` if the enum contains an unknown value deserialized from
8168 /// the integer representation of enums.
8169 pub fn name(&self) -> std::option::Option<&str> {
8170 match self {
8171 Self::Unspecified => std::option::Option::Some("FINDING_CLASS_UNSPECIFIED"),
8172 Self::Threat => std::option::Option::Some("THREAT"),
8173 Self::Vulnerability => std::option::Option::Some("VULNERABILITY"),
8174 Self::Misconfiguration => std::option::Option::Some("MISCONFIGURATION"),
8175 Self::Observation => std::option::Option::Some("OBSERVATION"),
8176 Self::SccError => std::option::Option::Some("SCC_ERROR"),
8177 Self::PostureViolation => std::option::Option::Some("POSTURE_VIOLATION"),
8178 Self::ToxicCombination => std::option::Option::Some("TOXIC_COMBINATION"),
8179 Self::SensitiveDataRisk => std::option::Option::Some("SENSITIVE_DATA_RISK"),
8180 Self::Chokepoint => std::option::Option::Some("CHOKEPOINT"),
8181 Self::UnknownValue(u) => u.0.name(),
8182 }
8183 }
8184 }
8185
8186 impl std::default::Default for FindingClass {
8187 fn default() -> Self {
8188 use std::convert::From;
8189 Self::from(0)
8190 }
8191 }
8192
8193 impl std::fmt::Display for FindingClass {
8194 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8195 wkt::internal::display_enum(f, self.name(), self.value())
8196 }
8197 }
8198
8199 impl std::convert::From<i32> for FindingClass {
8200 fn from(value: i32) -> Self {
8201 match value {
8202 0 => Self::Unspecified,
8203 1 => Self::Threat,
8204 2 => Self::Vulnerability,
8205 3 => Self::Misconfiguration,
8206 4 => Self::Observation,
8207 5 => Self::SccError,
8208 6 => Self::PostureViolation,
8209 7 => Self::ToxicCombination,
8210 8 => Self::SensitiveDataRisk,
8211 9 => Self::Chokepoint,
8212 _ => Self::UnknownValue(finding_class::UnknownValue(
8213 wkt::internal::UnknownEnumValue::Integer(value),
8214 )),
8215 }
8216 }
8217 }
8218
8219 impl std::convert::From<&str> for FindingClass {
8220 fn from(value: &str) -> Self {
8221 use std::string::ToString;
8222 match value {
8223 "FINDING_CLASS_UNSPECIFIED" => Self::Unspecified,
8224 "THREAT" => Self::Threat,
8225 "VULNERABILITY" => Self::Vulnerability,
8226 "MISCONFIGURATION" => Self::Misconfiguration,
8227 "OBSERVATION" => Self::Observation,
8228 "SCC_ERROR" => Self::SccError,
8229 "POSTURE_VIOLATION" => Self::PostureViolation,
8230 "TOXIC_COMBINATION" => Self::ToxicCombination,
8231 "SENSITIVE_DATA_RISK" => Self::SensitiveDataRisk,
8232 "CHOKEPOINT" => Self::Chokepoint,
8233 _ => Self::UnknownValue(finding_class::UnknownValue(
8234 wkt::internal::UnknownEnumValue::String(value.to_string()),
8235 )),
8236 }
8237 }
8238 }
8239
8240 impl serde::ser::Serialize for FindingClass {
8241 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8242 where
8243 S: serde::Serializer,
8244 {
8245 match self {
8246 Self::Unspecified => serializer.serialize_i32(0),
8247 Self::Threat => serializer.serialize_i32(1),
8248 Self::Vulnerability => serializer.serialize_i32(2),
8249 Self::Misconfiguration => serializer.serialize_i32(3),
8250 Self::Observation => serializer.serialize_i32(4),
8251 Self::SccError => serializer.serialize_i32(5),
8252 Self::PostureViolation => serializer.serialize_i32(6),
8253 Self::ToxicCombination => serializer.serialize_i32(7),
8254 Self::SensitiveDataRisk => serializer.serialize_i32(8),
8255 Self::Chokepoint => serializer.serialize_i32(9),
8256 Self::UnknownValue(u) => u.0.serialize(serializer),
8257 }
8258 }
8259 }
8260
8261 impl<'de> serde::de::Deserialize<'de> for FindingClass {
8262 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8263 where
8264 D: serde::Deserializer<'de>,
8265 {
8266 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FindingClass>::new(
8267 ".google.cloud.securitycenter.v2.Finding.FindingClass",
8268 ))
8269 }
8270 }
8271}
8272
8273/// Message that contains the resource name and display name of a folder
8274/// resource.
8275#[derive(Clone, Default, PartialEq)]
8276#[non_exhaustive]
8277pub struct Folder {
8278 /// Full resource name of this folder. See:
8279 /// <https://cloud.google.com/apis/design/resource_names#full_resource_name>
8280 pub resource_folder: std::string::String,
8281
8282 /// The user defined display name for this folder.
8283 pub resource_folder_display_name: std::string::String,
8284
8285 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8286}
8287
8288impl Folder {
8289 pub fn new() -> Self {
8290 std::default::Default::default()
8291 }
8292
8293 /// Sets the value of [resource_folder][crate::model::Folder::resource_folder].
8294 ///
8295 /// # Example
8296 /// ```ignore,no_run
8297 /// # use google_cloud_securitycenter_v2::model::Folder;
8298 /// let x = Folder::new().set_resource_folder("example");
8299 /// ```
8300 pub fn set_resource_folder<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8301 self.resource_folder = v.into();
8302 self
8303 }
8304
8305 /// Sets the value of [resource_folder_display_name][crate::model::Folder::resource_folder_display_name].
8306 ///
8307 /// # Example
8308 /// ```ignore,no_run
8309 /// # use google_cloud_securitycenter_v2::model::Folder;
8310 /// let x = Folder::new().set_resource_folder_display_name("example");
8311 /// ```
8312 pub fn set_resource_folder_display_name<T: std::convert::Into<std::string::String>>(
8313 mut self,
8314 v: T,
8315 ) -> Self {
8316 self.resource_folder_display_name = v.into();
8317 self
8318 }
8319}
8320
8321impl wkt::message::Message for Folder {
8322 fn typename() -> &'static str {
8323 "type.googleapis.com/google.cloud.securitycenter.v2.Folder"
8324 }
8325}
8326
8327/// Contains details about groups of which this finding is a member. A group is a
8328/// collection of findings that are related in some way.
8329#[derive(Clone, Default, PartialEq)]
8330#[non_exhaustive]
8331pub struct GroupMembership {
8332 /// Type of group.
8333 pub group_type: crate::model::group_membership::GroupType,
8334
8335 /// ID of the group.
8336 pub group_id: std::string::String,
8337
8338 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8339}
8340
8341impl GroupMembership {
8342 pub fn new() -> Self {
8343 std::default::Default::default()
8344 }
8345
8346 /// Sets the value of [group_type][crate::model::GroupMembership::group_type].
8347 ///
8348 /// # Example
8349 /// ```ignore,no_run
8350 /// # use google_cloud_securitycenter_v2::model::GroupMembership;
8351 /// use google_cloud_securitycenter_v2::model::group_membership::GroupType;
8352 /// let x0 = GroupMembership::new().set_group_type(GroupType::ToxicCombination);
8353 /// let x1 = GroupMembership::new().set_group_type(GroupType::Chokepoint);
8354 /// ```
8355 pub fn set_group_type<T: std::convert::Into<crate::model::group_membership::GroupType>>(
8356 mut self,
8357 v: T,
8358 ) -> Self {
8359 self.group_type = v.into();
8360 self
8361 }
8362
8363 /// Sets the value of [group_id][crate::model::GroupMembership::group_id].
8364 ///
8365 /// # Example
8366 /// ```ignore,no_run
8367 /// # use google_cloud_securitycenter_v2::model::GroupMembership;
8368 /// let x = GroupMembership::new().set_group_id("example");
8369 /// ```
8370 pub fn set_group_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8371 self.group_id = v.into();
8372 self
8373 }
8374}
8375
8376impl wkt::message::Message for GroupMembership {
8377 fn typename() -> &'static str {
8378 "type.googleapis.com/google.cloud.securitycenter.v2.GroupMembership"
8379 }
8380}
8381
8382/// Defines additional types related to [GroupMembership].
8383pub mod group_membership {
8384 #[allow(unused_imports)]
8385 use super::*;
8386
8387 /// Possible types of groups.
8388 ///
8389 /// # Working with unknown values
8390 ///
8391 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8392 /// additional enum variants at any time. Adding new variants is not considered
8393 /// a breaking change. Applications should write their code in anticipation of:
8394 ///
8395 /// - New values appearing in future releases of the client library, **and**
8396 /// - New values received dynamically, without application changes.
8397 ///
8398 /// Please consult the [Working with enums] section in the user guide for some
8399 /// guidelines.
8400 ///
8401 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8402 #[derive(Clone, Debug, PartialEq)]
8403 #[non_exhaustive]
8404 pub enum GroupType {
8405 /// Default value.
8406 Unspecified,
8407 /// Group represents a toxic combination.
8408 ToxicCombination,
8409 /// Group represents a chokepoint.
8410 Chokepoint,
8411 /// If set, the enum was initialized with an unknown value.
8412 ///
8413 /// Applications can examine the value using [GroupType::value] or
8414 /// [GroupType::name].
8415 UnknownValue(group_type::UnknownValue),
8416 }
8417
8418 #[doc(hidden)]
8419 pub mod group_type {
8420 #[allow(unused_imports)]
8421 use super::*;
8422 #[derive(Clone, Debug, PartialEq)]
8423 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8424 }
8425
8426 impl GroupType {
8427 /// Gets the enum value.
8428 ///
8429 /// Returns `None` if the enum contains an unknown value deserialized from
8430 /// the string representation of enums.
8431 pub fn value(&self) -> std::option::Option<i32> {
8432 match self {
8433 Self::Unspecified => std::option::Option::Some(0),
8434 Self::ToxicCombination => std::option::Option::Some(1),
8435 Self::Chokepoint => std::option::Option::Some(3),
8436 Self::UnknownValue(u) => u.0.value(),
8437 }
8438 }
8439
8440 /// Gets the enum value as a string.
8441 ///
8442 /// Returns `None` if the enum contains an unknown value deserialized from
8443 /// the integer representation of enums.
8444 pub fn name(&self) -> std::option::Option<&str> {
8445 match self {
8446 Self::Unspecified => std::option::Option::Some("GROUP_TYPE_UNSPECIFIED"),
8447 Self::ToxicCombination => std::option::Option::Some("GROUP_TYPE_TOXIC_COMBINATION"),
8448 Self::Chokepoint => std::option::Option::Some("GROUP_TYPE_CHOKEPOINT"),
8449 Self::UnknownValue(u) => u.0.name(),
8450 }
8451 }
8452 }
8453
8454 impl std::default::Default for GroupType {
8455 fn default() -> Self {
8456 use std::convert::From;
8457 Self::from(0)
8458 }
8459 }
8460
8461 impl std::fmt::Display for GroupType {
8462 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8463 wkt::internal::display_enum(f, self.name(), self.value())
8464 }
8465 }
8466
8467 impl std::convert::From<i32> for GroupType {
8468 fn from(value: i32) -> Self {
8469 match value {
8470 0 => Self::Unspecified,
8471 1 => Self::ToxicCombination,
8472 3 => Self::Chokepoint,
8473 _ => Self::UnknownValue(group_type::UnknownValue(
8474 wkt::internal::UnknownEnumValue::Integer(value),
8475 )),
8476 }
8477 }
8478 }
8479
8480 impl std::convert::From<&str> for GroupType {
8481 fn from(value: &str) -> Self {
8482 use std::string::ToString;
8483 match value {
8484 "GROUP_TYPE_UNSPECIFIED" => Self::Unspecified,
8485 "GROUP_TYPE_TOXIC_COMBINATION" => Self::ToxicCombination,
8486 "GROUP_TYPE_CHOKEPOINT" => Self::Chokepoint,
8487 _ => Self::UnknownValue(group_type::UnknownValue(
8488 wkt::internal::UnknownEnumValue::String(value.to_string()),
8489 )),
8490 }
8491 }
8492 }
8493
8494 impl serde::ser::Serialize for GroupType {
8495 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8496 where
8497 S: serde::Serializer,
8498 {
8499 match self {
8500 Self::Unspecified => serializer.serialize_i32(0),
8501 Self::ToxicCombination => serializer.serialize_i32(1),
8502 Self::Chokepoint => serializer.serialize_i32(3),
8503 Self::UnknownValue(u) => u.0.serialize(serializer),
8504 }
8505 }
8506 }
8507
8508 impl<'de> serde::de::Deserialize<'de> for GroupType {
8509 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8510 where
8511 D: serde::Deserializer<'de>,
8512 {
8513 deserializer.deserialize_any(wkt::internal::EnumVisitor::<GroupType>::new(
8514 ".google.cloud.securitycenter.v2.GroupMembership.GroupType",
8515 ))
8516 }
8517 }
8518}
8519
8520/// Represents a particular IAM binding, which captures a member's role addition,
8521/// removal, or state.
8522#[derive(Clone, Default, PartialEq)]
8523#[non_exhaustive]
8524pub struct IamBinding {
8525 /// The action that was performed on a Binding.
8526 pub action: crate::model::iam_binding::Action,
8527
8528 /// Role that is assigned to "members".
8529 /// For example, "roles/viewer", "roles/editor", or "roles/owner".
8530 pub role: std::string::String,
8531
8532 /// A single identity requesting access for a Cloud Platform resource, for
8533 /// example, "foo@google.com".
8534 pub member: std::string::String,
8535
8536 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8537}
8538
8539impl IamBinding {
8540 pub fn new() -> Self {
8541 std::default::Default::default()
8542 }
8543
8544 /// Sets the value of [action][crate::model::IamBinding::action].
8545 ///
8546 /// # Example
8547 /// ```ignore,no_run
8548 /// # use google_cloud_securitycenter_v2::model::IamBinding;
8549 /// use google_cloud_securitycenter_v2::model::iam_binding::Action;
8550 /// let x0 = IamBinding::new().set_action(Action::Add);
8551 /// let x1 = IamBinding::new().set_action(Action::Remove);
8552 /// ```
8553 pub fn set_action<T: std::convert::Into<crate::model::iam_binding::Action>>(
8554 mut self,
8555 v: T,
8556 ) -> Self {
8557 self.action = v.into();
8558 self
8559 }
8560
8561 /// Sets the value of [role][crate::model::IamBinding::role].
8562 ///
8563 /// # Example
8564 /// ```ignore,no_run
8565 /// # use google_cloud_securitycenter_v2::model::IamBinding;
8566 /// let x = IamBinding::new().set_role("example");
8567 /// ```
8568 pub fn set_role<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8569 self.role = v.into();
8570 self
8571 }
8572
8573 /// Sets the value of [member][crate::model::IamBinding::member].
8574 ///
8575 /// # Example
8576 /// ```ignore,no_run
8577 /// # use google_cloud_securitycenter_v2::model::IamBinding;
8578 /// let x = IamBinding::new().set_member("example");
8579 /// ```
8580 pub fn set_member<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8581 self.member = v.into();
8582 self
8583 }
8584}
8585
8586impl wkt::message::Message for IamBinding {
8587 fn typename() -> &'static str {
8588 "type.googleapis.com/google.cloud.securitycenter.v2.IamBinding"
8589 }
8590}
8591
8592/// Defines additional types related to [IamBinding].
8593pub mod iam_binding {
8594 #[allow(unused_imports)]
8595 use super::*;
8596
8597 /// The type of action performed on a Binding in a policy.
8598 ///
8599 /// # Working with unknown values
8600 ///
8601 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8602 /// additional enum variants at any time. Adding new variants is not considered
8603 /// a breaking change. Applications should write their code in anticipation of:
8604 ///
8605 /// - New values appearing in future releases of the client library, **and**
8606 /// - New values received dynamically, without application changes.
8607 ///
8608 /// Please consult the [Working with enums] section in the user guide for some
8609 /// guidelines.
8610 ///
8611 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8612 #[derive(Clone, Debug, PartialEq)]
8613 #[non_exhaustive]
8614 pub enum Action {
8615 /// Unspecified.
8616 Unspecified,
8617 /// Addition of a Binding.
8618 Add,
8619 /// Removal of a Binding.
8620 Remove,
8621 /// If set, the enum was initialized with an unknown value.
8622 ///
8623 /// Applications can examine the value using [Action::value] or
8624 /// [Action::name].
8625 UnknownValue(action::UnknownValue),
8626 }
8627
8628 #[doc(hidden)]
8629 pub mod action {
8630 #[allow(unused_imports)]
8631 use super::*;
8632 #[derive(Clone, Debug, PartialEq)]
8633 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8634 }
8635
8636 impl Action {
8637 /// Gets the enum value.
8638 ///
8639 /// Returns `None` if the enum contains an unknown value deserialized from
8640 /// the string representation of enums.
8641 pub fn value(&self) -> std::option::Option<i32> {
8642 match self {
8643 Self::Unspecified => std::option::Option::Some(0),
8644 Self::Add => std::option::Option::Some(1),
8645 Self::Remove => std::option::Option::Some(2),
8646 Self::UnknownValue(u) => u.0.value(),
8647 }
8648 }
8649
8650 /// Gets the enum value as a string.
8651 ///
8652 /// Returns `None` if the enum contains an unknown value deserialized from
8653 /// the integer representation of enums.
8654 pub fn name(&self) -> std::option::Option<&str> {
8655 match self {
8656 Self::Unspecified => std::option::Option::Some("ACTION_UNSPECIFIED"),
8657 Self::Add => std::option::Option::Some("ADD"),
8658 Self::Remove => std::option::Option::Some("REMOVE"),
8659 Self::UnknownValue(u) => u.0.name(),
8660 }
8661 }
8662 }
8663
8664 impl std::default::Default for Action {
8665 fn default() -> Self {
8666 use std::convert::From;
8667 Self::from(0)
8668 }
8669 }
8670
8671 impl std::fmt::Display for Action {
8672 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8673 wkt::internal::display_enum(f, self.name(), self.value())
8674 }
8675 }
8676
8677 impl std::convert::From<i32> for Action {
8678 fn from(value: i32) -> Self {
8679 match value {
8680 0 => Self::Unspecified,
8681 1 => Self::Add,
8682 2 => Self::Remove,
8683 _ => Self::UnknownValue(action::UnknownValue(
8684 wkt::internal::UnknownEnumValue::Integer(value),
8685 )),
8686 }
8687 }
8688 }
8689
8690 impl std::convert::From<&str> for Action {
8691 fn from(value: &str) -> Self {
8692 use std::string::ToString;
8693 match value {
8694 "ACTION_UNSPECIFIED" => Self::Unspecified,
8695 "ADD" => Self::Add,
8696 "REMOVE" => Self::Remove,
8697 _ => Self::UnknownValue(action::UnknownValue(
8698 wkt::internal::UnknownEnumValue::String(value.to_string()),
8699 )),
8700 }
8701 }
8702 }
8703
8704 impl serde::ser::Serialize for Action {
8705 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8706 where
8707 S: serde::Serializer,
8708 {
8709 match self {
8710 Self::Unspecified => serializer.serialize_i32(0),
8711 Self::Add => serializer.serialize_i32(1),
8712 Self::Remove => serializer.serialize_i32(2),
8713 Self::UnknownValue(u) => u.0.serialize(serializer),
8714 }
8715 }
8716 }
8717
8718 impl<'de> serde::de::Deserialize<'de> for Action {
8719 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8720 where
8721 D: serde::Deserializer<'de>,
8722 {
8723 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
8724 ".google.cloud.securitycenter.v2.IamBinding.Action",
8725 ))
8726 }
8727 }
8728}
8729
8730/// Represents what's commonly known as an _indicator of compromise_ (IoC) in
8731/// computer forensics. This is an artifact observed on a network or in an
8732/// operating system that, with high confidence, indicates a computer intrusion.
8733/// For more information, see [Indicator of
8734/// compromise](https://en.wikipedia.org/wiki/Indicator_of_compromise).
8735#[derive(Clone, Default, PartialEq)]
8736#[non_exhaustive]
8737pub struct Indicator {
8738 /// The list of IP addresses that are associated with the finding.
8739 pub ip_addresses: std::vec::Vec<std::string::String>,
8740
8741 /// List of domains associated to the Finding.
8742 pub domains: std::vec::Vec<std::string::String>,
8743
8744 /// The list of matched signatures indicating that the given
8745 /// process is present in the environment.
8746 pub signatures: std::vec::Vec<crate::model::indicator::ProcessSignature>,
8747
8748 /// The list of URIs associated to the Findings.
8749 pub uris: std::vec::Vec<std::string::String>,
8750
8751 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8752}
8753
8754impl Indicator {
8755 pub fn new() -> Self {
8756 std::default::Default::default()
8757 }
8758
8759 /// Sets the value of [ip_addresses][crate::model::Indicator::ip_addresses].
8760 ///
8761 /// # Example
8762 /// ```ignore,no_run
8763 /// # use google_cloud_securitycenter_v2::model::Indicator;
8764 /// let x = Indicator::new().set_ip_addresses(["a", "b", "c"]);
8765 /// ```
8766 pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
8767 where
8768 T: std::iter::IntoIterator<Item = V>,
8769 V: std::convert::Into<std::string::String>,
8770 {
8771 use std::iter::Iterator;
8772 self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
8773 self
8774 }
8775
8776 /// Sets the value of [domains][crate::model::Indicator::domains].
8777 ///
8778 /// # Example
8779 /// ```ignore,no_run
8780 /// # use google_cloud_securitycenter_v2::model::Indicator;
8781 /// let x = Indicator::new().set_domains(["a", "b", "c"]);
8782 /// ```
8783 pub fn set_domains<T, V>(mut self, v: T) -> Self
8784 where
8785 T: std::iter::IntoIterator<Item = V>,
8786 V: std::convert::Into<std::string::String>,
8787 {
8788 use std::iter::Iterator;
8789 self.domains = v.into_iter().map(|i| i.into()).collect();
8790 self
8791 }
8792
8793 /// Sets the value of [signatures][crate::model::Indicator::signatures].
8794 ///
8795 /// # Example
8796 /// ```ignore,no_run
8797 /// # use google_cloud_securitycenter_v2::model::Indicator;
8798 /// use google_cloud_securitycenter_v2::model::indicator::ProcessSignature;
8799 /// let x = Indicator::new()
8800 /// .set_signatures([
8801 /// ProcessSignature::default()/* use setters */,
8802 /// ProcessSignature::default()/* use (different) setters */,
8803 /// ]);
8804 /// ```
8805 pub fn set_signatures<T, V>(mut self, v: T) -> Self
8806 where
8807 T: std::iter::IntoIterator<Item = V>,
8808 V: std::convert::Into<crate::model::indicator::ProcessSignature>,
8809 {
8810 use std::iter::Iterator;
8811 self.signatures = v.into_iter().map(|i| i.into()).collect();
8812 self
8813 }
8814
8815 /// Sets the value of [uris][crate::model::Indicator::uris].
8816 ///
8817 /// # Example
8818 /// ```ignore,no_run
8819 /// # use google_cloud_securitycenter_v2::model::Indicator;
8820 /// let x = Indicator::new().set_uris(["a", "b", "c"]);
8821 /// ```
8822 pub fn set_uris<T, V>(mut self, v: T) -> Self
8823 where
8824 T: std::iter::IntoIterator<Item = V>,
8825 V: std::convert::Into<std::string::String>,
8826 {
8827 use std::iter::Iterator;
8828 self.uris = v.into_iter().map(|i| i.into()).collect();
8829 self
8830 }
8831}
8832
8833impl wkt::message::Message for Indicator {
8834 fn typename() -> &'static str {
8835 "type.googleapis.com/google.cloud.securitycenter.v2.Indicator"
8836 }
8837}
8838
8839/// Defines additional types related to [Indicator].
8840pub mod indicator {
8841 #[allow(unused_imports)]
8842 use super::*;
8843
8844 /// Indicates what signature matched this process.
8845 #[derive(Clone, Default, PartialEq)]
8846 #[non_exhaustive]
8847 pub struct ProcessSignature {
8848 /// Describes the type of resource associated with the signature.
8849 pub signature_type: crate::model::indicator::process_signature::SignatureType,
8850
8851 /// The signature.
8852 pub signature: std::option::Option<crate::model::indicator::process_signature::Signature>,
8853
8854 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8855 }
8856
8857 impl ProcessSignature {
8858 pub fn new() -> Self {
8859 std::default::Default::default()
8860 }
8861
8862 /// Sets the value of [signature_type][crate::model::indicator::ProcessSignature::signature_type].
8863 ///
8864 /// # Example
8865 /// ```ignore,no_run
8866 /// # use google_cloud_securitycenter_v2::model::indicator::ProcessSignature;
8867 /// use google_cloud_securitycenter_v2::model::indicator::process_signature::SignatureType;
8868 /// let x0 = ProcessSignature::new().set_signature_type(SignatureType::Process);
8869 /// let x1 = ProcessSignature::new().set_signature_type(SignatureType::File);
8870 /// ```
8871 pub fn set_signature_type<
8872 T: std::convert::Into<crate::model::indicator::process_signature::SignatureType>,
8873 >(
8874 mut self,
8875 v: T,
8876 ) -> Self {
8877 self.signature_type = v.into();
8878 self
8879 }
8880
8881 /// Sets the value of [signature][crate::model::indicator::ProcessSignature::signature].
8882 ///
8883 /// Note that all the setters affecting `signature` are mutually
8884 /// exclusive.
8885 ///
8886 /// # Example
8887 /// ```ignore,no_run
8888 /// # use google_cloud_securitycenter_v2::model::indicator::ProcessSignature;
8889 /// use google_cloud_securitycenter_v2::model::indicator::process_signature::MemoryHashSignature;
8890 /// let x = ProcessSignature::new().set_signature(Some(
8891 /// google_cloud_securitycenter_v2::model::indicator::process_signature::Signature::MemoryHashSignature(MemoryHashSignature::default().into())));
8892 /// ```
8893 pub fn set_signature<
8894 T: std::convert::Into<
8895 std::option::Option<crate::model::indicator::process_signature::Signature>,
8896 >,
8897 >(
8898 mut self,
8899 v: T,
8900 ) -> Self {
8901 self.signature = v.into();
8902 self
8903 }
8904
8905 /// The value of [signature][crate::model::indicator::ProcessSignature::signature]
8906 /// if it holds a `MemoryHashSignature`, `None` if the field is not set or
8907 /// holds a different branch.
8908 pub fn memory_hash_signature(
8909 &self,
8910 ) -> std::option::Option<
8911 &std::boxed::Box<crate::model::indicator::process_signature::MemoryHashSignature>,
8912 > {
8913 #[allow(unreachable_patterns)]
8914 self.signature.as_ref().and_then(|v| match v {
8915 crate::model::indicator::process_signature::Signature::MemoryHashSignature(v) => {
8916 std::option::Option::Some(v)
8917 }
8918 _ => std::option::Option::None,
8919 })
8920 }
8921
8922 /// Sets the value of [signature][crate::model::indicator::ProcessSignature::signature]
8923 /// to hold a `MemoryHashSignature`.
8924 ///
8925 /// Note that all the setters affecting `signature` are
8926 /// mutually exclusive.
8927 ///
8928 /// # Example
8929 /// ```ignore,no_run
8930 /// # use google_cloud_securitycenter_v2::model::indicator::ProcessSignature;
8931 /// use google_cloud_securitycenter_v2::model::indicator::process_signature::MemoryHashSignature;
8932 /// let x = ProcessSignature::new().set_memory_hash_signature(MemoryHashSignature::default()/* use setters */);
8933 /// assert!(x.memory_hash_signature().is_some());
8934 /// assert!(x.yara_rule_signature().is_none());
8935 /// ```
8936 pub fn set_memory_hash_signature<
8937 T: std::convert::Into<
8938 std::boxed::Box<
8939 crate::model::indicator::process_signature::MemoryHashSignature,
8940 >,
8941 >,
8942 >(
8943 mut self,
8944 v: T,
8945 ) -> Self {
8946 self.signature = std::option::Option::Some(
8947 crate::model::indicator::process_signature::Signature::MemoryHashSignature(
8948 v.into(),
8949 ),
8950 );
8951 self
8952 }
8953
8954 /// The value of [signature][crate::model::indicator::ProcessSignature::signature]
8955 /// if it holds a `YaraRuleSignature`, `None` if the field is not set or
8956 /// holds a different branch.
8957 pub fn yara_rule_signature(
8958 &self,
8959 ) -> std::option::Option<
8960 &std::boxed::Box<crate::model::indicator::process_signature::YaraRuleSignature>,
8961 > {
8962 #[allow(unreachable_patterns)]
8963 self.signature.as_ref().and_then(|v| match v {
8964 crate::model::indicator::process_signature::Signature::YaraRuleSignature(v) => {
8965 std::option::Option::Some(v)
8966 }
8967 _ => std::option::Option::None,
8968 })
8969 }
8970
8971 /// Sets the value of [signature][crate::model::indicator::ProcessSignature::signature]
8972 /// to hold a `YaraRuleSignature`.
8973 ///
8974 /// Note that all the setters affecting `signature` are
8975 /// mutually exclusive.
8976 ///
8977 /// # Example
8978 /// ```ignore,no_run
8979 /// # use google_cloud_securitycenter_v2::model::indicator::ProcessSignature;
8980 /// use google_cloud_securitycenter_v2::model::indicator::process_signature::YaraRuleSignature;
8981 /// let x = ProcessSignature::new().set_yara_rule_signature(YaraRuleSignature::default()/* use setters */);
8982 /// assert!(x.yara_rule_signature().is_some());
8983 /// assert!(x.memory_hash_signature().is_none());
8984 /// ```
8985 pub fn set_yara_rule_signature<
8986 T: std::convert::Into<
8987 std::boxed::Box<crate::model::indicator::process_signature::YaraRuleSignature>,
8988 >,
8989 >(
8990 mut self,
8991 v: T,
8992 ) -> Self {
8993 self.signature = std::option::Option::Some(
8994 crate::model::indicator::process_signature::Signature::YaraRuleSignature(v.into()),
8995 );
8996 self
8997 }
8998 }
8999
9000 impl wkt::message::Message for ProcessSignature {
9001 fn typename() -> &'static str {
9002 "type.googleapis.com/google.cloud.securitycenter.v2.Indicator.ProcessSignature"
9003 }
9004 }
9005
9006 /// Defines additional types related to [ProcessSignature].
9007 pub mod process_signature {
9008 #[allow(unused_imports)]
9009 use super::*;
9010
9011 /// A signature corresponding to memory page hashes.
9012 #[derive(Clone, Default, PartialEq)]
9013 #[non_exhaustive]
9014 pub struct MemoryHashSignature {
9015 /// The binary family.
9016 pub binary_family: std::string::String,
9017
9018 /// The list of memory hash detections contributing to the binary family
9019 /// match.
9020 pub detections: std::vec::Vec<
9021 crate::model::indicator::process_signature::memory_hash_signature::Detection,
9022 >,
9023
9024 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9025 }
9026
9027 impl MemoryHashSignature {
9028 pub fn new() -> Self {
9029 std::default::Default::default()
9030 }
9031
9032 /// Sets the value of [binary_family][crate::model::indicator::process_signature::MemoryHashSignature::binary_family].
9033 ///
9034 /// # Example
9035 /// ```ignore,no_run
9036 /// # use google_cloud_securitycenter_v2::model::indicator::process_signature::MemoryHashSignature;
9037 /// let x = MemoryHashSignature::new().set_binary_family("example");
9038 /// ```
9039 pub fn set_binary_family<T: std::convert::Into<std::string::String>>(
9040 mut self,
9041 v: T,
9042 ) -> Self {
9043 self.binary_family = v.into();
9044 self
9045 }
9046
9047 /// Sets the value of [detections][crate::model::indicator::process_signature::MemoryHashSignature::detections].
9048 ///
9049 /// # Example
9050 /// ```ignore,no_run
9051 /// # use google_cloud_securitycenter_v2::model::indicator::process_signature::MemoryHashSignature;
9052 /// use google_cloud_securitycenter_v2::model::indicator::process_signature::memory_hash_signature::Detection;
9053 /// let x = MemoryHashSignature::new()
9054 /// .set_detections([
9055 /// Detection::default()/* use setters */,
9056 /// Detection::default()/* use (different) setters */,
9057 /// ]);
9058 /// ```
9059 pub fn set_detections<T, V>(mut self, v: T) -> Self
9060 where
9061 T: std::iter::IntoIterator<Item = V>,
9062 V: std::convert::Into<crate::model::indicator::process_signature::memory_hash_signature::Detection>
9063 {
9064 use std::iter::Iterator;
9065 self.detections = v.into_iter().map(|i| i.into()).collect();
9066 self
9067 }
9068 }
9069
9070 impl wkt::message::Message for MemoryHashSignature {
9071 fn typename() -> &'static str {
9072 "type.googleapis.com/google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature"
9073 }
9074 }
9075
9076 /// Defines additional types related to [MemoryHashSignature].
9077 pub mod memory_hash_signature {
9078 #[allow(unused_imports)]
9079 use super::*;
9080
9081 /// Memory hash detection contributing to the binary family match.
9082 #[derive(Clone, Default, PartialEq)]
9083 #[non_exhaustive]
9084 pub struct Detection {
9085 /// The name of the binary associated with the memory hash
9086 /// signature detection.
9087 pub binary: std::string::String,
9088
9089 /// The percentage of memory page hashes in the signature
9090 /// that were matched.
9091 pub percent_pages_matched: f64,
9092
9093 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9094 }
9095
9096 impl Detection {
9097 pub fn new() -> Self {
9098 std::default::Default::default()
9099 }
9100
9101 /// Sets the value of [binary][crate::model::indicator::process_signature::memory_hash_signature::Detection::binary].
9102 ///
9103 /// # Example
9104 /// ```ignore,no_run
9105 /// # use google_cloud_securitycenter_v2::model::indicator::process_signature::memory_hash_signature::Detection;
9106 /// let x = Detection::new().set_binary("example");
9107 /// ```
9108 pub fn set_binary<T: std::convert::Into<std::string::String>>(
9109 mut self,
9110 v: T,
9111 ) -> Self {
9112 self.binary = v.into();
9113 self
9114 }
9115
9116 /// Sets the value of [percent_pages_matched][crate::model::indicator::process_signature::memory_hash_signature::Detection::percent_pages_matched].
9117 ///
9118 /// # Example
9119 /// ```ignore,no_run
9120 /// # use google_cloud_securitycenter_v2::model::indicator::process_signature::memory_hash_signature::Detection;
9121 /// let x = Detection::new().set_percent_pages_matched(42.0);
9122 /// ```
9123 pub fn set_percent_pages_matched<T: std::convert::Into<f64>>(
9124 mut self,
9125 v: T,
9126 ) -> Self {
9127 self.percent_pages_matched = v.into();
9128 self
9129 }
9130 }
9131
9132 impl wkt::message::Message for Detection {
9133 fn typename() -> &'static str {
9134 "type.googleapis.com/google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection"
9135 }
9136 }
9137 }
9138
9139 /// A signature corresponding to a YARA rule.
9140 #[derive(Clone, Default, PartialEq)]
9141 #[non_exhaustive]
9142 pub struct YaraRuleSignature {
9143 /// The name of the YARA rule.
9144 pub yara_rule: std::string::String,
9145
9146 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9147 }
9148
9149 impl YaraRuleSignature {
9150 pub fn new() -> Self {
9151 std::default::Default::default()
9152 }
9153
9154 /// Sets the value of [yara_rule][crate::model::indicator::process_signature::YaraRuleSignature::yara_rule].
9155 ///
9156 /// # Example
9157 /// ```ignore,no_run
9158 /// # use google_cloud_securitycenter_v2::model::indicator::process_signature::YaraRuleSignature;
9159 /// let x = YaraRuleSignature::new().set_yara_rule("example");
9160 /// ```
9161 pub fn set_yara_rule<T: std::convert::Into<std::string::String>>(
9162 mut self,
9163 v: T,
9164 ) -> Self {
9165 self.yara_rule = v.into();
9166 self
9167 }
9168 }
9169
9170 impl wkt::message::Message for YaraRuleSignature {
9171 fn typename() -> &'static str {
9172 "type.googleapis.com/google.cloud.securitycenter.v2.Indicator.ProcessSignature.YaraRuleSignature"
9173 }
9174 }
9175
9176 /// Possible resource types to be associated with a signature.
9177 ///
9178 /// # Working with unknown values
9179 ///
9180 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9181 /// additional enum variants at any time. Adding new variants is not considered
9182 /// a breaking change. Applications should write their code in anticipation of:
9183 ///
9184 /// - New values appearing in future releases of the client library, **and**
9185 /// - New values received dynamically, without application changes.
9186 ///
9187 /// Please consult the [Working with enums] section in the user guide for some
9188 /// guidelines.
9189 ///
9190 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9191 #[derive(Clone, Debug, PartialEq)]
9192 #[non_exhaustive]
9193 pub enum SignatureType {
9194 /// The default signature type.
9195 Unspecified,
9196 /// Used for signatures concerning processes.
9197 Process,
9198 /// Used for signatures concerning disks.
9199 File,
9200 /// If set, the enum was initialized with an unknown value.
9201 ///
9202 /// Applications can examine the value using [SignatureType::value] or
9203 /// [SignatureType::name].
9204 UnknownValue(signature_type::UnknownValue),
9205 }
9206
9207 #[doc(hidden)]
9208 pub mod signature_type {
9209 #[allow(unused_imports)]
9210 use super::*;
9211 #[derive(Clone, Debug, PartialEq)]
9212 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9213 }
9214
9215 impl SignatureType {
9216 /// Gets the enum value.
9217 ///
9218 /// Returns `None` if the enum contains an unknown value deserialized from
9219 /// the string representation of enums.
9220 pub fn value(&self) -> std::option::Option<i32> {
9221 match self {
9222 Self::Unspecified => std::option::Option::Some(0),
9223 Self::Process => std::option::Option::Some(1),
9224 Self::File => std::option::Option::Some(2),
9225 Self::UnknownValue(u) => u.0.value(),
9226 }
9227 }
9228
9229 /// Gets the enum value as a string.
9230 ///
9231 /// Returns `None` if the enum contains an unknown value deserialized from
9232 /// the integer representation of enums.
9233 pub fn name(&self) -> std::option::Option<&str> {
9234 match self {
9235 Self::Unspecified => std::option::Option::Some("SIGNATURE_TYPE_UNSPECIFIED"),
9236 Self::Process => std::option::Option::Some("SIGNATURE_TYPE_PROCESS"),
9237 Self::File => std::option::Option::Some("SIGNATURE_TYPE_FILE"),
9238 Self::UnknownValue(u) => u.0.name(),
9239 }
9240 }
9241 }
9242
9243 impl std::default::Default for SignatureType {
9244 fn default() -> Self {
9245 use std::convert::From;
9246 Self::from(0)
9247 }
9248 }
9249
9250 impl std::fmt::Display for SignatureType {
9251 fn fmt(
9252 &self,
9253 f: &mut std::fmt::Formatter<'_>,
9254 ) -> std::result::Result<(), std::fmt::Error> {
9255 wkt::internal::display_enum(f, self.name(), self.value())
9256 }
9257 }
9258
9259 impl std::convert::From<i32> for SignatureType {
9260 fn from(value: i32) -> Self {
9261 match value {
9262 0 => Self::Unspecified,
9263 1 => Self::Process,
9264 2 => Self::File,
9265 _ => Self::UnknownValue(signature_type::UnknownValue(
9266 wkt::internal::UnknownEnumValue::Integer(value),
9267 )),
9268 }
9269 }
9270 }
9271
9272 impl std::convert::From<&str> for SignatureType {
9273 fn from(value: &str) -> Self {
9274 use std::string::ToString;
9275 match value {
9276 "SIGNATURE_TYPE_UNSPECIFIED" => Self::Unspecified,
9277 "SIGNATURE_TYPE_PROCESS" => Self::Process,
9278 "SIGNATURE_TYPE_FILE" => Self::File,
9279 _ => Self::UnknownValue(signature_type::UnknownValue(
9280 wkt::internal::UnknownEnumValue::String(value.to_string()),
9281 )),
9282 }
9283 }
9284 }
9285
9286 impl serde::ser::Serialize for SignatureType {
9287 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9288 where
9289 S: serde::Serializer,
9290 {
9291 match self {
9292 Self::Unspecified => serializer.serialize_i32(0),
9293 Self::Process => serializer.serialize_i32(1),
9294 Self::File => serializer.serialize_i32(2),
9295 Self::UnknownValue(u) => u.0.serialize(serializer),
9296 }
9297 }
9298 }
9299
9300 impl<'de> serde::de::Deserialize<'de> for SignatureType {
9301 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9302 where
9303 D: serde::Deserializer<'de>,
9304 {
9305 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SignatureType>::new(
9306 ".google.cloud.securitycenter.v2.Indicator.ProcessSignature.SignatureType",
9307 ))
9308 }
9309 }
9310
9311 /// The signature.
9312 #[derive(Clone, Debug, PartialEq)]
9313 #[non_exhaustive]
9314 pub enum Signature {
9315 /// Signature indicating that a binary family was matched.
9316 MemoryHashSignature(
9317 std::boxed::Box<crate::model::indicator::process_signature::MemoryHashSignature>,
9318 ),
9319 /// Signature indicating that a YARA rule was matched.
9320 YaraRuleSignature(
9321 std::boxed::Box<crate::model::indicator::process_signature::YaraRuleSignature>,
9322 ),
9323 }
9324 }
9325}
9326
9327/// IP rules associated with the finding.
9328#[derive(Clone, Default, PartialEq)]
9329#[non_exhaustive]
9330pub struct IpRules {
9331 /// The direction that the rule is applicable to, one of ingress or egress.
9332 pub direction: crate::model::ip_rules::Direction,
9333
9334 /// If source IP ranges are specified, the firewall rule applies only to
9335 /// traffic that has a source IP address in these ranges. These ranges must be
9336 /// expressed in CIDR format. Only supports IPv4.
9337 pub source_ip_ranges: std::vec::Vec<std::string::String>,
9338
9339 /// If destination IP ranges are specified, the firewall rule applies only to
9340 /// traffic that has a destination IP address in these ranges. These ranges
9341 /// must be expressed in CIDR format. Only supports IPv4.
9342 pub destination_ip_ranges: std::vec::Vec<std::string::String>,
9343
9344 /// Name of the network protocol service, such as FTP, that is exposed by the
9345 /// open port. Follows the naming convention available at:
9346 /// <https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml>.
9347 pub exposed_services: std::vec::Vec<std::string::String>,
9348
9349 /// The list of allow rules specified by this firewall. Each rule specifies a
9350 /// protocol and port-range tuple that describes a permitted connection.
9351 pub rules: std::option::Option<crate::model::ip_rules::Rules>,
9352
9353 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9354}
9355
9356impl IpRules {
9357 pub fn new() -> Self {
9358 std::default::Default::default()
9359 }
9360
9361 /// Sets the value of [direction][crate::model::IpRules::direction].
9362 ///
9363 /// # Example
9364 /// ```ignore,no_run
9365 /// # use google_cloud_securitycenter_v2::model::IpRules;
9366 /// use google_cloud_securitycenter_v2::model::ip_rules::Direction;
9367 /// let x0 = IpRules::new().set_direction(Direction::Ingress);
9368 /// let x1 = IpRules::new().set_direction(Direction::Egress);
9369 /// ```
9370 pub fn set_direction<T: std::convert::Into<crate::model::ip_rules::Direction>>(
9371 mut self,
9372 v: T,
9373 ) -> Self {
9374 self.direction = v.into();
9375 self
9376 }
9377
9378 /// Sets the value of [source_ip_ranges][crate::model::IpRules::source_ip_ranges].
9379 ///
9380 /// # Example
9381 /// ```ignore,no_run
9382 /// # use google_cloud_securitycenter_v2::model::IpRules;
9383 /// let x = IpRules::new().set_source_ip_ranges(["a", "b", "c"]);
9384 /// ```
9385 pub fn set_source_ip_ranges<T, V>(mut self, v: T) -> Self
9386 where
9387 T: std::iter::IntoIterator<Item = V>,
9388 V: std::convert::Into<std::string::String>,
9389 {
9390 use std::iter::Iterator;
9391 self.source_ip_ranges = v.into_iter().map(|i| i.into()).collect();
9392 self
9393 }
9394
9395 /// Sets the value of [destination_ip_ranges][crate::model::IpRules::destination_ip_ranges].
9396 ///
9397 /// # Example
9398 /// ```ignore,no_run
9399 /// # use google_cloud_securitycenter_v2::model::IpRules;
9400 /// let x = IpRules::new().set_destination_ip_ranges(["a", "b", "c"]);
9401 /// ```
9402 pub fn set_destination_ip_ranges<T, V>(mut self, v: T) -> Self
9403 where
9404 T: std::iter::IntoIterator<Item = V>,
9405 V: std::convert::Into<std::string::String>,
9406 {
9407 use std::iter::Iterator;
9408 self.destination_ip_ranges = v.into_iter().map(|i| i.into()).collect();
9409 self
9410 }
9411
9412 /// Sets the value of [exposed_services][crate::model::IpRules::exposed_services].
9413 ///
9414 /// # Example
9415 /// ```ignore,no_run
9416 /// # use google_cloud_securitycenter_v2::model::IpRules;
9417 /// let x = IpRules::new().set_exposed_services(["a", "b", "c"]);
9418 /// ```
9419 pub fn set_exposed_services<T, V>(mut self, v: T) -> Self
9420 where
9421 T: std::iter::IntoIterator<Item = V>,
9422 V: std::convert::Into<std::string::String>,
9423 {
9424 use std::iter::Iterator;
9425 self.exposed_services = v.into_iter().map(|i| i.into()).collect();
9426 self
9427 }
9428
9429 /// Sets the value of [rules][crate::model::IpRules::rules].
9430 ///
9431 /// Note that all the setters affecting `rules` are mutually
9432 /// exclusive.
9433 ///
9434 /// # Example
9435 /// ```ignore,no_run
9436 /// # use google_cloud_securitycenter_v2::model::IpRules;
9437 /// use google_cloud_securitycenter_v2::model::Allowed;
9438 /// let x = IpRules::new().set_rules(Some(
9439 /// google_cloud_securitycenter_v2::model::ip_rules::Rules::Allowed(Allowed::default().into())));
9440 /// ```
9441 pub fn set_rules<T: std::convert::Into<std::option::Option<crate::model::ip_rules::Rules>>>(
9442 mut self,
9443 v: T,
9444 ) -> Self {
9445 self.rules = v.into();
9446 self
9447 }
9448
9449 /// The value of [rules][crate::model::IpRules::rules]
9450 /// if it holds a `Allowed`, `None` if the field is not set or
9451 /// holds a different branch.
9452 pub fn allowed(&self) -> std::option::Option<&std::boxed::Box<crate::model::Allowed>> {
9453 #[allow(unreachable_patterns)]
9454 self.rules.as_ref().and_then(|v| match v {
9455 crate::model::ip_rules::Rules::Allowed(v) => std::option::Option::Some(v),
9456 _ => std::option::Option::None,
9457 })
9458 }
9459
9460 /// Sets the value of [rules][crate::model::IpRules::rules]
9461 /// to hold a `Allowed`.
9462 ///
9463 /// Note that all the setters affecting `rules` are
9464 /// mutually exclusive.
9465 ///
9466 /// # Example
9467 /// ```ignore,no_run
9468 /// # use google_cloud_securitycenter_v2::model::IpRules;
9469 /// use google_cloud_securitycenter_v2::model::Allowed;
9470 /// let x = IpRules::new().set_allowed(Allowed::default()/* use setters */);
9471 /// assert!(x.allowed().is_some());
9472 /// assert!(x.denied().is_none());
9473 /// ```
9474 pub fn set_allowed<T: std::convert::Into<std::boxed::Box<crate::model::Allowed>>>(
9475 mut self,
9476 v: T,
9477 ) -> Self {
9478 self.rules = std::option::Option::Some(crate::model::ip_rules::Rules::Allowed(v.into()));
9479 self
9480 }
9481
9482 /// The value of [rules][crate::model::IpRules::rules]
9483 /// if it holds a `Denied`, `None` if the field is not set or
9484 /// holds a different branch.
9485 pub fn denied(&self) -> std::option::Option<&std::boxed::Box<crate::model::Denied>> {
9486 #[allow(unreachable_patterns)]
9487 self.rules.as_ref().and_then(|v| match v {
9488 crate::model::ip_rules::Rules::Denied(v) => std::option::Option::Some(v),
9489 _ => std::option::Option::None,
9490 })
9491 }
9492
9493 /// Sets the value of [rules][crate::model::IpRules::rules]
9494 /// to hold a `Denied`.
9495 ///
9496 /// Note that all the setters affecting `rules` are
9497 /// mutually exclusive.
9498 ///
9499 /// # Example
9500 /// ```ignore,no_run
9501 /// # use google_cloud_securitycenter_v2::model::IpRules;
9502 /// use google_cloud_securitycenter_v2::model::Denied;
9503 /// let x = IpRules::new().set_denied(Denied::default()/* use setters */);
9504 /// assert!(x.denied().is_some());
9505 /// assert!(x.allowed().is_none());
9506 /// ```
9507 pub fn set_denied<T: std::convert::Into<std::boxed::Box<crate::model::Denied>>>(
9508 mut self,
9509 v: T,
9510 ) -> Self {
9511 self.rules = std::option::Option::Some(crate::model::ip_rules::Rules::Denied(v.into()));
9512 self
9513 }
9514}
9515
9516impl wkt::message::Message for IpRules {
9517 fn typename() -> &'static str {
9518 "type.googleapis.com/google.cloud.securitycenter.v2.IpRules"
9519 }
9520}
9521
9522/// Defines additional types related to [IpRules].
9523pub mod ip_rules {
9524 #[allow(unused_imports)]
9525 use super::*;
9526
9527 /// The type of direction that the rule is applicable to, one of ingress or
9528 /// egress. Not applicable to OPEN_X_PORT findings.
9529 ///
9530 /// # Working with unknown values
9531 ///
9532 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9533 /// additional enum variants at any time. Adding new variants is not considered
9534 /// a breaking change. Applications should write their code in anticipation of:
9535 ///
9536 /// - New values appearing in future releases of the client library, **and**
9537 /// - New values received dynamically, without application changes.
9538 ///
9539 /// Please consult the [Working with enums] section in the user guide for some
9540 /// guidelines.
9541 ///
9542 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9543 #[derive(Clone, Debug, PartialEq)]
9544 #[non_exhaustive]
9545 pub enum Direction {
9546 /// Unspecified direction value.
9547 Unspecified,
9548 /// Ingress direction value.
9549 Ingress,
9550 /// Egress direction value.
9551 Egress,
9552 /// If set, the enum was initialized with an unknown value.
9553 ///
9554 /// Applications can examine the value using [Direction::value] or
9555 /// [Direction::name].
9556 UnknownValue(direction::UnknownValue),
9557 }
9558
9559 #[doc(hidden)]
9560 pub mod direction {
9561 #[allow(unused_imports)]
9562 use super::*;
9563 #[derive(Clone, Debug, PartialEq)]
9564 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9565 }
9566
9567 impl Direction {
9568 /// Gets the enum value.
9569 ///
9570 /// Returns `None` if the enum contains an unknown value deserialized from
9571 /// the string representation of enums.
9572 pub fn value(&self) -> std::option::Option<i32> {
9573 match self {
9574 Self::Unspecified => std::option::Option::Some(0),
9575 Self::Ingress => std::option::Option::Some(1),
9576 Self::Egress => std::option::Option::Some(2),
9577 Self::UnknownValue(u) => u.0.value(),
9578 }
9579 }
9580
9581 /// Gets the enum value as a string.
9582 ///
9583 /// Returns `None` if the enum contains an unknown value deserialized from
9584 /// the integer representation of enums.
9585 pub fn name(&self) -> std::option::Option<&str> {
9586 match self {
9587 Self::Unspecified => std::option::Option::Some("DIRECTION_UNSPECIFIED"),
9588 Self::Ingress => std::option::Option::Some("INGRESS"),
9589 Self::Egress => std::option::Option::Some("EGRESS"),
9590 Self::UnknownValue(u) => u.0.name(),
9591 }
9592 }
9593 }
9594
9595 impl std::default::Default for Direction {
9596 fn default() -> Self {
9597 use std::convert::From;
9598 Self::from(0)
9599 }
9600 }
9601
9602 impl std::fmt::Display for Direction {
9603 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9604 wkt::internal::display_enum(f, self.name(), self.value())
9605 }
9606 }
9607
9608 impl std::convert::From<i32> for Direction {
9609 fn from(value: i32) -> Self {
9610 match value {
9611 0 => Self::Unspecified,
9612 1 => Self::Ingress,
9613 2 => Self::Egress,
9614 _ => Self::UnknownValue(direction::UnknownValue(
9615 wkt::internal::UnknownEnumValue::Integer(value),
9616 )),
9617 }
9618 }
9619 }
9620
9621 impl std::convert::From<&str> for Direction {
9622 fn from(value: &str) -> Self {
9623 use std::string::ToString;
9624 match value {
9625 "DIRECTION_UNSPECIFIED" => Self::Unspecified,
9626 "INGRESS" => Self::Ingress,
9627 "EGRESS" => Self::Egress,
9628 _ => Self::UnknownValue(direction::UnknownValue(
9629 wkt::internal::UnknownEnumValue::String(value.to_string()),
9630 )),
9631 }
9632 }
9633 }
9634
9635 impl serde::ser::Serialize for Direction {
9636 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9637 where
9638 S: serde::Serializer,
9639 {
9640 match self {
9641 Self::Unspecified => serializer.serialize_i32(0),
9642 Self::Ingress => serializer.serialize_i32(1),
9643 Self::Egress => serializer.serialize_i32(2),
9644 Self::UnknownValue(u) => u.0.serialize(serializer),
9645 }
9646 }
9647 }
9648
9649 impl<'de> serde::de::Deserialize<'de> for Direction {
9650 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9651 where
9652 D: serde::Deserializer<'de>,
9653 {
9654 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Direction>::new(
9655 ".google.cloud.securitycenter.v2.IpRules.Direction",
9656 ))
9657 }
9658 }
9659
9660 /// The list of allow rules specified by this firewall. Each rule specifies a
9661 /// protocol and port-range tuple that describes a permitted connection.
9662 #[derive(Clone, Debug, PartialEq)]
9663 #[non_exhaustive]
9664 pub enum Rules {
9665 /// Tuple with allowed rules.
9666 Allowed(std::boxed::Box<crate::model::Allowed>),
9667 /// Tuple with denied rules.
9668 Denied(std::boxed::Box<crate::model::Denied>),
9669 }
9670}
9671
9672/// IP rule information.
9673#[derive(Clone, Default, PartialEq)]
9674#[non_exhaustive]
9675pub struct IpRule {
9676 /// The IP protocol this rule applies to. This value can either be one of the
9677 /// following well known protocol strings (TCP, UDP, ICMP, ESP, AH, IPIP,
9678 /// SCTP) or a string representation of the integer value.
9679 pub protocol: std::string::String,
9680
9681 /// Optional. An optional list of ports to which this rule applies. This field
9682 /// is only applicable for the UDP or (S)TCP protocols. Each entry must be
9683 /// either an integer or a range including a min and max port number.
9684 pub port_ranges: std::vec::Vec<crate::model::ip_rule::PortRange>,
9685
9686 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9687}
9688
9689impl IpRule {
9690 pub fn new() -> Self {
9691 std::default::Default::default()
9692 }
9693
9694 /// Sets the value of [protocol][crate::model::IpRule::protocol].
9695 ///
9696 /// # Example
9697 /// ```ignore,no_run
9698 /// # use google_cloud_securitycenter_v2::model::IpRule;
9699 /// let x = IpRule::new().set_protocol("example");
9700 /// ```
9701 pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9702 self.protocol = v.into();
9703 self
9704 }
9705
9706 /// Sets the value of [port_ranges][crate::model::IpRule::port_ranges].
9707 ///
9708 /// # Example
9709 /// ```ignore,no_run
9710 /// # use google_cloud_securitycenter_v2::model::IpRule;
9711 /// use google_cloud_securitycenter_v2::model::ip_rule::PortRange;
9712 /// let x = IpRule::new()
9713 /// .set_port_ranges([
9714 /// PortRange::default()/* use setters */,
9715 /// PortRange::default()/* use (different) setters */,
9716 /// ]);
9717 /// ```
9718 pub fn set_port_ranges<T, V>(mut self, v: T) -> Self
9719 where
9720 T: std::iter::IntoIterator<Item = V>,
9721 V: std::convert::Into<crate::model::ip_rule::PortRange>,
9722 {
9723 use std::iter::Iterator;
9724 self.port_ranges = v.into_iter().map(|i| i.into()).collect();
9725 self
9726 }
9727}
9728
9729impl wkt::message::Message for IpRule {
9730 fn typename() -> &'static str {
9731 "type.googleapis.com/google.cloud.securitycenter.v2.IpRule"
9732 }
9733}
9734
9735/// Defines additional types related to [IpRule].
9736pub mod ip_rule {
9737 #[allow(unused_imports)]
9738 use super::*;
9739
9740 /// A port range which is inclusive of the min and max values.
9741 /// Values are between 0 and 2^16-1. The max can be equal / must be not smaller
9742 /// than the min value. If min and max are equal this indicates that it is a
9743 /// single port.
9744 #[derive(Clone, Default, PartialEq)]
9745 #[non_exhaustive]
9746 pub struct PortRange {
9747 /// Minimum port value.
9748 pub min: i64,
9749
9750 /// Maximum port value.
9751 pub max: i64,
9752
9753 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9754 }
9755
9756 impl PortRange {
9757 pub fn new() -> Self {
9758 std::default::Default::default()
9759 }
9760
9761 /// Sets the value of [min][crate::model::ip_rule::PortRange::min].
9762 ///
9763 /// # Example
9764 /// ```ignore,no_run
9765 /// # use google_cloud_securitycenter_v2::model::ip_rule::PortRange;
9766 /// let x = PortRange::new().set_min(42);
9767 /// ```
9768 pub fn set_min<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9769 self.min = v.into();
9770 self
9771 }
9772
9773 /// Sets the value of [max][crate::model::ip_rule::PortRange::max].
9774 ///
9775 /// # Example
9776 /// ```ignore,no_run
9777 /// # use google_cloud_securitycenter_v2::model::ip_rule::PortRange;
9778 /// let x = PortRange::new().set_max(42);
9779 /// ```
9780 pub fn set_max<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9781 self.max = v.into();
9782 self
9783 }
9784 }
9785
9786 impl wkt::message::Message for PortRange {
9787 fn typename() -> &'static str {
9788 "type.googleapis.com/google.cloud.securitycenter.v2.IpRule.PortRange"
9789 }
9790 }
9791}
9792
9793/// Allowed IP rule.
9794#[derive(Clone, Default, PartialEq)]
9795#[non_exhaustive]
9796pub struct Allowed {
9797 /// Optional. Optional list of allowed IP rules.
9798 pub ip_rules: std::vec::Vec<crate::model::IpRule>,
9799
9800 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9801}
9802
9803impl Allowed {
9804 pub fn new() -> Self {
9805 std::default::Default::default()
9806 }
9807
9808 /// Sets the value of [ip_rules][crate::model::Allowed::ip_rules].
9809 ///
9810 /// # Example
9811 /// ```ignore,no_run
9812 /// # use google_cloud_securitycenter_v2::model::Allowed;
9813 /// use google_cloud_securitycenter_v2::model::IpRule;
9814 /// let x = Allowed::new()
9815 /// .set_ip_rules([
9816 /// IpRule::default()/* use setters */,
9817 /// IpRule::default()/* use (different) setters */,
9818 /// ]);
9819 /// ```
9820 pub fn set_ip_rules<T, V>(mut self, v: T) -> Self
9821 where
9822 T: std::iter::IntoIterator<Item = V>,
9823 V: std::convert::Into<crate::model::IpRule>,
9824 {
9825 use std::iter::Iterator;
9826 self.ip_rules = v.into_iter().map(|i| i.into()).collect();
9827 self
9828 }
9829}
9830
9831impl wkt::message::Message for Allowed {
9832 fn typename() -> &'static str {
9833 "type.googleapis.com/google.cloud.securitycenter.v2.Allowed"
9834 }
9835}
9836
9837/// Denied IP rule.
9838#[derive(Clone, Default, PartialEq)]
9839#[non_exhaustive]
9840pub struct Denied {
9841 /// Optional. Optional list of denied IP rules.
9842 pub ip_rules: std::vec::Vec<crate::model::IpRule>,
9843
9844 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9845}
9846
9847impl Denied {
9848 pub fn new() -> Self {
9849 std::default::Default::default()
9850 }
9851
9852 /// Sets the value of [ip_rules][crate::model::Denied::ip_rules].
9853 ///
9854 /// # Example
9855 /// ```ignore,no_run
9856 /// # use google_cloud_securitycenter_v2::model::Denied;
9857 /// use google_cloud_securitycenter_v2::model::IpRule;
9858 /// let x = Denied::new()
9859 /// .set_ip_rules([
9860 /// IpRule::default()/* use setters */,
9861 /// IpRule::default()/* use (different) setters */,
9862 /// ]);
9863 /// ```
9864 pub fn set_ip_rules<T, V>(mut self, v: T) -> Self
9865 where
9866 T: std::iter::IntoIterator<Item = V>,
9867 V: std::convert::Into<crate::model::IpRule>,
9868 {
9869 use std::iter::Iterator;
9870 self.ip_rules = v.into_iter().map(|i| i.into()).collect();
9871 self
9872 }
9873}
9874
9875impl wkt::message::Message for Denied {
9876 fn typename() -> &'static str {
9877 "type.googleapis.com/google.cloud.securitycenter.v2.Denied"
9878 }
9879}
9880
9881/// Describes a job
9882#[derive(Clone, Default, PartialEq)]
9883#[non_exhaustive]
9884pub struct Job {
9885 /// The fully-qualified name for a job.
9886 /// e.g. `projects/<project_id>/jobs/<job_id>`
9887 pub name: std::string::String,
9888
9889 /// Output only. State of the job, such as `RUNNING` or `PENDING`.
9890 pub state: crate::model::JobState,
9891
9892 /// Optional. If the job did not complete successfully, this field describes
9893 /// why.
9894 pub error_code: i32,
9895
9896 /// Optional. Gives the location where the job ran, such as `US` or
9897 /// `europe-west1`
9898 pub location: std::string::String,
9899
9900 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9901}
9902
9903impl Job {
9904 pub fn new() -> Self {
9905 std::default::Default::default()
9906 }
9907
9908 /// Sets the value of [name][crate::model::Job::name].
9909 ///
9910 /// # Example
9911 /// ```ignore,no_run
9912 /// # use google_cloud_securitycenter_v2::model::Job;
9913 /// let x = Job::new().set_name("example");
9914 /// ```
9915 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9916 self.name = v.into();
9917 self
9918 }
9919
9920 /// Sets the value of [state][crate::model::Job::state].
9921 ///
9922 /// # Example
9923 /// ```ignore,no_run
9924 /// # use google_cloud_securitycenter_v2::model::Job;
9925 /// use google_cloud_securitycenter_v2::model::JobState;
9926 /// let x0 = Job::new().set_state(JobState::Pending);
9927 /// let x1 = Job::new().set_state(JobState::Running);
9928 /// let x2 = Job::new().set_state(JobState::Succeeded);
9929 /// ```
9930 pub fn set_state<T: std::convert::Into<crate::model::JobState>>(mut self, v: T) -> Self {
9931 self.state = v.into();
9932 self
9933 }
9934
9935 /// Sets the value of [error_code][crate::model::Job::error_code].
9936 ///
9937 /// # Example
9938 /// ```ignore,no_run
9939 /// # use google_cloud_securitycenter_v2::model::Job;
9940 /// let x = Job::new().set_error_code(42);
9941 /// ```
9942 pub fn set_error_code<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9943 self.error_code = v.into();
9944 self
9945 }
9946
9947 /// Sets the value of [location][crate::model::Job::location].
9948 ///
9949 /// # Example
9950 /// ```ignore,no_run
9951 /// # use google_cloud_securitycenter_v2::model::Job;
9952 /// let x = Job::new().set_location("example");
9953 /// ```
9954 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9955 self.location = v.into();
9956 self
9957 }
9958}
9959
9960impl wkt::message::Message for Job {
9961 fn typename() -> &'static str {
9962 "type.googleapis.com/google.cloud.securitycenter.v2.Job"
9963 }
9964}
9965
9966/// Kernel mode rootkit signatures.
9967#[derive(Clone, Default, PartialEq)]
9968#[non_exhaustive]
9969pub struct KernelRootkit {
9970 /// Rootkit name, when available.
9971 pub name: std::string::String,
9972
9973 /// True if unexpected modifications of kernel code memory are present.
9974 pub unexpected_code_modification: bool,
9975
9976 /// True if unexpected modifications of kernel read-only data memory are
9977 /// present.
9978 pub unexpected_read_only_data_modification: bool,
9979
9980 /// True if `ftrace` points are present with callbacks pointing to regions
9981 /// that are not in the expected kernel or module code range.
9982 pub unexpected_ftrace_handler: bool,
9983
9984 /// True if `kprobe` points are present with callbacks pointing to regions
9985 /// that are not in the expected kernel or module code range.
9986 pub unexpected_kprobe_handler: bool,
9987
9988 /// True if kernel code pages that are not in the expected kernel or module
9989 /// code regions are present.
9990 pub unexpected_kernel_code_pages: bool,
9991
9992 /// True if system call handlers that are are not in the expected kernel or
9993 /// module code regions are present.
9994 pub unexpected_system_call_handler: bool,
9995
9996 /// True if interrupt handlers that are are not in the expected kernel or
9997 /// module code regions are present.
9998 pub unexpected_interrupt_handler: bool,
9999
10000 /// True if unexpected processes in the scheduler run queue are present. Such
10001 /// processes are in the run queue, but not in the process task list.
10002 pub unexpected_processes_in_runqueue: bool,
10003
10004 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10005}
10006
10007impl KernelRootkit {
10008 pub fn new() -> Self {
10009 std::default::Default::default()
10010 }
10011
10012 /// Sets the value of [name][crate::model::KernelRootkit::name].
10013 ///
10014 /// # Example
10015 /// ```ignore,no_run
10016 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10017 /// let x = KernelRootkit::new().set_name("example");
10018 /// ```
10019 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10020 self.name = v.into();
10021 self
10022 }
10023
10024 /// Sets the value of [unexpected_code_modification][crate::model::KernelRootkit::unexpected_code_modification].
10025 ///
10026 /// # Example
10027 /// ```ignore,no_run
10028 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10029 /// let x = KernelRootkit::new().set_unexpected_code_modification(true);
10030 /// ```
10031 pub fn set_unexpected_code_modification<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10032 self.unexpected_code_modification = v.into();
10033 self
10034 }
10035
10036 /// Sets the value of [unexpected_read_only_data_modification][crate::model::KernelRootkit::unexpected_read_only_data_modification].
10037 ///
10038 /// # Example
10039 /// ```ignore,no_run
10040 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10041 /// let x = KernelRootkit::new().set_unexpected_read_only_data_modification(true);
10042 /// ```
10043 pub fn set_unexpected_read_only_data_modification<T: std::convert::Into<bool>>(
10044 mut self,
10045 v: T,
10046 ) -> Self {
10047 self.unexpected_read_only_data_modification = v.into();
10048 self
10049 }
10050
10051 /// Sets the value of [unexpected_ftrace_handler][crate::model::KernelRootkit::unexpected_ftrace_handler].
10052 ///
10053 /// # Example
10054 /// ```ignore,no_run
10055 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10056 /// let x = KernelRootkit::new().set_unexpected_ftrace_handler(true);
10057 /// ```
10058 pub fn set_unexpected_ftrace_handler<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10059 self.unexpected_ftrace_handler = v.into();
10060 self
10061 }
10062
10063 /// Sets the value of [unexpected_kprobe_handler][crate::model::KernelRootkit::unexpected_kprobe_handler].
10064 ///
10065 /// # Example
10066 /// ```ignore,no_run
10067 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10068 /// let x = KernelRootkit::new().set_unexpected_kprobe_handler(true);
10069 /// ```
10070 pub fn set_unexpected_kprobe_handler<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10071 self.unexpected_kprobe_handler = v.into();
10072 self
10073 }
10074
10075 /// Sets the value of [unexpected_kernel_code_pages][crate::model::KernelRootkit::unexpected_kernel_code_pages].
10076 ///
10077 /// # Example
10078 /// ```ignore,no_run
10079 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10080 /// let x = KernelRootkit::new().set_unexpected_kernel_code_pages(true);
10081 /// ```
10082 pub fn set_unexpected_kernel_code_pages<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10083 self.unexpected_kernel_code_pages = v.into();
10084 self
10085 }
10086
10087 /// Sets the value of [unexpected_system_call_handler][crate::model::KernelRootkit::unexpected_system_call_handler].
10088 ///
10089 /// # Example
10090 /// ```ignore,no_run
10091 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10092 /// let x = KernelRootkit::new().set_unexpected_system_call_handler(true);
10093 /// ```
10094 pub fn set_unexpected_system_call_handler<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10095 self.unexpected_system_call_handler = v.into();
10096 self
10097 }
10098
10099 /// Sets the value of [unexpected_interrupt_handler][crate::model::KernelRootkit::unexpected_interrupt_handler].
10100 ///
10101 /// # Example
10102 /// ```ignore,no_run
10103 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10104 /// let x = KernelRootkit::new().set_unexpected_interrupt_handler(true);
10105 /// ```
10106 pub fn set_unexpected_interrupt_handler<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10107 self.unexpected_interrupt_handler = v.into();
10108 self
10109 }
10110
10111 /// Sets the value of [unexpected_processes_in_runqueue][crate::model::KernelRootkit::unexpected_processes_in_runqueue].
10112 ///
10113 /// # Example
10114 /// ```ignore,no_run
10115 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10116 /// let x = KernelRootkit::new().set_unexpected_processes_in_runqueue(true);
10117 /// ```
10118 pub fn set_unexpected_processes_in_runqueue<T: std::convert::Into<bool>>(
10119 mut self,
10120 v: T,
10121 ) -> Self {
10122 self.unexpected_processes_in_runqueue = v.into();
10123 self
10124 }
10125}
10126
10127impl wkt::message::Message for KernelRootkit {
10128 fn typename() -> &'static str {
10129 "type.googleapis.com/google.cloud.securitycenter.v2.KernelRootkit"
10130 }
10131}
10132
10133/// Kubernetes-related attributes.
10134#[derive(Clone, Default, PartialEq)]
10135#[non_exhaustive]
10136pub struct Kubernetes {
10137 /// Kubernetes
10138 /// [Pods](https://cloud.google.com/kubernetes-engine/docs/concepts/pod)
10139 /// associated with the finding. This field contains Pod records for each
10140 /// container that is owned by a Pod.
10141 pub pods: std::vec::Vec<crate::model::kubernetes::Pod>,
10142
10143 /// Provides Kubernetes
10144 /// [node](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture#nodes)
10145 /// information.
10146 pub nodes: std::vec::Vec<crate::model::kubernetes::Node>,
10147
10148 /// GKE [node
10149 /// pools](https://cloud.google.com/kubernetes-engine/docs/concepts/node-pools)
10150 /// associated with the finding. This field contains node pool information for
10151 /// each node, when it is available.
10152 pub node_pools: std::vec::Vec<crate::model::kubernetes::NodePool>,
10153
10154 /// Provides Kubernetes role information for findings that involve [Roles or
10155 /// ClusterRoles](https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control).
10156 pub roles: std::vec::Vec<crate::model::kubernetes::Role>,
10157
10158 /// Provides Kubernetes role binding information for findings that involve
10159 /// [RoleBindings or
10160 /// ClusterRoleBindings](https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control).
10161 pub bindings: std::vec::Vec<crate::model::kubernetes::Binding>,
10162
10163 /// Provides information on any Kubernetes access reviews (privilege checks)
10164 /// relevant to the finding.
10165 pub access_reviews: std::vec::Vec<crate::model::kubernetes::AccessReview>,
10166
10167 /// Kubernetes objects related to the finding.
10168 pub objects: std::vec::Vec<crate::model::kubernetes::Object>,
10169
10170 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10171}
10172
10173impl Kubernetes {
10174 pub fn new() -> Self {
10175 std::default::Default::default()
10176 }
10177
10178 /// Sets the value of [pods][crate::model::Kubernetes::pods].
10179 ///
10180 /// # Example
10181 /// ```ignore,no_run
10182 /// # use google_cloud_securitycenter_v2::model::Kubernetes;
10183 /// use google_cloud_securitycenter_v2::model::kubernetes::Pod;
10184 /// let x = Kubernetes::new()
10185 /// .set_pods([
10186 /// Pod::default()/* use setters */,
10187 /// Pod::default()/* use (different) setters */,
10188 /// ]);
10189 /// ```
10190 pub fn set_pods<T, V>(mut self, v: T) -> Self
10191 where
10192 T: std::iter::IntoIterator<Item = V>,
10193 V: std::convert::Into<crate::model::kubernetes::Pod>,
10194 {
10195 use std::iter::Iterator;
10196 self.pods = v.into_iter().map(|i| i.into()).collect();
10197 self
10198 }
10199
10200 /// Sets the value of [nodes][crate::model::Kubernetes::nodes].
10201 ///
10202 /// # Example
10203 /// ```ignore,no_run
10204 /// # use google_cloud_securitycenter_v2::model::Kubernetes;
10205 /// use google_cloud_securitycenter_v2::model::kubernetes::Node;
10206 /// let x = Kubernetes::new()
10207 /// .set_nodes([
10208 /// Node::default()/* use setters */,
10209 /// Node::default()/* use (different) setters */,
10210 /// ]);
10211 /// ```
10212 pub fn set_nodes<T, V>(mut self, v: T) -> Self
10213 where
10214 T: std::iter::IntoIterator<Item = V>,
10215 V: std::convert::Into<crate::model::kubernetes::Node>,
10216 {
10217 use std::iter::Iterator;
10218 self.nodes = v.into_iter().map(|i| i.into()).collect();
10219 self
10220 }
10221
10222 /// Sets the value of [node_pools][crate::model::Kubernetes::node_pools].
10223 ///
10224 /// # Example
10225 /// ```ignore,no_run
10226 /// # use google_cloud_securitycenter_v2::model::Kubernetes;
10227 /// use google_cloud_securitycenter_v2::model::kubernetes::NodePool;
10228 /// let x = Kubernetes::new()
10229 /// .set_node_pools([
10230 /// NodePool::default()/* use setters */,
10231 /// NodePool::default()/* use (different) setters */,
10232 /// ]);
10233 /// ```
10234 pub fn set_node_pools<T, V>(mut self, v: T) -> Self
10235 where
10236 T: std::iter::IntoIterator<Item = V>,
10237 V: std::convert::Into<crate::model::kubernetes::NodePool>,
10238 {
10239 use std::iter::Iterator;
10240 self.node_pools = v.into_iter().map(|i| i.into()).collect();
10241 self
10242 }
10243
10244 /// Sets the value of [roles][crate::model::Kubernetes::roles].
10245 ///
10246 /// # Example
10247 /// ```ignore,no_run
10248 /// # use google_cloud_securitycenter_v2::model::Kubernetes;
10249 /// use google_cloud_securitycenter_v2::model::kubernetes::Role;
10250 /// let x = Kubernetes::new()
10251 /// .set_roles([
10252 /// Role::default()/* use setters */,
10253 /// Role::default()/* use (different) setters */,
10254 /// ]);
10255 /// ```
10256 pub fn set_roles<T, V>(mut self, v: T) -> Self
10257 where
10258 T: std::iter::IntoIterator<Item = V>,
10259 V: std::convert::Into<crate::model::kubernetes::Role>,
10260 {
10261 use std::iter::Iterator;
10262 self.roles = v.into_iter().map(|i| i.into()).collect();
10263 self
10264 }
10265
10266 /// Sets the value of [bindings][crate::model::Kubernetes::bindings].
10267 ///
10268 /// # Example
10269 /// ```ignore,no_run
10270 /// # use google_cloud_securitycenter_v2::model::Kubernetes;
10271 /// use google_cloud_securitycenter_v2::model::kubernetes::Binding;
10272 /// let x = Kubernetes::new()
10273 /// .set_bindings([
10274 /// Binding::default()/* use setters */,
10275 /// Binding::default()/* use (different) setters */,
10276 /// ]);
10277 /// ```
10278 pub fn set_bindings<T, V>(mut self, v: T) -> Self
10279 where
10280 T: std::iter::IntoIterator<Item = V>,
10281 V: std::convert::Into<crate::model::kubernetes::Binding>,
10282 {
10283 use std::iter::Iterator;
10284 self.bindings = v.into_iter().map(|i| i.into()).collect();
10285 self
10286 }
10287
10288 /// Sets the value of [access_reviews][crate::model::Kubernetes::access_reviews].
10289 ///
10290 /// # Example
10291 /// ```ignore,no_run
10292 /// # use google_cloud_securitycenter_v2::model::Kubernetes;
10293 /// use google_cloud_securitycenter_v2::model::kubernetes::AccessReview;
10294 /// let x = Kubernetes::new()
10295 /// .set_access_reviews([
10296 /// AccessReview::default()/* use setters */,
10297 /// AccessReview::default()/* use (different) setters */,
10298 /// ]);
10299 /// ```
10300 pub fn set_access_reviews<T, V>(mut self, v: T) -> Self
10301 where
10302 T: std::iter::IntoIterator<Item = V>,
10303 V: std::convert::Into<crate::model::kubernetes::AccessReview>,
10304 {
10305 use std::iter::Iterator;
10306 self.access_reviews = v.into_iter().map(|i| i.into()).collect();
10307 self
10308 }
10309
10310 /// Sets the value of [objects][crate::model::Kubernetes::objects].
10311 ///
10312 /// # Example
10313 /// ```ignore,no_run
10314 /// # use google_cloud_securitycenter_v2::model::Kubernetes;
10315 /// use google_cloud_securitycenter_v2::model::kubernetes::Object;
10316 /// let x = Kubernetes::new()
10317 /// .set_objects([
10318 /// Object::default()/* use setters */,
10319 /// Object::default()/* use (different) setters */,
10320 /// ]);
10321 /// ```
10322 pub fn set_objects<T, V>(mut self, v: T) -> Self
10323 where
10324 T: std::iter::IntoIterator<Item = V>,
10325 V: std::convert::Into<crate::model::kubernetes::Object>,
10326 {
10327 use std::iter::Iterator;
10328 self.objects = v.into_iter().map(|i| i.into()).collect();
10329 self
10330 }
10331}
10332
10333impl wkt::message::Message for Kubernetes {
10334 fn typename() -> &'static str {
10335 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes"
10336 }
10337}
10338
10339/// Defines additional types related to [Kubernetes].
10340pub mod kubernetes {
10341 #[allow(unused_imports)]
10342 use super::*;
10343
10344 /// A Kubernetes Pod.
10345 #[derive(Clone, Default, PartialEq)]
10346 #[non_exhaustive]
10347 pub struct Pod {
10348 /// Kubernetes Pod namespace.
10349 pub ns: std::string::String,
10350
10351 /// Kubernetes Pod name.
10352 pub name: std::string::String,
10353
10354 /// Pod labels. For Kubernetes containers, these are applied to the
10355 /// container.
10356 pub labels: std::vec::Vec<crate::model::Label>,
10357
10358 /// Pod containers associated with this finding, if any.
10359 pub containers: std::vec::Vec<crate::model::Container>,
10360
10361 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10362 }
10363
10364 impl Pod {
10365 pub fn new() -> Self {
10366 std::default::Default::default()
10367 }
10368
10369 /// Sets the value of [ns][crate::model::kubernetes::Pod::ns].
10370 ///
10371 /// # Example
10372 /// ```ignore,no_run
10373 /// # use google_cloud_securitycenter_v2::model::kubernetes::Pod;
10374 /// let x = Pod::new().set_ns("example");
10375 /// ```
10376 pub fn set_ns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10377 self.ns = v.into();
10378 self
10379 }
10380
10381 /// Sets the value of [name][crate::model::kubernetes::Pod::name].
10382 ///
10383 /// # Example
10384 /// ```ignore,no_run
10385 /// # use google_cloud_securitycenter_v2::model::kubernetes::Pod;
10386 /// let x = Pod::new().set_name("example");
10387 /// ```
10388 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10389 self.name = v.into();
10390 self
10391 }
10392
10393 /// Sets the value of [labels][crate::model::kubernetes::Pod::labels].
10394 ///
10395 /// # Example
10396 /// ```ignore,no_run
10397 /// # use google_cloud_securitycenter_v2::model::kubernetes::Pod;
10398 /// use google_cloud_securitycenter_v2::model::Label;
10399 /// let x = Pod::new()
10400 /// .set_labels([
10401 /// Label::default()/* use setters */,
10402 /// Label::default()/* use (different) setters */,
10403 /// ]);
10404 /// ```
10405 pub fn set_labels<T, V>(mut self, v: T) -> Self
10406 where
10407 T: std::iter::IntoIterator<Item = V>,
10408 V: std::convert::Into<crate::model::Label>,
10409 {
10410 use std::iter::Iterator;
10411 self.labels = v.into_iter().map(|i| i.into()).collect();
10412 self
10413 }
10414
10415 /// Sets the value of [containers][crate::model::kubernetes::Pod::containers].
10416 ///
10417 /// # Example
10418 /// ```ignore,no_run
10419 /// # use google_cloud_securitycenter_v2::model::kubernetes::Pod;
10420 /// use google_cloud_securitycenter_v2::model::Container;
10421 /// let x = Pod::new()
10422 /// .set_containers([
10423 /// Container::default()/* use setters */,
10424 /// Container::default()/* use (different) setters */,
10425 /// ]);
10426 /// ```
10427 pub fn set_containers<T, V>(mut self, v: T) -> Self
10428 where
10429 T: std::iter::IntoIterator<Item = V>,
10430 V: std::convert::Into<crate::model::Container>,
10431 {
10432 use std::iter::Iterator;
10433 self.containers = v.into_iter().map(|i| i.into()).collect();
10434 self
10435 }
10436 }
10437
10438 impl wkt::message::Message for Pod {
10439 fn typename() -> &'static str {
10440 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.Pod"
10441 }
10442 }
10443
10444 /// Kubernetes nodes associated with the finding.
10445 #[derive(Clone, Default, PartialEq)]
10446 #[non_exhaustive]
10447 pub struct Node {
10448 /// [Full resource name](https://google.aip.dev/122#full-resource-names) of
10449 /// the Compute Engine VM running the cluster node.
10450 pub name: std::string::String,
10451
10452 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10453 }
10454
10455 impl Node {
10456 pub fn new() -> Self {
10457 std::default::Default::default()
10458 }
10459
10460 /// Sets the value of [name][crate::model::kubernetes::Node::name].
10461 ///
10462 /// # Example
10463 /// ```ignore,no_run
10464 /// # use google_cloud_securitycenter_v2::model::kubernetes::Node;
10465 /// let x = Node::new().set_name("example");
10466 /// ```
10467 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10468 self.name = v.into();
10469 self
10470 }
10471 }
10472
10473 impl wkt::message::Message for Node {
10474 fn typename() -> &'static str {
10475 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.Node"
10476 }
10477 }
10478
10479 /// Provides GKE node pool information.
10480 #[derive(Clone, Default, PartialEq)]
10481 #[non_exhaustive]
10482 pub struct NodePool {
10483 /// Kubernetes node pool name.
10484 pub name: std::string::String,
10485
10486 /// Nodes associated with the finding.
10487 pub nodes: std::vec::Vec<crate::model::kubernetes::Node>,
10488
10489 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10490 }
10491
10492 impl NodePool {
10493 pub fn new() -> Self {
10494 std::default::Default::default()
10495 }
10496
10497 /// Sets the value of [name][crate::model::kubernetes::NodePool::name].
10498 ///
10499 /// # Example
10500 /// ```ignore,no_run
10501 /// # use google_cloud_securitycenter_v2::model::kubernetes::NodePool;
10502 /// let x = NodePool::new().set_name("example");
10503 /// ```
10504 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10505 self.name = v.into();
10506 self
10507 }
10508
10509 /// Sets the value of [nodes][crate::model::kubernetes::NodePool::nodes].
10510 ///
10511 /// # Example
10512 /// ```ignore,no_run
10513 /// # use google_cloud_securitycenter_v2::model::kubernetes::NodePool;
10514 /// use google_cloud_securitycenter_v2::model::kubernetes::Node;
10515 /// let x = NodePool::new()
10516 /// .set_nodes([
10517 /// Node::default()/* use setters */,
10518 /// Node::default()/* use (different) setters */,
10519 /// ]);
10520 /// ```
10521 pub fn set_nodes<T, V>(mut self, v: T) -> Self
10522 where
10523 T: std::iter::IntoIterator<Item = V>,
10524 V: std::convert::Into<crate::model::kubernetes::Node>,
10525 {
10526 use std::iter::Iterator;
10527 self.nodes = v.into_iter().map(|i| i.into()).collect();
10528 self
10529 }
10530 }
10531
10532 impl wkt::message::Message for NodePool {
10533 fn typename() -> &'static str {
10534 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.NodePool"
10535 }
10536 }
10537
10538 /// Kubernetes Role or ClusterRole.
10539 #[derive(Clone, Default, PartialEq)]
10540 #[non_exhaustive]
10541 pub struct Role {
10542 /// Role type.
10543 pub kind: crate::model::kubernetes::role::Kind,
10544
10545 /// Role namespace.
10546 pub ns: std::string::String,
10547
10548 /// Role name.
10549 pub name: std::string::String,
10550
10551 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10552 }
10553
10554 impl Role {
10555 pub fn new() -> Self {
10556 std::default::Default::default()
10557 }
10558
10559 /// Sets the value of [kind][crate::model::kubernetes::Role::kind].
10560 ///
10561 /// # Example
10562 /// ```ignore,no_run
10563 /// # use google_cloud_securitycenter_v2::model::kubernetes::Role;
10564 /// use google_cloud_securitycenter_v2::model::kubernetes::role::Kind;
10565 /// let x0 = Role::new().set_kind(Kind::Role);
10566 /// let x1 = Role::new().set_kind(Kind::ClusterRole);
10567 /// ```
10568 pub fn set_kind<T: std::convert::Into<crate::model::kubernetes::role::Kind>>(
10569 mut self,
10570 v: T,
10571 ) -> Self {
10572 self.kind = v.into();
10573 self
10574 }
10575
10576 /// Sets the value of [ns][crate::model::kubernetes::Role::ns].
10577 ///
10578 /// # Example
10579 /// ```ignore,no_run
10580 /// # use google_cloud_securitycenter_v2::model::kubernetes::Role;
10581 /// let x = Role::new().set_ns("example");
10582 /// ```
10583 pub fn set_ns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10584 self.ns = v.into();
10585 self
10586 }
10587
10588 /// Sets the value of [name][crate::model::kubernetes::Role::name].
10589 ///
10590 /// # Example
10591 /// ```ignore,no_run
10592 /// # use google_cloud_securitycenter_v2::model::kubernetes::Role;
10593 /// let x = Role::new().set_name("example");
10594 /// ```
10595 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10596 self.name = v.into();
10597 self
10598 }
10599 }
10600
10601 impl wkt::message::Message for Role {
10602 fn typename() -> &'static str {
10603 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.Role"
10604 }
10605 }
10606
10607 /// Defines additional types related to [Role].
10608 pub mod role {
10609 #[allow(unused_imports)]
10610 use super::*;
10611
10612 /// Types of Kubernetes roles.
10613 ///
10614 /// # Working with unknown values
10615 ///
10616 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10617 /// additional enum variants at any time. Adding new variants is not considered
10618 /// a breaking change. Applications should write their code in anticipation of:
10619 ///
10620 /// - New values appearing in future releases of the client library, **and**
10621 /// - New values received dynamically, without application changes.
10622 ///
10623 /// Please consult the [Working with enums] section in the user guide for some
10624 /// guidelines.
10625 ///
10626 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10627 #[derive(Clone, Debug, PartialEq)]
10628 #[non_exhaustive]
10629 pub enum Kind {
10630 /// Role type is not specified.
10631 Unspecified,
10632 /// Kubernetes Role.
10633 Role,
10634 /// Kubernetes ClusterRole.
10635 ClusterRole,
10636 /// If set, the enum was initialized with an unknown value.
10637 ///
10638 /// Applications can examine the value using [Kind::value] or
10639 /// [Kind::name].
10640 UnknownValue(kind::UnknownValue),
10641 }
10642
10643 #[doc(hidden)]
10644 pub mod kind {
10645 #[allow(unused_imports)]
10646 use super::*;
10647 #[derive(Clone, Debug, PartialEq)]
10648 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10649 }
10650
10651 impl Kind {
10652 /// Gets the enum value.
10653 ///
10654 /// Returns `None` if the enum contains an unknown value deserialized from
10655 /// the string representation of enums.
10656 pub fn value(&self) -> std::option::Option<i32> {
10657 match self {
10658 Self::Unspecified => std::option::Option::Some(0),
10659 Self::Role => std::option::Option::Some(1),
10660 Self::ClusterRole => std::option::Option::Some(2),
10661 Self::UnknownValue(u) => u.0.value(),
10662 }
10663 }
10664
10665 /// Gets the enum value as a string.
10666 ///
10667 /// Returns `None` if the enum contains an unknown value deserialized from
10668 /// the integer representation of enums.
10669 pub fn name(&self) -> std::option::Option<&str> {
10670 match self {
10671 Self::Unspecified => std::option::Option::Some("KIND_UNSPECIFIED"),
10672 Self::Role => std::option::Option::Some("ROLE"),
10673 Self::ClusterRole => std::option::Option::Some("CLUSTER_ROLE"),
10674 Self::UnknownValue(u) => u.0.name(),
10675 }
10676 }
10677 }
10678
10679 impl std::default::Default for Kind {
10680 fn default() -> Self {
10681 use std::convert::From;
10682 Self::from(0)
10683 }
10684 }
10685
10686 impl std::fmt::Display for Kind {
10687 fn fmt(
10688 &self,
10689 f: &mut std::fmt::Formatter<'_>,
10690 ) -> std::result::Result<(), std::fmt::Error> {
10691 wkt::internal::display_enum(f, self.name(), self.value())
10692 }
10693 }
10694
10695 impl std::convert::From<i32> for Kind {
10696 fn from(value: i32) -> Self {
10697 match value {
10698 0 => Self::Unspecified,
10699 1 => Self::Role,
10700 2 => Self::ClusterRole,
10701 _ => Self::UnknownValue(kind::UnknownValue(
10702 wkt::internal::UnknownEnumValue::Integer(value),
10703 )),
10704 }
10705 }
10706 }
10707
10708 impl std::convert::From<&str> for Kind {
10709 fn from(value: &str) -> Self {
10710 use std::string::ToString;
10711 match value {
10712 "KIND_UNSPECIFIED" => Self::Unspecified,
10713 "ROLE" => Self::Role,
10714 "CLUSTER_ROLE" => Self::ClusterRole,
10715 _ => Self::UnknownValue(kind::UnknownValue(
10716 wkt::internal::UnknownEnumValue::String(value.to_string()),
10717 )),
10718 }
10719 }
10720 }
10721
10722 impl serde::ser::Serialize for Kind {
10723 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10724 where
10725 S: serde::Serializer,
10726 {
10727 match self {
10728 Self::Unspecified => serializer.serialize_i32(0),
10729 Self::Role => serializer.serialize_i32(1),
10730 Self::ClusterRole => serializer.serialize_i32(2),
10731 Self::UnknownValue(u) => u.0.serialize(serializer),
10732 }
10733 }
10734 }
10735
10736 impl<'de> serde::de::Deserialize<'de> for Kind {
10737 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10738 where
10739 D: serde::Deserializer<'de>,
10740 {
10741 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Kind>::new(
10742 ".google.cloud.securitycenter.v2.Kubernetes.Role.Kind",
10743 ))
10744 }
10745 }
10746 }
10747
10748 /// Represents a Kubernetes RoleBinding or ClusterRoleBinding.
10749 #[derive(Clone, Default, PartialEq)]
10750 #[non_exhaustive]
10751 pub struct Binding {
10752 /// Namespace for the binding.
10753 pub ns: std::string::String,
10754
10755 /// Name for the binding.
10756 pub name: std::string::String,
10757
10758 /// The Role or ClusterRole referenced by the binding.
10759 pub role: std::option::Option<crate::model::kubernetes::Role>,
10760
10761 /// Represents one or more subjects that are bound to the role. Not always
10762 /// available for PATCH requests.
10763 pub subjects: std::vec::Vec<crate::model::kubernetes::Subject>,
10764
10765 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10766 }
10767
10768 impl Binding {
10769 pub fn new() -> Self {
10770 std::default::Default::default()
10771 }
10772
10773 /// Sets the value of [ns][crate::model::kubernetes::Binding::ns].
10774 ///
10775 /// # Example
10776 /// ```ignore,no_run
10777 /// # use google_cloud_securitycenter_v2::model::kubernetes::Binding;
10778 /// let x = Binding::new().set_ns("example");
10779 /// ```
10780 pub fn set_ns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10781 self.ns = v.into();
10782 self
10783 }
10784
10785 /// Sets the value of [name][crate::model::kubernetes::Binding::name].
10786 ///
10787 /// # Example
10788 /// ```ignore,no_run
10789 /// # use google_cloud_securitycenter_v2::model::kubernetes::Binding;
10790 /// let x = Binding::new().set_name("example");
10791 /// ```
10792 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10793 self.name = v.into();
10794 self
10795 }
10796
10797 /// Sets the value of [role][crate::model::kubernetes::Binding::role].
10798 ///
10799 /// # Example
10800 /// ```ignore,no_run
10801 /// # use google_cloud_securitycenter_v2::model::kubernetes::Binding;
10802 /// use google_cloud_securitycenter_v2::model::kubernetes::Role;
10803 /// let x = Binding::new().set_role(Role::default()/* use setters */);
10804 /// ```
10805 pub fn set_role<T>(mut self, v: T) -> Self
10806 where
10807 T: std::convert::Into<crate::model::kubernetes::Role>,
10808 {
10809 self.role = std::option::Option::Some(v.into());
10810 self
10811 }
10812
10813 /// Sets or clears the value of [role][crate::model::kubernetes::Binding::role].
10814 ///
10815 /// # Example
10816 /// ```ignore,no_run
10817 /// # use google_cloud_securitycenter_v2::model::kubernetes::Binding;
10818 /// use google_cloud_securitycenter_v2::model::kubernetes::Role;
10819 /// let x = Binding::new().set_or_clear_role(Some(Role::default()/* use setters */));
10820 /// let x = Binding::new().set_or_clear_role(None::<Role>);
10821 /// ```
10822 pub fn set_or_clear_role<T>(mut self, v: std::option::Option<T>) -> Self
10823 where
10824 T: std::convert::Into<crate::model::kubernetes::Role>,
10825 {
10826 self.role = v.map(|x| x.into());
10827 self
10828 }
10829
10830 /// Sets the value of [subjects][crate::model::kubernetes::Binding::subjects].
10831 ///
10832 /// # Example
10833 /// ```ignore,no_run
10834 /// # use google_cloud_securitycenter_v2::model::kubernetes::Binding;
10835 /// use google_cloud_securitycenter_v2::model::kubernetes::Subject;
10836 /// let x = Binding::new()
10837 /// .set_subjects([
10838 /// Subject::default()/* use setters */,
10839 /// Subject::default()/* use (different) setters */,
10840 /// ]);
10841 /// ```
10842 pub fn set_subjects<T, V>(mut self, v: T) -> Self
10843 where
10844 T: std::iter::IntoIterator<Item = V>,
10845 V: std::convert::Into<crate::model::kubernetes::Subject>,
10846 {
10847 use std::iter::Iterator;
10848 self.subjects = v.into_iter().map(|i| i.into()).collect();
10849 self
10850 }
10851 }
10852
10853 impl wkt::message::Message for Binding {
10854 fn typename() -> &'static str {
10855 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.Binding"
10856 }
10857 }
10858
10859 /// Represents a Kubernetes subject.
10860 #[derive(Clone, Default, PartialEq)]
10861 #[non_exhaustive]
10862 pub struct Subject {
10863 /// Authentication type for the subject.
10864 pub kind: crate::model::kubernetes::subject::AuthType,
10865
10866 /// Namespace for the subject.
10867 pub ns: std::string::String,
10868
10869 /// Name for the subject.
10870 pub name: std::string::String,
10871
10872 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10873 }
10874
10875 impl Subject {
10876 pub fn new() -> Self {
10877 std::default::Default::default()
10878 }
10879
10880 /// Sets the value of [kind][crate::model::kubernetes::Subject::kind].
10881 ///
10882 /// # Example
10883 /// ```ignore,no_run
10884 /// # use google_cloud_securitycenter_v2::model::kubernetes::Subject;
10885 /// use google_cloud_securitycenter_v2::model::kubernetes::subject::AuthType;
10886 /// let x0 = Subject::new().set_kind(AuthType::User);
10887 /// let x1 = Subject::new().set_kind(AuthType::Serviceaccount);
10888 /// let x2 = Subject::new().set_kind(AuthType::Group);
10889 /// ```
10890 pub fn set_kind<T: std::convert::Into<crate::model::kubernetes::subject::AuthType>>(
10891 mut self,
10892 v: T,
10893 ) -> Self {
10894 self.kind = v.into();
10895 self
10896 }
10897
10898 /// Sets the value of [ns][crate::model::kubernetes::Subject::ns].
10899 ///
10900 /// # Example
10901 /// ```ignore,no_run
10902 /// # use google_cloud_securitycenter_v2::model::kubernetes::Subject;
10903 /// let x = Subject::new().set_ns("example");
10904 /// ```
10905 pub fn set_ns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10906 self.ns = v.into();
10907 self
10908 }
10909
10910 /// Sets the value of [name][crate::model::kubernetes::Subject::name].
10911 ///
10912 /// # Example
10913 /// ```ignore,no_run
10914 /// # use google_cloud_securitycenter_v2::model::kubernetes::Subject;
10915 /// let x = Subject::new().set_name("example");
10916 /// ```
10917 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10918 self.name = v.into();
10919 self
10920 }
10921 }
10922
10923 impl wkt::message::Message for Subject {
10924 fn typename() -> &'static str {
10925 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.Subject"
10926 }
10927 }
10928
10929 /// Defines additional types related to [Subject].
10930 pub mod subject {
10931 #[allow(unused_imports)]
10932 use super::*;
10933
10934 /// Auth types that can be used for the subject's kind field.
10935 ///
10936 /// # Working with unknown values
10937 ///
10938 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10939 /// additional enum variants at any time. Adding new variants is not considered
10940 /// a breaking change. Applications should write their code in anticipation of:
10941 ///
10942 /// - New values appearing in future releases of the client library, **and**
10943 /// - New values received dynamically, without application changes.
10944 ///
10945 /// Please consult the [Working with enums] section in the user guide for some
10946 /// guidelines.
10947 ///
10948 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10949 #[derive(Clone, Debug, PartialEq)]
10950 #[non_exhaustive]
10951 pub enum AuthType {
10952 /// Authentication is not specified.
10953 Unspecified,
10954 /// User with valid certificate.
10955 User,
10956 /// Users managed by Kubernetes API with credentials stored as secrets.
10957 Serviceaccount,
10958 /// Collection of users.
10959 Group,
10960 /// If set, the enum was initialized with an unknown value.
10961 ///
10962 /// Applications can examine the value using [AuthType::value] or
10963 /// [AuthType::name].
10964 UnknownValue(auth_type::UnknownValue),
10965 }
10966
10967 #[doc(hidden)]
10968 pub mod auth_type {
10969 #[allow(unused_imports)]
10970 use super::*;
10971 #[derive(Clone, Debug, PartialEq)]
10972 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10973 }
10974
10975 impl AuthType {
10976 /// Gets the enum value.
10977 ///
10978 /// Returns `None` if the enum contains an unknown value deserialized from
10979 /// the string representation of enums.
10980 pub fn value(&self) -> std::option::Option<i32> {
10981 match self {
10982 Self::Unspecified => std::option::Option::Some(0),
10983 Self::User => std::option::Option::Some(1),
10984 Self::Serviceaccount => std::option::Option::Some(2),
10985 Self::Group => std::option::Option::Some(3),
10986 Self::UnknownValue(u) => u.0.value(),
10987 }
10988 }
10989
10990 /// Gets the enum value as a string.
10991 ///
10992 /// Returns `None` if the enum contains an unknown value deserialized from
10993 /// the integer representation of enums.
10994 pub fn name(&self) -> std::option::Option<&str> {
10995 match self {
10996 Self::Unspecified => std::option::Option::Some("AUTH_TYPE_UNSPECIFIED"),
10997 Self::User => std::option::Option::Some("USER"),
10998 Self::Serviceaccount => std::option::Option::Some("SERVICEACCOUNT"),
10999 Self::Group => std::option::Option::Some("GROUP"),
11000 Self::UnknownValue(u) => u.0.name(),
11001 }
11002 }
11003 }
11004
11005 impl std::default::Default for AuthType {
11006 fn default() -> Self {
11007 use std::convert::From;
11008 Self::from(0)
11009 }
11010 }
11011
11012 impl std::fmt::Display for AuthType {
11013 fn fmt(
11014 &self,
11015 f: &mut std::fmt::Formatter<'_>,
11016 ) -> std::result::Result<(), std::fmt::Error> {
11017 wkt::internal::display_enum(f, self.name(), self.value())
11018 }
11019 }
11020
11021 impl std::convert::From<i32> for AuthType {
11022 fn from(value: i32) -> Self {
11023 match value {
11024 0 => Self::Unspecified,
11025 1 => Self::User,
11026 2 => Self::Serviceaccount,
11027 3 => Self::Group,
11028 _ => Self::UnknownValue(auth_type::UnknownValue(
11029 wkt::internal::UnknownEnumValue::Integer(value),
11030 )),
11031 }
11032 }
11033 }
11034
11035 impl std::convert::From<&str> for AuthType {
11036 fn from(value: &str) -> Self {
11037 use std::string::ToString;
11038 match value {
11039 "AUTH_TYPE_UNSPECIFIED" => Self::Unspecified,
11040 "USER" => Self::User,
11041 "SERVICEACCOUNT" => Self::Serviceaccount,
11042 "GROUP" => Self::Group,
11043 _ => Self::UnknownValue(auth_type::UnknownValue(
11044 wkt::internal::UnknownEnumValue::String(value.to_string()),
11045 )),
11046 }
11047 }
11048 }
11049
11050 impl serde::ser::Serialize for AuthType {
11051 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11052 where
11053 S: serde::Serializer,
11054 {
11055 match self {
11056 Self::Unspecified => serializer.serialize_i32(0),
11057 Self::User => serializer.serialize_i32(1),
11058 Self::Serviceaccount => serializer.serialize_i32(2),
11059 Self::Group => serializer.serialize_i32(3),
11060 Self::UnknownValue(u) => u.0.serialize(serializer),
11061 }
11062 }
11063 }
11064
11065 impl<'de> serde::de::Deserialize<'de> for AuthType {
11066 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11067 where
11068 D: serde::Deserializer<'de>,
11069 {
11070 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AuthType>::new(
11071 ".google.cloud.securitycenter.v2.Kubernetes.Subject.AuthType",
11072 ))
11073 }
11074 }
11075 }
11076
11077 /// Conveys information about a Kubernetes access review (such as one returned
11078 /// by a [`kubectl auth
11079 /// can-i`](https://kubernetes.io/docs/reference/access-authn-authz/authorization/#checking-api-access)
11080 /// command) that was involved in a finding.
11081 #[derive(Clone, Default, PartialEq)]
11082 #[non_exhaustive]
11083 pub struct AccessReview {
11084 /// The API group of the resource. "*" means all.
11085 pub group: std::string::String,
11086
11087 /// Namespace of the action being requested. Currently, there is no
11088 /// distinction between no namespace and all namespaces. Both
11089 /// are represented by "" (empty).
11090 pub ns: std::string::String,
11091
11092 /// The name of the resource being requested. Empty means all.
11093 pub name: std::string::String,
11094
11095 /// The optional resource type requested. "*" means all.
11096 pub resource: std::string::String,
11097
11098 /// The optional subresource type.
11099 pub subresource: std::string::String,
11100
11101 /// A Kubernetes resource API verb, like get, list, watch, create, update,
11102 /// delete, proxy. "*" means all.
11103 pub verb: std::string::String,
11104
11105 /// The API version of the resource. "*" means all.
11106 pub version: std::string::String,
11107
11108 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11109 }
11110
11111 impl AccessReview {
11112 pub fn new() -> Self {
11113 std::default::Default::default()
11114 }
11115
11116 /// Sets the value of [group][crate::model::kubernetes::AccessReview::group].
11117 ///
11118 /// # Example
11119 /// ```ignore,no_run
11120 /// # use google_cloud_securitycenter_v2::model::kubernetes::AccessReview;
11121 /// let x = AccessReview::new().set_group("example");
11122 /// ```
11123 pub fn set_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11124 self.group = v.into();
11125 self
11126 }
11127
11128 /// Sets the value of [ns][crate::model::kubernetes::AccessReview::ns].
11129 ///
11130 /// # Example
11131 /// ```ignore,no_run
11132 /// # use google_cloud_securitycenter_v2::model::kubernetes::AccessReview;
11133 /// let x = AccessReview::new().set_ns("example");
11134 /// ```
11135 pub fn set_ns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11136 self.ns = v.into();
11137 self
11138 }
11139
11140 /// Sets the value of [name][crate::model::kubernetes::AccessReview::name].
11141 ///
11142 /// # Example
11143 /// ```ignore,no_run
11144 /// # use google_cloud_securitycenter_v2::model::kubernetes::AccessReview;
11145 /// let x = AccessReview::new().set_name("example");
11146 /// ```
11147 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11148 self.name = v.into();
11149 self
11150 }
11151
11152 /// Sets the value of [resource][crate::model::kubernetes::AccessReview::resource].
11153 ///
11154 /// # Example
11155 /// ```ignore,no_run
11156 /// # use google_cloud_securitycenter_v2::model::kubernetes::AccessReview;
11157 /// let x = AccessReview::new().set_resource("example");
11158 /// ```
11159 pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11160 self.resource = v.into();
11161 self
11162 }
11163
11164 /// Sets the value of [subresource][crate::model::kubernetes::AccessReview::subresource].
11165 ///
11166 /// # Example
11167 /// ```ignore,no_run
11168 /// # use google_cloud_securitycenter_v2::model::kubernetes::AccessReview;
11169 /// let x = AccessReview::new().set_subresource("example");
11170 /// ```
11171 pub fn set_subresource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11172 self.subresource = v.into();
11173 self
11174 }
11175
11176 /// Sets the value of [verb][crate::model::kubernetes::AccessReview::verb].
11177 ///
11178 /// # Example
11179 /// ```ignore,no_run
11180 /// # use google_cloud_securitycenter_v2::model::kubernetes::AccessReview;
11181 /// let x = AccessReview::new().set_verb("example");
11182 /// ```
11183 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11184 self.verb = v.into();
11185 self
11186 }
11187
11188 /// Sets the value of [version][crate::model::kubernetes::AccessReview::version].
11189 ///
11190 /// # Example
11191 /// ```ignore,no_run
11192 /// # use google_cloud_securitycenter_v2::model::kubernetes::AccessReview;
11193 /// let x = AccessReview::new().set_version("example");
11194 /// ```
11195 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11196 self.version = v.into();
11197 self
11198 }
11199 }
11200
11201 impl wkt::message::Message for AccessReview {
11202 fn typename() -> &'static str {
11203 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.AccessReview"
11204 }
11205 }
11206
11207 /// Kubernetes object related to the finding, uniquely identified by GKNN.
11208 /// Used if the object Kind is not one of Pod, Node, NodePool, Binding, or
11209 /// AccessReview.
11210 #[derive(Clone, Default, PartialEq)]
11211 #[non_exhaustive]
11212 pub struct Object {
11213 /// Kubernetes object group, such as "policy.k8s.io/v1".
11214 pub group: std::string::String,
11215
11216 /// Kubernetes object kind, such as "Namespace".
11217 pub kind: std::string::String,
11218
11219 /// Kubernetes object namespace. Must be a valid DNS label. Named
11220 /// "ns" to avoid collision with C++ namespace keyword. For details see
11221 /// <https://kubernetes.io/docs/tasks/administer-cluster/namespaces/>.
11222 pub ns: std::string::String,
11223
11224 /// Kubernetes object name. For details see
11225 /// <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/>.
11226 pub name: std::string::String,
11227
11228 /// Pod containers associated with this finding, if any.
11229 pub containers: std::vec::Vec<crate::model::Container>,
11230
11231 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11232 }
11233
11234 impl Object {
11235 pub fn new() -> Self {
11236 std::default::Default::default()
11237 }
11238
11239 /// Sets the value of [group][crate::model::kubernetes::Object::group].
11240 ///
11241 /// # Example
11242 /// ```ignore,no_run
11243 /// # use google_cloud_securitycenter_v2::model::kubernetes::Object;
11244 /// let x = Object::new().set_group("example");
11245 /// ```
11246 pub fn set_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11247 self.group = v.into();
11248 self
11249 }
11250
11251 /// Sets the value of [kind][crate::model::kubernetes::Object::kind].
11252 ///
11253 /// # Example
11254 /// ```ignore,no_run
11255 /// # use google_cloud_securitycenter_v2::model::kubernetes::Object;
11256 /// let x = Object::new().set_kind("example");
11257 /// ```
11258 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11259 self.kind = v.into();
11260 self
11261 }
11262
11263 /// Sets the value of [ns][crate::model::kubernetes::Object::ns].
11264 ///
11265 /// # Example
11266 /// ```ignore,no_run
11267 /// # use google_cloud_securitycenter_v2::model::kubernetes::Object;
11268 /// let x = Object::new().set_ns("example");
11269 /// ```
11270 pub fn set_ns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11271 self.ns = v.into();
11272 self
11273 }
11274
11275 /// Sets the value of [name][crate::model::kubernetes::Object::name].
11276 ///
11277 /// # Example
11278 /// ```ignore,no_run
11279 /// # use google_cloud_securitycenter_v2::model::kubernetes::Object;
11280 /// let x = Object::new().set_name("example");
11281 /// ```
11282 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11283 self.name = v.into();
11284 self
11285 }
11286
11287 /// Sets the value of [containers][crate::model::kubernetes::Object::containers].
11288 ///
11289 /// # Example
11290 /// ```ignore,no_run
11291 /// # use google_cloud_securitycenter_v2::model::kubernetes::Object;
11292 /// use google_cloud_securitycenter_v2::model::Container;
11293 /// let x = Object::new()
11294 /// .set_containers([
11295 /// Container::default()/* use setters */,
11296 /// Container::default()/* use (different) setters */,
11297 /// ]);
11298 /// ```
11299 pub fn set_containers<T, V>(mut self, v: T) -> Self
11300 where
11301 T: std::iter::IntoIterator<Item = V>,
11302 V: std::convert::Into<crate::model::Container>,
11303 {
11304 use std::iter::Iterator;
11305 self.containers = v.into_iter().map(|i| i.into()).collect();
11306 self
11307 }
11308 }
11309
11310 impl wkt::message::Message for Object {
11311 fn typename() -> &'static str {
11312 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.Object"
11313 }
11314 }
11315}
11316
11317/// Represents a generic name-value label. A label has separate name and value
11318/// fields to support filtering with the `contains()` function. For more
11319/// information, see [Filtering on array-type
11320/// fields](https://cloud.google.com/security-command-center/docs/how-to-api-list-findings#array-contains-filtering).
11321#[derive(Clone, Default, PartialEq)]
11322#[non_exhaustive]
11323pub struct Label {
11324 /// Name of the label.
11325 pub name: std::string::String,
11326
11327 /// Value that corresponds to the label's name.
11328 pub value: std::string::String,
11329
11330 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11331}
11332
11333impl Label {
11334 pub fn new() -> Self {
11335 std::default::Default::default()
11336 }
11337
11338 /// Sets the value of [name][crate::model::Label::name].
11339 ///
11340 /// # Example
11341 /// ```ignore,no_run
11342 /// # use google_cloud_securitycenter_v2::model::Label;
11343 /// let x = Label::new().set_name("example");
11344 /// ```
11345 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11346 self.name = v.into();
11347 self
11348 }
11349
11350 /// Sets the value of [value][crate::model::Label::value].
11351 ///
11352 /// # Example
11353 /// ```ignore,no_run
11354 /// # use google_cloud_securitycenter_v2::model::Label;
11355 /// let x = Label::new().set_value("example");
11356 /// ```
11357 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11358 self.value = v.into();
11359 self
11360 }
11361}
11362
11363impl wkt::message::Message for Label {
11364 fn typename() -> &'static str {
11365 "type.googleapis.com/google.cloud.securitycenter.v2.Label"
11366 }
11367}
11368
11369/// Contains information related to the load balancer associated with the
11370/// finding.
11371#[derive(Clone, Default, PartialEq)]
11372#[non_exhaustive]
11373pub struct LoadBalancer {
11374 /// The name of the load balancer associated with the finding.
11375 pub name: std::string::String,
11376
11377 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11378}
11379
11380impl LoadBalancer {
11381 pub fn new() -> Self {
11382 std::default::Default::default()
11383 }
11384
11385 /// Sets the value of [name][crate::model::LoadBalancer::name].
11386 ///
11387 /// # Example
11388 /// ```ignore,no_run
11389 /// # use google_cloud_securitycenter_v2::model::LoadBalancer;
11390 /// let x = LoadBalancer::new().set_name("example");
11391 /// ```
11392 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11393 self.name = v.into();
11394 self
11395 }
11396}
11397
11398impl wkt::message::Message for LoadBalancer {
11399 fn typename() -> &'static str {
11400 "type.googleapis.com/google.cloud.securitycenter.v2.LoadBalancer"
11401 }
11402}
11403
11404/// An individual entry in a log.
11405#[derive(Clone, Default, PartialEq)]
11406#[non_exhaustive]
11407pub struct LogEntry {
11408 /// The log entry.
11409 pub log_entry: std::option::Option<crate::model::log_entry::LogEntry>,
11410
11411 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11412}
11413
11414impl LogEntry {
11415 pub fn new() -> Self {
11416 std::default::Default::default()
11417 }
11418
11419 /// Sets the value of [log_entry][crate::model::LogEntry::log_entry].
11420 ///
11421 /// Note that all the setters affecting `log_entry` are mutually
11422 /// exclusive.
11423 ///
11424 /// # Example
11425 /// ```ignore,no_run
11426 /// # use google_cloud_securitycenter_v2::model::LogEntry;
11427 /// use google_cloud_securitycenter_v2::model::CloudLoggingEntry;
11428 /// let x = LogEntry::new().set_log_entry(Some(
11429 /// google_cloud_securitycenter_v2::model::log_entry::LogEntry::CloudLoggingEntry(CloudLoggingEntry::default().into())));
11430 /// ```
11431 pub fn set_log_entry<
11432 T: std::convert::Into<std::option::Option<crate::model::log_entry::LogEntry>>,
11433 >(
11434 mut self,
11435 v: T,
11436 ) -> Self {
11437 self.log_entry = v.into();
11438 self
11439 }
11440
11441 /// The value of [log_entry][crate::model::LogEntry::log_entry]
11442 /// if it holds a `CloudLoggingEntry`, `None` if the field is not set or
11443 /// holds a different branch.
11444 pub fn cloud_logging_entry(
11445 &self,
11446 ) -> std::option::Option<&std::boxed::Box<crate::model::CloudLoggingEntry>> {
11447 #[allow(unreachable_patterns)]
11448 self.log_entry.as_ref().and_then(|v| match v {
11449 crate::model::log_entry::LogEntry::CloudLoggingEntry(v) => std::option::Option::Some(v),
11450 _ => std::option::Option::None,
11451 })
11452 }
11453
11454 /// Sets the value of [log_entry][crate::model::LogEntry::log_entry]
11455 /// to hold a `CloudLoggingEntry`.
11456 ///
11457 /// Note that all the setters affecting `log_entry` are
11458 /// mutually exclusive.
11459 ///
11460 /// # Example
11461 /// ```ignore,no_run
11462 /// # use google_cloud_securitycenter_v2::model::LogEntry;
11463 /// use google_cloud_securitycenter_v2::model::CloudLoggingEntry;
11464 /// let x = LogEntry::new().set_cloud_logging_entry(CloudLoggingEntry::default()/* use setters */);
11465 /// assert!(x.cloud_logging_entry().is_some());
11466 /// ```
11467 pub fn set_cloud_logging_entry<
11468 T: std::convert::Into<std::boxed::Box<crate::model::CloudLoggingEntry>>,
11469 >(
11470 mut self,
11471 v: T,
11472 ) -> Self {
11473 self.log_entry = std::option::Option::Some(
11474 crate::model::log_entry::LogEntry::CloudLoggingEntry(v.into()),
11475 );
11476 self
11477 }
11478}
11479
11480impl wkt::message::Message for LogEntry {
11481 fn typename() -> &'static str {
11482 "type.googleapis.com/google.cloud.securitycenter.v2.LogEntry"
11483 }
11484}
11485
11486/// Defines additional types related to [LogEntry].
11487pub mod log_entry {
11488 #[allow(unused_imports)]
11489 use super::*;
11490
11491 /// The log entry.
11492 #[derive(Clone, Debug, PartialEq)]
11493 #[non_exhaustive]
11494 pub enum LogEntry {
11495 /// An individual entry in a log stored in Cloud Logging.
11496 CloudLoggingEntry(std::boxed::Box<crate::model::CloudLoggingEntry>),
11497 }
11498}
11499
11500/// Metadata taken from a [Cloud Logging
11501/// LogEntry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry)
11502#[derive(Clone, Default, PartialEq)]
11503#[non_exhaustive]
11504pub struct CloudLoggingEntry {
11505 /// A unique identifier for the log entry.
11506 pub insert_id: std::string::String,
11507
11508 /// The type of the log (part of `log_name`. `log_name` is the resource name of
11509 /// the log to which this log entry belongs). For example:
11510 /// `cloudresourcemanager.googleapis.com/activity` Note that this field is not
11511 /// URL-encoded, unlike in `LogEntry`.
11512 pub log_id: std::string::String,
11513
11514 /// The organization, folder, or project of the monitored resource that
11515 /// produced this log entry.
11516 pub resource_container: std::string::String,
11517
11518 /// The time the event described by the log entry occurred.
11519 pub timestamp: std::option::Option<wkt::Timestamp>,
11520
11521 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11522}
11523
11524impl CloudLoggingEntry {
11525 pub fn new() -> Self {
11526 std::default::Default::default()
11527 }
11528
11529 /// Sets the value of [insert_id][crate::model::CloudLoggingEntry::insert_id].
11530 ///
11531 /// # Example
11532 /// ```ignore,no_run
11533 /// # use google_cloud_securitycenter_v2::model::CloudLoggingEntry;
11534 /// let x = CloudLoggingEntry::new().set_insert_id("example");
11535 /// ```
11536 pub fn set_insert_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11537 self.insert_id = v.into();
11538 self
11539 }
11540
11541 /// Sets the value of [log_id][crate::model::CloudLoggingEntry::log_id].
11542 ///
11543 /// # Example
11544 /// ```ignore,no_run
11545 /// # use google_cloud_securitycenter_v2::model::CloudLoggingEntry;
11546 /// let x = CloudLoggingEntry::new().set_log_id("example");
11547 /// ```
11548 pub fn set_log_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11549 self.log_id = v.into();
11550 self
11551 }
11552
11553 /// Sets the value of [resource_container][crate::model::CloudLoggingEntry::resource_container].
11554 ///
11555 /// # Example
11556 /// ```ignore,no_run
11557 /// # use google_cloud_securitycenter_v2::model::CloudLoggingEntry;
11558 /// let x = CloudLoggingEntry::new().set_resource_container("example");
11559 /// ```
11560 pub fn set_resource_container<T: std::convert::Into<std::string::String>>(
11561 mut self,
11562 v: T,
11563 ) -> Self {
11564 self.resource_container = v.into();
11565 self
11566 }
11567
11568 /// Sets the value of [timestamp][crate::model::CloudLoggingEntry::timestamp].
11569 ///
11570 /// # Example
11571 /// ```ignore,no_run
11572 /// # use google_cloud_securitycenter_v2::model::CloudLoggingEntry;
11573 /// use wkt::Timestamp;
11574 /// let x = CloudLoggingEntry::new().set_timestamp(Timestamp::default()/* use setters */);
11575 /// ```
11576 pub fn set_timestamp<T>(mut self, v: T) -> Self
11577 where
11578 T: std::convert::Into<wkt::Timestamp>,
11579 {
11580 self.timestamp = std::option::Option::Some(v.into());
11581 self
11582 }
11583
11584 /// Sets or clears the value of [timestamp][crate::model::CloudLoggingEntry::timestamp].
11585 ///
11586 /// # Example
11587 /// ```ignore,no_run
11588 /// # use google_cloud_securitycenter_v2::model::CloudLoggingEntry;
11589 /// use wkt::Timestamp;
11590 /// let x = CloudLoggingEntry::new().set_or_clear_timestamp(Some(Timestamp::default()/* use setters */));
11591 /// let x = CloudLoggingEntry::new().set_or_clear_timestamp(None::<Timestamp>);
11592 /// ```
11593 pub fn set_or_clear_timestamp<T>(mut self, v: std::option::Option<T>) -> Self
11594 where
11595 T: std::convert::Into<wkt::Timestamp>,
11596 {
11597 self.timestamp = v.map(|x| x.into());
11598 self
11599 }
11600}
11601
11602impl wkt::message::Message for CloudLoggingEntry {
11603 fn typename() -> &'static str {
11604 "type.googleapis.com/google.cloud.securitycenter.v2.CloudLoggingEntry"
11605 }
11606}
11607
11608/// MITRE ATT&CK tactics and techniques related to this finding.
11609/// See: <https://attack.mitre.org>
11610#[derive(Clone, Default, PartialEq)]
11611#[non_exhaustive]
11612pub struct MitreAttack {
11613 /// The MITRE ATT&CK tactic most closely represented by this finding, if any.
11614 pub primary_tactic: crate::model::mitre_attack::Tactic,
11615
11616 /// The MITRE ATT&CK technique most closely represented by this finding, if
11617 /// any. primary_techniques is a repeated field because there are multiple
11618 /// levels of MITRE ATT&CK techniques. If the technique most closely
11619 /// represented by this finding is a sub-technique (e.g. `SCANNING_IP_BLOCKS`),
11620 /// both the sub-technique and its parent technique(s) will be listed (e.g.
11621 /// `SCANNING_IP_BLOCKS`, `ACTIVE_SCANNING`).
11622 pub primary_techniques: std::vec::Vec<crate::model::mitre_attack::Technique>,
11623
11624 /// Additional MITRE ATT&CK tactics related to this finding, if any.
11625 pub additional_tactics: std::vec::Vec<crate::model::mitre_attack::Tactic>,
11626
11627 /// Additional MITRE ATT&CK techniques related to this finding, if any, along
11628 /// with any of their respective parent techniques.
11629 pub additional_techniques: std::vec::Vec<crate::model::mitre_attack::Technique>,
11630
11631 /// The MITRE ATT&CK version referenced by the above fields. E.g. "8".
11632 pub version: std::string::String,
11633
11634 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11635}
11636
11637impl MitreAttack {
11638 pub fn new() -> Self {
11639 std::default::Default::default()
11640 }
11641
11642 /// Sets the value of [primary_tactic][crate::model::MitreAttack::primary_tactic].
11643 ///
11644 /// # Example
11645 /// ```ignore,no_run
11646 /// # use google_cloud_securitycenter_v2::model::MitreAttack;
11647 /// use google_cloud_securitycenter_v2::model::mitre_attack::Tactic;
11648 /// let x0 = MitreAttack::new().set_primary_tactic(Tactic::Reconnaissance);
11649 /// let x1 = MitreAttack::new().set_primary_tactic(Tactic::ResourceDevelopment);
11650 /// let x2 = MitreAttack::new().set_primary_tactic(Tactic::InitialAccess);
11651 /// ```
11652 pub fn set_primary_tactic<T: std::convert::Into<crate::model::mitre_attack::Tactic>>(
11653 mut self,
11654 v: T,
11655 ) -> Self {
11656 self.primary_tactic = v.into();
11657 self
11658 }
11659
11660 /// Sets the value of [primary_techniques][crate::model::MitreAttack::primary_techniques].
11661 ///
11662 /// # Example
11663 /// ```ignore,no_run
11664 /// # use google_cloud_securitycenter_v2::model::MitreAttack;
11665 /// use google_cloud_securitycenter_v2::model::mitre_attack::Technique;
11666 /// let x = MitreAttack::new().set_primary_techniques([
11667 /// Technique::DataObfuscation,
11668 /// Technique::DataObfuscationSteganography,
11669 /// Technique::OsCredentialDumping,
11670 /// ]);
11671 /// ```
11672 pub fn set_primary_techniques<T, V>(mut self, v: T) -> Self
11673 where
11674 T: std::iter::IntoIterator<Item = V>,
11675 V: std::convert::Into<crate::model::mitre_attack::Technique>,
11676 {
11677 use std::iter::Iterator;
11678 self.primary_techniques = v.into_iter().map(|i| i.into()).collect();
11679 self
11680 }
11681
11682 /// Sets the value of [additional_tactics][crate::model::MitreAttack::additional_tactics].
11683 ///
11684 /// # Example
11685 /// ```ignore,no_run
11686 /// # use google_cloud_securitycenter_v2::model::MitreAttack;
11687 /// use google_cloud_securitycenter_v2::model::mitre_attack::Tactic;
11688 /// let x = MitreAttack::new().set_additional_tactics([
11689 /// Tactic::Reconnaissance,
11690 /// Tactic::ResourceDevelopment,
11691 /// Tactic::InitialAccess,
11692 /// ]);
11693 /// ```
11694 pub fn set_additional_tactics<T, V>(mut self, v: T) -> Self
11695 where
11696 T: std::iter::IntoIterator<Item = V>,
11697 V: std::convert::Into<crate::model::mitre_attack::Tactic>,
11698 {
11699 use std::iter::Iterator;
11700 self.additional_tactics = v.into_iter().map(|i| i.into()).collect();
11701 self
11702 }
11703
11704 /// Sets the value of [additional_techniques][crate::model::MitreAttack::additional_techniques].
11705 ///
11706 /// # Example
11707 /// ```ignore,no_run
11708 /// # use google_cloud_securitycenter_v2::model::MitreAttack;
11709 /// use google_cloud_securitycenter_v2::model::mitre_attack::Technique;
11710 /// let x = MitreAttack::new().set_additional_techniques([
11711 /// Technique::DataObfuscation,
11712 /// Technique::DataObfuscationSteganography,
11713 /// Technique::OsCredentialDumping,
11714 /// ]);
11715 /// ```
11716 pub fn set_additional_techniques<T, V>(mut self, v: T) -> Self
11717 where
11718 T: std::iter::IntoIterator<Item = V>,
11719 V: std::convert::Into<crate::model::mitre_attack::Technique>,
11720 {
11721 use std::iter::Iterator;
11722 self.additional_techniques = v.into_iter().map(|i| i.into()).collect();
11723 self
11724 }
11725
11726 /// Sets the value of [version][crate::model::MitreAttack::version].
11727 ///
11728 /// # Example
11729 /// ```ignore,no_run
11730 /// # use google_cloud_securitycenter_v2::model::MitreAttack;
11731 /// let x = MitreAttack::new().set_version("example");
11732 /// ```
11733 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11734 self.version = v.into();
11735 self
11736 }
11737}
11738
11739impl wkt::message::Message for MitreAttack {
11740 fn typename() -> &'static str {
11741 "type.googleapis.com/google.cloud.securitycenter.v2.MitreAttack"
11742 }
11743}
11744
11745/// Defines additional types related to [MitreAttack].
11746pub mod mitre_attack {
11747 #[allow(unused_imports)]
11748 use super::*;
11749
11750 /// MITRE ATT&CK tactics that can be referenced by SCC findings.
11751 /// See: <https://attack.mitre.org/tactics/enterprise/>
11752 ///
11753 /// # Working with unknown values
11754 ///
11755 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11756 /// additional enum variants at any time. Adding new variants is not considered
11757 /// a breaking change. Applications should write their code in anticipation of:
11758 ///
11759 /// - New values appearing in future releases of the client library, **and**
11760 /// - New values received dynamically, without application changes.
11761 ///
11762 /// Please consult the [Working with enums] section in the user guide for some
11763 /// guidelines.
11764 ///
11765 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11766 #[derive(Clone, Debug, PartialEq)]
11767 #[non_exhaustive]
11768 pub enum Tactic {
11769 /// Unspecified value.
11770 Unspecified,
11771 /// TA0043
11772 Reconnaissance,
11773 /// TA0042
11774 ResourceDevelopment,
11775 /// TA0001
11776 InitialAccess,
11777 /// TA0002
11778 Execution,
11779 /// TA0003
11780 Persistence,
11781 /// TA0004
11782 PrivilegeEscalation,
11783 /// TA0005
11784 DefenseEvasion,
11785 /// TA0006
11786 CredentialAccess,
11787 /// TA0007
11788 Discovery,
11789 /// TA0008
11790 LateralMovement,
11791 /// TA0009
11792 Collection,
11793 /// TA0011
11794 CommandAndControl,
11795 /// TA0010
11796 Exfiltration,
11797 /// TA0040
11798 Impact,
11799 /// If set, the enum was initialized with an unknown value.
11800 ///
11801 /// Applications can examine the value using [Tactic::value] or
11802 /// [Tactic::name].
11803 UnknownValue(tactic::UnknownValue),
11804 }
11805
11806 #[doc(hidden)]
11807 pub mod tactic {
11808 #[allow(unused_imports)]
11809 use super::*;
11810 #[derive(Clone, Debug, PartialEq)]
11811 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11812 }
11813
11814 impl Tactic {
11815 /// Gets the enum value.
11816 ///
11817 /// Returns `None` if the enum contains an unknown value deserialized from
11818 /// the string representation of enums.
11819 pub fn value(&self) -> std::option::Option<i32> {
11820 match self {
11821 Self::Unspecified => std::option::Option::Some(0),
11822 Self::Reconnaissance => std::option::Option::Some(1),
11823 Self::ResourceDevelopment => std::option::Option::Some(2),
11824 Self::InitialAccess => std::option::Option::Some(5),
11825 Self::Execution => std::option::Option::Some(3),
11826 Self::Persistence => std::option::Option::Some(6),
11827 Self::PrivilegeEscalation => std::option::Option::Some(8),
11828 Self::DefenseEvasion => std::option::Option::Some(7),
11829 Self::CredentialAccess => std::option::Option::Some(9),
11830 Self::Discovery => std::option::Option::Some(10),
11831 Self::LateralMovement => std::option::Option::Some(11),
11832 Self::Collection => std::option::Option::Some(12),
11833 Self::CommandAndControl => std::option::Option::Some(4),
11834 Self::Exfiltration => std::option::Option::Some(13),
11835 Self::Impact => std::option::Option::Some(14),
11836 Self::UnknownValue(u) => u.0.value(),
11837 }
11838 }
11839
11840 /// Gets the enum value as a string.
11841 ///
11842 /// Returns `None` if the enum contains an unknown value deserialized from
11843 /// the integer representation of enums.
11844 pub fn name(&self) -> std::option::Option<&str> {
11845 match self {
11846 Self::Unspecified => std::option::Option::Some("TACTIC_UNSPECIFIED"),
11847 Self::Reconnaissance => std::option::Option::Some("RECONNAISSANCE"),
11848 Self::ResourceDevelopment => std::option::Option::Some("RESOURCE_DEVELOPMENT"),
11849 Self::InitialAccess => std::option::Option::Some("INITIAL_ACCESS"),
11850 Self::Execution => std::option::Option::Some("EXECUTION"),
11851 Self::Persistence => std::option::Option::Some("PERSISTENCE"),
11852 Self::PrivilegeEscalation => std::option::Option::Some("PRIVILEGE_ESCALATION"),
11853 Self::DefenseEvasion => std::option::Option::Some("DEFENSE_EVASION"),
11854 Self::CredentialAccess => std::option::Option::Some("CREDENTIAL_ACCESS"),
11855 Self::Discovery => std::option::Option::Some("DISCOVERY"),
11856 Self::LateralMovement => std::option::Option::Some("LATERAL_MOVEMENT"),
11857 Self::Collection => std::option::Option::Some("COLLECTION"),
11858 Self::CommandAndControl => std::option::Option::Some("COMMAND_AND_CONTROL"),
11859 Self::Exfiltration => std::option::Option::Some("EXFILTRATION"),
11860 Self::Impact => std::option::Option::Some("IMPACT"),
11861 Self::UnknownValue(u) => u.0.name(),
11862 }
11863 }
11864 }
11865
11866 impl std::default::Default for Tactic {
11867 fn default() -> Self {
11868 use std::convert::From;
11869 Self::from(0)
11870 }
11871 }
11872
11873 impl std::fmt::Display for Tactic {
11874 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11875 wkt::internal::display_enum(f, self.name(), self.value())
11876 }
11877 }
11878
11879 impl std::convert::From<i32> for Tactic {
11880 fn from(value: i32) -> Self {
11881 match value {
11882 0 => Self::Unspecified,
11883 1 => Self::Reconnaissance,
11884 2 => Self::ResourceDevelopment,
11885 3 => Self::Execution,
11886 4 => Self::CommandAndControl,
11887 5 => Self::InitialAccess,
11888 6 => Self::Persistence,
11889 7 => Self::DefenseEvasion,
11890 8 => Self::PrivilegeEscalation,
11891 9 => Self::CredentialAccess,
11892 10 => Self::Discovery,
11893 11 => Self::LateralMovement,
11894 12 => Self::Collection,
11895 13 => Self::Exfiltration,
11896 14 => Self::Impact,
11897 _ => Self::UnknownValue(tactic::UnknownValue(
11898 wkt::internal::UnknownEnumValue::Integer(value),
11899 )),
11900 }
11901 }
11902 }
11903
11904 impl std::convert::From<&str> for Tactic {
11905 fn from(value: &str) -> Self {
11906 use std::string::ToString;
11907 match value {
11908 "TACTIC_UNSPECIFIED" => Self::Unspecified,
11909 "RECONNAISSANCE" => Self::Reconnaissance,
11910 "RESOURCE_DEVELOPMENT" => Self::ResourceDevelopment,
11911 "INITIAL_ACCESS" => Self::InitialAccess,
11912 "EXECUTION" => Self::Execution,
11913 "PERSISTENCE" => Self::Persistence,
11914 "PRIVILEGE_ESCALATION" => Self::PrivilegeEscalation,
11915 "DEFENSE_EVASION" => Self::DefenseEvasion,
11916 "CREDENTIAL_ACCESS" => Self::CredentialAccess,
11917 "DISCOVERY" => Self::Discovery,
11918 "LATERAL_MOVEMENT" => Self::LateralMovement,
11919 "COLLECTION" => Self::Collection,
11920 "COMMAND_AND_CONTROL" => Self::CommandAndControl,
11921 "EXFILTRATION" => Self::Exfiltration,
11922 "IMPACT" => Self::Impact,
11923 _ => Self::UnknownValue(tactic::UnknownValue(
11924 wkt::internal::UnknownEnumValue::String(value.to_string()),
11925 )),
11926 }
11927 }
11928 }
11929
11930 impl serde::ser::Serialize for Tactic {
11931 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11932 where
11933 S: serde::Serializer,
11934 {
11935 match self {
11936 Self::Unspecified => serializer.serialize_i32(0),
11937 Self::Reconnaissance => serializer.serialize_i32(1),
11938 Self::ResourceDevelopment => serializer.serialize_i32(2),
11939 Self::InitialAccess => serializer.serialize_i32(5),
11940 Self::Execution => serializer.serialize_i32(3),
11941 Self::Persistence => serializer.serialize_i32(6),
11942 Self::PrivilegeEscalation => serializer.serialize_i32(8),
11943 Self::DefenseEvasion => serializer.serialize_i32(7),
11944 Self::CredentialAccess => serializer.serialize_i32(9),
11945 Self::Discovery => serializer.serialize_i32(10),
11946 Self::LateralMovement => serializer.serialize_i32(11),
11947 Self::Collection => serializer.serialize_i32(12),
11948 Self::CommandAndControl => serializer.serialize_i32(4),
11949 Self::Exfiltration => serializer.serialize_i32(13),
11950 Self::Impact => serializer.serialize_i32(14),
11951 Self::UnknownValue(u) => u.0.serialize(serializer),
11952 }
11953 }
11954 }
11955
11956 impl<'de> serde::de::Deserialize<'de> for Tactic {
11957 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11958 where
11959 D: serde::Deserializer<'de>,
11960 {
11961 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Tactic>::new(
11962 ".google.cloud.securitycenter.v2.MitreAttack.Tactic",
11963 ))
11964 }
11965 }
11966
11967 /// MITRE ATT&CK techniques that can be referenced by Security Command Center
11968 /// findings. See: <https://attack.mitre.org/techniques/enterprise/>
11969 ///
11970 /// # Working with unknown values
11971 ///
11972 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11973 /// additional enum variants at any time. Adding new variants is not considered
11974 /// a breaking change. Applications should write their code in anticipation of:
11975 ///
11976 /// - New values appearing in future releases of the client library, **and**
11977 /// - New values received dynamically, without application changes.
11978 ///
11979 /// Please consult the [Working with enums] section in the user guide for some
11980 /// guidelines.
11981 ///
11982 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11983 #[derive(Clone, Debug, PartialEq)]
11984 #[non_exhaustive]
11985 pub enum Technique {
11986 /// Unspecified value.
11987 Unspecified,
11988 /// T1001
11989 DataObfuscation,
11990 /// T1001.002
11991 DataObfuscationSteganography,
11992 /// T1003
11993 OsCredentialDumping,
11994 /// T1003.007
11995 OsCredentialDumpingProcFilesystem,
11996 /// T1003.008
11997 OsCredentialDumpingEtcPasswordAndEtcShadow,
11998 /// T1005
11999 DataFromLocalSystem,
12000 /// T1020
12001 AutomatedExfiltration,
12002 /// T1027
12003 ObfuscatedFilesOrInfo,
12004 /// T1027.003
12005 Steganography,
12006 /// T1027.004
12007 CompileAfterDelivery,
12008 /// T1027.010
12009 CommandObfuscation,
12010 /// T1029
12011 ScheduledTransfer,
12012 /// T1033
12013 SystemOwnerUserDiscovery,
12014 /// T1036
12015 Masquerading,
12016 /// T1036.005
12017 MatchLegitimateNameOrLocation,
12018 /// T1037
12019 BootOrLogonInitializationScripts,
12020 /// T1037.005
12021 StartupItems,
12022 /// T1046
12023 NetworkServiceDiscovery,
12024 /// T1053
12025 ScheduledTaskJob,
12026 /// T1053.003
12027 ScheduledTaskJobCron,
12028 /// T1053.007
12029 ContainerOrchestrationJob,
12030 /// T1055
12031 ProcessInjection,
12032 /// T1056
12033 InputCapture,
12034 /// T1056.001
12035 InputCaptureKeylogging,
12036 /// T1057
12037 ProcessDiscovery,
12038 /// T1059
12039 CommandAndScriptingInterpreter,
12040 /// T1059.004
12041 UnixShell,
12042 /// T1059.006
12043 Python,
12044 /// T1068
12045 ExploitationForPrivilegeEscalation,
12046 /// T1069
12047 PermissionGroupsDiscovery,
12048 /// T1069.003
12049 CloudGroups,
12050 /// T1070
12051 IndicatorRemoval,
12052 /// T1070.002
12053 IndicatorRemovalClearLinuxOrMacSystemLogs,
12054 /// T1070.003
12055 IndicatorRemovalClearCommandHistory,
12056 /// T1070.004
12057 IndicatorRemovalFileDeletion,
12058 /// T1070.006
12059 IndicatorRemovalTimestomp,
12060 /// T1070.008
12061 IndicatorRemovalClearMailboxData,
12062 /// T1071
12063 ApplicationLayerProtocol,
12064 /// T1071.004
12065 Dns,
12066 /// T1072
12067 SoftwareDeploymentTools,
12068 /// T1078
12069 ValidAccounts,
12070 /// T1078.001
12071 DefaultAccounts,
12072 /// T1078.003
12073 LocalAccounts,
12074 /// T1078.004
12075 CloudAccounts,
12076 /// T1083
12077 FileAndDirectoryDiscovery,
12078 /// T1087.001
12079 AccountDiscoveryLocalAccount,
12080 /// T1090
12081 Proxy,
12082 /// T1090.002
12083 ExternalProxy,
12084 /// T1090.003
12085 MultiHopProxy,
12086 /// T1098
12087 AccountManipulation,
12088 /// T1098.001
12089 AdditionalCloudCredentials,
12090 /// T1098.003
12091 AdditionalCloudRoles,
12092 /// T1098.004
12093 SshAuthorizedKeys,
12094 /// T1098.006
12095 AdditionalContainerClusterRoles,
12096 /// T1104
12097 MultiStageChannels,
12098 /// T1105
12099 IngressToolTransfer,
12100 /// T1106
12101 NativeApi,
12102 /// T1110
12103 BruteForce,
12104 /// T1119
12105 AutomatedCollection,
12106 /// T1129
12107 SharedModules,
12108 /// T1132
12109 DataEncoding,
12110 /// T1132.001
12111 StandardEncoding,
12112 /// T1134
12113 AccessTokenManipulation,
12114 /// T1134.001
12115 TokenImpersonationOrTheft,
12116 /// T1136
12117 CreateAccount,
12118 /// T1136.001
12119 LocalAccount,
12120 /// T1140
12121 DeobfuscateDecodeFilesOrInfo,
12122 /// T1190
12123 ExploitPublicFacingApplication,
12124 /// T1195
12125 SupplyChainCompromise,
12126 /// T1195.001
12127 CompromiseSoftwareDependenciesAndDevelopmentTools,
12128 /// T1203
12129 ExploitationForClientExecution,
12130 /// T1204
12131 UserExecution,
12132 /// T1222.002
12133 LinuxAndMacFileAndDirectoryPermissionsModification,
12134 /// T1484
12135 DomainPolicyModification,
12136 /// T1485
12137 DataDestruction,
12138 /// T1486
12139 DataEncryptedForImpact,
12140 /// T1489
12141 ServiceStop,
12142 /// T1490
12143 InhibitSystemRecovery,
12144 /// T1495
12145 FirmwareCorruption,
12146 /// T1496
12147 ResourceHijacking,
12148 /// T1498
12149 NetworkDenialOfService,
12150 /// T1526
12151 CloudServiceDiscovery,
12152 /// T1528
12153 StealApplicationAccessToken,
12154 /// T1531
12155 AccountAccessRemoval,
12156 /// T1537
12157 TransferDataToCloudAccount,
12158 /// T1539
12159 StealWebSessionCookie,
12160 /// T1543
12161 CreateOrModifySystemProcess,
12162 /// T1546
12163 EventTriggeredExecution,
12164 /// T1547
12165 BootOrLogonAutostartExecution,
12166 /// T1547.006
12167 KernelModulesAndExtensions,
12168 /// T1547.009
12169 ShortcutModification,
12170 /// T1548
12171 AbuseElevationControlMechanism,
12172 /// T1548.001
12173 AbuseElevationControlMechanismSetuidAndSetgid,
12174 /// T1548.003
12175 AbuseElevationControlMechanismSudoAndSudoCaching,
12176 /// T1552
12177 UnsecuredCredentials,
12178 /// T1552.001
12179 CredentialsInFiles,
12180 /// T1552.003
12181 BashHistory,
12182 /// T1552.004
12183 PrivateKeys,
12184 /// T1553
12185 SubvertTrustControl,
12186 /// T1553.004
12187 InstallRootCertificate,
12188 /// T1554
12189 CompromiseHostSoftwareBinary,
12190 /// T1555
12191 CredentialsFromPasswordStores,
12192 /// T1556
12193 ModifyAuthenticationProcess,
12194 /// T1556.003
12195 PluggableAuthenticationModules,
12196 /// T1556.006
12197 MultiFactorAuthentication,
12198 /// T1562
12199 ImpairDefenses,
12200 /// T1562.001
12201 DisableOrModifyTools,
12202 /// T1562.006
12203 IndicatorBlocking,
12204 /// T1562.012
12205 DisableOrModifyLinuxAuditSystem,
12206 /// T1564
12207 HideArtifacts,
12208 /// T1564.001
12209 HiddenFilesAndDirectories,
12210 /// T1564.002
12211 HiddenUsers,
12212 /// T1567
12213 ExfiltrationOverWebService,
12214 /// T1567.002
12215 ExfiltrationToCloudStorage,
12216 /// T1568
12217 DynamicResolution,
12218 /// T1570
12219 LateralToolTransfer,
12220 /// T1574
12221 HijackExecutionFlow,
12222 /// T1574.006
12223 HijackExecutionFlowDynamicLinkerHijacking,
12224 /// T1578
12225 ModifyCloudComputeInfrastructure,
12226 /// T1578.001
12227 CreateSnapshot,
12228 /// T1580
12229 CloudInfrastructureDiscovery,
12230 /// T1587
12231 DevelopCapabilities,
12232 /// T1587.001
12233 DevelopCapabilitiesMalware,
12234 /// T1588
12235 ObtainCapabilities,
12236 /// T1588.001
12237 ObtainCapabilitiesMalware,
12238 /// T1588.006
12239 ObtainCapabilitiesVulnerabilities,
12240 /// T1595
12241 ActiveScanning,
12242 /// T1595.001
12243 ScanningIpBlocks,
12244 /// T1608
12245 StageCapabilities,
12246 /// T1608.001
12247 UploadMalware,
12248 /// T1609
12249 ContainerAdministrationCommand,
12250 /// T1610
12251 DeployContainer,
12252 /// T1611
12253 EscapeToHost,
12254 /// T1613
12255 ContainerAndResourceDiscovery,
12256 /// T1620
12257 ReflectiveCodeLoading,
12258 /// T1649
12259 StealOrForgeAuthenticationCertificates,
12260 /// T1657
12261 FinancialTheft,
12262 /// If set, the enum was initialized with an unknown value.
12263 ///
12264 /// Applications can examine the value using [Technique::value] or
12265 /// [Technique::name].
12266 UnknownValue(technique::UnknownValue),
12267 }
12268
12269 #[doc(hidden)]
12270 pub mod technique {
12271 #[allow(unused_imports)]
12272 use super::*;
12273 #[derive(Clone, Debug, PartialEq)]
12274 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12275 }
12276
12277 impl Technique {
12278 /// Gets the enum value.
12279 ///
12280 /// Returns `None` if the enum contains an unknown value deserialized from
12281 /// the string representation of enums.
12282 pub fn value(&self) -> std::option::Option<i32> {
12283 match self {
12284 Self::Unspecified => std::option::Option::Some(0),
12285 Self::DataObfuscation => std::option::Option::Some(70),
12286 Self::DataObfuscationSteganography => std::option::Option::Some(71),
12287 Self::OsCredentialDumping => std::option::Option::Some(114),
12288 Self::OsCredentialDumpingProcFilesystem => std::option::Option::Some(115),
12289 Self::OsCredentialDumpingEtcPasswordAndEtcShadow => std::option::Option::Some(122),
12290 Self::DataFromLocalSystem => std::option::Option::Some(117),
12291 Self::AutomatedExfiltration => std::option::Option::Some(68),
12292 Self::ObfuscatedFilesOrInfo => std::option::Option::Some(72),
12293 Self::Steganography => std::option::Option::Some(73),
12294 Self::CompileAfterDelivery => std::option::Option::Some(74),
12295 Self::CommandObfuscation => std::option::Option::Some(75),
12296 Self::ScheduledTransfer => std::option::Option::Some(120),
12297 Self::SystemOwnerUserDiscovery => std::option::Option::Some(118),
12298 Self::Masquerading => std::option::Option::Some(49),
12299 Self::MatchLegitimateNameOrLocation => std::option::Option::Some(50),
12300 Self::BootOrLogonInitializationScripts => std::option::Option::Some(37),
12301 Self::StartupItems => std::option::Option::Some(38),
12302 Self::NetworkServiceDiscovery => std::option::Option::Some(32),
12303 Self::ScheduledTaskJob => std::option::Option::Some(89),
12304 Self::ScheduledTaskJobCron => std::option::Option::Some(119),
12305 Self::ContainerOrchestrationJob => std::option::Option::Some(90),
12306 Self::ProcessInjection => std::option::Option::Some(93),
12307 Self::InputCapture => std::option::Option::Some(103),
12308 Self::InputCaptureKeylogging => std::option::Option::Some(104),
12309 Self::ProcessDiscovery => std::option::Option::Some(56),
12310 Self::CommandAndScriptingInterpreter => std::option::Option::Some(6),
12311 Self::UnixShell => std::option::Option::Some(7),
12312 Self::Python => std::option::Option::Some(59),
12313 Self::ExploitationForPrivilegeEscalation => std::option::Option::Some(63),
12314 Self::PermissionGroupsDiscovery => std::option::Option::Some(18),
12315 Self::CloudGroups => std::option::Option::Some(19),
12316 Self::IndicatorRemoval => std::option::Option::Some(123),
12317 Self::IndicatorRemovalClearLinuxOrMacSystemLogs => std::option::Option::Some(124),
12318 Self::IndicatorRemovalClearCommandHistory => std::option::Option::Some(125),
12319 Self::IndicatorRemovalFileDeletion => std::option::Option::Some(64),
12320 Self::IndicatorRemovalTimestomp => std::option::Option::Some(128),
12321 Self::IndicatorRemovalClearMailboxData => std::option::Option::Some(126),
12322 Self::ApplicationLayerProtocol => std::option::Option::Some(45),
12323 Self::Dns => std::option::Option::Some(46),
12324 Self::SoftwareDeploymentTools => std::option::Option::Some(47),
12325 Self::ValidAccounts => std::option::Option::Some(14),
12326 Self::DefaultAccounts => std::option::Option::Some(35),
12327 Self::LocalAccounts => std::option::Option::Some(15),
12328 Self::CloudAccounts => std::option::Option::Some(16),
12329 Self::FileAndDirectoryDiscovery => std::option::Option::Some(121),
12330 Self::AccountDiscoveryLocalAccount => std::option::Option::Some(116),
12331 Self::Proxy => std::option::Option::Some(9),
12332 Self::ExternalProxy => std::option::Option::Some(10),
12333 Self::MultiHopProxy => std::option::Option::Some(11),
12334 Self::AccountManipulation => std::option::Option::Some(22),
12335 Self::AdditionalCloudCredentials => std::option::Option::Some(40),
12336 Self::AdditionalCloudRoles => std::option::Option::Some(67),
12337 Self::SshAuthorizedKeys => std::option::Option::Some(23),
12338 Self::AdditionalContainerClusterRoles => std::option::Option::Some(58),
12339 Self::MultiStageChannels => std::option::Option::Some(76),
12340 Self::IngressToolTransfer => std::option::Option::Some(3),
12341 Self::NativeApi => std::option::Option::Some(4),
12342 Self::BruteForce => std::option::Option::Some(44),
12343 Self::AutomatedCollection => std::option::Option::Some(94),
12344 Self::SharedModules => std::option::Option::Some(5),
12345 Self::DataEncoding => std::option::Option::Some(77),
12346 Self::StandardEncoding => std::option::Option::Some(78),
12347 Self::AccessTokenManipulation => std::option::Option::Some(33),
12348 Self::TokenImpersonationOrTheft => std::option::Option::Some(39),
12349 Self::CreateAccount => std::option::Option::Some(79),
12350 Self::LocalAccount => std::option::Option::Some(80),
12351 Self::DeobfuscateDecodeFilesOrInfo => std::option::Option::Some(95),
12352 Self::ExploitPublicFacingApplication => std::option::Option::Some(27),
12353 Self::SupplyChainCompromise => std::option::Option::Some(129),
12354 Self::CompromiseSoftwareDependenciesAndDevelopmentTools => {
12355 std::option::Option::Some(130)
12356 }
12357 Self::ExploitationForClientExecution => std::option::Option::Some(134),
12358 Self::UserExecution => std::option::Option::Some(69),
12359 Self::LinuxAndMacFileAndDirectoryPermissionsModification => {
12360 std::option::Option::Some(135)
12361 }
12362 Self::DomainPolicyModification => std::option::Option::Some(30),
12363 Self::DataDestruction => std::option::Option::Some(29),
12364 Self::DataEncryptedForImpact => std::option::Option::Some(132),
12365 Self::ServiceStop => std::option::Option::Some(52),
12366 Self::InhibitSystemRecovery => std::option::Option::Some(36),
12367 Self::FirmwareCorruption => std::option::Option::Some(81),
12368 Self::ResourceHijacking => std::option::Option::Some(8),
12369 Self::NetworkDenialOfService => std::option::Option::Some(17),
12370 Self::CloudServiceDiscovery => std::option::Option::Some(48),
12371 Self::StealApplicationAccessToken => std::option::Option::Some(42),
12372 Self::AccountAccessRemoval => std::option::Option::Some(51),
12373 Self::TransferDataToCloudAccount => std::option::Option::Some(91),
12374 Self::StealWebSessionCookie => std::option::Option::Some(25),
12375 Self::CreateOrModifySystemProcess => std::option::Option::Some(24),
12376 Self::EventTriggeredExecution => std::option::Option::Some(65),
12377 Self::BootOrLogonAutostartExecution => std::option::Option::Some(82),
12378 Self::KernelModulesAndExtensions => std::option::Option::Some(83),
12379 Self::ShortcutModification => std::option::Option::Some(127),
12380 Self::AbuseElevationControlMechanism => std::option::Option::Some(34),
12381 Self::AbuseElevationControlMechanismSetuidAndSetgid => {
12382 std::option::Option::Some(136)
12383 }
12384 Self::AbuseElevationControlMechanismSudoAndSudoCaching => {
12385 std::option::Option::Some(109)
12386 }
12387 Self::UnsecuredCredentials => std::option::Option::Some(13),
12388 Self::CredentialsInFiles => std::option::Option::Some(105),
12389 Self::BashHistory => std::option::Option::Some(96),
12390 Self::PrivateKeys => std::option::Option::Some(97),
12391 Self::SubvertTrustControl => std::option::Option::Some(106),
12392 Self::InstallRootCertificate => std::option::Option::Some(107),
12393 Self::CompromiseHostSoftwareBinary => std::option::Option::Some(84),
12394 Self::CredentialsFromPasswordStores => std::option::Option::Some(98),
12395 Self::ModifyAuthenticationProcess => std::option::Option::Some(28),
12396 Self::PluggableAuthenticationModules => std::option::Option::Some(108),
12397 Self::MultiFactorAuthentication => std::option::Option::Some(137),
12398 Self::ImpairDefenses => std::option::Option::Some(31),
12399 Self::DisableOrModifyTools => std::option::Option::Some(55),
12400 Self::IndicatorBlocking => std::option::Option::Some(110),
12401 Self::DisableOrModifyLinuxAuditSystem => std::option::Option::Some(111),
12402 Self::HideArtifacts => std::option::Option::Some(85),
12403 Self::HiddenFilesAndDirectories => std::option::Option::Some(86),
12404 Self::HiddenUsers => std::option::Option::Some(87),
12405 Self::ExfiltrationOverWebService => std::option::Option::Some(20),
12406 Self::ExfiltrationToCloudStorage => std::option::Option::Some(21),
12407 Self::DynamicResolution => std::option::Option::Some(12),
12408 Self::LateralToolTransfer => std::option::Option::Some(41),
12409 Self::HijackExecutionFlow => std::option::Option::Some(112),
12410 Self::HijackExecutionFlowDynamicLinkerHijacking => std::option::Option::Some(113),
12411 Self::ModifyCloudComputeInfrastructure => std::option::Option::Some(26),
12412 Self::CreateSnapshot => std::option::Option::Some(54),
12413 Self::CloudInfrastructureDiscovery => std::option::Option::Some(53),
12414 Self::DevelopCapabilities => std::option::Option::Some(99),
12415 Self::DevelopCapabilitiesMalware => std::option::Option::Some(100),
12416 Self::ObtainCapabilities => std::option::Option::Some(43),
12417 Self::ObtainCapabilitiesMalware => std::option::Option::Some(101),
12418 Self::ObtainCapabilitiesVulnerabilities => std::option::Option::Some(133),
12419 Self::ActiveScanning => std::option::Option::Some(1),
12420 Self::ScanningIpBlocks => std::option::Option::Some(2),
12421 Self::StageCapabilities => std::option::Option::Some(88),
12422 Self::UploadMalware => std::option::Option::Some(102),
12423 Self::ContainerAdministrationCommand => std::option::Option::Some(60),
12424 Self::DeployContainer => std::option::Option::Some(66),
12425 Self::EscapeToHost => std::option::Option::Some(61),
12426 Self::ContainerAndResourceDiscovery => std::option::Option::Some(57),
12427 Self::ReflectiveCodeLoading => std::option::Option::Some(92),
12428 Self::StealOrForgeAuthenticationCertificates => std::option::Option::Some(62),
12429 Self::FinancialTheft => std::option::Option::Some(131),
12430 Self::UnknownValue(u) => u.0.value(),
12431 }
12432 }
12433
12434 /// Gets the enum value as a string.
12435 ///
12436 /// Returns `None` if the enum contains an unknown value deserialized from
12437 /// the integer representation of enums.
12438 pub fn name(&self) -> std::option::Option<&str> {
12439 match self {
12440 Self::Unspecified => std::option::Option::Some("TECHNIQUE_UNSPECIFIED"),
12441 Self::DataObfuscation => std::option::Option::Some("DATA_OBFUSCATION"),
12442 Self::DataObfuscationSteganography => {
12443 std::option::Option::Some("DATA_OBFUSCATION_STEGANOGRAPHY")
12444 }
12445 Self::OsCredentialDumping => std::option::Option::Some("OS_CREDENTIAL_DUMPING"),
12446 Self::OsCredentialDumpingProcFilesystem => {
12447 std::option::Option::Some("OS_CREDENTIAL_DUMPING_PROC_FILESYSTEM")
12448 }
12449 Self::OsCredentialDumpingEtcPasswordAndEtcShadow => {
12450 std::option::Option::Some("OS_CREDENTIAL_DUMPING_ETC_PASSWORD_AND_ETC_SHADOW")
12451 }
12452 Self::DataFromLocalSystem => std::option::Option::Some("DATA_FROM_LOCAL_SYSTEM"),
12453 Self::AutomatedExfiltration => std::option::Option::Some("AUTOMATED_EXFILTRATION"),
12454 Self::ObfuscatedFilesOrInfo => {
12455 std::option::Option::Some("OBFUSCATED_FILES_OR_INFO")
12456 }
12457 Self::Steganography => std::option::Option::Some("STEGANOGRAPHY"),
12458 Self::CompileAfterDelivery => std::option::Option::Some("COMPILE_AFTER_DELIVERY"),
12459 Self::CommandObfuscation => std::option::Option::Some("COMMAND_OBFUSCATION"),
12460 Self::ScheduledTransfer => std::option::Option::Some("SCHEDULED_TRANSFER"),
12461 Self::SystemOwnerUserDiscovery => {
12462 std::option::Option::Some("SYSTEM_OWNER_USER_DISCOVERY")
12463 }
12464 Self::Masquerading => std::option::Option::Some("MASQUERADING"),
12465 Self::MatchLegitimateNameOrLocation => {
12466 std::option::Option::Some("MATCH_LEGITIMATE_NAME_OR_LOCATION")
12467 }
12468 Self::BootOrLogonInitializationScripts => {
12469 std::option::Option::Some("BOOT_OR_LOGON_INITIALIZATION_SCRIPTS")
12470 }
12471 Self::StartupItems => std::option::Option::Some("STARTUP_ITEMS"),
12472 Self::NetworkServiceDiscovery => {
12473 std::option::Option::Some("NETWORK_SERVICE_DISCOVERY")
12474 }
12475 Self::ScheduledTaskJob => std::option::Option::Some("SCHEDULED_TASK_JOB"),
12476 Self::ScheduledTaskJobCron => std::option::Option::Some("SCHEDULED_TASK_JOB_CRON"),
12477 Self::ContainerOrchestrationJob => {
12478 std::option::Option::Some("CONTAINER_ORCHESTRATION_JOB")
12479 }
12480 Self::ProcessInjection => std::option::Option::Some("PROCESS_INJECTION"),
12481 Self::InputCapture => std::option::Option::Some("INPUT_CAPTURE"),
12482 Self::InputCaptureKeylogging => {
12483 std::option::Option::Some("INPUT_CAPTURE_KEYLOGGING")
12484 }
12485 Self::ProcessDiscovery => std::option::Option::Some("PROCESS_DISCOVERY"),
12486 Self::CommandAndScriptingInterpreter => {
12487 std::option::Option::Some("COMMAND_AND_SCRIPTING_INTERPRETER")
12488 }
12489 Self::UnixShell => std::option::Option::Some("UNIX_SHELL"),
12490 Self::Python => std::option::Option::Some("PYTHON"),
12491 Self::ExploitationForPrivilegeEscalation => {
12492 std::option::Option::Some("EXPLOITATION_FOR_PRIVILEGE_ESCALATION")
12493 }
12494 Self::PermissionGroupsDiscovery => {
12495 std::option::Option::Some("PERMISSION_GROUPS_DISCOVERY")
12496 }
12497 Self::CloudGroups => std::option::Option::Some("CLOUD_GROUPS"),
12498 Self::IndicatorRemoval => std::option::Option::Some("INDICATOR_REMOVAL"),
12499 Self::IndicatorRemovalClearLinuxOrMacSystemLogs => {
12500 std::option::Option::Some("INDICATOR_REMOVAL_CLEAR_LINUX_OR_MAC_SYSTEM_LOGS")
12501 }
12502 Self::IndicatorRemovalClearCommandHistory => {
12503 std::option::Option::Some("INDICATOR_REMOVAL_CLEAR_COMMAND_HISTORY")
12504 }
12505 Self::IndicatorRemovalFileDeletion => {
12506 std::option::Option::Some("INDICATOR_REMOVAL_FILE_DELETION")
12507 }
12508 Self::IndicatorRemovalTimestomp => {
12509 std::option::Option::Some("INDICATOR_REMOVAL_TIMESTOMP")
12510 }
12511 Self::IndicatorRemovalClearMailboxData => {
12512 std::option::Option::Some("INDICATOR_REMOVAL_CLEAR_MAILBOX_DATA")
12513 }
12514 Self::ApplicationLayerProtocol => {
12515 std::option::Option::Some("APPLICATION_LAYER_PROTOCOL")
12516 }
12517 Self::Dns => std::option::Option::Some("DNS"),
12518 Self::SoftwareDeploymentTools => {
12519 std::option::Option::Some("SOFTWARE_DEPLOYMENT_TOOLS")
12520 }
12521 Self::ValidAccounts => std::option::Option::Some("VALID_ACCOUNTS"),
12522 Self::DefaultAccounts => std::option::Option::Some("DEFAULT_ACCOUNTS"),
12523 Self::LocalAccounts => std::option::Option::Some("LOCAL_ACCOUNTS"),
12524 Self::CloudAccounts => std::option::Option::Some("CLOUD_ACCOUNTS"),
12525 Self::FileAndDirectoryDiscovery => {
12526 std::option::Option::Some("FILE_AND_DIRECTORY_DISCOVERY")
12527 }
12528 Self::AccountDiscoveryLocalAccount => {
12529 std::option::Option::Some("ACCOUNT_DISCOVERY_LOCAL_ACCOUNT")
12530 }
12531 Self::Proxy => std::option::Option::Some("PROXY"),
12532 Self::ExternalProxy => std::option::Option::Some("EXTERNAL_PROXY"),
12533 Self::MultiHopProxy => std::option::Option::Some("MULTI_HOP_PROXY"),
12534 Self::AccountManipulation => std::option::Option::Some("ACCOUNT_MANIPULATION"),
12535 Self::AdditionalCloudCredentials => {
12536 std::option::Option::Some("ADDITIONAL_CLOUD_CREDENTIALS")
12537 }
12538 Self::AdditionalCloudRoles => std::option::Option::Some("ADDITIONAL_CLOUD_ROLES"),
12539 Self::SshAuthorizedKeys => std::option::Option::Some("SSH_AUTHORIZED_KEYS"),
12540 Self::AdditionalContainerClusterRoles => {
12541 std::option::Option::Some("ADDITIONAL_CONTAINER_CLUSTER_ROLES")
12542 }
12543 Self::MultiStageChannels => std::option::Option::Some("MULTI_STAGE_CHANNELS"),
12544 Self::IngressToolTransfer => std::option::Option::Some("INGRESS_TOOL_TRANSFER"),
12545 Self::NativeApi => std::option::Option::Some("NATIVE_API"),
12546 Self::BruteForce => std::option::Option::Some("BRUTE_FORCE"),
12547 Self::AutomatedCollection => std::option::Option::Some("AUTOMATED_COLLECTION"),
12548 Self::SharedModules => std::option::Option::Some("SHARED_MODULES"),
12549 Self::DataEncoding => std::option::Option::Some("DATA_ENCODING"),
12550 Self::StandardEncoding => std::option::Option::Some("STANDARD_ENCODING"),
12551 Self::AccessTokenManipulation => {
12552 std::option::Option::Some("ACCESS_TOKEN_MANIPULATION")
12553 }
12554 Self::TokenImpersonationOrTheft => {
12555 std::option::Option::Some("TOKEN_IMPERSONATION_OR_THEFT")
12556 }
12557 Self::CreateAccount => std::option::Option::Some("CREATE_ACCOUNT"),
12558 Self::LocalAccount => std::option::Option::Some("LOCAL_ACCOUNT"),
12559 Self::DeobfuscateDecodeFilesOrInfo => {
12560 std::option::Option::Some("DEOBFUSCATE_DECODE_FILES_OR_INFO")
12561 }
12562 Self::ExploitPublicFacingApplication => {
12563 std::option::Option::Some("EXPLOIT_PUBLIC_FACING_APPLICATION")
12564 }
12565 Self::SupplyChainCompromise => std::option::Option::Some("SUPPLY_CHAIN_COMPROMISE"),
12566 Self::CompromiseSoftwareDependenciesAndDevelopmentTools => {
12567 std::option::Option::Some(
12568 "COMPROMISE_SOFTWARE_DEPENDENCIES_AND_DEVELOPMENT_TOOLS",
12569 )
12570 }
12571 Self::ExploitationForClientExecution => {
12572 std::option::Option::Some("EXPLOITATION_FOR_CLIENT_EXECUTION")
12573 }
12574 Self::UserExecution => std::option::Option::Some("USER_EXECUTION"),
12575 Self::LinuxAndMacFileAndDirectoryPermissionsModification => {
12576 std::option::Option::Some(
12577 "LINUX_AND_MAC_FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION",
12578 )
12579 }
12580 Self::DomainPolicyModification => {
12581 std::option::Option::Some("DOMAIN_POLICY_MODIFICATION")
12582 }
12583 Self::DataDestruction => std::option::Option::Some("DATA_DESTRUCTION"),
12584 Self::DataEncryptedForImpact => {
12585 std::option::Option::Some("DATA_ENCRYPTED_FOR_IMPACT")
12586 }
12587 Self::ServiceStop => std::option::Option::Some("SERVICE_STOP"),
12588 Self::InhibitSystemRecovery => std::option::Option::Some("INHIBIT_SYSTEM_RECOVERY"),
12589 Self::FirmwareCorruption => std::option::Option::Some("FIRMWARE_CORRUPTION"),
12590 Self::ResourceHijacking => std::option::Option::Some("RESOURCE_HIJACKING"),
12591 Self::NetworkDenialOfService => {
12592 std::option::Option::Some("NETWORK_DENIAL_OF_SERVICE")
12593 }
12594 Self::CloudServiceDiscovery => std::option::Option::Some("CLOUD_SERVICE_DISCOVERY"),
12595 Self::StealApplicationAccessToken => {
12596 std::option::Option::Some("STEAL_APPLICATION_ACCESS_TOKEN")
12597 }
12598 Self::AccountAccessRemoval => std::option::Option::Some("ACCOUNT_ACCESS_REMOVAL"),
12599 Self::TransferDataToCloudAccount => {
12600 std::option::Option::Some("TRANSFER_DATA_TO_CLOUD_ACCOUNT")
12601 }
12602 Self::StealWebSessionCookie => {
12603 std::option::Option::Some("STEAL_WEB_SESSION_COOKIE")
12604 }
12605 Self::CreateOrModifySystemProcess => {
12606 std::option::Option::Some("CREATE_OR_MODIFY_SYSTEM_PROCESS")
12607 }
12608 Self::EventTriggeredExecution => {
12609 std::option::Option::Some("EVENT_TRIGGERED_EXECUTION")
12610 }
12611 Self::BootOrLogonAutostartExecution => {
12612 std::option::Option::Some("BOOT_OR_LOGON_AUTOSTART_EXECUTION")
12613 }
12614 Self::KernelModulesAndExtensions => {
12615 std::option::Option::Some("KERNEL_MODULES_AND_EXTENSIONS")
12616 }
12617 Self::ShortcutModification => std::option::Option::Some("SHORTCUT_MODIFICATION"),
12618 Self::AbuseElevationControlMechanism => {
12619 std::option::Option::Some("ABUSE_ELEVATION_CONTROL_MECHANISM")
12620 }
12621 Self::AbuseElevationControlMechanismSetuidAndSetgid => {
12622 std::option::Option::Some("ABUSE_ELEVATION_CONTROL_MECHANISM_SETUID_AND_SETGID")
12623 }
12624 Self::AbuseElevationControlMechanismSudoAndSudoCaching => {
12625 std::option::Option::Some(
12626 "ABUSE_ELEVATION_CONTROL_MECHANISM_SUDO_AND_SUDO_CACHING",
12627 )
12628 }
12629 Self::UnsecuredCredentials => std::option::Option::Some("UNSECURED_CREDENTIALS"),
12630 Self::CredentialsInFiles => std::option::Option::Some("CREDENTIALS_IN_FILES"),
12631 Self::BashHistory => std::option::Option::Some("BASH_HISTORY"),
12632 Self::PrivateKeys => std::option::Option::Some("PRIVATE_KEYS"),
12633 Self::SubvertTrustControl => std::option::Option::Some("SUBVERT_TRUST_CONTROL"),
12634 Self::InstallRootCertificate => {
12635 std::option::Option::Some("INSTALL_ROOT_CERTIFICATE")
12636 }
12637 Self::CompromiseHostSoftwareBinary => {
12638 std::option::Option::Some("COMPROMISE_HOST_SOFTWARE_BINARY")
12639 }
12640 Self::CredentialsFromPasswordStores => {
12641 std::option::Option::Some("CREDENTIALS_FROM_PASSWORD_STORES")
12642 }
12643 Self::ModifyAuthenticationProcess => {
12644 std::option::Option::Some("MODIFY_AUTHENTICATION_PROCESS")
12645 }
12646 Self::PluggableAuthenticationModules => {
12647 std::option::Option::Some("PLUGGABLE_AUTHENTICATION_MODULES")
12648 }
12649 Self::MultiFactorAuthentication => {
12650 std::option::Option::Some("MULTI_FACTOR_AUTHENTICATION")
12651 }
12652 Self::ImpairDefenses => std::option::Option::Some("IMPAIR_DEFENSES"),
12653 Self::DisableOrModifyTools => std::option::Option::Some("DISABLE_OR_MODIFY_TOOLS"),
12654 Self::IndicatorBlocking => std::option::Option::Some("INDICATOR_BLOCKING"),
12655 Self::DisableOrModifyLinuxAuditSystem => {
12656 std::option::Option::Some("DISABLE_OR_MODIFY_LINUX_AUDIT_SYSTEM")
12657 }
12658 Self::HideArtifacts => std::option::Option::Some("HIDE_ARTIFACTS"),
12659 Self::HiddenFilesAndDirectories => {
12660 std::option::Option::Some("HIDDEN_FILES_AND_DIRECTORIES")
12661 }
12662 Self::HiddenUsers => std::option::Option::Some("HIDDEN_USERS"),
12663 Self::ExfiltrationOverWebService => {
12664 std::option::Option::Some("EXFILTRATION_OVER_WEB_SERVICE")
12665 }
12666 Self::ExfiltrationToCloudStorage => {
12667 std::option::Option::Some("EXFILTRATION_TO_CLOUD_STORAGE")
12668 }
12669 Self::DynamicResolution => std::option::Option::Some("DYNAMIC_RESOLUTION"),
12670 Self::LateralToolTransfer => std::option::Option::Some("LATERAL_TOOL_TRANSFER"),
12671 Self::HijackExecutionFlow => std::option::Option::Some("HIJACK_EXECUTION_FLOW"),
12672 Self::HijackExecutionFlowDynamicLinkerHijacking => {
12673 std::option::Option::Some("HIJACK_EXECUTION_FLOW_DYNAMIC_LINKER_HIJACKING")
12674 }
12675 Self::ModifyCloudComputeInfrastructure => {
12676 std::option::Option::Some("MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE")
12677 }
12678 Self::CreateSnapshot => std::option::Option::Some("CREATE_SNAPSHOT"),
12679 Self::CloudInfrastructureDiscovery => {
12680 std::option::Option::Some("CLOUD_INFRASTRUCTURE_DISCOVERY")
12681 }
12682 Self::DevelopCapabilities => std::option::Option::Some("DEVELOP_CAPABILITIES"),
12683 Self::DevelopCapabilitiesMalware => {
12684 std::option::Option::Some("DEVELOP_CAPABILITIES_MALWARE")
12685 }
12686 Self::ObtainCapabilities => std::option::Option::Some("OBTAIN_CAPABILITIES"),
12687 Self::ObtainCapabilitiesMalware => {
12688 std::option::Option::Some("OBTAIN_CAPABILITIES_MALWARE")
12689 }
12690 Self::ObtainCapabilitiesVulnerabilities => {
12691 std::option::Option::Some("OBTAIN_CAPABILITIES_VULNERABILITIES")
12692 }
12693 Self::ActiveScanning => std::option::Option::Some("ACTIVE_SCANNING"),
12694 Self::ScanningIpBlocks => std::option::Option::Some("SCANNING_IP_BLOCKS"),
12695 Self::StageCapabilities => std::option::Option::Some("STAGE_CAPABILITIES"),
12696 Self::UploadMalware => std::option::Option::Some("UPLOAD_MALWARE"),
12697 Self::ContainerAdministrationCommand => {
12698 std::option::Option::Some("CONTAINER_ADMINISTRATION_COMMAND")
12699 }
12700 Self::DeployContainer => std::option::Option::Some("DEPLOY_CONTAINER"),
12701 Self::EscapeToHost => std::option::Option::Some("ESCAPE_TO_HOST"),
12702 Self::ContainerAndResourceDiscovery => {
12703 std::option::Option::Some("CONTAINER_AND_RESOURCE_DISCOVERY")
12704 }
12705 Self::ReflectiveCodeLoading => std::option::Option::Some("REFLECTIVE_CODE_LOADING"),
12706 Self::StealOrForgeAuthenticationCertificates => {
12707 std::option::Option::Some("STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES")
12708 }
12709 Self::FinancialTheft => std::option::Option::Some("FINANCIAL_THEFT"),
12710 Self::UnknownValue(u) => u.0.name(),
12711 }
12712 }
12713 }
12714
12715 impl std::default::Default for Technique {
12716 fn default() -> Self {
12717 use std::convert::From;
12718 Self::from(0)
12719 }
12720 }
12721
12722 impl std::fmt::Display for Technique {
12723 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12724 wkt::internal::display_enum(f, self.name(), self.value())
12725 }
12726 }
12727
12728 impl std::convert::From<i32> for Technique {
12729 fn from(value: i32) -> Self {
12730 match value {
12731 0 => Self::Unspecified,
12732 1 => Self::ActiveScanning,
12733 2 => Self::ScanningIpBlocks,
12734 3 => Self::IngressToolTransfer,
12735 4 => Self::NativeApi,
12736 5 => Self::SharedModules,
12737 6 => Self::CommandAndScriptingInterpreter,
12738 7 => Self::UnixShell,
12739 8 => Self::ResourceHijacking,
12740 9 => Self::Proxy,
12741 10 => Self::ExternalProxy,
12742 11 => Self::MultiHopProxy,
12743 12 => Self::DynamicResolution,
12744 13 => Self::UnsecuredCredentials,
12745 14 => Self::ValidAccounts,
12746 15 => Self::LocalAccounts,
12747 16 => Self::CloudAccounts,
12748 17 => Self::NetworkDenialOfService,
12749 18 => Self::PermissionGroupsDiscovery,
12750 19 => Self::CloudGroups,
12751 20 => Self::ExfiltrationOverWebService,
12752 21 => Self::ExfiltrationToCloudStorage,
12753 22 => Self::AccountManipulation,
12754 23 => Self::SshAuthorizedKeys,
12755 24 => Self::CreateOrModifySystemProcess,
12756 25 => Self::StealWebSessionCookie,
12757 26 => Self::ModifyCloudComputeInfrastructure,
12758 27 => Self::ExploitPublicFacingApplication,
12759 28 => Self::ModifyAuthenticationProcess,
12760 29 => Self::DataDestruction,
12761 30 => Self::DomainPolicyModification,
12762 31 => Self::ImpairDefenses,
12763 32 => Self::NetworkServiceDiscovery,
12764 33 => Self::AccessTokenManipulation,
12765 34 => Self::AbuseElevationControlMechanism,
12766 35 => Self::DefaultAccounts,
12767 36 => Self::InhibitSystemRecovery,
12768 37 => Self::BootOrLogonInitializationScripts,
12769 38 => Self::StartupItems,
12770 39 => Self::TokenImpersonationOrTheft,
12771 40 => Self::AdditionalCloudCredentials,
12772 41 => Self::LateralToolTransfer,
12773 42 => Self::StealApplicationAccessToken,
12774 43 => Self::ObtainCapabilities,
12775 44 => Self::BruteForce,
12776 45 => Self::ApplicationLayerProtocol,
12777 46 => Self::Dns,
12778 47 => Self::SoftwareDeploymentTools,
12779 48 => Self::CloudServiceDiscovery,
12780 49 => Self::Masquerading,
12781 50 => Self::MatchLegitimateNameOrLocation,
12782 51 => Self::AccountAccessRemoval,
12783 52 => Self::ServiceStop,
12784 53 => Self::CloudInfrastructureDiscovery,
12785 54 => Self::CreateSnapshot,
12786 55 => Self::DisableOrModifyTools,
12787 56 => Self::ProcessDiscovery,
12788 57 => Self::ContainerAndResourceDiscovery,
12789 58 => Self::AdditionalContainerClusterRoles,
12790 59 => Self::Python,
12791 60 => Self::ContainerAdministrationCommand,
12792 61 => Self::EscapeToHost,
12793 62 => Self::StealOrForgeAuthenticationCertificates,
12794 63 => Self::ExploitationForPrivilegeEscalation,
12795 64 => Self::IndicatorRemovalFileDeletion,
12796 65 => Self::EventTriggeredExecution,
12797 66 => Self::DeployContainer,
12798 67 => Self::AdditionalCloudRoles,
12799 68 => Self::AutomatedExfiltration,
12800 69 => Self::UserExecution,
12801 70 => Self::DataObfuscation,
12802 71 => Self::DataObfuscationSteganography,
12803 72 => Self::ObfuscatedFilesOrInfo,
12804 73 => Self::Steganography,
12805 74 => Self::CompileAfterDelivery,
12806 75 => Self::CommandObfuscation,
12807 76 => Self::MultiStageChannels,
12808 77 => Self::DataEncoding,
12809 78 => Self::StandardEncoding,
12810 79 => Self::CreateAccount,
12811 80 => Self::LocalAccount,
12812 81 => Self::FirmwareCorruption,
12813 82 => Self::BootOrLogonAutostartExecution,
12814 83 => Self::KernelModulesAndExtensions,
12815 84 => Self::CompromiseHostSoftwareBinary,
12816 85 => Self::HideArtifacts,
12817 86 => Self::HiddenFilesAndDirectories,
12818 87 => Self::HiddenUsers,
12819 88 => Self::StageCapabilities,
12820 89 => Self::ScheduledTaskJob,
12821 90 => Self::ContainerOrchestrationJob,
12822 91 => Self::TransferDataToCloudAccount,
12823 92 => Self::ReflectiveCodeLoading,
12824 93 => Self::ProcessInjection,
12825 94 => Self::AutomatedCollection,
12826 95 => Self::DeobfuscateDecodeFilesOrInfo,
12827 96 => Self::BashHistory,
12828 97 => Self::PrivateKeys,
12829 98 => Self::CredentialsFromPasswordStores,
12830 99 => Self::DevelopCapabilities,
12831 100 => Self::DevelopCapabilitiesMalware,
12832 101 => Self::ObtainCapabilitiesMalware,
12833 102 => Self::UploadMalware,
12834 103 => Self::InputCapture,
12835 104 => Self::InputCaptureKeylogging,
12836 105 => Self::CredentialsInFiles,
12837 106 => Self::SubvertTrustControl,
12838 107 => Self::InstallRootCertificate,
12839 108 => Self::PluggableAuthenticationModules,
12840 109 => Self::AbuseElevationControlMechanismSudoAndSudoCaching,
12841 110 => Self::IndicatorBlocking,
12842 111 => Self::DisableOrModifyLinuxAuditSystem,
12843 112 => Self::HijackExecutionFlow,
12844 113 => Self::HijackExecutionFlowDynamicLinkerHijacking,
12845 114 => Self::OsCredentialDumping,
12846 115 => Self::OsCredentialDumpingProcFilesystem,
12847 116 => Self::AccountDiscoveryLocalAccount,
12848 117 => Self::DataFromLocalSystem,
12849 118 => Self::SystemOwnerUserDiscovery,
12850 119 => Self::ScheduledTaskJobCron,
12851 120 => Self::ScheduledTransfer,
12852 121 => Self::FileAndDirectoryDiscovery,
12853 122 => Self::OsCredentialDumpingEtcPasswordAndEtcShadow,
12854 123 => Self::IndicatorRemoval,
12855 124 => Self::IndicatorRemovalClearLinuxOrMacSystemLogs,
12856 125 => Self::IndicatorRemovalClearCommandHistory,
12857 126 => Self::IndicatorRemovalClearMailboxData,
12858 127 => Self::ShortcutModification,
12859 128 => Self::IndicatorRemovalTimestomp,
12860 129 => Self::SupplyChainCompromise,
12861 130 => Self::CompromiseSoftwareDependenciesAndDevelopmentTools,
12862 131 => Self::FinancialTheft,
12863 132 => Self::DataEncryptedForImpact,
12864 133 => Self::ObtainCapabilitiesVulnerabilities,
12865 134 => Self::ExploitationForClientExecution,
12866 135 => Self::LinuxAndMacFileAndDirectoryPermissionsModification,
12867 136 => Self::AbuseElevationControlMechanismSetuidAndSetgid,
12868 137 => Self::MultiFactorAuthentication,
12869 _ => Self::UnknownValue(technique::UnknownValue(
12870 wkt::internal::UnknownEnumValue::Integer(value),
12871 )),
12872 }
12873 }
12874 }
12875
12876 impl std::convert::From<&str> for Technique {
12877 fn from(value: &str) -> Self {
12878 use std::string::ToString;
12879 match value {
12880 "TECHNIQUE_UNSPECIFIED" => Self::Unspecified,
12881 "DATA_OBFUSCATION" => Self::DataObfuscation,
12882 "DATA_OBFUSCATION_STEGANOGRAPHY" => Self::DataObfuscationSteganography,
12883 "OS_CREDENTIAL_DUMPING" => Self::OsCredentialDumping,
12884 "OS_CREDENTIAL_DUMPING_PROC_FILESYSTEM" => Self::OsCredentialDumpingProcFilesystem,
12885 "OS_CREDENTIAL_DUMPING_ETC_PASSWORD_AND_ETC_SHADOW" => {
12886 Self::OsCredentialDumpingEtcPasswordAndEtcShadow
12887 }
12888 "DATA_FROM_LOCAL_SYSTEM" => Self::DataFromLocalSystem,
12889 "AUTOMATED_EXFILTRATION" => Self::AutomatedExfiltration,
12890 "OBFUSCATED_FILES_OR_INFO" => Self::ObfuscatedFilesOrInfo,
12891 "STEGANOGRAPHY" => Self::Steganography,
12892 "COMPILE_AFTER_DELIVERY" => Self::CompileAfterDelivery,
12893 "COMMAND_OBFUSCATION" => Self::CommandObfuscation,
12894 "SCHEDULED_TRANSFER" => Self::ScheduledTransfer,
12895 "SYSTEM_OWNER_USER_DISCOVERY" => Self::SystemOwnerUserDiscovery,
12896 "MASQUERADING" => Self::Masquerading,
12897 "MATCH_LEGITIMATE_NAME_OR_LOCATION" => Self::MatchLegitimateNameOrLocation,
12898 "BOOT_OR_LOGON_INITIALIZATION_SCRIPTS" => Self::BootOrLogonInitializationScripts,
12899 "STARTUP_ITEMS" => Self::StartupItems,
12900 "NETWORK_SERVICE_DISCOVERY" => Self::NetworkServiceDiscovery,
12901 "SCHEDULED_TASK_JOB" => Self::ScheduledTaskJob,
12902 "SCHEDULED_TASK_JOB_CRON" => Self::ScheduledTaskJobCron,
12903 "CONTAINER_ORCHESTRATION_JOB" => Self::ContainerOrchestrationJob,
12904 "PROCESS_INJECTION" => Self::ProcessInjection,
12905 "INPUT_CAPTURE" => Self::InputCapture,
12906 "INPUT_CAPTURE_KEYLOGGING" => Self::InputCaptureKeylogging,
12907 "PROCESS_DISCOVERY" => Self::ProcessDiscovery,
12908 "COMMAND_AND_SCRIPTING_INTERPRETER" => Self::CommandAndScriptingInterpreter,
12909 "UNIX_SHELL" => Self::UnixShell,
12910 "PYTHON" => Self::Python,
12911 "EXPLOITATION_FOR_PRIVILEGE_ESCALATION" => Self::ExploitationForPrivilegeEscalation,
12912 "PERMISSION_GROUPS_DISCOVERY" => Self::PermissionGroupsDiscovery,
12913 "CLOUD_GROUPS" => Self::CloudGroups,
12914 "INDICATOR_REMOVAL" => Self::IndicatorRemoval,
12915 "INDICATOR_REMOVAL_CLEAR_LINUX_OR_MAC_SYSTEM_LOGS" => {
12916 Self::IndicatorRemovalClearLinuxOrMacSystemLogs
12917 }
12918 "INDICATOR_REMOVAL_CLEAR_COMMAND_HISTORY" => {
12919 Self::IndicatorRemovalClearCommandHistory
12920 }
12921 "INDICATOR_REMOVAL_FILE_DELETION" => Self::IndicatorRemovalFileDeletion,
12922 "INDICATOR_REMOVAL_TIMESTOMP" => Self::IndicatorRemovalTimestomp,
12923 "INDICATOR_REMOVAL_CLEAR_MAILBOX_DATA" => Self::IndicatorRemovalClearMailboxData,
12924 "APPLICATION_LAYER_PROTOCOL" => Self::ApplicationLayerProtocol,
12925 "DNS" => Self::Dns,
12926 "SOFTWARE_DEPLOYMENT_TOOLS" => Self::SoftwareDeploymentTools,
12927 "VALID_ACCOUNTS" => Self::ValidAccounts,
12928 "DEFAULT_ACCOUNTS" => Self::DefaultAccounts,
12929 "LOCAL_ACCOUNTS" => Self::LocalAccounts,
12930 "CLOUD_ACCOUNTS" => Self::CloudAccounts,
12931 "FILE_AND_DIRECTORY_DISCOVERY" => Self::FileAndDirectoryDiscovery,
12932 "ACCOUNT_DISCOVERY_LOCAL_ACCOUNT" => Self::AccountDiscoveryLocalAccount,
12933 "PROXY" => Self::Proxy,
12934 "EXTERNAL_PROXY" => Self::ExternalProxy,
12935 "MULTI_HOP_PROXY" => Self::MultiHopProxy,
12936 "ACCOUNT_MANIPULATION" => Self::AccountManipulation,
12937 "ADDITIONAL_CLOUD_CREDENTIALS" => Self::AdditionalCloudCredentials,
12938 "ADDITIONAL_CLOUD_ROLES" => Self::AdditionalCloudRoles,
12939 "SSH_AUTHORIZED_KEYS" => Self::SshAuthorizedKeys,
12940 "ADDITIONAL_CONTAINER_CLUSTER_ROLES" => Self::AdditionalContainerClusterRoles,
12941 "MULTI_STAGE_CHANNELS" => Self::MultiStageChannels,
12942 "INGRESS_TOOL_TRANSFER" => Self::IngressToolTransfer,
12943 "NATIVE_API" => Self::NativeApi,
12944 "BRUTE_FORCE" => Self::BruteForce,
12945 "AUTOMATED_COLLECTION" => Self::AutomatedCollection,
12946 "SHARED_MODULES" => Self::SharedModules,
12947 "DATA_ENCODING" => Self::DataEncoding,
12948 "STANDARD_ENCODING" => Self::StandardEncoding,
12949 "ACCESS_TOKEN_MANIPULATION" => Self::AccessTokenManipulation,
12950 "TOKEN_IMPERSONATION_OR_THEFT" => Self::TokenImpersonationOrTheft,
12951 "CREATE_ACCOUNT" => Self::CreateAccount,
12952 "LOCAL_ACCOUNT" => Self::LocalAccount,
12953 "DEOBFUSCATE_DECODE_FILES_OR_INFO" => Self::DeobfuscateDecodeFilesOrInfo,
12954 "EXPLOIT_PUBLIC_FACING_APPLICATION" => Self::ExploitPublicFacingApplication,
12955 "SUPPLY_CHAIN_COMPROMISE" => Self::SupplyChainCompromise,
12956 "COMPROMISE_SOFTWARE_DEPENDENCIES_AND_DEVELOPMENT_TOOLS" => {
12957 Self::CompromiseSoftwareDependenciesAndDevelopmentTools
12958 }
12959 "EXPLOITATION_FOR_CLIENT_EXECUTION" => Self::ExploitationForClientExecution,
12960 "USER_EXECUTION" => Self::UserExecution,
12961 "LINUX_AND_MAC_FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION" => {
12962 Self::LinuxAndMacFileAndDirectoryPermissionsModification
12963 }
12964 "DOMAIN_POLICY_MODIFICATION" => Self::DomainPolicyModification,
12965 "DATA_DESTRUCTION" => Self::DataDestruction,
12966 "DATA_ENCRYPTED_FOR_IMPACT" => Self::DataEncryptedForImpact,
12967 "SERVICE_STOP" => Self::ServiceStop,
12968 "INHIBIT_SYSTEM_RECOVERY" => Self::InhibitSystemRecovery,
12969 "FIRMWARE_CORRUPTION" => Self::FirmwareCorruption,
12970 "RESOURCE_HIJACKING" => Self::ResourceHijacking,
12971 "NETWORK_DENIAL_OF_SERVICE" => Self::NetworkDenialOfService,
12972 "CLOUD_SERVICE_DISCOVERY" => Self::CloudServiceDiscovery,
12973 "STEAL_APPLICATION_ACCESS_TOKEN" => Self::StealApplicationAccessToken,
12974 "ACCOUNT_ACCESS_REMOVAL" => Self::AccountAccessRemoval,
12975 "TRANSFER_DATA_TO_CLOUD_ACCOUNT" => Self::TransferDataToCloudAccount,
12976 "STEAL_WEB_SESSION_COOKIE" => Self::StealWebSessionCookie,
12977 "CREATE_OR_MODIFY_SYSTEM_PROCESS" => Self::CreateOrModifySystemProcess,
12978 "EVENT_TRIGGERED_EXECUTION" => Self::EventTriggeredExecution,
12979 "BOOT_OR_LOGON_AUTOSTART_EXECUTION" => Self::BootOrLogonAutostartExecution,
12980 "KERNEL_MODULES_AND_EXTENSIONS" => Self::KernelModulesAndExtensions,
12981 "SHORTCUT_MODIFICATION" => Self::ShortcutModification,
12982 "ABUSE_ELEVATION_CONTROL_MECHANISM" => Self::AbuseElevationControlMechanism,
12983 "ABUSE_ELEVATION_CONTROL_MECHANISM_SETUID_AND_SETGID" => {
12984 Self::AbuseElevationControlMechanismSetuidAndSetgid
12985 }
12986 "ABUSE_ELEVATION_CONTROL_MECHANISM_SUDO_AND_SUDO_CACHING" => {
12987 Self::AbuseElevationControlMechanismSudoAndSudoCaching
12988 }
12989 "UNSECURED_CREDENTIALS" => Self::UnsecuredCredentials,
12990 "CREDENTIALS_IN_FILES" => Self::CredentialsInFiles,
12991 "BASH_HISTORY" => Self::BashHistory,
12992 "PRIVATE_KEYS" => Self::PrivateKeys,
12993 "SUBVERT_TRUST_CONTROL" => Self::SubvertTrustControl,
12994 "INSTALL_ROOT_CERTIFICATE" => Self::InstallRootCertificate,
12995 "COMPROMISE_HOST_SOFTWARE_BINARY" => Self::CompromiseHostSoftwareBinary,
12996 "CREDENTIALS_FROM_PASSWORD_STORES" => Self::CredentialsFromPasswordStores,
12997 "MODIFY_AUTHENTICATION_PROCESS" => Self::ModifyAuthenticationProcess,
12998 "PLUGGABLE_AUTHENTICATION_MODULES" => Self::PluggableAuthenticationModules,
12999 "MULTI_FACTOR_AUTHENTICATION" => Self::MultiFactorAuthentication,
13000 "IMPAIR_DEFENSES" => Self::ImpairDefenses,
13001 "DISABLE_OR_MODIFY_TOOLS" => Self::DisableOrModifyTools,
13002 "INDICATOR_BLOCKING" => Self::IndicatorBlocking,
13003 "DISABLE_OR_MODIFY_LINUX_AUDIT_SYSTEM" => Self::DisableOrModifyLinuxAuditSystem,
13004 "HIDE_ARTIFACTS" => Self::HideArtifacts,
13005 "HIDDEN_FILES_AND_DIRECTORIES" => Self::HiddenFilesAndDirectories,
13006 "HIDDEN_USERS" => Self::HiddenUsers,
13007 "EXFILTRATION_OVER_WEB_SERVICE" => Self::ExfiltrationOverWebService,
13008 "EXFILTRATION_TO_CLOUD_STORAGE" => Self::ExfiltrationToCloudStorage,
13009 "DYNAMIC_RESOLUTION" => Self::DynamicResolution,
13010 "LATERAL_TOOL_TRANSFER" => Self::LateralToolTransfer,
13011 "HIJACK_EXECUTION_FLOW" => Self::HijackExecutionFlow,
13012 "HIJACK_EXECUTION_FLOW_DYNAMIC_LINKER_HIJACKING" => {
13013 Self::HijackExecutionFlowDynamicLinkerHijacking
13014 }
13015 "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE" => Self::ModifyCloudComputeInfrastructure,
13016 "CREATE_SNAPSHOT" => Self::CreateSnapshot,
13017 "CLOUD_INFRASTRUCTURE_DISCOVERY" => Self::CloudInfrastructureDiscovery,
13018 "DEVELOP_CAPABILITIES" => Self::DevelopCapabilities,
13019 "DEVELOP_CAPABILITIES_MALWARE" => Self::DevelopCapabilitiesMalware,
13020 "OBTAIN_CAPABILITIES" => Self::ObtainCapabilities,
13021 "OBTAIN_CAPABILITIES_MALWARE" => Self::ObtainCapabilitiesMalware,
13022 "OBTAIN_CAPABILITIES_VULNERABILITIES" => Self::ObtainCapabilitiesVulnerabilities,
13023 "ACTIVE_SCANNING" => Self::ActiveScanning,
13024 "SCANNING_IP_BLOCKS" => Self::ScanningIpBlocks,
13025 "STAGE_CAPABILITIES" => Self::StageCapabilities,
13026 "UPLOAD_MALWARE" => Self::UploadMalware,
13027 "CONTAINER_ADMINISTRATION_COMMAND" => Self::ContainerAdministrationCommand,
13028 "DEPLOY_CONTAINER" => Self::DeployContainer,
13029 "ESCAPE_TO_HOST" => Self::EscapeToHost,
13030 "CONTAINER_AND_RESOURCE_DISCOVERY" => Self::ContainerAndResourceDiscovery,
13031 "REFLECTIVE_CODE_LOADING" => Self::ReflectiveCodeLoading,
13032 "STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES" => {
13033 Self::StealOrForgeAuthenticationCertificates
13034 }
13035 "FINANCIAL_THEFT" => Self::FinancialTheft,
13036 _ => Self::UnknownValue(technique::UnknownValue(
13037 wkt::internal::UnknownEnumValue::String(value.to_string()),
13038 )),
13039 }
13040 }
13041 }
13042
13043 impl serde::ser::Serialize for Technique {
13044 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13045 where
13046 S: serde::Serializer,
13047 {
13048 match self {
13049 Self::Unspecified => serializer.serialize_i32(0),
13050 Self::DataObfuscation => serializer.serialize_i32(70),
13051 Self::DataObfuscationSteganography => serializer.serialize_i32(71),
13052 Self::OsCredentialDumping => serializer.serialize_i32(114),
13053 Self::OsCredentialDumpingProcFilesystem => serializer.serialize_i32(115),
13054 Self::OsCredentialDumpingEtcPasswordAndEtcShadow => serializer.serialize_i32(122),
13055 Self::DataFromLocalSystem => serializer.serialize_i32(117),
13056 Self::AutomatedExfiltration => serializer.serialize_i32(68),
13057 Self::ObfuscatedFilesOrInfo => serializer.serialize_i32(72),
13058 Self::Steganography => serializer.serialize_i32(73),
13059 Self::CompileAfterDelivery => serializer.serialize_i32(74),
13060 Self::CommandObfuscation => serializer.serialize_i32(75),
13061 Self::ScheduledTransfer => serializer.serialize_i32(120),
13062 Self::SystemOwnerUserDiscovery => serializer.serialize_i32(118),
13063 Self::Masquerading => serializer.serialize_i32(49),
13064 Self::MatchLegitimateNameOrLocation => serializer.serialize_i32(50),
13065 Self::BootOrLogonInitializationScripts => serializer.serialize_i32(37),
13066 Self::StartupItems => serializer.serialize_i32(38),
13067 Self::NetworkServiceDiscovery => serializer.serialize_i32(32),
13068 Self::ScheduledTaskJob => serializer.serialize_i32(89),
13069 Self::ScheduledTaskJobCron => serializer.serialize_i32(119),
13070 Self::ContainerOrchestrationJob => serializer.serialize_i32(90),
13071 Self::ProcessInjection => serializer.serialize_i32(93),
13072 Self::InputCapture => serializer.serialize_i32(103),
13073 Self::InputCaptureKeylogging => serializer.serialize_i32(104),
13074 Self::ProcessDiscovery => serializer.serialize_i32(56),
13075 Self::CommandAndScriptingInterpreter => serializer.serialize_i32(6),
13076 Self::UnixShell => serializer.serialize_i32(7),
13077 Self::Python => serializer.serialize_i32(59),
13078 Self::ExploitationForPrivilegeEscalation => serializer.serialize_i32(63),
13079 Self::PermissionGroupsDiscovery => serializer.serialize_i32(18),
13080 Self::CloudGroups => serializer.serialize_i32(19),
13081 Self::IndicatorRemoval => serializer.serialize_i32(123),
13082 Self::IndicatorRemovalClearLinuxOrMacSystemLogs => serializer.serialize_i32(124),
13083 Self::IndicatorRemovalClearCommandHistory => serializer.serialize_i32(125),
13084 Self::IndicatorRemovalFileDeletion => serializer.serialize_i32(64),
13085 Self::IndicatorRemovalTimestomp => serializer.serialize_i32(128),
13086 Self::IndicatorRemovalClearMailboxData => serializer.serialize_i32(126),
13087 Self::ApplicationLayerProtocol => serializer.serialize_i32(45),
13088 Self::Dns => serializer.serialize_i32(46),
13089 Self::SoftwareDeploymentTools => serializer.serialize_i32(47),
13090 Self::ValidAccounts => serializer.serialize_i32(14),
13091 Self::DefaultAccounts => serializer.serialize_i32(35),
13092 Self::LocalAccounts => serializer.serialize_i32(15),
13093 Self::CloudAccounts => serializer.serialize_i32(16),
13094 Self::FileAndDirectoryDiscovery => serializer.serialize_i32(121),
13095 Self::AccountDiscoveryLocalAccount => serializer.serialize_i32(116),
13096 Self::Proxy => serializer.serialize_i32(9),
13097 Self::ExternalProxy => serializer.serialize_i32(10),
13098 Self::MultiHopProxy => serializer.serialize_i32(11),
13099 Self::AccountManipulation => serializer.serialize_i32(22),
13100 Self::AdditionalCloudCredentials => serializer.serialize_i32(40),
13101 Self::AdditionalCloudRoles => serializer.serialize_i32(67),
13102 Self::SshAuthorizedKeys => serializer.serialize_i32(23),
13103 Self::AdditionalContainerClusterRoles => serializer.serialize_i32(58),
13104 Self::MultiStageChannels => serializer.serialize_i32(76),
13105 Self::IngressToolTransfer => serializer.serialize_i32(3),
13106 Self::NativeApi => serializer.serialize_i32(4),
13107 Self::BruteForce => serializer.serialize_i32(44),
13108 Self::AutomatedCollection => serializer.serialize_i32(94),
13109 Self::SharedModules => serializer.serialize_i32(5),
13110 Self::DataEncoding => serializer.serialize_i32(77),
13111 Self::StandardEncoding => serializer.serialize_i32(78),
13112 Self::AccessTokenManipulation => serializer.serialize_i32(33),
13113 Self::TokenImpersonationOrTheft => serializer.serialize_i32(39),
13114 Self::CreateAccount => serializer.serialize_i32(79),
13115 Self::LocalAccount => serializer.serialize_i32(80),
13116 Self::DeobfuscateDecodeFilesOrInfo => serializer.serialize_i32(95),
13117 Self::ExploitPublicFacingApplication => serializer.serialize_i32(27),
13118 Self::SupplyChainCompromise => serializer.serialize_i32(129),
13119 Self::CompromiseSoftwareDependenciesAndDevelopmentTools => {
13120 serializer.serialize_i32(130)
13121 }
13122 Self::ExploitationForClientExecution => serializer.serialize_i32(134),
13123 Self::UserExecution => serializer.serialize_i32(69),
13124 Self::LinuxAndMacFileAndDirectoryPermissionsModification => {
13125 serializer.serialize_i32(135)
13126 }
13127 Self::DomainPolicyModification => serializer.serialize_i32(30),
13128 Self::DataDestruction => serializer.serialize_i32(29),
13129 Self::DataEncryptedForImpact => serializer.serialize_i32(132),
13130 Self::ServiceStop => serializer.serialize_i32(52),
13131 Self::InhibitSystemRecovery => serializer.serialize_i32(36),
13132 Self::FirmwareCorruption => serializer.serialize_i32(81),
13133 Self::ResourceHijacking => serializer.serialize_i32(8),
13134 Self::NetworkDenialOfService => serializer.serialize_i32(17),
13135 Self::CloudServiceDiscovery => serializer.serialize_i32(48),
13136 Self::StealApplicationAccessToken => serializer.serialize_i32(42),
13137 Self::AccountAccessRemoval => serializer.serialize_i32(51),
13138 Self::TransferDataToCloudAccount => serializer.serialize_i32(91),
13139 Self::StealWebSessionCookie => serializer.serialize_i32(25),
13140 Self::CreateOrModifySystemProcess => serializer.serialize_i32(24),
13141 Self::EventTriggeredExecution => serializer.serialize_i32(65),
13142 Self::BootOrLogonAutostartExecution => serializer.serialize_i32(82),
13143 Self::KernelModulesAndExtensions => serializer.serialize_i32(83),
13144 Self::ShortcutModification => serializer.serialize_i32(127),
13145 Self::AbuseElevationControlMechanism => serializer.serialize_i32(34),
13146 Self::AbuseElevationControlMechanismSetuidAndSetgid => {
13147 serializer.serialize_i32(136)
13148 }
13149 Self::AbuseElevationControlMechanismSudoAndSudoCaching => {
13150 serializer.serialize_i32(109)
13151 }
13152 Self::UnsecuredCredentials => serializer.serialize_i32(13),
13153 Self::CredentialsInFiles => serializer.serialize_i32(105),
13154 Self::BashHistory => serializer.serialize_i32(96),
13155 Self::PrivateKeys => serializer.serialize_i32(97),
13156 Self::SubvertTrustControl => serializer.serialize_i32(106),
13157 Self::InstallRootCertificate => serializer.serialize_i32(107),
13158 Self::CompromiseHostSoftwareBinary => serializer.serialize_i32(84),
13159 Self::CredentialsFromPasswordStores => serializer.serialize_i32(98),
13160 Self::ModifyAuthenticationProcess => serializer.serialize_i32(28),
13161 Self::PluggableAuthenticationModules => serializer.serialize_i32(108),
13162 Self::MultiFactorAuthentication => serializer.serialize_i32(137),
13163 Self::ImpairDefenses => serializer.serialize_i32(31),
13164 Self::DisableOrModifyTools => serializer.serialize_i32(55),
13165 Self::IndicatorBlocking => serializer.serialize_i32(110),
13166 Self::DisableOrModifyLinuxAuditSystem => serializer.serialize_i32(111),
13167 Self::HideArtifacts => serializer.serialize_i32(85),
13168 Self::HiddenFilesAndDirectories => serializer.serialize_i32(86),
13169 Self::HiddenUsers => serializer.serialize_i32(87),
13170 Self::ExfiltrationOverWebService => serializer.serialize_i32(20),
13171 Self::ExfiltrationToCloudStorage => serializer.serialize_i32(21),
13172 Self::DynamicResolution => serializer.serialize_i32(12),
13173 Self::LateralToolTransfer => serializer.serialize_i32(41),
13174 Self::HijackExecutionFlow => serializer.serialize_i32(112),
13175 Self::HijackExecutionFlowDynamicLinkerHijacking => serializer.serialize_i32(113),
13176 Self::ModifyCloudComputeInfrastructure => serializer.serialize_i32(26),
13177 Self::CreateSnapshot => serializer.serialize_i32(54),
13178 Self::CloudInfrastructureDiscovery => serializer.serialize_i32(53),
13179 Self::DevelopCapabilities => serializer.serialize_i32(99),
13180 Self::DevelopCapabilitiesMalware => serializer.serialize_i32(100),
13181 Self::ObtainCapabilities => serializer.serialize_i32(43),
13182 Self::ObtainCapabilitiesMalware => serializer.serialize_i32(101),
13183 Self::ObtainCapabilitiesVulnerabilities => serializer.serialize_i32(133),
13184 Self::ActiveScanning => serializer.serialize_i32(1),
13185 Self::ScanningIpBlocks => serializer.serialize_i32(2),
13186 Self::StageCapabilities => serializer.serialize_i32(88),
13187 Self::UploadMalware => serializer.serialize_i32(102),
13188 Self::ContainerAdministrationCommand => serializer.serialize_i32(60),
13189 Self::DeployContainer => serializer.serialize_i32(66),
13190 Self::EscapeToHost => serializer.serialize_i32(61),
13191 Self::ContainerAndResourceDiscovery => serializer.serialize_i32(57),
13192 Self::ReflectiveCodeLoading => serializer.serialize_i32(92),
13193 Self::StealOrForgeAuthenticationCertificates => serializer.serialize_i32(62),
13194 Self::FinancialTheft => serializer.serialize_i32(131),
13195 Self::UnknownValue(u) => u.0.serialize(serializer),
13196 }
13197 }
13198 }
13199
13200 impl<'de> serde::de::Deserialize<'de> for Technique {
13201 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13202 where
13203 D: serde::Deserializer<'de>,
13204 {
13205 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Technique>::new(
13206 ".google.cloud.securitycenter.v2.MitreAttack.Technique",
13207 ))
13208 }
13209 }
13210}
13211
13212/// A mute config is a Cloud SCC resource that contains the configuration
13213/// to mute create/update events of findings.
13214#[derive(Clone, Default, PartialEq)]
13215#[non_exhaustive]
13216pub struct MuteConfig {
13217 /// Identifier. This field will be ignored if provided on config creation. The
13218 /// following list shows some examples of the format:
13219 ///
13220 /// + `organizations/{organization}/muteConfigs/{mute_config}`
13221 ///
13222 /// `organizations/{organization}locations/{location}//muteConfigs/{mute_config}`
13223 ///
13224 /// + `folders/{folder}/muteConfigs/{mute_config}`
13225 /// + `folders/{folder}/locations/{location}/muteConfigs/{mute_config}`
13226 /// + `projects/{project}/muteConfigs/{mute_config}`
13227 /// + `projects/{project}/locations/{location}/muteConfigs/{mute_config}`
13228 pub name: std::string::String,
13229
13230 /// A description of the mute config.
13231 pub description: std::string::String,
13232
13233 /// Required. An expression that defines the filter to apply across
13234 /// create/update events of findings. While creating a filter string, be
13235 /// mindful of the scope in which the mute configuration is being created.
13236 /// E.g., If a filter contains project = X but is created under the project = Y
13237 /// scope, it might not match any findings.
13238 ///
13239 /// The following field and operator combinations are supported:
13240 ///
13241 /// * severity: `=`, `:`
13242 /// * category: `=`, `:`
13243 /// * resource.name: `=`, `:`
13244 /// * resource.project_name: `=`, `:`
13245 /// * resource.project_display_name: `=`, `:`
13246 /// * resource.folders.resource_folder: `=`, `:`
13247 /// * resource.parent_name: `=`, `:`
13248 /// * resource.parent_display_name: `=`, `:`
13249 /// * resource.type: `=`, `:`
13250 /// * finding_class: `=`, `:`
13251 /// * indicator.ip_addresses: `=`, `:`
13252 /// * indicator.domains: `=`, `:`
13253 pub filter: std::string::String,
13254
13255 /// Output only. The time at which the mute config was created.
13256 /// This field is set by the server and will be ignored if provided on config
13257 /// creation.
13258 pub create_time: std::option::Option<wkt::Timestamp>,
13259
13260 /// Output only. The most recent time at which the mute config was updated.
13261 /// This field is set by the server and will be ignored if provided on config
13262 /// creation or update.
13263 pub update_time: std::option::Option<wkt::Timestamp>,
13264
13265 /// Output only. Email address of the user who last edited the mute config.
13266 /// This field is set by the server and will be ignored if provided on config
13267 /// creation or update.
13268 pub most_recent_editor: std::string::String,
13269
13270 /// Required. The type of the mute config, which determines what type of mute
13271 /// state the config affects. Immutable after creation.
13272 pub r#type: crate::model::mute_config::MuteConfigType,
13273
13274 /// Optional. The expiry of the mute config. Only applicable for dynamic
13275 /// configs. If the expiry is set, when the config expires, it is removed from
13276 /// all findings.
13277 pub expiry_time: std::option::Option<wkt::Timestamp>,
13278
13279 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13280}
13281
13282impl MuteConfig {
13283 pub fn new() -> Self {
13284 std::default::Default::default()
13285 }
13286
13287 /// Sets the value of [name][crate::model::MuteConfig::name].
13288 ///
13289 /// # Example
13290 /// ```ignore,no_run
13291 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13292 /// let x = MuteConfig::new().set_name("example");
13293 /// ```
13294 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13295 self.name = v.into();
13296 self
13297 }
13298
13299 /// Sets the value of [description][crate::model::MuteConfig::description].
13300 ///
13301 /// # Example
13302 /// ```ignore,no_run
13303 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13304 /// let x = MuteConfig::new().set_description("example");
13305 /// ```
13306 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13307 self.description = v.into();
13308 self
13309 }
13310
13311 /// Sets the value of [filter][crate::model::MuteConfig::filter].
13312 ///
13313 /// # Example
13314 /// ```ignore,no_run
13315 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13316 /// let x = MuteConfig::new().set_filter("example");
13317 /// ```
13318 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13319 self.filter = v.into();
13320 self
13321 }
13322
13323 /// Sets the value of [create_time][crate::model::MuteConfig::create_time].
13324 ///
13325 /// # Example
13326 /// ```ignore,no_run
13327 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13328 /// use wkt::Timestamp;
13329 /// let x = MuteConfig::new().set_create_time(Timestamp::default()/* use setters */);
13330 /// ```
13331 pub fn set_create_time<T>(mut self, v: T) -> Self
13332 where
13333 T: std::convert::Into<wkt::Timestamp>,
13334 {
13335 self.create_time = std::option::Option::Some(v.into());
13336 self
13337 }
13338
13339 /// Sets or clears the value of [create_time][crate::model::MuteConfig::create_time].
13340 ///
13341 /// # Example
13342 /// ```ignore,no_run
13343 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13344 /// use wkt::Timestamp;
13345 /// let x = MuteConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
13346 /// let x = MuteConfig::new().set_or_clear_create_time(None::<Timestamp>);
13347 /// ```
13348 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13349 where
13350 T: std::convert::Into<wkt::Timestamp>,
13351 {
13352 self.create_time = v.map(|x| x.into());
13353 self
13354 }
13355
13356 /// Sets the value of [update_time][crate::model::MuteConfig::update_time].
13357 ///
13358 /// # Example
13359 /// ```ignore,no_run
13360 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13361 /// use wkt::Timestamp;
13362 /// let x = MuteConfig::new().set_update_time(Timestamp::default()/* use setters */);
13363 /// ```
13364 pub fn set_update_time<T>(mut self, v: T) -> Self
13365 where
13366 T: std::convert::Into<wkt::Timestamp>,
13367 {
13368 self.update_time = std::option::Option::Some(v.into());
13369 self
13370 }
13371
13372 /// Sets or clears the value of [update_time][crate::model::MuteConfig::update_time].
13373 ///
13374 /// # Example
13375 /// ```ignore,no_run
13376 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13377 /// use wkt::Timestamp;
13378 /// let x = MuteConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
13379 /// let x = MuteConfig::new().set_or_clear_update_time(None::<Timestamp>);
13380 /// ```
13381 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
13382 where
13383 T: std::convert::Into<wkt::Timestamp>,
13384 {
13385 self.update_time = v.map(|x| x.into());
13386 self
13387 }
13388
13389 /// Sets the value of [most_recent_editor][crate::model::MuteConfig::most_recent_editor].
13390 ///
13391 /// # Example
13392 /// ```ignore,no_run
13393 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13394 /// let x = MuteConfig::new().set_most_recent_editor("example");
13395 /// ```
13396 pub fn set_most_recent_editor<T: std::convert::Into<std::string::String>>(
13397 mut self,
13398 v: T,
13399 ) -> Self {
13400 self.most_recent_editor = v.into();
13401 self
13402 }
13403
13404 /// Sets the value of [r#type][crate::model::MuteConfig::type].
13405 ///
13406 /// # Example
13407 /// ```ignore,no_run
13408 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13409 /// use google_cloud_securitycenter_v2::model::mute_config::MuteConfigType;
13410 /// let x0 = MuteConfig::new().set_type(MuteConfigType::Static);
13411 /// let x1 = MuteConfig::new().set_type(MuteConfigType::Dynamic);
13412 /// ```
13413 pub fn set_type<T: std::convert::Into<crate::model::mute_config::MuteConfigType>>(
13414 mut self,
13415 v: T,
13416 ) -> Self {
13417 self.r#type = v.into();
13418 self
13419 }
13420
13421 /// Sets the value of [expiry_time][crate::model::MuteConfig::expiry_time].
13422 ///
13423 /// # Example
13424 /// ```ignore,no_run
13425 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13426 /// use wkt::Timestamp;
13427 /// let x = MuteConfig::new().set_expiry_time(Timestamp::default()/* use setters */);
13428 /// ```
13429 pub fn set_expiry_time<T>(mut self, v: T) -> Self
13430 where
13431 T: std::convert::Into<wkt::Timestamp>,
13432 {
13433 self.expiry_time = std::option::Option::Some(v.into());
13434 self
13435 }
13436
13437 /// Sets or clears the value of [expiry_time][crate::model::MuteConfig::expiry_time].
13438 ///
13439 /// # Example
13440 /// ```ignore,no_run
13441 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13442 /// use wkt::Timestamp;
13443 /// let x = MuteConfig::new().set_or_clear_expiry_time(Some(Timestamp::default()/* use setters */));
13444 /// let x = MuteConfig::new().set_or_clear_expiry_time(None::<Timestamp>);
13445 /// ```
13446 pub fn set_or_clear_expiry_time<T>(mut self, v: std::option::Option<T>) -> Self
13447 where
13448 T: std::convert::Into<wkt::Timestamp>,
13449 {
13450 self.expiry_time = v.map(|x| x.into());
13451 self
13452 }
13453}
13454
13455impl wkt::message::Message for MuteConfig {
13456 fn typename() -> &'static str {
13457 "type.googleapis.com/google.cloud.securitycenter.v2.MuteConfig"
13458 }
13459}
13460
13461/// Defines additional types related to [MuteConfig].
13462pub mod mute_config {
13463 #[allow(unused_imports)]
13464 use super::*;
13465
13466 /// The type of MuteConfig.
13467 ///
13468 /// # Working with unknown values
13469 ///
13470 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13471 /// additional enum variants at any time. Adding new variants is not considered
13472 /// a breaking change. Applications should write their code in anticipation of:
13473 ///
13474 /// - New values appearing in future releases of the client library, **and**
13475 /// - New values received dynamically, without application changes.
13476 ///
13477 /// Please consult the [Working with enums] section in the user guide for some
13478 /// guidelines.
13479 ///
13480 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13481 #[derive(Clone, Debug, PartialEq)]
13482 #[non_exhaustive]
13483 pub enum MuteConfigType {
13484 /// Unused.
13485 Unspecified,
13486 /// A static mute config, which sets the static mute state of future matching
13487 /// findings to muted. Once the static mute state has been set, finding or
13488 /// config modifications will not affect the state.
13489 Static,
13490 /// A dynamic mute config, which is applied to existing and future matching
13491 /// findings, setting their dynamic mute state to "muted". If the config is
13492 /// updated or deleted, or a matching finding is updated, such that the
13493 /// finding doesn't match the config, the config will be removed from the
13494 /// finding, and the finding's dynamic mute state may become "unmuted"
13495 /// (unless other configs still match).
13496 Dynamic,
13497 /// If set, the enum was initialized with an unknown value.
13498 ///
13499 /// Applications can examine the value using [MuteConfigType::value] or
13500 /// [MuteConfigType::name].
13501 UnknownValue(mute_config_type::UnknownValue),
13502 }
13503
13504 #[doc(hidden)]
13505 pub mod mute_config_type {
13506 #[allow(unused_imports)]
13507 use super::*;
13508 #[derive(Clone, Debug, PartialEq)]
13509 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13510 }
13511
13512 impl MuteConfigType {
13513 /// Gets the enum value.
13514 ///
13515 /// Returns `None` if the enum contains an unknown value deserialized from
13516 /// the string representation of enums.
13517 pub fn value(&self) -> std::option::Option<i32> {
13518 match self {
13519 Self::Unspecified => std::option::Option::Some(0),
13520 Self::Static => std::option::Option::Some(1),
13521 Self::Dynamic => std::option::Option::Some(2),
13522 Self::UnknownValue(u) => u.0.value(),
13523 }
13524 }
13525
13526 /// Gets the enum value as a string.
13527 ///
13528 /// Returns `None` if the enum contains an unknown value deserialized from
13529 /// the integer representation of enums.
13530 pub fn name(&self) -> std::option::Option<&str> {
13531 match self {
13532 Self::Unspecified => std::option::Option::Some("MUTE_CONFIG_TYPE_UNSPECIFIED"),
13533 Self::Static => std::option::Option::Some("STATIC"),
13534 Self::Dynamic => std::option::Option::Some("DYNAMIC"),
13535 Self::UnknownValue(u) => u.0.name(),
13536 }
13537 }
13538 }
13539
13540 impl std::default::Default for MuteConfigType {
13541 fn default() -> Self {
13542 use std::convert::From;
13543 Self::from(0)
13544 }
13545 }
13546
13547 impl std::fmt::Display for MuteConfigType {
13548 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13549 wkt::internal::display_enum(f, self.name(), self.value())
13550 }
13551 }
13552
13553 impl std::convert::From<i32> for MuteConfigType {
13554 fn from(value: i32) -> Self {
13555 match value {
13556 0 => Self::Unspecified,
13557 1 => Self::Static,
13558 2 => Self::Dynamic,
13559 _ => Self::UnknownValue(mute_config_type::UnknownValue(
13560 wkt::internal::UnknownEnumValue::Integer(value),
13561 )),
13562 }
13563 }
13564 }
13565
13566 impl std::convert::From<&str> for MuteConfigType {
13567 fn from(value: &str) -> Self {
13568 use std::string::ToString;
13569 match value {
13570 "MUTE_CONFIG_TYPE_UNSPECIFIED" => Self::Unspecified,
13571 "STATIC" => Self::Static,
13572 "DYNAMIC" => Self::Dynamic,
13573 _ => Self::UnknownValue(mute_config_type::UnknownValue(
13574 wkt::internal::UnknownEnumValue::String(value.to_string()),
13575 )),
13576 }
13577 }
13578 }
13579
13580 impl serde::ser::Serialize for MuteConfigType {
13581 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13582 where
13583 S: serde::Serializer,
13584 {
13585 match self {
13586 Self::Unspecified => serializer.serialize_i32(0),
13587 Self::Static => serializer.serialize_i32(1),
13588 Self::Dynamic => serializer.serialize_i32(2),
13589 Self::UnknownValue(u) => u.0.serialize(serializer),
13590 }
13591 }
13592 }
13593
13594 impl<'de> serde::de::Deserialize<'de> for MuteConfigType {
13595 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13596 where
13597 D: serde::Deserializer<'de>,
13598 {
13599 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MuteConfigType>::new(
13600 ".google.cloud.securitycenter.v2.MuteConfig.MuteConfigType",
13601 ))
13602 }
13603 }
13604}
13605
13606/// Contains information about a VPC network associated with the finding.
13607#[derive(Clone, Default, PartialEq)]
13608#[non_exhaustive]
13609pub struct Network {
13610 /// The name of the VPC network resource, for example,
13611 /// `//compute.googleapis.com/projects/my-project/global/networks/my-network`.
13612 pub name: std::string::String,
13613
13614 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13615}
13616
13617impl Network {
13618 pub fn new() -> Self {
13619 std::default::Default::default()
13620 }
13621
13622 /// Sets the value of [name][crate::model::Network::name].
13623 ///
13624 /// # Example
13625 /// ```ignore,no_run
13626 /// # use google_cloud_securitycenter_v2::model::Network;
13627 /// let x = Network::new().set_name("example");
13628 /// ```
13629 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13630 self.name = v.into();
13631 self
13632 }
13633}
13634
13635impl wkt::message::Message for Network {
13636 fn typename() -> &'static str {
13637 "type.googleapis.com/google.cloud.securitycenter.v2.Network"
13638 }
13639}
13640
13641/// Represents a Jupyter notebook IPYNB file, such as a [Colab Enterprise
13642/// notebook](https://cloud.google.com/colab/docs/introduction) file, that is
13643/// associated with a finding.
13644#[derive(Clone, Default, PartialEq)]
13645#[non_exhaustive]
13646pub struct Notebook {
13647 /// The name of the notebook.
13648 pub name: std::string::String,
13649
13650 /// The source notebook service, for example, "Colab Enterprise".
13651 pub service: std::string::String,
13652
13653 /// The user ID of the latest author to modify the notebook.
13654 pub last_author: std::string::String,
13655
13656 /// The most recent time the notebook was updated.
13657 pub notebook_update_time: std::option::Option<wkt::Timestamp>,
13658
13659 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13660}
13661
13662impl Notebook {
13663 pub fn new() -> Self {
13664 std::default::Default::default()
13665 }
13666
13667 /// Sets the value of [name][crate::model::Notebook::name].
13668 ///
13669 /// # Example
13670 /// ```ignore,no_run
13671 /// # use google_cloud_securitycenter_v2::model::Notebook;
13672 /// let x = Notebook::new().set_name("example");
13673 /// ```
13674 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13675 self.name = v.into();
13676 self
13677 }
13678
13679 /// Sets the value of [service][crate::model::Notebook::service].
13680 ///
13681 /// # Example
13682 /// ```ignore,no_run
13683 /// # use google_cloud_securitycenter_v2::model::Notebook;
13684 /// let x = Notebook::new().set_service("example");
13685 /// ```
13686 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13687 self.service = v.into();
13688 self
13689 }
13690
13691 /// Sets the value of [last_author][crate::model::Notebook::last_author].
13692 ///
13693 /// # Example
13694 /// ```ignore,no_run
13695 /// # use google_cloud_securitycenter_v2::model::Notebook;
13696 /// let x = Notebook::new().set_last_author("example");
13697 /// ```
13698 pub fn set_last_author<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13699 self.last_author = v.into();
13700 self
13701 }
13702
13703 /// Sets the value of [notebook_update_time][crate::model::Notebook::notebook_update_time].
13704 ///
13705 /// # Example
13706 /// ```ignore,no_run
13707 /// # use google_cloud_securitycenter_v2::model::Notebook;
13708 /// use wkt::Timestamp;
13709 /// let x = Notebook::new().set_notebook_update_time(Timestamp::default()/* use setters */);
13710 /// ```
13711 pub fn set_notebook_update_time<T>(mut self, v: T) -> Self
13712 where
13713 T: std::convert::Into<wkt::Timestamp>,
13714 {
13715 self.notebook_update_time = std::option::Option::Some(v.into());
13716 self
13717 }
13718
13719 /// Sets or clears the value of [notebook_update_time][crate::model::Notebook::notebook_update_time].
13720 ///
13721 /// # Example
13722 /// ```ignore,no_run
13723 /// # use google_cloud_securitycenter_v2::model::Notebook;
13724 /// use wkt::Timestamp;
13725 /// let x = Notebook::new().set_or_clear_notebook_update_time(Some(Timestamp::default()/* use setters */));
13726 /// let x = Notebook::new().set_or_clear_notebook_update_time(None::<Timestamp>);
13727 /// ```
13728 pub fn set_or_clear_notebook_update_time<T>(mut self, v: std::option::Option<T>) -> Self
13729 where
13730 T: std::convert::Into<wkt::Timestamp>,
13731 {
13732 self.notebook_update_time = v.map(|x| x.into());
13733 self
13734 }
13735}
13736
13737impl wkt::message::Message for Notebook {
13738 fn typename() -> &'static str {
13739 "type.googleapis.com/google.cloud.securitycenter.v2.Notebook"
13740 }
13741}
13742
13743/// Cloud Security Command Center (Cloud SCC) notification configs.
13744///
13745/// A notification config is a Cloud SCC resource that contains the configuration
13746/// to send notifications for create/update events of findings, assets and etc.
13747#[derive(Clone, Default, PartialEq)]
13748#[non_exhaustive]
13749pub struct NotificationConfig {
13750 /// Identifier. The relative resource name of this notification config. See:
13751 /// <https://cloud.google.com/apis/design/resource_names#relative_resource_name>
13752 /// The following list shows some examples:
13753 /// +
13754 /// `organizations/{organization_id}/locations/{location_id}/notificationConfigs/notify_public_bucket`
13755 /// +
13756 /// `folders/{folder_id}/locations/{location_id}/notificationConfigs/notify_public_bucket`
13757 /// +
13758 /// `projects/{project_id}/locations/{location_id}/notificationConfigs/notify_public_bucket`
13759 pub name: std::string::String,
13760
13761 /// The description of the notification config (max of 1024 characters).
13762 pub description: std::string::String,
13763
13764 /// The Pub/Sub topic to send notifications to. Its format is
13765 /// "projects/[project_id]/topics/[topic]".
13766 pub pubsub_topic: std::string::String,
13767
13768 /// Output only. The service account that needs "pubsub.topics.publish"
13769 /// permission to publish to the Pub/Sub topic.
13770 pub service_account: std::string::String,
13771
13772 /// Output only. The timestamp of when the notification config was last
13773 /// updated.
13774 pub update_time: std::option::Option<wkt::Timestamp>,
13775
13776 /// The config for triggering notifications.
13777 pub notify_config: std::option::Option<crate::model::notification_config::NotifyConfig>,
13778
13779 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13780}
13781
13782impl NotificationConfig {
13783 pub fn new() -> Self {
13784 std::default::Default::default()
13785 }
13786
13787 /// Sets the value of [name][crate::model::NotificationConfig::name].
13788 ///
13789 /// # Example
13790 /// ```ignore,no_run
13791 /// # use google_cloud_securitycenter_v2::model::NotificationConfig;
13792 /// let x = NotificationConfig::new().set_name("example");
13793 /// ```
13794 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13795 self.name = v.into();
13796 self
13797 }
13798
13799 /// Sets the value of [description][crate::model::NotificationConfig::description].
13800 ///
13801 /// # Example
13802 /// ```ignore,no_run
13803 /// # use google_cloud_securitycenter_v2::model::NotificationConfig;
13804 /// let x = NotificationConfig::new().set_description("example");
13805 /// ```
13806 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13807 self.description = v.into();
13808 self
13809 }
13810
13811 /// Sets the value of [pubsub_topic][crate::model::NotificationConfig::pubsub_topic].
13812 ///
13813 /// # Example
13814 /// ```ignore,no_run
13815 /// # use google_cloud_securitycenter_v2::model::NotificationConfig;
13816 /// let x = NotificationConfig::new().set_pubsub_topic("example");
13817 /// ```
13818 pub fn set_pubsub_topic<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13819 self.pubsub_topic = v.into();
13820 self
13821 }
13822
13823 /// Sets the value of [service_account][crate::model::NotificationConfig::service_account].
13824 ///
13825 /// # Example
13826 /// ```ignore,no_run
13827 /// # use google_cloud_securitycenter_v2::model::NotificationConfig;
13828 /// let x = NotificationConfig::new().set_service_account("example");
13829 /// ```
13830 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13831 self.service_account = v.into();
13832 self
13833 }
13834
13835 /// Sets the value of [update_time][crate::model::NotificationConfig::update_time].
13836 ///
13837 /// # Example
13838 /// ```ignore,no_run
13839 /// # use google_cloud_securitycenter_v2::model::NotificationConfig;
13840 /// use wkt::Timestamp;
13841 /// let x = NotificationConfig::new().set_update_time(Timestamp::default()/* use setters */);
13842 /// ```
13843 pub fn set_update_time<T>(mut self, v: T) -> Self
13844 where
13845 T: std::convert::Into<wkt::Timestamp>,
13846 {
13847 self.update_time = std::option::Option::Some(v.into());
13848 self
13849 }
13850
13851 /// Sets or clears the value of [update_time][crate::model::NotificationConfig::update_time].
13852 ///
13853 /// # Example
13854 /// ```ignore,no_run
13855 /// # use google_cloud_securitycenter_v2::model::NotificationConfig;
13856 /// use wkt::Timestamp;
13857 /// let x = NotificationConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
13858 /// let x = NotificationConfig::new().set_or_clear_update_time(None::<Timestamp>);
13859 /// ```
13860 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
13861 where
13862 T: std::convert::Into<wkt::Timestamp>,
13863 {
13864 self.update_time = v.map(|x| x.into());
13865 self
13866 }
13867
13868 /// Sets the value of [notify_config][crate::model::NotificationConfig::notify_config].
13869 ///
13870 /// Note that all the setters affecting `notify_config` are mutually
13871 /// exclusive.
13872 ///
13873 /// # Example
13874 /// ```ignore,no_run
13875 /// # use google_cloud_securitycenter_v2::model::NotificationConfig;
13876 /// use google_cloud_securitycenter_v2::model::notification_config::StreamingConfig;
13877 /// let x = NotificationConfig::new().set_notify_config(Some(
13878 /// google_cloud_securitycenter_v2::model::notification_config::NotifyConfig::StreamingConfig(StreamingConfig::default().into())));
13879 /// ```
13880 pub fn set_notify_config<
13881 T: std::convert::Into<std::option::Option<crate::model::notification_config::NotifyConfig>>,
13882 >(
13883 mut self,
13884 v: T,
13885 ) -> Self {
13886 self.notify_config = v.into();
13887 self
13888 }
13889
13890 /// The value of [notify_config][crate::model::NotificationConfig::notify_config]
13891 /// if it holds a `StreamingConfig`, `None` if the field is not set or
13892 /// holds a different branch.
13893 pub fn streaming_config(
13894 &self,
13895 ) -> std::option::Option<&std::boxed::Box<crate::model::notification_config::StreamingConfig>>
13896 {
13897 #[allow(unreachable_patterns)]
13898 self.notify_config.as_ref().and_then(|v| match v {
13899 crate::model::notification_config::NotifyConfig::StreamingConfig(v) => {
13900 std::option::Option::Some(v)
13901 }
13902 _ => std::option::Option::None,
13903 })
13904 }
13905
13906 /// Sets the value of [notify_config][crate::model::NotificationConfig::notify_config]
13907 /// to hold a `StreamingConfig`.
13908 ///
13909 /// Note that all the setters affecting `notify_config` are
13910 /// mutually exclusive.
13911 ///
13912 /// # Example
13913 /// ```ignore,no_run
13914 /// # use google_cloud_securitycenter_v2::model::NotificationConfig;
13915 /// use google_cloud_securitycenter_v2::model::notification_config::StreamingConfig;
13916 /// let x = NotificationConfig::new().set_streaming_config(StreamingConfig::default()/* use setters */);
13917 /// assert!(x.streaming_config().is_some());
13918 /// ```
13919 pub fn set_streaming_config<
13920 T: std::convert::Into<std::boxed::Box<crate::model::notification_config::StreamingConfig>>,
13921 >(
13922 mut self,
13923 v: T,
13924 ) -> Self {
13925 self.notify_config = std::option::Option::Some(
13926 crate::model::notification_config::NotifyConfig::StreamingConfig(v.into()),
13927 );
13928 self
13929 }
13930}
13931
13932impl wkt::message::Message for NotificationConfig {
13933 fn typename() -> &'static str {
13934 "type.googleapis.com/google.cloud.securitycenter.v2.NotificationConfig"
13935 }
13936}
13937
13938/// Defines additional types related to [NotificationConfig].
13939pub mod notification_config {
13940 #[allow(unused_imports)]
13941 use super::*;
13942
13943 /// The config for streaming-based notifications, which send each event as soon
13944 /// as it is detected.
13945 #[derive(Clone, Default, PartialEq)]
13946 #[non_exhaustive]
13947 pub struct StreamingConfig {
13948 /// Expression that defines the filter to apply across create/update events
13949 /// of assets or findings as specified by the event type. The expression is a
13950 /// list of zero or more restrictions combined via logical operators `AND`
13951 /// and `OR`. Parentheses are supported, and `OR` has higher precedence than
13952 /// `AND`.
13953 ///
13954 /// Restrictions have the form `<field> <operator> <value>` and may have a
13955 /// `-` character in front of them to indicate negation. The fields map to
13956 /// those defined in the corresponding resource.
13957 ///
13958 /// The supported operators are:
13959 ///
13960 /// * `=` for all value types.
13961 /// * `>`, `<`, `>=`, `<=` for integer values.
13962 /// * `:`, meaning substring matching, for strings.
13963 ///
13964 /// The supported value types are:
13965 ///
13966 /// * string literals in quotes.
13967 /// * integer literals without quotes.
13968 /// * boolean literals `true` and `false` without quotes.
13969 pub filter: std::string::String,
13970
13971 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13972 }
13973
13974 impl StreamingConfig {
13975 pub fn new() -> Self {
13976 std::default::Default::default()
13977 }
13978
13979 /// Sets the value of [filter][crate::model::notification_config::StreamingConfig::filter].
13980 ///
13981 /// # Example
13982 /// ```ignore,no_run
13983 /// # use google_cloud_securitycenter_v2::model::notification_config::StreamingConfig;
13984 /// let x = StreamingConfig::new().set_filter("example");
13985 /// ```
13986 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13987 self.filter = v.into();
13988 self
13989 }
13990 }
13991
13992 impl wkt::message::Message for StreamingConfig {
13993 fn typename() -> &'static str {
13994 "type.googleapis.com/google.cloud.securitycenter.v2.NotificationConfig.StreamingConfig"
13995 }
13996 }
13997
13998 /// The config for triggering notifications.
13999 #[derive(Clone, Debug, PartialEq)]
14000 #[non_exhaustive]
14001 pub enum NotifyConfig {
14002 /// The config for triggering streaming-based notifications.
14003 StreamingConfig(std::boxed::Box<crate::model::notification_config::StreamingConfig>),
14004 }
14005}
14006
14007/// Cloud SCC's Notification
14008#[derive(Clone, Default, PartialEq)]
14009#[non_exhaustive]
14010pub struct NotificationMessage {
14011 /// Name of the notification config that generated current notification.
14012 pub notification_config_name: std::string::String,
14013
14014 /// The Cloud resource tied to this notification's Finding.
14015 pub resource: std::option::Option<crate::model::Resource>,
14016
14017 /// Notification Event.
14018 pub event: std::option::Option<crate::model::notification_message::Event>,
14019
14020 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14021}
14022
14023impl NotificationMessage {
14024 pub fn new() -> Self {
14025 std::default::Default::default()
14026 }
14027
14028 /// Sets the value of [notification_config_name][crate::model::NotificationMessage::notification_config_name].
14029 ///
14030 /// # Example
14031 /// ```ignore,no_run
14032 /// # use google_cloud_securitycenter_v2::model::NotificationMessage;
14033 /// let x = NotificationMessage::new().set_notification_config_name("example");
14034 /// ```
14035 pub fn set_notification_config_name<T: std::convert::Into<std::string::String>>(
14036 mut self,
14037 v: T,
14038 ) -> Self {
14039 self.notification_config_name = v.into();
14040 self
14041 }
14042
14043 /// Sets the value of [resource][crate::model::NotificationMessage::resource].
14044 ///
14045 /// # Example
14046 /// ```ignore,no_run
14047 /// # use google_cloud_securitycenter_v2::model::NotificationMessage;
14048 /// use google_cloud_securitycenter_v2::model::Resource;
14049 /// let x = NotificationMessage::new().set_resource(Resource::default()/* use setters */);
14050 /// ```
14051 pub fn set_resource<T>(mut self, v: T) -> Self
14052 where
14053 T: std::convert::Into<crate::model::Resource>,
14054 {
14055 self.resource = std::option::Option::Some(v.into());
14056 self
14057 }
14058
14059 /// Sets or clears the value of [resource][crate::model::NotificationMessage::resource].
14060 ///
14061 /// # Example
14062 /// ```ignore,no_run
14063 /// # use google_cloud_securitycenter_v2::model::NotificationMessage;
14064 /// use google_cloud_securitycenter_v2::model::Resource;
14065 /// let x = NotificationMessage::new().set_or_clear_resource(Some(Resource::default()/* use setters */));
14066 /// let x = NotificationMessage::new().set_or_clear_resource(None::<Resource>);
14067 /// ```
14068 pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
14069 where
14070 T: std::convert::Into<crate::model::Resource>,
14071 {
14072 self.resource = v.map(|x| x.into());
14073 self
14074 }
14075
14076 /// Sets the value of [event][crate::model::NotificationMessage::event].
14077 ///
14078 /// Note that all the setters affecting `event` are mutually
14079 /// exclusive.
14080 ///
14081 /// # Example
14082 /// ```ignore,no_run
14083 /// # use google_cloud_securitycenter_v2::model::NotificationMessage;
14084 /// use google_cloud_securitycenter_v2::model::Finding;
14085 /// let x = NotificationMessage::new().set_event(Some(
14086 /// google_cloud_securitycenter_v2::model::notification_message::Event::Finding(Finding::default().into())));
14087 /// ```
14088 pub fn set_event<
14089 T: std::convert::Into<std::option::Option<crate::model::notification_message::Event>>,
14090 >(
14091 mut self,
14092 v: T,
14093 ) -> Self {
14094 self.event = v.into();
14095 self
14096 }
14097
14098 /// The value of [event][crate::model::NotificationMessage::event]
14099 /// if it holds a `Finding`, `None` if the field is not set or
14100 /// holds a different branch.
14101 pub fn finding(&self) -> std::option::Option<&std::boxed::Box<crate::model::Finding>> {
14102 #[allow(unreachable_patterns)]
14103 self.event.as_ref().and_then(|v| match v {
14104 crate::model::notification_message::Event::Finding(v) => std::option::Option::Some(v),
14105 _ => std::option::Option::None,
14106 })
14107 }
14108
14109 /// Sets the value of [event][crate::model::NotificationMessage::event]
14110 /// to hold a `Finding`.
14111 ///
14112 /// Note that all the setters affecting `event` are
14113 /// mutually exclusive.
14114 ///
14115 /// # Example
14116 /// ```ignore,no_run
14117 /// # use google_cloud_securitycenter_v2::model::NotificationMessage;
14118 /// use google_cloud_securitycenter_v2::model::Finding;
14119 /// let x = NotificationMessage::new().set_finding(Finding::default()/* use setters */);
14120 /// assert!(x.finding().is_some());
14121 /// ```
14122 pub fn set_finding<T: std::convert::Into<std::boxed::Box<crate::model::Finding>>>(
14123 mut self,
14124 v: T,
14125 ) -> Self {
14126 self.event =
14127 std::option::Option::Some(crate::model::notification_message::Event::Finding(v.into()));
14128 self
14129 }
14130}
14131
14132impl wkt::message::Message for NotificationMessage {
14133 fn typename() -> &'static str {
14134 "type.googleapis.com/google.cloud.securitycenter.v2.NotificationMessage"
14135 }
14136}
14137
14138/// Defines additional types related to [NotificationMessage].
14139pub mod notification_message {
14140 #[allow(unused_imports)]
14141 use super::*;
14142
14143 /// Notification Event.
14144 #[derive(Clone, Debug, PartialEq)]
14145 #[non_exhaustive]
14146 pub enum Event {
14147 /// If it's a Finding based notification config, this field will be
14148 /// populated.
14149 Finding(std::boxed::Box<crate::model::Finding>),
14150 }
14151}
14152
14153/// Contains information about the org policies associated with the finding.
14154#[derive(Clone, Default, PartialEq)]
14155#[non_exhaustive]
14156pub struct OrgPolicy {
14157 /// Identifier. The resource name of the org policy.
14158 /// Example:
14159 /// "organizations/{organization_id}/policies/{constraint_name}"
14160 pub name: std::string::String,
14161
14162 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14163}
14164
14165impl OrgPolicy {
14166 pub fn new() -> Self {
14167 std::default::Default::default()
14168 }
14169
14170 /// Sets the value of [name][crate::model::OrgPolicy::name].
14171 ///
14172 /// # Example
14173 /// ```ignore,no_run
14174 /// # use google_cloud_securitycenter_v2::model::OrgPolicy;
14175 /// let x = OrgPolicy::new().set_name("example");
14176 /// ```
14177 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14178 self.name = v.into();
14179 self
14180 }
14181}
14182
14183impl wkt::message::Message for OrgPolicy {
14184 fn typename() -> &'static str {
14185 "type.googleapis.com/google.cloud.securitycenter.v2.OrgPolicy"
14186 }
14187}
14188
14189/// Represents an operating system process.
14190#[derive(Clone, Default, PartialEq)]
14191#[non_exhaustive]
14192pub struct Process {
14193 /// The process name, as displayed in utilities like `top` and `ps`. This name
14194 /// can be accessed through `/proc/[pid]/comm` and changed with
14195 /// `prctl(PR_SET_NAME)`.
14196 pub name: std::string::String,
14197
14198 /// File information for the process executable.
14199 pub binary: std::option::Option<crate::model::File>,
14200
14201 /// File information for libraries loaded by the process.
14202 pub libraries: std::vec::Vec<crate::model::File>,
14203
14204 /// When the process represents the invocation of a script, `binary` provides
14205 /// information about the interpreter, while `script` provides information
14206 /// about the script file provided to the interpreter.
14207 pub script: std::option::Option<crate::model::File>,
14208
14209 /// Process arguments as JSON encoded strings.
14210 pub args: std::vec::Vec<std::string::String>,
14211
14212 /// True if `args` is incomplete.
14213 pub arguments_truncated: bool,
14214
14215 /// Process environment variables.
14216 pub env_variables: std::vec::Vec<crate::model::EnvironmentVariable>,
14217
14218 /// True if `env_variables` is incomplete.
14219 pub env_variables_truncated: bool,
14220
14221 /// The process ID.
14222 pub pid: i64,
14223
14224 /// The parent process ID.
14225 pub parent_pid: i64,
14226
14227 /// The ID of the user that executed the process. E.g. If this is the root user
14228 /// this will always be 0.
14229 pub user_id: i64,
14230
14231 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14232}
14233
14234impl Process {
14235 pub fn new() -> Self {
14236 std::default::Default::default()
14237 }
14238
14239 /// Sets the value of [name][crate::model::Process::name].
14240 ///
14241 /// # Example
14242 /// ```ignore,no_run
14243 /// # use google_cloud_securitycenter_v2::model::Process;
14244 /// let x = Process::new().set_name("example");
14245 /// ```
14246 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14247 self.name = v.into();
14248 self
14249 }
14250
14251 /// Sets the value of [binary][crate::model::Process::binary].
14252 ///
14253 /// # Example
14254 /// ```ignore,no_run
14255 /// # use google_cloud_securitycenter_v2::model::Process;
14256 /// use google_cloud_securitycenter_v2::model::File;
14257 /// let x = Process::new().set_binary(File::default()/* use setters */);
14258 /// ```
14259 pub fn set_binary<T>(mut self, v: T) -> Self
14260 where
14261 T: std::convert::Into<crate::model::File>,
14262 {
14263 self.binary = std::option::Option::Some(v.into());
14264 self
14265 }
14266
14267 /// Sets or clears the value of [binary][crate::model::Process::binary].
14268 ///
14269 /// # Example
14270 /// ```ignore,no_run
14271 /// # use google_cloud_securitycenter_v2::model::Process;
14272 /// use google_cloud_securitycenter_v2::model::File;
14273 /// let x = Process::new().set_or_clear_binary(Some(File::default()/* use setters */));
14274 /// let x = Process::new().set_or_clear_binary(None::<File>);
14275 /// ```
14276 pub fn set_or_clear_binary<T>(mut self, v: std::option::Option<T>) -> Self
14277 where
14278 T: std::convert::Into<crate::model::File>,
14279 {
14280 self.binary = v.map(|x| x.into());
14281 self
14282 }
14283
14284 /// Sets the value of [libraries][crate::model::Process::libraries].
14285 ///
14286 /// # Example
14287 /// ```ignore,no_run
14288 /// # use google_cloud_securitycenter_v2::model::Process;
14289 /// use google_cloud_securitycenter_v2::model::File;
14290 /// let x = Process::new()
14291 /// .set_libraries([
14292 /// File::default()/* use setters */,
14293 /// File::default()/* use (different) setters */,
14294 /// ]);
14295 /// ```
14296 pub fn set_libraries<T, V>(mut self, v: T) -> Self
14297 where
14298 T: std::iter::IntoIterator<Item = V>,
14299 V: std::convert::Into<crate::model::File>,
14300 {
14301 use std::iter::Iterator;
14302 self.libraries = v.into_iter().map(|i| i.into()).collect();
14303 self
14304 }
14305
14306 /// Sets the value of [script][crate::model::Process::script].
14307 ///
14308 /// # Example
14309 /// ```ignore,no_run
14310 /// # use google_cloud_securitycenter_v2::model::Process;
14311 /// use google_cloud_securitycenter_v2::model::File;
14312 /// let x = Process::new().set_script(File::default()/* use setters */);
14313 /// ```
14314 pub fn set_script<T>(mut self, v: T) -> Self
14315 where
14316 T: std::convert::Into<crate::model::File>,
14317 {
14318 self.script = std::option::Option::Some(v.into());
14319 self
14320 }
14321
14322 /// Sets or clears the value of [script][crate::model::Process::script].
14323 ///
14324 /// # Example
14325 /// ```ignore,no_run
14326 /// # use google_cloud_securitycenter_v2::model::Process;
14327 /// use google_cloud_securitycenter_v2::model::File;
14328 /// let x = Process::new().set_or_clear_script(Some(File::default()/* use setters */));
14329 /// let x = Process::new().set_or_clear_script(None::<File>);
14330 /// ```
14331 pub fn set_or_clear_script<T>(mut self, v: std::option::Option<T>) -> Self
14332 where
14333 T: std::convert::Into<crate::model::File>,
14334 {
14335 self.script = v.map(|x| x.into());
14336 self
14337 }
14338
14339 /// Sets the value of [args][crate::model::Process::args].
14340 ///
14341 /// # Example
14342 /// ```ignore,no_run
14343 /// # use google_cloud_securitycenter_v2::model::Process;
14344 /// let x = Process::new().set_args(["a", "b", "c"]);
14345 /// ```
14346 pub fn set_args<T, V>(mut self, v: T) -> Self
14347 where
14348 T: std::iter::IntoIterator<Item = V>,
14349 V: std::convert::Into<std::string::String>,
14350 {
14351 use std::iter::Iterator;
14352 self.args = v.into_iter().map(|i| i.into()).collect();
14353 self
14354 }
14355
14356 /// Sets the value of [arguments_truncated][crate::model::Process::arguments_truncated].
14357 ///
14358 /// # Example
14359 /// ```ignore,no_run
14360 /// # use google_cloud_securitycenter_v2::model::Process;
14361 /// let x = Process::new().set_arguments_truncated(true);
14362 /// ```
14363 pub fn set_arguments_truncated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14364 self.arguments_truncated = v.into();
14365 self
14366 }
14367
14368 /// Sets the value of [env_variables][crate::model::Process::env_variables].
14369 ///
14370 /// # Example
14371 /// ```ignore,no_run
14372 /// # use google_cloud_securitycenter_v2::model::Process;
14373 /// use google_cloud_securitycenter_v2::model::EnvironmentVariable;
14374 /// let x = Process::new()
14375 /// .set_env_variables([
14376 /// EnvironmentVariable::default()/* use setters */,
14377 /// EnvironmentVariable::default()/* use (different) setters */,
14378 /// ]);
14379 /// ```
14380 pub fn set_env_variables<T, V>(mut self, v: T) -> Self
14381 where
14382 T: std::iter::IntoIterator<Item = V>,
14383 V: std::convert::Into<crate::model::EnvironmentVariable>,
14384 {
14385 use std::iter::Iterator;
14386 self.env_variables = v.into_iter().map(|i| i.into()).collect();
14387 self
14388 }
14389
14390 /// Sets the value of [env_variables_truncated][crate::model::Process::env_variables_truncated].
14391 ///
14392 /// # Example
14393 /// ```ignore,no_run
14394 /// # use google_cloud_securitycenter_v2::model::Process;
14395 /// let x = Process::new().set_env_variables_truncated(true);
14396 /// ```
14397 pub fn set_env_variables_truncated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14398 self.env_variables_truncated = v.into();
14399 self
14400 }
14401
14402 /// Sets the value of [pid][crate::model::Process::pid].
14403 ///
14404 /// # Example
14405 /// ```ignore,no_run
14406 /// # use google_cloud_securitycenter_v2::model::Process;
14407 /// let x = Process::new().set_pid(42);
14408 /// ```
14409 pub fn set_pid<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14410 self.pid = v.into();
14411 self
14412 }
14413
14414 /// Sets the value of [parent_pid][crate::model::Process::parent_pid].
14415 ///
14416 /// # Example
14417 /// ```ignore,no_run
14418 /// # use google_cloud_securitycenter_v2::model::Process;
14419 /// let x = Process::new().set_parent_pid(42);
14420 /// ```
14421 pub fn set_parent_pid<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14422 self.parent_pid = v.into();
14423 self
14424 }
14425
14426 /// Sets the value of [user_id][crate::model::Process::user_id].
14427 ///
14428 /// # Example
14429 /// ```ignore,no_run
14430 /// # use google_cloud_securitycenter_v2::model::Process;
14431 /// let x = Process::new().set_user_id(42);
14432 /// ```
14433 pub fn set_user_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14434 self.user_id = v.into();
14435 self
14436 }
14437}
14438
14439impl wkt::message::Message for Process {
14440 fn typename() -> &'static str {
14441 "type.googleapis.com/google.cloud.securitycenter.v2.Process"
14442 }
14443}
14444
14445/// A name-value pair representing an environment variable used in an operating
14446/// system process.
14447#[derive(Clone, Default, PartialEq)]
14448#[non_exhaustive]
14449pub struct EnvironmentVariable {
14450 /// Environment variable name as a JSON encoded string.
14451 pub name: std::string::String,
14452
14453 /// Environment variable value as a JSON encoded string.
14454 pub val: std::string::String,
14455
14456 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14457}
14458
14459impl EnvironmentVariable {
14460 pub fn new() -> Self {
14461 std::default::Default::default()
14462 }
14463
14464 /// Sets the value of [name][crate::model::EnvironmentVariable::name].
14465 ///
14466 /// # Example
14467 /// ```ignore,no_run
14468 /// # use google_cloud_securitycenter_v2::model::EnvironmentVariable;
14469 /// let x = EnvironmentVariable::new().set_name("example");
14470 /// ```
14471 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14472 self.name = v.into();
14473 self
14474 }
14475
14476 /// Sets the value of [val][crate::model::EnvironmentVariable::val].
14477 ///
14478 /// # Example
14479 /// ```ignore,no_run
14480 /// # use google_cloud_securitycenter_v2::model::EnvironmentVariable;
14481 /// let x = EnvironmentVariable::new().set_val("example");
14482 /// ```
14483 pub fn set_val<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14484 self.val = v.into();
14485 self
14486 }
14487}
14488
14489impl wkt::message::Message for EnvironmentVariable {
14490 fn typename() -> &'static str {
14491 "type.googleapis.com/google.cloud.securitycenter.v2.EnvironmentVariable"
14492 }
14493}
14494
14495/// Information related to the Google Cloud resource.
14496#[derive(Clone, Default, PartialEq)]
14497#[non_exhaustive]
14498pub struct Resource {
14499 /// The full resource name of the resource. See:
14500 /// <https://cloud.google.com/apis/design/resource_names#full_resource_name>
14501 pub name: std::string::String,
14502
14503 /// The human readable name of the resource.
14504 pub display_name: std::string::String,
14505
14506 /// The full resource type of the resource.
14507 pub r#type: std::string::String,
14508
14509 /// Indicates which cloud provider the finding is from.
14510 pub cloud_provider: crate::model::CloudProvider,
14511
14512 /// The service or resource provider associated with the resource.
14513 pub service: std::string::String,
14514
14515 /// The region or location of the service (if applicable).
14516 pub location: std::string::String,
14517
14518 /// Provides the path to the resource within the resource hierarchy.
14519 pub resource_path: std::option::Option<crate::model::ResourcePath>,
14520
14521 /// A string representation of the resource path.
14522 /// For Google Cloud, it has the format of
14523 /// `organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}`
14524 /// where there can be any number of folders.
14525 /// For AWS, it has the format of
14526 /// `org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}`
14527 /// where there can be any number of organizational units.
14528 /// For Azure, it has the format of
14529 /// `mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}`
14530 /// where there can be any number of management groups.
14531 pub resource_path_string: std::string::String,
14532
14533 /// The metadata associated with the cloud provider.
14534 pub cloud_provider_metadata: std::option::Option<crate::model::resource::CloudProviderMetadata>,
14535
14536 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14537}
14538
14539impl Resource {
14540 pub fn new() -> Self {
14541 std::default::Default::default()
14542 }
14543
14544 /// Sets the value of [name][crate::model::Resource::name].
14545 ///
14546 /// # Example
14547 /// ```ignore,no_run
14548 /// # use google_cloud_securitycenter_v2::model::Resource;
14549 /// let x = Resource::new().set_name("example");
14550 /// ```
14551 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14552 self.name = v.into();
14553 self
14554 }
14555
14556 /// Sets the value of [display_name][crate::model::Resource::display_name].
14557 ///
14558 /// # Example
14559 /// ```ignore,no_run
14560 /// # use google_cloud_securitycenter_v2::model::Resource;
14561 /// let x = Resource::new().set_display_name("example");
14562 /// ```
14563 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14564 self.display_name = v.into();
14565 self
14566 }
14567
14568 /// Sets the value of [r#type][crate::model::Resource::type].
14569 ///
14570 /// # Example
14571 /// ```ignore,no_run
14572 /// # use google_cloud_securitycenter_v2::model::Resource;
14573 /// let x = Resource::new().set_type("example");
14574 /// ```
14575 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14576 self.r#type = v.into();
14577 self
14578 }
14579
14580 /// Sets the value of [cloud_provider][crate::model::Resource::cloud_provider].
14581 ///
14582 /// # Example
14583 /// ```ignore,no_run
14584 /// # use google_cloud_securitycenter_v2::model::Resource;
14585 /// use google_cloud_securitycenter_v2::model::CloudProvider;
14586 /// let x0 = Resource::new().set_cloud_provider(CloudProvider::GoogleCloudPlatform);
14587 /// let x1 = Resource::new().set_cloud_provider(CloudProvider::AmazonWebServices);
14588 /// let x2 = Resource::new().set_cloud_provider(CloudProvider::MicrosoftAzure);
14589 /// ```
14590 pub fn set_cloud_provider<T: std::convert::Into<crate::model::CloudProvider>>(
14591 mut self,
14592 v: T,
14593 ) -> Self {
14594 self.cloud_provider = v.into();
14595 self
14596 }
14597
14598 /// Sets the value of [service][crate::model::Resource::service].
14599 ///
14600 /// # Example
14601 /// ```ignore,no_run
14602 /// # use google_cloud_securitycenter_v2::model::Resource;
14603 /// let x = Resource::new().set_service("example");
14604 /// ```
14605 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14606 self.service = v.into();
14607 self
14608 }
14609
14610 /// Sets the value of [location][crate::model::Resource::location].
14611 ///
14612 /// # Example
14613 /// ```ignore,no_run
14614 /// # use google_cloud_securitycenter_v2::model::Resource;
14615 /// let x = Resource::new().set_location("example");
14616 /// ```
14617 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14618 self.location = v.into();
14619 self
14620 }
14621
14622 /// Sets the value of [resource_path][crate::model::Resource::resource_path].
14623 ///
14624 /// # Example
14625 /// ```ignore,no_run
14626 /// # use google_cloud_securitycenter_v2::model::Resource;
14627 /// use google_cloud_securitycenter_v2::model::ResourcePath;
14628 /// let x = Resource::new().set_resource_path(ResourcePath::default()/* use setters */);
14629 /// ```
14630 pub fn set_resource_path<T>(mut self, v: T) -> Self
14631 where
14632 T: std::convert::Into<crate::model::ResourcePath>,
14633 {
14634 self.resource_path = std::option::Option::Some(v.into());
14635 self
14636 }
14637
14638 /// Sets or clears the value of [resource_path][crate::model::Resource::resource_path].
14639 ///
14640 /// # Example
14641 /// ```ignore,no_run
14642 /// # use google_cloud_securitycenter_v2::model::Resource;
14643 /// use google_cloud_securitycenter_v2::model::ResourcePath;
14644 /// let x = Resource::new().set_or_clear_resource_path(Some(ResourcePath::default()/* use setters */));
14645 /// let x = Resource::new().set_or_clear_resource_path(None::<ResourcePath>);
14646 /// ```
14647 pub fn set_or_clear_resource_path<T>(mut self, v: std::option::Option<T>) -> Self
14648 where
14649 T: std::convert::Into<crate::model::ResourcePath>,
14650 {
14651 self.resource_path = v.map(|x| x.into());
14652 self
14653 }
14654
14655 /// Sets the value of [resource_path_string][crate::model::Resource::resource_path_string].
14656 ///
14657 /// # Example
14658 /// ```ignore,no_run
14659 /// # use google_cloud_securitycenter_v2::model::Resource;
14660 /// let x = Resource::new().set_resource_path_string("example");
14661 /// ```
14662 pub fn set_resource_path_string<T: std::convert::Into<std::string::String>>(
14663 mut self,
14664 v: T,
14665 ) -> Self {
14666 self.resource_path_string = v.into();
14667 self
14668 }
14669
14670 /// Sets the value of [cloud_provider_metadata][crate::model::Resource::cloud_provider_metadata].
14671 ///
14672 /// Note that all the setters affecting `cloud_provider_metadata` are mutually
14673 /// exclusive.
14674 ///
14675 /// # Example
14676 /// ```ignore,no_run
14677 /// # use google_cloud_securitycenter_v2::model::Resource;
14678 /// use google_cloud_securitycenter_v2::model::GcpMetadata;
14679 /// let x = Resource::new().set_cloud_provider_metadata(Some(
14680 /// google_cloud_securitycenter_v2::model::resource::CloudProviderMetadata::GcpMetadata(GcpMetadata::default().into())));
14681 /// ```
14682 pub fn set_cloud_provider_metadata<
14683 T: std::convert::Into<std::option::Option<crate::model::resource::CloudProviderMetadata>>,
14684 >(
14685 mut self,
14686 v: T,
14687 ) -> Self {
14688 self.cloud_provider_metadata = v.into();
14689 self
14690 }
14691
14692 /// The value of [cloud_provider_metadata][crate::model::Resource::cloud_provider_metadata]
14693 /// if it holds a `GcpMetadata`, `None` if the field is not set or
14694 /// holds a different branch.
14695 pub fn gcp_metadata(&self) -> std::option::Option<&std::boxed::Box<crate::model::GcpMetadata>> {
14696 #[allow(unreachable_patterns)]
14697 self.cloud_provider_metadata.as_ref().and_then(|v| match v {
14698 crate::model::resource::CloudProviderMetadata::GcpMetadata(v) => {
14699 std::option::Option::Some(v)
14700 }
14701 _ => std::option::Option::None,
14702 })
14703 }
14704
14705 /// Sets the value of [cloud_provider_metadata][crate::model::Resource::cloud_provider_metadata]
14706 /// to hold a `GcpMetadata`.
14707 ///
14708 /// Note that all the setters affecting `cloud_provider_metadata` are
14709 /// mutually exclusive.
14710 ///
14711 /// # Example
14712 /// ```ignore,no_run
14713 /// # use google_cloud_securitycenter_v2::model::Resource;
14714 /// use google_cloud_securitycenter_v2::model::GcpMetadata;
14715 /// let x = Resource::new().set_gcp_metadata(GcpMetadata::default()/* use setters */);
14716 /// assert!(x.gcp_metadata().is_some());
14717 /// assert!(x.aws_metadata().is_none());
14718 /// assert!(x.azure_metadata().is_none());
14719 /// ```
14720 pub fn set_gcp_metadata<T: std::convert::Into<std::boxed::Box<crate::model::GcpMetadata>>>(
14721 mut self,
14722 v: T,
14723 ) -> Self {
14724 self.cloud_provider_metadata = std::option::Option::Some(
14725 crate::model::resource::CloudProviderMetadata::GcpMetadata(v.into()),
14726 );
14727 self
14728 }
14729
14730 /// The value of [cloud_provider_metadata][crate::model::Resource::cloud_provider_metadata]
14731 /// if it holds a `AwsMetadata`, `None` if the field is not set or
14732 /// holds a different branch.
14733 pub fn aws_metadata(&self) -> std::option::Option<&std::boxed::Box<crate::model::AwsMetadata>> {
14734 #[allow(unreachable_patterns)]
14735 self.cloud_provider_metadata.as_ref().and_then(|v| match v {
14736 crate::model::resource::CloudProviderMetadata::AwsMetadata(v) => {
14737 std::option::Option::Some(v)
14738 }
14739 _ => std::option::Option::None,
14740 })
14741 }
14742
14743 /// Sets the value of [cloud_provider_metadata][crate::model::Resource::cloud_provider_metadata]
14744 /// to hold a `AwsMetadata`.
14745 ///
14746 /// Note that all the setters affecting `cloud_provider_metadata` are
14747 /// mutually exclusive.
14748 ///
14749 /// # Example
14750 /// ```ignore,no_run
14751 /// # use google_cloud_securitycenter_v2::model::Resource;
14752 /// use google_cloud_securitycenter_v2::model::AwsMetadata;
14753 /// let x = Resource::new().set_aws_metadata(AwsMetadata::default()/* use setters */);
14754 /// assert!(x.aws_metadata().is_some());
14755 /// assert!(x.gcp_metadata().is_none());
14756 /// assert!(x.azure_metadata().is_none());
14757 /// ```
14758 pub fn set_aws_metadata<T: std::convert::Into<std::boxed::Box<crate::model::AwsMetadata>>>(
14759 mut self,
14760 v: T,
14761 ) -> Self {
14762 self.cloud_provider_metadata = std::option::Option::Some(
14763 crate::model::resource::CloudProviderMetadata::AwsMetadata(v.into()),
14764 );
14765 self
14766 }
14767
14768 /// The value of [cloud_provider_metadata][crate::model::Resource::cloud_provider_metadata]
14769 /// if it holds a `AzureMetadata`, `None` if the field is not set or
14770 /// holds a different branch.
14771 pub fn azure_metadata(
14772 &self,
14773 ) -> std::option::Option<&std::boxed::Box<crate::model::AzureMetadata>> {
14774 #[allow(unreachable_patterns)]
14775 self.cloud_provider_metadata.as_ref().and_then(|v| match v {
14776 crate::model::resource::CloudProviderMetadata::AzureMetadata(v) => {
14777 std::option::Option::Some(v)
14778 }
14779 _ => std::option::Option::None,
14780 })
14781 }
14782
14783 /// Sets the value of [cloud_provider_metadata][crate::model::Resource::cloud_provider_metadata]
14784 /// to hold a `AzureMetadata`.
14785 ///
14786 /// Note that all the setters affecting `cloud_provider_metadata` are
14787 /// mutually exclusive.
14788 ///
14789 /// # Example
14790 /// ```ignore,no_run
14791 /// # use google_cloud_securitycenter_v2::model::Resource;
14792 /// use google_cloud_securitycenter_v2::model::AzureMetadata;
14793 /// let x = Resource::new().set_azure_metadata(AzureMetadata::default()/* use setters */);
14794 /// assert!(x.azure_metadata().is_some());
14795 /// assert!(x.gcp_metadata().is_none());
14796 /// assert!(x.aws_metadata().is_none());
14797 /// ```
14798 pub fn set_azure_metadata<
14799 T: std::convert::Into<std::boxed::Box<crate::model::AzureMetadata>>,
14800 >(
14801 mut self,
14802 v: T,
14803 ) -> Self {
14804 self.cloud_provider_metadata = std::option::Option::Some(
14805 crate::model::resource::CloudProviderMetadata::AzureMetadata(v.into()),
14806 );
14807 self
14808 }
14809}
14810
14811impl wkt::message::Message for Resource {
14812 fn typename() -> &'static str {
14813 "type.googleapis.com/google.cloud.securitycenter.v2.Resource"
14814 }
14815}
14816
14817/// Defines additional types related to [Resource].
14818pub mod resource {
14819 #[allow(unused_imports)]
14820 use super::*;
14821
14822 /// The metadata associated with the cloud provider.
14823 #[derive(Clone, Debug, PartialEq)]
14824 #[non_exhaustive]
14825 pub enum CloudProviderMetadata {
14826 /// The GCP metadata associated with the finding.
14827 GcpMetadata(std::boxed::Box<crate::model::GcpMetadata>),
14828 /// The AWS metadata associated with the finding.
14829 AwsMetadata(std::boxed::Box<crate::model::AwsMetadata>),
14830 /// The Azure metadata associated with the finding.
14831 AzureMetadata(std::boxed::Box<crate::model::AzureMetadata>),
14832 }
14833}
14834
14835/// Google Cloud metadata associated with the resource. Only applicable if the
14836/// finding's cloud provider is Google Cloud.
14837#[derive(Clone, Default, PartialEq)]
14838#[non_exhaustive]
14839pub struct GcpMetadata {
14840 /// The full resource name of project that the resource belongs to.
14841 pub project: std::string::String,
14842
14843 /// The project ID that the resource belongs to.
14844 pub project_display_name: std::string::String,
14845
14846 /// The full resource name of resource's parent.
14847 pub parent: std::string::String,
14848
14849 /// The human readable name of resource's parent.
14850 pub parent_display_name: std::string::String,
14851
14852 /// Output only. Contains a Folder message for each folder in the assets
14853 /// ancestry. The first folder is the deepest nested folder, and the last
14854 /// folder is the folder directly under the Organization.
14855 pub folders: std::vec::Vec<crate::model::Folder>,
14856
14857 /// The name of the organization that the resource belongs to.
14858 pub organization: std::string::String,
14859
14860 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14861}
14862
14863impl GcpMetadata {
14864 pub fn new() -> Self {
14865 std::default::Default::default()
14866 }
14867
14868 /// Sets the value of [project][crate::model::GcpMetadata::project].
14869 ///
14870 /// # Example
14871 /// ```ignore,no_run
14872 /// # use google_cloud_securitycenter_v2::model::GcpMetadata;
14873 /// let x = GcpMetadata::new().set_project("example");
14874 /// ```
14875 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14876 self.project = v.into();
14877 self
14878 }
14879
14880 /// Sets the value of [project_display_name][crate::model::GcpMetadata::project_display_name].
14881 ///
14882 /// # Example
14883 /// ```ignore,no_run
14884 /// # use google_cloud_securitycenter_v2::model::GcpMetadata;
14885 /// let x = GcpMetadata::new().set_project_display_name("example");
14886 /// ```
14887 pub fn set_project_display_name<T: std::convert::Into<std::string::String>>(
14888 mut self,
14889 v: T,
14890 ) -> Self {
14891 self.project_display_name = v.into();
14892 self
14893 }
14894
14895 /// Sets the value of [parent][crate::model::GcpMetadata::parent].
14896 ///
14897 /// # Example
14898 /// ```ignore,no_run
14899 /// # use google_cloud_securitycenter_v2::model::GcpMetadata;
14900 /// let x = GcpMetadata::new().set_parent("example");
14901 /// ```
14902 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14903 self.parent = v.into();
14904 self
14905 }
14906
14907 /// Sets the value of [parent_display_name][crate::model::GcpMetadata::parent_display_name].
14908 ///
14909 /// # Example
14910 /// ```ignore,no_run
14911 /// # use google_cloud_securitycenter_v2::model::GcpMetadata;
14912 /// let x = GcpMetadata::new().set_parent_display_name("example");
14913 /// ```
14914 pub fn set_parent_display_name<T: std::convert::Into<std::string::String>>(
14915 mut self,
14916 v: T,
14917 ) -> Self {
14918 self.parent_display_name = v.into();
14919 self
14920 }
14921
14922 /// Sets the value of [folders][crate::model::GcpMetadata::folders].
14923 ///
14924 /// # Example
14925 /// ```ignore,no_run
14926 /// # use google_cloud_securitycenter_v2::model::GcpMetadata;
14927 /// use google_cloud_securitycenter_v2::model::Folder;
14928 /// let x = GcpMetadata::new()
14929 /// .set_folders([
14930 /// Folder::default()/* use setters */,
14931 /// Folder::default()/* use (different) setters */,
14932 /// ]);
14933 /// ```
14934 pub fn set_folders<T, V>(mut self, v: T) -> Self
14935 where
14936 T: std::iter::IntoIterator<Item = V>,
14937 V: std::convert::Into<crate::model::Folder>,
14938 {
14939 use std::iter::Iterator;
14940 self.folders = v.into_iter().map(|i| i.into()).collect();
14941 self
14942 }
14943
14944 /// Sets the value of [organization][crate::model::GcpMetadata::organization].
14945 ///
14946 /// # Example
14947 /// ```ignore,no_run
14948 /// # use google_cloud_securitycenter_v2::model::GcpMetadata;
14949 /// let x = GcpMetadata::new().set_organization("example");
14950 /// ```
14951 pub fn set_organization<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14952 self.organization = v.into();
14953 self
14954 }
14955}
14956
14957impl wkt::message::Message for GcpMetadata {
14958 fn typename() -> &'static str {
14959 "type.googleapis.com/google.cloud.securitycenter.v2.GcpMetadata"
14960 }
14961}
14962
14963/// AWS metadata associated with the resource, only applicable if the finding's
14964/// cloud provider is Amazon Web Services.
14965#[derive(Clone, Default, PartialEq)]
14966#[non_exhaustive]
14967pub struct AwsMetadata {
14968 /// The AWS organization associated with the resource.
14969 pub organization: std::option::Option<crate::model::aws_metadata::AwsOrganization>,
14970
14971 /// A list of AWS organizational units associated with the resource, ordered
14972 /// from lowest level (closest to the account) to highest level.
14973 pub organizational_units: std::vec::Vec<crate::model::aws_metadata::AwsOrganizationalUnit>,
14974
14975 /// The AWS account associated with the resource.
14976 pub account: std::option::Option<crate::model::aws_metadata::AwsAccount>,
14977
14978 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14979}
14980
14981impl AwsMetadata {
14982 pub fn new() -> Self {
14983 std::default::Default::default()
14984 }
14985
14986 /// Sets the value of [organization][crate::model::AwsMetadata::organization].
14987 ///
14988 /// # Example
14989 /// ```ignore,no_run
14990 /// # use google_cloud_securitycenter_v2::model::AwsMetadata;
14991 /// use google_cloud_securitycenter_v2::model::aws_metadata::AwsOrganization;
14992 /// let x = AwsMetadata::new().set_organization(AwsOrganization::default()/* use setters */);
14993 /// ```
14994 pub fn set_organization<T>(mut self, v: T) -> Self
14995 where
14996 T: std::convert::Into<crate::model::aws_metadata::AwsOrganization>,
14997 {
14998 self.organization = std::option::Option::Some(v.into());
14999 self
15000 }
15001
15002 /// Sets or clears the value of [organization][crate::model::AwsMetadata::organization].
15003 ///
15004 /// # Example
15005 /// ```ignore,no_run
15006 /// # use google_cloud_securitycenter_v2::model::AwsMetadata;
15007 /// use google_cloud_securitycenter_v2::model::aws_metadata::AwsOrganization;
15008 /// let x = AwsMetadata::new().set_or_clear_organization(Some(AwsOrganization::default()/* use setters */));
15009 /// let x = AwsMetadata::new().set_or_clear_organization(None::<AwsOrganization>);
15010 /// ```
15011 pub fn set_or_clear_organization<T>(mut self, v: std::option::Option<T>) -> Self
15012 where
15013 T: std::convert::Into<crate::model::aws_metadata::AwsOrganization>,
15014 {
15015 self.organization = v.map(|x| x.into());
15016 self
15017 }
15018
15019 /// Sets the value of [organizational_units][crate::model::AwsMetadata::organizational_units].
15020 ///
15021 /// # Example
15022 /// ```ignore,no_run
15023 /// # use google_cloud_securitycenter_v2::model::AwsMetadata;
15024 /// use google_cloud_securitycenter_v2::model::aws_metadata::AwsOrganizationalUnit;
15025 /// let x = AwsMetadata::new()
15026 /// .set_organizational_units([
15027 /// AwsOrganizationalUnit::default()/* use setters */,
15028 /// AwsOrganizationalUnit::default()/* use (different) setters */,
15029 /// ]);
15030 /// ```
15031 pub fn set_organizational_units<T, V>(mut self, v: T) -> Self
15032 where
15033 T: std::iter::IntoIterator<Item = V>,
15034 V: std::convert::Into<crate::model::aws_metadata::AwsOrganizationalUnit>,
15035 {
15036 use std::iter::Iterator;
15037 self.organizational_units = v.into_iter().map(|i| i.into()).collect();
15038 self
15039 }
15040
15041 /// Sets the value of [account][crate::model::AwsMetadata::account].
15042 ///
15043 /// # Example
15044 /// ```ignore,no_run
15045 /// # use google_cloud_securitycenter_v2::model::AwsMetadata;
15046 /// use google_cloud_securitycenter_v2::model::aws_metadata::AwsAccount;
15047 /// let x = AwsMetadata::new().set_account(AwsAccount::default()/* use setters */);
15048 /// ```
15049 pub fn set_account<T>(mut self, v: T) -> Self
15050 where
15051 T: std::convert::Into<crate::model::aws_metadata::AwsAccount>,
15052 {
15053 self.account = std::option::Option::Some(v.into());
15054 self
15055 }
15056
15057 /// Sets or clears the value of [account][crate::model::AwsMetadata::account].
15058 ///
15059 /// # Example
15060 /// ```ignore,no_run
15061 /// # use google_cloud_securitycenter_v2::model::AwsMetadata;
15062 /// use google_cloud_securitycenter_v2::model::aws_metadata::AwsAccount;
15063 /// let x = AwsMetadata::new().set_or_clear_account(Some(AwsAccount::default()/* use setters */));
15064 /// let x = AwsMetadata::new().set_or_clear_account(None::<AwsAccount>);
15065 /// ```
15066 pub fn set_or_clear_account<T>(mut self, v: std::option::Option<T>) -> Self
15067 where
15068 T: std::convert::Into<crate::model::aws_metadata::AwsAccount>,
15069 {
15070 self.account = v.map(|x| x.into());
15071 self
15072 }
15073}
15074
15075impl wkt::message::Message for AwsMetadata {
15076 fn typename() -> &'static str {
15077 "type.googleapis.com/google.cloud.securitycenter.v2.AwsMetadata"
15078 }
15079}
15080
15081/// Defines additional types related to [AwsMetadata].
15082pub mod aws_metadata {
15083 #[allow(unused_imports)]
15084 use super::*;
15085
15086 /// An organization is a collection of accounts that are centrally managed
15087 /// together using consolidated billing, organized hierarchically with
15088 /// organizational units (OUs), and controlled with policies.
15089 #[derive(Clone, Default, PartialEq)]
15090 #[non_exhaustive]
15091 pub struct AwsOrganization {
15092 /// The unique identifier (ID) for the organization. The regex pattern for an
15093 /// organization ID string requires "o-" followed by from 10 to 32 lowercase
15094 /// letters or digits.
15095 pub id: std::string::String,
15096
15097 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15098 }
15099
15100 impl AwsOrganization {
15101 pub fn new() -> Self {
15102 std::default::Default::default()
15103 }
15104
15105 /// Sets the value of [id][crate::model::aws_metadata::AwsOrganization::id].
15106 ///
15107 /// # Example
15108 /// ```ignore,no_run
15109 /// # use google_cloud_securitycenter_v2::model::aws_metadata::AwsOrganization;
15110 /// let x = AwsOrganization::new().set_id("example");
15111 /// ```
15112 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15113 self.id = v.into();
15114 self
15115 }
15116 }
15117
15118 impl wkt::message::Message for AwsOrganization {
15119 fn typename() -> &'static str {
15120 "type.googleapis.com/google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization"
15121 }
15122 }
15123
15124 /// An Organizational Unit (OU) is a container of AWS accounts within a root of
15125 /// an organization. Policies that are attached to an OU apply to all accounts
15126 /// contained in that OU and in any child OUs.
15127 #[derive(Clone, Default, PartialEq)]
15128 #[non_exhaustive]
15129 pub struct AwsOrganizationalUnit {
15130 /// The unique identifier (ID) associated with this OU. The regex pattern for
15131 /// an organizational unit ID string requires "ou-" followed by from 4 to 32
15132 /// lowercase letters or digits (the ID of the root that contains the OU).
15133 /// This string is followed by a second "-" dash and from 8 to 32 additional
15134 /// lowercase letters or digits. For example, "ou-ab12-cd34ef56".
15135 pub id: std::string::String,
15136
15137 /// The friendly name of the OU.
15138 pub name: std::string::String,
15139
15140 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15141 }
15142
15143 impl AwsOrganizationalUnit {
15144 pub fn new() -> Self {
15145 std::default::Default::default()
15146 }
15147
15148 /// Sets the value of [id][crate::model::aws_metadata::AwsOrganizationalUnit::id].
15149 ///
15150 /// # Example
15151 /// ```ignore,no_run
15152 /// # use google_cloud_securitycenter_v2::model::aws_metadata::AwsOrganizationalUnit;
15153 /// let x = AwsOrganizationalUnit::new().set_id("example");
15154 /// ```
15155 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15156 self.id = v.into();
15157 self
15158 }
15159
15160 /// Sets the value of [name][crate::model::aws_metadata::AwsOrganizationalUnit::name].
15161 ///
15162 /// # Example
15163 /// ```ignore,no_run
15164 /// # use google_cloud_securitycenter_v2::model::aws_metadata::AwsOrganizationalUnit;
15165 /// let x = AwsOrganizationalUnit::new().set_name("example");
15166 /// ```
15167 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15168 self.name = v.into();
15169 self
15170 }
15171 }
15172
15173 impl wkt::message::Message for AwsOrganizationalUnit {
15174 fn typename() -> &'static str {
15175 "type.googleapis.com/google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit"
15176 }
15177 }
15178
15179 /// An AWS account that is a member of an organization.
15180 #[derive(Clone, Default, PartialEq)]
15181 #[non_exhaustive]
15182 pub struct AwsAccount {
15183 /// The unique identifier (ID) of the account, containing exactly 12 digits.
15184 pub id: std::string::String,
15185
15186 /// The friendly name of this account.
15187 pub name: std::string::String,
15188
15189 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15190 }
15191
15192 impl AwsAccount {
15193 pub fn new() -> Self {
15194 std::default::Default::default()
15195 }
15196
15197 /// Sets the value of [id][crate::model::aws_metadata::AwsAccount::id].
15198 ///
15199 /// # Example
15200 /// ```ignore,no_run
15201 /// # use google_cloud_securitycenter_v2::model::aws_metadata::AwsAccount;
15202 /// let x = AwsAccount::new().set_id("example");
15203 /// ```
15204 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15205 self.id = v.into();
15206 self
15207 }
15208
15209 /// Sets the value of [name][crate::model::aws_metadata::AwsAccount::name].
15210 ///
15211 /// # Example
15212 /// ```ignore,no_run
15213 /// # use google_cloud_securitycenter_v2::model::aws_metadata::AwsAccount;
15214 /// let x = AwsAccount::new().set_name("example");
15215 /// ```
15216 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15217 self.name = v.into();
15218 self
15219 }
15220 }
15221
15222 impl wkt::message::Message for AwsAccount {
15223 fn typename() -> &'static str {
15224 "type.googleapis.com/google.cloud.securitycenter.v2.AwsMetadata.AwsAccount"
15225 }
15226 }
15227}
15228
15229/// Azure metadata associated with the resource, only applicable if the finding's
15230/// cloud provider is Microsoft Azure.
15231#[derive(Clone, Default, PartialEq)]
15232#[non_exhaustive]
15233pub struct AzureMetadata {
15234 /// A list of Azure management groups associated with the resource, ordered
15235 /// from lowest level (closest to the subscription) to highest level.
15236 pub management_groups: std::vec::Vec<crate::model::azure_metadata::AzureManagementGroup>,
15237
15238 /// The Azure subscription associated with the resource.
15239 pub subscription: std::option::Option<crate::model::azure_metadata::AzureSubscription>,
15240
15241 /// The Azure resource group associated with the resource.
15242 pub resource_group: std::option::Option<crate::model::azure_metadata::AzureResourceGroup>,
15243
15244 /// The Azure Entra tenant associated with the resource.
15245 pub tenant: std::option::Option<crate::model::azure_metadata::AzureTenant>,
15246
15247 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15248}
15249
15250impl AzureMetadata {
15251 pub fn new() -> Self {
15252 std::default::Default::default()
15253 }
15254
15255 /// Sets the value of [management_groups][crate::model::AzureMetadata::management_groups].
15256 ///
15257 /// # Example
15258 /// ```ignore,no_run
15259 /// # use google_cloud_securitycenter_v2::model::AzureMetadata;
15260 /// use google_cloud_securitycenter_v2::model::azure_metadata::AzureManagementGroup;
15261 /// let x = AzureMetadata::new()
15262 /// .set_management_groups([
15263 /// AzureManagementGroup::default()/* use setters */,
15264 /// AzureManagementGroup::default()/* use (different) setters */,
15265 /// ]);
15266 /// ```
15267 pub fn set_management_groups<T, V>(mut self, v: T) -> Self
15268 where
15269 T: std::iter::IntoIterator<Item = V>,
15270 V: std::convert::Into<crate::model::azure_metadata::AzureManagementGroup>,
15271 {
15272 use std::iter::Iterator;
15273 self.management_groups = v.into_iter().map(|i| i.into()).collect();
15274 self
15275 }
15276
15277 /// Sets the value of [subscription][crate::model::AzureMetadata::subscription].
15278 ///
15279 /// # Example
15280 /// ```ignore,no_run
15281 /// # use google_cloud_securitycenter_v2::model::AzureMetadata;
15282 /// use google_cloud_securitycenter_v2::model::azure_metadata::AzureSubscription;
15283 /// let x = AzureMetadata::new().set_subscription(AzureSubscription::default()/* use setters */);
15284 /// ```
15285 pub fn set_subscription<T>(mut self, v: T) -> Self
15286 where
15287 T: std::convert::Into<crate::model::azure_metadata::AzureSubscription>,
15288 {
15289 self.subscription = std::option::Option::Some(v.into());
15290 self
15291 }
15292
15293 /// Sets or clears the value of [subscription][crate::model::AzureMetadata::subscription].
15294 ///
15295 /// # Example
15296 /// ```ignore,no_run
15297 /// # use google_cloud_securitycenter_v2::model::AzureMetadata;
15298 /// use google_cloud_securitycenter_v2::model::azure_metadata::AzureSubscription;
15299 /// let x = AzureMetadata::new().set_or_clear_subscription(Some(AzureSubscription::default()/* use setters */));
15300 /// let x = AzureMetadata::new().set_or_clear_subscription(None::<AzureSubscription>);
15301 /// ```
15302 pub fn set_or_clear_subscription<T>(mut self, v: std::option::Option<T>) -> Self
15303 where
15304 T: std::convert::Into<crate::model::azure_metadata::AzureSubscription>,
15305 {
15306 self.subscription = v.map(|x| x.into());
15307 self
15308 }
15309
15310 /// Sets the value of [resource_group][crate::model::AzureMetadata::resource_group].
15311 ///
15312 /// # Example
15313 /// ```ignore,no_run
15314 /// # use google_cloud_securitycenter_v2::model::AzureMetadata;
15315 /// use google_cloud_securitycenter_v2::model::azure_metadata::AzureResourceGroup;
15316 /// let x = AzureMetadata::new().set_resource_group(AzureResourceGroup::default()/* use setters */);
15317 /// ```
15318 pub fn set_resource_group<T>(mut self, v: T) -> Self
15319 where
15320 T: std::convert::Into<crate::model::azure_metadata::AzureResourceGroup>,
15321 {
15322 self.resource_group = std::option::Option::Some(v.into());
15323 self
15324 }
15325
15326 /// Sets or clears the value of [resource_group][crate::model::AzureMetadata::resource_group].
15327 ///
15328 /// # Example
15329 /// ```ignore,no_run
15330 /// # use google_cloud_securitycenter_v2::model::AzureMetadata;
15331 /// use google_cloud_securitycenter_v2::model::azure_metadata::AzureResourceGroup;
15332 /// let x = AzureMetadata::new().set_or_clear_resource_group(Some(AzureResourceGroup::default()/* use setters */));
15333 /// let x = AzureMetadata::new().set_or_clear_resource_group(None::<AzureResourceGroup>);
15334 /// ```
15335 pub fn set_or_clear_resource_group<T>(mut self, v: std::option::Option<T>) -> Self
15336 where
15337 T: std::convert::Into<crate::model::azure_metadata::AzureResourceGroup>,
15338 {
15339 self.resource_group = v.map(|x| x.into());
15340 self
15341 }
15342
15343 /// Sets the value of [tenant][crate::model::AzureMetadata::tenant].
15344 ///
15345 /// # Example
15346 /// ```ignore,no_run
15347 /// # use google_cloud_securitycenter_v2::model::AzureMetadata;
15348 /// use google_cloud_securitycenter_v2::model::azure_metadata::AzureTenant;
15349 /// let x = AzureMetadata::new().set_tenant(AzureTenant::default()/* use setters */);
15350 /// ```
15351 pub fn set_tenant<T>(mut self, v: T) -> Self
15352 where
15353 T: std::convert::Into<crate::model::azure_metadata::AzureTenant>,
15354 {
15355 self.tenant = std::option::Option::Some(v.into());
15356 self
15357 }
15358
15359 /// Sets or clears the value of [tenant][crate::model::AzureMetadata::tenant].
15360 ///
15361 /// # Example
15362 /// ```ignore,no_run
15363 /// # use google_cloud_securitycenter_v2::model::AzureMetadata;
15364 /// use google_cloud_securitycenter_v2::model::azure_metadata::AzureTenant;
15365 /// let x = AzureMetadata::new().set_or_clear_tenant(Some(AzureTenant::default()/* use setters */));
15366 /// let x = AzureMetadata::new().set_or_clear_tenant(None::<AzureTenant>);
15367 /// ```
15368 pub fn set_or_clear_tenant<T>(mut self, v: std::option::Option<T>) -> Self
15369 where
15370 T: std::convert::Into<crate::model::azure_metadata::AzureTenant>,
15371 {
15372 self.tenant = v.map(|x| x.into());
15373 self
15374 }
15375}
15376
15377impl wkt::message::Message for AzureMetadata {
15378 fn typename() -> &'static str {
15379 "type.googleapis.com/google.cloud.securitycenter.v2.AzureMetadata"
15380 }
15381}
15382
15383/// Defines additional types related to [AzureMetadata].
15384pub mod azure_metadata {
15385 #[allow(unused_imports)]
15386 use super::*;
15387
15388 /// Represents an Azure management group.
15389 #[derive(Clone, Default, PartialEq)]
15390 #[non_exhaustive]
15391 pub struct AzureManagementGroup {
15392 /// The UUID of the Azure management group, for example,
15393 /// `20000000-0001-0000-0000-000000000000`.
15394 pub id: std::string::String,
15395
15396 /// The display name of the Azure management group.
15397 pub display_name: std::string::String,
15398
15399 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15400 }
15401
15402 impl AzureManagementGroup {
15403 pub fn new() -> Self {
15404 std::default::Default::default()
15405 }
15406
15407 /// Sets the value of [id][crate::model::azure_metadata::AzureManagementGroup::id].
15408 ///
15409 /// # Example
15410 /// ```ignore,no_run
15411 /// # use google_cloud_securitycenter_v2::model::azure_metadata::AzureManagementGroup;
15412 /// let x = AzureManagementGroup::new().set_id("example");
15413 /// ```
15414 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15415 self.id = v.into();
15416 self
15417 }
15418
15419 /// Sets the value of [display_name][crate::model::azure_metadata::AzureManagementGroup::display_name].
15420 ///
15421 /// # Example
15422 /// ```ignore,no_run
15423 /// # use google_cloud_securitycenter_v2::model::azure_metadata::AzureManagementGroup;
15424 /// let x = AzureManagementGroup::new().set_display_name("example");
15425 /// ```
15426 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
15427 mut self,
15428 v: T,
15429 ) -> Self {
15430 self.display_name = v.into();
15431 self
15432 }
15433 }
15434
15435 impl wkt::message::Message for AzureManagementGroup {
15436 fn typename() -> &'static str {
15437 "type.googleapis.com/google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup"
15438 }
15439 }
15440
15441 /// Represents an Azure subscription.
15442 #[derive(Clone, Default, PartialEq)]
15443 #[non_exhaustive]
15444 pub struct AzureSubscription {
15445 /// The UUID of the Azure subscription, for example,
15446 /// `291bba3f-e0a5-47bc-a099-3bdcb2a50a05`.
15447 pub id: std::string::String,
15448
15449 /// The display name of the Azure subscription.
15450 pub display_name: std::string::String,
15451
15452 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15453 }
15454
15455 impl AzureSubscription {
15456 pub fn new() -> Self {
15457 std::default::Default::default()
15458 }
15459
15460 /// Sets the value of [id][crate::model::azure_metadata::AzureSubscription::id].
15461 ///
15462 /// # Example
15463 /// ```ignore,no_run
15464 /// # use google_cloud_securitycenter_v2::model::azure_metadata::AzureSubscription;
15465 /// let x = AzureSubscription::new().set_id("example");
15466 /// ```
15467 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15468 self.id = v.into();
15469 self
15470 }
15471
15472 /// Sets the value of [display_name][crate::model::azure_metadata::AzureSubscription::display_name].
15473 ///
15474 /// # Example
15475 /// ```ignore,no_run
15476 /// # use google_cloud_securitycenter_v2::model::azure_metadata::AzureSubscription;
15477 /// let x = AzureSubscription::new().set_display_name("example");
15478 /// ```
15479 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
15480 mut self,
15481 v: T,
15482 ) -> Self {
15483 self.display_name = v.into();
15484 self
15485 }
15486 }
15487
15488 impl wkt::message::Message for AzureSubscription {
15489 fn typename() -> &'static str {
15490 "type.googleapis.com/google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription"
15491 }
15492 }
15493
15494 /// Represents an Azure resource group.
15495 #[derive(Clone, Default, PartialEq)]
15496 #[non_exhaustive]
15497 pub struct AzureResourceGroup {
15498 /// The ID of the Azure resource group.
15499 pub id: std::string::String,
15500
15501 /// The name of the Azure resource group. This is not a UUID.
15502 pub name: std::string::String,
15503
15504 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15505 }
15506
15507 impl AzureResourceGroup {
15508 pub fn new() -> Self {
15509 std::default::Default::default()
15510 }
15511
15512 /// Sets the value of [id][crate::model::azure_metadata::AzureResourceGroup::id].
15513 ///
15514 /// # Example
15515 /// ```ignore,no_run
15516 /// # use google_cloud_securitycenter_v2::model::azure_metadata::AzureResourceGroup;
15517 /// let x = AzureResourceGroup::new().set_id("example");
15518 /// ```
15519 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15520 self.id = v.into();
15521 self
15522 }
15523
15524 /// Sets the value of [name][crate::model::azure_metadata::AzureResourceGroup::name].
15525 ///
15526 /// # Example
15527 /// ```ignore,no_run
15528 /// # use google_cloud_securitycenter_v2::model::azure_metadata::AzureResourceGroup;
15529 /// let x = AzureResourceGroup::new().set_name("example");
15530 /// ```
15531 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15532 self.name = v.into();
15533 self
15534 }
15535 }
15536
15537 impl wkt::message::Message for AzureResourceGroup {
15538 fn typename() -> &'static str {
15539 "type.googleapis.com/google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup"
15540 }
15541 }
15542
15543 /// Represents a Microsoft Entra tenant.
15544 #[derive(Clone, Default, PartialEq)]
15545 #[non_exhaustive]
15546 pub struct AzureTenant {
15547 /// The ID of the Microsoft Entra tenant, for example,
15548 /// "a11aaa11-aa11-1aa1-11aa-1aaa11a".
15549 pub id: std::string::String,
15550
15551 /// The display name of the Azure tenant.
15552 pub display_name: std::string::String,
15553
15554 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15555 }
15556
15557 impl AzureTenant {
15558 pub fn new() -> Self {
15559 std::default::Default::default()
15560 }
15561
15562 /// Sets the value of [id][crate::model::azure_metadata::AzureTenant::id].
15563 ///
15564 /// # Example
15565 /// ```ignore,no_run
15566 /// # use google_cloud_securitycenter_v2::model::azure_metadata::AzureTenant;
15567 /// let x = AzureTenant::new().set_id("example");
15568 /// ```
15569 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15570 self.id = v.into();
15571 self
15572 }
15573
15574 /// Sets the value of [display_name][crate::model::azure_metadata::AzureTenant::display_name].
15575 ///
15576 /// # Example
15577 /// ```ignore,no_run
15578 /// # use google_cloud_securitycenter_v2::model::azure_metadata::AzureTenant;
15579 /// let x = AzureTenant::new().set_display_name("example");
15580 /// ```
15581 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
15582 mut self,
15583 v: T,
15584 ) -> Self {
15585 self.display_name = v.into();
15586 self
15587 }
15588 }
15589
15590 impl wkt::message::Message for AzureTenant {
15591 fn typename() -> &'static str {
15592 "type.googleapis.com/google.cloud.securitycenter.v2.AzureMetadata.AzureTenant"
15593 }
15594 }
15595}
15596
15597/// Represents the path of resources leading up to the resource this finding is
15598/// about.
15599#[derive(Clone, Default, PartialEq)]
15600#[non_exhaustive]
15601pub struct ResourcePath {
15602 /// The list of nodes that make the up resource path, ordered from lowest
15603 /// level to highest level.
15604 pub nodes: std::vec::Vec<crate::model::resource_path::ResourcePathNode>,
15605
15606 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15607}
15608
15609impl ResourcePath {
15610 pub fn new() -> Self {
15611 std::default::Default::default()
15612 }
15613
15614 /// Sets the value of [nodes][crate::model::ResourcePath::nodes].
15615 ///
15616 /// # Example
15617 /// ```ignore,no_run
15618 /// # use google_cloud_securitycenter_v2::model::ResourcePath;
15619 /// use google_cloud_securitycenter_v2::model::resource_path::ResourcePathNode;
15620 /// let x = ResourcePath::new()
15621 /// .set_nodes([
15622 /// ResourcePathNode::default()/* use setters */,
15623 /// ResourcePathNode::default()/* use (different) setters */,
15624 /// ]);
15625 /// ```
15626 pub fn set_nodes<T, V>(mut self, v: T) -> Self
15627 where
15628 T: std::iter::IntoIterator<Item = V>,
15629 V: std::convert::Into<crate::model::resource_path::ResourcePathNode>,
15630 {
15631 use std::iter::Iterator;
15632 self.nodes = v.into_iter().map(|i| i.into()).collect();
15633 self
15634 }
15635}
15636
15637impl wkt::message::Message for ResourcePath {
15638 fn typename() -> &'static str {
15639 "type.googleapis.com/google.cloud.securitycenter.v2.ResourcePath"
15640 }
15641}
15642
15643/// Defines additional types related to [ResourcePath].
15644pub mod resource_path {
15645 #[allow(unused_imports)]
15646 use super::*;
15647
15648 /// A node within the resource path. Each node represents a resource within the
15649 /// resource hierarchy.
15650 #[derive(Clone, Default, PartialEq)]
15651 #[non_exhaustive]
15652 pub struct ResourcePathNode {
15653 /// The type of resource this node represents.
15654 pub node_type: crate::model::resource_path::ResourcePathNodeType,
15655
15656 /// The ID of the resource this node represents.
15657 pub id: std::string::String,
15658
15659 /// The display name of the resource this node represents.
15660 pub display_name: std::string::String,
15661
15662 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15663 }
15664
15665 impl ResourcePathNode {
15666 pub fn new() -> Self {
15667 std::default::Default::default()
15668 }
15669
15670 /// Sets the value of [node_type][crate::model::resource_path::ResourcePathNode::node_type].
15671 ///
15672 /// # Example
15673 /// ```ignore,no_run
15674 /// # use google_cloud_securitycenter_v2::model::resource_path::ResourcePathNode;
15675 /// use google_cloud_securitycenter_v2::model::resource_path::ResourcePathNodeType;
15676 /// let x0 = ResourcePathNode::new().set_node_type(ResourcePathNodeType::GcpOrganization);
15677 /// let x1 = ResourcePathNode::new().set_node_type(ResourcePathNodeType::GcpFolder);
15678 /// let x2 = ResourcePathNode::new().set_node_type(ResourcePathNodeType::GcpProject);
15679 /// ```
15680 pub fn set_node_type<
15681 T: std::convert::Into<crate::model::resource_path::ResourcePathNodeType>,
15682 >(
15683 mut self,
15684 v: T,
15685 ) -> Self {
15686 self.node_type = v.into();
15687 self
15688 }
15689
15690 /// Sets the value of [id][crate::model::resource_path::ResourcePathNode::id].
15691 ///
15692 /// # Example
15693 /// ```ignore,no_run
15694 /// # use google_cloud_securitycenter_v2::model::resource_path::ResourcePathNode;
15695 /// let x = ResourcePathNode::new().set_id("example");
15696 /// ```
15697 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15698 self.id = v.into();
15699 self
15700 }
15701
15702 /// Sets the value of [display_name][crate::model::resource_path::ResourcePathNode::display_name].
15703 ///
15704 /// # Example
15705 /// ```ignore,no_run
15706 /// # use google_cloud_securitycenter_v2::model::resource_path::ResourcePathNode;
15707 /// let x = ResourcePathNode::new().set_display_name("example");
15708 /// ```
15709 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
15710 mut self,
15711 v: T,
15712 ) -> Self {
15713 self.display_name = v.into();
15714 self
15715 }
15716 }
15717
15718 impl wkt::message::Message for ResourcePathNode {
15719 fn typename() -> &'static str {
15720 "type.googleapis.com/google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode"
15721 }
15722 }
15723
15724 /// The type of resource the node represents.
15725 ///
15726 /// # Working with unknown values
15727 ///
15728 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15729 /// additional enum variants at any time. Adding new variants is not considered
15730 /// a breaking change. Applications should write their code in anticipation of:
15731 ///
15732 /// - New values appearing in future releases of the client library, **and**
15733 /// - New values received dynamically, without application changes.
15734 ///
15735 /// Please consult the [Working with enums] section in the user guide for some
15736 /// guidelines.
15737 ///
15738 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15739 #[derive(Clone, Debug, PartialEq)]
15740 #[non_exhaustive]
15741 pub enum ResourcePathNodeType {
15742 /// Node type is unspecified.
15743 Unspecified,
15744 /// The node represents a Google Cloud organization.
15745 GcpOrganization,
15746 /// The node represents a Google Cloud folder.
15747 GcpFolder,
15748 /// The node represents a Google Cloud project.
15749 GcpProject,
15750 /// The node represents an AWS organization.
15751 AwsOrganization,
15752 /// The node represents an AWS organizational unit.
15753 AwsOrganizationalUnit,
15754 /// The node represents an AWS account.
15755 AwsAccount,
15756 /// The node represents an Azure management group.
15757 AzureManagementGroup,
15758 /// The node represents an Azure subscription.
15759 AzureSubscription,
15760 /// The node represents an Azure resource group.
15761 AzureResourceGroup,
15762 /// If set, the enum was initialized with an unknown value.
15763 ///
15764 /// Applications can examine the value using [ResourcePathNodeType::value] or
15765 /// [ResourcePathNodeType::name].
15766 UnknownValue(resource_path_node_type::UnknownValue),
15767 }
15768
15769 #[doc(hidden)]
15770 pub mod resource_path_node_type {
15771 #[allow(unused_imports)]
15772 use super::*;
15773 #[derive(Clone, Debug, PartialEq)]
15774 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15775 }
15776
15777 impl ResourcePathNodeType {
15778 /// Gets the enum value.
15779 ///
15780 /// Returns `None` if the enum contains an unknown value deserialized from
15781 /// the string representation of enums.
15782 pub fn value(&self) -> std::option::Option<i32> {
15783 match self {
15784 Self::Unspecified => std::option::Option::Some(0),
15785 Self::GcpOrganization => std::option::Option::Some(1),
15786 Self::GcpFolder => std::option::Option::Some(2),
15787 Self::GcpProject => std::option::Option::Some(3),
15788 Self::AwsOrganization => std::option::Option::Some(4),
15789 Self::AwsOrganizationalUnit => std::option::Option::Some(5),
15790 Self::AwsAccount => std::option::Option::Some(6),
15791 Self::AzureManagementGroup => std::option::Option::Some(7),
15792 Self::AzureSubscription => std::option::Option::Some(8),
15793 Self::AzureResourceGroup => std::option::Option::Some(9),
15794 Self::UnknownValue(u) => u.0.value(),
15795 }
15796 }
15797
15798 /// Gets the enum value as a string.
15799 ///
15800 /// Returns `None` if the enum contains an unknown value deserialized from
15801 /// the integer representation of enums.
15802 pub fn name(&self) -> std::option::Option<&str> {
15803 match self {
15804 Self::Unspecified => {
15805 std::option::Option::Some("RESOURCE_PATH_NODE_TYPE_UNSPECIFIED")
15806 }
15807 Self::GcpOrganization => std::option::Option::Some("GCP_ORGANIZATION"),
15808 Self::GcpFolder => std::option::Option::Some("GCP_FOLDER"),
15809 Self::GcpProject => std::option::Option::Some("GCP_PROJECT"),
15810 Self::AwsOrganization => std::option::Option::Some("AWS_ORGANIZATION"),
15811 Self::AwsOrganizationalUnit => std::option::Option::Some("AWS_ORGANIZATIONAL_UNIT"),
15812 Self::AwsAccount => std::option::Option::Some("AWS_ACCOUNT"),
15813 Self::AzureManagementGroup => std::option::Option::Some("AZURE_MANAGEMENT_GROUP"),
15814 Self::AzureSubscription => std::option::Option::Some("AZURE_SUBSCRIPTION"),
15815 Self::AzureResourceGroup => std::option::Option::Some("AZURE_RESOURCE_GROUP"),
15816 Self::UnknownValue(u) => u.0.name(),
15817 }
15818 }
15819 }
15820
15821 impl std::default::Default for ResourcePathNodeType {
15822 fn default() -> Self {
15823 use std::convert::From;
15824 Self::from(0)
15825 }
15826 }
15827
15828 impl std::fmt::Display for ResourcePathNodeType {
15829 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15830 wkt::internal::display_enum(f, self.name(), self.value())
15831 }
15832 }
15833
15834 impl std::convert::From<i32> for ResourcePathNodeType {
15835 fn from(value: i32) -> Self {
15836 match value {
15837 0 => Self::Unspecified,
15838 1 => Self::GcpOrganization,
15839 2 => Self::GcpFolder,
15840 3 => Self::GcpProject,
15841 4 => Self::AwsOrganization,
15842 5 => Self::AwsOrganizationalUnit,
15843 6 => Self::AwsAccount,
15844 7 => Self::AzureManagementGroup,
15845 8 => Self::AzureSubscription,
15846 9 => Self::AzureResourceGroup,
15847 _ => Self::UnknownValue(resource_path_node_type::UnknownValue(
15848 wkt::internal::UnknownEnumValue::Integer(value),
15849 )),
15850 }
15851 }
15852 }
15853
15854 impl std::convert::From<&str> for ResourcePathNodeType {
15855 fn from(value: &str) -> Self {
15856 use std::string::ToString;
15857 match value {
15858 "RESOURCE_PATH_NODE_TYPE_UNSPECIFIED" => Self::Unspecified,
15859 "GCP_ORGANIZATION" => Self::GcpOrganization,
15860 "GCP_FOLDER" => Self::GcpFolder,
15861 "GCP_PROJECT" => Self::GcpProject,
15862 "AWS_ORGANIZATION" => Self::AwsOrganization,
15863 "AWS_ORGANIZATIONAL_UNIT" => Self::AwsOrganizationalUnit,
15864 "AWS_ACCOUNT" => Self::AwsAccount,
15865 "AZURE_MANAGEMENT_GROUP" => Self::AzureManagementGroup,
15866 "AZURE_SUBSCRIPTION" => Self::AzureSubscription,
15867 "AZURE_RESOURCE_GROUP" => Self::AzureResourceGroup,
15868 _ => Self::UnknownValue(resource_path_node_type::UnknownValue(
15869 wkt::internal::UnknownEnumValue::String(value.to_string()),
15870 )),
15871 }
15872 }
15873 }
15874
15875 impl serde::ser::Serialize for ResourcePathNodeType {
15876 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15877 where
15878 S: serde::Serializer,
15879 {
15880 match self {
15881 Self::Unspecified => serializer.serialize_i32(0),
15882 Self::GcpOrganization => serializer.serialize_i32(1),
15883 Self::GcpFolder => serializer.serialize_i32(2),
15884 Self::GcpProject => serializer.serialize_i32(3),
15885 Self::AwsOrganization => serializer.serialize_i32(4),
15886 Self::AwsOrganizationalUnit => serializer.serialize_i32(5),
15887 Self::AwsAccount => serializer.serialize_i32(6),
15888 Self::AzureManagementGroup => serializer.serialize_i32(7),
15889 Self::AzureSubscription => serializer.serialize_i32(8),
15890 Self::AzureResourceGroup => serializer.serialize_i32(9),
15891 Self::UnknownValue(u) => u.0.serialize(serializer),
15892 }
15893 }
15894 }
15895
15896 impl<'de> serde::de::Deserialize<'de> for ResourcePathNodeType {
15897 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15898 where
15899 D: serde::Deserializer<'de>,
15900 {
15901 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResourcePathNodeType>::new(
15902 ".google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType",
15903 ))
15904 }
15905 }
15906}
15907
15908/// A resource value configuration (RVC) is a mapping configuration of user's
15909/// resources to resource values. Used in Attack path simulations.
15910#[derive(Clone, Default, PartialEq)]
15911#[non_exhaustive]
15912pub struct ResourceValueConfig {
15913 /// Identifier. Name for the resource value configuration
15914 pub name: std::string::String,
15915
15916 /// Resource value level this expression represents
15917 /// Only required when there is no Sensitive Data Protection mapping in the
15918 /// request
15919 pub resource_value: crate::model::ResourceValue,
15920
15921 /// Tag values combined with `AND` to check against.
15922 /// For Google Cloud resources, they are tag value IDs in the form of
15923 /// "tagValues/123". Example: `[ "tagValues/123", "tagValues/456",
15924 /// "tagValues/789" ]`
15925 /// <https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing>
15926 pub tag_values: std::vec::Vec<std::string::String>,
15927
15928 /// Apply resource_value only to resources that match resource_type.
15929 /// resource_type will be checked with `AND` of other resources.
15930 /// For example, "storage.googleapis.com/Bucket" with resource_value "HIGH"
15931 /// will apply "HIGH" value only to "storage.googleapis.com/Bucket" resources.
15932 pub resource_type: std::string::String,
15933
15934 /// Project or folder to scope this configuration to.
15935 /// For example, "project/456" would apply this configuration only to resources
15936 /// in "project/456" scope and will be checked with `AND` of other resources.
15937 pub scope: std::string::String,
15938
15939 /// List of resource labels to search for, evaluated with `AND`.
15940 /// For example, "resource_labels_selector": {"key": "value", "env": "prod"}
15941 /// will match resources with labels "key": "value" `AND` "env":
15942 /// "prod"
15943 /// <https://cloud.google.com/resource-manager/docs/creating-managing-labels>
15944 pub resource_labels_selector:
15945 std::collections::HashMap<std::string::String, std::string::String>,
15946
15947 /// Description of the resource value configuration.
15948 pub description: std::string::String,
15949
15950 /// Output only. Timestamp this resource value configuration was created.
15951 pub create_time: std::option::Option<wkt::Timestamp>,
15952
15953 /// Output only. Timestamp this resource value configuration was last updated.
15954 pub update_time: std::option::Option<wkt::Timestamp>,
15955
15956 /// Cloud provider this configuration applies to
15957 pub cloud_provider: crate::model::CloudProvider,
15958
15959 /// A mapping of the sensitivity on Sensitive Data Protection finding to
15960 /// resource values. This mapping can only be used in combination with a
15961 /// resource_type that is related to BigQuery, e.g.
15962 /// "bigquery.googleapis.com/Dataset".
15963 pub sensitive_data_protection_mapping:
15964 std::option::Option<crate::model::resource_value_config::SensitiveDataProtectionMapping>,
15965
15966 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15967}
15968
15969impl ResourceValueConfig {
15970 pub fn new() -> Self {
15971 std::default::Default::default()
15972 }
15973
15974 /// Sets the value of [name][crate::model::ResourceValueConfig::name].
15975 ///
15976 /// # Example
15977 /// ```ignore,no_run
15978 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
15979 /// let x = ResourceValueConfig::new().set_name("example");
15980 /// ```
15981 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15982 self.name = v.into();
15983 self
15984 }
15985
15986 /// Sets the value of [resource_value][crate::model::ResourceValueConfig::resource_value].
15987 ///
15988 /// # Example
15989 /// ```ignore,no_run
15990 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
15991 /// use google_cloud_securitycenter_v2::model::ResourceValue;
15992 /// let x0 = ResourceValueConfig::new().set_resource_value(ResourceValue::High);
15993 /// let x1 = ResourceValueConfig::new().set_resource_value(ResourceValue::Medium);
15994 /// let x2 = ResourceValueConfig::new().set_resource_value(ResourceValue::Low);
15995 /// ```
15996 pub fn set_resource_value<T: std::convert::Into<crate::model::ResourceValue>>(
15997 mut self,
15998 v: T,
15999 ) -> Self {
16000 self.resource_value = v.into();
16001 self
16002 }
16003
16004 /// Sets the value of [tag_values][crate::model::ResourceValueConfig::tag_values].
16005 ///
16006 /// # Example
16007 /// ```ignore,no_run
16008 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16009 /// let x = ResourceValueConfig::new().set_tag_values(["a", "b", "c"]);
16010 /// ```
16011 pub fn set_tag_values<T, V>(mut self, v: T) -> Self
16012 where
16013 T: std::iter::IntoIterator<Item = V>,
16014 V: std::convert::Into<std::string::String>,
16015 {
16016 use std::iter::Iterator;
16017 self.tag_values = v.into_iter().map(|i| i.into()).collect();
16018 self
16019 }
16020
16021 /// Sets the value of [resource_type][crate::model::ResourceValueConfig::resource_type].
16022 ///
16023 /// # Example
16024 /// ```ignore,no_run
16025 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16026 /// let x = ResourceValueConfig::new().set_resource_type("example");
16027 /// ```
16028 pub fn set_resource_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16029 self.resource_type = v.into();
16030 self
16031 }
16032
16033 /// Sets the value of [scope][crate::model::ResourceValueConfig::scope].
16034 ///
16035 /// # Example
16036 /// ```ignore,no_run
16037 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16038 /// let x = ResourceValueConfig::new().set_scope("example");
16039 /// ```
16040 pub fn set_scope<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16041 self.scope = v.into();
16042 self
16043 }
16044
16045 /// Sets the value of [resource_labels_selector][crate::model::ResourceValueConfig::resource_labels_selector].
16046 ///
16047 /// # Example
16048 /// ```ignore,no_run
16049 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16050 /// let x = ResourceValueConfig::new().set_resource_labels_selector([
16051 /// ("key0", "abc"),
16052 /// ("key1", "xyz"),
16053 /// ]);
16054 /// ```
16055 pub fn set_resource_labels_selector<T, K, V>(mut self, v: T) -> Self
16056 where
16057 T: std::iter::IntoIterator<Item = (K, V)>,
16058 K: std::convert::Into<std::string::String>,
16059 V: std::convert::Into<std::string::String>,
16060 {
16061 use std::iter::Iterator;
16062 self.resource_labels_selector = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16063 self
16064 }
16065
16066 /// Sets the value of [description][crate::model::ResourceValueConfig::description].
16067 ///
16068 /// # Example
16069 /// ```ignore,no_run
16070 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16071 /// let x = ResourceValueConfig::new().set_description("example");
16072 /// ```
16073 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16074 self.description = v.into();
16075 self
16076 }
16077
16078 /// Sets the value of [create_time][crate::model::ResourceValueConfig::create_time].
16079 ///
16080 /// # Example
16081 /// ```ignore,no_run
16082 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16083 /// use wkt::Timestamp;
16084 /// let x = ResourceValueConfig::new().set_create_time(Timestamp::default()/* use setters */);
16085 /// ```
16086 pub fn set_create_time<T>(mut self, v: T) -> Self
16087 where
16088 T: std::convert::Into<wkt::Timestamp>,
16089 {
16090 self.create_time = std::option::Option::Some(v.into());
16091 self
16092 }
16093
16094 /// Sets or clears the value of [create_time][crate::model::ResourceValueConfig::create_time].
16095 ///
16096 /// # Example
16097 /// ```ignore,no_run
16098 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16099 /// use wkt::Timestamp;
16100 /// let x = ResourceValueConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
16101 /// let x = ResourceValueConfig::new().set_or_clear_create_time(None::<Timestamp>);
16102 /// ```
16103 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16104 where
16105 T: std::convert::Into<wkt::Timestamp>,
16106 {
16107 self.create_time = v.map(|x| x.into());
16108 self
16109 }
16110
16111 /// Sets the value of [update_time][crate::model::ResourceValueConfig::update_time].
16112 ///
16113 /// # Example
16114 /// ```ignore,no_run
16115 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16116 /// use wkt::Timestamp;
16117 /// let x = ResourceValueConfig::new().set_update_time(Timestamp::default()/* use setters */);
16118 /// ```
16119 pub fn set_update_time<T>(mut self, v: T) -> Self
16120 where
16121 T: std::convert::Into<wkt::Timestamp>,
16122 {
16123 self.update_time = std::option::Option::Some(v.into());
16124 self
16125 }
16126
16127 /// Sets or clears the value of [update_time][crate::model::ResourceValueConfig::update_time].
16128 ///
16129 /// # Example
16130 /// ```ignore,no_run
16131 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16132 /// use wkt::Timestamp;
16133 /// let x = ResourceValueConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
16134 /// let x = ResourceValueConfig::new().set_or_clear_update_time(None::<Timestamp>);
16135 /// ```
16136 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
16137 where
16138 T: std::convert::Into<wkt::Timestamp>,
16139 {
16140 self.update_time = v.map(|x| x.into());
16141 self
16142 }
16143
16144 /// Sets the value of [cloud_provider][crate::model::ResourceValueConfig::cloud_provider].
16145 ///
16146 /// # Example
16147 /// ```ignore,no_run
16148 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16149 /// use google_cloud_securitycenter_v2::model::CloudProvider;
16150 /// let x0 = ResourceValueConfig::new().set_cloud_provider(CloudProvider::GoogleCloudPlatform);
16151 /// let x1 = ResourceValueConfig::new().set_cloud_provider(CloudProvider::AmazonWebServices);
16152 /// let x2 = ResourceValueConfig::new().set_cloud_provider(CloudProvider::MicrosoftAzure);
16153 /// ```
16154 pub fn set_cloud_provider<T: std::convert::Into<crate::model::CloudProvider>>(
16155 mut self,
16156 v: T,
16157 ) -> Self {
16158 self.cloud_provider = v.into();
16159 self
16160 }
16161
16162 /// Sets the value of [sensitive_data_protection_mapping][crate::model::ResourceValueConfig::sensitive_data_protection_mapping].
16163 ///
16164 /// # Example
16165 /// ```ignore,no_run
16166 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16167 /// use google_cloud_securitycenter_v2::model::resource_value_config::SensitiveDataProtectionMapping;
16168 /// let x = ResourceValueConfig::new().set_sensitive_data_protection_mapping(SensitiveDataProtectionMapping::default()/* use setters */);
16169 /// ```
16170 pub fn set_sensitive_data_protection_mapping<T>(mut self, v: T) -> Self
16171 where
16172 T: std::convert::Into<crate::model::resource_value_config::SensitiveDataProtectionMapping>,
16173 {
16174 self.sensitive_data_protection_mapping = std::option::Option::Some(v.into());
16175 self
16176 }
16177
16178 /// Sets or clears the value of [sensitive_data_protection_mapping][crate::model::ResourceValueConfig::sensitive_data_protection_mapping].
16179 ///
16180 /// # Example
16181 /// ```ignore,no_run
16182 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16183 /// use google_cloud_securitycenter_v2::model::resource_value_config::SensitiveDataProtectionMapping;
16184 /// let x = ResourceValueConfig::new().set_or_clear_sensitive_data_protection_mapping(Some(SensitiveDataProtectionMapping::default()/* use setters */));
16185 /// let x = ResourceValueConfig::new().set_or_clear_sensitive_data_protection_mapping(None::<SensitiveDataProtectionMapping>);
16186 /// ```
16187 pub fn set_or_clear_sensitive_data_protection_mapping<T>(
16188 mut self,
16189 v: std::option::Option<T>,
16190 ) -> Self
16191 where
16192 T: std::convert::Into<crate::model::resource_value_config::SensitiveDataProtectionMapping>,
16193 {
16194 self.sensitive_data_protection_mapping = v.map(|x| x.into());
16195 self
16196 }
16197}
16198
16199impl wkt::message::Message for ResourceValueConfig {
16200 fn typename() -> &'static str {
16201 "type.googleapis.com/google.cloud.securitycenter.v2.ResourceValueConfig"
16202 }
16203}
16204
16205/// Defines additional types related to [ResourceValueConfig].
16206pub mod resource_value_config {
16207 #[allow(unused_imports)]
16208 use super::*;
16209
16210 /// Resource value mapping for Sensitive Data Protection findings
16211 /// If any of these mappings have a resource value that is not unspecified,
16212 /// the resource_value field will be ignored when reading this configuration.
16213 #[derive(Clone, Default, PartialEq)]
16214 #[non_exhaustive]
16215 pub struct SensitiveDataProtectionMapping {
16216 /// Resource value mapping for high-sensitivity Sensitive Data Protection
16217 /// findings
16218 pub high_sensitivity_mapping: crate::model::ResourceValue,
16219
16220 /// Resource value mapping for medium-sensitivity Sensitive Data Protection
16221 /// findings
16222 pub medium_sensitivity_mapping: crate::model::ResourceValue,
16223
16224 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16225 }
16226
16227 impl SensitiveDataProtectionMapping {
16228 pub fn new() -> Self {
16229 std::default::Default::default()
16230 }
16231
16232 /// Sets the value of [high_sensitivity_mapping][crate::model::resource_value_config::SensitiveDataProtectionMapping::high_sensitivity_mapping].
16233 ///
16234 /// # Example
16235 /// ```ignore,no_run
16236 /// # use google_cloud_securitycenter_v2::model::resource_value_config::SensitiveDataProtectionMapping;
16237 /// use google_cloud_securitycenter_v2::model::ResourceValue;
16238 /// let x0 = SensitiveDataProtectionMapping::new().set_high_sensitivity_mapping(ResourceValue::High);
16239 /// let x1 = SensitiveDataProtectionMapping::new().set_high_sensitivity_mapping(ResourceValue::Medium);
16240 /// let x2 = SensitiveDataProtectionMapping::new().set_high_sensitivity_mapping(ResourceValue::Low);
16241 /// ```
16242 pub fn set_high_sensitivity_mapping<T: std::convert::Into<crate::model::ResourceValue>>(
16243 mut self,
16244 v: T,
16245 ) -> Self {
16246 self.high_sensitivity_mapping = v.into();
16247 self
16248 }
16249
16250 /// Sets the value of [medium_sensitivity_mapping][crate::model::resource_value_config::SensitiveDataProtectionMapping::medium_sensitivity_mapping].
16251 ///
16252 /// # Example
16253 /// ```ignore,no_run
16254 /// # use google_cloud_securitycenter_v2::model::resource_value_config::SensitiveDataProtectionMapping;
16255 /// use google_cloud_securitycenter_v2::model::ResourceValue;
16256 /// let x0 = SensitiveDataProtectionMapping::new().set_medium_sensitivity_mapping(ResourceValue::High);
16257 /// let x1 = SensitiveDataProtectionMapping::new().set_medium_sensitivity_mapping(ResourceValue::Medium);
16258 /// let x2 = SensitiveDataProtectionMapping::new().set_medium_sensitivity_mapping(ResourceValue::Low);
16259 /// ```
16260 pub fn set_medium_sensitivity_mapping<
16261 T: std::convert::Into<crate::model::ResourceValue>,
16262 >(
16263 mut self,
16264 v: T,
16265 ) -> Self {
16266 self.medium_sensitivity_mapping = v.into();
16267 self
16268 }
16269 }
16270
16271 impl wkt::message::Message for SensitiveDataProtectionMapping {
16272 fn typename() -> &'static str {
16273 "type.googleapis.com/google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping"
16274 }
16275 }
16276}
16277
16278/// User specified security marks that are attached to the parent Security
16279/// Command Center resource. Security marks are scoped within a Security Command
16280/// Center organization -- they can be modified and viewed by all users who have
16281/// proper permissions on the organization.
16282#[derive(Clone, Default, PartialEq)]
16283#[non_exhaustive]
16284pub struct SecurityMarks {
16285 /// The relative resource name of the SecurityMarks. See:
16286 /// <https://cloud.google.com/apis/design/resource_names#relative_resource_name>
16287 /// The following list shows some examples:
16288 ///
16289 /// + `organizations/{organization_id}/assets/{asset_id}/securityMarks`
16290 ///
16291 /// `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks`
16292 /// +
16293 /// `organizations/{organization_id}/sources/{source_id}/locations/{location}/findings/{finding_id}/securityMarks`
16294 pub name: std::string::String,
16295
16296 /// Mutable user specified security marks belonging to the parent resource.
16297 /// Constraints are as follows:
16298 ///
16299 /// * Keys and values are treated as case insensitive
16300 /// * Keys must be between 1 - 256 characters (inclusive)
16301 /// * Keys must be letters, numbers, underscores, or dashes
16302 /// * Values have leading and trailing whitespace trimmed, remaining
16303 /// characters must be between 1 - 4096 characters (inclusive)
16304 pub marks: std::collections::HashMap<std::string::String, std::string::String>,
16305
16306 /// The canonical name of the marks. The following list shows some examples:
16307 ///
16308 /// + `organizations/{organization_id}/assets/{asset_id}/securityMarks`
16309 ///
16310 /// `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks`
16311 /// +
16312 /// `organizations/{organization_id}/sources/{source_id}/locations/{location}/findings/{finding_id}/securityMarks`
16313 ///
16314 /// + `folders/{folder_id}/assets/{asset_id}/securityMarks`
16315 ///
16316 /// `folders/{folder_id}/sources/{source_id}/findings/{finding_id}/securityMarks`
16317 /// +
16318 /// `folders/{folder_id}/sources/{source_id}/locations/{location}/findings/{finding_id}/securityMarks`
16319 ///
16320 /// + `projects/{project_number}/assets/{asset_id}/securityMarks`
16321 ///
16322 /// `projects/{project_number}/sources/{source_id}/findings/{finding_id}/securityMarks`
16323 /// +
16324 /// `projects/{project_number}/sources/{source_id}/locations/{location}/findings/{finding_id}/securityMarks`
16325 pub canonical_name: std::string::String,
16326
16327 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16328}
16329
16330impl SecurityMarks {
16331 pub fn new() -> Self {
16332 std::default::Default::default()
16333 }
16334
16335 /// Sets the value of [name][crate::model::SecurityMarks::name].
16336 ///
16337 /// # Example
16338 /// ```ignore,no_run
16339 /// # use google_cloud_securitycenter_v2::model::SecurityMarks;
16340 /// let x = SecurityMarks::new().set_name("example");
16341 /// ```
16342 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16343 self.name = v.into();
16344 self
16345 }
16346
16347 /// Sets the value of [marks][crate::model::SecurityMarks::marks].
16348 ///
16349 /// # Example
16350 /// ```ignore,no_run
16351 /// # use google_cloud_securitycenter_v2::model::SecurityMarks;
16352 /// let x = SecurityMarks::new().set_marks([
16353 /// ("key0", "abc"),
16354 /// ("key1", "xyz"),
16355 /// ]);
16356 /// ```
16357 pub fn set_marks<T, K, V>(mut self, v: T) -> Self
16358 where
16359 T: std::iter::IntoIterator<Item = (K, V)>,
16360 K: std::convert::Into<std::string::String>,
16361 V: std::convert::Into<std::string::String>,
16362 {
16363 use std::iter::Iterator;
16364 self.marks = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16365 self
16366 }
16367
16368 /// Sets the value of [canonical_name][crate::model::SecurityMarks::canonical_name].
16369 ///
16370 /// # Example
16371 /// ```ignore,no_run
16372 /// # use google_cloud_securitycenter_v2::model::SecurityMarks;
16373 /// let x = SecurityMarks::new().set_canonical_name("example");
16374 /// ```
16375 pub fn set_canonical_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16376 self.canonical_name = v.into();
16377 self
16378 }
16379}
16380
16381impl wkt::message::Message for SecurityMarks {
16382 fn typename() -> &'static str {
16383 "type.googleapis.com/google.cloud.securitycenter.v2.SecurityMarks"
16384 }
16385}
16386
16387/// Represents a posture that is deployed on Google Cloud by the
16388/// Security Command Center Posture Management service.
16389/// A posture contains one or more policy sets. A policy set is a
16390/// group of policies that enforce a set of security rules on Google
16391/// Cloud.
16392#[derive(Clone, Default, PartialEq)]
16393#[non_exhaustive]
16394pub struct SecurityPosture {
16395 /// Name of the posture, for example, `CIS-Posture`.
16396 pub name: std::string::String,
16397
16398 /// The version of the posture, for example, `c7cfa2a8`.
16399 pub revision_id: std::string::String,
16400
16401 /// The project, folder, or organization on which the posture is deployed,
16402 /// for example, `projects/{project_number}`.
16403 pub posture_deployment_resource: std::string::String,
16404
16405 /// The name of the posture deployment, for example,
16406 /// `organizations/{org_id}/posturedeployments/{posture_deployment_id}`.
16407 pub posture_deployment: std::string::String,
16408
16409 /// The name of the updated policy, for example,
16410 /// `projects/{project_id}/policies/{constraint_name}`.
16411 pub changed_policy: std::string::String,
16412
16413 /// The name of the updated policy set, for example, `cis-policyset`.
16414 pub policy_set: std::string::String,
16415
16416 /// The ID of the updated policy, for example, `compute-policy-1`.
16417 pub policy: std::string::String,
16418
16419 /// The details about a change in an updated policy that violates the deployed
16420 /// posture.
16421 pub policy_drift_details: std::vec::Vec<crate::model::security_posture::PolicyDriftDetails>,
16422
16423 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16424}
16425
16426impl SecurityPosture {
16427 pub fn new() -> Self {
16428 std::default::Default::default()
16429 }
16430
16431 /// Sets the value of [name][crate::model::SecurityPosture::name].
16432 ///
16433 /// # Example
16434 /// ```ignore,no_run
16435 /// # use google_cloud_securitycenter_v2::model::SecurityPosture;
16436 /// let x = SecurityPosture::new().set_name("example");
16437 /// ```
16438 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16439 self.name = v.into();
16440 self
16441 }
16442
16443 /// Sets the value of [revision_id][crate::model::SecurityPosture::revision_id].
16444 ///
16445 /// # Example
16446 /// ```ignore,no_run
16447 /// # use google_cloud_securitycenter_v2::model::SecurityPosture;
16448 /// let x = SecurityPosture::new().set_revision_id("example");
16449 /// ```
16450 pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16451 self.revision_id = v.into();
16452 self
16453 }
16454
16455 /// Sets the value of [posture_deployment_resource][crate::model::SecurityPosture::posture_deployment_resource].
16456 ///
16457 /// # Example
16458 /// ```ignore,no_run
16459 /// # use google_cloud_securitycenter_v2::model::SecurityPosture;
16460 /// let x = SecurityPosture::new().set_posture_deployment_resource("example");
16461 /// ```
16462 pub fn set_posture_deployment_resource<T: std::convert::Into<std::string::String>>(
16463 mut self,
16464 v: T,
16465 ) -> Self {
16466 self.posture_deployment_resource = v.into();
16467 self
16468 }
16469
16470 /// Sets the value of [posture_deployment][crate::model::SecurityPosture::posture_deployment].
16471 ///
16472 /// # Example
16473 /// ```ignore,no_run
16474 /// # use google_cloud_securitycenter_v2::model::SecurityPosture;
16475 /// let x = SecurityPosture::new().set_posture_deployment("example");
16476 /// ```
16477 pub fn set_posture_deployment<T: std::convert::Into<std::string::String>>(
16478 mut self,
16479 v: T,
16480 ) -> Self {
16481 self.posture_deployment = v.into();
16482 self
16483 }
16484
16485 /// Sets the value of [changed_policy][crate::model::SecurityPosture::changed_policy].
16486 ///
16487 /// # Example
16488 /// ```ignore,no_run
16489 /// # use google_cloud_securitycenter_v2::model::SecurityPosture;
16490 /// let x = SecurityPosture::new().set_changed_policy("example");
16491 /// ```
16492 pub fn set_changed_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16493 self.changed_policy = v.into();
16494 self
16495 }
16496
16497 /// Sets the value of [policy_set][crate::model::SecurityPosture::policy_set].
16498 ///
16499 /// # Example
16500 /// ```ignore,no_run
16501 /// # use google_cloud_securitycenter_v2::model::SecurityPosture;
16502 /// let x = SecurityPosture::new().set_policy_set("example");
16503 /// ```
16504 pub fn set_policy_set<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16505 self.policy_set = v.into();
16506 self
16507 }
16508
16509 /// Sets the value of [policy][crate::model::SecurityPosture::policy].
16510 ///
16511 /// # Example
16512 /// ```ignore,no_run
16513 /// # use google_cloud_securitycenter_v2::model::SecurityPosture;
16514 /// let x = SecurityPosture::new().set_policy("example");
16515 /// ```
16516 pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16517 self.policy = v.into();
16518 self
16519 }
16520
16521 /// Sets the value of [policy_drift_details][crate::model::SecurityPosture::policy_drift_details].
16522 ///
16523 /// # Example
16524 /// ```ignore,no_run
16525 /// # use google_cloud_securitycenter_v2::model::SecurityPosture;
16526 /// use google_cloud_securitycenter_v2::model::security_posture::PolicyDriftDetails;
16527 /// let x = SecurityPosture::new()
16528 /// .set_policy_drift_details([
16529 /// PolicyDriftDetails::default()/* use setters */,
16530 /// PolicyDriftDetails::default()/* use (different) setters */,
16531 /// ]);
16532 /// ```
16533 pub fn set_policy_drift_details<T, V>(mut self, v: T) -> Self
16534 where
16535 T: std::iter::IntoIterator<Item = V>,
16536 V: std::convert::Into<crate::model::security_posture::PolicyDriftDetails>,
16537 {
16538 use std::iter::Iterator;
16539 self.policy_drift_details = v.into_iter().map(|i| i.into()).collect();
16540 self
16541 }
16542}
16543
16544impl wkt::message::Message for SecurityPosture {
16545 fn typename() -> &'static str {
16546 "type.googleapis.com/google.cloud.securitycenter.v2.SecurityPosture"
16547 }
16548}
16549
16550/// Defines additional types related to [SecurityPosture].
16551pub mod security_posture {
16552 #[allow(unused_imports)]
16553 use super::*;
16554
16555 /// The policy field that violates the deployed posture and its expected and
16556 /// detected values.
16557 #[derive(Clone, Default, PartialEq)]
16558 #[non_exhaustive]
16559 pub struct PolicyDriftDetails {
16560 /// The name of the updated field, for example
16561 /// constraint.implementation.policy_rules[0].enforce
16562 pub field: std::string::String,
16563
16564 /// The value of this field that was configured in a posture, for example,
16565 /// `true` or `allowed_values={"projects/29831892"}`.
16566 pub expected_value: std::string::String,
16567
16568 /// The detected value that violates the deployed posture, for example,
16569 /// `false` or `allowed_values={"projects/22831892"}`.
16570 pub detected_value: std::string::String,
16571
16572 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16573 }
16574
16575 impl PolicyDriftDetails {
16576 pub fn new() -> Self {
16577 std::default::Default::default()
16578 }
16579
16580 /// Sets the value of [field][crate::model::security_posture::PolicyDriftDetails::field].
16581 ///
16582 /// # Example
16583 /// ```ignore,no_run
16584 /// # use google_cloud_securitycenter_v2::model::security_posture::PolicyDriftDetails;
16585 /// let x = PolicyDriftDetails::new().set_field("example");
16586 /// ```
16587 pub fn set_field<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16588 self.field = v.into();
16589 self
16590 }
16591
16592 /// Sets the value of [expected_value][crate::model::security_posture::PolicyDriftDetails::expected_value].
16593 ///
16594 /// # Example
16595 /// ```ignore,no_run
16596 /// # use google_cloud_securitycenter_v2::model::security_posture::PolicyDriftDetails;
16597 /// let x = PolicyDriftDetails::new().set_expected_value("example");
16598 /// ```
16599 pub fn set_expected_value<T: std::convert::Into<std::string::String>>(
16600 mut self,
16601 v: T,
16602 ) -> Self {
16603 self.expected_value = v.into();
16604 self
16605 }
16606
16607 /// Sets the value of [detected_value][crate::model::security_posture::PolicyDriftDetails::detected_value].
16608 ///
16609 /// # Example
16610 /// ```ignore,no_run
16611 /// # use google_cloud_securitycenter_v2::model::security_posture::PolicyDriftDetails;
16612 /// let x = PolicyDriftDetails::new().set_detected_value("example");
16613 /// ```
16614 pub fn set_detected_value<T: std::convert::Into<std::string::String>>(
16615 mut self,
16616 v: T,
16617 ) -> Self {
16618 self.detected_value = v.into();
16619 self
16620 }
16621 }
16622
16623 impl wkt::message::Message for PolicyDriftDetails {
16624 fn typename() -> &'static str {
16625 "type.googleapis.com/google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails"
16626 }
16627 }
16628}
16629
16630/// Request message to create multiple resource value configs
16631#[derive(Clone, Default, PartialEq)]
16632#[non_exhaustive]
16633pub struct BatchCreateResourceValueConfigsRequest {
16634 /// Required. Resource name of the new ResourceValueConfig's parent.
16635 /// The parent field in the CreateResourceValueConfigRequest
16636 /// messages must either be empty or match this field.
16637 pub parent: std::string::String,
16638
16639 /// Required. The resource value configs to be created.
16640 pub requests: std::vec::Vec<crate::model::CreateResourceValueConfigRequest>,
16641
16642 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16643}
16644
16645impl BatchCreateResourceValueConfigsRequest {
16646 pub fn new() -> Self {
16647 std::default::Default::default()
16648 }
16649
16650 /// Sets the value of [parent][crate::model::BatchCreateResourceValueConfigsRequest::parent].
16651 ///
16652 /// # Example
16653 /// ```ignore,no_run
16654 /// # use google_cloud_securitycenter_v2::model::BatchCreateResourceValueConfigsRequest;
16655 /// let x = BatchCreateResourceValueConfigsRequest::new().set_parent("example");
16656 /// ```
16657 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16658 self.parent = v.into();
16659 self
16660 }
16661
16662 /// Sets the value of [requests][crate::model::BatchCreateResourceValueConfigsRequest::requests].
16663 ///
16664 /// # Example
16665 /// ```ignore,no_run
16666 /// # use google_cloud_securitycenter_v2::model::BatchCreateResourceValueConfigsRequest;
16667 /// use google_cloud_securitycenter_v2::model::CreateResourceValueConfigRequest;
16668 /// let x = BatchCreateResourceValueConfigsRequest::new()
16669 /// .set_requests([
16670 /// CreateResourceValueConfigRequest::default()/* use setters */,
16671 /// CreateResourceValueConfigRequest::default()/* use (different) setters */,
16672 /// ]);
16673 /// ```
16674 pub fn set_requests<T, V>(mut self, v: T) -> Self
16675 where
16676 T: std::iter::IntoIterator<Item = V>,
16677 V: std::convert::Into<crate::model::CreateResourceValueConfigRequest>,
16678 {
16679 use std::iter::Iterator;
16680 self.requests = v.into_iter().map(|i| i.into()).collect();
16681 self
16682 }
16683}
16684
16685impl wkt::message::Message for BatchCreateResourceValueConfigsRequest {
16686 fn typename() -> &'static str {
16687 "type.googleapis.com/google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest"
16688 }
16689}
16690
16691/// Response message for BatchCreateResourceValueConfigs
16692#[derive(Clone, Default, PartialEq)]
16693#[non_exhaustive]
16694pub struct BatchCreateResourceValueConfigsResponse {
16695 /// The resource value configs created
16696 pub resource_value_configs: std::vec::Vec<crate::model::ResourceValueConfig>,
16697
16698 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16699}
16700
16701impl BatchCreateResourceValueConfigsResponse {
16702 pub fn new() -> Self {
16703 std::default::Default::default()
16704 }
16705
16706 /// Sets the value of [resource_value_configs][crate::model::BatchCreateResourceValueConfigsResponse::resource_value_configs].
16707 ///
16708 /// # Example
16709 /// ```ignore,no_run
16710 /// # use google_cloud_securitycenter_v2::model::BatchCreateResourceValueConfigsResponse;
16711 /// use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16712 /// let x = BatchCreateResourceValueConfigsResponse::new()
16713 /// .set_resource_value_configs([
16714 /// ResourceValueConfig::default()/* use setters */,
16715 /// ResourceValueConfig::default()/* use (different) setters */,
16716 /// ]);
16717 /// ```
16718 pub fn set_resource_value_configs<T, V>(mut self, v: T) -> Self
16719 where
16720 T: std::iter::IntoIterator<Item = V>,
16721 V: std::convert::Into<crate::model::ResourceValueConfig>,
16722 {
16723 use std::iter::Iterator;
16724 self.resource_value_configs = v.into_iter().map(|i| i.into()).collect();
16725 self
16726 }
16727}
16728
16729impl wkt::message::Message for BatchCreateResourceValueConfigsResponse {
16730 fn typename() -> &'static str {
16731 "type.googleapis.com/google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse"
16732 }
16733}
16734
16735/// Request message for bulk findings update.
16736///
16737/// Note:
16738///
16739/// 1. If multiple bulk update requests match the same resource, the order in
16740/// which they get executed is not defined.
16741/// 1. Once a bulk operation is started, there is no way to stop it.
16742#[derive(Clone, Default, PartialEq)]
16743#[non_exhaustive]
16744pub struct BulkMuteFindingsRequest {
16745 /// Required. The parent, at which bulk action needs to be applied. If no
16746 /// location is specified, findings are updated in global. The following list
16747 /// shows some examples:
16748 ///
16749 /// + `organizations/[organization_id]`
16750 /// + `organizations/[organization_id]/locations/[location_id]`
16751 /// + `folders/[folder_id]`
16752 /// + `folders/[folder_id]/locations/[location_id]`
16753 /// + `projects/[project_id]`
16754 /// + `projects/[project_id]/locations/[location_id]`
16755 pub parent: std::string::String,
16756
16757 /// Expression that identifies findings that should be updated.
16758 /// The expression is a list of zero or more restrictions combined
16759 /// via logical operators `AND` and `OR`. Parentheses are supported, and `OR`
16760 /// has higher precedence than `AND`.
16761 ///
16762 /// Restrictions have the form `<field> <operator> <value>` and may have a
16763 /// `-` character in front of them to indicate negation. The fields map to
16764 /// those defined in the corresponding resource.
16765 ///
16766 /// The supported operators are:
16767 ///
16768 /// * `=` for all value types.
16769 /// * `>`, `<`, `>=`, `<=` for integer values.
16770 /// * `:`, meaning substring matching, for strings.
16771 ///
16772 /// The supported value types are:
16773 ///
16774 /// * string literals in quotes.
16775 /// * integer literals without quotes.
16776 /// * boolean literals `true` and `false` without quotes.
16777 pub filter: std::string::String,
16778
16779 /// Optional. All findings matching the given filter will have their mute state
16780 /// set to this value. The default value is `MUTED`. Setting this to
16781 /// `UNDEFINED` will clear the mute state on all matching findings.
16782 pub mute_state: crate::model::bulk_mute_findings_request::MuteState,
16783
16784 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16785}
16786
16787impl BulkMuteFindingsRequest {
16788 pub fn new() -> Self {
16789 std::default::Default::default()
16790 }
16791
16792 /// Sets the value of [parent][crate::model::BulkMuteFindingsRequest::parent].
16793 ///
16794 /// # Example
16795 /// ```ignore,no_run
16796 /// # use google_cloud_securitycenter_v2::model::BulkMuteFindingsRequest;
16797 /// let x = BulkMuteFindingsRequest::new().set_parent("example");
16798 /// ```
16799 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16800 self.parent = v.into();
16801 self
16802 }
16803
16804 /// Sets the value of [filter][crate::model::BulkMuteFindingsRequest::filter].
16805 ///
16806 /// # Example
16807 /// ```ignore,no_run
16808 /// # use google_cloud_securitycenter_v2::model::BulkMuteFindingsRequest;
16809 /// let x = BulkMuteFindingsRequest::new().set_filter("example");
16810 /// ```
16811 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16812 self.filter = v.into();
16813 self
16814 }
16815
16816 /// Sets the value of [mute_state][crate::model::BulkMuteFindingsRequest::mute_state].
16817 ///
16818 /// # Example
16819 /// ```ignore,no_run
16820 /// # use google_cloud_securitycenter_v2::model::BulkMuteFindingsRequest;
16821 /// use google_cloud_securitycenter_v2::model::bulk_mute_findings_request::MuteState;
16822 /// let x0 = BulkMuteFindingsRequest::new().set_mute_state(MuteState::Muted);
16823 /// let x1 = BulkMuteFindingsRequest::new().set_mute_state(MuteState::Undefined);
16824 /// ```
16825 pub fn set_mute_state<
16826 T: std::convert::Into<crate::model::bulk_mute_findings_request::MuteState>,
16827 >(
16828 mut self,
16829 v: T,
16830 ) -> Self {
16831 self.mute_state = v.into();
16832 self
16833 }
16834}
16835
16836impl wkt::message::Message for BulkMuteFindingsRequest {
16837 fn typename() -> &'static str {
16838 "type.googleapis.com/google.cloud.securitycenter.v2.BulkMuteFindingsRequest"
16839 }
16840}
16841
16842/// Defines additional types related to [BulkMuteFindingsRequest].
16843pub mod bulk_mute_findings_request {
16844 #[allow(unused_imports)]
16845 use super::*;
16846
16847 /// The mute state.
16848 ///
16849 /// # Working with unknown values
16850 ///
16851 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16852 /// additional enum variants at any time. Adding new variants is not considered
16853 /// a breaking change. Applications should write their code in anticipation of:
16854 ///
16855 /// - New values appearing in future releases of the client library, **and**
16856 /// - New values received dynamically, without application changes.
16857 ///
16858 /// Please consult the [Working with enums] section in the user guide for some
16859 /// guidelines.
16860 ///
16861 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16862 #[derive(Clone, Debug, PartialEq)]
16863 #[non_exhaustive]
16864 pub enum MuteState {
16865 /// Unused.
16866 Unspecified,
16867 /// Matching findings will be muted (default).
16868 Muted,
16869 /// Matching findings will have their mute state cleared.
16870 Undefined,
16871 /// If set, the enum was initialized with an unknown value.
16872 ///
16873 /// Applications can examine the value using [MuteState::value] or
16874 /// [MuteState::name].
16875 UnknownValue(mute_state::UnknownValue),
16876 }
16877
16878 #[doc(hidden)]
16879 pub mod mute_state {
16880 #[allow(unused_imports)]
16881 use super::*;
16882 #[derive(Clone, Debug, PartialEq)]
16883 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16884 }
16885
16886 impl MuteState {
16887 /// Gets the enum value.
16888 ///
16889 /// Returns `None` if the enum contains an unknown value deserialized from
16890 /// the string representation of enums.
16891 pub fn value(&self) -> std::option::Option<i32> {
16892 match self {
16893 Self::Unspecified => std::option::Option::Some(0),
16894 Self::Muted => std::option::Option::Some(1),
16895 Self::Undefined => std::option::Option::Some(2),
16896 Self::UnknownValue(u) => u.0.value(),
16897 }
16898 }
16899
16900 /// Gets the enum value as a string.
16901 ///
16902 /// Returns `None` if the enum contains an unknown value deserialized from
16903 /// the integer representation of enums.
16904 pub fn name(&self) -> std::option::Option<&str> {
16905 match self {
16906 Self::Unspecified => std::option::Option::Some("MUTE_STATE_UNSPECIFIED"),
16907 Self::Muted => std::option::Option::Some("MUTED"),
16908 Self::Undefined => std::option::Option::Some("UNDEFINED"),
16909 Self::UnknownValue(u) => u.0.name(),
16910 }
16911 }
16912 }
16913
16914 impl std::default::Default for MuteState {
16915 fn default() -> Self {
16916 use std::convert::From;
16917 Self::from(0)
16918 }
16919 }
16920
16921 impl std::fmt::Display for MuteState {
16922 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16923 wkt::internal::display_enum(f, self.name(), self.value())
16924 }
16925 }
16926
16927 impl std::convert::From<i32> for MuteState {
16928 fn from(value: i32) -> Self {
16929 match value {
16930 0 => Self::Unspecified,
16931 1 => Self::Muted,
16932 2 => Self::Undefined,
16933 _ => Self::UnknownValue(mute_state::UnknownValue(
16934 wkt::internal::UnknownEnumValue::Integer(value),
16935 )),
16936 }
16937 }
16938 }
16939
16940 impl std::convert::From<&str> for MuteState {
16941 fn from(value: &str) -> Self {
16942 use std::string::ToString;
16943 match value {
16944 "MUTE_STATE_UNSPECIFIED" => Self::Unspecified,
16945 "MUTED" => Self::Muted,
16946 "UNDEFINED" => Self::Undefined,
16947 _ => Self::UnknownValue(mute_state::UnknownValue(
16948 wkt::internal::UnknownEnumValue::String(value.to_string()),
16949 )),
16950 }
16951 }
16952 }
16953
16954 impl serde::ser::Serialize for MuteState {
16955 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16956 where
16957 S: serde::Serializer,
16958 {
16959 match self {
16960 Self::Unspecified => serializer.serialize_i32(0),
16961 Self::Muted => serializer.serialize_i32(1),
16962 Self::Undefined => serializer.serialize_i32(2),
16963 Self::UnknownValue(u) => u.0.serialize(serializer),
16964 }
16965 }
16966 }
16967
16968 impl<'de> serde::de::Deserialize<'de> for MuteState {
16969 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16970 where
16971 D: serde::Deserializer<'de>,
16972 {
16973 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MuteState>::new(
16974 ".google.cloud.securitycenter.v2.BulkMuteFindingsRequest.MuteState",
16975 ))
16976 }
16977 }
16978}
16979
16980/// The response to a BulkMute request. Contains the LRO information.
16981#[derive(Clone, Default, PartialEq)]
16982#[non_exhaustive]
16983pub struct BulkMuteFindingsResponse {
16984 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16985}
16986
16987impl BulkMuteFindingsResponse {
16988 pub fn new() -> Self {
16989 std::default::Default::default()
16990 }
16991}
16992
16993impl wkt::message::Message for BulkMuteFindingsResponse {
16994 fn typename() -> &'static str {
16995 "type.googleapis.com/google.cloud.securitycenter.v2.BulkMuteFindingsResponse"
16996 }
16997}
16998
16999/// Request message for creating a BigQuery export.
17000#[derive(Clone, Default, PartialEq)]
17001#[non_exhaustive]
17002pub struct CreateBigQueryExportRequest {
17003 /// Required. The name of the parent resource of the new BigQuery export. Its
17004 /// format is `organizations/[organization_id]/locations/[location_id]`,
17005 /// `folders/[folder_id]/locations/[location_id]`, or
17006 /// `projects/[project_id]/locations/[location_id]`.
17007 pub parent: std::string::String,
17008
17009 /// Required. The BigQuery export being created.
17010 pub big_query_export: std::option::Option<crate::model::BigQueryExport>,
17011
17012 /// Required. Unique identifier provided by the client within the parent scope.
17013 /// It must consist of only lowercase letters, numbers, and hyphens, must start
17014 /// with a letter, must end with either a letter or a number, and must be 63
17015 /// characters or less.
17016 pub big_query_export_id: std::string::String,
17017
17018 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17019}
17020
17021impl CreateBigQueryExportRequest {
17022 pub fn new() -> Self {
17023 std::default::Default::default()
17024 }
17025
17026 /// Sets the value of [parent][crate::model::CreateBigQueryExportRequest::parent].
17027 ///
17028 /// # Example
17029 /// ```ignore,no_run
17030 /// # use google_cloud_securitycenter_v2::model::CreateBigQueryExportRequest;
17031 /// let x = CreateBigQueryExportRequest::new().set_parent("example");
17032 /// ```
17033 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17034 self.parent = v.into();
17035 self
17036 }
17037
17038 /// Sets the value of [big_query_export][crate::model::CreateBigQueryExportRequest::big_query_export].
17039 ///
17040 /// # Example
17041 /// ```ignore,no_run
17042 /// # use google_cloud_securitycenter_v2::model::CreateBigQueryExportRequest;
17043 /// use google_cloud_securitycenter_v2::model::BigQueryExport;
17044 /// let x = CreateBigQueryExportRequest::new().set_big_query_export(BigQueryExport::default()/* use setters */);
17045 /// ```
17046 pub fn set_big_query_export<T>(mut self, v: T) -> Self
17047 where
17048 T: std::convert::Into<crate::model::BigQueryExport>,
17049 {
17050 self.big_query_export = std::option::Option::Some(v.into());
17051 self
17052 }
17053
17054 /// Sets or clears the value of [big_query_export][crate::model::CreateBigQueryExportRequest::big_query_export].
17055 ///
17056 /// # Example
17057 /// ```ignore,no_run
17058 /// # use google_cloud_securitycenter_v2::model::CreateBigQueryExportRequest;
17059 /// use google_cloud_securitycenter_v2::model::BigQueryExport;
17060 /// let x = CreateBigQueryExportRequest::new().set_or_clear_big_query_export(Some(BigQueryExport::default()/* use setters */));
17061 /// let x = CreateBigQueryExportRequest::new().set_or_clear_big_query_export(None::<BigQueryExport>);
17062 /// ```
17063 pub fn set_or_clear_big_query_export<T>(mut self, v: std::option::Option<T>) -> Self
17064 where
17065 T: std::convert::Into<crate::model::BigQueryExport>,
17066 {
17067 self.big_query_export = v.map(|x| x.into());
17068 self
17069 }
17070
17071 /// Sets the value of [big_query_export_id][crate::model::CreateBigQueryExportRequest::big_query_export_id].
17072 ///
17073 /// # Example
17074 /// ```ignore,no_run
17075 /// # use google_cloud_securitycenter_v2::model::CreateBigQueryExportRequest;
17076 /// let x = CreateBigQueryExportRequest::new().set_big_query_export_id("example");
17077 /// ```
17078 pub fn set_big_query_export_id<T: std::convert::Into<std::string::String>>(
17079 mut self,
17080 v: T,
17081 ) -> Self {
17082 self.big_query_export_id = v.into();
17083 self
17084 }
17085}
17086
17087impl wkt::message::Message for CreateBigQueryExportRequest {
17088 fn typename() -> &'static str {
17089 "type.googleapis.com/google.cloud.securitycenter.v2.CreateBigQueryExportRequest"
17090 }
17091}
17092
17093/// Request message for creating a finding.
17094#[derive(Clone, Default, PartialEq)]
17095#[non_exhaustive]
17096pub struct CreateFindingRequest {
17097 /// Required. Resource name of the new finding's parent. The following list
17098 /// shows some examples of the format:
17099 /// +
17100 /// `organizations/[organization_id]/sources/[source_id]`
17101 /// +
17102 /// `organizations/[organization_id]/sources/[source_id]/locations/[location_id]`
17103 pub parent: std::string::String,
17104
17105 /// Required. Unique identifier provided by the client within the parent scope.
17106 /// It must be alphanumeric and less than or equal to 32 characters and
17107 /// greater than 0 characters in length.
17108 pub finding_id: std::string::String,
17109
17110 /// Required. The Finding being created. The name and security_marks will be
17111 /// ignored as they are both output only fields on this resource.
17112 pub finding: std::option::Option<crate::model::Finding>,
17113
17114 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17115}
17116
17117impl CreateFindingRequest {
17118 pub fn new() -> Self {
17119 std::default::Default::default()
17120 }
17121
17122 /// Sets the value of [parent][crate::model::CreateFindingRequest::parent].
17123 ///
17124 /// # Example
17125 /// ```ignore,no_run
17126 /// # use google_cloud_securitycenter_v2::model::CreateFindingRequest;
17127 /// let x = CreateFindingRequest::new().set_parent("example");
17128 /// ```
17129 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17130 self.parent = v.into();
17131 self
17132 }
17133
17134 /// Sets the value of [finding_id][crate::model::CreateFindingRequest::finding_id].
17135 ///
17136 /// # Example
17137 /// ```ignore,no_run
17138 /// # use google_cloud_securitycenter_v2::model::CreateFindingRequest;
17139 /// let x = CreateFindingRequest::new().set_finding_id("example");
17140 /// ```
17141 pub fn set_finding_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17142 self.finding_id = v.into();
17143 self
17144 }
17145
17146 /// Sets the value of [finding][crate::model::CreateFindingRequest::finding].
17147 ///
17148 /// # Example
17149 /// ```ignore,no_run
17150 /// # use google_cloud_securitycenter_v2::model::CreateFindingRequest;
17151 /// use google_cloud_securitycenter_v2::model::Finding;
17152 /// let x = CreateFindingRequest::new().set_finding(Finding::default()/* use setters */);
17153 /// ```
17154 pub fn set_finding<T>(mut self, v: T) -> Self
17155 where
17156 T: std::convert::Into<crate::model::Finding>,
17157 {
17158 self.finding = std::option::Option::Some(v.into());
17159 self
17160 }
17161
17162 /// Sets or clears the value of [finding][crate::model::CreateFindingRequest::finding].
17163 ///
17164 /// # Example
17165 /// ```ignore,no_run
17166 /// # use google_cloud_securitycenter_v2::model::CreateFindingRequest;
17167 /// use google_cloud_securitycenter_v2::model::Finding;
17168 /// let x = CreateFindingRequest::new().set_or_clear_finding(Some(Finding::default()/* use setters */));
17169 /// let x = CreateFindingRequest::new().set_or_clear_finding(None::<Finding>);
17170 /// ```
17171 pub fn set_or_clear_finding<T>(mut self, v: std::option::Option<T>) -> Self
17172 where
17173 T: std::convert::Into<crate::model::Finding>,
17174 {
17175 self.finding = v.map(|x| x.into());
17176 self
17177 }
17178}
17179
17180impl wkt::message::Message for CreateFindingRequest {
17181 fn typename() -> &'static str {
17182 "type.googleapis.com/google.cloud.securitycenter.v2.CreateFindingRequest"
17183 }
17184}
17185
17186/// Request message for creating a mute config.
17187#[derive(Clone, Default, PartialEq)]
17188#[non_exhaustive]
17189pub struct CreateMuteConfigRequest {
17190 /// Required. Resource name of the new mute configs's parent. Its format is
17191 /// `organizations/[organization_id]/locations/[location_id]`,
17192 /// `folders/[folder_id]/locations/[location_id]`, or
17193 /// `projects/[project_id]/locations/[location_id]`.
17194 pub parent: std::string::String,
17195
17196 /// Required. The mute config being created.
17197 pub mute_config: std::option::Option<crate::model::MuteConfig>,
17198
17199 /// Required. Unique identifier provided by the client within the parent scope.
17200 /// It must consist of only lowercase letters, numbers, and hyphens, must start
17201 /// with a letter, must end with either a letter or a number, and must be 63
17202 /// characters or less.
17203 pub mute_config_id: std::string::String,
17204
17205 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17206}
17207
17208impl CreateMuteConfigRequest {
17209 pub fn new() -> Self {
17210 std::default::Default::default()
17211 }
17212
17213 /// Sets the value of [parent][crate::model::CreateMuteConfigRequest::parent].
17214 ///
17215 /// # Example
17216 /// ```ignore,no_run
17217 /// # use google_cloud_securitycenter_v2::model::CreateMuteConfigRequest;
17218 /// let x = CreateMuteConfigRequest::new().set_parent("example");
17219 /// ```
17220 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17221 self.parent = v.into();
17222 self
17223 }
17224
17225 /// Sets the value of [mute_config][crate::model::CreateMuteConfigRequest::mute_config].
17226 ///
17227 /// # Example
17228 /// ```ignore,no_run
17229 /// # use google_cloud_securitycenter_v2::model::CreateMuteConfigRequest;
17230 /// use google_cloud_securitycenter_v2::model::MuteConfig;
17231 /// let x = CreateMuteConfigRequest::new().set_mute_config(MuteConfig::default()/* use setters */);
17232 /// ```
17233 pub fn set_mute_config<T>(mut self, v: T) -> Self
17234 where
17235 T: std::convert::Into<crate::model::MuteConfig>,
17236 {
17237 self.mute_config = std::option::Option::Some(v.into());
17238 self
17239 }
17240
17241 /// Sets or clears the value of [mute_config][crate::model::CreateMuteConfigRequest::mute_config].
17242 ///
17243 /// # Example
17244 /// ```ignore,no_run
17245 /// # use google_cloud_securitycenter_v2::model::CreateMuteConfigRequest;
17246 /// use google_cloud_securitycenter_v2::model::MuteConfig;
17247 /// let x = CreateMuteConfigRequest::new().set_or_clear_mute_config(Some(MuteConfig::default()/* use setters */));
17248 /// let x = CreateMuteConfigRequest::new().set_or_clear_mute_config(None::<MuteConfig>);
17249 /// ```
17250 pub fn set_or_clear_mute_config<T>(mut self, v: std::option::Option<T>) -> Self
17251 where
17252 T: std::convert::Into<crate::model::MuteConfig>,
17253 {
17254 self.mute_config = v.map(|x| x.into());
17255 self
17256 }
17257
17258 /// Sets the value of [mute_config_id][crate::model::CreateMuteConfigRequest::mute_config_id].
17259 ///
17260 /// # Example
17261 /// ```ignore,no_run
17262 /// # use google_cloud_securitycenter_v2::model::CreateMuteConfigRequest;
17263 /// let x = CreateMuteConfigRequest::new().set_mute_config_id("example");
17264 /// ```
17265 pub fn set_mute_config_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17266 self.mute_config_id = v.into();
17267 self
17268 }
17269}
17270
17271impl wkt::message::Message for CreateMuteConfigRequest {
17272 fn typename() -> &'static str {
17273 "type.googleapis.com/google.cloud.securitycenter.v2.CreateMuteConfigRequest"
17274 }
17275}
17276
17277/// Request message for creating a notification config.
17278#[derive(Clone, Default, PartialEq)]
17279#[non_exhaustive]
17280pub struct CreateNotificationConfigRequest {
17281 /// Required. Resource name of the new notification config's parent. Its format
17282 /// is `organizations/[organization_id]/locations/[location_id]`,
17283 /// `folders/[folder_id]/locations/[location_id]`, or
17284 /// `projects/[project_id]/locations/[location_id]`.
17285 pub parent: std::string::String,
17286
17287 /// Required.
17288 /// Unique identifier provided by the client within the parent scope.
17289 /// It must be between 1 and 128 characters and contain alphanumeric
17290 /// characters, underscores, or hyphens only.
17291 pub config_id: std::string::String,
17292
17293 /// Required. The notification config being created. The name and the service
17294 /// account will be ignored as they are both output only fields on this
17295 /// resource.
17296 pub notification_config: std::option::Option<crate::model::NotificationConfig>,
17297
17298 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17299}
17300
17301impl CreateNotificationConfigRequest {
17302 pub fn new() -> Self {
17303 std::default::Default::default()
17304 }
17305
17306 /// Sets the value of [parent][crate::model::CreateNotificationConfigRequest::parent].
17307 ///
17308 /// # Example
17309 /// ```ignore,no_run
17310 /// # use google_cloud_securitycenter_v2::model::CreateNotificationConfigRequest;
17311 /// let x = CreateNotificationConfigRequest::new().set_parent("example");
17312 /// ```
17313 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17314 self.parent = v.into();
17315 self
17316 }
17317
17318 /// Sets the value of [config_id][crate::model::CreateNotificationConfigRequest::config_id].
17319 ///
17320 /// # Example
17321 /// ```ignore,no_run
17322 /// # use google_cloud_securitycenter_v2::model::CreateNotificationConfigRequest;
17323 /// let x = CreateNotificationConfigRequest::new().set_config_id("example");
17324 /// ```
17325 pub fn set_config_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17326 self.config_id = v.into();
17327 self
17328 }
17329
17330 /// Sets the value of [notification_config][crate::model::CreateNotificationConfigRequest::notification_config].
17331 ///
17332 /// # Example
17333 /// ```ignore,no_run
17334 /// # use google_cloud_securitycenter_v2::model::CreateNotificationConfigRequest;
17335 /// use google_cloud_securitycenter_v2::model::NotificationConfig;
17336 /// let x = CreateNotificationConfigRequest::new().set_notification_config(NotificationConfig::default()/* use setters */);
17337 /// ```
17338 pub fn set_notification_config<T>(mut self, v: T) -> Self
17339 where
17340 T: std::convert::Into<crate::model::NotificationConfig>,
17341 {
17342 self.notification_config = std::option::Option::Some(v.into());
17343 self
17344 }
17345
17346 /// Sets or clears the value of [notification_config][crate::model::CreateNotificationConfigRequest::notification_config].
17347 ///
17348 /// # Example
17349 /// ```ignore,no_run
17350 /// # use google_cloud_securitycenter_v2::model::CreateNotificationConfigRequest;
17351 /// use google_cloud_securitycenter_v2::model::NotificationConfig;
17352 /// let x = CreateNotificationConfigRequest::new().set_or_clear_notification_config(Some(NotificationConfig::default()/* use setters */));
17353 /// let x = CreateNotificationConfigRequest::new().set_or_clear_notification_config(None::<NotificationConfig>);
17354 /// ```
17355 pub fn set_or_clear_notification_config<T>(mut self, v: std::option::Option<T>) -> Self
17356 where
17357 T: std::convert::Into<crate::model::NotificationConfig>,
17358 {
17359 self.notification_config = v.map(|x| x.into());
17360 self
17361 }
17362}
17363
17364impl wkt::message::Message for CreateNotificationConfigRequest {
17365 fn typename() -> &'static str {
17366 "type.googleapis.com/google.cloud.securitycenter.v2.CreateNotificationConfigRequest"
17367 }
17368}
17369
17370/// Request message to create single resource value config
17371#[derive(Clone, Default, PartialEq)]
17372#[non_exhaustive]
17373pub struct CreateResourceValueConfigRequest {
17374 /// Required. Resource name of the new ResourceValueConfig's parent.
17375 pub parent: std::string::String,
17376
17377 /// Required. The resource value config being created.
17378 pub resource_value_config: std::option::Option<crate::model::ResourceValueConfig>,
17379
17380 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17381}
17382
17383impl CreateResourceValueConfigRequest {
17384 pub fn new() -> Self {
17385 std::default::Default::default()
17386 }
17387
17388 /// Sets the value of [parent][crate::model::CreateResourceValueConfigRequest::parent].
17389 ///
17390 /// # Example
17391 /// ```ignore,no_run
17392 /// # use google_cloud_securitycenter_v2::model::CreateResourceValueConfigRequest;
17393 /// let x = CreateResourceValueConfigRequest::new().set_parent("example");
17394 /// ```
17395 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17396 self.parent = v.into();
17397 self
17398 }
17399
17400 /// Sets the value of [resource_value_config][crate::model::CreateResourceValueConfigRequest::resource_value_config].
17401 ///
17402 /// # Example
17403 /// ```ignore,no_run
17404 /// # use google_cloud_securitycenter_v2::model::CreateResourceValueConfigRequest;
17405 /// use google_cloud_securitycenter_v2::model::ResourceValueConfig;
17406 /// let x = CreateResourceValueConfigRequest::new().set_resource_value_config(ResourceValueConfig::default()/* use setters */);
17407 /// ```
17408 pub fn set_resource_value_config<T>(mut self, v: T) -> Self
17409 where
17410 T: std::convert::Into<crate::model::ResourceValueConfig>,
17411 {
17412 self.resource_value_config = std::option::Option::Some(v.into());
17413 self
17414 }
17415
17416 /// Sets or clears the value of [resource_value_config][crate::model::CreateResourceValueConfigRequest::resource_value_config].
17417 ///
17418 /// # Example
17419 /// ```ignore,no_run
17420 /// # use google_cloud_securitycenter_v2::model::CreateResourceValueConfigRequest;
17421 /// use google_cloud_securitycenter_v2::model::ResourceValueConfig;
17422 /// let x = CreateResourceValueConfigRequest::new().set_or_clear_resource_value_config(Some(ResourceValueConfig::default()/* use setters */));
17423 /// let x = CreateResourceValueConfigRequest::new().set_or_clear_resource_value_config(None::<ResourceValueConfig>);
17424 /// ```
17425 pub fn set_or_clear_resource_value_config<T>(mut self, v: std::option::Option<T>) -> Self
17426 where
17427 T: std::convert::Into<crate::model::ResourceValueConfig>,
17428 {
17429 self.resource_value_config = v.map(|x| x.into());
17430 self
17431 }
17432}
17433
17434impl wkt::message::Message for CreateResourceValueConfigRequest {
17435 fn typename() -> &'static str {
17436 "type.googleapis.com/google.cloud.securitycenter.v2.CreateResourceValueConfigRequest"
17437 }
17438}
17439
17440/// Request message for creating a source.
17441#[derive(Clone, Default, PartialEq)]
17442#[non_exhaustive]
17443pub struct CreateSourceRequest {
17444 /// Required. Resource name of the new source's parent. Its format should be
17445 /// `organizations/[organization_id]`.
17446 pub parent: std::string::String,
17447
17448 /// Required. The Source being created, only the display_name and description
17449 /// will be used. All other fields will be ignored.
17450 pub source: std::option::Option<crate::model::Source>,
17451
17452 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17453}
17454
17455impl CreateSourceRequest {
17456 pub fn new() -> Self {
17457 std::default::Default::default()
17458 }
17459
17460 /// Sets the value of [parent][crate::model::CreateSourceRequest::parent].
17461 ///
17462 /// # Example
17463 /// ```ignore,no_run
17464 /// # use google_cloud_securitycenter_v2::model::CreateSourceRequest;
17465 /// let x = CreateSourceRequest::new().set_parent("example");
17466 /// ```
17467 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17468 self.parent = v.into();
17469 self
17470 }
17471
17472 /// Sets the value of [source][crate::model::CreateSourceRequest::source].
17473 ///
17474 /// # Example
17475 /// ```ignore,no_run
17476 /// # use google_cloud_securitycenter_v2::model::CreateSourceRequest;
17477 /// use google_cloud_securitycenter_v2::model::Source;
17478 /// let x = CreateSourceRequest::new().set_source(Source::default()/* use setters */);
17479 /// ```
17480 pub fn set_source<T>(mut self, v: T) -> Self
17481 where
17482 T: std::convert::Into<crate::model::Source>,
17483 {
17484 self.source = std::option::Option::Some(v.into());
17485 self
17486 }
17487
17488 /// Sets or clears the value of [source][crate::model::CreateSourceRequest::source].
17489 ///
17490 /// # Example
17491 /// ```ignore,no_run
17492 /// # use google_cloud_securitycenter_v2::model::CreateSourceRequest;
17493 /// use google_cloud_securitycenter_v2::model::Source;
17494 /// let x = CreateSourceRequest::new().set_or_clear_source(Some(Source::default()/* use setters */));
17495 /// let x = CreateSourceRequest::new().set_or_clear_source(None::<Source>);
17496 /// ```
17497 pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
17498 where
17499 T: std::convert::Into<crate::model::Source>,
17500 {
17501 self.source = v.map(|x| x.into());
17502 self
17503 }
17504}
17505
17506impl wkt::message::Message for CreateSourceRequest {
17507 fn typename() -> &'static str {
17508 "type.googleapis.com/google.cloud.securitycenter.v2.CreateSourceRequest"
17509 }
17510}
17511
17512/// Request message for deleting a BigQuery export.
17513#[derive(Clone, Default, PartialEq)]
17514#[non_exhaustive]
17515pub struct DeleteBigQueryExportRequest {
17516 /// Required. The name of the BigQuery export to delete. The following list
17517 /// shows some examples of the format:
17518 ///
17519 ///
17520 /// `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}`
17521 ///
17522 /// + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}`
17523 /// + `projects/{project}/locations/{location}/bigQueryExports/{export_id}`
17524 pub name: std::string::String,
17525
17526 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17527}
17528
17529impl DeleteBigQueryExportRequest {
17530 pub fn new() -> Self {
17531 std::default::Default::default()
17532 }
17533
17534 /// Sets the value of [name][crate::model::DeleteBigQueryExportRequest::name].
17535 ///
17536 /// # Example
17537 /// ```ignore,no_run
17538 /// # use google_cloud_securitycenter_v2::model::DeleteBigQueryExportRequest;
17539 /// let x = DeleteBigQueryExportRequest::new().set_name("example");
17540 /// ```
17541 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17542 self.name = v.into();
17543 self
17544 }
17545}
17546
17547impl wkt::message::Message for DeleteBigQueryExportRequest {
17548 fn typename() -> &'static str {
17549 "type.googleapis.com/google.cloud.securitycenter.v2.DeleteBigQueryExportRequest"
17550 }
17551}
17552
17553/// Request message for deleting a mute config. If no location is specified,
17554/// default is global.
17555#[derive(Clone, Default, PartialEq)]
17556#[non_exhaustive]
17557pub struct DeleteMuteConfigRequest {
17558 /// Required. Name of the mute config to delete. The following list shows some
17559 /// examples of the format:
17560 ///
17561 /// + `organizations/{organization}/muteConfigs/{config_id}`
17562 ///
17563 /// `organizations/{organization}/locations/{location}/muteConfigs/{config_id}`
17564 ///
17565 /// + `folders/{folder}/muteConfigs/{config_id}`
17566 /// + `folders/{folder}/locations/{location}/muteConfigs/{config_id}`
17567 /// + `projects/{project}/muteConfigs/{config_id}`
17568 /// + `projects/{project}/locations/{location}/muteConfigs/{config_id}`
17569 pub name: std::string::String,
17570
17571 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17572}
17573
17574impl DeleteMuteConfigRequest {
17575 pub fn new() -> Self {
17576 std::default::Default::default()
17577 }
17578
17579 /// Sets the value of [name][crate::model::DeleteMuteConfigRequest::name].
17580 ///
17581 /// # Example
17582 /// ```ignore,no_run
17583 /// # use google_cloud_securitycenter_v2::model::DeleteMuteConfigRequest;
17584 /// let x = DeleteMuteConfigRequest::new().set_name("example");
17585 /// ```
17586 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17587 self.name = v.into();
17588 self
17589 }
17590}
17591
17592impl wkt::message::Message for DeleteMuteConfigRequest {
17593 fn typename() -> &'static str {
17594 "type.googleapis.com/google.cloud.securitycenter.v2.DeleteMuteConfigRequest"
17595 }
17596}
17597
17598/// Request message for deleting a notification config.
17599#[derive(Clone, Default, PartialEq)]
17600#[non_exhaustive]
17601pub struct DeleteNotificationConfigRequest {
17602 /// Required. Name of the notification config to delete. The following list
17603 /// shows some examples of the format:
17604 ///
17605 ///
17606 /// `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]`
17607 /// +
17608 /// `folders/[folder_id]/locations/[location_id]notificationConfigs/[config_id]`
17609 /// +
17610 /// `projects/[project_id]/locations/[location_id]notificationConfigs/[config_id]`
17611 pub name: std::string::String,
17612
17613 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17614}
17615
17616impl DeleteNotificationConfigRequest {
17617 pub fn new() -> Self {
17618 std::default::Default::default()
17619 }
17620
17621 /// Sets the value of [name][crate::model::DeleteNotificationConfigRequest::name].
17622 ///
17623 /// # Example
17624 /// ```ignore,no_run
17625 /// # use google_cloud_securitycenter_v2::model::DeleteNotificationConfigRequest;
17626 /// let x = DeleteNotificationConfigRequest::new().set_name("example");
17627 /// ```
17628 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17629 self.name = v.into();
17630 self
17631 }
17632}
17633
17634impl wkt::message::Message for DeleteNotificationConfigRequest {
17635 fn typename() -> &'static str {
17636 "type.googleapis.com/google.cloud.securitycenter.v2.DeleteNotificationConfigRequest"
17637 }
17638}
17639
17640/// Request message to delete resource value config
17641#[derive(Clone, Default, PartialEq)]
17642#[non_exhaustive]
17643pub struct DeleteResourceValueConfigRequest {
17644 /// Required. Name of the ResourceValueConfig to delete
17645 pub name: std::string::String,
17646
17647 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17648}
17649
17650impl DeleteResourceValueConfigRequest {
17651 pub fn new() -> Self {
17652 std::default::Default::default()
17653 }
17654
17655 /// Sets the value of [name][crate::model::DeleteResourceValueConfigRequest::name].
17656 ///
17657 /// # Example
17658 /// ```ignore,no_run
17659 /// # use google_cloud_securitycenter_v2::model::DeleteResourceValueConfigRequest;
17660 /// let x = DeleteResourceValueConfigRequest::new().set_name("example");
17661 /// ```
17662 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17663 self.name = v.into();
17664 self
17665 }
17666}
17667
17668impl wkt::message::Message for DeleteResourceValueConfigRequest {
17669 fn typename() -> &'static str {
17670 "type.googleapis.com/google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest"
17671 }
17672}
17673
17674/// The destination big query dataset to export findings to.
17675#[derive(Clone, Default, PartialEq)]
17676#[non_exhaustive]
17677pub struct BigQueryDestination {
17678 /// Required. The relative resource name of the destination dataset, in the
17679 /// form projects/{projectId}/datasets/{datasetId}.
17680 pub dataset: std::string::String,
17681
17682 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17683}
17684
17685impl BigQueryDestination {
17686 pub fn new() -> Self {
17687 std::default::Default::default()
17688 }
17689
17690 /// Sets the value of [dataset][crate::model::BigQueryDestination::dataset].
17691 ///
17692 /// # Example
17693 /// ```ignore,no_run
17694 /// # use google_cloud_securitycenter_v2::model::BigQueryDestination;
17695 /// let x = BigQueryDestination::new().set_dataset("example");
17696 /// ```
17697 pub fn set_dataset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17698 self.dataset = v.into();
17699 self
17700 }
17701}
17702
17703impl wkt::message::Message for BigQueryDestination {
17704 fn typename() -> &'static str {
17705 "type.googleapis.com/google.cloud.securitycenter.v2.BigQueryDestination"
17706 }
17707}
17708
17709/// The LRO metadata for a ExportFindings request.
17710#[derive(Clone, Default, PartialEq)]
17711#[non_exhaustive]
17712pub struct ExportFindingsMetadata {
17713 /// Optional. Timestamp at which export was started
17714 pub export_start_time: std::option::Option<wkt::Timestamp>,
17715
17716 /// The destination to export findings to.
17717 pub destination: std::option::Option<crate::model::export_findings_metadata::Destination>,
17718
17719 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17720}
17721
17722impl ExportFindingsMetadata {
17723 pub fn new() -> Self {
17724 std::default::Default::default()
17725 }
17726
17727 /// Sets the value of [export_start_time][crate::model::ExportFindingsMetadata::export_start_time].
17728 ///
17729 /// # Example
17730 /// ```ignore,no_run
17731 /// # use google_cloud_securitycenter_v2::model::ExportFindingsMetadata;
17732 /// use wkt::Timestamp;
17733 /// let x = ExportFindingsMetadata::new().set_export_start_time(Timestamp::default()/* use setters */);
17734 /// ```
17735 pub fn set_export_start_time<T>(mut self, v: T) -> Self
17736 where
17737 T: std::convert::Into<wkt::Timestamp>,
17738 {
17739 self.export_start_time = std::option::Option::Some(v.into());
17740 self
17741 }
17742
17743 /// Sets or clears the value of [export_start_time][crate::model::ExportFindingsMetadata::export_start_time].
17744 ///
17745 /// # Example
17746 /// ```ignore,no_run
17747 /// # use google_cloud_securitycenter_v2::model::ExportFindingsMetadata;
17748 /// use wkt::Timestamp;
17749 /// let x = ExportFindingsMetadata::new().set_or_clear_export_start_time(Some(Timestamp::default()/* use setters */));
17750 /// let x = ExportFindingsMetadata::new().set_or_clear_export_start_time(None::<Timestamp>);
17751 /// ```
17752 pub fn set_or_clear_export_start_time<T>(mut self, v: std::option::Option<T>) -> Self
17753 where
17754 T: std::convert::Into<wkt::Timestamp>,
17755 {
17756 self.export_start_time = v.map(|x| x.into());
17757 self
17758 }
17759
17760 /// Sets the value of [destination][crate::model::ExportFindingsMetadata::destination].
17761 ///
17762 /// Note that all the setters affecting `destination` are mutually
17763 /// exclusive.
17764 ///
17765 /// # Example
17766 /// ```ignore,no_run
17767 /// # use google_cloud_securitycenter_v2::model::ExportFindingsMetadata;
17768 /// use google_cloud_securitycenter_v2::model::BigQueryDestination;
17769 /// let x = ExportFindingsMetadata::new().set_destination(Some(
17770 /// google_cloud_securitycenter_v2::model::export_findings_metadata::Destination::BigQueryDestination(BigQueryDestination::default().into())));
17771 /// ```
17772 pub fn set_destination<
17773 T: std::convert::Into<
17774 std::option::Option<crate::model::export_findings_metadata::Destination>,
17775 >,
17776 >(
17777 mut self,
17778 v: T,
17779 ) -> Self {
17780 self.destination = v.into();
17781 self
17782 }
17783
17784 /// The value of [destination][crate::model::ExportFindingsMetadata::destination]
17785 /// if it holds a `BigQueryDestination`, `None` if the field is not set or
17786 /// holds a different branch.
17787 pub fn big_query_destination(
17788 &self,
17789 ) -> std::option::Option<&std::boxed::Box<crate::model::BigQueryDestination>> {
17790 #[allow(unreachable_patterns)]
17791 self.destination.as_ref().and_then(|v| match v {
17792 crate::model::export_findings_metadata::Destination::BigQueryDestination(v) => {
17793 std::option::Option::Some(v)
17794 }
17795 _ => std::option::Option::None,
17796 })
17797 }
17798
17799 /// Sets the value of [destination][crate::model::ExportFindingsMetadata::destination]
17800 /// to hold a `BigQueryDestination`.
17801 ///
17802 /// Note that all the setters affecting `destination` are
17803 /// mutually exclusive.
17804 ///
17805 /// # Example
17806 /// ```ignore,no_run
17807 /// # use google_cloud_securitycenter_v2::model::ExportFindingsMetadata;
17808 /// use google_cloud_securitycenter_v2::model::BigQueryDestination;
17809 /// let x = ExportFindingsMetadata::new().set_big_query_destination(BigQueryDestination::default()/* use setters */);
17810 /// assert!(x.big_query_destination().is_some());
17811 /// ```
17812 pub fn set_big_query_destination<
17813 T: std::convert::Into<std::boxed::Box<crate::model::BigQueryDestination>>,
17814 >(
17815 mut self,
17816 v: T,
17817 ) -> Self {
17818 self.destination = std::option::Option::Some(
17819 crate::model::export_findings_metadata::Destination::BigQueryDestination(v.into()),
17820 );
17821 self
17822 }
17823}
17824
17825impl wkt::message::Message for ExportFindingsMetadata {
17826 fn typename() -> &'static str {
17827 "type.googleapis.com/google.cloud.securitycenter.v2.ExportFindingsMetadata"
17828 }
17829}
17830
17831/// Defines additional types related to [ExportFindingsMetadata].
17832pub mod export_findings_metadata {
17833 #[allow(unused_imports)]
17834 use super::*;
17835
17836 /// The destination to export findings to.
17837 #[derive(Clone, Debug, PartialEq)]
17838 #[non_exhaustive]
17839 pub enum Destination {
17840 /// Required. The destination big query dataset to export findings to.
17841 BigQueryDestination(std::boxed::Box<crate::model::BigQueryDestination>),
17842 }
17843}
17844
17845/// The response to a ExportFindings request. Contains the LRO information.
17846#[derive(Clone, Default, PartialEq)]
17847#[non_exhaustive]
17848pub struct ExportFindingsResponse {
17849 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17850}
17851
17852impl ExportFindingsResponse {
17853 pub fn new() -> Self {
17854 std::default::Default::default()
17855 }
17856}
17857
17858impl wkt::message::Message for ExportFindingsResponse {
17859 fn typename() -> &'static str {
17860 "type.googleapis.com/google.cloud.securitycenter.v2.ExportFindingsResponse"
17861 }
17862}
17863
17864/// Request message for retrieving a BigQuery export.
17865#[derive(Clone, Default, PartialEq)]
17866#[non_exhaustive]
17867pub struct GetBigQueryExportRequest {
17868 /// Required. Name of the BigQuery export to retrieve. The following list shows
17869 /// some examples of the format:
17870 ///
17871 ///
17872 /// `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}`
17873 ///
17874 /// + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}`
17875 /// + `projects/{project}locations/{location}//bigQueryExports/{export_id}`
17876 pub name: std::string::String,
17877
17878 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17879}
17880
17881impl GetBigQueryExportRequest {
17882 pub fn new() -> Self {
17883 std::default::Default::default()
17884 }
17885
17886 /// Sets the value of [name][crate::model::GetBigQueryExportRequest::name].
17887 ///
17888 /// # Example
17889 /// ```ignore,no_run
17890 /// # use google_cloud_securitycenter_v2::model::GetBigQueryExportRequest;
17891 /// let x = GetBigQueryExportRequest::new().set_name("example");
17892 /// ```
17893 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17894 self.name = v.into();
17895 self
17896 }
17897}
17898
17899impl wkt::message::Message for GetBigQueryExportRequest {
17900 fn typename() -> &'static str {
17901 "type.googleapis.com/google.cloud.securitycenter.v2.GetBigQueryExportRequest"
17902 }
17903}
17904
17905/// Request message for retrieving a mute config. If no location is specified,
17906/// default is global.
17907#[derive(Clone, Default, PartialEq)]
17908#[non_exhaustive]
17909pub struct GetMuteConfigRequest {
17910 /// Required. Name of the mute config to retrieve. The following list shows
17911 /// some examples of the format:
17912 ///
17913 /// + `organizations/{organization}/muteConfigs/{config_id}`
17914 ///
17915 /// `organizations/{organization}/locations/{location}/muteConfigs/{config_id}`
17916 ///
17917 /// + `folders/{folder}/muteConfigs/{config_id}`
17918 /// + `folders/{folder}/locations/{location}/muteConfigs/{config_id}`
17919 /// + `projects/{project}/muteConfigs/{config_id}`
17920 /// + `projects/{project}/locations/{location}/muteConfigs/{config_id}`
17921 pub name: std::string::String,
17922
17923 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17924}
17925
17926impl GetMuteConfigRequest {
17927 pub fn new() -> Self {
17928 std::default::Default::default()
17929 }
17930
17931 /// Sets the value of [name][crate::model::GetMuteConfigRequest::name].
17932 ///
17933 /// # Example
17934 /// ```ignore,no_run
17935 /// # use google_cloud_securitycenter_v2::model::GetMuteConfigRequest;
17936 /// let x = GetMuteConfigRequest::new().set_name("example");
17937 /// ```
17938 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17939 self.name = v.into();
17940 self
17941 }
17942}
17943
17944impl wkt::message::Message for GetMuteConfigRequest {
17945 fn typename() -> &'static str {
17946 "type.googleapis.com/google.cloud.securitycenter.v2.GetMuteConfigRequest"
17947 }
17948}
17949
17950/// Request message for getting a notification config.
17951#[derive(Clone, Default, PartialEq)]
17952#[non_exhaustive]
17953pub struct GetNotificationConfigRequest {
17954 /// Required. Name of the notification config to get. The following list shows
17955 /// some examples of the format:
17956 ///
17957 ///
17958 /// `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]`
17959 /// +
17960 /// `folders/[folder_id]/locations/[location_id]/notificationConfigs/[config_id]`
17961 /// +
17962 /// `projects/[project_id]/locations/[location_id]/notificationConfigs/[config_id]`
17963 pub name: std::string::String,
17964
17965 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17966}
17967
17968impl GetNotificationConfigRequest {
17969 pub fn new() -> Self {
17970 std::default::Default::default()
17971 }
17972
17973 /// Sets the value of [name][crate::model::GetNotificationConfigRequest::name].
17974 ///
17975 /// # Example
17976 /// ```ignore,no_run
17977 /// # use google_cloud_securitycenter_v2::model::GetNotificationConfigRequest;
17978 /// let x = GetNotificationConfigRequest::new().set_name("example");
17979 /// ```
17980 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17981 self.name = v.into();
17982 self
17983 }
17984}
17985
17986impl wkt::message::Message for GetNotificationConfigRequest {
17987 fn typename() -> &'static str {
17988 "type.googleapis.com/google.cloud.securitycenter.v2.GetNotificationConfigRequest"
17989 }
17990}
17991
17992/// Request message to get resource value config
17993#[derive(Clone, Default, PartialEq)]
17994#[non_exhaustive]
17995pub struct GetResourceValueConfigRequest {
17996 /// Required. Name of the resource value config to retrieve. Its format is
17997 /// organizations/{organization}/resourceValueConfigs/{config_id}.
17998 pub name: std::string::String,
17999
18000 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18001}
18002
18003impl GetResourceValueConfigRequest {
18004 pub fn new() -> Self {
18005 std::default::Default::default()
18006 }
18007
18008 /// Sets the value of [name][crate::model::GetResourceValueConfigRequest::name].
18009 ///
18010 /// # Example
18011 /// ```ignore,no_run
18012 /// # use google_cloud_securitycenter_v2::model::GetResourceValueConfigRequest;
18013 /// let x = GetResourceValueConfigRequest::new().set_name("example");
18014 /// ```
18015 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18016 self.name = v.into();
18017 self
18018 }
18019}
18020
18021impl wkt::message::Message for GetResourceValueConfigRequest {
18022 fn typename() -> &'static str {
18023 "type.googleapis.com/google.cloud.securitycenter.v2.GetResourceValueConfigRequest"
18024 }
18025}
18026
18027/// Request message for getting a source.
18028#[derive(Clone, Default, PartialEq)]
18029#[non_exhaustive]
18030pub struct GetSourceRequest {
18031 /// Required. Relative resource name of the source. Its format is
18032 /// `organizations/[organization_id]/source/[source_id]`.
18033 pub name: std::string::String,
18034
18035 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18036}
18037
18038impl GetSourceRequest {
18039 pub fn new() -> Self {
18040 std::default::Default::default()
18041 }
18042
18043 /// Sets the value of [name][crate::model::GetSourceRequest::name].
18044 ///
18045 /// # Example
18046 /// ```ignore,no_run
18047 /// # use google_cloud_securitycenter_v2::model::GetSourceRequest;
18048 /// let x = GetSourceRequest::new().set_name("example");
18049 /// ```
18050 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18051 self.name = v.into();
18052 self
18053 }
18054}
18055
18056impl wkt::message::Message for GetSourceRequest {
18057 fn typename() -> &'static str {
18058 "type.googleapis.com/google.cloud.securitycenter.v2.GetSourceRequest"
18059 }
18060}
18061
18062/// Request message for grouping by findings.
18063#[derive(Clone, Default, PartialEq)]
18064#[non_exhaustive]
18065pub struct GroupFindingsRequest {
18066 /// Required. Name of the source to groupBy. If no location is specified,
18067 /// finding is assumed to be in global.
18068 /// The following list shows some examples:
18069 ///
18070 /// + `organizations/[organization_id]/sources/[source_id]`
18071 ///
18072 /// `organizations/[organization_id]/sources/[source_id]/locations/[location_id]`
18073 ///
18074 /// + `folders/[folder_id]/sources/[source_id]`
18075 /// + `folders/[folder_id]/sources/[source_id]/locations/[location_id]`
18076 /// + `projects/[project_id]/sources/[source_id]`
18077 /// + `projects/[project_id]/sources/[source_id]/locations/[location_id]`
18078 ///
18079 /// To groupBy across all sources provide a source_id of `-`. The following
18080 /// list shows some examples:
18081 ///
18082 /// + `organizations/{organization_id}/sources/-`
18083 /// + `organizations/{organization_id}/sources/-/locations/[location_id]`
18084 /// + `folders/{folder_id}/sources/-`
18085 /// + `folders/{folder_id}/sources/-/locations/[location_id]`
18086 /// + `projects/{project_id}/sources/-`
18087 /// + `projects/{project_id}/sources/-/locations/[location_id]`
18088 pub parent: std::string::String,
18089
18090 /// Expression that defines the filter to apply across findings.
18091 /// The expression is a list of one or more restrictions combined via logical
18092 /// operators `AND` and `OR`.
18093 /// Parentheses are supported, and `OR` has higher precedence than `AND`.
18094 ///
18095 /// Restrictions have the form `<field> <operator> <value>` and may have a `-`
18096 /// character in front of them to indicate negation. Examples include:
18097 ///
18098 /// * name
18099 /// * security_marks.marks.marka
18100 ///
18101 /// The supported operators are:
18102 ///
18103 /// * `=` for all value types.
18104 /// * `>`, `<`, `>=`, `<=` for integer values.
18105 /// * `:`, meaning substring matching, for strings.
18106 ///
18107 /// The supported value types are:
18108 ///
18109 /// * string literals in quotes.
18110 /// * integer literals without quotes.
18111 /// * boolean literals `true` and `false` without quotes.
18112 ///
18113 /// The following field and operator combinations are supported:
18114 ///
18115 /// * name: `=`
18116 ///
18117 /// * parent: `=`, `:`
18118 ///
18119 /// * resource_name: `=`, `:`
18120 ///
18121 /// * state: `=`, `:`
18122 ///
18123 /// * category: `=`, `:`
18124 ///
18125 /// * external_uri: `=`, `:`
18126 ///
18127 /// * event_time: `=`, `>`, `<`, `>=`, `<=`
18128 ///
18129 /// Usage: This should be milliseconds since epoch or an RFC3339 string.
18130 /// Examples:
18131 /// `event_time = "2019-06-10T16:07:18-07:00"`
18132 /// `event_time = 1560208038000`
18133 ///
18134 /// * severity: `=`, `:`
18135 ///
18136 /// * security_marks.marks: `=`, `:`
18137 ///
18138 /// * resource:
18139 ///
18140 /// * resource.name: `=`, `:`
18141 /// * resource.parent_name: `=`, `:`
18142 /// * resource.parent_display_name: `=`, `:`
18143 /// * resource.project_name: `=`, `:`
18144 /// * resource.project_display_name: `=`, `:`
18145 /// * resource.type: `=`, `:`
18146 pub filter: std::string::String,
18147
18148 /// Required. Expression that defines what assets fields to use for grouping.
18149 /// The string value should follow SQL syntax: comma separated list of fields.
18150 /// For example: "parent,resource_name".
18151 pub group_by: std::string::String,
18152
18153 /// The value returned by the last `GroupFindingsResponse`; indicates
18154 /// that this is a continuation of a prior `GroupFindings` call, and
18155 /// that the system should return the next page of data.
18156 pub page_token: std::string::String,
18157
18158 /// The maximum number of results to return in a single response. Default is
18159 /// 10, minimum is 1, maximum is 1000.
18160 pub page_size: i32,
18161
18162 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18163}
18164
18165impl GroupFindingsRequest {
18166 pub fn new() -> Self {
18167 std::default::Default::default()
18168 }
18169
18170 /// Sets the value of [parent][crate::model::GroupFindingsRequest::parent].
18171 ///
18172 /// # Example
18173 /// ```ignore,no_run
18174 /// # use google_cloud_securitycenter_v2::model::GroupFindingsRequest;
18175 /// let x = GroupFindingsRequest::new().set_parent("example");
18176 /// ```
18177 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18178 self.parent = v.into();
18179 self
18180 }
18181
18182 /// Sets the value of [filter][crate::model::GroupFindingsRequest::filter].
18183 ///
18184 /// # Example
18185 /// ```ignore,no_run
18186 /// # use google_cloud_securitycenter_v2::model::GroupFindingsRequest;
18187 /// let x = GroupFindingsRequest::new().set_filter("example");
18188 /// ```
18189 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18190 self.filter = v.into();
18191 self
18192 }
18193
18194 /// Sets the value of [group_by][crate::model::GroupFindingsRequest::group_by].
18195 ///
18196 /// # Example
18197 /// ```ignore,no_run
18198 /// # use google_cloud_securitycenter_v2::model::GroupFindingsRequest;
18199 /// let x = GroupFindingsRequest::new().set_group_by("example");
18200 /// ```
18201 pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18202 self.group_by = v.into();
18203 self
18204 }
18205
18206 /// Sets the value of [page_token][crate::model::GroupFindingsRequest::page_token].
18207 ///
18208 /// # Example
18209 /// ```ignore,no_run
18210 /// # use google_cloud_securitycenter_v2::model::GroupFindingsRequest;
18211 /// let x = GroupFindingsRequest::new().set_page_token("example");
18212 /// ```
18213 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18214 self.page_token = v.into();
18215 self
18216 }
18217
18218 /// Sets the value of [page_size][crate::model::GroupFindingsRequest::page_size].
18219 ///
18220 /// # Example
18221 /// ```ignore,no_run
18222 /// # use google_cloud_securitycenter_v2::model::GroupFindingsRequest;
18223 /// let x = GroupFindingsRequest::new().set_page_size(42);
18224 /// ```
18225 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18226 self.page_size = v.into();
18227 self
18228 }
18229}
18230
18231impl wkt::message::Message for GroupFindingsRequest {
18232 fn typename() -> &'static str {
18233 "type.googleapis.com/google.cloud.securitycenter.v2.GroupFindingsRequest"
18234 }
18235}
18236
18237/// Response message for group by findings.
18238#[derive(Clone, Default, PartialEq)]
18239#[non_exhaustive]
18240pub struct GroupFindingsResponse {
18241 /// Group results. There exists an element for each existing unique
18242 /// combination of property/values. The element contains a count for the number
18243 /// of times those specific property/values appear.
18244 pub group_by_results: std::vec::Vec<crate::model::GroupResult>,
18245
18246 /// Token to retrieve the next page of results, or empty if there are no more
18247 /// results.
18248 pub next_page_token: std::string::String,
18249
18250 /// The total number of results matching the query.
18251 pub total_size: i32,
18252
18253 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18254}
18255
18256impl GroupFindingsResponse {
18257 pub fn new() -> Self {
18258 std::default::Default::default()
18259 }
18260
18261 /// Sets the value of [group_by_results][crate::model::GroupFindingsResponse::group_by_results].
18262 ///
18263 /// # Example
18264 /// ```ignore,no_run
18265 /// # use google_cloud_securitycenter_v2::model::GroupFindingsResponse;
18266 /// use google_cloud_securitycenter_v2::model::GroupResult;
18267 /// let x = GroupFindingsResponse::new()
18268 /// .set_group_by_results([
18269 /// GroupResult::default()/* use setters */,
18270 /// GroupResult::default()/* use (different) setters */,
18271 /// ]);
18272 /// ```
18273 pub fn set_group_by_results<T, V>(mut self, v: T) -> Self
18274 where
18275 T: std::iter::IntoIterator<Item = V>,
18276 V: std::convert::Into<crate::model::GroupResult>,
18277 {
18278 use std::iter::Iterator;
18279 self.group_by_results = v.into_iter().map(|i| i.into()).collect();
18280 self
18281 }
18282
18283 /// Sets the value of [next_page_token][crate::model::GroupFindingsResponse::next_page_token].
18284 ///
18285 /// # Example
18286 /// ```ignore,no_run
18287 /// # use google_cloud_securitycenter_v2::model::GroupFindingsResponse;
18288 /// let x = GroupFindingsResponse::new().set_next_page_token("example");
18289 /// ```
18290 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18291 self.next_page_token = v.into();
18292 self
18293 }
18294
18295 /// Sets the value of [total_size][crate::model::GroupFindingsResponse::total_size].
18296 ///
18297 /// # Example
18298 /// ```ignore,no_run
18299 /// # use google_cloud_securitycenter_v2::model::GroupFindingsResponse;
18300 /// let x = GroupFindingsResponse::new().set_total_size(42);
18301 /// ```
18302 pub fn set_total_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18303 self.total_size = v.into();
18304 self
18305 }
18306}
18307
18308impl wkt::message::Message for GroupFindingsResponse {
18309 fn typename() -> &'static str {
18310 "type.googleapis.com/google.cloud.securitycenter.v2.GroupFindingsResponse"
18311 }
18312}
18313
18314#[doc(hidden)]
18315impl gax::paginator::internal::PageableResponse for GroupFindingsResponse {
18316 type PageItem = crate::model::GroupResult;
18317
18318 fn items(self) -> std::vec::Vec<Self::PageItem> {
18319 self.group_by_results
18320 }
18321
18322 fn next_page_token(&self) -> std::string::String {
18323 use std::clone::Clone;
18324 self.next_page_token.clone()
18325 }
18326}
18327
18328/// Result containing the properties and count of a groupBy request.
18329#[derive(Clone, Default, PartialEq)]
18330#[non_exhaustive]
18331pub struct GroupResult {
18332 /// Properties matching the groupBy fields in the request.
18333 pub properties: std::collections::HashMap<std::string::String, wkt::Value>,
18334
18335 /// Total count of resources for the given properties.
18336 pub count: i64,
18337
18338 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18339}
18340
18341impl GroupResult {
18342 pub fn new() -> Self {
18343 std::default::Default::default()
18344 }
18345
18346 /// Sets the value of [properties][crate::model::GroupResult::properties].
18347 ///
18348 /// # Example
18349 /// ```ignore,no_run
18350 /// # use google_cloud_securitycenter_v2::model::GroupResult;
18351 /// use wkt::Value;
18352 /// let x = GroupResult::new().set_properties([
18353 /// ("key0", Value::default()/* use setters */),
18354 /// ("key1", Value::default()/* use (different) setters */),
18355 /// ]);
18356 /// ```
18357 pub fn set_properties<T, K, V>(mut self, v: T) -> Self
18358 where
18359 T: std::iter::IntoIterator<Item = (K, V)>,
18360 K: std::convert::Into<std::string::String>,
18361 V: std::convert::Into<wkt::Value>,
18362 {
18363 use std::iter::Iterator;
18364 self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
18365 self
18366 }
18367
18368 /// Sets the value of [count][crate::model::GroupResult::count].
18369 ///
18370 /// # Example
18371 /// ```ignore,no_run
18372 /// # use google_cloud_securitycenter_v2::model::GroupResult;
18373 /// let x = GroupResult::new().set_count(42);
18374 /// ```
18375 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
18376 self.count = v.into();
18377 self
18378 }
18379}
18380
18381impl wkt::message::Message for GroupResult {
18382 fn typename() -> &'static str {
18383 "type.googleapis.com/google.cloud.securitycenter.v2.GroupResult"
18384 }
18385}
18386
18387/// Request message for listing the attack paths for a given simulation or valued
18388/// resource.
18389#[derive(Clone, Default, PartialEq)]
18390#[non_exhaustive]
18391pub struct ListAttackPathsRequest {
18392 /// Required. Name of parent to list attack paths.
18393 ///
18394 /// Valid formats:
18395 /// `organizations/{organization}`,
18396 /// `organizations/{organization}/simulations/{simulation}`
18397 /// `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}`
18398 /// `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}`
18399 pub parent: std::string::String,
18400
18401 /// The filter expression that filters the attack path in the response.
18402 /// Supported fields:
18403 ///
18404 /// * `valued_resources` supports =
18405 pub filter: std::string::String,
18406
18407 /// The value returned by the last `ListAttackPathsResponse`; indicates
18408 /// that this is a continuation of a prior `ListAttackPaths` call, and
18409 /// that the system should return the next page of data.
18410 pub page_token: std::string::String,
18411
18412 /// The maximum number of results to return in a single response. Default is
18413 /// 10, minimum is 1, maximum is 1000.
18414 pub page_size: i32,
18415
18416 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18417}
18418
18419impl ListAttackPathsRequest {
18420 pub fn new() -> Self {
18421 std::default::Default::default()
18422 }
18423
18424 /// Sets the value of [parent][crate::model::ListAttackPathsRequest::parent].
18425 ///
18426 /// # Example
18427 /// ```ignore,no_run
18428 /// # use google_cloud_securitycenter_v2::model::ListAttackPathsRequest;
18429 /// let x = ListAttackPathsRequest::new().set_parent("example");
18430 /// ```
18431 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18432 self.parent = v.into();
18433 self
18434 }
18435
18436 /// Sets the value of [filter][crate::model::ListAttackPathsRequest::filter].
18437 ///
18438 /// # Example
18439 /// ```ignore,no_run
18440 /// # use google_cloud_securitycenter_v2::model::ListAttackPathsRequest;
18441 /// let x = ListAttackPathsRequest::new().set_filter("example");
18442 /// ```
18443 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18444 self.filter = v.into();
18445 self
18446 }
18447
18448 /// Sets the value of [page_token][crate::model::ListAttackPathsRequest::page_token].
18449 ///
18450 /// # Example
18451 /// ```ignore,no_run
18452 /// # use google_cloud_securitycenter_v2::model::ListAttackPathsRequest;
18453 /// let x = ListAttackPathsRequest::new().set_page_token("example");
18454 /// ```
18455 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18456 self.page_token = v.into();
18457 self
18458 }
18459
18460 /// Sets the value of [page_size][crate::model::ListAttackPathsRequest::page_size].
18461 ///
18462 /// # Example
18463 /// ```ignore,no_run
18464 /// # use google_cloud_securitycenter_v2::model::ListAttackPathsRequest;
18465 /// let x = ListAttackPathsRequest::new().set_page_size(42);
18466 /// ```
18467 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18468 self.page_size = v.into();
18469 self
18470 }
18471}
18472
18473impl wkt::message::Message for ListAttackPathsRequest {
18474 fn typename() -> &'static str {
18475 "type.googleapis.com/google.cloud.securitycenter.v2.ListAttackPathsRequest"
18476 }
18477}
18478
18479/// Response message for listing the attack paths for a given simulation or
18480/// valued resource.
18481#[derive(Clone, Default, PartialEq)]
18482#[non_exhaustive]
18483pub struct ListAttackPathsResponse {
18484 /// The attack paths that the attack path simulation identified.
18485 pub attack_paths: std::vec::Vec<crate::model::AttackPath>,
18486
18487 /// Token to retrieve the next page of results, or empty if there are no more
18488 /// results.
18489 pub next_page_token: std::string::String,
18490
18491 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18492}
18493
18494impl ListAttackPathsResponse {
18495 pub fn new() -> Self {
18496 std::default::Default::default()
18497 }
18498
18499 /// Sets the value of [attack_paths][crate::model::ListAttackPathsResponse::attack_paths].
18500 ///
18501 /// # Example
18502 /// ```ignore,no_run
18503 /// # use google_cloud_securitycenter_v2::model::ListAttackPathsResponse;
18504 /// use google_cloud_securitycenter_v2::model::AttackPath;
18505 /// let x = ListAttackPathsResponse::new()
18506 /// .set_attack_paths([
18507 /// AttackPath::default()/* use setters */,
18508 /// AttackPath::default()/* use (different) setters */,
18509 /// ]);
18510 /// ```
18511 pub fn set_attack_paths<T, V>(mut self, v: T) -> Self
18512 where
18513 T: std::iter::IntoIterator<Item = V>,
18514 V: std::convert::Into<crate::model::AttackPath>,
18515 {
18516 use std::iter::Iterator;
18517 self.attack_paths = v.into_iter().map(|i| i.into()).collect();
18518 self
18519 }
18520
18521 /// Sets the value of [next_page_token][crate::model::ListAttackPathsResponse::next_page_token].
18522 ///
18523 /// # Example
18524 /// ```ignore,no_run
18525 /// # use google_cloud_securitycenter_v2::model::ListAttackPathsResponse;
18526 /// let x = ListAttackPathsResponse::new().set_next_page_token("example");
18527 /// ```
18528 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18529 self.next_page_token = v.into();
18530 self
18531 }
18532}
18533
18534impl wkt::message::Message for ListAttackPathsResponse {
18535 fn typename() -> &'static str {
18536 "type.googleapis.com/google.cloud.securitycenter.v2.ListAttackPathsResponse"
18537 }
18538}
18539
18540#[doc(hidden)]
18541impl gax::paginator::internal::PageableResponse for ListAttackPathsResponse {
18542 type PageItem = crate::model::AttackPath;
18543
18544 fn items(self) -> std::vec::Vec<Self::PageItem> {
18545 self.attack_paths
18546 }
18547
18548 fn next_page_token(&self) -> std::string::String {
18549 use std::clone::Clone;
18550 self.next_page_token.clone()
18551 }
18552}
18553
18554/// Request message for getting simulation.
18555/// Simulation name can include "latest" to retrieve the latest simulation
18556/// For example, "organizations/123/simulations/latest"
18557#[derive(Clone, Default, PartialEq)]
18558#[non_exhaustive]
18559pub struct GetSimulationRequest {
18560 /// Required. The organization name or simulation name of this simulation
18561 ///
18562 /// Valid format:
18563 /// `organizations/{organization}/simulations/latest`
18564 /// `organizations/{organization}/simulations/{simulation}`
18565 pub name: std::string::String,
18566
18567 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18568}
18569
18570impl GetSimulationRequest {
18571 pub fn new() -> Self {
18572 std::default::Default::default()
18573 }
18574
18575 /// Sets the value of [name][crate::model::GetSimulationRequest::name].
18576 ///
18577 /// # Example
18578 /// ```ignore,no_run
18579 /// # use google_cloud_securitycenter_v2::model::GetSimulationRequest;
18580 /// let x = GetSimulationRequest::new().set_name("example");
18581 /// ```
18582 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18583 self.name = v.into();
18584 self
18585 }
18586}
18587
18588impl wkt::message::Message for GetSimulationRequest {
18589 fn typename() -> &'static str {
18590 "type.googleapis.com/google.cloud.securitycenter.v2.GetSimulationRequest"
18591 }
18592}
18593
18594/// Request message for getting a valued resource.
18595#[derive(Clone, Default, PartialEq)]
18596#[non_exhaustive]
18597pub struct GetValuedResourceRequest {
18598 /// Required. The name of this valued resource
18599 ///
18600 /// Valid format:
18601 /// `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}`
18602 pub name: std::string::String,
18603
18604 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18605}
18606
18607impl GetValuedResourceRequest {
18608 pub fn new() -> Self {
18609 std::default::Default::default()
18610 }
18611
18612 /// Sets the value of [name][crate::model::GetValuedResourceRequest::name].
18613 ///
18614 /// # Example
18615 /// ```ignore,no_run
18616 /// # use google_cloud_securitycenter_v2::model::GetValuedResourceRequest;
18617 /// let x = GetValuedResourceRequest::new().set_name("example");
18618 /// ```
18619 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18620 self.name = v.into();
18621 self
18622 }
18623}
18624
18625impl wkt::message::Message for GetValuedResourceRequest {
18626 fn typename() -> &'static str {
18627 "type.googleapis.com/google.cloud.securitycenter.v2.GetValuedResourceRequest"
18628 }
18629}
18630
18631/// Request message for listing BigQuery exports at a given scope e.g.
18632/// organization, folder or project.
18633#[derive(Clone, Default, PartialEq)]
18634#[non_exhaustive]
18635pub struct ListBigQueryExportsRequest {
18636 /// Required. The parent, which owns the collection of BigQuery exports. Its
18637 /// format is `organizations/[organization_id]/locations/[location_id]`,
18638 /// `folders/[folder_id]/locations/[location_id]`, or
18639 /// `projects/[project_id]/locations/[location_id]`.
18640 pub parent: std::string::String,
18641
18642 /// The maximum number of configs to return. The service may return fewer than
18643 /// this value.
18644 /// If unspecified, at most 10 configs will be returned.
18645 /// The maximum value is 1000; values above 1000 will be coerced to 1000.
18646 pub page_size: i32,
18647
18648 /// A page token, received from a previous `ListBigQueryExports` call.
18649 /// Provide this to retrieve the subsequent page.
18650 /// When paginating, all other parameters provided to `ListBigQueryExports`
18651 /// must match the call that provided the page token.
18652 pub page_token: std::string::String,
18653
18654 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18655}
18656
18657impl ListBigQueryExportsRequest {
18658 pub fn new() -> Self {
18659 std::default::Default::default()
18660 }
18661
18662 /// Sets the value of [parent][crate::model::ListBigQueryExportsRequest::parent].
18663 ///
18664 /// # Example
18665 /// ```ignore,no_run
18666 /// # use google_cloud_securitycenter_v2::model::ListBigQueryExportsRequest;
18667 /// let x = ListBigQueryExportsRequest::new().set_parent("example");
18668 /// ```
18669 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18670 self.parent = v.into();
18671 self
18672 }
18673
18674 /// Sets the value of [page_size][crate::model::ListBigQueryExportsRequest::page_size].
18675 ///
18676 /// # Example
18677 /// ```ignore,no_run
18678 /// # use google_cloud_securitycenter_v2::model::ListBigQueryExportsRequest;
18679 /// let x = ListBigQueryExportsRequest::new().set_page_size(42);
18680 /// ```
18681 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18682 self.page_size = v.into();
18683 self
18684 }
18685
18686 /// Sets the value of [page_token][crate::model::ListBigQueryExportsRequest::page_token].
18687 ///
18688 /// # Example
18689 /// ```ignore,no_run
18690 /// # use google_cloud_securitycenter_v2::model::ListBigQueryExportsRequest;
18691 /// let x = ListBigQueryExportsRequest::new().set_page_token("example");
18692 /// ```
18693 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18694 self.page_token = v.into();
18695 self
18696 }
18697}
18698
18699impl wkt::message::Message for ListBigQueryExportsRequest {
18700 fn typename() -> &'static str {
18701 "type.googleapis.com/google.cloud.securitycenter.v2.ListBigQueryExportsRequest"
18702 }
18703}
18704
18705/// Response message for listing BigQuery exports.
18706#[derive(Clone, Default, PartialEq)]
18707#[non_exhaustive]
18708pub struct ListBigQueryExportsResponse {
18709 /// The BigQuery exports from the specified parent.
18710 pub big_query_exports: std::vec::Vec<crate::model::BigQueryExport>,
18711
18712 /// A token, which can be sent as `page_token` to retrieve the next page.
18713 /// If this field is omitted, there are no subsequent pages.
18714 pub next_page_token: std::string::String,
18715
18716 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18717}
18718
18719impl ListBigQueryExportsResponse {
18720 pub fn new() -> Self {
18721 std::default::Default::default()
18722 }
18723
18724 /// Sets the value of [big_query_exports][crate::model::ListBigQueryExportsResponse::big_query_exports].
18725 ///
18726 /// # Example
18727 /// ```ignore,no_run
18728 /// # use google_cloud_securitycenter_v2::model::ListBigQueryExportsResponse;
18729 /// use google_cloud_securitycenter_v2::model::BigQueryExport;
18730 /// let x = ListBigQueryExportsResponse::new()
18731 /// .set_big_query_exports([
18732 /// BigQueryExport::default()/* use setters */,
18733 /// BigQueryExport::default()/* use (different) setters */,
18734 /// ]);
18735 /// ```
18736 pub fn set_big_query_exports<T, V>(mut self, v: T) -> Self
18737 where
18738 T: std::iter::IntoIterator<Item = V>,
18739 V: std::convert::Into<crate::model::BigQueryExport>,
18740 {
18741 use std::iter::Iterator;
18742 self.big_query_exports = v.into_iter().map(|i| i.into()).collect();
18743 self
18744 }
18745
18746 /// Sets the value of [next_page_token][crate::model::ListBigQueryExportsResponse::next_page_token].
18747 ///
18748 /// # Example
18749 /// ```ignore,no_run
18750 /// # use google_cloud_securitycenter_v2::model::ListBigQueryExportsResponse;
18751 /// let x = ListBigQueryExportsResponse::new().set_next_page_token("example");
18752 /// ```
18753 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18754 self.next_page_token = v.into();
18755 self
18756 }
18757}
18758
18759impl wkt::message::Message for ListBigQueryExportsResponse {
18760 fn typename() -> &'static str {
18761 "type.googleapis.com/google.cloud.securitycenter.v2.ListBigQueryExportsResponse"
18762 }
18763}
18764
18765#[doc(hidden)]
18766impl gax::paginator::internal::PageableResponse for ListBigQueryExportsResponse {
18767 type PageItem = crate::model::BigQueryExport;
18768
18769 fn items(self) -> std::vec::Vec<Self::PageItem> {
18770 self.big_query_exports
18771 }
18772
18773 fn next_page_token(&self) -> std::string::String {
18774 use std::clone::Clone;
18775 self.next_page_token.clone()
18776 }
18777}
18778
18779/// Request message for listing findings.
18780#[derive(Clone, Default, PartialEq)]
18781#[non_exhaustive]
18782pub struct ListFindingsRequest {
18783 /// Required. Name of the source the findings belong to. If no location is
18784 /// specified, the default is global. The following list shows some examples:
18785 ///
18786 /// + `organizations/[organization_id]/sources/[source_id]`
18787 ///
18788 /// `organizations/[organization_id]/sources/[source_id]/locations/[location_id]`
18789 ///
18790 /// + `folders/[folder_id]/sources/[source_id]`
18791 /// + `folders/[folder_id]/sources/[source_id]/locations/[location_id]`
18792 /// + `projects/[project_id]/sources/[source_id]`
18793 /// + `projects/[project_id]/sources/[source_id]/locations/[location_id]`
18794 ///
18795 /// To list across all sources provide a source_id of `-`. The following
18796 /// list shows some examples:
18797 ///
18798 /// + `organizations/{organization_id}/sources/-`
18799 /// + `organizations/{organization_id}/sources/-/locations/{location_id}`
18800 /// + `folders/{folder_id}/sources/-`
18801 /// + `folders/{folder_id}/sources/-locations/{location_id}`
18802 /// + `projects/{projects_id}/sources/-`
18803 /// + `projects/{projects_id}/sources/-/locations/{location_id}`
18804 pub parent: std::string::String,
18805
18806 /// Expression that defines the filter to apply across findings.
18807 /// The expression is a list of one or more restrictions combined via logical
18808 /// operators `AND` and `OR`.
18809 /// Parentheses are supported, and `OR` has higher precedence than `AND`.
18810 ///
18811 /// Restrictions have the form `<field> <operator> <value>` and may have a `-`
18812 /// character in front of them to indicate negation. Examples include:
18813 ///
18814 /// * name
18815 /// * security_marks.marks.marka
18816 ///
18817 /// The supported operators are:
18818 ///
18819 /// * `=` for all value types.
18820 /// * `>`, `<`, `>=`, `<=` for integer values.
18821 /// * `:`, meaning substring matching, for strings.
18822 ///
18823 /// The supported value types are:
18824 ///
18825 /// * string literals in quotes.
18826 /// * integer literals without quotes.
18827 /// * boolean literals `true` and `false` without quotes.
18828 ///
18829 /// The following field and operator combinations are supported:
18830 ///
18831 /// * name: `=`
18832 ///
18833 /// * parent: `=`, `:`
18834 ///
18835 /// * resource_name: `=`, `:`
18836 ///
18837 /// * state: `=`, `:`
18838 ///
18839 /// * category: `=`, `:`
18840 ///
18841 /// * external_uri: `=`, `:`
18842 ///
18843 /// * event_time: `=`, `>`, `<`, `>=`, `<=`
18844 ///
18845 /// Usage: This should be milliseconds since epoch or an RFC3339 string.
18846 /// Examples:
18847 /// `event_time = "2019-06-10T16:07:18-07:00"`
18848 /// `event_time = 1560208038000`
18849 ///
18850 /// * severity: `=`, `:`
18851 ///
18852 /// * security_marks.marks: `=`, `:`
18853 ///
18854 /// * resource:
18855 ///
18856 /// * resource.name: `=`, `:`
18857 /// * resource.parent_name: `=`, `:`
18858 /// * resource.parent_display_name: `=`, `:`
18859 /// * resource.project_name: `=`, `:`
18860 /// * resource.project_display_name: `=`, `:`
18861 /// * resource.type: `=`, `:`
18862 /// * resource.folders.resource_folder: `=`, `:`
18863 /// * resource.display_name: `=`, `:`
18864 pub filter: std::string::String,
18865
18866 /// Expression that defines what fields and order to use for sorting. The
18867 /// string value should follow SQL syntax: comma separated list of fields. For
18868 /// example: "name,parent". The default sorting order
18869 /// is ascending. To specify descending order for a field, a suffix " desc"
18870 /// should be appended to the field name. For example: "name
18871 /// desc,parent". Redundant space characters in the
18872 /// syntax are insignificant. "name desc,parent" and "
18873 /// name desc , parent " are equivalent.
18874 ///
18875 /// The following fields are supported:
18876 /// name
18877 /// parent
18878 /// state
18879 /// category
18880 /// resource_name
18881 /// event_time
18882 /// security_marks.marks
18883 pub order_by: std::string::String,
18884
18885 /// A field mask to specify the Finding fields to be listed in the response.
18886 /// An empty field mask will list all fields.
18887 pub field_mask: std::option::Option<wkt::FieldMask>,
18888
18889 /// The value returned by the last `ListFindingsResponse`; indicates
18890 /// that this is a continuation of a prior `ListFindings` call, and
18891 /// that the system should return the next page of data.
18892 pub page_token: std::string::String,
18893
18894 /// The maximum number of results to return in a single response. Default is
18895 /// 10, minimum is 1, maximum is 1000.
18896 pub page_size: i32,
18897
18898 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18899}
18900
18901impl ListFindingsRequest {
18902 pub fn new() -> Self {
18903 std::default::Default::default()
18904 }
18905
18906 /// Sets the value of [parent][crate::model::ListFindingsRequest::parent].
18907 ///
18908 /// # Example
18909 /// ```ignore,no_run
18910 /// # use google_cloud_securitycenter_v2::model::ListFindingsRequest;
18911 /// let x = ListFindingsRequest::new().set_parent("example");
18912 /// ```
18913 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18914 self.parent = v.into();
18915 self
18916 }
18917
18918 /// Sets the value of [filter][crate::model::ListFindingsRequest::filter].
18919 ///
18920 /// # Example
18921 /// ```ignore,no_run
18922 /// # use google_cloud_securitycenter_v2::model::ListFindingsRequest;
18923 /// let x = ListFindingsRequest::new().set_filter("example");
18924 /// ```
18925 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18926 self.filter = v.into();
18927 self
18928 }
18929
18930 /// Sets the value of [order_by][crate::model::ListFindingsRequest::order_by].
18931 ///
18932 /// # Example
18933 /// ```ignore,no_run
18934 /// # use google_cloud_securitycenter_v2::model::ListFindingsRequest;
18935 /// let x = ListFindingsRequest::new().set_order_by("example");
18936 /// ```
18937 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18938 self.order_by = v.into();
18939 self
18940 }
18941
18942 /// Sets the value of [field_mask][crate::model::ListFindingsRequest::field_mask].
18943 ///
18944 /// # Example
18945 /// ```ignore,no_run
18946 /// # use google_cloud_securitycenter_v2::model::ListFindingsRequest;
18947 /// use wkt::FieldMask;
18948 /// let x = ListFindingsRequest::new().set_field_mask(FieldMask::default()/* use setters */);
18949 /// ```
18950 pub fn set_field_mask<T>(mut self, v: T) -> Self
18951 where
18952 T: std::convert::Into<wkt::FieldMask>,
18953 {
18954 self.field_mask = std::option::Option::Some(v.into());
18955 self
18956 }
18957
18958 /// Sets or clears the value of [field_mask][crate::model::ListFindingsRequest::field_mask].
18959 ///
18960 /// # Example
18961 /// ```ignore,no_run
18962 /// # use google_cloud_securitycenter_v2::model::ListFindingsRequest;
18963 /// use wkt::FieldMask;
18964 /// let x = ListFindingsRequest::new().set_or_clear_field_mask(Some(FieldMask::default()/* use setters */));
18965 /// let x = ListFindingsRequest::new().set_or_clear_field_mask(None::<FieldMask>);
18966 /// ```
18967 pub fn set_or_clear_field_mask<T>(mut self, v: std::option::Option<T>) -> Self
18968 where
18969 T: std::convert::Into<wkt::FieldMask>,
18970 {
18971 self.field_mask = v.map(|x| x.into());
18972 self
18973 }
18974
18975 /// Sets the value of [page_token][crate::model::ListFindingsRequest::page_token].
18976 ///
18977 /// # Example
18978 /// ```ignore,no_run
18979 /// # use google_cloud_securitycenter_v2::model::ListFindingsRequest;
18980 /// let x = ListFindingsRequest::new().set_page_token("example");
18981 /// ```
18982 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18983 self.page_token = v.into();
18984 self
18985 }
18986
18987 /// Sets the value of [page_size][crate::model::ListFindingsRequest::page_size].
18988 ///
18989 /// # Example
18990 /// ```ignore,no_run
18991 /// # use google_cloud_securitycenter_v2::model::ListFindingsRequest;
18992 /// let x = ListFindingsRequest::new().set_page_size(42);
18993 /// ```
18994 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18995 self.page_size = v.into();
18996 self
18997 }
18998}
18999
19000impl wkt::message::Message for ListFindingsRequest {
19001 fn typename() -> &'static str {
19002 "type.googleapis.com/google.cloud.securitycenter.v2.ListFindingsRequest"
19003 }
19004}
19005
19006/// Response message for listing findings.
19007#[derive(Clone, Default, PartialEq)]
19008#[non_exhaustive]
19009pub struct ListFindingsResponse {
19010 /// Findings matching the list request.
19011 pub list_findings_results:
19012 std::vec::Vec<crate::model::list_findings_response::ListFindingsResult>,
19013
19014 /// Token to retrieve the next page of results, or empty if there are no more
19015 /// results.
19016 pub next_page_token: std::string::String,
19017
19018 /// The total number of findings matching the query.
19019 pub total_size: i32,
19020
19021 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19022}
19023
19024impl ListFindingsResponse {
19025 pub fn new() -> Self {
19026 std::default::Default::default()
19027 }
19028
19029 /// Sets the value of [list_findings_results][crate::model::ListFindingsResponse::list_findings_results].
19030 ///
19031 /// # Example
19032 /// ```ignore,no_run
19033 /// # use google_cloud_securitycenter_v2::model::ListFindingsResponse;
19034 /// use google_cloud_securitycenter_v2::model::list_findings_response::ListFindingsResult;
19035 /// let x = ListFindingsResponse::new()
19036 /// .set_list_findings_results([
19037 /// ListFindingsResult::default()/* use setters */,
19038 /// ListFindingsResult::default()/* use (different) setters */,
19039 /// ]);
19040 /// ```
19041 pub fn set_list_findings_results<T, V>(mut self, v: T) -> Self
19042 where
19043 T: std::iter::IntoIterator<Item = V>,
19044 V: std::convert::Into<crate::model::list_findings_response::ListFindingsResult>,
19045 {
19046 use std::iter::Iterator;
19047 self.list_findings_results = v.into_iter().map(|i| i.into()).collect();
19048 self
19049 }
19050
19051 /// Sets the value of [next_page_token][crate::model::ListFindingsResponse::next_page_token].
19052 ///
19053 /// # Example
19054 /// ```ignore,no_run
19055 /// # use google_cloud_securitycenter_v2::model::ListFindingsResponse;
19056 /// let x = ListFindingsResponse::new().set_next_page_token("example");
19057 /// ```
19058 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19059 self.next_page_token = v.into();
19060 self
19061 }
19062
19063 /// Sets the value of [total_size][crate::model::ListFindingsResponse::total_size].
19064 ///
19065 /// # Example
19066 /// ```ignore,no_run
19067 /// # use google_cloud_securitycenter_v2::model::ListFindingsResponse;
19068 /// let x = ListFindingsResponse::new().set_total_size(42);
19069 /// ```
19070 pub fn set_total_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19071 self.total_size = v.into();
19072 self
19073 }
19074}
19075
19076impl wkt::message::Message for ListFindingsResponse {
19077 fn typename() -> &'static str {
19078 "type.googleapis.com/google.cloud.securitycenter.v2.ListFindingsResponse"
19079 }
19080}
19081
19082#[doc(hidden)]
19083impl gax::paginator::internal::PageableResponse for ListFindingsResponse {
19084 type PageItem = crate::model::list_findings_response::ListFindingsResult;
19085
19086 fn items(self) -> std::vec::Vec<Self::PageItem> {
19087 self.list_findings_results
19088 }
19089
19090 fn next_page_token(&self) -> std::string::String {
19091 use std::clone::Clone;
19092 self.next_page_token.clone()
19093 }
19094}
19095
19096/// Defines additional types related to [ListFindingsResponse].
19097pub mod list_findings_response {
19098 #[allow(unused_imports)]
19099 use super::*;
19100
19101 /// Result containing the Finding.
19102 #[derive(Clone, Default, PartialEq)]
19103 #[non_exhaustive]
19104 pub struct ListFindingsResult {
19105 /// Finding matching the search request.
19106 pub finding: std::option::Option<crate::model::Finding>,
19107
19108 /// Output only. Resource that is associated with this finding.
19109 pub resource: std::option::Option<
19110 crate::model::list_findings_response::list_findings_result::Resource,
19111 >,
19112
19113 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19114 }
19115
19116 impl ListFindingsResult {
19117 pub fn new() -> Self {
19118 std::default::Default::default()
19119 }
19120
19121 /// Sets the value of [finding][crate::model::list_findings_response::ListFindingsResult::finding].
19122 ///
19123 /// # Example
19124 /// ```ignore,no_run
19125 /// # use google_cloud_securitycenter_v2::model::list_findings_response::ListFindingsResult;
19126 /// use google_cloud_securitycenter_v2::model::Finding;
19127 /// let x = ListFindingsResult::new().set_finding(Finding::default()/* use setters */);
19128 /// ```
19129 pub fn set_finding<T>(mut self, v: T) -> Self
19130 where
19131 T: std::convert::Into<crate::model::Finding>,
19132 {
19133 self.finding = std::option::Option::Some(v.into());
19134 self
19135 }
19136
19137 /// Sets or clears the value of [finding][crate::model::list_findings_response::ListFindingsResult::finding].
19138 ///
19139 /// # Example
19140 /// ```ignore,no_run
19141 /// # use google_cloud_securitycenter_v2::model::list_findings_response::ListFindingsResult;
19142 /// use google_cloud_securitycenter_v2::model::Finding;
19143 /// let x = ListFindingsResult::new().set_or_clear_finding(Some(Finding::default()/* use setters */));
19144 /// let x = ListFindingsResult::new().set_or_clear_finding(None::<Finding>);
19145 /// ```
19146 pub fn set_or_clear_finding<T>(mut self, v: std::option::Option<T>) -> Self
19147 where
19148 T: std::convert::Into<crate::model::Finding>,
19149 {
19150 self.finding = v.map(|x| x.into());
19151 self
19152 }
19153
19154 /// Sets the value of [resource][crate::model::list_findings_response::ListFindingsResult::resource].
19155 ///
19156 /// # Example
19157 /// ```ignore,no_run
19158 /// # use google_cloud_securitycenter_v2::model::list_findings_response::ListFindingsResult;
19159 /// use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19160 /// let x = ListFindingsResult::new().set_resource(Resource::default()/* use setters */);
19161 /// ```
19162 pub fn set_resource<T>(mut self, v: T) -> Self
19163 where
19164 T: std::convert::Into<
19165 crate::model::list_findings_response::list_findings_result::Resource,
19166 >,
19167 {
19168 self.resource = std::option::Option::Some(v.into());
19169 self
19170 }
19171
19172 /// Sets or clears the value of [resource][crate::model::list_findings_response::ListFindingsResult::resource].
19173 ///
19174 /// # Example
19175 /// ```ignore,no_run
19176 /// # use google_cloud_securitycenter_v2::model::list_findings_response::ListFindingsResult;
19177 /// use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19178 /// let x = ListFindingsResult::new().set_or_clear_resource(Some(Resource::default()/* use setters */));
19179 /// let x = ListFindingsResult::new().set_or_clear_resource(None::<Resource>);
19180 /// ```
19181 pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
19182 where
19183 T: std::convert::Into<
19184 crate::model::list_findings_response::list_findings_result::Resource,
19185 >,
19186 {
19187 self.resource = v.map(|x| x.into());
19188 self
19189 }
19190 }
19191
19192 impl wkt::message::Message for ListFindingsResult {
19193 fn typename() -> &'static str {
19194 "type.googleapis.com/google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult"
19195 }
19196 }
19197
19198 /// Defines additional types related to [ListFindingsResult].
19199 pub mod list_findings_result {
19200 #[allow(unused_imports)]
19201 use super::*;
19202
19203 /// Information related to the Google Cloud resource that is
19204 /// associated with this finding.
19205 #[derive(Clone, Default, PartialEq)]
19206 #[non_exhaustive]
19207 pub struct Resource {
19208
19209 /// The full resource name of the resource. See:
19210 /// <https://cloud.google.com/apis/design/resource_names#full_resource_name>
19211 pub name: std::string::String,
19212
19213 /// The human readable name of the resource.
19214 pub display_name: std::string::String,
19215
19216 /// The full resource type of the resource.
19217 pub r#type: std::string::String,
19218
19219 /// Indicates which cloud provider the finding is from.
19220 pub cloud_provider: crate::model::CloudProvider,
19221
19222 /// The service or resource provider associated with the resource.
19223 pub service: std::string::String,
19224
19225 /// The region or location of the service (if applicable).
19226 pub location: std::string::String,
19227
19228 /// Provides the path to the resource within the resource hierarchy.
19229 pub resource_path: std::option::Option<crate::model::ResourcePath>,
19230
19231 /// A string representation of the resource path.
19232 /// For Google Cloud, it has the format of
19233 /// `organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}`
19234 /// where there can be any number of folders.
19235 /// For AWS, it has the format of
19236 /// `org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}`
19237 /// where there can be any number of organizational units.
19238 /// For Azure, it has the format of
19239 /// `mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}`
19240 /// where there can be any number of management groups.
19241 pub resource_path_string: std::string::String,
19242
19243 /// The metadata associated with the cloud provider.
19244 pub cloud_provider_metadata: std::option::Option<crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata>,
19245
19246 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19247 }
19248
19249 impl Resource {
19250 pub fn new() -> Self {
19251 std::default::Default::default()
19252 }
19253
19254 /// Sets the value of [name][crate::model::list_findings_response::list_findings_result::Resource::name].
19255 ///
19256 /// # Example
19257 /// ```ignore,no_run
19258 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19259 /// let x = Resource::new().set_name("example");
19260 /// ```
19261 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19262 self.name = v.into();
19263 self
19264 }
19265
19266 /// Sets the value of [display_name][crate::model::list_findings_response::list_findings_result::Resource::display_name].
19267 ///
19268 /// # Example
19269 /// ```ignore,no_run
19270 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19271 /// let x = Resource::new().set_display_name("example");
19272 /// ```
19273 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
19274 mut self,
19275 v: T,
19276 ) -> Self {
19277 self.display_name = v.into();
19278 self
19279 }
19280
19281 /// Sets the value of [r#type][crate::model::list_findings_response::list_findings_result::Resource::type].
19282 ///
19283 /// # Example
19284 /// ```ignore,no_run
19285 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19286 /// let x = Resource::new().set_type("example");
19287 /// ```
19288 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19289 self.r#type = v.into();
19290 self
19291 }
19292
19293 /// Sets the value of [cloud_provider][crate::model::list_findings_response::list_findings_result::Resource::cloud_provider].
19294 ///
19295 /// # Example
19296 /// ```ignore,no_run
19297 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19298 /// use google_cloud_securitycenter_v2::model::CloudProvider;
19299 /// let x0 = Resource::new().set_cloud_provider(CloudProvider::GoogleCloudPlatform);
19300 /// let x1 = Resource::new().set_cloud_provider(CloudProvider::AmazonWebServices);
19301 /// let x2 = Resource::new().set_cloud_provider(CloudProvider::MicrosoftAzure);
19302 /// ```
19303 pub fn set_cloud_provider<T: std::convert::Into<crate::model::CloudProvider>>(
19304 mut self,
19305 v: T,
19306 ) -> Self {
19307 self.cloud_provider = v.into();
19308 self
19309 }
19310
19311 /// Sets the value of [service][crate::model::list_findings_response::list_findings_result::Resource::service].
19312 ///
19313 /// # Example
19314 /// ```ignore,no_run
19315 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19316 /// let x = Resource::new().set_service("example");
19317 /// ```
19318 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19319 self.service = v.into();
19320 self
19321 }
19322
19323 /// Sets the value of [location][crate::model::list_findings_response::list_findings_result::Resource::location].
19324 ///
19325 /// # Example
19326 /// ```ignore,no_run
19327 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19328 /// let x = Resource::new().set_location("example");
19329 /// ```
19330 pub fn set_location<T: std::convert::Into<std::string::String>>(
19331 mut self,
19332 v: T,
19333 ) -> Self {
19334 self.location = v.into();
19335 self
19336 }
19337
19338 /// Sets the value of [resource_path][crate::model::list_findings_response::list_findings_result::Resource::resource_path].
19339 ///
19340 /// # Example
19341 /// ```ignore,no_run
19342 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19343 /// use google_cloud_securitycenter_v2::model::ResourcePath;
19344 /// let x = Resource::new().set_resource_path(ResourcePath::default()/* use setters */);
19345 /// ```
19346 pub fn set_resource_path<T>(mut self, v: T) -> Self
19347 where
19348 T: std::convert::Into<crate::model::ResourcePath>,
19349 {
19350 self.resource_path = std::option::Option::Some(v.into());
19351 self
19352 }
19353
19354 /// Sets or clears the value of [resource_path][crate::model::list_findings_response::list_findings_result::Resource::resource_path].
19355 ///
19356 /// # Example
19357 /// ```ignore,no_run
19358 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19359 /// use google_cloud_securitycenter_v2::model::ResourcePath;
19360 /// let x = Resource::new().set_or_clear_resource_path(Some(ResourcePath::default()/* use setters */));
19361 /// let x = Resource::new().set_or_clear_resource_path(None::<ResourcePath>);
19362 /// ```
19363 pub fn set_or_clear_resource_path<T>(mut self, v: std::option::Option<T>) -> Self
19364 where
19365 T: std::convert::Into<crate::model::ResourcePath>,
19366 {
19367 self.resource_path = v.map(|x| x.into());
19368 self
19369 }
19370
19371 /// Sets the value of [resource_path_string][crate::model::list_findings_response::list_findings_result::Resource::resource_path_string].
19372 ///
19373 /// # Example
19374 /// ```ignore,no_run
19375 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19376 /// let x = Resource::new().set_resource_path_string("example");
19377 /// ```
19378 pub fn set_resource_path_string<T: std::convert::Into<std::string::String>>(
19379 mut self,
19380 v: T,
19381 ) -> Self {
19382 self.resource_path_string = v.into();
19383 self
19384 }
19385
19386 /// Sets the value of [cloud_provider_metadata][crate::model::list_findings_response::list_findings_result::Resource::cloud_provider_metadata].
19387 ///
19388 /// Note that all the setters affecting `cloud_provider_metadata` are mutually
19389 /// exclusive.
19390 ///
19391 /// # Example
19392 /// ```ignore,no_run
19393 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19394 /// use google_cloud_securitycenter_v2::model::GcpMetadata;
19395 /// let x = Resource::new().set_cloud_provider_metadata(Some(
19396 /// google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::GcpMetadata(GcpMetadata::default().into())));
19397 /// ```
19398 pub fn set_cloud_provider_metadata<T: std::convert::Into<std::option::Option<crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata>>>(mut self, v: T) -> Self
19399 {
19400 self.cloud_provider_metadata = v.into();
19401 self
19402 }
19403
19404 /// The value of [cloud_provider_metadata][crate::model::list_findings_response::list_findings_result::Resource::cloud_provider_metadata]
19405 /// if it holds a `GcpMetadata`, `None` if the field is not set or
19406 /// holds a different branch.
19407 pub fn gcp_metadata(
19408 &self,
19409 ) -> std::option::Option<&std::boxed::Box<crate::model::GcpMetadata>> {
19410 #[allow(unreachable_patterns)]
19411 self.cloud_provider_metadata.as_ref().and_then(|v| match v {
19412 crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::GcpMetadata(v) => std::option::Option::Some(v),
19413 _ => std::option::Option::None,
19414 })
19415 }
19416
19417 /// Sets the value of [cloud_provider_metadata][crate::model::list_findings_response::list_findings_result::Resource::cloud_provider_metadata]
19418 /// to hold a `GcpMetadata`.
19419 ///
19420 /// Note that all the setters affecting `cloud_provider_metadata` are
19421 /// mutually exclusive.
19422 ///
19423 /// # Example
19424 /// ```ignore,no_run
19425 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19426 /// use google_cloud_securitycenter_v2::model::GcpMetadata;
19427 /// let x = Resource::new().set_gcp_metadata(GcpMetadata::default()/* use setters */);
19428 /// assert!(x.gcp_metadata().is_some());
19429 /// assert!(x.aws_metadata().is_none());
19430 /// assert!(x.azure_metadata().is_none());
19431 /// ```
19432 pub fn set_gcp_metadata<
19433 T: std::convert::Into<std::boxed::Box<crate::model::GcpMetadata>>,
19434 >(
19435 mut self,
19436 v: T,
19437 ) -> Self {
19438 self.cloud_provider_metadata = std::option::Option::Some(
19439 crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::GcpMetadata(
19440 v.into()
19441 )
19442 );
19443 self
19444 }
19445
19446 /// The value of [cloud_provider_metadata][crate::model::list_findings_response::list_findings_result::Resource::cloud_provider_metadata]
19447 /// if it holds a `AwsMetadata`, `None` if the field is not set or
19448 /// holds a different branch.
19449 pub fn aws_metadata(
19450 &self,
19451 ) -> std::option::Option<&std::boxed::Box<crate::model::AwsMetadata>> {
19452 #[allow(unreachable_patterns)]
19453 self.cloud_provider_metadata.as_ref().and_then(|v| match v {
19454 crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::AwsMetadata(v) => std::option::Option::Some(v),
19455 _ => std::option::Option::None,
19456 })
19457 }
19458
19459 /// Sets the value of [cloud_provider_metadata][crate::model::list_findings_response::list_findings_result::Resource::cloud_provider_metadata]
19460 /// to hold a `AwsMetadata`.
19461 ///
19462 /// Note that all the setters affecting `cloud_provider_metadata` are
19463 /// mutually exclusive.
19464 ///
19465 /// # Example
19466 /// ```ignore,no_run
19467 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19468 /// use google_cloud_securitycenter_v2::model::AwsMetadata;
19469 /// let x = Resource::new().set_aws_metadata(AwsMetadata::default()/* use setters */);
19470 /// assert!(x.aws_metadata().is_some());
19471 /// assert!(x.gcp_metadata().is_none());
19472 /// assert!(x.azure_metadata().is_none());
19473 /// ```
19474 pub fn set_aws_metadata<
19475 T: std::convert::Into<std::boxed::Box<crate::model::AwsMetadata>>,
19476 >(
19477 mut self,
19478 v: T,
19479 ) -> Self {
19480 self.cloud_provider_metadata = std::option::Option::Some(
19481 crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::AwsMetadata(
19482 v.into()
19483 )
19484 );
19485 self
19486 }
19487
19488 /// The value of [cloud_provider_metadata][crate::model::list_findings_response::list_findings_result::Resource::cloud_provider_metadata]
19489 /// if it holds a `AzureMetadata`, `None` if the field is not set or
19490 /// holds a different branch.
19491 pub fn azure_metadata(
19492 &self,
19493 ) -> std::option::Option<&std::boxed::Box<crate::model::AzureMetadata>> {
19494 #[allow(unreachable_patterns)]
19495 self.cloud_provider_metadata.as_ref().and_then(|v| match v {
19496 crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::AzureMetadata(v) => std::option::Option::Some(v),
19497 _ => std::option::Option::None,
19498 })
19499 }
19500
19501 /// Sets the value of [cloud_provider_metadata][crate::model::list_findings_response::list_findings_result::Resource::cloud_provider_metadata]
19502 /// to hold a `AzureMetadata`.
19503 ///
19504 /// Note that all the setters affecting `cloud_provider_metadata` are
19505 /// mutually exclusive.
19506 ///
19507 /// # Example
19508 /// ```ignore,no_run
19509 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19510 /// use google_cloud_securitycenter_v2::model::AzureMetadata;
19511 /// let x = Resource::new().set_azure_metadata(AzureMetadata::default()/* use setters */);
19512 /// assert!(x.azure_metadata().is_some());
19513 /// assert!(x.gcp_metadata().is_none());
19514 /// assert!(x.aws_metadata().is_none());
19515 /// ```
19516 pub fn set_azure_metadata<
19517 T: std::convert::Into<std::boxed::Box<crate::model::AzureMetadata>>,
19518 >(
19519 mut self,
19520 v: T,
19521 ) -> Self {
19522 self.cloud_provider_metadata = std::option::Option::Some(
19523 crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::AzureMetadata(
19524 v.into()
19525 )
19526 );
19527 self
19528 }
19529 }
19530
19531 impl wkt::message::Message for Resource {
19532 fn typename() -> &'static str {
19533 "type.googleapis.com/google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource"
19534 }
19535 }
19536
19537 /// Defines additional types related to [Resource].
19538 pub mod resource {
19539 #[allow(unused_imports)]
19540 use super::*;
19541
19542 /// The metadata associated with the cloud provider.
19543 #[derive(Clone, Debug, PartialEq)]
19544 #[non_exhaustive]
19545 pub enum CloudProviderMetadata {
19546 /// The GCP metadata associated with the finding.
19547 GcpMetadata(std::boxed::Box<crate::model::GcpMetadata>),
19548 /// The AWS metadata associated with the finding.
19549 AwsMetadata(std::boxed::Box<crate::model::AwsMetadata>),
19550 /// The Azure metadata associated with the finding.
19551 AzureMetadata(std::boxed::Box<crate::model::AzureMetadata>),
19552 }
19553 }
19554 }
19555}
19556
19557/// Request message for listing mute configs at a given scope e.g. organization,
19558/// folder or project. If no location is specified, default is
19559/// global.
19560#[derive(Clone, Default, PartialEq)]
19561#[non_exhaustive]
19562pub struct ListMuteConfigsRequest {
19563 /// Required. The parent, which owns the collection of mute configs. Its format
19564 /// is `organizations/[organization_id]", "folders/[folder_id]`,
19565 /// `projects/[project_id]`,
19566 /// `organizations/[organization_id]/locations/[location_id]`,
19567 /// `folders/[folder_id]/locations/[location_id]`,
19568 /// `projects/[project_id]/locations/[location_id]`.
19569 pub parent: std::string::String,
19570
19571 /// The maximum number of configs to return. The service may return fewer than
19572 /// this value.
19573 /// If unspecified, at most 10 configs will be returned.
19574 /// The maximum value is 1000; values above 1000 will be coerced to 1000.
19575 pub page_size: i32,
19576
19577 /// A page token, received from a previous `ListMuteConfigs` call.
19578 /// Provide this to retrieve the subsequent page.
19579 ///
19580 /// When paginating, all other parameters provided to `ListMuteConfigs` must
19581 /// match the call that provided the page token.
19582 pub page_token: std::string::String,
19583
19584 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19585}
19586
19587impl ListMuteConfigsRequest {
19588 pub fn new() -> Self {
19589 std::default::Default::default()
19590 }
19591
19592 /// Sets the value of [parent][crate::model::ListMuteConfigsRequest::parent].
19593 ///
19594 /// # Example
19595 /// ```ignore,no_run
19596 /// # use google_cloud_securitycenter_v2::model::ListMuteConfigsRequest;
19597 /// let x = ListMuteConfigsRequest::new().set_parent("example");
19598 /// ```
19599 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19600 self.parent = v.into();
19601 self
19602 }
19603
19604 /// Sets the value of [page_size][crate::model::ListMuteConfigsRequest::page_size].
19605 ///
19606 /// # Example
19607 /// ```ignore,no_run
19608 /// # use google_cloud_securitycenter_v2::model::ListMuteConfigsRequest;
19609 /// let x = ListMuteConfigsRequest::new().set_page_size(42);
19610 /// ```
19611 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19612 self.page_size = v.into();
19613 self
19614 }
19615
19616 /// Sets the value of [page_token][crate::model::ListMuteConfigsRequest::page_token].
19617 ///
19618 /// # Example
19619 /// ```ignore,no_run
19620 /// # use google_cloud_securitycenter_v2::model::ListMuteConfigsRequest;
19621 /// let x = ListMuteConfigsRequest::new().set_page_token("example");
19622 /// ```
19623 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19624 self.page_token = v.into();
19625 self
19626 }
19627}
19628
19629impl wkt::message::Message for ListMuteConfigsRequest {
19630 fn typename() -> &'static str {
19631 "type.googleapis.com/google.cloud.securitycenter.v2.ListMuteConfigsRequest"
19632 }
19633}
19634
19635/// Response message for listing mute configs.
19636#[derive(Clone, Default, PartialEq)]
19637#[non_exhaustive]
19638pub struct ListMuteConfigsResponse {
19639 /// The mute configs from the specified parent.
19640 pub mute_configs: std::vec::Vec<crate::model::MuteConfig>,
19641
19642 /// A token, which can be sent as `page_token` to retrieve the next page.
19643 /// If this field is omitted, there are no subsequent pages.
19644 pub next_page_token: std::string::String,
19645
19646 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19647}
19648
19649impl ListMuteConfigsResponse {
19650 pub fn new() -> Self {
19651 std::default::Default::default()
19652 }
19653
19654 /// Sets the value of [mute_configs][crate::model::ListMuteConfigsResponse::mute_configs].
19655 ///
19656 /// # Example
19657 /// ```ignore,no_run
19658 /// # use google_cloud_securitycenter_v2::model::ListMuteConfigsResponse;
19659 /// use google_cloud_securitycenter_v2::model::MuteConfig;
19660 /// let x = ListMuteConfigsResponse::new()
19661 /// .set_mute_configs([
19662 /// MuteConfig::default()/* use setters */,
19663 /// MuteConfig::default()/* use (different) setters */,
19664 /// ]);
19665 /// ```
19666 pub fn set_mute_configs<T, V>(mut self, v: T) -> Self
19667 where
19668 T: std::iter::IntoIterator<Item = V>,
19669 V: std::convert::Into<crate::model::MuteConfig>,
19670 {
19671 use std::iter::Iterator;
19672 self.mute_configs = v.into_iter().map(|i| i.into()).collect();
19673 self
19674 }
19675
19676 /// Sets the value of [next_page_token][crate::model::ListMuteConfigsResponse::next_page_token].
19677 ///
19678 /// # Example
19679 /// ```ignore,no_run
19680 /// # use google_cloud_securitycenter_v2::model::ListMuteConfigsResponse;
19681 /// let x = ListMuteConfigsResponse::new().set_next_page_token("example");
19682 /// ```
19683 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19684 self.next_page_token = v.into();
19685 self
19686 }
19687}
19688
19689impl wkt::message::Message for ListMuteConfigsResponse {
19690 fn typename() -> &'static str {
19691 "type.googleapis.com/google.cloud.securitycenter.v2.ListMuteConfigsResponse"
19692 }
19693}
19694
19695#[doc(hidden)]
19696impl gax::paginator::internal::PageableResponse for ListMuteConfigsResponse {
19697 type PageItem = crate::model::MuteConfig;
19698
19699 fn items(self) -> std::vec::Vec<Self::PageItem> {
19700 self.mute_configs
19701 }
19702
19703 fn next_page_token(&self) -> std::string::String {
19704 use std::clone::Clone;
19705 self.next_page_token.clone()
19706 }
19707}
19708
19709/// Request message for listing notification configs.
19710#[derive(Clone, Default, PartialEq)]
19711#[non_exhaustive]
19712pub struct ListNotificationConfigsRequest {
19713 /// Required. The name of the parent in which to list the notification
19714 /// configurations. Its format is
19715 /// "organizations/[organization_id]/locations/[location_id]",
19716 /// "folders/[folder_id]/locations/[location_id]", or
19717 /// "projects/[project_id]/locations/[location_id]".
19718 pub parent: std::string::String,
19719
19720 /// The value returned by the last `ListNotificationConfigsResponse`; indicates
19721 /// that this is a continuation of a prior `ListNotificationConfigs` call, and
19722 /// that the system should return the next page of data.
19723 pub page_token: std::string::String,
19724
19725 /// The maximum number of results to return in a single response. Default is
19726 /// 10, minimum is 1, maximum is 1000.
19727 pub page_size: i32,
19728
19729 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19730}
19731
19732impl ListNotificationConfigsRequest {
19733 pub fn new() -> Self {
19734 std::default::Default::default()
19735 }
19736
19737 /// Sets the value of [parent][crate::model::ListNotificationConfigsRequest::parent].
19738 ///
19739 /// # Example
19740 /// ```ignore,no_run
19741 /// # use google_cloud_securitycenter_v2::model::ListNotificationConfigsRequest;
19742 /// let x = ListNotificationConfigsRequest::new().set_parent("example");
19743 /// ```
19744 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19745 self.parent = v.into();
19746 self
19747 }
19748
19749 /// Sets the value of [page_token][crate::model::ListNotificationConfigsRequest::page_token].
19750 ///
19751 /// # Example
19752 /// ```ignore,no_run
19753 /// # use google_cloud_securitycenter_v2::model::ListNotificationConfigsRequest;
19754 /// let x = ListNotificationConfigsRequest::new().set_page_token("example");
19755 /// ```
19756 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19757 self.page_token = v.into();
19758 self
19759 }
19760
19761 /// Sets the value of [page_size][crate::model::ListNotificationConfigsRequest::page_size].
19762 ///
19763 /// # Example
19764 /// ```ignore,no_run
19765 /// # use google_cloud_securitycenter_v2::model::ListNotificationConfigsRequest;
19766 /// let x = ListNotificationConfigsRequest::new().set_page_size(42);
19767 /// ```
19768 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19769 self.page_size = v.into();
19770 self
19771 }
19772}
19773
19774impl wkt::message::Message for ListNotificationConfigsRequest {
19775 fn typename() -> &'static str {
19776 "type.googleapis.com/google.cloud.securitycenter.v2.ListNotificationConfigsRequest"
19777 }
19778}
19779
19780/// Response message for listing notification configs.
19781#[derive(Clone, Default, PartialEq)]
19782#[non_exhaustive]
19783pub struct ListNotificationConfigsResponse {
19784 /// Notification configs belonging to the requested parent.
19785 pub notification_configs: std::vec::Vec<crate::model::NotificationConfig>,
19786
19787 /// Token to retrieve the next page of results, or empty if there are no more
19788 /// results.
19789 pub next_page_token: std::string::String,
19790
19791 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19792}
19793
19794impl ListNotificationConfigsResponse {
19795 pub fn new() -> Self {
19796 std::default::Default::default()
19797 }
19798
19799 /// Sets the value of [notification_configs][crate::model::ListNotificationConfigsResponse::notification_configs].
19800 ///
19801 /// # Example
19802 /// ```ignore,no_run
19803 /// # use google_cloud_securitycenter_v2::model::ListNotificationConfigsResponse;
19804 /// use google_cloud_securitycenter_v2::model::NotificationConfig;
19805 /// let x = ListNotificationConfigsResponse::new()
19806 /// .set_notification_configs([
19807 /// NotificationConfig::default()/* use setters */,
19808 /// NotificationConfig::default()/* use (different) setters */,
19809 /// ]);
19810 /// ```
19811 pub fn set_notification_configs<T, V>(mut self, v: T) -> Self
19812 where
19813 T: std::iter::IntoIterator<Item = V>,
19814 V: std::convert::Into<crate::model::NotificationConfig>,
19815 {
19816 use std::iter::Iterator;
19817 self.notification_configs = v.into_iter().map(|i| i.into()).collect();
19818 self
19819 }
19820
19821 /// Sets the value of [next_page_token][crate::model::ListNotificationConfigsResponse::next_page_token].
19822 ///
19823 /// # Example
19824 /// ```ignore,no_run
19825 /// # use google_cloud_securitycenter_v2::model::ListNotificationConfigsResponse;
19826 /// let x = ListNotificationConfigsResponse::new().set_next_page_token("example");
19827 /// ```
19828 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19829 self.next_page_token = v.into();
19830 self
19831 }
19832}
19833
19834impl wkt::message::Message for ListNotificationConfigsResponse {
19835 fn typename() -> &'static str {
19836 "type.googleapis.com/google.cloud.securitycenter.v2.ListNotificationConfigsResponse"
19837 }
19838}
19839
19840#[doc(hidden)]
19841impl gax::paginator::internal::PageableResponse for ListNotificationConfigsResponse {
19842 type PageItem = crate::model::NotificationConfig;
19843
19844 fn items(self) -> std::vec::Vec<Self::PageItem> {
19845 self.notification_configs
19846 }
19847
19848 fn next_page_token(&self) -> std::string::String {
19849 use std::clone::Clone;
19850 self.next_page_token.clone()
19851 }
19852}
19853
19854/// Request message to list resource value configs of a parent
19855#[derive(Clone, Default, PartialEq)]
19856#[non_exhaustive]
19857pub struct ListResourceValueConfigsRequest {
19858 /// Required. The parent, which owns the collection of resource value configs.
19859 /// Its format is
19860 /// `organizations/[organization_id]`
19861 pub parent: std::string::String,
19862
19863 /// The maximum number of configs to return. The service may return fewer than
19864 /// this value.
19865 /// If unspecified, at most 10 configs will be returned.
19866 /// The maximum value is 1000; values above 1000 will be coerced to 1000.
19867 pub page_size: i32,
19868
19869 /// A page token, received from a previous `ListResourceValueConfigs` call.
19870 /// Provide this to retrieve the subsequent page.
19871 ///
19872 /// When paginating, all other parameters provided to
19873 /// `ListResourceValueConfigs` must match the call that provided the
19874 /// page token.
19875 ///
19876 /// page_size can be specified, and the new page_size will be used.
19877 pub page_token: std::string::String,
19878
19879 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19880}
19881
19882impl ListResourceValueConfigsRequest {
19883 pub fn new() -> Self {
19884 std::default::Default::default()
19885 }
19886
19887 /// Sets the value of [parent][crate::model::ListResourceValueConfigsRequest::parent].
19888 ///
19889 /// # Example
19890 /// ```ignore,no_run
19891 /// # use google_cloud_securitycenter_v2::model::ListResourceValueConfigsRequest;
19892 /// let x = ListResourceValueConfigsRequest::new().set_parent("example");
19893 /// ```
19894 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19895 self.parent = v.into();
19896 self
19897 }
19898
19899 /// Sets the value of [page_size][crate::model::ListResourceValueConfigsRequest::page_size].
19900 ///
19901 /// # Example
19902 /// ```ignore,no_run
19903 /// # use google_cloud_securitycenter_v2::model::ListResourceValueConfigsRequest;
19904 /// let x = ListResourceValueConfigsRequest::new().set_page_size(42);
19905 /// ```
19906 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19907 self.page_size = v.into();
19908 self
19909 }
19910
19911 /// Sets the value of [page_token][crate::model::ListResourceValueConfigsRequest::page_token].
19912 ///
19913 /// # Example
19914 /// ```ignore,no_run
19915 /// # use google_cloud_securitycenter_v2::model::ListResourceValueConfigsRequest;
19916 /// let x = ListResourceValueConfigsRequest::new().set_page_token("example");
19917 /// ```
19918 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19919 self.page_token = v.into();
19920 self
19921 }
19922}
19923
19924impl wkt::message::Message for ListResourceValueConfigsRequest {
19925 fn typename() -> &'static str {
19926 "type.googleapis.com/google.cloud.securitycenter.v2.ListResourceValueConfigsRequest"
19927 }
19928}
19929
19930/// Response message to list resource value configs
19931#[derive(Clone, Default, PartialEq)]
19932#[non_exhaustive]
19933pub struct ListResourceValueConfigsResponse {
19934 /// The resource value configs from the specified parent.
19935 pub resource_value_configs: std::vec::Vec<crate::model::ResourceValueConfig>,
19936
19937 /// A token, which can be sent as `page_token` to retrieve the next page.
19938 /// If this field is empty, there are no subsequent pages.
19939 pub next_page_token: std::string::String,
19940
19941 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19942}
19943
19944impl ListResourceValueConfigsResponse {
19945 pub fn new() -> Self {
19946 std::default::Default::default()
19947 }
19948
19949 /// Sets the value of [resource_value_configs][crate::model::ListResourceValueConfigsResponse::resource_value_configs].
19950 ///
19951 /// # Example
19952 /// ```ignore,no_run
19953 /// # use google_cloud_securitycenter_v2::model::ListResourceValueConfigsResponse;
19954 /// use google_cloud_securitycenter_v2::model::ResourceValueConfig;
19955 /// let x = ListResourceValueConfigsResponse::new()
19956 /// .set_resource_value_configs([
19957 /// ResourceValueConfig::default()/* use setters */,
19958 /// ResourceValueConfig::default()/* use (different) setters */,
19959 /// ]);
19960 /// ```
19961 pub fn set_resource_value_configs<T, V>(mut self, v: T) -> Self
19962 where
19963 T: std::iter::IntoIterator<Item = V>,
19964 V: std::convert::Into<crate::model::ResourceValueConfig>,
19965 {
19966 use std::iter::Iterator;
19967 self.resource_value_configs = v.into_iter().map(|i| i.into()).collect();
19968 self
19969 }
19970
19971 /// Sets the value of [next_page_token][crate::model::ListResourceValueConfigsResponse::next_page_token].
19972 ///
19973 /// # Example
19974 /// ```ignore,no_run
19975 /// # use google_cloud_securitycenter_v2::model::ListResourceValueConfigsResponse;
19976 /// let x = ListResourceValueConfigsResponse::new().set_next_page_token("example");
19977 /// ```
19978 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19979 self.next_page_token = v.into();
19980 self
19981 }
19982}
19983
19984impl wkt::message::Message for ListResourceValueConfigsResponse {
19985 fn typename() -> &'static str {
19986 "type.googleapis.com/google.cloud.securitycenter.v2.ListResourceValueConfigsResponse"
19987 }
19988}
19989
19990#[doc(hidden)]
19991impl gax::paginator::internal::PageableResponse for ListResourceValueConfigsResponse {
19992 type PageItem = crate::model::ResourceValueConfig;
19993
19994 fn items(self) -> std::vec::Vec<Self::PageItem> {
19995 self.resource_value_configs
19996 }
19997
19998 fn next_page_token(&self) -> std::string::String {
19999 use std::clone::Clone;
20000 self.next_page_token.clone()
20001 }
20002}
20003
20004/// Request message for listing sources.
20005#[derive(Clone, Default, PartialEq)]
20006#[non_exhaustive]
20007pub struct ListSourcesRequest {
20008 /// Required. Resource name of the parent of sources to list. Its format should
20009 /// be `organizations/[organization_id]`, `folders/[folder_id]`, or
20010 /// `projects/[project_id]`.
20011 pub parent: std::string::String,
20012
20013 /// The value returned by the last `ListSourcesResponse`; indicates
20014 /// that this is a continuation of a prior `ListSources` call, and
20015 /// that the system should return the next page of data.
20016 pub page_token: std::string::String,
20017
20018 /// The maximum number of results to return in a single response. Default is
20019 /// 10, minimum is 1, maximum is 1000.
20020 pub page_size: i32,
20021
20022 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20023}
20024
20025impl ListSourcesRequest {
20026 pub fn new() -> Self {
20027 std::default::Default::default()
20028 }
20029
20030 /// Sets the value of [parent][crate::model::ListSourcesRequest::parent].
20031 ///
20032 /// # Example
20033 /// ```ignore,no_run
20034 /// # use google_cloud_securitycenter_v2::model::ListSourcesRequest;
20035 /// let x = ListSourcesRequest::new().set_parent("example");
20036 /// ```
20037 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20038 self.parent = v.into();
20039 self
20040 }
20041
20042 /// Sets the value of [page_token][crate::model::ListSourcesRequest::page_token].
20043 ///
20044 /// # Example
20045 /// ```ignore,no_run
20046 /// # use google_cloud_securitycenter_v2::model::ListSourcesRequest;
20047 /// let x = ListSourcesRequest::new().set_page_token("example");
20048 /// ```
20049 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20050 self.page_token = v.into();
20051 self
20052 }
20053
20054 /// Sets the value of [page_size][crate::model::ListSourcesRequest::page_size].
20055 ///
20056 /// # Example
20057 /// ```ignore,no_run
20058 /// # use google_cloud_securitycenter_v2::model::ListSourcesRequest;
20059 /// let x = ListSourcesRequest::new().set_page_size(42);
20060 /// ```
20061 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20062 self.page_size = v.into();
20063 self
20064 }
20065}
20066
20067impl wkt::message::Message for ListSourcesRequest {
20068 fn typename() -> &'static str {
20069 "type.googleapis.com/google.cloud.securitycenter.v2.ListSourcesRequest"
20070 }
20071}
20072
20073/// Response message for listing sources.
20074#[derive(Clone, Default, PartialEq)]
20075#[non_exhaustive]
20076pub struct ListSourcesResponse {
20077 /// Sources belonging to the requested parent.
20078 pub sources: std::vec::Vec<crate::model::Source>,
20079
20080 /// Token to retrieve the next page of results, or empty if there are no more
20081 /// results.
20082 pub next_page_token: std::string::String,
20083
20084 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20085}
20086
20087impl ListSourcesResponse {
20088 pub fn new() -> Self {
20089 std::default::Default::default()
20090 }
20091
20092 /// Sets the value of [sources][crate::model::ListSourcesResponse::sources].
20093 ///
20094 /// # Example
20095 /// ```ignore,no_run
20096 /// # use google_cloud_securitycenter_v2::model::ListSourcesResponse;
20097 /// use google_cloud_securitycenter_v2::model::Source;
20098 /// let x = ListSourcesResponse::new()
20099 /// .set_sources([
20100 /// Source::default()/* use setters */,
20101 /// Source::default()/* use (different) setters */,
20102 /// ]);
20103 /// ```
20104 pub fn set_sources<T, V>(mut self, v: T) -> Self
20105 where
20106 T: std::iter::IntoIterator<Item = V>,
20107 V: std::convert::Into<crate::model::Source>,
20108 {
20109 use std::iter::Iterator;
20110 self.sources = v.into_iter().map(|i| i.into()).collect();
20111 self
20112 }
20113
20114 /// Sets the value of [next_page_token][crate::model::ListSourcesResponse::next_page_token].
20115 ///
20116 /// # Example
20117 /// ```ignore,no_run
20118 /// # use google_cloud_securitycenter_v2::model::ListSourcesResponse;
20119 /// let x = ListSourcesResponse::new().set_next_page_token("example");
20120 /// ```
20121 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20122 self.next_page_token = v.into();
20123 self
20124 }
20125}
20126
20127impl wkt::message::Message for ListSourcesResponse {
20128 fn typename() -> &'static str {
20129 "type.googleapis.com/google.cloud.securitycenter.v2.ListSourcesResponse"
20130 }
20131}
20132
20133#[doc(hidden)]
20134impl gax::paginator::internal::PageableResponse for ListSourcesResponse {
20135 type PageItem = crate::model::Source;
20136
20137 fn items(self) -> std::vec::Vec<Self::PageItem> {
20138 self.sources
20139 }
20140
20141 fn next_page_token(&self) -> std::string::String {
20142 use std::clone::Clone;
20143 self.next_page_token.clone()
20144 }
20145}
20146
20147/// Request message for listing the valued resources for a given simulation.
20148#[derive(Clone, Default, PartialEq)]
20149#[non_exhaustive]
20150pub struct ListValuedResourcesRequest {
20151 /// Required. Name of parent to list exposed resources.
20152 ///
20153 /// Valid formats:
20154 /// `organizations/{organization}`,
20155 /// `organizations/{organization}/simulations/{simulation}`
20156 /// `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}`
20157 pub parent: std::string::String,
20158
20159 /// The filter expression that filters the valued resources in the response.
20160 /// Supported fields:
20161 ///
20162 /// * `resource_value` supports =
20163 /// * `resource_type` supports =
20164 pub filter: std::string::String,
20165
20166 /// The value returned by the last `ListValuedResourcesResponse`; indicates
20167 /// that this is a continuation of a prior `ListValuedResources` call, and
20168 /// that the system should return the next page of data.
20169 pub page_token: std::string::String,
20170
20171 /// The maximum number of results to return in a single response. Default is
20172 /// 10, minimum is 1, maximum is 1000.
20173 pub page_size: i32,
20174
20175 /// Optional. The fields by which to order the valued resources response.
20176 ///
20177 /// Supported fields:
20178 ///
20179 /// * `exposed_score`
20180 ///
20181 /// * `resource_value`
20182 ///
20183 /// * `resource_type`
20184 ///
20185 ///
20186 /// Values should be a comma separated list of fields. For example:
20187 /// `exposed_score,resource_value`.
20188 ///
20189 /// The default sorting order is descending. To specify ascending or descending
20190 /// order for a field, append a " ASC" or a " DESC" suffix, respectively; for
20191 /// example: `exposed_score DESC`.
20192 pub order_by: std::string::String,
20193
20194 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20195}
20196
20197impl ListValuedResourcesRequest {
20198 pub fn new() -> Self {
20199 std::default::Default::default()
20200 }
20201
20202 /// Sets the value of [parent][crate::model::ListValuedResourcesRequest::parent].
20203 ///
20204 /// # Example
20205 /// ```ignore,no_run
20206 /// # use google_cloud_securitycenter_v2::model::ListValuedResourcesRequest;
20207 /// let x = ListValuedResourcesRequest::new().set_parent("example");
20208 /// ```
20209 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20210 self.parent = v.into();
20211 self
20212 }
20213
20214 /// Sets the value of [filter][crate::model::ListValuedResourcesRequest::filter].
20215 ///
20216 /// # Example
20217 /// ```ignore,no_run
20218 /// # use google_cloud_securitycenter_v2::model::ListValuedResourcesRequest;
20219 /// let x = ListValuedResourcesRequest::new().set_filter("example");
20220 /// ```
20221 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20222 self.filter = v.into();
20223 self
20224 }
20225
20226 /// Sets the value of [page_token][crate::model::ListValuedResourcesRequest::page_token].
20227 ///
20228 /// # Example
20229 /// ```ignore,no_run
20230 /// # use google_cloud_securitycenter_v2::model::ListValuedResourcesRequest;
20231 /// let x = ListValuedResourcesRequest::new().set_page_token("example");
20232 /// ```
20233 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20234 self.page_token = v.into();
20235 self
20236 }
20237
20238 /// Sets the value of [page_size][crate::model::ListValuedResourcesRequest::page_size].
20239 ///
20240 /// # Example
20241 /// ```ignore,no_run
20242 /// # use google_cloud_securitycenter_v2::model::ListValuedResourcesRequest;
20243 /// let x = ListValuedResourcesRequest::new().set_page_size(42);
20244 /// ```
20245 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20246 self.page_size = v.into();
20247 self
20248 }
20249
20250 /// Sets the value of [order_by][crate::model::ListValuedResourcesRequest::order_by].
20251 ///
20252 /// # Example
20253 /// ```ignore,no_run
20254 /// # use google_cloud_securitycenter_v2::model::ListValuedResourcesRequest;
20255 /// let x = ListValuedResourcesRequest::new().set_order_by("example");
20256 /// ```
20257 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20258 self.order_by = v.into();
20259 self
20260 }
20261}
20262
20263impl wkt::message::Message for ListValuedResourcesRequest {
20264 fn typename() -> &'static str {
20265 "type.googleapis.com/google.cloud.securitycenter.v2.ListValuedResourcesRequest"
20266 }
20267}
20268
20269/// Response message for listing the valued resources for a given simulation.
20270#[derive(Clone, Default, PartialEq)]
20271#[non_exhaustive]
20272pub struct ListValuedResourcesResponse {
20273 /// The valued resources that the attack path simulation identified.
20274 pub valued_resources: std::vec::Vec<crate::model::ValuedResource>,
20275
20276 /// Token to retrieve the next page of results, or empty if there are no more
20277 /// results.
20278 pub next_page_token: std::string::String,
20279
20280 /// The estimated total number of results matching the query.
20281 pub total_size: i32,
20282
20283 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20284}
20285
20286impl ListValuedResourcesResponse {
20287 pub fn new() -> Self {
20288 std::default::Default::default()
20289 }
20290
20291 /// Sets the value of [valued_resources][crate::model::ListValuedResourcesResponse::valued_resources].
20292 ///
20293 /// # Example
20294 /// ```ignore,no_run
20295 /// # use google_cloud_securitycenter_v2::model::ListValuedResourcesResponse;
20296 /// use google_cloud_securitycenter_v2::model::ValuedResource;
20297 /// let x = ListValuedResourcesResponse::new()
20298 /// .set_valued_resources([
20299 /// ValuedResource::default()/* use setters */,
20300 /// ValuedResource::default()/* use (different) setters */,
20301 /// ]);
20302 /// ```
20303 pub fn set_valued_resources<T, V>(mut self, v: T) -> Self
20304 where
20305 T: std::iter::IntoIterator<Item = V>,
20306 V: std::convert::Into<crate::model::ValuedResource>,
20307 {
20308 use std::iter::Iterator;
20309 self.valued_resources = v.into_iter().map(|i| i.into()).collect();
20310 self
20311 }
20312
20313 /// Sets the value of [next_page_token][crate::model::ListValuedResourcesResponse::next_page_token].
20314 ///
20315 /// # Example
20316 /// ```ignore,no_run
20317 /// # use google_cloud_securitycenter_v2::model::ListValuedResourcesResponse;
20318 /// let x = ListValuedResourcesResponse::new().set_next_page_token("example");
20319 /// ```
20320 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20321 self.next_page_token = v.into();
20322 self
20323 }
20324
20325 /// Sets the value of [total_size][crate::model::ListValuedResourcesResponse::total_size].
20326 ///
20327 /// # Example
20328 /// ```ignore,no_run
20329 /// # use google_cloud_securitycenter_v2::model::ListValuedResourcesResponse;
20330 /// let x = ListValuedResourcesResponse::new().set_total_size(42);
20331 /// ```
20332 pub fn set_total_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20333 self.total_size = v.into();
20334 self
20335 }
20336}
20337
20338impl wkt::message::Message for ListValuedResourcesResponse {
20339 fn typename() -> &'static str {
20340 "type.googleapis.com/google.cloud.securitycenter.v2.ListValuedResourcesResponse"
20341 }
20342}
20343
20344#[doc(hidden)]
20345impl gax::paginator::internal::PageableResponse for ListValuedResourcesResponse {
20346 type PageItem = crate::model::ValuedResource;
20347
20348 fn items(self) -> std::vec::Vec<Self::PageItem> {
20349 self.valued_resources
20350 }
20351
20352 fn next_page_token(&self) -> std::string::String {
20353 use std::clone::Clone;
20354 self.next_page_token.clone()
20355 }
20356}
20357
20358/// Request message for updating a finding's state.
20359#[derive(Clone, Default, PartialEq)]
20360#[non_exhaustive]
20361pub struct SetFindingStateRequest {
20362 /// Required. The [relative resource
20363 /// name](https://cloud.google.com/apis/design/resource_names#relative_resource_name)
20364 /// of the finding. If no location is specified, finding is assumed to be in
20365 /// global. The following list shows some examples:
20366 ///
20367 ///
20368 /// `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`
20369 /// +
20370 /// `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
20371 ///
20372 /// + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`
20373 ///
20374 /// `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
20375 ///
20376 /// + `projects/{project_id}/sources/{source_id}/findings/{finding_id}`
20377 ///
20378 /// `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
20379 pub name: std::string::String,
20380
20381 /// Required. The desired State of the finding.
20382 pub state: crate::model::finding::State,
20383
20384 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20385}
20386
20387impl SetFindingStateRequest {
20388 pub fn new() -> Self {
20389 std::default::Default::default()
20390 }
20391
20392 /// Sets the value of [name][crate::model::SetFindingStateRequest::name].
20393 ///
20394 /// # Example
20395 /// ```ignore,no_run
20396 /// # use google_cloud_securitycenter_v2::model::SetFindingStateRequest;
20397 /// let x = SetFindingStateRequest::new().set_name("example");
20398 /// ```
20399 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20400 self.name = v.into();
20401 self
20402 }
20403
20404 /// Sets the value of [state][crate::model::SetFindingStateRequest::state].
20405 ///
20406 /// # Example
20407 /// ```ignore,no_run
20408 /// # use google_cloud_securitycenter_v2::model::SetFindingStateRequest;
20409 /// use google_cloud_securitycenter_v2::model::finding::State;
20410 /// let x0 = SetFindingStateRequest::new().set_state(State::Active);
20411 /// let x1 = SetFindingStateRequest::new().set_state(State::Inactive);
20412 /// ```
20413 pub fn set_state<T: std::convert::Into<crate::model::finding::State>>(mut self, v: T) -> Self {
20414 self.state = v.into();
20415 self
20416 }
20417}
20418
20419impl wkt::message::Message for SetFindingStateRequest {
20420 fn typename() -> &'static str {
20421 "type.googleapis.com/google.cloud.securitycenter.v2.SetFindingStateRequest"
20422 }
20423}
20424
20425/// Request message for updating a finding's mute status.
20426#[derive(Clone, Default, PartialEq)]
20427#[non_exhaustive]
20428pub struct SetMuteRequest {
20429 /// Required. The [relative resource
20430 /// name](https://cloud.google.com/apis/design/resource_names#relative_resource_name)
20431 /// of the finding. If no location is specified, finding is assumed to be in
20432 /// global. The following list shows some examples:
20433 ///
20434 ///
20435 /// `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`
20436 /// +
20437 /// `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
20438 ///
20439 /// + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`
20440 ///
20441 /// `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
20442 ///
20443 /// + `projects/{project_id}/sources/{source_id}/findings/{finding_id}`
20444 ///
20445 /// `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
20446 pub name: std::string::String,
20447
20448 /// Required. The desired state of the Mute.
20449 pub mute: crate::model::finding::Mute,
20450
20451 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20452}
20453
20454impl SetMuteRequest {
20455 pub fn new() -> Self {
20456 std::default::Default::default()
20457 }
20458
20459 /// Sets the value of [name][crate::model::SetMuteRequest::name].
20460 ///
20461 /// # Example
20462 /// ```ignore,no_run
20463 /// # use google_cloud_securitycenter_v2::model::SetMuteRequest;
20464 /// let x = SetMuteRequest::new().set_name("example");
20465 /// ```
20466 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20467 self.name = v.into();
20468 self
20469 }
20470
20471 /// Sets the value of [mute][crate::model::SetMuteRequest::mute].
20472 ///
20473 /// # Example
20474 /// ```ignore,no_run
20475 /// # use google_cloud_securitycenter_v2::model::SetMuteRequest;
20476 /// use google_cloud_securitycenter_v2::model::finding::Mute;
20477 /// let x0 = SetMuteRequest::new().set_mute(Mute::Muted);
20478 /// let x1 = SetMuteRequest::new().set_mute(Mute::Unmuted);
20479 /// let x2 = SetMuteRequest::new().set_mute(Mute::Undefined);
20480 /// ```
20481 pub fn set_mute<T: std::convert::Into<crate::model::finding::Mute>>(mut self, v: T) -> Self {
20482 self.mute = v.into();
20483 self
20484 }
20485}
20486
20487impl wkt::message::Message for SetMuteRequest {
20488 fn typename() -> &'static str {
20489 "type.googleapis.com/google.cloud.securitycenter.v2.SetMuteRequest"
20490 }
20491}
20492
20493/// Request message for updating a BigQuery export.
20494#[derive(Clone, Default, PartialEq)]
20495#[non_exhaustive]
20496pub struct UpdateBigQueryExportRequest {
20497 /// Required. The BigQuery export being updated.
20498 pub big_query_export: std::option::Option<crate::model::BigQueryExport>,
20499
20500 /// The list of fields to be updated.
20501 /// If empty all mutable fields will be updated.
20502 pub update_mask: std::option::Option<wkt::FieldMask>,
20503
20504 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20505}
20506
20507impl UpdateBigQueryExportRequest {
20508 pub fn new() -> Self {
20509 std::default::Default::default()
20510 }
20511
20512 /// Sets the value of [big_query_export][crate::model::UpdateBigQueryExportRequest::big_query_export].
20513 ///
20514 /// # Example
20515 /// ```ignore,no_run
20516 /// # use google_cloud_securitycenter_v2::model::UpdateBigQueryExportRequest;
20517 /// use google_cloud_securitycenter_v2::model::BigQueryExport;
20518 /// let x = UpdateBigQueryExportRequest::new().set_big_query_export(BigQueryExport::default()/* use setters */);
20519 /// ```
20520 pub fn set_big_query_export<T>(mut self, v: T) -> Self
20521 where
20522 T: std::convert::Into<crate::model::BigQueryExport>,
20523 {
20524 self.big_query_export = std::option::Option::Some(v.into());
20525 self
20526 }
20527
20528 /// Sets or clears the value of [big_query_export][crate::model::UpdateBigQueryExportRequest::big_query_export].
20529 ///
20530 /// # Example
20531 /// ```ignore,no_run
20532 /// # use google_cloud_securitycenter_v2::model::UpdateBigQueryExportRequest;
20533 /// use google_cloud_securitycenter_v2::model::BigQueryExport;
20534 /// let x = UpdateBigQueryExportRequest::new().set_or_clear_big_query_export(Some(BigQueryExport::default()/* use setters */));
20535 /// let x = UpdateBigQueryExportRequest::new().set_or_clear_big_query_export(None::<BigQueryExport>);
20536 /// ```
20537 pub fn set_or_clear_big_query_export<T>(mut self, v: std::option::Option<T>) -> Self
20538 where
20539 T: std::convert::Into<crate::model::BigQueryExport>,
20540 {
20541 self.big_query_export = v.map(|x| x.into());
20542 self
20543 }
20544
20545 /// Sets the value of [update_mask][crate::model::UpdateBigQueryExportRequest::update_mask].
20546 ///
20547 /// # Example
20548 /// ```ignore,no_run
20549 /// # use google_cloud_securitycenter_v2::model::UpdateBigQueryExportRequest;
20550 /// use wkt::FieldMask;
20551 /// let x = UpdateBigQueryExportRequest::new().set_update_mask(FieldMask::default()/* use setters */);
20552 /// ```
20553 pub fn set_update_mask<T>(mut self, v: T) -> Self
20554 where
20555 T: std::convert::Into<wkt::FieldMask>,
20556 {
20557 self.update_mask = std::option::Option::Some(v.into());
20558 self
20559 }
20560
20561 /// Sets or clears the value of [update_mask][crate::model::UpdateBigQueryExportRequest::update_mask].
20562 ///
20563 /// # Example
20564 /// ```ignore,no_run
20565 /// # use google_cloud_securitycenter_v2::model::UpdateBigQueryExportRequest;
20566 /// use wkt::FieldMask;
20567 /// let x = UpdateBigQueryExportRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
20568 /// let x = UpdateBigQueryExportRequest::new().set_or_clear_update_mask(None::<FieldMask>);
20569 /// ```
20570 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20571 where
20572 T: std::convert::Into<wkt::FieldMask>,
20573 {
20574 self.update_mask = v.map(|x| x.into());
20575 self
20576 }
20577}
20578
20579impl wkt::message::Message for UpdateBigQueryExportRequest {
20580 fn typename() -> &'static str {
20581 "type.googleapis.com/google.cloud.securitycenter.v2.UpdateBigQueryExportRequest"
20582 }
20583}
20584
20585/// Request message for updating a ExternalSystem resource.
20586#[derive(Clone, Default, PartialEq)]
20587#[non_exhaustive]
20588pub struct UpdateExternalSystemRequest {
20589 /// Required. The external system resource to update.
20590 pub external_system: std::option::Option<crate::model::ExternalSystem>,
20591
20592 /// The FieldMask to use when updating the external system resource.
20593 ///
20594 /// If empty all mutable fields will be updated.
20595 pub update_mask: std::option::Option<wkt::FieldMask>,
20596
20597 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20598}
20599
20600impl UpdateExternalSystemRequest {
20601 pub fn new() -> Self {
20602 std::default::Default::default()
20603 }
20604
20605 /// Sets the value of [external_system][crate::model::UpdateExternalSystemRequest::external_system].
20606 ///
20607 /// # Example
20608 /// ```ignore,no_run
20609 /// # use google_cloud_securitycenter_v2::model::UpdateExternalSystemRequest;
20610 /// use google_cloud_securitycenter_v2::model::ExternalSystem;
20611 /// let x = UpdateExternalSystemRequest::new().set_external_system(ExternalSystem::default()/* use setters */);
20612 /// ```
20613 pub fn set_external_system<T>(mut self, v: T) -> Self
20614 where
20615 T: std::convert::Into<crate::model::ExternalSystem>,
20616 {
20617 self.external_system = std::option::Option::Some(v.into());
20618 self
20619 }
20620
20621 /// Sets or clears the value of [external_system][crate::model::UpdateExternalSystemRequest::external_system].
20622 ///
20623 /// # Example
20624 /// ```ignore,no_run
20625 /// # use google_cloud_securitycenter_v2::model::UpdateExternalSystemRequest;
20626 /// use google_cloud_securitycenter_v2::model::ExternalSystem;
20627 /// let x = UpdateExternalSystemRequest::new().set_or_clear_external_system(Some(ExternalSystem::default()/* use setters */));
20628 /// let x = UpdateExternalSystemRequest::new().set_or_clear_external_system(None::<ExternalSystem>);
20629 /// ```
20630 pub fn set_or_clear_external_system<T>(mut self, v: std::option::Option<T>) -> Self
20631 where
20632 T: std::convert::Into<crate::model::ExternalSystem>,
20633 {
20634 self.external_system = v.map(|x| x.into());
20635 self
20636 }
20637
20638 /// Sets the value of [update_mask][crate::model::UpdateExternalSystemRequest::update_mask].
20639 ///
20640 /// # Example
20641 /// ```ignore,no_run
20642 /// # use google_cloud_securitycenter_v2::model::UpdateExternalSystemRequest;
20643 /// use wkt::FieldMask;
20644 /// let x = UpdateExternalSystemRequest::new().set_update_mask(FieldMask::default()/* use setters */);
20645 /// ```
20646 pub fn set_update_mask<T>(mut self, v: T) -> Self
20647 where
20648 T: std::convert::Into<wkt::FieldMask>,
20649 {
20650 self.update_mask = std::option::Option::Some(v.into());
20651 self
20652 }
20653
20654 /// Sets or clears the value of [update_mask][crate::model::UpdateExternalSystemRequest::update_mask].
20655 ///
20656 /// # Example
20657 /// ```ignore,no_run
20658 /// # use google_cloud_securitycenter_v2::model::UpdateExternalSystemRequest;
20659 /// use wkt::FieldMask;
20660 /// let x = UpdateExternalSystemRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
20661 /// let x = UpdateExternalSystemRequest::new().set_or_clear_update_mask(None::<FieldMask>);
20662 /// ```
20663 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20664 where
20665 T: std::convert::Into<wkt::FieldMask>,
20666 {
20667 self.update_mask = v.map(|x| x.into());
20668 self
20669 }
20670}
20671
20672impl wkt::message::Message for UpdateExternalSystemRequest {
20673 fn typename() -> &'static str {
20674 "type.googleapis.com/google.cloud.securitycenter.v2.UpdateExternalSystemRequest"
20675 }
20676}
20677
20678/// Request message for updating or creating a finding.
20679#[derive(Clone, Default, PartialEq)]
20680#[non_exhaustive]
20681pub struct UpdateFindingRequest {
20682 /// Required. The finding resource to update or create if it does not already
20683 /// exist. parent, security_marks, and update_time will be ignored.
20684 ///
20685 /// In the case of creation, the finding id portion of the name must be
20686 /// alphanumeric and less than or equal to 32 characters and greater than 0
20687 /// characters in length.
20688 pub finding: std::option::Option<crate::model::Finding>,
20689
20690 /// The FieldMask to use when updating the finding resource. This field should
20691 /// not be specified when creating a finding.
20692 ///
20693 /// When updating a finding, an empty mask is treated as updating all mutable
20694 /// fields and replacing source_properties. Individual source_properties can
20695 /// be added/updated by using "source_properties.\<property key\>" in the field
20696 /// mask.
20697 pub update_mask: std::option::Option<wkt::FieldMask>,
20698
20699 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20700}
20701
20702impl UpdateFindingRequest {
20703 pub fn new() -> Self {
20704 std::default::Default::default()
20705 }
20706
20707 /// Sets the value of [finding][crate::model::UpdateFindingRequest::finding].
20708 ///
20709 /// # Example
20710 /// ```ignore,no_run
20711 /// # use google_cloud_securitycenter_v2::model::UpdateFindingRequest;
20712 /// use google_cloud_securitycenter_v2::model::Finding;
20713 /// let x = UpdateFindingRequest::new().set_finding(Finding::default()/* use setters */);
20714 /// ```
20715 pub fn set_finding<T>(mut self, v: T) -> Self
20716 where
20717 T: std::convert::Into<crate::model::Finding>,
20718 {
20719 self.finding = std::option::Option::Some(v.into());
20720 self
20721 }
20722
20723 /// Sets or clears the value of [finding][crate::model::UpdateFindingRequest::finding].
20724 ///
20725 /// # Example
20726 /// ```ignore,no_run
20727 /// # use google_cloud_securitycenter_v2::model::UpdateFindingRequest;
20728 /// use google_cloud_securitycenter_v2::model::Finding;
20729 /// let x = UpdateFindingRequest::new().set_or_clear_finding(Some(Finding::default()/* use setters */));
20730 /// let x = UpdateFindingRequest::new().set_or_clear_finding(None::<Finding>);
20731 /// ```
20732 pub fn set_or_clear_finding<T>(mut self, v: std::option::Option<T>) -> Self
20733 where
20734 T: std::convert::Into<crate::model::Finding>,
20735 {
20736 self.finding = v.map(|x| x.into());
20737 self
20738 }
20739
20740 /// Sets the value of [update_mask][crate::model::UpdateFindingRequest::update_mask].
20741 ///
20742 /// # Example
20743 /// ```ignore,no_run
20744 /// # use google_cloud_securitycenter_v2::model::UpdateFindingRequest;
20745 /// use wkt::FieldMask;
20746 /// let x = UpdateFindingRequest::new().set_update_mask(FieldMask::default()/* use setters */);
20747 /// ```
20748 pub fn set_update_mask<T>(mut self, v: T) -> Self
20749 where
20750 T: std::convert::Into<wkt::FieldMask>,
20751 {
20752 self.update_mask = std::option::Option::Some(v.into());
20753 self
20754 }
20755
20756 /// Sets or clears the value of [update_mask][crate::model::UpdateFindingRequest::update_mask].
20757 ///
20758 /// # Example
20759 /// ```ignore,no_run
20760 /// # use google_cloud_securitycenter_v2::model::UpdateFindingRequest;
20761 /// use wkt::FieldMask;
20762 /// let x = UpdateFindingRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
20763 /// let x = UpdateFindingRequest::new().set_or_clear_update_mask(None::<FieldMask>);
20764 /// ```
20765 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20766 where
20767 T: std::convert::Into<wkt::FieldMask>,
20768 {
20769 self.update_mask = v.map(|x| x.into());
20770 self
20771 }
20772}
20773
20774impl wkt::message::Message for UpdateFindingRequest {
20775 fn typename() -> &'static str {
20776 "type.googleapis.com/google.cloud.securitycenter.v2.UpdateFindingRequest"
20777 }
20778}
20779
20780/// Request message for updating a mute config.
20781#[derive(Clone, Default, PartialEq)]
20782#[non_exhaustive]
20783pub struct UpdateMuteConfigRequest {
20784 /// Required. The mute config being updated.
20785 pub mute_config: std::option::Option<crate::model::MuteConfig>,
20786
20787 /// The list of fields to be updated.
20788 /// If empty all mutable fields will be updated.
20789 pub update_mask: std::option::Option<wkt::FieldMask>,
20790
20791 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20792}
20793
20794impl UpdateMuteConfigRequest {
20795 pub fn new() -> Self {
20796 std::default::Default::default()
20797 }
20798
20799 /// Sets the value of [mute_config][crate::model::UpdateMuteConfigRequest::mute_config].
20800 ///
20801 /// # Example
20802 /// ```ignore,no_run
20803 /// # use google_cloud_securitycenter_v2::model::UpdateMuteConfigRequest;
20804 /// use google_cloud_securitycenter_v2::model::MuteConfig;
20805 /// let x = UpdateMuteConfigRequest::new().set_mute_config(MuteConfig::default()/* use setters */);
20806 /// ```
20807 pub fn set_mute_config<T>(mut self, v: T) -> Self
20808 where
20809 T: std::convert::Into<crate::model::MuteConfig>,
20810 {
20811 self.mute_config = std::option::Option::Some(v.into());
20812 self
20813 }
20814
20815 /// Sets or clears the value of [mute_config][crate::model::UpdateMuteConfigRequest::mute_config].
20816 ///
20817 /// # Example
20818 /// ```ignore,no_run
20819 /// # use google_cloud_securitycenter_v2::model::UpdateMuteConfigRequest;
20820 /// use google_cloud_securitycenter_v2::model::MuteConfig;
20821 /// let x = UpdateMuteConfigRequest::new().set_or_clear_mute_config(Some(MuteConfig::default()/* use setters */));
20822 /// let x = UpdateMuteConfigRequest::new().set_or_clear_mute_config(None::<MuteConfig>);
20823 /// ```
20824 pub fn set_or_clear_mute_config<T>(mut self, v: std::option::Option<T>) -> Self
20825 where
20826 T: std::convert::Into<crate::model::MuteConfig>,
20827 {
20828 self.mute_config = v.map(|x| x.into());
20829 self
20830 }
20831
20832 /// Sets the value of [update_mask][crate::model::UpdateMuteConfigRequest::update_mask].
20833 ///
20834 /// # Example
20835 /// ```ignore,no_run
20836 /// # use google_cloud_securitycenter_v2::model::UpdateMuteConfigRequest;
20837 /// use wkt::FieldMask;
20838 /// let x = UpdateMuteConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
20839 /// ```
20840 pub fn set_update_mask<T>(mut self, v: T) -> Self
20841 where
20842 T: std::convert::Into<wkt::FieldMask>,
20843 {
20844 self.update_mask = std::option::Option::Some(v.into());
20845 self
20846 }
20847
20848 /// Sets or clears the value of [update_mask][crate::model::UpdateMuteConfigRequest::update_mask].
20849 ///
20850 /// # Example
20851 /// ```ignore,no_run
20852 /// # use google_cloud_securitycenter_v2::model::UpdateMuteConfigRequest;
20853 /// use wkt::FieldMask;
20854 /// let x = UpdateMuteConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
20855 /// let x = UpdateMuteConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
20856 /// ```
20857 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20858 where
20859 T: std::convert::Into<wkt::FieldMask>,
20860 {
20861 self.update_mask = v.map(|x| x.into());
20862 self
20863 }
20864}
20865
20866impl wkt::message::Message for UpdateMuteConfigRequest {
20867 fn typename() -> &'static str {
20868 "type.googleapis.com/google.cloud.securitycenter.v2.UpdateMuteConfigRequest"
20869 }
20870}
20871
20872/// Request message for updating a notification config.
20873#[derive(Clone, Default, PartialEq)]
20874#[non_exhaustive]
20875pub struct UpdateNotificationConfigRequest {
20876 /// Required. The notification config to update.
20877 pub notification_config: std::option::Option<crate::model::NotificationConfig>,
20878
20879 /// The FieldMask to use when updating the notification config.
20880 ///
20881 /// If empty all mutable fields will be updated.
20882 pub update_mask: std::option::Option<wkt::FieldMask>,
20883
20884 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20885}
20886
20887impl UpdateNotificationConfigRequest {
20888 pub fn new() -> Self {
20889 std::default::Default::default()
20890 }
20891
20892 /// Sets the value of [notification_config][crate::model::UpdateNotificationConfigRequest::notification_config].
20893 ///
20894 /// # Example
20895 /// ```ignore,no_run
20896 /// # use google_cloud_securitycenter_v2::model::UpdateNotificationConfigRequest;
20897 /// use google_cloud_securitycenter_v2::model::NotificationConfig;
20898 /// let x = UpdateNotificationConfigRequest::new().set_notification_config(NotificationConfig::default()/* use setters */);
20899 /// ```
20900 pub fn set_notification_config<T>(mut self, v: T) -> Self
20901 where
20902 T: std::convert::Into<crate::model::NotificationConfig>,
20903 {
20904 self.notification_config = std::option::Option::Some(v.into());
20905 self
20906 }
20907
20908 /// Sets or clears the value of [notification_config][crate::model::UpdateNotificationConfigRequest::notification_config].
20909 ///
20910 /// # Example
20911 /// ```ignore,no_run
20912 /// # use google_cloud_securitycenter_v2::model::UpdateNotificationConfigRequest;
20913 /// use google_cloud_securitycenter_v2::model::NotificationConfig;
20914 /// let x = UpdateNotificationConfigRequest::new().set_or_clear_notification_config(Some(NotificationConfig::default()/* use setters */));
20915 /// let x = UpdateNotificationConfigRequest::new().set_or_clear_notification_config(None::<NotificationConfig>);
20916 /// ```
20917 pub fn set_or_clear_notification_config<T>(mut self, v: std::option::Option<T>) -> Self
20918 where
20919 T: std::convert::Into<crate::model::NotificationConfig>,
20920 {
20921 self.notification_config = v.map(|x| x.into());
20922 self
20923 }
20924
20925 /// Sets the value of [update_mask][crate::model::UpdateNotificationConfigRequest::update_mask].
20926 ///
20927 /// # Example
20928 /// ```ignore,no_run
20929 /// # use google_cloud_securitycenter_v2::model::UpdateNotificationConfigRequest;
20930 /// use wkt::FieldMask;
20931 /// let x = UpdateNotificationConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
20932 /// ```
20933 pub fn set_update_mask<T>(mut self, v: T) -> Self
20934 where
20935 T: std::convert::Into<wkt::FieldMask>,
20936 {
20937 self.update_mask = std::option::Option::Some(v.into());
20938 self
20939 }
20940
20941 /// Sets or clears the value of [update_mask][crate::model::UpdateNotificationConfigRequest::update_mask].
20942 ///
20943 /// # Example
20944 /// ```ignore,no_run
20945 /// # use google_cloud_securitycenter_v2::model::UpdateNotificationConfigRequest;
20946 /// use wkt::FieldMask;
20947 /// let x = UpdateNotificationConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
20948 /// let x = UpdateNotificationConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
20949 /// ```
20950 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20951 where
20952 T: std::convert::Into<wkt::FieldMask>,
20953 {
20954 self.update_mask = v.map(|x| x.into());
20955 self
20956 }
20957}
20958
20959impl wkt::message::Message for UpdateNotificationConfigRequest {
20960 fn typename() -> &'static str {
20961 "type.googleapis.com/google.cloud.securitycenter.v2.UpdateNotificationConfigRequest"
20962 }
20963}
20964
20965/// Request message to update resource value config
20966#[derive(Clone, Default, PartialEq)]
20967#[non_exhaustive]
20968pub struct UpdateResourceValueConfigRequest {
20969 /// Required. The resource value config being updated.
20970 pub resource_value_config: std::option::Option<crate::model::ResourceValueConfig>,
20971
20972 /// The list of fields to be updated.
20973 /// If empty all mutable fields will be updated.
20974 ///
20975 /// To update nested fields, include the top level field in the mask
20976 /// For example, to update gcp_metadata.resource_type, include the
20977 /// "gcp_metadata" field mask
20978 pub update_mask: std::option::Option<wkt::FieldMask>,
20979
20980 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20981}
20982
20983impl UpdateResourceValueConfigRequest {
20984 pub fn new() -> Self {
20985 std::default::Default::default()
20986 }
20987
20988 /// Sets the value of [resource_value_config][crate::model::UpdateResourceValueConfigRequest::resource_value_config].
20989 ///
20990 /// # Example
20991 /// ```ignore,no_run
20992 /// # use google_cloud_securitycenter_v2::model::UpdateResourceValueConfigRequest;
20993 /// use google_cloud_securitycenter_v2::model::ResourceValueConfig;
20994 /// let x = UpdateResourceValueConfigRequest::new().set_resource_value_config(ResourceValueConfig::default()/* use setters */);
20995 /// ```
20996 pub fn set_resource_value_config<T>(mut self, v: T) -> Self
20997 where
20998 T: std::convert::Into<crate::model::ResourceValueConfig>,
20999 {
21000 self.resource_value_config = std::option::Option::Some(v.into());
21001 self
21002 }
21003
21004 /// Sets or clears the value of [resource_value_config][crate::model::UpdateResourceValueConfigRequest::resource_value_config].
21005 ///
21006 /// # Example
21007 /// ```ignore,no_run
21008 /// # use google_cloud_securitycenter_v2::model::UpdateResourceValueConfigRequest;
21009 /// use google_cloud_securitycenter_v2::model::ResourceValueConfig;
21010 /// let x = UpdateResourceValueConfigRequest::new().set_or_clear_resource_value_config(Some(ResourceValueConfig::default()/* use setters */));
21011 /// let x = UpdateResourceValueConfigRequest::new().set_or_clear_resource_value_config(None::<ResourceValueConfig>);
21012 /// ```
21013 pub fn set_or_clear_resource_value_config<T>(mut self, v: std::option::Option<T>) -> Self
21014 where
21015 T: std::convert::Into<crate::model::ResourceValueConfig>,
21016 {
21017 self.resource_value_config = v.map(|x| x.into());
21018 self
21019 }
21020
21021 /// Sets the value of [update_mask][crate::model::UpdateResourceValueConfigRequest::update_mask].
21022 ///
21023 /// # Example
21024 /// ```ignore,no_run
21025 /// # use google_cloud_securitycenter_v2::model::UpdateResourceValueConfigRequest;
21026 /// use wkt::FieldMask;
21027 /// let x = UpdateResourceValueConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
21028 /// ```
21029 pub fn set_update_mask<T>(mut self, v: T) -> Self
21030 where
21031 T: std::convert::Into<wkt::FieldMask>,
21032 {
21033 self.update_mask = std::option::Option::Some(v.into());
21034 self
21035 }
21036
21037 /// Sets or clears the value of [update_mask][crate::model::UpdateResourceValueConfigRequest::update_mask].
21038 ///
21039 /// # Example
21040 /// ```ignore,no_run
21041 /// # use google_cloud_securitycenter_v2::model::UpdateResourceValueConfigRequest;
21042 /// use wkt::FieldMask;
21043 /// let x = UpdateResourceValueConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
21044 /// let x = UpdateResourceValueConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
21045 /// ```
21046 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21047 where
21048 T: std::convert::Into<wkt::FieldMask>,
21049 {
21050 self.update_mask = v.map(|x| x.into());
21051 self
21052 }
21053}
21054
21055impl wkt::message::Message for UpdateResourceValueConfigRequest {
21056 fn typename() -> &'static str {
21057 "type.googleapis.com/google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest"
21058 }
21059}
21060
21061/// Request message for updating a SecurityMarks resource.
21062#[derive(Clone, Default, PartialEq)]
21063#[non_exhaustive]
21064pub struct UpdateSecurityMarksRequest {
21065 /// Required. The security marks resource to update.
21066 pub security_marks: std::option::Option<crate::model::SecurityMarks>,
21067
21068 /// The FieldMask to use when updating the security marks resource.
21069 ///
21070 /// The field mask must not contain duplicate fields.
21071 /// If empty or set to "marks", all marks will be replaced. Individual
21072 /// marks can be updated using "marks.<mark_key>".
21073 pub update_mask: std::option::Option<wkt::FieldMask>,
21074
21075 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21076}
21077
21078impl UpdateSecurityMarksRequest {
21079 pub fn new() -> Self {
21080 std::default::Default::default()
21081 }
21082
21083 /// Sets the value of [security_marks][crate::model::UpdateSecurityMarksRequest::security_marks].
21084 ///
21085 /// # Example
21086 /// ```ignore,no_run
21087 /// # use google_cloud_securitycenter_v2::model::UpdateSecurityMarksRequest;
21088 /// use google_cloud_securitycenter_v2::model::SecurityMarks;
21089 /// let x = UpdateSecurityMarksRequest::new().set_security_marks(SecurityMarks::default()/* use setters */);
21090 /// ```
21091 pub fn set_security_marks<T>(mut self, v: T) -> Self
21092 where
21093 T: std::convert::Into<crate::model::SecurityMarks>,
21094 {
21095 self.security_marks = std::option::Option::Some(v.into());
21096 self
21097 }
21098
21099 /// Sets or clears the value of [security_marks][crate::model::UpdateSecurityMarksRequest::security_marks].
21100 ///
21101 /// # Example
21102 /// ```ignore,no_run
21103 /// # use google_cloud_securitycenter_v2::model::UpdateSecurityMarksRequest;
21104 /// use google_cloud_securitycenter_v2::model::SecurityMarks;
21105 /// let x = UpdateSecurityMarksRequest::new().set_or_clear_security_marks(Some(SecurityMarks::default()/* use setters */));
21106 /// let x = UpdateSecurityMarksRequest::new().set_or_clear_security_marks(None::<SecurityMarks>);
21107 /// ```
21108 pub fn set_or_clear_security_marks<T>(mut self, v: std::option::Option<T>) -> Self
21109 where
21110 T: std::convert::Into<crate::model::SecurityMarks>,
21111 {
21112 self.security_marks = v.map(|x| x.into());
21113 self
21114 }
21115
21116 /// Sets the value of [update_mask][crate::model::UpdateSecurityMarksRequest::update_mask].
21117 ///
21118 /// # Example
21119 /// ```ignore,no_run
21120 /// # use google_cloud_securitycenter_v2::model::UpdateSecurityMarksRequest;
21121 /// use wkt::FieldMask;
21122 /// let x = UpdateSecurityMarksRequest::new().set_update_mask(FieldMask::default()/* use setters */);
21123 /// ```
21124 pub fn set_update_mask<T>(mut self, v: T) -> Self
21125 where
21126 T: std::convert::Into<wkt::FieldMask>,
21127 {
21128 self.update_mask = std::option::Option::Some(v.into());
21129 self
21130 }
21131
21132 /// Sets or clears the value of [update_mask][crate::model::UpdateSecurityMarksRequest::update_mask].
21133 ///
21134 /// # Example
21135 /// ```ignore,no_run
21136 /// # use google_cloud_securitycenter_v2::model::UpdateSecurityMarksRequest;
21137 /// use wkt::FieldMask;
21138 /// let x = UpdateSecurityMarksRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
21139 /// let x = UpdateSecurityMarksRequest::new().set_or_clear_update_mask(None::<FieldMask>);
21140 /// ```
21141 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21142 where
21143 T: std::convert::Into<wkt::FieldMask>,
21144 {
21145 self.update_mask = v.map(|x| x.into());
21146 self
21147 }
21148}
21149
21150impl wkt::message::Message for UpdateSecurityMarksRequest {
21151 fn typename() -> &'static str {
21152 "type.googleapis.com/google.cloud.securitycenter.v2.UpdateSecurityMarksRequest"
21153 }
21154}
21155
21156/// Request message for updating a source.
21157#[derive(Clone, Default, PartialEq)]
21158#[non_exhaustive]
21159pub struct UpdateSourceRequest {
21160 /// Required. The source resource to update.
21161 pub source: std::option::Option<crate::model::Source>,
21162
21163 /// The FieldMask to use when updating the source resource.
21164 ///
21165 /// If empty all mutable fields will be updated.
21166 pub update_mask: std::option::Option<wkt::FieldMask>,
21167
21168 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21169}
21170
21171impl UpdateSourceRequest {
21172 pub fn new() -> Self {
21173 std::default::Default::default()
21174 }
21175
21176 /// Sets the value of [source][crate::model::UpdateSourceRequest::source].
21177 ///
21178 /// # Example
21179 /// ```ignore,no_run
21180 /// # use google_cloud_securitycenter_v2::model::UpdateSourceRequest;
21181 /// use google_cloud_securitycenter_v2::model::Source;
21182 /// let x = UpdateSourceRequest::new().set_source(Source::default()/* use setters */);
21183 /// ```
21184 pub fn set_source<T>(mut self, v: T) -> Self
21185 where
21186 T: std::convert::Into<crate::model::Source>,
21187 {
21188 self.source = std::option::Option::Some(v.into());
21189 self
21190 }
21191
21192 /// Sets or clears the value of [source][crate::model::UpdateSourceRequest::source].
21193 ///
21194 /// # Example
21195 /// ```ignore,no_run
21196 /// # use google_cloud_securitycenter_v2::model::UpdateSourceRequest;
21197 /// use google_cloud_securitycenter_v2::model::Source;
21198 /// let x = UpdateSourceRequest::new().set_or_clear_source(Some(Source::default()/* use setters */));
21199 /// let x = UpdateSourceRequest::new().set_or_clear_source(None::<Source>);
21200 /// ```
21201 pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
21202 where
21203 T: std::convert::Into<crate::model::Source>,
21204 {
21205 self.source = v.map(|x| x.into());
21206 self
21207 }
21208
21209 /// Sets the value of [update_mask][crate::model::UpdateSourceRequest::update_mask].
21210 ///
21211 /// # Example
21212 /// ```ignore,no_run
21213 /// # use google_cloud_securitycenter_v2::model::UpdateSourceRequest;
21214 /// use wkt::FieldMask;
21215 /// let x = UpdateSourceRequest::new().set_update_mask(FieldMask::default()/* use setters */);
21216 /// ```
21217 pub fn set_update_mask<T>(mut self, v: T) -> Self
21218 where
21219 T: std::convert::Into<wkt::FieldMask>,
21220 {
21221 self.update_mask = std::option::Option::Some(v.into());
21222 self
21223 }
21224
21225 /// Sets or clears the value of [update_mask][crate::model::UpdateSourceRequest::update_mask].
21226 ///
21227 /// # Example
21228 /// ```ignore,no_run
21229 /// # use google_cloud_securitycenter_v2::model::UpdateSourceRequest;
21230 /// use wkt::FieldMask;
21231 /// let x = UpdateSourceRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
21232 /// let x = UpdateSourceRequest::new().set_or_clear_update_mask(None::<FieldMask>);
21233 /// ```
21234 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21235 where
21236 T: std::convert::Into<wkt::FieldMask>,
21237 {
21238 self.update_mask = v.map(|x| x.into());
21239 self
21240 }
21241}
21242
21243impl wkt::message::Message for UpdateSourceRequest {
21244 fn typename() -> &'static str {
21245 "type.googleapis.com/google.cloud.securitycenter.v2.UpdateSourceRequest"
21246 }
21247}
21248
21249/// Attack path simulation
21250#[derive(Clone, Default, PartialEq)]
21251#[non_exhaustive]
21252pub struct Simulation {
21253 /// Full resource name of the Simulation:
21254 /// `organizations/123/simulations/456`
21255 pub name: std::string::String,
21256
21257 /// Output only. Time simulation was created
21258 pub create_time: std::option::Option<wkt::Timestamp>,
21259
21260 /// Resource value configurations' metadata used in this simulation. Maximum of
21261 /// 100.
21262 pub resource_value_configs_metadata: std::vec::Vec<crate::model::ResourceValueConfigMetadata>,
21263
21264 /// Indicates which cloud provider was used in this simulation.
21265 pub cloud_provider: crate::model::CloudProvider,
21266
21267 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21268}
21269
21270impl Simulation {
21271 pub fn new() -> Self {
21272 std::default::Default::default()
21273 }
21274
21275 /// Sets the value of [name][crate::model::Simulation::name].
21276 ///
21277 /// # Example
21278 /// ```ignore,no_run
21279 /// # use google_cloud_securitycenter_v2::model::Simulation;
21280 /// let x = Simulation::new().set_name("example");
21281 /// ```
21282 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21283 self.name = v.into();
21284 self
21285 }
21286
21287 /// Sets the value of [create_time][crate::model::Simulation::create_time].
21288 ///
21289 /// # Example
21290 /// ```ignore,no_run
21291 /// # use google_cloud_securitycenter_v2::model::Simulation;
21292 /// use wkt::Timestamp;
21293 /// let x = Simulation::new().set_create_time(Timestamp::default()/* use setters */);
21294 /// ```
21295 pub fn set_create_time<T>(mut self, v: T) -> Self
21296 where
21297 T: std::convert::Into<wkt::Timestamp>,
21298 {
21299 self.create_time = std::option::Option::Some(v.into());
21300 self
21301 }
21302
21303 /// Sets or clears the value of [create_time][crate::model::Simulation::create_time].
21304 ///
21305 /// # Example
21306 /// ```ignore,no_run
21307 /// # use google_cloud_securitycenter_v2::model::Simulation;
21308 /// use wkt::Timestamp;
21309 /// let x = Simulation::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
21310 /// let x = Simulation::new().set_or_clear_create_time(None::<Timestamp>);
21311 /// ```
21312 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
21313 where
21314 T: std::convert::Into<wkt::Timestamp>,
21315 {
21316 self.create_time = v.map(|x| x.into());
21317 self
21318 }
21319
21320 /// Sets the value of [resource_value_configs_metadata][crate::model::Simulation::resource_value_configs_metadata].
21321 ///
21322 /// # Example
21323 /// ```ignore,no_run
21324 /// # use google_cloud_securitycenter_v2::model::Simulation;
21325 /// use google_cloud_securitycenter_v2::model::ResourceValueConfigMetadata;
21326 /// let x = Simulation::new()
21327 /// .set_resource_value_configs_metadata([
21328 /// ResourceValueConfigMetadata::default()/* use setters */,
21329 /// ResourceValueConfigMetadata::default()/* use (different) setters */,
21330 /// ]);
21331 /// ```
21332 pub fn set_resource_value_configs_metadata<T, V>(mut self, v: T) -> Self
21333 where
21334 T: std::iter::IntoIterator<Item = V>,
21335 V: std::convert::Into<crate::model::ResourceValueConfigMetadata>,
21336 {
21337 use std::iter::Iterator;
21338 self.resource_value_configs_metadata = v.into_iter().map(|i| i.into()).collect();
21339 self
21340 }
21341
21342 /// Sets the value of [cloud_provider][crate::model::Simulation::cloud_provider].
21343 ///
21344 /// # Example
21345 /// ```ignore,no_run
21346 /// # use google_cloud_securitycenter_v2::model::Simulation;
21347 /// use google_cloud_securitycenter_v2::model::CloudProvider;
21348 /// let x0 = Simulation::new().set_cloud_provider(CloudProvider::GoogleCloudPlatform);
21349 /// let x1 = Simulation::new().set_cloud_provider(CloudProvider::AmazonWebServices);
21350 /// let x2 = Simulation::new().set_cloud_provider(CloudProvider::MicrosoftAzure);
21351 /// ```
21352 pub fn set_cloud_provider<T: std::convert::Into<crate::model::CloudProvider>>(
21353 mut self,
21354 v: T,
21355 ) -> Self {
21356 self.cloud_provider = v.into();
21357 self
21358 }
21359}
21360
21361impl wkt::message::Message for Simulation {
21362 fn typename() -> &'static str {
21363 "type.googleapis.com/google.cloud.securitycenter.v2.Simulation"
21364 }
21365}
21366
21367/// Security Command Center finding source. A finding source
21368/// is an entity or a mechanism that can produce a finding. A source is like a
21369/// container of findings that come from the same scanner, logger, monitor, and
21370/// other tools.
21371#[derive(Clone, Default, PartialEq)]
21372#[non_exhaustive]
21373pub struct Source {
21374 /// The relative resource name of this source. See:
21375 /// <https://cloud.google.com/apis/design/resource_names#relative_resource_name>
21376 /// Example:
21377 /// "organizations/{organization_id}/sources/{source_id}"
21378 pub name: std::string::String,
21379
21380 /// The source's display name.
21381 /// A source's display name must be unique amongst its siblings, for example,
21382 /// two sources with the same parent can't share the same display name.
21383 /// The display name must have a length between 1 and 64 characters
21384 /// (inclusive).
21385 pub display_name: std::string::String,
21386
21387 /// The description of the source (max of 1024 characters).
21388 /// Example:
21389 /// "Web Security Scanner is a web security scanner for common
21390 /// vulnerabilities in App Engine applications. It can automatically
21391 /// scan and detect four common vulnerabilities, including cross-site-scripting
21392 /// (XSS), Flash injection, mixed content (HTTP in HTTPS), and
21393 /// outdated or insecure libraries."
21394 pub description: std::string::String,
21395
21396 /// The canonical name of the finding source. It's either
21397 /// "organizations/{organization_id}/sources/{source_id}",
21398 /// "folders/{folder_id}/sources/{source_id}", or
21399 /// "projects/{project_number}/sources/{source_id}",
21400 /// depending on the closest CRM ancestor of the resource associated with the
21401 /// finding.
21402 pub canonical_name: std::string::String,
21403
21404 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21405}
21406
21407impl Source {
21408 pub fn new() -> Self {
21409 std::default::Default::default()
21410 }
21411
21412 /// Sets the value of [name][crate::model::Source::name].
21413 ///
21414 /// # Example
21415 /// ```ignore,no_run
21416 /// # use google_cloud_securitycenter_v2::model::Source;
21417 /// let x = Source::new().set_name("example");
21418 /// ```
21419 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21420 self.name = v.into();
21421 self
21422 }
21423
21424 /// Sets the value of [display_name][crate::model::Source::display_name].
21425 ///
21426 /// # Example
21427 /// ```ignore,no_run
21428 /// # use google_cloud_securitycenter_v2::model::Source;
21429 /// let x = Source::new().set_display_name("example");
21430 /// ```
21431 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21432 self.display_name = v.into();
21433 self
21434 }
21435
21436 /// Sets the value of [description][crate::model::Source::description].
21437 ///
21438 /// # Example
21439 /// ```ignore,no_run
21440 /// # use google_cloud_securitycenter_v2::model::Source;
21441 /// let x = Source::new().set_description("example");
21442 /// ```
21443 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21444 self.description = v.into();
21445 self
21446 }
21447
21448 /// Sets the value of [canonical_name][crate::model::Source::canonical_name].
21449 ///
21450 /// # Example
21451 /// ```ignore,no_run
21452 /// # use google_cloud_securitycenter_v2::model::Source;
21453 /// let x = Source::new().set_canonical_name("example");
21454 /// ```
21455 pub fn set_canonical_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21456 self.canonical_name = v.into();
21457 self
21458 }
21459}
21460
21461impl wkt::message::Message for Source {
21462 fn typename() -> &'static str {
21463 "type.googleapis.com/google.cloud.securitycenter.v2.Source"
21464 }
21465}
21466
21467/// Contains details about a group of security issues that, when the issues
21468/// occur together, represent a greater risk than when the issues occur
21469/// independently. A group of such issues is referred to as a toxic
21470/// combination.
21471#[derive(Clone, Default, PartialEq)]
21472#[non_exhaustive]
21473pub struct ToxicCombination {
21474 /// The
21475 /// [Attack exposure
21476 /// score](https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_exposure_scores)
21477 /// of this toxic combination. The score is a measure of how much this toxic
21478 /// combination exposes one or more high-value resources to potential attack.
21479 pub attack_exposure_score: f64,
21480
21481 /// List of resource names of findings associated with this toxic combination.
21482 /// For example, `organizations/123/sources/456/findings/789`.
21483 pub related_findings: std::vec::Vec<std::string::String>,
21484
21485 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21486}
21487
21488impl ToxicCombination {
21489 pub fn new() -> Self {
21490 std::default::Default::default()
21491 }
21492
21493 /// Sets the value of [attack_exposure_score][crate::model::ToxicCombination::attack_exposure_score].
21494 ///
21495 /// # Example
21496 /// ```ignore,no_run
21497 /// # use google_cloud_securitycenter_v2::model::ToxicCombination;
21498 /// let x = ToxicCombination::new().set_attack_exposure_score(42.0);
21499 /// ```
21500 pub fn set_attack_exposure_score<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
21501 self.attack_exposure_score = v.into();
21502 self
21503 }
21504
21505 /// Sets the value of [related_findings][crate::model::ToxicCombination::related_findings].
21506 ///
21507 /// # Example
21508 /// ```ignore,no_run
21509 /// # use google_cloud_securitycenter_v2::model::ToxicCombination;
21510 /// let x = ToxicCombination::new().set_related_findings(["a", "b", "c"]);
21511 /// ```
21512 pub fn set_related_findings<T, V>(mut self, v: T) -> Self
21513 where
21514 T: std::iter::IntoIterator<Item = V>,
21515 V: std::convert::Into<std::string::String>,
21516 {
21517 use std::iter::Iterator;
21518 self.related_findings = v.into_iter().map(|i| i.into()).collect();
21519 self
21520 }
21521}
21522
21523impl wkt::message::Message for ToxicCombination {
21524 fn typename() -> &'static str {
21525 "type.googleapis.com/google.cloud.securitycenter.v2.ToxicCombination"
21526 }
21527}
21528
21529/// A resource that is determined to have value to a user's system
21530#[derive(Clone, Default, PartialEq)]
21531#[non_exhaustive]
21532pub struct ValuedResource {
21533 /// Valued resource name, for example,
21534 /// e.g.:
21535 /// `organizations/123/simulations/456/valuedResources/789`
21536 pub name: std::string::String,
21537
21538 /// The
21539 /// [full resource
21540 /// name](https://cloud.google.com/apis/design/resource_names#full_resource_name)
21541 /// of the valued resource.
21542 pub resource: std::string::String,
21543
21544 /// The [resource
21545 /// type](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
21546 /// of the valued resource.
21547 pub resource_type: std::string::String,
21548
21549 /// Human-readable name of the valued resource.
21550 pub display_name: std::string::String,
21551
21552 /// How valuable this resource is.
21553 pub resource_value: crate::model::valued_resource::ResourceValue,
21554
21555 /// Exposed score for this valued resource. A value of 0 means no exposure was
21556 /// detected exposure.
21557 pub exposed_score: f64,
21558
21559 /// List of resource value configurations' metadata used to determine the value
21560 /// of this resource. Maximum of 100.
21561 pub resource_value_configs_used: std::vec::Vec<crate::model::ResourceValueConfigMetadata>,
21562
21563 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21564}
21565
21566impl ValuedResource {
21567 pub fn new() -> Self {
21568 std::default::Default::default()
21569 }
21570
21571 /// Sets the value of [name][crate::model::ValuedResource::name].
21572 ///
21573 /// # Example
21574 /// ```ignore,no_run
21575 /// # use google_cloud_securitycenter_v2::model::ValuedResource;
21576 /// let x = ValuedResource::new().set_name("example");
21577 /// ```
21578 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21579 self.name = v.into();
21580 self
21581 }
21582
21583 /// Sets the value of [resource][crate::model::ValuedResource::resource].
21584 ///
21585 /// # Example
21586 /// ```ignore,no_run
21587 /// # use google_cloud_securitycenter_v2::model::ValuedResource;
21588 /// let x = ValuedResource::new().set_resource("example");
21589 /// ```
21590 pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21591 self.resource = v.into();
21592 self
21593 }
21594
21595 /// Sets the value of [resource_type][crate::model::ValuedResource::resource_type].
21596 ///
21597 /// # Example
21598 /// ```ignore,no_run
21599 /// # use google_cloud_securitycenter_v2::model::ValuedResource;
21600 /// let x = ValuedResource::new().set_resource_type("example");
21601 /// ```
21602 pub fn set_resource_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21603 self.resource_type = v.into();
21604 self
21605 }
21606
21607 /// Sets the value of [display_name][crate::model::ValuedResource::display_name].
21608 ///
21609 /// # Example
21610 /// ```ignore,no_run
21611 /// # use google_cloud_securitycenter_v2::model::ValuedResource;
21612 /// let x = ValuedResource::new().set_display_name("example");
21613 /// ```
21614 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21615 self.display_name = v.into();
21616 self
21617 }
21618
21619 /// Sets the value of [resource_value][crate::model::ValuedResource::resource_value].
21620 ///
21621 /// # Example
21622 /// ```ignore,no_run
21623 /// # use google_cloud_securitycenter_v2::model::ValuedResource;
21624 /// use google_cloud_securitycenter_v2::model::valued_resource::ResourceValue;
21625 /// let x0 = ValuedResource::new().set_resource_value(ResourceValue::Low);
21626 /// let x1 = ValuedResource::new().set_resource_value(ResourceValue::Medium);
21627 /// let x2 = ValuedResource::new().set_resource_value(ResourceValue::High);
21628 /// ```
21629 pub fn set_resource_value<
21630 T: std::convert::Into<crate::model::valued_resource::ResourceValue>,
21631 >(
21632 mut self,
21633 v: T,
21634 ) -> Self {
21635 self.resource_value = v.into();
21636 self
21637 }
21638
21639 /// Sets the value of [exposed_score][crate::model::ValuedResource::exposed_score].
21640 ///
21641 /// # Example
21642 /// ```ignore,no_run
21643 /// # use google_cloud_securitycenter_v2::model::ValuedResource;
21644 /// let x = ValuedResource::new().set_exposed_score(42.0);
21645 /// ```
21646 pub fn set_exposed_score<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
21647 self.exposed_score = v.into();
21648 self
21649 }
21650
21651 /// Sets the value of [resource_value_configs_used][crate::model::ValuedResource::resource_value_configs_used].
21652 ///
21653 /// # Example
21654 /// ```ignore,no_run
21655 /// # use google_cloud_securitycenter_v2::model::ValuedResource;
21656 /// use google_cloud_securitycenter_v2::model::ResourceValueConfigMetadata;
21657 /// let x = ValuedResource::new()
21658 /// .set_resource_value_configs_used([
21659 /// ResourceValueConfigMetadata::default()/* use setters */,
21660 /// ResourceValueConfigMetadata::default()/* use (different) setters */,
21661 /// ]);
21662 /// ```
21663 pub fn set_resource_value_configs_used<T, V>(mut self, v: T) -> Self
21664 where
21665 T: std::iter::IntoIterator<Item = V>,
21666 V: std::convert::Into<crate::model::ResourceValueConfigMetadata>,
21667 {
21668 use std::iter::Iterator;
21669 self.resource_value_configs_used = v.into_iter().map(|i| i.into()).collect();
21670 self
21671 }
21672}
21673
21674impl wkt::message::Message for ValuedResource {
21675 fn typename() -> &'static str {
21676 "type.googleapis.com/google.cloud.securitycenter.v2.ValuedResource"
21677 }
21678}
21679
21680/// Defines additional types related to [ValuedResource].
21681pub mod valued_resource {
21682 #[allow(unused_imports)]
21683 use super::*;
21684
21685 /// How valuable the resource is.
21686 ///
21687 /// # Working with unknown values
21688 ///
21689 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
21690 /// additional enum variants at any time. Adding new variants is not considered
21691 /// a breaking change. Applications should write their code in anticipation of:
21692 ///
21693 /// - New values appearing in future releases of the client library, **and**
21694 /// - New values received dynamically, without application changes.
21695 ///
21696 /// Please consult the [Working with enums] section in the user guide for some
21697 /// guidelines.
21698 ///
21699 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
21700 #[derive(Clone, Debug, PartialEq)]
21701 #[non_exhaustive]
21702 pub enum ResourceValue {
21703 /// The resource value isn't specified.
21704 Unspecified,
21705 /// This is a low-value resource.
21706 Low,
21707 /// This is a medium-value resource.
21708 Medium,
21709 /// This is a high-value resource.
21710 High,
21711 /// If set, the enum was initialized with an unknown value.
21712 ///
21713 /// Applications can examine the value using [ResourceValue::value] or
21714 /// [ResourceValue::name].
21715 UnknownValue(resource_value::UnknownValue),
21716 }
21717
21718 #[doc(hidden)]
21719 pub mod resource_value {
21720 #[allow(unused_imports)]
21721 use super::*;
21722 #[derive(Clone, Debug, PartialEq)]
21723 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
21724 }
21725
21726 impl ResourceValue {
21727 /// Gets the enum value.
21728 ///
21729 /// Returns `None` if the enum contains an unknown value deserialized from
21730 /// the string representation of enums.
21731 pub fn value(&self) -> std::option::Option<i32> {
21732 match self {
21733 Self::Unspecified => std::option::Option::Some(0),
21734 Self::Low => std::option::Option::Some(1),
21735 Self::Medium => std::option::Option::Some(2),
21736 Self::High => std::option::Option::Some(3),
21737 Self::UnknownValue(u) => u.0.value(),
21738 }
21739 }
21740
21741 /// Gets the enum value as a string.
21742 ///
21743 /// Returns `None` if the enum contains an unknown value deserialized from
21744 /// the integer representation of enums.
21745 pub fn name(&self) -> std::option::Option<&str> {
21746 match self {
21747 Self::Unspecified => std::option::Option::Some("RESOURCE_VALUE_UNSPECIFIED"),
21748 Self::Low => std::option::Option::Some("RESOURCE_VALUE_LOW"),
21749 Self::Medium => std::option::Option::Some("RESOURCE_VALUE_MEDIUM"),
21750 Self::High => std::option::Option::Some("RESOURCE_VALUE_HIGH"),
21751 Self::UnknownValue(u) => u.0.name(),
21752 }
21753 }
21754 }
21755
21756 impl std::default::Default for ResourceValue {
21757 fn default() -> Self {
21758 use std::convert::From;
21759 Self::from(0)
21760 }
21761 }
21762
21763 impl std::fmt::Display for ResourceValue {
21764 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
21765 wkt::internal::display_enum(f, self.name(), self.value())
21766 }
21767 }
21768
21769 impl std::convert::From<i32> for ResourceValue {
21770 fn from(value: i32) -> Self {
21771 match value {
21772 0 => Self::Unspecified,
21773 1 => Self::Low,
21774 2 => Self::Medium,
21775 3 => Self::High,
21776 _ => Self::UnknownValue(resource_value::UnknownValue(
21777 wkt::internal::UnknownEnumValue::Integer(value),
21778 )),
21779 }
21780 }
21781 }
21782
21783 impl std::convert::From<&str> for ResourceValue {
21784 fn from(value: &str) -> Self {
21785 use std::string::ToString;
21786 match value {
21787 "RESOURCE_VALUE_UNSPECIFIED" => Self::Unspecified,
21788 "RESOURCE_VALUE_LOW" => Self::Low,
21789 "RESOURCE_VALUE_MEDIUM" => Self::Medium,
21790 "RESOURCE_VALUE_HIGH" => Self::High,
21791 _ => Self::UnknownValue(resource_value::UnknownValue(
21792 wkt::internal::UnknownEnumValue::String(value.to_string()),
21793 )),
21794 }
21795 }
21796 }
21797
21798 impl serde::ser::Serialize for ResourceValue {
21799 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21800 where
21801 S: serde::Serializer,
21802 {
21803 match self {
21804 Self::Unspecified => serializer.serialize_i32(0),
21805 Self::Low => serializer.serialize_i32(1),
21806 Self::Medium => serializer.serialize_i32(2),
21807 Self::High => serializer.serialize_i32(3),
21808 Self::UnknownValue(u) => u.0.serialize(serializer),
21809 }
21810 }
21811 }
21812
21813 impl<'de> serde::de::Deserialize<'de> for ResourceValue {
21814 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21815 where
21816 D: serde::Deserializer<'de>,
21817 {
21818 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResourceValue>::new(
21819 ".google.cloud.securitycenter.v2.ValuedResource.ResourceValue",
21820 ))
21821 }
21822 }
21823}
21824
21825/// Metadata about a ResourceValueConfig. For example, id and name.
21826#[derive(Clone, Default, PartialEq)]
21827#[non_exhaustive]
21828pub struct ResourceValueConfigMetadata {
21829 /// Resource value config name
21830 pub name: std::string::String,
21831
21832 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21833}
21834
21835impl ResourceValueConfigMetadata {
21836 pub fn new() -> Self {
21837 std::default::Default::default()
21838 }
21839
21840 /// Sets the value of [name][crate::model::ResourceValueConfigMetadata::name].
21841 ///
21842 /// # Example
21843 /// ```ignore,no_run
21844 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfigMetadata;
21845 /// let x = ResourceValueConfigMetadata::new().set_name("example");
21846 /// ```
21847 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21848 self.name = v.into();
21849 self
21850 }
21851}
21852
21853impl wkt::message::Message for ResourceValueConfigMetadata {
21854 fn typename() -> &'static str {
21855 "type.googleapis.com/google.cloud.securitycenter.v2.ResourceValueConfigMetadata"
21856 }
21857}
21858
21859/// Vertex AI-related information associated with the finding.
21860#[derive(Clone, Default, PartialEq)]
21861#[non_exhaustive]
21862pub struct VertexAi {
21863 /// Datasets associated with the finding.
21864 pub datasets: std::vec::Vec<crate::model::vertex_ai::Dataset>,
21865
21866 /// Pipelines associated with the finding.
21867 pub pipelines: std::vec::Vec<crate::model::vertex_ai::Pipeline>,
21868
21869 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21870}
21871
21872impl VertexAi {
21873 pub fn new() -> Self {
21874 std::default::Default::default()
21875 }
21876
21877 /// Sets the value of [datasets][crate::model::VertexAi::datasets].
21878 ///
21879 /// # Example
21880 /// ```ignore,no_run
21881 /// # use google_cloud_securitycenter_v2::model::VertexAi;
21882 /// use google_cloud_securitycenter_v2::model::vertex_ai::Dataset;
21883 /// let x = VertexAi::new()
21884 /// .set_datasets([
21885 /// Dataset::default()/* use setters */,
21886 /// Dataset::default()/* use (different) setters */,
21887 /// ]);
21888 /// ```
21889 pub fn set_datasets<T, V>(mut self, v: T) -> Self
21890 where
21891 T: std::iter::IntoIterator<Item = V>,
21892 V: std::convert::Into<crate::model::vertex_ai::Dataset>,
21893 {
21894 use std::iter::Iterator;
21895 self.datasets = v.into_iter().map(|i| i.into()).collect();
21896 self
21897 }
21898
21899 /// Sets the value of [pipelines][crate::model::VertexAi::pipelines].
21900 ///
21901 /// # Example
21902 /// ```ignore,no_run
21903 /// # use google_cloud_securitycenter_v2::model::VertexAi;
21904 /// use google_cloud_securitycenter_v2::model::vertex_ai::Pipeline;
21905 /// let x = VertexAi::new()
21906 /// .set_pipelines([
21907 /// Pipeline::default()/* use setters */,
21908 /// Pipeline::default()/* use (different) setters */,
21909 /// ]);
21910 /// ```
21911 pub fn set_pipelines<T, V>(mut self, v: T) -> Self
21912 where
21913 T: std::iter::IntoIterator<Item = V>,
21914 V: std::convert::Into<crate::model::vertex_ai::Pipeline>,
21915 {
21916 use std::iter::Iterator;
21917 self.pipelines = v.into_iter().map(|i| i.into()).collect();
21918 self
21919 }
21920}
21921
21922impl wkt::message::Message for VertexAi {
21923 fn typename() -> &'static str {
21924 "type.googleapis.com/google.cloud.securitycenter.v2.VertexAi"
21925 }
21926}
21927
21928/// Defines additional types related to [VertexAi].
21929pub mod vertex_ai {
21930 #[allow(unused_imports)]
21931 use super::*;
21932
21933 /// Vertex AI dataset associated with the finding.
21934 #[derive(Clone, Default, PartialEq)]
21935 #[non_exhaustive]
21936 pub struct Dataset {
21937 /// Resource name of the dataset, e.g.
21938 /// projects/{project}/locations/{location}/datasets/2094040236064505856
21939 pub name: std::string::String,
21940
21941 /// The user defined display name of dataset, e.g. plants-dataset
21942 pub display_name: std::string::String,
21943
21944 /// Data source, such as a BigQuery source URI, e.g.
21945 /// bq://scc-nexus-test.AIPPtest.gsod
21946 pub source: std::string::String,
21947
21948 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21949 }
21950
21951 impl Dataset {
21952 pub fn new() -> Self {
21953 std::default::Default::default()
21954 }
21955
21956 /// Sets the value of [name][crate::model::vertex_ai::Dataset::name].
21957 ///
21958 /// # Example
21959 /// ```ignore,no_run
21960 /// # use google_cloud_securitycenter_v2::model::vertex_ai::Dataset;
21961 /// let x = Dataset::new().set_name("example");
21962 /// ```
21963 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21964 self.name = v.into();
21965 self
21966 }
21967
21968 /// Sets the value of [display_name][crate::model::vertex_ai::Dataset::display_name].
21969 ///
21970 /// # Example
21971 /// ```ignore,no_run
21972 /// # use google_cloud_securitycenter_v2::model::vertex_ai::Dataset;
21973 /// let x = Dataset::new().set_display_name("example");
21974 /// ```
21975 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
21976 mut self,
21977 v: T,
21978 ) -> Self {
21979 self.display_name = v.into();
21980 self
21981 }
21982
21983 /// Sets the value of [source][crate::model::vertex_ai::Dataset::source].
21984 ///
21985 /// # Example
21986 /// ```ignore,no_run
21987 /// # use google_cloud_securitycenter_v2::model::vertex_ai::Dataset;
21988 /// let x = Dataset::new().set_source("example");
21989 /// ```
21990 pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21991 self.source = v.into();
21992 self
21993 }
21994 }
21995
21996 impl wkt::message::Message for Dataset {
21997 fn typename() -> &'static str {
21998 "type.googleapis.com/google.cloud.securitycenter.v2.VertexAi.Dataset"
21999 }
22000 }
22001
22002 /// Vertex AI training pipeline associated with the finding.
22003 #[derive(Clone, Default, PartialEq)]
22004 #[non_exhaustive]
22005 pub struct Pipeline {
22006 /// Resource name of the pipeline, e.g.
22007 /// projects/{project}/locations/{location}/trainingPipelines/5253428229225578496
22008 pub name: std::string::String,
22009
22010 /// The user-defined display name of pipeline, e.g. plants-classification
22011 pub display_name: std::string::String,
22012
22013 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22014 }
22015
22016 impl Pipeline {
22017 pub fn new() -> Self {
22018 std::default::Default::default()
22019 }
22020
22021 /// Sets the value of [name][crate::model::vertex_ai::Pipeline::name].
22022 ///
22023 /// # Example
22024 /// ```ignore,no_run
22025 /// # use google_cloud_securitycenter_v2::model::vertex_ai::Pipeline;
22026 /// let x = Pipeline::new().set_name("example");
22027 /// ```
22028 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22029 self.name = v.into();
22030 self
22031 }
22032
22033 /// Sets the value of [display_name][crate::model::vertex_ai::Pipeline::display_name].
22034 ///
22035 /// # Example
22036 /// ```ignore,no_run
22037 /// # use google_cloud_securitycenter_v2::model::vertex_ai::Pipeline;
22038 /// let x = Pipeline::new().set_display_name("example");
22039 /// ```
22040 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
22041 mut self,
22042 v: T,
22043 ) -> Self {
22044 self.display_name = v.into();
22045 self
22046 }
22047 }
22048
22049 impl wkt::message::Message for Pipeline {
22050 fn typename() -> &'static str {
22051 "type.googleapis.com/google.cloud.securitycenter.v2.VertexAi.Pipeline"
22052 }
22053 }
22054}
22055
22056/// Refers to common vulnerability fields e.g. cve, cvss, cwe etc.
22057#[derive(Clone, Default, PartialEq)]
22058#[non_exhaustive]
22059pub struct Vulnerability {
22060 /// CVE stands for Common Vulnerabilities and Exposures
22061 /// (<https://cve.mitre.org/about/>)
22062 pub cve: std::option::Option<crate::model::Cve>,
22063
22064 /// The offending package is relevant to the finding.
22065 pub offending_package: std::option::Option<crate::model::Package>,
22066
22067 /// The fixed package is relevant to the finding.
22068 pub fixed_package: std::option::Option<crate::model::Package>,
22069
22070 /// The security bulletin is relevant to this finding.
22071 pub security_bulletin: std::option::Option<crate::model::SecurityBulletin>,
22072
22073 /// Provider provided risk_score based on multiple factors. The higher the risk
22074 /// score, the more risky the vulnerability is.
22075 pub provider_risk_score: i64,
22076
22077 /// Represents whether the vulnerability is reachable (detected via static
22078 /// analysis)
22079 pub reachable: bool,
22080
22081 /// Represents one or more Common Weakness Enumeration (CWE) information on
22082 /// this vulnerability.
22083 pub cwes: std::vec::Vec<crate::model::Cwe>,
22084
22085 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22086}
22087
22088impl Vulnerability {
22089 pub fn new() -> Self {
22090 std::default::Default::default()
22091 }
22092
22093 /// Sets the value of [cve][crate::model::Vulnerability::cve].
22094 ///
22095 /// # Example
22096 /// ```ignore,no_run
22097 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22098 /// use google_cloud_securitycenter_v2::model::Cve;
22099 /// let x = Vulnerability::new().set_cve(Cve::default()/* use setters */);
22100 /// ```
22101 pub fn set_cve<T>(mut self, v: T) -> Self
22102 where
22103 T: std::convert::Into<crate::model::Cve>,
22104 {
22105 self.cve = std::option::Option::Some(v.into());
22106 self
22107 }
22108
22109 /// Sets or clears the value of [cve][crate::model::Vulnerability::cve].
22110 ///
22111 /// # Example
22112 /// ```ignore,no_run
22113 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22114 /// use google_cloud_securitycenter_v2::model::Cve;
22115 /// let x = Vulnerability::new().set_or_clear_cve(Some(Cve::default()/* use setters */));
22116 /// let x = Vulnerability::new().set_or_clear_cve(None::<Cve>);
22117 /// ```
22118 pub fn set_or_clear_cve<T>(mut self, v: std::option::Option<T>) -> Self
22119 where
22120 T: std::convert::Into<crate::model::Cve>,
22121 {
22122 self.cve = v.map(|x| x.into());
22123 self
22124 }
22125
22126 /// Sets the value of [offending_package][crate::model::Vulnerability::offending_package].
22127 ///
22128 /// # Example
22129 /// ```ignore,no_run
22130 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22131 /// use google_cloud_securitycenter_v2::model::Package;
22132 /// let x = Vulnerability::new().set_offending_package(Package::default()/* use setters */);
22133 /// ```
22134 pub fn set_offending_package<T>(mut self, v: T) -> Self
22135 where
22136 T: std::convert::Into<crate::model::Package>,
22137 {
22138 self.offending_package = std::option::Option::Some(v.into());
22139 self
22140 }
22141
22142 /// Sets or clears the value of [offending_package][crate::model::Vulnerability::offending_package].
22143 ///
22144 /// # Example
22145 /// ```ignore,no_run
22146 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22147 /// use google_cloud_securitycenter_v2::model::Package;
22148 /// let x = Vulnerability::new().set_or_clear_offending_package(Some(Package::default()/* use setters */));
22149 /// let x = Vulnerability::new().set_or_clear_offending_package(None::<Package>);
22150 /// ```
22151 pub fn set_or_clear_offending_package<T>(mut self, v: std::option::Option<T>) -> Self
22152 where
22153 T: std::convert::Into<crate::model::Package>,
22154 {
22155 self.offending_package = v.map(|x| x.into());
22156 self
22157 }
22158
22159 /// Sets the value of [fixed_package][crate::model::Vulnerability::fixed_package].
22160 ///
22161 /// # Example
22162 /// ```ignore,no_run
22163 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22164 /// use google_cloud_securitycenter_v2::model::Package;
22165 /// let x = Vulnerability::new().set_fixed_package(Package::default()/* use setters */);
22166 /// ```
22167 pub fn set_fixed_package<T>(mut self, v: T) -> Self
22168 where
22169 T: std::convert::Into<crate::model::Package>,
22170 {
22171 self.fixed_package = std::option::Option::Some(v.into());
22172 self
22173 }
22174
22175 /// Sets or clears the value of [fixed_package][crate::model::Vulnerability::fixed_package].
22176 ///
22177 /// # Example
22178 /// ```ignore,no_run
22179 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22180 /// use google_cloud_securitycenter_v2::model::Package;
22181 /// let x = Vulnerability::new().set_or_clear_fixed_package(Some(Package::default()/* use setters */));
22182 /// let x = Vulnerability::new().set_or_clear_fixed_package(None::<Package>);
22183 /// ```
22184 pub fn set_or_clear_fixed_package<T>(mut self, v: std::option::Option<T>) -> Self
22185 where
22186 T: std::convert::Into<crate::model::Package>,
22187 {
22188 self.fixed_package = v.map(|x| x.into());
22189 self
22190 }
22191
22192 /// Sets the value of [security_bulletin][crate::model::Vulnerability::security_bulletin].
22193 ///
22194 /// # Example
22195 /// ```ignore,no_run
22196 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22197 /// use google_cloud_securitycenter_v2::model::SecurityBulletin;
22198 /// let x = Vulnerability::new().set_security_bulletin(SecurityBulletin::default()/* use setters */);
22199 /// ```
22200 pub fn set_security_bulletin<T>(mut self, v: T) -> Self
22201 where
22202 T: std::convert::Into<crate::model::SecurityBulletin>,
22203 {
22204 self.security_bulletin = std::option::Option::Some(v.into());
22205 self
22206 }
22207
22208 /// Sets or clears the value of [security_bulletin][crate::model::Vulnerability::security_bulletin].
22209 ///
22210 /// # Example
22211 /// ```ignore,no_run
22212 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22213 /// use google_cloud_securitycenter_v2::model::SecurityBulletin;
22214 /// let x = Vulnerability::new().set_or_clear_security_bulletin(Some(SecurityBulletin::default()/* use setters */));
22215 /// let x = Vulnerability::new().set_or_clear_security_bulletin(None::<SecurityBulletin>);
22216 /// ```
22217 pub fn set_or_clear_security_bulletin<T>(mut self, v: std::option::Option<T>) -> Self
22218 where
22219 T: std::convert::Into<crate::model::SecurityBulletin>,
22220 {
22221 self.security_bulletin = v.map(|x| x.into());
22222 self
22223 }
22224
22225 /// Sets the value of [provider_risk_score][crate::model::Vulnerability::provider_risk_score].
22226 ///
22227 /// # Example
22228 /// ```ignore,no_run
22229 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22230 /// let x = Vulnerability::new().set_provider_risk_score(42);
22231 /// ```
22232 pub fn set_provider_risk_score<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
22233 self.provider_risk_score = v.into();
22234 self
22235 }
22236
22237 /// Sets the value of [reachable][crate::model::Vulnerability::reachable].
22238 ///
22239 /// # Example
22240 /// ```ignore,no_run
22241 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22242 /// let x = Vulnerability::new().set_reachable(true);
22243 /// ```
22244 pub fn set_reachable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
22245 self.reachable = v.into();
22246 self
22247 }
22248
22249 /// Sets the value of [cwes][crate::model::Vulnerability::cwes].
22250 ///
22251 /// # Example
22252 /// ```ignore,no_run
22253 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22254 /// use google_cloud_securitycenter_v2::model::Cwe;
22255 /// let x = Vulnerability::new()
22256 /// .set_cwes([
22257 /// Cwe::default()/* use setters */,
22258 /// Cwe::default()/* use (different) setters */,
22259 /// ]);
22260 /// ```
22261 pub fn set_cwes<T, V>(mut self, v: T) -> Self
22262 where
22263 T: std::iter::IntoIterator<Item = V>,
22264 V: std::convert::Into<crate::model::Cwe>,
22265 {
22266 use std::iter::Iterator;
22267 self.cwes = v.into_iter().map(|i| i.into()).collect();
22268 self
22269 }
22270}
22271
22272impl wkt::message::Message for Vulnerability {
22273 fn typename() -> &'static str {
22274 "type.googleapis.com/google.cloud.securitycenter.v2.Vulnerability"
22275 }
22276}
22277
22278/// CVE stands for Common Vulnerabilities and Exposures.
22279/// Information from the [CVE
22280/// record](https://www.cve.org/ResourcesSupport/Glossary) that describes this
22281/// vulnerability.
22282#[derive(Clone, Default, PartialEq)]
22283#[non_exhaustive]
22284pub struct Cve {
22285 /// The unique identifier for the vulnerability. e.g. CVE-2021-34527
22286 pub id: std::string::String,
22287
22288 /// Additional information about the CVE.
22289 /// e.g. <https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-34527>
22290 pub references: std::vec::Vec<crate::model::Reference>,
22291
22292 /// Describe Common Vulnerability Scoring System specified at
22293 /// <https://www.first.org/cvss/v3.1/specification-document>
22294 pub cvssv3: std::option::Option<crate::model::Cvssv3>,
22295
22296 /// Whether upstream fix is available for the CVE.
22297 pub upstream_fix_available: bool,
22298
22299 /// The potential impact of the vulnerability if it was to be exploited.
22300 pub impact: crate::model::cve::RiskRating,
22301
22302 /// The exploitation activity of the vulnerability in the wild.
22303 pub exploitation_activity: crate::model::cve::ExploitationActivity,
22304
22305 /// Whether or not the vulnerability has been observed in the wild.
22306 pub observed_in_the_wild: bool,
22307
22308 /// Whether or not the vulnerability was zero day when the finding was
22309 /// published.
22310 pub zero_day: bool,
22311
22312 /// Date the first publicly available exploit or PoC was released.
22313 pub exploit_release_date: std::option::Option<wkt::Timestamp>,
22314
22315 /// Date of the earliest known exploitation.
22316 pub first_exploitation_date: std::option::Option<wkt::Timestamp>,
22317
22318 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22319}
22320
22321impl Cve {
22322 pub fn new() -> Self {
22323 std::default::Default::default()
22324 }
22325
22326 /// Sets the value of [id][crate::model::Cve::id].
22327 ///
22328 /// # Example
22329 /// ```ignore,no_run
22330 /// # use google_cloud_securitycenter_v2::model::Cve;
22331 /// let x = Cve::new().set_id("example");
22332 /// ```
22333 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22334 self.id = v.into();
22335 self
22336 }
22337
22338 /// Sets the value of [references][crate::model::Cve::references].
22339 ///
22340 /// # Example
22341 /// ```ignore,no_run
22342 /// # use google_cloud_securitycenter_v2::model::Cve;
22343 /// use google_cloud_securitycenter_v2::model::Reference;
22344 /// let x = Cve::new()
22345 /// .set_references([
22346 /// Reference::default()/* use setters */,
22347 /// Reference::default()/* use (different) setters */,
22348 /// ]);
22349 /// ```
22350 pub fn set_references<T, V>(mut self, v: T) -> Self
22351 where
22352 T: std::iter::IntoIterator<Item = V>,
22353 V: std::convert::Into<crate::model::Reference>,
22354 {
22355 use std::iter::Iterator;
22356 self.references = v.into_iter().map(|i| i.into()).collect();
22357 self
22358 }
22359
22360 /// Sets the value of [cvssv3][crate::model::Cve::cvssv3].
22361 ///
22362 /// # Example
22363 /// ```ignore,no_run
22364 /// # use google_cloud_securitycenter_v2::model::Cve;
22365 /// use google_cloud_securitycenter_v2::model::Cvssv3;
22366 /// let x = Cve::new().set_cvssv3(Cvssv3::default()/* use setters */);
22367 /// ```
22368 pub fn set_cvssv3<T>(mut self, v: T) -> Self
22369 where
22370 T: std::convert::Into<crate::model::Cvssv3>,
22371 {
22372 self.cvssv3 = std::option::Option::Some(v.into());
22373 self
22374 }
22375
22376 /// Sets or clears the value of [cvssv3][crate::model::Cve::cvssv3].
22377 ///
22378 /// # Example
22379 /// ```ignore,no_run
22380 /// # use google_cloud_securitycenter_v2::model::Cve;
22381 /// use google_cloud_securitycenter_v2::model::Cvssv3;
22382 /// let x = Cve::new().set_or_clear_cvssv3(Some(Cvssv3::default()/* use setters */));
22383 /// let x = Cve::new().set_or_clear_cvssv3(None::<Cvssv3>);
22384 /// ```
22385 pub fn set_or_clear_cvssv3<T>(mut self, v: std::option::Option<T>) -> Self
22386 where
22387 T: std::convert::Into<crate::model::Cvssv3>,
22388 {
22389 self.cvssv3 = v.map(|x| x.into());
22390 self
22391 }
22392
22393 /// Sets the value of [upstream_fix_available][crate::model::Cve::upstream_fix_available].
22394 ///
22395 /// # Example
22396 /// ```ignore,no_run
22397 /// # use google_cloud_securitycenter_v2::model::Cve;
22398 /// let x = Cve::new().set_upstream_fix_available(true);
22399 /// ```
22400 pub fn set_upstream_fix_available<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
22401 self.upstream_fix_available = v.into();
22402 self
22403 }
22404
22405 /// Sets the value of [impact][crate::model::Cve::impact].
22406 ///
22407 /// # Example
22408 /// ```ignore,no_run
22409 /// # use google_cloud_securitycenter_v2::model::Cve;
22410 /// use google_cloud_securitycenter_v2::model::cve::RiskRating;
22411 /// let x0 = Cve::new().set_impact(RiskRating::Low);
22412 /// let x1 = Cve::new().set_impact(RiskRating::Medium);
22413 /// let x2 = Cve::new().set_impact(RiskRating::High);
22414 /// ```
22415 pub fn set_impact<T: std::convert::Into<crate::model::cve::RiskRating>>(
22416 mut self,
22417 v: T,
22418 ) -> Self {
22419 self.impact = v.into();
22420 self
22421 }
22422
22423 /// Sets the value of [exploitation_activity][crate::model::Cve::exploitation_activity].
22424 ///
22425 /// # Example
22426 /// ```ignore,no_run
22427 /// # use google_cloud_securitycenter_v2::model::Cve;
22428 /// use google_cloud_securitycenter_v2::model::cve::ExploitationActivity;
22429 /// let x0 = Cve::new().set_exploitation_activity(ExploitationActivity::Wide);
22430 /// let x1 = Cve::new().set_exploitation_activity(ExploitationActivity::Confirmed);
22431 /// let x2 = Cve::new().set_exploitation_activity(ExploitationActivity::Available);
22432 /// ```
22433 pub fn set_exploitation_activity<
22434 T: std::convert::Into<crate::model::cve::ExploitationActivity>,
22435 >(
22436 mut self,
22437 v: T,
22438 ) -> Self {
22439 self.exploitation_activity = v.into();
22440 self
22441 }
22442
22443 /// Sets the value of [observed_in_the_wild][crate::model::Cve::observed_in_the_wild].
22444 ///
22445 /// # Example
22446 /// ```ignore,no_run
22447 /// # use google_cloud_securitycenter_v2::model::Cve;
22448 /// let x = Cve::new().set_observed_in_the_wild(true);
22449 /// ```
22450 pub fn set_observed_in_the_wild<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
22451 self.observed_in_the_wild = v.into();
22452 self
22453 }
22454
22455 /// Sets the value of [zero_day][crate::model::Cve::zero_day].
22456 ///
22457 /// # Example
22458 /// ```ignore,no_run
22459 /// # use google_cloud_securitycenter_v2::model::Cve;
22460 /// let x = Cve::new().set_zero_day(true);
22461 /// ```
22462 pub fn set_zero_day<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
22463 self.zero_day = v.into();
22464 self
22465 }
22466
22467 /// Sets the value of [exploit_release_date][crate::model::Cve::exploit_release_date].
22468 ///
22469 /// # Example
22470 /// ```ignore,no_run
22471 /// # use google_cloud_securitycenter_v2::model::Cve;
22472 /// use wkt::Timestamp;
22473 /// let x = Cve::new().set_exploit_release_date(Timestamp::default()/* use setters */);
22474 /// ```
22475 pub fn set_exploit_release_date<T>(mut self, v: T) -> Self
22476 where
22477 T: std::convert::Into<wkt::Timestamp>,
22478 {
22479 self.exploit_release_date = std::option::Option::Some(v.into());
22480 self
22481 }
22482
22483 /// Sets or clears the value of [exploit_release_date][crate::model::Cve::exploit_release_date].
22484 ///
22485 /// # Example
22486 /// ```ignore,no_run
22487 /// # use google_cloud_securitycenter_v2::model::Cve;
22488 /// use wkt::Timestamp;
22489 /// let x = Cve::new().set_or_clear_exploit_release_date(Some(Timestamp::default()/* use setters */));
22490 /// let x = Cve::new().set_or_clear_exploit_release_date(None::<Timestamp>);
22491 /// ```
22492 pub fn set_or_clear_exploit_release_date<T>(mut self, v: std::option::Option<T>) -> Self
22493 where
22494 T: std::convert::Into<wkt::Timestamp>,
22495 {
22496 self.exploit_release_date = v.map(|x| x.into());
22497 self
22498 }
22499
22500 /// Sets the value of [first_exploitation_date][crate::model::Cve::first_exploitation_date].
22501 ///
22502 /// # Example
22503 /// ```ignore,no_run
22504 /// # use google_cloud_securitycenter_v2::model::Cve;
22505 /// use wkt::Timestamp;
22506 /// let x = Cve::new().set_first_exploitation_date(Timestamp::default()/* use setters */);
22507 /// ```
22508 pub fn set_first_exploitation_date<T>(mut self, v: T) -> Self
22509 where
22510 T: std::convert::Into<wkt::Timestamp>,
22511 {
22512 self.first_exploitation_date = std::option::Option::Some(v.into());
22513 self
22514 }
22515
22516 /// Sets or clears the value of [first_exploitation_date][crate::model::Cve::first_exploitation_date].
22517 ///
22518 /// # Example
22519 /// ```ignore,no_run
22520 /// # use google_cloud_securitycenter_v2::model::Cve;
22521 /// use wkt::Timestamp;
22522 /// let x = Cve::new().set_or_clear_first_exploitation_date(Some(Timestamp::default()/* use setters */));
22523 /// let x = Cve::new().set_or_clear_first_exploitation_date(None::<Timestamp>);
22524 /// ```
22525 pub fn set_or_clear_first_exploitation_date<T>(mut self, v: std::option::Option<T>) -> Self
22526 where
22527 T: std::convert::Into<wkt::Timestamp>,
22528 {
22529 self.first_exploitation_date = v.map(|x| x.into());
22530 self
22531 }
22532}
22533
22534impl wkt::message::Message for Cve {
22535 fn typename() -> &'static str {
22536 "type.googleapis.com/google.cloud.securitycenter.v2.Cve"
22537 }
22538}
22539
22540/// Defines additional types related to [Cve].
22541pub mod cve {
22542 #[allow(unused_imports)]
22543 use super::*;
22544
22545 /// The possible values of impact of the vulnerability if it was to be
22546 /// exploited.
22547 ///
22548 /// # Working with unknown values
22549 ///
22550 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22551 /// additional enum variants at any time. Adding new variants is not considered
22552 /// a breaking change. Applications should write their code in anticipation of:
22553 ///
22554 /// - New values appearing in future releases of the client library, **and**
22555 /// - New values received dynamically, without application changes.
22556 ///
22557 /// Please consult the [Working with enums] section in the user guide for some
22558 /// guidelines.
22559 ///
22560 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
22561 #[derive(Clone, Debug, PartialEq)]
22562 #[non_exhaustive]
22563 pub enum RiskRating {
22564 /// Invalid or empty value.
22565 Unspecified,
22566 /// Exploitation would have little to no security impact.
22567 Low,
22568 /// Exploitation would enable attackers to perform activities, or could allow
22569 /// attackers to have a direct impact, but would require additional steps.
22570 Medium,
22571 /// Exploitation would enable attackers to have a notable direct impact
22572 /// without needing to overcome any major mitigating factors.
22573 High,
22574 /// Exploitation would fundamentally undermine the security of affected
22575 /// systems, enable actors to perform significant attacks with minimal
22576 /// effort, with little to no mitigating factors to overcome.
22577 Critical,
22578 /// If set, the enum was initialized with an unknown value.
22579 ///
22580 /// Applications can examine the value using [RiskRating::value] or
22581 /// [RiskRating::name].
22582 UnknownValue(risk_rating::UnknownValue),
22583 }
22584
22585 #[doc(hidden)]
22586 pub mod risk_rating {
22587 #[allow(unused_imports)]
22588 use super::*;
22589 #[derive(Clone, Debug, PartialEq)]
22590 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22591 }
22592
22593 impl RiskRating {
22594 /// Gets the enum value.
22595 ///
22596 /// Returns `None` if the enum contains an unknown value deserialized from
22597 /// the string representation of enums.
22598 pub fn value(&self) -> std::option::Option<i32> {
22599 match self {
22600 Self::Unspecified => std::option::Option::Some(0),
22601 Self::Low => std::option::Option::Some(1),
22602 Self::Medium => std::option::Option::Some(2),
22603 Self::High => std::option::Option::Some(3),
22604 Self::Critical => std::option::Option::Some(4),
22605 Self::UnknownValue(u) => u.0.value(),
22606 }
22607 }
22608
22609 /// Gets the enum value as a string.
22610 ///
22611 /// Returns `None` if the enum contains an unknown value deserialized from
22612 /// the integer representation of enums.
22613 pub fn name(&self) -> std::option::Option<&str> {
22614 match self {
22615 Self::Unspecified => std::option::Option::Some("RISK_RATING_UNSPECIFIED"),
22616 Self::Low => std::option::Option::Some("LOW"),
22617 Self::Medium => std::option::Option::Some("MEDIUM"),
22618 Self::High => std::option::Option::Some("HIGH"),
22619 Self::Critical => std::option::Option::Some("CRITICAL"),
22620 Self::UnknownValue(u) => u.0.name(),
22621 }
22622 }
22623 }
22624
22625 impl std::default::Default for RiskRating {
22626 fn default() -> Self {
22627 use std::convert::From;
22628 Self::from(0)
22629 }
22630 }
22631
22632 impl std::fmt::Display for RiskRating {
22633 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22634 wkt::internal::display_enum(f, self.name(), self.value())
22635 }
22636 }
22637
22638 impl std::convert::From<i32> for RiskRating {
22639 fn from(value: i32) -> Self {
22640 match value {
22641 0 => Self::Unspecified,
22642 1 => Self::Low,
22643 2 => Self::Medium,
22644 3 => Self::High,
22645 4 => Self::Critical,
22646 _ => Self::UnknownValue(risk_rating::UnknownValue(
22647 wkt::internal::UnknownEnumValue::Integer(value),
22648 )),
22649 }
22650 }
22651 }
22652
22653 impl std::convert::From<&str> for RiskRating {
22654 fn from(value: &str) -> Self {
22655 use std::string::ToString;
22656 match value {
22657 "RISK_RATING_UNSPECIFIED" => Self::Unspecified,
22658 "LOW" => Self::Low,
22659 "MEDIUM" => Self::Medium,
22660 "HIGH" => Self::High,
22661 "CRITICAL" => Self::Critical,
22662 _ => Self::UnknownValue(risk_rating::UnknownValue(
22663 wkt::internal::UnknownEnumValue::String(value.to_string()),
22664 )),
22665 }
22666 }
22667 }
22668
22669 impl serde::ser::Serialize for RiskRating {
22670 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22671 where
22672 S: serde::Serializer,
22673 {
22674 match self {
22675 Self::Unspecified => serializer.serialize_i32(0),
22676 Self::Low => serializer.serialize_i32(1),
22677 Self::Medium => serializer.serialize_i32(2),
22678 Self::High => serializer.serialize_i32(3),
22679 Self::Critical => serializer.serialize_i32(4),
22680 Self::UnknownValue(u) => u.0.serialize(serializer),
22681 }
22682 }
22683 }
22684
22685 impl<'de> serde::de::Deserialize<'de> for RiskRating {
22686 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22687 where
22688 D: serde::Deserializer<'de>,
22689 {
22690 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RiskRating>::new(
22691 ".google.cloud.securitycenter.v2.Cve.RiskRating",
22692 ))
22693 }
22694 }
22695
22696 /// The possible values of exploitation activity of the vulnerability in the
22697 /// wild.
22698 ///
22699 /// # Working with unknown values
22700 ///
22701 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22702 /// additional enum variants at any time. Adding new variants is not considered
22703 /// a breaking change. Applications should write their code in anticipation of:
22704 ///
22705 /// - New values appearing in future releases of the client library, **and**
22706 /// - New values received dynamically, without application changes.
22707 ///
22708 /// Please consult the [Working with enums] section in the user guide for some
22709 /// guidelines.
22710 ///
22711 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
22712 #[derive(Clone, Debug, PartialEq)]
22713 #[non_exhaustive]
22714 pub enum ExploitationActivity {
22715 /// Invalid or empty value.
22716 Unspecified,
22717 /// Exploitation has been reported or confirmed to widely occur.
22718 Wide,
22719 /// Limited reported or confirmed exploitation activities.
22720 Confirmed,
22721 /// Exploit is publicly available.
22722 Available,
22723 /// No known exploitation activity, but has a high potential for
22724 /// exploitation.
22725 Anticipated,
22726 /// No known exploitation activity.
22727 NoKnown,
22728 /// If set, the enum was initialized with an unknown value.
22729 ///
22730 /// Applications can examine the value using [ExploitationActivity::value] or
22731 /// [ExploitationActivity::name].
22732 UnknownValue(exploitation_activity::UnknownValue),
22733 }
22734
22735 #[doc(hidden)]
22736 pub mod exploitation_activity {
22737 #[allow(unused_imports)]
22738 use super::*;
22739 #[derive(Clone, Debug, PartialEq)]
22740 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22741 }
22742
22743 impl ExploitationActivity {
22744 /// Gets the enum value.
22745 ///
22746 /// Returns `None` if the enum contains an unknown value deserialized from
22747 /// the string representation of enums.
22748 pub fn value(&self) -> std::option::Option<i32> {
22749 match self {
22750 Self::Unspecified => std::option::Option::Some(0),
22751 Self::Wide => std::option::Option::Some(1),
22752 Self::Confirmed => std::option::Option::Some(2),
22753 Self::Available => std::option::Option::Some(3),
22754 Self::Anticipated => std::option::Option::Some(4),
22755 Self::NoKnown => std::option::Option::Some(5),
22756 Self::UnknownValue(u) => u.0.value(),
22757 }
22758 }
22759
22760 /// Gets the enum value as a string.
22761 ///
22762 /// Returns `None` if the enum contains an unknown value deserialized from
22763 /// the integer representation of enums.
22764 pub fn name(&self) -> std::option::Option<&str> {
22765 match self {
22766 Self::Unspecified => std::option::Option::Some("EXPLOITATION_ACTIVITY_UNSPECIFIED"),
22767 Self::Wide => std::option::Option::Some("WIDE"),
22768 Self::Confirmed => std::option::Option::Some("CONFIRMED"),
22769 Self::Available => std::option::Option::Some("AVAILABLE"),
22770 Self::Anticipated => std::option::Option::Some("ANTICIPATED"),
22771 Self::NoKnown => std::option::Option::Some("NO_KNOWN"),
22772 Self::UnknownValue(u) => u.0.name(),
22773 }
22774 }
22775 }
22776
22777 impl std::default::Default for ExploitationActivity {
22778 fn default() -> Self {
22779 use std::convert::From;
22780 Self::from(0)
22781 }
22782 }
22783
22784 impl std::fmt::Display for ExploitationActivity {
22785 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22786 wkt::internal::display_enum(f, self.name(), self.value())
22787 }
22788 }
22789
22790 impl std::convert::From<i32> for ExploitationActivity {
22791 fn from(value: i32) -> Self {
22792 match value {
22793 0 => Self::Unspecified,
22794 1 => Self::Wide,
22795 2 => Self::Confirmed,
22796 3 => Self::Available,
22797 4 => Self::Anticipated,
22798 5 => Self::NoKnown,
22799 _ => Self::UnknownValue(exploitation_activity::UnknownValue(
22800 wkt::internal::UnknownEnumValue::Integer(value),
22801 )),
22802 }
22803 }
22804 }
22805
22806 impl std::convert::From<&str> for ExploitationActivity {
22807 fn from(value: &str) -> Self {
22808 use std::string::ToString;
22809 match value {
22810 "EXPLOITATION_ACTIVITY_UNSPECIFIED" => Self::Unspecified,
22811 "WIDE" => Self::Wide,
22812 "CONFIRMED" => Self::Confirmed,
22813 "AVAILABLE" => Self::Available,
22814 "ANTICIPATED" => Self::Anticipated,
22815 "NO_KNOWN" => Self::NoKnown,
22816 _ => Self::UnknownValue(exploitation_activity::UnknownValue(
22817 wkt::internal::UnknownEnumValue::String(value.to_string()),
22818 )),
22819 }
22820 }
22821 }
22822
22823 impl serde::ser::Serialize for ExploitationActivity {
22824 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22825 where
22826 S: serde::Serializer,
22827 {
22828 match self {
22829 Self::Unspecified => serializer.serialize_i32(0),
22830 Self::Wide => serializer.serialize_i32(1),
22831 Self::Confirmed => serializer.serialize_i32(2),
22832 Self::Available => serializer.serialize_i32(3),
22833 Self::Anticipated => serializer.serialize_i32(4),
22834 Self::NoKnown => serializer.serialize_i32(5),
22835 Self::UnknownValue(u) => u.0.serialize(serializer),
22836 }
22837 }
22838 }
22839
22840 impl<'de> serde::de::Deserialize<'de> for ExploitationActivity {
22841 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22842 where
22843 D: serde::Deserializer<'de>,
22844 {
22845 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ExploitationActivity>::new(
22846 ".google.cloud.securitycenter.v2.Cve.ExploitationActivity",
22847 ))
22848 }
22849 }
22850}
22851
22852/// Additional Links
22853#[derive(Clone, Default, PartialEq)]
22854#[non_exhaustive]
22855pub struct Reference {
22856 /// Source of the reference e.g. NVD
22857 pub source: std::string::String,
22858
22859 /// Uri for the mentioned source e.g.
22860 /// <https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-34527>.
22861 pub uri: std::string::String,
22862
22863 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22864}
22865
22866impl Reference {
22867 pub fn new() -> Self {
22868 std::default::Default::default()
22869 }
22870
22871 /// Sets the value of [source][crate::model::Reference::source].
22872 ///
22873 /// # Example
22874 /// ```ignore,no_run
22875 /// # use google_cloud_securitycenter_v2::model::Reference;
22876 /// let x = Reference::new().set_source("example");
22877 /// ```
22878 pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22879 self.source = v.into();
22880 self
22881 }
22882
22883 /// Sets the value of [uri][crate::model::Reference::uri].
22884 ///
22885 /// # Example
22886 /// ```ignore,no_run
22887 /// # use google_cloud_securitycenter_v2::model::Reference;
22888 /// let x = Reference::new().set_uri("example");
22889 /// ```
22890 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22891 self.uri = v.into();
22892 self
22893 }
22894}
22895
22896impl wkt::message::Message for Reference {
22897 fn typename() -> &'static str {
22898 "type.googleapis.com/google.cloud.securitycenter.v2.Reference"
22899 }
22900}
22901
22902/// Common Vulnerability Scoring System version 3.
22903#[derive(Clone, Default, PartialEq)]
22904#[non_exhaustive]
22905pub struct Cvssv3 {
22906 /// The base score is a function of the base metric scores.
22907 pub base_score: f64,
22908
22909 /// Base Metrics
22910 /// Represents the intrinsic characteristics of a vulnerability that are
22911 /// constant over time and across user environments.
22912 /// This metric reflects the context by which vulnerability exploitation is
22913 /// possible.
22914 pub attack_vector: crate::model::cvssv_3::AttackVector,
22915
22916 /// This metric describes the conditions beyond the attacker's control that
22917 /// must exist in order to exploit the vulnerability.
22918 pub attack_complexity: crate::model::cvssv_3::AttackComplexity,
22919
22920 /// This metric describes the level of privileges an attacker must possess
22921 /// before successfully exploiting the vulnerability.
22922 pub privileges_required: crate::model::cvssv_3::PrivilegesRequired,
22923
22924 /// This metric captures the requirement for a human user, other than the
22925 /// attacker, to participate in the successful compromise of the vulnerable
22926 /// component.
22927 pub user_interaction: crate::model::cvssv_3::UserInteraction,
22928
22929 /// The Scope metric captures whether a vulnerability in one vulnerable
22930 /// component impacts resources in components beyond its security scope.
22931 pub scope: crate::model::cvssv_3::Scope,
22932
22933 /// This metric measures the impact to the confidentiality of the information
22934 /// resources managed by a software component due to a successfully exploited
22935 /// vulnerability.
22936 pub confidentiality_impact: crate::model::cvssv_3::Impact,
22937
22938 /// This metric measures the impact to integrity of a successfully exploited
22939 /// vulnerability.
22940 pub integrity_impact: crate::model::cvssv_3::Impact,
22941
22942 /// This metric measures the impact to the availability of the impacted
22943 /// component resulting from a successfully exploited vulnerability.
22944 pub availability_impact: crate::model::cvssv_3::Impact,
22945
22946 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22947}
22948
22949impl Cvssv3 {
22950 pub fn new() -> Self {
22951 std::default::Default::default()
22952 }
22953
22954 /// Sets the value of [base_score][crate::model::Cvssv3::base_score].
22955 ///
22956 /// # Example
22957 /// ```ignore,no_run
22958 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
22959 /// let x = Cvssv3::new().set_base_score(42.0);
22960 /// ```
22961 pub fn set_base_score<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
22962 self.base_score = v.into();
22963 self
22964 }
22965
22966 /// Sets the value of [attack_vector][crate::model::Cvssv3::attack_vector].
22967 ///
22968 /// # Example
22969 /// ```ignore,no_run
22970 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
22971 /// use google_cloud_securitycenter_v2::model::cvssv_3::AttackVector;
22972 /// let x0 = Cvssv3::new().set_attack_vector(AttackVector::Network);
22973 /// let x1 = Cvssv3::new().set_attack_vector(AttackVector::Adjacent);
22974 /// let x2 = Cvssv3::new().set_attack_vector(AttackVector::Local);
22975 /// ```
22976 pub fn set_attack_vector<T: std::convert::Into<crate::model::cvssv_3::AttackVector>>(
22977 mut self,
22978 v: T,
22979 ) -> Self {
22980 self.attack_vector = v.into();
22981 self
22982 }
22983
22984 /// Sets the value of [attack_complexity][crate::model::Cvssv3::attack_complexity].
22985 ///
22986 /// # Example
22987 /// ```ignore,no_run
22988 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
22989 /// use google_cloud_securitycenter_v2::model::cvssv_3::AttackComplexity;
22990 /// let x0 = Cvssv3::new().set_attack_complexity(AttackComplexity::Low);
22991 /// let x1 = Cvssv3::new().set_attack_complexity(AttackComplexity::High);
22992 /// ```
22993 pub fn set_attack_complexity<T: std::convert::Into<crate::model::cvssv_3::AttackComplexity>>(
22994 mut self,
22995 v: T,
22996 ) -> Self {
22997 self.attack_complexity = v.into();
22998 self
22999 }
23000
23001 /// Sets the value of [privileges_required][crate::model::Cvssv3::privileges_required].
23002 ///
23003 /// # Example
23004 /// ```ignore,no_run
23005 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
23006 /// use google_cloud_securitycenter_v2::model::cvssv_3::PrivilegesRequired;
23007 /// let x0 = Cvssv3::new().set_privileges_required(PrivilegesRequired::None);
23008 /// let x1 = Cvssv3::new().set_privileges_required(PrivilegesRequired::Low);
23009 /// let x2 = Cvssv3::new().set_privileges_required(PrivilegesRequired::High);
23010 /// ```
23011 pub fn set_privileges_required<
23012 T: std::convert::Into<crate::model::cvssv_3::PrivilegesRequired>,
23013 >(
23014 mut self,
23015 v: T,
23016 ) -> Self {
23017 self.privileges_required = v.into();
23018 self
23019 }
23020
23021 /// Sets the value of [user_interaction][crate::model::Cvssv3::user_interaction].
23022 ///
23023 /// # Example
23024 /// ```ignore,no_run
23025 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
23026 /// use google_cloud_securitycenter_v2::model::cvssv_3::UserInteraction;
23027 /// let x0 = Cvssv3::new().set_user_interaction(UserInteraction::None);
23028 /// let x1 = Cvssv3::new().set_user_interaction(UserInteraction::Required);
23029 /// ```
23030 pub fn set_user_interaction<T: std::convert::Into<crate::model::cvssv_3::UserInteraction>>(
23031 mut self,
23032 v: T,
23033 ) -> Self {
23034 self.user_interaction = v.into();
23035 self
23036 }
23037
23038 /// Sets the value of [scope][crate::model::Cvssv3::scope].
23039 ///
23040 /// # Example
23041 /// ```ignore,no_run
23042 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
23043 /// use google_cloud_securitycenter_v2::model::cvssv_3::Scope;
23044 /// let x0 = Cvssv3::new().set_scope(Scope::Unchanged);
23045 /// let x1 = Cvssv3::new().set_scope(Scope::Changed);
23046 /// ```
23047 pub fn set_scope<T: std::convert::Into<crate::model::cvssv_3::Scope>>(mut self, v: T) -> Self {
23048 self.scope = v.into();
23049 self
23050 }
23051
23052 /// Sets the value of [confidentiality_impact][crate::model::Cvssv3::confidentiality_impact].
23053 ///
23054 /// # Example
23055 /// ```ignore,no_run
23056 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
23057 /// use google_cloud_securitycenter_v2::model::cvssv_3::Impact;
23058 /// let x0 = Cvssv3::new().set_confidentiality_impact(Impact::High);
23059 /// let x1 = Cvssv3::new().set_confidentiality_impact(Impact::Low);
23060 /// let x2 = Cvssv3::new().set_confidentiality_impact(Impact::None);
23061 /// ```
23062 pub fn set_confidentiality_impact<T: std::convert::Into<crate::model::cvssv_3::Impact>>(
23063 mut self,
23064 v: T,
23065 ) -> Self {
23066 self.confidentiality_impact = v.into();
23067 self
23068 }
23069
23070 /// Sets the value of [integrity_impact][crate::model::Cvssv3::integrity_impact].
23071 ///
23072 /// # Example
23073 /// ```ignore,no_run
23074 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
23075 /// use google_cloud_securitycenter_v2::model::cvssv_3::Impact;
23076 /// let x0 = Cvssv3::new().set_integrity_impact(Impact::High);
23077 /// let x1 = Cvssv3::new().set_integrity_impact(Impact::Low);
23078 /// let x2 = Cvssv3::new().set_integrity_impact(Impact::None);
23079 /// ```
23080 pub fn set_integrity_impact<T: std::convert::Into<crate::model::cvssv_3::Impact>>(
23081 mut self,
23082 v: T,
23083 ) -> Self {
23084 self.integrity_impact = v.into();
23085 self
23086 }
23087
23088 /// Sets the value of [availability_impact][crate::model::Cvssv3::availability_impact].
23089 ///
23090 /// # Example
23091 /// ```ignore,no_run
23092 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
23093 /// use google_cloud_securitycenter_v2::model::cvssv_3::Impact;
23094 /// let x0 = Cvssv3::new().set_availability_impact(Impact::High);
23095 /// let x1 = Cvssv3::new().set_availability_impact(Impact::Low);
23096 /// let x2 = Cvssv3::new().set_availability_impact(Impact::None);
23097 /// ```
23098 pub fn set_availability_impact<T: std::convert::Into<crate::model::cvssv_3::Impact>>(
23099 mut self,
23100 v: T,
23101 ) -> Self {
23102 self.availability_impact = v.into();
23103 self
23104 }
23105}
23106
23107impl wkt::message::Message for Cvssv3 {
23108 fn typename() -> &'static str {
23109 "type.googleapis.com/google.cloud.securitycenter.v2.Cvssv3"
23110 }
23111}
23112
23113/// Defines additional types related to [Cvssv3].
23114pub mod cvssv_3 {
23115 #[allow(unused_imports)]
23116 use super::*;
23117
23118 /// This metric reflects the context by which vulnerability exploitation is
23119 /// possible.
23120 ///
23121 /// # Working with unknown values
23122 ///
23123 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23124 /// additional enum variants at any time. Adding new variants is not considered
23125 /// a breaking change. Applications should write their code in anticipation of:
23126 ///
23127 /// - New values appearing in future releases of the client library, **and**
23128 /// - New values received dynamically, without application changes.
23129 ///
23130 /// Please consult the [Working with enums] section in the user guide for some
23131 /// guidelines.
23132 ///
23133 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
23134 #[derive(Clone, Debug, PartialEq)]
23135 #[non_exhaustive]
23136 pub enum AttackVector {
23137 /// Invalid value.
23138 Unspecified,
23139 /// The vulnerable component is bound to the network stack and the set of
23140 /// possible attackers extends beyond the other options listed below, up to
23141 /// and including the entire Internet.
23142 Network,
23143 /// The vulnerable component is bound to the network stack, but the attack is
23144 /// limited at the protocol level to a logically adjacent topology.
23145 Adjacent,
23146 /// The vulnerable component is not bound to the network stack and the
23147 /// attacker's path is via read/write/execute capabilities.
23148 Local,
23149 /// The attack requires the attacker to physically touch or manipulate the
23150 /// vulnerable component.
23151 Physical,
23152 /// If set, the enum was initialized with an unknown value.
23153 ///
23154 /// Applications can examine the value using [AttackVector::value] or
23155 /// [AttackVector::name].
23156 UnknownValue(attack_vector::UnknownValue),
23157 }
23158
23159 #[doc(hidden)]
23160 pub mod attack_vector {
23161 #[allow(unused_imports)]
23162 use super::*;
23163 #[derive(Clone, Debug, PartialEq)]
23164 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23165 }
23166
23167 impl AttackVector {
23168 /// Gets the enum value.
23169 ///
23170 /// Returns `None` if the enum contains an unknown value deserialized from
23171 /// the string representation of enums.
23172 pub fn value(&self) -> std::option::Option<i32> {
23173 match self {
23174 Self::Unspecified => std::option::Option::Some(0),
23175 Self::Network => std::option::Option::Some(1),
23176 Self::Adjacent => std::option::Option::Some(2),
23177 Self::Local => std::option::Option::Some(3),
23178 Self::Physical => std::option::Option::Some(4),
23179 Self::UnknownValue(u) => u.0.value(),
23180 }
23181 }
23182
23183 /// Gets the enum value as a string.
23184 ///
23185 /// Returns `None` if the enum contains an unknown value deserialized from
23186 /// the integer representation of enums.
23187 pub fn name(&self) -> std::option::Option<&str> {
23188 match self {
23189 Self::Unspecified => std::option::Option::Some("ATTACK_VECTOR_UNSPECIFIED"),
23190 Self::Network => std::option::Option::Some("ATTACK_VECTOR_NETWORK"),
23191 Self::Adjacent => std::option::Option::Some("ATTACK_VECTOR_ADJACENT"),
23192 Self::Local => std::option::Option::Some("ATTACK_VECTOR_LOCAL"),
23193 Self::Physical => std::option::Option::Some("ATTACK_VECTOR_PHYSICAL"),
23194 Self::UnknownValue(u) => u.0.name(),
23195 }
23196 }
23197 }
23198
23199 impl std::default::Default for AttackVector {
23200 fn default() -> Self {
23201 use std::convert::From;
23202 Self::from(0)
23203 }
23204 }
23205
23206 impl std::fmt::Display for AttackVector {
23207 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23208 wkt::internal::display_enum(f, self.name(), self.value())
23209 }
23210 }
23211
23212 impl std::convert::From<i32> for AttackVector {
23213 fn from(value: i32) -> Self {
23214 match value {
23215 0 => Self::Unspecified,
23216 1 => Self::Network,
23217 2 => Self::Adjacent,
23218 3 => Self::Local,
23219 4 => Self::Physical,
23220 _ => Self::UnknownValue(attack_vector::UnknownValue(
23221 wkt::internal::UnknownEnumValue::Integer(value),
23222 )),
23223 }
23224 }
23225 }
23226
23227 impl std::convert::From<&str> for AttackVector {
23228 fn from(value: &str) -> Self {
23229 use std::string::ToString;
23230 match value {
23231 "ATTACK_VECTOR_UNSPECIFIED" => Self::Unspecified,
23232 "ATTACK_VECTOR_NETWORK" => Self::Network,
23233 "ATTACK_VECTOR_ADJACENT" => Self::Adjacent,
23234 "ATTACK_VECTOR_LOCAL" => Self::Local,
23235 "ATTACK_VECTOR_PHYSICAL" => Self::Physical,
23236 _ => Self::UnknownValue(attack_vector::UnknownValue(
23237 wkt::internal::UnknownEnumValue::String(value.to_string()),
23238 )),
23239 }
23240 }
23241 }
23242
23243 impl serde::ser::Serialize for AttackVector {
23244 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23245 where
23246 S: serde::Serializer,
23247 {
23248 match self {
23249 Self::Unspecified => serializer.serialize_i32(0),
23250 Self::Network => serializer.serialize_i32(1),
23251 Self::Adjacent => serializer.serialize_i32(2),
23252 Self::Local => serializer.serialize_i32(3),
23253 Self::Physical => serializer.serialize_i32(4),
23254 Self::UnknownValue(u) => u.0.serialize(serializer),
23255 }
23256 }
23257 }
23258
23259 impl<'de> serde::de::Deserialize<'de> for AttackVector {
23260 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23261 where
23262 D: serde::Deserializer<'de>,
23263 {
23264 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AttackVector>::new(
23265 ".google.cloud.securitycenter.v2.Cvssv3.AttackVector",
23266 ))
23267 }
23268 }
23269
23270 /// This metric describes the conditions beyond the attacker's control that
23271 /// must exist in order to exploit the vulnerability.
23272 ///
23273 /// # Working with unknown values
23274 ///
23275 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23276 /// additional enum variants at any time. Adding new variants is not considered
23277 /// a breaking change. Applications should write their code in anticipation of:
23278 ///
23279 /// - New values appearing in future releases of the client library, **and**
23280 /// - New values received dynamically, without application changes.
23281 ///
23282 /// Please consult the [Working with enums] section in the user guide for some
23283 /// guidelines.
23284 ///
23285 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
23286 #[derive(Clone, Debug, PartialEq)]
23287 #[non_exhaustive]
23288 pub enum AttackComplexity {
23289 /// Invalid value.
23290 Unspecified,
23291 /// Specialized access conditions or extenuating circumstances do not exist.
23292 /// An attacker can expect repeatable success when attacking the vulnerable
23293 /// component.
23294 Low,
23295 /// A successful attack depends on conditions beyond the attacker's control.
23296 /// That is, a successful attack cannot be accomplished at will, but requires
23297 /// the attacker to invest in some measurable amount of effort in preparation
23298 /// or execution against the vulnerable component before a successful attack
23299 /// can be expected.
23300 High,
23301 /// If set, the enum was initialized with an unknown value.
23302 ///
23303 /// Applications can examine the value using [AttackComplexity::value] or
23304 /// [AttackComplexity::name].
23305 UnknownValue(attack_complexity::UnknownValue),
23306 }
23307
23308 #[doc(hidden)]
23309 pub mod attack_complexity {
23310 #[allow(unused_imports)]
23311 use super::*;
23312 #[derive(Clone, Debug, PartialEq)]
23313 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23314 }
23315
23316 impl AttackComplexity {
23317 /// Gets the enum value.
23318 ///
23319 /// Returns `None` if the enum contains an unknown value deserialized from
23320 /// the string representation of enums.
23321 pub fn value(&self) -> std::option::Option<i32> {
23322 match self {
23323 Self::Unspecified => std::option::Option::Some(0),
23324 Self::Low => std::option::Option::Some(1),
23325 Self::High => std::option::Option::Some(2),
23326 Self::UnknownValue(u) => u.0.value(),
23327 }
23328 }
23329
23330 /// Gets the enum value as a string.
23331 ///
23332 /// Returns `None` if the enum contains an unknown value deserialized from
23333 /// the integer representation of enums.
23334 pub fn name(&self) -> std::option::Option<&str> {
23335 match self {
23336 Self::Unspecified => std::option::Option::Some("ATTACK_COMPLEXITY_UNSPECIFIED"),
23337 Self::Low => std::option::Option::Some("ATTACK_COMPLEXITY_LOW"),
23338 Self::High => std::option::Option::Some("ATTACK_COMPLEXITY_HIGH"),
23339 Self::UnknownValue(u) => u.0.name(),
23340 }
23341 }
23342 }
23343
23344 impl std::default::Default for AttackComplexity {
23345 fn default() -> Self {
23346 use std::convert::From;
23347 Self::from(0)
23348 }
23349 }
23350
23351 impl std::fmt::Display for AttackComplexity {
23352 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23353 wkt::internal::display_enum(f, self.name(), self.value())
23354 }
23355 }
23356
23357 impl std::convert::From<i32> for AttackComplexity {
23358 fn from(value: i32) -> Self {
23359 match value {
23360 0 => Self::Unspecified,
23361 1 => Self::Low,
23362 2 => Self::High,
23363 _ => Self::UnknownValue(attack_complexity::UnknownValue(
23364 wkt::internal::UnknownEnumValue::Integer(value),
23365 )),
23366 }
23367 }
23368 }
23369
23370 impl std::convert::From<&str> for AttackComplexity {
23371 fn from(value: &str) -> Self {
23372 use std::string::ToString;
23373 match value {
23374 "ATTACK_COMPLEXITY_UNSPECIFIED" => Self::Unspecified,
23375 "ATTACK_COMPLEXITY_LOW" => Self::Low,
23376 "ATTACK_COMPLEXITY_HIGH" => Self::High,
23377 _ => Self::UnknownValue(attack_complexity::UnknownValue(
23378 wkt::internal::UnknownEnumValue::String(value.to_string()),
23379 )),
23380 }
23381 }
23382 }
23383
23384 impl serde::ser::Serialize for AttackComplexity {
23385 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23386 where
23387 S: serde::Serializer,
23388 {
23389 match self {
23390 Self::Unspecified => serializer.serialize_i32(0),
23391 Self::Low => serializer.serialize_i32(1),
23392 Self::High => serializer.serialize_i32(2),
23393 Self::UnknownValue(u) => u.0.serialize(serializer),
23394 }
23395 }
23396 }
23397
23398 impl<'de> serde::de::Deserialize<'de> for AttackComplexity {
23399 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23400 where
23401 D: serde::Deserializer<'de>,
23402 {
23403 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AttackComplexity>::new(
23404 ".google.cloud.securitycenter.v2.Cvssv3.AttackComplexity",
23405 ))
23406 }
23407 }
23408
23409 /// This metric describes the level of privileges an attacker must possess
23410 /// before successfully exploiting the vulnerability.
23411 ///
23412 /// # Working with unknown values
23413 ///
23414 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23415 /// additional enum variants at any time. Adding new variants is not considered
23416 /// a breaking change. Applications should write their code in anticipation of:
23417 ///
23418 /// - New values appearing in future releases of the client library, **and**
23419 /// - New values received dynamically, without application changes.
23420 ///
23421 /// Please consult the [Working with enums] section in the user guide for some
23422 /// guidelines.
23423 ///
23424 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
23425 #[derive(Clone, Debug, PartialEq)]
23426 #[non_exhaustive]
23427 pub enum PrivilegesRequired {
23428 /// Invalid value.
23429 Unspecified,
23430 /// The attacker is unauthorized prior to attack, and therefore does not
23431 /// require any access to settings or files of the vulnerable system to
23432 /// carry out an attack.
23433 None,
23434 /// The attacker requires privileges that provide basic user capabilities
23435 /// that could normally affect only settings and files owned by a user.
23436 /// Alternatively, an attacker with Low privileges has the ability to access
23437 /// only non-sensitive resources.
23438 Low,
23439 /// The attacker requires privileges that provide significant (e.g.,
23440 /// administrative) control over the vulnerable component allowing access to
23441 /// component-wide settings and files.
23442 High,
23443 /// If set, the enum was initialized with an unknown value.
23444 ///
23445 /// Applications can examine the value using [PrivilegesRequired::value] or
23446 /// [PrivilegesRequired::name].
23447 UnknownValue(privileges_required::UnknownValue),
23448 }
23449
23450 #[doc(hidden)]
23451 pub mod privileges_required {
23452 #[allow(unused_imports)]
23453 use super::*;
23454 #[derive(Clone, Debug, PartialEq)]
23455 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23456 }
23457
23458 impl PrivilegesRequired {
23459 /// Gets the enum value.
23460 ///
23461 /// Returns `None` if the enum contains an unknown value deserialized from
23462 /// the string representation of enums.
23463 pub fn value(&self) -> std::option::Option<i32> {
23464 match self {
23465 Self::Unspecified => std::option::Option::Some(0),
23466 Self::None => std::option::Option::Some(1),
23467 Self::Low => std::option::Option::Some(2),
23468 Self::High => std::option::Option::Some(3),
23469 Self::UnknownValue(u) => u.0.value(),
23470 }
23471 }
23472
23473 /// Gets the enum value as a string.
23474 ///
23475 /// Returns `None` if the enum contains an unknown value deserialized from
23476 /// the integer representation of enums.
23477 pub fn name(&self) -> std::option::Option<&str> {
23478 match self {
23479 Self::Unspecified => std::option::Option::Some("PRIVILEGES_REQUIRED_UNSPECIFIED"),
23480 Self::None => std::option::Option::Some("PRIVILEGES_REQUIRED_NONE"),
23481 Self::Low => std::option::Option::Some("PRIVILEGES_REQUIRED_LOW"),
23482 Self::High => std::option::Option::Some("PRIVILEGES_REQUIRED_HIGH"),
23483 Self::UnknownValue(u) => u.0.name(),
23484 }
23485 }
23486 }
23487
23488 impl std::default::Default for PrivilegesRequired {
23489 fn default() -> Self {
23490 use std::convert::From;
23491 Self::from(0)
23492 }
23493 }
23494
23495 impl std::fmt::Display for PrivilegesRequired {
23496 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23497 wkt::internal::display_enum(f, self.name(), self.value())
23498 }
23499 }
23500
23501 impl std::convert::From<i32> for PrivilegesRequired {
23502 fn from(value: i32) -> Self {
23503 match value {
23504 0 => Self::Unspecified,
23505 1 => Self::None,
23506 2 => Self::Low,
23507 3 => Self::High,
23508 _ => Self::UnknownValue(privileges_required::UnknownValue(
23509 wkt::internal::UnknownEnumValue::Integer(value),
23510 )),
23511 }
23512 }
23513 }
23514
23515 impl std::convert::From<&str> for PrivilegesRequired {
23516 fn from(value: &str) -> Self {
23517 use std::string::ToString;
23518 match value {
23519 "PRIVILEGES_REQUIRED_UNSPECIFIED" => Self::Unspecified,
23520 "PRIVILEGES_REQUIRED_NONE" => Self::None,
23521 "PRIVILEGES_REQUIRED_LOW" => Self::Low,
23522 "PRIVILEGES_REQUIRED_HIGH" => Self::High,
23523 _ => Self::UnknownValue(privileges_required::UnknownValue(
23524 wkt::internal::UnknownEnumValue::String(value.to_string()),
23525 )),
23526 }
23527 }
23528 }
23529
23530 impl serde::ser::Serialize for PrivilegesRequired {
23531 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23532 where
23533 S: serde::Serializer,
23534 {
23535 match self {
23536 Self::Unspecified => serializer.serialize_i32(0),
23537 Self::None => serializer.serialize_i32(1),
23538 Self::Low => serializer.serialize_i32(2),
23539 Self::High => serializer.serialize_i32(3),
23540 Self::UnknownValue(u) => u.0.serialize(serializer),
23541 }
23542 }
23543 }
23544
23545 impl<'de> serde::de::Deserialize<'de> for PrivilegesRequired {
23546 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23547 where
23548 D: serde::Deserializer<'de>,
23549 {
23550 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PrivilegesRequired>::new(
23551 ".google.cloud.securitycenter.v2.Cvssv3.PrivilegesRequired",
23552 ))
23553 }
23554 }
23555
23556 /// This metric captures the requirement for a human user, other than the
23557 /// attacker, to participate in the successful compromise of the vulnerable
23558 /// component.
23559 ///
23560 /// # Working with unknown values
23561 ///
23562 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23563 /// additional enum variants at any time. Adding new variants is not considered
23564 /// a breaking change. Applications should write their code in anticipation of:
23565 ///
23566 /// - New values appearing in future releases of the client library, **and**
23567 /// - New values received dynamically, without application changes.
23568 ///
23569 /// Please consult the [Working with enums] section in the user guide for some
23570 /// guidelines.
23571 ///
23572 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
23573 #[derive(Clone, Debug, PartialEq)]
23574 #[non_exhaustive]
23575 pub enum UserInteraction {
23576 /// Invalid value.
23577 Unspecified,
23578 /// The vulnerable system can be exploited without interaction from any user.
23579 None,
23580 /// Successful exploitation of this vulnerability requires a user to take
23581 /// some action before the vulnerability can be exploited.
23582 Required,
23583 /// If set, the enum was initialized with an unknown value.
23584 ///
23585 /// Applications can examine the value using [UserInteraction::value] or
23586 /// [UserInteraction::name].
23587 UnknownValue(user_interaction::UnknownValue),
23588 }
23589
23590 #[doc(hidden)]
23591 pub mod user_interaction {
23592 #[allow(unused_imports)]
23593 use super::*;
23594 #[derive(Clone, Debug, PartialEq)]
23595 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23596 }
23597
23598 impl UserInteraction {
23599 /// Gets the enum value.
23600 ///
23601 /// Returns `None` if the enum contains an unknown value deserialized from
23602 /// the string representation of enums.
23603 pub fn value(&self) -> std::option::Option<i32> {
23604 match self {
23605 Self::Unspecified => std::option::Option::Some(0),
23606 Self::None => std::option::Option::Some(1),
23607 Self::Required => std::option::Option::Some(2),
23608 Self::UnknownValue(u) => u.0.value(),
23609 }
23610 }
23611
23612 /// Gets the enum value as a string.
23613 ///
23614 /// Returns `None` if the enum contains an unknown value deserialized from
23615 /// the integer representation of enums.
23616 pub fn name(&self) -> std::option::Option<&str> {
23617 match self {
23618 Self::Unspecified => std::option::Option::Some("USER_INTERACTION_UNSPECIFIED"),
23619 Self::None => std::option::Option::Some("USER_INTERACTION_NONE"),
23620 Self::Required => std::option::Option::Some("USER_INTERACTION_REQUIRED"),
23621 Self::UnknownValue(u) => u.0.name(),
23622 }
23623 }
23624 }
23625
23626 impl std::default::Default for UserInteraction {
23627 fn default() -> Self {
23628 use std::convert::From;
23629 Self::from(0)
23630 }
23631 }
23632
23633 impl std::fmt::Display for UserInteraction {
23634 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23635 wkt::internal::display_enum(f, self.name(), self.value())
23636 }
23637 }
23638
23639 impl std::convert::From<i32> for UserInteraction {
23640 fn from(value: i32) -> Self {
23641 match value {
23642 0 => Self::Unspecified,
23643 1 => Self::None,
23644 2 => Self::Required,
23645 _ => Self::UnknownValue(user_interaction::UnknownValue(
23646 wkt::internal::UnknownEnumValue::Integer(value),
23647 )),
23648 }
23649 }
23650 }
23651
23652 impl std::convert::From<&str> for UserInteraction {
23653 fn from(value: &str) -> Self {
23654 use std::string::ToString;
23655 match value {
23656 "USER_INTERACTION_UNSPECIFIED" => Self::Unspecified,
23657 "USER_INTERACTION_NONE" => Self::None,
23658 "USER_INTERACTION_REQUIRED" => Self::Required,
23659 _ => Self::UnknownValue(user_interaction::UnknownValue(
23660 wkt::internal::UnknownEnumValue::String(value.to_string()),
23661 )),
23662 }
23663 }
23664 }
23665
23666 impl serde::ser::Serialize for UserInteraction {
23667 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23668 where
23669 S: serde::Serializer,
23670 {
23671 match self {
23672 Self::Unspecified => serializer.serialize_i32(0),
23673 Self::None => serializer.serialize_i32(1),
23674 Self::Required => serializer.serialize_i32(2),
23675 Self::UnknownValue(u) => u.0.serialize(serializer),
23676 }
23677 }
23678 }
23679
23680 impl<'de> serde::de::Deserialize<'de> for UserInteraction {
23681 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23682 where
23683 D: serde::Deserializer<'de>,
23684 {
23685 deserializer.deserialize_any(wkt::internal::EnumVisitor::<UserInteraction>::new(
23686 ".google.cloud.securitycenter.v2.Cvssv3.UserInteraction",
23687 ))
23688 }
23689 }
23690
23691 /// The Scope metric captures whether a vulnerability in one vulnerable
23692 /// component impacts resources in components beyond its security scope.
23693 ///
23694 /// # Working with unknown values
23695 ///
23696 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23697 /// additional enum variants at any time. Adding new variants is not considered
23698 /// a breaking change. Applications should write their code in anticipation of:
23699 ///
23700 /// - New values appearing in future releases of the client library, **and**
23701 /// - New values received dynamically, without application changes.
23702 ///
23703 /// Please consult the [Working with enums] section in the user guide for some
23704 /// guidelines.
23705 ///
23706 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
23707 #[derive(Clone, Debug, PartialEq)]
23708 #[non_exhaustive]
23709 pub enum Scope {
23710 /// Invalid value.
23711 Unspecified,
23712 /// An exploited vulnerability can only affect resources managed by the same
23713 /// security authority.
23714 Unchanged,
23715 /// An exploited vulnerability can affect resources beyond the security scope
23716 /// managed by the security authority of the vulnerable component.
23717 Changed,
23718 /// If set, the enum was initialized with an unknown value.
23719 ///
23720 /// Applications can examine the value using [Scope::value] or
23721 /// [Scope::name].
23722 UnknownValue(scope::UnknownValue),
23723 }
23724
23725 #[doc(hidden)]
23726 pub mod scope {
23727 #[allow(unused_imports)]
23728 use super::*;
23729 #[derive(Clone, Debug, PartialEq)]
23730 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23731 }
23732
23733 impl Scope {
23734 /// Gets the enum value.
23735 ///
23736 /// Returns `None` if the enum contains an unknown value deserialized from
23737 /// the string representation of enums.
23738 pub fn value(&self) -> std::option::Option<i32> {
23739 match self {
23740 Self::Unspecified => std::option::Option::Some(0),
23741 Self::Unchanged => std::option::Option::Some(1),
23742 Self::Changed => std::option::Option::Some(2),
23743 Self::UnknownValue(u) => u.0.value(),
23744 }
23745 }
23746
23747 /// Gets the enum value as a string.
23748 ///
23749 /// Returns `None` if the enum contains an unknown value deserialized from
23750 /// the integer representation of enums.
23751 pub fn name(&self) -> std::option::Option<&str> {
23752 match self {
23753 Self::Unspecified => std::option::Option::Some("SCOPE_UNSPECIFIED"),
23754 Self::Unchanged => std::option::Option::Some("SCOPE_UNCHANGED"),
23755 Self::Changed => std::option::Option::Some("SCOPE_CHANGED"),
23756 Self::UnknownValue(u) => u.0.name(),
23757 }
23758 }
23759 }
23760
23761 impl std::default::Default for Scope {
23762 fn default() -> Self {
23763 use std::convert::From;
23764 Self::from(0)
23765 }
23766 }
23767
23768 impl std::fmt::Display for Scope {
23769 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23770 wkt::internal::display_enum(f, self.name(), self.value())
23771 }
23772 }
23773
23774 impl std::convert::From<i32> for Scope {
23775 fn from(value: i32) -> Self {
23776 match value {
23777 0 => Self::Unspecified,
23778 1 => Self::Unchanged,
23779 2 => Self::Changed,
23780 _ => Self::UnknownValue(scope::UnknownValue(
23781 wkt::internal::UnknownEnumValue::Integer(value),
23782 )),
23783 }
23784 }
23785 }
23786
23787 impl std::convert::From<&str> for Scope {
23788 fn from(value: &str) -> Self {
23789 use std::string::ToString;
23790 match value {
23791 "SCOPE_UNSPECIFIED" => Self::Unspecified,
23792 "SCOPE_UNCHANGED" => Self::Unchanged,
23793 "SCOPE_CHANGED" => Self::Changed,
23794 _ => Self::UnknownValue(scope::UnknownValue(
23795 wkt::internal::UnknownEnumValue::String(value.to_string()),
23796 )),
23797 }
23798 }
23799 }
23800
23801 impl serde::ser::Serialize for Scope {
23802 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23803 where
23804 S: serde::Serializer,
23805 {
23806 match self {
23807 Self::Unspecified => serializer.serialize_i32(0),
23808 Self::Unchanged => serializer.serialize_i32(1),
23809 Self::Changed => serializer.serialize_i32(2),
23810 Self::UnknownValue(u) => u.0.serialize(serializer),
23811 }
23812 }
23813 }
23814
23815 impl<'de> serde::de::Deserialize<'de> for Scope {
23816 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23817 where
23818 D: serde::Deserializer<'de>,
23819 {
23820 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Scope>::new(
23821 ".google.cloud.securitycenter.v2.Cvssv3.Scope",
23822 ))
23823 }
23824 }
23825
23826 /// The Impact metrics capture the effects of a successfully exploited
23827 /// vulnerability on the component that suffers the worst outcome that is most
23828 /// directly and predictably associated with the attack.
23829 ///
23830 /// # Working with unknown values
23831 ///
23832 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23833 /// additional enum variants at any time. Adding new variants is not considered
23834 /// a breaking change. Applications should write their code in anticipation of:
23835 ///
23836 /// - New values appearing in future releases of the client library, **and**
23837 /// - New values received dynamically, without application changes.
23838 ///
23839 /// Please consult the [Working with enums] section in the user guide for some
23840 /// guidelines.
23841 ///
23842 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
23843 #[derive(Clone, Debug, PartialEq)]
23844 #[non_exhaustive]
23845 pub enum Impact {
23846 /// Invalid value.
23847 Unspecified,
23848 /// High impact.
23849 High,
23850 /// Low impact.
23851 Low,
23852 /// No impact.
23853 None,
23854 /// If set, the enum was initialized with an unknown value.
23855 ///
23856 /// Applications can examine the value using [Impact::value] or
23857 /// [Impact::name].
23858 UnknownValue(impact::UnknownValue),
23859 }
23860
23861 #[doc(hidden)]
23862 pub mod impact {
23863 #[allow(unused_imports)]
23864 use super::*;
23865 #[derive(Clone, Debug, PartialEq)]
23866 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23867 }
23868
23869 impl Impact {
23870 /// Gets the enum value.
23871 ///
23872 /// Returns `None` if the enum contains an unknown value deserialized from
23873 /// the string representation of enums.
23874 pub fn value(&self) -> std::option::Option<i32> {
23875 match self {
23876 Self::Unspecified => std::option::Option::Some(0),
23877 Self::High => std::option::Option::Some(1),
23878 Self::Low => std::option::Option::Some(2),
23879 Self::None => std::option::Option::Some(3),
23880 Self::UnknownValue(u) => u.0.value(),
23881 }
23882 }
23883
23884 /// Gets the enum value as a string.
23885 ///
23886 /// Returns `None` if the enum contains an unknown value deserialized from
23887 /// the integer representation of enums.
23888 pub fn name(&self) -> std::option::Option<&str> {
23889 match self {
23890 Self::Unspecified => std::option::Option::Some("IMPACT_UNSPECIFIED"),
23891 Self::High => std::option::Option::Some("IMPACT_HIGH"),
23892 Self::Low => std::option::Option::Some("IMPACT_LOW"),
23893 Self::None => std::option::Option::Some("IMPACT_NONE"),
23894 Self::UnknownValue(u) => u.0.name(),
23895 }
23896 }
23897 }
23898
23899 impl std::default::Default for Impact {
23900 fn default() -> Self {
23901 use std::convert::From;
23902 Self::from(0)
23903 }
23904 }
23905
23906 impl std::fmt::Display for Impact {
23907 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23908 wkt::internal::display_enum(f, self.name(), self.value())
23909 }
23910 }
23911
23912 impl std::convert::From<i32> for Impact {
23913 fn from(value: i32) -> Self {
23914 match value {
23915 0 => Self::Unspecified,
23916 1 => Self::High,
23917 2 => Self::Low,
23918 3 => Self::None,
23919 _ => Self::UnknownValue(impact::UnknownValue(
23920 wkt::internal::UnknownEnumValue::Integer(value),
23921 )),
23922 }
23923 }
23924 }
23925
23926 impl std::convert::From<&str> for Impact {
23927 fn from(value: &str) -> Self {
23928 use std::string::ToString;
23929 match value {
23930 "IMPACT_UNSPECIFIED" => Self::Unspecified,
23931 "IMPACT_HIGH" => Self::High,
23932 "IMPACT_LOW" => Self::Low,
23933 "IMPACT_NONE" => Self::None,
23934 _ => Self::UnknownValue(impact::UnknownValue(
23935 wkt::internal::UnknownEnumValue::String(value.to_string()),
23936 )),
23937 }
23938 }
23939 }
23940
23941 impl serde::ser::Serialize for Impact {
23942 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23943 where
23944 S: serde::Serializer,
23945 {
23946 match self {
23947 Self::Unspecified => serializer.serialize_i32(0),
23948 Self::High => serializer.serialize_i32(1),
23949 Self::Low => serializer.serialize_i32(2),
23950 Self::None => serializer.serialize_i32(3),
23951 Self::UnknownValue(u) => u.0.serialize(serializer),
23952 }
23953 }
23954 }
23955
23956 impl<'de> serde::de::Deserialize<'de> for Impact {
23957 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23958 where
23959 D: serde::Deserializer<'de>,
23960 {
23961 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Impact>::new(
23962 ".google.cloud.securitycenter.v2.Cvssv3.Impact",
23963 ))
23964 }
23965 }
23966}
23967
23968/// Package is a generic definition of a package.
23969#[derive(Clone, Default, PartialEq)]
23970#[non_exhaustive]
23971pub struct Package {
23972 /// The name of the package where the vulnerability was detected.
23973 pub package_name: std::string::String,
23974
23975 /// The CPE URI where the vulnerability was detected.
23976 pub cpe_uri: std::string::String,
23977
23978 /// Type of package, for example, os, maven, or go.
23979 pub package_type: std::string::String,
23980
23981 /// The version of the package.
23982 pub package_version: std::string::String,
23983
23984 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23985}
23986
23987impl Package {
23988 pub fn new() -> Self {
23989 std::default::Default::default()
23990 }
23991
23992 /// Sets the value of [package_name][crate::model::Package::package_name].
23993 ///
23994 /// # Example
23995 /// ```ignore,no_run
23996 /// # use google_cloud_securitycenter_v2::model::Package;
23997 /// let x = Package::new().set_package_name("example");
23998 /// ```
23999 pub fn set_package_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24000 self.package_name = v.into();
24001 self
24002 }
24003
24004 /// Sets the value of [cpe_uri][crate::model::Package::cpe_uri].
24005 ///
24006 /// # Example
24007 /// ```ignore,no_run
24008 /// # use google_cloud_securitycenter_v2::model::Package;
24009 /// let x = Package::new().set_cpe_uri("example");
24010 /// ```
24011 pub fn set_cpe_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24012 self.cpe_uri = v.into();
24013 self
24014 }
24015
24016 /// Sets the value of [package_type][crate::model::Package::package_type].
24017 ///
24018 /// # Example
24019 /// ```ignore,no_run
24020 /// # use google_cloud_securitycenter_v2::model::Package;
24021 /// let x = Package::new().set_package_type("example");
24022 /// ```
24023 pub fn set_package_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24024 self.package_type = v.into();
24025 self
24026 }
24027
24028 /// Sets the value of [package_version][crate::model::Package::package_version].
24029 ///
24030 /// # Example
24031 /// ```ignore,no_run
24032 /// # use google_cloud_securitycenter_v2::model::Package;
24033 /// let x = Package::new().set_package_version("example");
24034 /// ```
24035 pub fn set_package_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24036 self.package_version = v.into();
24037 self
24038 }
24039}
24040
24041impl wkt::message::Message for Package {
24042 fn typename() -> &'static str {
24043 "type.googleapis.com/google.cloud.securitycenter.v2.Package"
24044 }
24045}
24046
24047/// SecurityBulletin are notifications of vulnerabilities of Google products.
24048#[derive(Clone, Default, PartialEq)]
24049#[non_exhaustive]
24050pub struct SecurityBulletin {
24051 /// ID of the bulletin corresponding to the vulnerability.
24052 pub bulletin_id: std::string::String,
24053
24054 /// Submission time of this Security Bulletin.
24055 pub submission_time: std::option::Option<wkt::Timestamp>,
24056
24057 /// This represents a version that the cluster receiving this notification
24058 /// should be upgraded to, based on its current version. For example, 1.15.0
24059 pub suggested_upgrade_version: std::string::String,
24060
24061 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24062}
24063
24064impl SecurityBulletin {
24065 pub fn new() -> Self {
24066 std::default::Default::default()
24067 }
24068
24069 /// Sets the value of [bulletin_id][crate::model::SecurityBulletin::bulletin_id].
24070 ///
24071 /// # Example
24072 /// ```ignore,no_run
24073 /// # use google_cloud_securitycenter_v2::model::SecurityBulletin;
24074 /// let x = SecurityBulletin::new().set_bulletin_id("example");
24075 /// ```
24076 pub fn set_bulletin_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24077 self.bulletin_id = v.into();
24078 self
24079 }
24080
24081 /// Sets the value of [submission_time][crate::model::SecurityBulletin::submission_time].
24082 ///
24083 /// # Example
24084 /// ```ignore,no_run
24085 /// # use google_cloud_securitycenter_v2::model::SecurityBulletin;
24086 /// use wkt::Timestamp;
24087 /// let x = SecurityBulletin::new().set_submission_time(Timestamp::default()/* use setters */);
24088 /// ```
24089 pub fn set_submission_time<T>(mut self, v: T) -> Self
24090 where
24091 T: std::convert::Into<wkt::Timestamp>,
24092 {
24093 self.submission_time = std::option::Option::Some(v.into());
24094 self
24095 }
24096
24097 /// Sets or clears the value of [submission_time][crate::model::SecurityBulletin::submission_time].
24098 ///
24099 /// # Example
24100 /// ```ignore,no_run
24101 /// # use google_cloud_securitycenter_v2::model::SecurityBulletin;
24102 /// use wkt::Timestamp;
24103 /// let x = SecurityBulletin::new().set_or_clear_submission_time(Some(Timestamp::default()/* use setters */));
24104 /// let x = SecurityBulletin::new().set_or_clear_submission_time(None::<Timestamp>);
24105 /// ```
24106 pub fn set_or_clear_submission_time<T>(mut self, v: std::option::Option<T>) -> Self
24107 where
24108 T: std::convert::Into<wkt::Timestamp>,
24109 {
24110 self.submission_time = v.map(|x| x.into());
24111 self
24112 }
24113
24114 /// Sets the value of [suggested_upgrade_version][crate::model::SecurityBulletin::suggested_upgrade_version].
24115 ///
24116 /// # Example
24117 /// ```ignore,no_run
24118 /// # use google_cloud_securitycenter_v2::model::SecurityBulletin;
24119 /// let x = SecurityBulletin::new().set_suggested_upgrade_version("example");
24120 /// ```
24121 pub fn set_suggested_upgrade_version<T: std::convert::Into<std::string::String>>(
24122 mut self,
24123 v: T,
24124 ) -> Self {
24125 self.suggested_upgrade_version = v.into();
24126 self
24127 }
24128}
24129
24130impl wkt::message::Message for SecurityBulletin {
24131 fn typename() -> &'static str {
24132 "type.googleapis.com/google.cloud.securitycenter.v2.SecurityBulletin"
24133 }
24134}
24135
24136/// CWE stands for Common Weakness Enumeration. Information about this weakness,
24137/// as described by [CWE](https://cwe.mitre.org/).
24138#[derive(Clone, Default, PartialEq)]
24139#[non_exhaustive]
24140pub struct Cwe {
24141 /// The CWE identifier, e.g. CWE-94
24142 pub id: std::string::String,
24143
24144 /// Any reference to the details on the CWE, for example,
24145 /// <https://cwe.mitre.org/data/definitions/94.html>
24146 pub references: std::vec::Vec<crate::model::Reference>,
24147
24148 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24149}
24150
24151impl Cwe {
24152 pub fn new() -> Self {
24153 std::default::Default::default()
24154 }
24155
24156 /// Sets the value of [id][crate::model::Cwe::id].
24157 ///
24158 /// # Example
24159 /// ```ignore,no_run
24160 /// # use google_cloud_securitycenter_v2::model::Cwe;
24161 /// let x = Cwe::new().set_id("example");
24162 /// ```
24163 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24164 self.id = v.into();
24165 self
24166 }
24167
24168 /// Sets the value of [references][crate::model::Cwe::references].
24169 ///
24170 /// # Example
24171 /// ```ignore,no_run
24172 /// # use google_cloud_securitycenter_v2::model::Cwe;
24173 /// use google_cloud_securitycenter_v2::model::Reference;
24174 /// let x = Cwe::new()
24175 /// .set_references([
24176 /// Reference::default()/* use setters */,
24177 /// Reference::default()/* use (different) setters */,
24178 /// ]);
24179 /// ```
24180 pub fn set_references<T, V>(mut self, v: T) -> Self
24181 where
24182 T: std::iter::IntoIterator<Item = V>,
24183 V: std::convert::Into<crate::model::Reference>,
24184 {
24185 use std::iter::Iterator;
24186 self.references = v.into_iter().map(|i| i.into()).collect();
24187 self
24188 }
24189}
24190
24191impl wkt::message::Message for Cwe {
24192 fn typename() -> &'static str {
24193 "type.googleapis.com/google.cloud.securitycenter.v2.Cwe"
24194 }
24195}
24196
24197/// JobState represents the state of the job.
24198///
24199/// # Working with unknown values
24200///
24201/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24202/// additional enum variants at any time. Adding new variants is not considered
24203/// a breaking change. Applications should write their code in anticipation of:
24204///
24205/// - New values appearing in future releases of the client library, **and**
24206/// - New values received dynamically, without application changes.
24207///
24208/// Please consult the [Working with enums] section in the user guide for some
24209/// guidelines.
24210///
24211/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
24212#[derive(Clone, Debug, PartialEq)]
24213#[non_exhaustive]
24214pub enum JobState {
24215 /// Unspecified represents an unknown state and should not be used.
24216 Unspecified,
24217 /// Job is scheduled and pending for run
24218 Pending,
24219 /// Job in progress
24220 Running,
24221 /// Job has completed with success
24222 Succeeded,
24223 /// Job has completed but with failure
24224 Failed,
24225 /// If set, the enum was initialized with an unknown value.
24226 ///
24227 /// Applications can examine the value using [JobState::value] or
24228 /// [JobState::name].
24229 UnknownValue(job_state::UnknownValue),
24230}
24231
24232#[doc(hidden)]
24233pub mod job_state {
24234 #[allow(unused_imports)]
24235 use super::*;
24236 #[derive(Clone, Debug, PartialEq)]
24237 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24238}
24239
24240impl JobState {
24241 /// Gets the enum value.
24242 ///
24243 /// Returns `None` if the enum contains an unknown value deserialized from
24244 /// the string representation of enums.
24245 pub fn value(&self) -> std::option::Option<i32> {
24246 match self {
24247 Self::Unspecified => std::option::Option::Some(0),
24248 Self::Pending => std::option::Option::Some(1),
24249 Self::Running => std::option::Option::Some(2),
24250 Self::Succeeded => std::option::Option::Some(3),
24251 Self::Failed => std::option::Option::Some(4),
24252 Self::UnknownValue(u) => u.0.value(),
24253 }
24254 }
24255
24256 /// Gets the enum value as a string.
24257 ///
24258 /// Returns `None` if the enum contains an unknown value deserialized from
24259 /// the integer representation of enums.
24260 pub fn name(&self) -> std::option::Option<&str> {
24261 match self {
24262 Self::Unspecified => std::option::Option::Some("JOB_STATE_UNSPECIFIED"),
24263 Self::Pending => std::option::Option::Some("PENDING"),
24264 Self::Running => std::option::Option::Some("RUNNING"),
24265 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
24266 Self::Failed => std::option::Option::Some("FAILED"),
24267 Self::UnknownValue(u) => u.0.name(),
24268 }
24269 }
24270}
24271
24272impl std::default::Default for JobState {
24273 fn default() -> Self {
24274 use std::convert::From;
24275 Self::from(0)
24276 }
24277}
24278
24279impl std::fmt::Display for JobState {
24280 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24281 wkt::internal::display_enum(f, self.name(), self.value())
24282 }
24283}
24284
24285impl std::convert::From<i32> for JobState {
24286 fn from(value: i32) -> Self {
24287 match value {
24288 0 => Self::Unspecified,
24289 1 => Self::Pending,
24290 2 => Self::Running,
24291 3 => Self::Succeeded,
24292 4 => Self::Failed,
24293 _ => Self::UnknownValue(job_state::UnknownValue(
24294 wkt::internal::UnknownEnumValue::Integer(value),
24295 )),
24296 }
24297 }
24298}
24299
24300impl std::convert::From<&str> for JobState {
24301 fn from(value: &str) -> Self {
24302 use std::string::ToString;
24303 match value {
24304 "JOB_STATE_UNSPECIFIED" => Self::Unspecified,
24305 "PENDING" => Self::Pending,
24306 "RUNNING" => Self::Running,
24307 "SUCCEEDED" => Self::Succeeded,
24308 "FAILED" => Self::Failed,
24309 _ => Self::UnknownValue(job_state::UnknownValue(
24310 wkt::internal::UnknownEnumValue::String(value.to_string()),
24311 )),
24312 }
24313 }
24314}
24315
24316impl serde::ser::Serialize for JobState {
24317 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24318 where
24319 S: serde::Serializer,
24320 {
24321 match self {
24322 Self::Unspecified => serializer.serialize_i32(0),
24323 Self::Pending => serializer.serialize_i32(1),
24324 Self::Running => serializer.serialize_i32(2),
24325 Self::Succeeded => serializer.serialize_i32(3),
24326 Self::Failed => serializer.serialize_i32(4),
24327 Self::UnknownValue(u) => u.0.serialize(serializer),
24328 }
24329 }
24330}
24331
24332impl<'de> serde::de::Deserialize<'de> for JobState {
24333 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24334 where
24335 D: serde::Deserializer<'de>,
24336 {
24337 deserializer.deserialize_any(wkt::internal::EnumVisitor::<JobState>::new(
24338 ".google.cloud.securitycenter.v2.JobState",
24339 ))
24340 }
24341}
24342
24343/// The cloud provider the finding pertains to.
24344///
24345/// # Working with unknown values
24346///
24347/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24348/// additional enum variants at any time. Adding new variants is not considered
24349/// a breaking change. Applications should write their code in anticipation of:
24350///
24351/// - New values appearing in future releases of the client library, **and**
24352/// - New values received dynamically, without application changes.
24353///
24354/// Please consult the [Working with enums] section in the user guide for some
24355/// guidelines.
24356///
24357/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
24358#[derive(Clone, Debug, PartialEq)]
24359#[non_exhaustive]
24360pub enum CloudProvider {
24361 /// The cloud provider is unspecified.
24362 Unspecified,
24363 /// The cloud provider is Google Cloud.
24364 GoogleCloudPlatform,
24365 /// The cloud provider is Amazon Web Services.
24366 AmazonWebServices,
24367 /// The cloud provider is Microsoft Azure.
24368 MicrosoftAzure,
24369 /// If set, the enum was initialized with an unknown value.
24370 ///
24371 /// Applications can examine the value using [CloudProvider::value] or
24372 /// [CloudProvider::name].
24373 UnknownValue(cloud_provider::UnknownValue),
24374}
24375
24376#[doc(hidden)]
24377pub mod cloud_provider {
24378 #[allow(unused_imports)]
24379 use super::*;
24380 #[derive(Clone, Debug, PartialEq)]
24381 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24382}
24383
24384impl CloudProvider {
24385 /// Gets the enum value.
24386 ///
24387 /// Returns `None` if the enum contains an unknown value deserialized from
24388 /// the string representation of enums.
24389 pub fn value(&self) -> std::option::Option<i32> {
24390 match self {
24391 Self::Unspecified => std::option::Option::Some(0),
24392 Self::GoogleCloudPlatform => std::option::Option::Some(1),
24393 Self::AmazonWebServices => std::option::Option::Some(2),
24394 Self::MicrosoftAzure => std::option::Option::Some(3),
24395 Self::UnknownValue(u) => u.0.value(),
24396 }
24397 }
24398
24399 /// Gets the enum value as a string.
24400 ///
24401 /// Returns `None` if the enum contains an unknown value deserialized from
24402 /// the integer representation of enums.
24403 pub fn name(&self) -> std::option::Option<&str> {
24404 match self {
24405 Self::Unspecified => std::option::Option::Some("CLOUD_PROVIDER_UNSPECIFIED"),
24406 Self::GoogleCloudPlatform => std::option::Option::Some("GOOGLE_CLOUD_PLATFORM"),
24407 Self::AmazonWebServices => std::option::Option::Some("AMAZON_WEB_SERVICES"),
24408 Self::MicrosoftAzure => std::option::Option::Some("MICROSOFT_AZURE"),
24409 Self::UnknownValue(u) => u.0.name(),
24410 }
24411 }
24412}
24413
24414impl std::default::Default for CloudProvider {
24415 fn default() -> Self {
24416 use std::convert::From;
24417 Self::from(0)
24418 }
24419}
24420
24421impl std::fmt::Display for CloudProvider {
24422 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24423 wkt::internal::display_enum(f, self.name(), self.value())
24424 }
24425}
24426
24427impl std::convert::From<i32> for CloudProvider {
24428 fn from(value: i32) -> Self {
24429 match value {
24430 0 => Self::Unspecified,
24431 1 => Self::GoogleCloudPlatform,
24432 2 => Self::AmazonWebServices,
24433 3 => Self::MicrosoftAzure,
24434 _ => Self::UnknownValue(cloud_provider::UnknownValue(
24435 wkt::internal::UnknownEnumValue::Integer(value),
24436 )),
24437 }
24438 }
24439}
24440
24441impl std::convert::From<&str> for CloudProvider {
24442 fn from(value: &str) -> Self {
24443 use std::string::ToString;
24444 match value {
24445 "CLOUD_PROVIDER_UNSPECIFIED" => Self::Unspecified,
24446 "GOOGLE_CLOUD_PLATFORM" => Self::GoogleCloudPlatform,
24447 "AMAZON_WEB_SERVICES" => Self::AmazonWebServices,
24448 "MICROSOFT_AZURE" => Self::MicrosoftAzure,
24449 _ => Self::UnknownValue(cloud_provider::UnknownValue(
24450 wkt::internal::UnknownEnumValue::String(value.to_string()),
24451 )),
24452 }
24453 }
24454}
24455
24456impl serde::ser::Serialize for CloudProvider {
24457 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24458 where
24459 S: serde::Serializer,
24460 {
24461 match self {
24462 Self::Unspecified => serializer.serialize_i32(0),
24463 Self::GoogleCloudPlatform => serializer.serialize_i32(1),
24464 Self::AmazonWebServices => serializer.serialize_i32(2),
24465 Self::MicrosoftAzure => serializer.serialize_i32(3),
24466 Self::UnknownValue(u) => u.0.serialize(serializer),
24467 }
24468 }
24469}
24470
24471impl<'de> serde::de::Deserialize<'de> for CloudProvider {
24472 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24473 where
24474 D: serde::Deserializer<'de>,
24475 {
24476 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CloudProvider>::new(
24477 ".google.cloud.securitycenter.v2.CloudProvider",
24478 ))
24479 }
24480}
24481
24482/// Value enum to map to a resource
24483///
24484/// # Working with unknown values
24485///
24486/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24487/// additional enum variants at any time. Adding new variants is not considered
24488/// a breaking change. Applications should write their code in anticipation of:
24489///
24490/// - New values appearing in future releases of the client library, **and**
24491/// - New values received dynamically, without application changes.
24492///
24493/// Please consult the [Working with enums] section in the user guide for some
24494/// guidelines.
24495///
24496/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
24497#[derive(Clone, Debug, PartialEq)]
24498#[non_exhaustive]
24499pub enum ResourceValue {
24500 /// Unspecific value
24501 Unspecified,
24502 /// High resource value
24503 High,
24504 /// Medium resource value
24505 Medium,
24506 /// Low resource value
24507 Low,
24508 /// No resource value, e.g. ignore these resources
24509 None,
24510 /// If set, the enum was initialized with an unknown value.
24511 ///
24512 /// Applications can examine the value using [ResourceValue::value] or
24513 /// [ResourceValue::name].
24514 UnknownValue(resource_value::UnknownValue),
24515}
24516
24517#[doc(hidden)]
24518pub mod resource_value {
24519 #[allow(unused_imports)]
24520 use super::*;
24521 #[derive(Clone, Debug, PartialEq)]
24522 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24523}
24524
24525impl ResourceValue {
24526 /// Gets the enum value.
24527 ///
24528 /// Returns `None` if the enum contains an unknown value deserialized from
24529 /// the string representation of enums.
24530 pub fn value(&self) -> std::option::Option<i32> {
24531 match self {
24532 Self::Unspecified => std::option::Option::Some(0),
24533 Self::High => std::option::Option::Some(1),
24534 Self::Medium => std::option::Option::Some(2),
24535 Self::Low => std::option::Option::Some(3),
24536 Self::None => std::option::Option::Some(4),
24537 Self::UnknownValue(u) => u.0.value(),
24538 }
24539 }
24540
24541 /// Gets the enum value as a string.
24542 ///
24543 /// Returns `None` if the enum contains an unknown value deserialized from
24544 /// the integer representation of enums.
24545 pub fn name(&self) -> std::option::Option<&str> {
24546 match self {
24547 Self::Unspecified => std::option::Option::Some("RESOURCE_VALUE_UNSPECIFIED"),
24548 Self::High => std::option::Option::Some("HIGH"),
24549 Self::Medium => std::option::Option::Some("MEDIUM"),
24550 Self::Low => std::option::Option::Some("LOW"),
24551 Self::None => std::option::Option::Some("NONE"),
24552 Self::UnknownValue(u) => u.0.name(),
24553 }
24554 }
24555}
24556
24557impl std::default::Default for ResourceValue {
24558 fn default() -> Self {
24559 use std::convert::From;
24560 Self::from(0)
24561 }
24562}
24563
24564impl std::fmt::Display for ResourceValue {
24565 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24566 wkt::internal::display_enum(f, self.name(), self.value())
24567 }
24568}
24569
24570impl std::convert::From<i32> for ResourceValue {
24571 fn from(value: i32) -> Self {
24572 match value {
24573 0 => Self::Unspecified,
24574 1 => Self::High,
24575 2 => Self::Medium,
24576 3 => Self::Low,
24577 4 => Self::None,
24578 _ => Self::UnknownValue(resource_value::UnknownValue(
24579 wkt::internal::UnknownEnumValue::Integer(value),
24580 )),
24581 }
24582 }
24583}
24584
24585impl std::convert::From<&str> for ResourceValue {
24586 fn from(value: &str) -> Self {
24587 use std::string::ToString;
24588 match value {
24589 "RESOURCE_VALUE_UNSPECIFIED" => Self::Unspecified,
24590 "HIGH" => Self::High,
24591 "MEDIUM" => Self::Medium,
24592 "LOW" => Self::Low,
24593 "NONE" => Self::None,
24594 _ => Self::UnknownValue(resource_value::UnknownValue(
24595 wkt::internal::UnknownEnumValue::String(value.to_string()),
24596 )),
24597 }
24598 }
24599}
24600
24601impl serde::ser::Serialize for ResourceValue {
24602 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24603 where
24604 S: serde::Serializer,
24605 {
24606 match self {
24607 Self::Unspecified => serializer.serialize_i32(0),
24608 Self::High => serializer.serialize_i32(1),
24609 Self::Medium => serializer.serialize_i32(2),
24610 Self::Low => serializer.serialize_i32(3),
24611 Self::None => serializer.serialize_i32(4),
24612 Self::UnknownValue(u) => u.0.serialize(serializer),
24613 }
24614 }
24615}
24616
24617impl<'de> serde::de::Deserialize<'de> for ResourceValue {
24618 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24619 where
24620 D: serde::Deserializer<'de>,
24621 {
24622 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResourceValue>::new(
24623 ".google.cloud.securitycenter.v2.ResourceValue",
24624 ))
24625 }
24626}