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 gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_iam_v1;
25extern crate google_cloud_longrunning;
26extern crate google_cloud_lro;
27extern crate serde;
28extern crate serde_json;
29extern crate serde_with;
30extern crate std;
31extern crate tracing;
32extern crate wkt;
33
34mod debug;
35mod deserialize;
36mod serialize;
37
38/// Represents an access event.
39#[derive(Clone, Default, PartialEq)]
40#[non_exhaustive]
41pub struct Access {
42 /// Associated email, such as "foo@google.com".
43 ///
44 /// The email address of the authenticated user or a service account acting on
45 /// behalf of a third party principal making the request. For third party
46 /// identity callers, the `principal_subject` field is populated instead of
47 /// this field. For privacy reasons, the principal email address is sometimes
48 /// redacted. For more information, see [Caller identities in audit
49 /// logs](https://cloud.google.com/logging/docs/audit#user-id).
50 pub principal_email: std::string::String,
51
52 /// Caller's IP address, such as "1.1.1.1".
53 pub caller_ip: std::string::String,
54
55 /// The caller IP's geolocation, which identifies where the call came from.
56 pub caller_ip_geo: std::option::Option<crate::model::Geolocation>,
57
58 /// Type of user agent associated with the finding. For example, an operating
59 /// system shell or an embedded or standalone application.
60 pub user_agent_family: std::string::String,
61
62 /// The caller's user agent string associated with the finding.
63 pub user_agent: std::string::String,
64
65 /// This is the API service that the service account made a call to, e.g.
66 /// "iam.googleapis.com"
67 pub service_name: std::string::String,
68
69 /// The method that the service account called, e.g. "SetIamPolicy".
70 pub method_name: std::string::String,
71
72 /// A string that represents the principal_subject that is associated with the
73 /// identity. Unlike `principal_email`, `principal_subject` supports principals
74 /// that aren't associated with email addresses, such as third party
75 /// principals. For most identities, the format is
76 /// `principal://iam.googleapis.com/{identity pool name}/subject/{subject}`.
77 /// Some GKE identities, such as GKE_WORKLOAD, FREEFORM, and GKE_HUB_WORKLOAD,
78 /// still use the legacy format `serviceAccount:{identity pool
79 /// name}[{subject}]`.
80 pub principal_subject: std::string::String,
81
82 /// The name of the service account key that was used to create or exchange
83 /// credentials when authenticating the service account that made the request.
84 /// This is a scheme-less URI full resource name. For example:
85 ///
86 /// "//iam.googleapis.com/projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}".
87 pub service_account_key_name: std::string::String,
88
89 /// The identity delegation history of an authenticated service account that
90 /// made the request. The `serviceAccountDelegationInfo[]` object contains
91 /// information about the real authorities that try to access Google Cloud
92 /// resources by delegating on a service account. When multiple authorities are
93 /// present, they are guaranteed to be sorted based on the original ordering of
94 /// the identity delegation events.
95 pub service_account_delegation_info: std::vec::Vec<crate::model::ServiceAccountDelegationInfo>,
96
97 /// A string that represents a username. The username provided depends on the
98 /// type of the finding and is likely not an IAM principal. For example, this
99 /// can be a system username if the finding is related to a virtual machine, or
100 /// it can be an application login username.
101 pub user_name: std::string::String,
102
103 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
104}
105
106impl Access {
107 /// Creates a new default instance.
108 pub fn new() -> Self {
109 std::default::Default::default()
110 }
111
112 /// Sets the value of [principal_email][crate::model::Access::principal_email].
113 ///
114 /// # Example
115 /// ```ignore,no_run
116 /// # use google_cloud_securitycenter_v2::model::Access;
117 /// let x = Access::new().set_principal_email("example");
118 /// ```
119 pub fn set_principal_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
120 self.principal_email = v.into();
121 self
122 }
123
124 /// Sets the value of [caller_ip][crate::model::Access::caller_ip].
125 ///
126 /// # Example
127 /// ```ignore,no_run
128 /// # use google_cloud_securitycenter_v2::model::Access;
129 /// let x = Access::new().set_caller_ip("example");
130 /// ```
131 pub fn set_caller_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
132 self.caller_ip = v.into();
133 self
134 }
135
136 /// Sets the value of [caller_ip_geo][crate::model::Access::caller_ip_geo].
137 ///
138 /// # Example
139 /// ```ignore,no_run
140 /// # use google_cloud_securitycenter_v2::model::Access;
141 /// use google_cloud_securitycenter_v2::model::Geolocation;
142 /// let x = Access::new().set_caller_ip_geo(Geolocation::default()/* use setters */);
143 /// ```
144 pub fn set_caller_ip_geo<T>(mut self, v: T) -> Self
145 where
146 T: std::convert::Into<crate::model::Geolocation>,
147 {
148 self.caller_ip_geo = std::option::Option::Some(v.into());
149 self
150 }
151
152 /// Sets or clears the value of [caller_ip_geo][crate::model::Access::caller_ip_geo].
153 ///
154 /// # Example
155 /// ```ignore,no_run
156 /// # use google_cloud_securitycenter_v2::model::Access;
157 /// use google_cloud_securitycenter_v2::model::Geolocation;
158 /// let x = Access::new().set_or_clear_caller_ip_geo(Some(Geolocation::default()/* use setters */));
159 /// let x = Access::new().set_or_clear_caller_ip_geo(None::<Geolocation>);
160 /// ```
161 pub fn set_or_clear_caller_ip_geo<T>(mut self, v: std::option::Option<T>) -> Self
162 where
163 T: std::convert::Into<crate::model::Geolocation>,
164 {
165 self.caller_ip_geo = v.map(|x| x.into());
166 self
167 }
168
169 /// Sets the value of [user_agent_family][crate::model::Access::user_agent_family].
170 ///
171 /// # Example
172 /// ```ignore,no_run
173 /// # use google_cloud_securitycenter_v2::model::Access;
174 /// let x = Access::new().set_user_agent_family("example");
175 /// ```
176 pub fn set_user_agent_family<T: std::convert::Into<std::string::String>>(
177 mut self,
178 v: T,
179 ) -> Self {
180 self.user_agent_family = v.into();
181 self
182 }
183
184 /// Sets the value of [user_agent][crate::model::Access::user_agent].
185 ///
186 /// # Example
187 /// ```ignore,no_run
188 /// # use google_cloud_securitycenter_v2::model::Access;
189 /// let x = Access::new().set_user_agent("example");
190 /// ```
191 pub fn set_user_agent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
192 self.user_agent = v.into();
193 self
194 }
195
196 /// Sets the value of [service_name][crate::model::Access::service_name].
197 ///
198 /// # Example
199 /// ```ignore,no_run
200 /// # use google_cloud_securitycenter_v2::model::Access;
201 /// let x = Access::new().set_service_name("example");
202 /// ```
203 pub fn set_service_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
204 self.service_name = v.into();
205 self
206 }
207
208 /// Sets the value of [method_name][crate::model::Access::method_name].
209 ///
210 /// # Example
211 /// ```ignore,no_run
212 /// # use google_cloud_securitycenter_v2::model::Access;
213 /// let x = Access::new().set_method_name("example");
214 /// ```
215 pub fn set_method_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
216 self.method_name = v.into();
217 self
218 }
219
220 /// Sets the value of [principal_subject][crate::model::Access::principal_subject].
221 ///
222 /// # Example
223 /// ```ignore,no_run
224 /// # use google_cloud_securitycenter_v2::model::Access;
225 /// let x = Access::new().set_principal_subject("example");
226 /// ```
227 pub fn set_principal_subject<T: std::convert::Into<std::string::String>>(
228 mut self,
229 v: T,
230 ) -> Self {
231 self.principal_subject = v.into();
232 self
233 }
234
235 /// Sets the value of [service_account_key_name][crate::model::Access::service_account_key_name].
236 ///
237 /// # Example
238 /// ```ignore,no_run
239 /// # use google_cloud_securitycenter_v2::model::Access;
240 /// let x = Access::new().set_service_account_key_name("example");
241 /// ```
242 pub fn set_service_account_key_name<T: std::convert::Into<std::string::String>>(
243 mut self,
244 v: T,
245 ) -> Self {
246 self.service_account_key_name = v.into();
247 self
248 }
249
250 /// Sets the value of [service_account_delegation_info][crate::model::Access::service_account_delegation_info].
251 ///
252 /// # Example
253 /// ```ignore,no_run
254 /// # use google_cloud_securitycenter_v2::model::Access;
255 /// use google_cloud_securitycenter_v2::model::ServiceAccountDelegationInfo;
256 /// let x = Access::new()
257 /// .set_service_account_delegation_info([
258 /// ServiceAccountDelegationInfo::default()/* use setters */,
259 /// ServiceAccountDelegationInfo::default()/* use (different) setters */,
260 /// ]);
261 /// ```
262 pub fn set_service_account_delegation_info<T, V>(mut self, v: T) -> Self
263 where
264 T: std::iter::IntoIterator<Item = V>,
265 V: std::convert::Into<crate::model::ServiceAccountDelegationInfo>,
266 {
267 use std::iter::Iterator;
268 self.service_account_delegation_info = v.into_iter().map(|i| i.into()).collect();
269 self
270 }
271
272 /// Sets the value of [user_name][crate::model::Access::user_name].
273 ///
274 /// # Example
275 /// ```ignore,no_run
276 /// # use google_cloud_securitycenter_v2::model::Access;
277 /// let x = Access::new().set_user_name("example");
278 /// ```
279 pub fn set_user_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
280 self.user_name = v.into();
281 self
282 }
283}
284
285impl wkt::message::Message for Access {
286 fn typename() -> &'static str {
287 "type.googleapis.com/google.cloud.securitycenter.v2.Access"
288 }
289}
290
291/// Identity delegation history of an authenticated service account.
292#[derive(Clone, Default, PartialEq)]
293#[non_exhaustive]
294pub struct ServiceAccountDelegationInfo {
295 /// The email address of a Google account.
296 pub principal_email: std::string::String,
297
298 /// A string representing the principal_subject associated with the identity.
299 /// As compared to `principal_email`, supports principals that aren't
300 /// associated with email addresses, such as third party principals. For most
301 /// identities, the format will be `principal://iam.googleapis.com/{identity
302 /// pool name}/subjects/{subject}` except for some GKE identities
303 /// (GKE_WORKLOAD, FREEFORM, GKE_HUB_WORKLOAD) that are still in the legacy
304 /// format `serviceAccount:{identity pool name}[{subject}]`
305 pub principal_subject: std::string::String,
306
307 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
308}
309
310impl ServiceAccountDelegationInfo {
311 /// Creates a new default instance.
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 /// Creates a new default instance.
362 pub fn new() -> Self {
363 std::default::Default::default()
364 }
365
366 /// Sets the value of [region_code][crate::model::Geolocation::region_code].
367 ///
368 /// # Example
369 /// ```ignore,no_run
370 /// # use google_cloud_securitycenter_v2::model::Geolocation;
371 /// let x = Geolocation::new().set_region_code("example");
372 /// ```
373 pub fn set_region_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
374 self.region_code = v.into();
375 self
376 }
377}
378
379impl wkt::message::Message for Geolocation {
380 fn typename() -> &'static str {
381 "type.googleapis.com/google.cloud.securitycenter.v2.Geolocation"
382 }
383}
384
385/// Details about resources affected by this finding.
386#[derive(Clone, Default, PartialEq)]
387#[non_exhaustive]
388pub struct AffectedResources {
389 /// The count of resources affected by the finding.
390 pub count: i64,
391
392 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
393}
394
395impl AffectedResources {
396 /// Creates a new default instance.
397 pub fn new() -> Self {
398 std::default::Default::default()
399 }
400
401 /// Sets the value of [count][crate::model::AffectedResources::count].
402 ///
403 /// # Example
404 /// ```ignore,no_run
405 /// # use google_cloud_securitycenter_v2::model::AffectedResources;
406 /// let x = AffectedResources::new().set_count(42);
407 /// ```
408 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
409 self.count = v.into();
410 self
411 }
412}
413
414impl wkt::message::Message for AffectedResources {
415 fn typename() -> &'static str {
416 "type.googleapis.com/google.cloud.securitycenter.v2.AffectedResources"
417 }
418}
419
420/// Contains information about the AI model associated with the finding.
421#[derive(Clone, Default, PartialEq)]
422#[non_exhaustive]
423pub struct AiModel {
424 /// The name of the AI model, for example, "gemini:1.0.0".
425 pub name: std::string::String,
426
427 /// The domain of the model, for example, “image-classification”.
428 pub domain: std::string::String,
429
430 /// The name of the model library, for example, “transformers”.
431 pub library: std::string::String,
432
433 /// The region in which the model is used, for example, “us-central1”.
434 pub location: std::string::String,
435
436 /// The publisher of the model, for example, “google” or “nvidia”.
437 pub publisher: std::string::String,
438
439 /// The platform on which the model is deployed.
440 pub deployment_platform: crate::model::ai_model::DeploymentPlatform,
441
442 /// The user defined display name of model. Ex. baseline-classification-model
443 pub display_name: std::string::String,
444
445 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
446}
447
448impl AiModel {
449 /// Creates a new default instance.
450 pub fn new() -> Self {
451 std::default::Default::default()
452 }
453
454 /// Sets the value of [name][crate::model::AiModel::name].
455 ///
456 /// # Example
457 /// ```ignore,no_run
458 /// # use google_cloud_securitycenter_v2::model::AiModel;
459 /// let x = AiModel::new().set_name("example");
460 /// ```
461 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
462 self.name = v.into();
463 self
464 }
465
466 /// Sets the value of [domain][crate::model::AiModel::domain].
467 ///
468 /// # Example
469 /// ```ignore,no_run
470 /// # use google_cloud_securitycenter_v2::model::AiModel;
471 /// let x = AiModel::new().set_domain("example");
472 /// ```
473 pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
474 self.domain = v.into();
475 self
476 }
477
478 /// Sets the value of [library][crate::model::AiModel::library].
479 ///
480 /// # Example
481 /// ```ignore,no_run
482 /// # use google_cloud_securitycenter_v2::model::AiModel;
483 /// let x = AiModel::new().set_library("example");
484 /// ```
485 pub fn set_library<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
486 self.library = v.into();
487 self
488 }
489
490 /// Sets the value of [location][crate::model::AiModel::location].
491 ///
492 /// # Example
493 /// ```ignore,no_run
494 /// # use google_cloud_securitycenter_v2::model::AiModel;
495 /// let x = AiModel::new().set_location("example");
496 /// ```
497 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
498 self.location = v.into();
499 self
500 }
501
502 /// Sets the value of [publisher][crate::model::AiModel::publisher].
503 ///
504 /// # Example
505 /// ```ignore,no_run
506 /// # use google_cloud_securitycenter_v2::model::AiModel;
507 /// let x = AiModel::new().set_publisher("example");
508 /// ```
509 pub fn set_publisher<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
510 self.publisher = v.into();
511 self
512 }
513
514 /// Sets the value of [deployment_platform][crate::model::AiModel::deployment_platform].
515 ///
516 /// # Example
517 /// ```ignore,no_run
518 /// # use google_cloud_securitycenter_v2::model::AiModel;
519 /// use google_cloud_securitycenter_v2::model::ai_model::DeploymentPlatform;
520 /// let x0 = AiModel::new().set_deployment_platform(DeploymentPlatform::VertexAi);
521 /// let x1 = AiModel::new().set_deployment_platform(DeploymentPlatform::Gke);
522 /// let x2 = AiModel::new().set_deployment_platform(DeploymentPlatform::Gce);
523 /// ```
524 pub fn set_deployment_platform<
525 T: std::convert::Into<crate::model::ai_model::DeploymentPlatform>,
526 >(
527 mut self,
528 v: T,
529 ) -> Self {
530 self.deployment_platform = v.into();
531 self
532 }
533
534 /// Sets the value of [display_name][crate::model::AiModel::display_name].
535 ///
536 /// # Example
537 /// ```ignore,no_run
538 /// # use google_cloud_securitycenter_v2::model::AiModel;
539 /// let x = AiModel::new().set_display_name("example");
540 /// ```
541 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
542 self.display_name = v.into();
543 self
544 }
545}
546
547impl wkt::message::Message for AiModel {
548 fn typename() -> &'static str {
549 "type.googleapis.com/google.cloud.securitycenter.v2.AiModel"
550 }
551}
552
553/// Defines additional types related to [AiModel].
554pub mod ai_model {
555 #[allow(unused_imports)]
556 use super::*;
557
558 /// The platform on which the model is deployed.
559 ///
560 /// # Working with unknown values
561 ///
562 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
563 /// additional enum variants at any time. Adding new variants is not considered
564 /// a breaking change. Applications should write their code in anticipation of:
565 ///
566 /// - New values appearing in future releases of the client library, **and**
567 /// - New values received dynamically, without application changes.
568 ///
569 /// Please consult the [Working with enums] section in the user guide for some
570 /// guidelines.
571 ///
572 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
573 #[derive(Clone, Debug, PartialEq)]
574 #[non_exhaustive]
575 pub enum DeploymentPlatform {
576 /// Unspecified deployment platform.
577 Unspecified,
578 /// Vertex AI.
579 VertexAi,
580 /// Google Kubernetes Engine.
581 Gke,
582 /// Google Compute Engine.
583 Gce,
584 /// Fine tuned model.
585 FineTunedModel,
586 /// If set, the enum was initialized with an unknown value.
587 ///
588 /// Applications can examine the value using [DeploymentPlatform::value] or
589 /// [DeploymentPlatform::name].
590 UnknownValue(deployment_platform::UnknownValue),
591 }
592
593 #[doc(hidden)]
594 pub mod deployment_platform {
595 #[allow(unused_imports)]
596 use super::*;
597 #[derive(Clone, Debug, PartialEq)]
598 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
599 }
600
601 impl DeploymentPlatform {
602 /// Gets the enum value.
603 ///
604 /// Returns `None` if the enum contains an unknown value deserialized from
605 /// the string representation of enums.
606 pub fn value(&self) -> std::option::Option<i32> {
607 match self {
608 Self::Unspecified => std::option::Option::Some(0),
609 Self::VertexAi => std::option::Option::Some(1),
610 Self::Gke => std::option::Option::Some(2),
611 Self::Gce => std::option::Option::Some(3),
612 Self::FineTunedModel => std::option::Option::Some(4),
613 Self::UnknownValue(u) => u.0.value(),
614 }
615 }
616
617 /// Gets the enum value as a string.
618 ///
619 /// Returns `None` if the enum contains an unknown value deserialized from
620 /// the integer representation of enums.
621 pub fn name(&self) -> std::option::Option<&str> {
622 match self {
623 Self::Unspecified => std::option::Option::Some("DEPLOYMENT_PLATFORM_UNSPECIFIED"),
624 Self::VertexAi => std::option::Option::Some("VERTEX_AI"),
625 Self::Gke => std::option::Option::Some("GKE"),
626 Self::Gce => std::option::Option::Some("GCE"),
627 Self::FineTunedModel => std::option::Option::Some("FINE_TUNED_MODEL"),
628 Self::UnknownValue(u) => u.0.name(),
629 }
630 }
631 }
632
633 impl std::default::Default for DeploymentPlatform {
634 fn default() -> Self {
635 use std::convert::From;
636 Self::from(0)
637 }
638 }
639
640 impl std::fmt::Display for DeploymentPlatform {
641 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
642 wkt::internal::display_enum(f, self.name(), self.value())
643 }
644 }
645
646 impl std::convert::From<i32> for DeploymentPlatform {
647 fn from(value: i32) -> Self {
648 match value {
649 0 => Self::Unspecified,
650 1 => Self::VertexAi,
651 2 => Self::Gke,
652 3 => Self::Gce,
653 4 => Self::FineTunedModel,
654 _ => Self::UnknownValue(deployment_platform::UnknownValue(
655 wkt::internal::UnknownEnumValue::Integer(value),
656 )),
657 }
658 }
659 }
660
661 impl std::convert::From<&str> for DeploymentPlatform {
662 fn from(value: &str) -> Self {
663 use std::string::ToString;
664 match value {
665 "DEPLOYMENT_PLATFORM_UNSPECIFIED" => Self::Unspecified,
666 "VERTEX_AI" => Self::VertexAi,
667 "GKE" => Self::Gke,
668 "GCE" => Self::Gce,
669 "FINE_TUNED_MODEL" => Self::FineTunedModel,
670 _ => Self::UnknownValue(deployment_platform::UnknownValue(
671 wkt::internal::UnknownEnumValue::String(value.to_string()),
672 )),
673 }
674 }
675 }
676
677 impl serde::ser::Serialize for DeploymentPlatform {
678 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
679 where
680 S: serde::Serializer,
681 {
682 match self {
683 Self::Unspecified => serializer.serialize_i32(0),
684 Self::VertexAi => serializer.serialize_i32(1),
685 Self::Gke => serializer.serialize_i32(2),
686 Self::Gce => serializer.serialize_i32(3),
687 Self::FineTunedModel => serializer.serialize_i32(4),
688 Self::UnknownValue(u) => u.0.serialize(serializer),
689 }
690 }
691 }
692
693 impl<'de> serde::de::Deserialize<'de> for DeploymentPlatform {
694 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
695 where
696 D: serde::Deserializer<'de>,
697 {
698 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeploymentPlatform>::new(
699 ".google.cloud.securitycenter.v2.AiModel.DeploymentPlatform",
700 ))
701 }
702 }
703}
704
705/// Represents an application associated with a finding.
706#[derive(Clone, Default, PartialEq)]
707#[non_exhaustive]
708pub struct Application {
709 /// The base URI that identifies the network location of the application in
710 /// which the vulnerability was detected. For example, `<http://example.com>`.
711 pub base_uri: std::string::String,
712
713 /// The full URI with payload that could be used to reproduce the
714 /// vulnerability. For example, `<http://example.com>?p=aMmYgI6H`.
715 pub full_uri: std::string::String,
716
717 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
718}
719
720impl Application {
721 /// Creates a new default instance.
722 pub fn new() -> Self {
723 std::default::Default::default()
724 }
725
726 /// Sets the value of [base_uri][crate::model::Application::base_uri].
727 ///
728 /// # Example
729 /// ```ignore,no_run
730 /// # use google_cloud_securitycenter_v2::model::Application;
731 /// let x = Application::new().set_base_uri("example");
732 /// ```
733 pub fn set_base_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
734 self.base_uri = v.into();
735 self
736 }
737
738 /// Sets the value of [full_uri][crate::model::Application::full_uri].
739 ///
740 /// # Example
741 /// ```ignore,no_run
742 /// # use google_cloud_securitycenter_v2::model::Application;
743 /// let x = Application::new().set_full_uri("example");
744 /// ```
745 pub fn set_full_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
746 self.full_uri = v.into();
747 self
748 }
749}
750
751impl wkt::message::Message for Application {
752 fn typename() -> &'static str {
753 "type.googleapis.com/google.cloud.securitycenter.v2.Application"
754 }
755}
756
757/// An attack exposure contains the results of an attack path simulation run.
758#[derive(Clone, Default, PartialEq)]
759#[non_exhaustive]
760pub struct AttackExposure {
761 /// A number between 0 (inclusive) and infinity that represents how important
762 /// this finding is to remediate. The higher the score, the more important it
763 /// is to remediate.
764 pub score: f64,
765
766 /// The most recent time the attack exposure was updated on this finding.
767 pub latest_calculation_time: std::option::Option<wkt::Timestamp>,
768
769 /// The resource name of the attack path simulation result that contains the
770 /// details regarding this attack exposure score.
771 /// Example: `organizations/123/simulations/456/attackExposureResults/789`
772 pub attack_exposure_result: std::string::String,
773
774 /// Output only. What state this AttackExposure is in. This captures whether or
775 /// not an attack exposure has been calculated or not.
776 pub state: crate::model::attack_exposure::State,
777
778 /// The number of high value resources that are exposed as a result of this
779 /// finding.
780 pub exposed_high_value_resources_count: i32,
781
782 /// The number of medium value resources that are exposed as a result of this
783 /// finding.
784 pub exposed_medium_value_resources_count: i32,
785
786 /// The number of high value resources that are exposed as a result of this
787 /// finding.
788 pub exposed_low_value_resources_count: i32,
789
790 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
791}
792
793impl AttackExposure {
794 /// Creates a new default instance.
795 pub fn new() -> Self {
796 std::default::Default::default()
797 }
798
799 /// Sets the value of [score][crate::model::AttackExposure::score].
800 ///
801 /// # Example
802 /// ```ignore,no_run
803 /// # use google_cloud_securitycenter_v2::model::AttackExposure;
804 /// let x = AttackExposure::new().set_score(42.0);
805 /// ```
806 pub fn set_score<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
807 self.score = v.into();
808 self
809 }
810
811 /// Sets the value of [latest_calculation_time][crate::model::AttackExposure::latest_calculation_time].
812 ///
813 /// # Example
814 /// ```ignore,no_run
815 /// # use google_cloud_securitycenter_v2::model::AttackExposure;
816 /// use wkt::Timestamp;
817 /// let x = AttackExposure::new().set_latest_calculation_time(Timestamp::default()/* use setters */);
818 /// ```
819 pub fn set_latest_calculation_time<T>(mut self, v: T) -> Self
820 where
821 T: std::convert::Into<wkt::Timestamp>,
822 {
823 self.latest_calculation_time = std::option::Option::Some(v.into());
824 self
825 }
826
827 /// Sets or clears the value of [latest_calculation_time][crate::model::AttackExposure::latest_calculation_time].
828 ///
829 /// # Example
830 /// ```ignore,no_run
831 /// # use google_cloud_securitycenter_v2::model::AttackExposure;
832 /// use wkt::Timestamp;
833 /// let x = AttackExposure::new().set_or_clear_latest_calculation_time(Some(Timestamp::default()/* use setters */));
834 /// let x = AttackExposure::new().set_or_clear_latest_calculation_time(None::<Timestamp>);
835 /// ```
836 pub fn set_or_clear_latest_calculation_time<T>(mut self, v: std::option::Option<T>) -> Self
837 where
838 T: std::convert::Into<wkt::Timestamp>,
839 {
840 self.latest_calculation_time = v.map(|x| x.into());
841 self
842 }
843
844 /// Sets the value of [attack_exposure_result][crate::model::AttackExposure::attack_exposure_result].
845 ///
846 /// # Example
847 /// ```ignore,no_run
848 /// # use google_cloud_securitycenter_v2::model::AttackExposure;
849 /// let x = AttackExposure::new().set_attack_exposure_result("example");
850 /// ```
851 pub fn set_attack_exposure_result<T: std::convert::Into<std::string::String>>(
852 mut self,
853 v: T,
854 ) -> Self {
855 self.attack_exposure_result = v.into();
856 self
857 }
858
859 /// Sets the value of [state][crate::model::AttackExposure::state].
860 ///
861 /// # Example
862 /// ```ignore,no_run
863 /// # use google_cloud_securitycenter_v2::model::AttackExposure;
864 /// use google_cloud_securitycenter_v2::model::attack_exposure::State;
865 /// let x0 = AttackExposure::new().set_state(State::Calculated);
866 /// let x1 = AttackExposure::new().set_state(State::NotCalculated);
867 /// ```
868 pub fn set_state<T: std::convert::Into<crate::model::attack_exposure::State>>(
869 mut self,
870 v: T,
871 ) -> Self {
872 self.state = v.into();
873 self
874 }
875
876 /// Sets the value of [exposed_high_value_resources_count][crate::model::AttackExposure::exposed_high_value_resources_count].
877 ///
878 /// # Example
879 /// ```ignore,no_run
880 /// # use google_cloud_securitycenter_v2::model::AttackExposure;
881 /// let x = AttackExposure::new().set_exposed_high_value_resources_count(42);
882 /// ```
883 pub fn set_exposed_high_value_resources_count<T: std::convert::Into<i32>>(
884 mut self,
885 v: T,
886 ) -> Self {
887 self.exposed_high_value_resources_count = v.into();
888 self
889 }
890
891 /// Sets the value of [exposed_medium_value_resources_count][crate::model::AttackExposure::exposed_medium_value_resources_count].
892 ///
893 /// # Example
894 /// ```ignore,no_run
895 /// # use google_cloud_securitycenter_v2::model::AttackExposure;
896 /// let x = AttackExposure::new().set_exposed_medium_value_resources_count(42);
897 /// ```
898 pub fn set_exposed_medium_value_resources_count<T: std::convert::Into<i32>>(
899 mut self,
900 v: T,
901 ) -> Self {
902 self.exposed_medium_value_resources_count = v.into();
903 self
904 }
905
906 /// Sets the value of [exposed_low_value_resources_count][crate::model::AttackExposure::exposed_low_value_resources_count].
907 ///
908 /// # Example
909 /// ```ignore,no_run
910 /// # use google_cloud_securitycenter_v2::model::AttackExposure;
911 /// let x = AttackExposure::new().set_exposed_low_value_resources_count(42);
912 /// ```
913 pub fn set_exposed_low_value_resources_count<T: std::convert::Into<i32>>(
914 mut self,
915 v: T,
916 ) -> Self {
917 self.exposed_low_value_resources_count = v.into();
918 self
919 }
920}
921
922impl wkt::message::Message for AttackExposure {
923 fn typename() -> &'static str {
924 "type.googleapis.com/google.cloud.securitycenter.v2.AttackExposure"
925 }
926}
927
928/// Defines additional types related to [AttackExposure].
929pub mod attack_exposure {
930 #[allow(unused_imports)]
931 use super::*;
932
933 /// This enum defines the various states an AttackExposure can be in.
934 ///
935 /// # Working with unknown values
936 ///
937 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
938 /// additional enum variants at any time. Adding new variants is not considered
939 /// a breaking change. Applications should write their code in anticipation of:
940 ///
941 /// - New values appearing in future releases of the client library, **and**
942 /// - New values received dynamically, without application changes.
943 ///
944 /// Please consult the [Working with enums] section in the user guide for some
945 /// guidelines.
946 ///
947 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
948 #[derive(Clone, Debug, PartialEq)]
949 #[non_exhaustive]
950 pub enum State {
951 /// The state is not specified.
952 Unspecified,
953 /// The attack exposure has been calculated.
954 Calculated,
955 /// The attack exposure has not been calculated.
956 NotCalculated,
957 /// If set, the enum was initialized with an unknown value.
958 ///
959 /// Applications can examine the value using [State::value] or
960 /// [State::name].
961 UnknownValue(state::UnknownValue),
962 }
963
964 #[doc(hidden)]
965 pub mod state {
966 #[allow(unused_imports)]
967 use super::*;
968 #[derive(Clone, Debug, PartialEq)]
969 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
970 }
971
972 impl State {
973 /// Gets the enum value.
974 ///
975 /// Returns `None` if the enum contains an unknown value deserialized from
976 /// the string representation of enums.
977 pub fn value(&self) -> std::option::Option<i32> {
978 match self {
979 Self::Unspecified => std::option::Option::Some(0),
980 Self::Calculated => std::option::Option::Some(1),
981 Self::NotCalculated => std::option::Option::Some(2),
982 Self::UnknownValue(u) => u.0.value(),
983 }
984 }
985
986 /// Gets the enum value as a string.
987 ///
988 /// Returns `None` if the enum contains an unknown value deserialized from
989 /// the integer representation of enums.
990 pub fn name(&self) -> std::option::Option<&str> {
991 match self {
992 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
993 Self::Calculated => std::option::Option::Some("CALCULATED"),
994 Self::NotCalculated => std::option::Option::Some("NOT_CALCULATED"),
995 Self::UnknownValue(u) => u.0.name(),
996 }
997 }
998 }
999
1000 impl std::default::Default for State {
1001 fn default() -> Self {
1002 use std::convert::From;
1003 Self::from(0)
1004 }
1005 }
1006
1007 impl std::fmt::Display for State {
1008 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1009 wkt::internal::display_enum(f, self.name(), self.value())
1010 }
1011 }
1012
1013 impl std::convert::From<i32> for State {
1014 fn from(value: i32) -> Self {
1015 match value {
1016 0 => Self::Unspecified,
1017 1 => Self::Calculated,
1018 2 => Self::NotCalculated,
1019 _ => Self::UnknownValue(state::UnknownValue(
1020 wkt::internal::UnknownEnumValue::Integer(value),
1021 )),
1022 }
1023 }
1024 }
1025
1026 impl std::convert::From<&str> for State {
1027 fn from(value: &str) -> Self {
1028 use std::string::ToString;
1029 match value {
1030 "STATE_UNSPECIFIED" => Self::Unspecified,
1031 "CALCULATED" => Self::Calculated,
1032 "NOT_CALCULATED" => Self::NotCalculated,
1033 _ => Self::UnknownValue(state::UnknownValue(
1034 wkt::internal::UnknownEnumValue::String(value.to_string()),
1035 )),
1036 }
1037 }
1038 }
1039
1040 impl serde::ser::Serialize for State {
1041 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1042 where
1043 S: serde::Serializer,
1044 {
1045 match self {
1046 Self::Unspecified => serializer.serialize_i32(0),
1047 Self::Calculated => serializer.serialize_i32(1),
1048 Self::NotCalculated => serializer.serialize_i32(2),
1049 Self::UnknownValue(u) => u.0.serialize(serializer),
1050 }
1051 }
1052 }
1053
1054 impl<'de> serde::de::Deserialize<'de> for State {
1055 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1056 where
1057 D: serde::Deserializer<'de>,
1058 {
1059 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1060 ".google.cloud.securitycenter.v2.AttackExposure.State",
1061 ))
1062 }
1063 }
1064}
1065
1066/// A path that an attacker could take to reach an exposed resource.
1067#[derive(Clone, Default, PartialEq)]
1068#[non_exhaustive]
1069pub struct AttackPath {
1070 /// The attack path name, for example,
1071 /// `organizations/12/simulations/34/valuedResources/56/attackPaths/78`
1072 pub name: std::string::String,
1073
1074 /// A list of nodes that exist in this attack path.
1075 pub path_nodes: std::vec::Vec<crate::model::attack_path::AttackPathNode>,
1076
1077 /// A list of the edges between nodes in this attack path.
1078 pub edges: std::vec::Vec<crate::model::attack_path::AttackPathEdge>,
1079
1080 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1081}
1082
1083impl AttackPath {
1084 /// Creates a new default instance.
1085 pub fn new() -> Self {
1086 std::default::Default::default()
1087 }
1088
1089 /// Sets the value of [name][crate::model::AttackPath::name].
1090 ///
1091 /// # Example
1092 /// ```ignore,no_run
1093 /// # use google_cloud_securitycenter_v2::model::AttackPath;
1094 /// let x = AttackPath::new().set_name("example");
1095 /// ```
1096 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1097 self.name = v.into();
1098 self
1099 }
1100
1101 /// Sets the value of [path_nodes][crate::model::AttackPath::path_nodes].
1102 ///
1103 /// # Example
1104 /// ```ignore,no_run
1105 /// # use google_cloud_securitycenter_v2::model::AttackPath;
1106 /// use google_cloud_securitycenter_v2::model::attack_path::AttackPathNode;
1107 /// let x = AttackPath::new()
1108 /// .set_path_nodes([
1109 /// AttackPathNode::default()/* use setters */,
1110 /// AttackPathNode::default()/* use (different) setters */,
1111 /// ]);
1112 /// ```
1113 pub fn set_path_nodes<T, V>(mut self, v: T) -> Self
1114 where
1115 T: std::iter::IntoIterator<Item = V>,
1116 V: std::convert::Into<crate::model::attack_path::AttackPathNode>,
1117 {
1118 use std::iter::Iterator;
1119 self.path_nodes = v.into_iter().map(|i| i.into()).collect();
1120 self
1121 }
1122
1123 /// Sets the value of [edges][crate::model::AttackPath::edges].
1124 ///
1125 /// # Example
1126 /// ```ignore,no_run
1127 /// # use google_cloud_securitycenter_v2::model::AttackPath;
1128 /// use google_cloud_securitycenter_v2::model::attack_path::AttackPathEdge;
1129 /// let x = AttackPath::new()
1130 /// .set_edges([
1131 /// AttackPathEdge::default()/* use setters */,
1132 /// AttackPathEdge::default()/* use (different) setters */,
1133 /// ]);
1134 /// ```
1135 pub fn set_edges<T, V>(mut self, v: T) -> Self
1136 where
1137 T: std::iter::IntoIterator<Item = V>,
1138 V: std::convert::Into<crate::model::attack_path::AttackPathEdge>,
1139 {
1140 use std::iter::Iterator;
1141 self.edges = v.into_iter().map(|i| i.into()).collect();
1142 self
1143 }
1144}
1145
1146impl wkt::message::Message for AttackPath {
1147 fn typename() -> &'static str {
1148 "type.googleapis.com/google.cloud.securitycenter.v2.AttackPath"
1149 }
1150}
1151
1152/// Defines additional types related to [AttackPath].
1153pub mod attack_path {
1154 #[allow(unused_imports)]
1155 use super::*;
1156
1157 /// Represents one point that an attacker passes through in this attack path.
1158 #[derive(Clone, Default, PartialEq)]
1159 #[non_exhaustive]
1160 pub struct AttackPathNode {
1161 /// The name of the resource at this point in the attack path.
1162 /// The format of the name follows the Cloud Asset Inventory [resource
1163 /// name
1164 /// format](https://cloud.google.com/asset-inventory/docs/resource-name-format)
1165 pub resource: std::string::String,
1166
1167 /// The [supported resource
1168 /// type](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
1169 pub resource_type: std::string::String,
1170
1171 /// Human-readable name of this resource.
1172 pub display_name: std::string::String,
1173
1174 /// The findings associated with this node in the attack path.
1175 pub associated_findings:
1176 std::vec::Vec<crate::model::attack_path::attack_path_node::PathNodeAssociatedFinding>,
1177
1178 /// Unique id of the attack path node.
1179 pub uuid: std::string::String,
1180
1181 /// A list of attack step nodes that exist in this attack path node.
1182 pub attack_steps:
1183 std::vec::Vec<crate::model::attack_path::attack_path_node::AttackStepNode>,
1184
1185 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1186 }
1187
1188 impl AttackPathNode {
1189 /// Creates a new default instance.
1190 pub fn new() -> Self {
1191 std::default::Default::default()
1192 }
1193
1194 /// Sets the value of [resource][crate::model::attack_path::AttackPathNode::resource].
1195 ///
1196 /// # Example
1197 /// ```ignore,no_run
1198 /// # use google_cloud_securitycenter_v2::model::attack_path::AttackPathNode;
1199 /// let x = AttackPathNode::new().set_resource("example");
1200 /// ```
1201 pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1202 self.resource = v.into();
1203 self
1204 }
1205
1206 /// Sets the value of [resource_type][crate::model::attack_path::AttackPathNode::resource_type].
1207 ///
1208 /// # Example
1209 /// ```ignore,no_run
1210 /// # use google_cloud_securitycenter_v2::model::attack_path::AttackPathNode;
1211 /// let x = AttackPathNode::new().set_resource_type("example");
1212 /// ```
1213 pub fn set_resource_type<T: std::convert::Into<std::string::String>>(
1214 mut self,
1215 v: T,
1216 ) -> Self {
1217 self.resource_type = v.into();
1218 self
1219 }
1220
1221 /// Sets the value of [display_name][crate::model::attack_path::AttackPathNode::display_name].
1222 ///
1223 /// # Example
1224 /// ```ignore,no_run
1225 /// # use google_cloud_securitycenter_v2::model::attack_path::AttackPathNode;
1226 /// let x = AttackPathNode::new().set_display_name("example");
1227 /// ```
1228 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
1229 mut self,
1230 v: T,
1231 ) -> Self {
1232 self.display_name = v.into();
1233 self
1234 }
1235
1236 /// Sets the value of [associated_findings][crate::model::attack_path::AttackPathNode::associated_findings].
1237 ///
1238 /// # Example
1239 /// ```ignore,no_run
1240 /// # use google_cloud_securitycenter_v2::model::attack_path::AttackPathNode;
1241 /// use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::PathNodeAssociatedFinding;
1242 /// let x = AttackPathNode::new()
1243 /// .set_associated_findings([
1244 /// PathNodeAssociatedFinding::default()/* use setters */,
1245 /// PathNodeAssociatedFinding::default()/* use (different) setters */,
1246 /// ]);
1247 /// ```
1248 pub fn set_associated_findings<T, V>(mut self, v: T) -> Self
1249 where
1250 T: std::iter::IntoIterator<Item = V>,
1251 V: std::convert::Into<
1252 crate::model::attack_path::attack_path_node::PathNodeAssociatedFinding,
1253 >,
1254 {
1255 use std::iter::Iterator;
1256 self.associated_findings = v.into_iter().map(|i| i.into()).collect();
1257 self
1258 }
1259
1260 /// Sets the value of [uuid][crate::model::attack_path::AttackPathNode::uuid].
1261 ///
1262 /// # Example
1263 /// ```ignore,no_run
1264 /// # use google_cloud_securitycenter_v2::model::attack_path::AttackPathNode;
1265 /// let x = AttackPathNode::new().set_uuid("example");
1266 /// ```
1267 pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1268 self.uuid = v.into();
1269 self
1270 }
1271
1272 /// Sets the value of [attack_steps][crate::model::attack_path::AttackPathNode::attack_steps].
1273 ///
1274 /// # Example
1275 /// ```ignore,no_run
1276 /// # use google_cloud_securitycenter_v2::model::attack_path::AttackPathNode;
1277 /// use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::AttackStepNode;
1278 /// let x = AttackPathNode::new()
1279 /// .set_attack_steps([
1280 /// AttackStepNode::default()/* use setters */,
1281 /// AttackStepNode::default()/* use (different) setters */,
1282 /// ]);
1283 /// ```
1284 pub fn set_attack_steps<T, V>(mut self, v: T) -> Self
1285 where
1286 T: std::iter::IntoIterator<Item = V>,
1287 V: std::convert::Into<crate::model::attack_path::attack_path_node::AttackStepNode>,
1288 {
1289 use std::iter::Iterator;
1290 self.attack_steps = v.into_iter().map(|i| i.into()).collect();
1291 self
1292 }
1293 }
1294
1295 impl wkt::message::Message for AttackPathNode {
1296 fn typename() -> &'static str {
1297 "type.googleapis.com/google.cloud.securitycenter.v2.AttackPath.AttackPathNode"
1298 }
1299 }
1300
1301 /// Defines additional types related to [AttackPathNode].
1302 pub mod attack_path_node {
1303 #[allow(unused_imports)]
1304 use super::*;
1305
1306 /// A finding that is associated with this node in the attack path.
1307 #[derive(Clone, Default, PartialEq)]
1308 #[non_exhaustive]
1309 pub struct PathNodeAssociatedFinding {
1310 /// Canonical name of the associated findings. Example:
1311 /// `organizations/123/sources/456/findings/789`
1312 pub canonical_finding: std::string::String,
1313
1314 /// The additional taxonomy group within findings from a given source.
1315 pub finding_category: std::string::String,
1316
1317 /// Full resource name of the finding.
1318 pub name: std::string::String,
1319
1320 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1321 }
1322
1323 impl PathNodeAssociatedFinding {
1324 /// Creates a new default instance.
1325 pub fn new() -> Self {
1326 std::default::Default::default()
1327 }
1328
1329 /// Sets the value of [canonical_finding][crate::model::attack_path::attack_path_node::PathNodeAssociatedFinding::canonical_finding].
1330 ///
1331 /// # Example
1332 /// ```ignore,no_run
1333 /// # use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::PathNodeAssociatedFinding;
1334 /// let x = PathNodeAssociatedFinding::new().set_canonical_finding("example");
1335 /// ```
1336 pub fn set_canonical_finding<T: std::convert::Into<std::string::String>>(
1337 mut self,
1338 v: T,
1339 ) -> Self {
1340 self.canonical_finding = v.into();
1341 self
1342 }
1343
1344 /// Sets the value of [finding_category][crate::model::attack_path::attack_path_node::PathNodeAssociatedFinding::finding_category].
1345 ///
1346 /// # Example
1347 /// ```ignore,no_run
1348 /// # use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::PathNodeAssociatedFinding;
1349 /// let x = PathNodeAssociatedFinding::new().set_finding_category("example");
1350 /// ```
1351 pub fn set_finding_category<T: std::convert::Into<std::string::String>>(
1352 mut self,
1353 v: T,
1354 ) -> Self {
1355 self.finding_category = v.into();
1356 self
1357 }
1358
1359 /// Sets the value of [name][crate::model::attack_path::attack_path_node::PathNodeAssociatedFinding::name].
1360 ///
1361 /// # Example
1362 /// ```ignore,no_run
1363 /// # use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::PathNodeAssociatedFinding;
1364 /// let x = PathNodeAssociatedFinding::new().set_name("example");
1365 /// ```
1366 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1367 self.name = v.into();
1368 self
1369 }
1370 }
1371
1372 impl wkt::message::Message for PathNodeAssociatedFinding {
1373 fn typename() -> &'static str {
1374 "type.googleapis.com/google.cloud.securitycenter.v2.AttackPath.AttackPathNode.PathNodeAssociatedFinding"
1375 }
1376 }
1377
1378 /// Detailed steps the attack can take between path nodes.
1379 #[derive(Clone, Default, PartialEq)]
1380 #[non_exhaustive]
1381 pub struct AttackStepNode {
1382 /// Unique ID for one Node
1383 pub uuid: std::string::String,
1384
1385 /// Attack step type. Can be either AND, OR or DEFENSE
1386 pub r#type: crate::model::attack_path::attack_path_node::NodeType,
1387
1388 /// User friendly name of the attack step
1389 pub display_name: std::string::String,
1390
1391 /// Attack step labels for metadata
1392 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1393
1394 /// Attack step description
1395 pub description: std::string::String,
1396
1397 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1398 }
1399
1400 impl AttackStepNode {
1401 /// Creates a new default instance.
1402 pub fn new() -> Self {
1403 std::default::Default::default()
1404 }
1405
1406 /// Sets the value of [uuid][crate::model::attack_path::attack_path_node::AttackStepNode::uuid].
1407 ///
1408 /// # Example
1409 /// ```ignore,no_run
1410 /// # use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::AttackStepNode;
1411 /// let x = AttackStepNode::new().set_uuid("example");
1412 /// ```
1413 pub fn set_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1414 self.uuid = v.into();
1415 self
1416 }
1417
1418 /// Sets the value of [r#type][crate::model::attack_path::attack_path_node::AttackStepNode::type].
1419 ///
1420 /// # Example
1421 /// ```ignore,no_run
1422 /// # use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::AttackStepNode;
1423 /// use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::NodeType;
1424 /// let x0 = AttackStepNode::new().set_type(NodeType::And);
1425 /// let x1 = AttackStepNode::new().set_type(NodeType::Or);
1426 /// let x2 = AttackStepNode::new().set_type(NodeType::Defense);
1427 /// ```
1428 pub fn set_type<
1429 T: std::convert::Into<crate::model::attack_path::attack_path_node::NodeType>,
1430 >(
1431 mut self,
1432 v: T,
1433 ) -> Self {
1434 self.r#type = v.into();
1435 self
1436 }
1437
1438 /// Sets the value of [display_name][crate::model::attack_path::attack_path_node::AttackStepNode::display_name].
1439 ///
1440 /// # Example
1441 /// ```ignore,no_run
1442 /// # use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::AttackStepNode;
1443 /// let x = AttackStepNode::new().set_display_name("example");
1444 /// ```
1445 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
1446 mut self,
1447 v: T,
1448 ) -> Self {
1449 self.display_name = v.into();
1450 self
1451 }
1452
1453 /// Sets the value of [labels][crate::model::attack_path::attack_path_node::AttackStepNode::labels].
1454 ///
1455 /// # Example
1456 /// ```ignore,no_run
1457 /// # use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::AttackStepNode;
1458 /// let x = AttackStepNode::new().set_labels([
1459 /// ("key0", "abc"),
1460 /// ("key1", "xyz"),
1461 /// ]);
1462 /// ```
1463 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1464 where
1465 T: std::iter::IntoIterator<Item = (K, V)>,
1466 K: std::convert::Into<std::string::String>,
1467 V: std::convert::Into<std::string::String>,
1468 {
1469 use std::iter::Iterator;
1470 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1471 self
1472 }
1473
1474 /// Sets the value of [description][crate::model::attack_path::attack_path_node::AttackStepNode::description].
1475 ///
1476 /// # Example
1477 /// ```ignore,no_run
1478 /// # use google_cloud_securitycenter_v2::model::attack_path::attack_path_node::AttackStepNode;
1479 /// let x = AttackStepNode::new().set_description("example");
1480 /// ```
1481 pub fn set_description<T: std::convert::Into<std::string::String>>(
1482 mut self,
1483 v: T,
1484 ) -> Self {
1485 self.description = v.into();
1486 self
1487 }
1488 }
1489
1490 impl wkt::message::Message for AttackStepNode {
1491 fn typename() -> &'static str {
1492 "type.googleapis.com/google.cloud.securitycenter.v2.AttackPath.AttackPathNode.AttackStepNode"
1493 }
1494 }
1495
1496 /// The type of the incoming attack step node.
1497 ///
1498 /// # Working with unknown values
1499 ///
1500 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1501 /// additional enum variants at any time. Adding new variants is not considered
1502 /// a breaking change. Applications should write their code in anticipation of:
1503 ///
1504 /// - New values appearing in future releases of the client library, **and**
1505 /// - New values received dynamically, without application changes.
1506 ///
1507 /// Please consult the [Working with enums] section in the user guide for some
1508 /// guidelines.
1509 ///
1510 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1511 #[derive(Clone, Debug, PartialEq)]
1512 #[non_exhaustive]
1513 pub enum NodeType {
1514 /// Type not specified
1515 Unspecified,
1516 /// Incoming edge joined with AND
1517 And,
1518 /// Incoming edge joined with OR
1519 Or,
1520 /// Incoming edge is defense
1521 Defense,
1522 /// Incoming edge is attacker
1523 Attacker,
1524 /// If set, the enum was initialized with an unknown value.
1525 ///
1526 /// Applications can examine the value using [NodeType::value] or
1527 /// [NodeType::name].
1528 UnknownValue(node_type::UnknownValue),
1529 }
1530
1531 #[doc(hidden)]
1532 pub mod node_type {
1533 #[allow(unused_imports)]
1534 use super::*;
1535 #[derive(Clone, Debug, PartialEq)]
1536 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1537 }
1538
1539 impl NodeType {
1540 /// Gets the enum value.
1541 ///
1542 /// Returns `None` if the enum contains an unknown value deserialized from
1543 /// the string representation of enums.
1544 pub fn value(&self) -> std::option::Option<i32> {
1545 match self {
1546 Self::Unspecified => std::option::Option::Some(0),
1547 Self::And => std::option::Option::Some(1),
1548 Self::Or => std::option::Option::Some(2),
1549 Self::Defense => std::option::Option::Some(3),
1550 Self::Attacker => std::option::Option::Some(4),
1551 Self::UnknownValue(u) => u.0.value(),
1552 }
1553 }
1554
1555 /// Gets the enum value as a string.
1556 ///
1557 /// Returns `None` if the enum contains an unknown value deserialized from
1558 /// the integer representation of enums.
1559 pub fn name(&self) -> std::option::Option<&str> {
1560 match self {
1561 Self::Unspecified => std::option::Option::Some("NODE_TYPE_UNSPECIFIED"),
1562 Self::And => std::option::Option::Some("NODE_TYPE_AND"),
1563 Self::Or => std::option::Option::Some("NODE_TYPE_OR"),
1564 Self::Defense => std::option::Option::Some("NODE_TYPE_DEFENSE"),
1565 Self::Attacker => std::option::Option::Some("NODE_TYPE_ATTACKER"),
1566 Self::UnknownValue(u) => u.0.name(),
1567 }
1568 }
1569 }
1570
1571 impl std::default::Default for NodeType {
1572 fn default() -> Self {
1573 use std::convert::From;
1574 Self::from(0)
1575 }
1576 }
1577
1578 impl std::fmt::Display for NodeType {
1579 fn fmt(
1580 &self,
1581 f: &mut std::fmt::Formatter<'_>,
1582 ) -> std::result::Result<(), std::fmt::Error> {
1583 wkt::internal::display_enum(f, self.name(), self.value())
1584 }
1585 }
1586
1587 impl std::convert::From<i32> for NodeType {
1588 fn from(value: i32) -> Self {
1589 match value {
1590 0 => Self::Unspecified,
1591 1 => Self::And,
1592 2 => Self::Or,
1593 3 => Self::Defense,
1594 4 => Self::Attacker,
1595 _ => Self::UnknownValue(node_type::UnknownValue(
1596 wkt::internal::UnknownEnumValue::Integer(value),
1597 )),
1598 }
1599 }
1600 }
1601
1602 impl std::convert::From<&str> for NodeType {
1603 fn from(value: &str) -> Self {
1604 use std::string::ToString;
1605 match value {
1606 "NODE_TYPE_UNSPECIFIED" => Self::Unspecified,
1607 "NODE_TYPE_AND" => Self::And,
1608 "NODE_TYPE_OR" => Self::Or,
1609 "NODE_TYPE_DEFENSE" => Self::Defense,
1610 "NODE_TYPE_ATTACKER" => Self::Attacker,
1611 _ => Self::UnknownValue(node_type::UnknownValue(
1612 wkt::internal::UnknownEnumValue::String(value.to_string()),
1613 )),
1614 }
1615 }
1616 }
1617
1618 impl serde::ser::Serialize for NodeType {
1619 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1620 where
1621 S: serde::Serializer,
1622 {
1623 match self {
1624 Self::Unspecified => serializer.serialize_i32(0),
1625 Self::And => serializer.serialize_i32(1),
1626 Self::Or => serializer.serialize_i32(2),
1627 Self::Defense => serializer.serialize_i32(3),
1628 Self::Attacker => serializer.serialize_i32(4),
1629 Self::UnknownValue(u) => u.0.serialize(serializer),
1630 }
1631 }
1632 }
1633
1634 impl<'de> serde::de::Deserialize<'de> for NodeType {
1635 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1636 where
1637 D: serde::Deserializer<'de>,
1638 {
1639 deserializer.deserialize_any(wkt::internal::EnumVisitor::<NodeType>::new(
1640 ".google.cloud.securitycenter.v2.AttackPath.AttackPathNode.NodeType",
1641 ))
1642 }
1643 }
1644 }
1645
1646 /// Represents a connection between a source node and a destination node in
1647 /// this attack path.
1648 #[derive(Clone, Default, PartialEq)]
1649 #[non_exhaustive]
1650 pub struct AttackPathEdge {
1651 /// The attack node uuid of the source node.
1652 pub source: std::string::String,
1653
1654 /// The attack node uuid of the destination node.
1655 pub destination: std::string::String,
1656
1657 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1658 }
1659
1660 impl AttackPathEdge {
1661 /// Creates a new default instance.
1662 pub fn new() -> Self {
1663 std::default::Default::default()
1664 }
1665
1666 /// Sets the value of [source][crate::model::attack_path::AttackPathEdge::source].
1667 ///
1668 /// # Example
1669 /// ```ignore,no_run
1670 /// # use google_cloud_securitycenter_v2::model::attack_path::AttackPathEdge;
1671 /// let x = AttackPathEdge::new().set_source("example");
1672 /// ```
1673 pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1674 self.source = v.into();
1675 self
1676 }
1677
1678 /// Sets the value of [destination][crate::model::attack_path::AttackPathEdge::destination].
1679 ///
1680 /// # Example
1681 /// ```ignore,no_run
1682 /// # use google_cloud_securitycenter_v2::model::attack_path::AttackPathEdge;
1683 /// let x = AttackPathEdge::new().set_destination("example");
1684 /// ```
1685 pub fn set_destination<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1686 self.destination = v.into();
1687 self
1688 }
1689 }
1690
1691 impl wkt::message::Message for AttackPathEdge {
1692 fn typename() -> &'static str {
1693 "type.googleapis.com/google.cloud.securitycenter.v2.AttackPath.AttackPathEdge"
1694 }
1695 }
1696}
1697
1698/// Information related to Google Cloud Backup and DR Service findings.
1699#[derive(Clone, Default, PartialEq)]
1700#[non_exhaustive]
1701pub struct BackupDisasterRecovery {
1702 /// The name of a Backup and DR template which comprises one or more backup
1703 /// policies. See the [Backup and DR
1704 /// documentation](https://cloud.google.com/backup-disaster-recovery/docs/concepts/backup-plan#temp)
1705 /// for more information. For example, `snap-ov`.
1706 pub backup_template: std::string::String,
1707
1708 /// The names of Backup and DR policies that are associated with a template
1709 /// and that define when to run a backup, how frequently to run a backup, and
1710 /// how long to retain the backup image. For example, `onvaults`.
1711 pub policies: std::vec::Vec<std::string::String>,
1712
1713 /// The name of a Backup and DR host, which is managed by the backup and
1714 /// recovery appliance and known to the management console. The host can be of
1715 /// type Generic (for example, Compute Engine, SQL Server, Oracle DB, SMB file
1716 /// system, etc.), vCenter, or an ESX server. See the [Backup and DR
1717 /// documentation on
1718 /// hosts](https://cloud.google.com/backup-disaster-recovery/docs/configuration/manage-hosts-and-their-applications)
1719 /// for more information. For example, `centos7-01`.
1720 pub host: std::string::String,
1721
1722 /// The names of Backup and DR applications. An application is a VM, database,
1723 /// or file system on a managed host monitored by a backup and recovery
1724 /// appliance. For example, `centos7-01-vol00`, `centos7-01-vol01`,
1725 /// `centos7-01-vol02`.
1726 pub applications: std::vec::Vec<std::string::String>,
1727
1728 /// The name of the Backup and DR storage pool that the backup and recovery
1729 /// appliance is storing data in. The storage pool could be of type Cloud,
1730 /// Primary, Snapshot, or OnVault. See the [Backup and DR documentation on
1731 /// storage
1732 /// pools](https://cloud.google.com/backup-disaster-recovery/docs/concepts/storage-pools).
1733 /// For example, `DiskPoolOne`.
1734 pub storage_pool: std::string::String,
1735
1736 /// The names of Backup and DR advanced policy options of a policy applying to
1737 /// an application. See the [Backup and DR documentation on policy
1738 /// options](https://cloud.google.com/backup-disaster-recovery/docs/create-plan/policy-settings).
1739 /// For example, `skipofflineappsincongrp, nounmap`.
1740 pub policy_options: std::vec::Vec<std::string::String>,
1741
1742 /// The name of the Backup and DR resource profile that specifies the storage
1743 /// media for backups of application and VM data. See the [Backup and DR
1744 /// documentation on
1745 /// profiles](https://cloud.google.com/backup-disaster-recovery/docs/concepts/backup-plan#profile).
1746 /// For example, `GCP`.
1747 pub profile: std::string::String,
1748
1749 /// The name of the Backup and DR appliance that captures, moves, and manages
1750 /// the lifecycle of backup data. For example, `backup-server-57137`.
1751 pub appliance: std::string::String,
1752
1753 /// The backup type of the Backup and DR image.
1754 /// For example, `Snapshot`, `Remote Snapshot`, `OnVault`.
1755 pub backup_type: std::string::String,
1756
1757 /// The timestamp at which the Backup and DR backup was created.
1758 pub backup_create_time: std::option::Option<wkt::Timestamp>,
1759
1760 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1761}
1762
1763impl BackupDisasterRecovery {
1764 /// Creates a new default instance.
1765 pub fn new() -> Self {
1766 std::default::Default::default()
1767 }
1768
1769 /// Sets the value of [backup_template][crate::model::BackupDisasterRecovery::backup_template].
1770 ///
1771 /// # Example
1772 /// ```ignore,no_run
1773 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1774 /// let x = BackupDisasterRecovery::new().set_backup_template("example");
1775 /// ```
1776 pub fn set_backup_template<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1777 self.backup_template = v.into();
1778 self
1779 }
1780
1781 /// Sets the value of [policies][crate::model::BackupDisasterRecovery::policies].
1782 ///
1783 /// # Example
1784 /// ```ignore,no_run
1785 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1786 /// let x = BackupDisasterRecovery::new().set_policies(["a", "b", "c"]);
1787 /// ```
1788 pub fn set_policies<T, V>(mut self, v: T) -> Self
1789 where
1790 T: std::iter::IntoIterator<Item = V>,
1791 V: std::convert::Into<std::string::String>,
1792 {
1793 use std::iter::Iterator;
1794 self.policies = v.into_iter().map(|i| i.into()).collect();
1795 self
1796 }
1797
1798 /// Sets the value of [host][crate::model::BackupDisasterRecovery::host].
1799 ///
1800 /// # Example
1801 /// ```ignore,no_run
1802 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1803 /// let x = BackupDisasterRecovery::new().set_host("example");
1804 /// ```
1805 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1806 self.host = v.into();
1807 self
1808 }
1809
1810 /// Sets the value of [applications][crate::model::BackupDisasterRecovery::applications].
1811 ///
1812 /// # Example
1813 /// ```ignore,no_run
1814 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1815 /// let x = BackupDisasterRecovery::new().set_applications(["a", "b", "c"]);
1816 /// ```
1817 pub fn set_applications<T, V>(mut self, v: T) -> Self
1818 where
1819 T: std::iter::IntoIterator<Item = V>,
1820 V: std::convert::Into<std::string::String>,
1821 {
1822 use std::iter::Iterator;
1823 self.applications = v.into_iter().map(|i| i.into()).collect();
1824 self
1825 }
1826
1827 /// Sets the value of [storage_pool][crate::model::BackupDisasterRecovery::storage_pool].
1828 ///
1829 /// # Example
1830 /// ```ignore,no_run
1831 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1832 /// let x = BackupDisasterRecovery::new().set_storage_pool("example");
1833 /// ```
1834 pub fn set_storage_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1835 self.storage_pool = v.into();
1836 self
1837 }
1838
1839 /// Sets the value of [policy_options][crate::model::BackupDisasterRecovery::policy_options].
1840 ///
1841 /// # Example
1842 /// ```ignore,no_run
1843 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1844 /// let x = BackupDisasterRecovery::new().set_policy_options(["a", "b", "c"]);
1845 /// ```
1846 pub fn set_policy_options<T, V>(mut self, v: T) -> Self
1847 where
1848 T: std::iter::IntoIterator<Item = V>,
1849 V: std::convert::Into<std::string::String>,
1850 {
1851 use std::iter::Iterator;
1852 self.policy_options = v.into_iter().map(|i| i.into()).collect();
1853 self
1854 }
1855
1856 /// Sets the value of [profile][crate::model::BackupDisasterRecovery::profile].
1857 ///
1858 /// # Example
1859 /// ```ignore,no_run
1860 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1861 /// let x = BackupDisasterRecovery::new().set_profile("example");
1862 /// ```
1863 pub fn set_profile<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1864 self.profile = v.into();
1865 self
1866 }
1867
1868 /// Sets the value of [appliance][crate::model::BackupDisasterRecovery::appliance].
1869 ///
1870 /// # Example
1871 /// ```ignore,no_run
1872 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1873 /// let x = BackupDisasterRecovery::new().set_appliance("example");
1874 /// ```
1875 pub fn set_appliance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1876 self.appliance = v.into();
1877 self
1878 }
1879
1880 /// Sets the value of [backup_type][crate::model::BackupDisasterRecovery::backup_type].
1881 ///
1882 /// # Example
1883 /// ```ignore,no_run
1884 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1885 /// let x = BackupDisasterRecovery::new().set_backup_type("example");
1886 /// ```
1887 pub fn set_backup_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1888 self.backup_type = v.into();
1889 self
1890 }
1891
1892 /// Sets the value of [backup_create_time][crate::model::BackupDisasterRecovery::backup_create_time].
1893 ///
1894 /// # Example
1895 /// ```ignore,no_run
1896 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1897 /// use wkt::Timestamp;
1898 /// let x = BackupDisasterRecovery::new().set_backup_create_time(Timestamp::default()/* use setters */);
1899 /// ```
1900 pub fn set_backup_create_time<T>(mut self, v: T) -> Self
1901 where
1902 T: std::convert::Into<wkt::Timestamp>,
1903 {
1904 self.backup_create_time = std::option::Option::Some(v.into());
1905 self
1906 }
1907
1908 /// Sets or clears the value of [backup_create_time][crate::model::BackupDisasterRecovery::backup_create_time].
1909 ///
1910 /// # Example
1911 /// ```ignore,no_run
1912 /// # use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
1913 /// use wkt::Timestamp;
1914 /// let x = BackupDisasterRecovery::new().set_or_clear_backup_create_time(Some(Timestamp::default()/* use setters */));
1915 /// let x = BackupDisasterRecovery::new().set_or_clear_backup_create_time(None::<Timestamp>);
1916 /// ```
1917 pub fn set_or_clear_backup_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1918 where
1919 T: std::convert::Into<wkt::Timestamp>,
1920 {
1921 self.backup_create_time = v.map(|x| x.into());
1922 self
1923 }
1924}
1925
1926impl wkt::message::Message for BackupDisasterRecovery {
1927 fn typename() -> &'static str {
1928 "type.googleapis.com/google.cloud.securitycenter.v2.BackupDisasterRecovery"
1929 }
1930}
1931
1932/// Configures how to deliver Findings to BigQuery Instance.
1933#[derive(Clone, Default, PartialEq)]
1934#[non_exhaustive]
1935pub struct BigQueryExport {
1936 /// Identifier. The relative resource name of this export. See:
1937 /// <https://cloud.google.com/apis/design/resource_names#relative_resource_name>.
1938 /// The following list shows some examples:
1939 ///
1940 ///
1941 /// `organizations/{organization_id}/locations/{location_id}/bigQueryExports/{export_id}`
1942 ///
1943 /// + `folders/{folder_id}/locations/{location_id}/bigQueryExports/{export_id}`
1944 ///
1945 /// `projects/{project_id}/locations/{location_id}/bigQueryExports/{export_id}`
1946 ///
1947 /// This field is provided in responses, and is ignored when provided in create
1948 /// requests.
1949 pub name: std::string::String,
1950
1951 /// The description of the export (max of 1024 characters).
1952 pub description: std::string::String,
1953
1954 /// Expression that defines the filter to apply across create/update events
1955 /// of findings. The expression is a list of zero or more restrictions combined
1956 /// via logical operators `AND` and `OR`. Parentheses are supported, and `OR`
1957 /// has higher precedence than `AND`.
1958 ///
1959 /// Restrictions have the form `<field> <operator> <value>` and may have a
1960 /// `-` character in front of them to indicate negation. The fields map to
1961 /// those defined in the corresponding resource.
1962 ///
1963 /// The supported operators are:
1964 ///
1965 /// * `=` for all value types.
1966 /// * `>`, `<`, `>=`, `<=` for integer values.
1967 /// * `:`, meaning substring matching, for strings.
1968 ///
1969 /// The supported value types are:
1970 ///
1971 /// * string literals in quotes.
1972 /// * integer literals without quotes.
1973 /// * boolean literals `true` and `false` without quotes.
1974 pub filter: std::string::String,
1975
1976 /// The dataset to write findings' updates to. Its format is
1977 /// "projects/[project_id]/datasets/[bigquery_dataset_id]".
1978 /// BigQuery dataset unique ID must contain only letters (a-z, A-Z), numbers
1979 /// (0-9), or underscores (_).
1980 pub dataset: std::string::String,
1981
1982 /// Output only. The time at which the BigQuery export was created.
1983 /// This field is set by the server and will be ignored if provided on export
1984 /// on creation.
1985 pub create_time: std::option::Option<wkt::Timestamp>,
1986
1987 /// Output only. The most recent time at which the BigQuery export was updated.
1988 /// This field is set by the server and will be ignored if provided on export
1989 /// creation or update.
1990 pub update_time: std::option::Option<wkt::Timestamp>,
1991
1992 /// Output only. Email address of the user who last edited the BigQuery export.
1993 /// This field is set by the server and will be ignored if provided on export
1994 /// creation or update.
1995 pub most_recent_editor: std::string::String,
1996
1997 /// Output only. The service account that needs permission to create table and
1998 /// upload data to the BigQuery dataset.
1999 pub principal: std::string::String,
2000
2001 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2002}
2003
2004impl BigQueryExport {
2005 /// Creates a new default instance.
2006 pub fn new() -> Self {
2007 std::default::Default::default()
2008 }
2009
2010 /// Sets the value of [name][crate::model::BigQueryExport::name].
2011 ///
2012 /// # Example
2013 /// ```ignore,no_run
2014 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2015 /// let x = BigQueryExport::new().set_name("example");
2016 /// ```
2017 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2018 self.name = v.into();
2019 self
2020 }
2021
2022 /// Sets the value of [description][crate::model::BigQueryExport::description].
2023 ///
2024 /// # Example
2025 /// ```ignore,no_run
2026 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2027 /// let x = BigQueryExport::new().set_description("example");
2028 /// ```
2029 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2030 self.description = v.into();
2031 self
2032 }
2033
2034 /// Sets the value of [filter][crate::model::BigQueryExport::filter].
2035 ///
2036 /// # Example
2037 /// ```ignore,no_run
2038 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2039 /// let x = BigQueryExport::new().set_filter("example");
2040 /// ```
2041 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2042 self.filter = v.into();
2043 self
2044 }
2045
2046 /// Sets the value of [dataset][crate::model::BigQueryExport::dataset].
2047 ///
2048 /// # Example
2049 /// ```ignore,no_run
2050 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2051 /// let x = BigQueryExport::new().set_dataset("example");
2052 /// ```
2053 pub fn set_dataset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2054 self.dataset = v.into();
2055 self
2056 }
2057
2058 /// Sets the value of [create_time][crate::model::BigQueryExport::create_time].
2059 ///
2060 /// # Example
2061 /// ```ignore,no_run
2062 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2063 /// use wkt::Timestamp;
2064 /// let x = BigQueryExport::new().set_create_time(Timestamp::default()/* use setters */);
2065 /// ```
2066 pub fn set_create_time<T>(mut self, v: T) -> Self
2067 where
2068 T: std::convert::Into<wkt::Timestamp>,
2069 {
2070 self.create_time = std::option::Option::Some(v.into());
2071 self
2072 }
2073
2074 /// Sets or clears the value of [create_time][crate::model::BigQueryExport::create_time].
2075 ///
2076 /// # Example
2077 /// ```ignore,no_run
2078 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2079 /// use wkt::Timestamp;
2080 /// let x = BigQueryExport::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2081 /// let x = BigQueryExport::new().set_or_clear_create_time(None::<Timestamp>);
2082 /// ```
2083 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2084 where
2085 T: std::convert::Into<wkt::Timestamp>,
2086 {
2087 self.create_time = v.map(|x| x.into());
2088 self
2089 }
2090
2091 /// Sets the value of [update_time][crate::model::BigQueryExport::update_time].
2092 ///
2093 /// # Example
2094 /// ```ignore,no_run
2095 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2096 /// use wkt::Timestamp;
2097 /// let x = BigQueryExport::new().set_update_time(Timestamp::default()/* use setters */);
2098 /// ```
2099 pub fn set_update_time<T>(mut self, v: T) -> Self
2100 where
2101 T: std::convert::Into<wkt::Timestamp>,
2102 {
2103 self.update_time = std::option::Option::Some(v.into());
2104 self
2105 }
2106
2107 /// Sets or clears the value of [update_time][crate::model::BigQueryExport::update_time].
2108 ///
2109 /// # Example
2110 /// ```ignore,no_run
2111 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2112 /// use wkt::Timestamp;
2113 /// let x = BigQueryExport::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2114 /// let x = BigQueryExport::new().set_or_clear_update_time(None::<Timestamp>);
2115 /// ```
2116 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2117 where
2118 T: std::convert::Into<wkt::Timestamp>,
2119 {
2120 self.update_time = v.map(|x| x.into());
2121 self
2122 }
2123
2124 /// Sets the value of [most_recent_editor][crate::model::BigQueryExport::most_recent_editor].
2125 ///
2126 /// # Example
2127 /// ```ignore,no_run
2128 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2129 /// let x = BigQueryExport::new().set_most_recent_editor("example");
2130 /// ```
2131 pub fn set_most_recent_editor<T: std::convert::Into<std::string::String>>(
2132 mut self,
2133 v: T,
2134 ) -> Self {
2135 self.most_recent_editor = v.into();
2136 self
2137 }
2138
2139 /// Sets the value of [principal][crate::model::BigQueryExport::principal].
2140 ///
2141 /// # Example
2142 /// ```ignore,no_run
2143 /// # use google_cloud_securitycenter_v2::model::BigQueryExport;
2144 /// let x = BigQueryExport::new().set_principal("example");
2145 /// ```
2146 pub fn set_principal<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2147 self.principal = v.into();
2148 self
2149 }
2150}
2151
2152impl wkt::message::Message for BigQueryExport {
2153 fn typename() -> &'static str {
2154 "type.googleapis.com/google.cloud.securitycenter.v2.BigQueryExport"
2155 }
2156}
2157
2158/// Contains details about a chokepoint, which is a resource or resource group
2159/// where high-risk attack paths converge, based on [attack path simulations]
2160/// (<https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_path_simulations>).
2161#[derive(Clone, Default, PartialEq)]
2162#[non_exhaustive]
2163pub struct Chokepoint {
2164 /// List of resource names of findings associated with this chokepoint.
2165 /// For example, organizations/123/sources/456/findings/789.
2166 /// This list will have at most 100 findings.
2167 pub related_findings: std::vec::Vec<std::string::String>,
2168
2169 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2170}
2171
2172impl Chokepoint {
2173 /// Creates a new default instance.
2174 pub fn new() -> Self {
2175 std::default::Default::default()
2176 }
2177
2178 /// Sets the value of [related_findings][crate::model::Chokepoint::related_findings].
2179 ///
2180 /// # Example
2181 /// ```ignore,no_run
2182 /// # use google_cloud_securitycenter_v2::model::Chokepoint;
2183 /// let x = Chokepoint::new().set_related_findings(["a", "b", "c"]);
2184 /// ```
2185 pub fn set_related_findings<T, V>(mut self, v: T) -> Self
2186 where
2187 T: std::iter::IntoIterator<Item = V>,
2188 V: std::convert::Into<std::string::String>,
2189 {
2190 use std::iter::Iterator;
2191 self.related_findings = v.into_iter().map(|i| i.into()).collect();
2192 self
2193 }
2194}
2195
2196impl wkt::message::Message for Chokepoint {
2197 fn typename() -> &'static str {
2198 "type.googleapis.com/google.cloud.securitycenter.v2.Chokepoint"
2199 }
2200}
2201
2202/// Fields related to Google Cloud Armor findings.
2203#[derive(Clone, Default, PartialEq)]
2204#[non_exhaustive]
2205pub struct CloudArmor {
2206 /// Information about the [Google Cloud Armor security
2207 /// policy](https://cloud.google.com/armor/docs/security-policy-overview)
2208 /// relevant to the finding.
2209 pub security_policy: std::option::Option<crate::model::SecurityPolicy>,
2210
2211 /// Information about incoming requests evaluated by [Google Cloud Armor
2212 /// security
2213 /// policies](https://cloud.google.com/armor/docs/security-policy-overview).
2214 pub requests: std::option::Option<crate::model::Requests>,
2215
2216 /// Information about potential Layer 7 DDoS attacks identified by [Google
2217 /// Cloud Armor Adaptive
2218 /// Protection](https://cloud.google.com/armor/docs/adaptive-protection-overview).
2219 pub adaptive_protection: std::option::Option<crate::model::AdaptiveProtection>,
2220
2221 /// Information about DDoS attack volume and classification.
2222 pub attack: std::option::Option<crate::model::Attack>,
2223
2224 /// Distinguish between volumetric & protocol DDoS attack and
2225 /// application layer attacks. For example, "L3_4" for Layer 3 and Layer 4 DDoS
2226 /// attacks, or "L_7" for Layer 7 DDoS attacks.
2227 pub threat_vector: std::string::String,
2228
2229 /// Duration of attack from the start until the current moment (updated every 5
2230 /// minutes).
2231 pub duration: std::option::Option<wkt::Duration>,
2232
2233 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2234}
2235
2236impl CloudArmor {
2237 /// Creates a new default instance.
2238 pub fn new() -> Self {
2239 std::default::Default::default()
2240 }
2241
2242 /// Sets the value of [security_policy][crate::model::CloudArmor::security_policy].
2243 ///
2244 /// # Example
2245 /// ```ignore,no_run
2246 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2247 /// use google_cloud_securitycenter_v2::model::SecurityPolicy;
2248 /// let x = CloudArmor::new().set_security_policy(SecurityPolicy::default()/* use setters */);
2249 /// ```
2250 pub fn set_security_policy<T>(mut self, v: T) -> Self
2251 where
2252 T: std::convert::Into<crate::model::SecurityPolicy>,
2253 {
2254 self.security_policy = std::option::Option::Some(v.into());
2255 self
2256 }
2257
2258 /// Sets or clears the value of [security_policy][crate::model::CloudArmor::security_policy].
2259 ///
2260 /// # Example
2261 /// ```ignore,no_run
2262 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2263 /// use google_cloud_securitycenter_v2::model::SecurityPolicy;
2264 /// let x = CloudArmor::new().set_or_clear_security_policy(Some(SecurityPolicy::default()/* use setters */));
2265 /// let x = CloudArmor::new().set_or_clear_security_policy(None::<SecurityPolicy>);
2266 /// ```
2267 pub fn set_or_clear_security_policy<T>(mut self, v: std::option::Option<T>) -> Self
2268 where
2269 T: std::convert::Into<crate::model::SecurityPolicy>,
2270 {
2271 self.security_policy = v.map(|x| x.into());
2272 self
2273 }
2274
2275 /// Sets the value of [requests][crate::model::CloudArmor::requests].
2276 ///
2277 /// # Example
2278 /// ```ignore,no_run
2279 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2280 /// use google_cloud_securitycenter_v2::model::Requests;
2281 /// let x = CloudArmor::new().set_requests(Requests::default()/* use setters */);
2282 /// ```
2283 pub fn set_requests<T>(mut self, v: T) -> Self
2284 where
2285 T: std::convert::Into<crate::model::Requests>,
2286 {
2287 self.requests = std::option::Option::Some(v.into());
2288 self
2289 }
2290
2291 /// Sets or clears the value of [requests][crate::model::CloudArmor::requests].
2292 ///
2293 /// # Example
2294 /// ```ignore,no_run
2295 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2296 /// use google_cloud_securitycenter_v2::model::Requests;
2297 /// let x = CloudArmor::new().set_or_clear_requests(Some(Requests::default()/* use setters */));
2298 /// let x = CloudArmor::new().set_or_clear_requests(None::<Requests>);
2299 /// ```
2300 pub fn set_or_clear_requests<T>(mut self, v: std::option::Option<T>) -> Self
2301 where
2302 T: std::convert::Into<crate::model::Requests>,
2303 {
2304 self.requests = v.map(|x| x.into());
2305 self
2306 }
2307
2308 /// Sets the value of [adaptive_protection][crate::model::CloudArmor::adaptive_protection].
2309 ///
2310 /// # Example
2311 /// ```ignore,no_run
2312 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2313 /// use google_cloud_securitycenter_v2::model::AdaptiveProtection;
2314 /// let x = CloudArmor::new().set_adaptive_protection(AdaptiveProtection::default()/* use setters */);
2315 /// ```
2316 pub fn set_adaptive_protection<T>(mut self, v: T) -> Self
2317 where
2318 T: std::convert::Into<crate::model::AdaptiveProtection>,
2319 {
2320 self.adaptive_protection = std::option::Option::Some(v.into());
2321 self
2322 }
2323
2324 /// Sets or clears the value of [adaptive_protection][crate::model::CloudArmor::adaptive_protection].
2325 ///
2326 /// # Example
2327 /// ```ignore,no_run
2328 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2329 /// use google_cloud_securitycenter_v2::model::AdaptiveProtection;
2330 /// let x = CloudArmor::new().set_or_clear_adaptive_protection(Some(AdaptiveProtection::default()/* use setters */));
2331 /// let x = CloudArmor::new().set_or_clear_adaptive_protection(None::<AdaptiveProtection>);
2332 /// ```
2333 pub fn set_or_clear_adaptive_protection<T>(mut self, v: std::option::Option<T>) -> Self
2334 where
2335 T: std::convert::Into<crate::model::AdaptiveProtection>,
2336 {
2337 self.adaptive_protection = v.map(|x| x.into());
2338 self
2339 }
2340
2341 /// Sets the value of [attack][crate::model::CloudArmor::attack].
2342 ///
2343 /// # Example
2344 /// ```ignore,no_run
2345 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2346 /// use google_cloud_securitycenter_v2::model::Attack;
2347 /// let x = CloudArmor::new().set_attack(Attack::default()/* use setters */);
2348 /// ```
2349 pub fn set_attack<T>(mut self, v: T) -> Self
2350 where
2351 T: std::convert::Into<crate::model::Attack>,
2352 {
2353 self.attack = std::option::Option::Some(v.into());
2354 self
2355 }
2356
2357 /// Sets or clears the value of [attack][crate::model::CloudArmor::attack].
2358 ///
2359 /// # Example
2360 /// ```ignore,no_run
2361 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2362 /// use google_cloud_securitycenter_v2::model::Attack;
2363 /// let x = CloudArmor::new().set_or_clear_attack(Some(Attack::default()/* use setters */));
2364 /// let x = CloudArmor::new().set_or_clear_attack(None::<Attack>);
2365 /// ```
2366 pub fn set_or_clear_attack<T>(mut self, v: std::option::Option<T>) -> Self
2367 where
2368 T: std::convert::Into<crate::model::Attack>,
2369 {
2370 self.attack = v.map(|x| x.into());
2371 self
2372 }
2373
2374 /// Sets the value of [threat_vector][crate::model::CloudArmor::threat_vector].
2375 ///
2376 /// # Example
2377 /// ```ignore,no_run
2378 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2379 /// let x = CloudArmor::new().set_threat_vector("example");
2380 /// ```
2381 pub fn set_threat_vector<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2382 self.threat_vector = v.into();
2383 self
2384 }
2385
2386 /// Sets the value of [duration][crate::model::CloudArmor::duration].
2387 ///
2388 /// # Example
2389 /// ```ignore,no_run
2390 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2391 /// use wkt::Duration;
2392 /// let x = CloudArmor::new().set_duration(Duration::default()/* use setters */);
2393 /// ```
2394 pub fn set_duration<T>(mut self, v: T) -> Self
2395 where
2396 T: std::convert::Into<wkt::Duration>,
2397 {
2398 self.duration = std::option::Option::Some(v.into());
2399 self
2400 }
2401
2402 /// Sets or clears the value of [duration][crate::model::CloudArmor::duration].
2403 ///
2404 /// # Example
2405 /// ```ignore,no_run
2406 /// # use google_cloud_securitycenter_v2::model::CloudArmor;
2407 /// use wkt::Duration;
2408 /// let x = CloudArmor::new().set_or_clear_duration(Some(Duration::default()/* use setters */));
2409 /// let x = CloudArmor::new().set_or_clear_duration(None::<Duration>);
2410 /// ```
2411 pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
2412 where
2413 T: std::convert::Into<wkt::Duration>,
2414 {
2415 self.duration = v.map(|x| x.into());
2416 self
2417 }
2418}
2419
2420impl wkt::message::Message for CloudArmor {
2421 fn typename() -> &'static str {
2422 "type.googleapis.com/google.cloud.securitycenter.v2.CloudArmor"
2423 }
2424}
2425
2426/// Information about the [Google Cloud Armor security
2427/// policy](https://cloud.google.com/armor/docs/security-policy-overview)
2428/// relevant to the finding.
2429#[derive(Clone, Default, PartialEq)]
2430#[non_exhaustive]
2431pub struct SecurityPolicy {
2432 /// The name of the Google Cloud Armor security policy, for example,
2433 /// "my-security-policy".
2434 pub name: std::string::String,
2435
2436 /// The type of Google Cloud Armor security policy for example, 'backend
2437 /// security policy', 'edge security policy', 'network edge security policy',
2438 /// or 'always-on DDoS protection'.
2439 pub r#type: std::string::String,
2440
2441 /// Whether or not the associated rule or policy is in preview mode.
2442 pub preview: bool,
2443
2444 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2445}
2446
2447impl SecurityPolicy {
2448 /// Creates a new default instance.
2449 pub fn new() -> Self {
2450 std::default::Default::default()
2451 }
2452
2453 /// Sets the value of [name][crate::model::SecurityPolicy::name].
2454 ///
2455 /// # Example
2456 /// ```ignore,no_run
2457 /// # use google_cloud_securitycenter_v2::model::SecurityPolicy;
2458 /// let x = SecurityPolicy::new().set_name("example");
2459 /// ```
2460 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2461 self.name = v.into();
2462 self
2463 }
2464
2465 /// Sets the value of [r#type][crate::model::SecurityPolicy::type].
2466 ///
2467 /// # Example
2468 /// ```ignore,no_run
2469 /// # use google_cloud_securitycenter_v2::model::SecurityPolicy;
2470 /// let x = SecurityPolicy::new().set_type("example");
2471 /// ```
2472 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2473 self.r#type = v.into();
2474 self
2475 }
2476
2477 /// Sets the value of [preview][crate::model::SecurityPolicy::preview].
2478 ///
2479 /// # Example
2480 /// ```ignore,no_run
2481 /// # use google_cloud_securitycenter_v2::model::SecurityPolicy;
2482 /// let x = SecurityPolicy::new().set_preview(true);
2483 /// ```
2484 pub fn set_preview<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2485 self.preview = v.into();
2486 self
2487 }
2488}
2489
2490impl wkt::message::Message for SecurityPolicy {
2491 fn typename() -> &'static str {
2492 "type.googleapis.com/google.cloud.securitycenter.v2.SecurityPolicy"
2493 }
2494}
2495
2496/// Information about the requests relevant to the finding.
2497#[derive(Clone, Default, PartialEq)]
2498#[non_exhaustive]
2499pub struct Requests {
2500 /// For 'Increasing deny ratio', the ratio is the denied traffic divided by the
2501 /// allowed traffic. For 'Allowed traffic spike', the ratio is the allowed
2502 /// traffic in the short term divided by allowed traffic in the long term.
2503 pub ratio: f64,
2504
2505 /// Allowed RPS (requests per second) in the short term.
2506 pub short_term_allowed: i32,
2507
2508 /// Allowed RPS (requests per second) over the long term.
2509 pub long_term_allowed: i32,
2510
2511 /// Denied RPS (requests per second) over the long term.
2512 pub long_term_denied: i32,
2513
2514 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2515}
2516
2517impl Requests {
2518 /// Creates a new default instance.
2519 pub fn new() -> Self {
2520 std::default::Default::default()
2521 }
2522
2523 /// Sets the value of [ratio][crate::model::Requests::ratio].
2524 ///
2525 /// # Example
2526 /// ```ignore,no_run
2527 /// # use google_cloud_securitycenter_v2::model::Requests;
2528 /// let x = Requests::new().set_ratio(42.0);
2529 /// ```
2530 pub fn set_ratio<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
2531 self.ratio = v.into();
2532 self
2533 }
2534
2535 /// Sets the value of [short_term_allowed][crate::model::Requests::short_term_allowed].
2536 ///
2537 /// # Example
2538 /// ```ignore,no_run
2539 /// # use google_cloud_securitycenter_v2::model::Requests;
2540 /// let x = Requests::new().set_short_term_allowed(42);
2541 /// ```
2542 pub fn set_short_term_allowed<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2543 self.short_term_allowed = v.into();
2544 self
2545 }
2546
2547 /// Sets the value of [long_term_allowed][crate::model::Requests::long_term_allowed].
2548 ///
2549 /// # Example
2550 /// ```ignore,no_run
2551 /// # use google_cloud_securitycenter_v2::model::Requests;
2552 /// let x = Requests::new().set_long_term_allowed(42);
2553 /// ```
2554 pub fn set_long_term_allowed<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2555 self.long_term_allowed = v.into();
2556 self
2557 }
2558
2559 /// Sets the value of [long_term_denied][crate::model::Requests::long_term_denied].
2560 ///
2561 /// # Example
2562 /// ```ignore,no_run
2563 /// # use google_cloud_securitycenter_v2::model::Requests;
2564 /// let x = Requests::new().set_long_term_denied(42);
2565 /// ```
2566 pub fn set_long_term_denied<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2567 self.long_term_denied = v.into();
2568 self
2569 }
2570}
2571
2572impl wkt::message::Message for Requests {
2573 fn typename() -> &'static str {
2574 "type.googleapis.com/google.cloud.securitycenter.v2.Requests"
2575 }
2576}
2577
2578/// Information about [Google Cloud Armor Adaptive
2579/// Protection](https://cloud.google.com/armor/docs/cloud-armor-overview#google-cloud-armor-adaptive-protection).
2580#[derive(Clone, Default, PartialEq)]
2581#[non_exhaustive]
2582pub struct AdaptiveProtection {
2583 /// A score of 0 means that there is low confidence that the detected event is
2584 /// an actual attack. A score of 1 means that there is high confidence that the
2585 /// detected event is an attack. See the [Adaptive Protection
2586 /// documentation](https://cloud.google.com/armor/docs/adaptive-protection-overview#configure-alert-tuning)
2587 /// for further explanation.
2588 pub confidence: f64,
2589
2590 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2591}
2592
2593impl AdaptiveProtection {
2594 /// Creates a new default instance.
2595 pub fn new() -> Self {
2596 std::default::Default::default()
2597 }
2598
2599 /// Sets the value of [confidence][crate::model::AdaptiveProtection::confidence].
2600 ///
2601 /// # Example
2602 /// ```ignore,no_run
2603 /// # use google_cloud_securitycenter_v2::model::AdaptiveProtection;
2604 /// let x = AdaptiveProtection::new().set_confidence(42.0);
2605 /// ```
2606 pub fn set_confidence<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
2607 self.confidence = v.into();
2608 self
2609 }
2610}
2611
2612impl wkt::message::Message for AdaptiveProtection {
2613 fn typename() -> &'static str {
2614 "type.googleapis.com/google.cloud.securitycenter.v2.AdaptiveProtection"
2615 }
2616}
2617
2618/// Information about DDoS attack volume and classification.
2619#[derive(Clone, Default, PartialEq)]
2620#[non_exhaustive]
2621pub struct Attack {
2622 /// Total PPS (packets per second) volume of attack.
2623 pub volume_pps_long: i64,
2624
2625 /// Total BPS (bytes per second) volume of attack.
2626 pub volume_bps_long: i64,
2627
2628 /// Type of attack, for example, 'SYN-flood', 'NTP-udp', or 'CHARGEN-udp'.
2629 pub classification: std::string::String,
2630
2631 /// Total PPS (packets per second) volume of attack. Deprecated - refer to
2632 /// volume_pps_long instead.
2633 #[deprecated]
2634 pub volume_pps: i32,
2635
2636 /// Total BPS (bytes per second) volume of attack. Deprecated - refer to
2637 /// volume_bps_long instead.
2638 #[deprecated]
2639 pub volume_bps: i32,
2640
2641 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2642}
2643
2644impl Attack {
2645 /// Creates a new default instance.
2646 pub fn new() -> Self {
2647 std::default::Default::default()
2648 }
2649
2650 /// Sets the value of [volume_pps_long][crate::model::Attack::volume_pps_long].
2651 ///
2652 /// # Example
2653 /// ```ignore,no_run
2654 /// # use google_cloud_securitycenter_v2::model::Attack;
2655 /// let x = Attack::new().set_volume_pps_long(42);
2656 /// ```
2657 pub fn set_volume_pps_long<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2658 self.volume_pps_long = v.into();
2659 self
2660 }
2661
2662 /// Sets the value of [volume_bps_long][crate::model::Attack::volume_bps_long].
2663 ///
2664 /// # Example
2665 /// ```ignore,no_run
2666 /// # use google_cloud_securitycenter_v2::model::Attack;
2667 /// let x = Attack::new().set_volume_bps_long(42);
2668 /// ```
2669 pub fn set_volume_bps_long<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2670 self.volume_bps_long = v.into();
2671 self
2672 }
2673
2674 /// Sets the value of [classification][crate::model::Attack::classification].
2675 ///
2676 /// # Example
2677 /// ```ignore,no_run
2678 /// # use google_cloud_securitycenter_v2::model::Attack;
2679 /// let x = Attack::new().set_classification("example");
2680 /// ```
2681 pub fn set_classification<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2682 self.classification = v.into();
2683 self
2684 }
2685
2686 /// Sets the value of [volume_pps][crate::model::Attack::volume_pps].
2687 ///
2688 /// # Example
2689 /// ```ignore,no_run
2690 /// # use google_cloud_securitycenter_v2::model::Attack;
2691 /// let x = Attack::new().set_volume_pps(42);
2692 /// ```
2693 #[deprecated]
2694 pub fn set_volume_pps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2695 self.volume_pps = v.into();
2696 self
2697 }
2698
2699 /// Sets the value of [volume_bps][crate::model::Attack::volume_bps].
2700 ///
2701 /// # Example
2702 /// ```ignore,no_run
2703 /// # use google_cloud_securitycenter_v2::model::Attack;
2704 /// let x = Attack::new().set_volume_bps(42);
2705 /// ```
2706 #[deprecated]
2707 pub fn set_volume_bps<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2708 self.volume_bps = v.into();
2709 self
2710 }
2711}
2712
2713impl wkt::message::Message for Attack {
2714 fn typename() -> &'static str {
2715 "type.googleapis.com/google.cloud.securitycenter.v2.Attack"
2716 }
2717}
2718
2719/// The [data profile](https://cloud.google.com/dlp/docs/data-profiles)
2720/// associated with the finding.
2721#[derive(Clone, Default, PartialEq)]
2722#[non_exhaustive]
2723pub struct CloudDlpDataProfile {
2724 /// Name of the data profile, for example,
2725 /// `projects/123/locations/europe/tableProfiles/8383929`.
2726 pub data_profile: std::string::String,
2727
2728 /// The resource hierarchy level at which the data profile was generated.
2729 pub parent_type: crate::model::cloud_dlp_data_profile::ParentType,
2730
2731 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2732}
2733
2734impl CloudDlpDataProfile {
2735 /// Creates a new default instance.
2736 pub fn new() -> Self {
2737 std::default::Default::default()
2738 }
2739
2740 /// Sets the value of [data_profile][crate::model::CloudDlpDataProfile::data_profile].
2741 ///
2742 /// # Example
2743 /// ```ignore,no_run
2744 /// # use google_cloud_securitycenter_v2::model::CloudDlpDataProfile;
2745 /// let x = CloudDlpDataProfile::new().set_data_profile("example");
2746 /// ```
2747 pub fn set_data_profile<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2748 self.data_profile = v.into();
2749 self
2750 }
2751
2752 /// Sets the value of [parent_type][crate::model::CloudDlpDataProfile::parent_type].
2753 ///
2754 /// # Example
2755 /// ```ignore,no_run
2756 /// # use google_cloud_securitycenter_v2::model::CloudDlpDataProfile;
2757 /// use google_cloud_securitycenter_v2::model::cloud_dlp_data_profile::ParentType;
2758 /// let x0 = CloudDlpDataProfile::new().set_parent_type(ParentType::Organization);
2759 /// let x1 = CloudDlpDataProfile::new().set_parent_type(ParentType::Project);
2760 /// ```
2761 pub fn set_parent_type<
2762 T: std::convert::Into<crate::model::cloud_dlp_data_profile::ParentType>,
2763 >(
2764 mut self,
2765 v: T,
2766 ) -> Self {
2767 self.parent_type = v.into();
2768 self
2769 }
2770}
2771
2772impl wkt::message::Message for CloudDlpDataProfile {
2773 fn typename() -> &'static str {
2774 "type.googleapis.com/google.cloud.securitycenter.v2.CloudDlpDataProfile"
2775 }
2776}
2777
2778/// Defines additional types related to [CloudDlpDataProfile].
2779pub mod cloud_dlp_data_profile {
2780 #[allow(unused_imports)]
2781 use super::*;
2782
2783 /// Parents for configurations that produce data profile findings.
2784 ///
2785 /// # Working with unknown values
2786 ///
2787 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2788 /// additional enum variants at any time. Adding new variants is not considered
2789 /// a breaking change. Applications should write their code in anticipation of:
2790 ///
2791 /// - New values appearing in future releases of the client library, **and**
2792 /// - New values received dynamically, without application changes.
2793 ///
2794 /// Please consult the [Working with enums] section in the user guide for some
2795 /// guidelines.
2796 ///
2797 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2798 #[derive(Clone, Debug, PartialEq)]
2799 #[non_exhaustive]
2800 pub enum ParentType {
2801 /// Unspecified parent type.
2802 Unspecified,
2803 /// Organization-level configurations.
2804 Organization,
2805 /// Project-level configurations.
2806 Project,
2807 /// If set, the enum was initialized with an unknown value.
2808 ///
2809 /// Applications can examine the value using [ParentType::value] or
2810 /// [ParentType::name].
2811 UnknownValue(parent_type::UnknownValue),
2812 }
2813
2814 #[doc(hidden)]
2815 pub mod parent_type {
2816 #[allow(unused_imports)]
2817 use super::*;
2818 #[derive(Clone, Debug, PartialEq)]
2819 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2820 }
2821
2822 impl ParentType {
2823 /// Gets the enum value.
2824 ///
2825 /// Returns `None` if the enum contains an unknown value deserialized from
2826 /// the string representation of enums.
2827 pub fn value(&self) -> std::option::Option<i32> {
2828 match self {
2829 Self::Unspecified => std::option::Option::Some(0),
2830 Self::Organization => std::option::Option::Some(1),
2831 Self::Project => std::option::Option::Some(2),
2832 Self::UnknownValue(u) => u.0.value(),
2833 }
2834 }
2835
2836 /// Gets the enum value as a string.
2837 ///
2838 /// Returns `None` if the enum contains an unknown value deserialized from
2839 /// the integer representation of enums.
2840 pub fn name(&self) -> std::option::Option<&str> {
2841 match self {
2842 Self::Unspecified => std::option::Option::Some("PARENT_TYPE_UNSPECIFIED"),
2843 Self::Organization => std::option::Option::Some("ORGANIZATION"),
2844 Self::Project => std::option::Option::Some("PROJECT"),
2845 Self::UnknownValue(u) => u.0.name(),
2846 }
2847 }
2848 }
2849
2850 impl std::default::Default for ParentType {
2851 fn default() -> Self {
2852 use std::convert::From;
2853 Self::from(0)
2854 }
2855 }
2856
2857 impl std::fmt::Display for ParentType {
2858 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2859 wkt::internal::display_enum(f, self.name(), self.value())
2860 }
2861 }
2862
2863 impl std::convert::From<i32> for ParentType {
2864 fn from(value: i32) -> Self {
2865 match value {
2866 0 => Self::Unspecified,
2867 1 => Self::Organization,
2868 2 => Self::Project,
2869 _ => Self::UnknownValue(parent_type::UnknownValue(
2870 wkt::internal::UnknownEnumValue::Integer(value),
2871 )),
2872 }
2873 }
2874 }
2875
2876 impl std::convert::From<&str> for ParentType {
2877 fn from(value: &str) -> Self {
2878 use std::string::ToString;
2879 match value {
2880 "PARENT_TYPE_UNSPECIFIED" => Self::Unspecified,
2881 "ORGANIZATION" => Self::Organization,
2882 "PROJECT" => Self::Project,
2883 _ => Self::UnknownValue(parent_type::UnknownValue(
2884 wkt::internal::UnknownEnumValue::String(value.to_string()),
2885 )),
2886 }
2887 }
2888 }
2889
2890 impl serde::ser::Serialize for ParentType {
2891 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2892 where
2893 S: serde::Serializer,
2894 {
2895 match self {
2896 Self::Unspecified => serializer.serialize_i32(0),
2897 Self::Organization => serializer.serialize_i32(1),
2898 Self::Project => serializer.serialize_i32(2),
2899 Self::UnknownValue(u) => u.0.serialize(serializer),
2900 }
2901 }
2902 }
2903
2904 impl<'de> serde::de::Deserialize<'de> for ParentType {
2905 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2906 where
2907 D: serde::Deserializer<'de>,
2908 {
2909 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ParentType>::new(
2910 ".google.cloud.securitycenter.v2.CloudDlpDataProfile.ParentType",
2911 ))
2912 }
2913 }
2914}
2915
2916/// Details about the Cloud Data Loss Prevention (Cloud DLP) [inspection
2917/// job](https://cloud.google.com/dlp/docs/concepts-job-triggers) that produced
2918/// the finding.
2919#[derive(Clone, Default, PartialEq)]
2920#[non_exhaustive]
2921pub struct CloudDlpInspection {
2922 /// Name of the inspection job, for example,
2923 /// `projects/123/locations/europe/dlpJobs/i-8383929`.
2924 pub inspect_job: std::string::String,
2925
2926 /// The type of information (or
2927 /// *[infoType](https://cloud.google.com/dlp/docs/infotypes-reference)*) found,
2928 /// for example, `EMAIL_ADDRESS` or `STREET_ADDRESS`.
2929 pub info_type: std::string::String,
2930
2931 /// The number of times Cloud DLP found this infoType within this job
2932 /// and resource.
2933 pub info_type_count: i64,
2934
2935 /// Whether Cloud DLP scanned the complete resource or a sampled subset.
2936 pub full_scan: bool,
2937
2938 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2939}
2940
2941impl CloudDlpInspection {
2942 /// Creates a new default instance.
2943 pub fn new() -> Self {
2944 std::default::Default::default()
2945 }
2946
2947 /// Sets the value of [inspect_job][crate::model::CloudDlpInspection::inspect_job].
2948 ///
2949 /// # Example
2950 /// ```ignore,no_run
2951 /// # use google_cloud_securitycenter_v2::model::CloudDlpInspection;
2952 /// let x = CloudDlpInspection::new().set_inspect_job("example");
2953 /// ```
2954 pub fn set_inspect_job<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2955 self.inspect_job = v.into();
2956 self
2957 }
2958
2959 /// Sets the value of [info_type][crate::model::CloudDlpInspection::info_type].
2960 ///
2961 /// # Example
2962 /// ```ignore,no_run
2963 /// # use google_cloud_securitycenter_v2::model::CloudDlpInspection;
2964 /// let x = CloudDlpInspection::new().set_info_type("example");
2965 /// ```
2966 pub fn set_info_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2967 self.info_type = v.into();
2968 self
2969 }
2970
2971 /// Sets the value of [info_type_count][crate::model::CloudDlpInspection::info_type_count].
2972 ///
2973 /// # Example
2974 /// ```ignore,no_run
2975 /// # use google_cloud_securitycenter_v2::model::CloudDlpInspection;
2976 /// let x = CloudDlpInspection::new().set_info_type_count(42);
2977 /// ```
2978 pub fn set_info_type_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2979 self.info_type_count = v.into();
2980 self
2981 }
2982
2983 /// Sets the value of [full_scan][crate::model::CloudDlpInspection::full_scan].
2984 ///
2985 /// # Example
2986 /// ```ignore,no_run
2987 /// # use google_cloud_securitycenter_v2::model::CloudDlpInspection;
2988 /// let x = CloudDlpInspection::new().set_full_scan(true);
2989 /// ```
2990 pub fn set_full_scan<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2991 self.full_scan = v.into();
2992 self
2993 }
2994}
2995
2996impl wkt::message::Message for CloudDlpInspection {
2997 fn typename() -> &'static str {
2998 "type.googleapis.com/google.cloud.securitycenter.v2.CloudDlpInspection"
2999 }
3000}
3001
3002/// Contains compliance information about a security standard indicating unmet
3003/// recommendations.
3004#[derive(Clone, Default, PartialEq)]
3005#[non_exhaustive]
3006pub struct Compliance {
3007 /// Industry-wide compliance standards or benchmarks, such as CIS, PCI, and
3008 /// OWASP.
3009 pub standard: std::string::String,
3010
3011 /// Version of the standard or benchmark, for example, 1.1
3012 pub version: std::string::String,
3013
3014 /// Policies within the standard or benchmark, for example, A.12.4.1
3015 pub ids: std::vec::Vec<std::string::String>,
3016
3017 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3018}
3019
3020impl Compliance {
3021 /// Creates a new default instance.
3022 pub fn new() -> Self {
3023 std::default::Default::default()
3024 }
3025
3026 /// Sets the value of [standard][crate::model::Compliance::standard].
3027 ///
3028 /// # Example
3029 /// ```ignore,no_run
3030 /// # use google_cloud_securitycenter_v2::model::Compliance;
3031 /// let x = Compliance::new().set_standard("example");
3032 /// ```
3033 pub fn set_standard<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3034 self.standard = v.into();
3035 self
3036 }
3037
3038 /// Sets the value of [version][crate::model::Compliance::version].
3039 ///
3040 /// # Example
3041 /// ```ignore,no_run
3042 /// # use google_cloud_securitycenter_v2::model::Compliance;
3043 /// let x = Compliance::new().set_version("example");
3044 /// ```
3045 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3046 self.version = v.into();
3047 self
3048 }
3049
3050 /// Sets the value of [ids][crate::model::Compliance::ids].
3051 ///
3052 /// # Example
3053 /// ```ignore,no_run
3054 /// # use google_cloud_securitycenter_v2::model::Compliance;
3055 /// let x = Compliance::new().set_ids(["a", "b", "c"]);
3056 /// ```
3057 pub fn set_ids<T, V>(mut self, v: T) -> Self
3058 where
3059 T: std::iter::IntoIterator<Item = V>,
3060 V: std::convert::Into<std::string::String>,
3061 {
3062 use std::iter::Iterator;
3063 self.ids = v.into_iter().map(|i| i.into()).collect();
3064 self
3065 }
3066}
3067
3068impl wkt::message::Message for Compliance {
3069 fn typename() -> &'static str {
3070 "type.googleapis.com/google.cloud.securitycenter.v2.Compliance"
3071 }
3072}
3073
3074/// Contains information about the IP connection associated with the finding.
3075#[derive(Clone, Default, PartialEq)]
3076#[non_exhaustive]
3077pub struct Connection {
3078 /// Destination IP address. Not present for sockets that are listening and not
3079 /// connected.
3080 pub destination_ip: std::string::String,
3081
3082 /// Destination port. Not present for sockets that are listening and not
3083 /// connected.
3084 pub destination_port: i32,
3085
3086 /// Source IP address.
3087 pub source_ip: std::string::String,
3088
3089 /// Source port.
3090 pub source_port: i32,
3091
3092 /// IANA Internet Protocol Number such as TCP(6) and UDP(17).
3093 pub protocol: crate::model::connection::Protocol,
3094
3095 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3096}
3097
3098impl Connection {
3099 /// Creates a new default instance.
3100 pub fn new() -> Self {
3101 std::default::Default::default()
3102 }
3103
3104 /// Sets the value of [destination_ip][crate::model::Connection::destination_ip].
3105 ///
3106 /// # Example
3107 /// ```ignore,no_run
3108 /// # use google_cloud_securitycenter_v2::model::Connection;
3109 /// let x = Connection::new().set_destination_ip("example");
3110 /// ```
3111 pub fn set_destination_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3112 self.destination_ip = v.into();
3113 self
3114 }
3115
3116 /// Sets the value of [destination_port][crate::model::Connection::destination_port].
3117 ///
3118 /// # Example
3119 /// ```ignore,no_run
3120 /// # use google_cloud_securitycenter_v2::model::Connection;
3121 /// let x = Connection::new().set_destination_port(42);
3122 /// ```
3123 pub fn set_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3124 self.destination_port = v.into();
3125 self
3126 }
3127
3128 /// Sets the value of [source_ip][crate::model::Connection::source_ip].
3129 ///
3130 /// # Example
3131 /// ```ignore,no_run
3132 /// # use google_cloud_securitycenter_v2::model::Connection;
3133 /// let x = Connection::new().set_source_ip("example");
3134 /// ```
3135 pub fn set_source_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3136 self.source_ip = v.into();
3137 self
3138 }
3139
3140 /// Sets the value of [source_port][crate::model::Connection::source_port].
3141 ///
3142 /// # Example
3143 /// ```ignore,no_run
3144 /// # use google_cloud_securitycenter_v2::model::Connection;
3145 /// let x = Connection::new().set_source_port(42);
3146 /// ```
3147 pub fn set_source_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3148 self.source_port = v.into();
3149 self
3150 }
3151
3152 /// Sets the value of [protocol][crate::model::Connection::protocol].
3153 ///
3154 /// # Example
3155 /// ```ignore,no_run
3156 /// # use google_cloud_securitycenter_v2::model::Connection;
3157 /// use google_cloud_securitycenter_v2::model::connection::Protocol;
3158 /// let x0 = Connection::new().set_protocol(Protocol::Icmp);
3159 /// let x1 = Connection::new().set_protocol(Protocol::Tcp);
3160 /// let x2 = Connection::new().set_protocol(Protocol::Udp);
3161 /// ```
3162 pub fn set_protocol<T: std::convert::Into<crate::model::connection::Protocol>>(
3163 mut self,
3164 v: T,
3165 ) -> Self {
3166 self.protocol = v.into();
3167 self
3168 }
3169}
3170
3171impl wkt::message::Message for Connection {
3172 fn typename() -> &'static str {
3173 "type.googleapis.com/google.cloud.securitycenter.v2.Connection"
3174 }
3175}
3176
3177/// Defines additional types related to [Connection].
3178pub mod connection {
3179 #[allow(unused_imports)]
3180 use super::*;
3181
3182 /// IANA Internet Protocol Number such as TCP(6) and UDP(17).
3183 ///
3184 /// # Working with unknown values
3185 ///
3186 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3187 /// additional enum variants at any time. Adding new variants is not considered
3188 /// a breaking change. Applications should write their code in anticipation of:
3189 ///
3190 /// - New values appearing in future releases of the client library, **and**
3191 /// - New values received dynamically, without application changes.
3192 ///
3193 /// Please consult the [Working with enums] section in the user guide for some
3194 /// guidelines.
3195 ///
3196 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3197 #[derive(Clone, Debug, PartialEq)]
3198 #[non_exhaustive]
3199 pub enum Protocol {
3200 /// Unspecified protocol (not HOPOPT).
3201 Unspecified,
3202 /// Internet Control Message Protocol.
3203 Icmp,
3204 /// Transmission Control Protocol.
3205 Tcp,
3206 /// User Datagram Protocol.
3207 Udp,
3208 /// Generic Routing Encapsulation.
3209 Gre,
3210 /// Encap Security Payload.
3211 Esp,
3212 /// If set, the enum was initialized with an unknown value.
3213 ///
3214 /// Applications can examine the value using [Protocol::value] or
3215 /// [Protocol::name].
3216 UnknownValue(protocol::UnknownValue),
3217 }
3218
3219 #[doc(hidden)]
3220 pub mod protocol {
3221 #[allow(unused_imports)]
3222 use super::*;
3223 #[derive(Clone, Debug, PartialEq)]
3224 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3225 }
3226
3227 impl Protocol {
3228 /// Gets the enum value.
3229 ///
3230 /// Returns `None` if the enum contains an unknown value deserialized from
3231 /// the string representation of enums.
3232 pub fn value(&self) -> std::option::Option<i32> {
3233 match self {
3234 Self::Unspecified => std::option::Option::Some(0),
3235 Self::Icmp => std::option::Option::Some(1),
3236 Self::Tcp => std::option::Option::Some(6),
3237 Self::Udp => std::option::Option::Some(17),
3238 Self::Gre => std::option::Option::Some(47),
3239 Self::Esp => std::option::Option::Some(50),
3240 Self::UnknownValue(u) => u.0.value(),
3241 }
3242 }
3243
3244 /// Gets the enum value as a string.
3245 ///
3246 /// Returns `None` if the enum contains an unknown value deserialized from
3247 /// the integer representation of enums.
3248 pub fn name(&self) -> std::option::Option<&str> {
3249 match self {
3250 Self::Unspecified => std::option::Option::Some("PROTOCOL_UNSPECIFIED"),
3251 Self::Icmp => std::option::Option::Some("ICMP"),
3252 Self::Tcp => std::option::Option::Some("TCP"),
3253 Self::Udp => std::option::Option::Some("UDP"),
3254 Self::Gre => std::option::Option::Some("GRE"),
3255 Self::Esp => std::option::Option::Some("ESP"),
3256 Self::UnknownValue(u) => u.0.name(),
3257 }
3258 }
3259 }
3260
3261 impl std::default::Default for Protocol {
3262 fn default() -> Self {
3263 use std::convert::From;
3264 Self::from(0)
3265 }
3266 }
3267
3268 impl std::fmt::Display for Protocol {
3269 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3270 wkt::internal::display_enum(f, self.name(), self.value())
3271 }
3272 }
3273
3274 impl std::convert::From<i32> for Protocol {
3275 fn from(value: i32) -> Self {
3276 match value {
3277 0 => Self::Unspecified,
3278 1 => Self::Icmp,
3279 6 => Self::Tcp,
3280 17 => Self::Udp,
3281 47 => Self::Gre,
3282 50 => Self::Esp,
3283 _ => Self::UnknownValue(protocol::UnknownValue(
3284 wkt::internal::UnknownEnumValue::Integer(value),
3285 )),
3286 }
3287 }
3288 }
3289
3290 impl std::convert::From<&str> for Protocol {
3291 fn from(value: &str) -> Self {
3292 use std::string::ToString;
3293 match value {
3294 "PROTOCOL_UNSPECIFIED" => Self::Unspecified,
3295 "ICMP" => Self::Icmp,
3296 "TCP" => Self::Tcp,
3297 "UDP" => Self::Udp,
3298 "GRE" => Self::Gre,
3299 "ESP" => Self::Esp,
3300 _ => Self::UnknownValue(protocol::UnknownValue(
3301 wkt::internal::UnknownEnumValue::String(value.to_string()),
3302 )),
3303 }
3304 }
3305 }
3306
3307 impl serde::ser::Serialize for Protocol {
3308 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3309 where
3310 S: serde::Serializer,
3311 {
3312 match self {
3313 Self::Unspecified => serializer.serialize_i32(0),
3314 Self::Icmp => serializer.serialize_i32(1),
3315 Self::Tcp => serializer.serialize_i32(6),
3316 Self::Udp => serializer.serialize_i32(17),
3317 Self::Gre => serializer.serialize_i32(47),
3318 Self::Esp => serializer.serialize_i32(50),
3319 Self::UnknownValue(u) => u.0.serialize(serializer),
3320 }
3321 }
3322 }
3323
3324 impl<'de> serde::de::Deserialize<'de> for Protocol {
3325 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3326 where
3327 D: serde::Deserializer<'de>,
3328 {
3329 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Protocol>::new(
3330 ".google.cloud.securitycenter.v2.Connection.Protocol",
3331 ))
3332 }
3333 }
3334}
3335
3336/// Details about specific contacts
3337#[derive(Clone, Default, PartialEq)]
3338#[non_exhaustive]
3339pub struct ContactDetails {
3340 /// A list of contacts
3341 pub contacts: std::vec::Vec<crate::model::Contact>,
3342
3343 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3344}
3345
3346impl ContactDetails {
3347 /// Creates a new default instance.
3348 pub fn new() -> Self {
3349 std::default::Default::default()
3350 }
3351
3352 /// Sets the value of [contacts][crate::model::ContactDetails::contacts].
3353 ///
3354 /// # Example
3355 /// ```ignore,no_run
3356 /// # use google_cloud_securitycenter_v2::model::ContactDetails;
3357 /// use google_cloud_securitycenter_v2::model::Contact;
3358 /// let x = ContactDetails::new()
3359 /// .set_contacts([
3360 /// Contact::default()/* use setters */,
3361 /// Contact::default()/* use (different) setters */,
3362 /// ]);
3363 /// ```
3364 pub fn set_contacts<T, V>(mut self, v: T) -> Self
3365 where
3366 T: std::iter::IntoIterator<Item = V>,
3367 V: std::convert::Into<crate::model::Contact>,
3368 {
3369 use std::iter::Iterator;
3370 self.contacts = v.into_iter().map(|i| i.into()).collect();
3371 self
3372 }
3373}
3374
3375impl wkt::message::Message for ContactDetails {
3376 fn typename() -> &'static str {
3377 "type.googleapis.com/google.cloud.securitycenter.v2.ContactDetails"
3378 }
3379}
3380
3381/// The email address of a contact.
3382#[derive(Clone, Default, PartialEq)]
3383#[non_exhaustive]
3384pub struct Contact {
3385 /// An email address. For example, "`person123@company.com`".
3386 pub email: std::string::String,
3387
3388 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3389}
3390
3391impl Contact {
3392 /// Creates a new default instance.
3393 pub fn new() -> Self {
3394 std::default::Default::default()
3395 }
3396
3397 /// Sets the value of [email][crate::model::Contact::email].
3398 ///
3399 /// # Example
3400 /// ```ignore,no_run
3401 /// # use google_cloud_securitycenter_v2::model::Contact;
3402 /// let x = Contact::new().set_email("example");
3403 /// ```
3404 pub fn set_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3405 self.email = v.into();
3406 self
3407 }
3408}
3409
3410impl wkt::message::Message for Contact {
3411 fn typename() -> &'static str {
3412 "type.googleapis.com/google.cloud.securitycenter.v2.Contact"
3413 }
3414}
3415
3416/// Container associated with the finding.
3417#[derive(Clone, Default, PartialEq)]
3418#[non_exhaustive]
3419pub struct Container {
3420 /// Name of the container.
3421 pub name: std::string::String,
3422
3423 /// Container image URI provided when configuring a pod or container. This
3424 /// string can identify a container image version using mutable tags.
3425 pub uri: std::string::String,
3426
3427 /// Optional container image ID, if provided by the container runtime. Uniquely
3428 /// identifies the container image launched using a container image digest.
3429 pub image_id: std::string::String,
3430
3431 /// Container labels, as provided by the container runtime.
3432 pub labels: std::vec::Vec<crate::model::Label>,
3433
3434 /// The time that the container was created.
3435 pub create_time: std::option::Option<wkt::Timestamp>,
3436
3437 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3438}
3439
3440impl Container {
3441 /// Creates a new default instance.
3442 pub fn new() -> Self {
3443 std::default::Default::default()
3444 }
3445
3446 /// Sets the value of [name][crate::model::Container::name].
3447 ///
3448 /// # Example
3449 /// ```ignore,no_run
3450 /// # use google_cloud_securitycenter_v2::model::Container;
3451 /// let x = Container::new().set_name("example");
3452 /// ```
3453 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3454 self.name = v.into();
3455 self
3456 }
3457
3458 /// Sets the value of [uri][crate::model::Container::uri].
3459 ///
3460 /// # Example
3461 /// ```ignore,no_run
3462 /// # use google_cloud_securitycenter_v2::model::Container;
3463 /// let x = Container::new().set_uri("example");
3464 /// ```
3465 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3466 self.uri = v.into();
3467 self
3468 }
3469
3470 /// Sets the value of [image_id][crate::model::Container::image_id].
3471 ///
3472 /// # Example
3473 /// ```ignore,no_run
3474 /// # use google_cloud_securitycenter_v2::model::Container;
3475 /// let x = Container::new().set_image_id("example");
3476 /// ```
3477 pub fn set_image_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3478 self.image_id = v.into();
3479 self
3480 }
3481
3482 /// Sets the value of [labels][crate::model::Container::labels].
3483 ///
3484 /// # Example
3485 /// ```ignore,no_run
3486 /// # use google_cloud_securitycenter_v2::model::Container;
3487 /// use google_cloud_securitycenter_v2::model::Label;
3488 /// let x = Container::new()
3489 /// .set_labels([
3490 /// Label::default()/* use setters */,
3491 /// Label::default()/* use (different) setters */,
3492 /// ]);
3493 /// ```
3494 pub fn set_labels<T, V>(mut self, v: T) -> Self
3495 where
3496 T: std::iter::IntoIterator<Item = V>,
3497 V: std::convert::Into<crate::model::Label>,
3498 {
3499 use std::iter::Iterator;
3500 self.labels = v.into_iter().map(|i| i.into()).collect();
3501 self
3502 }
3503
3504 /// Sets the value of [create_time][crate::model::Container::create_time].
3505 ///
3506 /// # Example
3507 /// ```ignore,no_run
3508 /// # use google_cloud_securitycenter_v2::model::Container;
3509 /// use wkt::Timestamp;
3510 /// let x = Container::new().set_create_time(Timestamp::default()/* use setters */);
3511 /// ```
3512 pub fn set_create_time<T>(mut self, v: T) -> Self
3513 where
3514 T: std::convert::Into<wkt::Timestamp>,
3515 {
3516 self.create_time = std::option::Option::Some(v.into());
3517 self
3518 }
3519
3520 /// Sets or clears the value of [create_time][crate::model::Container::create_time].
3521 ///
3522 /// # Example
3523 /// ```ignore,no_run
3524 /// # use google_cloud_securitycenter_v2::model::Container;
3525 /// use wkt::Timestamp;
3526 /// let x = Container::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3527 /// let x = Container::new().set_or_clear_create_time(None::<Timestamp>);
3528 /// ```
3529 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3530 where
3531 T: std::convert::Into<wkt::Timestamp>,
3532 {
3533 self.create_time = v.map(|x| x.into());
3534 self
3535 }
3536}
3537
3538impl wkt::message::Message for Container {
3539 fn typename() -> &'static str {
3540 "type.googleapis.com/google.cloud.securitycenter.v2.Container"
3541 }
3542}
3543
3544/// Details about a data access attempt made by a principal not authorized under
3545/// applicable data security policy.
3546#[derive(Clone, Default, PartialEq)]
3547#[non_exhaustive]
3548pub struct DataAccessEvent {
3549 /// Unique identifier for data access event.
3550 pub event_id: std::string::String,
3551
3552 /// The email address of the principal that accessed the data. The principal
3553 /// could be a user account, service account, Google group, or other.
3554 pub principal_email: std::string::String,
3555
3556 /// The operation performed by the principal to access the data.
3557 pub operation: crate::model::data_access_event::Operation,
3558
3559 /// Timestamp of data access event.
3560 pub event_time: std::option::Option<wkt::Timestamp>,
3561
3562 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3563}
3564
3565impl DataAccessEvent {
3566 /// Creates a new default instance.
3567 pub fn new() -> Self {
3568 std::default::Default::default()
3569 }
3570
3571 /// Sets the value of [event_id][crate::model::DataAccessEvent::event_id].
3572 ///
3573 /// # Example
3574 /// ```ignore,no_run
3575 /// # use google_cloud_securitycenter_v2::model::DataAccessEvent;
3576 /// let x = DataAccessEvent::new().set_event_id("example");
3577 /// ```
3578 pub fn set_event_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3579 self.event_id = v.into();
3580 self
3581 }
3582
3583 /// Sets the value of [principal_email][crate::model::DataAccessEvent::principal_email].
3584 ///
3585 /// # Example
3586 /// ```ignore,no_run
3587 /// # use google_cloud_securitycenter_v2::model::DataAccessEvent;
3588 /// let x = DataAccessEvent::new().set_principal_email("example");
3589 /// ```
3590 pub fn set_principal_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3591 self.principal_email = v.into();
3592 self
3593 }
3594
3595 /// Sets the value of [operation][crate::model::DataAccessEvent::operation].
3596 ///
3597 /// # Example
3598 /// ```ignore,no_run
3599 /// # use google_cloud_securitycenter_v2::model::DataAccessEvent;
3600 /// use google_cloud_securitycenter_v2::model::data_access_event::Operation;
3601 /// let x0 = DataAccessEvent::new().set_operation(Operation::Read);
3602 /// let x1 = DataAccessEvent::new().set_operation(Operation::Move);
3603 /// let x2 = DataAccessEvent::new().set_operation(Operation::Copy);
3604 /// ```
3605 pub fn set_operation<T: std::convert::Into<crate::model::data_access_event::Operation>>(
3606 mut self,
3607 v: T,
3608 ) -> Self {
3609 self.operation = v.into();
3610 self
3611 }
3612
3613 /// Sets the value of [event_time][crate::model::DataAccessEvent::event_time].
3614 ///
3615 /// # Example
3616 /// ```ignore,no_run
3617 /// # use google_cloud_securitycenter_v2::model::DataAccessEvent;
3618 /// use wkt::Timestamp;
3619 /// let x = DataAccessEvent::new().set_event_time(Timestamp::default()/* use setters */);
3620 /// ```
3621 pub fn set_event_time<T>(mut self, v: T) -> Self
3622 where
3623 T: std::convert::Into<wkt::Timestamp>,
3624 {
3625 self.event_time = std::option::Option::Some(v.into());
3626 self
3627 }
3628
3629 /// Sets or clears the value of [event_time][crate::model::DataAccessEvent::event_time].
3630 ///
3631 /// # Example
3632 /// ```ignore,no_run
3633 /// # use google_cloud_securitycenter_v2::model::DataAccessEvent;
3634 /// use wkt::Timestamp;
3635 /// let x = DataAccessEvent::new().set_or_clear_event_time(Some(Timestamp::default()/* use setters */));
3636 /// let x = DataAccessEvent::new().set_or_clear_event_time(None::<Timestamp>);
3637 /// ```
3638 pub fn set_or_clear_event_time<T>(mut self, v: std::option::Option<T>) -> Self
3639 where
3640 T: std::convert::Into<wkt::Timestamp>,
3641 {
3642 self.event_time = v.map(|x| x.into());
3643 self
3644 }
3645}
3646
3647impl wkt::message::Message for DataAccessEvent {
3648 fn typename() -> &'static str {
3649 "type.googleapis.com/google.cloud.securitycenter.v2.DataAccessEvent"
3650 }
3651}
3652
3653/// Defines additional types related to [DataAccessEvent].
3654pub mod data_access_event {
3655 #[allow(unused_imports)]
3656 use super::*;
3657
3658 /// The operation of a data access event.
3659 ///
3660 /// # Working with unknown values
3661 ///
3662 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3663 /// additional enum variants at any time. Adding new variants is not considered
3664 /// a breaking change. Applications should write their code in anticipation of:
3665 ///
3666 /// - New values appearing in future releases of the client library, **and**
3667 /// - New values received dynamically, without application changes.
3668 ///
3669 /// Please consult the [Working with enums] section in the user guide for some
3670 /// guidelines.
3671 ///
3672 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3673 #[derive(Clone, Debug, PartialEq)]
3674 #[non_exhaustive]
3675 pub enum Operation {
3676 /// The operation is unspecified.
3677 Unspecified,
3678 /// Represents a read operation.
3679 Read,
3680 /// Represents a move operation.
3681 Move,
3682 /// Represents a copy operation.
3683 Copy,
3684 /// If set, the enum was initialized with an unknown value.
3685 ///
3686 /// Applications can examine the value using [Operation::value] or
3687 /// [Operation::name].
3688 UnknownValue(operation::UnknownValue),
3689 }
3690
3691 #[doc(hidden)]
3692 pub mod operation {
3693 #[allow(unused_imports)]
3694 use super::*;
3695 #[derive(Clone, Debug, PartialEq)]
3696 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3697 }
3698
3699 impl Operation {
3700 /// Gets the enum value.
3701 ///
3702 /// Returns `None` if the enum contains an unknown value deserialized from
3703 /// the string representation of enums.
3704 pub fn value(&self) -> std::option::Option<i32> {
3705 match self {
3706 Self::Unspecified => std::option::Option::Some(0),
3707 Self::Read => std::option::Option::Some(1),
3708 Self::Move => std::option::Option::Some(2),
3709 Self::Copy => std::option::Option::Some(3),
3710 Self::UnknownValue(u) => u.0.value(),
3711 }
3712 }
3713
3714 /// Gets the enum value as a string.
3715 ///
3716 /// Returns `None` if the enum contains an unknown value deserialized from
3717 /// the integer representation of enums.
3718 pub fn name(&self) -> std::option::Option<&str> {
3719 match self {
3720 Self::Unspecified => std::option::Option::Some("OPERATION_UNSPECIFIED"),
3721 Self::Read => std::option::Option::Some("READ"),
3722 Self::Move => std::option::Option::Some("MOVE"),
3723 Self::Copy => std::option::Option::Some("COPY"),
3724 Self::UnknownValue(u) => u.0.name(),
3725 }
3726 }
3727 }
3728
3729 impl std::default::Default for Operation {
3730 fn default() -> Self {
3731 use std::convert::From;
3732 Self::from(0)
3733 }
3734 }
3735
3736 impl std::fmt::Display for Operation {
3737 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3738 wkt::internal::display_enum(f, self.name(), self.value())
3739 }
3740 }
3741
3742 impl std::convert::From<i32> for Operation {
3743 fn from(value: i32) -> Self {
3744 match value {
3745 0 => Self::Unspecified,
3746 1 => Self::Read,
3747 2 => Self::Move,
3748 3 => Self::Copy,
3749 _ => Self::UnknownValue(operation::UnknownValue(
3750 wkt::internal::UnknownEnumValue::Integer(value),
3751 )),
3752 }
3753 }
3754 }
3755
3756 impl std::convert::From<&str> for Operation {
3757 fn from(value: &str) -> Self {
3758 use std::string::ToString;
3759 match value {
3760 "OPERATION_UNSPECIFIED" => Self::Unspecified,
3761 "READ" => Self::Read,
3762 "MOVE" => Self::Move,
3763 "COPY" => Self::Copy,
3764 _ => Self::UnknownValue(operation::UnknownValue(
3765 wkt::internal::UnknownEnumValue::String(value.to_string()),
3766 )),
3767 }
3768 }
3769 }
3770
3771 impl serde::ser::Serialize for Operation {
3772 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3773 where
3774 S: serde::Serializer,
3775 {
3776 match self {
3777 Self::Unspecified => serializer.serialize_i32(0),
3778 Self::Read => serializer.serialize_i32(1),
3779 Self::Move => serializer.serialize_i32(2),
3780 Self::Copy => serializer.serialize_i32(3),
3781 Self::UnknownValue(u) => u.0.serialize(serializer),
3782 }
3783 }
3784 }
3785
3786 impl<'de> serde::de::Deserialize<'de> for Operation {
3787 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3788 where
3789 D: serde::Deserializer<'de>,
3790 {
3791 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Operation>::new(
3792 ".google.cloud.securitycenter.v2.DataAccessEvent.Operation",
3793 ))
3794 }
3795 }
3796}
3797
3798/// Details about a data flow event, in which either the data is moved to or is
3799/// accessed from a non-compliant geo-location, as defined in the applicable data
3800/// security policy.
3801#[derive(Clone, Default, PartialEq)]
3802#[non_exhaustive]
3803pub struct DataFlowEvent {
3804 /// Unique identifier for data flow event.
3805 pub event_id: std::string::String,
3806
3807 /// The email address of the principal that initiated the data flow event. The
3808 /// principal could be a user account, service account, Google group, or other.
3809 pub principal_email: std::string::String,
3810
3811 /// The operation performed by the principal for the data flow event.
3812 pub operation: crate::model::data_flow_event::Operation,
3813
3814 /// Non-compliant location of the principal or the data destination.
3815 pub violated_location: std::string::String,
3816
3817 /// Timestamp of data flow event.
3818 pub event_time: std::option::Option<wkt::Timestamp>,
3819
3820 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3821}
3822
3823impl DataFlowEvent {
3824 /// Creates a new default instance.
3825 pub fn new() -> Self {
3826 std::default::Default::default()
3827 }
3828
3829 /// Sets the value of [event_id][crate::model::DataFlowEvent::event_id].
3830 ///
3831 /// # Example
3832 /// ```ignore,no_run
3833 /// # use google_cloud_securitycenter_v2::model::DataFlowEvent;
3834 /// let x = DataFlowEvent::new().set_event_id("example");
3835 /// ```
3836 pub fn set_event_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3837 self.event_id = v.into();
3838 self
3839 }
3840
3841 /// Sets the value of [principal_email][crate::model::DataFlowEvent::principal_email].
3842 ///
3843 /// # Example
3844 /// ```ignore,no_run
3845 /// # use google_cloud_securitycenter_v2::model::DataFlowEvent;
3846 /// let x = DataFlowEvent::new().set_principal_email("example");
3847 /// ```
3848 pub fn set_principal_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3849 self.principal_email = v.into();
3850 self
3851 }
3852
3853 /// Sets the value of [operation][crate::model::DataFlowEvent::operation].
3854 ///
3855 /// # Example
3856 /// ```ignore,no_run
3857 /// # use google_cloud_securitycenter_v2::model::DataFlowEvent;
3858 /// use google_cloud_securitycenter_v2::model::data_flow_event::Operation;
3859 /// let x0 = DataFlowEvent::new().set_operation(Operation::Read);
3860 /// let x1 = DataFlowEvent::new().set_operation(Operation::Move);
3861 /// let x2 = DataFlowEvent::new().set_operation(Operation::Copy);
3862 /// ```
3863 pub fn set_operation<T: std::convert::Into<crate::model::data_flow_event::Operation>>(
3864 mut self,
3865 v: T,
3866 ) -> Self {
3867 self.operation = v.into();
3868 self
3869 }
3870
3871 /// Sets the value of [violated_location][crate::model::DataFlowEvent::violated_location].
3872 ///
3873 /// # Example
3874 /// ```ignore,no_run
3875 /// # use google_cloud_securitycenter_v2::model::DataFlowEvent;
3876 /// let x = DataFlowEvent::new().set_violated_location("example");
3877 /// ```
3878 pub fn set_violated_location<T: std::convert::Into<std::string::String>>(
3879 mut self,
3880 v: T,
3881 ) -> Self {
3882 self.violated_location = v.into();
3883 self
3884 }
3885
3886 /// Sets the value of [event_time][crate::model::DataFlowEvent::event_time].
3887 ///
3888 /// # Example
3889 /// ```ignore,no_run
3890 /// # use google_cloud_securitycenter_v2::model::DataFlowEvent;
3891 /// use wkt::Timestamp;
3892 /// let x = DataFlowEvent::new().set_event_time(Timestamp::default()/* use setters */);
3893 /// ```
3894 pub fn set_event_time<T>(mut self, v: T) -> Self
3895 where
3896 T: std::convert::Into<wkt::Timestamp>,
3897 {
3898 self.event_time = std::option::Option::Some(v.into());
3899 self
3900 }
3901
3902 /// Sets or clears the value of [event_time][crate::model::DataFlowEvent::event_time].
3903 ///
3904 /// # Example
3905 /// ```ignore,no_run
3906 /// # use google_cloud_securitycenter_v2::model::DataFlowEvent;
3907 /// use wkt::Timestamp;
3908 /// let x = DataFlowEvent::new().set_or_clear_event_time(Some(Timestamp::default()/* use setters */));
3909 /// let x = DataFlowEvent::new().set_or_clear_event_time(None::<Timestamp>);
3910 /// ```
3911 pub fn set_or_clear_event_time<T>(mut self, v: std::option::Option<T>) -> Self
3912 where
3913 T: std::convert::Into<wkt::Timestamp>,
3914 {
3915 self.event_time = v.map(|x| x.into());
3916 self
3917 }
3918}
3919
3920impl wkt::message::Message for DataFlowEvent {
3921 fn typename() -> &'static str {
3922 "type.googleapis.com/google.cloud.securitycenter.v2.DataFlowEvent"
3923 }
3924}
3925
3926/// Defines additional types related to [DataFlowEvent].
3927pub mod data_flow_event {
3928 #[allow(unused_imports)]
3929 use super::*;
3930
3931 /// The operation of a data flow event.
3932 ///
3933 /// # Working with unknown values
3934 ///
3935 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3936 /// additional enum variants at any time. Adding new variants is not considered
3937 /// a breaking change. Applications should write their code in anticipation of:
3938 ///
3939 /// - New values appearing in future releases of the client library, **and**
3940 /// - New values received dynamically, without application changes.
3941 ///
3942 /// Please consult the [Working with enums] section in the user guide for some
3943 /// guidelines.
3944 ///
3945 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3946 #[derive(Clone, Debug, PartialEq)]
3947 #[non_exhaustive]
3948 pub enum Operation {
3949 /// The operation is unspecified.
3950 Unspecified,
3951 /// Represents a read operation.
3952 Read,
3953 /// Represents a move operation.
3954 Move,
3955 /// Represents a copy operation.
3956 Copy,
3957 /// If set, the enum was initialized with an unknown value.
3958 ///
3959 /// Applications can examine the value using [Operation::value] or
3960 /// [Operation::name].
3961 UnknownValue(operation::UnknownValue),
3962 }
3963
3964 #[doc(hidden)]
3965 pub mod operation {
3966 #[allow(unused_imports)]
3967 use super::*;
3968 #[derive(Clone, Debug, PartialEq)]
3969 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3970 }
3971
3972 impl Operation {
3973 /// Gets the enum value.
3974 ///
3975 /// Returns `None` if the enum contains an unknown value deserialized from
3976 /// the string representation of enums.
3977 pub fn value(&self) -> std::option::Option<i32> {
3978 match self {
3979 Self::Unspecified => std::option::Option::Some(0),
3980 Self::Read => std::option::Option::Some(1),
3981 Self::Move => std::option::Option::Some(2),
3982 Self::Copy => std::option::Option::Some(3),
3983 Self::UnknownValue(u) => u.0.value(),
3984 }
3985 }
3986
3987 /// Gets the enum value as a string.
3988 ///
3989 /// Returns `None` if the enum contains an unknown value deserialized from
3990 /// the integer representation of enums.
3991 pub fn name(&self) -> std::option::Option<&str> {
3992 match self {
3993 Self::Unspecified => std::option::Option::Some("OPERATION_UNSPECIFIED"),
3994 Self::Read => std::option::Option::Some("READ"),
3995 Self::Move => std::option::Option::Some("MOVE"),
3996 Self::Copy => std::option::Option::Some("COPY"),
3997 Self::UnknownValue(u) => u.0.name(),
3998 }
3999 }
4000 }
4001
4002 impl std::default::Default for Operation {
4003 fn default() -> Self {
4004 use std::convert::From;
4005 Self::from(0)
4006 }
4007 }
4008
4009 impl std::fmt::Display for Operation {
4010 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4011 wkt::internal::display_enum(f, self.name(), self.value())
4012 }
4013 }
4014
4015 impl std::convert::From<i32> for Operation {
4016 fn from(value: i32) -> Self {
4017 match value {
4018 0 => Self::Unspecified,
4019 1 => Self::Read,
4020 2 => Self::Move,
4021 3 => Self::Copy,
4022 _ => Self::UnknownValue(operation::UnknownValue(
4023 wkt::internal::UnknownEnumValue::Integer(value),
4024 )),
4025 }
4026 }
4027 }
4028
4029 impl std::convert::From<&str> for Operation {
4030 fn from(value: &str) -> Self {
4031 use std::string::ToString;
4032 match value {
4033 "OPERATION_UNSPECIFIED" => Self::Unspecified,
4034 "READ" => Self::Read,
4035 "MOVE" => Self::Move,
4036 "COPY" => Self::Copy,
4037 _ => Self::UnknownValue(operation::UnknownValue(
4038 wkt::internal::UnknownEnumValue::String(value.to_string()),
4039 )),
4040 }
4041 }
4042 }
4043
4044 impl serde::ser::Serialize for Operation {
4045 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4046 where
4047 S: serde::Serializer,
4048 {
4049 match self {
4050 Self::Unspecified => serializer.serialize_i32(0),
4051 Self::Read => serializer.serialize_i32(1),
4052 Self::Move => serializer.serialize_i32(2),
4053 Self::Copy => serializer.serialize_i32(3),
4054 Self::UnknownValue(u) => u.0.serialize(serializer),
4055 }
4056 }
4057 }
4058
4059 impl<'de> serde::de::Deserialize<'de> for Operation {
4060 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4061 where
4062 D: serde::Deserializer<'de>,
4063 {
4064 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Operation>::new(
4065 ".google.cloud.securitycenter.v2.DataFlowEvent.Operation",
4066 ))
4067 }
4068 }
4069}
4070
4071/// Details about data retention deletion violations, in which the data is
4072/// non-compliant based on their retention or deletion time, as defined in the
4073/// applicable data security policy. The Data Retention Deletion (DRD) control is
4074/// a control of the DSPM (Data Security Posture Management) suite that enables
4075/// organizations to manage data retention and deletion policies in compliance
4076/// with regulations, such as GDPR and CRPA. DRD supports two primary policy
4077/// types: maximum storage length (max TTL) and minimum storage length (min TTL).
4078/// Both are aimed at helping organizations meet regulatory and data management
4079/// commitments.
4080#[derive(Clone, Default, PartialEq)]
4081#[non_exhaustive]
4082pub struct DataRetentionDeletionEvent {
4083 /// Timestamp indicating when the event was detected.
4084 pub event_detection_time: std::option::Option<wkt::Timestamp>,
4085
4086 /// Number of objects that violated the policy for this resource. If the number
4087 /// is less than 1,000, then the value of this field is the exact number. If
4088 /// the number of objects that violated the policy is greater than or equal to
4089 /// 1,000, then the value of this field is 1000.
4090 pub data_object_count: i64,
4091
4092 /// Maximum duration of retention allowed from the DRD control. This comes
4093 /// from the DRD control where users set a max TTL for their data. For example,
4094 /// suppose that a user sets the max TTL for a Cloud Storage bucket to 90 days.
4095 /// However, an object in that bucket is 100 days old. In this case, a
4096 /// DataRetentionDeletionEvent will be generated for that Cloud Storage bucket,
4097 /// and the max_retention_allowed is 90 days.
4098 pub max_retention_allowed: std::option::Option<wkt::Duration>,
4099
4100 /// Type of the DRD event.
4101 pub event_type: crate::model::data_retention_deletion_event::EventType,
4102
4103 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4104}
4105
4106impl DataRetentionDeletionEvent {
4107 /// Creates a new default instance.
4108 pub fn new() -> Self {
4109 std::default::Default::default()
4110 }
4111
4112 /// Sets the value of [event_detection_time][crate::model::DataRetentionDeletionEvent::event_detection_time].
4113 ///
4114 /// # Example
4115 /// ```ignore,no_run
4116 /// # use google_cloud_securitycenter_v2::model::DataRetentionDeletionEvent;
4117 /// use wkt::Timestamp;
4118 /// let x = DataRetentionDeletionEvent::new().set_event_detection_time(Timestamp::default()/* use setters */);
4119 /// ```
4120 pub fn set_event_detection_time<T>(mut self, v: T) -> Self
4121 where
4122 T: std::convert::Into<wkt::Timestamp>,
4123 {
4124 self.event_detection_time = std::option::Option::Some(v.into());
4125 self
4126 }
4127
4128 /// Sets or clears the value of [event_detection_time][crate::model::DataRetentionDeletionEvent::event_detection_time].
4129 ///
4130 /// # Example
4131 /// ```ignore,no_run
4132 /// # use google_cloud_securitycenter_v2::model::DataRetentionDeletionEvent;
4133 /// use wkt::Timestamp;
4134 /// let x = DataRetentionDeletionEvent::new().set_or_clear_event_detection_time(Some(Timestamp::default()/* use setters */));
4135 /// let x = DataRetentionDeletionEvent::new().set_or_clear_event_detection_time(None::<Timestamp>);
4136 /// ```
4137 pub fn set_or_clear_event_detection_time<T>(mut self, v: std::option::Option<T>) -> Self
4138 where
4139 T: std::convert::Into<wkt::Timestamp>,
4140 {
4141 self.event_detection_time = v.map(|x| x.into());
4142 self
4143 }
4144
4145 /// Sets the value of [data_object_count][crate::model::DataRetentionDeletionEvent::data_object_count].
4146 ///
4147 /// # Example
4148 /// ```ignore,no_run
4149 /// # use google_cloud_securitycenter_v2::model::DataRetentionDeletionEvent;
4150 /// let x = DataRetentionDeletionEvent::new().set_data_object_count(42);
4151 /// ```
4152 pub fn set_data_object_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4153 self.data_object_count = v.into();
4154 self
4155 }
4156
4157 /// Sets the value of [max_retention_allowed][crate::model::DataRetentionDeletionEvent::max_retention_allowed].
4158 ///
4159 /// # Example
4160 /// ```ignore,no_run
4161 /// # use google_cloud_securitycenter_v2::model::DataRetentionDeletionEvent;
4162 /// use wkt::Duration;
4163 /// let x = DataRetentionDeletionEvent::new().set_max_retention_allowed(Duration::default()/* use setters */);
4164 /// ```
4165 pub fn set_max_retention_allowed<T>(mut self, v: T) -> Self
4166 where
4167 T: std::convert::Into<wkt::Duration>,
4168 {
4169 self.max_retention_allowed = std::option::Option::Some(v.into());
4170 self
4171 }
4172
4173 /// Sets or clears the value of [max_retention_allowed][crate::model::DataRetentionDeletionEvent::max_retention_allowed].
4174 ///
4175 /// # Example
4176 /// ```ignore,no_run
4177 /// # use google_cloud_securitycenter_v2::model::DataRetentionDeletionEvent;
4178 /// use wkt::Duration;
4179 /// let x = DataRetentionDeletionEvent::new().set_or_clear_max_retention_allowed(Some(Duration::default()/* use setters */));
4180 /// let x = DataRetentionDeletionEvent::new().set_or_clear_max_retention_allowed(None::<Duration>);
4181 /// ```
4182 pub fn set_or_clear_max_retention_allowed<T>(mut self, v: std::option::Option<T>) -> Self
4183 where
4184 T: std::convert::Into<wkt::Duration>,
4185 {
4186 self.max_retention_allowed = v.map(|x| x.into());
4187 self
4188 }
4189
4190 /// Sets the value of [event_type][crate::model::DataRetentionDeletionEvent::event_type].
4191 ///
4192 /// # Example
4193 /// ```ignore,no_run
4194 /// # use google_cloud_securitycenter_v2::model::DataRetentionDeletionEvent;
4195 /// use google_cloud_securitycenter_v2::model::data_retention_deletion_event::EventType;
4196 /// let x0 = DataRetentionDeletionEvent::new().set_event_type(EventType::MaxTtlExceeded);
4197 /// ```
4198 pub fn set_event_type<
4199 T: std::convert::Into<crate::model::data_retention_deletion_event::EventType>,
4200 >(
4201 mut self,
4202 v: T,
4203 ) -> Self {
4204 self.event_type = v.into();
4205 self
4206 }
4207}
4208
4209impl wkt::message::Message for DataRetentionDeletionEvent {
4210 fn typename() -> &'static str {
4211 "type.googleapis.com/google.cloud.securitycenter.v2.DataRetentionDeletionEvent"
4212 }
4213}
4214
4215/// Defines additional types related to [DataRetentionDeletionEvent].
4216pub mod data_retention_deletion_event {
4217 #[allow(unused_imports)]
4218 use super::*;
4219
4220 /// Type of the DRD event.
4221 ///
4222 /// # Working with unknown values
4223 ///
4224 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4225 /// additional enum variants at any time. Adding new variants is not considered
4226 /// a breaking change. Applications should write their code in anticipation of:
4227 ///
4228 /// - New values appearing in future releases of the client library, **and**
4229 /// - New values received dynamically, without application changes.
4230 ///
4231 /// Please consult the [Working with enums] section in the user guide for some
4232 /// guidelines.
4233 ///
4234 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4235 #[derive(Clone, Debug, PartialEq)]
4236 #[non_exhaustive]
4237 pub enum EventType {
4238 /// Unspecified event type.
4239 Unspecified,
4240 /// The maximum retention time has been exceeded.
4241 MaxTtlExceeded,
4242 /// If set, the enum was initialized with an unknown value.
4243 ///
4244 /// Applications can examine the value using [EventType::value] or
4245 /// [EventType::name].
4246 UnknownValue(event_type::UnknownValue),
4247 }
4248
4249 #[doc(hidden)]
4250 pub mod event_type {
4251 #[allow(unused_imports)]
4252 use super::*;
4253 #[derive(Clone, Debug, PartialEq)]
4254 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4255 }
4256
4257 impl EventType {
4258 /// Gets the enum value.
4259 ///
4260 /// Returns `None` if the enum contains an unknown value deserialized from
4261 /// the string representation of enums.
4262 pub fn value(&self) -> std::option::Option<i32> {
4263 match self {
4264 Self::Unspecified => std::option::Option::Some(0),
4265 Self::MaxTtlExceeded => std::option::Option::Some(1),
4266 Self::UnknownValue(u) => u.0.value(),
4267 }
4268 }
4269
4270 /// Gets the enum value as a string.
4271 ///
4272 /// Returns `None` if the enum contains an unknown value deserialized from
4273 /// the integer representation of enums.
4274 pub fn name(&self) -> std::option::Option<&str> {
4275 match self {
4276 Self::Unspecified => std::option::Option::Some("EVENT_TYPE_UNSPECIFIED"),
4277 Self::MaxTtlExceeded => std::option::Option::Some("EVENT_TYPE_MAX_TTL_EXCEEDED"),
4278 Self::UnknownValue(u) => u.0.name(),
4279 }
4280 }
4281 }
4282
4283 impl std::default::Default for EventType {
4284 fn default() -> Self {
4285 use std::convert::From;
4286 Self::from(0)
4287 }
4288 }
4289
4290 impl std::fmt::Display for EventType {
4291 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4292 wkt::internal::display_enum(f, self.name(), self.value())
4293 }
4294 }
4295
4296 impl std::convert::From<i32> for EventType {
4297 fn from(value: i32) -> Self {
4298 match value {
4299 0 => Self::Unspecified,
4300 1 => Self::MaxTtlExceeded,
4301 _ => Self::UnknownValue(event_type::UnknownValue(
4302 wkt::internal::UnknownEnumValue::Integer(value),
4303 )),
4304 }
4305 }
4306 }
4307
4308 impl std::convert::From<&str> for EventType {
4309 fn from(value: &str) -> Self {
4310 use std::string::ToString;
4311 match value {
4312 "EVENT_TYPE_UNSPECIFIED" => Self::Unspecified,
4313 "EVENT_TYPE_MAX_TTL_EXCEEDED" => Self::MaxTtlExceeded,
4314 _ => Self::UnknownValue(event_type::UnknownValue(
4315 wkt::internal::UnknownEnumValue::String(value.to_string()),
4316 )),
4317 }
4318 }
4319 }
4320
4321 impl serde::ser::Serialize for EventType {
4322 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4323 where
4324 S: serde::Serializer,
4325 {
4326 match self {
4327 Self::Unspecified => serializer.serialize_i32(0),
4328 Self::MaxTtlExceeded => serializer.serialize_i32(1),
4329 Self::UnknownValue(u) => u.0.serialize(serializer),
4330 }
4331 }
4332 }
4333
4334 impl<'de> serde::de::Deserialize<'de> for EventType {
4335 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4336 where
4337 D: serde::Deserializer<'de>,
4338 {
4339 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EventType>::new(
4340 ".google.cloud.securitycenter.v2.DataRetentionDeletionEvent.EventType",
4341 ))
4342 }
4343 }
4344}
4345
4346/// Represents database access information, such as queries. A database may be a
4347/// sub-resource of an instance (as in the case of Cloud SQL instances or Cloud
4348/// Spanner instances), or the database instance itself. Some database resources
4349/// might not have the [full resource
4350/// name](https://google.aip.dev/122#full-resource-names) populated because these
4351/// resource types, such as Cloud SQL databases, are not yet supported by Cloud
4352/// Asset Inventory. In these cases only the display name is provided.
4353#[derive(Clone, Default, PartialEq)]
4354#[non_exhaustive]
4355pub struct Database {
4356 /// Some database resources may not have the [full resource
4357 /// name](https://google.aip.dev/122#full-resource-names) populated because
4358 /// these resource types are not yet supported by Cloud Asset Inventory (e.g.
4359 /// Cloud SQL databases). In these cases only the display name will be
4360 /// provided.
4361 /// The [full resource name](https://google.aip.dev/122#full-resource-names) of
4362 /// the database that the user connected to, if it is supported by Cloud Asset
4363 /// Inventory.
4364 pub name: std::string::String,
4365
4366 /// The human-readable name of the database that the user connected to.
4367 pub display_name: std::string::String,
4368
4369 /// The username used to connect to the database. The username might not be an
4370 /// IAM principal and does not have a set format.
4371 pub user_name: std::string::String,
4372
4373 /// The SQL statement that is associated with the database access.
4374 pub query: std::string::String,
4375
4376 /// The target usernames, roles, or groups of an SQL privilege grant, which is
4377 /// not an IAM policy change.
4378 pub grantees: std::vec::Vec<std::string::String>,
4379
4380 /// The version of the database, for example, POSTGRES_14.
4381 /// See [the complete
4382 /// list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
4383 pub version: std::string::String,
4384
4385 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4386}
4387
4388impl Database {
4389 /// Creates a new default instance.
4390 pub fn new() -> Self {
4391 std::default::Default::default()
4392 }
4393
4394 /// Sets the value of [name][crate::model::Database::name].
4395 ///
4396 /// # Example
4397 /// ```ignore,no_run
4398 /// # use google_cloud_securitycenter_v2::model::Database;
4399 /// let x = Database::new().set_name("example");
4400 /// ```
4401 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4402 self.name = v.into();
4403 self
4404 }
4405
4406 /// Sets the value of [display_name][crate::model::Database::display_name].
4407 ///
4408 /// # Example
4409 /// ```ignore,no_run
4410 /// # use google_cloud_securitycenter_v2::model::Database;
4411 /// let x = Database::new().set_display_name("example");
4412 /// ```
4413 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4414 self.display_name = v.into();
4415 self
4416 }
4417
4418 /// Sets the value of [user_name][crate::model::Database::user_name].
4419 ///
4420 /// # Example
4421 /// ```ignore,no_run
4422 /// # use google_cloud_securitycenter_v2::model::Database;
4423 /// let x = Database::new().set_user_name("example");
4424 /// ```
4425 pub fn set_user_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4426 self.user_name = v.into();
4427 self
4428 }
4429
4430 /// Sets the value of [query][crate::model::Database::query].
4431 ///
4432 /// # Example
4433 /// ```ignore,no_run
4434 /// # use google_cloud_securitycenter_v2::model::Database;
4435 /// let x = Database::new().set_query("example");
4436 /// ```
4437 pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4438 self.query = v.into();
4439 self
4440 }
4441
4442 /// Sets the value of [grantees][crate::model::Database::grantees].
4443 ///
4444 /// # Example
4445 /// ```ignore,no_run
4446 /// # use google_cloud_securitycenter_v2::model::Database;
4447 /// let x = Database::new().set_grantees(["a", "b", "c"]);
4448 /// ```
4449 pub fn set_grantees<T, V>(mut self, v: T) -> Self
4450 where
4451 T: std::iter::IntoIterator<Item = V>,
4452 V: std::convert::Into<std::string::String>,
4453 {
4454 use std::iter::Iterator;
4455 self.grantees = v.into_iter().map(|i| i.into()).collect();
4456 self
4457 }
4458
4459 /// Sets the value of [version][crate::model::Database::version].
4460 ///
4461 /// # Example
4462 /// ```ignore,no_run
4463 /// # use google_cloud_securitycenter_v2::model::Database;
4464 /// let x = Database::new().set_version("example");
4465 /// ```
4466 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4467 self.version = v.into();
4468 self
4469 }
4470}
4471
4472impl wkt::message::Message for Database {
4473 fn typename() -> &'static str {
4474 "type.googleapis.com/google.cloud.securitycenter.v2.Database"
4475 }
4476}
4477
4478/// Contains information about the disk associated with the finding.
4479#[derive(Clone, Default, PartialEq)]
4480#[non_exhaustive]
4481pub struct Disk {
4482 /// The name of the disk, for example,
4483 /// `https://www.googleapis.com/compute/v1/projects/{project-id}/zones/{zone-id}/disks/{disk-id}`.
4484 pub name: std::string::String,
4485
4486 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4487}
4488
4489impl Disk {
4490 /// Creates a new default instance.
4491 pub fn new() -> Self {
4492 std::default::Default::default()
4493 }
4494
4495 /// Sets the value of [name][crate::model::Disk::name].
4496 ///
4497 /// # Example
4498 /// ```ignore,no_run
4499 /// # use google_cloud_securitycenter_v2::model::Disk;
4500 /// let x = Disk::new().set_name("example");
4501 /// ```
4502 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4503 self.name = v.into();
4504 self
4505 }
4506}
4507
4508impl wkt::message::Message for Disk {
4509 fn typename() -> &'static str {
4510 "type.googleapis.com/google.cloud.securitycenter.v2.Disk"
4511 }
4512}
4513
4514/// Exfiltration represents a data exfiltration attempt from one or more sources
4515/// to one or more targets. The `sources` attribute lists the sources of the
4516/// exfiltrated data. The `targets` attribute lists the destinations the data was
4517/// copied to.
4518#[derive(Clone, Default, PartialEq)]
4519#[non_exhaustive]
4520pub struct Exfiltration {
4521 /// If there are multiple sources, then the data is considered "joined" between
4522 /// them. For instance, BigQuery can join multiple tables, and each
4523 /// table would be considered a source.
4524 pub sources: std::vec::Vec<crate::model::ExfilResource>,
4525
4526 /// If there are multiple targets, each target would get a complete copy of the
4527 /// "joined" source data.
4528 pub targets: std::vec::Vec<crate::model::ExfilResource>,
4529
4530 /// Total exfiltrated bytes processed for the entire job.
4531 pub total_exfiltrated_bytes: i64,
4532
4533 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4534}
4535
4536impl Exfiltration {
4537 /// Creates a new default instance.
4538 pub fn new() -> Self {
4539 std::default::Default::default()
4540 }
4541
4542 /// Sets the value of [sources][crate::model::Exfiltration::sources].
4543 ///
4544 /// # Example
4545 /// ```ignore,no_run
4546 /// # use google_cloud_securitycenter_v2::model::Exfiltration;
4547 /// use google_cloud_securitycenter_v2::model::ExfilResource;
4548 /// let x = Exfiltration::new()
4549 /// .set_sources([
4550 /// ExfilResource::default()/* use setters */,
4551 /// ExfilResource::default()/* use (different) setters */,
4552 /// ]);
4553 /// ```
4554 pub fn set_sources<T, V>(mut self, v: T) -> Self
4555 where
4556 T: std::iter::IntoIterator<Item = V>,
4557 V: std::convert::Into<crate::model::ExfilResource>,
4558 {
4559 use std::iter::Iterator;
4560 self.sources = v.into_iter().map(|i| i.into()).collect();
4561 self
4562 }
4563
4564 /// Sets the value of [targets][crate::model::Exfiltration::targets].
4565 ///
4566 /// # Example
4567 /// ```ignore,no_run
4568 /// # use google_cloud_securitycenter_v2::model::Exfiltration;
4569 /// use google_cloud_securitycenter_v2::model::ExfilResource;
4570 /// let x = Exfiltration::new()
4571 /// .set_targets([
4572 /// ExfilResource::default()/* use setters */,
4573 /// ExfilResource::default()/* use (different) setters */,
4574 /// ]);
4575 /// ```
4576 pub fn set_targets<T, V>(mut self, v: T) -> Self
4577 where
4578 T: std::iter::IntoIterator<Item = V>,
4579 V: std::convert::Into<crate::model::ExfilResource>,
4580 {
4581 use std::iter::Iterator;
4582 self.targets = v.into_iter().map(|i| i.into()).collect();
4583 self
4584 }
4585
4586 /// Sets the value of [total_exfiltrated_bytes][crate::model::Exfiltration::total_exfiltrated_bytes].
4587 ///
4588 /// # Example
4589 /// ```ignore,no_run
4590 /// # use google_cloud_securitycenter_v2::model::Exfiltration;
4591 /// let x = Exfiltration::new().set_total_exfiltrated_bytes(42);
4592 /// ```
4593 pub fn set_total_exfiltrated_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4594 self.total_exfiltrated_bytes = v.into();
4595 self
4596 }
4597}
4598
4599impl wkt::message::Message for Exfiltration {
4600 fn typename() -> &'static str {
4601 "type.googleapis.com/google.cloud.securitycenter.v2.Exfiltration"
4602 }
4603}
4604
4605/// Resource where data was exfiltrated from or exfiltrated to.
4606#[derive(Clone, Default, PartialEq)]
4607#[non_exhaustive]
4608pub struct ExfilResource {
4609 /// The resource's [full resource
4610 /// name](https://cloud.google.com/apis/design/resource_names#full_resource_name).
4611 pub name: std::string::String,
4612
4613 /// Subcomponents of the asset that was exfiltrated, like URIs used during
4614 /// exfiltration, table names, databases, and filenames. For example, multiple
4615 /// tables might have been exfiltrated from the same Cloud SQL instance, or
4616 /// multiple files might have been exfiltrated from the same Cloud Storage
4617 /// bucket.
4618 pub components: std::vec::Vec<std::string::String>,
4619
4620 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4621}
4622
4623impl ExfilResource {
4624 /// Creates a new default instance.
4625 pub fn new() -> Self {
4626 std::default::Default::default()
4627 }
4628
4629 /// Sets the value of [name][crate::model::ExfilResource::name].
4630 ///
4631 /// # Example
4632 /// ```ignore,no_run
4633 /// # use google_cloud_securitycenter_v2::model::ExfilResource;
4634 /// let x = ExfilResource::new().set_name("example");
4635 /// ```
4636 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4637 self.name = v.into();
4638 self
4639 }
4640
4641 /// Sets the value of [components][crate::model::ExfilResource::components].
4642 ///
4643 /// # Example
4644 /// ```ignore,no_run
4645 /// # use google_cloud_securitycenter_v2::model::ExfilResource;
4646 /// let x = ExfilResource::new().set_components(["a", "b", "c"]);
4647 /// ```
4648 pub fn set_components<T, V>(mut self, v: T) -> Self
4649 where
4650 T: std::iter::IntoIterator<Item = V>,
4651 V: std::convert::Into<std::string::String>,
4652 {
4653 use std::iter::Iterator;
4654 self.components = v.into_iter().map(|i| i.into()).collect();
4655 self
4656 }
4657}
4658
4659impl wkt::message::Message for ExfilResource {
4660 fn typename() -> &'static str {
4661 "type.googleapis.com/google.cloud.securitycenter.v2.ExfilResource"
4662 }
4663}
4664
4665/// Representation of third party SIEM/SOAR fields within SCC.
4666#[derive(Clone, Default, PartialEq)]
4667#[non_exhaustive]
4668pub struct ExternalSystem {
4669 /// Full resource name of the external system. The following list
4670 /// shows some examples:
4671 ///
4672 /// + `organizations/1234/sources/5678/findings/123456/externalSystems/jira`
4673 ///
4674 /// `organizations/1234/sources/5678/locations/us/findings/123456/externalSystems/jira`
4675 ///
4676 /// + `folders/1234/sources/5678/findings/123456/externalSystems/jira`
4677 ///
4678 /// `folders/1234/sources/5678/locations/us/findings/123456/externalSystems/jira`
4679 ///
4680 /// + `projects/1234/sources/5678/findings/123456/externalSystems/jira`
4681 ///
4682 /// `projects/1234/sources/5678/locations/us/findings/123456/externalSystems/jira`
4683 pub name: std::string::String,
4684
4685 /// References primary/secondary etc assignees in the external system.
4686 pub assignees: std::vec::Vec<std::string::String>,
4687
4688 /// The identifier that's used to track the finding's corresponding case in the
4689 /// external system.
4690 pub external_uid: std::string::String,
4691
4692 /// The most recent status of the finding's corresponding case, as reported by
4693 /// the external system.
4694 pub status: std::string::String,
4695
4696 /// The time when the case was last updated, as reported by the external
4697 /// system.
4698 pub external_system_update_time: std::option::Option<wkt::Timestamp>,
4699
4700 /// The link to the finding's corresponding case in the external system.
4701 pub case_uri: std::string::String,
4702
4703 /// The priority of the finding's corresponding case in the external system.
4704 pub case_priority: std::string::String,
4705
4706 /// The SLA of the finding's corresponding case in the external system.
4707 pub case_sla: std::option::Option<wkt::Timestamp>,
4708
4709 /// The time when the case was created, as reported by the external system.
4710 pub case_create_time: std::option::Option<wkt::Timestamp>,
4711
4712 /// The time when the case was closed, as reported by the external system.
4713 pub case_close_time: std::option::Option<wkt::Timestamp>,
4714
4715 /// Information about the ticket, if any, that is being used to track the
4716 /// resolution of the issue that is identified by this finding.
4717 pub ticket_info: std::option::Option<crate::model::external_system::TicketInfo>,
4718
4719 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4720}
4721
4722impl ExternalSystem {
4723 /// Creates a new default instance.
4724 pub fn new() -> Self {
4725 std::default::Default::default()
4726 }
4727
4728 /// Sets the value of [name][crate::model::ExternalSystem::name].
4729 ///
4730 /// # Example
4731 /// ```ignore,no_run
4732 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4733 /// let x = ExternalSystem::new().set_name("example");
4734 /// ```
4735 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4736 self.name = v.into();
4737 self
4738 }
4739
4740 /// Sets the value of [assignees][crate::model::ExternalSystem::assignees].
4741 ///
4742 /// # Example
4743 /// ```ignore,no_run
4744 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4745 /// let x = ExternalSystem::new().set_assignees(["a", "b", "c"]);
4746 /// ```
4747 pub fn set_assignees<T, V>(mut self, v: T) -> Self
4748 where
4749 T: std::iter::IntoIterator<Item = V>,
4750 V: std::convert::Into<std::string::String>,
4751 {
4752 use std::iter::Iterator;
4753 self.assignees = v.into_iter().map(|i| i.into()).collect();
4754 self
4755 }
4756
4757 /// Sets the value of [external_uid][crate::model::ExternalSystem::external_uid].
4758 ///
4759 /// # Example
4760 /// ```ignore,no_run
4761 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4762 /// let x = ExternalSystem::new().set_external_uid("example");
4763 /// ```
4764 pub fn set_external_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4765 self.external_uid = v.into();
4766 self
4767 }
4768
4769 /// Sets the value of [status][crate::model::ExternalSystem::status].
4770 ///
4771 /// # Example
4772 /// ```ignore,no_run
4773 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4774 /// let x = ExternalSystem::new().set_status("example");
4775 /// ```
4776 pub fn set_status<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4777 self.status = v.into();
4778 self
4779 }
4780
4781 /// Sets the value of [external_system_update_time][crate::model::ExternalSystem::external_system_update_time].
4782 ///
4783 /// # Example
4784 /// ```ignore,no_run
4785 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4786 /// use wkt::Timestamp;
4787 /// let x = ExternalSystem::new().set_external_system_update_time(Timestamp::default()/* use setters */);
4788 /// ```
4789 pub fn set_external_system_update_time<T>(mut self, v: T) -> Self
4790 where
4791 T: std::convert::Into<wkt::Timestamp>,
4792 {
4793 self.external_system_update_time = std::option::Option::Some(v.into());
4794 self
4795 }
4796
4797 /// Sets or clears the value of [external_system_update_time][crate::model::ExternalSystem::external_system_update_time].
4798 ///
4799 /// # Example
4800 /// ```ignore,no_run
4801 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4802 /// use wkt::Timestamp;
4803 /// let x = ExternalSystem::new().set_or_clear_external_system_update_time(Some(Timestamp::default()/* use setters */));
4804 /// let x = ExternalSystem::new().set_or_clear_external_system_update_time(None::<Timestamp>);
4805 /// ```
4806 pub fn set_or_clear_external_system_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4807 where
4808 T: std::convert::Into<wkt::Timestamp>,
4809 {
4810 self.external_system_update_time = v.map(|x| x.into());
4811 self
4812 }
4813
4814 /// Sets the value of [case_uri][crate::model::ExternalSystem::case_uri].
4815 ///
4816 /// # Example
4817 /// ```ignore,no_run
4818 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4819 /// let x = ExternalSystem::new().set_case_uri("example");
4820 /// ```
4821 pub fn set_case_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4822 self.case_uri = v.into();
4823 self
4824 }
4825
4826 /// Sets the value of [case_priority][crate::model::ExternalSystem::case_priority].
4827 ///
4828 /// # Example
4829 /// ```ignore,no_run
4830 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4831 /// let x = ExternalSystem::new().set_case_priority("example");
4832 /// ```
4833 pub fn set_case_priority<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4834 self.case_priority = v.into();
4835 self
4836 }
4837
4838 /// Sets the value of [case_sla][crate::model::ExternalSystem::case_sla].
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_sla(Timestamp::default()/* use setters */);
4845 /// ```
4846 pub fn set_case_sla<T>(mut self, v: T) -> Self
4847 where
4848 T: std::convert::Into<wkt::Timestamp>,
4849 {
4850 self.case_sla = std::option::Option::Some(v.into());
4851 self
4852 }
4853
4854 /// Sets or clears the value of [case_sla][crate::model::ExternalSystem::case_sla].
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_sla(Some(Timestamp::default()/* use setters */));
4861 /// let x = ExternalSystem::new().set_or_clear_case_sla(None::<Timestamp>);
4862 /// ```
4863 pub fn set_or_clear_case_sla<T>(mut self, v: std::option::Option<T>) -> Self
4864 where
4865 T: std::convert::Into<wkt::Timestamp>,
4866 {
4867 self.case_sla = v.map(|x| x.into());
4868 self
4869 }
4870
4871 /// Sets the value of [case_create_time][crate::model::ExternalSystem::case_create_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_create_time(Timestamp::default()/* use setters */);
4878 /// ```
4879 pub fn set_case_create_time<T>(mut self, v: T) -> Self
4880 where
4881 T: std::convert::Into<wkt::Timestamp>,
4882 {
4883 self.case_create_time = std::option::Option::Some(v.into());
4884 self
4885 }
4886
4887 /// Sets or clears the value of [case_create_time][crate::model::ExternalSystem::case_create_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_create_time(Some(Timestamp::default()/* use setters */));
4894 /// let x = ExternalSystem::new().set_or_clear_case_create_time(None::<Timestamp>);
4895 /// ```
4896 pub fn set_or_clear_case_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4897 where
4898 T: std::convert::Into<wkt::Timestamp>,
4899 {
4900 self.case_create_time = v.map(|x| x.into());
4901 self
4902 }
4903
4904 /// Sets the value of [case_close_time][crate::model::ExternalSystem::case_close_time].
4905 ///
4906 /// # Example
4907 /// ```ignore,no_run
4908 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4909 /// use wkt::Timestamp;
4910 /// let x = ExternalSystem::new().set_case_close_time(Timestamp::default()/* use setters */);
4911 /// ```
4912 pub fn set_case_close_time<T>(mut self, v: T) -> Self
4913 where
4914 T: std::convert::Into<wkt::Timestamp>,
4915 {
4916 self.case_close_time = std::option::Option::Some(v.into());
4917 self
4918 }
4919
4920 /// Sets or clears the value of [case_close_time][crate::model::ExternalSystem::case_close_time].
4921 ///
4922 /// # Example
4923 /// ```ignore,no_run
4924 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4925 /// use wkt::Timestamp;
4926 /// let x = ExternalSystem::new().set_or_clear_case_close_time(Some(Timestamp::default()/* use setters */));
4927 /// let x = ExternalSystem::new().set_or_clear_case_close_time(None::<Timestamp>);
4928 /// ```
4929 pub fn set_or_clear_case_close_time<T>(mut self, v: std::option::Option<T>) -> Self
4930 where
4931 T: std::convert::Into<wkt::Timestamp>,
4932 {
4933 self.case_close_time = v.map(|x| x.into());
4934 self
4935 }
4936
4937 /// Sets the value of [ticket_info][crate::model::ExternalSystem::ticket_info].
4938 ///
4939 /// # Example
4940 /// ```ignore,no_run
4941 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4942 /// use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
4943 /// let x = ExternalSystem::new().set_ticket_info(TicketInfo::default()/* use setters */);
4944 /// ```
4945 pub fn set_ticket_info<T>(mut self, v: T) -> Self
4946 where
4947 T: std::convert::Into<crate::model::external_system::TicketInfo>,
4948 {
4949 self.ticket_info = std::option::Option::Some(v.into());
4950 self
4951 }
4952
4953 /// Sets or clears the value of [ticket_info][crate::model::ExternalSystem::ticket_info].
4954 ///
4955 /// # Example
4956 /// ```ignore,no_run
4957 /// # use google_cloud_securitycenter_v2::model::ExternalSystem;
4958 /// use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
4959 /// let x = ExternalSystem::new().set_or_clear_ticket_info(Some(TicketInfo::default()/* use setters */));
4960 /// let x = ExternalSystem::new().set_or_clear_ticket_info(None::<TicketInfo>);
4961 /// ```
4962 pub fn set_or_clear_ticket_info<T>(mut self, v: std::option::Option<T>) -> Self
4963 where
4964 T: std::convert::Into<crate::model::external_system::TicketInfo>,
4965 {
4966 self.ticket_info = v.map(|x| x.into());
4967 self
4968 }
4969}
4970
4971impl wkt::message::Message for ExternalSystem {
4972 fn typename() -> &'static str {
4973 "type.googleapis.com/google.cloud.securitycenter.v2.ExternalSystem"
4974 }
4975}
4976
4977/// Defines additional types related to [ExternalSystem].
4978pub mod external_system {
4979 #[allow(unused_imports)]
4980 use super::*;
4981
4982 /// Information about the ticket, if any, that is being used to track the
4983 /// resolution of the issue that is identified by this finding.
4984 #[derive(Clone, Default, PartialEq)]
4985 #[non_exhaustive]
4986 pub struct TicketInfo {
4987 /// The identifier of the ticket in the ticket system.
4988 pub id: std::string::String,
4989
4990 /// The assignee of the ticket in the ticket system.
4991 pub assignee: std::string::String,
4992
4993 /// The description of the ticket in the ticket system.
4994 pub description: std::string::String,
4995
4996 /// The link to the ticket in the ticket system.
4997 pub uri: std::string::String,
4998
4999 /// The latest status of the ticket, as reported by the ticket system.
5000 pub status: std::string::String,
5001
5002 /// The time when the ticket was last updated, as reported by the ticket
5003 /// system.
5004 pub update_time: std::option::Option<wkt::Timestamp>,
5005
5006 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5007 }
5008
5009 impl TicketInfo {
5010 /// Creates a new default instance.
5011 pub fn new() -> Self {
5012 std::default::Default::default()
5013 }
5014
5015 /// Sets the value of [id][crate::model::external_system::TicketInfo::id].
5016 ///
5017 /// # Example
5018 /// ```ignore,no_run
5019 /// # use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
5020 /// let x = TicketInfo::new().set_id("example");
5021 /// ```
5022 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5023 self.id = v.into();
5024 self
5025 }
5026
5027 /// Sets the value of [assignee][crate::model::external_system::TicketInfo::assignee].
5028 ///
5029 /// # Example
5030 /// ```ignore,no_run
5031 /// # use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
5032 /// let x = TicketInfo::new().set_assignee("example");
5033 /// ```
5034 pub fn set_assignee<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5035 self.assignee = v.into();
5036 self
5037 }
5038
5039 /// Sets the value of [description][crate::model::external_system::TicketInfo::description].
5040 ///
5041 /// # Example
5042 /// ```ignore,no_run
5043 /// # use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
5044 /// let x = TicketInfo::new().set_description("example");
5045 /// ```
5046 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5047 self.description = v.into();
5048 self
5049 }
5050
5051 /// Sets the value of [uri][crate::model::external_system::TicketInfo::uri].
5052 ///
5053 /// # Example
5054 /// ```ignore,no_run
5055 /// # use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
5056 /// let x = TicketInfo::new().set_uri("example");
5057 /// ```
5058 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5059 self.uri = v.into();
5060 self
5061 }
5062
5063 /// Sets the value of [status][crate::model::external_system::TicketInfo::status].
5064 ///
5065 /// # Example
5066 /// ```ignore,no_run
5067 /// # use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
5068 /// let x = TicketInfo::new().set_status("example");
5069 /// ```
5070 pub fn set_status<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5071 self.status = v.into();
5072 self
5073 }
5074
5075 /// Sets the value of [update_time][crate::model::external_system::TicketInfo::update_time].
5076 ///
5077 /// # Example
5078 /// ```ignore,no_run
5079 /// # use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
5080 /// use wkt::Timestamp;
5081 /// let x = TicketInfo::new().set_update_time(Timestamp::default()/* use setters */);
5082 /// ```
5083 pub fn set_update_time<T>(mut self, v: T) -> Self
5084 where
5085 T: std::convert::Into<wkt::Timestamp>,
5086 {
5087 self.update_time = std::option::Option::Some(v.into());
5088 self
5089 }
5090
5091 /// Sets or clears the value of [update_time][crate::model::external_system::TicketInfo::update_time].
5092 ///
5093 /// # Example
5094 /// ```ignore,no_run
5095 /// # use google_cloud_securitycenter_v2::model::external_system::TicketInfo;
5096 /// use wkt::Timestamp;
5097 /// let x = TicketInfo::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
5098 /// let x = TicketInfo::new().set_or_clear_update_time(None::<Timestamp>);
5099 /// ```
5100 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5101 where
5102 T: std::convert::Into<wkt::Timestamp>,
5103 {
5104 self.update_time = v.map(|x| x.into());
5105 self
5106 }
5107 }
5108
5109 impl wkt::message::Message for TicketInfo {
5110 fn typename() -> &'static str {
5111 "type.googleapis.com/google.cloud.securitycenter.v2.ExternalSystem.TicketInfo"
5112 }
5113 }
5114}
5115
5116/// File information about the related binary/library used by an executable, or
5117/// the script used by a script interpreter
5118#[derive(Clone, Default, PartialEq)]
5119#[non_exhaustive]
5120pub struct File {
5121 /// Absolute path of the file as a JSON encoded string.
5122 pub path: std::string::String,
5123
5124 /// Size of the file in bytes.
5125 pub size: i64,
5126
5127 /// SHA256 hash of the first hashed_size bytes of the file encoded as a
5128 /// hex string. If hashed_size == size, sha256 represents the SHA256 hash
5129 /// of the entire file.
5130 pub sha256: std::string::String,
5131
5132 /// The length in bytes of the file prefix that was hashed. If
5133 /// hashed_size == size, any hashes reported represent the entire
5134 /// file.
5135 pub hashed_size: i64,
5136
5137 /// True when the hash covers only a prefix of the file.
5138 pub partially_hashed: bool,
5139
5140 /// Prefix of the file contents as a JSON-encoded string.
5141 pub contents: std::string::String,
5142
5143 /// Path of the file in terms of underlying disk/partition identifiers.
5144 pub disk_path: std::option::Option<crate::model::file::DiskPath>,
5145
5146 /// Operation(s) performed on a file.
5147 pub operations: std::vec::Vec<crate::model::file::FileOperation>,
5148
5149 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5150}
5151
5152impl File {
5153 /// Creates a new default instance.
5154 pub fn new() -> Self {
5155 std::default::Default::default()
5156 }
5157
5158 /// Sets the value of [path][crate::model::File::path].
5159 ///
5160 /// # Example
5161 /// ```ignore,no_run
5162 /// # use google_cloud_securitycenter_v2::model::File;
5163 /// let x = File::new().set_path("example");
5164 /// ```
5165 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5166 self.path = v.into();
5167 self
5168 }
5169
5170 /// Sets the value of [size][crate::model::File::size].
5171 ///
5172 /// # Example
5173 /// ```ignore,no_run
5174 /// # use google_cloud_securitycenter_v2::model::File;
5175 /// let x = File::new().set_size(42);
5176 /// ```
5177 pub fn set_size<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5178 self.size = v.into();
5179 self
5180 }
5181
5182 /// Sets the value of [sha256][crate::model::File::sha256].
5183 ///
5184 /// # Example
5185 /// ```ignore,no_run
5186 /// # use google_cloud_securitycenter_v2::model::File;
5187 /// let x = File::new().set_sha256("example");
5188 /// ```
5189 pub fn set_sha256<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5190 self.sha256 = v.into();
5191 self
5192 }
5193
5194 /// Sets the value of [hashed_size][crate::model::File::hashed_size].
5195 ///
5196 /// # Example
5197 /// ```ignore,no_run
5198 /// # use google_cloud_securitycenter_v2::model::File;
5199 /// let x = File::new().set_hashed_size(42);
5200 /// ```
5201 pub fn set_hashed_size<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5202 self.hashed_size = v.into();
5203 self
5204 }
5205
5206 /// Sets the value of [partially_hashed][crate::model::File::partially_hashed].
5207 ///
5208 /// # Example
5209 /// ```ignore,no_run
5210 /// # use google_cloud_securitycenter_v2::model::File;
5211 /// let x = File::new().set_partially_hashed(true);
5212 /// ```
5213 pub fn set_partially_hashed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5214 self.partially_hashed = v.into();
5215 self
5216 }
5217
5218 /// Sets the value of [contents][crate::model::File::contents].
5219 ///
5220 /// # Example
5221 /// ```ignore,no_run
5222 /// # use google_cloud_securitycenter_v2::model::File;
5223 /// let x = File::new().set_contents("example");
5224 /// ```
5225 pub fn set_contents<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5226 self.contents = v.into();
5227 self
5228 }
5229
5230 /// Sets the value of [disk_path][crate::model::File::disk_path].
5231 ///
5232 /// # Example
5233 /// ```ignore,no_run
5234 /// # use google_cloud_securitycenter_v2::model::File;
5235 /// use google_cloud_securitycenter_v2::model::file::DiskPath;
5236 /// let x = File::new().set_disk_path(DiskPath::default()/* use setters */);
5237 /// ```
5238 pub fn set_disk_path<T>(mut self, v: T) -> Self
5239 where
5240 T: std::convert::Into<crate::model::file::DiskPath>,
5241 {
5242 self.disk_path = std::option::Option::Some(v.into());
5243 self
5244 }
5245
5246 /// Sets or clears the value of [disk_path][crate::model::File::disk_path].
5247 ///
5248 /// # Example
5249 /// ```ignore,no_run
5250 /// # use google_cloud_securitycenter_v2::model::File;
5251 /// use google_cloud_securitycenter_v2::model::file::DiskPath;
5252 /// let x = File::new().set_or_clear_disk_path(Some(DiskPath::default()/* use setters */));
5253 /// let x = File::new().set_or_clear_disk_path(None::<DiskPath>);
5254 /// ```
5255 pub fn set_or_clear_disk_path<T>(mut self, v: std::option::Option<T>) -> Self
5256 where
5257 T: std::convert::Into<crate::model::file::DiskPath>,
5258 {
5259 self.disk_path = v.map(|x| x.into());
5260 self
5261 }
5262
5263 /// Sets the value of [operations][crate::model::File::operations].
5264 ///
5265 /// # Example
5266 /// ```ignore,no_run
5267 /// # use google_cloud_securitycenter_v2::model::File;
5268 /// use google_cloud_securitycenter_v2::model::file::FileOperation;
5269 /// let x = File::new()
5270 /// .set_operations([
5271 /// FileOperation::default()/* use setters */,
5272 /// FileOperation::default()/* use (different) setters */,
5273 /// ]);
5274 /// ```
5275 pub fn set_operations<T, V>(mut self, v: T) -> Self
5276 where
5277 T: std::iter::IntoIterator<Item = V>,
5278 V: std::convert::Into<crate::model::file::FileOperation>,
5279 {
5280 use std::iter::Iterator;
5281 self.operations = v.into_iter().map(|i| i.into()).collect();
5282 self
5283 }
5284}
5285
5286impl wkt::message::Message for File {
5287 fn typename() -> &'static str {
5288 "type.googleapis.com/google.cloud.securitycenter.v2.File"
5289 }
5290}
5291
5292/// Defines additional types related to [File].
5293pub mod file {
5294 #[allow(unused_imports)]
5295 use super::*;
5296
5297 /// Path of the file in terms of underlying disk/partition identifiers.
5298 #[derive(Clone, Default, PartialEq)]
5299 #[non_exhaustive]
5300 pub struct DiskPath {
5301 /// UUID of the partition (format
5302 /// <https://wiki.archlinux.org/title/persistent_block_device_naming#by-uuid>)
5303 pub partition_uuid: std::string::String,
5304
5305 /// Relative path of the file in the partition as a JSON encoded string.
5306 /// Example: /home/user1/executable_file.sh
5307 pub relative_path: std::string::String,
5308
5309 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5310 }
5311
5312 impl DiskPath {
5313 /// Creates a new default instance.
5314 pub fn new() -> Self {
5315 std::default::Default::default()
5316 }
5317
5318 /// Sets the value of [partition_uuid][crate::model::file::DiskPath::partition_uuid].
5319 ///
5320 /// # Example
5321 /// ```ignore,no_run
5322 /// # use google_cloud_securitycenter_v2::model::file::DiskPath;
5323 /// let x = DiskPath::new().set_partition_uuid("example");
5324 /// ```
5325 pub fn set_partition_uuid<T: std::convert::Into<std::string::String>>(
5326 mut self,
5327 v: T,
5328 ) -> Self {
5329 self.partition_uuid = v.into();
5330 self
5331 }
5332
5333 /// Sets the value of [relative_path][crate::model::file::DiskPath::relative_path].
5334 ///
5335 /// # Example
5336 /// ```ignore,no_run
5337 /// # use google_cloud_securitycenter_v2::model::file::DiskPath;
5338 /// let x = DiskPath::new().set_relative_path("example");
5339 /// ```
5340 pub fn set_relative_path<T: std::convert::Into<std::string::String>>(
5341 mut self,
5342 v: T,
5343 ) -> Self {
5344 self.relative_path = v.into();
5345 self
5346 }
5347 }
5348
5349 impl wkt::message::Message for DiskPath {
5350 fn typename() -> &'static str {
5351 "type.googleapis.com/google.cloud.securitycenter.v2.File.DiskPath"
5352 }
5353 }
5354
5355 /// Operation(s) performed on a file.
5356 #[derive(Clone, Default, PartialEq)]
5357 #[non_exhaustive]
5358 pub struct FileOperation {
5359 /// The type of the operation
5360 pub r#type: crate::model::file::file_operation::OperationType,
5361
5362 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5363 }
5364
5365 impl FileOperation {
5366 /// Creates a new default instance.
5367 pub fn new() -> Self {
5368 std::default::Default::default()
5369 }
5370
5371 /// Sets the value of [r#type][crate::model::file::FileOperation::type].
5372 ///
5373 /// # Example
5374 /// ```ignore,no_run
5375 /// # use google_cloud_securitycenter_v2::model::file::FileOperation;
5376 /// use google_cloud_securitycenter_v2::model::file::file_operation::OperationType;
5377 /// let x0 = FileOperation::new().set_type(OperationType::Open);
5378 /// let x1 = FileOperation::new().set_type(OperationType::Read);
5379 /// let x2 = FileOperation::new().set_type(OperationType::Rename);
5380 /// ```
5381 pub fn set_type<
5382 T: std::convert::Into<crate::model::file::file_operation::OperationType>,
5383 >(
5384 mut self,
5385 v: T,
5386 ) -> Self {
5387 self.r#type = v.into();
5388 self
5389 }
5390 }
5391
5392 impl wkt::message::Message for FileOperation {
5393 fn typename() -> &'static str {
5394 "type.googleapis.com/google.cloud.securitycenter.v2.File.FileOperation"
5395 }
5396 }
5397
5398 /// Defines additional types related to [FileOperation].
5399 pub mod file_operation {
5400 #[allow(unused_imports)]
5401 use super::*;
5402
5403 /// The type of the operation
5404 ///
5405 /// # Working with unknown values
5406 ///
5407 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5408 /// additional enum variants at any time. Adding new variants is not considered
5409 /// a breaking change. Applications should write their code in anticipation of:
5410 ///
5411 /// - New values appearing in future releases of the client library, **and**
5412 /// - New values received dynamically, without application changes.
5413 ///
5414 /// Please consult the [Working with enums] section in the user guide for some
5415 /// guidelines.
5416 ///
5417 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5418 #[derive(Clone, Debug, PartialEq)]
5419 #[non_exhaustive]
5420 pub enum OperationType {
5421 /// The operation is unspecified.
5422 Unspecified,
5423 /// Represents an open operation.
5424 Open,
5425 /// Represents a read operation.
5426 Read,
5427 /// Represents a rename operation.
5428 Rename,
5429 /// Represents a write operation.
5430 Write,
5431 /// Represents an execute operation.
5432 Execute,
5433 /// If set, the enum was initialized with an unknown value.
5434 ///
5435 /// Applications can examine the value using [OperationType::value] or
5436 /// [OperationType::name].
5437 UnknownValue(operation_type::UnknownValue),
5438 }
5439
5440 #[doc(hidden)]
5441 pub mod operation_type {
5442 #[allow(unused_imports)]
5443 use super::*;
5444 #[derive(Clone, Debug, PartialEq)]
5445 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5446 }
5447
5448 impl OperationType {
5449 /// Gets the enum value.
5450 ///
5451 /// Returns `None` if the enum contains an unknown value deserialized from
5452 /// the string representation of enums.
5453 pub fn value(&self) -> std::option::Option<i32> {
5454 match self {
5455 Self::Unspecified => std::option::Option::Some(0),
5456 Self::Open => std::option::Option::Some(1),
5457 Self::Read => std::option::Option::Some(2),
5458 Self::Rename => std::option::Option::Some(3),
5459 Self::Write => std::option::Option::Some(4),
5460 Self::Execute => std::option::Option::Some(5),
5461 Self::UnknownValue(u) => u.0.value(),
5462 }
5463 }
5464
5465 /// Gets the enum value as a string.
5466 ///
5467 /// Returns `None` if the enum contains an unknown value deserialized from
5468 /// the integer representation of enums.
5469 pub fn name(&self) -> std::option::Option<&str> {
5470 match self {
5471 Self::Unspecified => std::option::Option::Some("OPERATION_TYPE_UNSPECIFIED"),
5472 Self::Open => std::option::Option::Some("OPEN"),
5473 Self::Read => std::option::Option::Some("READ"),
5474 Self::Rename => std::option::Option::Some("RENAME"),
5475 Self::Write => std::option::Option::Some("WRITE"),
5476 Self::Execute => std::option::Option::Some("EXECUTE"),
5477 Self::UnknownValue(u) => u.0.name(),
5478 }
5479 }
5480 }
5481
5482 impl std::default::Default for OperationType {
5483 fn default() -> Self {
5484 use std::convert::From;
5485 Self::from(0)
5486 }
5487 }
5488
5489 impl std::fmt::Display for OperationType {
5490 fn fmt(
5491 &self,
5492 f: &mut std::fmt::Formatter<'_>,
5493 ) -> std::result::Result<(), std::fmt::Error> {
5494 wkt::internal::display_enum(f, self.name(), self.value())
5495 }
5496 }
5497
5498 impl std::convert::From<i32> for OperationType {
5499 fn from(value: i32) -> Self {
5500 match value {
5501 0 => Self::Unspecified,
5502 1 => Self::Open,
5503 2 => Self::Read,
5504 3 => Self::Rename,
5505 4 => Self::Write,
5506 5 => Self::Execute,
5507 _ => Self::UnknownValue(operation_type::UnknownValue(
5508 wkt::internal::UnknownEnumValue::Integer(value),
5509 )),
5510 }
5511 }
5512 }
5513
5514 impl std::convert::From<&str> for OperationType {
5515 fn from(value: &str) -> Self {
5516 use std::string::ToString;
5517 match value {
5518 "OPERATION_TYPE_UNSPECIFIED" => Self::Unspecified,
5519 "OPEN" => Self::Open,
5520 "READ" => Self::Read,
5521 "RENAME" => Self::Rename,
5522 "WRITE" => Self::Write,
5523 "EXECUTE" => Self::Execute,
5524 _ => Self::UnknownValue(operation_type::UnknownValue(
5525 wkt::internal::UnknownEnumValue::String(value.to_string()),
5526 )),
5527 }
5528 }
5529 }
5530
5531 impl serde::ser::Serialize for OperationType {
5532 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5533 where
5534 S: serde::Serializer,
5535 {
5536 match self {
5537 Self::Unspecified => serializer.serialize_i32(0),
5538 Self::Open => serializer.serialize_i32(1),
5539 Self::Read => serializer.serialize_i32(2),
5540 Self::Rename => serializer.serialize_i32(3),
5541 Self::Write => serializer.serialize_i32(4),
5542 Self::Execute => serializer.serialize_i32(5),
5543 Self::UnknownValue(u) => u.0.serialize(serializer),
5544 }
5545 }
5546 }
5547
5548 impl<'de> serde::de::Deserialize<'de> for OperationType {
5549 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5550 where
5551 D: serde::Deserializer<'de>,
5552 {
5553 deserializer.deserialize_any(wkt::internal::EnumVisitor::<OperationType>::new(
5554 ".google.cloud.securitycenter.v2.File.FileOperation.OperationType",
5555 ))
5556 }
5557 }
5558 }
5559}
5560
5561/// Security Command Center finding.
5562///
5563/// A finding is a record of assessment data like security, risk, health, or
5564/// privacy, that is ingested into Security Command Center for presentation,
5565/// notification, analysis, policy testing, and enforcement. For example, a
5566/// cross-site scripting (XSS) vulnerability in an App Engine application is a
5567/// finding.
5568#[derive(Clone, Default, PartialEq)]
5569#[non_exhaustive]
5570pub struct Finding {
5571 /// Identifier. The [relative resource
5572 /// name](https://cloud.google.com/apis/design/resource_names#relative_resource_name)
5573 /// of the finding. The following list shows some examples:
5574 ///
5575 ///
5576 /// `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`
5577 /// +
5578 /// `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
5579 ///
5580 /// + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`
5581 ///
5582 /// `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
5583 ///
5584 /// + `projects/{project_id}/sources/{source_id}/findings/{finding_id}`
5585 ///
5586 /// `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
5587 pub name: std::string::String,
5588
5589 /// Output only. The canonical name of the finding. The following list shows
5590 /// some examples:
5591 ///
5592 ///
5593 /// `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`
5594 /// +
5595 /// `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
5596 ///
5597 /// + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`
5598 ///
5599 /// `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
5600 ///
5601 /// + `projects/{project_id}/sources/{source_id}/findings/{finding_id}`
5602 ///
5603 /// `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
5604 ///
5605 /// The prefix is the closest CRM ancestor of the resource associated with the
5606 /// finding.
5607 pub canonical_name: std::string::String,
5608
5609 /// The relative resource name of the source and location the finding belongs
5610 /// to. See:
5611 /// <https://cloud.google.com/apis/design/resource_names#relative_resource_name>
5612 /// This field is immutable after creation time. The following list shows some
5613 /// examples:
5614 ///
5615 /// + `organizations/{organization_id}/sources/{source_id}`
5616 /// + `folders/{folders_id}/sources/{source_id}`
5617 /// + `projects/{projects_id}/sources/{source_id}`
5618 ///
5619 /// `organizations/{organization_id}/sources/{source_id}/locations/{location_id}`
5620 ///
5621 /// + `folders/{folders_id}/sources/{source_id}/locations/{location_id}`
5622 /// + `projects/{projects_id}/sources/{source_id}/locations/{location_id}`
5623 pub parent: std::string::String,
5624
5625 /// Immutable. For findings on Google Cloud resources, the full resource
5626 /// name of the Google Cloud resource this finding is for. See:
5627 /// <https://cloud.google.com/apis/design/resource_names#full_resource_name>
5628 /// When the finding is for a non-Google Cloud resource, the resourceName can
5629 /// be a customer or partner defined string.
5630 pub resource_name: std::string::String,
5631
5632 /// Output only. The state of the finding.
5633 pub state: crate::model::finding::State,
5634
5635 /// Immutable. The additional taxonomy group within findings from a given
5636 /// source. Example: "XSS_FLASH_INJECTION"
5637 pub category: std::string::String,
5638
5639 /// The URI that, if available, points to a web page outside of Security
5640 /// Command Center where additional information about the finding can be found.
5641 /// This field is guaranteed to be either empty or a well formed URL.
5642 pub external_uri: std::string::String,
5643
5644 /// Source specific properties. These properties are managed by the source
5645 /// that writes the finding. The key names in the source_properties map must be
5646 /// between 1 and 255 characters, and must start with a letter and contain
5647 /// alphanumeric characters or underscores only.
5648 pub source_properties: std::collections::HashMap<std::string::String, wkt::Value>,
5649
5650 /// Output only. User specified security marks. These marks are entirely
5651 /// managed by the user and come from the SecurityMarks resource that belongs
5652 /// to the finding.
5653 pub security_marks: std::option::Option<crate::model::SecurityMarks>,
5654
5655 /// The time the finding was first detected. If an existing finding is updated,
5656 /// then this is the time the update occurred.
5657 /// For example, if the finding represents an open firewall, this property
5658 /// captures the time the detector believes the firewall became open. The
5659 /// accuracy is determined by the detector. If the finding is later resolved,
5660 /// then this time reflects when the finding was resolved. This must not
5661 /// be set to a value greater than the current timestamp.
5662 pub event_time: std::option::Option<wkt::Timestamp>,
5663
5664 /// Output only. The time at which the finding was created in Security Command
5665 /// Center.
5666 pub create_time: std::option::Option<wkt::Timestamp>,
5667
5668 /// The severity of the finding. This field is managed by the source that
5669 /// writes the finding.
5670 pub severity: crate::model::finding::Severity,
5671
5672 /// Indicates the mute state of a finding (either muted, unmuted
5673 /// or undefined). Unlike other attributes of a finding, a finding provider
5674 /// shouldn't set the value of mute.
5675 pub mute: crate::model::finding::Mute,
5676
5677 /// Output only. The mute information regarding this finding.
5678 pub mute_info: std::option::Option<crate::model::finding::MuteInfo>,
5679
5680 /// The class of the finding.
5681 pub finding_class: crate::model::finding::FindingClass,
5682
5683 /// Represents what's commonly known as an *indicator of compromise* (IoC) in
5684 /// computer forensics. This is an artifact observed on a network or in an
5685 /// operating system that, with high confidence, indicates a computer
5686 /// intrusion. For more information, see [Indicator of
5687 /// compromise](https://en.wikipedia.org/wiki/Indicator_of_compromise).
5688 pub indicator: std::option::Option<crate::model::Indicator>,
5689
5690 /// Represents vulnerability-specific fields like CVE and CVSS scores.
5691 /// CVE stands for Common Vulnerabilities and Exposures
5692 /// (<https://cve.mitre.org/about/>)
5693 pub vulnerability: std::option::Option<crate::model::Vulnerability>,
5694
5695 /// Output only. The most recent time this finding was muted or unmuted.
5696 pub mute_update_time: std::option::Option<wkt::Timestamp>,
5697
5698 /// Output only. Third party SIEM/SOAR fields within SCC, contains external
5699 /// system information and external system finding fields.
5700 pub external_systems:
5701 std::collections::HashMap<std::string::String, crate::model::ExternalSystem>,
5702
5703 /// MITRE ATT&CK tactics and techniques related to this finding.
5704 /// See: <https://attack.mitre.org>
5705 pub mitre_attack: std::option::Option<crate::model::MitreAttack>,
5706
5707 /// Access details associated with the finding, such as more information on the
5708 /// caller, which method was accessed, and from where.
5709 pub access: std::option::Option<crate::model::Access>,
5710
5711 /// Contains information about the IP connection associated with the finding.
5712 pub connections: std::vec::Vec<crate::model::Connection>,
5713
5714 /// Records additional information about the mute operation, for example, the
5715 /// [mute
5716 /// configuration](https://cloud.google.com/security-command-center/docs/how-to-mute-findings)
5717 /// that muted the finding and the user who muted the finding.
5718 pub mute_initiator: std::string::String,
5719
5720 /// Represents operating system processes associated with the Finding.
5721 pub processes: std::vec::Vec<crate::model::Process>,
5722
5723 /// Output only. Map containing the points of contact for the given finding.
5724 /// The key represents the type of contact, while the value contains a list of
5725 /// all the contacts that pertain. Please refer to:
5726 /// <https://cloud.google.com/resource-manager/docs/managing-notification-contacts#notification-categories>
5727 ///
5728 /// ```norust
5729 /// {
5730 /// "security": {
5731 /// "contacts": [
5732 /// {
5733 /// "email": "person1@company.com"
5734 /// },
5735 /// {
5736 /// "email": "person2@company.com"
5737 /// }
5738 /// ]
5739 /// }
5740 /// }
5741 /// ```
5742 pub contacts: std::collections::HashMap<std::string::String, crate::model::ContactDetails>,
5743
5744 /// Contains compliance information for security standards associated to the
5745 /// finding.
5746 pub compliances: std::vec::Vec<crate::model::Compliance>,
5747
5748 /// Output only. The human readable display name of the finding source such as
5749 /// "Event Threat Detection" or "Security Health Analytics".
5750 pub parent_display_name: std::string::String,
5751
5752 /// Contains more details about the finding.
5753 pub description: std::string::String,
5754
5755 /// Represents exfiltrations associated with the finding.
5756 pub exfiltration: std::option::Option<crate::model::Exfiltration>,
5757
5758 /// Represents IAM bindings associated with the finding.
5759 pub iam_bindings: std::vec::Vec<crate::model::IamBinding>,
5760
5761 /// Steps to address the finding.
5762 pub next_steps: std::string::String,
5763
5764 /// Unique identifier of the module which generated the finding.
5765 /// Example:
5766 /// folders/598186756061/securityHealthAnalyticsSettings/customModules/56799441161885
5767 pub module_name: std::string::String,
5768
5769 /// Containers associated with the finding. This field provides information for
5770 /// both Kubernetes and non-Kubernetes containers.
5771 pub containers: std::vec::Vec<crate::model::Container>,
5772
5773 /// Kubernetes resources associated with the finding.
5774 pub kubernetes: std::option::Option<crate::model::Kubernetes>,
5775
5776 /// Database associated with the finding.
5777 pub database: std::option::Option<crate::model::Database>,
5778
5779 /// The results of an attack path simulation relevant to this finding.
5780 pub attack_exposure: std::option::Option<crate::model::AttackExposure>,
5781
5782 /// File associated with the finding.
5783 pub files: std::vec::Vec<crate::model::File>,
5784
5785 /// Cloud Data Loss Prevention (Cloud DLP) inspection results that are
5786 /// associated with the finding.
5787 pub cloud_dlp_inspection: std::option::Option<crate::model::CloudDlpInspection>,
5788
5789 /// Cloud DLP data profile that is associated with the finding.
5790 pub cloud_dlp_data_profile: std::option::Option<crate::model::CloudDlpDataProfile>,
5791
5792 /// Signature of the kernel rootkit.
5793 pub kernel_rootkit: std::option::Option<crate::model::KernelRootkit>,
5794
5795 /// Contains information about the org policies associated with the finding.
5796 pub org_policies: std::vec::Vec<crate::model::OrgPolicy>,
5797
5798 /// Job associated with the finding.
5799 pub job: std::option::Option<crate::model::Job>,
5800
5801 /// Represents an application associated with the finding.
5802 pub application: std::option::Option<crate::model::Application>,
5803
5804 /// IP rules associated with the finding.
5805 pub ip_rules: std::option::Option<crate::model::IpRules>,
5806
5807 /// Fields related to Backup and DR findings.
5808 pub backup_disaster_recovery: std::option::Option<crate::model::BackupDisasterRecovery>,
5809
5810 /// The security posture associated with the finding.
5811 pub security_posture: std::option::Option<crate::model::SecurityPosture>,
5812
5813 /// Log entries that are relevant to the finding.
5814 pub log_entries: std::vec::Vec<crate::model::LogEntry>,
5815
5816 /// The load balancers associated with the finding.
5817 pub load_balancers: std::vec::Vec<crate::model::LoadBalancer>,
5818
5819 /// Fields related to Cloud Armor findings.
5820 pub cloud_armor: std::option::Option<crate::model::CloudArmor>,
5821
5822 /// Notebook associated with the finding.
5823 pub notebook: std::option::Option<crate::model::Notebook>,
5824
5825 /// Contains details about a group of security issues that, when the issues
5826 /// occur together, represent a greater risk than when the issues occur
5827 /// independently. A group of such issues is referred to as a toxic
5828 /// combination.
5829 /// This field cannot be updated. Its value is ignored in all update requests.
5830 pub toxic_combination: std::option::Option<crate::model::ToxicCombination>,
5831
5832 /// Contains details about groups of which this finding is a member. A group is
5833 /// a collection of findings that are related in some way.
5834 /// This field cannot be updated. Its value is ignored in all update requests.
5835 pub group_memberships: std::vec::Vec<crate::model::GroupMembership>,
5836
5837 /// Disk associated with the finding.
5838 pub disk: std::option::Option<crate::model::Disk>,
5839
5840 /// Data access events associated with the finding.
5841 pub data_access_events: std::vec::Vec<crate::model::DataAccessEvent>,
5842
5843 /// Data flow events associated with the finding.
5844 pub data_flow_events: std::vec::Vec<crate::model::DataFlowEvent>,
5845
5846 /// Represents the VPC networks that the resource is attached to.
5847 pub networks: std::vec::Vec<crate::model::Network>,
5848
5849 /// Data retention deletion events associated with the finding.
5850 pub data_retention_deletion_events: std::vec::Vec<crate::model::DataRetentionDeletionEvent>,
5851
5852 /// AffectedResources associated with the finding.
5853 pub affected_resources: std::option::Option<crate::model::AffectedResources>,
5854
5855 /// The AI model associated with the finding.
5856 pub ai_model: std::option::Option<crate::model::AiModel>,
5857
5858 /// Contains details about a chokepoint, which is a resource or resource group
5859 /// where high-risk attack paths converge, based on [attack path simulations]
5860 /// (<https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_path_simulations>).
5861 /// This field cannot be updated. Its value is ignored in all update requests.
5862 pub chokepoint: std::option::Option<crate::model::Chokepoint>,
5863
5864 /// VertexAi associated with the finding.
5865 pub vertex_ai: std::option::Option<crate::model::VertexAi>,
5866
5867 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5868}
5869
5870impl Finding {
5871 /// Creates a new default instance.
5872 pub fn new() -> Self {
5873 std::default::Default::default()
5874 }
5875
5876 /// Sets the value of [name][crate::model::Finding::name].
5877 ///
5878 /// # Example
5879 /// ```ignore,no_run
5880 /// # use google_cloud_securitycenter_v2::model::Finding;
5881 /// let x = Finding::new().set_name("example");
5882 /// ```
5883 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5884 self.name = v.into();
5885 self
5886 }
5887
5888 /// Sets the value of [canonical_name][crate::model::Finding::canonical_name].
5889 ///
5890 /// # Example
5891 /// ```ignore,no_run
5892 /// # use google_cloud_securitycenter_v2::model::Finding;
5893 /// let x = Finding::new().set_canonical_name("example");
5894 /// ```
5895 pub fn set_canonical_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5896 self.canonical_name = v.into();
5897 self
5898 }
5899
5900 /// Sets the value of [parent][crate::model::Finding::parent].
5901 ///
5902 /// # Example
5903 /// ```ignore,no_run
5904 /// # use google_cloud_securitycenter_v2::model::Finding;
5905 /// let x = Finding::new().set_parent("example");
5906 /// ```
5907 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5908 self.parent = v.into();
5909 self
5910 }
5911
5912 /// Sets the value of [resource_name][crate::model::Finding::resource_name].
5913 ///
5914 /// # Example
5915 /// ```ignore,no_run
5916 /// # use google_cloud_securitycenter_v2::model::Finding;
5917 /// let x = Finding::new().set_resource_name("example");
5918 /// ```
5919 pub fn set_resource_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5920 self.resource_name = v.into();
5921 self
5922 }
5923
5924 /// Sets the value of [state][crate::model::Finding::state].
5925 ///
5926 /// # Example
5927 /// ```ignore,no_run
5928 /// # use google_cloud_securitycenter_v2::model::Finding;
5929 /// use google_cloud_securitycenter_v2::model::finding::State;
5930 /// let x0 = Finding::new().set_state(State::Active);
5931 /// let x1 = Finding::new().set_state(State::Inactive);
5932 /// ```
5933 pub fn set_state<T: std::convert::Into<crate::model::finding::State>>(mut self, v: T) -> Self {
5934 self.state = v.into();
5935 self
5936 }
5937
5938 /// Sets the value of [category][crate::model::Finding::category].
5939 ///
5940 /// # Example
5941 /// ```ignore,no_run
5942 /// # use google_cloud_securitycenter_v2::model::Finding;
5943 /// let x = Finding::new().set_category("example");
5944 /// ```
5945 pub fn set_category<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5946 self.category = v.into();
5947 self
5948 }
5949
5950 /// Sets the value of [external_uri][crate::model::Finding::external_uri].
5951 ///
5952 /// # Example
5953 /// ```ignore,no_run
5954 /// # use google_cloud_securitycenter_v2::model::Finding;
5955 /// let x = Finding::new().set_external_uri("example");
5956 /// ```
5957 pub fn set_external_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5958 self.external_uri = v.into();
5959 self
5960 }
5961
5962 /// Sets the value of [source_properties][crate::model::Finding::source_properties].
5963 ///
5964 /// # Example
5965 /// ```ignore,no_run
5966 /// # use google_cloud_securitycenter_v2::model::Finding;
5967 /// use wkt::Value;
5968 /// let x = Finding::new().set_source_properties([
5969 /// ("key0", Value::default()/* use setters */),
5970 /// ("key1", Value::default()/* use (different) setters */),
5971 /// ]);
5972 /// ```
5973 pub fn set_source_properties<T, K, V>(mut self, v: T) -> Self
5974 where
5975 T: std::iter::IntoIterator<Item = (K, V)>,
5976 K: std::convert::Into<std::string::String>,
5977 V: std::convert::Into<wkt::Value>,
5978 {
5979 use std::iter::Iterator;
5980 self.source_properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5981 self
5982 }
5983
5984 /// Sets the value of [security_marks][crate::model::Finding::security_marks].
5985 ///
5986 /// # Example
5987 /// ```ignore,no_run
5988 /// # use google_cloud_securitycenter_v2::model::Finding;
5989 /// use google_cloud_securitycenter_v2::model::SecurityMarks;
5990 /// let x = Finding::new().set_security_marks(SecurityMarks::default()/* use setters */);
5991 /// ```
5992 pub fn set_security_marks<T>(mut self, v: T) -> Self
5993 where
5994 T: std::convert::Into<crate::model::SecurityMarks>,
5995 {
5996 self.security_marks = std::option::Option::Some(v.into());
5997 self
5998 }
5999
6000 /// Sets or clears the value of [security_marks][crate::model::Finding::security_marks].
6001 ///
6002 /// # Example
6003 /// ```ignore,no_run
6004 /// # use google_cloud_securitycenter_v2::model::Finding;
6005 /// use google_cloud_securitycenter_v2::model::SecurityMarks;
6006 /// let x = Finding::new().set_or_clear_security_marks(Some(SecurityMarks::default()/* use setters */));
6007 /// let x = Finding::new().set_or_clear_security_marks(None::<SecurityMarks>);
6008 /// ```
6009 pub fn set_or_clear_security_marks<T>(mut self, v: std::option::Option<T>) -> Self
6010 where
6011 T: std::convert::Into<crate::model::SecurityMarks>,
6012 {
6013 self.security_marks = v.map(|x| x.into());
6014 self
6015 }
6016
6017 /// Sets the value of [event_time][crate::model::Finding::event_time].
6018 ///
6019 /// # Example
6020 /// ```ignore,no_run
6021 /// # use google_cloud_securitycenter_v2::model::Finding;
6022 /// use wkt::Timestamp;
6023 /// let x = Finding::new().set_event_time(Timestamp::default()/* use setters */);
6024 /// ```
6025 pub fn set_event_time<T>(mut self, v: T) -> Self
6026 where
6027 T: std::convert::Into<wkt::Timestamp>,
6028 {
6029 self.event_time = std::option::Option::Some(v.into());
6030 self
6031 }
6032
6033 /// Sets or clears the value of [event_time][crate::model::Finding::event_time].
6034 ///
6035 /// # Example
6036 /// ```ignore,no_run
6037 /// # use google_cloud_securitycenter_v2::model::Finding;
6038 /// use wkt::Timestamp;
6039 /// let x = Finding::new().set_or_clear_event_time(Some(Timestamp::default()/* use setters */));
6040 /// let x = Finding::new().set_or_clear_event_time(None::<Timestamp>);
6041 /// ```
6042 pub fn set_or_clear_event_time<T>(mut self, v: std::option::Option<T>) -> Self
6043 where
6044 T: std::convert::Into<wkt::Timestamp>,
6045 {
6046 self.event_time = v.map(|x| x.into());
6047 self
6048 }
6049
6050 /// Sets the value of [create_time][crate::model::Finding::create_time].
6051 ///
6052 /// # Example
6053 /// ```ignore,no_run
6054 /// # use google_cloud_securitycenter_v2::model::Finding;
6055 /// use wkt::Timestamp;
6056 /// let x = Finding::new().set_create_time(Timestamp::default()/* use setters */);
6057 /// ```
6058 pub fn set_create_time<T>(mut self, v: T) -> Self
6059 where
6060 T: std::convert::Into<wkt::Timestamp>,
6061 {
6062 self.create_time = std::option::Option::Some(v.into());
6063 self
6064 }
6065
6066 /// Sets or clears the value of [create_time][crate::model::Finding::create_time].
6067 ///
6068 /// # Example
6069 /// ```ignore,no_run
6070 /// # use google_cloud_securitycenter_v2::model::Finding;
6071 /// use wkt::Timestamp;
6072 /// let x = Finding::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6073 /// let x = Finding::new().set_or_clear_create_time(None::<Timestamp>);
6074 /// ```
6075 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6076 where
6077 T: std::convert::Into<wkt::Timestamp>,
6078 {
6079 self.create_time = v.map(|x| x.into());
6080 self
6081 }
6082
6083 /// Sets the value of [severity][crate::model::Finding::severity].
6084 ///
6085 /// # Example
6086 /// ```ignore,no_run
6087 /// # use google_cloud_securitycenter_v2::model::Finding;
6088 /// use google_cloud_securitycenter_v2::model::finding::Severity;
6089 /// let x0 = Finding::new().set_severity(Severity::Critical);
6090 /// let x1 = Finding::new().set_severity(Severity::High);
6091 /// let x2 = Finding::new().set_severity(Severity::Medium);
6092 /// ```
6093 pub fn set_severity<T: std::convert::Into<crate::model::finding::Severity>>(
6094 mut self,
6095 v: T,
6096 ) -> Self {
6097 self.severity = v.into();
6098 self
6099 }
6100
6101 /// Sets the value of [mute][crate::model::Finding::mute].
6102 ///
6103 /// # Example
6104 /// ```ignore,no_run
6105 /// # use google_cloud_securitycenter_v2::model::Finding;
6106 /// use google_cloud_securitycenter_v2::model::finding::Mute;
6107 /// let x0 = Finding::new().set_mute(Mute::Muted);
6108 /// let x1 = Finding::new().set_mute(Mute::Unmuted);
6109 /// let x2 = Finding::new().set_mute(Mute::Undefined);
6110 /// ```
6111 pub fn set_mute<T: std::convert::Into<crate::model::finding::Mute>>(mut self, v: T) -> Self {
6112 self.mute = v.into();
6113 self
6114 }
6115
6116 /// Sets the value of [mute_info][crate::model::Finding::mute_info].
6117 ///
6118 /// # Example
6119 /// ```ignore,no_run
6120 /// # use google_cloud_securitycenter_v2::model::Finding;
6121 /// use google_cloud_securitycenter_v2::model::finding::MuteInfo;
6122 /// let x = Finding::new().set_mute_info(MuteInfo::default()/* use setters */);
6123 /// ```
6124 pub fn set_mute_info<T>(mut self, v: T) -> Self
6125 where
6126 T: std::convert::Into<crate::model::finding::MuteInfo>,
6127 {
6128 self.mute_info = std::option::Option::Some(v.into());
6129 self
6130 }
6131
6132 /// Sets or clears the value of [mute_info][crate::model::Finding::mute_info].
6133 ///
6134 /// # Example
6135 /// ```ignore,no_run
6136 /// # use google_cloud_securitycenter_v2::model::Finding;
6137 /// use google_cloud_securitycenter_v2::model::finding::MuteInfo;
6138 /// let x = Finding::new().set_or_clear_mute_info(Some(MuteInfo::default()/* use setters */));
6139 /// let x = Finding::new().set_or_clear_mute_info(None::<MuteInfo>);
6140 /// ```
6141 pub fn set_or_clear_mute_info<T>(mut self, v: std::option::Option<T>) -> Self
6142 where
6143 T: std::convert::Into<crate::model::finding::MuteInfo>,
6144 {
6145 self.mute_info = v.map(|x| x.into());
6146 self
6147 }
6148
6149 /// Sets the value of [finding_class][crate::model::Finding::finding_class].
6150 ///
6151 /// # Example
6152 /// ```ignore,no_run
6153 /// # use google_cloud_securitycenter_v2::model::Finding;
6154 /// use google_cloud_securitycenter_v2::model::finding::FindingClass;
6155 /// let x0 = Finding::new().set_finding_class(FindingClass::Threat);
6156 /// let x1 = Finding::new().set_finding_class(FindingClass::Vulnerability);
6157 /// let x2 = Finding::new().set_finding_class(FindingClass::Misconfiguration);
6158 /// ```
6159 pub fn set_finding_class<T: std::convert::Into<crate::model::finding::FindingClass>>(
6160 mut self,
6161 v: T,
6162 ) -> Self {
6163 self.finding_class = v.into();
6164 self
6165 }
6166
6167 /// Sets the value of [indicator][crate::model::Finding::indicator].
6168 ///
6169 /// # Example
6170 /// ```ignore,no_run
6171 /// # use google_cloud_securitycenter_v2::model::Finding;
6172 /// use google_cloud_securitycenter_v2::model::Indicator;
6173 /// let x = Finding::new().set_indicator(Indicator::default()/* use setters */);
6174 /// ```
6175 pub fn set_indicator<T>(mut self, v: T) -> Self
6176 where
6177 T: std::convert::Into<crate::model::Indicator>,
6178 {
6179 self.indicator = std::option::Option::Some(v.into());
6180 self
6181 }
6182
6183 /// Sets or clears the value of [indicator][crate::model::Finding::indicator].
6184 ///
6185 /// # Example
6186 /// ```ignore,no_run
6187 /// # use google_cloud_securitycenter_v2::model::Finding;
6188 /// use google_cloud_securitycenter_v2::model::Indicator;
6189 /// let x = Finding::new().set_or_clear_indicator(Some(Indicator::default()/* use setters */));
6190 /// let x = Finding::new().set_or_clear_indicator(None::<Indicator>);
6191 /// ```
6192 pub fn set_or_clear_indicator<T>(mut self, v: std::option::Option<T>) -> Self
6193 where
6194 T: std::convert::Into<crate::model::Indicator>,
6195 {
6196 self.indicator = v.map(|x| x.into());
6197 self
6198 }
6199
6200 /// Sets the value of [vulnerability][crate::model::Finding::vulnerability].
6201 ///
6202 /// # Example
6203 /// ```ignore,no_run
6204 /// # use google_cloud_securitycenter_v2::model::Finding;
6205 /// use google_cloud_securitycenter_v2::model::Vulnerability;
6206 /// let x = Finding::new().set_vulnerability(Vulnerability::default()/* use setters */);
6207 /// ```
6208 pub fn set_vulnerability<T>(mut self, v: T) -> Self
6209 where
6210 T: std::convert::Into<crate::model::Vulnerability>,
6211 {
6212 self.vulnerability = std::option::Option::Some(v.into());
6213 self
6214 }
6215
6216 /// Sets or clears the value of [vulnerability][crate::model::Finding::vulnerability].
6217 ///
6218 /// # Example
6219 /// ```ignore,no_run
6220 /// # use google_cloud_securitycenter_v2::model::Finding;
6221 /// use google_cloud_securitycenter_v2::model::Vulnerability;
6222 /// let x = Finding::new().set_or_clear_vulnerability(Some(Vulnerability::default()/* use setters */));
6223 /// let x = Finding::new().set_or_clear_vulnerability(None::<Vulnerability>);
6224 /// ```
6225 pub fn set_or_clear_vulnerability<T>(mut self, v: std::option::Option<T>) -> Self
6226 where
6227 T: std::convert::Into<crate::model::Vulnerability>,
6228 {
6229 self.vulnerability = v.map(|x| x.into());
6230 self
6231 }
6232
6233 /// Sets the value of [mute_update_time][crate::model::Finding::mute_update_time].
6234 ///
6235 /// # Example
6236 /// ```ignore,no_run
6237 /// # use google_cloud_securitycenter_v2::model::Finding;
6238 /// use wkt::Timestamp;
6239 /// let x = Finding::new().set_mute_update_time(Timestamp::default()/* use setters */);
6240 /// ```
6241 pub fn set_mute_update_time<T>(mut self, v: T) -> Self
6242 where
6243 T: std::convert::Into<wkt::Timestamp>,
6244 {
6245 self.mute_update_time = std::option::Option::Some(v.into());
6246 self
6247 }
6248
6249 /// Sets or clears the value of [mute_update_time][crate::model::Finding::mute_update_time].
6250 ///
6251 /// # Example
6252 /// ```ignore,no_run
6253 /// # use google_cloud_securitycenter_v2::model::Finding;
6254 /// use wkt::Timestamp;
6255 /// let x = Finding::new().set_or_clear_mute_update_time(Some(Timestamp::default()/* use setters */));
6256 /// let x = Finding::new().set_or_clear_mute_update_time(None::<Timestamp>);
6257 /// ```
6258 pub fn set_or_clear_mute_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6259 where
6260 T: std::convert::Into<wkt::Timestamp>,
6261 {
6262 self.mute_update_time = v.map(|x| x.into());
6263 self
6264 }
6265
6266 /// Sets the value of [external_systems][crate::model::Finding::external_systems].
6267 ///
6268 /// # Example
6269 /// ```ignore,no_run
6270 /// # use google_cloud_securitycenter_v2::model::Finding;
6271 /// use google_cloud_securitycenter_v2::model::ExternalSystem;
6272 /// let x = Finding::new().set_external_systems([
6273 /// ("key0", ExternalSystem::default()/* use setters */),
6274 /// ("key1", ExternalSystem::default()/* use (different) setters */),
6275 /// ]);
6276 /// ```
6277 pub fn set_external_systems<T, K, V>(mut self, v: T) -> Self
6278 where
6279 T: std::iter::IntoIterator<Item = (K, V)>,
6280 K: std::convert::Into<std::string::String>,
6281 V: std::convert::Into<crate::model::ExternalSystem>,
6282 {
6283 use std::iter::Iterator;
6284 self.external_systems = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6285 self
6286 }
6287
6288 /// Sets the value of [mitre_attack][crate::model::Finding::mitre_attack].
6289 ///
6290 /// # Example
6291 /// ```ignore,no_run
6292 /// # use google_cloud_securitycenter_v2::model::Finding;
6293 /// use google_cloud_securitycenter_v2::model::MitreAttack;
6294 /// let x = Finding::new().set_mitre_attack(MitreAttack::default()/* use setters */);
6295 /// ```
6296 pub fn set_mitre_attack<T>(mut self, v: T) -> Self
6297 where
6298 T: std::convert::Into<crate::model::MitreAttack>,
6299 {
6300 self.mitre_attack = std::option::Option::Some(v.into());
6301 self
6302 }
6303
6304 /// Sets or clears the value of [mitre_attack][crate::model::Finding::mitre_attack].
6305 ///
6306 /// # Example
6307 /// ```ignore,no_run
6308 /// # use google_cloud_securitycenter_v2::model::Finding;
6309 /// use google_cloud_securitycenter_v2::model::MitreAttack;
6310 /// let x = Finding::new().set_or_clear_mitre_attack(Some(MitreAttack::default()/* use setters */));
6311 /// let x = Finding::new().set_or_clear_mitre_attack(None::<MitreAttack>);
6312 /// ```
6313 pub fn set_or_clear_mitre_attack<T>(mut self, v: std::option::Option<T>) -> Self
6314 where
6315 T: std::convert::Into<crate::model::MitreAttack>,
6316 {
6317 self.mitre_attack = v.map(|x| x.into());
6318 self
6319 }
6320
6321 /// Sets the value of [access][crate::model::Finding::access].
6322 ///
6323 /// # Example
6324 /// ```ignore,no_run
6325 /// # use google_cloud_securitycenter_v2::model::Finding;
6326 /// use google_cloud_securitycenter_v2::model::Access;
6327 /// let x = Finding::new().set_access(Access::default()/* use setters */);
6328 /// ```
6329 pub fn set_access<T>(mut self, v: T) -> Self
6330 where
6331 T: std::convert::Into<crate::model::Access>,
6332 {
6333 self.access = std::option::Option::Some(v.into());
6334 self
6335 }
6336
6337 /// Sets or clears the value of [access][crate::model::Finding::access].
6338 ///
6339 /// # Example
6340 /// ```ignore,no_run
6341 /// # use google_cloud_securitycenter_v2::model::Finding;
6342 /// use google_cloud_securitycenter_v2::model::Access;
6343 /// let x = Finding::new().set_or_clear_access(Some(Access::default()/* use setters */));
6344 /// let x = Finding::new().set_or_clear_access(None::<Access>);
6345 /// ```
6346 pub fn set_or_clear_access<T>(mut self, v: std::option::Option<T>) -> Self
6347 where
6348 T: std::convert::Into<crate::model::Access>,
6349 {
6350 self.access = v.map(|x| x.into());
6351 self
6352 }
6353
6354 /// Sets the value of [connections][crate::model::Finding::connections].
6355 ///
6356 /// # Example
6357 /// ```ignore,no_run
6358 /// # use google_cloud_securitycenter_v2::model::Finding;
6359 /// use google_cloud_securitycenter_v2::model::Connection;
6360 /// let x = Finding::new()
6361 /// .set_connections([
6362 /// Connection::default()/* use setters */,
6363 /// Connection::default()/* use (different) setters */,
6364 /// ]);
6365 /// ```
6366 pub fn set_connections<T, V>(mut self, v: T) -> Self
6367 where
6368 T: std::iter::IntoIterator<Item = V>,
6369 V: std::convert::Into<crate::model::Connection>,
6370 {
6371 use std::iter::Iterator;
6372 self.connections = v.into_iter().map(|i| i.into()).collect();
6373 self
6374 }
6375
6376 /// Sets the value of [mute_initiator][crate::model::Finding::mute_initiator].
6377 ///
6378 /// # Example
6379 /// ```ignore,no_run
6380 /// # use google_cloud_securitycenter_v2::model::Finding;
6381 /// let x = Finding::new().set_mute_initiator("example");
6382 /// ```
6383 pub fn set_mute_initiator<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6384 self.mute_initiator = v.into();
6385 self
6386 }
6387
6388 /// Sets the value of [processes][crate::model::Finding::processes].
6389 ///
6390 /// # Example
6391 /// ```ignore,no_run
6392 /// # use google_cloud_securitycenter_v2::model::Finding;
6393 /// use google_cloud_securitycenter_v2::model::Process;
6394 /// let x = Finding::new()
6395 /// .set_processes([
6396 /// Process::default()/* use setters */,
6397 /// Process::default()/* use (different) setters */,
6398 /// ]);
6399 /// ```
6400 pub fn set_processes<T, V>(mut self, v: T) -> Self
6401 where
6402 T: std::iter::IntoIterator<Item = V>,
6403 V: std::convert::Into<crate::model::Process>,
6404 {
6405 use std::iter::Iterator;
6406 self.processes = v.into_iter().map(|i| i.into()).collect();
6407 self
6408 }
6409
6410 /// Sets the value of [contacts][crate::model::Finding::contacts].
6411 ///
6412 /// # Example
6413 /// ```ignore,no_run
6414 /// # use google_cloud_securitycenter_v2::model::Finding;
6415 /// use google_cloud_securitycenter_v2::model::ContactDetails;
6416 /// let x = Finding::new().set_contacts([
6417 /// ("key0", ContactDetails::default()/* use setters */),
6418 /// ("key1", ContactDetails::default()/* use (different) setters */),
6419 /// ]);
6420 /// ```
6421 pub fn set_contacts<T, K, V>(mut self, v: T) -> Self
6422 where
6423 T: std::iter::IntoIterator<Item = (K, V)>,
6424 K: std::convert::Into<std::string::String>,
6425 V: std::convert::Into<crate::model::ContactDetails>,
6426 {
6427 use std::iter::Iterator;
6428 self.contacts = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6429 self
6430 }
6431
6432 /// Sets the value of [compliances][crate::model::Finding::compliances].
6433 ///
6434 /// # Example
6435 /// ```ignore,no_run
6436 /// # use google_cloud_securitycenter_v2::model::Finding;
6437 /// use google_cloud_securitycenter_v2::model::Compliance;
6438 /// let x = Finding::new()
6439 /// .set_compliances([
6440 /// Compliance::default()/* use setters */,
6441 /// Compliance::default()/* use (different) setters */,
6442 /// ]);
6443 /// ```
6444 pub fn set_compliances<T, V>(mut self, v: T) -> Self
6445 where
6446 T: std::iter::IntoIterator<Item = V>,
6447 V: std::convert::Into<crate::model::Compliance>,
6448 {
6449 use std::iter::Iterator;
6450 self.compliances = v.into_iter().map(|i| i.into()).collect();
6451 self
6452 }
6453
6454 /// Sets the value of [parent_display_name][crate::model::Finding::parent_display_name].
6455 ///
6456 /// # Example
6457 /// ```ignore,no_run
6458 /// # use google_cloud_securitycenter_v2::model::Finding;
6459 /// let x = Finding::new().set_parent_display_name("example");
6460 /// ```
6461 pub fn set_parent_display_name<T: std::convert::Into<std::string::String>>(
6462 mut self,
6463 v: T,
6464 ) -> Self {
6465 self.parent_display_name = v.into();
6466 self
6467 }
6468
6469 /// Sets the value of [description][crate::model::Finding::description].
6470 ///
6471 /// # Example
6472 /// ```ignore,no_run
6473 /// # use google_cloud_securitycenter_v2::model::Finding;
6474 /// let x = Finding::new().set_description("example");
6475 /// ```
6476 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6477 self.description = v.into();
6478 self
6479 }
6480
6481 /// Sets the value of [exfiltration][crate::model::Finding::exfiltration].
6482 ///
6483 /// # Example
6484 /// ```ignore,no_run
6485 /// # use google_cloud_securitycenter_v2::model::Finding;
6486 /// use google_cloud_securitycenter_v2::model::Exfiltration;
6487 /// let x = Finding::new().set_exfiltration(Exfiltration::default()/* use setters */);
6488 /// ```
6489 pub fn set_exfiltration<T>(mut self, v: T) -> Self
6490 where
6491 T: std::convert::Into<crate::model::Exfiltration>,
6492 {
6493 self.exfiltration = std::option::Option::Some(v.into());
6494 self
6495 }
6496
6497 /// Sets or clears the value of [exfiltration][crate::model::Finding::exfiltration].
6498 ///
6499 /// # Example
6500 /// ```ignore,no_run
6501 /// # use google_cloud_securitycenter_v2::model::Finding;
6502 /// use google_cloud_securitycenter_v2::model::Exfiltration;
6503 /// let x = Finding::new().set_or_clear_exfiltration(Some(Exfiltration::default()/* use setters */));
6504 /// let x = Finding::new().set_or_clear_exfiltration(None::<Exfiltration>);
6505 /// ```
6506 pub fn set_or_clear_exfiltration<T>(mut self, v: std::option::Option<T>) -> Self
6507 where
6508 T: std::convert::Into<crate::model::Exfiltration>,
6509 {
6510 self.exfiltration = v.map(|x| x.into());
6511 self
6512 }
6513
6514 /// Sets the value of [iam_bindings][crate::model::Finding::iam_bindings].
6515 ///
6516 /// # Example
6517 /// ```ignore,no_run
6518 /// # use google_cloud_securitycenter_v2::model::Finding;
6519 /// use google_cloud_securitycenter_v2::model::IamBinding;
6520 /// let x = Finding::new()
6521 /// .set_iam_bindings([
6522 /// IamBinding::default()/* use setters */,
6523 /// IamBinding::default()/* use (different) setters */,
6524 /// ]);
6525 /// ```
6526 pub fn set_iam_bindings<T, V>(mut self, v: T) -> Self
6527 where
6528 T: std::iter::IntoIterator<Item = V>,
6529 V: std::convert::Into<crate::model::IamBinding>,
6530 {
6531 use std::iter::Iterator;
6532 self.iam_bindings = v.into_iter().map(|i| i.into()).collect();
6533 self
6534 }
6535
6536 /// Sets the value of [next_steps][crate::model::Finding::next_steps].
6537 ///
6538 /// # Example
6539 /// ```ignore,no_run
6540 /// # use google_cloud_securitycenter_v2::model::Finding;
6541 /// let x = Finding::new().set_next_steps("example");
6542 /// ```
6543 pub fn set_next_steps<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6544 self.next_steps = v.into();
6545 self
6546 }
6547
6548 /// Sets the value of [module_name][crate::model::Finding::module_name].
6549 ///
6550 /// # Example
6551 /// ```ignore,no_run
6552 /// # use google_cloud_securitycenter_v2::model::Finding;
6553 /// let x = Finding::new().set_module_name("example");
6554 /// ```
6555 pub fn set_module_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6556 self.module_name = v.into();
6557 self
6558 }
6559
6560 /// Sets the value of [containers][crate::model::Finding::containers].
6561 ///
6562 /// # Example
6563 /// ```ignore,no_run
6564 /// # use google_cloud_securitycenter_v2::model::Finding;
6565 /// use google_cloud_securitycenter_v2::model::Container;
6566 /// let x = Finding::new()
6567 /// .set_containers([
6568 /// Container::default()/* use setters */,
6569 /// Container::default()/* use (different) setters */,
6570 /// ]);
6571 /// ```
6572 pub fn set_containers<T, V>(mut self, v: T) -> Self
6573 where
6574 T: std::iter::IntoIterator<Item = V>,
6575 V: std::convert::Into<crate::model::Container>,
6576 {
6577 use std::iter::Iterator;
6578 self.containers = v.into_iter().map(|i| i.into()).collect();
6579 self
6580 }
6581
6582 /// Sets the value of [kubernetes][crate::model::Finding::kubernetes].
6583 ///
6584 /// # Example
6585 /// ```ignore,no_run
6586 /// # use google_cloud_securitycenter_v2::model::Finding;
6587 /// use google_cloud_securitycenter_v2::model::Kubernetes;
6588 /// let x = Finding::new().set_kubernetes(Kubernetes::default()/* use setters */);
6589 /// ```
6590 pub fn set_kubernetes<T>(mut self, v: T) -> Self
6591 where
6592 T: std::convert::Into<crate::model::Kubernetes>,
6593 {
6594 self.kubernetes = std::option::Option::Some(v.into());
6595 self
6596 }
6597
6598 /// Sets or clears the value of [kubernetes][crate::model::Finding::kubernetes].
6599 ///
6600 /// # Example
6601 /// ```ignore,no_run
6602 /// # use google_cloud_securitycenter_v2::model::Finding;
6603 /// use google_cloud_securitycenter_v2::model::Kubernetes;
6604 /// let x = Finding::new().set_or_clear_kubernetes(Some(Kubernetes::default()/* use setters */));
6605 /// let x = Finding::new().set_or_clear_kubernetes(None::<Kubernetes>);
6606 /// ```
6607 pub fn set_or_clear_kubernetes<T>(mut self, v: std::option::Option<T>) -> Self
6608 where
6609 T: std::convert::Into<crate::model::Kubernetes>,
6610 {
6611 self.kubernetes = v.map(|x| x.into());
6612 self
6613 }
6614
6615 /// Sets the value of [database][crate::model::Finding::database].
6616 ///
6617 /// # Example
6618 /// ```ignore,no_run
6619 /// # use google_cloud_securitycenter_v2::model::Finding;
6620 /// use google_cloud_securitycenter_v2::model::Database;
6621 /// let x = Finding::new().set_database(Database::default()/* use setters */);
6622 /// ```
6623 pub fn set_database<T>(mut self, v: T) -> Self
6624 where
6625 T: std::convert::Into<crate::model::Database>,
6626 {
6627 self.database = std::option::Option::Some(v.into());
6628 self
6629 }
6630
6631 /// Sets or clears the value of [database][crate::model::Finding::database].
6632 ///
6633 /// # Example
6634 /// ```ignore,no_run
6635 /// # use google_cloud_securitycenter_v2::model::Finding;
6636 /// use google_cloud_securitycenter_v2::model::Database;
6637 /// let x = Finding::new().set_or_clear_database(Some(Database::default()/* use setters */));
6638 /// let x = Finding::new().set_or_clear_database(None::<Database>);
6639 /// ```
6640 pub fn set_or_clear_database<T>(mut self, v: std::option::Option<T>) -> Self
6641 where
6642 T: std::convert::Into<crate::model::Database>,
6643 {
6644 self.database = v.map(|x| x.into());
6645 self
6646 }
6647
6648 /// Sets the value of [attack_exposure][crate::model::Finding::attack_exposure].
6649 ///
6650 /// # Example
6651 /// ```ignore,no_run
6652 /// # use google_cloud_securitycenter_v2::model::Finding;
6653 /// use google_cloud_securitycenter_v2::model::AttackExposure;
6654 /// let x = Finding::new().set_attack_exposure(AttackExposure::default()/* use setters */);
6655 /// ```
6656 pub fn set_attack_exposure<T>(mut self, v: T) -> Self
6657 where
6658 T: std::convert::Into<crate::model::AttackExposure>,
6659 {
6660 self.attack_exposure = std::option::Option::Some(v.into());
6661 self
6662 }
6663
6664 /// Sets or clears the value of [attack_exposure][crate::model::Finding::attack_exposure].
6665 ///
6666 /// # Example
6667 /// ```ignore,no_run
6668 /// # use google_cloud_securitycenter_v2::model::Finding;
6669 /// use google_cloud_securitycenter_v2::model::AttackExposure;
6670 /// let x = Finding::new().set_or_clear_attack_exposure(Some(AttackExposure::default()/* use setters */));
6671 /// let x = Finding::new().set_or_clear_attack_exposure(None::<AttackExposure>);
6672 /// ```
6673 pub fn set_or_clear_attack_exposure<T>(mut self, v: std::option::Option<T>) -> Self
6674 where
6675 T: std::convert::Into<crate::model::AttackExposure>,
6676 {
6677 self.attack_exposure = v.map(|x| x.into());
6678 self
6679 }
6680
6681 /// Sets the value of [files][crate::model::Finding::files].
6682 ///
6683 /// # Example
6684 /// ```ignore,no_run
6685 /// # use google_cloud_securitycenter_v2::model::Finding;
6686 /// use google_cloud_securitycenter_v2::model::File;
6687 /// let x = Finding::new()
6688 /// .set_files([
6689 /// File::default()/* use setters */,
6690 /// File::default()/* use (different) setters */,
6691 /// ]);
6692 /// ```
6693 pub fn set_files<T, V>(mut self, v: T) -> Self
6694 where
6695 T: std::iter::IntoIterator<Item = V>,
6696 V: std::convert::Into<crate::model::File>,
6697 {
6698 use std::iter::Iterator;
6699 self.files = v.into_iter().map(|i| i.into()).collect();
6700 self
6701 }
6702
6703 /// Sets the value of [cloud_dlp_inspection][crate::model::Finding::cloud_dlp_inspection].
6704 ///
6705 /// # Example
6706 /// ```ignore,no_run
6707 /// # use google_cloud_securitycenter_v2::model::Finding;
6708 /// use google_cloud_securitycenter_v2::model::CloudDlpInspection;
6709 /// let x = Finding::new().set_cloud_dlp_inspection(CloudDlpInspection::default()/* use setters */);
6710 /// ```
6711 pub fn set_cloud_dlp_inspection<T>(mut self, v: T) -> Self
6712 where
6713 T: std::convert::Into<crate::model::CloudDlpInspection>,
6714 {
6715 self.cloud_dlp_inspection = std::option::Option::Some(v.into());
6716 self
6717 }
6718
6719 /// Sets or clears the value of [cloud_dlp_inspection][crate::model::Finding::cloud_dlp_inspection].
6720 ///
6721 /// # Example
6722 /// ```ignore,no_run
6723 /// # use google_cloud_securitycenter_v2::model::Finding;
6724 /// use google_cloud_securitycenter_v2::model::CloudDlpInspection;
6725 /// let x = Finding::new().set_or_clear_cloud_dlp_inspection(Some(CloudDlpInspection::default()/* use setters */));
6726 /// let x = Finding::new().set_or_clear_cloud_dlp_inspection(None::<CloudDlpInspection>);
6727 /// ```
6728 pub fn set_or_clear_cloud_dlp_inspection<T>(mut self, v: std::option::Option<T>) -> Self
6729 where
6730 T: std::convert::Into<crate::model::CloudDlpInspection>,
6731 {
6732 self.cloud_dlp_inspection = v.map(|x| x.into());
6733 self
6734 }
6735
6736 /// Sets the value of [cloud_dlp_data_profile][crate::model::Finding::cloud_dlp_data_profile].
6737 ///
6738 /// # Example
6739 /// ```ignore,no_run
6740 /// # use google_cloud_securitycenter_v2::model::Finding;
6741 /// use google_cloud_securitycenter_v2::model::CloudDlpDataProfile;
6742 /// let x = Finding::new().set_cloud_dlp_data_profile(CloudDlpDataProfile::default()/* use setters */);
6743 /// ```
6744 pub fn set_cloud_dlp_data_profile<T>(mut self, v: T) -> Self
6745 where
6746 T: std::convert::Into<crate::model::CloudDlpDataProfile>,
6747 {
6748 self.cloud_dlp_data_profile = std::option::Option::Some(v.into());
6749 self
6750 }
6751
6752 /// Sets or clears the value of [cloud_dlp_data_profile][crate::model::Finding::cloud_dlp_data_profile].
6753 ///
6754 /// # Example
6755 /// ```ignore,no_run
6756 /// # use google_cloud_securitycenter_v2::model::Finding;
6757 /// use google_cloud_securitycenter_v2::model::CloudDlpDataProfile;
6758 /// let x = Finding::new().set_or_clear_cloud_dlp_data_profile(Some(CloudDlpDataProfile::default()/* use setters */));
6759 /// let x = Finding::new().set_or_clear_cloud_dlp_data_profile(None::<CloudDlpDataProfile>);
6760 /// ```
6761 pub fn set_or_clear_cloud_dlp_data_profile<T>(mut self, v: std::option::Option<T>) -> Self
6762 where
6763 T: std::convert::Into<crate::model::CloudDlpDataProfile>,
6764 {
6765 self.cloud_dlp_data_profile = v.map(|x| x.into());
6766 self
6767 }
6768
6769 /// Sets the value of [kernel_rootkit][crate::model::Finding::kernel_rootkit].
6770 ///
6771 /// # Example
6772 /// ```ignore,no_run
6773 /// # use google_cloud_securitycenter_v2::model::Finding;
6774 /// use google_cloud_securitycenter_v2::model::KernelRootkit;
6775 /// let x = Finding::new().set_kernel_rootkit(KernelRootkit::default()/* use setters */);
6776 /// ```
6777 pub fn set_kernel_rootkit<T>(mut self, v: T) -> Self
6778 where
6779 T: std::convert::Into<crate::model::KernelRootkit>,
6780 {
6781 self.kernel_rootkit = std::option::Option::Some(v.into());
6782 self
6783 }
6784
6785 /// Sets or clears the value of [kernel_rootkit][crate::model::Finding::kernel_rootkit].
6786 ///
6787 /// # Example
6788 /// ```ignore,no_run
6789 /// # use google_cloud_securitycenter_v2::model::Finding;
6790 /// use google_cloud_securitycenter_v2::model::KernelRootkit;
6791 /// let x = Finding::new().set_or_clear_kernel_rootkit(Some(KernelRootkit::default()/* use setters */));
6792 /// let x = Finding::new().set_or_clear_kernel_rootkit(None::<KernelRootkit>);
6793 /// ```
6794 pub fn set_or_clear_kernel_rootkit<T>(mut self, v: std::option::Option<T>) -> Self
6795 where
6796 T: std::convert::Into<crate::model::KernelRootkit>,
6797 {
6798 self.kernel_rootkit = v.map(|x| x.into());
6799 self
6800 }
6801
6802 /// Sets the value of [org_policies][crate::model::Finding::org_policies].
6803 ///
6804 /// # Example
6805 /// ```ignore,no_run
6806 /// # use google_cloud_securitycenter_v2::model::Finding;
6807 /// use google_cloud_securitycenter_v2::model::OrgPolicy;
6808 /// let x = Finding::new()
6809 /// .set_org_policies([
6810 /// OrgPolicy::default()/* use setters */,
6811 /// OrgPolicy::default()/* use (different) setters */,
6812 /// ]);
6813 /// ```
6814 pub fn set_org_policies<T, V>(mut self, v: T) -> Self
6815 where
6816 T: std::iter::IntoIterator<Item = V>,
6817 V: std::convert::Into<crate::model::OrgPolicy>,
6818 {
6819 use std::iter::Iterator;
6820 self.org_policies = v.into_iter().map(|i| i.into()).collect();
6821 self
6822 }
6823
6824 /// Sets the value of [job][crate::model::Finding::job].
6825 ///
6826 /// # Example
6827 /// ```ignore,no_run
6828 /// # use google_cloud_securitycenter_v2::model::Finding;
6829 /// use google_cloud_securitycenter_v2::model::Job;
6830 /// let x = Finding::new().set_job(Job::default()/* use setters */);
6831 /// ```
6832 pub fn set_job<T>(mut self, v: T) -> Self
6833 where
6834 T: std::convert::Into<crate::model::Job>,
6835 {
6836 self.job = std::option::Option::Some(v.into());
6837 self
6838 }
6839
6840 /// Sets or clears the value of [job][crate::model::Finding::job].
6841 ///
6842 /// # Example
6843 /// ```ignore,no_run
6844 /// # use google_cloud_securitycenter_v2::model::Finding;
6845 /// use google_cloud_securitycenter_v2::model::Job;
6846 /// let x = Finding::new().set_or_clear_job(Some(Job::default()/* use setters */));
6847 /// let x = Finding::new().set_or_clear_job(None::<Job>);
6848 /// ```
6849 pub fn set_or_clear_job<T>(mut self, v: std::option::Option<T>) -> Self
6850 where
6851 T: std::convert::Into<crate::model::Job>,
6852 {
6853 self.job = v.map(|x| x.into());
6854 self
6855 }
6856
6857 /// Sets the value of [application][crate::model::Finding::application].
6858 ///
6859 /// # Example
6860 /// ```ignore,no_run
6861 /// # use google_cloud_securitycenter_v2::model::Finding;
6862 /// use google_cloud_securitycenter_v2::model::Application;
6863 /// let x = Finding::new().set_application(Application::default()/* use setters */);
6864 /// ```
6865 pub fn set_application<T>(mut self, v: T) -> Self
6866 where
6867 T: std::convert::Into<crate::model::Application>,
6868 {
6869 self.application = std::option::Option::Some(v.into());
6870 self
6871 }
6872
6873 /// Sets or clears the value of [application][crate::model::Finding::application].
6874 ///
6875 /// # Example
6876 /// ```ignore,no_run
6877 /// # use google_cloud_securitycenter_v2::model::Finding;
6878 /// use google_cloud_securitycenter_v2::model::Application;
6879 /// let x = Finding::new().set_or_clear_application(Some(Application::default()/* use setters */));
6880 /// let x = Finding::new().set_or_clear_application(None::<Application>);
6881 /// ```
6882 pub fn set_or_clear_application<T>(mut self, v: std::option::Option<T>) -> Self
6883 where
6884 T: std::convert::Into<crate::model::Application>,
6885 {
6886 self.application = v.map(|x| x.into());
6887 self
6888 }
6889
6890 /// Sets the value of [ip_rules][crate::model::Finding::ip_rules].
6891 ///
6892 /// # Example
6893 /// ```ignore,no_run
6894 /// # use google_cloud_securitycenter_v2::model::Finding;
6895 /// use google_cloud_securitycenter_v2::model::IpRules;
6896 /// let x = Finding::new().set_ip_rules(IpRules::default()/* use setters */);
6897 /// ```
6898 pub fn set_ip_rules<T>(mut self, v: T) -> Self
6899 where
6900 T: std::convert::Into<crate::model::IpRules>,
6901 {
6902 self.ip_rules = std::option::Option::Some(v.into());
6903 self
6904 }
6905
6906 /// Sets or clears the value of [ip_rules][crate::model::Finding::ip_rules].
6907 ///
6908 /// # Example
6909 /// ```ignore,no_run
6910 /// # use google_cloud_securitycenter_v2::model::Finding;
6911 /// use google_cloud_securitycenter_v2::model::IpRules;
6912 /// let x = Finding::new().set_or_clear_ip_rules(Some(IpRules::default()/* use setters */));
6913 /// let x = Finding::new().set_or_clear_ip_rules(None::<IpRules>);
6914 /// ```
6915 pub fn set_or_clear_ip_rules<T>(mut self, v: std::option::Option<T>) -> Self
6916 where
6917 T: std::convert::Into<crate::model::IpRules>,
6918 {
6919 self.ip_rules = v.map(|x| x.into());
6920 self
6921 }
6922
6923 /// Sets the value of [backup_disaster_recovery][crate::model::Finding::backup_disaster_recovery].
6924 ///
6925 /// # Example
6926 /// ```ignore,no_run
6927 /// # use google_cloud_securitycenter_v2::model::Finding;
6928 /// use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
6929 /// let x = Finding::new().set_backup_disaster_recovery(BackupDisasterRecovery::default()/* use setters */);
6930 /// ```
6931 pub fn set_backup_disaster_recovery<T>(mut self, v: T) -> Self
6932 where
6933 T: std::convert::Into<crate::model::BackupDisasterRecovery>,
6934 {
6935 self.backup_disaster_recovery = std::option::Option::Some(v.into());
6936 self
6937 }
6938
6939 /// Sets or clears the value of [backup_disaster_recovery][crate::model::Finding::backup_disaster_recovery].
6940 ///
6941 /// # Example
6942 /// ```ignore,no_run
6943 /// # use google_cloud_securitycenter_v2::model::Finding;
6944 /// use google_cloud_securitycenter_v2::model::BackupDisasterRecovery;
6945 /// let x = Finding::new().set_or_clear_backup_disaster_recovery(Some(BackupDisasterRecovery::default()/* use setters */));
6946 /// let x = Finding::new().set_or_clear_backup_disaster_recovery(None::<BackupDisasterRecovery>);
6947 /// ```
6948 pub fn set_or_clear_backup_disaster_recovery<T>(mut self, v: std::option::Option<T>) -> Self
6949 where
6950 T: std::convert::Into<crate::model::BackupDisasterRecovery>,
6951 {
6952 self.backup_disaster_recovery = v.map(|x| x.into());
6953 self
6954 }
6955
6956 /// Sets the value of [security_posture][crate::model::Finding::security_posture].
6957 ///
6958 /// # Example
6959 /// ```ignore,no_run
6960 /// # use google_cloud_securitycenter_v2::model::Finding;
6961 /// use google_cloud_securitycenter_v2::model::SecurityPosture;
6962 /// let x = Finding::new().set_security_posture(SecurityPosture::default()/* use setters */);
6963 /// ```
6964 pub fn set_security_posture<T>(mut self, v: T) -> Self
6965 where
6966 T: std::convert::Into<crate::model::SecurityPosture>,
6967 {
6968 self.security_posture = std::option::Option::Some(v.into());
6969 self
6970 }
6971
6972 /// Sets or clears the value of [security_posture][crate::model::Finding::security_posture].
6973 ///
6974 /// # Example
6975 /// ```ignore,no_run
6976 /// # use google_cloud_securitycenter_v2::model::Finding;
6977 /// use google_cloud_securitycenter_v2::model::SecurityPosture;
6978 /// let x = Finding::new().set_or_clear_security_posture(Some(SecurityPosture::default()/* use setters */));
6979 /// let x = Finding::new().set_or_clear_security_posture(None::<SecurityPosture>);
6980 /// ```
6981 pub fn set_or_clear_security_posture<T>(mut self, v: std::option::Option<T>) -> Self
6982 where
6983 T: std::convert::Into<crate::model::SecurityPosture>,
6984 {
6985 self.security_posture = v.map(|x| x.into());
6986 self
6987 }
6988
6989 /// Sets the value of [log_entries][crate::model::Finding::log_entries].
6990 ///
6991 /// # Example
6992 /// ```ignore,no_run
6993 /// # use google_cloud_securitycenter_v2::model::Finding;
6994 /// use google_cloud_securitycenter_v2::model::LogEntry;
6995 /// let x = Finding::new()
6996 /// .set_log_entries([
6997 /// LogEntry::default()/* use setters */,
6998 /// LogEntry::default()/* use (different) setters */,
6999 /// ]);
7000 /// ```
7001 pub fn set_log_entries<T, V>(mut self, v: T) -> Self
7002 where
7003 T: std::iter::IntoIterator<Item = V>,
7004 V: std::convert::Into<crate::model::LogEntry>,
7005 {
7006 use std::iter::Iterator;
7007 self.log_entries = v.into_iter().map(|i| i.into()).collect();
7008 self
7009 }
7010
7011 /// Sets the value of [load_balancers][crate::model::Finding::load_balancers].
7012 ///
7013 /// # Example
7014 /// ```ignore,no_run
7015 /// # use google_cloud_securitycenter_v2::model::Finding;
7016 /// use google_cloud_securitycenter_v2::model::LoadBalancer;
7017 /// let x = Finding::new()
7018 /// .set_load_balancers([
7019 /// LoadBalancer::default()/* use setters */,
7020 /// LoadBalancer::default()/* use (different) setters */,
7021 /// ]);
7022 /// ```
7023 pub fn set_load_balancers<T, V>(mut self, v: T) -> Self
7024 where
7025 T: std::iter::IntoIterator<Item = V>,
7026 V: std::convert::Into<crate::model::LoadBalancer>,
7027 {
7028 use std::iter::Iterator;
7029 self.load_balancers = v.into_iter().map(|i| i.into()).collect();
7030 self
7031 }
7032
7033 /// Sets the value of [cloud_armor][crate::model::Finding::cloud_armor].
7034 ///
7035 /// # Example
7036 /// ```ignore,no_run
7037 /// # use google_cloud_securitycenter_v2::model::Finding;
7038 /// use google_cloud_securitycenter_v2::model::CloudArmor;
7039 /// let x = Finding::new().set_cloud_armor(CloudArmor::default()/* use setters */);
7040 /// ```
7041 pub fn set_cloud_armor<T>(mut self, v: T) -> Self
7042 where
7043 T: std::convert::Into<crate::model::CloudArmor>,
7044 {
7045 self.cloud_armor = std::option::Option::Some(v.into());
7046 self
7047 }
7048
7049 /// Sets or clears the value of [cloud_armor][crate::model::Finding::cloud_armor].
7050 ///
7051 /// # Example
7052 /// ```ignore,no_run
7053 /// # use google_cloud_securitycenter_v2::model::Finding;
7054 /// use google_cloud_securitycenter_v2::model::CloudArmor;
7055 /// let x = Finding::new().set_or_clear_cloud_armor(Some(CloudArmor::default()/* use setters */));
7056 /// let x = Finding::new().set_or_clear_cloud_armor(None::<CloudArmor>);
7057 /// ```
7058 pub fn set_or_clear_cloud_armor<T>(mut self, v: std::option::Option<T>) -> Self
7059 where
7060 T: std::convert::Into<crate::model::CloudArmor>,
7061 {
7062 self.cloud_armor = v.map(|x| x.into());
7063 self
7064 }
7065
7066 /// Sets the value of [notebook][crate::model::Finding::notebook].
7067 ///
7068 /// # Example
7069 /// ```ignore,no_run
7070 /// # use google_cloud_securitycenter_v2::model::Finding;
7071 /// use google_cloud_securitycenter_v2::model::Notebook;
7072 /// let x = Finding::new().set_notebook(Notebook::default()/* use setters */);
7073 /// ```
7074 pub fn set_notebook<T>(mut self, v: T) -> Self
7075 where
7076 T: std::convert::Into<crate::model::Notebook>,
7077 {
7078 self.notebook = std::option::Option::Some(v.into());
7079 self
7080 }
7081
7082 /// Sets or clears the value of [notebook][crate::model::Finding::notebook].
7083 ///
7084 /// # Example
7085 /// ```ignore,no_run
7086 /// # use google_cloud_securitycenter_v2::model::Finding;
7087 /// use google_cloud_securitycenter_v2::model::Notebook;
7088 /// let x = Finding::new().set_or_clear_notebook(Some(Notebook::default()/* use setters */));
7089 /// let x = Finding::new().set_or_clear_notebook(None::<Notebook>);
7090 /// ```
7091 pub fn set_or_clear_notebook<T>(mut self, v: std::option::Option<T>) -> Self
7092 where
7093 T: std::convert::Into<crate::model::Notebook>,
7094 {
7095 self.notebook = v.map(|x| x.into());
7096 self
7097 }
7098
7099 /// Sets the value of [toxic_combination][crate::model::Finding::toxic_combination].
7100 ///
7101 /// # Example
7102 /// ```ignore,no_run
7103 /// # use google_cloud_securitycenter_v2::model::Finding;
7104 /// use google_cloud_securitycenter_v2::model::ToxicCombination;
7105 /// let x = Finding::new().set_toxic_combination(ToxicCombination::default()/* use setters */);
7106 /// ```
7107 pub fn set_toxic_combination<T>(mut self, v: T) -> Self
7108 where
7109 T: std::convert::Into<crate::model::ToxicCombination>,
7110 {
7111 self.toxic_combination = std::option::Option::Some(v.into());
7112 self
7113 }
7114
7115 /// Sets or clears the value of [toxic_combination][crate::model::Finding::toxic_combination].
7116 ///
7117 /// # Example
7118 /// ```ignore,no_run
7119 /// # use google_cloud_securitycenter_v2::model::Finding;
7120 /// use google_cloud_securitycenter_v2::model::ToxicCombination;
7121 /// let x = Finding::new().set_or_clear_toxic_combination(Some(ToxicCombination::default()/* use setters */));
7122 /// let x = Finding::new().set_or_clear_toxic_combination(None::<ToxicCombination>);
7123 /// ```
7124 pub fn set_or_clear_toxic_combination<T>(mut self, v: std::option::Option<T>) -> Self
7125 where
7126 T: std::convert::Into<crate::model::ToxicCombination>,
7127 {
7128 self.toxic_combination = v.map(|x| x.into());
7129 self
7130 }
7131
7132 /// Sets the value of [group_memberships][crate::model::Finding::group_memberships].
7133 ///
7134 /// # Example
7135 /// ```ignore,no_run
7136 /// # use google_cloud_securitycenter_v2::model::Finding;
7137 /// use google_cloud_securitycenter_v2::model::GroupMembership;
7138 /// let x = Finding::new()
7139 /// .set_group_memberships([
7140 /// GroupMembership::default()/* use setters */,
7141 /// GroupMembership::default()/* use (different) setters */,
7142 /// ]);
7143 /// ```
7144 pub fn set_group_memberships<T, V>(mut self, v: T) -> Self
7145 where
7146 T: std::iter::IntoIterator<Item = V>,
7147 V: std::convert::Into<crate::model::GroupMembership>,
7148 {
7149 use std::iter::Iterator;
7150 self.group_memberships = v.into_iter().map(|i| i.into()).collect();
7151 self
7152 }
7153
7154 /// Sets the value of [disk][crate::model::Finding::disk].
7155 ///
7156 /// # Example
7157 /// ```ignore,no_run
7158 /// # use google_cloud_securitycenter_v2::model::Finding;
7159 /// use google_cloud_securitycenter_v2::model::Disk;
7160 /// let x = Finding::new().set_disk(Disk::default()/* use setters */);
7161 /// ```
7162 pub fn set_disk<T>(mut self, v: T) -> Self
7163 where
7164 T: std::convert::Into<crate::model::Disk>,
7165 {
7166 self.disk = std::option::Option::Some(v.into());
7167 self
7168 }
7169
7170 /// Sets or clears the value of [disk][crate::model::Finding::disk].
7171 ///
7172 /// # Example
7173 /// ```ignore,no_run
7174 /// # use google_cloud_securitycenter_v2::model::Finding;
7175 /// use google_cloud_securitycenter_v2::model::Disk;
7176 /// let x = Finding::new().set_or_clear_disk(Some(Disk::default()/* use setters */));
7177 /// let x = Finding::new().set_or_clear_disk(None::<Disk>);
7178 /// ```
7179 pub fn set_or_clear_disk<T>(mut self, v: std::option::Option<T>) -> Self
7180 where
7181 T: std::convert::Into<crate::model::Disk>,
7182 {
7183 self.disk = v.map(|x| x.into());
7184 self
7185 }
7186
7187 /// Sets the value of [data_access_events][crate::model::Finding::data_access_events].
7188 ///
7189 /// # Example
7190 /// ```ignore,no_run
7191 /// # use google_cloud_securitycenter_v2::model::Finding;
7192 /// use google_cloud_securitycenter_v2::model::DataAccessEvent;
7193 /// let x = Finding::new()
7194 /// .set_data_access_events([
7195 /// DataAccessEvent::default()/* use setters */,
7196 /// DataAccessEvent::default()/* use (different) setters */,
7197 /// ]);
7198 /// ```
7199 pub fn set_data_access_events<T, V>(mut self, v: T) -> Self
7200 where
7201 T: std::iter::IntoIterator<Item = V>,
7202 V: std::convert::Into<crate::model::DataAccessEvent>,
7203 {
7204 use std::iter::Iterator;
7205 self.data_access_events = v.into_iter().map(|i| i.into()).collect();
7206 self
7207 }
7208
7209 /// Sets the value of [data_flow_events][crate::model::Finding::data_flow_events].
7210 ///
7211 /// # Example
7212 /// ```ignore,no_run
7213 /// # use google_cloud_securitycenter_v2::model::Finding;
7214 /// use google_cloud_securitycenter_v2::model::DataFlowEvent;
7215 /// let x = Finding::new()
7216 /// .set_data_flow_events([
7217 /// DataFlowEvent::default()/* use setters */,
7218 /// DataFlowEvent::default()/* use (different) setters */,
7219 /// ]);
7220 /// ```
7221 pub fn set_data_flow_events<T, V>(mut self, v: T) -> Self
7222 where
7223 T: std::iter::IntoIterator<Item = V>,
7224 V: std::convert::Into<crate::model::DataFlowEvent>,
7225 {
7226 use std::iter::Iterator;
7227 self.data_flow_events = v.into_iter().map(|i| i.into()).collect();
7228 self
7229 }
7230
7231 /// Sets the value of [networks][crate::model::Finding::networks].
7232 ///
7233 /// # Example
7234 /// ```ignore,no_run
7235 /// # use google_cloud_securitycenter_v2::model::Finding;
7236 /// use google_cloud_securitycenter_v2::model::Network;
7237 /// let x = Finding::new()
7238 /// .set_networks([
7239 /// Network::default()/* use setters */,
7240 /// Network::default()/* use (different) setters */,
7241 /// ]);
7242 /// ```
7243 pub fn set_networks<T, V>(mut self, v: T) -> Self
7244 where
7245 T: std::iter::IntoIterator<Item = V>,
7246 V: std::convert::Into<crate::model::Network>,
7247 {
7248 use std::iter::Iterator;
7249 self.networks = v.into_iter().map(|i| i.into()).collect();
7250 self
7251 }
7252
7253 /// Sets the value of [data_retention_deletion_events][crate::model::Finding::data_retention_deletion_events].
7254 ///
7255 /// # Example
7256 /// ```ignore,no_run
7257 /// # use google_cloud_securitycenter_v2::model::Finding;
7258 /// use google_cloud_securitycenter_v2::model::DataRetentionDeletionEvent;
7259 /// let x = Finding::new()
7260 /// .set_data_retention_deletion_events([
7261 /// DataRetentionDeletionEvent::default()/* use setters */,
7262 /// DataRetentionDeletionEvent::default()/* use (different) setters */,
7263 /// ]);
7264 /// ```
7265 pub fn set_data_retention_deletion_events<T, V>(mut self, v: T) -> Self
7266 where
7267 T: std::iter::IntoIterator<Item = V>,
7268 V: std::convert::Into<crate::model::DataRetentionDeletionEvent>,
7269 {
7270 use std::iter::Iterator;
7271 self.data_retention_deletion_events = v.into_iter().map(|i| i.into()).collect();
7272 self
7273 }
7274
7275 /// Sets the value of [affected_resources][crate::model::Finding::affected_resources].
7276 ///
7277 /// # Example
7278 /// ```ignore,no_run
7279 /// # use google_cloud_securitycenter_v2::model::Finding;
7280 /// use google_cloud_securitycenter_v2::model::AffectedResources;
7281 /// let x = Finding::new().set_affected_resources(AffectedResources::default()/* use setters */);
7282 /// ```
7283 pub fn set_affected_resources<T>(mut self, v: T) -> Self
7284 where
7285 T: std::convert::Into<crate::model::AffectedResources>,
7286 {
7287 self.affected_resources = std::option::Option::Some(v.into());
7288 self
7289 }
7290
7291 /// Sets or clears the value of [affected_resources][crate::model::Finding::affected_resources].
7292 ///
7293 /// # Example
7294 /// ```ignore,no_run
7295 /// # use google_cloud_securitycenter_v2::model::Finding;
7296 /// use google_cloud_securitycenter_v2::model::AffectedResources;
7297 /// let x = Finding::new().set_or_clear_affected_resources(Some(AffectedResources::default()/* use setters */));
7298 /// let x = Finding::new().set_or_clear_affected_resources(None::<AffectedResources>);
7299 /// ```
7300 pub fn set_or_clear_affected_resources<T>(mut self, v: std::option::Option<T>) -> Self
7301 where
7302 T: std::convert::Into<crate::model::AffectedResources>,
7303 {
7304 self.affected_resources = v.map(|x| x.into());
7305 self
7306 }
7307
7308 /// Sets the value of [ai_model][crate::model::Finding::ai_model].
7309 ///
7310 /// # Example
7311 /// ```ignore,no_run
7312 /// # use google_cloud_securitycenter_v2::model::Finding;
7313 /// use google_cloud_securitycenter_v2::model::AiModel;
7314 /// let x = Finding::new().set_ai_model(AiModel::default()/* use setters */);
7315 /// ```
7316 pub fn set_ai_model<T>(mut self, v: T) -> Self
7317 where
7318 T: std::convert::Into<crate::model::AiModel>,
7319 {
7320 self.ai_model = std::option::Option::Some(v.into());
7321 self
7322 }
7323
7324 /// Sets or clears the value of [ai_model][crate::model::Finding::ai_model].
7325 ///
7326 /// # Example
7327 /// ```ignore,no_run
7328 /// # use google_cloud_securitycenter_v2::model::Finding;
7329 /// use google_cloud_securitycenter_v2::model::AiModel;
7330 /// let x = Finding::new().set_or_clear_ai_model(Some(AiModel::default()/* use setters */));
7331 /// let x = Finding::new().set_or_clear_ai_model(None::<AiModel>);
7332 /// ```
7333 pub fn set_or_clear_ai_model<T>(mut self, v: std::option::Option<T>) -> Self
7334 where
7335 T: std::convert::Into<crate::model::AiModel>,
7336 {
7337 self.ai_model = v.map(|x| x.into());
7338 self
7339 }
7340
7341 /// Sets the value of [chokepoint][crate::model::Finding::chokepoint].
7342 ///
7343 /// # Example
7344 /// ```ignore,no_run
7345 /// # use google_cloud_securitycenter_v2::model::Finding;
7346 /// use google_cloud_securitycenter_v2::model::Chokepoint;
7347 /// let x = Finding::new().set_chokepoint(Chokepoint::default()/* use setters */);
7348 /// ```
7349 pub fn set_chokepoint<T>(mut self, v: T) -> Self
7350 where
7351 T: std::convert::Into<crate::model::Chokepoint>,
7352 {
7353 self.chokepoint = std::option::Option::Some(v.into());
7354 self
7355 }
7356
7357 /// Sets or clears the value of [chokepoint][crate::model::Finding::chokepoint].
7358 ///
7359 /// # Example
7360 /// ```ignore,no_run
7361 /// # use google_cloud_securitycenter_v2::model::Finding;
7362 /// use google_cloud_securitycenter_v2::model::Chokepoint;
7363 /// let x = Finding::new().set_or_clear_chokepoint(Some(Chokepoint::default()/* use setters */));
7364 /// let x = Finding::new().set_or_clear_chokepoint(None::<Chokepoint>);
7365 /// ```
7366 pub fn set_or_clear_chokepoint<T>(mut self, v: std::option::Option<T>) -> Self
7367 where
7368 T: std::convert::Into<crate::model::Chokepoint>,
7369 {
7370 self.chokepoint = v.map(|x| x.into());
7371 self
7372 }
7373
7374 /// Sets the value of [vertex_ai][crate::model::Finding::vertex_ai].
7375 ///
7376 /// # Example
7377 /// ```ignore,no_run
7378 /// # use google_cloud_securitycenter_v2::model::Finding;
7379 /// use google_cloud_securitycenter_v2::model::VertexAi;
7380 /// let x = Finding::new().set_vertex_ai(VertexAi::default()/* use setters */);
7381 /// ```
7382 pub fn set_vertex_ai<T>(mut self, v: T) -> Self
7383 where
7384 T: std::convert::Into<crate::model::VertexAi>,
7385 {
7386 self.vertex_ai = std::option::Option::Some(v.into());
7387 self
7388 }
7389
7390 /// Sets or clears the value of [vertex_ai][crate::model::Finding::vertex_ai].
7391 ///
7392 /// # Example
7393 /// ```ignore,no_run
7394 /// # use google_cloud_securitycenter_v2::model::Finding;
7395 /// use google_cloud_securitycenter_v2::model::VertexAi;
7396 /// let x = Finding::new().set_or_clear_vertex_ai(Some(VertexAi::default()/* use setters */));
7397 /// let x = Finding::new().set_or_clear_vertex_ai(None::<VertexAi>);
7398 /// ```
7399 pub fn set_or_clear_vertex_ai<T>(mut self, v: std::option::Option<T>) -> Self
7400 where
7401 T: std::convert::Into<crate::model::VertexAi>,
7402 {
7403 self.vertex_ai = v.map(|x| x.into());
7404 self
7405 }
7406}
7407
7408impl wkt::message::Message for Finding {
7409 fn typename() -> &'static str {
7410 "type.googleapis.com/google.cloud.securitycenter.v2.Finding"
7411 }
7412}
7413
7414/// Defines additional types related to [Finding].
7415pub mod finding {
7416 #[allow(unused_imports)]
7417 use super::*;
7418
7419 /// Mute information about the finding, including whether the finding has a
7420 /// static mute or any matching dynamic mute rules.
7421 #[derive(Clone, Default, PartialEq)]
7422 #[non_exhaustive]
7423 pub struct MuteInfo {
7424 /// If set, the static mute applied to this finding. Static mutes override
7425 /// dynamic mutes. If unset, there is no static mute.
7426 pub static_mute: std::option::Option<crate::model::finding::mute_info::StaticMute>,
7427
7428 /// The list of dynamic mute rules that currently match the finding.
7429 pub dynamic_mute_records:
7430 std::vec::Vec<crate::model::finding::mute_info::DynamicMuteRecord>,
7431
7432 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7433 }
7434
7435 impl MuteInfo {
7436 /// Creates a new default instance.
7437 pub fn new() -> Self {
7438 std::default::Default::default()
7439 }
7440
7441 /// Sets the value of [static_mute][crate::model::finding::MuteInfo::static_mute].
7442 ///
7443 /// # Example
7444 /// ```ignore,no_run
7445 /// # use google_cloud_securitycenter_v2::model::finding::MuteInfo;
7446 /// use google_cloud_securitycenter_v2::model::finding::mute_info::StaticMute;
7447 /// let x = MuteInfo::new().set_static_mute(StaticMute::default()/* use setters */);
7448 /// ```
7449 pub fn set_static_mute<T>(mut self, v: T) -> Self
7450 where
7451 T: std::convert::Into<crate::model::finding::mute_info::StaticMute>,
7452 {
7453 self.static_mute = std::option::Option::Some(v.into());
7454 self
7455 }
7456
7457 /// Sets or clears the value of [static_mute][crate::model::finding::MuteInfo::static_mute].
7458 ///
7459 /// # Example
7460 /// ```ignore,no_run
7461 /// # use google_cloud_securitycenter_v2::model::finding::MuteInfo;
7462 /// use google_cloud_securitycenter_v2::model::finding::mute_info::StaticMute;
7463 /// let x = MuteInfo::new().set_or_clear_static_mute(Some(StaticMute::default()/* use setters */));
7464 /// let x = MuteInfo::new().set_or_clear_static_mute(None::<StaticMute>);
7465 /// ```
7466 pub fn set_or_clear_static_mute<T>(mut self, v: std::option::Option<T>) -> Self
7467 where
7468 T: std::convert::Into<crate::model::finding::mute_info::StaticMute>,
7469 {
7470 self.static_mute = v.map(|x| x.into());
7471 self
7472 }
7473
7474 /// Sets the value of [dynamic_mute_records][crate::model::finding::MuteInfo::dynamic_mute_records].
7475 ///
7476 /// # Example
7477 /// ```ignore,no_run
7478 /// # use google_cloud_securitycenter_v2::model::finding::MuteInfo;
7479 /// use google_cloud_securitycenter_v2::model::finding::mute_info::DynamicMuteRecord;
7480 /// let x = MuteInfo::new()
7481 /// .set_dynamic_mute_records([
7482 /// DynamicMuteRecord::default()/* use setters */,
7483 /// DynamicMuteRecord::default()/* use (different) setters */,
7484 /// ]);
7485 /// ```
7486 pub fn set_dynamic_mute_records<T, V>(mut self, v: T) -> Self
7487 where
7488 T: std::iter::IntoIterator<Item = V>,
7489 V: std::convert::Into<crate::model::finding::mute_info::DynamicMuteRecord>,
7490 {
7491 use std::iter::Iterator;
7492 self.dynamic_mute_records = v.into_iter().map(|i| i.into()).collect();
7493 self
7494 }
7495 }
7496
7497 impl wkt::message::Message for MuteInfo {
7498 fn typename() -> &'static str {
7499 "type.googleapis.com/google.cloud.securitycenter.v2.Finding.MuteInfo"
7500 }
7501 }
7502
7503 /// Defines additional types related to [MuteInfo].
7504 pub mod mute_info {
7505 #[allow(unused_imports)]
7506 use super::*;
7507
7508 /// Information about the static mute state. A static mute state overrides
7509 /// any dynamic mute rules that apply to this finding. The static mute state
7510 /// can be set by a static mute rule or by muting the finding directly.
7511 #[derive(Clone, Default, PartialEq)]
7512 #[non_exhaustive]
7513 pub struct StaticMute {
7514 /// The static mute state. If the value is `MUTED` or `UNMUTED`, then the
7515 /// finding's overall mute state will have the same value.
7516 pub state: crate::model::finding::Mute,
7517
7518 /// When the static mute was applied.
7519 pub apply_time: std::option::Option<wkt::Timestamp>,
7520
7521 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7522 }
7523
7524 impl StaticMute {
7525 /// Creates a new default instance.
7526 pub fn new() -> Self {
7527 std::default::Default::default()
7528 }
7529
7530 /// Sets the value of [state][crate::model::finding::mute_info::StaticMute::state].
7531 ///
7532 /// # Example
7533 /// ```ignore,no_run
7534 /// # use google_cloud_securitycenter_v2::model::finding::mute_info::StaticMute;
7535 /// use google_cloud_securitycenter_v2::model::finding::Mute;
7536 /// let x0 = StaticMute::new().set_state(Mute::Muted);
7537 /// let x1 = StaticMute::new().set_state(Mute::Unmuted);
7538 /// let x2 = StaticMute::new().set_state(Mute::Undefined);
7539 /// ```
7540 pub fn set_state<T: std::convert::Into<crate::model::finding::Mute>>(
7541 mut self,
7542 v: T,
7543 ) -> Self {
7544 self.state = v.into();
7545 self
7546 }
7547
7548 /// Sets the value of [apply_time][crate::model::finding::mute_info::StaticMute::apply_time].
7549 ///
7550 /// # Example
7551 /// ```ignore,no_run
7552 /// # use google_cloud_securitycenter_v2::model::finding::mute_info::StaticMute;
7553 /// use wkt::Timestamp;
7554 /// let x = StaticMute::new().set_apply_time(Timestamp::default()/* use setters */);
7555 /// ```
7556 pub fn set_apply_time<T>(mut self, v: T) -> Self
7557 where
7558 T: std::convert::Into<wkt::Timestamp>,
7559 {
7560 self.apply_time = std::option::Option::Some(v.into());
7561 self
7562 }
7563
7564 /// Sets or clears the value of [apply_time][crate::model::finding::mute_info::StaticMute::apply_time].
7565 ///
7566 /// # Example
7567 /// ```ignore,no_run
7568 /// # use google_cloud_securitycenter_v2::model::finding::mute_info::StaticMute;
7569 /// use wkt::Timestamp;
7570 /// let x = StaticMute::new().set_or_clear_apply_time(Some(Timestamp::default()/* use setters */));
7571 /// let x = StaticMute::new().set_or_clear_apply_time(None::<Timestamp>);
7572 /// ```
7573 pub fn set_or_clear_apply_time<T>(mut self, v: std::option::Option<T>) -> Self
7574 where
7575 T: std::convert::Into<wkt::Timestamp>,
7576 {
7577 self.apply_time = v.map(|x| x.into());
7578 self
7579 }
7580 }
7581
7582 impl wkt::message::Message for StaticMute {
7583 fn typename() -> &'static str {
7584 "type.googleapis.com/google.cloud.securitycenter.v2.Finding.MuteInfo.StaticMute"
7585 }
7586 }
7587
7588 /// The record of a dynamic mute rule that matches the finding.
7589 #[derive(Clone, Default, PartialEq)]
7590 #[non_exhaustive]
7591 pub struct DynamicMuteRecord {
7592 /// The relative resource name of the mute rule, represented by a mute
7593 /// config, that created this record, for example
7594 /// `organizations/123/muteConfigs/mymuteconfig` or
7595 /// `organizations/123/locations/global/muteConfigs/mymuteconfig`.
7596 pub mute_config: std::string::String,
7597
7598 /// When the dynamic mute rule first matched the finding.
7599 pub match_time: std::option::Option<wkt::Timestamp>,
7600
7601 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7602 }
7603
7604 impl DynamicMuteRecord {
7605 /// Creates a new default instance.
7606 pub fn new() -> Self {
7607 std::default::Default::default()
7608 }
7609
7610 /// Sets the value of [mute_config][crate::model::finding::mute_info::DynamicMuteRecord::mute_config].
7611 ///
7612 /// # Example
7613 /// ```ignore,no_run
7614 /// # use google_cloud_securitycenter_v2::model::finding::mute_info::DynamicMuteRecord;
7615 /// let x = DynamicMuteRecord::new().set_mute_config("example");
7616 /// ```
7617 pub fn set_mute_config<T: std::convert::Into<std::string::String>>(
7618 mut self,
7619 v: T,
7620 ) -> Self {
7621 self.mute_config = v.into();
7622 self
7623 }
7624
7625 /// Sets the value of [match_time][crate::model::finding::mute_info::DynamicMuteRecord::match_time].
7626 ///
7627 /// # Example
7628 /// ```ignore,no_run
7629 /// # use google_cloud_securitycenter_v2::model::finding::mute_info::DynamicMuteRecord;
7630 /// use wkt::Timestamp;
7631 /// let x = DynamicMuteRecord::new().set_match_time(Timestamp::default()/* use setters */);
7632 /// ```
7633 pub fn set_match_time<T>(mut self, v: T) -> Self
7634 where
7635 T: std::convert::Into<wkt::Timestamp>,
7636 {
7637 self.match_time = std::option::Option::Some(v.into());
7638 self
7639 }
7640
7641 /// Sets or clears the value of [match_time][crate::model::finding::mute_info::DynamicMuteRecord::match_time].
7642 ///
7643 /// # Example
7644 /// ```ignore,no_run
7645 /// # use google_cloud_securitycenter_v2::model::finding::mute_info::DynamicMuteRecord;
7646 /// use wkt::Timestamp;
7647 /// let x = DynamicMuteRecord::new().set_or_clear_match_time(Some(Timestamp::default()/* use setters */));
7648 /// let x = DynamicMuteRecord::new().set_or_clear_match_time(None::<Timestamp>);
7649 /// ```
7650 pub fn set_or_clear_match_time<T>(mut self, v: std::option::Option<T>) -> Self
7651 where
7652 T: std::convert::Into<wkt::Timestamp>,
7653 {
7654 self.match_time = v.map(|x| x.into());
7655 self
7656 }
7657 }
7658
7659 impl wkt::message::Message for DynamicMuteRecord {
7660 fn typename() -> &'static str {
7661 "type.googleapis.com/google.cloud.securitycenter.v2.Finding.MuteInfo.DynamicMuteRecord"
7662 }
7663 }
7664 }
7665
7666 /// The state of the finding.
7667 ///
7668 /// # Working with unknown values
7669 ///
7670 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7671 /// additional enum variants at any time. Adding new variants is not considered
7672 /// a breaking change. Applications should write their code in anticipation of:
7673 ///
7674 /// - New values appearing in future releases of the client library, **and**
7675 /// - New values received dynamically, without application changes.
7676 ///
7677 /// Please consult the [Working with enums] section in the user guide for some
7678 /// guidelines.
7679 ///
7680 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7681 #[derive(Clone, Debug, PartialEq)]
7682 #[non_exhaustive]
7683 pub enum State {
7684 /// Unspecified state.
7685 Unspecified,
7686 /// The finding requires attention and has not been addressed yet.
7687 Active,
7688 /// The finding has been fixed, triaged as a non-issue or otherwise addressed
7689 /// and is no longer active.
7690 Inactive,
7691 /// If set, the enum was initialized with an unknown value.
7692 ///
7693 /// Applications can examine the value using [State::value] or
7694 /// [State::name].
7695 UnknownValue(state::UnknownValue),
7696 }
7697
7698 #[doc(hidden)]
7699 pub mod state {
7700 #[allow(unused_imports)]
7701 use super::*;
7702 #[derive(Clone, Debug, PartialEq)]
7703 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7704 }
7705
7706 impl State {
7707 /// Gets the enum value.
7708 ///
7709 /// Returns `None` if the enum contains an unknown value deserialized from
7710 /// the string representation of enums.
7711 pub fn value(&self) -> std::option::Option<i32> {
7712 match self {
7713 Self::Unspecified => std::option::Option::Some(0),
7714 Self::Active => std::option::Option::Some(1),
7715 Self::Inactive => std::option::Option::Some(2),
7716 Self::UnknownValue(u) => u.0.value(),
7717 }
7718 }
7719
7720 /// Gets the enum value as a string.
7721 ///
7722 /// Returns `None` if the enum contains an unknown value deserialized from
7723 /// the integer representation of enums.
7724 pub fn name(&self) -> std::option::Option<&str> {
7725 match self {
7726 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
7727 Self::Active => std::option::Option::Some("ACTIVE"),
7728 Self::Inactive => std::option::Option::Some("INACTIVE"),
7729 Self::UnknownValue(u) => u.0.name(),
7730 }
7731 }
7732 }
7733
7734 impl std::default::Default for State {
7735 fn default() -> Self {
7736 use std::convert::From;
7737 Self::from(0)
7738 }
7739 }
7740
7741 impl std::fmt::Display for State {
7742 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7743 wkt::internal::display_enum(f, self.name(), self.value())
7744 }
7745 }
7746
7747 impl std::convert::From<i32> for State {
7748 fn from(value: i32) -> Self {
7749 match value {
7750 0 => Self::Unspecified,
7751 1 => Self::Active,
7752 2 => Self::Inactive,
7753 _ => Self::UnknownValue(state::UnknownValue(
7754 wkt::internal::UnknownEnumValue::Integer(value),
7755 )),
7756 }
7757 }
7758 }
7759
7760 impl std::convert::From<&str> for State {
7761 fn from(value: &str) -> Self {
7762 use std::string::ToString;
7763 match value {
7764 "STATE_UNSPECIFIED" => Self::Unspecified,
7765 "ACTIVE" => Self::Active,
7766 "INACTIVE" => Self::Inactive,
7767 _ => Self::UnknownValue(state::UnknownValue(
7768 wkt::internal::UnknownEnumValue::String(value.to_string()),
7769 )),
7770 }
7771 }
7772 }
7773
7774 impl serde::ser::Serialize for State {
7775 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7776 where
7777 S: serde::Serializer,
7778 {
7779 match self {
7780 Self::Unspecified => serializer.serialize_i32(0),
7781 Self::Active => serializer.serialize_i32(1),
7782 Self::Inactive => serializer.serialize_i32(2),
7783 Self::UnknownValue(u) => u.0.serialize(serializer),
7784 }
7785 }
7786 }
7787
7788 impl<'de> serde::de::Deserialize<'de> for State {
7789 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7790 where
7791 D: serde::Deserializer<'de>,
7792 {
7793 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
7794 ".google.cloud.securitycenter.v2.Finding.State",
7795 ))
7796 }
7797 }
7798
7799 /// The severity of the finding.
7800 ///
7801 /// # Working with unknown values
7802 ///
7803 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7804 /// additional enum variants at any time. Adding new variants is not considered
7805 /// a breaking change. Applications should write their code in anticipation of:
7806 ///
7807 /// - New values appearing in future releases of the client library, **and**
7808 /// - New values received dynamically, without application changes.
7809 ///
7810 /// Please consult the [Working with enums] section in the user guide for some
7811 /// guidelines.
7812 ///
7813 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7814 #[derive(Clone, Debug, PartialEq)]
7815 #[non_exhaustive]
7816 pub enum Severity {
7817 /// This value is used for findings when a source doesn't write a severity
7818 /// value.
7819 Unspecified,
7820 /// Vulnerability:
7821 /// A critical vulnerability is easily discoverable by an external actor,
7822 /// exploitable, and results in the direct ability to execute arbitrary code,
7823 /// exfiltrate data, and otherwise gain additional access and privileges to
7824 /// cloud resources and workloads. Examples include publicly accessible
7825 /// unprotected user data and public SSH access with weak or no
7826 /// passwords.
7827 ///
7828 /// Threat:
7829 /// Indicates a threat that is able to access, modify, or delete data or
7830 /// execute unauthorized code within existing resources.
7831 Critical,
7832 /// Vulnerability:
7833 /// A high risk vulnerability can be easily discovered and exploited in
7834 /// combination with other vulnerabilities in order to gain direct access and
7835 /// the ability to execute arbitrary code, exfiltrate data, and otherwise
7836 /// gain additional access and privileges to cloud resources and workloads.
7837 /// An example is a database with weak or no passwords that is only
7838 /// accessible internally. This database could easily be compromised by an
7839 /// actor that had access to the internal network.
7840 ///
7841 /// Threat:
7842 /// Indicates a threat that is able to create new computational resources in
7843 /// an environment but not able to access data or execute code in existing
7844 /// resources.
7845 High,
7846 /// Vulnerability:
7847 /// A medium risk vulnerability could be used by an actor to gain access to
7848 /// resources or privileges that enable them to eventually (through multiple
7849 /// steps or a complex exploit) gain access and the ability to execute
7850 /// arbitrary code or exfiltrate data. An example is a service account with
7851 /// access to more projects than it should have. If an actor gains access to
7852 /// the service account, they could potentially use that access to manipulate
7853 /// a project the service account was not intended to.
7854 ///
7855 /// Threat:
7856 /// Indicates a threat that is able to cause operational impact but may not
7857 /// access data or execute unauthorized code.
7858 Medium,
7859 /// Vulnerability:
7860 /// A low risk vulnerability hampers a security organization's ability to
7861 /// detect vulnerabilities or active threats in their deployment, or prevents
7862 /// the root cause investigation of security issues. An example is monitoring
7863 /// and logs being disabled for resource configurations and access.
7864 ///
7865 /// Threat:
7866 /// Indicates a threat that has obtained minimal access to an environment but
7867 /// is not able to access data, execute code, or create resources.
7868 Low,
7869 /// If set, the enum was initialized with an unknown value.
7870 ///
7871 /// Applications can examine the value using [Severity::value] or
7872 /// [Severity::name].
7873 UnknownValue(severity::UnknownValue),
7874 }
7875
7876 #[doc(hidden)]
7877 pub mod severity {
7878 #[allow(unused_imports)]
7879 use super::*;
7880 #[derive(Clone, Debug, PartialEq)]
7881 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7882 }
7883
7884 impl Severity {
7885 /// Gets the enum value.
7886 ///
7887 /// Returns `None` if the enum contains an unknown value deserialized from
7888 /// the string representation of enums.
7889 pub fn value(&self) -> std::option::Option<i32> {
7890 match self {
7891 Self::Unspecified => std::option::Option::Some(0),
7892 Self::Critical => std::option::Option::Some(1),
7893 Self::High => std::option::Option::Some(2),
7894 Self::Medium => std::option::Option::Some(3),
7895 Self::Low => std::option::Option::Some(4),
7896 Self::UnknownValue(u) => u.0.value(),
7897 }
7898 }
7899
7900 /// Gets the enum value as a string.
7901 ///
7902 /// Returns `None` if the enum contains an unknown value deserialized from
7903 /// the integer representation of enums.
7904 pub fn name(&self) -> std::option::Option<&str> {
7905 match self {
7906 Self::Unspecified => std::option::Option::Some("SEVERITY_UNSPECIFIED"),
7907 Self::Critical => std::option::Option::Some("CRITICAL"),
7908 Self::High => std::option::Option::Some("HIGH"),
7909 Self::Medium => std::option::Option::Some("MEDIUM"),
7910 Self::Low => std::option::Option::Some("LOW"),
7911 Self::UnknownValue(u) => u.0.name(),
7912 }
7913 }
7914 }
7915
7916 impl std::default::Default for Severity {
7917 fn default() -> Self {
7918 use std::convert::From;
7919 Self::from(0)
7920 }
7921 }
7922
7923 impl std::fmt::Display for Severity {
7924 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7925 wkt::internal::display_enum(f, self.name(), self.value())
7926 }
7927 }
7928
7929 impl std::convert::From<i32> for Severity {
7930 fn from(value: i32) -> Self {
7931 match value {
7932 0 => Self::Unspecified,
7933 1 => Self::Critical,
7934 2 => Self::High,
7935 3 => Self::Medium,
7936 4 => Self::Low,
7937 _ => Self::UnknownValue(severity::UnknownValue(
7938 wkt::internal::UnknownEnumValue::Integer(value),
7939 )),
7940 }
7941 }
7942 }
7943
7944 impl std::convert::From<&str> for Severity {
7945 fn from(value: &str) -> Self {
7946 use std::string::ToString;
7947 match value {
7948 "SEVERITY_UNSPECIFIED" => Self::Unspecified,
7949 "CRITICAL" => Self::Critical,
7950 "HIGH" => Self::High,
7951 "MEDIUM" => Self::Medium,
7952 "LOW" => Self::Low,
7953 _ => Self::UnknownValue(severity::UnknownValue(
7954 wkt::internal::UnknownEnumValue::String(value.to_string()),
7955 )),
7956 }
7957 }
7958 }
7959
7960 impl serde::ser::Serialize for Severity {
7961 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7962 where
7963 S: serde::Serializer,
7964 {
7965 match self {
7966 Self::Unspecified => serializer.serialize_i32(0),
7967 Self::Critical => serializer.serialize_i32(1),
7968 Self::High => serializer.serialize_i32(2),
7969 Self::Medium => serializer.serialize_i32(3),
7970 Self::Low => serializer.serialize_i32(4),
7971 Self::UnknownValue(u) => u.0.serialize(serializer),
7972 }
7973 }
7974 }
7975
7976 impl<'de> serde::de::Deserialize<'de> for Severity {
7977 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7978 where
7979 D: serde::Deserializer<'de>,
7980 {
7981 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Severity>::new(
7982 ".google.cloud.securitycenter.v2.Finding.Severity",
7983 ))
7984 }
7985 }
7986
7987 /// Mute state a finding can be in.
7988 ///
7989 /// # Working with unknown values
7990 ///
7991 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7992 /// additional enum variants at any time. Adding new variants is not considered
7993 /// a breaking change. Applications should write their code in anticipation of:
7994 ///
7995 /// - New values appearing in future releases of the client library, **and**
7996 /// - New values received dynamically, without application changes.
7997 ///
7998 /// Please consult the [Working with enums] section in the user guide for some
7999 /// guidelines.
8000 ///
8001 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8002 #[derive(Clone, Debug, PartialEq)]
8003 #[non_exhaustive]
8004 pub enum Mute {
8005 /// Unspecified.
8006 Unspecified,
8007 /// Finding has been muted.
8008 Muted,
8009 /// Finding has been unmuted.
8010 Unmuted,
8011 /// Finding has never been muted/unmuted.
8012 Undefined,
8013 /// If set, the enum was initialized with an unknown value.
8014 ///
8015 /// Applications can examine the value using [Mute::value] or
8016 /// [Mute::name].
8017 UnknownValue(mute::UnknownValue),
8018 }
8019
8020 #[doc(hidden)]
8021 pub mod mute {
8022 #[allow(unused_imports)]
8023 use super::*;
8024 #[derive(Clone, Debug, PartialEq)]
8025 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8026 }
8027
8028 impl Mute {
8029 /// Gets the enum value.
8030 ///
8031 /// Returns `None` if the enum contains an unknown value deserialized from
8032 /// the string representation of enums.
8033 pub fn value(&self) -> std::option::Option<i32> {
8034 match self {
8035 Self::Unspecified => std::option::Option::Some(0),
8036 Self::Muted => std::option::Option::Some(1),
8037 Self::Unmuted => std::option::Option::Some(2),
8038 Self::Undefined => std::option::Option::Some(3),
8039 Self::UnknownValue(u) => u.0.value(),
8040 }
8041 }
8042
8043 /// Gets the enum value as a string.
8044 ///
8045 /// Returns `None` if the enum contains an unknown value deserialized from
8046 /// the integer representation of enums.
8047 pub fn name(&self) -> std::option::Option<&str> {
8048 match self {
8049 Self::Unspecified => std::option::Option::Some("MUTE_UNSPECIFIED"),
8050 Self::Muted => std::option::Option::Some("MUTED"),
8051 Self::Unmuted => std::option::Option::Some("UNMUTED"),
8052 Self::Undefined => std::option::Option::Some("UNDEFINED"),
8053 Self::UnknownValue(u) => u.0.name(),
8054 }
8055 }
8056 }
8057
8058 impl std::default::Default for Mute {
8059 fn default() -> Self {
8060 use std::convert::From;
8061 Self::from(0)
8062 }
8063 }
8064
8065 impl std::fmt::Display for Mute {
8066 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8067 wkt::internal::display_enum(f, self.name(), self.value())
8068 }
8069 }
8070
8071 impl std::convert::From<i32> for Mute {
8072 fn from(value: i32) -> Self {
8073 match value {
8074 0 => Self::Unspecified,
8075 1 => Self::Muted,
8076 2 => Self::Unmuted,
8077 3 => Self::Undefined,
8078 _ => Self::UnknownValue(mute::UnknownValue(
8079 wkt::internal::UnknownEnumValue::Integer(value),
8080 )),
8081 }
8082 }
8083 }
8084
8085 impl std::convert::From<&str> for Mute {
8086 fn from(value: &str) -> Self {
8087 use std::string::ToString;
8088 match value {
8089 "MUTE_UNSPECIFIED" => Self::Unspecified,
8090 "MUTED" => Self::Muted,
8091 "UNMUTED" => Self::Unmuted,
8092 "UNDEFINED" => Self::Undefined,
8093 _ => Self::UnknownValue(mute::UnknownValue(
8094 wkt::internal::UnknownEnumValue::String(value.to_string()),
8095 )),
8096 }
8097 }
8098 }
8099
8100 impl serde::ser::Serialize for Mute {
8101 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8102 where
8103 S: serde::Serializer,
8104 {
8105 match self {
8106 Self::Unspecified => serializer.serialize_i32(0),
8107 Self::Muted => serializer.serialize_i32(1),
8108 Self::Unmuted => serializer.serialize_i32(2),
8109 Self::Undefined => serializer.serialize_i32(3),
8110 Self::UnknownValue(u) => u.0.serialize(serializer),
8111 }
8112 }
8113 }
8114
8115 impl<'de> serde::de::Deserialize<'de> for Mute {
8116 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8117 where
8118 D: serde::Deserializer<'de>,
8119 {
8120 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mute>::new(
8121 ".google.cloud.securitycenter.v2.Finding.Mute",
8122 ))
8123 }
8124 }
8125
8126 /// Represents what kind of Finding it is.
8127 ///
8128 /// # Working with unknown values
8129 ///
8130 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8131 /// additional enum variants at any time. Adding new variants is not considered
8132 /// a breaking change. Applications should write their code in anticipation of:
8133 ///
8134 /// - New values appearing in future releases of the client library, **and**
8135 /// - New values received dynamically, without application changes.
8136 ///
8137 /// Please consult the [Working with enums] section in the user guide for some
8138 /// guidelines.
8139 ///
8140 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8141 #[derive(Clone, Debug, PartialEq)]
8142 #[non_exhaustive]
8143 pub enum FindingClass {
8144 /// Unspecified finding class.
8145 Unspecified,
8146 /// Describes unwanted or malicious activity.
8147 Threat,
8148 /// Describes a potential weakness in software that increases risk to
8149 /// Confidentiality & Integrity & Availability.
8150 Vulnerability,
8151 /// Describes a potential weakness in cloud resource/asset configuration that
8152 /// increases risk.
8153 Misconfiguration,
8154 /// Describes a security observation that is for informational purposes.
8155 Observation,
8156 /// Describes an error that prevents some SCC functionality.
8157 SccError,
8158 /// Describes a potential security risk due to a change in the security
8159 /// posture.
8160 PostureViolation,
8161 /// Describes a combination of security issues that represent a more severe
8162 /// security problem when taken together.
8163 ToxicCombination,
8164 /// Describes a potential security risk to data assets that contain sensitive
8165 /// data.
8166 SensitiveDataRisk,
8167 /// Describes a resource or resource group where high risk attack paths
8168 /// converge, based on attack path simulations (APS).
8169 Chokepoint,
8170 /// If set, the enum was initialized with an unknown value.
8171 ///
8172 /// Applications can examine the value using [FindingClass::value] or
8173 /// [FindingClass::name].
8174 UnknownValue(finding_class::UnknownValue),
8175 }
8176
8177 #[doc(hidden)]
8178 pub mod finding_class {
8179 #[allow(unused_imports)]
8180 use super::*;
8181 #[derive(Clone, Debug, PartialEq)]
8182 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8183 }
8184
8185 impl FindingClass {
8186 /// Gets the enum value.
8187 ///
8188 /// Returns `None` if the enum contains an unknown value deserialized from
8189 /// the string representation of enums.
8190 pub fn value(&self) -> std::option::Option<i32> {
8191 match self {
8192 Self::Unspecified => std::option::Option::Some(0),
8193 Self::Threat => std::option::Option::Some(1),
8194 Self::Vulnerability => std::option::Option::Some(2),
8195 Self::Misconfiguration => std::option::Option::Some(3),
8196 Self::Observation => std::option::Option::Some(4),
8197 Self::SccError => std::option::Option::Some(5),
8198 Self::PostureViolation => std::option::Option::Some(6),
8199 Self::ToxicCombination => std::option::Option::Some(7),
8200 Self::SensitiveDataRisk => std::option::Option::Some(8),
8201 Self::Chokepoint => std::option::Option::Some(9),
8202 Self::UnknownValue(u) => u.0.value(),
8203 }
8204 }
8205
8206 /// Gets the enum value as a string.
8207 ///
8208 /// Returns `None` if the enum contains an unknown value deserialized from
8209 /// the integer representation of enums.
8210 pub fn name(&self) -> std::option::Option<&str> {
8211 match self {
8212 Self::Unspecified => std::option::Option::Some("FINDING_CLASS_UNSPECIFIED"),
8213 Self::Threat => std::option::Option::Some("THREAT"),
8214 Self::Vulnerability => std::option::Option::Some("VULNERABILITY"),
8215 Self::Misconfiguration => std::option::Option::Some("MISCONFIGURATION"),
8216 Self::Observation => std::option::Option::Some("OBSERVATION"),
8217 Self::SccError => std::option::Option::Some("SCC_ERROR"),
8218 Self::PostureViolation => std::option::Option::Some("POSTURE_VIOLATION"),
8219 Self::ToxicCombination => std::option::Option::Some("TOXIC_COMBINATION"),
8220 Self::SensitiveDataRisk => std::option::Option::Some("SENSITIVE_DATA_RISK"),
8221 Self::Chokepoint => std::option::Option::Some("CHOKEPOINT"),
8222 Self::UnknownValue(u) => u.0.name(),
8223 }
8224 }
8225 }
8226
8227 impl std::default::Default for FindingClass {
8228 fn default() -> Self {
8229 use std::convert::From;
8230 Self::from(0)
8231 }
8232 }
8233
8234 impl std::fmt::Display for FindingClass {
8235 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8236 wkt::internal::display_enum(f, self.name(), self.value())
8237 }
8238 }
8239
8240 impl std::convert::From<i32> for FindingClass {
8241 fn from(value: i32) -> Self {
8242 match value {
8243 0 => Self::Unspecified,
8244 1 => Self::Threat,
8245 2 => Self::Vulnerability,
8246 3 => Self::Misconfiguration,
8247 4 => Self::Observation,
8248 5 => Self::SccError,
8249 6 => Self::PostureViolation,
8250 7 => Self::ToxicCombination,
8251 8 => Self::SensitiveDataRisk,
8252 9 => Self::Chokepoint,
8253 _ => Self::UnknownValue(finding_class::UnknownValue(
8254 wkt::internal::UnknownEnumValue::Integer(value),
8255 )),
8256 }
8257 }
8258 }
8259
8260 impl std::convert::From<&str> for FindingClass {
8261 fn from(value: &str) -> Self {
8262 use std::string::ToString;
8263 match value {
8264 "FINDING_CLASS_UNSPECIFIED" => Self::Unspecified,
8265 "THREAT" => Self::Threat,
8266 "VULNERABILITY" => Self::Vulnerability,
8267 "MISCONFIGURATION" => Self::Misconfiguration,
8268 "OBSERVATION" => Self::Observation,
8269 "SCC_ERROR" => Self::SccError,
8270 "POSTURE_VIOLATION" => Self::PostureViolation,
8271 "TOXIC_COMBINATION" => Self::ToxicCombination,
8272 "SENSITIVE_DATA_RISK" => Self::SensitiveDataRisk,
8273 "CHOKEPOINT" => Self::Chokepoint,
8274 _ => Self::UnknownValue(finding_class::UnknownValue(
8275 wkt::internal::UnknownEnumValue::String(value.to_string()),
8276 )),
8277 }
8278 }
8279 }
8280
8281 impl serde::ser::Serialize for FindingClass {
8282 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8283 where
8284 S: serde::Serializer,
8285 {
8286 match self {
8287 Self::Unspecified => serializer.serialize_i32(0),
8288 Self::Threat => serializer.serialize_i32(1),
8289 Self::Vulnerability => serializer.serialize_i32(2),
8290 Self::Misconfiguration => serializer.serialize_i32(3),
8291 Self::Observation => serializer.serialize_i32(4),
8292 Self::SccError => serializer.serialize_i32(5),
8293 Self::PostureViolation => serializer.serialize_i32(6),
8294 Self::ToxicCombination => serializer.serialize_i32(7),
8295 Self::SensitiveDataRisk => serializer.serialize_i32(8),
8296 Self::Chokepoint => serializer.serialize_i32(9),
8297 Self::UnknownValue(u) => u.0.serialize(serializer),
8298 }
8299 }
8300 }
8301
8302 impl<'de> serde::de::Deserialize<'de> for FindingClass {
8303 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8304 where
8305 D: serde::Deserializer<'de>,
8306 {
8307 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FindingClass>::new(
8308 ".google.cloud.securitycenter.v2.Finding.FindingClass",
8309 ))
8310 }
8311 }
8312}
8313
8314/// Message that contains the resource name and display name of a folder
8315/// resource.
8316#[derive(Clone, Default, PartialEq)]
8317#[non_exhaustive]
8318pub struct Folder {
8319 /// Full resource name of this folder. See:
8320 /// <https://cloud.google.com/apis/design/resource_names#full_resource_name>
8321 pub resource_folder: std::string::String,
8322
8323 /// The user defined display name for this folder.
8324 pub resource_folder_display_name: std::string::String,
8325
8326 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8327}
8328
8329impl Folder {
8330 /// Creates a new default instance.
8331 pub fn new() -> Self {
8332 std::default::Default::default()
8333 }
8334
8335 /// Sets the value of [resource_folder][crate::model::Folder::resource_folder].
8336 ///
8337 /// # Example
8338 /// ```ignore,no_run
8339 /// # use google_cloud_securitycenter_v2::model::Folder;
8340 /// let x = Folder::new().set_resource_folder("example");
8341 /// ```
8342 pub fn set_resource_folder<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8343 self.resource_folder = v.into();
8344 self
8345 }
8346
8347 /// Sets the value of [resource_folder_display_name][crate::model::Folder::resource_folder_display_name].
8348 ///
8349 /// # Example
8350 /// ```ignore,no_run
8351 /// # use google_cloud_securitycenter_v2::model::Folder;
8352 /// let x = Folder::new().set_resource_folder_display_name("example");
8353 /// ```
8354 pub fn set_resource_folder_display_name<T: std::convert::Into<std::string::String>>(
8355 mut self,
8356 v: T,
8357 ) -> Self {
8358 self.resource_folder_display_name = v.into();
8359 self
8360 }
8361}
8362
8363impl wkt::message::Message for Folder {
8364 fn typename() -> &'static str {
8365 "type.googleapis.com/google.cloud.securitycenter.v2.Folder"
8366 }
8367}
8368
8369/// Contains details about groups of which this finding is a member. A group is a
8370/// collection of findings that are related in some way.
8371#[derive(Clone, Default, PartialEq)]
8372#[non_exhaustive]
8373pub struct GroupMembership {
8374 /// Type of group.
8375 pub group_type: crate::model::group_membership::GroupType,
8376
8377 /// ID of the group.
8378 pub group_id: std::string::String,
8379
8380 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8381}
8382
8383impl GroupMembership {
8384 /// Creates a new default instance.
8385 pub fn new() -> Self {
8386 std::default::Default::default()
8387 }
8388
8389 /// Sets the value of [group_type][crate::model::GroupMembership::group_type].
8390 ///
8391 /// # Example
8392 /// ```ignore,no_run
8393 /// # use google_cloud_securitycenter_v2::model::GroupMembership;
8394 /// use google_cloud_securitycenter_v2::model::group_membership::GroupType;
8395 /// let x0 = GroupMembership::new().set_group_type(GroupType::ToxicCombination);
8396 /// let x1 = GroupMembership::new().set_group_type(GroupType::Chokepoint);
8397 /// ```
8398 pub fn set_group_type<T: std::convert::Into<crate::model::group_membership::GroupType>>(
8399 mut self,
8400 v: T,
8401 ) -> Self {
8402 self.group_type = v.into();
8403 self
8404 }
8405
8406 /// Sets the value of [group_id][crate::model::GroupMembership::group_id].
8407 ///
8408 /// # Example
8409 /// ```ignore,no_run
8410 /// # use google_cloud_securitycenter_v2::model::GroupMembership;
8411 /// let x = GroupMembership::new().set_group_id("example");
8412 /// ```
8413 pub fn set_group_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8414 self.group_id = v.into();
8415 self
8416 }
8417}
8418
8419impl wkt::message::Message for GroupMembership {
8420 fn typename() -> &'static str {
8421 "type.googleapis.com/google.cloud.securitycenter.v2.GroupMembership"
8422 }
8423}
8424
8425/// Defines additional types related to [GroupMembership].
8426pub mod group_membership {
8427 #[allow(unused_imports)]
8428 use super::*;
8429
8430 /// Possible types of groups.
8431 ///
8432 /// # Working with unknown values
8433 ///
8434 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8435 /// additional enum variants at any time. Adding new variants is not considered
8436 /// a breaking change. Applications should write their code in anticipation of:
8437 ///
8438 /// - New values appearing in future releases of the client library, **and**
8439 /// - New values received dynamically, without application changes.
8440 ///
8441 /// Please consult the [Working with enums] section in the user guide for some
8442 /// guidelines.
8443 ///
8444 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8445 #[derive(Clone, Debug, PartialEq)]
8446 #[non_exhaustive]
8447 pub enum GroupType {
8448 /// Default value.
8449 Unspecified,
8450 /// Group represents a toxic combination.
8451 ToxicCombination,
8452 /// Group represents a chokepoint.
8453 Chokepoint,
8454 /// If set, the enum was initialized with an unknown value.
8455 ///
8456 /// Applications can examine the value using [GroupType::value] or
8457 /// [GroupType::name].
8458 UnknownValue(group_type::UnknownValue),
8459 }
8460
8461 #[doc(hidden)]
8462 pub mod group_type {
8463 #[allow(unused_imports)]
8464 use super::*;
8465 #[derive(Clone, Debug, PartialEq)]
8466 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8467 }
8468
8469 impl GroupType {
8470 /// Gets the enum value.
8471 ///
8472 /// Returns `None` if the enum contains an unknown value deserialized from
8473 /// the string representation of enums.
8474 pub fn value(&self) -> std::option::Option<i32> {
8475 match self {
8476 Self::Unspecified => std::option::Option::Some(0),
8477 Self::ToxicCombination => std::option::Option::Some(1),
8478 Self::Chokepoint => std::option::Option::Some(3),
8479 Self::UnknownValue(u) => u.0.value(),
8480 }
8481 }
8482
8483 /// Gets the enum value as a string.
8484 ///
8485 /// Returns `None` if the enum contains an unknown value deserialized from
8486 /// the integer representation of enums.
8487 pub fn name(&self) -> std::option::Option<&str> {
8488 match self {
8489 Self::Unspecified => std::option::Option::Some("GROUP_TYPE_UNSPECIFIED"),
8490 Self::ToxicCombination => std::option::Option::Some("GROUP_TYPE_TOXIC_COMBINATION"),
8491 Self::Chokepoint => std::option::Option::Some("GROUP_TYPE_CHOKEPOINT"),
8492 Self::UnknownValue(u) => u.0.name(),
8493 }
8494 }
8495 }
8496
8497 impl std::default::Default for GroupType {
8498 fn default() -> Self {
8499 use std::convert::From;
8500 Self::from(0)
8501 }
8502 }
8503
8504 impl std::fmt::Display for GroupType {
8505 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8506 wkt::internal::display_enum(f, self.name(), self.value())
8507 }
8508 }
8509
8510 impl std::convert::From<i32> for GroupType {
8511 fn from(value: i32) -> Self {
8512 match value {
8513 0 => Self::Unspecified,
8514 1 => Self::ToxicCombination,
8515 3 => Self::Chokepoint,
8516 _ => Self::UnknownValue(group_type::UnknownValue(
8517 wkt::internal::UnknownEnumValue::Integer(value),
8518 )),
8519 }
8520 }
8521 }
8522
8523 impl std::convert::From<&str> for GroupType {
8524 fn from(value: &str) -> Self {
8525 use std::string::ToString;
8526 match value {
8527 "GROUP_TYPE_UNSPECIFIED" => Self::Unspecified,
8528 "GROUP_TYPE_TOXIC_COMBINATION" => Self::ToxicCombination,
8529 "GROUP_TYPE_CHOKEPOINT" => Self::Chokepoint,
8530 _ => Self::UnknownValue(group_type::UnknownValue(
8531 wkt::internal::UnknownEnumValue::String(value.to_string()),
8532 )),
8533 }
8534 }
8535 }
8536
8537 impl serde::ser::Serialize for GroupType {
8538 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8539 where
8540 S: serde::Serializer,
8541 {
8542 match self {
8543 Self::Unspecified => serializer.serialize_i32(0),
8544 Self::ToxicCombination => serializer.serialize_i32(1),
8545 Self::Chokepoint => serializer.serialize_i32(3),
8546 Self::UnknownValue(u) => u.0.serialize(serializer),
8547 }
8548 }
8549 }
8550
8551 impl<'de> serde::de::Deserialize<'de> for GroupType {
8552 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8553 where
8554 D: serde::Deserializer<'de>,
8555 {
8556 deserializer.deserialize_any(wkt::internal::EnumVisitor::<GroupType>::new(
8557 ".google.cloud.securitycenter.v2.GroupMembership.GroupType",
8558 ))
8559 }
8560 }
8561}
8562
8563/// Represents a particular IAM binding, which captures a member's role addition,
8564/// removal, or state.
8565#[derive(Clone, Default, PartialEq)]
8566#[non_exhaustive]
8567pub struct IamBinding {
8568 /// The action that was performed on a Binding.
8569 pub action: crate::model::iam_binding::Action,
8570
8571 /// Role that is assigned to "members".
8572 /// For example, "roles/viewer", "roles/editor", or "roles/owner".
8573 pub role: std::string::String,
8574
8575 /// A single identity requesting access for a Cloud Platform resource, for
8576 /// example, "foo@google.com".
8577 pub member: std::string::String,
8578
8579 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8580}
8581
8582impl IamBinding {
8583 /// Creates a new default instance.
8584 pub fn new() -> Self {
8585 std::default::Default::default()
8586 }
8587
8588 /// Sets the value of [action][crate::model::IamBinding::action].
8589 ///
8590 /// # Example
8591 /// ```ignore,no_run
8592 /// # use google_cloud_securitycenter_v2::model::IamBinding;
8593 /// use google_cloud_securitycenter_v2::model::iam_binding::Action;
8594 /// let x0 = IamBinding::new().set_action(Action::Add);
8595 /// let x1 = IamBinding::new().set_action(Action::Remove);
8596 /// ```
8597 pub fn set_action<T: std::convert::Into<crate::model::iam_binding::Action>>(
8598 mut self,
8599 v: T,
8600 ) -> Self {
8601 self.action = v.into();
8602 self
8603 }
8604
8605 /// Sets the value of [role][crate::model::IamBinding::role].
8606 ///
8607 /// # Example
8608 /// ```ignore,no_run
8609 /// # use google_cloud_securitycenter_v2::model::IamBinding;
8610 /// let x = IamBinding::new().set_role("example");
8611 /// ```
8612 pub fn set_role<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8613 self.role = v.into();
8614 self
8615 }
8616
8617 /// Sets the value of [member][crate::model::IamBinding::member].
8618 ///
8619 /// # Example
8620 /// ```ignore,no_run
8621 /// # use google_cloud_securitycenter_v2::model::IamBinding;
8622 /// let x = IamBinding::new().set_member("example");
8623 /// ```
8624 pub fn set_member<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8625 self.member = v.into();
8626 self
8627 }
8628}
8629
8630impl wkt::message::Message for IamBinding {
8631 fn typename() -> &'static str {
8632 "type.googleapis.com/google.cloud.securitycenter.v2.IamBinding"
8633 }
8634}
8635
8636/// Defines additional types related to [IamBinding].
8637pub mod iam_binding {
8638 #[allow(unused_imports)]
8639 use super::*;
8640
8641 /// The type of action performed on a Binding in a policy.
8642 ///
8643 /// # Working with unknown values
8644 ///
8645 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8646 /// additional enum variants at any time. Adding new variants is not considered
8647 /// a breaking change. Applications should write their code in anticipation of:
8648 ///
8649 /// - New values appearing in future releases of the client library, **and**
8650 /// - New values received dynamically, without application changes.
8651 ///
8652 /// Please consult the [Working with enums] section in the user guide for some
8653 /// guidelines.
8654 ///
8655 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8656 #[derive(Clone, Debug, PartialEq)]
8657 #[non_exhaustive]
8658 pub enum Action {
8659 /// Unspecified.
8660 Unspecified,
8661 /// Addition of a Binding.
8662 Add,
8663 /// Removal of a Binding.
8664 Remove,
8665 /// If set, the enum was initialized with an unknown value.
8666 ///
8667 /// Applications can examine the value using [Action::value] or
8668 /// [Action::name].
8669 UnknownValue(action::UnknownValue),
8670 }
8671
8672 #[doc(hidden)]
8673 pub mod action {
8674 #[allow(unused_imports)]
8675 use super::*;
8676 #[derive(Clone, Debug, PartialEq)]
8677 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8678 }
8679
8680 impl Action {
8681 /// Gets the enum value.
8682 ///
8683 /// Returns `None` if the enum contains an unknown value deserialized from
8684 /// the string representation of enums.
8685 pub fn value(&self) -> std::option::Option<i32> {
8686 match self {
8687 Self::Unspecified => std::option::Option::Some(0),
8688 Self::Add => std::option::Option::Some(1),
8689 Self::Remove => std::option::Option::Some(2),
8690 Self::UnknownValue(u) => u.0.value(),
8691 }
8692 }
8693
8694 /// Gets the enum value as a string.
8695 ///
8696 /// Returns `None` if the enum contains an unknown value deserialized from
8697 /// the integer representation of enums.
8698 pub fn name(&self) -> std::option::Option<&str> {
8699 match self {
8700 Self::Unspecified => std::option::Option::Some("ACTION_UNSPECIFIED"),
8701 Self::Add => std::option::Option::Some("ADD"),
8702 Self::Remove => std::option::Option::Some("REMOVE"),
8703 Self::UnknownValue(u) => u.0.name(),
8704 }
8705 }
8706 }
8707
8708 impl std::default::Default for Action {
8709 fn default() -> Self {
8710 use std::convert::From;
8711 Self::from(0)
8712 }
8713 }
8714
8715 impl std::fmt::Display for Action {
8716 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8717 wkt::internal::display_enum(f, self.name(), self.value())
8718 }
8719 }
8720
8721 impl std::convert::From<i32> for Action {
8722 fn from(value: i32) -> Self {
8723 match value {
8724 0 => Self::Unspecified,
8725 1 => Self::Add,
8726 2 => Self::Remove,
8727 _ => Self::UnknownValue(action::UnknownValue(
8728 wkt::internal::UnknownEnumValue::Integer(value),
8729 )),
8730 }
8731 }
8732 }
8733
8734 impl std::convert::From<&str> for Action {
8735 fn from(value: &str) -> Self {
8736 use std::string::ToString;
8737 match value {
8738 "ACTION_UNSPECIFIED" => Self::Unspecified,
8739 "ADD" => Self::Add,
8740 "REMOVE" => Self::Remove,
8741 _ => Self::UnknownValue(action::UnknownValue(
8742 wkt::internal::UnknownEnumValue::String(value.to_string()),
8743 )),
8744 }
8745 }
8746 }
8747
8748 impl serde::ser::Serialize for Action {
8749 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8750 where
8751 S: serde::Serializer,
8752 {
8753 match self {
8754 Self::Unspecified => serializer.serialize_i32(0),
8755 Self::Add => serializer.serialize_i32(1),
8756 Self::Remove => serializer.serialize_i32(2),
8757 Self::UnknownValue(u) => u.0.serialize(serializer),
8758 }
8759 }
8760 }
8761
8762 impl<'de> serde::de::Deserialize<'de> for Action {
8763 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8764 where
8765 D: serde::Deserializer<'de>,
8766 {
8767 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
8768 ".google.cloud.securitycenter.v2.IamBinding.Action",
8769 ))
8770 }
8771 }
8772}
8773
8774/// Represents what's commonly known as an _indicator of compromise_ (IoC) in
8775/// computer forensics. This is an artifact observed on a network or in an
8776/// operating system that, with high confidence, indicates a computer intrusion.
8777/// For more information, see [Indicator of
8778/// compromise](https://en.wikipedia.org/wiki/Indicator_of_compromise).
8779#[derive(Clone, Default, PartialEq)]
8780#[non_exhaustive]
8781pub struct Indicator {
8782 /// The list of IP addresses that are associated with the finding.
8783 pub ip_addresses: std::vec::Vec<std::string::String>,
8784
8785 /// List of domains associated to the Finding.
8786 pub domains: std::vec::Vec<std::string::String>,
8787
8788 /// The list of matched signatures indicating that the given
8789 /// process is present in the environment.
8790 pub signatures: std::vec::Vec<crate::model::indicator::ProcessSignature>,
8791
8792 /// The list of URIs associated to the Findings.
8793 pub uris: std::vec::Vec<std::string::String>,
8794
8795 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8796}
8797
8798impl Indicator {
8799 /// Creates a new default instance.
8800 pub fn new() -> Self {
8801 std::default::Default::default()
8802 }
8803
8804 /// Sets the value of [ip_addresses][crate::model::Indicator::ip_addresses].
8805 ///
8806 /// # Example
8807 /// ```ignore,no_run
8808 /// # use google_cloud_securitycenter_v2::model::Indicator;
8809 /// let x = Indicator::new().set_ip_addresses(["a", "b", "c"]);
8810 /// ```
8811 pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
8812 where
8813 T: std::iter::IntoIterator<Item = V>,
8814 V: std::convert::Into<std::string::String>,
8815 {
8816 use std::iter::Iterator;
8817 self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
8818 self
8819 }
8820
8821 /// Sets the value of [domains][crate::model::Indicator::domains].
8822 ///
8823 /// # Example
8824 /// ```ignore,no_run
8825 /// # use google_cloud_securitycenter_v2::model::Indicator;
8826 /// let x = Indicator::new().set_domains(["a", "b", "c"]);
8827 /// ```
8828 pub fn set_domains<T, V>(mut self, v: T) -> Self
8829 where
8830 T: std::iter::IntoIterator<Item = V>,
8831 V: std::convert::Into<std::string::String>,
8832 {
8833 use std::iter::Iterator;
8834 self.domains = v.into_iter().map(|i| i.into()).collect();
8835 self
8836 }
8837
8838 /// Sets the value of [signatures][crate::model::Indicator::signatures].
8839 ///
8840 /// # Example
8841 /// ```ignore,no_run
8842 /// # use google_cloud_securitycenter_v2::model::Indicator;
8843 /// use google_cloud_securitycenter_v2::model::indicator::ProcessSignature;
8844 /// let x = Indicator::new()
8845 /// .set_signatures([
8846 /// ProcessSignature::default()/* use setters */,
8847 /// ProcessSignature::default()/* use (different) setters */,
8848 /// ]);
8849 /// ```
8850 pub fn set_signatures<T, V>(mut self, v: T) -> Self
8851 where
8852 T: std::iter::IntoIterator<Item = V>,
8853 V: std::convert::Into<crate::model::indicator::ProcessSignature>,
8854 {
8855 use std::iter::Iterator;
8856 self.signatures = v.into_iter().map(|i| i.into()).collect();
8857 self
8858 }
8859
8860 /// Sets the value of [uris][crate::model::Indicator::uris].
8861 ///
8862 /// # Example
8863 /// ```ignore,no_run
8864 /// # use google_cloud_securitycenter_v2::model::Indicator;
8865 /// let x = Indicator::new().set_uris(["a", "b", "c"]);
8866 /// ```
8867 pub fn set_uris<T, V>(mut self, v: T) -> Self
8868 where
8869 T: std::iter::IntoIterator<Item = V>,
8870 V: std::convert::Into<std::string::String>,
8871 {
8872 use std::iter::Iterator;
8873 self.uris = v.into_iter().map(|i| i.into()).collect();
8874 self
8875 }
8876}
8877
8878impl wkt::message::Message for Indicator {
8879 fn typename() -> &'static str {
8880 "type.googleapis.com/google.cloud.securitycenter.v2.Indicator"
8881 }
8882}
8883
8884/// Defines additional types related to [Indicator].
8885pub mod indicator {
8886 #[allow(unused_imports)]
8887 use super::*;
8888
8889 /// Indicates what signature matched this process.
8890 #[derive(Clone, Default, PartialEq)]
8891 #[non_exhaustive]
8892 pub struct ProcessSignature {
8893 /// Describes the type of resource associated with the signature.
8894 pub signature_type: crate::model::indicator::process_signature::SignatureType,
8895
8896 /// The signature.
8897 pub signature: std::option::Option<crate::model::indicator::process_signature::Signature>,
8898
8899 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8900 }
8901
8902 impl ProcessSignature {
8903 /// Creates a new default instance.
8904 pub fn new() -> Self {
8905 std::default::Default::default()
8906 }
8907
8908 /// Sets the value of [signature_type][crate::model::indicator::ProcessSignature::signature_type].
8909 ///
8910 /// # Example
8911 /// ```ignore,no_run
8912 /// # use google_cloud_securitycenter_v2::model::indicator::ProcessSignature;
8913 /// use google_cloud_securitycenter_v2::model::indicator::process_signature::SignatureType;
8914 /// let x0 = ProcessSignature::new().set_signature_type(SignatureType::Process);
8915 /// let x1 = ProcessSignature::new().set_signature_type(SignatureType::File);
8916 /// ```
8917 pub fn set_signature_type<
8918 T: std::convert::Into<crate::model::indicator::process_signature::SignatureType>,
8919 >(
8920 mut self,
8921 v: T,
8922 ) -> Self {
8923 self.signature_type = v.into();
8924 self
8925 }
8926
8927 /// Sets the value of [signature][crate::model::indicator::ProcessSignature::signature].
8928 ///
8929 /// Note that all the setters affecting `signature` are mutually
8930 /// exclusive.
8931 ///
8932 /// # Example
8933 /// ```ignore,no_run
8934 /// # use google_cloud_securitycenter_v2::model::indicator::ProcessSignature;
8935 /// use google_cloud_securitycenter_v2::model::indicator::process_signature::MemoryHashSignature;
8936 /// let x = ProcessSignature::new().set_signature(Some(
8937 /// google_cloud_securitycenter_v2::model::indicator::process_signature::Signature::MemoryHashSignature(MemoryHashSignature::default().into())));
8938 /// ```
8939 pub fn set_signature<
8940 T: std::convert::Into<
8941 std::option::Option<crate::model::indicator::process_signature::Signature>,
8942 >,
8943 >(
8944 mut self,
8945 v: T,
8946 ) -> Self {
8947 self.signature = v.into();
8948 self
8949 }
8950
8951 /// The value of [signature][crate::model::indicator::ProcessSignature::signature]
8952 /// if it holds a `MemoryHashSignature`, `None` if the field is not set or
8953 /// holds a different branch.
8954 pub fn memory_hash_signature(
8955 &self,
8956 ) -> std::option::Option<
8957 &std::boxed::Box<crate::model::indicator::process_signature::MemoryHashSignature>,
8958 > {
8959 #[allow(unreachable_patterns)]
8960 self.signature.as_ref().and_then(|v| match v {
8961 crate::model::indicator::process_signature::Signature::MemoryHashSignature(v) => {
8962 std::option::Option::Some(v)
8963 }
8964 _ => std::option::Option::None,
8965 })
8966 }
8967
8968 /// Sets the value of [signature][crate::model::indicator::ProcessSignature::signature]
8969 /// to hold a `MemoryHashSignature`.
8970 ///
8971 /// Note that all the setters affecting `signature` are
8972 /// mutually exclusive.
8973 ///
8974 /// # Example
8975 /// ```ignore,no_run
8976 /// # use google_cloud_securitycenter_v2::model::indicator::ProcessSignature;
8977 /// use google_cloud_securitycenter_v2::model::indicator::process_signature::MemoryHashSignature;
8978 /// let x = ProcessSignature::new().set_memory_hash_signature(MemoryHashSignature::default()/* use setters */);
8979 /// assert!(x.memory_hash_signature().is_some());
8980 /// assert!(x.yara_rule_signature().is_none());
8981 /// ```
8982 pub fn set_memory_hash_signature<
8983 T: std::convert::Into<
8984 std::boxed::Box<
8985 crate::model::indicator::process_signature::MemoryHashSignature,
8986 >,
8987 >,
8988 >(
8989 mut self,
8990 v: T,
8991 ) -> Self {
8992 self.signature = std::option::Option::Some(
8993 crate::model::indicator::process_signature::Signature::MemoryHashSignature(
8994 v.into(),
8995 ),
8996 );
8997 self
8998 }
8999
9000 /// The value of [signature][crate::model::indicator::ProcessSignature::signature]
9001 /// if it holds a `YaraRuleSignature`, `None` if the field is not set or
9002 /// holds a different branch.
9003 pub fn yara_rule_signature(
9004 &self,
9005 ) -> std::option::Option<
9006 &std::boxed::Box<crate::model::indicator::process_signature::YaraRuleSignature>,
9007 > {
9008 #[allow(unreachable_patterns)]
9009 self.signature.as_ref().and_then(|v| match v {
9010 crate::model::indicator::process_signature::Signature::YaraRuleSignature(v) => {
9011 std::option::Option::Some(v)
9012 }
9013 _ => std::option::Option::None,
9014 })
9015 }
9016
9017 /// Sets the value of [signature][crate::model::indicator::ProcessSignature::signature]
9018 /// to hold a `YaraRuleSignature`.
9019 ///
9020 /// Note that all the setters affecting `signature` are
9021 /// mutually exclusive.
9022 ///
9023 /// # Example
9024 /// ```ignore,no_run
9025 /// # use google_cloud_securitycenter_v2::model::indicator::ProcessSignature;
9026 /// use google_cloud_securitycenter_v2::model::indicator::process_signature::YaraRuleSignature;
9027 /// let x = ProcessSignature::new().set_yara_rule_signature(YaraRuleSignature::default()/* use setters */);
9028 /// assert!(x.yara_rule_signature().is_some());
9029 /// assert!(x.memory_hash_signature().is_none());
9030 /// ```
9031 pub fn set_yara_rule_signature<
9032 T: std::convert::Into<
9033 std::boxed::Box<crate::model::indicator::process_signature::YaraRuleSignature>,
9034 >,
9035 >(
9036 mut self,
9037 v: T,
9038 ) -> Self {
9039 self.signature = std::option::Option::Some(
9040 crate::model::indicator::process_signature::Signature::YaraRuleSignature(v.into()),
9041 );
9042 self
9043 }
9044 }
9045
9046 impl wkt::message::Message for ProcessSignature {
9047 fn typename() -> &'static str {
9048 "type.googleapis.com/google.cloud.securitycenter.v2.Indicator.ProcessSignature"
9049 }
9050 }
9051
9052 /// Defines additional types related to [ProcessSignature].
9053 pub mod process_signature {
9054 #[allow(unused_imports)]
9055 use super::*;
9056
9057 /// A signature corresponding to memory page hashes.
9058 #[derive(Clone, Default, PartialEq)]
9059 #[non_exhaustive]
9060 pub struct MemoryHashSignature {
9061 /// The binary family.
9062 pub binary_family: std::string::String,
9063
9064 /// The list of memory hash detections contributing to the binary family
9065 /// match.
9066 pub detections: std::vec::Vec<
9067 crate::model::indicator::process_signature::memory_hash_signature::Detection,
9068 >,
9069
9070 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9071 }
9072
9073 impl MemoryHashSignature {
9074 /// Creates a new default instance.
9075 pub fn new() -> Self {
9076 std::default::Default::default()
9077 }
9078
9079 /// Sets the value of [binary_family][crate::model::indicator::process_signature::MemoryHashSignature::binary_family].
9080 ///
9081 /// # Example
9082 /// ```ignore,no_run
9083 /// # use google_cloud_securitycenter_v2::model::indicator::process_signature::MemoryHashSignature;
9084 /// let x = MemoryHashSignature::new().set_binary_family("example");
9085 /// ```
9086 pub fn set_binary_family<T: std::convert::Into<std::string::String>>(
9087 mut self,
9088 v: T,
9089 ) -> Self {
9090 self.binary_family = v.into();
9091 self
9092 }
9093
9094 /// Sets the value of [detections][crate::model::indicator::process_signature::MemoryHashSignature::detections].
9095 ///
9096 /// # Example
9097 /// ```ignore,no_run
9098 /// # use google_cloud_securitycenter_v2::model::indicator::process_signature::MemoryHashSignature;
9099 /// use google_cloud_securitycenter_v2::model::indicator::process_signature::memory_hash_signature::Detection;
9100 /// let x = MemoryHashSignature::new()
9101 /// .set_detections([
9102 /// Detection::default()/* use setters */,
9103 /// Detection::default()/* use (different) setters */,
9104 /// ]);
9105 /// ```
9106 pub fn set_detections<T, V>(mut self, v: T) -> Self
9107 where
9108 T: std::iter::IntoIterator<Item = V>,
9109 V: std::convert::Into<crate::model::indicator::process_signature::memory_hash_signature::Detection>
9110 {
9111 use std::iter::Iterator;
9112 self.detections = v.into_iter().map(|i| i.into()).collect();
9113 self
9114 }
9115 }
9116
9117 impl wkt::message::Message for MemoryHashSignature {
9118 fn typename() -> &'static str {
9119 "type.googleapis.com/google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature"
9120 }
9121 }
9122
9123 /// Defines additional types related to [MemoryHashSignature].
9124 pub mod memory_hash_signature {
9125 #[allow(unused_imports)]
9126 use super::*;
9127
9128 /// Memory hash detection contributing to the binary family match.
9129 #[derive(Clone, Default, PartialEq)]
9130 #[non_exhaustive]
9131 pub struct Detection {
9132 /// The name of the binary associated with the memory hash
9133 /// signature detection.
9134 pub binary: std::string::String,
9135
9136 /// The percentage of memory page hashes in the signature
9137 /// that were matched.
9138 pub percent_pages_matched: f64,
9139
9140 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9141 }
9142
9143 impl Detection {
9144 /// Creates a new default instance.
9145 pub fn new() -> Self {
9146 std::default::Default::default()
9147 }
9148
9149 /// Sets the value of [binary][crate::model::indicator::process_signature::memory_hash_signature::Detection::binary].
9150 ///
9151 /// # Example
9152 /// ```ignore,no_run
9153 /// # use google_cloud_securitycenter_v2::model::indicator::process_signature::memory_hash_signature::Detection;
9154 /// let x = Detection::new().set_binary("example");
9155 /// ```
9156 pub fn set_binary<T: std::convert::Into<std::string::String>>(
9157 mut self,
9158 v: T,
9159 ) -> Self {
9160 self.binary = v.into();
9161 self
9162 }
9163
9164 /// Sets the value of [percent_pages_matched][crate::model::indicator::process_signature::memory_hash_signature::Detection::percent_pages_matched].
9165 ///
9166 /// # Example
9167 /// ```ignore,no_run
9168 /// # use google_cloud_securitycenter_v2::model::indicator::process_signature::memory_hash_signature::Detection;
9169 /// let x = Detection::new().set_percent_pages_matched(42.0);
9170 /// ```
9171 pub fn set_percent_pages_matched<T: std::convert::Into<f64>>(
9172 mut self,
9173 v: T,
9174 ) -> Self {
9175 self.percent_pages_matched = v.into();
9176 self
9177 }
9178 }
9179
9180 impl wkt::message::Message for Detection {
9181 fn typename() -> &'static str {
9182 "type.googleapis.com/google.cloud.securitycenter.v2.Indicator.ProcessSignature.MemoryHashSignature.Detection"
9183 }
9184 }
9185 }
9186
9187 /// A signature corresponding to a YARA rule.
9188 #[derive(Clone, Default, PartialEq)]
9189 #[non_exhaustive]
9190 pub struct YaraRuleSignature {
9191 /// The name of the YARA rule.
9192 pub yara_rule: std::string::String,
9193
9194 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9195 }
9196
9197 impl YaraRuleSignature {
9198 /// Creates a new default instance.
9199 pub fn new() -> Self {
9200 std::default::Default::default()
9201 }
9202
9203 /// Sets the value of [yara_rule][crate::model::indicator::process_signature::YaraRuleSignature::yara_rule].
9204 ///
9205 /// # Example
9206 /// ```ignore,no_run
9207 /// # use google_cloud_securitycenter_v2::model::indicator::process_signature::YaraRuleSignature;
9208 /// let x = YaraRuleSignature::new().set_yara_rule("example");
9209 /// ```
9210 pub fn set_yara_rule<T: std::convert::Into<std::string::String>>(
9211 mut self,
9212 v: T,
9213 ) -> Self {
9214 self.yara_rule = v.into();
9215 self
9216 }
9217 }
9218
9219 impl wkt::message::Message for YaraRuleSignature {
9220 fn typename() -> &'static str {
9221 "type.googleapis.com/google.cloud.securitycenter.v2.Indicator.ProcessSignature.YaraRuleSignature"
9222 }
9223 }
9224
9225 /// Possible resource types to be associated with a signature.
9226 ///
9227 /// # Working with unknown values
9228 ///
9229 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9230 /// additional enum variants at any time. Adding new variants is not considered
9231 /// a breaking change. Applications should write their code in anticipation of:
9232 ///
9233 /// - New values appearing in future releases of the client library, **and**
9234 /// - New values received dynamically, without application changes.
9235 ///
9236 /// Please consult the [Working with enums] section in the user guide for some
9237 /// guidelines.
9238 ///
9239 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9240 #[derive(Clone, Debug, PartialEq)]
9241 #[non_exhaustive]
9242 pub enum SignatureType {
9243 /// The default signature type.
9244 Unspecified,
9245 /// Used for signatures concerning processes.
9246 Process,
9247 /// Used for signatures concerning disks.
9248 File,
9249 /// If set, the enum was initialized with an unknown value.
9250 ///
9251 /// Applications can examine the value using [SignatureType::value] or
9252 /// [SignatureType::name].
9253 UnknownValue(signature_type::UnknownValue),
9254 }
9255
9256 #[doc(hidden)]
9257 pub mod signature_type {
9258 #[allow(unused_imports)]
9259 use super::*;
9260 #[derive(Clone, Debug, PartialEq)]
9261 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9262 }
9263
9264 impl SignatureType {
9265 /// Gets the enum value.
9266 ///
9267 /// Returns `None` if the enum contains an unknown value deserialized from
9268 /// the string representation of enums.
9269 pub fn value(&self) -> std::option::Option<i32> {
9270 match self {
9271 Self::Unspecified => std::option::Option::Some(0),
9272 Self::Process => std::option::Option::Some(1),
9273 Self::File => std::option::Option::Some(2),
9274 Self::UnknownValue(u) => u.0.value(),
9275 }
9276 }
9277
9278 /// Gets the enum value as a string.
9279 ///
9280 /// Returns `None` if the enum contains an unknown value deserialized from
9281 /// the integer representation of enums.
9282 pub fn name(&self) -> std::option::Option<&str> {
9283 match self {
9284 Self::Unspecified => std::option::Option::Some("SIGNATURE_TYPE_UNSPECIFIED"),
9285 Self::Process => std::option::Option::Some("SIGNATURE_TYPE_PROCESS"),
9286 Self::File => std::option::Option::Some("SIGNATURE_TYPE_FILE"),
9287 Self::UnknownValue(u) => u.0.name(),
9288 }
9289 }
9290 }
9291
9292 impl std::default::Default for SignatureType {
9293 fn default() -> Self {
9294 use std::convert::From;
9295 Self::from(0)
9296 }
9297 }
9298
9299 impl std::fmt::Display for SignatureType {
9300 fn fmt(
9301 &self,
9302 f: &mut std::fmt::Formatter<'_>,
9303 ) -> std::result::Result<(), std::fmt::Error> {
9304 wkt::internal::display_enum(f, self.name(), self.value())
9305 }
9306 }
9307
9308 impl std::convert::From<i32> for SignatureType {
9309 fn from(value: i32) -> Self {
9310 match value {
9311 0 => Self::Unspecified,
9312 1 => Self::Process,
9313 2 => Self::File,
9314 _ => Self::UnknownValue(signature_type::UnknownValue(
9315 wkt::internal::UnknownEnumValue::Integer(value),
9316 )),
9317 }
9318 }
9319 }
9320
9321 impl std::convert::From<&str> for SignatureType {
9322 fn from(value: &str) -> Self {
9323 use std::string::ToString;
9324 match value {
9325 "SIGNATURE_TYPE_UNSPECIFIED" => Self::Unspecified,
9326 "SIGNATURE_TYPE_PROCESS" => Self::Process,
9327 "SIGNATURE_TYPE_FILE" => Self::File,
9328 _ => Self::UnknownValue(signature_type::UnknownValue(
9329 wkt::internal::UnknownEnumValue::String(value.to_string()),
9330 )),
9331 }
9332 }
9333 }
9334
9335 impl serde::ser::Serialize for SignatureType {
9336 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9337 where
9338 S: serde::Serializer,
9339 {
9340 match self {
9341 Self::Unspecified => serializer.serialize_i32(0),
9342 Self::Process => serializer.serialize_i32(1),
9343 Self::File => serializer.serialize_i32(2),
9344 Self::UnknownValue(u) => u.0.serialize(serializer),
9345 }
9346 }
9347 }
9348
9349 impl<'de> serde::de::Deserialize<'de> for SignatureType {
9350 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9351 where
9352 D: serde::Deserializer<'de>,
9353 {
9354 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SignatureType>::new(
9355 ".google.cloud.securitycenter.v2.Indicator.ProcessSignature.SignatureType",
9356 ))
9357 }
9358 }
9359
9360 /// The signature.
9361 #[derive(Clone, Debug, PartialEq)]
9362 #[non_exhaustive]
9363 pub enum Signature {
9364 /// Signature indicating that a binary family was matched.
9365 MemoryHashSignature(
9366 std::boxed::Box<crate::model::indicator::process_signature::MemoryHashSignature>,
9367 ),
9368 /// Signature indicating that a YARA rule was matched.
9369 YaraRuleSignature(
9370 std::boxed::Box<crate::model::indicator::process_signature::YaraRuleSignature>,
9371 ),
9372 }
9373 }
9374}
9375
9376/// IP rules associated with the finding.
9377#[derive(Clone, Default, PartialEq)]
9378#[non_exhaustive]
9379pub struct IpRules {
9380 /// The direction that the rule is applicable to, one of ingress or egress.
9381 pub direction: crate::model::ip_rules::Direction,
9382
9383 /// If source IP ranges are specified, the firewall rule applies only to
9384 /// traffic that has a source IP address in these ranges. These ranges must be
9385 /// expressed in CIDR format. Only supports IPv4.
9386 pub source_ip_ranges: std::vec::Vec<std::string::String>,
9387
9388 /// If destination IP ranges are specified, the firewall rule applies only to
9389 /// traffic that has a destination IP address in these ranges. These ranges
9390 /// must be expressed in CIDR format. Only supports IPv4.
9391 pub destination_ip_ranges: std::vec::Vec<std::string::String>,
9392
9393 /// Name of the network protocol service, such as FTP, that is exposed by the
9394 /// open port. Follows the naming convention available at:
9395 /// <https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml>.
9396 pub exposed_services: std::vec::Vec<std::string::String>,
9397
9398 /// The list of allow rules specified by this firewall. Each rule specifies a
9399 /// protocol and port-range tuple that describes a permitted connection.
9400 pub rules: std::option::Option<crate::model::ip_rules::Rules>,
9401
9402 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9403}
9404
9405impl IpRules {
9406 /// Creates a new default instance.
9407 pub fn new() -> Self {
9408 std::default::Default::default()
9409 }
9410
9411 /// Sets the value of [direction][crate::model::IpRules::direction].
9412 ///
9413 /// # Example
9414 /// ```ignore,no_run
9415 /// # use google_cloud_securitycenter_v2::model::IpRules;
9416 /// use google_cloud_securitycenter_v2::model::ip_rules::Direction;
9417 /// let x0 = IpRules::new().set_direction(Direction::Ingress);
9418 /// let x1 = IpRules::new().set_direction(Direction::Egress);
9419 /// ```
9420 pub fn set_direction<T: std::convert::Into<crate::model::ip_rules::Direction>>(
9421 mut self,
9422 v: T,
9423 ) -> Self {
9424 self.direction = v.into();
9425 self
9426 }
9427
9428 /// Sets the value of [source_ip_ranges][crate::model::IpRules::source_ip_ranges].
9429 ///
9430 /// # Example
9431 /// ```ignore,no_run
9432 /// # use google_cloud_securitycenter_v2::model::IpRules;
9433 /// let x = IpRules::new().set_source_ip_ranges(["a", "b", "c"]);
9434 /// ```
9435 pub fn set_source_ip_ranges<T, V>(mut self, v: T) -> Self
9436 where
9437 T: std::iter::IntoIterator<Item = V>,
9438 V: std::convert::Into<std::string::String>,
9439 {
9440 use std::iter::Iterator;
9441 self.source_ip_ranges = v.into_iter().map(|i| i.into()).collect();
9442 self
9443 }
9444
9445 /// Sets the value of [destination_ip_ranges][crate::model::IpRules::destination_ip_ranges].
9446 ///
9447 /// # Example
9448 /// ```ignore,no_run
9449 /// # use google_cloud_securitycenter_v2::model::IpRules;
9450 /// let x = IpRules::new().set_destination_ip_ranges(["a", "b", "c"]);
9451 /// ```
9452 pub fn set_destination_ip_ranges<T, V>(mut self, v: T) -> Self
9453 where
9454 T: std::iter::IntoIterator<Item = V>,
9455 V: std::convert::Into<std::string::String>,
9456 {
9457 use std::iter::Iterator;
9458 self.destination_ip_ranges = v.into_iter().map(|i| i.into()).collect();
9459 self
9460 }
9461
9462 /// Sets the value of [exposed_services][crate::model::IpRules::exposed_services].
9463 ///
9464 /// # Example
9465 /// ```ignore,no_run
9466 /// # use google_cloud_securitycenter_v2::model::IpRules;
9467 /// let x = IpRules::new().set_exposed_services(["a", "b", "c"]);
9468 /// ```
9469 pub fn set_exposed_services<T, V>(mut self, v: T) -> Self
9470 where
9471 T: std::iter::IntoIterator<Item = V>,
9472 V: std::convert::Into<std::string::String>,
9473 {
9474 use std::iter::Iterator;
9475 self.exposed_services = v.into_iter().map(|i| i.into()).collect();
9476 self
9477 }
9478
9479 /// Sets the value of [rules][crate::model::IpRules::rules].
9480 ///
9481 /// Note that all the setters affecting `rules` are mutually
9482 /// exclusive.
9483 ///
9484 /// # Example
9485 /// ```ignore,no_run
9486 /// # use google_cloud_securitycenter_v2::model::IpRules;
9487 /// use google_cloud_securitycenter_v2::model::Allowed;
9488 /// let x = IpRules::new().set_rules(Some(
9489 /// google_cloud_securitycenter_v2::model::ip_rules::Rules::Allowed(Allowed::default().into())));
9490 /// ```
9491 pub fn set_rules<T: std::convert::Into<std::option::Option<crate::model::ip_rules::Rules>>>(
9492 mut self,
9493 v: T,
9494 ) -> Self {
9495 self.rules = v.into();
9496 self
9497 }
9498
9499 /// The value of [rules][crate::model::IpRules::rules]
9500 /// if it holds a `Allowed`, `None` if the field is not set or
9501 /// holds a different branch.
9502 pub fn allowed(&self) -> std::option::Option<&std::boxed::Box<crate::model::Allowed>> {
9503 #[allow(unreachable_patterns)]
9504 self.rules.as_ref().and_then(|v| match v {
9505 crate::model::ip_rules::Rules::Allowed(v) => std::option::Option::Some(v),
9506 _ => std::option::Option::None,
9507 })
9508 }
9509
9510 /// Sets the value of [rules][crate::model::IpRules::rules]
9511 /// to hold a `Allowed`.
9512 ///
9513 /// Note that all the setters affecting `rules` are
9514 /// mutually exclusive.
9515 ///
9516 /// # Example
9517 /// ```ignore,no_run
9518 /// # use google_cloud_securitycenter_v2::model::IpRules;
9519 /// use google_cloud_securitycenter_v2::model::Allowed;
9520 /// let x = IpRules::new().set_allowed(Allowed::default()/* use setters */);
9521 /// assert!(x.allowed().is_some());
9522 /// assert!(x.denied().is_none());
9523 /// ```
9524 pub fn set_allowed<T: std::convert::Into<std::boxed::Box<crate::model::Allowed>>>(
9525 mut self,
9526 v: T,
9527 ) -> Self {
9528 self.rules = std::option::Option::Some(crate::model::ip_rules::Rules::Allowed(v.into()));
9529 self
9530 }
9531
9532 /// The value of [rules][crate::model::IpRules::rules]
9533 /// if it holds a `Denied`, `None` if the field is not set or
9534 /// holds a different branch.
9535 pub fn denied(&self) -> std::option::Option<&std::boxed::Box<crate::model::Denied>> {
9536 #[allow(unreachable_patterns)]
9537 self.rules.as_ref().and_then(|v| match v {
9538 crate::model::ip_rules::Rules::Denied(v) => std::option::Option::Some(v),
9539 _ => std::option::Option::None,
9540 })
9541 }
9542
9543 /// Sets the value of [rules][crate::model::IpRules::rules]
9544 /// to hold a `Denied`.
9545 ///
9546 /// Note that all the setters affecting `rules` are
9547 /// mutually exclusive.
9548 ///
9549 /// # Example
9550 /// ```ignore,no_run
9551 /// # use google_cloud_securitycenter_v2::model::IpRules;
9552 /// use google_cloud_securitycenter_v2::model::Denied;
9553 /// let x = IpRules::new().set_denied(Denied::default()/* use setters */);
9554 /// assert!(x.denied().is_some());
9555 /// assert!(x.allowed().is_none());
9556 /// ```
9557 pub fn set_denied<T: std::convert::Into<std::boxed::Box<crate::model::Denied>>>(
9558 mut self,
9559 v: T,
9560 ) -> Self {
9561 self.rules = std::option::Option::Some(crate::model::ip_rules::Rules::Denied(v.into()));
9562 self
9563 }
9564}
9565
9566impl wkt::message::Message for IpRules {
9567 fn typename() -> &'static str {
9568 "type.googleapis.com/google.cloud.securitycenter.v2.IpRules"
9569 }
9570}
9571
9572/// Defines additional types related to [IpRules].
9573pub mod ip_rules {
9574 #[allow(unused_imports)]
9575 use super::*;
9576
9577 /// The type of direction that the rule is applicable to, one of ingress or
9578 /// egress. Not applicable to OPEN_X_PORT findings.
9579 ///
9580 /// # Working with unknown values
9581 ///
9582 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9583 /// additional enum variants at any time. Adding new variants is not considered
9584 /// a breaking change. Applications should write their code in anticipation of:
9585 ///
9586 /// - New values appearing in future releases of the client library, **and**
9587 /// - New values received dynamically, without application changes.
9588 ///
9589 /// Please consult the [Working with enums] section in the user guide for some
9590 /// guidelines.
9591 ///
9592 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9593 #[derive(Clone, Debug, PartialEq)]
9594 #[non_exhaustive]
9595 pub enum Direction {
9596 /// Unspecified direction value.
9597 Unspecified,
9598 /// Ingress direction value.
9599 Ingress,
9600 /// Egress direction value.
9601 Egress,
9602 /// If set, the enum was initialized with an unknown value.
9603 ///
9604 /// Applications can examine the value using [Direction::value] or
9605 /// [Direction::name].
9606 UnknownValue(direction::UnknownValue),
9607 }
9608
9609 #[doc(hidden)]
9610 pub mod direction {
9611 #[allow(unused_imports)]
9612 use super::*;
9613 #[derive(Clone, Debug, PartialEq)]
9614 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9615 }
9616
9617 impl Direction {
9618 /// Gets the enum value.
9619 ///
9620 /// Returns `None` if the enum contains an unknown value deserialized from
9621 /// the string representation of enums.
9622 pub fn value(&self) -> std::option::Option<i32> {
9623 match self {
9624 Self::Unspecified => std::option::Option::Some(0),
9625 Self::Ingress => std::option::Option::Some(1),
9626 Self::Egress => std::option::Option::Some(2),
9627 Self::UnknownValue(u) => u.0.value(),
9628 }
9629 }
9630
9631 /// Gets the enum value as a string.
9632 ///
9633 /// Returns `None` if the enum contains an unknown value deserialized from
9634 /// the integer representation of enums.
9635 pub fn name(&self) -> std::option::Option<&str> {
9636 match self {
9637 Self::Unspecified => std::option::Option::Some("DIRECTION_UNSPECIFIED"),
9638 Self::Ingress => std::option::Option::Some("INGRESS"),
9639 Self::Egress => std::option::Option::Some("EGRESS"),
9640 Self::UnknownValue(u) => u.0.name(),
9641 }
9642 }
9643 }
9644
9645 impl std::default::Default for Direction {
9646 fn default() -> Self {
9647 use std::convert::From;
9648 Self::from(0)
9649 }
9650 }
9651
9652 impl std::fmt::Display for Direction {
9653 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9654 wkt::internal::display_enum(f, self.name(), self.value())
9655 }
9656 }
9657
9658 impl std::convert::From<i32> for Direction {
9659 fn from(value: i32) -> Self {
9660 match value {
9661 0 => Self::Unspecified,
9662 1 => Self::Ingress,
9663 2 => Self::Egress,
9664 _ => Self::UnknownValue(direction::UnknownValue(
9665 wkt::internal::UnknownEnumValue::Integer(value),
9666 )),
9667 }
9668 }
9669 }
9670
9671 impl std::convert::From<&str> for Direction {
9672 fn from(value: &str) -> Self {
9673 use std::string::ToString;
9674 match value {
9675 "DIRECTION_UNSPECIFIED" => Self::Unspecified,
9676 "INGRESS" => Self::Ingress,
9677 "EGRESS" => Self::Egress,
9678 _ => Self::UnknownValue(direction::UnknownValue(
9679 wkt::internal::UnknownEnumValue::String(value.to_string()),
9680 )),
9681 }
9682 }
9683 }
9684
9685 impl serde::ser::Serialize for Direction {
9686 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9687 where
9688 S: serde::Serializer,
9689 {
9690 match self {
9691 Self::Unspecified => serializer.serialize_i32(0),
9692 Self::Ingress => serializer.serialize_i32(1),
9693 Self::Egress => serializer.serialize_i32(2),
9694 Self::UnknownValue(u) => u.0.serialize(serializer),
9695 }
9696 }
9697 }
9698
9699 impl<'de> serde::de::Deserialize<'de> for Direction {
9700 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9701 where
9702 D: serde::Deserializer<'de>,
9703 {
9704 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Direction>::new(
9705 ".google.cloud.securitycenter.v2.IpRules.Direction",
9706 ))
9707 }
9708 }
9709
9710 /// The list of allow rules specified by this firewall. Each rule specifies a
9711 /// protocol and port-range tuple that describes a permitted connection.
9712 #[derive(Clone, Debug, PartialEq)]
9713 #[non_exhaustive]
9714 pub enum Rules {
9715 /// Tuple with allowed rules.
9716 Allowed(std::boxed::Box<crate::model::Allowed>),
9717 /// Tuple with denied rules.
9718 Denied(std::boxed::Box<crate::model::Denied>),
9719 }
9720}
9721
9722/// IP rule information.
9723#[derive(Clone, Default, PartialEq)]
9724#[non_exhaustive]
9725pub struct IpRule {
9726 /// The IP protocol this rule applies to. This value can either be one of the
9727 /// following well known protocol strings (TCP, UDP, ICMP, ESP, AH, IPIP,
9728 /// SCTP) or a string representation of the integer value.
9729 pub protocol: std::string::String,
9730
9731 /// Optional. An optional list of ports to which this rule applies. This field
9732 /// is only applicable for the UDP or (S)TCP protocols. Each entry must be
9733 /// either an integer or a range including a min and max port number.
9734 pub port_ranges: std::vec::Vec<crate::model::ip_rule::PortRange>,
9735
9736 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9737}
9738
9739impl IpRule {
9740 /// Creates a new default instance.
9741 pub fn new() -> Self {
9742 std::default::Default::default()
9743 }
9744
9745 /// Sets the value of [protocol][crate::model::IpRule::protocol].
9746 ///
9747 /// # Example
9748 /// ```ignore,no_run
9749 /// # use google_cloud_securitycenter_v2::model::IpRule;
9750 /// let x = IpRule::new().set_protocol("example");
9751 /// ```
9752 pub fn set_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9753 self.protocol = v.into();
9754 self
9755 }
9756
9757 /// Sets the value of [port_ranges][crate::model::IpRule::port_ranges].
9758 ///
9759 /// # Example
9760 /// ```ignore,no_run
9761 /// # use google_cloud_securitycenter_v2::model::IpRule;
9762 /// use google_cloud_securitycenter_v2::model::ip_rule::PortRange;
9763 /// let x = IpRule::new()
9764 /// .set_port_ranges([
9765 /// PortRange::default()/* use setters */,
9766 /// PortRange::default()/* use (different) setters */,
9767 /// ]);
9768 /// ```
9769 pub fn set_port_ranges<T, V>(mut self, v: T) -> Self
9770 where
9771 T: std::iter::IntoIterator<Item = V>,
9772 V: std::convert::Into<crate::model::ip_rule::PortRange>,
9773 {
9774 use std::iter::Iterator;
9775 self.port_ranges = v.into_iter().map(|i| i.into()).collect();
9776 self
9777 }
9778}
9779
9780impl wkt::message::Message for IpRule {
9781 fn typename() -> &'static str {
9782 "type.googleapis.com/google.cloud.securitycenter.v2.IpRule"
9783 }
9784}
9785
9786/// Defines additional types related to [IpRule].
9787pub mod ip_rule {
9788 #[allow(unused_imports)]
9789 use super::*;
9790
9791 /// A port range which is inclusive of the min and max values.
9792 /// Values are between 0 and 2^16-1. The max can be equal / must be not smaller
9793 /// than the min value. If min and max are equal this indicates that it is a
9794 /// single port.
9795 #[derive(Clone, Default, PartialEq)]
9796 #[non_exhaustive]
9797 pub struct PortRange {
9798 /// Minimum port value.
9799 pub min: i64,
9800
9801 /// Maximum port value.
9802 pub max: i64,
9803
9804 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9805 }
9806
9807 impl PortRange {
9808 /// Creates a new default instance.
9809 pub fn new() -> Self {
9810 std::default::Default::default()
9811 }
9812
9813 /// Sets the value of [min][crate::model::ip_rule::PortRange::min].
9814 ///
9815 /// # Example
9816 /// ```ignore,no_run
9817 /// # use google_cloud_securitycenter_v2::model::ip_rule::PortRange;
9818 /// let x = PortRange::new().set_min(42);
9819 /// ```
9820 pub fn set_min<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9821 self.min = v.into();
9822 self
9823 }
9824
9825 /// Sets the value of [max][crate::model::ip_rule::PortRange::max].
9826 ///
9827 /// # Example
9828 /// ```ignore,no_run
9829 /// # use google_cloud_securitycenter_v2::model::ip_rule::PortRange;
9830 /// let x = PortRange::new().set_max(42);
9831 /// ```
9832 pub fn set_max<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9833 self.max = v.into();
9834 self
9835 }
9836 }
9837
9838 impl wkt::message::Message for PortRange {
9839 fn typename() -> &'static str {
9840 "type.googleapis.com/google.cloud.securitycenter.v2.IpRule.PortRange"
9841 }
9842 }
9843}
9844
9845/// Allowed IP rule.
9846#[derive(Clone, Default, PartialEq)]
9847#[non_exhaustive]
9848pub struct Allowed {
9849 /// Optional. Optional list of allowed IP rules.
9850 pub ip_rules: std::vec::Vec<crate::model::IpRule>,
9851
9852 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9853}
9854
9855impl Allowed {
9856 /// Creates a new default instance.
9857 pub fn new() -> Self {
9858 std::default::Default::default()
9859 }
9860
9861 /// Sets the value of [ip_rules][crate::model::Allowed::ip_rules].
9862 ///
9863 /// # Example
9864 /// ```ignore,no_run
9865 /// # use google_cloud_securitycenter_v2::model::Allowed;
9866 /// use google_cloud_securitycenter_v2::model::IpRule;
9867 /// let x = Allowed::new()
9868 /// .set_ip_rules([
9869 /// IpRule::default()/* use setters */,
9870 /// IpRule::default()/* use (different) setters */,
9871 /// ]);
9872 /// ```
9873 pub fn set_ip_rules<T, V>(mut self, v: T) -> Self
9874 where
9875 T: std::iter::IntoIterator<Item = V>,
9876 V: std::convert::Into<crate::model::IpRule>,
9877 {
9878 use std::iter::Iterator;
9879 self.ip_rules = v.into_iter().map(|i| i.into()).collect();
9880 self
9881 }
9882}
9883
9884impl wkt::message::Message for Allowed {
9885 fn typename() -> &'static str {
9886 "type.googleapis.com/google.cloud.securitycenter.v2.Allowed"
9887 }
9888}
9889
9890/// Denied IP rule.
9891#[derive(Clone, Default, PartialEq)]
9892#[non_exhaustive]
9893pub struct Denied {
9894 /// Optional. Optional list of denied IP rules.
9895 pub ip_rules: std::vec::Vec<crate::model::IpRule>,
9896
9897 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9898}
9899
9900impl Denied {
9901 /// Creates a new default instance.
9902 pub fn new() -> Self {
9903 std::default::Default::default()
9904 }
9905
9906 /// Sets the value of [ip_rules][crate::model::Denied::ip_rules].
9907 ///
9908 /// # Example
9909 /// ```ignore,no_run
9910 /// # use google_cloud_securitycenter_v2::model::Denied;
9911 /// use google_cloud_securitycenter_v2::model::IpRule;
9912 /// let x = Denied::new()
9913 /// .set_ip_rules([
9914 /// IpRule::default()/* use setters */,
9915 /// IpRule::default()/* use (different) setters */,
9916 /// ]);
9917 /// ```
9918 pub fn set_ip_rules<T, V>(mut self, v: T) -> Self
9919 where
9920 T: std::iter::IntoIterator<Item = V>,
9921 V: std::convert::Into<crate::model::IpRule>,
9922 {
9923 use std::iter::Iterator;
9924 self.ip_rules = v.into_iter().map(|i| i.into()).collect();
9925 self
9926 }
9927}
9928
9929impl wkt::message::Message for Denied {
9930 fn typename() -> &'static str {
9931 "type.googleapis.com/google.cloud.securitycenter.v2.Denied"
9932 }
9933}
9934
9935/// Describes a job
9936#[derive(Clone, Default, PartialEq)]
9937#[non_exhaustive]
9938pub struct Job {
9939 /// The fully-qualified name for a job.
9940 /// e.g. `projects/<project_id>/jobs/<job_id>`
9941 pub name: std::string::String,
9942
9943 /// Output only. State of the job, such as `RUNNING` or `PENDING`.
9944 pub state: crate::model::JobState,
9945
9946 /// Optional. If the job did not complete successfully, this field describes
9947 /// why.
9948 pub error_code: i32,
9949
9950 /// Optional. Gives the location where the job ran, such as `US` or
9951 /// `europe-west1`
9952 pub location: std::string::String,
9953
9954 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9955}
9956
9957impl Job {
9958 /// Creates a new default instance.
9959 pub fn new() -> Self {
9960 std::default::Default::default()
9961 }
9962
9963 /// Sets the value of [name][crate::model::Job::name].
9964 ///
9965 /// # Example
9966 /// ```ignore,no_run
9967 /// # use google_cloud_securitycenter_v2::model::Job;
9968 /// let x = Job::new().set_name("example");
9969 /// ```
9970 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9971 self.name = v.into();
9972 self
9973 }
9974
9975 /// Sets the value of [state][crate::model::Job::state].
9976 ///
9977 /// # Example
9978 /// ```ignore,no_run
9979 /// # use google_cloud_securitycenter_v2::model::Job;
9980 /// use google_cloud_securitycenter_v2::model::JobState;
9981 /// let x0 = Job::new().set_state(JobState::Pending);
9982 /// let x1 = Job::new().set_state(JobState::Running);
9983 /// let x2 = Job::new().set_state(JobState::Succeeded);
9984 /// ```
9985 pub fn set_state<T: std::convert::Into<crate::model::JobState>>(mut self, v: T) -> Self {
9986 self.state = v.into();
9987 self
9988 }
9989
9990 /// Sets the value of [error_code][crate::model::Job::error_code].
9991 ///
9992 /// # Example
9993 /// ```ignore,no_run
9994 /// # use google_cloud_securitycenter_v2::model::Job;
9995 /// let x = Job::new().set_error_code(42);
9996 /// ```
9997 pub fn set_error_code<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9998 self.error_code = v.into();
9999 self
10000 }
10001
10002 /// Sets the value of [location][crate::model::Job::location].
10003 ///
10004 /// # Example
10005 /// ```ignore,no_run
10006 /// # use google_cloud_securitycenter_v2::model::Job;
10007 /// let x = Job::new().set_location("example");
10008 /// ```
10009 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10010 self.location = v.into();
10011 self
10012 }
10013}
10014
10015impl wkt::message::Message for Job {
10016 fn typename() -> &'static str {
10017 "type.googleapis.com/google.cloud.securitycenter.v2.Job"
10018 }
10019}
10020
10021/// Kernel mode rootkit signatures.
10022#[derive(Clone, Default, PartialEq)]
10023#[non_exhaustive]
10024pub struct KernelRootkit {
10025 /// Rootkit name, when available.
10026 pub name: std::string::String,
10027
10028 /// True if unexpected modifications of kernel code memory are present.
10029 pub unexpected_code_modification: bool,
10030
10031 /// True if unexpected modifications of kernel read-only data memory are
10032 /// present.
10033 pub unexpected_read_only_data_modification: bool,
10034
10035 /// True if `ftrace` points are present with callbacks pointing to regions
10036 /// that are not in the expected kernel or module code range.
10037 pub unexpected_ftrace_handler: bool,
10038
10039 /// True if `kprobe` points are present with callbacks pointing to regions
10040 /// that are not in the expected kernel or module code range.
10041 pub unexpected_kprobe_handler: bool,
10042
10043 /// True if kernel code pages that are not in the expected kernel or module
10044 /// code regions are present.
10045 pub unexpected_kernel_code_pages: bool,
10046
10047 /// True if system call handlers that are are not in the expected kernel or
10048 /// module code regions are present.
10049 pub unexpected_system_call_handler: bool,
10050
10051 /// True if interrupt handlers that are are not in the expected kernel or
10052 /// module code regions are present.
10053 pub unexpected_interrupt_handler: bool,
10054
10055 /// True if unexpected processes in the scheduler run queue are present. Such
10056 /// processes are in the run queue, but not in the process task list.
10057 pub unexpected_processes_in_runqueue: bool,
10058
10059 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10060}
10061
10062impl KernelRootkit {
10063 /// Creates a new default instance.
10064 pub fn new() -> Self {
10065 std::default::Default::default()
10066 }
10067
10068 /// Sets the value of [name][crate::model::KernelRootkit::name].
10069 ///
10070 /// # Example
10071 /// ```ignore,no_run
10072 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10073 /// let x = KernelRootkit::new().set_name("example");
10074 /// ```
10075 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10076 self.name = v.into();
10077 self
10078 }
10079
10080 /// Sets the value of [unexpected_code_modification][crate::model::KernelRootkit::unexpected_code_modification].
10081 ///
10082 /// # Example
10083 /// ```ignore,no_run
10084 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10085 /// let x = KernelRootkit::new().set_unexpected_code_modification(true);
10086 /// ```
10087 pub fn set_unexpected_code_modification<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10088 self.unexpected_code_modification = v.into();
10089 self
10090 }
10091
10092 /// Sets the value of [unexpected_read_only_data_modification][crate::model::KernelRootkit::unexpected_read_only_data_modification].
10093 ///
10094 /// # Example
10095 /// ```ignore,no_run
10096 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10097 /// let x = KernelRootkit::new().set_unexpected_read_only_data_modification(true);
10098 /// ```
10099 pub fn set_unexpected_read_only_data_modification<T: std::convert::Into<bool>>(
10100 mut self,
10101 v: T,
10102 ) -> Self {
10103 self.unexpected_read_only_data_modification = v.into();
10104 self
10105 }
10106
10107 /// Sets the value of [unexpected_ftrace_handler][crate::model::KernelRootkit::unexpected_ftrace_handler].
10108 ///
10109 /// # Example
10110 /// ```ignore,no_run
10111 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10112 /// let x = KernelRootkit::new().set_unexpected_ftrace_handler(true);
10113 /// ```
10114 pub fn set_unexpected_ftrace_handler<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10115 self.unexpected_ftrace_handler = v.into();
10116 self
10117 }
10118
10119 /// Sets the value of [unexpected_kprobe_handler][crate::model::KernelRootkit::unexpected_kprobe_handler].
10120 ///
10121 /// # Example
10122 /// ```ignore,no_run
10123 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10124 /// let x = KernelRootkit::new().set_unexpected_kprobe_handler(true);
10125 /// ```
10126 pub fn set_unexpected_kprobe_handler<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10127 self.unexpected_kprobe_handler = v.into();
10128 self
10129 }
10130
10131 /// Sets the value of [unexpected_kernel_code_pages][crate::model::KernelRootkit::unexpected_kernel_code_pages].
10132 ///
10133 /// # Example
10134 /// ```ignore,no_run
10135 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10136 /// let x = KernelRootkit::new().set_unexpected_kernel_code_pages(true);
10137 /// ```
10138 pub fn set_unexpected_kernel_code_pages<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10139 self.unexpected_kernel_code_pages = v.into();
10140 self
10141 }
10142
10143 /// Sets the value of [unexpected_system_call_handler][crate::model::KernelRootkit::unexpected_system_call_handler].
10144 ///
10145 /// # Example
10146 /// ```ignore,no_run
10147 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10148 /// let x = KernelRootkit::new().set_unexpected_system_call_handler(true);
10149 /// ```
10150 pub fn set_unexpected_system_call_handler<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10151 self.unexpected_system_call_handler = v.into();
10152 self
10153 }
10154
10155 /// Sets the value of [unexpected_interrupt_handler][crate::model::KernelRootkit::unexpected_interrupt_handler].
10156 ///
10157 /// # Example
10158 /// ```ignore,no_run
10159 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10160 /// let x = KernelRootkit::new().set_unexpected_interrupt_handler(true);
10161 /// ```
10162 pub fn set_unexpected_interrupt_handler<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10163 self.unexpected_interrupt_handler = v.into();
10164 self
10165 }
10166
10167 /// Sets the value of [unexpected_processes_in_runqueue][crate::model::KernelRootkit::unexpected_processes_in_runqueue].
10168 ///
10169 /// # Example
10170 /// ```ignore,no_run
10171 /// # use google_cloud_securitycenter_v2::model::KernelRootkit;
10172 /// let x = KernelRootkit::new().set_unexpected_processes_in_runqueue(true);
10173 /// ```
10174 pub fn set_unexpected_processes_in_runqueue<T: std::convert::Into<bool>>(
10175 mut self,
10176 v: T,
10177 ) -> Self {
10178 self.unexpected_processes_in_runqueue = v.into();
10179 self
10180 }
10181}
10182
10183impl wkt::message::Message for KernelRootkit {
10184 fn typename() -> &'static str {
10185 "type.googleapis.com/google.cloud.securitycenter.v2.KernelRootkit"
10186 }
10187}
10188
10189/// Kubernetes-related attributes.
10190#[derive(Clone, Default, PartialEq)]
10191#[non_exhaustive]
10192pub struct Kubernetes {
10193 /// Kubernetes
10194 /// [Pods](https://cloud.google.com/kubernetes-engine/docs/concepts/pod)
10195 /// associated with the finding. This field contains Pod records for each
10196 /// container that is owned by a Pod.
10197 pub pods: std::vec::Vec<crate::model::kubernetes::Pod>,
10198
10199 /// Provides Kubernetes
10200 /// [node](https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture#nodes)
10201 /// information.
10202 pub nodes: std::vec::Vec<crate::model::kubernetes::Node>,
10203
10204 /// GKE [node
10205 /// pools](https://cloud.google.com/kubernetes-engine/docs/concepts/node-pools)
10206 /// associated with the finding. This field contains node pool information for
10207 /// each node, when it is available.
10208 pub node_pools: std::vec::Vec<crate::model::kubernetes::NodePool>,
10209
10210 /// Provides Kubernetes role information for findings that involve [Roles or
10211 /// ClusterRoles](https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control).
10212 pub roles: std::vec::Vec<crate::model::kubernetes::Role>,
10213
10214 /// Provides Kubernetes role binding information for findings that involve
10215 /// [RoleBindings or
10216 /// ClusterRoleBindings](https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control).
10217 pub bindings: std::vec::Vec<crate::model::kubernetes::Binding>,
10218
10219 /// Provides information on any Kubernetes access reviews (privilege checks)
10220 /// relevant to the finding.
10221 pub access_reviews: std::vec::Vec<crate::model::kubernetes::AccessReview>,
10222
10223 /// Kubernetes objects related to the finding.
10224 pub objects: std::vec::Vec<crate::model::kubernetes::Object>,
10225
10226 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10227}
10228
10229impl Kubernetes {
10230 /// Creates a new default instance.
10231 pub fn new() -> Self {
10232 std::default::Default::default()
10233 }
10234
10235 /// Sets the value of [pods][crate::model::Kubernetes::pods].
10236 ///
10237 /// # Example
10238 /// ```ignore,no_run
10239 /// # use google_cloud_securitycenter_v2::model::Kubernetes;
10240 /// use google_cloud_securitycenter_v2::model::kubernetes::Pod;
10241 /// let x = Kubernetes::new()
10242 /// .set_pods([
10243 /// Pod::default()/* use setters */,
10244 /// Pod::default()/* use (different) setters */,
10245 /// ]);
10246 /// ```
10247 pub fn set_pods<T, V>(mut self, v: T) -> Self
10248 where
10249 T: std::iter::IntoIterator<Item = V>,
10250 V: std::convert::Into<crate::model::kubernetes::Pod>,
10251 {
10252 use std::iter::Iterator;
10253 self.pods = v.into_iter().map(|i| i.into()).collect();
10254 self
10255 }
10256
10257 /// Sets the value of [nodes][crate::model::Kubernetes::nodes].
10258 ///
10259 /// # Example
10260 /// ```ignore,no_run
10261 /// # use google_cloud_securitycenter_v2::model::Kubernetes;
10262 /// use google_cloud_securitycenter_v2::model::kubernetes::Node;
10263 /// let x = Kubernetes::new()
10264 /// .set_nodes([
10265 /// Node::default()/* use setters */,
10266 /// Node::default()/* use (different) setters */,
10267 /// ]);
10268 /// ```
10269 pub fn set_nodes<T, V>(mut self, v: T) -> Self
10270 where
10271 T: std::iter::IntoIterator<Item = V>,
10272 V: std::convert::Into<crate::model::kubernetes::Node>,
10273 {
10274 use std::iter::Iterator;
10275 self.nodes = v.into_iter().map(|i| i.into()).collect();
10276 self
10277 }
10278
10279 /// Sets the value of [node_pools][crate::model::Kubernetes::node_pools].
10280 ///
10281 /// # Example
10282 /// ```ignore,no_run
10283 /// # use google_cloud_securitycenter_v2::model::Kubernetes;
10284 /// use google_cloud_securitycenter_v2::model::kubernetes::NodePool;
10285 /// let x = Kubernetes::new()
10286 /// .set_node_pools([
10287 /// NodePool::default()/* use setters */,
10288 /// NodePool::default()/* use (different) setters */,
10289 /// ]);
10290 /// ```
10291 pub fn set_node_pools<T, V>(mut self, v: T) -> Self
10292 where
10293 T: std::iter::IntoIterator<Item = V>,
10294 V: std::convert::Into<crate::model::kubernetes::NodePool>,
10295 {
10296 use std::iter::Iterator;
10297 self.node_pools = v.into_iter().map(|i| i.into()).collect();
10298 self
10299 }
10300
10301 /// Sets the value of [roles][crate::model::Kubernetes::roles].
10302 ///
10303 /// # Example
10304 /// ```ignore,no_run
10305 /// # use google_cloud_securitycenter_v2::model::Kubernetes;
10306 /// use google_cloud_securitycenter_v2::model::kubernetes::Role;
10307 /// let x = Kubernetes::new()
10308 /// .set_roles([
10309 /// Role::default()/* use setters */,
10310 /// Role::default()/* use (different) setters */,
10311 /// ]);
10312 /// ```
10313 pub fn set_roles<T, V>(mut self, v: T) -> Self
10314 where
10315 T: std::iter::IntoIterator<Item = V>,
10316 V: std::convert::Into<crate::model::kubernetes::Role>,
10317 {
10318 use std::iter::Iterator;
10319 self.roles = v.into_iter().map(|i| i.into()).collect();
10320 self
10321 }
10322
10323 /// Sets the value of [bindings][crate::model::Kubernetes::bindings].
10324 ///
10325 /// # Example
10326 /// ```ignore,no_run
10327 /// # use google_cloud_securitycenter_v2::model::Kubernetes;
10328 /// use google_cloud_securitycenter_v2::model::kubernetes::Binding;
10329 /// let x = Kubernetes::new()
10330 /// .set_bindings([
10331 /// Binding::default()/* use setters */,
10332 /// Binding::default()/* use (different) setters */,
10333 /// ]);
10334 /// ```
10335 pub fn set_bindings<T, V>(mut self, v: T) -> Self
10336 where
10337 T: std::iter::IntoIterator<Item = V>,
10338 V: std::convert::Into<crate::model::kubernetes::Binding>,
10339 {
10340 use std::iter::Iterator;
10341 self.bindings = v.into_iter().map(|i| i.into()).collect();
10342 self
10343 }
10344
10345 /// Sets the value of [access_reviews][crate::model::Kubernetes::access_reviews].
10346 ///
10347 /// # Example
10348 /// ```ignore,no_run
10349 /// # use google_cloud_securitycenter_v2::model::Kubernetes;
10350 /// use google_cloud_securitycenter_v2::model::kubernetes::AccessReview;
10351 /// let x = Kubernetes::new()
10352 /// .set_access_reviews([
10353 /// AccessReview::default()/* use setters */,
10354 /// AccessReview::default()/* use (different) setters */,
10355 /// ]);
10356 /// ```
10357 pub fn set_access_reviews<T, V>(mut self, v: T) -> Self
10358 where
10359 T: std::iter::IntoIterator<Item = V>,
10360 V: std::convert::Into<crate::model::kubernetes::AccessReview>,
10361 {
10362 use std::iter::Iterator;
10363 self.access_reviews = v.into_iter().map(|i| i.into()).collect();
10364 self
10365 }
10366
10367 /// Sets the value of [objects][crate::model::Kubernetes::objects].
10368 ///
10369 /// # Example
10370 /// ```ignore,no_run
10371 /// # use google_cloud_securitycenter_v2::model::Kubernetes;
10372 /// use google_cloud_securitycenter_v2::model::kubernetes::Object;
10373 /// let x = Kubernetes::new()
10374 /// .set_objects([
10375 /// Object::default()/* use setters */,
10376 /// Object::default()/* use (different) setters */,
10377 /// ]);
10378 /// ```
10379 pub fn set_objects<T, V>(mut self, v: T) -> Self
10380 where
10381 T: std::iter::IntoIterator<Item = V>,
10382 V: std::convert::Into<crate::model::kubernetes::Object>,
10383 {
10384 use std::iter::Iterator;
10385 self.objects = v.into_iter().map(|i| i.into()).collect();
10386 self
10387 }
10388}
10389
10390impl wkt::message::Message for Kubernetes {
10391 fn typename() -> &'static str {
10392 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes"
10393 }
10394}
10395
10396/// Defines additional types related to [Kubernetes].
10397pub mod kubernetes {
10398 #[allow(unused_imports)]
10399 use super::*;
10400
10401 /// A Kubernetes Pod.
10402 #[derive(Clone, Default, PartialEq)]
10403 #[non_exhaustive]
10404 pub struct Pod {
10405 /// Kubernetes Pod namespace.
10406 pub ns: std::string::String,
10407
10408 /// Kubernetes Pod name.
10409 pub name: std::string::String,
10410
10411 /// Pod labels. For Kubernetes containers, these are applied to the
10412 /// container.
10413 pub labels: std::vec::Vec<crate::model::Label>,
10414
10415 /// Pod containers associated with this finding, if any.
10416 pub containers: std::vec::Vec<crate::model::Container>,
10417
10418 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10419 }
10420
10421 impl Pod {
10422 /// Creates a new default instance.
10423 pub fn new() -> Self {
10424 std::default::Default::default()
10425 }
10426
10427 /// Sets the value of [ns][crate::model::kubernetes::Pod::ns].
10428 ///
10429 /// # Example
10430 /// ```ignore,no_run
10431 /// # use google_cloud_securitycenter_v2::model::kubernetes::Pod;
10432 /// let x = Pod::new().set_ns("example");
10433 /// ```
10434 pub fn set_ns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10435 self.ns = v.into();
10436 self
10437 }
10438
10439 /// Sets the value of [name][crate::model::kubernetes::Pod::name].
10440 ///
10441 /// # Example
10442 /// ```ignore,no_run
10443 /// # use google_cloud_securitycenter_v2::model::kubernetes::Pod;
10444 /// let x = Pod::new().set_name("example");
10445 /// ```
10446 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10447 self.name = v.into();
10448 self
10449 }
10450
10451 /// Sets the value of [labels][crate::model::kubernetes::Pod::labels].
10452 ///
10453 /// # Example
10454 /// ```ignore,no_run
10455 /// # use google_cloud_securitycenter_v2::model::kubernetes::Pod;
10456 /// use google_cloud_securitycenter_v2::model::Label;
10457 /// let x = Pod::new()
10458 /// .set_labels([
10459 /// Label::default()/* use setters */,
10460 /// Label::default()/* use (different) setters */,
10461 /// ]);
10462 /// ```
10463 pub fn set_labels<T, V>(mut self, v: T) -> Self
10464 where
10465 T: std::iter::IntoIterator<Item = V>,
10466 V: std::convert::Into<crate::model::Label>,
10467 {
10468 use std::iter::Iterator;
10469 self.labels = v.into_iter().map(|i| i.into()).collect();
10470 self
10471 }
10472
10473 /// Sets the value of [containers][crate::model::kubernetes::Pod::containers].
10474 ///
10475 /// # Example
10476 /// ```ignore,no_run
10477 /// # use google_cloud_securitycenter_v2::model::kubernetes::Pod;
10478 /// use google_cloud_securitycenter_v2::model::Container;
10479 /// let x = Pod::new()
10480 /// .set_containers([
10481 /// Container::default()/* use setters */,
10482 /// Container::default()/* use (different) setters */,
10483 /// ]);
10484 /// ```
10485 pub fn set_containers<T, V>(mut self, v: T) -> Self
10486 where
10487 T: std::iter::IntoIterator<Item = V>,
10488 V: std::convert::Into<crate::model::Container>,
10489 {
10490 use std::iter::Iterator;
10491 self.containers = v.into_iter().map(|i| i.into()).collect();
10492 self
10493 }
10494 }
10495
10496 impl wkt::message::Message for Pod {
10497 fn typename() -> &'static str {
10498 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.Pod"
10499 }
10500 }
10501
10502 /// Kubernetes nodes associated with the finding.
10503 #[derive(Clone, Default, PartialEq)]
10504 #[non_exhaustive]
10505 pub struct Node {
10506 /// [Full resource name](https://google.aip.dev/122#full-resource-names) of
10507 /// the Compute Engine VM running the cluster node.
10508 pub name: std::string::String,
10509
10510 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10511 }
10512
10513 impl Node {
10514 /// Creates a new default instance.
10515 pub fn new() -> Self {
10516 std::default::Default::default()
10517 }
10518
10519 /// Sets the value of [name][crate::model::kubernetes::Node::name].
10520 ///
10521 /// # Example
10522 /// ```ignore,no_run
10523 /// # use google_cloud_securitycenter_v2::model::kubernetes::Node;
10524 /// let x = Node::new().set_name("example");
10525 /// ```
10526 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10527 self.name = v.into();
10528 self
10529 }
10530 }
10531
10532 impl wkt::message::Message for Node {
10533 fn typename() -> &'static str {
10534 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.Node"
10535 }
10536 }
10537
10538 /// Provides GKE node pool information.
10539 #[derive(Clone, Default, PartialEq)]
10540 #[non_exhaustive]
10541 pub struct NodePool {
10542 /// Kubernetes node pool name.
10543 pub name: std::string::String,
10544
10545 /// Nodes associated with the finding.
10546 pub nodes: std::vec::Vec<crate::model::kubernetes::Node>,
10547
10548 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10549 }
10550
10551 impl NodePool {
10552 /// Creates a new default instance.
10553 pub fn new() -> Self {
10554 std::default::Default::default()
10555 }
10556
10557 /// Sets the value of [name][crate::model::kubernetes::NodePool::name].
10558 ///
10559 /// # Example
10560 /// ```ignore,no_run
10561 /// # use google_cloud_securitycenter_v2::model::kubernetes::NodePool;
10562 /// let x = NodePool::new().set_name("example");
10563 /// ```
10564 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10565 self.name = v.into();
10566 self
10567 }
10568
10569 /// Sets the value of [nodes][crate::model::kubernetes::NodePool::nodes].
10570 ///
10571 /// # Example
10572 /// ```ignore,no_run
10573 /// # use google_cloud_securitycenter_v2::model::kubernetes::NodePool;
10574 /// use google_cloud_securitycenter_v2::model::kubernetes::Node;
10575 /// let x = NodePool::new()
10576 /// .set_nodes([
10577 /// Node::default()/* use setters */,
10578 /// Node::default()/* use (different) setters */,
10579 /// ]);
10580 /// ```
10581 pub fn set_nodes<T, V>(mut self, v: T) -> Self
10582 where
10583 T: std::iter::IntoIterator<Item = V>,
10584 V: std::convert::Into<crate::model::kubernetes::Node>,
10585 {
10586 use std::iter::Iterator;
10587 self.nodes = v.into_iter().map(|i| i.into()).collect();
10588 self
10589 }
10590 }
10591
10592 impl wkt::message::Message for NodePool {
10593 fn typename() -> &'static str {
10594 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.NodePool"
10595 }
10596 }
10597
10598 /// Kubernetes Role or ClusterRole.
10599 #[derive(Clone, Default, PartialEq)]
10600 #[non_exhaustive]
10601 pub struct Role {
10602 /// Role type.
10603 pub kind: crate::model::kubernetes::role::Kind,
10604
10605 /// Role namespace.
10606 pub ns: std::string::String,
10607
10608 /// Role name.
10609 pub name: std::string::String,
10610
10611 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10612 }
10613
10614 impl Role {
10615 /// Creates a new default instance.
10616 pub fn new() -> Self {
10617 std::default::Default::default()
10618 }
10619
10620 /// Sets the value of [kind][crate::model::kubernetes::Role::kind].
10621 ///
10622 /// # Example
10623 /// ```ignore,no_run
10624 /// # use google_cloud_securitycenter_v2::model::kubernetes::Role;
10625 /// use google_cloud_securitycenter_v2::model::kubernetes::role::Kind;
10626 /// let x0 = Role::new().set_kind(Kind::Role);
10627 /// let x1 = Role::new().set_kind(Kind::ClusterRole);
10628 /// ```
10629 pub fn set_kind<T: std::convert::Into<crate::model::kubernetes::role::Kind>>(
10630 mut self,
10631 v: T,
10632 ) -> Self {
10633 self.kind = v.into();
10634 self
10635 }
10636
10637 /// Sets the value of [ns][crate::model::kubernetes::Role::ns].
10638 ///
10639 /// # Example
10640 /// ```ignore,no_run
10641 /// # use google_cloud_securitycenter_v2::model::kubernetes::Role;
10642 /// let x = Role::new().set_ns("example");
10643 /// ```
10644 pub fn set_ns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10645 self.ns = v.into();
10646 self
10647 }
10648
10649 /// Sets the value of [name][crate::model::kubernetes::Role::name].
10650 ///
10651 /// # Example
10652 /// ```ignore,no_run
10653 /// # use google_cloud_securitycenter_v2::model::kubernetes::Role;
10654 /// let x = Role::new().set_name("example");
10655 /// ```
10656 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10657 self.name = v.into();
10658 self
10659 }
10660 }
10661
10662 impl wkt::message::Message for Role {
10663 fn typename() -> &'static str {
10664 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.Role"
10665 }
10666 }
10667
10668 /// Defines additional types related to [Role].
10669 pub mod role {
10670 #[allow(unused_imports)]
10671 use super::*;
10672
10673 /// Types of Kubernetes roles.
10674 ///
10675 /// # Working with unknown values
10676 ///
10677 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10678 /// additional enum variants at any time. Adding new variants is not considered
10679 /// a breaking change. Applications should write their code in anticipation of:
10680 ///
10681 /// - New values appearing in future releases of the client library, **and**
10682 /// - New values received dynamically, without application changes.
10683 ///
10684 /// Please consult the [Working with enums] section in the user guide for some
10685 /// guidelines.
10686 ///
10687 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10688 #[derive(Clone, Debug, PartialEq)]
10689 #[non_exhaustive]
10690 pub enum Kind {
10691 /// Role type is not specified.
10692 Unspecified,
10693 /// Kubernetes Role.
10694 Role,
10695 /// Kubernetes ClusterRole.
10696 ClusterRole,
10697 /// If set, the enum was initialized with an unknown value.
10698 ///
10699 /// Applications can examine the value using [Kind::value] or
10700 /// [Kind::name].
10701 UnknownValue(kind::UnknownValue),
10702 }
10703
10704 #[doc(hidden)]
10705 pub mod kind {
10706 #[allow(unused_imports)]
10707 use super::*;
10708 #[derive(Clone, Debug, PartialEq)]
10709 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10710 }
10711
10712 impl Kind {
10713 /// Gets the enum value.
10714 ///
10715 /// Returns `None` if the enum contains an unknown value deserialized from
10716 /// the string representation of enums.
10717 pub fn value(&self) -> std::option::Option<i32> {
10718 match self {
10719 Self::Unspecified => std::option::Option::Some(0),
10720 Self::Role => std::option::Option::Some(1),
10721 Self::ClusterRole => std::option::Option::Some(2),
10722 Self::UnknownValue(u) => u.0.value(),
10723 }
10724 }
10725
10726 /// Gets the enum value as a string.
10727 ///
10728 /// Returns `None` if the enum contains an unknown value deserialized from
10729 /// the integer representation of enums.
10730 pub fn name(&self) -> std::option::Option<&str> {
10731 match self {
10732 Self::Unspecified => std::option::Option::Some("KIND_UNSPECIFIED"),
10733 Self::Role => std::option::Option::Some("ROLE"),
10734 Self::ClusterRole => std::option::Option::Some("CLUSTER_ROLE"),
10735 Self::UnknownValue(u) => u.0.name(),
10736 }
10737 }
10738 }
10739
10740 impl std::default::Default for Kind {
10741 fn default() -> Self {
10742 use std::convert::From;
10743 Self::from(0)
10744 }
10745 }
10746
10747 impl std::fmt::Display for Kind {
10748 fn fmt(
10749 &self,
10750 f: &mut std::fmt::Formatter<'_>,
10751 ) -> std::result::Result<(), std::fmt::Error> {
10752 wkt::internal::display_enum(f, self.name(), self.value())
10753 }
10754 }
10755
10756 impl std::convert::From<i32> for Kind {
10757 fn from(value: i32) -> Self {
10758 match value {
10759 0 => Self::Unspecified,
10760 1 => Self::Role,
10761 2 => Self::ClusterRole,
10762 _ => Self::UnknownValue(kind::UnknownValue(
10763 wkt::internal::UnknownEnumValue::Integer(value),
10764 )),
10765 }
10766 }
10767 }
10768
10769 impl std::convert::From<&str> for Kind {
10770 fn from(value: &str) -> Self {
10771 use std::string::ToString;
10772 match value {
10773 "KIND_UNSPECIFIED" => Self::Unspecified,
10774 "ROLE" => Self::Role,
10775 "CLUSTER_ROLE" => Self::ClusterRole,
10776 _ => Self::UnknownValue(kind::UnknownValue(
10777 wkt::internal::UnknownEnumValue::String(value.to_string()),
10778 )),
10779 }
10780 }
10781 }
10782
10783 impl serde::ser::Serialize for Kind {
10784 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10785 where
10786 S: serde::Serializer,
10787 {
10788 match self {
10789 Self::Unspecified => serializer.serialize_i32(0),
10790 Self::Role => serializer.serialize_i32(1),
10791 Self::ClusterRole => serializer.serialize_i32(2),
10792 Self::UnknownValue(u) => u.0.serialize(serializer),
10793 }
10794 }
10795 }
10796
10797 impl<'de> serde::de::Deserialize<'de> for Kind {
10798 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10799 where
10800 D: serde::Deserializer<'de>,
10801 {
10802 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Kind>::new(
10803 ".google.cloud.securitycenter.v2.Kubernetes.Role.Kind",
10804 ))
10805 }
10806 }
10807 }
10808
10809 /// Represents a Kubernetes RoleBinding or ClusterRoleBinding.
10810 #[derive(Clone, Default, PartialEq)]
10811 #[non_exhaustive]
10812 pub struct Binding {
10813 /// Namespace for the binding.
10814 pub ns: std::string::String,
10815
10816 /// Name for the binding.
10817 pub name: std::string::String,
10818
10819 /// The Role or ClusterRole referenced by the binding.
10820 pub role: std::option::Option<crate::model::kubernetes::Role>,
10821
10822 /// Represents one or more subjects that are bound to the role. Not always
10823 /// available for PATCH requests.
10824 pub subjects: std::vec::Vec<crate::model::kubernetes::Subject>,
10825
10826 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10827 }
10828
10829 impl Binding {
10830 /// Creates a new default instance.
10831 pub fn new() -> Self {
10832 std::default::Default::default()
10833 }
10834
10835 /// Sets the value of [ns][crate::model::kubernetes::Binding::ns].
10836 ///
10837 /// # Example
10838 /// ```ignore,no_run
10839 /// # use google_cloud_securitycenter_v2::model::kubernetes::Binding;
10840 /// let x = Binding::new().set_ns("example");
10841 /// ```
10842 pub fn set_ns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10843 self.ns = v.into();
10844 self
10845 }
10846
10847 /// Sets the value of [name][crate::model::kubernetes::Binding::name].
10848 ///
10849 /// # Example
10850 /// ```ignore,no_run
10851 /// # use google_cloud_securitycenter_v2::model::kubernetes::Binding;
10852 /// let x = Binding::new().set_name("example");
10853 /// ```
10854 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10855 self.name = v.into();
10856 self
10857 }
10858
10859 /// Sets the value of [role][crate::model::kubernetes::Binding::role].
10860 ///
10861 /// # Example
10862 /// ```ignore,no_run
10863 /// # use google_cloud_securitycenter_v2::model::kubernetes::Binding;
10864 /// use google_cloud_securitycenter_v2::model::kubernetes::Role;
10865 /// let x = Binding::new().set_role(Role::default()/* use setters */);
10866 /// ```
10867 pub fn set_role<T>(mut self, v: T) -> Self
10868 where
10869 T: std::convert::Into<crate::model::kubernetes::Role>,
10870 {
10871 self.role = std::option::Option::Some(v.into());
10872 self
10873 }
10874
10875 /// Sets or clears the value of [role][crate::model::kubernetes::Binding::role].
10876 ///
10877 /// # Example
10878 /// ```ignore,no_run
10879 /// # use google_cloud_securitycenter_v2::model::kubernetes::Binding;
10880 /// use google_cloud_securitycenter_v2::model::kubernetes::Role;
10881 /// let x = Binding::new().set_or_clear_role(Some(Role::default()/* use setters */));
10882 /// let x = Binding::new().set_or_clear_role(None::<Role>);
10883 /// ```
10884 pub fn set_or_clear_role<T>(mut self, v: std::option::Option<T>) -> Self
10885 where
10886 T: std::convert::Into<crate::model::kubernetes::Role>,
10887 {
10888 self.role = v.map(|x| x.into());
10889 self
10890 }
10891
10892 /// Sets the value of [subjects][crate::model::kubernetes::Binding::subjects].
10893 ///
10894 /// # Example
10895 /// ```ignore,no_run
10896 /// # use google_cloud_securitycenter_v2::model::kubernetes::Binding;
10897 /// use google_cloud_securitycenter_v2::model::kubernetes::Subject;
10898 /// let x = Binding::new()
10899 /// .set_subjects([
10900 /// Subject::default()/* use setters */,
10901 /// Subject::default()/* use (different) setters */,
10902 /// ]);
10903 /// ```
10904 pub fn set_subjects<T, V>(mut self, v: T) -> Self
10905 where
10906 T: std::iter::IntoIterator<Item = V>,
10907 V: std::convert::Into<crate::model::kubernetes::Subject>,
10908 {
10909 use std::iter::Iterator;
10910 self.subjects = v.into_iter().map(|i| i.into()).collect();
10911 self
10912 }
10913 }
10914
10915 impl wkt::message::Message for Binding {
10916 fn typename() -> &'static str {
10917 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.Binding"
10918 }
10919 }
10920
10921 /// Represents a Kubernetes subject.
10922 #[derive(Clone, Default, PartialEq)]
10923 #[non_exhaustive]
10924 pub struct Subject {
10925 /// Authentication type for the subject.
10926 pub kind: crate::model::kubernetes::subject::AuthType,
10927
10928 /// Namespace for the subject.
10929 pub ns: std::string::String,
10930
10931 /// Name for the subject.
10932 pub name: std::string::String,
10933
10934 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10935 }
10936
10937 impl Subject {
10938 /// Creates a new default instance.
10939 pub fn new() -> Self {
10940 std::default::Default::default()
10941 }
10942
10943 /// Sets the value of [kind][crate::model::kubernetes::Subject::kind].
10944 ///
10945 /// # Example
10946 /// ```ignore,no_run
10947 /// # use google_cloud_securitycenter_v2::model::kubernetes::Subject;
10948 /// use google_cloud_securitycenter_v2::model::kubernetes::subject::AuthType;
10949 /// let x0 = Subject::new().set_kind(AuthType::User);
10950 /// let x1 = Subject::new().set_kind(AuthType::Serviceaccount);
10951 /// let x2 = Subject::new().set_kind(AuthType::Group);
10952 /// ```
10953 pub fn set_kind<T: std::convert::Into<crate::model::kubernetes::subject::AuthType>>(
10954 mut self,
10955 v: T,
10956 ) -> Self {
10957 self.kind = v.into();
10958 self
10959 }
10960
10961 /// Sets the value of [ns][crate::model::kubernetes::Subject::ns].
10962 ///
10963 /// # Example
10964 /// ```ignore,no_run
10965 /// # use google_cloud_securitycenter_v2::model::kubernetes::Subject;
10966 /// let x = Subject::new().set_ns("example");
10967 /// ```
10968 pub fn set_ns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10969 self.ns = v.into();
10970 self
10971 }
10972
10973 /// Sets the value of [name][crate::model::kubernetes::Subject::name].
10974 ///
10975 /// # Example
10976 /// ```ignore,no_run
10977 /// # use google_cloud_securitycenter_v2::model::kubernetes::Subject;
10978 /// let x = Subject::new().set_name("example");
10979 /// ```
10980 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10981 self.name = v.into();
10982 self
10983 }
10984 }
10985
10986 impl wkt::message::Message for Subject {
10987 fn typename() -> &'static str {
10988 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.Subject"
10989 }
10990 }
10991
10992 /// Defines additional types related to [Subject].
10993 pub mod subject {
10994 #[allow(unused_imports)]
10995 use super::*;
10996
10997 /// Auth types that can be used for the subject's kind field.
10998 ///
10999 /// # Working with unknown values
11000 ///
11001 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11002 /// additional enum variants at any time. Adding new variants is not considered
11003 /// a breaking change. Applications should write their code in anticipation of:
11004 ///
11005 /// - New values appearing in future releases of the client library, **and**
11006 /// - New values received dynamically, without application changes.
11007 ///
11008 /// Please consult the [Working with enums] section in the user guide for some
11009 /// guidelines.
11010 ///
11011 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11012 #[derive(Clone, Debug, PartialEq)]
11013 #[non_exhaustive]
11014 pub enum AuthType {
11015 /// Authentication is not specified.
11016 Unspecified,
11017 /// User with valid certificate.
11018 User,
11019 /// Users managed by Kubernetes API with credentials stored as secrets.
11020 Serviceaccount,
11021 /// Collection of users.
11022 Group,
11023 /// If set, the enum was initialized with an unknown value.
11024 ///
11025 /// Applications can examine the value using [AuthType::value] or
11026 /// [AuthType::name].
11027 UnknownValue(auth_type::UnknownValue),
11028 }
11029
11030 #[doc(hidden)]
11031 pub mod auth_type {
11032 #[allow(unused_imports)]
11033 use super::*;
11034 #[derive(Clone, Debug, PartialEq)]
11035 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11036 }
11037
11038 impl AuthType {
11039 /// Gets the enum value.
11040 ///
11041 /// Returns `None` if the enum contains an unknown value deserialized from
11042 /// the string representation of enums.
11043 pub fn value(&self) -> std::option::Option<i32> {
11044 match self {
11045 Self::Unspecified => std::option::Option::Some(0),
11046 Self::User => std::option::Option::Some(1),
11047 Self::Serviceaccount => std::option::Option::Some(2),
11048 Self::Group => std::option::Option::Some(3),
11049 Self::UnknownValue(u) => u.0.value(),
11050 }
11051 }
11052
11053 /// Gets the enum value as a string.
11054 ///
11055 /// Returns `None` if the enum contains an unknown value deserialized from
11056 /// the integer representation of enums.
11057 pub fn name(&self) -> std::option::Option<&str> {
11058 match self {
11059 Self::Unspecified => std::option::Option::Some("AUTH_TYPE_UNSPECIFIED"),
11060 Self::User => std::option::Option::Some("USER"),
11061 Self::Serviceaccount => std::option::Option::Some("SERVICEACCOUNT"),
11062 Self::Group => std::option::Option::Some("GROUP"),
11063 Self::UnknownValue(u) => u.0.name(),
11064 }
11065 }
11066 }
11067
11068 impl std::default::Default for AuthType {
11069 fn default() -> Self {
11070 use std::convert::From;
11071 Self::from(0)
11072 }
11073 }
11074
11075 impl std::fmt::Display for AuthType {
11076 fn fmt(
11077 &self,
11078 f: &mut std::fmt::Formatter<'_>,
11079 ) -> std::result::Result<(), std::fmt::Error> {
11080 wkt::internal::display_enum(f, self.name(), self.value())
11081 }
11082 }
11083
11084 impl std::convert::From<i32> for AuthType {
11085 fn from(value: i32) -> Self {
11086 match value {
11087 0 => Self::Unspecified,
11088 1 => Self::User,
11089 2 => Self::Serviceaccount,
11090 3 => Self::Group,
11091 _ => Self::UnknownValue(auth_type::UnknownValue(
11092 wkt::internal::UnknownEnumValue::Integer(value),
11093 )),
11094 }
11095 }
11096 }
11097
11098 impl std::convert::From<&str> for AuthType {
11099 fn from(value: &str) -> Self {
11100 use std::string::ToString;
11101 match value {
11102 "AUTH_TYPE_UNSPECIFIED" => Self::Unspecified,
11103 "USER" => Self::User,
11104 "SERVICEACCOUNT" => Self::Serviceaccount,
11105 "GROUP" => Self::Group,
11106 _ => Self::UnknownValue(auth_type::UnknownValue(
11107 wkt::internal::UnknownEnumValue::String(value.to_string()),
11108 )),
11109 }
11110 }
11111 }
11112
11113 impl serde::ser::Serialize for AuthType {
11114 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11115 where
11116 S: serde::Serializer,
11117 {
11118 match self {
11119 Self::Unspecified => serializer.serialize_i32(0),
11120 Self::User => serializer.serialize_i32(1),
11121 Self::Serviceaccount => serializer.serialize_i32(2),
11122 Self::Group => serializer.serialize_i32(3),
11123 Self::UnknownValue(u) => u.0.serialize(serializer),
11124 }
11125 }
11126 }
11127
11128 impl<'de> serde::de::Deserialize<'de> for AuthType {
11129 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11130 where
11131 D: serde::Deserializer<'de>,
11132 {
11133 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AuthType>::new(
11134 ".google.cloud.securitycenter.v2.Kubernetes.Subject.AuthType",
11135 ))
11136 }
11137 }
11138 }
11139
11140 /// Conveys information about a Kubernetes access review (such as one returned
11141 /// by a [`kubectl auth
11142 /// can-i`](https://kubernetes.io/docs/reference/access-authn-authz/authorization/#checking-api-access)
11143 /// command) that was involved in a finding.
11144 #[derive(Clone, Default, PartialEq)]
11145 #[non_exhaustive]
11146 pub struct AccessReview {
11147 /// The API group of the resource. "*" means all.
11148 pub group: std::string::String,
11149
11150 /// Namespace of the action being requested. Currently, there is no
11151 /// distinction between no namespace and all namespaces. Both
11152 /// are represented by "" (empty).
11153 pub ns: std::string::String,
11154
11155 /// The name of the resource being requested. Empty means all.
11156 pub name: std::string::String,
11157
11158 /// The optional resource type requested. "*" means all.
11159 pub resource: std::string::String,
11160
11161 /// The optional subresource type.
11162 pub subresource: std::string::String,
11163
11164 /// A Kubernetes resource API verb, like get, list, watch, create, update,
11165 /// delete, proxy. "*" means all.
11166 pub verb: std::string::String,
11167
11168 /// The API version of the resource. "*" means all.
11169 pub version: std::string::String,
11170
11171 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11172 }
11173
11174 impl AccessReview {
11175 /// Creates a new default instance.
11176 pub fn new() -> Self {
11177 std::default::Default::default()
11178 }
11179
11180 /// Sets the value of [group][crate::model::kubernetes::AccessReview::group].
11181 ///
11182 /// # Example
11183 /// ```ignore,no_run
11184 /// # use google_cloud_securitycenter_v2::model::kubernetes::AccessReview;
11185 /// let x = AccessReview::new().set_group("example");
11186 /// ```
11187 pub fn set_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11188 self.group = v.into();
11189 self
11190 }
11191
11192 /// Sets the value of [ns][crate::model::kubernetes::AccessReview::ns].
11193 ///
11194 /// # Example
11195 /// ```ignore,no_run
11196 /// # use google_cloud_securitycenter_v2::model::kubernetes::AccessReview;
11197 /// let x = AccessReview::new().set_ns("example");
11198 /// ```
11199 pub fn set_ns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11200 self.ns = v.into();
11201 self
11202 }
11203
11204 /// Sets the value of [name][crate::model::kubernetes::AccessReview::name].
11205 ///
11206 /// # Example
11207 /// ```ignore,no_run
11208 /// # use google_cloud_securitycenter_v2::model::kubernetes::AccessReview;
11209 /// let x = AccessReview::new().set_name("example");
11210 /// ```
11211 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11212 self.name = v.into();
11213 self
11214 }
11215
11216 /// Sets the value of [resource][crate::model::kubernetes::AccessReview::resource].
11217 ///
11218 /// # Example
11219 /// ```ignore,no_run
11220 /// # use google_cloud_securitycenter_v2::model::kubernetes::AccessReview;
11221 /// let x = AccessReview::new().set_resource("example");
11222 /// ```
11223 pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11224 self.resource = v.into();
11225 self
11226 }
11227
11228 /// Sets the value of [subresource][crate::model::kubernetes::AccessReview::subresource].
11229 ///
11230 /// # Example
11231 /// ```ignore,no_run
11232 /// # use google_cloud_securitycenter_v2::model::kubernetes::AccessReview;
11233 /// let x = AccessReview::new().set_subresource("example");
11234 /// ```
11235 pub fn set_subresource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11236 self.subresource = v.into();
11237 self
11238 }
11239
11240 /// Sets the value of [verb][crate::model::kubernetes::AccessReview::verb].
11241 ///
11242 /// # Example
11243 /// ```ignore,no_run
11244 /// # use google_cloud_securitycenter_v2::model::kubernetes::AccessReview;
11245 /// let x = AccessReview::new().set_verb("example");
11246 /// ```
11247 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11248 self.verb = v.into();
11249 self
11250 }
11251
11252 /// Sets the value of [version][crate::model::kubernetes::AccessReview::version].
11253 ///
11254 /// # Example
11255 /// ```ignore,no_run
11256 /// # use google_cloud_securitycenter_v2::model::kubernetes::AccessReview;
11257 /// let x = AccessReview::new().set_version("example");
11258 /// ```
11259 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11260 self.version = v.into();
11261 self
11262 }
11263 }
11264
11265 impl wkt::message::Message for AccessReview {
11266 fn typename() -> &'static str {
11267 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.AccessReview"
11268 }
11269 }
11270
11271 /// Kubernetes object related to the finding, uniquely identified by GKNN.
11272 /// Used if the object Kind is not one of Pod, Node, NodePool, Binding, or
11273 /// AccessReview.
11274 #[derive(Clone, Default, PartialEq)]
11275 #[non_exhaustive]
11276 pub struct Object {
11277 /// Kubernetes object group, such as "policy.k8s.io/v1".
11278 pub group: std::string::String,
11279
11280 /// Kubernetes object kind, such as "Namespace".
11281 pub kind: std::string::String,
11282
11283 /// Kubernetes object namespace. Must be a valid DNS label. Named
11284 /// "ns" to avoid collision with C++ namespace keyword. For details see
11285 /// <https://kubernetes.io/docs/tasks/administer-cluster/namespaces/>.
11286 pub ns: std::string::String,
11287
11288 /// Kubernetes object name. For details see
11289 /// <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/>.
11290 pub name: std::string::String,
11291
11292 /// Pod containers associated with this finding, if any.
11293 pub containers: std::vec::Vec<crate::model::Container>,
11294
11295 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11296 }
11297
11298 impl Object {
11299 /// Creates a new default instance.
11300 pub fn new() -> Self {
11301 std::default::Default::default()
11302 }
11303
11304 /// Sets the value of [group][crate::model::kubernetes::Object::group].
11305 ///
11306 /// # Example
11307 /// ```ignore,no_run
11308 /// # use google_cloud_securitycenter_v2::model::kubernetes::Object;
11309 /// let x = Object::new().set_group("example");
11310 /// ```
11311 pub fn set_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11312 self.group = v.into();
11313 self
11314 }
11315
11316 /// Sets the value of [kind][crate::model::kubernetes::Object::kind].
11317 ///
11318 /// # Example
11319 /// ```ignore,no_run
11320 /// # use google_cloud_securitycenter_v2::model::kubernetes::Object;
11321 /// let x = Object::new().set_kind("example");
11322 /// ```
11323 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11324 self.kind = v.into();
11325 self
11326 }
11327
11328 /// Sets the value of [ns][crate::model::kubernetes::Object::ns].
11329 ///
11330 /// # Example
11331 /// ```ignore,no_run
11332 /// # use google_cloud_securitycenter_v2::model::kubernetes::Object;
11333 /// let x = Object::new().set_ns("example");
11334 /// ```
11335 pub fn set_ns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11336 self.ns = v.into();
11337 self
11338 }
11339
11340 /// Sets the value of [name][crate::model::kubernetes::Object::name].
11341 ///
11342 /// # Example
11343 /// ```ignore,no_run
11344 /// # use google_cloud_securitycenter_v2::model::kubernetes::Object;
11345 /// let x = Object::new().set_name("example");
11346 /// ```
11347 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11348 self.name = v.into();
11349 self
11350 }
11351
11352 /// Sets the value of [containers][crate::model::kubernetes::Object::containers].
11353 ///
11354 /// # Example
11355 /// ```ignore,no_run
11356 /// # use google_cloud_securitycenter_v2::model::kubernetes::Object;
11357 /// use google_cloud_securitycenter_v2::model::Container;
11358 /// let x = Object::new()
11359 /// .set_containers([
11360 /// Container::default()/* use setters */,
11361 /// Container::default()/* use (different) setters */,
11362 /// ]);
11363 /// ```
11364 pub fn set_containers<T, V>(mut self, v: T) -> Self
11365 where
11366 T: std::iter::IntoIterator<Item = V>,
11367 V: std::convert::Into<crate::model::Container>,
11368 {
11369 use std::iter::Iterator;
11370 self.containers = v.into_iter().map(|i| i.into()).collect();
11371 self
11372 }
11373 }
11374
11375 impl wkt::message::Message for Object {
11376 fn typename() -> &'static str {
11377 "type.googleapis.com/google.cloud.securitycenter.v2.Kubernetes.Object"
11378 }
11379 }
11380}
11381
11382/// Represents a generic name-value label. A label has separate name and value
11383/// fields to support filtering with the `contains()` function. For more
11384/// information, see [Filtering on array-type
11385/// fields](https://cloud.google.com/security-command-center/docs/how-to-api-list-findings#array-contains-filtering).
11386#[derive(Clone, Default, PartialEq)]
11387#[non_exhaustive]
11388pub struct Label {
11389 /// Name of the label.
11390 pub name: std::string::String,
11391
11392 /// Value that corresponds to the label's name.
11393 pub value: std::string::String,
11394
11395 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11396}
11397
11398impl Label {
11399 /// Creates a new default instance.
11400 pub fn new() -> Self {
11401 std::default::Default::default()
11402 }
11403
11404 /// Sets the value of [name][crate::model::Label::name].
11405 ///
11406 /// # Example
11407 /// ```ignore,no_run
11408 /// # use google_cloud_securitycenter_v2::model::Label;
11409 /// let x = Label::new().set_name("example");
11410 /// ```
11411 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11412 self.name = v.into();
11413 self
11414 }
11415
11416 /// Sets the value of [value][crate::model::Label::value].
11417 ///
11418 /// # Example
11419 /// ```ignore,no_run
11420 /// # use google_cloud_securitycenter_v2::model::Label;
11421 /// let x = Label::new().set_value("example");
11422 /// ```
11423 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11424 self.value = v.into();
11425 self
11426 }
11427}
11428
11429impl wkt::message::Message for Label {
11430 fn typename() -> &'static str {
11431 "type.googleapis.com/google.cloud.securitycenter.v2.Label"
11432 }
11433}
11434
11435/// Contains information related to the load balancer associated with the
11436/// finding.
11437#[derive(Clone, Default, PartialEq)]
11438#[non_exhaustive]
11439pub struct LoadBalancer {
11440 /// The name of the load balancer associated with the finding.
11441 pub name: std::string::String,
11442
11443 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11444}
11445
11446impl LoadBalancer {
11447 /// Creates a new default instance.
11448 pub fn new() -> Self {
11449 std::default::Default::default()
11450 }
11451
11452 /// Sets the value of [name][crate::model::LoadBalancer::name].
11453 ///
11454 /// # Example
11455 /// ```ignore,no_run
11456 /// # use google_cloud_securitycenter_v2::model::LoadBalancer;
11457 /// let x = LoadBalancer::new().set_name("example");
11458 /// ```
11459 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11460 self.name = v.into();
11461 self
11462 }
11463}
11464
11465impl wkt::message::Message for LoadBalancer {
11466 fn typename() -> &'static str {
11467 "type.googleapis.com/google.cloud.securitycenter.v2.LoadBalancer"
11468 }
11469}
11470
11471/// An individual entry in a log.
11472#[derive(Clone, Default, PartialEq)]
11473#[non_exhaustive]
11474pub struct LogEntry {
11475 /// The log entry.
11476 pub log_entry: std::option::Option<crate::model::log_entry::LogEntry>,
11477
11478 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11479}
11480
11481impl LogEntry {
11482 /// Creates a new default instance.
11483 pub fn new() -> Self {
11484 std::default::Default::default()
11485 }
11486
11487 /// Sets the value of [log_entry][crate::model::LogEntry::log_entry].
11488 ///
11489 /// Note that all the setters affecting `log_entry` are mutually
11490 /// exclusive.
11491 ///
11492 /// # Example
11493 /// ```ignore,no_run
11494 /// # use google_cloud_securitycenter_v2::model::LogEntry;
11495 /// use google_cloud_securitycenter_v2::model::CloudLoggingEntry;
11496 /// let x = LogEntry::new().set_log_entry(Some(
11497 /// google_cloud_securitycenter_v2::model::log_entry::LogEntry::CloudLoggingEntry(CloudLoggingEntry::default().into())));
11498 /// ```
11499 pub fn set_log_entry<
11500 T: std::convert::Into<std::option::Option<crate::model::log_entry::LogEntry>>,
11501 >(
11502 mut self,
11503 v: T,
11504 ) -> Self {
11505 self.log_entry = v.into();
11506 self
11507 }
11508
11509 /// The value of [log_entry][crate::model::LogEntry::log_entry]
11510 /// if it holds a `CloudLoggingEntry`, `None` if the field is not set or
11511 /// holds a different branch.
11512 pub fn cloud_logging_entry(
11513 &self,
11514 ) -> std::option::Option<&std::boxed::Box<crate::model::CloudLoggingEntry>> {
11515 #[allow(unreachable_patterns)]
11516 self.log_entry.as_ref().and_then(|v| match v {
11517 crate::model::log_entry::LogEntry::CloudLoggingEntry(v) => std::option::Option::Some(v),
11518 _ => std::option::Option::None,
11519 })
11520 }
11521
11522 /// Sets the value of [log_entry][crate::model::LogEntry::log_entry]
11523 /// to hold a `CloudLoggingEntry`.
11524 ///
11525 /// Note that all the setters affecting `log_entry` are
11526 /// mutually exclusive.
11527 ///
11528 /// # Example
11529 /// ```ignore,no_run
11530 /// # use google_cloud_securitycenter_v2::model::LogEntry;
11531 /// use google_cloud_securitycenter_v2::model::CloudLoggingEntry;
11532 /// let x = LogEntry::new().set_cloud_logging_entry(CloudLoggingEntry::default()/* use setters */);
11533 /// assert!(x.cloud_logging_entry().is_some());
11534 /// ```
11535 pub fn set_cloud_logging_entry<
11536 T: std::convert::Into<std::boxed::Box<crate::model::CloudLoggingEntry>>,
11537 >(
11538 mut self,
11539 v: T,
11540 ) -> Self {
11541 self.log_entry = std::option::Option::Some(
11542 crate::model::log_entry::LogEntry::CloudLoggingEntry(v.into()),
11543 );
11544 self
11545 }
11546}
11547
11548impl wkt::message::Message for LogEntry {
11549 fn typename() -> &'static str {
11550 "type.googleapis.com/google.cloud.securitycenter.v2.LogEntry"
11551 }
11552}
11553
11554/// Defines additional types related to [LogEntry].
11555pub mod log_entry {
11556 #[allow(unused_imports)]
11557 use super::*;
11558
11559 /// The log entry.
11560 #[derive(Clone, Debug, PartialEq)]
11561 #[non_exhaustive]
11562 pub enum LogEntry {
11563 /// An individual entry in a log stored in Cloud Logging.
11564 CloudLoggingEntry(std::boxed::Box<crate::model::CloudLoggingEntry>),
11565 }
11566}
11567
11568/// Metadata taken from a [Cloud Logging
11569/// LogEntry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry)
11570#[derive(Clone, Default, PartialEq)]
11571#[non_exhaustive]
11572pub struct CloudLoggingEntry {
11573 /// A unique identifier for the log entry.
11574 pub insert_id: std::string::String,
11575
11576 /// The type of the log (part of `log_name`. `log_name` is the resource name of
11577 /// the log to which this log entry belongs). For example:
11578 /// `cloudresourcemanager.googleapis.com/activity` Note that this field is not
11579 /// URL-encoded, unlike in `LogEntry`.
11580 pub log_id: std::string::String,
11581
11582 /// The organization, folder, or project of the monitored resource that
11583 /// produced this log entry.
11584 pub resource_container: std::string::String,
11585
11586 /// The time the event described by the log entry occurred.
11587 pub timestamp: std::option::Option<wkt::Timestamp>,
11588
11589 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11590}
11591
11592impl CloudLoggingEntry {
11593 /// Creates a new default instance.
11594 pub fn new() -> Self {
11595 std::default::Default::default()
11596 }
11597
11598 /// Sets the value of [insert_id][crate::model::CloudLoggingEntry::insert_id].
11599 ///
11600 /// # Example
11601 /// ```ignore,no_run
11602 /// # use google_cloud_securitycenter_v2::model::CloudLoggingEntry;
11603 /// let x = CloudLoggingEntry::new().set_insert_id("example");
11604 /// ```
11605 pub fn set_insert_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11606 self.insert_id = v.into();
11607 self
11608 }
11609
11610 /// Sets the value of [log_id][crate::model::CloudLoggingEntry::log_id].
11611 ///
11612 /// # Example
11613 /// ```ignore,no_run
11614 /// # use google_cloud_securitycenter_v2::model::CloudLoggingEntry;
11615 /// let x = CloudLoggingEntry::new().set_log_id("example");
11616 /// ```
11617 pub fn set_log_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11618 self.log_id = v.into();
11619 self
11620 }
11621
11622 /// Sets the value of [resource_container][crate::model::CloudLoggingEntry::resource_container].
11623 ///
11624 /// # Example
11625 /// ```ignore,no_run
11626 /// # use google_cloud_securitycenter_v2::model::CloudLoggingEntry;
11627 /// let x = CloudLoggingEntry::new().set_resource_container("example");
11628 /// ```
11629 pub fn set_resource_container<T: std::convert::Into<std::string::String>>(
11630 mut self,
11631 v: T,
11632 ) -> Self {
11633 self.resource_container = v.into();
11634 self
11635 }
11636
11637 /// Sets the value of [timestamp][crate::model::CloudLoggingEntry::timestamp].
11638 ///
11639 /// # Example
11640 /// ```ignore,no_run
11641 /// # use google_cloud_securitycenter_v2::model::CloudLoggingEntry;
11642 /// use wkt::Timestamp;
11643 /// let x = CloudLoggingEntry::new().set_timestamp(Timestamp::default()/* use setters */);
11644 /// ```
11645 pub fn set_timestamp<T>(mut self, v: T) -> Self
11646 where
11647 T: std::convert::Into<wkt::Timestamp>,
11648 {
11649 self.timestamp = std::option::Option::Some(v.into());
11650 self
11651 }
11652
11653 /// Sets or clears the value of [timestamp][crate::model::CloudLoggingEntry::timestamp].
11654 ///
11655 /// # Example
11656 /// ```ignore,no_run
11657 /// # use google_cloud_securitycenter_v2::model::CloudLoggingEntry;
11658 /// use wkt::Timestamp;
11659 /// let x = CloudLoggingEntry::new().set_or_clear_timestamp(Some(Timestamp::default()/* use setters */));
11660 /// let x = CloudLoggingEntry::new().set_or_clear_timestamp(None::<Timestamp>);
11661 /// ```
11662 pub fn set_or_clear_timestamp<T>(mut self, v: std::option::Option<T>) -> Self
11663 where
11664 T: std::convert::Into<wkt::Timestamp>,
11665 {
11666 self.timestamp = v.map(|x| x.into());
11667 self
11668 }
11669}
11670
11671impl wkt::message::Message for CloudLoggingEntry {
11672 fn typename() -> &'static str {
11673 "type.googleapis.com/google.cloud.securitycenter.v2.CloudLoggingEntry"
11674 }
11675}
11676
11677/// MITRE ATT&CK tactics and techniques related to this finding.
11678/// See: <https://attack.mitre.org>
11679#[derive(Clone, Default, PartialEq)]
11680#[non_exhaustive]
11681pub struct MitreAttack {
11682 /// The MITRE ATT&CK tactic most closely represented by this finding, if any.
11683 pub primary_tactic: crate::model::mitre_attack::Tactic,
11684
11685 /// The MITRE ATT&CK technique most closely represented by this finding, if
11686 /// any. primary_techniques is a repeated field because there are multiple
11687 /// levels of MITRE ATT&CK techniques. If the technique most closely
11688 /// represented by this finding is a sub-technique (e.g. `SCANNING_IP_BLOCKS`),
11689 /// both the sub-technique and its parent technique(s) will be listed (e.g.
11690 /// `SCANNING_IP_BLOCKS`, `ACTIVE_SCANNING`).
11691 pub primary_techniques: std::vec::Vec<crate::model::mitre_attack::Technique>,
11692
11693 /// Additional MITRE ATT&CK tactics related to this finding, if any.
11694 pub additional_tactics: std::vec::Vec<crate::model::mitre_attack::Tactic>,
11695
11696 /// Additional MITRE ATT&CK techniques related to this finding, if any, along
11697 /// with any of their respective parent techniques.
11698 pub additional_techniques: std::vec::Vec<crate::model::mitre_attack::Technique>,
11699
11700 /// The MITRE ATT&CK version referenced by the above fields. E.g. "8".
11701 pub version: std::string::String,
11702
11703 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11704}
11705
11706impl MitreAttack {
11707 /// Creates a new default instance.
11708 pub fn new() -> Self {
11709 std::default::Default::default()
11710 }
11711
11712 /// Sets the value of [primary_tactic][crate::model::MitreAttack::primary_tactic].
11713 ///
11714 /// # Example
11715 /// ```ignore,no_run
11716 /// # use google_cloud_securitycenter_v2::model::MitreAttack;
11717 /// use google_cloud_securitycenter_v2::model::mitre_attack::Tactic;
11718 /// let x0 = MitreAttack::new().set_primary_tactic(Tactic::Reconnaissance);
11719 /// let x1 = MitreAttack::new().set_primary_tactic(Tactic::ResourceDevelopment);
11720 /// let x2 = MitreAttack::new().set_primary_tactic(Tactic::InitialAccess);
11721 /// ```
11722 pub fn set_primary_tactic<T: std::convert::Into<crate::model::mitre_attack::Tactic>>(
11723 mut self,
11724 v: T,
11725 ) -> Self {
11726 self.primary_tactic = v.into();
11727 self
11728 }
11729
11730 /// Sets the value of [primary_techniques][crate::model::MitreAttack::primary_techniques].
11731 ///
11732 /// # Example
11733 /// ```ignore,no_run
11734 /// # use google_cloud_securitycenter_v2::model::MitreAttack;
11735 /// use google_cloud_securitycenter_v2::model::mitre_attack::Technique;
11736 /// let x = MitreAttack::new().set_primary_techniques([
11737 /// Technique::DataObfuscation,
11738 /// Technique::DataObfuscationSteganography,
11739 /// Technique::OsCredentialDumping,
11740 /// ]);
11741 /// ```
11742 pub fn set_primary_techniques<T, V>(mut self, v: T) -> Self
11743 where
11744 T: std::iter::IntoIterator<Item = V>,
11745 V: std::convert::Into<crate::model::mitre_attack::Technique>,
11746 {
11747 use std::iter::Iterator;
11748 self.primary_techniques = v.into_iter().map(|i| i.into()).collect();
11749 self
11750 }
11751
11752 /// Sets the value of [additional_tactics][crate::model::MitreAttack::additional_tactics].
11753 ///
11754 /// # Example
11755 /// ```ignore,no_run
11756 /// # use google_cloud_securitycenter_v2::model::MitreAttack;
11757 /// use google_cloud_securitycenter_v2::model::mitre_attack::Tactic;
11758 /// let x = MitreAttack::new().set_additional_tactics([
11759 /// Tactic::Reconnaissance,
11760 /// Tactic::ResourceDevelopment,
11761 /// Tactic::InitialAccess,
11762 /// ]);
11763 /// ```
11764 pub fn set_additional_tactics<T, V>(mut self, v: T) -> Self
11765 where
11766 T: std::iter::IntoIterator<Item = V>,
11767 V: std::convert::Into<crate::model::mitre_attack::Tactic>,
11768 {
11769 use std::iter::Iterator;
11770 self.additional_tactics = v.into_iter().map(|i| i.into()).collect();
11771 self
11772 }
11773
11774 /// Sets the value of [additional_techniques][crate::model::MitreAttack::additional_techniques].
11775 ///
11776 /// # Example
11777 /// ```ignore,no_run
11778 /// # use google_cloud_securitycenter_v2::model::MitreAttack;
11779 /// use google_cloud_securitycenter_v2::model::mitre_attack::Technique;
11780 /// let x = MitreAttack::new().set_additional_techniques([
11781 /// Technique::DataObfuscation,
11782 /// Technique::DataObfuscationSteganography,
11783 /// Technique::OsCredentialDumping,
11784 /// ]);
11785 /// ```
11786 pub fn set_additional_techniques<T, V>(mut self, v: T) -> Self
11787 where
11788 T: std::iter::IntoIterator<Item = V>,
11789 V: std::convert::Into<crate::model::mitre_attack::Technique>,
11790 {
11791 use std::iter::Iterator;
11792 self.additional_techniques = v.into_iter().map(|i| i.into()).collect();
11793 self
11794 }
11795
11796 /// Sets the value of [version][crate::model::MitreAttack::version].
11797 ///
11798 /// # Example
11799 /// ```ignore,no_run
11800 /// # use google_cloud_securitycenter_v2::model::MitreAttack;
11801 /// let x = MitreAttack::new().set_version("example");
11802 /// ```
11803 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11804 self.version = v.into();
11805 self
11806 }
11807}
11808
11809impl wkt::message::Message for MitreAttack {
11810 fn typename() -> &'static str {
11811 "type.googleapis.com/google.cloud.securitycenter.v2.MitreAttack"
11812 }
11813}
11814
11815/// Defines additional types related to [MitreAttack].
11816pub mod mitre_attack {
11817 #[allow(unused_imports)]
11818 use super::*;
11819
11820 /// MITRE ATT&CK tactics that can be referenced by SCC findings.
11821 /// See: <https://attack.mitre.org/tactics/enterprise/>
11822 ///
11823 /// # Working with unknown values
11824 ///
11825 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11826 /// additional enum variants at any time. Adding new variants is not considered
11827 /// a breaking change. Applications should write their code in anticipation of:
11828 ///
11829 /// - New values appearing in future releases of the client library, **and**
11830 /// - New values received dynamically, without application changes.
11831 ///
11832 /// Please consult the [Working with enums] section in the user guide for some
11833 /// guidelines.
11834 ///
11835 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11836 #[derive(Clone, Debug, PartialEq)]
11837 #[non_exhaustive]
11838 pub enum Tactic {
11839 /// Unspecified value.
11840 Unspecified,
11841 /// TA0043
11842 Reconnaissance,
11843 /// TA0042
11844 ResourceDevelopment,
11845 /// TA0001
11846 InitialAccess,
11847 /// TA0002
11848 Execution,
11849 /// TA0003
11850 Persistence,
11851 /// TA0004
11852 PrivilegeEscalation,
11853 /// TA0005
11854 DefenseEvasion,
11855 /// TA0006
11856 CredentialAccess,
11857 /// TA0007
11858 Discovery,
11859 /// TA0008
11860 LateralMovement,
11861 /// TA0009
11862 Collection,
11863 /// TA0011
11864 CommandAndControl,
11865 /// TA0010
11866 Exfiltration,
11867 /// TA0040
11868 Impact,
11869 /// If set, the enum was initialized with an unknown value.
11870 ///
11871 /// Applications can examine the value using [Tactic::value] or
11872 /// [Tactic::name].
11873 UnknownValue(tactic::UnknownValue),
11874 }
11875
11876 #[doc(hidden)]
11877 pub mod tactic {
11878 #[allow(unused_imports)]
11879 use super::*;
11880 #[derive(Clone, Debug, PartialEq)]
11881 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11882 }
11883
11884 impl Tactic {
11885 /// Gets the enum value.
11886 ///
11887 /// Returns `None` if the enum contains an unknown value deserialized from
11888 /// the string representation of enums.
11889 pub fn value(&self) -> std::option::Option<i32> {
11890 match self {
11891 Self::Unspecified => std::option::Option::Some(0),
11892 Self::Reconnaissance => std::option::Option::Some(1),
11893 Self::ResourceDevelopment => std::option::Option::Some(2),
11894 Self::InitialAccess => std::option::Option::Some(5),
11895 Self::Execution => std::option::Option::Some(3),
11896 Self::Persistence => std::option::Option::Some(6),
11897 Self::PrivilegeEscalation => std::option::Option::Some(8),
11898 Self::DefenseEvasion => std::option::Option::Some(7),
11899 Self::CredentialAccess => std::option::Option::Some(9),
11900 Self::Discovery => std::option::Option::Some(10),
11901 Self::LateralMovement => std::option::Option::Some(11),
11902 Self::Collection => std::option::Option::Some(12),
11903 Self::CommandAndControl => std::option::Option::Some(4),
11904 Self::Exfiltration => std::option::Option::Some(13),
11905 Self::Impact => std::option::Option::Some(14),
11906 Self::UnknownValue(u) => u.0.value(),
11907 }
11908 }
11909
11910 /// Gets the enum value as a string.
11911 ///
11912 /// Returns `None` if the enum contains an unknown value deserialized from
11913 /// the integer representation of enums.
11914 pub fn name(&self) -> std::option::Option<&str> {
11915 match self {
11916 Self::Unspecified => std::option::Option::Some("TACTIC_UNSPECIFIED"),
11917 Self::Reconnaissance => std::option::Option::Some("RECONNAISSANCE"),
11918 Self::ResourceDevelopment => std::option::Option::Some("RESOURCE_DEVELOPMENT"),
11919 Self::InitialAccess => std::option::Option::Some("INITIAL_ACCESS"),
11920 Self::Execution => std::option::Option::Some("EXECUTION"),
11921 Self::Persistence => std::option::Option::Some("PERSISTENCE"),
11922 Self::PrivilegeEscalation => std::option::Option::Some("PRIVILEGE_ESCALATION"),
11923 Self::DefenseEvasion => std::option::Option::Some("DEFENSE_EVASION"),
11924 Self::CredentialAccess => std::option::Option::Some("CREDENTIAL_ACCESS"),
11925 Self::Discovery => std::option::Option::Some("DISCOVERY"),
11926 Self::LateralMovement => std::option::Option::Some("LATERAL_MOVEMENT"),
11927 Self::Collection => std::option::Option::Some("COLLECTION"),
11928 Self::CommandAndControl => std::option::Option::Some("COMMAND_AND_CONTROL"),
11929 Self::Exfiltration => std::option::Option::Some("EXFILTRATION"),
11930 Self::Impact => std::option::Option::Some("IMPACT"),
11931 Self::UnknownValue(u) => u.0.name(),
11932 }
11933 }
11934 }
11935
11936 impl std::default::Default for Tactic {
11937 fn default() -> Self {
11938 use std::convert::From;
11939 Self::from(0)
11940 }
11941 }
11942
11943 impl std::fmt::Display for Tactic {
11944 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11945 wkt::internal::display_enum(f, self.name(), self.value())
11946 }
11947 }
11948
11949 impl std::convert::From<i32> for Tactic {
11950 fn from(value: i32) -> Self {
11951 match value {
11952 0 => Self::Unspecified,
11953 1 => Self::Reconnaissance,
11954 2 => Self::ResourceDevelopment,
11955 3 => Self::Execution,
11956 4 => Self::CommandAndControl,
11957 5 => Self::InitialAccess,
11958 6 => Self::Persistence,
11959 7 => Self::DefenseEvasion,
11960 8 => Self::PrivilegeEscalation,
11961 9 => Self::CredentialAccess,
11962 10 => Self::Discovery,
11963 11 => Self::LateralMovement,
11964 12 => Self::Collection,
11965 13 => Self::Exfiltration,
11966 14 => Self::Impact,
11967 _ => Self::UnknownValue(tactic::UnknownValue(
11968 wkt::internal::UnknownEnumValue::Integer(value),
11969 )),
11970 }
11971 }
11972 }
11973
11974 impl std::convert::From<&str> for Tactic {
11975 fn from(value: &str) -> Self {
11976 use std::string::ToString;
11977 match value {
11978 "TACTIC_UNSPECIFIED" => Self::Unspecified,
11979 "RECONNAISSANCE" => Self::Reconnaissance,
11980 "RESOURCE_DEVELOPMENT" => Self::ResourceDevelopment,
11981 "INITIAL_ACCESS" => Self::InitialAccess,
11982 "EXECUTION" => Self::Execution,
11983 "PERSISTENCE" => Self::Persistence,
11984 "PRIVILEGE_ESCALATION" => Self::PrivilegeEscalation,
11985 "DEFENSE_EVASION" => Self::DefenseEvasion,
11986 "CREDENTIAL_ACCESS" => Self::CredentialAccess,
11987 "DISCOVERY" => Self::Discovery,
11988 "LATERAL_MOVEMENT" => Self::LateralMovement,
11989 "COLLECTION" => Self::Collection,
11990 "COMMAND_AND_CONTROL" => Self::CommandAndControl,
11991 "EXFILTRATION" => Self::Exfiltration,
11992 "IMPACT" => Self::Impact,
11993 _ => Self::UnknownValue(tactic::UnknownValue(
11994 wkt::internal::UnknownEnumValue::String(value.to_string()),
11995 )),
11996 }
11997 }
11998 }
11999
12000 impl serde::ser::Serialize for Tactic {
12001 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12002 where
12003 S: serde::Serializer,
12004 {
12005 match self {
12006 Self::Unspecified => serializer.serialize_i32(0),
12007 Self::Reconnaissance => serializer.serialize_i32(1),
12008 Self::ResourceDevelopment => serializer.serialize_i32(2),
12009 Self::InitialAccess => serializer.serialize_i32(5),
12010 Self::Execution => serializer.serialize_i32(3),
12011 Self::Persistence => serializer.serialize_i32(6),
12012 Self::PrivilegeEscalation => serializer.serialize_i32(8),
12013 Self::DefenseEvasion => serializer.serialize_i32(7),
12014 Self::CredentialAccess => serializer.serialize_i32(9),
12015 Self::Discovery => serializer.serialize_i32(10),
12016 Self::LateralMovement => serializer.serialize_i32(11),
12017 Self::Collection => serializer.serialize_i32(12),
12018 Self::CommandAndControl => serializer.serialize_i32(4),
12019 Self::Exfiltration => serializer.serialize_i32(13),
12020 Self::Impact => serializer.serialize_i32(14),
12021 Self::UnknownValue(u) => u.0.serialize(serializer),
12022 }
12023 }
12024 }
12025
12026 impl<'de> serde::de::Deserialize<'de> for Tactic {
12027 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12028 where
12029 D: serde::Deserializer<'de>,
12030 {
12031 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Tactic>::new(
12032 ".google.cloud.securitycenter.v2.MitreAttack.Tactic",
12033 ))
12034 }
12035 }
12036
12037 /// MITRE ATT&CK techniques that can be referenced by Security Command Center
12038 /// findings. See: <https://attack.mitre.org/techniques/enterprise/>
12039 ///
12040 /// # Working with unknown values
12041 ///
12042 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12043 /// additional enum variants at any time. Adding new variants is not considered
12044 /// a breaking change. Applications should write their code in anticipation of:
12045 ///
12046 /// - New values appearing in future releases of the client library, **and**
12047 /// - New values received dynamically, without application changes.
12048 ///
12049 /// Please consult the [Working with enums] section in the user guide for some
12050 /// guidelines.
12051 ///
12052 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12053 #[derive(Clone, Debug, PartialEq)]
12054 #[non_exhaustive]
12055 pub enum Technique {
12056 /// Unspecified value.
12057 Unspecified,
12058 /// T1001
12059 DataObfuscation,
12060 /// T1001.002
12061 DataObfuscationSteganography,
12062 /// T1003
12063 OsCredentialDumping,
12064 /// T1003.007
12065 OsCredentialDumpingProcFilesystem,
12066 /// T1003.008
12067 OsCredentialDumpingEtcPasswordAndEtcShadow,
12068 /// T1005
12069 DataFromLocalSystem,
12070 /// T1020
12071 AutomatedExfiltration,
12072 /// T1027
12073 ObfuscatedFilesOrInfo,
12074 /// T1027.003
12075 Steganography,
12076 /// T1027.004
12077 CompileAfterDelivery,
12078 /// T1027.010
12079 CommandObfuscation,
12080 /// T1029
12081 ScheduledTransfer,
12082 /// T1033
12083 SystemOwnerUserDiscovery,
12084 /// T1036
12085 Masquerading,
12086 /// T1036.005
12087 MatchLegitimateNameOrLocation,
12088 /// T1037
12089 BootOrLogonInitializationScripts,
12090 /// T1037.005
12091 StartupItems,
12092 /// T1046
12093 NetworkServiceDiscovery,
12094 /// T1053
12095 ScheduledTaskJob,
12096 /// T1053.003
12097 ScheduledTaskJobCron,
12098 /// T1053.007
12099 ContainerOrchestrationJob,
12100 /// T1055
12101 ProcessInjection,
12102 /// T1056
12103 InputCapture,
12104 /// T1056.001
12105 InputCaptureKeylogging,
12106 /// T1057
12107 ProcessDiscovery,
12108 /// T1059
12109 CommandAndScriptingInterpreter,
12110 /// T1059.004
12111 UnixShell,
12112 /// T1059.006
12113 Python,
12114 /// T1068
12115 ExploitationForPrivilegeEscalation,
12116 /// T1069
12117 PermissionGroupsDiscovery,
12118 /// T1069.003
12119 CloudGroups,
12120 /// T1070
12121 IndicatorRemoval,
12122 /// T1070.002
12123 IndicatorRemovalClearLinuxOrMacSystemLogs,
12124 /// T1070.003
12125 IndicatorRemovalClearCommandHistory,
12126 /// T1070.004
12127 IndicatorRemovalFileDeletion,
12128 /// T1070.006
12129 IndicatorRemovalTimestomp,
12130 /// T1070.008
12131 IndicatorRemovalClearMailboxData,
12132 /// T1071
12133 ApplicationLayerProtocol,
12134 /// T1071.004
12135 Dns,
12136 /// T1072
12137 SoftwareDeploymentTools,
12138 /// T1078
12139 ValidAccounts,
12140 /// T1078.001
12141 DefaultAccounts,
12142 /// T1078.003
12143 LocalAccounts,
12144 /// T1078.004
12145 CloudAccounts,
12146 /// T1083
12147 FileAndDirectoryDiscovery,
12148 /// T1087.001
12149 AccountDiscoveryLocalAccount,
12150 /// T1090
12151 Proxy,
12152 /// T1090.002
12153 ExternalProxy,
12154 /// T1090.003
12155 MultiHopProxy,
12156 /// T1098
12157 AccountManipulation,
12158 /// T1098.001
12159 AdditionalCloudCredentials,
12160 /// T1098.003
12161 AdditionalCloudRoles,
12162 /// T1098.004
12163 SshAuthorizedKeys,
12164 /// T1098.006
12165 AdditionalContainerClusterRoles,
12166 /// T1104
12167 MultiStageChannels,
12168 /// T1105
12169 IngressToolTransfer,
12170 /// T1106
12171 NativeApi,
12172 /// T1110
12173 BruteForce,
12174 /// T1119
12175 AutomatedCollection,
12176 /// T1129
12177 SharedModules,
12178 /// T1132
12179 DataEncoding,
12180 /// T1132.001
12181 StandardEncoding,
12182 /// T1134
12183 AccessTokenManipulation,
12184 /// T1134.001
12185 TokenImpersonationOrTheft,
12186 /// T1136
12187 CreateAccount,
12188 /// T1136.001
12189 LocalAccount,
12190 /// T1140
12191 DeobfuscateDecodeFilesOrInfo,
12192 /// T1190
12193 ExploitPublicFacingApplication,
12194 /// T1195
12195 SupplyChainCompromise,
12196 /// T1195.001
12197 CompromiseSoftwareDependenciesAndDevelopmentTools,
12198 /// T1203
12199 ExploitationForClientExecution,
12200 /// T1204
12201 UserExecution,
12202 /// T1222.002
12203 LinuxAndMacFileAndDirectoryPermissionsModification,
12204 /// T1484
12205 DomainPolicyModification,
12206 /// T1485
12207 DataDestruction,
12208 /// T1486
12209 DataEncryptedForImpact,
12210 /// T1489
12211 ServiceStop,
12212 /// T1490
12213 InhibitSystemRecovery,
12214 /// T1495
12215 FirmwareCorruption,
12216 /// T1496
12217 ResourceHijacking,
12218 /// T1498
12219 NetworkDenialOfService,
12220 /// T1526
12221 CloudServiceDiscovery,
12222 /// T1528
12223 StealApplicationAccessToken,
12224 /// T1531
12225 AccountAccessRemoval,
12226 /// T1537
12227 TransferDataToCloudAccount,
12228 /// T1539
12229 StealWebSessionCookie,
12230 /// T1543
12231 CreateOrModifySystemProcess,
12232 /// T1546
12233 EventTriggeredExecution,
12234 /// T1547
12235 BootOrLogonAutostartExecution,
12236 /// T1547.006
12237 KernelModulesAndExtensions,
12238 /// T1547.009
12239 ShortcutModification,
12240 /// T1548
12241 AbuseElevationControlMechanism,
12242 /// T1548.001
12243 AbuseElevationControlMechanismSetuidAndSetgid,
12244 /// T1548.003
12245 AbuseElevationControlMechanismSudoAndSudoCaching,
12246 /// T1552
12247 UnsecuredCredentials,
12248 /// T1552.001
12249 CredentialsInFiles,
12250 /// T1552.003
12251 BashHistory,
12252 /// T1552.004
12253 PrivateKeys,
12254 /// T1553
12255 SubvertTrustControl,
12256 /// T1553.004
12257 InstallRootCertificate,
12258 /// T1554
12259 CompromiseHostSoftwareBinary,
12260 /// T1555
12261 CredentialsFromPasswordStores,
12262 /// T1556
12263 ModifyAuthenticationProcess,
12264 /// T1556.003
12265 PluggableAuthenticationModules,
12266 /// T1556.006
12267 MultiFactorAuthentication,
12268 /// T1562
12269 ImpairDefenses,
12270 /// T1562.001
12271 DisableOrModifyTools,
12272 /// T1562.006
12273 IndicatorBlocking,
12274 /// T1562.012
12275 DisableOrModifyLinuxAuditSystem,
12276 /// T1564
12277 HideArtifacts,
12278 /// T1564.001
12279 HiddenFilesAndDirectories,
12280 /// T1564.002
12281 HiddenUsers,
12282 /// T1567
12283 ExfiltrationOverWebService,
12284 /// T1567.002
12285 ExfiltrationToCloudStorage,
12286 /// T1568
12287 DynamicResolution,
12288 /// T1570
12289 LateralToolTransfer,
12290 /// T1574
12291 HijackExecutionFlow,
12292 /// T1574.006
12293 HijackExecutionFlowDynamicLinkerHijacking,
12294 /// T1578
12295 ModifyCloudComputeInfrastructure,
12296 /// T1578.001
12297 CreateSnapshot,
12298 /// T1580
12299 CloudInfrastructureDiscovery,
12300 /// T1587
12301 DevelopCapabilities,
12302 /// T1587.001
12303 DevelopCapabilitiesMalware,
12304 /// T1588
12305 ObtainCapabilities,
12306 /// T1588.001
12307 ObtainCapabilitiesMalware,
12308 /// T1588.006
12309 ObtainCapabilitiesVulnerabilities,
12310 /// T1595
12311 ActiveScanning,
12312 /// T1595.001
12313 ScanningIpBlocks,
12314 /// T1608
12315 StageCapabilities,
12316 /// T1608.001
12317 UploadMalware,
12318 /// T1609
12319 ContainerAdministrationCommand,
12320 /// T1610
12321 DeployContainer,
12322 /// T1611
12323 EscapeToHost,
12324 /// T1613
12325 ContainerAndResourceDiscovery,
12326 /// T1620
12327 ReflectiveCodeLoading,
12328 /// T1649
12329 StealOrForgeAuthenticationCertificates,
12330 /// T1657
12331 FinancialTheft,
12332 /// If set, the enum was initialized with an unknown value.
12333 ///
12334 /// Applications can examine the value using [Technique::value] or
12335 /// [Technique::name].
12336 UnknownValue(technique::UnknownValue),
12337 }
12338
12339 #[doc(hidden)]
12340 pub mod technique {
12341 #[allow(unused_imports)]
12342 use super::*;
12343 #[derive(Clone, Debug, PartialEq)]
12344 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12345 }
12346
12347 impl Technique {
12348 /// Gets the enum value.
12349 ///
12350 /// Returns `None` if the enum contains an unknown value deserialized from
12351 /// the string representation of enums.
12352 pub fn value(&self) -> std::option::Option<i32> {
12353 match self {
12354 Self::Unspecified => std::option::Option::Some(0),
12355 Self::DataObfuscation => std::option::Option::Some(70),
12356 Self::DataObfuscationSteganography => std::option::Option::Some(71),
12357 Self::OsCredentialDumping => std::option::Option::Some(114),
12358 Self::OsCredentialDumpingProcFilesystem => std::option::Option::Some(115),
12359 Self::OsCredentialDumpingEtcPasswordAndEtcShadow => std::option::Option::Some(122),
12360 Self::DataFromLocalSystem => std::option::Option::Some(117),
12361 Self::AutomatedExfiltration => std::option::Option::Some(68),
12362 Self::ObfuscatedFilesOrInfo => std::option::Option::Some(72),
12363 Self::Steganography => std::option::Option::Some(73),
12364 Self::CompileAfterDelivery => std::option::Option::Some(74),
12365 Self::CommandObfuscation => std::option::Option::Some(75),
12366 Self::ScheduledTransfer => std::option::Option::Some(120),
12367 Self::SystemOwnerUserDiscovery => std::option::Option::Some(118),
12368 Self::Masquerading => std::option::Option::Some(49),
12369 Self::MatchLegitimateNameOrLocation => std::option::Option::Some(50),
12370 Self::BootOrLogonInitializationScripts => std::option::Option::Some(37),
12371 Self::StartupItems => std::option::Option::Some(38),
12372 Self::NetworkServiceDiscovery => std::option::Option::Some(32),
12373 Self::ScheduledTaskJob => std::option::Option::Some(89),
12374 Self::ScheduledTaskJobCron => std::option::Option::Some(119),
12375 Self::ContainerOrchestrationJob => std::option::Option::Some(90),
12376 Self::ProcessInjection => std::option::Option::Some(93),
12377 Self::InputCapture => std::option::Option::Some(103),
12378 Self::InputCaptureKeylogging => std::option::Option::Some(104),
12379 Self::ProcessDiscovery => std::option::Option::Some(56),
12380 Self::CommandAndScriptingInterpreter => std::option::Option::Some(6),
12381 Self::UnixShell => std::option::Option::Some(7),
12382 Self::Python => std::option::Option::Some(59),
12383 Self::ExploitationForPrivilegeEscalation => std::option::Option::Some(63),
12384 Self::PermissionGroupsDiscovery => std::option::Option::Some(18),
12385 Self::CloudGroups => std::option::Option::Some(19),
12386 Self::IndicatorRemoval => std::option::Option::Some(123),
12387 Self::IndicatorRemovalClearLinuxOrMacSystemLogs => std::option::Option::Some(124),
12388 Self::IndicatorRemovalClearCommandHistory => std::option::Option::Some(125),
12389 Self::IndicatorRemovalFileDeletion => std::option::Option::Some(64),
12390 Self::IndicatorRemovalTimestomp => std::option::Option::Some(128),
12391 Self::IndicatorRemovalClearMailboxData => std::option::Option::Some(126),
12392 Self::ApplicationLayerProtocol => std::option::Option::Some(45),
12393 Self::Dns => std::option::Option::Some(46),
12394 Self::SoftwareDeploymentTools => std::option::Option::Some(47),
12395 Self::ValidAccounts => std::option::Option::Some(14),
12396 Self::DefaultAccounts => std::option::Option::Some(35),
12397 Self::LocalAccounts => std::option::Option::Some(15),
12398 Self::CloudAccounts => std::option::Option::Some(16),
12399 Self::FileAndDirectoryDiscovery => std::option::Option::Some(121),
12400 Self::AccountDiscoveryLocalAccount => std::option::Option::Some(116),
12401 Self::Proxy => std::option::Option::Some(9),
12402 Self::ExternalProxy => std::option::Option::Some(10),
12403 Self::MultiHopProxy => std::option::Option::Some(11),
12404 Self::AccountManipulation => std::option::Option::Some(22),
12405 Self::AdditionalCloudCredentials => std::option::Option::Some(40),
12406 Self::AdditionalCloudRoles => std::option::Option::Some(67),
12407 Self::SshAuthorizedKeys => std::option::Option::Some(23),
12408 Self::AdditionalContainerClusterRoles => std::option::Option::Some(58),
12409 Self::MultiStageChannels => std::option::Option::Some(76),
12410 Self::IngressToolTransfer => std::option::Option::Some(3),
12411 Self::NativeApi => std::option::Option::Some(4),
12412 Self::BruteForce => std::option::Option::Some(44),
12413 Self::AutomatedCollection => std::option::Option::Some(94),
12414 Self::SharedModules => std::option::Option::Some(5),
12415 Self::DataEncoding => std::option::Option::Some(77),
12416 Self::StandardEncoding => std::option::Option::Some(78),
12417 Self::AccessTokenManipulation => std::option::Option::Some(33),
12418 Self::TokenImpersonationOrTheft => std::option::Option::Some(39),
12419 Self::CreateAccount => std::option::Option::Some(79),
12420 Self::LocalAccount => std::option::Option::Some(80),
12421 Self::DeobfuscateDecodeFilesOrInfo => std::option::Option::Some(95),
12422 Self::ExploitPublicFacingApplication => std::option::Option::Some(27),
12423 Self::SupplyChainCompromise => std::option::Option::Some(129),
12424 Self::CompromiseSoftwareDependenciesAndDevelopmentTools => {
12425 std::option::Option::Some(130)
12426 }
12427 Self::ExploitationForClientExecution => std::option::Option::Some(134),
12428 Self::UserExecution => std::option::Option::Some(69),
12429 Self::LinuxAndMacFileAndDirectoryPermissionsModification => {
12430 std::option::Option::Some(135)
12431 }
12432 Self::DomainPolicyModification => std::option::Option::Some(30),
12433 Self::DataDestruction => std::option::Option::Some(29),
12434 Self::DataEncryptedForImpact => std::option::Option::Some(132),
12435 Self::ServiceStop => std::option::Option::Some(52),
12436 Self::InhibitSystemRecovery => std::option::Option::Some(36),
12437 Self::FirmwareCorruption => std::option::Option::Some(81),
12438 Self::ResourceHijacking => std::option::Option::Some(8),
12439 Self::NetworkDenialOfService => std::option::Option::Some(17),
12440 Self::CloudServiceDiscovery => std::option::Option::Some(48),
12441 Self::StealApplicationAccessToken => std::option::Option::Some(42),
12442 Self::AccountAccessRemoval => std::option::Option::Some(51),
12443 Self::TransferDataToCloudAccount => std::option::Option::Some(91),
12444 Self::StealWebSessionCookie => std::option::Option::Some(25),
12445 Self::CreateOrModifySystemProcess => std::option::Option::Some(24),
12446 Self::EventTriggeredExecution => std::option::Option::Some(65),
12447 Self::BootOrLogonAutostartExecution => std::option::Option::Some(82),
12448 Self::KernelModulesAndExtensions => std::option::Option::Some(83),
12449 Self::ShortcutModification => std::option::Option::Some(127),
12450 Self::AbuseElevationControlMechanism => std::option::Option::Some(34),
12451 Self::AbuseElevationControlMechanismSetuidAndSetgid => {
12452 std::option::Option::Some(136)
12453 }
12454 Self::AbuseElevationControlMechanismSudoAndSudoCaching => {
12455 std::option::Option::Some(109)
12456 }
12457 Self::UnsecuredCredentials => std::option::Option::Some(13),
12458 Self::CredentialsInFiles => std::option::Option::Some(105),
12459 Self::BashHistory => std::option::Option::Some(96),
12460 Self::PrivateKeys => std::option::Option::Some(97),
12461 Self::SubvertTrustControl => std::option::Option::Some(106),
12462 Self::InstallRootCertificate => std::option::Option::Some(107),
12463 Self::CompromiseHostSoftwareBinary => std::option::Option::Some(84),
12464 Self::CredentialsFromPasswordStores => std::option::Option::Some(98),
12465 Self::ModifyAuthenticationProcess => std::option::Option::Some(28),
12466 Self::PluggableAuthenticationModules => std::option::Option::Some(108),
12467 Self::MultiFactorAuthentication => std::option::Option::Some(137),
12468 Self::ImpairDefenses => std::option::Option::Some(31),
12469 Self::DisableOrModifyTools => std::option::Option::Some(55),
12470 Self::IndicatorBlocking => std::option::Option::Some(110),
12471 Self::DisableOrModifyLinuxAuditSystem => std::option::Option::Some(111),
12472 Self::HideArtifacts => std::option::Option::Some(85),
12473 Self::HiddenFilesAndDirectories => std::option::Option::Some(86),
12474 Self::HiddenUsers => std::option::Option::Some(87),
12475 Self::ExfiltrationOverWebService => std::option::Option::Some(20),
12476 Self::ExfiltrationToCloudStorage => std::option::Option::Some(21),
12477 Self::DynamicResolution => std::option::Option::Some(12),
12478 Self::LateralToolTransfer => std::option::Option::Some(41),
12479 Self::HijackExecutionFlow => std::option::Option::Some(112),
12480 Self::HijackExecutionFlowDynamicLinkerHijacking => std::option::Option::Some(113),
12481 Self::ModifyCloudComputeInfrastructure => std::option::Option::Some(26),
12482 Self::CreateSnapshot => std::option::Option::Some(54),
12483 Self::CloudInfrastructureDiscovery => std::option::Option::Some(53),
12484 Self::DevelopCapabilities => std::option::Option::Some(99),
12485 Self::DevelopCapabilitiesMalware => std::option::Option::Some(100),
12486 Self::ObtainCapabilities => std::option::Option::Some(43),
12487 Self::ObtainCapabilitiesMalware => std::option::Option::Some(101),
12488 Self::ObtainCapabilitiesVulnerabilities => std::option::Option::Some(133),
12489 Self::ActiveScanning => std::option::Option::Some(1),
12490 Self::ScanningIpBlocks => std::option::Option::Some(2),
12491 Self::StageCapabilities => std::option::Option::Some(88),
12492 Self::UploadMalware => std::option::Option::Some(102),
12493 Self::ContainerAdministrationCommand => std::option::Option::Some(60),
12494 Self::DeployContainer => std::option::Option::Some(66),
12495 Self::EscapeToHost => std::option::Option::Some(61),
12496 Self::ContainerAndResourceDiscovery => std::option::Option::Some(57),
12497 Self::ReflectiveCodeLoading => std::option::Option::Some(92),
12498 Self::StealOrForgeAuthenticationCertificates => std::option::Option::Some(62),
12499 Self::FinancialTheft => std::option::Option::Some(131),
12500 Self::UnknownValue(u) => u.0.value(),
12501 }
12502 }
12503
12504 /// Gets the enum value as a string.
12505 ///
12506 /// Returns `None` if the enum contains an unknown value deserialized from
12507 /// the integer representation of enums.
12508 pub fn name(&self) -> std::option::Option<&str> {
12509 match self {
12510 Self::Unspecified => std::option::Option::Some("TECHNIQUE_UNSPECIFIED"),
12511 Self::DataObfuscation => std::option::Option::Some("DATA_OBFUSCATION"),
12512 Self::DataObfuscationSteganography => {
12513 std::option::Option::Some("DATA_OBFUSCATION_STEGANOGRAPHY")
12514 }
12515 Self::OsCredentialDumping => std::option::Option::Some("OS_CREDENTIAL_DUMPING"),
12516 Self::OsCredentialDumpingProcFilesystem => {
12517 std::option::Option::Some("OS_CREDENTIAL_DUMPING_PROC_FILESYSTEM")
12518 }
12519 Self::OsCredentialDumpingEtcPasswordAndEtcShadow => {
12520 std::option::Option::Some("OS_CREDENTIAL_DUMPING_ETC_PASSWORD_AND_ETC_SHADOW")
12521 }
12522 Self::DataFromLocalSystem => std::option::Option::Some("DATA_FROM_LOCAL_SYSTEM"),
12523 Self::AutomatedExfiltration => std::option::Option::Some("AUTOMATED_EXFILTRATION"),
12524 Self::ObfuscatedFilesOrInfo => {
12525 std::option::Option::Some("OBFUSCATED_FILES_OR_INFO")
12526 }
12527 Self::Steganography => std::option::Option::Some("STEGANOGRAPHY"),
12528 Self::CompileAfterDelivery => std::option::Option::Some("COMPILE_AFTER_DELIVERY"),
12529 Self::CommandObfuscation => std::option::Option::Some("COMMAND_OBFUSCATION"),
12530 Self::ScheduledTransfer => std::option::Option::Some("SCHEDULED_TRANSFER"),
12531 Self::SystemOwnerUserDiscovery => {
12532 std::option::Option::Some("SYSTEM_OWNER_USER_DISCOVERY")
12533 }
12534 Self::Masquerading => std::option::Option::Some("MASQUERADING"),
12535 Self::MatchLegitimateNameOrLocation => {
12536 std::option::Option::Some("MATCH_LEGITIMATE_NAME_OR_LOCATION")
12537 }
12538 Self::BootOrLogonInitializationScripts => {
12539 std::option::Option::Some("BOOT_OR_LOGON_INITIALIZATION_SCRIPTS")
12540 }
12541 Self::StartupItems => std::option::Option::Some("STARTUP_ITEMS"),
12542 Self::NetworkServiceDiscovery => {
12543 std::option::Option::Some("NETWORK_SERVICE_DISCOVERY")
12544 }
12545 Self::ScheduledTaskJob => std::option::Option::Some("SCHEDULED_TASK_JOB"),
12546 Self::ScheduledTaskJobCron => std::option::Option::Some("SCHEDULED_TASK_JOB_CRON"),
12547 Self::ContainerOrchestrationJob => {
12548 std::option::Option::Some("CONTAINER_ORCHESTRATION_JOB")
12549 }
12550 Self::ProcessInjection => std::option::Option::Some("PROCESS_INJECTION"),
12551 Self::InputCapture => std::option::Option::Some("INPUT_CAPTURE"),
12552 Self::InputCaptureKeylogging => {
12553 std::option::Option::Some("INPUT_CAPTURE_KEYLOGGING")
12554 }
12555 Self::ProcessDiscovery => std::option::Option::Some("PROCESS_DISCOVERY"),
12556 Self::CommandAndScriptingInterpreter => {
12557 std::option::Option::Some("COMMAND_AND_SCRIPTING_INTERPRETER")
12558 }
12559 Self::UnixShell => std::option::Option::Some("UNIX_SHELL"),
12560 Self::Python => std::option::Option::Some("PYTHON"),
12561 Self::ExploitationForPrivilegeEscalation => {
12562 std::option::Option::Some("EXPLOITATION_FOR_PRIVILEGE_ESCALATION")
12563 }
12564 Self::PermissionGroupsDiscovery => {
12565 std::option::Option::Some("PERMISSION_GROUPS_DISCOVERY")
12566 }
12567 Self::CloudGroups => std::option::Option::Some("CLOUD_GROUPS"),
12568 Self::IndicatorRemoval => std::option::Option::Some("INDICATOR_REMOVAL"),
12569 Self::IndicatorRemovalClearLinuxOrMacSystemLogs => {
12570 std::option::Option::Some("INDICATOR_REMOVAL_CLEAR_LINUX_OR_MAC_SYSTEM_LOGS")
12571 }
12572 Self::IndicatorRemovalClearCommandHistory => {
12573 std::option::Option::Some("INDICATOR_REMOVAL_CLEAR_COMMAND_HISTORY")
12574 }
12575 Self::IndicatorRemovalFileDeletion => {
12576 std::option::Option::Some("INDICATOR_REMOVAL_FILE_DELETION")
12577 }
12578 Self::IndicatorRemovalTimestomp => {
12579 std::option::Option::Some("INDICATOR_REMOVAL_TIMESTOMP")
12580 }
12581 Self::IndicatorRemovalClearMailboxData => {
12582 std::option::Option::Some("INDICATOR_REMOVAL_CLEAR_MAILBOX_DATA")
12583 }
12584 Self::ApplicationLayerProtocol => {
12585 std::option::Option::Some("APPLICATION_LAYER_PROTOCOL")
12586 }
12587 Self::Dns => std::option::Option::Some("DNS"),
12588 Self::SoftwareDeploymentTools => {
12589 std::option::Option::Some("SOFTWARE_DEPLOYMENT_TOOLS")
12590 }
12591 Self::ValidAccounts => std::option::Option::Some("VALID_ACCOUNTS"),
12592 Self::DefaultAccounts => std::option::Option::Some("DEFAULT_ACCOUNTS"),
12593 Self::LocalAccounts => std::option::Option::Some("LOCAL_ACCOUNTS"),
12594 Self::CloudAccounts => std::option::Option::Some("CLOUD_ACCOUNTS"),
12595 Self::FileAndDirectoryDiscovery => {
12596 std::option::Option::Some("FILE_AND_DIRECTORY_DISCOVERY")
12597 }
12598 Self::AccountDiscoveryLocalAccount => {
12599 std::option::Option::Some("ACCOUNT_DISCOVERY_LOCAL_ACCOUNT")
12600 }
12601 Self::Proxy => std::option::Option::Some("PROXY"),
12602 Self::ExternalProxy => std::option::Option::Some("EXTERNAL_PROXY"),
12603 Self::MultiHopProxy => std::option::Option::Some("MULTI_HOP_PROXY"),
12604 Self::AccountManipulation => std::option::Option::Some("ACCOUNT_MANIPULATION"),
12605 Self::AdditionalCloudCredentials => {
12606 std::option::Option::Some("ADDITIONAL_CLOUD_CREDENTIALS")
12607 }
12608 Self::AdditionalCloudRoles => std::option::Option::Some("ADDITIONAL_CLOUD_ROLES"),
12609 Self::SshAuthorizedKeys => std::option::Option::Some("SSH_AUTHORIZED_KEYS"),
12610 Self::AdditionalContainerClusterRoles => {
12611 std::option::Option::Some("ADDITIONAL_CONTAINER_CLUSTER_ROLES")
12612 }
12613 Self::MultiStageChannels => std::option::Option::Some("MULTI_STAGE_CHANNELS"),
12614 Self::IngressToolTransfer => std::option::Option::Some("INGRESS_TOOL_TRANSFER"),
12615 Self::NativeApi => std::option::Option::Some("NATIVE_API"),
12616 Self::BruteForce => std::option::Option::Some("BRUTE_FORCE"),
12617 Self::AutomatedCollection => std::option::Option::Some("AUTOMATED_COLLECTION"),
12618 Self::SharedModules => std::option::Option::Some("SHARED_MODULES"),
12619 Self::DataEncoding => std::option::Option::Some("DATA_ENCODING"),
12620 Self::StandardEncoding => std::option::Option::Some("STANDARD_ENCODING"),
12621 Self::AccessTokenManipulation => {
12622 std::option::Option::Some("ACCESS_TOKEN_MANIPULATION")
12623 }
12624 Self::TokenImpersonationOrTheft => {
12625 std::option::Option::Some("TOKEN_IMPERSONATION_OR_THEFT")
12626 }
12627 Self::CreateAccount => std::option::Option::Some("CREATE_ACCOUNT"),
12628 Self::LocalAccount => std::option::Option::Some("LOCAL_ACCOUNT"),
12629 Self::DeobfuscateDecodeFilesOrInfo => {
12630 std::option::Option::Some("DEOBFUSCATE_DECODE_FILES_OR_INFO")
12631 }
12632 Self::ExploitPublicFacingApplication => {
12633 std::option::Option::Some("EXPLOIT_PUBLIC_FACING_APPLICATION")
12634 }
12635 Self::SupplyChainCompromise => std::option::Option::Some("SUPPLY_CHAIN_COMPROMISE"),
12636 Self::CompromiseSoftwareDependenciesAndDevelopmentTools => {
12637 std::option::Option::Some(
12638 "COMPROMISE_SOFTWARE_DEPENDENCIES_AND_DEVELOPMENT_TOOLS",
12639 )
12640 }
12641 Self::ExploitationForClientExecution => {
12642 std::option::Option::Some("EXPLOITATION_FOR_CLIENT_EXECUTION")
12643 }
12644 Self::UserExecution => std::option::Option::Some("USER_EXECUTION"),
12645 Self::LinuxAndMacFileAndDirectoryPermissionsModification => {
12646 std::option::Option::Some(
12647 "LINUX_AND_MAC_FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION",
12648 )
12649 }
12650 Self::DomainPolicyModification => {
12651 std::option::Option::Some("DOMAIN_POLICY_MODIFICATION")
12652 }
12653 Self::DataDestruction => std::option::Option::Some("DATA_DESTRUCTION"),
12654 Self::DataEncryptedForImpact => {
12655 std::option::Option::Some("DATA_ENCRYPTED_FOR_IMPACT")
12656 }
12657 Self::ServiceStop => std::option::Option::Some("SERVICE_STOP"),
12658 Self::InhibitSystemRecovery => std::option::Option::Some("INHIBIT_SYSTEM_RECOVERY"),
12659 Self::FirmwareCorruption => std::option::Option::Some("FIRMWARE_CORRUPTION"),
12660 Self::ResourceHijacking => std::option::Option::Some("RESOURCE_HIJACKING"),
12661 Self::NetworkDenialOfService => {
12662 std::option::Option::Some("NETWORK_DENIAL_OF_SERVICE")
12663 }
12664 Self::CloudServiceDiscovery => std::option::Option::Some("CLOUD_SERVICE_DISCOVERY"),
12665 Self::StealApplicationAccessToken => {
12666 std::option::Option::Some("STEAL_APPLICATION_ACCESS_TOKEN")
12667 }
12668 Self::AccountAccessRemoval => std::option::Option::Some("ACCOUNT_ACCESS_REMOVAL"),
12669 Self::TransferDataToCloudAccount => {
12670 std::option::Option::Some("TRANSFER_DATA_TO_CLOUD_ACCOUNT")
12671 }
12672 Self::StealWebSessionCookie => {
12673 std::option::Option::Some("STEAL_WEB_SESSION_COOKIE")
12674 }
12675 Self::CreateOrModifySystemProcess => {
12676 std::option::Option::Some("CREATE_OR_MODIFY_SYSTEM_PROCESS")
12677 }
12678 Self::EventTriggeredExecution => {
12679 std::option::Option::Some("EVENT_TRIGGERED_EXECUTION")
12680 }
12681 Self::BootOrLogonAutostartExecution => {
12682 std::option::Option::Some("BOOT_OR_LOGON_AUTOSTART_EXECUTION")
12683 }
12684 Self::KernelModulesAndExtensions => {
12685 std::option::Option::Some("KERNEL_MODULES_AND_EXTENSIONS")
12686 }
12687 Self::ShortcutModification => std::option::Option::Some("SHORTCUT_MODIFICATION"),
12688 Self::AbuseElevationControlMechanism => {
12689 std::option::Option::Some("ABUSE_ELEVATION_CONTROL_MECHANISM")
12690 }
12691 Self::AbuseElevationControlMechanismSetuidAndSetgid => {
12692 std::option::Option::Some("ABUSE_ELEVATION_CONTROL_MECHANISM_SETUID_AND_SETGID")
12693 }
12694 Self::AbuseElevationControlMechanismSudoAndSudoCaching => {
12695 std::option::Option::Some(
12696 "ABUSE_ELEVATION_CONTROL_MECHANISM_SUDO_AND_SUDO_CACHING",
12697 )
12698 }
12699 Self::UnsecuredCredentials => std::option::Option::Some("UNSECURED_CREDENTIALS"),
12700 Self::CredentialsInFiles => std::option::Option::Some("CREDENTIALS_IN_FILES"),
12701 Self::BashHistory => std::option::Option::Some("BASH_HISTORY"),
12702 Self::PrivateKeys => std::option::Option::Some("PRIVATE_KEYS"),
12703 Self::SubvertTrustControl => std::option::Option::Some("SUBVERT_TRUST_CONTROL"),
12704 Self::InstallRootCertificate => {
12705 std::option::Option::Some("INSTALL_ROOT_CERTIFICATE")
12706 }
12707 Self::CompromiseHostSoftwareBinary => {
12708 std::option::Option::Some("COMPROMISE_HOST_SOFTWARE_BINARY")
12709 }
12710 Self::CredentialsFromPasswordStores => {
12711 std::option::Option::Some("CREDENTIALS_FROM_PASSWORD_STORES")
12712 }
12713 Self::ModifyAuthenticationProcess => {
12714 std::option::Option::Some("MODIFY_AUTHENTICATION_PROCESS")
12715 }
12716 Self::PluggableAuthenticationModules => {
12717 std::option::Option::Some("PLUGGABLE_AUTHENTICATION_MODULES")
12718 }
12719 Self::MultiFactorAuthentication => {
12720 std::option::Option::Some("MULTI_FACTOR_AUTHENTICATION")
12721 }
12722 Self::ImpairDefenses => std::option::Option::Some("IMPAIR_DEFENSES"),
12723 Self::DisableOrModifyTools => std::option::Option::Some("DISABLE_OR_MODIFY_TOOLS"),
12724 Self::IndicatorBlocking => std::option::Option::Some("INDICATOR_BLOCKING"),
12725 Self::DisableOrModifyLinuxAuditSystem => {
12726 std::option::Option::Some("DISABLE_OR_MODIFY_LINUX_AUDIT_SYSTEM")
12727 }
12728 Self::HideArtifacts => std::option::Option::Some("HIDE_ARTIFACTS"),
12729 Self::HiddenFilesAndDirectories => {
12730 std::option::Option::Some("HIDDEN_FILES_AND_DIRECTORIES")
12731 }
12732 Self::HiddenUsers => std::option::Option::Some("HIDDEN_USERS"),
12733 Self::ExfiltrationOverWebService => {
12734 std::option::Option::Some("EXFILTRATION_OVER_WEB_SERVICE")
12735 }
12736 Self::ExfiltrationToCloudStorage => {
12737 std::option::Option::Some("EXFILTRATION_TO_CLOUD_STORAGE")
12738 }
12739 Self::DynamicResolution => std::option::Option::Some("DYNAMIC_RESOLUTION"),
12740 Self::LateralToolTransfer => std::option::Option::Some("LATERAL_TOOL_TRANSFER"),
12741 Self::HijackExecutionFlow => std::option::Option::Some("HIJACK_EXECUTION_FLOW"),
12742 Self::HijackExecutionFlowDynamicLinkerHijacking => {
12743 std::option::Option::Some("HIJACK_EXECUTION_FLOW_DYNAMIC_LINKER_HIJACKING")
12744 }
12745 Self::ModifyCloudComputeInfrastructure => {
12746 std::option::Option::Some("MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE")
12747 }
12748 Self::CreateSnapshot => std::option::Option::Some("CREATE_SNAPSHOT"),
12749 Self::CloudInfrastructureDiscovery => {
12750 std::option::Option::Some("CLOUD_INFRASTRUCTURE_DISCOVERY")
12751 }
12752 Self::DevelopCapabilities => std::option::Option::Some("DEVELOP_CAPABILITIES"),
12753 Self::DevelopCapabilitiesMalware => {
12754 std::option::Option::Some("DEVELOP_CAPABILITIES_MALWARE")
12755 }
12756 Self::ObtainCapabilities => std::option::Option::Some("OBTAIN_CAPABILITIES"),
12757 Self::ObtainCapabilitiesMalware => {
12758 std::option::Option::Some("OBTAIN_CAPABILITIES_MALWARE")
12759 }
12760 Self::ObtainCapabilitiesVulnerabilities => {
12761 std::option::Option::Some("OBTAIN_CAPABILITIES_VULNERABILITIES")
12762 }
12763 Self::ActiveScanning => std::option::Option::Some("ACTIVE_SCANNING"),
12764 Self::ScanningIpBlocks => std::option::Option::Some("SCANNING_IP_BLOCKS"),
12765 Self::StageCapabilities => std::option::Option::Some("STAGE_CAPABILITIES"),
12766 Self::UploadMalware => std::option::Option::Some("UPLOAD_MALWARE"),
12767 Self::ContainerAdministrationCommand => {
12768 std::option::Option::Some("CONTAINER_ADMINISTRATION_COMMAND")
12769 }
12770 Self::DeployContainer => std::option::Option::Some("DEPLOY_CONTAINER"),
12771 Self::EscapeToHost => std::option::Option::Some("ESCAPE_TO_HOST"),
12772 Self::ContainerAndResourceDiscovery => {
12773 std::option::Option::Some("CONTAINER_AND_RESOURCE_DISCOVERY")
12774 }
12775 Self::ReflectiveCodeLoading => std::option::Option::Some("REFLECTIVE_CODE_LOADING"),
12776 Self::StealOrForgeAuthenticationCertificates => {
12777 std::option::Option::Some("STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES")
12778 }
12779 Self::FinancialTheft => std::option::Option::Some("FINANCIAL_THEFT"),
12780 Self::UnknownValue(u) => u.0.name(),
12781 }
12782 }
12783 }
12784
12785 impl std::default::Default for Technique {
12786 fn default() -> Self {
12787 use std::convert::From;
12788 Self::from(0)
12789 }
12790 }
12791
12792 impl std::fmt::Display for Technique {
12793 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12794 wkt::internal::display_enum(f, self.name(), self.value())
12795 }
12796 }
12797
12798 impl std::convert::From<i32> for Technique {
12799 fn from(value: i32) -> Self {
12800 match value {
12801 0 => Self::Unspecified,
12802 1 => Self::ActiveScanning,
12803 2 => Self::ScanningIpBlocks,
12804 3 => Self::IngressToolTransfer,
12805 4 => Self::NativeApi,
12806 5 => Self::SharedModules,
12807 6 => Self::CommandAndScriptingInterpreter,
12808 7 => Self::UnixShell,
12809 8 => Self::ResourceHijacking,
12810 9 => Self::Proxy,
12811 10 => Self::ExternalProxy,
12812 11 => Self::MultiHopProxy,
12813 12 => Self::DynamicResolution,
12814 13 => Self::UnsecuredCredentials,
12815 14 => Self::ValidAccounts,
12816 15 => Self::LocalAccounts,
12817 16 => Self::CloudAccounts,
12818 17 => Self::NetworkDenialOfService,
12819 18 => Self::PermissionGroupsDiscovery,
12820 19 => Self::CloudGroups,
12821 20 => Self::ExfiltrationOverWebService,
12822 21 => Self::ExfiltrationToCloudStorage,
12823 22 => Self::AccountManipulation,
12824 23 => Self::SshAuthorizedKeys,
12825 24 => Self::CreateOrModifySystemProcess,
12826 25 => Self::StealWebSessionCookie,
12827 26 => Self::ModifyCloudComputeInfrastructure,
12828 27 => Self::ExploitPublicFacingApplication,
12829 28 => Self::ModifyAuthenticationProcess,
12830 29 => Self::DataDestruction,
12831 30 => Self::DomainPolicyModification,
12832 31 => Self::ImpairDefenses,
12833 32 => Self::NetworkServiceDiscovery,
12834 33 => Self::AccessTokenManipulation,
12835 34 => Self::AbuseElevationControlMechanism,
12836 35 => Self::DefaultAccounts,
12837 36 => Self::InhibitSystemRecovery,
12838 37 => Self::BootOrLogonInitializationScripts,
12839 38 => Self::StartupItems,
12840 39 => Self::TokenImpersonationOrTheft,
12841 40 => Self::AdditionalCloudCredentials,
12842 41 => Self::LateralToolTransfer,
12843 42 => Self::StealApplicationAccessToken,
12844 43 => Self::ObtainCapabilities,
12845 44 => Self::BruteForce,
12846 45 => Self::ApplicationLayerProtocol,
12847 46 => Self::Dns,
12848 47 => Self::SoftwareDeploymentTools,
12849 48 => Self::CloudServiceDiscovery,
12850 49 => Self::Masquerading,
12851 50 => Self::MatchLegitimateNameOrLocation,
12852 51 => Self::AccountAccessRemoval,
12853 52 => Self::ServiceStop,
12854 53 => Self::CloudInfrastructureDiscovery,
12855 54 => Self::CreateSnapshot,
12856 55 => Self::DisableOrModifyTools,
12857 56 => Self::ProcessDiscovery,
12858 57 => Self::ContainerAndResourceDiscovery,
12859 58 => Self::AdditionalContainerClusterRoles,
12860 59 => Self::Python,
12861 60 => Self::ContainerAdministrationCommand,
12862 61 => Self::EscapeToHost,
12863 62 => Self::StealOrForgeAuthenticationCertificates,
12864 63 => Self::ExploitationForPrivilegeEscalation,
12865 64 => Self::IndicatorRemovalFileDeletion,
12866 65 => Self::EventTriggeredExecution,
12867 66 => Self::DeployContainer,
12868 67 => Self::AdditionalCloudRoles,
12869 68 => Self::AutomatedExfiltration,
12870 69 => Self::UserExecution,
12871 70 => Self::DataObfuscation,
12872 71 => Self::DataObfuscationSteganography,
12873 72 => Self::ObfuscatedFilesOrInfo,
12874 73 => Self::Steganography,
12875 74 => Self::CompileAfterDelivery,
12876 75 => Self::CommandObfuscation,
12877 76 => Self::MultiStageChannels,
12878 77 => Self::DataEncoding,
12879 78 => Self::StandardEncoding,
12880 79 => Self::CreateAccount,
12881 80 => Self::LocalAccount,
12882 81 => Self::FirmwareCorruption,
12883 82 => Self::BootOrLogonAutostartExecution,
12884 83 => Self::KernelModulesAndExtensions,
12885 84 => Self::CompromiseHostSoftwareBinary,
12886 85 => Self::HideArtifacts,
12887 86 => Self::HiddenFilesAndDirectories,
12888 87 => Self::HiddenUsers,
12889 88 => Self::StageCapabilities,
12890 89 => Self::ScheduledTaskJob,
12891 90 => Self::ContainerOrchestrationJob,
12892 91 => Self::TransferDataToCloudAccount,
12893 92 => Self::ReflectiveCodeLoading,
12894 93 => Self::ProcessInjection,
12895 94 => Self::AutomatedCollection,
12896 95 => Self::DeobfuscateDecodeFilesOrInfo,
12897 96 => Self::BashHistory,
12898 97 => Self::PrivateKeys,
12899 98 => Self::CredentialsFromPasswordStores,
12900 99 => Self::DevelopCapabilities,
12901 100 => Self::DevelopCapabilitiesMalware,
12902 101 => Self::ObtainCapabilitiesMalware,
12903 102 => Self::UploadMalware,
12904 103 => Self::InputCapture,
12905 104 => Self::InputCaptureKeylogging,
12906 105 => Self::CredentialsInFiles,
12907 106 => Self::SubvertTrustControl,
12908 107 => Self::InstallRootCertificate,
12909 108 => Self::PluggableAuthenticationModules,
12910 109 => Self::AbuseElevationControlMechanismSudoAndSudoCaching,
12911 110 => Self::IndicatorBlocking,
12912 111 => Self::DisableOrModifyLinuxAuditSystem,
12913 112 => Self::HijackExecutionFlow,
12914 113 => Self::HijackExecutionFlowDynamicLinkerHijacking,
12915 114 => Self::OsCredentialDumping,
12916 115 => Self::OsCredentialDumpingProcFilesystem,
12917 116 => Self::AccountDiscoveryLocalAccount,
12918 117 => Self::DataFromLocalSystem,
12919 118 => Self::SystemOwnerUserDiscovery,
12920 119 => Self::ScheduledTaskJobCron,
12921 120 => Self::ScheduledTransfer,
12922 121 => Self::FileAndDirectoryDiscovery,
12923 122 => Self::OsCredentialDumpingEtcPasswordAndEtcShadow,
12924 123 => Self::IndicatorRemoval,
12925 124 => Self::IndicatorRemovalClearLinuxOrMacSystemLogs,
12926 125 => Self::IndicatorRemovalClearCommandHistory,
12927 126 => Self::IndicatorRemovalClearMailboxData,
12928 127 => Self::ShortcutModification,
12929 128 => Self::IndicatorRemovalTimestomp,
12930 129 => Self::SupplyChainCompromise,
12931 130 => Self::CompromiseSoftwareDependenciesAndDevelopmentTools,
12932 131 => Self::FinancialTheft,
12933 132 => Self::DataEncryptedForImpact,
12934 133 => Self::ObtainCapabilitiesVulnerabilities,
12935 134 => Self::ExploitationForClientExecution,
12936 135 => Self::LinuxAndMacFileAndDirectoryPermissionsModification,
12937 136 => Self::AbuseElevationControlMechanismSetuidAndSetgid,
12938 137 => Self::MultiFactorAuthentication,
12939 _ => Self::UnknownValue(technique::UnknownValue(
12940 wkt::internal::UnknownEnumValue::Integer(value),
12941 )),
12942 }
12943 }
12944 }
12945
12946 impl std::convert::From<&str> for Technique {
12947 fn from(value: &str) -> Self {
12948 use std::string::ToString;
12949 match value {
12950 "TECHNIQUE_UNSPECIFIED" => Self::Unspecified,
12951 "DATA_OBFUSCATION" => Self::DataObfuscation,
12952 "DATA_OBFUSCATION_STEGANOGRAPHY" => Self::DataObfuscationSteganography,
12953 "OS_CREDENTIAL_DUMPING" => Self::OsCredentialDumping,
12954 "OS_CREDENTIAL_DUMPING_PROC_FILESYSTEM" => Self::OsCredentialDumpingProcFilesystem,
12955 "OS_CREDENTIAL_DUMPING_ETC_PASSWORD_AND_ETC_SHADOW" => {
12956 Self::OsCredentialDumpingEtcPasswordAndEtcShadow
12957 }
12958 "DATA_FROM_LOCAL_SYSTEM" => Self::DataFromLocalSystem,
12959 "AUTOMATED_EXFILTRATION" => Self::AutomatedExfiltration,
12960 "OBFUSCATED_FILES_OR_INFO" => Self::ObfuscatedFilesOrInfo,
12961 "STEGANOGRAPHY" => Self::Steganography,
12962 "COMPILE_AFTER_DELIVERY" => Self::CompileAfterDelivery,
12963 "COMMAND_OBFUSCATION" => Self::CommandObfuscation,
12964 "SCHEDULED_TRANSFER" => Self::ScheduledTransfer,
12965 "SYSTEM_OWNER_USER_DISCOVERY" => Self::SystemOwnerUserDiscovery,
12966 "MASQUERADING" => Self::Masquerading,
12967 "MATCH_LEGITIMATE_NAME_OR_LOCATION" => Self::MatchLegitimateNameOrLocation,
12968 "BOOT_OR_LOGON_INITIALIZATION_SCRIPTS" => Self::BootOrLogonInitializationScripts,
12969 "STARTUP_ITEMS" => Self::StartupItems,
12970 "NETWORK_SERVICE_DISCOVERY" => Self::NetworkServiceDiscovery,
12971 "SCHEDULED_TASK_JOB" => Self::ScheduledTaskJob,
12972 "SCHEDULED_TASK_JOB_CRON" => Self::ScheduledTaskJobCron,
12973 "CONTAINER_ORCHESTRATION_JOB" => Self::ContainerOrchestrationJob,
12974 "PROCESS_INJECTION" => Self::ProcessInjection,
12975 "INPUT_CAPTURE" => Self::InputCapture,
12976 "INPUT_CAPTURE_KEYLOGGING" => Self::InputCaptureKeylogging,
12977 "PROCESS_DISCOVERY" => Self::ProcessDiscovery,
12978 "COMMAND_AND_SCRIPTING_INTERPRETER" => Self::CommandAndScriptingInterpreter,
12979 "UNIX_SHELL" => Self::UnixShell,
12980 "PYTHON" => Self::Python,
12981 "EXPLOITATION_FOR_PRIVILEGE_ESCALATION" => Self::ExploitationForPrivilegeEscalation,
12982 "PERMISSION_GROUPS_DISCOVERY" => Self::PermissionGroupsDiscovery,
12983 "CLOUD_GROUPS" => Self::CloudGroups,
12984 "INDICATOR_REMOVAL" => Self::IndicatorRemoval,
12985 "INDICATOR_REMOVAL_CLEAR_LINUX_OR_MAC_SYSTEM_LOGS" => {
12986 Self::IndicatorRemovalClearLinuxOrMacSystemLogs
12987 }
12988 "INDICATOR_REMOVAL_CLEAR_COMMAND_HISTORY" => {
12989 Self::IndicatorRemovalClearCommandHistory
12990 }
12991 "INDICATOR_REMOVAL_FILE_DELETION" => Self::IndicatorRemovalFileDeletion,
12992 "INDICATOR_REMOVAL_TIMESTOMP" => Self::IndicatorRemovalTimestomp,
12993 "INDICATOR_REMOVAL_CLEAR_MAILBOX_DATA" => Self::IndicatorRemovalClearMailboxData,
12994 "APPLICATION_LAYER_PROTOCOL" => Self::ApplicationLayerProtocol,
12995 "DNS" => Self::Dns,
12996 "SOFTWARE_DEPLOYMENT_TOOLS" => Self::SoftwareDeploymentTools,
12997 "VALID_ACCOUNTS" => Self::ValidAccounts,
12998 "DEFAULT_ACCOUNTS" => Self::DefaultAccounts,
12999 "LOCAL_ACCOUNTS" => Self::LocalAccounts,
13000 "CLOUD_ACCOUNTS" => Self::CloudAccounts,
13001 "FILE_AND_DIRECTORY_DISCOVERY" => Self::FileAndDirectoryDiscovery,
13002 "ACCOUNT_DISCOVERY_LOCAL_ACCOUNT" => Self::AccountDiscoveryLocalAccount,
13003 "PROXY" => Self::Proxy,
13004 "EXTERNAL_PROXY" => Self::ExternalProxy,
13005 "MULTI_HOP_PROXY" => Self::MultiHopProxy,
13006 "ACCOUNT_MANIPULATION" => Self::AccountManipulation,
13007 "ADDITIONAL_CLOUD_CREDENTIALS" => Self::AdditionalCloudCredentials,
13008 "ADDITIONAL_CLOUD_ROLES" => Self::AdditionalCloudRoles,
13009 "SSH_AUTHORIZED_KEYS" => Self::SshAuthorizedKeys,
13010 "ADDITIONAL_CONTAINER_CLUSTER_ROLES" => Self::AdditionalContainerClusterRoles,
13011 "MULTI_STAGE_CHANNELS" => Self::MultiStageChannels,
13012 "INGRESS_TOOL_TRANSFER" => Self::IngressToolTransfer,
13013 "NATIVE_API" => Self::NativeApi,
13014 "BRUTE_FORCE" => Self::BruteForce,
13015 "AUTOMATED_COLLECTION" => Self::AutomatedCollection,
13016 "SHARED_MODULES" => Self::SharedModules,
13017 "DATA_ENCODING" => Self::DataEncoding,
13018 "STANDARD_ENCODING" => Self::StandardEncoding,
13019 "ACCESS_TOKEN_MANIPULATION" => Self::AccessTokenManipulation,
13020 "TOKEN_IMPERSONATION_OR_THEFT" => Self::TokenImpersonationOrTheft,
13021 "CREATE_ACCOUNT" => Self::CreateAccount,
13022 "LOCAL_ACCOUNT" => Self::LocalAccount,
13023 "DEOBFUSCATE_DECODE_FILES_OR_INFO" => Self::DeobfuscateDecodeFilesOrInfo,
13024 "EXPLOIT_PUBLIC_FACING_APPLICATION" => Self::ExploitPublicFacingApplication,
13025 "SUPPLY_CHAIN_COMPROMISE" => Self::SupplyChainCompromise,
13026 "COMPROMISE_SOFTWARE_DEPENDENCIES_AND_DEVELOPMENT_TOOLS" => {
13027 Self::CompromiseSoftwareDependenciesAndDevelopmentTools
13028 }
13029 "EXPLOITATION_FOR_CLIENT_EXECUTION" => Self::ExploitationForClientExecution,
13030 "USER_EXECUTION" => Self::UserExecution,
13031 "LINUX_AND_MAC_FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION" => {
13032 Self::LinuxAndMacFileAndDirectoryPermissionsModification
13033 }
13034 "DOMAIN_POLICY_MODIFICATION" => Self::DomainPolicyModification,
13035 "DATA_DESTRUCTION" => Self::DataDestruction,
13036 "DATA_ENCRYPTED_FOR_IMPACT" => Self::DataEncryptedForImpact,
13037 "SERVICE_STOP" => Self::ServiceStop,
13038 "INHIBIT_SYSTEM_RECOVERY" => Self::InhibitSystemRecovery,
13039 "FIRMWARE_CORRUPTION" => Self::FirmwareCorruption,
13040 "RESOURCE_HIJACKING" => Self::ResourceHijacking,
13041 "NETWORK_DENIAL_OF_SERVICE" => Self::NetworkDenialOfService,
13042 "CLOUD_SERVICE_DISCOVERY" => Self::CloudServiceDiscovery,
13043 "STEAL_APPLICATION_ACCESS_TOKEN" => Self::StealApplicationAccessToken,
13044 "ACCOUNT_ACCESS_REMOVAL" => Self::AccountAccessRemoval,
13045 "TRANSFER_DATA_TO_CLOUD_ACCOUNT" => Self::TransferDataToCloudAccount,
13046 "STEAL_WEB_SESSION_COOKIE" => Self::StealWebSessionCookie,
13047 "CREATE_OR_MODIFY_SYSTEM_PROCESS" => Self::CreateOrModifySystemProcess,
13048 "EVENT_TRIGGERED_EXECUTION" => Self::EventTriggeredExecution,
13049 "BOOT_OR_LOGON_AUTOSTART_EXECUTION" => Self::BootOrLogonAutostartExecution,
13050 "KERNEL_MODULES_AND_EXTENSIONS" => Self::KernelModulesAndExtensions,
13051 "SHORTCUT_MODIFICATION" => Self::ShortcutModification,
13052 "ABUSE_ELEVATION_CONTROL_MECHANISM" => Self::AbuseElevationControlMechanism,
13053 "ABUSE_ELEVATION_CONTROL_MECHANISM_SETUID_AND_SETGID" => {
13054 Self::AbuseElevationControlMechanismSetuidAndSetgid
13055 }
13056 "ABUSE_ELEVATION_CONTROL_MECHANISM_SUDO_AND_SUDO_CACHING" => {
13057 Self::AbuseElevationControlMechanismSudoAndSudoCaching
13058 }
13059 "UNSECURED_CREDENTIALS" => Self::UnsecuredCredentials,
13060 "CREDENTIALS_IN_FILES" => Self::CredentialsInFiles,
13061 "BASH_HISTORY" => Self::BashHistory,
13062 "PRIVATE_KEYS" => Self::PrivateKeys,
13063 "SUBVERT_TRUST_CONTROL" => Self::SubvertTrustControl,
13064 "INSTALL_ROOT_CERTIFICATE" => Self::InstallRootCertificate,
13065 "COMPROMISE_HOST_SOFTWARE_BINARY" => Self::CompromiseHostSoftwareBinary,
13066 "CREDENTIALS_FROM_PASSWORD_STORES" => Self::CredentialsFromPasswordStores,
13067 "MODIFY_AUTHENTICATION_PROCESS" => Self::ModifyAuthenticationProcess,
13068 "PLUGGABLE_AUTHENTICATION_MODULES" => Self::PluggableAuthenticationModules,
13069 "MULTI_FACTOR_AUTHENTICATION" => Self::MultiFactorAuthentication,
13070 "IMPAIR_DEFENSES" => Self::ImpairDefenses,
13071 "DISABLE_OR_MODIFY_TOOLS" => Self::DisableOrModifyTools,
13072 "INDICATOR_BLOCKING" => Self::IndicatorBlocking,
13073 "DISABLE_OR_MODIFY_LINUX_AUDIT_SYSTEM" => Self::DisableOrModifyLinuxAuditSystem,
13074 "HIDE_ARTIFACTS" => Self::HideArtifacts,
13075 "HIDDEN_FILES_AND_DIRECTORIES" => Self::HiddenFilesAndDirectories,
13076 "HIDDEN_USERS" => Self::HiddenUsers,
13077 "EXFILTRATION_OVER_WEB_SERVICE" => Self::ExfiltrationOverWebService,
13078 "EXFILTRATION_TO_CLOUD_STORAGE" => Self::ExfiltrationToCloudStorage,
13079 "DYNAMIC_RESOLUTION" => Self::DynamicResolution,
13080 "LATERAL_TOOL_TRANSFER" => Self::LateralToolTransfer,
13081 "HIJACK_EXECUTION_FLOW" => Self::HijackExecutionFlow,
13082 "HIJACK_EXECUTION_FLOW_DYNAMIC_LINKER_HIJACKING" => {
13083 Self::HijackExecutionFlowDynamicLinkerHijacking
13084 }
13085 "MODIFY_CLOUD_COMPUTE_INFRASTRUCTURE" => Self::ModifyCloudComputeInfrastructure,
13086 "CREATE_SNAPSHOT" => Self::CreateSnapshot,
13087 "CLOUD_INFRASTRUCTURE_DISCOVERY" => Self::CloudInfrastructureDiscovery,
13088 "DEVELOP_CAPABILITIES" => Self::DevelopCapabilities,
13089 "DEVELOP_CAPABILITIES_MALWARE" => Self::DevelopCapabilitiesMalware,
13090 "OBTAIN_CAPABILITIES" => Self::ObtainCapabilities,
13091 "OBTAIN_CAPABILITIES_MALWARE" => Self::ObtainCapabilitiesMalware,
13092 "OBTAIN_CAPABILITIES_VULNERABILITIES" => Self::ObtainCapabilitiesVulnerabilities,
13093 "ACTIVE_SCANNING" => Self::ActiveScanning,
13094 "SCANNING_IP_BLOCKS" => Self::ScanningIpBlocks,
13095 "STAGE_CAPABILITIES" => Self::StageCapabilities,
13096 "UPLOAD_MALWARE" => Self::UploadMalware,
13097 "CONTAINER_ADMINISTRATION_COMMAND" => Self::ContainerAdministrationCommand,
13098 "DEPLOY_CONTAINER" => Self::DeployContainer,
13099 "ESCAPE_TO_HOST" => Self::EscapeToHost,
13100 "CONTAINER_AND_RESOURCE_DISCOVERY" => Self::ContainerAndResourceDiscovery,
13101 "REFLECTIVE_CODE_LOADING" => Self::ReflectiveCodeLoading,
13102 "STEAL_OR_FORGE_AUTHENTICATION_CERTIFICATES" => {
13103 Self::StealOrForgeAuthenticationCertificates
13104 }
13105 "FINANCIAL_THEFT" => Self::FinancialTheft,
13106 _ => Self::UnknownValue(technique::UnknownValue(
13107 wkt::internal::UnknownEnumValue::String(value.to_string()),
13108 )),
13109 }
13110 }
13111 }
13112
13113 impl serde::ser::Serialize for Technique {
13114 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13115 where
13116 S: serde::Serializer,
13117 {
13118 match self {
13119 Self::Unspecified => serializer.serialize_i32(0),
13120 Self::DataObfuscation => serializer.serialize_i32(70),
13121 Self::DataObfuscationSteganography => serializer.serialize_i32(71),
13122 Self::OsCredentialDumping => serializer.serialize_i32(114),
13123 Self::OsCredentialDumpingProcFilesystem => serializer.serialize_i32(115),
13124 Self::OsCredentialDumpingEtcPasswordAndEtcShadow => serializer.serialize_i32(122),
13125 Self::DataFromLocalSystem => serializer.serialize_i32(117),
13126 Self::AutomatedExfiltration => serializer.serialize_i32(68),
13127 Self::ObfuscatedFilesOrInfo => serializer.serialize_i32(72),
13128 Self::Steganography => serializer.serialize_i32(73),
13129 Self::CompileAfterDelivery => serializer.serialize_i32(74),
13130 Self::CommandObfuscation => serializer.serialize_i32(75),
13131 Self::ScheduledTransfer => serializer.serialize_i32(120),
13132 Self::SystemOwnerUserDiscovery => serializer.serialize_i32(118),
13133 Self::Masquerading => serializer.serialize_i32(49),
13134 Self::MatchLegitimateNameOrLocation => serializer.serialize_i32(50),
13135 Self::BootOrLogonInitializationScripts => serializer.serialize_i32(37),
13136 Self::StartupItems => serializer.serialize_i32(38),
13137 Self::NetworkServiceDiscovery => serializer.serialize_i32(32),
13138 Self::ScheduledTaskJob => serializer.serialize_i32(89),
13139 Self::ScheduledTaskJobCron => serializer.serialize_i32(119),
13140 Self::ContainerOrchestrationJob => serializer.serialize_i32(90),
13141 Self::ProcessInjection => serializer.serialize_i32(93),
13142 Self::InputCapture => serializer.serialize_i32(103),
13143 Self::InputCaptureKeylogging => serializer.serialize_i32(104),
13144 Self::ProcessDiscovery => serializer.serialize_i32(56),
13145 Self::CommandAndScriptingInterpreter => serializer.serialize_i32(6),
13146 Self::UnixShell => serializer.serialize_i32(7),
13147 Self::Python => serializer.serialize_i32(59),
13148 Self::ExploitationForPrivilegeEscalation => serializer.serialize_i32(63),
13149 Self::PermissionGroupsDiscovery => serializer.serialize_i32(18),
13150 Self::CloudGroups => serializer.serialize_i32(19),
13151 Self::IndicatorRemoval => serializer.serialize_i32(123),
13152 Self::IndicatorRemovalClearLinuxOrMacSystemLogs => serializer.serialize_i32(124),
13153 Self::IndicatorRemovalClearCommandHistory => serializer.serialize_i32(125),
13154 Self::IndicatorRemovalFileDeletion => serializer.serialize_i32(64),
13155 Self::IndicatorRemovalTimestomp => serializer.serialize_i32(128),
13156 Self::IndicatorRemovalClearMailboxData => serializer.serialize_i32(126),
13157 Self::ApplicationLayerProtocol => serializer.serialize_i32(45),
13158 Self::Dns => serializer.serialize_i32(46),
13159 Self::SoftwareDeploymentTools => serializer.serialize_i32(47),
13160 Self::ValidAccounts => serializer.serialize_i32(14),
13161 Self::DefaultAccounts => serializer.serialize_i32(35),
13162 Self::LocalAccounts => serializer.serialize_i32(15),
13163 Self::CloudAccounts => serializer.serialize_i32(16),
13164 Self::FileAndDirectoryDiscovery => serializer.serialize_i32(121),
13165 Self::AccountDiscoveryLocalAccount => serializer.serialize_i32(116),
13166 Self::Proxy => serializer.serialize_i32(9),
13167 Self::ExternalProxy => serializer.serialize_i32(10),
13168 Self::MultiHopProxy => serializer.serialize_i32(11),
13169 Self::AccountManipulation => serializer.serialize_i32(22),
13170 Self::AdditionalCloudCredentials => serializer.serialize_i32(40),
13171 Self::AdditionalCloudRoles => serializer.serialize_i32(67),
13172 Self::SshAuthorizedKeys => serializer.serialize_i32(23),
13173 Self::AdditionalContainerClusterRoles => serializer.serialize_i32(58),
13174 Self::MultiStageChannels => serializer.serialize_i32(76),
13175 Self::IngressToolTransfer => serializer.serialize_i32(3),
13176 Self::NativeApi => serializer.serialize_i32(4),
13177 Self::BruteForce => serializer.serialize_i32(44),
13178 Self::AutomatedCollection => serializer.serialize_i32(94),
13179 Self::SharedModules => serializer.serialize_i32(5),
13180 Self::DataEncoding => serializer.serialize_i32(77),
13181 Self::StandardEncoding => serializer.serialize_i32(78),
13182 Self::AccessTokenManipulation => serializer.serialize_i32(33),
13183 Self::TokenImpersonationOrTheft => serializer.serialize_i32(39),
13184 Self::CreateAccount => serializer.serialize_i32(79),
13185 Self::LocalAccount => serializer.serialize_i32(80),
13186 Self::DeobfuscateDecodeFilesOrInfo => serializer.serialize_i32(95),
13187 Self::ExploitPublicFacingApplication => serializer.serialize_i32(27),
13188 Self::SupplyChainCompromise => serializer.serialize_i32(129),
13189 Self::CompromiseSoftwareDependenciesAndDevelopmentTools => {
13190 serializer.serialize_i32(130)
13191 }
13192 Self::ExploitationForClientExecution => serializer.serialize_i32(134),
13193 Self::UserExecution => serializer.serialize_i32(69),
13194 Self::LinuxAndMacFileAndDirectoryPermissionsModification => {
13195 serializer.serialize_i32(135)
13196 }
13197 Self::DomainPolicyModification => serializer.serialize_i32(30),
13198 Self::DataDestruction => serializer.serialize_i32(29),
13199 Self::DataEncryptedForImpact => serializer.serialize_i32(132),
13200 Self::ServiceStop => serializer.serialize_i32(52),
13201 Self::InhibitSystemRecovery => serializer.serialize_i32(36),
13202 Self::FirmwareCorruption => serializer.serialize_i32(81),
13203 Self::ResourceHijacking => serializer.serialize_i32(8),
13204 Self::NetworkDenialOfService => serializer.serialize_i32(17),
13205 Self::CloudServiceDiscovery => serializer.serialize_i32(48),
13206 Self::StealApplicationAccessToken => serializer.serialize_i32(42),
13207 Self::AccountAccessRemoval => serializer.serialize_i32(51),
13208 Self::TransferDataToCloudAccount => serializer.serialize_i32(91),
13209 Self::StealWebSessionCookie => serializer.serialize_i32(25),
13210 Self::CreateOrModifySystemProcess => serializer.serialize_i32(24),
13211 Self::EventTriggeredExecution => serializer.serialize_i32(65),
13212 Self::BootOrLogonAutostartExecution => serializer.serialize_i32(82),
13213 Self::KernelModulesAndExtensions => serializer.serialize_i32(83),
13214 Self::ShortcutModification => serializer.serialize_i32(127),
13215 Self::AbuseElevationControlMechanism => serializer.serialize_i32(34),
13216 Self::AbuseElevationControlMechanismSetuidAndSetgid => {
13217 serializer.serialize_i32(136)
13218 }
13219 Self::AbuseElevationControlMechanismSudoAndSudoCaching => {
13220 serializer.serialize_i32(109)
13221 }
13222 Self::UnsecuredCredentials => serializer.serialize_i32(13),
13223 Self::CredentialsInFiles => serializer.serialize_i32(105),
13224 Self::BashHistory => serializer.serialize_i32(96),
13225 Self::PrivateKeys => serializer.serialize_i32(97),
13226 Self::SubvertTrustControl => serializer.serialize_i32(106),
13227 Self::InstallRootCertificate => serializer.serialize_i32(107),
13228 Self::CompromiseHostSoftwareBinary => serializer.serialize_i32(84),
13229 Self::CredentialsFromPasswordStores => serializer.serialize_i32(98),
13230 Self::ModifyAuthenticationProcess => serializer.serialize_i32(28),
13231 Self::PluggableAuthenticationModules => serializer.serialize_i32(108),
13232 Self::MultiFactorAuthentication => serializer.serialize_i32(137),
13233 Self::ImpairDefenses => serializer.serialize_i32(31),
13234 Self::DisableOrModifyTools => serializer.serialize_i32(55),
13235 Self::IndicatorBlocking => serializer.serialize_i32(110),
13236 Self::DisableOrModifyLinuxAuditSystem => serializer.serialize_i32(111),
13237 Self::HideArtifacts => serializer.serialize_i32(85),
13238 Self::HiddenFilesAndDirectories => serializer.serialize_i32(86),
13239 Self::HiddenUsers => serializer.serialize_i32(87),
13240 Self::ExfiltrationOverWebService => serializer.serialize_i32(20),
13241 Self::ExfiltrationToCloudStorage => serializer.serialize_i32(21),
13242 Self::DynamicResolution => serializer.serialize_i32(12),
13243 Self::LateralToolTransfer => serializer.serialize_i32(41),
13244 Self::HijackExecutionFlow => serializer.serialize_i32(112),
13245 Self::HijackExecutionFlowDynamicLinkerHijacking => serializer.serialize_i32(113),
13246 Self::ModifyCloudComputeInfrastructure => serializer.serialize_i32(26),
13247 Self::CreateSnapshot => serializer.serialize_i32(54),
13248 Self::CloudInfrastructureDiscovery => serializer.serialize_i32(53),
13249 Self::DevelopCapabilities => serializer.serialize_i32(99),
13250 Self::DevelopCapabilitiesMalware => serializer.serialize_i32(100),
13251 Self::ObtainCapabilities => serializer.serialize_i32(43),
13252 Self::ObtainCapabilitiesMalware => serializer.serialize_i32(101),
13253 Self::ObtainCapabilitiesVulnerabilities => serializer.serialize_i32(133),
13254 Self::ActiveScanning => serializer.serialize_i32(1),
13255 Self::ScanningIpBlocks => serializer.serialize_i32(2),
13256 Self::StageCapabilities => serializer.serialize_i32(88),
13257 Self::UploadMalware => serializer.serialize_i32(102),
13258 Self::ContainerAdministrationCommand => serializer.serialize_i32(60),
13259 Self::DeployContainer => serializer.serialize_i32(66),
13260 Self::EscapeToHost => serializer.serialize_i32(61),
13261 Self::ContainerAndResourceDiscovery => serializer.serialize_i32(57),
13262 Self::ReflectiveCodeLoading => serializer.serialize_i32(92),
13263 Self::StealOrForgeAuthenticationCertificates => serializer.serialize_i32(62),
13264 Self::FinancialTheft => serializer.serialize_i32(131),
13265 Self::UnknownValue(u) => u.0.serialize(serializer),
13266 }
13267 }
13268 }
13269
13270 impl<'de> serde::de::Deserialize<'de> for Technique {
13271 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13272 where
13273 D: serde::Deserializer<'de>,
13274 {
13275 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Technique>::new(
13276 ".google.cloud.securitycenter.v2.MitreAttack.Technique",
13277 ))
13278 }
13279 }
13280}
13281
13282/// A mute config is a Cloud SCC resource that contains the configuration
13283/// to mute create/update events of findings.
13284#[derive(Clone, Default, PartialEq)]
13285#[non_exhaustive]
13286pub struct MuteConfig {
13287 /// Identifier. This field will be ignored if provided on config creation. The
13288 /// following list shows some examples of the format:
13289 ///
13290 /// + `organizations/{organization}/muteConfigs/{mute_config}`
13291 ///
13292 /// `organizations/{organization}locations/{location}//muteConfigs/{mute_config}`
13293 ///
13294 /// + `folders/{folder}/muteConfigs/{mute_config}`
13295 /// + `folders/{folder}/locations/{location}/muteConfigs/{mute_config}`
13296 /// + `projects/{project}/muteConfigs/{mute_config}`
13297 /// + `projects/{project}/locations/{location}/muteConfigs/{mute_config}`
13298 pub name: std::string::String,
13299
13300 /// A description of the mute config.
13301 pub description: std::string::String,
13302
13303 /// Required. An expression that defines the filter to apply across
13304 /// create/update events of findings. While creating a filter string, be
13305 /// mindful of the scope in which the mute configuration is being created.
13306 /// E.g., If a filter contains project = X but is created under the project = Y
13307 /// scope, it might not match any findings.
13308 ///
13309 /// The following field and operator combinations are supported:
13310 ///
13311 /// * severity: `=`, `:`
13312 /// * category: `=`, `:`
13313 /// * resource.name: `=`, `:`
13314 /// * resource.project_name: `=`, `:`
13315 /// * resource.project_display_name: `=`, `:`
13316 /// * resource.folders.resource_folder: `=`, `:`
13317 /// * resource.parent_name: `=`, `:`
13318 /// * resource.parent_display_name: `=`, `:`
13319 /// * resource.type: `=`, `:`
13320 /// * finding_class: `=`, `:`
13321 /// * indicator.ip_addresses: `=`, `:`
13322 /// * indicator.domains: `=`, `:`
13323 pub filter: std::string::String,
13324
13325 /// Output only. The time at which the mute config was created.
13326 /// This field is set by the server and will be ignored if provided on config
13327 /// creation.
13328 pub create_time: std::option::Option<wkt::Timestamp>,
13329
13330 /// Output only. The most recent time at which the mute config was updated.
13331 /// This field is set by the server and will be ignored if provided on config
13332 /// creation or update.
13333 pub update_time: std::option::Option<wkt::Timestamp>,
13334
13335 /// Output only. Email address of the user who last edited the mute config.
13336 /// This field is set by the server and will be ignored if provided on config
13337 /// creation or update.
13338 pub most_recent_editor: std::string::String,
13339
13340 /// Required. The type of the mute config, which determines what type of mute
13341 /// state the config affects. Immutable after creation.
13342 pub r#type: crate::model::mute_config::MuteConfigType,
13343
13344 /// Optional. The expiry of the mute config. Only applicable for dynamic
13345 /// configs. If the expiry is set, when the config expires, it is removed from
13346 /// all findings.
13347 pub expiry_time: std::option::Option<wkt::Timestamp>,
13348
13349 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13350}
13351
13352impl MuteConfig {
13353 /// Creates a new default instance.
13354 pub fn new() -> Self {
13355 std::default::Default::default()
13356 }
13357
13358 /// Sets the value of [name][crate::model::MuteConfig::name].
13359 ///
13360 /// # Example
13361 /// ```ignore,no_run
13362 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13363 /// let x = MuteConfig::new().set_name("example");
13364 /// ```
13365 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13366 self.name = v.into();
13367 self
13368 }
13369
13370 /// Sets the value of [description][crate::model::MuteConfig::description].
13371 ///
13372 /// # Example
13373 /// ```ignore,no_run
13374 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13375 /// let x = MuteConfig::new().set_description("example");
13376 /// ```
13377 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13378 self.description = v.into();
13379 self
13380 }
13381
13382 /// Sets the value of [filter][crate::model::MuteConfig::filter].
13383 ///
13384 /// # Example
13385 /// ```ignore,no_run
13386 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13387 /// let x = MuteConfig::new().set_filter("example");
13388 /// ```
13389 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13390 self.filter = v.into();
13391 self
13392 }
13393
13394 /// Sets the value of [create_time][crate::model::MuteConfig::create_time].
13395 ///
13396 /// # Example
13397 /// ```ignore,no_run
13398 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13399 /// use wkt::Timestamp;
13400 /// let x = MuteConfig::new().set_create_time(Timestamp::default()/* use setters */);
13401 /// ```
13402 pub fn set_create_time<T>(mut self, v: T) -> Self
13403 where
13404 T: std::convert::Into<wkt::Timestamp>,
13405 {
13406 self.create_time = std::option::Option::Some(v.into());
13407 self
13408 }
13409
13410 /// Sets or clears the value of [create_time][crate::model::MuteConfig::create_time].
13411 ///
13412 /// # Example
13413 /// ```ignore,no_run
13414 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13415 /// use wkt::Timestamp;
13416 /// let x = MuteConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
13417 /// let x = MuteConfig::new().set_or_clear_create_time(None::<Timestamp>);
13418 /// ```
13419 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13420 where
13421 T: std::convert::Into<wkt::Timestamp>,
13422 {
13423 self.create_time = v.map(|x| x.into());
13424 self
13425 }
13426
13427 /// Sets the value of [update_time][crate::model::MuteConfig::update_time].
13428 ///
13429 /// # Example
13430 /// ```ignore,no_run
13431 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13432 /// use wkt::Timestamp;
13433 /// let x = MuteConfig::new().set_update_time(Timestamp::default()/* use setters */);
13434 /// ```
13435 pub fn set_update_time<T>(mut self, v: T) -> Self
13436 where
13437 T: std::convert::Into<wkt::Timestamp>,
13438 {
13439 self.update_time = std::option::Option::Some(v.into());
13440 self
13441 }
13442
13443 /// Sets or clears the value of [update_time][crate::model::MuteConfig::update_time].
13444 ///
13445 /// # Example
13446 /// ```ignore,no_run
13447 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13448 /// use wkt::Timestamp;
13449 /// let x = MuteConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
13450 /// let x = MuteConfig::new().set_or_clear_update_time(None::<Timestamp>);
13451 /// ```
13452 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
13453 where
13454 T: std::convert::Into<wkt::Timestamp>,
13455 {
13456 self.update_time = v.map(|x| x.into());
13457 self
13458 }
13459
13460 /// Sets the value of [most_recent_editor][crate::model::MuteConfig::most_recent_editor].
13461 ///
13462 /// # Example
13463 /// ```ignore,no_run
13464 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13465 /// let x = MuteConfig::new().set_most_recent_editor("example");
13466 /// ```
13467 pub fn set_most_recent_editor<T: std::convert::Into<std::string::String>>(
13468 mut self,
13469 v: T,
13470 ) -> Self {
13471 self.most_recent_editor = v.into();
13472 self
13473 }
13474
13475 /// Sets the value of [r#type][crate::model::MuteConfig::type].
13476 ///
13477 /// # Example
13478 /// ```ignore,no_run
13479 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13480 /// use google_cloud_securitycenter_v2::model::mute_config::MuteConfigType;
13481 /// let x0 = MuteConfig::new().set_type(MuteConfigType::Static);
13482 /// let x1 = MuteConfig::new().set_type(MuteConfigType::Dynamic);
13483 /// ```
13484 pub fn set_type<T: std::convert::Into<crate::model::mute_config::MuteConfigType>>(
13485 mut self,
13486 v: T,
13487 ) -> Self {
13488 self.r#type = v.into();
13489 self
13490 }
13491
13492 /// Sets the value of [expiry_time][crate::model::MuteConfig::expiry_time].
13493 ///
13494 /// # Example
13495 /// ```ignore,no_run
13496 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13497 /// use wkt::Timestamp;
13498 /// let x = MuteConfig::new().set_expiry_time(Timestamp::default()/* use setters */);
13499 /// ```
13500 pub fn set_expiry_time<T>(mut self, v: T) -> Self
13501 where
13502 T: std::convert::Into<wkt::Timestamp>,
13503 {
13504 self.expiry_time = std::option::Option::Some(v.into());
13505 self
13506 }
13507
13508 /// Sets or clears the value of [expiry_time][crate::model::MuteConfig::expiry_time].
13509 ///
13510 /// # Example
13511 /// ```ignore,no_run
13512 /// # use google_cloud_securitycenter_v2::model::MuteConfig;
13513 /// use wkt::Timestamp;
13514 /// let x = MuteConfig::new().set_or_clear_expiry_time(Some(Timestamp::default()/* use setters */));
13515 /// let x = MuteConfig::new().set_or_clear_expiry_time(None::<Timestamp>);
13516 /// ```
13517 pub fn set_or_clear_expiry_time<T>(mut self, v: std::option::Option<T>) -> Self
13518 where
13519 T: std::convert::Into<wkt::Timestamp>,
13520 {
13521 self.expiry_time = v.map(|x| x.into());
13522 self
13523 }
13524}
13525
13526impl wkt::message::Message for MuteConfig {
13527 fn typename() -> &'static str {
13528 "type.googleapis.com/google.cloud.securitycenter.v2.MuteConfig"
13529 }
13530}
13531
13532/// Defines additional types related to [MuteConfig].
13533pub mod mute_config {
13534 #[allow(unused_imports)]
13535 use super::*;
13536
13537 /// The type of MuteConfig.
13538 ///
13539 /// # Working with unknown values
13540 ///
13541 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13542 /// additional enum variants at any time. Adding new variants is not considered
13543 /// a breaking change. Applications should write their code in anticipation of:
13544 ///
13545 /// - New values appearing in future releases of the client library, **and**
13546 /// - New values received dynamically, without application changes.
13547 ///
13548 /// Please consult the [Working with enums] section in the user guide for some
13549 /// guidelines.
13550 ///
13551 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13552 #[derive(Clone, Debug, PartialEq)]
13553 #[non_exhaustive]
13554 pub enum MuteConfigType {
13555 /// Unused.
13556 Unspecified,
13557 /// A static mute config, which sets the static mute state of future matching
13558 /// findings to muted. Once the static mute state has been set, finding or
13559 /// config modifications will not affect the state.
13560 Static,
13561 /// A dynamic mute config, which is applied to existing and future matching
13562 /// findings, setting their dynamic mute state to "muted". If the config is
13563 /// updated or deleted, or a matching finding is updated, such that the
13564 /// finding doesn't match the config, the config will be removed from the
13565 /// finding, and the finding's dynamic mute state may become "unmuted"
13566 /// (unless other configs still match).
13567 Dynamic,
13568 /// If set, the enum was initialized with an unknown value.
13569 ///
13570 /// Applications can examine the value using [MuteConfigType::value] or
13571 /// [MuteConfigType::name].
13572 UnknownValue(mute_config_type::UnknownValue),
13573 }
13574
13575 #[doc(hidden)]
13576 pub mod mute_config_type {
13577 #[allow(unused_imports)]
13578 use super::*;
13579 #[derive(Clone, Debug, PartialEq)]
13580 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13581 }
13582
13583 impl MuteConfigType {
13584 /// Gets the enum value.
13585 ///
13586 /// Returns `None` if the enum contains an unknown value deserialized from
13587 /// the string representation of enums.
13588 pub fn value(&self) -> std::option::Option<i32> {
13589 match self {
13590 Self::Unspecified => std::option::Option::Some(0),
13591 Self::Static => std::option::Option::Some(1),
13592 Self::Dynamic => std::option::Option::Some(2),
13593 Self::UnknownValue(u) => u.0.value(),
13594 }
13595 }
13596
13597 /// Gets the enum value as a string.
13598 ///
13599 /// Returns `None` if the enum contains an unknown value deserialized from
13600 /// the integer representation of enums.
13601 pub fn name(&self) -> std::option::Option<&str> {
13602 match self {
13603 Self::Unspecified => std::option::Option::Some("MUTE_CONFIG_TYPE_UNSPECIFIED"),
13604 Self::Static => std::option::Option::Some("STATIC"),
13605 Self::Dynamic => std::option::Option::Some("DYNAMIC"),
13606 Self::UnknownValue(u) => u.0.name(),
13607 }
13608 }
13609 }
13610
13611 impl std::default::Default for MuteConfigType {
13612 fn default() -> Self {
13613 use std::convert::From;
13614 Self::from(0)
13615 }
13616 }
13617
13618 impl std::fmt::Display for MuteConfigType {
13619 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13620 wkt::internal::display_enum(f, self.name(), self.value())
13621 }
13622 }
13623
13624 impl std::convert::From<i32> for MuteConfigType {
13625 fn from(value: i32) -> Self {
13626 match value {
13627 0 => Self::Unspecified,
13628 1 => Self::Static,
13629 2 => Self::Dynamic,
13630 _ => Self::UnknownValue(mute_config_type::UnknownValue(
13631 wkt::internal::UnknownEnumValue::Integer(value),
13632 )),
13633 }
13634 }
13635 }
13636
13637 impl std::convert::From<&str> for MuteConfigType {
13638 fn from(value: &str) -> Self {
13639 use std::string::ToString;
13640 match value {
13641 "MUTE_CONFIG_TYPE_UNSPECIFIED" => Self::Unspecified,
13642 "STATIC" => Self::Static,
13643 "DYNAMIC" => Self::Dynamic,
13644 _ => Self::UnknownValue(mute_config_type::UnknownValue(
13645 wkt::internal::UnknownEnumValue::String(value.to_string()),
13646 )),
13647 }
13648 }
13649 }
13650
13651 impl serde::ser::Serialize for MuteConfigType {
13652 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13653 where
13654 S: serde::Serializer,
13655 {
13656 match self {
13657 Self::Unspecified => serializer.serialize_i32(0),
13658 Self::Static => serializer.serialize_i32(1),
13659 Self::Dynamic => serializer.serialize_i32(2),
13660 Self::UnknownValue(u) => u.0.serialize(serializer),
13661 }
13662 }
13663 }
13664
13665 impl<'de> serde::de::Deserialize<'de> for MuteConfigType {
13666 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13667 where
13668 D: serde::Deserializer<'de>,
13669 {
13670 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MuteConfigType>::new(
13671 ".google.cloud.securitycenter.v2.MuteConfig.MuteConfigType",
13672 ))
13673 }
13674 }
13675}
13676
13677/// Contains information about a VPC network associated with the finding.
13678#[derive(Clone, Default, PartialEq)]
13679#[non_exhaustive]
13680pub struct Network {
13681 /// The name of the VPC network resource, for example,
13682 /// `//compute.googleapis.com/projects/my-project/global/networks/my-network`.
13683 pub name: std::string::String,
13684
13685 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13686}
13687
13688impl Network {
13689 /// Creates a new default instance.
13690 pub fn new() -> Self {
13691 std::default::Default::default()
13692 }
13693
13694 /// Sets the value of [name][crate::model::Network::name].
13695 ///
13696 /// # Example
13697 /// ```ignore,no_run
13698 /// # use google_cloud_securitycenter_v2::model::Network;
13699 /// let x = Network::new().set_name("example");
13700 /// ```
13701 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13702 self.name = v.into();
13703 self
13704 }
13705}
13706
13707impl wkt::message::Message for Network {
13708 fn typename() -> &'static str {
13709 "type.googleapis.com/google.cloud.securitycenter.v2.Network"
13710 }
13711}
13712
13713/// Represents a Jupyter notebook IPYNB file, such as a [Colab Enterprise
13714/// notebook](https://cloud.google.com/colab/docs/introduction) file, that is
13715/// associated with a finding.
13716#[derive(Clone, Default, PartialEq)]
13717#[non_exhaustive]
13718pub struct Notebook {
13719 /// The name of the notebook.
13720 pub name: std::string::String,
13721
13722 /// The source notebook service, for example, "Colab Enterprise".
13723 pub service: std::string::String,
13724
13725 /// The user ID of the latest author to modify the notebook.
13726 pub last_author: std::string::String,
13727
13728 /// The most recent time the notebook was updated.
13729 pub notebook_update_time: std::option::Option<wkt::Timestamp>,
13730
13731 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13732}
13733
13734impl Notebook {
13735 /// Creates a new default instance.
13736 pub fn new() -> Self {
13737 std::default::Default::default()
13738 }
13739
13740 /// Sets the value of [name][crate::model::Notebook::name].
13741 ///
13742 /// # Example
13743 /// ```ignore,no_run
13744 /// # use google_cloud_securitycenter_v2::model::Notebook;
13745 /// let x = Notebook::new().set_name("example");
13746 /// ```
13747 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13748 self.name = v.into();
13749 self
13750 }
13751
13752 /// Sets the value of [service][crate::model::Notebook::service].
13753 ///
13754 /// # Example
13755 /// ```ignore,no_run
13756 /// # use google_cloud_securitycenter_v2::model::Notebook;
13757 /// let x = Notebook::new().set_service("example");
13758 /// ```
13759 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13760 self.service = v.into();
13761 self
13762 }
13763
13764 /// Sets the value of [last_author][crate::model::Notebook::last_author].
13765 ///
13766 /// # Example
13767 /// ```ignore,no_run
13768 /// # use google_cloud_securitycenter_v2::model::Notebook;
13769 /// let x = Notebook::new().set_last_author("example");
13770 /// ```
13771 pub fn set_last_author<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13772 self.last_author = v.into();
13773 self
13774 }
13775
13776 /// Sets the value of [notebook_update_time][crate::model::Notebook::notebook_update_time].
13777 ///
13778 /// # Example
13779 /// ```ignore,no_run
13780 /// # use google_cloud_securitycenter_v2::model::Notebook;
13781 /// use wkt::Timestamp;
13782 /// let x = Notebook::new().set_notebook_update_time(Timestamp::default()/* use setters */);
13783 /// ```
13784 pub fn set_notebook_update_time<T>(mut self, v: T) -> Self
13785 where
13786 T: std::convert::Into<wkt::Timestamp>,
13787 {
13788 self.notebook_update_time = std::option::Option::Some(v.into());
13789 self
13790 }
13791
13792 /// Sets or clears the value of [notebook_update_time][crate::model::Notebook::notebook_update_time].
13793 ///
13794 /// # Example
13795 /// ```ignore,no_run
13796 /// # use google_cloud_securitycenter_v2::model::Notebook;
13797 /// use wkt::Timestamp;
13798 /// let x = Notebook::new().set_or_clear_notebook_update_time(Some(Timestamp::default()/* use setters */));
13799 /// let x = Notebook::new().set_or_clear_notebook_update_time(None::<Timestamp>);
13800 /// ```
13801 pub fn set_or_clear_notebook_update_time<T>(mut self, v: std::option::Option<T>) -> Self
13802 where
13803 T: std::convert::Into<wkt::Timestamp>,
13804 {
13805 self.notebook_update_time = v.map(|x| x.into());
13806 self
13807 }
13808}
13809
13810impl wkt::message::Message for Notebook {
13811 fn typename() -> &'static str {
13812 "type.googleapis.com/google.cloud.securitycenter.v2.Notebook"
13813 }
13814}
13815
13816/// Cloud Security Command Center (Cloud SCC) notification configs.
13817///
13818/// A notification config is a Cloud SCC resource that contains the configuration
13819/// to send notifications for create/update events of findings, assets and etc.
13820#[derive(Clone, Default, PartialEq)]
13821#[non_exhaustive]
13822pub struct NotificationConfig {
13823 /// Identifier. The relative resource name of this notification config. See:
13824 /// <https://cloud.google.com/apis/design/resource_names#relative_resource_name>
13825 /// The following list shows some examples:
13826 /// +
13827 /// `organizations/{organization_id}/locations/{location_id}/notificationConfigs/notify_public_bucket`
13828 /// +
13829 /// `folders/{folder_id}/locations/{location_id}/notificationConfigs/notify_public_bucket`
13830 /// +
13831 /// `projects/{project_id}/locations/{location_id}/notificationConfigs/notify_public_bucket`
13832 pub name: std::string::String,
13833
13834 /// The description of the notification config (max of 1024 characters).
13835 pub description: std::string::String,
13836
13837 /// The Pub/Sub topic to send notifications to. Its format is
13838 /// "projects/[project_id]/topics/[topic]".
13839 pub pubsub_topic: std::string::String,
13840
13841 /// Output only. The service account that needs "pubsub.topics.publish"
13842 /// permission to publish to the Pub/Sub topic.
13843 pub service_account: std::string::String,
13844
13845 /// Output only. The timestamp of when the notification config was last
13846 /// updated.
13847 pub update_time: std::option::Option<wkt::Timestamp>,
13848
13849 /// The config for triggering notifications.
13850 pub notify_config: std::option::Option<crate::model::notification_config::NotifyConfig>,
13851
13852 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13853}
13854
13855impl NotificationConfig {
13856 /// Creates a new default instance.
13857 pub fn new() -> Self {
13858 std::default::Default::default()
13859 }
13860
13861 /// Sets the value of [name][crate::model::NotificationConfig::name].
13862 ///
13863 /// # Example
13864 /// ```ignore,no_run
13865 /// # use google_cloud_securitycenter_v2::model::NotificationConfig;
13866 /// let x = NotificationConfig::new().set_name("example");
13867 /// ```
13868 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13869 self.name = v.into();
13870 self
13871 }
13872
13873 /// Sets the value of [description][crate::model::NotificationConfig::description].
13874 ///
13875 /// # Example
13876 /// ```ignore,no_run
13877 /// # use google_cloud_securitycenter_v2::model::NotificationConfig;
13878 /// let x = NotificationConfig::new().set_description("example");
13879 /// ```
13880 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13881 self.description = v.into();
13882 self
13883 }
13884
13885 /// Sets the value of [pubsub_topic][crate::model::NotificationConfig::pubsub_topic].
13886 ///
13887 /// # Example
13888 /// ```ignore,no_run
13889 /// # use google_cloud_securitycenter_v2::model::NotificationConfig;
13890 /// let x = NotificationConfig::new().set_pubsub_topic("example");
13891 /// ```
13892 pub fn set_pubsub_topic<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13893 self.pubsub_topic = v.into();
13894 self
13895 }
13896
13897 /// Sets the value of [service_account][crate::model::NotificationConfig::service_account].
13898 ///
13899 /// # Example
13900 /// ```ignore,no_run
13901 /// # use google_cloud_securitycenter_v2::model::NotificationConfig;
13902 /// let x = NotificationConfig::new().set_service_account("example");
13903 /// ```
13904 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13905 self.service_account = v.into();
13906 self
13907 }
13908
13909 /// Sets the value of [update_time][crate::model::NotificationConfig::update_time].
13910 ///
13911 /// # Example
13912 /// ```ignore,no_run
13913 /// # use google_cloud_securitycenter_v2::model::NotificationConfig;
13914 /// use wkt::Timestamp;
13915 /// let x = NotificationConfig::new().set_update_time(Timestamp::default()/* use setters */);
13916 /// ```
13917 pub fn set_update_time<T>(mut self, v: T) -> Self
13918 where
13919 T: std::convert::Into<wkt::Timestamp>,
13920 {
13921 self.update_time = std::option::Option::Some(v.into());
13922 self
13923 }
13924
13925 /// Sets or clears the value of [update_time][crate::model::NotificationConfig::update_time].
13926 ///
13927 /// # Example
13928 /// ```ignore,no_run
13929 /// # use google_cloud_securitycenter_v2::model::NotificationConfig;
13930 /// use wkt::Timestamp;
13931 /// let x = NotificationConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
13932 /// let x = NotificationConfig::new().set_or_clear_update_time(None::<Timestamp>);
13933 /// ```
13934 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
13935 where
13936 T: std::convert::Into<wkt::Timestamp>,
13937 {
13938 self.update_time = v.map(|x| x.into());
13939 self
13940 }
13941
13942 /// Sets the value of [notify_config][crate::model::NotificationConfig::notify_config].
13943 ///
13944 /// Note that all the setters affecting `notify_config` are mutually
13945 /// exclusive.
13946 ///
13947 /// # Example
13948 /// ```ignore,no_run
13949 /// # use google_cloud_securitycenter_v2::model::NotificationConfig;
13950 /// use google_cloud_securitycenter_v2::model::notification_config::StreamingConfig;
13951 /// let x = NotificationConfig::new().set_notify_config(Some(
13952 /// google_cloud_securitycenter_v2::model::notification_config::NotifyConfig::StreamingConfig(StreamingConfig::default().into())));
13953 /// ```
13954 pub fn set_notify_config<
13955 T: std::convert::Into<std::option::Option<crate::model::notification_config::NotifyConfig>>,
13956 >(
13957 mut self,
13958 v: T,
13959 ) -> Self {
13960 self.notify_config = v.into();
13961 self
13962 }
13963
13964 /// The value of [notify_config][crate::model::NotificationConfig::notify_config]
13965 /// if it holds a `StreamingConfig`, `None` if the field is not set or
13966 /// holds a different branch.
13967 pub fn streaming_config(
13968 &self,
13969 ) -> std::option::Option<&std::boxed::Box<crate::model::notification_config::StreamingConfig>>
13970 {
13971 #[allow(unreachable_patterns)]
13972 self.notify_config.as_ref().and_then(|v| match v {
13973 crate::model::notification_config::NotifyConfig::StreamingConfig(v) => {
13974 std::option::Option::Some(v)
13975 }
13976 _ => std::option::Option::None,
13977 })
13978 }
13979
13980 /// Sets the value of [notify_config][crate::model::NotificationConfig::notify_config]
13981 /// to hold a `StreamingConfig`.
13982 ///
13983 /// Note that all the setters affecting `notify_config` are
13984 /// mutually exclusive.
13985 ///
13986 /// # Example
13987 /// ```ignore,no_run
13988 /// # use google_cloud_securitycenter_v2::model::NotificationConfig;
13989 /// use google_cloud_securitycenter_v2::model::notification_config::StreamingConfig;
13990 /// let x = NotificationConfig::new().set_streaming_config(StreamingConfig::default()/* use setters */);
13991 /// assert!(x.streaming_config().is_some());
13992 /// ```
13993 pub fn set_streaming_config<
13994 T: std::convert::Into<std::boxed::Box<crate::model::notification_config::StreamingConfig>>,
13995 >(
13996 mut self,
13997 v: T,
13998 ) -> Self {
13999 self.notify_config = std::option::Option::Some(
14000 crate::model::notification_config::NotifyConfig::StreamingConfig(v.into()),
14001 );
14002 self
14003 }
14004}
14005
14006impl wkt::message::Message for NotificationConfig {
14007 fn typename() -> &'static str {
14008 "type.googleapis.com/google.cloud.securitycenter.v2.NotificationConfig"
14009 }
14010}
14011
14012/// Defines additional types related to [NotificationConfig].
14013pub mod notification_config {
14014 #[allow(unused_imports)]
14015 use super::*;
14016
14017 /// The config for streaming-based notifications, which send each event as soon
14018 /// as it is detected.
14019 #[derive(Clone, Default, PartialEq)]
14020 #[non_exhaustive]
14021 pub struct StreamingConfig {
14022 /// Expression that defines the filter to apply across create/update events
14023 /// of assets or findings as specified by the event type. The expression is a
14024 /// list of zero or more restrictions combined via logical operators `AND`
14025 /// and `OR`. Parentheses are supported, and `OR` has higher precedence than
14026 /// `AND`.
14027 ///
14028 /// Restrictions have the form `<field> <operator> <value>` and may have a
14029 /// `-` character in front of them to indicate negation. The fields map to
14030 /// those defined in the corresponding resource.
14031 ///
14032 /// The supported operators are:
14033 ///
14034 /// * `=` for all value types.
14035 /// * `>`, `<`, `>=`, `<=` for integer values.
14036 /// * `:`, meaning substring matching, for strings.
14037 ///
14038 /// The supported value types are:
14039 ///
14040 /// * string literals in quotes.
14041 /// * integer literals without quotes.
14042 /// * boolean literals `true` and `false` without quotes.
14043 pub filter: std::string::String,
14044
14045 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14046 }
14047
14048 impl StreamingConfig {
14049 /// Creates a new default instance.
14050 pub fn new() -> Self {
14051 std::default::Default::default()
14052 }
14053
14054 /// Sets the value of [filter][crate::model::notification_config::StreamingConfig::filter].
14055 ///
14056 /// # Example
14057 /// ```ignore,no_run
14058 /// # use google_cloud_securitycenter_v2::model::notification_config::StreamingConfig;
14059 /// let x = StreamingConfig::new().set_filter("example");
14060 /// ```
14061 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14062 self.filter = v.into();
14063 self
14064 }
14065 }
14066
14067 impl wkt::message::Message for StreamingConfig {
14068 fn typename() -> &'static str {
14069 "type.googleapis.com/google.cloud.securitycenter.v2.NotificationConfig.StreamingConfig"
14070 }
14071 }
14072
14073 /// The config for triggering notifications.
14074 #[derive(Clone, Debug, PartialEq)]
14075 #[non_exhaustive]
14076 pub enum NotifyConfig {
14077 /// The config for triggering streaming-based notifications.
14078 StreamingConfig(std::boxed::Box<crate::model::notification_config::StreamingConfig>),
14079 }
14080}
14081
14082/// Cloud SCC's Notification
14083#[derive(Clone, Default, PartialEq)]
14084#[non_exhaustive]
14085pub struct NotificationMessage {
14086 /// Name of the notification config that generated current notification.
14087 pub notification_config_name: std::string::String,
14088
14089 /// The Cloud resource tied to this notification's Finding.
14090 pub resource: std::option::Option<crate::model::Resource>,
14091
14092 /// Notification Event.
14093 pub event: std::option::Option<crate::model::notification_message::Event>,
14094
14095 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14096}
14097
14098impl NotificationMessage {
14099 /// Creates a new default instance.
14100 pub fn new() -> Self {
14101 std::default::Default::default()
14102 }
14103
14104 /// Sets the value of [notification_config_name][crate::model::NotificationMessage::notification_config_name].
14105 ///
14106 /// # Example
14107 /// ```ignore,no_run
14108 /// # use google_cloud_securitycenter_v2::model::NotificationMessage;
14109 /// let x = NotificationMessage::new().set_notification_config_name("example");
14110 /// ```
14111 pub fn set_notification_config_name<T: std::convert::Into<std::string::String>>(
14112 mut self,
14113 v: T,
14114 ) -> Self {
14115 self.notification_config_name = v.into();
14116 self
14117 }
14118
14119 /// Sets the value of [resource][crate::model::NotificationMessage::resource].
14120 ///
14121 /// # Example
14122 /// ```ignore,no_run
14123 /// # use google_cloud_securitycenter_v2::model::NotificationMessage;
14124 /// use google_cloud_securitycenter_v2::model::Resource;
14125 /// let x = NotificationMessage::new().set_resource(Resource::default()/* use setters */);
14126 /// ```
14127 pub fn set_resource<T>(mut self, v: T) -> Self
14128 where
14129 T: std::convert::Into<crate::model::Resource>,
14130 {
14131 self.resource = std::option::Option::Some(v.into());
14132 self
14133 }
14134
14135 /// Sets or clears the value of [resource][crate::model::NotificationMessage::resource].
14136 ///
14137 /// # Example
14138 /// ```ignore,no_run
14139 /// # use google_cloud_securitycenter_v2::model::NotificationMessage;
14140 /// use google_cloud_securitycenter_v2::model::Resource;
14141 /// let x = NotificationMessage::new().set_or_clear_resource(Some(Resource::default()/* use setters */));
14142 /// let x = NotificationMessage::new().set_or_clear_resource(None::<Resource>);
14143 /// ```
14144 pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
14145 where
14146 T: std::convert::Into<crate::model::Resource>,
14147 {
14148 self.resource = v.map(|x| x.into());
14149 self
14150 }
14151
14152 /// Sets the value of [event][crate::model::NotificationMessage::event].
14153 ///
14154 /// Note that all the setters affecting `event` are mutually
14155 /// exclusive.
14156 ///
14157 /// # Example
14158 /// ```ignore,no_run
14159 /// # use google_cloud_securitycenter_v2::model::NotificationMessage;
14160 /// use google_cloud_securitycenter_v2::model::Finding;
14161 /// let x = NotificationMessage::new().set_event(Some(
14162 /// google_cloud_securitycenter_v2::model::notification_message::Event::Finding(Finding::default().into())));
14163 /// ```
14164 pub fn set_event<
14165 T: std::convert::Into<std::option::Option<crate::model::notification_message::Event>>,
14166 >(
14167 mut self,
14168 v: T,
14169 ) -> Self {
14170 self.event = v.into();
14171 self
14172 }
14173
14174 /// The value of [event][crate::model::NotificationMessage::event]
14175 /// if it holds a `Finding`, `None` if the field is not set or
14176 /// holds a different branch.
14177 pub fn finding(&self) -> std::option::Option<&std::boxed::Box<crate::model::Finding>> {
14178 #[allow(unreachable_patterns)]
14179 self.event.as_ref().and_then(|v| match v {
14180 crate::model::notification_message::Event::Finding(v) => std::option::Option::Some(v),
14181 _ => std::option::Option::None,
14182 })
14183 }
14184
14185 /// Sets the value of [event][crate::model::NotificationMessage::event]
14186 /// to hold a `Finding`.
14187 ///
14188 /// Note that all the setters affecting `event` are
14189 /// mutually exclusive.
14190 ///
14191 /// # Example
14192 /// ```ignore,no_run
14193 /// # use google_cloud_securitycenter_v2::model::NotificationMessage;
14194 /// use google_cloud_securitycenter_v2::model::Finding;
14195 /// let x = NotificationMessage::new().set_finding(Finding::default()/* use setters */);
14196 /// assert!(x.finding().is_some());
14197 /// ```
14198 pub fn set_finding<T: std::convert::Into<std::boxed::Box<crate::model::Finding>>>(
14199 mut self,
14200 v: T,
14201 ) -> Self {
14202 self.event =
14203 std::option::Option::Some(crate::model::notification_message::Event::Finding(v.into()));
14204 self
14205 }
14206}
14207
14208impl wkt::message::Message for NotificationMessage {
14209 fn typename() -> &'static str {
14210 "type.googleapis.com/google.cloud.securitycenter.v2.NotificationMessage"
14211 }
14212}
14213
14214/// Defines additional types related to [NotificationMessage].
14215pub mod notification_message {
14216 #[allow(unused_imports)]
14217 use super::*;
14218
14219 /// Notification Event.
14220 #[derive(Clone, Debug, PartialEq)]
14221 #[non_exhaustive]
14222 pub enum Event {
14223 /// If it's a Finding based notification config, this field will be
14224 /// populated.
14225 Finding(std::boxed::Box<crate::model::Finding>),
14226 }
14227}
14228
14229/// Contains information about the org policies associated with the finding.
14230#[derive(Clone, Default, PartialEq)]
14231#[non_exhaustive]
14232pub struct OrgPolicy {
14233 /// Identifier. The resource name of the org policy.
14234 /// Example:
14235 /// "organizations/{organization_id}/policies/{constraint_name}"
14236 pub name: std::string::String,
14237
14238 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14239}
14240
14241impl OrgPolicy {
14242 /// Creates a new default instance.
14243 pub fn new() -> Self {
14244 std::default::Default::default()
14245 }
14246
14247 /// Sets the value of [name][crate::model::OrgPolicy::name].
14248 ///
14249 /// # Example
14250 /// ```ignore,no_run
14251 /// # use google_cloud_securitycenter_v2::model::OrgPolicy;
14252 /// let x = OrgPolicy::new().set_name("example");
14253 /// ```
14254 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14255 self.name = v.into();
14256 self
14257 }
14258}
14259
14260impl wkt::message::Message for OrgPolicy {
14261 fn typename() -> &'static str {
14262 "type.googleapis.com/google.cloud.securitycenter.v2.OrgPolicy"
14263 }
14264}
14265
14266/// Represents an operating system process.
14267#[derive(Clone, Default, PartialEq)]
14268#[non_exhaustive]
14269pub struct Process {
14270 /// The process name, as displayed in utilities like `top` and `ps`. This name
14271 /// can be accessed through `/proc/[pid]/comm` and changed with
14272 /// `prctl(PR_SET_NAME)`.
14273 pub name: std::string::String,
14274
14275 /// File information for the process executable.
14276 pub binary: std::option::Option<crate::model::File>,
14277
14278 /// File information for libraries loaded by the process.
14279 pub libraries: std::vec::Vec<crate::model::File>,
14280
14281 /// When the process represents the invocation of a script, `binary` provides
14282 /// information about the interpreter, while `script` provides information
14283 /// about the script file provided to the interpreter.
14284 pub script: std::option::Option<crate::model::File>,
14285
14286 /// Process arguments as JSON encoded strings.
14287 pub args: std::vec::Vec<std::string::String>,
14288
14289 /// True if `args` is incomplete.
14290 pub arguments_truncated: bool,
14291
14292 /// Process environment variables.
14293 pub env_variables: std::vec::Vec<crate::model::EnvironmentVariable>,
14294
14295 /// True if `env_variables` is incomplete.
14296 pub env_variables_truncated: bool,
14297
14298 /// The process ID.
14299 pub pid: i64,
14300
14301 /// The parent process ID.
14302 pub parent_pid: i64,
14303
14304 /// The ID of the user that executed the process. E.g. If this is the root user
14305 /// this will always be 0.
14306 pub user_id: i64,
14307
14308 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14309}
14310
14311impl Process {
14312 /// Creates a new default instance.
14313 pub fn new() -> Self {
14314 std::default::Default::default()
14315 }
14316
14317 /// Sets the value of [name][crate::model::Process::name].
14318 ///
14319 /// # Example
14320 /// ```ignore,no_run
14321 /// # use google_cloud_securitycenter_v2::model::Process;
14322 /// let x = Process::new().set_name("example");
14323 /// ```
14324 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14325 self.name = v.into();
14326 self
14327 }
14328
14329 /// Sets the value of [binary][crate::model::Process::binary].
14330 ///
14331 /// # Example
14332 /// ```ignore,no_run
14333 /// # use google_cloud_securitycenter_v2::model::Process;
14334 /// use google_cloud_securitycenter_v2::model::File;
14335 /// let x = Process::new().set_binary(File::default()/* use setters */);
14336 /// ```
14337 pub fn set_binary<T>(mut self, v: T) -> Self
14338 where
14339 T: std::convert::Into<crate::model::File>,
14340 {
14341 self.binary = std::option::Option::Some(v.into());
14342 self
14343 }
14344
14345 /// Sets or clears the value of [binary][crate::model::Process::binary].
14346 ///
14347 /// # Example
14348 /// ```ignore,no_run
14349 /// # use google_cloud_securitycenter_v2::model::Process;
14350 /// use google_cloud_securitycenter_v2::model::File;
14351 /// let x = Process::new().set_or_clear_binary(Some(File::default()/* use setters */));
14352 /// let x = Process::new().set_or_clear_binary(None::<File>);
14353 /// ```
14354 pub fn set_or_clear_binary<T>(mut self, v: std::option::Option<T>) -> Self
14355 where
14356 T: std::convert::Into<crate::model::File>,
14357 {
14358 self.binary = v.map(|x| x.into());
14359 self
14360 }
14361
14362 /// Sets the value of [libraries][crate::model::Process::libraries].
14363 ///
14364 /// # Example
14365 /// ```ignore,no_run
14366 /// # use google_cloud_securitycenter_v2::model::Process;
14367 /// use google_cloud_securitycenter_v2::model::File;
14368 /// let x = Process::new()
14369 /// .set_libraries([
14370 /// File::default()/* use setters */,
14371 /// File::default()/* use (different) setters */,
14372 /// ]);
14373 /// ```
14374 pub fn set_libraries<T, V>(mut self, v: T) -> Self
14375 where
14376 T: std::iter::IntoIterator<Item = V>,
14377 V: std::convert::Into<crate::model::File>,
14378 {
14379 use std::iter::Iterator;
14380 self.libraries = v.into_iter().map(|i| i.into()).collect();
14381 self
14382 }
14383
14384 /// Sets the value of [script][crate::model::Process::script].
14385 ///
14386 /// # Example
14387 /// ```ignore,no_run
14388 /// # use google_cloud_securitycenter_v2::model::Process;
14389 /// use google_cloud_securitycenter_v2::model::File;
14390 /// let x = Process::new().set_script(File::default()/* use setters */);
14391 /// ```
14392 pub fn set_script<T>(mut self, v: T) -> Self
14393 where
14394 T: std::convert::Into<crate::model::File>,
14395 {
14396 self.script = std::option::Option::Some(v.into());
14397 self
14398 }
14399
14400 /// Sets or clears the value of [script][crate::model::Process::script].
14401 ///
14402 /// # Example
14403 /// ```ignore,no_run
14404 /// # use google_cloud_securitycenter_v2::model::Process;
14405 /// use google_cloud_securitycenter_v2::model::File;
14406 /// let x = Process::new().set_or_clear_script(Some(File::default()/* use setters */));
14407 /// let x = Process::new().set_or_clear_script(None::<File>);
14408 /// ```
14409 pub fn set_or_clear_script<T>(mut self, v: std::option::Option<T>) -> Self
14410 where
14411 T: std::convert::Into<crate::model::File>,
14412 {
14413 self.script = v.map(|x| x.into());
14414 self
14415 }
14416
14417 /// Sets the value of [args][crate::model::Process::args].
14418 ///
14419 /// # Example
14420 /// ```ignore,no_run
14421 /// # use google_cloud_securitycenter_v2::model::Process;
14422 /// let x = Process::new().set_args(["a", "b", "c"]);
14423 /// ```
14424 pub fn set_args<T, V>(mut self, v: T) -> Self
14425 where
14426 T: std::iter::IntoIterator<Item = V>,
14427 V: std::convert::Into<std::string::String>,
14428 {
14429 use std::iter::Iterator;
14430 self.args = v.into_iter().map(|i| i.into()).collect();
14431 self
14432 }
14433
14434 /// Sets the value of [arguments_truncated][crate::model::Process::arguments_truncated].
14435 ///
14436 /// # Example
14437 /// ```ignore,no_run
14438 /// # use google_cloud_securitycenter_v2::model::Process;
14439 /// let x = Process::new().set_arguments_truncated(true);
14440 /// ```
14441 pub fn set_arguments_truncated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14442 self.arguments_truncated = v.into();
14443 self
14444 }
14445
14446 /// Sets the value of [env_variables][crate::model::Process::env_variables].
14447 ///
14448 /// # Example
14449 /// ```ignore,no_run
14450 /// # use google_cloud_securitycenter_v2::model::Process;
14451 /// use google_cloud_securitycenter_v2::model::EnvironmentVariable;
14452 /// let x = Process::new()
14453 /// .set_env_variables([
14454 /// EnvironmentVariable::default()/* use setters */,
14455 /// EnvironmentVariable::default()/* use (different) setters */,
14456 /// ]);
14457 /// ```
14458 pub fn set_env_variables<T, V>(mut self, v: T) -> Self
14459 where
14460 T: std::iter::IntoIterator<Item = V>,
14461 V: std::convert::Into<crate::model::EnvironmentVariable>,
14462 {
14463 use std::iter::Iterator;
14464 self.env_variables = v.into_iter().map(|i| i.into()).collect();
14465 self
14466 }
14467
14468 /// Sets the value of [env_variables_truncated][crate::model::Process::env_variables_truncated].
14469 ///
14470 /// # Example
14471 /// ```ignore,no_run
14472 /// # use google_cloud_securitycenter_v2::model::Process;
14473 /// let x = Process::new().set_env_variables_truncated(true);
14474 /// ```
14475 pub fn set_env_variables_truncated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14476 self.env_variables_truncated = v.into();
14477 self
14478 }
14479
14480 /// Sets the value of [pid][crate::model::Process::pid].
14481 ///
14482 /// # Example
14483 /// ```ignore,no_run
14484 /// # use google_cloud_securitycenter_v2::model::Process;
14485 /// let x = Process::new().set_pid(42);
14486 /// ```
14487 pub fn set_pid<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14488 self.pid = v.into();
14489 self
14490 }
14491
14492 /// Sets the value of [parent_pid][crate::model::Process::parent_pid].
14493 ///
14494 /// # Example
14495 /// ```ignore,no_run
14496 /// # use google_cloud_securitycenter_v2::model::Process;
14497 /// let x = Process::new().set_parent_pid(42);
14498 /// ```
14499 pub fn set_parent_pid<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14500 self.parent_pid = v.into();
14501 self
14502 }
14503
14504 /// Sets the value of [user_id][crate::model::Process::user_id].
14505 ///
14506 /// # Example
14507 /// ```ignore,no_run
14508 /// # use google_cloud_securitycenter_v2::model::Process;
14509 /// let x = Process::new().set_user_id(42);
14510 /// ```
14511 pub fn set_user_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14512 self.user_id = v.into();
14513 self
14514 }
14515}
14516
14517impl wkt::message::Message for Process {
14518 fn typename() -> &'static str {
14519 "type.googleapis.com/google.cloud.securitycenter.v2.Process"
14520 }
14521}
14522
14523/// A name-value pair representing an environment variable used in an operating
14524/// system process.
14525#[derive(Clone, Default, PartialEq)]
14526#[non_exhaustive]
14527pub struct EnvironmentVariable {
14528 /// Environment variable name as a JSON encoded string.
14529 pub name: std::string::String,
14530
14531 /// Environment variable value as a JSON encoded string.
14532 pub val: std::string::String,
14533
14534 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14535}
14536
14537impl EnvironmentVariable {
14538 /// Creates a new default instance.
14539 pub fn new() -> Self {
14540 std::default::Default::default()
14541 }
14542
14543 /// Sets the value of [name][crate::model::EnvironmentVariable::name].
14544 ///
14545 /// # Example
14546 /// ```ignore,no_run
14547 /// # use google_cloud_securitycenter_v2::model::EnvironmentVariable;
14548 /// let x = EnvironmentVariable::new().set_name("example");
14549 /// ```
14550 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14551 self.name = v.into();
14552 self
14553 }
14554
14555 /// Sets the value of [val][crate::model::EnvironmentVariable::val].
14556 ///
14557 /// # Example
14558 /// ```ignore,no_run
14559 /// # use google_cloud_securitycenter_v2::model::EnvironmentVariable;
14560 /// let x = EnvironmentVariable::new().set_val("example");
14561 /// ```
14562 pub fn set_val<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14563 self.val = v.into();
14564 self
14565 }
14566}
14567
14568impl wkt::message::Message for EnvironmentVariable {
14569 fn typename() -> &'static str {
14570 "type.googleapis.com/google.cloud.securitycenter.v2.EnvironmentVariable"
14571 }
14572}
14573
14574/// Information related to the Google Cloud resource.
14575#[derive(Clone, Default, PartialEq)]
14576#[non_exhaustive]
14577pub struct Resource {
14578 /// The full resource name of the resource. See:
14579 /// <https://cloud.google.com/apis/design/resource_names#full_resource_name>
14580 pub name: std::string::String,
14581
14582 /// The human readable name of the resource.
14583 pub display_name: std::string::String,
14584
14585 /// The full resource type of the resource.
14586 pub r#type: std::string::String,
14587
14588 /// Indicates which cloud provider the finding is from.
14589 pub cloud_provider: crate::model::CloudProvider,
14590
14591 /// The service or resource provider associated with the resource.
14592 pub service: std::string::String,
14593
14594 /// The region or location of the service (if applicable).
14595 pub location: std::string::String,
14596
14597 /// Provides the path to the resource within the resource hierarchy.
14598 pub resource_path: std::option::Option<crate::model::ResourcePath>,
14599
14600 /// A string representation of the resource path.
14601 /// For Google Cloud, it has the format of
14602 /// `organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}`
14603 /// where there can be any number of folders.
14604 /// For AWS, it has the format of
14605 /// `org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}`
14606 /// where there can be any number of organizational units.
14607 /// For Azure, it has the format of
14608 /// `mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}`
14609 /// where there can be any number of management groups.
14610 pub resource_path_string: std::string::String,
14611
14612 /// The metadata associated with the cloud provider.
14613 pub cloud_provider_metadata: std::option::Option<crate::model::resource::CloudProviderMetadata>,
14614
14615 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14616}
14617
14618impl Resource {
14619 /// Creates a new default instance.
14620 pub fn new() -> Self {
14621 std::default::Default::default()
14622 }
14623
14624 /// Sets the value of [name][crate::model::Resource::name].
14625 ///
14626 /// # Example
14627 /// ```ignore,no_run
14628 /// # use google_cloud_securitycenter_v2::model::Resource;
14629 /// let x = Resource::new().set_name("example");
14630 /// ```
14631 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14632 self.name = v.into();
14633 self
14634 }
14635
14636 /// Sets the value of [display_name][crate::model::Resource::display_name].
14637 ///
14638 /// # Example
14639 /// ```ignore,no_run
14640 /// # use google_cloud_securitycenter_v2::model::Resource;
14641 /// let x = Resource::new().set_display_name("example");
14642 /// ```
14643 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14644 self.display_name = v.into();
14645 self
14646 }
14647
14648 /// Sets the value of [r#type][crate::model::Resource::type].
14649 ///
14650 /// # Example
14651 /// ```ignore,no_run
14652 /// # use google_cloud_securitycenter_v2::model::Resource;
14653 /// let x = Resource::new().set_type("example");
14654 /// ```
14655 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14656 self.r#type = v.into();
14657 self
14658 }
14659
14660 /// Sets the value of [cloud_provider][crate::model::Resource::cloud_provider].
14661 ///
14662 /// # Example
14663 /// ```ignore,no_run
14664 /// # use google_cloud_securitycenter_v2::model::Resource;
14665 /// use google_cloud_securitycenter_v2::model::CloudProvider;
14666 /// let x0 = Resource::new().set_cloud_provider(CloudProvider::GoogleCloudPlatform);
14667 /// let x1 = Resource::new().set_cloud_provider(CloudProvider::AmazonWebServices);
14668 /// let x2 = Resource::new().set_cloud_provider(CloudProvider::MicrosoftAzure);
14669 /// ```
14670 pub fn set_cloud_provider<T: std::convert::Into<crate::model::CloudProvider>>(
14671 mut self,
14672 v: T,
14673 ) -> Self {
14674 self.cloud_provider = v.into();
14675 self
14676 }
14677
14678 /// Sets the value of [service][crate::model::Resource::service].
14679 ///
14680 /// # Example
14681 /// ```ignore,no_run
14682 /// # use google_cloud_securitycenter_v2::model::Resource;
14683 /// let x = Resource::new().set_service("example");
14684 /// ```
14685 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14686 self.service = v.into();
14687 self
14688 }
14689
14690 /// Sets the value of [location][crate::model::Resource::location].
14691 ///
14692 /// # Example
14693 /// ```ignore,no_run
14694 /// # use google_cloud_securitycenter_v2::model::Resource;
14695 /// let x = Resource::new().set_location("example");
14696 /// ```
14697 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14698 self.location = v.into();
14699 self
14700 }
14701
14702 /// Sets the value of [resource_path][crate::model::Resource::resource_path].
14703 ///
14704 /// # Example
14705 /// ```ignore,no_run
14706 /// # use google_cloud_securitycenter_v2::model::Resource;
14707 /// use google_cloud_securitycenter_v2::model::ResourcePath;
14708 /// let x = Resource::new().set_resource_path(ResourcePath::default()/* use setters */);
14709 /// ```
14710 pub fn set_resource_path<T>(mut self, v: T) -> Self
14711 where
14712 T: std::convert::Into<crate::model::ResourcePath>,
14713 {
14714 self.resource_path = std::option::Option::Some(v.into());
14715 self
14716 }
14717
14718 /// Sets or clears the value of [resource_path][crate::model::Resource::resource_path].
14719 ///
14720 /// # Example
14721 /// ```ignore,no_run
14722 /// # use google_cloud_securitycenter_v2::model::Resource;
14723 /// use google_cloud_securitycenter_v2::model::ResourcePath;
14724 /// let x = Resource::new().set_or_clear_resource_path(Some(ResourcePath::default()/* use setters */));
14725 /// let x = Resource::new().set_or_clear_resource_path(None::<ResourcePath>);
14726 /// ```
14727 pub fn set_or_clear_resource_path<T>(mut self, v: std::option::Option<T>) -> Self
14728 where
14729 T: std::convert::Into<crate::model::ResourcePath>,
14730 {
14731 self.resource_path = v.map(|x| x.into());
14732 self
14733 }
14734
14735 /// Sets the value of [resource_path_string][crate::model::Resource::resource_path_string].
14736 ///
14737 /// # Example
14738 /// ```ignore,no_run
14739 /// # use google_cloud_securitycenter_v2::model::Resource;
14740 /// let x = Resource::new().set_resource_path_string("example");
14741 /// ```
14742 pub fn set_resource_path_string<T: std::convert::Into<std::string::String>>(
14743 mut self,
14744 v: T,
14745 ) -> Self {
14746 self.resource_path_string = v.into();
14747 self
14748 }
14749
14750 /// Sets the value of [cloud_provider_metadata][crate::model::Resource::cloud_provider_metadata].
14751 ///
14752 /// Note that all the setters affecting `cloud_provider_metadata` are mutually
14753 /// exclusive.
14754 ///
14755 /// # Example
14756 /// ```ignore,no_run
14757 /// # use google_cloud_securitycenter_v2::model::Resource;
14758 /// use google_cloud_securitycenter_v2::model::GcpMetadata;
14759 /// let x = Resource::new().set_cloud_provider_metadata(Some(
14760 /// google_cloud_securitycenter_v2::model::resource::CloudProviderMetadata::GcpMetadata(GcpMetadata::default().into())));
14761 /// ```
14762 pub fn set_cloud_provider_metadata<
14763 T: std::convert::Into<std::option::Option<crate::model::resource::CloudProviderMetadata>>,
14764 >(
14765 mut self,
14766 v: T,
14767 ) -> Self {
14768 self.cloud_provider_metadata = v.into();
14769 self
14770 }
14771
14772 /// The value of [cloud_provider_metadata][crate::model::Resource::cloud_provider_metadata]
14773 /// if it holds a `GcpMetadata`, `None` if the field is not set or
14774 /// holds a different branch.
14775 pub fn gcp_metadata(&self) -> std::option::Option<&std::boxed::Box<crate::model::GcpMetadata>> {
14776 #[allow(unreachable_patterns)]
14777 self.cloud_provider_metadata.as_ref().and_then(|v| match v {
14778 crate::model::resource::CloudProviderMetadata::GcpMetadata(v) => {
14779 std::option::Option::Some(v)
14780 }
14781 _ => std::option::Option::None,
14782 })
14783 }
14784
14785 /// Sets the value of [cloud_provider_metadata][crate::model::Resource::cloud_provider_metadata]
14786 /// to hold a `GcpMetadata`.
14787 ///
14788 /// Note that all the setters affecting `cloud_provider_metadata` are
14789 /// mutually exclusive.
14790 ///
14791 /// # Example
14792 /// ```ignore,no_run
14793 /// # use google_cloud_securitycenter_v2::model::Resource;
14794 /// use google_cloud_securitycenter_v2::model::GcpMetadata;
14795 /// let x = Resource::new().set_gcp_metadata(GcpMetadata::default()/* use setters */);
14796 /// assert!(x.gcp_metadata().is_some());
14797 /// assert!(x.aws_metadata().is_none());
14798 /// assert!(x.azure_metadata().is_none());
14799 /// ```
14800 pub fn set_gcp_metadata<T: std::convert::Into<std::boxed::Box<crate::model::GcpMetadata>>>(
14801 mut self,
14802 v: T,
14803 ) -> Self {
14804 self.cloud_provider_metadata = std::option::Option::Some(
14805 crate::model::resource::CloudProviderMetadata::GcpMetadata(v.into()),
14806 );
14807 self
14808 }
14809
14810 /// The value of [cloud_provider_metadata][crate::model::Resource::cloud_provider_metadata]
14811 /// if it holds a `AwsMetadata`, `None` if the field is not set or
14812 /// holds a different branch.
14813 pub fn aws_metadata(&self) -> std::option::Option<&std::boxed::Box<crate::model::AwsMetadata>> {
14814 #[allow(unreachable_patterns)]
14815 self.cloud_provider_metadata.as_ref().and_then(|v| match v {
14816 crate::model::resource::CloudProviderMetadata::AwsMetadata(v) => {
14817 std::option::Option::Some(v)
14818 }
14819 _ => std::option::Option::None,
14820 })
14821 }
14822
14823 /// Sets the value of [cloud_provider_metadata][crate::model::Resource::cloud_provider_metadata]
14824 /// to hold a `AwsMetadata`.
14825 ///
14826 /// Note that all the setters affecting `cloud_provider_metadata` are
14827 /// mutually exclusive.
14828 ///
14829 /// # Example
14830 /// ```ignore,no_run
14831 /// # use google_cloud_securitycenter_v2::model::Resource;
14832 /// use google_cloud_securitycenter_v2::model::AwsMetadata;
14833 /// let x = Resource::new().set_aws_metadata(AwsMetadata::default()/* use setters */);
14834 /// assert!(x.aws_metadata().is_some());
14835 /// assert!(x.gcp_metadata().is_none());
14836 /// assert!(x.azure_metadata().is_none());
14837 /// ```
14838 pub fn set_aws_metadata<T: std::convert::Into<std::boxed::Box<crate::model::AwsMetadata>>>(
14839 mut self,
14840 v: T,
14841 ) -> Self {
14842 self.cloud_provider_metadata = std::option::Option::Some(
14843 crate::model::resource::CloudProviderMetadata::AwsMetadata(v.into()),
14844 );
14845 self
14846 }
14847
14848 /// The value of [cloud_provider_metadata][crate::model::Resource::cloud_provider_metadata]
14849 /// if it holds a `AzureMetadata`, `None` if the field is not set or
14850 /// holds a different branch.
14851 pub fn azure_metadata(
14852 &self,
14853 ) -> std::option::Option<&std::boxed::Box<crate::model::AzureMetadata>> {
14854 #[allow(unreachable_patterns)]
14855 self.cloud_provider_metadata.as_ref().and_then(|v| match v {
14856 crate::model::resource::CloudProviderMetadata::AzureMetadata(v) => {
14857 std::option::Option::Some(v)
14858 }
14859 _ => std::option::Option::None,
14860 })
14861 }
14862
14863 /// Sets the value of [cloud_provider_metadata][crate::model::Resource::cloud_provider_metadata]
14864 /// to hold a `AzureMetadata`.
14865 ///
14866 /// Note that all the setters affecting `cloud_provider_metadata` are
14867 /// mutually exclusive.
14868 ///
14869 /// # Example
14870 /// ```ignore,no_run
14871 /// # use google_cloud_securitycenter_v2::model::Resource;
14872 /// use google_cloud_securitycenter_v2::model::AzureMetadata;
14873 /// let x = Resource::new().set_azure_metadata(AzureMetadata::default()/* use setters */);
14874 /// assert!(x.azure_metadata().is_some());
14875 /// assert!(x.gcp_metadata().is_none());
14876 /// assert!(x.aws_metadata().is_none());
14877 /// ```
14878 pub fn set_azure_metadata<
14879 T: std::convert::Into<std::boxed::Box<crate::model::AzureMetadata>>,
14880 >(
14881 mut self,
14882 v: T,
14883 ) -> Self {
14884 self.cloud_provider_metadata = std::option::Option::Some(
14885 crate::model::resource::CloudProviderMetadata::AzureMetadata(v.into()),
14886 );
14887 self
14888 }
14889}
14890
14891impl wkt::message::Message for Resource {
14892 fn typename() -> &'static str {
14893 "type.googleapis.com/google.cloud.securitycenter.v2.Resource"
14894 }
14895}
14896
14897/// Defines additional types related to [Resource].
14898pub mod resource {
14899 #[allow(unused_imports)]
14900 use super::*;
14901
14902 /// The metadata associated with the cloud provider.
14903 #[derive(Clone, Debug, PartialEq)]
14904 #[non_exhaustive]
14905 pub enum CloudProviderMetadata {
14906 /// The GCP metadata associated with the finding.
14907 GcpMetadata(std::boxed::Box<crate::model::GcpMetadata>),
14908 /// The AWS metadata associated with the finding.
14909 AwsMetadata(std::boxed::Box<crate::model::AwsMetadata>),
14910 /// The Azure metadata associated with the finding.
14911 AzureMetadata(std::boxed::Box<crate::model::AzureMetadata>),
14912 }
14913}
14914
14915/// Google Cloud metadata associated with the resource. Only applicable if the
14916/// finding's cloud provider is Google Cloud.
14917#[derive(Clone, Default, PartialEq)]
14918#[non_exhaustive]
14919pub struct GcpMetadata {
14920 /// The full resource name of project that the resource belongs to.
14921 pub project: std::string::String,
14922
14923 /// The project ID that the resource belongs to.
14924 pub project_display_name: std::string::String,
14925
14926 /// The full resource name of resource's parent.
14927 pub parent: std::string::String,
14928
14929 /// The human readable name of resource's parent.
14930 pub parent_display_name: std::string::String,
14931
14932 /// Output only. Contains a Folder message for each folder in the assets
14933 /// ancestry. The first folder is the deepest nested folder, and the last
14934 /// folder is the folder directly under the Organization.
14935 pub folders: std::vec::Vec<crate::model::Folder>,
14936
14937 /// The name of the organization that the resource belongs to.
14938 pub organization: std::string::String,
14939
14940 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14941}
14942
14943impl GcpMetadata {
14944 /// Creates a new default instance.
14945 pub fn new() -> Self {
14946 std::default::Default::default()
14947 }
14948
14949 /// Sets the value of [project][crate::model::GcpMetadata::project].
14950 ///
14951 /// # Example
14952 /// ```ignore,no_run
14953 /// # use google_cloud_securitycenter_v2::model::GcpMetadata;
14954 /// let x = GcpMetadata::new().set_project("example");
14955 /// ```
14956 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14957 self.project = v.into();
14958 self
14959 }
14960
14961 /// Sets the value of [project_display_name][crate::model::GcpMetadata::project_display_name].
14962 ///
14963 /// # Example
14964 /// ```ignore,no_run
14965 /// # use google_cloud_securitycenter_v2::model::GcpMetadata;
14966 /// let x = GcpMetadata::new().set_project_display_name("example");
14967 /// ```
14968 pub fn set_project_display_name<T: std::convert::Into<std::string::String>>(
14969 mut self,
14970 v: T,
14971 ) -> Self {
14972 self.project_display_name = v.into();
14973 self
14974 }
14975
14976 /// Sets the value of [parent][crate::model::GcpMetadata::parent].
14977 ///
14978 /// # Example
14979 /// ```ignore,no_run
14980 /// # use google_cloud_securitycenter_v2::model::GcpMetadata;
14981 /// let x = GcpMetadata::new().set_parent("example");
14982 /// ```
14983 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14984 self.parent = v.into();
14985 self
14986 }
14987
14988 /// Sets the value of [parent_display_name][crate::model::GcpMetadata::parent_display_name].
14989 ///
14990 /// # Example
14991 /// ```ignore,no_run
14992 /// # use google_cloud_securitycenter_v2::model::GcpMetadata;
14993 /// let x = GcpMetadata::new().set_parent_display_name("example");
14994 /// ```
14995 pub fn set_parent_display_name<T: std::convert::Into<std::string::String>>(
14996 mut self,
14997 v: T,
14998 ) -> Self {
14999 self.parent_display_name = v.into();
15000 self
15001 }
15002
15003 /// Sets the value of [folders][crate::model::GcpMetadata::folders].
15004 ///
15005 /// # Example
15006 /// ```ignore,no_run
15007 /// # use google_cloud_securitycenter_v2::model::GcpMetadata;
15008 /// use google_cloud_securitycenter_v2::model::Folder;
15009 /// let x = GcpMetadata::new()
15010 /// .set_folders([
15011 /// Folder::default()/* use setters */,
15012 /// Folder::default()/* use (different) setters */,
15013 /// ]);
15014 /// ```
15015 pub fn set_folders<T, V>(mut self, v: T) -> Self
15016 where
15017 T: std::iter::IntoIterator<Item = V>,
15018 V: std::convert::Into<crate::model::Folder>,
15019 {
15020 use std::iter::Iterator;
15021 self.folders = v.into_iter().map(|i| i.into()).collect();
15022 self
15023 }
15024
15025 /// Sets the value of [organization][crate::model::GcpMetadata::organization].
15026 ///
15027 /// # Example
15028 /// ```ignore,no_run
15029 /// # use google_cloud_securitycenter_v2::model::GcpMetadata;
15030 /// let x = GcpMetadata::new().set_organization("example");
15031 /// ```
15032 pub fn set_organization<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15033 self.organization = v.into();
15034 self
15035 }
15036}
15037
15038impl wkt::message::Message for GcpMetadata {
15039 fn typename() -> &'static str {
15040 "type.googleapis.com/google.cloud.securitycenter.v2.GcpMetadata"
15041 }
15042}
15043
15044/// AWS metadata associated with the resource, only applicable if the finding's
15045/// cloud provider is Amazon Web Services.
15046#[derive(Clone, Default, PartialEq)]
15047#[non_exhaustive]
15048pub struct AwsMetadata {
15049 /// The AWS organization associated with the resource.
15050 pub organization: std::option::Option<crate::model::aws_metadata::AwsOrganization>,
15051
15052 /// A list of AWS organizational units associated with the resource, ordered
15053 /// from lowest level (closest to the account) to highest level.
15054 pub organizational_units: std::vec::Vec<crate::model::aws_metadata::AwsOrganizationalUnit>,
15055
15056 /// The AWS account associated with the resource.
15057 pub account: std::option::Option<crate::model::aws_metadata::AwsAccount>,
15058
15059 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15060}
15061
15062impl AwsMetadata {
15063 /// Creates a new default instance.
15064 pub fn new() -> Self {
15065 std::default::Default::default()
15066 }
15067
15068 /// Sets the value of [organization][crate::model::AwsMetadata::organization].
15069 ///
15070 /// # Example
15071 /// ```ignore,no_run
15072 /// # use google_cloud_securitycenter_v2::model::AwsMetadata;
15073 /// use google_cloud_securitycenter_v2::model::aws_metadata::AwsOrganization;
15074 /// let x = AwsMetadata::new().set_organization(AwsOrganization::default()/* use setters */);
15075 /// ```
15076 pub fn set_organization<T>(mut self, v: T) -> Self
15077 where
15078 T: std::convert::Into<crate::model::aws_metadata::AwsOrganization>,
15079 {
15080 self.organization = std::option::Option::Some(v.into());
15081 self
15082 }
15083
15084 /// Sets or clears the value of [organization][crate::model::AwsMetadata::organization].
15085 ///
15086 /// # Example
15087 /// ```ignore,no_run
15088 /// # use google_cloud_securitycenter_v2::model::AwsMetadata;
15089 /// use google_cloud_securitycenter_v2::model::aws_metadata::AwsOrganization;
15090 /// let x = AwsMetadata::new().set_or_clear_organization(Some(AwsOrganization::default()/* use setters */));
15091 /// let x = AwsMetadata::new().set_or_clear_organization(None::<AwsOrganization>);
15092 /// ```
15093 pub fn set_or_clear_organization<T>(mut self, v: std::option::Option<T>) -> Self
15094 where
15095 T: std::convert::Into<crate::model::aws_metadata::AwsOrganization>,
15096 {
15097 self.organization = v.map(|x| x.into());
15098 self
15099 }
15100
15101 /// Sets the value of [organizational_units][crate::model::AwsMetadata::organizational_units].
15102 ///
15103 /// # Example
15104 /// ```ignore,no_run
15105 /// # use google_cloud_securitycenter_v2::model::AwsMetadata;
15106 /// use google_cloud_securitycenter_v2::model::aws_metadata::AwsOrganizationalUnit;
15107 /// let x = AwsMetadata::new()
15108 /// .set_organizational_units([
15109 /// AwsOrganizationalUnit::default()/* use setters */,
15110 /// AwsOrganizationalUnit::default()/* use (different) setters */,
15111 /// ]);
15112 /// ```
15113 pub fn set_organizational_units<T, V>(mut self, v: T) -> Self
15114 where
15115 T: std::iter::IntoIterator<Item = V>,
15116 V: std::convert::Into<crate::model::aws_metadata::AwsOrganizationalUnit>,
15117 {
15118 use std::iter::Iterator;
15119 self.organizational_units = v.into_iter().map(|i| i.into()).collect();
15120 self
15121 }
15122
15123 /// Sets the value of [account][crate::model::AwsMetadata::account].
15124 ///
15125 /// # Example
15126 /// ```ignore,no_run
15127 /// # use google_cloud_securitycenter_v2::model::AwsMetadata;
15128 /// use google_cloud_securitycenter_v2::model::aws_metadata::AwsAccount;
15129 /// let x = AwsMetadata::new().set_account(AwsAccount::default()/* use setters */);
15130 /// ```
15131 pub fn set_account<T>(mut self, v: T) -> Self
15132 where
15133 T: std::convert::Into<crate::model::aws_metadata::AwsAccount>,
15134 {
15135 self.account = std::option::Option::Some(v.into());
15136 self
15137 }
15138
15139 /// Sets or clears the value of [account][crate::model::AwsMetadata::account].
15140 ///
15141 /// # Example
15142 /// ```ignore,no_run
15143 /// # use google_cloud_securitycenter_v2::model::AwsMetadata;
15144 /// use google_cloud_securitycenter_v2::model::aws_metadata::AwsAccount;
15145 /// let x = AwsMetadata::new().set_or_clear_account(Some(AwsAccount::default()/* use setters */));
15146 /// let x = AwsMetadata::new().set_or_clear_account(None::<AwsAccount>);
15147 /// ```
15148 pub fn set_or_clear_account<T>(mut self, v: std::option::Option<T>) -> Self
15149 where
15150 T: std::convert::Into<crate::model::aws_metadata::AwsAccount>,
15151 {
15152 self.account = v.map(|x| x.into());
15153 self
15154 }
15155}
15156
15157impl wkt::message::Message for AwsMetadata {
15158 fn typename() -> &'static str {
15159 "type.googleapis.com/google.cloud.securitycenter.v2.AwsMetadata"
15160 }
15161}
15162
15163/// Defines additional types related to [AwsMetadata].
15164pub mod aws_metadata {
15165 #[allow(unused_imports)]
15166 use super::*;
15167
15168 /// An organization is a collection of accounts that are centrally managed
15169 /// together using consolidated billing, organized hierarchically with
15170 /// organizational units (OUs), and controlled with policies.
15171 #[derive(Clone, Default, PartialEq)]
15172 #[non_exhaustive]
15173 pub struct AwsOrganization {
15174 /// The unique identifier (ID) for the organization. The regex pattern for an
15175 /// organization ID string requires "o-" followed by from 10 to 32 lowercase
15176 /// letters or digits.
15177 pub id: std::string::String,
15178
15179 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15180 }
15181
15182 impl AwsOrganization {
15183 /// Creates a new default instance.
15184 pub fn new() -> Self {
15185 std::default::Default::default()
15186 }
15187
15188 /// Sets the value of [id][crate::model::aws_metadata::AwsOrganization::id].
15189 ///
15190 /// # Example
15191 /// ```ignore,no_run
15192 /// # use google_cloud_securitycenter_v2::model::aws_metadata::AwsOrganization;
15193 /// let x = AwsOrganization::new().set_id("example");
15194 /// ```
15195 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15196 self.id = v.into();
15197 self
15198 }
15199 }
15200
15201 impl wkt::message::Message for AwsOrganization {
15202 fn typename() -> &'static str {
15203 "type.googleapis.com/google.cloud.securitycenter.v2.AwsMetadata.AwsOrganization"
15204 }
15205 }
15206
15207 /// An Organizational Unit (OU) is a container of AWS accounts within a root of
15208 /// an organization. Policies that are attached to an OU apply to all accounts
15209 /// contained in that OU and in any child OUs.
15210 #[derive(Clone, Default, PartialEq)]
15211 #[non_exhaustive]
15212 pub struct AwsOrganizationalUnit {
15213 /// The unique identifier (ID) associated with this OU. The regex pattern for
15214 /// an organizational unit ID string requires "ou-" followed by from 4 to 32
15215 /// lowercase letters or digits (the ID of the root that contains the OU).
15216 /// This string is followed by a second "-" dash and from 8 to 32 additional
15217 /// lowercase letters or digits. For example, "ou-ab12-cd34ef56".
15218 pub id: std::string::String,
15219
15220 /// The friendly name of the OU.
15221 pub name: std::string::String,
15222
15223 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15224 }
15225
15226 impl AwsOrganizationalUnit {
15227 /// Creates a new default instance.
15228 pub fn new() -> Self {
15229 std::default::Default::default()
15230 }
15231
15232 /// Sets the value of [id][crate::model::aws_metadata::AwsOrganizationalUnit::id].
15233 ///
15234 /// # Example
15235 /// ```ignore,no_run
15236 /// # use google_cloud_securitycenter_v2::model::aws_metadata::AwsOrganizationalUnit;
15237 /// let x = AwsOrganizationalUnit::new().set_id("example");
15238 /// ```
15239 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15240 self.id = v.into();
15241 self
15242 }
15243
15244 /// Sets the value of [name][crate::model::aws_metadata::AwsOrganizationalUnit::name].
15245 ///
15246 /// # Example
15247 /// ```ignore,no_run
15248 /// # use google_cloud_securitycenter_v2::model::aws_metadata::AwsOrganizationalUnit;
15249 /// let x = AwsOrganizationalUnit::new().set_name("example");
15250 /// ```
15251 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15252 self.name = v.into();
15253 self
15254 }
15255 }
15256
15257 impl wkt::message::Message for AwsOrganizationalUnit {
15258 fn typename() -> &'static str {
15259 "type.googleapis.com/google.cloud.securitycenter.v2.AwsMetadata.AwsOrganizationalUnit"
15260 }
15261 }
15262
15263 /// An AWS account that is a member of an organization.
15264 #[derive(Clone, Default, PartialEq)]
15265 #[non_exhaustive]
15266 pub struct AwsAccount {
15267 /// The unique identifier (ID) of the account, containing exactly 12 digits.
15268 pub id: std::string::String,
15269
15270 /// The friendly name of this account.
15271 pub name: std::string::String,
15272
15273 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15274 }
15275
15276 impl AwsAccount {
15277 /// Creates a new default instance.
15278 pub fn new() -> Self {
15279 std::default::Default::default()
15280 }
15281
15282 /// Sets the value of [id][crate::model::aws_metadata::AwsAccount::id].
15283 ///
15284 /// # Example
15285 /// ```ignore,no_run
15286 /// # use google_cloud_securitycenter_v2::model::aws_metadata::AwsAccount;
15287 /// let x = AwsAccount::new().set_id("example");
15288 /// ```
15289 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15290 self.id = v.into();
15291 self
15292 }
15293
15294 /// Sets the value of [name][crate::model::aws_metadata::AwsAccount::name].
15295 ///
15296 /// # Example
15297 /// ```ignore,no_run
15298 /// # use google_cloud_securitycenter_v2::model::aws_metadata::AwsAccount;
15299 /// let x = AwsAccount::new().set_name("example");
15300 /// ```
15301 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15302 self.name = v.into();
15303 self
15304 }
15305 }
15306
15307 impl wkt::message::Message for AwsAccount {
15308 fn typename() -> &'static str {
15309 "type.googleapis.com/google.cloud.securitycenter.v2.AwsMetadata.AwsAccount"
15310 }
15311 }
15312}
15313
15314/// Azure metadata associated with the resource, only applicable if the finding's
15315/// cloud provider is Microsoft Azure.
15316#[derive(Clone, Default, PartialEq)]
15317#[non_exhaustive]
15318pub struct AzureMetadata {
15319 /// A list of Azure management groups associated with the resource, ordered
15320 /// from lowest level (closest to the subscription) to highest level.
15321 pub management_groups: std::vec::Vec<crate::model::azure_metadata::AzureManagementGroup>,
15322
15323 /// The Azure subscription associated with the resource.
15324 pub subscription: std::option::Option<crate::model::azure_metadata::AzureSubscription>,
15325
15326 /// The Azure resource group associated with the resource.
15327 pub resource_group: std::option::Option<crate::model::azure_metadata::AzureResourceGroup>,
15328
15329 /// The Azure Entra tenant associated with the resource.
15330 pub tenant: std::option::Option<crate::model::azure_metadata::AzureTenant>,
15331
15332 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15333}
15334
15335impl AzureMetadata {
15336 /// Creates a new default instance.
15337 pub fn new() -> Self {
15338 std::default::Default::default()
15339 }
15340
15341 /// Sets the value of [management_groups][crate::model::AzureMetadata::management_groups].
15342 ///
15343 /// # Example
15344 /// ```ignore,no_run
15345 /// # use google_cloud_securitycenter_v2::model::AzureMetadata;
15346 /// use google_cloud_securitycenter_v2::model::azure_metadata::AzureManagementGroup;
15347 /// let x = AzureMetadata::new()
15348 /// .set_management_groups([
15349 /// AzureManagementGroup::default()/* use setters */,
15350 /// AzureManagementGroup::default()/* use (different) setters */,
15351 /// ]);
15352 /// ```
15353 pub fn set_management_groups<T, V>(mut self, v: T) -> Self
15354 where
15355 T: std::iter::IntoIterator<Item = V>,
15356 V: std::convert::Into<crate::model::azure_metadata::AzureManagementGroup>,
15357 {
15358 use std::iter::Iterator;
15359 self.management_groups = v.into_iter().map(|i| i.into()).collect();
15360 self
15361 }
15362
15363 /// Sets the value of [subscription][crate::model::AzureMetadata::subscription].
15364 ///
15365 /// # Example
15366 /// ```ignore,no_run
15367 /// # use google_cloud_securitycenter_v2::model::AzureMetadata;
15368 /// use google_cloud_securitycenter_v2::model::azure_metadata::AzureSubscription;
15369 /// let x = AzureMetadata::new().set_subscription(AzureSubscription::default()/* use setters */);
15370 /// ```
15371 pub fn set_subscription<T>(mut self, v: T) -> Self
15372 where
15373 T: std::convert::Into<crate::model::azure_metadata::AzureSubscription>,
15374 {
15375 self.subscription = std::option::Option::Some(v.into());
15376 self
15377 }
15378
15379 /// Sets or clears the value of [subscription][crate::model::AzureMetadata::subscription].
15380 ///
15381 /// # Example
15382 /// ```ignore,no_run
15383 /// # use google_cloud_securitycenter_v2::model::AzureMetadata;
15384 /// use google_cloud_securitycenter_v2::model::azure_metadata::AzureSubscription;
15385 /// let x = AzureMetadata::new().set_or_clear_subscription(Some(AzureSubscription::default()/* use setters */));
15386 /// let x = AzureMetadata::new().set_or_clear_subscription(None::<AzureSubscription>);
15387 /// ```
15388 pub fn set_or_clear_subscription<T>(mut self, v: std::option::Option<T>) -> Self
15389 where
15390 T: std::convert::Into<crate::model::azure_metadata::AzureSubscription>,
15391 {
15392 self.subscription = v.map(|x| x.into());
15393 self
15394 }
15395
15396 /// Sets the value of [resource_group][crate::model::AzureMetadata::resource_group].
15397 ///
15398 /// # Example
15399 /// ```ignore,no_run
15400 /// # use google_cloud_securitycenter_v2::model::AzureMetadata;
15401 /// use google_cloud_securitycenter_v2::model::azure_metadata::AzureResourceGroup;
15402 /// let x = AzureMetadata::new().set_resource_group(AzureResourceGroup::default()/* use setters */);
15403 /// ```
15404 pub fn set_resource_group<T>(mut self, v: T) -> Self
15405 where
15406 T: std::convert::Into<crate::model::azure_metadata::AzureResourceGroup>,
15407 {
15408 self.resource_group = std::option::Option::Some(v.into());
15409 self
15410 }
15411
15412 /// Sets or clears the value of [resource_group][crate::model::AzureMetadata::resource_group].
15413 ///
15414 /// # Example
15415 /// ```ignore,no_run
15416 /// # use google_cloud_securitycenter_v2::model::AzureMetadata;
15417 /// use google_cloud_securitycenter_v2::model::azure_metadata::AzureResourceGroup;
15418 /// let x = AzureMetadata::new().set_or_clear_resource_group(Some(AzureResourceGroup::default()/* use setters */));
15419 /// let x = AzureMetadata::new().set_or_clear_resource_group(None::<AzureResourceGroup>);
15420 /// ```
15421 pub fn set_or_clear_resource_group<T>(mut self, v: std::option::Option<T>) -> Self
15422 where
15423 T: std::convert::Into<crate::model::azure_metadata::AzureResourceGroup>,
15424 {
15425 self.resource_group = v.map(|x| x.into());
15426 self
15427 }
15428
15429 /// Sets the value of [tenant][crate::model::AzureMetadata::tenant].
15430 ///
15431 /// # Example
15432 /// ```ignore,no_run
15433 /// # use google_cloud_securitycenter_v2::model::AzureMetadata;
15434 /// use google_cloud_securitycenter_v2::model::azure_metadata::AzureTenant;
15435 /// let x = AzureMetadata::new().set_tenant(AzureTenant::default()/* use setters */);
15436 /// ```
15437 pub fn set_tenant<T>(mut self, v: T) -> Self
15438 where
15439 T: std::convert::Into<crate::model::azure_metadata::AzureTenant>,
15440 {
15441 self.tenant = std::option::Option::Some(v.into());
15442 self
15443 }
15444
15445 /// Sets or clears the value of [tenant][crate::model::AzureMetadata::tenant].
15446 ///
15447 /// # Example
15448 /// ```ignore,no_run
15449 /// # use google_cloud_securitycenter_v2::model::AzureMetadata;
15450 /// use google_cloud_securitycenter_v2::model::azure_metadata::AzureTenant;
15451 /// let x = AzureMetadata::new().set_or_clear_tenant(Some(AzureTenant::default()/* use setters */));
15452 /// let x = AzureMetadata::new().set_or_clear_tenant(None::<AzureTenant>);
15453 /// ```
15454 pub fn set_or_clear_tenant<T>(mut self, v: std::option::Option<T>) -> Self
15455 where
15456 T: std::convert::Into<crate::model::azure_metadata::AzureTenant>,
15457 {
15458 self.tenant = v.map(|x| x.into());
15459 self
15460 }
15461}
15462
15463impl wkt::message::Message for AzureMetadata {
15464 fn typename() -> &'static str {
15465 "type.googleapis.com/google.cloud.securitycenter.v2.AzureMetadata"
15466 }
15467}
15468
15469/// Defines additional types related to [AzureMetadata].
15470pub mod azure_metadata {
15471 #[allow(unused_imports)]
15472 use super::*;
15473
15474 /// Represents an Azure management group.
15475 #[derive(Clone, Default, PartialEq)]
15476 #[non_exhaustive]
15477 pub struct AzureManagementGroup {
15478 /// The UUID of the Azure management group, for example,
15479 /// `20000000-0001-0000-0000-000000000000`.
15480 pub id: std::string::String,
15481
15482 /// The display name of the Azure management group.
15483 pub display_name: std::string::String,
15484
15485 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15486 }
15487
15488 impl AzureManagementGroup {
15489 /// Creates a new default instance.
15490 pub fn new() -> Self {
15491 std::default::Default::default()
15492 }
15493
15494 /// Sets the value of [id][crate::model::azure_metadata::AzureManagementGroup::id].
15495 ///
15496 /// # Example
15497 /// ```ignore,no_run
15498 /// # use google_cloud_securitycenter_v2::model::azure_metadata::AzureManagementGroup;
15499 /// let x = AzureManagementGroup::new().set_id("example");
15500 /// ```
15501 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15502 self.id = v.into();
15503 self
15504 }
15505
15506 /// Sets the value of [display_name][crate::model::azure_metadata::AzureManagementGroup::display_name].
15507 ///
15508 /// # Example
15509 /// ```ignore,no_run
15510 /// # use google_cloud_securitycenter_v2::model::azure_metadata::AzureManagementGroup;
15511 /// let x = AzureManagementGroup::new().set_display_name("example");
15512 /// ```
15513 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
15514 mut self,
15515 v: T,
15516 ) -> Self {
15517 self.display_name = v.into();
15518 self
15519 }
15520 }
15521
15522 impl wkt::message::Message for AzureManagementGroup {
15523 fn typename() -> &'static str {
15524 "type.googleapis.com/google.cloud.securitycenter.v2.AzureMetadata.AzureManagementGroup"
15525 }
15526 }
15527
15528 /// Represents an Azure subscription.
15529 #[derive(Clone, Default, PartialEq)]
15530 #[non_exhaustive]
15531 pub struct AzureSubscription {
15532 /// The UUID of the Azure subscription, for example,
15533 /// `291bba3f-e0a5-47bc-a099-3bdcb2a50a05`.
15534 pub id: std::string::String,
15535
15536 /// The display name of the Azure subscription.
15537 pub display_name: std::string::String,
15538
15539 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15540 }
15541
15542 impl AzureSubscription {
15543 /// Creates a new default instance.
15544 pub fn new() -> Self {
15545 std::default::Default::default()
15546 }
15547
15548 /// Sets the value of [id][crate::model::azure_metadata::AzureSubscription::id].
15549 ///
15550 /// # Example
15551 /// ```ignore,no_run
15552 /// # use google_cloud_securitycenter_v2::model::azure_metadata::AzureSubscription;
15553 /// let x = AzureSubscription::new().set_id("example");
15554 /// ```
15555 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15556 self.id = v.into();
15557 self
15558 }
15559
15560 /// Sets the value of [display_name][crate::model::azure_metadata::AzureSubscription::display_name].
15561 ///
15562 /// # Example
15563 /// ```ignore,no_run
15564 /// # use google_cloud_securitycenter_v2::model::azure_metadata::AzureSubscription;
15565 /// let x = AzureSubscription::new().set_display_name("example");
15566 /// ```
15567 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
15568 mut self,
15569 v: T,
15570 ) -> Self {
15571 self.display_name = v.into();
15572 self
15573 }
15574 }
15575
15576 impl wkt::message::Message for AzureSubscription {
15577 fn typename() -> &'static str {
15578 "type.googleapis.com/google.cloud.securitycenter.v2.AzureMetadata.AzureSubscription"
15579 }
15580 }
15581
15582 /// Represents an Azure resource group.
15583 #[derive(Clone, Default, PartialEq)]
15584 #[non_exhaustive]
15585 pub struct AzureResourceGroup {
15586 /// The ID of the Azure resource group.
15587 pub id: std::string::String,
15588
15589 /// The name of the Azure resource group. This is not a UUID.
15590 pub name: std::string::String,
15591
15592 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15593 }
15594
15595 impl AzureResourceGroup {
15596 /// Creates a new default instance.
15597 pub fn new() -> Self {
15598 std::default::Default::default()
15599 }
15600
15601 /// Sets the value of [id][crate::model::azure_metadata::AzureResourceGroup::id].
15602 ///
15603 /// # Example
15604 /// ```ignore,no_run
15605 /// # use google_cloud_securitycenter_v2::model::azure_metadata::AzureResourceGroup;
15606 /// let x = AzureResourceGroup::new().set_id("example");
15607 /// ```
15608 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15609 self.id = v.into();
15610 self
15611 }
15612
15613 /// Sets the value of [name][crate::model::azure_metadata::AzureResourceGroup::name].
15614 ///
15615 /// # Example
15616 /// ```ignore,no_run
15617 /// # use google_cloud_securitycenter_v2::model::azure_metadata::AzureResourceGroup;
15618 /// let x = AzureResourceGroup::new().set_name("example");
15619 /// ```
15620 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15621 self.name = v.into();
15622 self
15623 }
15624 }
15625
15626 impl wkt::message::Message for AzureResourceGroup {
15627 fn typename() -> &'static str {
15628 "type.googleapis.com/google.cloud.securitycenter.v2.AzureMetadata.AzureResourceGroup"
15629 }
15630 }
15631
15632 /// Represents a Microsoft Entra tenant.
15633 #[derive(Clone, Default, PartialEq)]
15634 #[non_exhaustive]
15635 pub struct AzureTenant {
15636 /// The ID of the Microsoft Entra tenant, for example,
15637 /// "a11aaa11-aa11-1aa1-11aa-1aaa11a".
15638 pub id: std::string::String,
15639
15640 /// The display name of the Azure tenant.
15641 pub display_name: std::string::String,
15642
15643 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15644 }
15645
15646 impl AzureTenant {
15647 /// Creates a new default instance.
15648 pub fn new() -> Self {
15649 std::default::Default::default()
15650 }
15651
15652 /// Sets the value of [id][crate::model::azure_metadata::AzureTenant::id].
15653 ///
15654 /// # Example
15655 /// ```ignore,no_run
15656 /// # use google_cloud_securitycenter_v2::model::azure_metadata::AzureTenant;
15657 /// let x = AzureTenant::new().set_id("example");
15658 /// ```
15659 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15660 self.id = v.into();
15661 self
15662 }
15663
15664 /// Sets the value of [display_name][crate::model::azure_metadata::AzureTenant::display_name].
15665 ///
15666 /// # Example
15667 /// ```ignore,no_run
15668 /// # use google_cloud_securitycenter_v2::model::azure_metadata::AzureTenant;
15669 /// let x = AzureTenant::new().set_display_name("example");
15670 /// ```
15671 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
15672 mut self,
15673 v: T,
15674 ) -> Self {
15675 self.display_name = v.into();
15676 self
15677 }
15678 }
15679
15680 impl wkt::message::Message for AzureTenant {
15681 fn typename() -> &'static str {
15682 "type.googleapis.com/google.cloud.securitycenter.v2.AzureMetadata.AzureTenant"
15683 }
15684 }
15685}
15686
15687/// Represents the path of resources leading up to the resource this finding is
15688/// about.
15689#[derive(Clone, Default, PartialEq)]
15690#[non_exhaustive]
15691pub struct ResourcePath {
15692 /// The list of nodes that make the up resource path, ordered from lowest
15693 /// level to highest level.
15694 pub nodes: std::vec::Vec<crate::model::resource_path::ResourcePathNode>,
15695
15696 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15697}
15698
15699impl ResourcePath {
15700 /// Creates a new default instance.
15701 pub fn new() -> Self {
15702 std::default::Default::default()
15703 }
15704
15705 /// Sets the value of [nodes][crate::model::ResourcePath::nodes].
15706 ///
15707 /// # Example
15708 /// ```ignore,no_run
15709 /// # use google_cloud_securitycenter_v2::model::ResourcePath;
15710 /// use google_cloud_securitycenter_v2::model::resource_path::ResourcePathNode;
15711 /// let x = ResourcePath::new()
15712 /// .set_nodes([
15713 /// ResourcePathNode::default()/* use setters */,
15714 /// ResourcePathNode::default()/* use (different) setters */,
15715 /// ]);
15716 /// ```
15717 pub fn set_nodes<T, V>(mut self, v: T) -> Self
15718 where
15719 T: std::iter::IntoIterator<Item = V>,
15720 V: std::convert::Into<crate::model::resource_path::ResourcePathNode>,
15721 {
15722 use std::iter::Iterator;
15723 self.nodes = v.into_iter().map(|i| i.into()).collect();
15724 self
15725 }
15726}
15727
15728impl wkt::message::Message for ResourcePath {
15729 fn typename() -> &'static str {
15730 "type.googleapis.com/google.cloud.securitycenter.v2.ResourcePath"
15731 }
15732}
15733
15734/// Defines additional types related to [ResourcePath].
15735pub mod resource_path {
15736 #[allow(unused_imports)]
15737 use super::*;
15738
15739 /// A node within the resource path. Each node represents a resource within the
15740 /// resource hierarchy.
15741 #[derive(Clone, Default, PartialEq)]
15742 #[non_exhaustive]
15743 pub struct ResourcePathNode {
15744 /// The type of resource this node represents.
15745 pub node_type: crate::model::resource_path::ResourcePathNodeType,
15746
15747 /// The ID of the resource this node represents.
15748 pub id: std::string::String,
15749
15750 /// The display name of the resource this node represents.
15751 pub display_name: std::string::String,
15752
15753 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15754 }
15755
15756 impl ResourcePathNode {
15757 /// Creates a new default instance.
15758 pub fn new() -> Self {
15759 std::default::Default::default()
15760 }
15761
15762 /// Sets the value of [node_type][crate::model::resource_path::ResourcePathNode::node_type].
15763 ///
15764 /// # Example
15765 /// ```ignore,no_run
15766 /// # use google_cloud_securitycenter_v2::model::resource_path::ResourcePathNode;
15767 /// use google_cloud_securitycenter_v2::model::resource_path::ResourcePathNodeType;
15768 /// let x0 = ResourcePathNode::new().set_node_type(ResourcePathNodeType::GcpOrganization);
15769 /// let x1 = ResourcePathNode::new().set_node_type(ResourcePathNodeType::GcpFolder);
15770 /// let x2 = ResourcePathNode::new().set_node_type(ResourcePathNodeType::GcpProject);
15771 /// ```
15772 pub fn set_node_type<
15773 T: std::convert::Into<crate::model::resource_path::ResourcePathNodeType>,
15774 >(
15775 mut self,
15776 v: T,
15777 ) -> Self {
15778 self.node_type = v.into();
15779 self
15780 }
15781
15782 /// Sets the value of [id][crate::model::resource_path::ResourcePathNode::id].
15783 ///
15784 /// # Example
15785 /// ```ignore,no_run
15786 /// # use google_cloud_securitycenter_v2::model::resource_path::ResourcePathNode;
15787 /// let x = ResourcePathNode::new().set_id("example");
15788 /// ```
15789 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15790 self.id = v.into();
15791 self
15792 }
15793
15794 /// Sets the value of [display_name][crate::model::resource_path::ResourcePathNode::display_name].
15795 ///
15796 /// # Example
15797 /// ```ignore,no_run
15798 /// # use google_cloud_securitycenter_v2::model::resource_path::ResourcePathNode;
15799 /// let x = ResourcePathNode::new().set_display_name("example");
15800 /// ```
15801 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
15802 mut self,
15803 v: T,
15804 ) -> Self {
15805 self.display_name = v.into();
15806 self
15807 }
15808 }
15809
15810 impl wkt::message::Message for ResourcePathNode {
15811 fn typename() -> &'static str {
15812 "type.googleapis.com/google.cloud.securitycenter.v2.ResourcePath.ResourcePathNode"
15813 }
15814 }
15815
15816 /// The type of resource the node represents.
15817 ///
15818 /// # Working with unknown values
15819 ///
15820 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15821 /// additional enum variants at any time. Adding new variants is not considered
15822 /// a breaking change. Applications should write their code in anticipation of:
15823 ///
15824 /// - New values appearing in future releases of the client library, **and**
15825 /// - New values received dynamically, without application changes.
15826 ///
15827 /// Please consult the [Working with enums] section in the user guide for some
15828 /// guidelines.
15829 ///
15830 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15831 #[derive(Clone, Debug, PartialEq)]
15832 #[non_exhaustive]
15833 pub enum ResourcePathNodeType {
15834 /// Node type is unspecified.
15835 Unspecified,
15836 /// The node represents a Google Cloud organization.
15837 GcpOrganization,
15838 /// The node represents a Google Cloud folder.
15839 GcpFolder,
15840 /// The node represents a Google Cloud project.
15841 GcpProject,
15842 /// The node represents an AWS organization.
15843 AwsOrganization,
15844 /// The node represents an AWS organizational unit.
15845 AwsOrganizationalUnit,
15846 /// The node represents an AWS account.
15847 AwsAccount,
15848 /// The node represents an Azure management group.
15849 AzureManagementGroup,
15850 /// The node represents an Azure subscription.
15851 AzureSubscription,
15852 /// The node represents an Azure resource group.
15853 AzureResourceGroup,
15854 /// If set, the enum was initialized with an unknown value.
15855 ///
15856 /// Applications can examine the value using [ResourcePathNodeType::value] or
15857 /// [ResourcePathNodeType::name].
15858 UnknownValue(resource_path_node_type::UnknownValue),
15859 }
15860
15861 #[doc(hidden)]
15862 pub mod resource_path_node_type {
15863 #[allow(unused_imports)]
15864 use super::*;
15865 #[derive(Clone, Debug, PartialEq)]
15866 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15867 }
15868
15869 impl ResourcePathNodeType {
15870 /// Gets the enum value.
15871 ///
15872 /// Returns `None` if the enum contains an unknown value deserialized from
15873 /// the string representation of enums.
15874 pub fn value(&self) -> std::option::Option<i32> {
15875 match self {
15876 Self::Unspecified => std::option::Option::Some(0),
15877 Self::GcpOrganization => std::option::Option::Some(1),
15878 Self::GcpFolder => std::option::Option::Some(2),
15879 Self::GcpProject => std::option::Option::Some(3),
15880 Self::AwsOrganization => std::option::Option::Some(4),
15881 Self::AwsOrganizationalUnit => std::option::Option::Some(5),
15882 Self::AwsAccount => std::option::Option::Some(6),
15883 Self::AzureManagementGroup => std::option::Option::Some(7),
15884 Self::AzureSubscription => std::option::Option::Some(8),
15885 Self::AzureResourceGroup => std::option::Option::Some(9),
15886 Self::UnknownValue(u) => u.0.value(),
15887 }
15888 }
15889
15890 /// Gets the enum value as a string.
15891 ///
15892 /// Returns `None` if the enum contains an unknown value deserialized from
15893 /// the integer representation of enums.
15894 pub fn name(&self) -> std::option::Option<&str> {
15895 match self {
15896 Self::Unspecified => {
15897 std::option::Option::Some("RESOURCE_PATH_NODE_TYPE_UNSPECIFIED")
15898 }
15899 Self::GcpOrganization => std::option::Option::Some("GCP_ORGANIZATION"),
15900 Self::GcpFolder => std::option::Option::Some("GCP_FOLDER"),
15901 Self::GcpProject => std::option::Option::Some("GCP_PROJECT"),
15902 Self::AwsOrganization => std::option::Option::Some("AWS_ORGANIZATION"),
15903 Self::AwsOrganizationalUnit => std::option::Option::Some("AWS_ORGANIZATIONAL_UNIT"),
15904 Self::AwsAccount => std::option::Option::Some("AWS_ACCOUNT"),
15905 Self::AzureManagementGroup => std::option::Option::Some("AZURE_MANAGEMENT_GROUP"),
15906 Self::AzureSubscription => std::option::Option::Some("AZURE_SUBSCRIPTION"),
15907 Self::AzureResourceGroup => std::option::Option::Some("AZURE_RESOURCE_GROUP"),
15908 Self::UnknownValue(u) => u.0.name(),
15909 }
15910 }
15911 }
15912
15913 impl std::default::Default for ResourcePathNodeType {
15914 fn default() -> Self {
15915 use std::convert::From;
15916 Self::from(0)
15917 }
15918 }
15919
15920 impl std::fmt::Display for ResourcePathNodeType {
15921 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15922 wkt::internal::display_enum(f, self.name(), self.value())
15923 }
15924 }
15925
15926 impl std::convert::From<i32> for ResourcePathNodeType {
15927 fn from(value: i32) -> Self {
15928 match value {
15929 0 => Self::Unspecified,
15930 1 => Self::GcpOrganization,
15931 2 => Self::GcpFolder,
15932 3 => Self::GcpProject,
15933 4 => Self::AwsOrganization,
15934 5 => Self::AwsOrganizationalUnit,
15935 6 => Self::AwsAccount,
15936 7 => Self::AzureManagementGroup,
15937 8 => Self::AzureSubscription,
15938 9 => Self::AzureResourceGroup,
15939 _ => Self::UnknownValue(resource_path_node_type::UnknownValue(
15940 wkt::internal::UnknownEnumValue::Integer(value),
15941 )),
15942 }
15943 }
15944 }
15945
15946 impl std::convert::From<&str> for ResourcePathNodeType {
15947 fn from(value: &str) -> Self {
15948 use std::string::ToString;
15949 match value {
15950 "RESOURCE_PATH_NODE_TYPE_UNSPECIFIED" => Self::Unspecified,
15951 "GCP_ORGANIZATION" => Self::GcpOrganization,
15952 "GCP_FOLDER" => Self::GcpFolder,
15953 "GCP_PROJECT" => Self::GcpProject,
15954 "AWS_ORGANIZATION" => Self::AwsOrganization,
15955 "AWS_ORGANIZATIONAL_UNIT" => Self::AwsOrganizationalUnit,
15956 "AWS_ACCOUNT" => Self::AwsAccount,
15957 "AZURE_MANAGEMENT_GROUP" => Self::AzureManagementGroup,
15958 "AZURE_SUBSCRIPTION" => Self::AzureSubscription,
15959 "AZURE_RESOURCE_GROUP" => Self::AzureResourceGroup,
15960 _ => Self::UnknownValue(resource_path_node_type::UnknownValue(
15961 wkt::internal::UnknownEnumValue::String(value.to_string()),
15962 )),
15963 }
15964 }
15965 }
15966
15967 impl serde::ser::Serialize for ResourcePathNodeType {
15968 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15969 where
15970 S: serde::Serializer,
15971 {
15972 match self {
15973 Self::Unspecified => serializer.serialize_i32(0),
15974 Self::GcpOrganization => serializer.serialize_i32(1),
15975 Self::GcpFolder => serializer.serialize_i32(2),
15976 Self::GcpProject => serializer.serialize_i32(3),
15977 Self::AwsOrganization => serializer.serialize_i32(4),
15978 Self::AwsOrganizationalUnit => serializer.serialize_i32(5),
15979 Self::AwsAccount => serializer.serialize_i32(6),
15980 Self::AzureManagementGroup => serializer.serialize_i32(7),
15981 Self::AzureSubscription => serializer.serialize_i32(8),
15982 Self::AzureResourceGroup => serializer.serialize_i32(9),
15983 Self::UnknownValue(u) => u.0.serialize(serializer),
15984 }
15985 }
15986 }
15987
15988 impl<'de> serde::de::Deserialize<'de> for ResourcePathNodeType {
15989 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15990 where
15991 D: serde::Deserializer<'de>,
15992 {
15993 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResourcePathNodeType>::new(
15994 ".google.cloud.securitycenter.v2.ResourcePath.ResourcePathNodeType",
15995 ))
15996 }
15997 }
15998}
15999
16000/// A resource value configuration (RVC) is a mapping configuration of user's
16001/// resources to resource values. Used in Attack path simulations.
16002#[derive(Clone, Default, PartialEq)]
16003#[non_exhaustive]
16004pub struct ResourceValueConfig {
16005 /// Identifier. Name for the resource value configuration
16006 pub name: std::string::String,
16007
16008 /// Resource value level this expression represents
16009 /// Only required when there is no Sensitive Data Protection mapping in the
16010 /// request
16011 pub resource_value: crate::model::ResourceValue,
16012
16013 /// Tag values combined with `AND` to check against.
16014 /// For Google Cloud resources, they are tag value IDs in the form of
16015 /// "tagValues/123". Example: `[ "tagValues/123", "tagValues/456",
16016 /// "tagValues/789" ]`
16017 /// <https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing>
16018 pub tag_values: std::vec::Vec<std::string::String>,
16019
16020 /// Apply resource_value only to resources that match resource_type.
16021 /// resource_type will be checked with `AND` of other resources.
16022 /// For example, "storage.googleapis.com/Bucket" with resource_value "HIGH"
16023 /// will apply "HIGH" value only to "storage.googleapis.com/Bucket" resources.
16024 pub resource_type: std::string::String,
16025
16026 /// Project or folder to scope this configuration to.
16027 /// For example, "project/456" would apply this configuration only to resources
16028 /// in "project/456" scope and will be checked with `AND` of other resources.
16029 pub scope: std::string::String,
16030
16031 /// List of resource labels to search for, evaluated with `AND`.
16032 /// For example, "resource_labels_selector": {"key": "value", "env": "prod"}
16033 /// will match resources with labels "key": "value" `AND` "env":
16034 /// "prod"
16035 /// <https://cloud.google.com/resource-manager/docs/creating-managing-labels>
16036 pub resource_labels_selector:
16037 std::collections::HashMap<std::string::String, std::string::String>,
16038
16039 /// Description of the resource value configuration.
16040 pub description: std::string::String,
16041
16042 /// Output only. Timestamp this resource value configuration was created.
16043 pub create_time: std::option::Option<wkt::Timestamp>,
16044
16045 /// Output only. Timestamp this resource value configuration was last updated.
16046 pub update_time: std::option::Option<wkt::Timestamp>,
16047
16048 /// Cloud provider this configuration applies to
16049 pub cloud_provider: crate::model::CloudProvider,
16050
16051 /// A mapping of the sensitivity on Sensitive Data Protection finding to
16052 /// resource values. This mapping can only be used in combination with a
16053 /// resource_type that is related to BigQuery, e.g.
16054 /// "bigquery.googleapis.com/Dataset".
16055 pub sensitive_data_protection_mapping:
16056 std::option::Option<crate::model::resource_value_config::SensitiveDataProtectionMapping>,
16057
16058 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16059}
16060
16061impl ResourceValueConfig {
16062 /// Creates a new default instance.
16063 pub fn new() -> Self {
16064 std::default::Default::default()
16065 }
16066
16067 /// Sets the value of [name][crate::model::ResourceValueConfig::name].
16068 ///
16069 /// # Example
16070 /// ```ignore,no_run
16071 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16072 /// let x = ResourceValueConfig::new().set_name("example");
16073 /// ```
16074 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16075 self.name = v.into();
16076 self
16077 }
16078
16079 /// Sets the value of [resource_value][crate::model::ResourceValueConfig::resource_value].
16080 ///
16081 /// # Example
16082 /// ```ignore,no_run
16083 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16084 /// use google_cloud_securitycenter_v2::model::ResourceValue;
16085 /// let x0 = ResourceValueConfig::new().set_resource_value(ResourceValue::High);
16086 /// let x1 = ResourceValueConfig::new().set_resource_value(ResourceValue::Medium);
16087 /// let x2 = ResourceValueConfig::new().set_resource_value(ResourceValue::Low);
16088 /// ```
16089 pub fn set_resource_value<T: std::convert::Into<crate::model::ResourceValue>>(
16090 mut self,
16091 v: T,
16092 ) -> Self {
16093 self.resource_value = v.into();
16094 self
16095 }
16096
16097 /// Sets the value of [tag_values][crate::model::ResourceValueConfig::tag_values].
16098 ///
16099 /// # Example
16100 /// ```ignore,no_run
16101 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16102 /// let x = ResourceValueConfig::new().set_tag_values(["a", "b", "c"]);
16103 /// ```
16104 pub fn set_tag_values<T, V>(mut self, v: T) -> Self
16105 where
16106 T: std::iter::IntoIterator<Item = V>,
16107 V: std::convert::Into<std::string::String>,
16108 {
16109 use std::iter::Iterator;
16110 self.tag_values = v.into_iter().map(|i| i.into()).collect();
16111 self
16112 }
16113
16114 /// Sets the value of [resource_type][crate::model::ResourceValueConfig::resource_type].
16115 ///
16116 /// # Example
16117 /// ```ignore,no_run
16118 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16119 /// let x = ResourceValueConfig::new().set_resource_type("example");
16120 /// ```
16121 pub fn set_resource_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16122 self.resource_type = v.into();
16123 self
16124 }
16125
16126 /// Sets the value of [scope][crate::model::ResourceValueConfig::scope].
16127 ///
16128 /// # Example
16129 /// ```ignore,no_run
16130 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16131 /// let x = ResourceValueConfig::new().set_scope("example");
16132 /// ```
16133 pub fn set_scope<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16134 self.scope = v.into();
16135 self
16136 }
16137
16138 /// Sets the value of [resource_labels_selector][crate::model::ResourceValueConfig::resource_labels_selector].
16139 ///
16140 /// # Example
16141 /// ```ignore,no_run
16142 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16143 /// let x = ResourceValueConfig::new().set_resource_labels_selector([
16144 /// ("key0", "abc"),
16145 /// ("key1", "xyz"),
16146 /// ]);
16147 /// ```
16148 pub fn set_resource_labels_selector<T, K, V>(mut self, v: T) -> Self
16149 where
16150 T: std::iter::IntoIterator<Item = (K, V)>,
16151 K: std::convert::Into<std::string::String>,
16152 V: std::convert::Into<std::string::String>,
16153 {
16154 use std::iter::Iterator;
16155 self.resource_labels_selector = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16156 self
16157 }
16158
16159 /// Sets the value of [description][crate::model::ResourceValueConfig::description].
16160 ///
16161 /// # Example
16162 /// ```ignore,no_run
16163 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16164 /// let x = ResourceValueConfig::new().set_description("example");
16165 /// ```
16166 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16167 self.description = v.into();
16168 self
16169 }
16170
16171 /// Sets the value of [create_time][crate::model::ResourceValueConfig::create_time].
16172 ///
16173 /// # Example
16174 /// ```ignore,no_run
16175 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16176 /// use wkt::Timestamp;
16177 /// let x = ResourceValueConfig::new().set_create_time(Timestamp::default()/* use setters */);
16178 /// ```
16179 pub fn set_create_time<T>(mut self, v: T) -> Self
16180 where
16181 T: std::convert::Into<wkt::Timestamp>,
16182 {
16183 self.create_time = std::option::Option::Some(v.into());
16184 self
16185 }
16186
16187 /// Sets or clears the value of [create_time][crate::model::ResourceValueConfig::create_time].
16188 ///
16189 /// # Example
16190 /// ```ignore,no_run
16191 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16192 /// use wkt::Timestamp;
16193 /// let x = ResourceValueConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
16194 /// let x = ResourceValueConfig::new().set_or_clear_create_time(None::<Timestamp>);
16195 /// ```
16196 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
16197 where
16198 T: std::convert::Into<wkt::Timestamp>,
16199 {
16200 self.create_time = v.map(|x| x.into());
16201 self
16202 }
16203
16204 /// Sets the value of [update_time][crate::model::ResourceValueConfig::update_time].
16205 ///
16206 /// # Example
16207 /// ```ignore,no_run
16208 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16209 /// use wkt::Timestamp;
16210 /// let x = ResourceValueConfig::new().set_update_time(Timestamp::default()/* use setters */);
16211 /// ```
16212 pub fn set_update_time<T>(mut self, v: T) -> Self
16213 where
16214 T: std::convert::Into<wkt::Timestamp>,
16215 {
16216 self.update_time = std::option::Option::Some(v.into());
16217 self
16218 }
16219
16220 /// Sets or clears the value of [update_time][crate::model::ResourceValueConfig::update_time].
16221 ///
16222 /// # Example
16223 /// ```ignore,no_run
16224 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16225 /// use wkt::Timestamp;
16226 /// let x = ResourceValueConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
16227 /// let x = ResourceValueConfig::new().set_or_clear_update_time(None::<Timestamp>);
16228 /// ```
16229 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
16230 where
16231 T: std::convert::Into<wkt::Timestamp>,
16232 {
16233 self.update_time = v.map(|x| x.into());
16234 self
16235 }
16236
16237 /// Sets the value of [cloud_provider][crate::model::ResourceValueConfig::cloud_provider].
16238 ///
16239 /// # Example
16240 /// ```ignore,no_run
16241 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16242 /// use google_cloud_securitycenter_v2::model::CloudProvider;
16243 /// let x0 = ResourceValueConfig::new().set_cloud_provider(CloudProvider::GoogleCloudPlatform);
16244 /// let x1 = ResourceValueConfig::new().set_cloud_provider(CloudProvider::AmazonWebServices);
16245 /// let x2 = ResourceValueConfig::new().set_cloud_provider(CloudProvider::MicrosoftAzure);
16246 /// ```
16247 pub fn set_cloud_provider<T: std::convert::Into<crate::model::CloudProvider>>(
16248 mut self,
16249 v: T,
16250 ) -> Self {
16251 self.cloud_provider = v.into();
16252 self
16253 }
16254
16255 /// Sets the value of [sensitive_data_protection_mapping][crate::model::ResourceValueConfig::sensitive_data_protection_mapping].
16256 ///
16257 /// # Example
16258 /// ```ignore,no_run
16259 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16260 /// use google_cloud_securitycenter_v2::model::resource_value_config::SensitiveDataProtectionMapping;
16261 /// let x = ResourceValueConfig::new().set_sensitive_data_protection_mapping(SensitiveDataProtectionMapping::default()/* use setters */);
16262 /// ```
16263 pub fn set_sensitive_data_protection_mapping<T>(mut self, v: T) -> Self
16264 where
16265 T: std::convert::Into<crate::model::resource_value_config::SensitiveDataProtectionMapping>,
16266 {
16267 self.sensitive_data_protection_mapping = std::option::Option::Some(v.into());
16268 self
16269 }
16270
16271 /// Sets or clears the value of [sensitive_data_protection_mapping][crate::model::ResourceValueConfig::sensitive_data_protection_mapping].
16272 ///
16273 /// # Example
16274 /// ```ignore,no_run
16275 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16276 /// use google_cloud_securitycenter_v2::model::resource_value_config::SensitiveDataProtectionMapping;
16277 /// let x = ResourceValueConfig::new().set_or_clear_sensitive_data_protection_mapping(Some(SensitiveDataProtectionMapping::default()/* use setters */));
16278 /// let x = ResourceValueConfig::new().set_or_clear_sensitive_data_protection_mapping(None::<SensitiveDataProtectionMapping>);
16279 /// ```
16280 pub fn set_or_clear_sensitive_data_protection_mapping<T>(
16281 mut self,
16282 v: std::option::Option<T>,
16283 ) -> Self
16284 where
16285 T: std::convert::Into<crate::model::resource_value_config::SensitiveDataProtectionMapping>,
16286 {
16287 self.sensitive_data_protection_mapping = v.map(|x| x.into());
16288 self
16289 }
16290}
16291
16292impl wkt::message::Message for ResourceValueConfig {
16293 fn typename() -> &'static str {
16294 "type.googleapis.com/google.cloud.securitycenter.v2.ResourceValueConfig"
16295 }
16296}
16297
16298/// Defines additional types related to [ResourceValueConfig].
16299pub mod resource_value_config {
16300 #[allow(unused_imports)]
16301 use super::*;
16302
16303 /// Resource value mapping for Sensitive Data Protection findings
16304 /// If any of these mappings have a resource value that is not unspecified,
16305 /// the resource_value field will be ignored when reading this configuration.
16306 #[derive(Clone, Default, PartialEq)]
16307 #[non_exhaustive]
16308 pub struct SensitiveDataProtectionMapping {
16309 /// Resource value mapping for high-sensitivity Sensitive Data Protection
16310 /// findings
16311 pub high_sensitivity_mapping: crate::model::ResourceValue,
16312
16313 /// Resource value mapping for medium-sensitivity Sensitive Data Protection
16314 /// findings
16315 pub medium_sensitivity_mapping: crate::model::ResourceValue,
16316
16317 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16318 }
16319
16320 impl SensitiveDataProtectionMapping {
16321 /// Creates a new default instance.
16322 pub fn new() -> Self {
16323 std::default::Default::default()
16324 }
16325
16326 /// Sets the value of [high_sensitivity_mapping][crate::model::resource_value_config::SensitiveDataProtectionMapping::high_sensitivity_mapping].
16327 ///
16328 /// # Example
16329 /// ```ignore,no_run
16330 /// # use google_cloud_securitycenter_v2::model::resource_value_config::SensitiveDataProtectionMapping;
16331 /// use google_cloud_securitycenter_v2::model::ResourceValue;
16332 /// let x0 = SensitiveDataProtectionMapping::new().set_high_sensitivity_mapping(ResourceValue::High);
16333 /// let x1 = SensitiveDataProtectionMapping::new().set_high_sensitivity_mapping(ResourceValue::Medium);
16334 /// let x2 = SensitiveDataProtectionMapping::new().set_high_sensitivity_mapping(ResourceValue::Low);
16335 /// ```
16336 pub fn set_high_sensitivity_mapping<T: std::convert::Into<crate::model::ResourceValue>>(
16337 mut self,
16338 v: T,
16339 ) -> Self {
16340 self.high_sensitivity_mapping = v.into();
16341 self
16342 }
16343
16344 /// Sets the value of [medium_sensitivity_mapping][crate::model::resource_value_config::SensitiveDataProtectionMapping::medium_sensitivity_mapping].
16345 ///
16346 /// # Example
16347 /// ```ignore,no_run
16348 /// # use google_cloud_securitycenter_v2::model::resource_value_config::SensitiveDataProtectionMapping;
16349 /// use google_cloud_securitycenter_v2::model::ResourceValue;
16350 /// let x0 = SensitiveDataProtectionMapping::new().set_medium_sensitivity_mapping(ResourceValue::High);
16351 /// let x1 = SensitiveDataProtectionMapping::new().set_medium_sensitivity_mapping(ResourceValue::Medium);
16352 /// let x2 = SensitiveDataProtectionMapping::new().set_medium_sensitivity_mapping(ResourceValue::Low);
16353 /// ```
16354 pub fn set_medium_sensitivity_mapping<
16355 T: std::convert::Into<crate::model::ResourceValue>,
16356 >(
16357 mut self,
16358 v: T,
16359 ) -> Self {
16360 self.medium_sensitivity_mapping = v.into();
16361 self
16362 }
16363 }
16364
16365 impl wkt::message::Message for SensitiveDataProtectionMapping {
16366 fn typename() -> &'static str {
16367 "type.googleapis.com/google.cloud.securitycenter.v2.ResourceValueConfig.SensitiveDataProtectionMapping"
16368 }
16369 }
16370}
16371
16372/// User specified security marks that are attached to the parent Security
16373/// Command Center resource. Security marks are scoped within a Security Command
16374/// Center organization -- they can be modified and viewed by all users who have
16375/// proper permissions on the organization.
16376#[derive(Clone, Default, PartialEq)]
16377#[non_exhaustive]
16378pub struct SecurityMarks {
16379 /// The relative resource name of the SecurityMarks. See:
16380 /// <https://cloud.google.com/apis/design/resource_names#relative_resource_name>
16381 /// The following list shows some examples:
16382 ///
16383 /// + `organizations/{organization_id}/assets/{asset_id}/securityMarks`
16384 ///
16385 /// `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks`
16386 /// +
16387 /// `organizations/{organization_id}/sources/{source_id}/locations/{location}/findings/{finding_id}/securityMarks`
16388 pub name: std::string::String,
16389
16390 /// Mutable user specified security marks belonging to the parent resource.
16391 /// Constraints are as follows:
16392 ///
16393 /// * Keys and values are treated as case insensitive
16394 /// * Keys must be between 1 - 256 characters (inclusive)
16395 /// * Keys must be letters, numbers, underscores, or dashes
16396 /// * Values have leading and trailing whitespace trimmed, remaining
16397 /// characters must be between 1 - 4096 characters (inclusive)
16398 pub marks: std::collections::HashMap<std::string::String, std::string::String>,
16399
16400 /// The canonical name of the marks. The following list shows some examples:
16401 ///
16402 /// + `organizations/{organization_id}/assets/{asset_id}/securityMarks`
16403 ///
16404 /// `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks`
16405 /// +
16406 /// `organizations/{organization_id}/sources/{source_id}/locations/{location}/findings/{finding_id}/securityMarks`
16407 ///
16408 /// + `folders/{folder_id}/assets/{asset_id}/securityMarks`
16409 ///
16410 /// `folders/{folder_id}/sources/{source_id}/findings/{finding_id}/securityMarks`
16411 /// +
16412 /// `folders/{folder_id}/sources/{source_id}/locations/{location}/findings/{finding_id}/securityMarks`
16413 ///
16414 /// + `projects/{project_number}/assets/{asset_id}/securityMarks`
16415 ///
16416 /// `projects/{project_number}/sources/{source_id}/findings/{finding_id}/securityMarks`
16417 /// +
16418 /// `projects/{project_number}/sources/{source_id}/locations/{location}/findings/{finding_id}/securityMarks`
16419 pub canonical_name: std::string::String,
16420
16421 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16422}
16423
16424impl SecurityMarks {
16425 /// Creates a new default instance.
16426 pub fn new() -> Self {
16427 std::default::Default::default()
16428 }
16429
16430 /// Sets the value of [name][crate::model::SecurityMarks::name].
16431 ///
16432 /// # Example
16433 /// ```ignore,no_run
16434 /// # use google_cloud_securitycenter_v2::model::SecurityMarks;
16435 /// let x = SecurityMarks::new().set_name("example");
16436 /// ```
16437 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16438 self.name = v.into();
16439 self
16440 }
16441
16442 /// Sets the value of [marks][crate::model::SecurityMarks::marks].
16443 ///
16444 /// # Example
16445 /// ```ignore,no_run
16446 /// # use google_cloud_securitycenter_v2::model::SecurityMarks;
16447 /// let x = SecurityMarks::new().set_marks([
16448 /// ("key0", "abc"),
16449 /// ("key1", "xyz"),
16450 /// ]);
16451 /// ```
16452 pub fn set_marks<T, K, V>(mut self, v: T) -> Self
16453 where
16454 T: std::iter::IntoIterator<Item = (K, V)>,
16455 K: std::convert::Into<std::string::String>,
16456 V: std::convert::Into<std::string::String>,
16457 {
16458 use std::iter::Iterator;
16459 self.marks = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16460 self
16461 }
16462
16463 /// Sets the value of [canonical_name][crate::model::SecurityMarks::canonical_name].
16464 ///
16465 /// # Example
16466 /// ```ignore,no_run
16467 /// # use google_cloud_securitycenter_v2::model::SecurityMarks;
16468 /// let x = SecurityMarks::new().set_canonical_name("example");
16469 /// ```
16470 pub fn set_canonical_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16471 self.canonical_name = v.into();
16472 self
16473 }
16474}
16475
16476impl wkt::message::Message for SecurityMarks {
16477 fn typename() -> &'static str {
16478 "type.googleapis.com/google.cloud.securitycenter.v2.SecurityMarks"
16479 }
16480}
16481
16482/// Represents a posture that is deployed on Google Cloud by the
16483/// Security Command Center Posture Management service.
16484/// A posture contains one or more policy sets. A policy set is a
16485/// group of policies that enforce a set of security rules on Google
16486/// Cloud.
16487#[derive(Clone, Default, PartialEq)]
16488#[non_exhaustive]
16489pub struct SecurityPosture {
16490 /// Name of the posture, for example, `CIS-Posture`.
16491 pub name: std::string::String,
16492
16493 /// The version of the posture, for example, `c7cfa2a8`.
16494 pub revision_id: std::string::String,
16495
16496 /// The project, folder, or organization on which the posture is deployed,
16497 /// for example, `projects/{project_number}`.
16498 pub posture_deployment_resource: std::string::String,
16499
16500 /// The name of the posture deployment, for example,
16501 /// `organizations/{org_id}/posturedeployments/{posture_deployment_id}`.
16502 pub posture_deployment: std::string::String,
16503
16504 /// The name of the updated policy, for example,
16505 /// `projects/{project_id}/policies/{constraint_name}`.
16506 pub changed_policy: std::string::String,
16507
16508 /// The name of the updated policy set, for example, `cis-policyset`.
16509 pub policy_set: std::string::String,
16510
16511 /// The ID of the updated policy, for example, `compute-policy-1`.
16512 pub policy: std::string::String,
16513
16514 /// The details about a change in an updated policy that violates the deployed
16515 /// posture.
16516 pub policy_drift_details: std::vec::Vec<crate::model::security_posture::PolicyDriftDetails>,
16517
16518 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16519}
16520
16521impl SecurityPosture {
16522 /// Creates a new default instance.
16523 pub fn new() -> Self {
16524 std::default::Default::default()
16525 }
16526
16527 /// Sets the value of [name][crate::model::SecurityPosture::name].
16528 ///
16529 /// # Example
16530 /// ```ignore,no_run
16531 /// # use google_cloud_securitycenter_v2::model::SecurityPosture;
16532 /// let x = SecurityPosture::new().set_name("example");
16533 /// ```
16534 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16535 self.name = v.into();
16536 self
16537 }
16538
16539 /// Sets the value of [revision_id][crate::model::SecurityPosture::revision_id].
16540 ///
16541 /// # Example
16542 /// ```ignore,no_run
16543 /// # use google_cloud_securitycenter_v2::model::SecurityPosture;
16544 /// let x = SecurityPosture::new().set_revision_id("example");
16545 /// ```
16546 pub fn set_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16547 self.revision_id = v.into();
16548 self
16549 }
16550
16551 /// Sets the value of [posture_deployment_resource][crate::model::SecurityPosture::posture_deployment_resource].
16552 ///
16553 /// # Example
16554 /// ```ignore,no_run
16555 /// # use google_cloud_securitycenter_v2::model::SecurityPosture;
16556 /// let x = SecurityPosture::new().set_posture_deployment_resource("example");
16557 /// ```
16558 pub fn set_posture_deployment_resource<T: std::convert::Into<std::string::String>>(
16559 mut self,
16560 v: T,
16561 ) -> Self {
16562 self.posture_deployment_resource = v.into();
16563 self
16564 }
16565
16566 /// Sets the value of [posture_deployment][crate::model::SecurityPosture::posture_deployment].
16567 ///
16568 /// # Example
16569 /// ```ignore,no_run
16570 /// # use google_cloud_securitycenter_v2::model::SecurityPosture;
16571 /// let x = SecurityPosture::new().set_posture_deployment("example");
16572 /// ```
16573 pub fn set_posture_deployment<T: std::convert::Into<std::string::String>>(
16574 mut self,
16575 v: T,
16576 ) -> Self {
16577 self.posture_deployment = v.into();
16578 self
16579 }
16580
16581 /// Sets the value of [changed_policy][crate::model::SecurityPosture::changed_policy].
16582 ///
16583 /// # Example
16584 /// ```ignore,no_run
16585 /// # use google_cloud_securitycenter_v2::model::SecurityPosture;
16586 /// let x = SecurityPosture::new().set_changed_policy("example");
16587 /// ```
16588 pub fn set_changed_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16589 self.changed_policy = v.into();
16590 self
16591 }
16592
16593 /// Sets the value of [policy_set][crate::model::SecurityPosture::policy_set].
16594 ///
16595 /// # Example
16596 /// ```ignore,no_run
16597 /// # use google_cloud_securitycenter_v2::model::SecurityPosture;
16598 /// let x = SecurityPosture::new().set_policy_set("example");
16599 /// ```
16600 pub fn set_policy_set<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16601 self.policy_set = v.into();
16602 self
16603 }
16604
16605 /// Sets the value of [policy][crate::model::SecurityPosture::policy].
16606 ///
16607 /// # Example
16608 /// ```ignore,no_run
16609 /// # use google_cloud_securitycenter_v2::model::SecurityPosture;
16610 /// let x = SecurityPosture::new().set_policy("example");
16611 /// ```
16612 pub fn set_policy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16613 self.policy = v.into();
16614 self
16615 }
16616
16617 /// Sets the value of [policy_drift_details][crate::model::SecurityPosture::policy_drift_details].
16618 ///
16619 /// # Example
16620 /// ```ignore,no_run
16621 /// # use google_cloud_securitycenter_v2::model::SecurityPosture;
16622 /// use google_cloud_securitycenter_v2::model::security_posture::PolicyDriftDetails;
16623 /// let x = SecurityPosture::new()
16624 /// .set_policy_drift_details([
16625 /// PolicyDriftDetails::default()/* use setters */,
16626 /// PolicyDriftDetails::default()/* use (different) setters */,
16627 /// ]);
16628 /// ```
16629 pub fn set_policy_drift_details<T, V>(mut self, v: T) -> Self
16630 where
16631 T: std::iter::IntoIterator<Item = V>,
16632 V: std::convert::Into<crate::model::security_posture::PolicyDriftDetails>,
16633 {
16634 use std::iter::Iterator;
16635 self.policy_drift_details = v.into_iter().map(|i| i.into()).collect();
16636 self
16637 }
16638}
16639
16640impl wkt::message::Message for SecurityPosture {
16641 fn typename() -> &'static str {
16642 "type.googleapis.com/google.cloud.securitycenter.v2.SecurityPosture"
16643 }
16644}
16645
16646/// Defines additional types related to [SecurityPosture].
16647pub mod security_posture {
16648 #[allow(unused_imports)]
16649 use super::*;
16650
16651 /// The policy field that violates the deployed posture and its expected and
16652 /// detected values.
16653 #[derive(Clone, Default, PartialEq)]
16654 #[non_exhaustive]
16655 pub struct PolicyDriftDetails {
16656 /// The name of the updated field, for example
16657 /// constraint.implementation.policy_rules[0].enforce
16658 pub field: std::string::String,
16659
16660 /// The value of this field that was configured in a posture, for example,
16661 /// `true` or `allowed_values={"projects/29831892"}`.
16662 pub expected_value: std::string::String,
16663
16664 /// The detected value that violates the deployed posture, for example,
16665 /// `false` or `allowed_values={"projects/22831892"}`.
16666 pub detected_value: std::string::String,
16667
16668 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16669 }
16670
16671 impl PolicyDriftDetails {
16672 /// Creates a new default instance.
16673 pub fn new() -> Self {
16674 std::default::Default::default()
16675 }
16676
16677 /// Sets the value of [field][crate::model::security_posture::PolicyDriftDetails::field].
16678 ///
16679 /// # Example
16680 /// ```ignore,no_run
16681 /// # use google_cloud_securitycenter_v2::model::security_posture::PolicyDriftDetails;
16682 /// let x = PolicyDriftDetails::new().set_field("example");
16683 /// ```
16684 pub fn set_field<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16685 self.field = v.into();
16686 self
16687 }
16688
16689 /// Sets the value of [expected_value][crate::model::security_posture::PolicyDriftDetails::expected_value].
16690 ///
16691 /// # Example
16692 /// ```ignore,no_run
16693 /// # use google_cloud_securitycenter_v2::model::security_posture::PolicyDriftDetails;
16694 /// let x = PolicyDriftDetails::new().set_expected_value("example");
16695 /// ```
16696 pub fn set_expected_value<T: std::convert::Into<std::string::String>>(
16697 mut self,
16698 v: T,
16699 ) -> Self {
16700 self.expected_value = v.into();
16701 self
16702 }
16703
16704 /// Sets the value of [detected_value][crate::model::security_posture::PolicyDriftDetails::detected_value].
16705 ///
16706 /// # Example
16707 /// ```ignore,no_run
16708 /// # use google_cloud_securitycenter_v2::model::security_posture::PolicyDriftDetails;
16709 /// let x = PolicyDriftDetails::new().set_detected_value("example");
16710 /// ```
16711 pub fn set_detected_value<T: std::convert::Into<std::string::String>>(
16712 mut self,
16713 v: T,
16714 ) -> Self {
16715 self.detected_value = v.into();
16716 self
16717 }
16718 }
16719
16720 impl wkt::message::Message for PolicyDriftDetails {
16721 fn typename() -> &'static str {
16722 "type.googleapis.com/google.cloud.securitycenter.v2.SecurityPosture.PolicyDriftDetails"
16723 }
16724 }
16725}
16726
16727/// Request message to create multiple resource value configs
16728#[derive(Clone, Default, PartialEq)]
16729#[non_exhaustive]
16730pub struct BatchCreateResourceValueConfigsRequest {
16731 /// Required. Resource name of the new ResourceValueConfig's parent.
16732 /// The parent field in the CreateResourceValueConfigRequest
16733 /// messages must either be empty or match this field.
16734 pub parent: std::string::String,
16735
16736 /// Required. The resource value configs to be created.
16737 pub requests: std::vec::Vec<crate::model::CreateResourceValueConfigRequest>,
16738
16739 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16740}
16741
16742impl BatchCreateResourceValueConfigsRequest {
16743 /// Creates a new default instance.
16744 pub fn new() -> Self {
16745 std::default::Default::default()
16746 }
16747
16748 /// Sets the value of [parent][crate::model::BatchCreateResourceValueConfigsRequest::parent].
16749 ///
16750 /// # Example
16751 /// ```ignore,no_run
16752 /// # use google_cloud_securitycenter_v2::model::BatchCreateResourceValueConfigsRequest;
16753 /// let x = BatchCreateResourceValueConfigsRequest::new().set_parent("example");
16754 /// ```
16755 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16756 self.parent = v.into();
16757 self
16758 }
16759
16760 /// Sets the value of [requests][crate::model::BatchCreateResourceValueConfigsRequest::requests].
16761 ///
16762 /// # Example
16763 /// ```ignore,no_run
16764 /// # use google_cloud_securitycenter_v2::model::BatchCreateResourceValueConfigsRequest;
16765 /// use google_cloud_securitycenter_v2::model::CreateResourceValueConfigRequest;
16766 /// let x = BatchCreateResourceValueConfigsRequest::new()
16767 /// .set_requests([
16768 /// CreateResourceValueConfigRequest::default()/* use setters */,
16769 /// CreateResourceValueConfigRequest::default()/* use (different) setters */,
16770 /// ]);
16771 /// ```
16772 pub fn set_requests<T, V>(mut self, v: T) -> Self
16773 where
16774 T: std::iter::IntoIterator<Item = V>,
16775 V: std::convert::Into<crate::model::CreateResourceValueConfigRequest>,
16776 {
16777 use std::iter::Iterator;
16778 self.requests = v.into_iter().map(|i| i.into()).collect();
16779 self
16780 }
16781}
16782
16783impl wkt::message::Message for BatchCreateResourceValueConfigsRequest {
16784 fn typename() -> &'static str {
16785 "type.googleapis.com/google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsRequest"
16786 }
16787}
16788
16789/// Response message for BatchCreateResourceValueConfigs
16790#[derive(Clone, Default, PartialEq)]
16791#[non_exhaustive]
16792pub struct BatchCreateResourceValueConfigsResponse {
16793 /// The resource value configs created
16794 pub resource_value_configs: std::vec::Vec<crate::model::ResourceValueConfig>,
16795
16796 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16797}
16798
16799impl BatchCreateResourceValueConfigsResponse {
16800 /// Creates a new default instance.
16801 pub fn new() -> Self {
16802 std::default::Default::default()
16803 }
16804
16805 /// Sets the value of [resource_value_configs][crate::model::BatchCreateResourceValueConfigsResponse::resource_value_configs].
16806 ///
16807 /// # Example
16808 /// ```ignore,no_run
16809 /// # use google_cloud_securitycenter_v2::model::BatchCreateResourceValueConfigsResponse;
16810 /// use google_cloud_securitycenter_v2::model::ResourceValueConfig;
16811 /// let x = BatchCreateResourceValueConfigsResponse::new()
16812 /// .set_resource_value_configs([
16813 /// ResourceValueConfig::default()/* use setters */,
16814 /// ResourceValueConfig::default()/* use (different) setters */,
16815 /// ]);
16816 /// ```
16817 pub fn set_resource_value_configs<T, V>(mut self, v: T) -> Self
16818 where
16819 T: std::iter::IntoIterator<Item = V>,
16820 V: std::convert::Into<crate::model::ResourceValueConfig>,
16821 {
16822 use std::iter::Iterator;
16823 self.resource_value_configs = v.into_iter().map(|i| i.into()).collect();
16824 self
16825 }
16826}
16827
16828impl wkt::message::Message for BatchCreateResourceValueConfigsResponse {
16829 fn typename() -> &'static str {
16830 "type.googleapis.com/google.cloud.securitycenter.v2.BatchCreateResourceValueConfigsResponse"
16831 }
16832}
16833
16834/// Request message for bulk findings update.
16835///
16836/// Note:
16837///
16838/// 1. If multiple bulk update requests match the same resource, the order in
16839/// which they get executed is not defined.
16840/// 1. Once a bulk operation is started, there is no way to stop it.
16841#[derive(Clone, Default, PartialEq)]
16842#[non_exhaustive]
16843pub struct BulkMuteFindingsRequest {
16844 /// Required. The parent, at which bulk action needs to be applied. If no
16845 /// location is specified, findings are updated in global. The following list
16846 /// shows some examples:
16847 ///
16848 /// + `organizations/[organization_id]`
16849 /// + `organizations/[organization_id]/locations/[location_id]`
16850 /// + `folders/[folder_id]`
16851 /// + `folders/[folder_id]/locations/[location_id]`
16852 /// + `projects/[project_id]`
16853 /// + `projects/[project_id]/locations/[location_id]`
16854 pub parent: std::string::String,
16855
16856 /// Expression that identifies findings that should be updated.
16857 /// The expression is a list of zero or more restrictions combined
16858 /// via logical operators `AND` and `OR`. Parentheses are supported, and `OR`
16859 /// has higher precedence than `AND`.
16860 ///
16861 /// Restrictions have the form `<field> <operator> <value>` and may have a
16862 /// `-` character in front of them to indicate negation. The fields map to
16863 /// those defined in the corresponding resource.
16864 ///
16865 /// The supported operators are:
16866 ///
16867 /// * `=` for all value types.
16868 /// * `>`, `<`, `>=`, `<=` for integer values.
16869 /// * `:`, meaning substring matching, for strings.
16870 ///
16871 /// The supported value types are:
16872 ///
16873 /// * string literals in quotes.
16874 /// * integer literals without quotes.
16875 /// * boolean literals `true` and `false` without quotes.
16876 pub filter: std::string::String,
16877
16878 /// Optional. All findings matching the given filter will have their mute state
16879 /// set to this value. The default value is `MUTED`. Setting this to
16880 /// `UNDEFINED` will clear the mute state on all matching findings.
16881 pub mute_state: crate::model::bulk_mute_findings_request::MuteState,
16882
16883 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16884}
16885
16886impl BulkMuteFindingsRequest {
16887 /// Creates a new default instance.
16888 pub fn new() -> Self {
16889 std::default::Default::default()
16890 }
16891
16892 /// Sets the value of [parent][crate::model::BulkMuteFindingsRequest::parent].
16893 ///
16894 /// # Example
16895 /// ```ignore,no_run
16896 /// # use google_cloud_securitycenter_v2::model::BulkMuteFindingsRequest;
16897 /// let x = BulkMuteFindingsRequest::new().set_parent("example");
16898 /// ```
16899 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16900 self.parent = v.into();
16901 self
16902 }
16903
16904 /// Sets the value of [filter][crate::model::BulkMuteFindingsRequest::filter].
16905 ///
16906 /// # Example
16907 /// ```ignore,no_run
16908 /// # use google_cloud_securitycenter_v2::model::BulkMuteFindingsRequest;
16909 /// let x = BulkMuteFindingsRequest::new().set_filter("example");
16910 /// ```
16911 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16912 self.filter = v.into();
16913 self
16914 }
16915
16916 /// Sets the value of [mute_state][crate::model::BulkMuteFindingsRequest::mute_state].
16917 ///
16918 /// # Example
16919 /// ```ignore,no_run
16920 /// # use google_cloud_securitycenter_v2::model::BulkMuteFindingsRequest;
16921 /// use google_cloud_securitycenter_v2::model::bulk_mute_findings_request::MuteState;
16922 /// let x0 = BulkMuteFindingsRequest::new().set_mute_state(MuteState::Muted);
16923 /// let x1 = BulkMuteFindingsRequest::new().set_mute_state(MuteState::Undefined);
16924 /// ```
16925 pub fn set_mute_state<
16926 T: std::convert::Into<crate::model::bulk_mute_findings_request::MuteState>,
16927 >(
16928 mut self,
16929 v: T,
16930 ) -> Self {
16931 self.mute_state = v.into();
16932 self
16933 }
16934}
16935
16936impl wkt::message::Message for BulkMuteFindingsRequest {
16937 fn typename() -> &'static str {
16938 "type.googleapis.com/google.cloud.securitycenter.v2.BulkMuteFindingsRequest"
16939 }
16940}
16941
16942/// Defines additional types related to [BulkMuteFindingsRequest].
16943pub mod bulk_mute_findings_request {
16944 #[allow(unused_imports)]
16945 use super::*;
16946
16947 /// The mute state.
16948 ///
16949 /// # Working with unknown values
16950 ///
16951 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16952 /// additional enum variants at any time. Adding new variants is not considered
16953 /// a breaking change. Applications should write their code in anticipation of:
16954 ///
16955 /// - New values appearing in future releases of the client library, **and**
16956 /// - New values received dynamically, without application changes.
16957 ///
16958 /// Please consult the [Working with enums] section in the user guide for some
16959 /// guidelines.
16960 ///
16961 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16962 #[derive(Clone, Debug, PartialEq)]
16963 #[non_exhaustive]
16964 pub enum MuteState {
16965 /// Unused.
16966 Unspecified,
16967 /// Matching findings will be muted (default).
16968 Muted,
16969 /// Matching findings will have their mute state cleared.
16970 Undefined,
16971 /// If set, the enum was initialized with an unknown value.
16972 ///
16973 /// Applications can examine the value using [MuteState::value] or
16974 /// [MuteState::name].
16975 UnknownValue(mute_state::UnknownValue),
16976 }
16977
16978 #[doc(hidden)]
16979 pub mod mute_state {
16980 #[allow(unused_imports)]
16981 use super::*;
16982 #[derive(Clone, Debug, PartialEq)]
16983 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16984 }
16985
16986 impl MuteState {
16987 /// Gets the enum value.
16988 ///
16989 /// Returns `None` if the enum contains an unknown value deserialized from
16990 /// the string representation of enums.
16991 pub fn value(&self) -> std::option::Option<i32> {
16992 match self {
16993 Self::Unspecified => std::option::Option::Some(0),
16994 Self::Muted => std::option::Option::Some(1),
16995 Self::Undefined => std::option::Option::Some(2),
16996 Self::UnknownValue(u) => u.0.value(),
16997 }
16998 }
16999
17000 /// Gets the enum value as a string.
17001 ///
17002 /// Returns `None` if the enum contains an unknown value deserialized from
17003 /// the integer representation of enums.
17004 pub fn name(&self) -> std::option::Option<&str> {
17005 match self {
17006 Self::Unspecified => std::option::Option::Some("MUTE_STATE_UNSPECIFIED"),
17007 Self::Muted => std::option::Option::Some("MUTED"),
17008 Self::Undefined => std::option::Option::Some("UNDEFINED"),
17009 Self::UnknownValue(u) => u.0.name(),
17010 }
17011 }
17012 }
17013
17014 impl std::default::Default for MuteState {
17015 fn default() -> Self {
17016 use std::convert::From;
17017 Self::from(0)
17018 }
17019 }
17020
17021 impl std::fmt::Display for MuteState {
17022 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17023 wkt::internal::display_enum(f, self.name(), self.value())
17024 }
17025 }
17026
17027 impl std::convert::From<i32> for MuteState {
17028 fn from(value: i32) -> Self {
17029 match value {
17030 0 => Self::Unspecified,
17031 1 => Self::Muted,
17032 2 => Self::Undefined,
17033 _ => Self::UnknownValue(mute_state::UnknownValue(
17034 wkt::internal::UnknownEnumValue::Integer(value),
17035 )),
17036 }
17037 }
17038 }
17039
17040 impl std::convert::From<&str> for MuteState {
17041 fn from(value: &str) -> Self {
17042 use std::string::ToString;
17043 match value {
17044 "MUTE_STATE_UNSPECIFIED" => Self::Unspecified,
17045 "MUTED" => Self::Muted,
17046 "UNDEFINED" => Self::Undefined,
17047 _ => Self::UnknownValue(mute_state::UnknownValue(
17048 wkt::internal::UnknownEnumValue::String(value.to_string()),
17049 )),
17050 }
17051 }
17052 }
17053
17054 impl serde::ser::Serialize for MuteState {
17055 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17056 where
17057 S: serde::Serializer,
17058 {
17059 match self {
17060 Self::Unspecified => serializer.serialize_i32(0),
17061 Self::Muted => serializer.serialize_i32(1),
17062 Self::Undefined => serializer.serialize_i32(2),
17063 Self::UnknownValue(u) => u.0.serialize(serializer),
17064 }
17065 }
17066 }
17067
17068 impl<'de> serde::de::Deserialize<'de> for MuteState {
17069 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17070 where
17071 D: serde::Deserializer<'de>,
17072 {
17073 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MuteState>::new(
17074 ".google.cloud.securitycenter.v2.BulkMuteFindingsRequest.MuteState",
17075 ))
17076 }
17077 }
17078}
17079
17080/// The response to a BulkMute request. Contains the LRO information.
17081#[derive(Clone, Default, PartialEq)]
17082#[non_exhaustive]
17083pub struct BulkMuteFindingsResponse {
17084 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17085}
17086
17087impl BulkMuteFindingsResponse {
17088 /// Creates a new default instance.
17089 pub fn new() -> Self {
17090 std::default::Default::default()
17091 }
17092}
17093
17094impl wkt::message::Message for BulkMuteFindingsResponse {
17095 fn typename() -> &'static str {
17096 "type.googleapis.com/google.cloud.securitycenter.v2.BulkMuteFindingsResponse"
17097 }
17098}
17099
17100/// Request message for creating a BigQuery export.
17101#[derive(Clone, Default, PartialEq)]
17102#[non_exhaustive]
17103pub struct CreateBigQueryExportRequest {
17104 /// Required. The name of the parent resource of the new BigQuery export. Its
17105 /// format is `organizations/[organization_id]/locations/[location_id]`,
17106 /// `folders/[folder_id]/locations/[location_id]`, or
17107 /// `projects/[project_id]/locations/[location_id]`.
17108 pub parent: std::string::String,
17109
17110 /// Required. The BigQuery export being created.
17111 pub big_query_export: std::option::Option<crate::model::BigQueryExport>,
17112
17113 /// Required. Unique identifier provided by the client within the parent scope.
17114 /// It must consist of only lowercase letters, numbers, and hyphens, must start
17115 /// with a letter, must end with either a letter or a number, and must be 63
17116 /// characters or less.
17117 pub big_query_export_id: std::string::String,
17118
17119 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17120}
17121
17122impl CreateBigQueryExportRequest {
17123 /// Creates a new default instance.
17124 pub fn new() -> Self {
17125 std::default::Default::default()
17126 }
17127
17128 /// Sets the value of [parent][crate::model::CreateBigQueryExportRequest::parent].
17129 ///
17130 /// # Example
17131 /// ```ignore,no_run
17132 /// # use google_cloud_securitycenter_v2::model::CreateBigQueryExportRequest;
17133 /// let x = CreateBigQueryExportRequest::new().set_parent("example");
17134 /// ```
17135 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17136 self.parent = v.into();
17137 self
17138 }
17139
17140 /// Sets the value of [big_query_export][crate::model::CreateBigQueryExportRequest::big_query_export].
17141 ///
17142 /// # Example
17143 /// ```ignore,no_run
17144 /// # use google_cloud_securitycenter_v2::model::CreateBigQueryExportRequest;
17145 /// use google_cloud_securitycenter_v2::model::BigQueryExport;
17146 /// let x = CreateBigQueryExportRequest::new().set_big_query_export(BigQueryExport::default()/* use setters */);
17147 /// ```
17148 pub fn set_big_query_export<T>(mut self, v: T) -> Self
17149 where
17150 T: std::convert::Into<crate::model::BigQueryExport>,
17151 {
17152 self.big_query_export = std::option::Option::Some(v.into());
17153 self
17154 }
17155
17156 /// Sets or clears the value of [big_query_export][crate::model::CreateBigQueryExportRequest::big_query_export].
17157 ///
17158 /// # Example
17159 /// ```ignore,no_run
17160 /// # use google_cloud_securitycenter_v2::model::CreateBigQueryExportRequest;
17161 /// use google_cloud_securitycenter_v2::model::BigQueryExport;
17162 /// let x = CreateBigQueryExportRequest::new().set_or_clear_big_query_export(Some(BigQueryExport::default()/* use setters */));
17163 /// let x = CreateBigQueryExportRequest::new().set_or_clear_big_query_export(None::<BigQueryExport>);
17164 /// ```
17165 pub fn set_or_clear_big_query_export<T>(mut self, v: std::option::Option<T>) -> Self
17166 where
17167 T: std::convert::Into<crate::model::BigQueryExport>,
17168 {
17169 self.big_query_export = v.map(|x| x.into());
17170 self
17171 }
17172
17173 /// Sets the value of [big_query_export_id][crate::model::CreateBigQueryExportRequest::big_query_export_id].
17174 ///
17175 /// # Example
17176 /// ```ignore,no_run
17177 /// # use google_cloud_securitycenter_v2::model::CreateBigQueryExportRequest;
17178 /// let x = CreateBigQueryExportRequest::new().set_big_query_export_id("example");
17179 /// ```
17180 pub fn set_big_query_export_id<T: std::convert::Into<std::string::String>>(
17181 mut self,
17182 v: T,
17183 ) -> Self {
17184 self.big_query_export_id = v.into();
17185 self
17186 }
17187}
17188
17189impl wkt::message::Message for CreateBigQueryExportRequest {
17190 fn typename() -> &'static str {
17191 "type.googleapis.com/google.cloud.securitycenter.v2.CreateBigQueryExportRequest"
17192 }
17193}
17194
17195/// Request message for creating a finding.
17196#[derive(Clone, Default, PartialEq)]
17197#[non_exhaustive]
17198pub struct CreateFindingRequest {
17199 /// Required. Resource name of the new finding's parent. The following list
17200 /// shows some examples of the format:
17201 /// +
17202 /// `organizations/[organization_id]/sources/[source_id]`
17203 /// +
17204 /// `organizations/[organization_id]/sources/[source_id]/locations/[location_id]`
17205 pub parent: std::string::String,
17206
17207 /// Required. Unique identifier provided by the client within the parent scope.
17208 /// It must be alphanumeric and less than or equal to 32 characters and
17209 /// greater than 0 characters in length.
17210 pub finding_id: std::string::String,
17211
17212 /// Required. The Finding being created. The name and security_marks will be
17213 /// ignored as they are both output only fields on this resource.
17214 pub finding: std::option::Option<crate::model::Finding>,
17215
17216 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17217}
17218
17219impl CreateFindingRequest {
17220 /// Creates a new default instance.
17221 pub fn new() -> Self {
17222 std::default::Default::default()
17223 }
17224
17225 /// Sets the value of [parent][crate::model::CreateFindingRequest::parent].
17226 ///
17227 /// # Example
17228 /// ```ignore,no_run
17229 /// # use google_cloud_securitycenter_v2::model::CreateFindingRequest;
17230 /// let x = CreateFindingRequest::new().set_parent("example");
17231 /// ```
17232 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17233 self.parent = v.into();
17234 self
17235 }
17236
17237 /// Sets the value of [finding_id][crate::model::CreateFindingRequest::finding_id].
17238 ///
17239 /// # Example
17240 /// ```ignore,no_run
17241 /// # use google_cloud_securitycenter_v2::model::CreateFindingRequest;
17242 /// let x = CreateFindingRequest::new().set_finding_id("example");
17243 /// ```
17244 pub fn set_finding_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17245 self.finding_id = v.into();
17246 self
17247 }
17248
17249 /// Sets the value of [finding][crate::model::CreateFindingRequest::finding].
17250 ///
17251 /// # Example
17252 /// ```ignore,no_run
17253 /// # use google_cloud_securitycenter_v2::model::CreateFindingRequest;
17254 /// use google_cloud_securitycenter_v2::model::Finding;
17255 /// let x = CreateFindingRequest::new().set_finding(Finding::default()/* use setters */);
17256 /// ```
17257 pub fn set_finding<T>(mut self, v: T) -> Self
17258 where
17259 T: std::convert::Into<crate::model::Finding>,
17260 {
17261 self.finding = std::option::Option::Some(v.into());
17262 self
17263 }
17264
17265 /// Sets or clears the value of [finding][crate::model::CreateFindingRequest::finding].
17266 ///
17267 /// # Example
17268 /// ```ignore,no_run
17269 /// # use google_cloud_securitycenter_v2::model::CreateFindingRequest;
17270 /// use google_cloud_securitycenter_v2::model::Finding;
17271 /// let x = CreateFindingRequest::new().set_or_clear_finding(Some(Finding::default()/* use setters */));
17272 /// let x = CreateFindingRequest::new().set_or_clear_finding(None::<Finding>);
17273 /// ```
17274 pub fn set_or_clear_finding<T>(mut self, v: std::option::Option<T>) -> Self
17275 where
17276 T: std::convert::Into<crate::model::Finding>,
17277 {
17278 self.finding = v.map(|x| x.into());
17279 self
17280 }
17281}
17282
17283impl wkt::message::Message for CreateFindingRequest {
17284 fn typename() -> &'static str {
17285 "type.googleapis.com/google.cloud.securitycenter.v2.CreateFindingRequest"
17286 }
17287}
17288
17289/// Request message for creating a mute config.
17290#[derive(Clone, Default, PartialEq)]
17291#[non_exhaustive]
17292pub struct CreateMuteConfigRequest {
17293 /// Required. Resource name of the new mute configs's parent. Its format is
17294 /// `organizations/[organization_id]/locations/[location_id]`,
17295 /// `folders/[folder_id]/locations/[location_id]`, or
17296 /// `projects/[project_id]/locations/[location_id]`.
17297 pub parent: std::string::String,
17298
17299 /// Required. The mute config being created.
17300 pub mute_config: std::option::Option<crate::model::MuteConfig>,
17301
17302 /// Required. Unique identifier provided by the client within the parent scope.
17303 /// It must consist of only lowercase letters, numbers, and hyphens, must start
17304 /// with a letter, must end with either a letter or a number, and must be 63
17305 /// characters or less.
17306 pub mute_config_id: std::string::String,
17307
17308 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17309}
17310
17311impl CreateMuteConfigRequest {
17312 /// Creates a new default instance.
17313 pub fn new() -> Self {
17314 std::default::Default::default()
17315 }
17316
17317 /// Sets the value of [parent][crate::model::CreateMuteConfigRequest::parent].
17318 ///
17319 /// # Example
17320 /// ```ignore,no_run
17321 /// # use google_cloud_securitycenter_v2::model::CreateMuteConfigRequest;
17322 /// let x = CreateMuteConfigRequest::new().set_parent("example");
17323 /// ```
17324 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17325 self.parent = v.into();
17326 self
17327 }
17328
17329 /// Sets the value of [mute_config][crate::model::CreateMuteConfigRequest::mute_config].
17330 ///
17331 /// # Example
17332 /// ```ignore,no_run
17333 /// # use google_cloud_securitycenter_v2::model::CreateMuteConfigRequest;
17334 /// use google_cloud_securitycenter_v2::model::MuteConfig;
17335 /// let x = CreateMuteConfigRequest::new().set_mute_config(MuteConfig::default()/* use setters */);
17336 /// ```
17337 pub fn set_mute_config<T>(mut self, v: T) -> Self
17338 where
17339 T: std::convert::Into<crate::model::MuteConfig>,
17340 {
17341 self.mute_config = std::option::Option::Some(v.into());
17342 self
17343 }
17344
17345 /// Sets or clears the value of [mute_config][crate::model::CreateMuteConfigRequest::mute_config].
17346 ///
17347 /// # Example
17348 /// ```ignore,no_run
17349 /// # use google_cloud_securitycenter_v2::model::CreateMuteConfigRequest;
17350 /// use google_cloud_securitycenter_v2::model::MuteConfig;
17351 /// let x = CreateMuteConfigRequest::new().set_or_clear_mute_config(Some(MuteConfig::default()/* use setters */));
17352 /// let x = CreateMuteConfigRequest::new().set_or_clear_mute_config(None::<MuteConfig>);
17353 /// ```
17354 pub fn set_or_clear_mute_config<T>(mut self, v: std::option::Option<T>) -> Self
17355 where
17356 T: std::convert::Into<crate::model::MuteConfig>,
17357 {
17358 self.mute_config = v.map(|x| x.into());
17359 self
17360 }
17361
17362 /// Sets the value of [mute_config_id][crate::model::CreateMuteConfigRequest::mute_config_id].
17363 ///
17364 /// # Example
17365 /// ```ignore,no_run
17366 /// # use google_cloud_securitycenter_v2::model::CreateMuteConfigRequest;
17367 /// let x = CreateMuteConfigRequest::new().set_mute_config_id("example");
17368 /// ```
17369 pub fn set_mute_config_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17370 self.mute_config_id = v.into();
17371 self
17372 }
17373}
17374
17375impl wkt::message::Message for CreateMuteConfigRequest {
17376 fn typename() -> &'static str {
17377 "type.googleapis.com/google.cloud.securitycenter.v2.CreateMuteConfigRequest"
17378 }
17379}
17380
17381/// Request message for creating a notification config.
17382#[derive(Clone, Default, PartialEq)]
17383#[non_exhaustive]
17384pub struct CreateNotificationConfigRequest {
17385 /// Required. Resource name of the new notification config's parent. Its format
17386 /// is `organizations/[organization_id]/locations/[location_id]`,
17387 /// `folders/[folder_id]/locations/[location_id]`, or
17388 /// `projects/[project_id]/locations/[location_id]`.
17389 pub parent: std::string::String,
17390
17391 /// Required.
17392 /// Unique identifier provided by the client within the parent scope.
17393 /// It must be between 1 and 128 characters and contain alphanumeric
17394 /// characters, underscores, or hyphens only.
17395 pub config_id: std::string::String,
17396
17397 /// Required. The notification config being created. The name and the service
17398 /// account will be ignored as they are both output only fields on this
17399 /// resource.
17400 pub notification_config: std::option::Option<crate::model::NotificationConfig>,
17401
17402 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17403}
17404
17405impl CreateNotificationConfigRequest {
17406 /// Creates a new default instance.
17407 pub fn new() -> Self {
17408 std::default::Default::default()
17409 }
17410
17411 /// Sets the value of [parent][crate::model::CreateNotificationConfigRequest::parent].
17412 ///
17413 /// # Example
17414 /// ```ignore,no_run
17415 /// # use google_cloud_securitycenter_v2::model::CreateNotificationConfigRequest;
17416 /// let x = CreateNotificationConfigRequest::new().set_parent("example");
17417 /// ```
17418 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17419 self.parent = v.into();
17420 self
17421 }
17422
17423 /// Sets the value of [config_id][crate::model::CreateNotificationConfigRequest::config_id].
17424 ///
17425 /// # Example
17426 /// ```ignore,no_run
17427 /// # use google_cloud_securitycenter_v2::model::CreateNotificationConfigRequest;
17428 /// let x = CreateNotificationConfigRequest::new().set_config_id("example");
17429 /// ```
17430 pub fn set_config_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17431 self.config_id = v.into();
17432 self
17433 }
17434
17435 /// Sets the value of [notification_config][crate::model::CreateNotificationConfigRequest::notification_config].
17436 ///
17437 /// # Example
17438 /// ```ignore,no_run
17439 /// # use google_cloud_securitycenter_v2::model::CreateNotificationConfigRequest;
17440 /// use google_cloud_securitycenter_v2::model::NotificationConfig;
17441 /// let x = CreateNotificationConfigRequest::new().set_notification_config(NotificationConfig::default()/* use setters */);
17442 /// ```
17443 pub fn set_notification_config<T>(mut self, v: T) -> Self
17444 where
17445 T: std::convert::Into<crate::model::NotificationConfig>,
17446 {
17447 self.notification_config = std::option::Option::Some(v.into());
17448 self
17449 }
17450
17451 /// Sets or clears the value of [notification_config][crate::model::CreateNotificationConfigRequest::notification_config].
17452 ///
17453 /// # Example
17454 /// ```ignore,no_run
17455 /// # use google_cloud_securitycenter_v2::model::CreateNotificationConfigRequest;
17456 /// use google_cloud_securitycenter_v2::model::NotificationConfig;
17457 /// let x = CreateNotificationConfigRequest::new().set_or_clear_notification_config(Some(NotificationConfig::default()/* use setters */));
17458 /// let x = CreateNotificationConfigRequest::new().set_or_clear_notification_config(None::<NotificationConfig>);
17459 /// ```
17460 pub fn set_or_clear_notification_config<T>(mut self, v: std::option::Option<T>) -> Self
17461 where
17462 T: std::convert::Into<crate::model::NotificationConfig>,
17463 {
17464 self.notification_config = v.map(|x| x.into());
17465 self
17466 }
17467}
17468
17469impl wkt::message::Message for CreateNotificationConfigRequest {
17470 fn typename() -> &'static str {
17471 "type.googleapis.com/google.cloud.securitycenter.v2.CreateNotificationConfigRequest"
17472 }
17473}
17474
17475/// Request message to create single resource value config
17476#[derive(Clone, Default, PartialEq)]
17477#[non_exhaustive]
17478pub struct CreateResourceValueConfigRequest {
17479 /// Required. Resource name of the new ResourceValueConfig's parent.
17480 pub parent: std::string::String,
17481
17482 /// Required. The resource value config being created.
17483 pub resource_value_config: std::option::Option<crate::model::ResourceValueConfig>,
17484
17485 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17486}
17487
17488impl CreateResourceValueConfigRequest {
17489 /// Creates a new default instance.
17490 pub fn new() -> Self {
17491 std::default::Default::default()
17492 }
17493
17494 /// Sets the value of [parent][crate::model::CreateResourceValueConfigRequest::parent].
17495 ///
17496 /// # Example
17497 /// ```ignore,no_run
17498 /// # use google_cloud_securitycenter_v2::model::CreateResourceValueConfigRequest;
17499 /// let x = CreateResourceValueConfigRequest::new().set_parent("example");
17500 /// ```
17501 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17502 self.parent = v.into();
17503 self
17504 }
17505
17506 /// Sets the value of [resource_value_config][crate::model::CreateResourceValueConfigRequest::resource_value_config].
17507 ///
17508 /// # Example
17509 /// ```ignore,no_run
17510 /// # use google_cloud_securitycenter_v2::model::CreateResourceValueConfigRequest;
17511 /// use google_cloud_securitycenter_v2::model::ResourceValueConfig;
17512 /// let x = CreateResourceValueConfigRequest::new().set_resource_value_config(ResourceValueConfig::default()/* use setters */);
17513 /// ```
17514 pub fn set_resource_value_config<T>(mut self, v: T) -> Self
17515 where
17516 T: std::convert::Into<crate::model::ResourceValueConfig>,
17517 {
17518 self.resource_value_config = std::option::Option::Some(v.into());
17519 self
17520 }
17521
17522 /// Sets or clears the value of [resource_value_config][crate::model::CreateResourceValueConfigRequest::resource_value_config].
17523 ///
17524 /// # Example
17525 /// ```ignore,no_run
17526 /// # use google_cloud_securitycenter_v2::model::CreateResourceValueConfigRequest;
17527 /// use google_cloud_securitycenter_v2::model::ResourceValueConfig;
17528 /// let x = CreateResourceValueConfigRequest::new().set_or_clear_resource_value_config(Some(ResourceValueConfig::default()/* use setters */));
17529 /// let x = CreateResourceValueConfigRequest::new().set_or_clear_resource_value_config(None::<ResourceValueConfig>);
17530 /// ```
17531 pub fn set_or_clear_resource_value_config<T>(mut self, v: std::option::Option<T>) -> Self
17532 where
17533 T: std::convert::Into<crate::model::ResourceValueConfig>,
17534 {
17535 self.resource_value_config = v.map(|x| x.into());
17536 self
17537 }
17538}
17539
17540impl wkt::message::Message for CreateResourceValueConfigRequest {
17541 fn typename() -> &'static str {
17542 "type.googleapis.com/google.cloud.securitycenter.v2.CreateResourceValueConfigRequest"
17543 }
17544}
17545
17546/// Request message for creating a source.
17547#[derive(Clone, Default, PartialEq)]
17548#[non_exhaustive]
17549pub struct CreateSourceRequest {
17550 /// Required. Resource name of the new source's parent. Its format should be
17551 /// `organizations/[organization_id]`.
17552 pub parent: std::string::String,
17553
17554 /// Required. The Source being created, only the display_name and description
17555 /// will be used. All other fields will be ignored.
17556 pub source: std::option::Option<crate::model::Source>,
17557
17558 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17559}
17560
17561impl CreateSourceRequest {
17562 /// Creates a new default instance.
17563 pub fn new() -> Self {
17564 std::default::Default::default()
17565 }
17566
17567 /// Sets the value of [parent][crate::model::CreateSourceRequest::parent].
17568 ///
17569 /// # Example
17570 /// ```ignore,no_run
17571 /// # use google_cloud_securitycenter_v2::model::CreateSourceRequest;
17572 /// let x = CreateSourceRequest::new().set_parent("example");
17573 /// ```
17574 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17575 self.parent = v.into();
17576 self
17577 }
17578
17579 /// Sets the value of [source][crate::model::CreateSourceRequest::source].
17580 ///
17581 /// # Example
17582 /// ```ignore,no_run
17583 /// # use google_cloud_securitycenter_v2::model::CreateSourceRequest;
17584 /// use google_cloud_securitycenter_v2::model::Source;
17585 /// let x = CreateSourceRequest::new().set_source(Source::default()/* use setters */);
17586 /// ```
17587 pub fn set_source<T>(mut self, v: T) -> Self
17588 where
17589 T: std::convert::Into<crate::model::Source>,
17590 {
17591 self.source = std::option::Option::Some(v.into());
17592 self
17593 }
17594
17595 /// Sets or clears the value of [source][crate::model::CreateSourceRequest::source].
17596 ///
17597 /// # Example
17598 /// ```ignore,no_run
17599 /// # use google_cloud_securitycenter_v2::model::CreateSourceRequest;
17600 /// use google_cloud_securitycenter_v2::model::Source;
17601 /// let x = CreateSourceRequest::new().set_or_clear_source(Some(Source::default()/* use setters */));
17602 /// let x = CreateSourceRequest::new().set_or_clear_source(None::<Source>);
17603 /// ```
17604 pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
17605 where
17606 T: std::convert::Into<crate::model::Source>,
17607 {
17608 self.source = v.map(|x| x.into());
17609 self
17610 }
17611}
17612
17613impl wkt::message::Message for CreateSourceRequest {
17614 fn typename() -> &'static str {
17615 "type.googleapis.com/google.cloud.securitycenter.v2.CreateSourceRequest"
17616 }
17617}
17618
17619/// Request message for deleting a BigQuery export.
17620#[derive(Clone, Default, PartialEq)]
17621#[non_exhaustive]
17622pub struct DeleteBigQueryExportRequest {
17623 /// Required. The name of the BigQuery export to delete. The following list
17624 /// shows some examples of the format:
17625 ///
17626 ///
17627 /// `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}`
17628 ///
17629 /// + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}`
17630 /// + `projects/{project}/locations/{location}/bigQueryExports/{export_id}`
17631 pub name: std::string::String,
17632
17633 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17634}
17635
17636impl DeleteBigQueryExportRequest {
17637 /// Creates a new default instance.
17638 pub fn new() -> Self {
17639 std::default::Default::default()
17640 }
17641
17642 /// Sets the value of [name][crate::model::DeleteBigQueryExportRequest::name].
17643 ///
17644 /// # Example
17645 /// ```ignore,no_run
17646 /// # use google_cloud_securitycenter_v2::model::DeleteBigQueryExportRequest;
17647 /// let x = DeleteBigQueryExportRequest::new().set_name("example");
17648 /// ```
17649 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17650 self.name = v.into();
17651 self
17652 }
17653}
17654
17655impl wkt::message::Message for DeleteBigQueryExportRequest {
17656 fn typename() -> &'static str {
17657 "type.googleapis.com/google.cloud.securitycenter.v2.DeleteBigQueryExportRequest"
17658 }
17659}
17660
17661/// Request message for deleting a mute config. If no location is specified,
17662/// default is global.
17663#[derive(Clone, Default, PartialEq)]
17664#[non_exhaustive]
17665pub struct DeleteMuteConfigRequest {
17666 /// Required. Name of the mute config to delete. The following list shows some
17667 /// examples of the format:
17668 ///
17669 /// + `organizations/{organization}/muteConfigs/{config_id}`
17670 ///
17671 /// `organizations/{organization}/locations/{location}/muteConfigs/{config_id}`
17672 ///
17673 /// + `folders/{folder}/muteConfigs/{config_id}`
17674 /// + `folders/{folder}/locations/{location}/muteConfigs/{config_id}`
17675 /// + `projects/{project}/muteConfigs/{config_id}`
17676 /// + `projects/{project}/locations/{location}/muteConfigs/{config_id}`
17677 pub name: std::string::String,
17678
17679 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17680}
17681
17682impl DeleteMuteConfigRequest {
17683 /// Creates a new default instance.
17684 pub fn new() -> Self {
17685 std::default::Default::default()
17686 }
17687
17688 /// Sets the value of [name][crate::model::DeleteMuteConfigRequest::name].
17689 ///
17690 /// # Example
17691 /// ```ignore,no_run
17692 /// # use google_cloud_securitycenter_v2::model::DeleteMuteConfigRequest;
17693 /// let x = DeleteMuteConfigRequest::new().set_name("example");
17694 /// ```
17695 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17696 self.name = v.into();
17697 self
17698 }
17699}
17700
17701impl wkt::message::Message for DeleteMuteConfigRequest {
17702 fn typename() -> &'static str {
17703 "type.googleapis.com/google.cloud.securitycenter.v2.DeleteMuteConfigRequest"
17704 }
17705}
17706
17707/// Request message for deleting a notification config.
17708#[derive(Clone, Default, PartialEq)]
17709#[non_exhaustive]
17710pub struct DeleteNotificationConfigRequest {
17711 /// Required. Name of the notification config to delete. The following list
17712 /// shows some examples of the format:
17713 ///
17714 ///
17715 /// `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]`
17716 /// +
17717 /// `folders/[folder_id]/locations/[location_id]notificationConfigs/[config_id]`
17718 /// +
17719 /// `projects/[project_id]/locations/[location_id]notificationConfigs/[config_id]`
17720 pub name: std::string::String,
17721
17722 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17723}
17724
17725impl DeleteNotificationConfigRequest {
17726 /// Creates a new default instance.
17727 pub fn new() -> Self {
17728 std::default::Default::default()
17729 }
17730
17731 /// Sets the value of [name][crate::model::DeleteNotificationConfigRequest::name].
17732 ///
17733 /// # Example
17734 /// ```ignore,no_run
17735 /// # use google_cloud_securitycenter_v2::model::DeleteNotificationConfigRequest;
17736 /// let x = DeleteNotificationConfigRequest::new().set_name("example");
17737 /// ```
17738 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17739 self.name = v.into();
17740 self
17741 }
17742}
17743
17744impl wkt::message::Message for DeleteNotificationConfigRequest {
17745 fn typename() -> &'static str {
17746 "type.googleapis.com/google.cloud.securitycenter.v2.DeleteNotificationConfigRequest"
17747 }
17748}
17749
17750/// Request message to delete resource value config
17751#[derive(Clone, Default, PartialEq)]
17752#[non_exhaustive]
17753pub struct DeleteResourceValueConfigRequest {
17754 /// Required. Name of the ResourceValueConfig to delete
17755 pub name: std::string::String,
17756
17757 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17758}
17759
17760impl DeleteResourceValueConfigRequest {
17761 /// Creates a new default instance.
17762 pub fn new() -> Self {
17763 std::default::Default::default()
17764 }
17765
17766 /// Sets the value of [name][crate::model::DeleteResourceValueConfigRequest::name].
17767 ///
17768 /// # Example
17769 /// ```ignore,no_run
17770 /// # use google_cloud_securitycenter_v2::model::DeleteResourceValueConfigRequest;
17771 /// let x = DeleteResourceValueConfigRequest::new().set_name("example");
17772 /// ```
17773 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17774 self.name = v.into();
17775 self
17776 }
17777}
17778
17779impl wkt::message::Message for DeleteResourceValueConfigRequest {
17780 fn typename() -> &'static str {
17781 "type.googleapis.com/google.cloud.securitycenter.v2.DeleteResourceValueConfigRequest"
17782 }
17783}
17784
17785/// The destination big query dataset to export findings to.
17786#[derive(Clone, Default, PartialEq)]
17787#[non_exhaustive]
17788pub struct BigQueryDestination {
17789 /// Required. The relative resource name of the destination dataset, in the
17790 /// form projects/{projectId}/datasets/{datasetId}.
17791 pub dataset: std::string::String,
17792
17793 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17794}
17795
17796impl BigQueryDestination {
17797 /// Creates a new default instance.
17798 pub fn new() -> Self {
17799 std::default::Default::default()
17800 }
17801
17802 /// Sets the value of [dataset][crate::model::BigQueryDestination::dataset].
17803 ///
17804 /// # Example
17805 /// ```ignore,no_run
17806 /// # use google_cloud_securitycenter_v2::model::BigQueryDestination;
17807 /// let x = BigQueryDestination::new().set_dataset("example");
17808 /// ```
17809 pub fn set_dataset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17810 self.dataset = v.into();
17811 self
17812 }
17813}
17814
17815impl wkt::message::Message for BigQueryDestination {
17816 fn typename() -> &'static str {
17817 "type.googleapis.com/google.cloud.securitycenter.v2.BigQueryDestination"
17818 }
17819}
17820
17821/// The LRO metadata for a ExportFindings request.
17822#[derive(Clone, Default, PartialEq)]
17823#[non_exhaustive]
17824pub struct ExportFindingsMetadata {
17825 /// Optional. Timestamp at which export was started
17826 pub export_start_time: std::option::Option<wkt::Timestamp>,
17827
17828 /// The destination to export findings to.
17829 pub destination: std::option::Option<crate::model::export_findings_metadata::Destination>,
17830
17831 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17832}
17833
17834impl ExportFindingsMetadata {
17835 /// Creates a new default instance.
17836 pub fn new() -> Self {
17837 std::default::Default::default()
17838 }
17839
17840 /// Sets the value of [export_start_time][crate::model::ExportFindingsMetadata::export_start_time].
17841 ///
17842 /// # Example
17843 /// ```ignore,no_run
17844 /// # use google_cloud_securitycenter_v2::model::ExportFindingsMetadata;
17845 /// use wkt::Timestamp;
17846 /// let x = ExportFindingsMetadata::new().set_export_start_time(Timestamp::default()/* use setters */);
17847 /// ```
17848 pub fn set_export_start_time<T>(mut self, v: T) -> Self
17849 where
17850 T: std::convert::Into<wkt::Timestamp>,
17851 {
17852 self.export_start_time = std::option::Option::Some(v.into());
17853 self
17854 }
17855
17856 /// Sets or clears the value of [export_start_time][crate::model::ExportFindingsMetadata::export_start_time].
17857 ///
17858 /// # Example
17859 /// ```ignore,no_run
17860 /// # use google_cloud_securitycenter_v2::model::ExportFindingsMetadata;
17861 /// use wkt::Timestamp;
17862 /// let x = ExportFindingsMetadata::new().set_or_clear_export_start_time(Some(Timestamp::default()/* use setters */));
17863 /// let x = ExportFindingsMetadata::new().set_or_clear_export_start_time(None::<Timestamp>);
17864 /// ```
17865 pub fn set_or_clear_export_start_time<T>(mut self, v: std::option::Option<T>) -> Self
17866 where
17867 T: std::convert::Into<wkt::Timestamp>,
17868 {
17869 self.export_start_time = v.map(|x| x.into());
17870 self
17871 }
17872
17873 /// Sets the value of [destination][crate::model::ExportFindingsMetadata::destination].
17874 ///
17875 /// Note that all the setters affecting `destination` are mutually
17876 /// exclusive.
17877 ///
17878 /// # Example
17879 /// ```ignore,no_run
17880 /// # use google_cloud_securitycenter_v2::model::ExportFindingsMetadata;
17881 /// use google_cloud_securitycenter_v2::model::BigQueryDestination;
17882 /// let x = ExportFindingsMetadata::new().set_destination(Some(
17883 /// google_cloud_securitycenter_v2::model::export_findings_metadata::Destination::BigQueryDestination(BigQueryDestination::default().into())));
17884 /// ```
17885 pub fn set_destination<
17886 T: std::convert::Into<
17887 std::option::Option<crate::model::export_findings_metadata::Destination>,
17888 >,
17889 >(
17890 mut self,
17891 v: T,
17892 ) -> Self {
17893 self.destination = v.into();
17894 self
17895 }
17896
17897 /// The value of [destination][crate::model::ExportFindingsMetadata::destination]
17898 /// if it holds a `BigQueryDestination`, `None` if the field is not set or
17899 /// holds a different branch.
17900 pub fn big_query_destination(
17901 &self,
17902 ) -> std::option::Option<&std::boxed::Box<crate::model::BigQueryDestination>> {
17903 #[allow(unreachable_patterns)]
17904 self.destination.as_ref().and_then(|v| match v {
17905 crate::model::export_findings_metadata::Destination::BigQueryDestination(v) => {
17906 std::option::Option::Some(v)
17907 }
17908 _ => std::option::Option::None,
17909 })
17910 }
17911
17912 /// Sets the value of [destination][crate::model::ExportFindingsMetadata::destination]
17913 /// to hold a `BigQueryDestination`.
17914 ///
17915 /// Note that all the setters affecting `destination` are
17916 /// mutually exclusive.
17917 ///
17918 /// # Example
17919 /// ```ignore,no_run
17920 /// # use google_cloud_securitycenter_v2::model::ExportFindingsMetadata;
17921 /// use google_cloud_securitycenter_v2::model::BigQueryDestination;
17922 /// let x = ExportFindingsMetadata::new().set_big_query_destination(BigQueryDestination::default()/* use setters */);
17923 /// assert!(x.big_query_destination().is_some());
17924 /// ```
17925 pub fn set_big_query_destination<
17926 T: std::convert::Into<std::boxed::Box<crate::model::BigQueryDestination>>,
17927 >(
17928 mut self,
17929 v: T,
17930 ) -> Self {
17931 self.destination = std::option::Option::Some(
17932 crate::model::export_findings_metadata::Destination::BigQueryDestination(v.into()),
17933 );
17934 self
17935 }
17936}
17937
17938impl wkt::message::Message for ExportFindingsMetadata {
17939 fn typename() -> &'static str {
17940 "type.googleapis.com/google.cloud.securitycenter.v2.ExportFindingsMetadata"
17941 }
17942}
17943
17944/// Defines additional types related to [ExportFindingsMetadata].
17945pub mod export_findings_metadata {
17946 #[allow(unused_imports)]
17947 use super::*;
17948
17949 /// The destination to export findings to.
17950 #[derive(Clone, Debug, PartialEq)]
17951 #[non_exhaustive]
17952 pub enum Destination {
17953 /// Required. The destination big query dataset to export findings to.
17954 BigQueryDestination(std::boxed::Box<crate::model::BigQueryDestination>),
17955 }
17956}
17957
17958/// The response to a ExportFindings request. Contains the LRO information.
17959#[derive(Clone, Default, PartialEq)]
17960#[non_exhaustive]
17961pub struct ExportFindingsResponse {
17962 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17963}
17964
17965impl ExportFindingsResponse {
17966 /// Creates a new default instance.
17967 pub fn new() -> Self {
17968 std::default::Default::default()
17969 }
17970}
17971
17972impl wkt::message::Message for ExportFindingsResponse {
17973 fn typename() -> &'static str {
17974 "type.googleapis.com/google.cloud.securitycenter.v2.ExportFindingsResponse"
17975 }
17976}
17977
17978/// Request message for retrieving a BigQuery export.
17979#[derive(Clone, Default, PartialEq)]
17980#[non_exhaustive]
17981pub struct GetBigQueryExportRequest {
17982 /// Required. Name of the BigQuery export to retrieve. The following list shows
17983 /// some examples of the format:
17984 ///
17985 ///
17986 /// `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}`
17987 ///
17988 /// + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}`
17989 /// + `projects/{project}locations/{location}//bigQueryExports/{export_id}`
17990 pub name: std::string::String,
17991
17992 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17993}
17994
17995impl GetBigQueryExportRequest {
17996 /// Creates a new default instance.
17997 pub fn new() -> Self {
17998 std::default::Default::default()
17999 }
18000
18001 /// Sets the value of [name][crate::model::GetBigQueryExportRequest::name].
18002 ///
18003 /// # Example
18004 /// ```ignore,no_run
18005 /// # use google_cloud_securitycenter_v2::model::GetBigQueryExportRequest;
18006 /// let x = GetBigQueryExportRequest::new().set_name("example");
18007 /// ```
18008 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18009 self.name = v.into();
18010 self
18011 }
18012}
18013
18014impl wkt::message::Message for GetBigQueryExportRequest {
18015 fn typename() -> &'static str {
18016 "type.googleapis.com/google.cloud.securitycenter.v2.GetBigQueryExportRequest"
18017 }
18018}
18019
18020/// Request message for retrieving a mute config. If no location is specified,
18021/// default is global.
18022#[derive(Clone, Default, PartialEq)]
18023#[non_exhaustive]
18024pub struct GetMuteConfigRequest {
18025 /// Required. Name of the mute config to retrieve. The following list shows
18026 /// some examples of the format:
18027 ///
18028 /// + `organizations/{organization}/muteConfigs/{config_id}`
18029 ///
18030 /// `organizations/{organization}/locations/{location}/muteConfigs/{config_id}`
18031 ///
18032 /// + `folders/{folder}/muteConfigs/{config_id}`
18033 /// + `folders/{folder}/locations/{location}/muteConfigs/{config_id}`
18034 /// + `projects/{project}/muteConfigs/{config_id}`
18035 /// + `projects/{project}/locations/{location}/muteConfigs/{config_id}`
18036 pub name: std::string::String,
18037
18038 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18039}
18040
18041impl GetMuteConfigRequest {
18042 /// Creates a new default instance.
18043 pub fn new() -> Self {
18044 std::default::Default::default()
18045 }
18046
18047 /// Sets the value of [name][crate::model::GetMuteConfigRequest::name].
18048 ///
18049 /// # Example
18050 /// ```ignore,no_run
18051 /// # use google_cloud_securitycenter_v2::model::GetMuteConfigRequest;
18052 /// let x = GetMuteConfigRequest::new().set_name("example");
18053 /// ```
18054 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18055 self.name = v.into();
18056 self
18057 }
18058}
18059
18060impl wkt::message::Message for GetMuteConfigRequest {
18061 fn typename() -> &'static str {
18062 "type.googleapis.com/google.cloud.securitycenter.v2.GetMuteConfigRequest"
18063 }
18064}
18065
18066/// Request message for getting a notification config.
18067#[derive(Clone, Default, PartialEq)]
18068#[non_exhaustive]
18069pub struct GetNotificationConfigRequest {
18070 /// Required. Name of the notification config to get. The following list shows
18071 /// some examples of the format:
18072 ///
18073 ///
18074 /// `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]`
18075 /// +
18076 /// `folders/[folder_id]/locations/[location_id]/notificationConfigs/[config_id]`
18077 /// +
18078 /// `projects/[project_id]/locations/[location_id]/notificationConfigs/[config_id]`
18079 pub name: std::string::String,
18080
18081 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18082}
18083
18084impl GetNotificationConfigRequest {
18085 /// Creates a new default instance.
18086 pub fn new() -> Self {
18087 std::default::Default::default()
18088 }
18089
18090 /// Sets the value of [name][crate::model::GetNotificationConfigRequest::name].
18091 ///
18092 /// # Example
18093 /// ```ignore,no_run
18094 /// # use google_cloud_securitycenter_v2::model::GetNotificationConfigRequest;
18095 /// let x = GetNotificationConfigRequest::new().set_name("example");
18096 /// ```
18097 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18098 self.name = v.into();
18099 self
18100 }
18101}
18102
18103impl wkt::message::Message for GetNotificationConfigRequest {
18104 fn typename() -> &'static str {
18105 "type.googleapis.com/google.cloud.securitycenter.v2.GetNotificationConfigRequest"
18106 }
18107}
18108
18109/// Request message to get resource value config
18110#[derive(Clone, Default, PartialEq)]
18111#[non_exhaustive]
18112pub struct GetResourceValueConfigRequest {
18113 /// Required. Name of the resource value config to retrieve. Its format is
18114 /// organizations/{organization}/resourceValueConfigs/{config_id}.
18115 pub name: std::string::String,
18116
18117 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18118}
18119
18120impl GetResourceValueConfigRequest {
18121 /// Creates a new default instance.
18122 pub fn new() -> Self {
18123 std::default::Default::default()
18124 }
18125
18126 /// Sets the value of [name][crate::model::GetResourceValueConfigRequest::name].
18127 ///
18128 /// # Example
18129 /// ```ignore,no_run
18130 /// # use google_cloud_securitycenter_v2::model::GetResourceValueConfigRequest;
18131 /// let x = GetResourceValueConfigRequest::new().set_name("example");
18132 /// ```
18133 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18134 self.name = v.into();
18135 self
18136 }
18137}
18138
18139impl wkt::message::Message for GetResourceValueConfigRequest {
18140 fn typename() -> &'static str {
18141 "type.googleapis.com/google.cloud.securitycenter.v2.GetResourceValueConfigRequest"
18142 }
18143}
18144
18145/// Request message for getting a source.
18146#[derive(Clone, Default, PartialEq)]
18147#[non_exhaustive]
18148pub struct GetSourceRequest {
18149 /// Required. Relative resource name of the source. Its format is
18150 /// `organizations/[organization_id]/source/[source_id]`.
18151 pub name: std::string::String,
18152
18153 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18154}
18155
18156impl GetSourceRequest {
18157 /// Creates a new default instance.
18158 pub fn new() -> Self {
18159 std::default::Default::default()
18160 }
18161
18162 /// Sets the value of [name][crate::model::GetSourceRequest::name].
18163 ///
18164 /// # Example
18165 /// ```ignore,no_run
18166 /// # use google_cloud_securitycenter_v2::model::GetSourceRequest;
18167 /// let x = GetSourceRequest::new().set_name("example");
18168 /// ```
18169 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18170 self.name = v.into();
18171 self
18172 }
18173}
18174
18175impl wkt::message::Message for GetSourceRequest {
18176 fn typename() -> &'static str {
18177 "type.googleapis.com/google.cloud.securitycenter.v2.GetSourceRequest"
18178 }
18179}
18180
18181/// Request message for grouping by findings.
18182#[derive(Clone, Default, PartialEq)]
18183#[non_exhaustive]
18184pub struct GroupFindingsRequest {
18185 /// Required. Name of the source to groupBy. If no location is specified,
18186 /// finding is assumed to be in global.
18187 /// The following list shows some examples:
18188 ///
18189 /// + `organizations/[organization_id]/sources/[source_id]`
18190 ///
18191 /// `organizations/[organization_id]/sources/[source_id]/locations/[location_id]`
18192 ///
18193 /// + `folders/[folder_id]/sources/[source_id]`
18194 /// + `folders/[folder_id]/sources/[source_id]/locations/[location_id]`
18195 /// + `projects/[project_id]/sources/[source_id]`
18196 /// + `projects/[project_id]/sources/[source_id]/locations/[location_id]`
18197 ///
18198 /// To groupBy across all sources provide a source_id of `-`. The following
18199 /// list shows some examples:
18200 ///
18201 /// + `organizations/{organization_id}/sources/-`
18202 /// + `organizations/{organization_id}/sources/-/locations/[location_id]`
18203 /// + `folders/{folder_id}/sources/-`
18204 /// + `folders/{folder_id}/sources/-/locations/[location_id]`
18205 /// + `projects/{project_id}/sources/-`
18206 /// + `projects/{project_id}/sources/-/locations/[location_id]`
18207 pub parent: std::string::String,
18208
18209 /// Expression that defines the filter to apply across findings.
18210 /// The expression is a list of one or more restrictions combined via logical
18211 /// operators `AND` and `OR`.
18212 /// Parentheses are supported, and `OR` has higher precedence than `AND`.
18213 ///
18214 /// Restrictions have the form `<field> <operator> <value>` and may have a `-`
18215 /// character in front of them to indicate negation. Examples include:
18216 ///
18217 /// * name
18218 /// * security_marks.marks.marka
18219 ///
18220 /// The supported operators are:
18221 ///
18222 /// * `=` for all value types.
18223 /// * `>`, `<`, `>=`, `<=` for integer values.
18224 /// * `:`, meaning substring matching, for strings.
18225 ///
18226 /// The supported value types are:
18227 ///
18228 /// * string literals in quotes.
18229 /// * integer literals without quotes.
18230 /// * boolean literals `true` and `false` without quotes.
18231 ///
18232 /// The following field and operator combinations are supported:
18233 ///
18234 /// * name: `=`
18235 ///
18236 /// * parent: `=`, `:`
18237 ///
18238 /// * resource_name: `=`, `:`
18239 ///
18240 /// * state: `=`, `:`
18241 ///
18242 /// * category: `=`, `:`
18243 ///
18244 /// * external_uri: `=`, `:`
18245 ///
18246 /// * event_time: `=`, `>`, `<`, `>=`, `<=`
18247 ///
18248 /// Usage: This should be milliseconds since epoch or an RFC3339 string.
18249 /// Examples:
18250 /// `event_time = "2019-06-10T16:07:18-07:00"`
18251 /// `event_time = 1560208038000`
18252 ///
18253 /// * severity: `=`, `:`
18254 ///
18255 /// * security_marks.marks: `=`, `:`
18256 ///
18257 /// * resource:
18258 ///
18259 /// * resource.name: `=`, `:`
18260 /// * resource.parent_name: `=`, `:`
18261 /// * resource.parent_display_name: `=`, `:`
18262 /// * resource.project_name: `=`, `:`
18263 /// * resource.project_display_name: `=`, `:`
18264 /// * resource.type: `=`, `:`
18265 pub filter: std::string::String,
18266
18267 /// Required. Expression that defines what assets fields to use for grouping.
18268 /// The string value should follow SQL syntax: comma separated list of fields.
18269 /// For example: "parent,resource_name".
18270 pub group_by: std::string::String,
18271
18272 /// The value returned by the last `GroupFindingsResponse`; indicates
18273 /// that this is a continuation of a prior `GroupFindings` call, and
18274 /// that the system should return the next page of data.
18275 pub page_token: std::string::String,
18276
18277 /// The maximum number of results to return in a single response. Default is
18278 /// 10, minimum is 1, maximum is 1000.
18279 pub page_size: i32,
18280
18281 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18282}
18283
18284impl GroupFindingsRequest {
18285 /// Creates a new default instance.
18286 pub fn new() -> Self {
18287 std::default::Default::default()
18288 }
18289
18290 /// Sets the value of [parent][crate::model::GroupFindingsRequest::parent].
18291 ///
18292 /// # Example
18293 /// ```ignore,no_run
18294 /// # use google_cloud_securitycenter_v2::model::GroupFindingsRequest;
18295 /// let x = GroupFindingsRequest::new().set_parent("example");
18296 /// ```
18297 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18298 self.parent = v.into();
18299 self
18300 }
18301
18302 /// Sets the value of [filter][crate::model::GroupFindingsRequest::filter].
18303 ///
18304 /// # Example
18305 /// ```ignore,no_run
18306 /// # use google_cloud_securitycenter_v2::model::GroupFindingsRequest;
18307 /// let x = GroupFindingsRequest::new().set_filter("example");
18308 /// ```
18309 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18310 self.filter = v.into();
18311 self
18312 }
18313
18314 /// Sets the value of [group_by][crate::model::GroupFindingsRequest::group_by].
18315 ///
18316 /// # Example
18317 /// ```ignore,no_run
18318 /// # use google_cloud_securitycenter_v2::model::GroupFindingsRequest;
18319 /// let x = GroupFindingsRequest::new().set_group_by("example");
18320 /// ```
18321 pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18322 self.group_by = v.into();
18323 self
18324 }
18325
18326 /// Sets the value of [page_token][crate::model::GroupFindingsRequest::page_token].
18327 ///
18328 /// # Example
18329 /// ```ignore,no_run
18330 /// # use google_cloud_securitycenter_v2::model::GroupFindingsRequest;
18331 /// let x = GroupFindingsRequest::new().set_page_token("example");
18332 /// ```
18333 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18334 self.page_token = v.into();
18335 self
18336 }
18337
18338 /// Sets the value of [page_size][crate::model::GroupFindingsRequest::page_size].
18339 ///
18340 /// # Example
18341 /// ```ignore,no_run
18342 /// # use google_cloud_securitycenter_v2::model::GroupFindingsRequest;
18343 /// let x = GroupFindingsRequest::new().set_page_size(42);
18344 /// ```
18345 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18346 self.page_size = v.into();
18347 self
18348 }
18349}
18350
18351impl wkt::message::Message for GroupFindingsRequest {
18352 fn typename() -> &'static str {
18353 "type.googleapis.com/google.cloud.securitycenter.v2.GroupFindingsRequest"
18354 }
18355}
18356
18357/// Response message for group by findings.
18358#[derive(Clone, Default, PartialEq)]
18359#[non_exhaustive]
18360pub struct GroupFindingsResponse {
18361 /// Group results. There exists an element for each existing unique
18362 /// combination of property/values. The element contains a count for the number
18363 /// of times those specific property/values appear.
18364 pub group_by_results: std::vec::Vec<crate::model::GroupResult>,
18365
18366 /// Token to retrieve the next page of results, or empty if there are no more
18367 /// results.
18368 pub next_page_token: std::string::String,
18369
18370 /// The total number of results matching the query.
18371 pub total_size: i32,
18372
18373 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18374}
18375
18376impl GroupFindingsResponse {
18377 /// Creates a new default instance.
18378 pub fn new() -> Self {
18379 std::default::Default::default()
18380 }
18381
18382 /// Sets the value of [group_by_results][crate::model::GroupFindingsResponse::group_by_results].
18383 ///
18384 /// # Example
18385 /// ```ignore,no_run
18386 /// # use google_cloud_securitycenter_v2::model::GroupFindingsResponse;
18387 /// use google_cloud_securitycenter_v2::model::GroupResult;
18388 /// let x = GroupFindingsResponse::new()
18389 /// .set_group_by_results([
18390 /// GroupResult::default()/* use setters */,
18391 /// GroupResult::default()/* use (different) setters */,
18392 /// ]);
18393 /// ```
18394 pub fn set_group_by_results<T, V>(mut self, v: T) -> Self
18395 where
18396 T: std::iter::IntoIterator<Item = V>,
18397 V: std::convert::Into<crate::model::GroupResult>,
18398 {
18399 use std::iter::Iterator;
18400 self.group_by_results = v.into_iter().map(|i| i.into()).collect();
18401 self
18402 }
18403
18404 /// Sets the value of [next_page_token][crate::model::GroupFindingsResponse::next_page_token].
18405 ///
18406 /// # Example
18407 /// ```ignore,no_run
18408 /// # use google_cloud_securitycenter_v2::model::GroupFindingsResponse;
18409 /// let x = GroupFindingsResponse::new().set_next_page_token("example");
18410 /// ```
18411 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18412 self.next_page_token = v.into();
18413 self
18414 }
18415
18416 /// Sets the value of [total_size][crate::model::GroupFindingsResponse::total_size].
18417 ///
18418 /// # Example
18419 /// ```ignore,no_run
18420 /// # use google_cloud_securitycenter_v2::model::GroupFindingsResponse;
18421 /// let x = GroupFindingsResponse::new().set_total_size(42);
18422 /// ```
18423 pub fn set_total_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18424 self.total_size = v.into();
18425 self
18426 }
18427}
18428
18429impl wkt::message::Message for GroupFindingsResponse {
18430 fn typename() -> &'static str {
18431 "type.googleapis.com/google.cloud.securitycenter.v2.GroupFindingsResponse"
18432 }
18433}
18434
18435#[doc(hidden)]
18436impl google_cloud_gax::paginator::internal::PageableResponse for GroupFindingsResponse {
18437 type PageItem = crate::model::GroupResult;
18438
18439 fn items(self) -> std::vec::Vec<Self::PageItem> {
18440 self.group_by_results
18441 }
18442
18443 fn next_page_token(&self) -> std::string::String {
18444 use std::clone::Clone;
18445 self.next_page_token.clone()
18446 }
18447}
18448
18449/// Result containing the properties and count of a groupBy request.
18450#[derive(Clone, Default, PartialEq)]
18451#[non_exhaustive]
18452pub struct GroupResult {
18453 /// Properties matching the groupBy fields in the request.
18454 pub properties: std::collections::HashMap<std::string::String, wkt::Value>,
18455
18456 /// Total count of resources for the given properties.
18457 pub count: i64,
18458
18459 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18460}
18461
18462impl GroupResult {
18463 /// Creates a new default instance.
18464 pub fn new() -> Self {
18465 std::default::Default::default()
18466 }
18467
18468 /// Sets the value of [properties][crate::model::GroupResult::properties].
18469 ///
18470 /// # Example
18471 /// ```ignore,no_run
18472 /// # use google_cloud_securitycenter_v2::model::GroupResult;
18473 /// use wkt::Value;
18474 /// let x = GroupResult::new().set_properties([
18475 /// ("key0", Value::default()/* use setters */),
18476 /// ("key1", Value::default()/* use (different) setters */),
18477 /// ]);
18478 /// ```
18479 pub fn set_properties<T, K, V>(mut self, v: T) -> Self
18480 where
18481 T: std::iter::IntoIterator<Item = (K, V)>,
18482 K: std::convert::Into<std::string::String>,
18483 V: std::convert::Into<wkt::Value>,
18484 {
18485 use std::iter::Iterator;
18486 self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
18487 self
18488 }
18489
18490 /// Sets the value of [count][crate::model::GroupResult::count].
18491 ///
18492 /// # Example
18493 /// ```ignore,no_run
18494 /// # use google_cloud_securitycenter_v2::model::GroupResult;
18495 /// let x = GroupResult::new().set_count(42);
18496 /// ```
18497 pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
18498 self.count = v.into();
18499 self
18500 }
18501}
18502
18503impl wkt::message::Message for GroupResult {
18504 fn typename() -> &'static str {
18505 "type.googleapis.com/google.cloud.securitycenter.v2.GroupResult"
18506 }
18507}
18508
18509/// Request message for listing the attack paths for a given simulation or valued
18510/// resource.
18511#[derive(Clone, Default, PartialEq)]
18512#[non_exhaustive]
18513pub struct ListAttackPathsRequest {
18514 /// Required. Name of parent to list attack paths.
18515 ///
18516 /// Valid formats:
18517 /// `organizations/{organization}`,
18518 /// `organizations/{organization}/simulations/{simulation}`
18519 /// `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}`
18520 /// `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}`
18521 pub parent: std::string::String,
18522
18523 /// The filter expression that filters the attack path in the response.
18524 /// Supported fields:
18525 ///
18526 /// * `valued_resources` supports =
18527 pub filter: std::string::String,
18528
18529 /// The value returned by the last `ListAttackPathsResponse`; indicates
18530 /// that this is a continuation of a prior `ListAttackPaths` call, and
18531 /// that the system should return the next page of data.
18532 pub page_token: std::string::String,
18533
18534 /// The maximum number of results to return in a single response. Default is
18535 /// 10, minimum is 1, maximum is 1000.
18536 pub page_size: i32,
18537
18538 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18539}
18540
18541impl ListAttackPathsRequest {
18542 /// Creates a new default instance.
18543 pub fn new() -> Self {
18544 std::default::Default::default()
18545 }
18546
18547 /// Sets the value of [parent][crate::model::ListAttackPathsRequest::parent].
18548 ///
18549 /// # Example
18550 /// ```ignore,no_run
18551 /// # use google_cloud_securitycenter_v2::model::ListAttackPathsRequest;
18552 /// let x = ListAttackPathsRequest::new().set_parent("example");
18553 /// ```
18554 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18555 self.parent = v.into();
18556 self
18557 }
18558
18559 /// Sets the value of [filter][crate::model::ListAttackPathsRequest::filter].
18560 ///
18561 /// # Example
18562 /// ```ignore,no_run
18563 /// # use google_cloud_securitycenter_v2::model::ListAttackPathsRequest;
18564 /// let x = ListAttackPathsRequest::new().set_filter("example");
18565 /// ```
18566 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18567 self.filter = v.into();
18568 self
18569 }
18570
18571 /// Sets the value of [page_token][crate::model::ListAttackPathsRequest::page_token].
18572 ///
18573 /// # Example
18574 /// ```ignore,no_run
18575 /// # use google_cloud_securitycenter_v2::model::ListAttackPathsRequest;
18576 /// let x = ListAttackPathsRequest::new().set_page_token("example");
18577 /// ```
18578 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18579 self.page_token = v.into();
18580 self
18581 }
18582
18583 /// Sets the value of [page_size][crate::model::ListAttackPathsRequest::page_size].
18584 ///
18585 /// # Example
18586 /// ```ignore,no_run
18587 /// # use google_cloud_securitycenter_v2::model::ListAttackPathsRequest;
18588 /// let x = ListAttackPathsRequest::new().set_page_size(42);
18589 /// ```
18590 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18591 self.page_size = v.into();
18592 self
18593 }
18594}
18595
18596impl wkt::message::Message for ListAttackPathsRequest {
18597 fn typename() -> &'static str {
18598 "type.googleapis.com/google.cloud.securitycenter.v2.ListAttackPathsRequest"
18599 }
18600}
18601
18602/// Response message for listing the attack paths for a given simulation or
18603/// valued resource.
18604#[derive(Clone, Default, PartialEq)]
18605#[non_exhaustive]
18606pub struct ListAttackPathsResponse {
18607 /// The attack paths that the attack path simulation identified.
18608 pub attack_paths: std::vec::Vec<crate::model::AttackPath>,
18609
18610 /// Token to retrieve the next page of results, or empty if there are no more
18611 /// results.
18612 pub next_page_token: std::string::String,
18613
18614 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18615}
18616
18617impl ListAttackPathsResponse {
18618 /// Creates a new default instance.
18619 pub fn new() -> Self {
18620 std::default::Default::default()
18621 }
18622
18623 /// Sets the value of [attack_paths][crate::model::ListAttackPathsResponse::attack_paths].
18624 ///
18625 /// # Example
18626 /// ```ignore,no_run
18627 /// # use google_cloud_securitycenter_v2::model::ListAttackPathsResponse;
18628 /// use google_cloud_securitycenter_v2::model::AttackPath;
18629 /// let x = ListAttackPathsResponse::new()
18630 /// .set_attack_paths([
18631 /// AttackPath::default()/* use setters */,
18632 /// AttackPath::default()/* use (different) setters */,
18633 /// ]);
18634 /// ```
18635 pub fn set_attack_paths<T, V>(mut self, v: T) -> Self
18636 where
18637 T: std::iter::IntoIterator<Item = V>,
18638 V: std::convert::Into<crate::model::AttackPath>,
18639 {
18640 use std::iter::Iterator;
18641 self.attack_paths = v.into_iter().map(|i| i.into()).collect();
18642 self
18643 }
18644
18645 /// Sets the value of [next_page_token][crate::model::ListAttackPathsResponse::next_page_token].
18646 ///
18647 /// # Example
18648 /// ```ignore,no_run
18649 /// # use google_cloud_securitycenter_v2::model::ListAttackPathsResponse;
18650 /// let x = ListAttackPathsResponse::new().set_next_page_token("example");
18651 /// ```
18652 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18653 self.next_page_token = v.into();
18654 self
18655 }
18656}
18657
18658impl wkt::message::Message for ListAttackPathsResponse {
18659 fn typename() -> &'static str {
18660 "type.googleapis.com/google.cloud.securitycenter.v2.ListAttackPathsResponse"
18661 }
18662}
18663
18664#[doc(hidden)]
18665impl google_cloud_gax::paginator::internal::PageableResponse for ListAttackPathsResponse {
18666 type PageItem = crate::model::AttackPath;
18667
18668 fn items(self) -> std::vec::Vec<Self::PageItem> {
18669 self.attack_paths
18670 }
18671
18672 fn next_page_token(&self) -> std::string::String {
18673 use std::clone::Clone;
18674 self.next_page_token.clone()
18675 }
18676}
18677
18678/// Request message for getting simulation.
18679/// Simulation name can include "latest" to retrieve the latest simulation
18680/// For example, "organizations/123/simulations/latest"
18681#[derive(Clone, Default, PartialEq)]
18682#[non_exhaustive]
18683pub struct GetSimulationRequest {
18684 /// Required. The organization name or simulation name of this simulation
18685 ///
18686 /// Valid format:
18687 /// `organizations/{organization}/simulations/latest`
18688 /// `organizations/{organization}/simulations/{simulation}`
18689 pub name: std::string::String,
18690
18691 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18692}
18693
18694impl GetSimulationRequest {
18695 /// Creates a new default instance.
18696 pub fn new() -> Self {
18697 std::default::Default::default()
18698 }
18699
18700 /// Sets the value of [name][crate::model::GetSimulationRequest::name].
18701 ///
18702 /// # Example
18703 /// ```ignore,no_run
18704 /// # use google_cloud_securitycenter_v2::model::GetSimulationRequest;
18705 /// let x = GetSimulationRequest::new().set_name("example");
18706 /// ```
18707 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18708 self.name = v.into();
18709 self
18710 }
18711}
18712
18713impl wkt::message::Message for GetSimulationRequest {
18714 fn typename() -> &'static str {
18715 "type.googleapis.com/google.cloud.securitycenter.v2.GetSimulationRequest"
18716 }
18717}
18718
18719/// Request message for getting a valued resource.
18720#[derive(Clone, Default, PartialEq)]
18721#[non_exhaustive]
18722pub struct GetValuedResourceRequest {
18723 /// Required. The name of this valued resource
18724 ///
18725 /// Valid format:
18726 /// `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}`
18727 pub name: std::string::String,
18728
18729 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18730}
18731
18732impl GetValuedResourceRequest {
18733 /// Creates a new default instance.
18734 pub fn new() -> Self {
18735 std::default::Default::default()
18736 }
18737
18738 /// Sets the value of [name][crate::model::GetValuedResourceRequest::name].
18739 ///
18740 /// # Example
18741 /// ```ignore,no_run
18742 /// # use google_cloud_securitycenter_v2::model::GetValuedResourceRequest;
18743 /// let x = GetValuedResourceRequest::new().set_name("example");
18744 /// ```
18745 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18746 self.name = v.into();
18747 self
18748 }
18749}
18750
18751impl wkt::message::Message for GetValuedResourceRequest {
18752 fn typename() -> &'static str {
18753 "type.googleapis.com/google.cloud.securitycenter.v2.GetValuedResourceRequest"
18754 }
18755}
18756
18757/// Request message for listing BigQuery exports at a given scope e.g.
18758/// organization, folder or project.
18759#[derive(Clone, Default, PartialEq)]
18760#[non_exhaustive]
18761pub struct ListBigQueryExportsRequest {
18762 /// Required. The parent, which owns the collection of BigQuery exports. Its
18763 /// format is `organizations/[organization_id]/locations/[location_id]`,
18764 /// `folders/[folder_id]/locations/[location_id]`, or
18765 /// `projects/[project_id]/locations/[location_id]`.
18766 pub parent: std::string::String,
18767
18768 /// The maximum number of configs to return. The service may return fewer than
18769 /// this value.
18770 /// If unspecified, at most 10 configs will be returned.
18771 /// The maximum value is 1000; values above 1000 will be coerced to 1000.
18772 pub page_size: i32,
18773
18774 /// A page token, received from a previous `ListBigQueryExports` call.
18775 /// Provide this to retrieve the subsequent page.
18776 /// When paginating, all other parameters provided to `ListBigQueryExports`
18777 /// must match the call that provided the page token.
18778 pub page_token: std::string::String,
18779
18780 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18781}
18782
18783impl ListBigQueryExportsRequest {
18784 /// Creates a new default instance.
18785 pub fn new() -> Self {
18786 std::default::Default::default()
18787 }
18788
18789 /// Sets the value of [parent][crate::model::ListBigQueryExportsRequest::parent].
18790 ///
18791 /// # Example
18792 /// ```ignore,no_run
18793 /// # use google_cloud_securitycenter_v2::model::ListBigQueryExportsRequest;
18794 /// let x = ListBigQueryExportsRequest::new().set_parent("example");
18795 /// ```
18796 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18797 self.parent = v.into();
18798 self
18799 }
18800
18801 /// Sets the value of [page_size][crate::model::ListBigQueryExportsRequest::page_size].
18802 ///
18803 /// # Example
18804 /// ```ignore,no_run
18805 /// # use google_cloud_securitycenter_v2::model::ListBigQueryExportsRequest;
18806 /// let x = ListBigQueryExportsRequest::new().set_page_size(42);
18807 /// ```
18808 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
18809 self.page_size = v.into();
18810 self
18811 }
18812
18813 /// Sets the value of [page_token][crate::model::ListBigQueryExportsRequest::page_token].
18814 ///
18815 /// # Example
18816 /// ```ignore,no_run
18817 /// # use google_cloud_securitycenter_v2::model::ListBigQueryExportsRequest;
18818 /// let x = ListBigQueryExportsRequest::new().set_page_token("example");
18819 /// ```
18820 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18821 self.page_token = v.into();
18822 self
18823 }
18824}
18825
18826impl wkt::message::Message for ListBigQueryExportsRequest {
18827 fn typename() -> &'static str {
18828 "type.googleapis.com/google.cloud.securitycenter.v2.ListBigQueryExportsRequest"
18829 }
18830}
18831
18832/// Response message for listing BigQuery exports.
18833#[derive(Clone, Default, PartialEq)]
18834#[non_exhaustive]
18835pub struct ListBigQueryExportsResponse {
18836 /// The BigQuery exports from the specified parent.
18837 pub big_query_exports: std::vec::Vec<crate::model::BigQueryExport>,
18838
18839 /// A token, which can be sent as `page_token` to retrieve the next page.
18840 /// If this field is omitted, there are no subsequent pages.
18841 pub next_page_token: std::string::String,
18842
18843 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18844}
18845
18846impl ListBigQueryExportsResponse {
18847 /// Creates a new default instance.
18848 pub fn new() -> Self {
18849 std::default::Default::default()
18850 }
18851
18852 /// Sets the value of [big_query_exports][crate::model::ListBigQueryExportsResponse::big_query_exports].
18853 ///
18854 /// # Example
18855 /// ```ignore,no_run
18856 /// # use google_cloud_securitycenter_v2::model::ListBigQueryExportsResponse;
18857 /// use google_cloud_securitycenter_v2::model::BigQueryExport;
18858 /// let x = ListBigQueryExportsResponse::new()
18859 /// .set_big_query_exports([
18860 /// BigQueryExport::default()/* use setters */,
18861 /// BigQueryExport::default()/* use (different) setters */,
18862 /// ]);
18863 /// ```
18864 pub fn set_big_query_exports<T, V>(mut self, v: T) -> Self
18865 where
18866 T: std::iter::IntoIterator<Item = V>,
18867 V: std::convert::Into<crate::model::BigQueryExport>,
18868 {
18869 use std::iter::Iterator;
18870 self.big_query_exports = v.into_iter().map(|i| i.into()).collect();
18871 self
18872 }
18873
18874 /// Sets the value of [next_page_token][crate::model::ListBigQueryExportsResponse::next_page_token].
18875 ///
18876 /// # Example
18877 /// ```ignore,no_run
18878 /// # use google_cloud_securitycenter_v2::model::ListBigQueryExportsResponse;
18879 /// let x = ListBigQueryExportsResponse::new().set_next_page_token("example");
18880 /// ```
18881 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18882 self.next_page_token = v.into();
18883 self
18884 }
18885}
18886
18887impl wkt::message::Message for ListBigQueryExportsResponse {
18888 fn typename() -> &'static str {
18889 "type.googleapis.com/google.cloud.securitycenter.v2.ListBigQueryExportsResponse"
18890 }
18891}
18892
18893#[doc(hidden)]
18894impl google_cloud_gax::paginator::internal::PageableResponse for ListBigQueryExportsResponse {
18895 type PageItem = crate::model::BigQueryExport;
18896
18897 fn items(self) -> std::vec::Vec<Self::PageItem> {
18898 self.big_query_exports
18899 }
18900
18901 fn next_page_token(&self) -> std::string::String {
18902 use std::clone::Clone;
18903 self.next_page_token.clone()
18904 }
18905}
18906
18907/// Request message for listing findings.
18908#[derive(Clone, Default, PartialEq)]
18909#[non_exhaustive]
18910pub struct ListFindingsRequest {
18911 /// Required. Name of the source the findings belong to. If no location is
18912 /// specified, the default is global. The following list shows some examples:
18913 ///
18914 /// + `organizations/[organization_id]/sources/[source_id]`
18915 ///
18916 /// `organizations/[organization_id]/sources/[source_id]/locations/[location_id]`
18917 ///
18918 /// + `folders/[folder_id]/sources/[source_id]`
18919 /// + `folders/[folder_id]/sources/[source_id]/locations/[location_id]`
18920 /// + `projects/[project_id]/sources/[source_id]`
18921 /// + `projects/[project_id]/sources/[source_id]/locations/[location_id]`
18922 ///
18923 /// To list across all sources provide a source_id of `-`. The following
18924 /// list shows some examples:
18925 ///
18926 /// + `organizations/{organization_id}/sources/-`
18927 /// + `organizations/{organization_id}/sources/-/locations/{location_id}`
18928 /// + `folders/{folder_id}/sources/-`
18929 /// + `folders/{folder_id}/sources/-locations/{location_id}`
18930 /// + `projects/{projects_id}/sources/-`
18931 /// + `projects/{projects_id}/sources/-/locations/{location_id}`
18932 pub parent: std::string::String,
18933
18934 /// Expression that defines the filter to apply across findings.
18935 /// The expression is a list of one or more restrictions combined via logical
18936 /// operators `AND` and `OR`.
18937 /// Parentheses are supported, and `OR` has higher precedence than `AND`.
18938 ///
18939 /// Restrictions have the form `<field> <operator> <value>` and may have a `-`
18940 /// character in front of them to indicate negation. Examples include:
18941 ///
18942 /// * name
18943 /// * security_marks.marks.marka
18944 ///
18945 /// The supported operators are:
18946 ///
18947 /// * `=` for all value types.
18948 /// * `>`, `<`, `>=`, `<=` for integer values.
18949 /// * `:`, meaning substring matching, for strings.
18950 ///
18951 /// The supported value types are:
18952 ///
18953 /// * string literals in quotes.
18954 /// * integer literals without quotes.
18955 /// * boolean literals `true` and `false` without quotes.
18956 ///
18957 /// The following field and operator combinations are supported:
18958 ///
18959 /// * name: `=`
18960 ///
18961 /// * parent: `=`, `:`
18962 ///
18963 /// * resource_name: `=`, `:`
18964 ///
18965 /// * state: `=`, `:`
18966 ///
18967 /// * category: `=`, `:`
18968 ///
18969 /// * external_uri: `=`, `:`
18970 ///
18971 /// * event_time: `=`, `>`, `<`, `>=`, `<=`
18972 ///
18973 /// Usage: This should be milliseconds since epoch or an RFC3339 string.
18974 /// Examples:
18975 /// `event_time = "2019-06-10T16:07:18-07:00"`
18976 /// `event_time = 1560208038000`
18977 ///
18978 /// * severity: `=`, `:`
18979 ///
18980 /// * security_marks.marks: `=`, `:`
18981 ///
18982 /// * resource:
18983 ///
18984 /// * resource.name: `=`, `:`
18985 /// * resource.parent_name: `=`, `:`
18986 /// * resource.parent_display_name: `=`, `:`
18987 /// * resource.project_name: `=`, `:`
18988 /// * resource.project_display_name: `=`, `:`
18989 /// * resource.type: `=`, `:`
18990 /// * resource.folders.resource_folder: `=`, `:`
18991 /// * resource.display_name: `=`, `:`
18992 pub filter: std::string::String,
18993
18994 /// Expression that defines what fields and order to use for sorting. The
18995 /// string value should follow SQL syntax: comma separated list of fields. For
18996 /// example: "name,parent". The default sorting order
18997 /// is ascending. To specify descending order for a field, a suffix " desc"
18998 /// should be appended to the field name. For example: "name
18999 /// desc,parent". Redundant space characters in the
19000 /// syntax are insignificant. "name desc,parent" and "
19001 /// name desc , parent " are equivalent.
19002 ///
19003 /// The following fields are supported:
19004 /// name
19005 /// parent
19006 /// state
19007 /// category
19008 /// resource_name
19009 /// event_time
19010 /// security_marks.marks
19011 pub order_by: std::string::String,
19012
19013 /// A field mask to specify the Finding fields to be listed in the response.
19014 /// An empty field mask will list all fields.
19015 pub field_mask: std::option::Option<wkt::FieldMask>,
19016
19017 /// The value returned by the last `ListFindingsResponse`; indicates
19018 /// that this is a continuation of a prior `ListFindings` call, and
19019 /// that the system should return the next page of data.
19020 pub page_token: std::string::String,
19021
19022 /// The maximum number of results to return in a single response. Default is
19023 /// 10, minimum is 1, maximum is 1000.
19024 pub page_size: i32,
19025
19026 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19027}
19028
19029impl ListFindingsRequest {
19030 /// Creates a new default instance.
19031 pub fn new() -> Self {
19032 std::default::Default::default()
19033 }
19034
19035 /// Sets the value of [parent][crate::model::ListFindingsRequest::parent].
19036 ///
19037 /// # Example
19038 /// ```ignore,no_run
19039 /// # use google_cloud_securitycenter_v2::model::ListFindingsRequest;
19040 /// let x = ListFindingsRequest::new().set_parent("example");
19041 /// ```
19042 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19043 self.parent = v.into();
19044 self
19045 }
19046
19047 /// Sets the value of [filter][crate::model::ListFindingsRequest::filter].
19048 ///
19049 /// # Example
19050 /// ```ignore,no_run
19051 /// # use google_cloud_securitycenter_v2::model::ListFindingsRequest;
19052 /// let x = ListFindingsRequest::new().set_filter("example");
19053 /// ```
19054 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19055 self.filter = v.into();
19056 self
19057 }
19058
19059 /// Sets the value of [order_by][crate::model::ListFindingsRequest::order_by].
19060 ///
19061 /// # Example
19062 /// ```ignore,no_run
19063 /// # use google_cloud_securitycenter_v2::model::ListFindingsRequest;
19064 /// let x = ListFindingsRequest::new().set_order_by("example");
19065 /// ```
19066 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19067 self.order_by = v.into();
19068 self
19069 }
19070
19071 /// Sets the value of [field_mask][crate::model::ListFindingsRequest::field_mask].
19072 ///
19073 /// # Example
19074 /// ```ignore,no_run
19075 /// # use google_cloud_securitycenter_v2::model::ListFindingsRequest;
19076 /// use wkt::FieldMask;
19077 /// let x = ListFindingsRequest::new().set_field_mask(FieldMask::default()/* use setters */);
19078 /// ```
19079 pub fn set_field_mask<T>(mut self, v: T) -> Self
19080 where
19081 T: std::convert::Into<wkt::FieldMask>,
19082 {
19083 self.field_mask = std::option::Option::Some(v.into());
19084 self
19085 }
19086
19087 /// Sets or clears the value of [field_mask][crate::model::ListFindingsRequest::field_mask].
19088 ///
19089 /// # Example
19090 /// ```ignore,no_run
19091 /// # use google_cloud_securitycenter_v2::model::ListFindingsRequest;
19092 /// use wkt::FieldMask;
19093 /// let x = ListFindingsRequest::new().set_or_clear_field_mask(Some(FieldMask::default()/* use setters */));
19094 /// let x = ListFindingsRequest::new().set_or_clear_field_mask(None::<FieldMask>);
19095 /// ```
19096 pub fn set_or_clear_field_mask<T>(mut self, v: std::option::Option<T>) -> Self
19097 where
19098 T: std::convert::Into<wkt::FieldMask>,
19099 {
19100 self.field_mask = v.map(|x| x.into());
19101 self
19102 }
19103
19104 /// Sets the value of [page_token][crate::model::ListFindingsRequest::page_token].
19105 ///
19106 /// # Example
19107 /// ```ignore,no_run
19108 /// # use google_cloud_securitycenter_v2::model::ListFindingsRequest;
19109 /// let x = ListFindingsRequest::new().set_page_token("example");
19110 /// ```
19111 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19112 self.page_token = v.into();
19113 self
19114 }
19115
19116 /// Sets the value of [page_size][crate::model::ListFindingsRequest::page_size].
19117 ///
19118 /// # Example
19119 /// ```ignore,no_run
19120 /// # use google_cloud_securitycenter_v2::model::ListFindingsRequest;
19121 /// let x = ListFindingsRequest::new().set_page_size(42);
19122 /// ```
19123 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19124 self.page_size = v.into();
19125 self
19126 }
19127}
19128
19129impl wkt::message::Message for ListFindingsRequest {
19130 fn typename() -> &'static str {
19131 "type.googleapis.com/google.cloud.securitycenter.v2.ListFindingsRequest"
19132 }
19133}
19134
19135/// Response message for listing findings.
19136#[derive(Clone, Default, PartialEq)]
19137#[non_exhaustive]
19138pub struct ListFindingsResponse {
19139 /// Findings matching the list request.
19140 pub list_findings_results:
19141 std::vec::Vec<crate::model::list_findings_response::ListFindingsResult>,
19142
19143 /// Token to retrieve the next page of results, or empty if there are no more
19144 /// results.
19145 pub next_page_token: std::string::String,
19146
19147 /// The total number of findings matching the query.
19148 pub total_size: i32,
19149
19150 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19151}
19152
19153impl ListFindingsResponse {
19154 /// Creates a new default instance.
19155 pub fn new() -> Self {
19156 std::default::Default::default()
19157 }
19158
19159 /// Sets the value of [list_findings_results][crate::model::ListFindingsResponse::list_findings_results].
19160 ///
19161 /// # Example
19162 /// ```ignore,no_run
19163 /// # use google_cloud_securitycenter_v2::model::ListFindingsResponse;
19164 /// use google_cloud_securitycenter_v2::model::list_findings_response::ListFindingsResult;
19165 /// let x = ListFindingsResponse::new()
19166 /// .set_list_findings_results([
19167 /// ListFindingsResult::default()/* use setters */,
19168 /// ListFindingsResult::default()/* use (different) setters */,
19169 /// ]);
19170 /// ```
19171 pub fn set_list_findings_results<T, V>(mut self, v: T) -> Self
19172 where
19173 T: std::iter::IntoIterator<Item = V>,
19174 V: std::convert::Into<crate::model::list_findings_response::ListFindingsResult>,
19175 {
19176 use std::iter::Iterator;
19177 self.list_findings_results = v.into_iter().map(|i| i.into()).collect();
19178 self
19179 }
19180
19181 /// Sets the value of [next_page_token][crate::model::ListFindingsResponse::next_page_token].
19182 ///
19183 /// # Example
19184 /// ```ignore,no_run
19185 /// # use google_cloud_securitycenter_v2::model::ListFindingsResponse;
19186 /// let x = ListFindingsResponse::new().set_next_page_token("example");
19187 /// ```
19188 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19189 self.next_page_token = v.into();
19190 self
19191 }
19192
19193 /// Sets the value of [total_size][crate::model::ListFindingsResponse::total_size].
19194 ///
19195 /// # Example
19196 /// ```ignore,no_run
19197 /// # use google_cloud_securitycenter_v2::model::ListFindingsResponse;
19198 /// let x = ListFindingsResponse::new().set_total_size(42);
19199 /// ```
19200 pub fn set_total_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19201 self.total_size = v.into();
19202 self
19203 }
19204}
19205
19206impl wkt::message::Message for ListFindingsResponse {
19207 fn typename() -> &'static str {
19208 "type.googleapis.com/google.cloud.securitycenter.v2.ListFindingsResponse"
19209 }
19210}
19211
19212#[doc(hidden)]
19213impl google_cloud_gax::paginator::internal::PageableResponse for ListFindingsResponse {
19214 type PageItem = crate::model::list_findings_response::ListFindingsResult;
19215
19216 fn items(self) -> std::vec::Vec<Self::PageItem> {
19217 self.list_findings_results
19218 }
19219
19220 fn next_page_token(&self) -> std::string::String {
19221 use std::clone::Clone;
19222 self.next_page_token.clone()
19223 }
19224}
19225
19226/// Defines additional types related to [ListFindingsResponse].
19227pub mod list_findings_response {
19228 #[allow(unused_imports)]
19229 use super::*;
19230
19231 /// Result containing the Finding.
19232 #[derive(Clone, Default, PartialEq)]
19233 #[non_exhaustive]
19234 pub struct ListFindingsResult {
19235 /// Finding matching the search request.
19236 pub finding: std::option::Option<crate::model::Finding>,
19237
19238 /// Output only. Resource that is associated with this finding.
19239 pub resource: std::option::Option<
19240 crate::model::list_findings_response::list_findings_result::Resource,
19241 >,
19242
19243 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19244 }
19245
19246 impl ListFindingsResult {
19247 /// Creates a new default instance.
19248 pub fn new() -> Self {
19249 std::default::Default::default()
19250 }
19251
19252 /// Sets the value of [finding][crate::model::list_findings_response::ListFindingsResult::finding].
19253 ///
19254 /// # Example
19255 /// ```ignore,no_run
19256 /// # use google_cloud_securitycenter_v2::model::list_findings_response::ListFindingsResult;
19257 /// use google_cloud_securitycenter_v2::model::Finding;
19258 /// let x = ListFindingsResult::new().set_finding(Finding::default()/* use setters */);
19259 /// ```
19260 pub fn set_finding<T>(mut self, v: T) -> Self
19261 where
19262 T: std::convert::Into<crate::model::Finding>,
19263 {
19264 self.finding = std::option::Option::Some(v.into());
19265 self
19266 }
19267
19268 /// Sets or clears the value of [finding][crate::model::list_findings_response::ListFindingsResult::finding].
19269 ///
19270 /// # Example
19271 /// ```ignore,no_run
19272 /// # use google_cloud_securitycenter_v2::model::list_findings_response::ListFindingsResult;
19273 /// use google_cloud_securitycenter_v2::model::Finding;
19274 /// let x = ListFindingsResult::new().set_or_clear_finding(Some(Finding::default()/* use setters */));
19275 /// let x = ListFindingsResult::new().set_or_clear_finding(None::<Finding>);
19276 /// ```
19277 pub fn set_or_clear_finding<T>(mut self, v: std::option::Option<T>) -> Self
19278 where
19279 T: std::convert::Into<crate::model::Finding>,
19280 {
19281 self.finding = v.map(|x| x.into());
19282 self
19283 }
19284
19285 /// Sets the value of [resource][crate::model::list_findings_response::ListFindingsResult::resource].
19286 ///
19287 /// # Example
19288 /// ```ignore,no_run
19289 /// # use google_cloud_securitycenter_v2::model::list_findings_response::ListFindingsResult;
19290 /// use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19291 /// let x = ListFindingsResult::new().set_resource(Resource::default()/* use setters */);
19292 /// ```
19293 pub fn set_resource<T>(mut self, v: T) -> Self
19294 where
19295 T: std::convert::Into<
19296 crate::model::list_findings_response::list_findings_result::Resource,
19297 >,
19298 {
19299 self.resource = std::option::Option::Some(v.into());
19300 self
19301 }
19302
19303 /// Sets or clears the value of [resource][crate::model::list_findings_response::ListFindingsResult::resource].
19304 ///
19305 /// # Example
19306 /// ```ignore,no_run
19307 /// # use google_cloud_securitycenter_v2::model::list_findings_response::ListFindingsResult;
19308 /// use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19309 /// let x = ListFindingsResult::new().set_or_clear_resource(Some(Resource::default()/* use setters */));
19310 /// let x = ListFindingsResult::new().set_or_clear_resource(None::<Resource>);
19311 /// ```
19312 pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
19313 where
19314 T: std::convert::Into<
19315 crate::model::list_findings_response::list_findings_result::Resource,
19316 >,
19317 {
19318 self.resource = v.map(|x| x.into());
19319 self
19320 }
19321 }
19322
19323 impl wkt::message::Message for ListFindingsResult {
19324 fn typename() -> &'static str {
19325 "type.googleapis.com/google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult"
19326 }
19327 }
19328
19329 /// Defines additional types related to [ListFindingsResult].
19330 pub mod list_findings_result {
19331 #[allow(unused_imports)]
19332 use super::*;
19333
19334 /// Information related to the Google Cloud resource that is
19335 /// associated with this finding.
19336 #[derive(Clone, Default, PartialEq)]
19337 #[non_exhaustive]
19338 pub struct Resource {
19339
19340 /// The full resource name of the resource. See:
19341 /// <https://cloud.google.com/apis/design/resource_names#full_resource_name>
19342 pub name: std::string::String,
19343
19344 /// The human readable name of the resource.
19345 pub display_name: std::string::String,
19346
19347 /// The full resource type of the resource.
19348 pub r#type: std::string::String,
19349
19350 /// Indicates which cloud provider the finding is from.
19351 pub cloud_provider: crate::model::CloudProvider,
19352
19353 /// The service or resource provider associated with the resource.
19354 pub service: std::string::String,
19355
19356 /// The region or location of the service (if applicable).
19357 pub location: std::string::String,
19358
19359 /// Provides the path to the resource within the resource hierarchy.
19360 pub resource_path: std::option::Option<crate::model::ResourcePath>,
19361
19362 /// A string representation of the resource path.
19363 /// For Google Cloud, it has the format of
19364 /// `organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}`
19365 /// where there can be any number of folders.
19366 /// For AWS, it has the format of
19367 /// `org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}`
19368 /// where there can be any number of organizational units.
19369 /// For Azure, it has the format of
19370 /// `mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}`
19371 /// where there can be any number of management groups.
19372 pub resource_path_string: std::string::String,
19373
19374 /// The metadata associated with the cloud provider.
19375 pub cloud_provider_metadata: std::option::Option<crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata>,
19376
19377 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19378 }
19379
19380 impl Resource {
19381 /// Creates a new default instance.
19382 pub fn new() -> Self {
19383 std::default::Default::default()
19384 }
19385
19386 /// Sets the value of [name][crate::model::list_findings_response::list_findings_result::Resource::name].
19387 ///
19388 /// # Example
19389 /// ```ignore,no_run
19390 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19391 /// let x = Resource::new().set_name("example");
19392 /// ```
19393 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19394 self.name = v.into();
19395 self
19396 }
19397
19398 /// Sets the value of [display_name][crate::model::list_findings_response::list_findings_result::Resource::display_name].
19399 ///
19400 /// # Example
19401 /// ```ignore,no_run
19402 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19403 /// let x = Resource::new().set_display_name("example");
19404 /// ```
19405 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
19406 mut self,
19407 v: T,
19408 ) -> Self {
19409 self.display_name = v.into();
19410 self
19411 }
19412
19413 /// Sets the value of [r#type][crate::model::list_findings_response::list_findings_result::Resource::type].
19414 ///
19415 /// # Example
19416 /// ```ignore,no_run
19417 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19418 /// let x = Resource::new().set_type("example");
19419 /// ```
19420 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19421 self.r#type = v.into();
19422 self
19423 }
19424
19425 /// Sets the value of [cloud_provider][crate::model::list_findings_response::list_findings_result::Resource::cloud_provider].
19426 ///
19427 /// # Example
19428 /// ```ignore,no_run
19429 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19430 /// use google_cloud_securitycenter_v2::model::CloudProvider;
19431 /// let x0 = Resource::new().set_cloud_provider(CloudProvider::GoogleCloudPlatform);
19432 /// let x1 = Resource::new().set_cloud_provider(CloudProvider::AmazonWebServices);
19433 /// let x2 = Resource::new().set_cloud_provider(CloudProvider::MicrosoftAzure);
19434 /// ```
19435 pub fn set_cloud_provider<T: std::convert::Into<crate::model::CloudProvider>>(
19436 mut self,
19437 v: T,
19438 ) -> Self {
19439 self.cloud_provider = v.into();
19440 self
19441 }
19442
19443 /// Sets the value of [service][crate::model::list_findings_response::list_findings_result::Resource::service].
19444 ///
19445 /// # Example
19446 /// ```ignore,no_run
19447 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19448 /// let x = Resource::new().set_service("example");
19449 /// ```
19450 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19451 self.service = v.into();
19452 self
19453 }
19454
19455 /// Sets the value of [location][crate::model::list_findings_response::list_findings_result::Resource::location].
19456 ///
19457 /// # Example
19458 /// ```ignore,no_run
19459 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19460 /// let x = Resource::new().set_location("example");
19461 /// ```
19462 pub fn set_location<T: std::convert::Into<std::string::String>>(
19463 mut self,
19464 v: T,
19465 ) -> Self {
19466 self.location = v.into();
19467 self
19468 }
19469
19470 /// Sets the value of [resource_path][crate::model::list_findings_response::list_findings_result::Resource::resource_path].
19471 ///
19472 /// # Example
19473 /// ```ignore,no_run
19474 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19475 /// use google_cloud_securitycenter_v2::model::ResourcePath;
19476 /// let x = Resource::new().set_resource_path(ResourcePath::default()/* use setters */);
19477 /// ```
19478 pub fn set_resource_path<T>(mut self, v: T) -> Self
19479 where
19480 T: std::convert::Into<crate::model::ResourcePath>,
19481 {
19482 self.resource_path = std::option::Option::Some(v.into());
19483 self
19484 }
19485
19486 /// Sets or clears the value of [resource_path][crate::model::list_findings_response::list_findings_result::Resource::resource_path].
19487 ///
19488 /// # Example
19489 /// ```ignore,no_run
19490 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19491 /// use google_cloud_securitycenter_v2::model::ResourcePath;
19492 /// let x = Resource::new().set_or_clear_resource_path(Some(ResourcePath::default()/* use setters */));
19493 /// let x = Resource::new().set_or_clear_resource_path(None::<ResourcePath>);
19494 /// ```
19495 pub fn set_or_clear_resource_path<T>(mut self, v: std::option::Option<T>) -> Self
19496 where
19497 T: std::convert::Into<crate::model::ResourcePath>,
19498 {
19499 self.resource_path = v.map(|x| x.into());
19500 self
19501 }
19502
19503 /// Sets the value of [resource_path_string][crate::model::list_findings_response::list_findings_result::Resource::resource_path_string].
19504 ///
19505 /// # Example
19506 /// ```ignore,no_run
19507 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19508 /// let x = Resource::new().set_resource_path_string("example");
19509 /// ```
19510 pub fn set_resource_path_string<T: std::convert::Into<std::string::String>>(
19511 mut self,
19512 v: T,
19513 ) -> Self {
19514 self.resource_path_string = v.into();
19515 self
19516 }
19517
19518 /// Sets the value of [cloud_provider_metadata][crate::model::list_findings_response::list_findings_result::Resource::cloud_provider_metadata].
19519 ///
19520 /// Note that all the setters affecting `cloud_provider_metadata` are mutually
19521 /// exclusive.
19522 ///
19523 /// # Example
19524 /// ```ignore,no_run
19525 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19526 /// use google_cloud_securitycenter_v2::model::GcpMetadata;
19527 /// let x = Resource::new().set_cloud_provider_metadata(Some(
19528 /// google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::GcpMetadata(GcpMetadata::default().into())));
19529 /// ```
19530 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
19531 {
19532 self.cloud_provider_metadata = v.into();
19533 self
19534 }
19535
19536 /// The value of [cloud_provider_metadata][crate::model::list_findings_response::list_findings_result::Resource::cloud_provider_metadata]
19537 /// if it holds a `GcpMetadata`, `None` if the field is not set or
19538 /// holds a different branch.
19539 pub fn gcp_metadata(
19540 &self,
19541 ) -> std::option::Option<&std::boxed::Box<crate::model::GcpMetadata>> {
19542 #[allow(unreachable_patterns)]
19543 self.cloud_provider_metadata.as_ref().and_then(|v| match v {
19544 crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::GcpMetadata(v) => std::option::Option::Some(v),
19545 _ => std::option::Option::None,
19546 })
19547 }
19548
19549 /// Sets the value of [cloud_provider_metadata][crate::model::list_findings_response::list_findings_result::Resource::cloud_provider_metadata]
19550 /// to hold a `GcpMetadata`.
19551 ///
19552 /// Note that all the setters affecting `cloud_provider_metadata` are
19553 /// mutually exclusive.
19554 ///
19555 /// # Example
19556 /// ```ignore,no_run
19557 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19558 /// use google_cloud_securitycenter_v2::model::GcpMetadata;
19559 /// let x = Resource::new().set_gcp_metadata(GcpMetadata::default()/* use setters */);
19560 /// assert!(x.gcp_metadata().is_some());
19561 /// assert!(x.aws_metadata().is_none());
19562 /// assert!(x.azure_metadata().is_none());
19563 /// ```
19564 pub fn set_gcp_metadata<
19565 T: std::convert::Into<std::boxed::Box<crate::model::GcpMetadata>>,
19566 >(
19567 mut self,
19568 v: T,
19569 ) -> Self {
19570 self.cloud_provider_metadata = std::option::Option::Some(
19571 crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::GcpMetadata(
19572 v.into()
19573 )
19574 );
19575 self
19576 }
19577
19578 /// The value of [cloud_provider_metadata][crate::model::list_findings_response::list_findings_result::Resource::cloud_provider_metadata]
19579 /// if it holds a `AwsMetadata`, `None` if the field is not set or
19580 /// holds a different branch.
19581 pub fn aws_metadata(
19582 &self,
19583 ) -> std::option::Option<&std::boxed::Box<crate::model::AwsMetadata>> {
19584 #[allow(unreachable_patterns)]
19585 self.cloud_provider_metadata.as_ref().and_then(|v| match v {
19586 crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::AwsMetadata(v) => std::option::Option::Some(v),
19587 _ => std::option::Option::None,
19588 })
19589 }
19590
19591 /// Sets the value of [cloud_provider_metadata][crate::model::list_findings_response::list_findings_result::Resource::cloud_provider_metadata]
19592 /// to hold a `AwsMetadata`.
19593 ///
19594 /// Note that all the setters affecting `cloud_provider_metadata` are
19595 /// mutually exclusive.
19596 ///
19597 /// # Example
19598 /// ```ignore,no_run
19599 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19600 /// use google_cloud_securitycenter_v2::model::AwsMetadata;
19601 /// let x = Resource::new().set_aws_metadata(AwsMetadata::default()/* use setters */);
19602 /// assert!(x.aws_metadata().is_some());
19603 /// assert!(x.gcp_metadata().is_none());
19604 /// assert!(x.azure_metadata().is_none());
19605 /// ```
19606 pub fn set_aws_metadata<
19607 T: std::convert::Into<std::boxed::Box<crate::model::AwsMetadata>>,
19608 >(
19609 mut self,
19610 v: T,
19611 ) -> Self {
19612 self.cloud_provider_metadata = std::option::Option::Some(
19613 crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::AwsMetadata(
19614 v.into()
19615 )
19616 );
19617 self
19618 }
19619
19620 /// The value of [cloud_provider_metadata][crate::model::list_findings_response::list_findings_result::Resource::cloud_provider_metadata]
19621 /// if it holds a `AzureMetadata`, `None` if the field is not set or
19622 /// holds a different branch.
19623 pub fn azure_metadata(
19624 &self,
19625 ) -> std::option::Option<&std::boxed::Box<crate::model::AzureMetadata>> {
19626 #[allow(unreachable_patterns)]
19627 self.cloud_provider_metadata.as_ref().and_then(|v| match v {
19628 crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::AzureMetadata(v) => std::option::Option::Some(v),
19629 _ => std::option::Option::None,
19630 })
19631 }
19632
19633 /// Sets the value of [cloud_provider_metadata][crate::model::list_findings_response::list_findings_result::Resource::cloud_provider_metadata]
19634 /// to hold a `AzureMetadata`.
19635 ///
19636 /// Note that all the setters affecting `cloud_provider_metadata` are
19637 /// mutually exclusive.
19638 ///
19639 /// # Example
19640 /// ```ignore,no_run
19641 /// # use google_cloud_securitycenter_v2::model::list_findings_response::list_findings_result::Resource;
19642 /// use google_cloud_securitycenter_v2::model::AzureMetadata;
19643 /// let x = Resource::new().set_azure_metadata(AzureMetadata::default()/* use setters */);
19644 /// assert!(x.azure_metadata().is_some());
19645 /// assert!(x.gcp_metadata().is_none());
19646 /// assert!(x.aws_metadata().is_none());
19647 /// ```
19648 pub fn set_azure_metadata<
19649 T: std::convert::Into<std::boxed::Box<crate::model::AzureMetadata>>,
19650 >(
19651 mut self,
19652 v: T,
19653 ) -> Self {
19654 self.cloud_provider_metadata = std::option::Option::Some(
19655 crate::model::list_findings_response::list_findings_result::resource::CloudProviderMetadata::AzureMetadata(
19656 v.into()
19657 )
19658 );
19659 self
19660 }
19661 }
19662
19663 impl wkt::message::Message for Resource {
19664 fn typename() -> &'static str {
19665 "type.googleapis.com/google.cloud.securitycenter.v2.ListFindingsResponse.ListFindingsResult.Resource"
19666 }
19667 }
19668
19669 /// Defines additional types related to [Resource].
19670 pub mod resource {
19671 #[allow(unused_imports)]
19672 use super::*;
19673
19674 /// The metadata associated with the cloud provider.
19675 #[derive(Clone, Debug, PartialEq)]
19676 #[non_exhaustive]
19677 pub enum CloudProviderMetadata {
19678 /// The GCP metadata associated with the finding.
19679 GcpMetadata(std::boxed::Box<crate::model::GcpMetadata>),
19680 /// The AWS metadata associated with the finding.
19681 AwsMetadata(std::boxed::Box<crate::model::AwsMetadata>),
19682 /// The Azure metadata associated with the finding.
19683 AzureMetadata(std::boxed::Box<crate::model::AzureMetadata>),
19684 }
19685 }
19686 }
19687}
19688
19689/// Request message for listing mute configs at a given scope e.g. organization,
19690/// folder or project. If no location is specified, default is
19691/// global.
19692#[derive(Clone, Default, PartialEq)]
19693#[non_exhaustive]
19694pub struct ListMuteConfigsRequest {
19695 /// Required. The parent, which owns the collection of mute configs. Its format
19696 /// is `organizations/[organization_id]", "folders/[folder_id]`,
19697 /// `projects/[project_id]`,
19698 /// `organizations/[organization_id]/locations/[location_id]`,
19699 /// `folders/[folder_id]/locations/[location_id]`,
19700 /// `projects/[project_id]/locations/[location_id]`.
19701 pub parent: std::string::String,
19702
19703 /// The maximum number of configs to return. The service may return fewer than
19704 /// this value.
19705 /// If unspecified, at most 10 configs will be returned.
19706 /// The maximum value is 1000; values above 1000 will be coerced to 1000.
19707 pub page_size: i32,
19708
19709 /// A page token, received from a previous `ListMuteConfigs` call.
19710 /// Provide this to retrieve the subsequent page.
19711 ///
19712 /// When paginating, all other parameters provided to `ListMuteConfigs` must
19713 /// match the call that provided the page token.
19714 pub page_token: std::string::String,
19715
19716 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19717}
19718
19719impl ListMuteConfigsRequest {
19720 /// Creates a new default instance.
19721 pub fn new() -> Self {
19722 std::default::Default::default()
19723 }
19724
19725 /// Sets the value of [parent][crate::model::ListMuteConfigsRequest::parent].
19726 ///
19727 /// # Example
19728 /// ```ignore,no_run
19729 /// # use google_cloud_securitycenter_v2::model::ListMuteConfigsRequest;
19730 /// let x = ListMuteConfigsRequest::new().set_parent("example");
19731 /// ```
19732 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19733 self.parent = v.into();
19734 self
19735 }
19736
19737 /// Sets the value of [page_size][crate::model::ListMuteConfigsRequest::page_size].
19738 ///
19739 /// # Example
19740 /// ```ignore,no_run
19741 /// # use google_cloud_securitycenter_v2::model::ListMuteConfigsRequest;
19742 /// let x = ListMuteConfigsRequest::new().set_page_size(42);
19743 /// ```
19744 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19745 self.page_size = v.into();
19746 self
19747 }
19748
19749 /// Sets the value of [page_token][crate::model::ListMuteConfigsRequest::page_token].
19750 ///
19751 /// # Example
19752 /// ```ignore,no_run
19753 /// # use google_cloud_securitycenter_v2::model::ListMuteConfigsRequest;
19754 /// let x = ListMuteConfigsRequest::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
19762impl wkt::message::Message for ListMuteConfigsRequest {
19763 fn typename() -> &'static str {
19764 "type.googleapis.com/google.cloud.securitycenter.v2.ListMuteConfigsRequest"
19765 }
19766}
19767
19768/// Response message for listing mute configs.
19769#[derive(Clone, Default, PartialEq)]
19770#[non_exhaustive]
19771pub struct ListMuteConfigsResponse {
19772 /// The mute configs from the specified parent.
19773 pub mute_configs: std::vec::Vec<crate::model::MuteConfig>,
19774
19775 /// A token, which can be sent as `page_token` to retrieve the next page.
19776 /// If this field is omitted, there are no subsequent pages.
19777 pub next_page_token: std::string::String,
19778
19779 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19780}
19781
19782impl ListMuteConfigsResponse {
19783 /// Creates a new default instance.
19784 pub fn new() -> Self {
19785 std::default::Default::default()
19786 }
19787
19788 /// Sets the value of [mute_configs][crate::model::ListMuteConfigsResponse::mute_configs].
19789 ///
19790 /// # Example
19791 /// ```ignore,no_run
19792 /// # use google_cloud_securitycenter_v2::model::ListMuteConfigsResponse;
19793 /// use google_cloud_securitycenter_v2::model::MuteConfig;
19794 /// let x = ListMuteConfigsResponse::new()
19795 /// .set_mute_configs([
19796 /// MuteConfig::default()/* use setters */,
19797 /// MuteConfig::default()/* use (different) setters */,
19798 /// ]);
19799 /// ```
19800 pub fn set_mute_configs<T, V>(mut self, v: T) -> Self
19801 where
19802 T: std::iter::IntoIterator<Item = V>,
19803 V: std::convert::Into<crate::model::MuteConfig>,
19804 {
19805 use std::iter::Iterator;
19806 self.mute_configs = v.into_iter().map(|i| i.into()).collect();
19807 self
19808 }
19809
19810 /// Sets the value of [next_page_token][crate::model::ListMuteConfigsResponse::next_page_token].
19811 ///
19812 /// # Example
19813 /// ```ignore,no_run
19814 /// # use google_cloud_securitycenter_v2::model::ListMuteConfigsResponse;
19815 /// let x = ListMuteConfigsResponse::new().set_next_page_token("example");
19816 /// ```
19817 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19818 self.next_page_token = v.into();
19819 self
19820 }
19821}
19822
19823impl wkt::message::Message for ListMuteConfigsResponse {
19824 fn typename() -> &'static str {
19825 "type.googleapis.com/google.cloud.securitycenter.v2.ListMuteConfigsResponse"
19826 }
19827}
19828
19829#[doc(hidden)]
19830impl google_cloud_gax::paginator::internal::PageableResponse for ListMuteConfigsResponse {
19831 type PageItem = crate::model::MuteConfig;
19832
19833 fn items(self) -> std::vec::Vec<Self::PageItem> {
19834 self.mute_configs
19835 }
19836
19837 fn next_page_token(&self) -> std::string::String {
19838 use std::clone::Clone;
19839 self.next_page_token.clone()
19840 }
19841}
19842
19843/// Request message for listing notification configs.
19844#[derive(Clone, Default, PartialEq)]
19845#[non_exhaustive]
19846pub struct ListNotificationConfigsRequest {
19847 /// Required. The name of the parent in which to list the notification
19848 /// configurations. Its format is
19849 /// "organizations/[organization_id]/locations/[location_id]",
19850 /// "folders/[folder_id]/locations/[location_id]", or
19851 /// "projects/[project_id]/locations/[location_id]".
19852 pub parent: std::string::String,
19853
19854 /// The value returned by the last `ListNotificationConfigsResponse`; indicates
19855 /// that this is a continuation of a prior `ListNotificationConfigs` call, and
19856 /// that the system should return the next page of data.
19857 pub page_token: std::string::String,
19858
19859 /// The maximum number of results to return in a single response. Default is
19860 /// 10, minimum is 1, maximum is 1000.
19861 pub page_size: i32,
19862
19863 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19864}
19865
19866impl ListNotificationConfigsRequest {
19867 /// Creates a new default instance.
19868 pub fn new() -> Self {
19869 std::default::Default::default()
19870 }
19871
19872 /// Sets the value of [parent][crate::model::ListNotificationConfigsRequest::parent].
19873 ///
19874 /// # Example
19875 /// ```ignore,no_run
19876 /// # use google_cloud_securitycenter_v2::model::ListNotificationConfigsRequest;
19877 /// let x = ListNotificationConfigsRequest::new().set_parent("example");
19878 /// ```
19879 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19880 self.parent = v.into();
19881 self
19882 }
19883
19884 /// Sets the value of [page_token][crate::model::ListNotificationConfigsRequest::page_token].
19885 ///
19886 /// # Example
19887 /// ```ignore,no_run
19888 /// # use google_cloud_securitycenter_v2::model::ListNotificationConfigsRequest;
19889 /// let x = ListNotificationConfigsRequest::new().set_page_token("example");
19890 /// ```
19891 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19892 self.page_token = v.into();
19893 self
19894 }
19895
19896 /// Sets the value of [page_size][crate::model::ListNotificationConfigsRequest::page_size].
19897 ///
19898 /// # Example
19899 /// ```ignore,no_run
19900 /// # use google_cloud_securitycenter_v2::model::ListNotificationConfigsRequest;
19901 /// let x = ListNotificationConfigsRequest::new().set_page_size(42);
19902 /// ```
19903 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19904 self.page_size = v.into();
19905 self
19906 }
19907}
19908
19909impl wkt::message::Message for ListNotificationConfigsRequest {
19910 fn typename() -> &'static str {
19911 "type.googleapis.com/google.cloud.securitycenter.v2.ListNotificationConfigsRequest"
19912 }
19913}
19914
19915/// Response message for listing notification configs.
19916#[derive(Clone, Default, PartialEq)]
19917#[non_exhaustive]
19918pub struct ListNotificationConfigsResponse {
19919 /// Notification configs belonging to the requested parent.
19920 pub notification_configs: std::vec::Vec<crate::model::NotificationConfig>,
19921
19922 /// Token to retrieve the next page of results, or empty if there are no more
19923 /// results.
19924 pub next_page_token: std::string::String,
19925
19926 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19927}
19928
19929impl ListNotificationConfigsResponse {
19930 /// Creates a new default instance.
19931 pub fn new() -> Self {
19932 std::default::Default::default()
19933 }
19934
19935 /// Sets the value of [notification_configs][crate::model::ListNotificationConfigsResponse::notification_configs].
19936 ///
19937 /// # Example
19938 /// ```ignore,no_run
19939 /// # use google_cloud_securitycenter_v2::model::ListNotificationConfigsResponse;
19940 /// use google_cloud_securitycenter_v2::model::NotificationConfig;
19941 /// let x = ListNotificationConfigsResponse::new()
19942 /// .set_notification_configs([
19943 /// NotificationConfig::default()/* use setters */,
19944 /// NotificationConfig::default()/* use (different) setters */,
19945 /// ]);
19946 /// ```
19947 pub fn set_notification_configs<T, V>(mut self, v: T) -> Self
19948 where
19949 T: std::iter::IntoIterator<Item = V>,
19950 V: std::convert::Into<crate::model::NotificationConfig>,
19951 {
19952 use std::iter::Iterator;
19953 self.notification_configs = v.into_iter().map(|i| i.into()).collect();
19954 self
19955 }
19956
19957 /// Sets the value of [next_page_token][crate::model::ListNotificationConfigsResponse::next_page_token].
19958 ///
19959 /// # Example
19960 /// ```ignore,no_run
19961 /// # use google_cloud_securitycenter_v2::model::ListNotificationConfigsResponse;
19962 /// let x = ListNotificationConfigsResponse::new().set_next_page_token("example");
19963 /// ```
19964 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19965 self.next_page_token = v.into();
19966 self
19967 }
19968}
19969
19970impl wkt::message::Message for ListNotificationConfigsResponse {
19971 fn typename() -> &'static str {
19972 "type.googleapis.com/google.cloud.securitycenter.v2.ListNotificationConfigsResponse"
19973 }
19974}
19975
19976#[doc(hidden)]
19977impl google_cloud_gax::paginator::internal::PageableResponse for ListNotificationConfigsResponse {
19978 type PageItem = crate::model::NotificationConfig;
19979
19980 fn items(self) -> std::vec::Vec<Self::PageItem> {
19981 self.notification_configs
19982 }
19983
19984 fn next_page_token(&self) -> std::string::String {
19985 use std::clone::Clone;
19986 self.next_page_token.clone()
19987 }
19988}
19989
19990/// Request message to list resource value configs of a parent
19991#[derive(Clone, Default, PartialEq)]
19992#[non_exhaustive]
19993pub struct ListResourceValueConfigsRequest {
19994 /// Required. The parent, which owns the collection of resource value configs.
19995 /// Its format is
19996 /// `organizations/[organization_id]`
19997 pub parent: std::string::String,
19998
19999 /// The maximum number of configs to return. The service may return fewer than
20000 /// this value.
20001 /// If unspecified, at most 10 configs will be returned.
20002 /// The maximum value is 1000; values above 1000 will be coerced to 1000.
20003 pub page_size: i32,
20004
20005 /// A page token, received from a previous `ListResourceValueConfigs` call.
20006 /// Provide this to retrieve the subsequent page.
20007 ///
20008 /// When paginating, all other parameters provided to
20009 /// `ListResourceValueConfigs` must match the call that provided the
20010 /// page token.
20011 ///
20012 /// page_size can be specified, and the new page_size will be used.
20013 pub page_token: std::string::String,
20014
20015 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20016}
20017
20018impl ListResourceValueConfigsRequest {
20019 /// Creates a new default instance.
20020 pub fn new() -> Self {
20021 std::default::Default::default()
20022 }
20023
20024 /// Sets the value of [parent][crate::model::ListResourceValueConfigsRequest::parent].
20025 ///
20026 /// # Example
20027 /// ```ignore,no_run
20028 /// # use google_cloud_securitycenter_v2::model::ListResourceValueConfigsRequest;
20029 /// let x = ListResourceValueConfigsRequest::new().set_parent("example");
20030 /// ```
20031 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20032 self.parent = v.into();
20033 self
20034 }
20035
20036 /// Sets the value of [page_size][crate::model::ListResourceValueConfigsRequest::page_size].
20037 ///
20038 /// # Example
20039 /// ```ignore,no_run
20040 /// # use google_cloud_securitycenter_v2::model::ListResourceValueConfigsRequest;
20041 /// let x = ListResourceValueConfigsRequest::new().set_page_size(42);
20042 /// ```
20043 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20044 self.page_size = v.into();
20045 self
20046 }
20047
20048 /// Sets the value of [page_token][crate::model::ListResourceValueConfigsRequest::page_token].
20049 ///
20050 /// # Example
20051 /// ```ignore,no_run
20052 /// # use google_cloud_securitycenter_v2::model::ListResourceValueConfigsRequest;
20053 /// let x = ListResourceValueConfigsRequest::new().set_page_token("example");
20054 /// ```
20055 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20056 self.page_token = v.into();
20057 self
20058 }
20059}
20060
20061impl wkt::message::Message for ListResourceValueConfigsRequest {
20062 fn typename() -> &'static str {
20063 "type.googleapis.com/google.cloud.securitycenter.v2.ListResourceValueConfigsRequest"
20064 }
20065}
20066
20067/// Response message to list resource value configs
20068#[derive(Clone, Default, PartialEq)]
20069#[non_exhaustive]
20070pub struct ListResourceValueConfigsResponse {
20071 /// The resource value configs from the specified parent.
20072 pub resource_value_configs: std::vec::Vec<crate::model::ResourceValueConfig>,
20073
20074 /// A token, which can be sent as `page_token` to retrieve the next page.
20075 /// If this field is empty, there are no subsequent pages.
20076 pub next_page_token: std::string::String,
20077
20078 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20079}
20080
20081impl ListResourceValueConfigsResponse {
20082 /// Creates a new default instance.
20083 pub fn new() -> Self {
20084 std::default::Default::default()
20085 }
20086
20087 /// Sets the value of [resource_value_configs][crate::model::ListResourceValueConfigsResponse::resource_value_configs].
20088 ///
20089 /// # Example
20090 /// ```ignore,no_run
20091 /// # use google_cloud_securitycenter_v2::model::ListResourceValueConfigsResponse;
20092 /// use google_cloud_securitycenter_v2::model::ResourceValueConfig;
20093 /// let x = ListResourceValueConfigsResponse::new()
20094 /// .set_resource_value_configs([
20095 /// ResourceValueConfig::default()/* use setters */,
20096 /// ResourceValueConfig::default()/* use (different) setters */,
20097 /// ]);
20098 /// ```
20099 pub fn set_resource_value_configs<T, V>(mut self, v: T) -> Self
20100 where
20101 T: std::iter::IntoIterator<Item = V>,
20102 V: std::convert::Into<crate::model::ResourceValueConfig>,
20103 {
20104 use std::iter::Iterator;
20105 self.resource_value_configs = v.into_iter().map(|i| i.into()).collect();
20106 self
20107 }
20108
20109 /// Sets the value of [next_page_token][crate::model::ListResourceValueConfigsResponse::next_page_token].
20110 ///
20111 /// # Example
20112 /// ```ignore,no_run
20113 /// # use google_cloud_securitycenter_v2::model::ListResourceValueConfigsResponse;
20114 /// let x = ListResourceValueConfigsResponse::new().set_next_page_token("example");
20115 /// ```
20116 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20117 self.next_page_token = v.into();
20118 self
20119 }
20120}
20121
20122impl wkt::message::Message for ListResourceValueConfigsResponse {
20123 fn typename() -> &'static str {
20124 "type.googleapis.com/google.cloud.securitycenter.v2.ListResourceValueConfigsResponse"
20125 }
20126}
20127
20128#[doc(hidden)]
20129impl google_cloud_gax::paginator::internal::PageableResponse for ListResourceValueConfigsResponse {
20130 type PageItem = crate::model::ResourceValueConfig;
20131
20132 fn items(self) -> std::vec::Vec<Self::PageItem> {
20133 self.resource_value_configs
20134 }
20135
20136 fn next_page_token(&self) -> std::string::String {
20137 use std::clone::Clone;
20138 self.next_page_token.clone()
20139 }
20140}
20141
20142/// Request message for listing sources.
20143#[derive(Clone, Default, PartialEq)]
20144#[non_exhaustive]
20145pub struct ListSourcesRequest {
20146 /// Required. Resource name of the parent of sources to list. Its format should
20147 /// be `organizations/[organization_id]`, `folders/[folder_id]`, or
20148 /// `projects/[project_id]`.
20149 pub parent: std::string::String,
20150
20151 /// The value returned by the last `ListSourcesResponse`; indicates
20152 /// that this is a continuation of a prior `ListSources` call, and
20153 /// that the system should return the next page of data.
20154 pub page_token: std::string::String,
20155
20156 /// The maximum number of results to return in a single response. Default is
20157 /// 10, minimum is 1, maximum is 1000.
20158 pub page_size: i32,
20159
20160 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20161}
20162
20163impl ListSourcesRequest {
20164 /// Creates a new default instance.
20165 pub fn new() -> Self {
20166 std::default::Default::default()
20167 }
20168
20169 /// Sets the value of [parent][crate::model::ListSourcesRequest::parent].
20170 ///
20171 /// # Example
20172 /// ```ignore,no_run
20173 /// # use google_cloud_securitycenter_v2::model::ListSourcesRequest;
20174 /// let x = ListSourcesRequest::new().set_parent("example");
20175 /// ```
20176 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20177 self.parent = v.into();
20178 self
20179 }
20180
20181 /// Sets the value of [page_token][crate::model::ListSourcesRequest::page_token].
20182 ///
20183 /// # Example
20184 /// ```ignore,no_run
20185 /// # use google_cloud_securitycenter_v2::model::ListSourcesRequest;
20186 /// let x = ListSourcesRequest::new().set_page_token("example");
20187 /// ```
20188 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20189 self.page_token = v.into();
20190 self
20191 }
20192
20193 /// Sets the value of [page_size][crate::model::ListSourcesRequest::page_size].
20194 ///
20195 /// # Example
20196 /// ```ignore,no_run
20197 /// # use google_cloud_securitycenter_v2::model::ListSourcesRequest;
20198 /// let x = ListSourcesRequest::new().set_page_size(42);
20199 /// ```
20200 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20201 self.page_size = v.into();
20202 self
20203 }
20204}
20205
20206impl wkt::message::Message for ListSourcesRequest {
20207 fn typename() -> &'static str {
20208 "type.googleapis.com/google.cloud.securitycenter.v2.ListSourcesRequest"
20209 }
20210}
20211
20212/// Response message for listing sources.
20213#[derive(Clone, Default, PartialEq)]
20214#[non_exhaustive]
20215pub struct ListSourcesResponse {
20216 /// Sources belonging to the requested parent.
20217 pub sources: std::vec::Vec<crate::model::Source>,
20218
20219 /// Token to retrieve the next page of results, or empty if there are no more
20220 /// results.
20221 pub next_page_token: std::string::String,
20222
20223 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20224}
20225
20226impl ListSourcesResponse {
20227 /// Creates a new default instance.
20228 pub fn new() -> Self {
20229 std::default::Default::default()
20230 }
20231
20232 /// Sets the value of [sources][crate::model::ListSourcesResponse::sources].
20233 ///
20234 /// # Example
20235 /// ```ignore,no_run
20236 /// # use google_cloud_securitycenter_v2::model::ListSourcesResponse;
20237 /// use google_cloud_securitycenter_v2::model::Source;
20238 /// let x = ListSourcesResponse::new()
20239 /// .set_sources([
20240 /// Source::default()/* use setters */,
20241 /// Source::default()/* use (different) setters */,
20242 /// ]);
20243 /// ```
20244 pub fn set_sources<T, V>(mut self, v: T) -> Self
20245 where
20246 T: std::iter::IntoIterator<Item = V>,
20247 V: std::convert::Into<crate::model::Source>,
20248 {
20249 use std::iter::Iterator;
20250 self.sources = v.into_iter().map(|i| i.into()).collect();
20251 self
20252 }
20253
20254 /// Sets the value of [next_page_token][crate::model::ListSourcesResponse::next_page_token].
20255 ///
20256 /// # Example
20257 /// ```ignore,no_run
20258 /// # use google_cloud_securitycenter_v2::model::ListSourcesResponse;
20259 /// let x = ListSourcesResponse::new().set_next_page_token("example");
20260 /// ```
20261 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20262 self.next_page_token = v.into();
20263 self
20264 }
20265}
20266
20267impl wkt::message::Message for ListSourcesResponse {
20268 fn typename() -> &'static str {
20269 "type.googleapis.com/google.cloud.securitycenter.v2.ListSourcesResponse"
20270 }
20271}
20272
20273#[doc(hidden)]
20274impl google_cloud_gax::paginator::internal::PageableResponse for ListSourcesResponse {
20275 type PageItem = crate::model::Source;
20276
20277 fn items(self) -> std::vec::Vec<Self::PageItem> {
20278 self.sources
20279 }
20280
20281 fn next_page_token(&self) -> std::string::String {
20282 use std::clone::Clone;
20283 self.next_page_token.clone()
20284 }
20285}
20286
20287/// Request message for listing the valued resources for a given simulation.
20288#[derive(Clone, Default, PartialEq)]
20289#[non_exhaustive]
20290pub struct ListValuedResourcesRequest {
20291 /// Required. Name of parent to list exposed resources.
20292 ///
20293 /// Valid formats:
20294 /// `organizations/{organization}`,
20295 /// `organizations/{organization}/simulations/{simulation}`
20296 /// `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}`
20297 pub parent: std::string::String,
20298
20299 /// The filter expression that filters the valued resources in the response.
20300 /// Supported fields:
20301 ///
20302 /// * `resource_value` supports =
20303 /// * `resource_type` supports =
20304 pub filter: std::string::String,
20305
20306 /// The value returned by the last `ListValuedResourcesResponse`; indicates
20307 /// that this is a continuation of a prior `ListValuedResources` call, and
20308 /// that the system should return the next page of data.
20309 pub page_token: std::string::String,
20310
20311 /// The maximum number of results to return in a single response. Default is
20312 /// 10, minimum is 1, maximum is 1000.
20313 pub page_size: i32,
20314
20315 /// Optional. The fields by which to order the valued resources response.
20316 ///
20317 /// Supported fields:
20318 ///
20319 /// * `exposed_score`
20320 ///
20321 /// * `resource_value`
20322 ///
20323 /// * `resource_type`
20324 ///
20325 ///
20326 /// Values should be a comma separated list of fields. For example:
20327 /// `exposed_score,resource_value`.
20328 ///
20329 /// The default sorting order is descending. To specify ascending or descending
20330 /// order for a field, append a " ASC" or a " DESC" suffix, respectively; for
20331 /// example: `exposed_score DESC`.
20332 pub order_by: std::string::String,
20333
20334 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20335}
20336
20337impl ListValuedResourcesRequest {
20338 /// Creates a new default instance.
20339 pub fn new() -> Self {
20340 std::default::Default::default()
20341 }
20342
20343 /// Sets the value of [parent][crate::model::ListValuedResourcesRequest::parent].
20344 ///
20345 /// # Example
20346 /// ```ignore,no_run
20347 /// # use google_cloud_securitycenter_v2::model::ListValuedResourcesRequest;
20348 /// let x = ListValuedResourcesRequest::new().set_parent("example");
20349 /// ```
20350 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20351 self.parent = v.into();
20352 self
20353 }
20354
20355 /// Sets the value of [filter][crate::model::ListValuedResourcesRequest::filter].
20356 ///
20357 /// # Example
20358 /// ```ignore,no_run
20359 /// # use google_cloud_securitycenter_v2::model::ListValuedResourcesRequest;
20360 /// let x = ListValuedResourcesRequest::new().set_filter("example");
20361 /// ```
20362 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20363 self.filter = v.into();
20364 self
20365 }
20366
20367 /// Sets the value of [page_token][crate::model::ListValuedResourcesRequest::page_token].
20368 ///
20369 /// # Example
20370 /// ```ignore,no_run
20371 /// # use google_cloud_securitycenter_v2::model::ListValuedResourcesRequest;
20372 /// let x = ListValuedResourcesRequest::new().set_page_token("example");
20373 /// ```
20374 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20375 self.page_token = v.into();
20376 self
20377 }
20378
20379 /// Sets the value of [page_size][crate::model::ListValuedResourcesRequest::page_size].
20380 ///
20381 /// # Example
20382 /// ```ignore,no_run
20383 /// # use google_cloud_securitycenter_v2::model::ListValuedResourcesRequest;
20384 /// let x = ListValuedResourcesRequest::new().set_page_size(42);
20385 /// ```
20386 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20387 self.page_size = v.into();
20388 self
20389 }
20390
20391 /// Sets the value of [order_by][crate::model::ListValuedResourcesRequest::order_by].
20392 ///
20393 /// # Example
20394 /// ```ignore,no_run
20395 /// # use google_cloud_securitycenter_v2::model::ListValuedResourcesRequest;
20396 /// let x = ListValuedResourcesRequest::new().set_order_by("example");
20397 /// ```
20398 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20399 self.order_by = v.into();
20400 self
20401 }
20402}
20403
20404impl wkt::message::Message for ListValuedResourcesRequest {
20405 fn typename() -> &'static str {
20406 "type.googleapis.com/google.cloud.securitycenter.v2.ListValuedResourcesRequest"
20407 }
20408}
20409
20410/// Response message for listing the valued resources for a given simulation.
20411#[derive(Clone, Default, PartialEq)]
20412#[non_exhaustive]
20413pub struct ListValuedResourcesResponse {
20414 /// The valued resources that the attack path simulation identified.
20415 pub valued_resources: std::vec::Vec<crate::model::ValuedResource>,
20416
20417 /// Token to retrieve the next page of results, or empty if there are no more
20418 /// results.
20419 pub next_page_token: std::string::String,
20420
20421 /// The estimated total number of results matching the query.
20422 pub total_size: i32,
20423
20424 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20425}
20426
20427impl ListValuedResourcesResponse {
20428 /// Creates a new default instance.
20429 pub fn new() -> Self {
20430 std::default::Default::default()
20431 }
20432
20433 /// Sets the value of [valued_resources][crate::model::ListValuedResourcesResponse::valued_resources].
20434 ///
20435 /// # Example
20436 /// ```ignore,no_run
20437 /// # use google_cloud_securitycenter_v2::model::ListValuedResourcesResponse;
20438 /// use google_cloud_securitycenter_v2::model::ValuedResource;
20439 /// let x = ListValuedResourcesResponse::new()
20440 /// .set_valued_resources([
20441 /// ValuedResource::default()/* use setters */,
20442 /// ValuedResource::default()/* use (different) setters */,
20443 /// ]);
20444 /// ```
20445 pub fn set_valued_resources<T, V>(mut self, v: T) -> Self
20446 where
20447 T: std::iter::IntoIterator<Item = V>,
20448 V: std::convert::Into<crate::model::ValuedResource>,
20449 {
20450 use std::iter::Iterator;
20451 self.valued_resources = v.into_iter().map(|i| i.into()).collect();
20452 self
20453 }
20454
20455 /// Sets the value of [next_page_token][crate::model::ListValuedResourcesResponse::next_page_token].
20456 ///
20457 /// # Example
20458 /// ```ignore,no_run
20459 /// # use google_cloud_securitycenter_v2::model::ListValuedResourcesResponse;
20460 /// let x = ListValuedResourcesResponse::new().set_next_page_token("example");
20461 /// ```
20462 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20463 self.next_page_token = v.into();
20464 self
20465 }
20466
20467 /// Sets the value of [total_size][crate::model::ListValuedResourcesResponse::total_size].
20468 ///
20469 /// # Example
20470 /// ```ignore,no_run
20471 /// # use google_cloud_securitycenter_v2::model::ListValuedResourcesResponse;
20472 /// let x = ListValuedResourcesResponse::new().set_total_size(42);
20473 /// ```
20474 pub fn set_total_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20475 self.total_size = v.into();
20476 self
20477 }
20478}
20479
20480impl wkt::message::Message for ListValuedResourcesResponse {
20481 fn typename() -> &'static str {
20482 "type.googleapis.com/google.cloud.securitycenter.v2.ListValuedResourcesResponse"
20483 }
20484}
20485
20486#[doc(hidden)]
20487impl google_cloud_gax::paginator::internal::PageableResponse for ListValuedResourcesResponse {
20488 type PageItem = crate::model::ValuedResource;
20489
20490 fn items(self) -> std::vec::Vec<Self::PageItem> {
20491 self.valued_resources
20492 }
20493
20494 fn next_page_token(&self) -> std::string::String {
20495 use std::clone::Clone;
20496 self.next_page_token.clone()
20497 }
20498}
20499
20500/// Request message for updating a finding's state.
20501#[derive(Clone, Default, PartialEq)]
20502#[non_exhaustive]
20503pub struct SetFindingStateRequest {
20504 /// Required. The [relative resource
20505 /// name](https://cloud.google.com/apis/design/resource_names#relative_resource_name)
20506 /// of the finding. If no location is specified, finding is assumed to be in
20507 /// global. The following list shows some examples:
20508 ///
20509 ///
20510 /// `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`
20511 /// +
20512 /// `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
20513 ///
20514 /// + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`
20515 ///
20516 /// `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
20517 ///
20518 /// + `projects/{project_id}/sources/{source_id}/findings/{finding_id}`
20519 ///
20520 /// `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
20521 pub name: std::string::String,
20522
20523 /// Required. The desired State of the finding.
20524 pub state: crate::model::finding::State,
20525
20526 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20527}
20528
20529impl SetFindingStateRequest {
20530 /// Creates a new default instance.
20531 pub fn new() -> Self {
20532 std::default::Default::default()
20533 }
20534
20535 /// Sets the value of [name][crate::model::SetFindingStateRequest::name].
20536 ///
20537 /// # Example
20538 /// ```ignore,no_run
20539 /// # use google_cloud_securitycenter_v2::model::SetFindingStateRequest;
20540 /// let x = SetFindingStateRequest::new().set_name("example");
20541 /// ```
20542 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20543 self.name = v.into();
20544 self
20545 }
20546
20547 /// Sets the value of [state][crate::model::SetFindingStateRequest::state].
20548 ///
20549 /// # Example
20550 /// ```ignore,no_run
20551 /// # use google_cloud_securitycenter_v2::model::SetFindingStateRequest;
20552 /// use google_cloud_securitycenter_v2::model::finding::State;
20553 /// let x0 = SetFindingStateRequest::new().set_state(State::Active);
20554 /// let x1 = SetFindingStateRequest::new().set_state(State::Inactive);
20555 /// ```
20556 pub fn set_state<T: std::convert::Into<crate::model::finding::State>>(mut self, v: T) -> Self {
20557 self.state = v.into();
20558 self
20559 }
20560}
20561
20562impl wkt::message::Message for SetFindingStateRequest {
20563 fn typename() -> &'static str {
20564 "type.googleapis.com/google.cloud.securitycenter.v2.SetFindingStateRequest"
20565 }
20566}
20567
20568/// Request message for updating a finding's mute status.
20569#[derive(Clone, Default, PartialEq)]
20570#[non_exhaustive]
20571pub struct SetMuteRequest {
20572 /// Required. The [relative resource
20573 /// name](https://cloud.google.com/apis/design/resource_names#relative_resource_name)
20574 /// of the finding. If no location is specified, finding is assumed to be in
20575 /// global. The following list shows some examples:
20576 ///
20577 ///
20578 /// `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`
20579 /// +
20580 /// `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
20581 ///
20582 /// + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`
20583 ///
20584 /// `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
20585 ///
20586 /// + `projects/{project_id}/sources/{source_id}/findings/{finding_id}`
20587 ///
20588 /// `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
20589 pub name: std::string::String,
20590
20591 /// Required. The desired state of the Mute.
20592 pub mute: crate::model::finding::Mute,
20593
20594 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20595}
20596
20597impl SetMuteRequest {
20598 /// Creates a new default instance.
20599 pub fn new() -> Self {
20600 std::default::Default::default()
20601 }
20602
20603 /// Sets the value of [name][crate::model::SetMuteRequest::name].
20604 ///
20605 /// # Example
20606 /// ```ignore,no_run
20607 /// # use google_cloud_securitycenter_v2::model::SetMuteRequest;
20608 /// let x = SetMuteRequest::new().set_name("example");
20609 /// ```
20610 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20611 self.name = v.into();
20612 self
20613 }
20614
20615 /// Sets the value of [mute][crate::model::SetMuteRequest::mute].
20616 ///
20617 /// # Example
20618 /// ```ignore,no_run
20619 /// # use google_cloud_securitycenter_v2::model::SetMuteRequest;
20620 /// use google_cloud_securitycenter_v2::model::finding::Mute;
20621 /// let x0 = SetMuteRequest::new().set_mute(Mute::Muted);
20622 /// let x1 = SetMuteRequest::new().set_mute(Mute::Unmuted);
20623 /// let x2 = SetMuteRequest::new().set_mute(Mute::Undefined);
20624 /// ```
20625 pub fn set_mute<T: std::convert::Into<crate::model::finding::Mute>>(mut self, v: T) -> Self {
20626 self.mute = v.into();
20627 self
20628 }
20629}
20630
20631impl wkt::message::Message for SetMuteRequest {
20632 fn typename() -> &'static str {
20633 "type.googleapis.com/google.cloud.securitycenter.v2.SetMuteRequest"
20634 }
20635}
20636
20637/// Request message for updating a BigQuery export.
20638#[derive(Clone, Default, PartialEq)]
20639#[non_exhaustive]
20640pub struct UpdateBigQueryExportRequest {
20641 /// Required. The BigQuery export being updated.
20642 pub big_query_export: std::option::Option<crate::model::BigQueryExport>,
20643
20644 /// The list of fields to be updated.
20645 /// If empty all mutable fields will be updated.
20646 pub update_mask: std::option::Option<wkt::FieldMask>,
20647
20648 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20649}
20650
20651impl UpdateBigQueryExportRequest {
20652 /// Creates a new default instance.
20653 pub fn new() -> Self {
20654 std::default::Default::default()
20655 }
20656
20657 /// Sets the value of [big_query_export][crate::model::UpdateBigQueryExportRequest::big_query_export].
20658 ///
20659 /// # Example
20660 /// ```ignore,no_run
20661 /// # use google_cloud_securitycenter_v2::model::UpdateBigQueryExportRequest;
20662 /// use google_cloud_securitycenter_v2::model::BigQueryExport;
20663 /// let x = UpdateBigQueryExportRequest::new().set_big_query_export(BigQueryExport::default()/* use setters */);
20664 /// ```
20665 pub fn set_big_query_export<T>(mut self, v: T) -> Self
20666 where
20667 T: std::convert::Into<crate::model::BigQueryExport>,
20668 {
20669 self.big_query_export = std::option::Option::Some(v.into());
20670 self
20671 }
20672
20673 /// Sets or clears the value of [big_query_export][crate::model::UpdateBigQueryExportRequest::big_query_export].
20674 ///
20675 /// # Example
20676 /// ```ignore,no_run
20677 /// # use google_cloud_securitycenter_v2::model::UpdateBigQueryExportRequest;
20678 /// use google_cloud_securitycenter_v2::model::BigQueryExport;
20679 /// let x = UpdateBigQueryExportRequest::new().set_or_clear_big_query_export(Some(BigQueryExport::default()/* use setters */));
20680 /// let x = UpdateBigQueryExportRequest::new().set_or_clear_big_query_export(None::<BigQueryExport>);
20681 /// ```
20682 pub fn set_or_clear_big_query_export<T>(mut self, v: std::option::Option<T>) -> Self
20683 where
20684 T: std::convert::Into<crate::model::BigQueryExport>,
20685 {
20686 self.big_query_export = v.map(|x| x.into());
20687 self
20688 }
20689
20690 /// Sets the value of [update_mask][crate::model::UpdateBigQueryExportRequest::update_mask].
20691 ///
20692 /// # Example
20693 /// ```ignore,no_run
20694 /// # use google_cloud_securitycenter_v2::model::UpdateBigQueryExportRequest;
20695 /// use wkt::FieldMask;
20696 /// let x = UpdateBigQueryExportRequest::new().set_update_mask(FieldMask::default()/* use setters */);
20697 /// ```
20698 pub fn set_update_mask<T>(mut self, v: T) -> Self
20699 where
20700 T: std::convert::Into<wkt::FieldMask>,
20701 {
20702 self.update_mask = std::option::Option::Some(v.into());
20703 self
20704 }
20705
20706 /// Sets or clears the value of [update_mask][crate::model::UpdateBigQueryExportRequest::update_mask].
20707 ///
20708 /// # Example
20709 /// ```ignore,no_run
20710 /// # use google_cloud_securitycenter_v2::model::UpdateBigQueryExportRequest;
20711 /// use wkt::FieldMask;
20712 /// let x = UpdateBigQueryExportRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
20713 /// let x = UpdateBigQueryExportRequest::new().set_or_clear_update_mask(None::<FieldMask>);
20714 /// ```
20715 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20716 where
20717 T: std::convert::Into<wkt::FieldMask>,
20718 {
20719 self.update_mask = v.map(|x| x.into());
20720 self
20721 }
20722}
20723
20724impl wkt::message::Message for UpdateBigQueryExportRequest {
20725 fn typename() -> &'static str {
20726 "type.googleapis.com/google.cloud.securitycenter.v2.UpdateBigQueryExportRequest"
20727 }
20728}
20729
20730/// Request message for updating a ExternalSystem resource.
20731#[derive(Clone, Default, PartialEq)]
20732#[non_exhaustive]
20733pub struct UpdateExternalSystemRequest {
20734 /// Required. The external system resource to update.
20735 pub external_system: std::option::Option<crate::model::ExternalSystem>,
20736
20737 /// The FieldMask to use when updating the external system resource.
20738 ///
20739 /// If empty all mutable fields will be updated.
20740 pub update_mask: std::option::Option<wkt::FieldMask>,
20741
20742 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20743}
20744
20745impl UpdateExternalSystemRequest {
20746 /// Creates a new default instance.
20747 pub fn new() -> Self {
20748 std::default::Default::default()
20749 }
20750
20751 /// Sets the value of [external_system][crate::model::UpdateExternalSystemRequest::external_system].
20752 ///
20753 /// # Example
20754 /// ```ignore,no_run
20755 /// # use google_cloud_securitycenter_v2::model::UpdateExternalSystemRequest;
20756 /// use google_cloud_securitycenter_v2::model::ExternalSystem;
20757 /// let x = UpdateExternalSystemRequest::new().set_external_system(ExternalSystem::default()/* use setters */);
20758 /// ```
20759 pub fn set_external_system<T>(mut self, v: T) -> Self
20760 where
20761 T: std::convert::Into<crate::model::ExternalSystem>,
20762 {
20763 self.external_system = std::option::Option::Some(v.into());
20764 self
20765 }
20766
20767 /// Sets or clears the value of [external_system][crate::model::UpdateExternalSystemRequest::external_system].
20768 ///
20769 /// # Example
20770 /// ```ignore,no_run
20771 /// # use google_cloud_securitycenter_v2::model::UpdateExternalSystemRequest;
20772 /// use google_cloud_securitycenter_v2::model::ExternalSystem;
20773 /// let x = UpdateExternalSystemRequest::new().set_or_clear_external_system(Some(ExternalSystem::default()/* use setters */));
20774 /// let x = UpdateExternalSystemRequest::new().set_or_clear_external_system(None::<ExternalSystem>);
20775 /// ```
20776 pub fn set_or_clear_external_system<T>(mut self, v: std::option::Option<T>) -> Self
20777 where
20778 T: std::convert::Into<crate::model::ExternalSystem>,
20779 {
20780 self.external_system = v.map(|x| x.into());
20781 self
20782 }
20783
20784 /// Sets the value of [update_mask][crate::model::UpdateExternalSystemRequest::update_mask].
20785 ///
20786 /// # Example
20787 /// ```ignore,no_run
20788 /// # use google_cloud_securitycenter_v2::model::UpdateExternalSystemRequest;
20789 /// use wkt::FieldMask;
20790 /// let x = UpdateExternalSystemRequest::new().set_update_mask(FieldMask::default()/* use setters */);
20791 /// ```
20792 pub fn set_update_mask<T>(mut self, v: T) -> Self
20793 where
20794 T: std::convert::Into<wkt::FieldMask>,
20795 {
20796 self.update_mask = std::option::Option::Some(v.into());
20797 self
20798 }
20799
20800 /// Sets or clears the value of [update_mask][crate::model::UpdateExternalSystemRequest::update_mask].
20801 ///
20802 /// # Example
20803 /// ```ignore,no_run
20804 /// # use google_cloud_securitycenter_v2::model::UpdateExternalSystemRequest;
20805 /// use wkt::FieldMask;
20806 /// let x = UpdateExternalSystemRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
20807 /// let x = UpdateExternalSystemRequest::new().set_or_clear_update_mask(None::<FieldMask>);
20808 /// ```
20809 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20810 where
20811 T: std::convert::Into<wkt::FieldMask>,
20812 {
20813 self.update_mask = v.map(|x| x.into());
20814 self
20815 }
20816}
20817
20818impl wkt::message::Message for UpdateExternalSystemRequest {
20819 fn typename() -> &'static str {
20820 "type.googleapis.com/google.cloud.securitycenter.v2.UpdateExternalSystemRequest"
20821 }
20822}
20823
20824/// Request message for updating or creating a finding.
20825#[derive(Clone, Default, PartialEq)]
20826#[non_exhaustive]
20827pub struct UpdateFindingRequest {
20828 /// Required. The finding resource to update or create if it does not already
20829 /// exist. parent, security_marks, and update_time will be ignored.
20830 ///
20831 /// In the case of creation, the finding id portion of the name must be
20832 /// alphanumeric and less than or equal to 32 characters and greater than 0
20833 /// characters in length.
20834 pub finding: std::option::Option<crate::model::Finding>,
20835
20836 /// The FieldMask to use when updating the finding resource. This field should
20837 /// not be specified when creating a finding.
20838 ///
20839 /// When updating a finding, an empty mask is treated as updating all mutable
20840 /// fields and replacing source_properties. Individual source_properties can
20841 /// be added/updated by using "source_properties.\<property key\>" in the field
20842 /// mask.
20843 pub update_mask: std::option::Option<wkt::FieldMask>,
20844
20845 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20846}
20847
20848impl UpdateFindingRequest {
20849 /// Creates a new default instance.
20850 pub fn new() -> Self {
20851 std::default::Default::default()
20852 }
20853
20854 /// Sets the value of [finding][crate::model::UpdateFindingRequest::finding].
20855 ///
20856 /// # Example
20857 /// ```ignore,no_run
20858 /// # use google_cloud_securitycenter_v2::model::UpdateFindingRequest;
20859 /// use google_cloud_securitycenter_v2::model::Finding;
20860 /// let x = UpdateFindingRequest::new().set_finding(Finding::default()/* use setters */);
20861 /// ```
20862 pub fn set_finding<T>(mut self, v: T) -> Self
20863 where
20864 T: std::convert::Into<crate::model::Finding>,
20865 {
20866 self.finding = std::option::Option::Some(v.into());
20867 self
20868 }
20869
20870 /// Sets or clears the value of [finding][crate::model::UpdateFindingRequest::finding].
20871 ///
20872 /// # Example
20873 /// ```ignore,no_run
20874 /// # use google_cloud_securitycenter_v2::model::UpdateFindingRequest;
20875 /// use google_cloud_securitycenter_v2::model::Finding;
20876 /// let x = UpdateFindingRequest::new().set_or_clear_finding(Some(Finding::default()/* use setters */));
20877 /// let x = UpdateFindingRequest::new().set_or_clear_finding(None::<Finding>);
20878 /// ```
20879 pub fn set_or_clear_finding<T>(mut self, v: std::option::Option<T>) -> Self
20880 where
20881 T: std::convert::Into<crate::model::Finding>,
20882 {
20883 self.finding = v.map(|x| x.into());
20884 self
20885 }
20886
20887 /// Sets the value of [update_mask][crate::model::UpdateFindingRequest::update_mask].
20888 ///
20889 /// # Example
20890 /// ```ignore,no_run
20891 /// # use google_cloud_securitycenter_v2::model::UpdateFindingRequest;
20892 /// use wkt::FieldMask;
20893 /// let x = UpdateFindingRequest::new().set_update_mask(FieldMask::default()/* use setters */);
20894 /// ```
20895 pub fn set_update_mask<T>(mut self, v: T) -> Self
20896 where
20897 T: std::convert::Into<wkt::FieldMask>,
20898 {
20899 self.update_mask = std::option::Option::Some(v.into());
20900 self
20901 }
20902
20903 /// Sets or clears the value of [update_mask][crate::model::UpdateFindingRequest::update_mask].
20904 ///
20905 /// # Example
20906 /// ```ignore,no_run
20907 /// # use google_cloud_securitycenter_v2::model::UpdateFindingRequest;
20908 /// use wkt::FieldMask;
20909 /// let x = UpdateFindingRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
20910 /// let x = UpdateFindingRequest::new().set_or_clear_update_mask(None::<FieldMask>);
20911 /// ```
20912 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20913 where
20914 T: std::convert::Into<wkt::FieldMask>,
20915 {
20916 self.update_mask = v.map(|x| x.into());
20917 self
20918 }
20919}
20920
20921impl wkt::message::Message for UpdateFindingRequest {
20922 fn typename() -> &'static str {
20923 "type.googleapis.com/google.cloud.securitycenter.v2.UpdateFindingRequest"
20924 }
20925}
20926
20927/// Request message for updating a mute config.
20928#[derive(Clone, Default, PartialEq)]
20929#[non_exhaustive]
20930pub struct UpdateMuteConfigRequest {
20931 /// Required. The mute config being updated.
20932 pub mute_config: std::option::Option<crate::model::MuteConfig>,
20933
20934 /// The list of fields to be updated.
20935 /// If empty all mutable fields will be updated.
20936 pub update_mask: std::option::Option<wkt::FieldMask>,
20937
20938 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20939}
20940
20941impl UpdateMuteConfigRequest {
20942 /// Creates a new default instance.
20943 pub fn new() -> Self {
20944 std::default::Default::default()
20945 }
20946
20947 /// Sets the value of [mute_config][crate::model::UpdateMuteConfigRequest::mute_config].
20948 ///
20949 /// # Example
20950 /// ```ignore,no_run
20951 /// # use google_cloud_securitycenter_v2::model::UpdateMuteConfigRequest;
20952 /// use google_cloud_securitycenter_v2::model::MuteConfig;
20953 /// let x = UpdateMuteConfigRequest::new().set_mute_config(MuteConfig::default()/* use setters */);
20954 /// ```
20955 pub fn set_mute_config<T>(mut self, v: T) -> Self
20956 where
20957 T: std::convert::Into<crate::model::MuteConfig>,
20958 {
20959 self.mute_config = std::option::Option::Some(v.into());
20960 self
20961 }
20962
20963 /// Sets or clears the value of [mute_config][crate::model::UpdateMuteConfigRequest::mute_config].
20964 ///
20965 /// # Example
20966 /// ```ignore,no_run
20967 /// # use google_cloud_securitycenter_v2::model::UpdateMuteConfigRequest;
20968 /// use google_cloud_securitycenter_v2::model::MuteConfig;
20969 /// let x = UpdateMuteConfigRequest::new().set_or_clear_mute_config(Some(MuteConfig::default()/* use setters */));
20970 /// let x = UpdateMuteConfigRequest::new().set_or_clear_mute_config(None::<MuteConfig>);
20971 /// ```
20972 pub fn set_or_clear_mute_config<T>(mut self, v: std::option::Option<T>) -> Self
20973 where
20974 T: std::convert::Into<crate::model::MuteConfig>,
20975 {
20976 self.mute_config = v.map(|x| x.into());
20977 self
20978 }
20979
20980 /// Sets the value of [update_mask][crate::model::UpdateMuteConfigRequest::update_mask].
20981 ///
20982 /// # Example
20983 /// ```ignore,no_run
20984 /// # use google_cloud_securitycenter_v2::model::UpdateMuteConfigRequest;
20985 /// use wkt::FieldMask;
20986 /// let x = UpdateMuteConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
20987 /// ```
20988 pub fn set_update_mask<T>(mut self, v: T) -> Self
20989 where
20990 T: std::convert::Into<wkt::FieldMask>,
20991 {
20992 self.update_mask = std::option::Option::Some(v.into());
20993 self
20994 }
20995
20996 /// Sets or clears the value of [update_mask][crate::model::UpdateMuteConfigRequest::update_mask].
20997 ///
20998 /// # Example
20999 /// ```ignore,no_run
21000 /// # use google_cloud_securitycenter_v2::model::UpdateMuteConfigRequest;
21001 /// use wkt::FieldMask;
21002 /// let x = UpdateMuteConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
21003 /// let x = UpdateMuteConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
21004 /// ```
21005 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21006 where
21007 T: std::convert::Into<wkt::FieldMask>,
21008 {
21009 self.update_mask = v.map(|x| x.into());
21010 self
21011 }
21012}
21013
21014impl wkt::message::Message for UpdateMuteConfigRequest {
21015 fn typename() -> &'static str {
21016 "type.googleapis.com/google.cloud.securitycenter.v2.UpdateMuteConfigRequest"
21017 }
21018}
21019
21020/// Request message for updating a notification config.
21021#[derive(Clone, Default, PartialEq)]
21022#[non_exhaustive]
21023pub struct UpdateNotificationConfigRequest {
21024 /// Required. The notification config to update.
21025 pub notification_config: std::option::Option<crate::model::NotificationConfig>,
21026
21027 /// The FieldMask to use when updating the notification config.
21028 ///
21029 /// If empty all mutable fields will be updated.
21030 pub update_mask: std::option::Option<wkt::FieldMask>,
21031
21032 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21033}
21034
21035impl UpdateNotificationConfigRequest {
21036 /// Creates a new default instance.
21037 pub fn new() -> Self {
21038 std::default::Default::default()
21039 }
21040
21041 /// Sets the value of [notification_config][crate::model::UpdateNotificationConfigRequest::notification_config].
21042 ///
21043 /// # Example
21044 /// ```ignore,no_run
21045 /// # use google_cloud_securitycenter_v2::model::UpdateNotificationConfigRequest;
21046 /// use google_cloud_securitycenter_v2::model::NotificationConfig;
21047 /// let x = UpdateNotificationConfigRequest::new().set_notification_config(NotificationConfig::default()/* use setters */);
21048 /// ```
21049 pub fn set_notification_config<T>(mut self, v: T) -> Self
21050 where
21051 T: std::convert::Into<crate::model::NotificationConfig>,
21052 {
21053 self.notification_config = std::option::Option::Some(v.into());
21054 self
21055 }
21056
21057 /// Sets or clears the value of [notification_config][crate::model::UpdateNotificationConfigRequest::notification_config].
21058 ///
21059 /// # Example
21060 /// ```ignore,no_run
21061 /// # use google_cloud_securitycenter_v2::model::UpdateNotificationConfigRequest;
21062 /// use google_cloud_securitycenter_v2::model::NotificationConfig;
21063 /// let x = UpdateNotificationConfigRequest::new().set_or_clear_notification_config(Some(NotificationConfig::default()/* use setters */));
21064 /// let x = UpdateNotificationConfigRequest::new().set_or_clear_notification_config(None::<NotificationConfig>);
21065 /// ```
21066 pub fn set_or_clear_notification_config<T>(mut self, v: std::option::Option<T>) -> Self
21067 where
21068 T: std::convert::Into<crate::model::NotificationConfig>,
21069 {
21070 self.notification_config = v.map(|x| x.into());
21071 self
21072 }
21073
21074 /// Sets the value of [update_mask][crate::model::UpdateNotificationConfigRequest::update_mask].
21075 ///
21076 /// # Example
21077 /// ```ignore,no_run
21078 /// # use google_cloud_securitycenter_v2::model::UpdateNotificationConfigRequest;
21079 /// use wkt::FieldMask;
21080 /// let x = UpdateNotificationConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
21081 /// ```
21082 pub fn set_update_mask<T>(mut self, v: T) -> Self
21083 where
21084 T: std::convert::Into<wkt::FieldMask>,
21085 {
21086 self.update_mask = std::option::Option::Some(v.into());
21087 self
21088 }
21089
21090 /// Sets or clears the value of [update_mask][crate::model::UpdateNotificationConfigRequest::update_mask].
21091 ///
21092 /// # Example
21093 /// ```ignore,no_run
21094 /// # use google_cloud_securitycenter_v2::model::UpdateNotificationConfigRequest;
21095 /// use wkt::FieldMask;
21096 /// let x = UpdateNotificationConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
21097 /// let x = UpdateNotificationConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
21098 /// ```
21099 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21100 where
21101 T: std::convert::Into<wkt::FieldMask>,
21102 {
21103 self.update_mask = v.map(|x| x.into());
21104 self
21105 }
21106}
21107
21108impl wkt::message::Message for UpdateNotificationConfigRequest {
21109 fn typename() -> &'static str {
21110 "type.googleapis.com/google.cloud.securitycenter.v2.UpdateNotificationConfigRequest"
21111 }
21112}
21113
21114/// Request message to update resource value config
21115#[derive(Clone, Default, PartialEq)]
21116#[non_exhaustive]
21117pub struct UpdateResourceValueConfigRequest {
21118 /// Required. The resource value config being updated.
21119 pub resource_value_config: std::option::Option<crate::model::ResourceValueConfig>,
21120
21121 /// The list of fields to be updated.
21122 /// If empty all mutable fields will be updated.
21123 ///
21124 /// To update nested fields, include the top level field in the mask
21125 /// For example, to update gcp_metadata.resource_type, include the
21126 /// "gcp_metadata" field mask
21127 pub update_mask: std::option::Option<wkt::FieldMask>,
21128
21129 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21130}
21131
21132impl UpdateResourceValueConfigRequest {
21133 /// Creates a new default instance.
21134 pub fn new() -> Self {
21135 std::default::Default::default()
21136 }
21137
21138 /// Sets the value of [resource_value_config][crate::model::UpdateResourceValueConfigRequest::resource_value_config].
21139 ///
21140 /// # Example
21141 /// ```ignore,no_run
21142 /// # use google_cloud_securitycenter_v2::model::UpdateResourceValueConfigRequest;
21143 /// use google_cloud_securitycenter_v2::model::ResourceValueConfig;
21144 /// let x = UpdateResourceValueConfigRequest::new().set_resource_value_config(ResourceValueConfig::default()/* use setters */);
21145 /// ```
21146 pub fn set_resource_value_config<T>(mut self, v: T) -> Self
21147 where
21148 T: std::convert::Into<crate::model::ResourceValueConfig>,
21149 {
21150 self.resource_value_config = std::option::Option::Some(v.into());
21151 self
21152 }
21153
21154 /// Sets or clears the value of [resource_value_config][crate::model::UpdateResourceValueConfigRequest::resource_value_config].
21155 ///
21156 /// # Example
21157 /// ```ignore,no_run
21158 /// # use google_cloud_securitycenter_v2::model::UpdateResourceValueConfigRequest;
21159 /// use google_cloud_securitycenter_v2::model::ResourceValueConfig;
21160 /// let x = UpdateResourceValueConfigRequest::new().set_or_clear_resource_value_config(Some(ResourceValueConfig::default()/* use setters */));
21161 /// let x = UpdateResourceValueConfigRequest::new().set_or_clear_resource_value_config(None::<ResourceValueConfig>);
21162 /// ```
21163 pub fn set_or_clear_resource_value_config<T>(mut self, v: std::option::Option<T>) -> Self
21164 where
21165 T: std::convert::Into<crate::model::ResourceValueConfig>,
21166 {
21167 self.resource_value_config = v.map(|x| x.into());
21168 self
21169 }
21170
21171 /// Sets the value of [update_mask][crate::model::UpdateResourceValueConfigRequest::update_mask].
21172 ///
21173 /// # Example
21174 /// ```ignore,no_run
21175 /// # use google_cloud_securitycenter_v2::model::UpdateResourceValueConfigRequest;
21176 /// use wkt::FieldMask;
21177 /// let x = UpdateResourceValueConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
21178 /// ```
21179 pub fn set_update_mask<T>(mut self, v: T) -> Self
21180 where
21181 T: std::convert::Into<wkt::FieldMask>,
21182 {
21183 self.update_mask = std::option::Option::Some(v.into());
21184 self
21185 }
21186
21187 /// Sets or clears the value of [update_mask][crate::model::UpdateResourceValueConfigRequest::update_mask].
21188 ///
21189 /// # Example
21190 /// ```ignore,no_run
21191 /// # use google_cloud_securitycenter_v2::model::UpdateResourceValueConfigRequest;
21192 /// use wkt::FieldMask;
21193 /// let x = UpdateResourceValueConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
21194 /// let x = UpdateResourceValueConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
21195 /// ```
21196 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21197 where
21198 T: std::convert::Into<wkt::FieldMask>,
21199 {
21200 self.update_mask = v.map(|x| x.into());
21201 self
21202 }
21203}
21204
21205impl wkt::message::Message for UpdateResourceValueConfigRequest {
21206 fn typename() -> &'static str {
21207 "type.googleapis.com/google.cloud.securitycenter.v2.UpdateResourceValueConfigRequest"
21208 }
21209}
21210
21211/// Request message for updating a SecurityMarks resource.
21212#[derive(Clone, Default, PartialEq)]
21213#[non_exhaustive]
21214pub struct UpdateSecurityMarksRequest {
21215 /// Required. The security marks resource to update.
21216 pub security_marks: std::option::Option<crate::model::SecurityMarks>,
21217
21218 /// The FieldMask to use when updating the security marks resource.
21219 ///
21220 /// The field mask must not contain duplicate fields.
21221 /// If empty or set to "marks", all marks will be replaced. Individual
21222 /// marks can be updated using "marks.<mark_key>".
21223 pub update_mask: std::option::Option<wkt::FieldMask>,
21224
21225 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21226}
21227
21228impl UpdateSecurityMarksRequest {
21229 /// Creates a new default instance.
21230 pub fn new() -> Self {
21231 std::default::Default::default()
21232 }
21233
21234 /// Sets the value of [security_marks][crate::model::UpdateSecurityMarksRequest::security_marks].
21235 ///
21236 /// # Example
21237 /// ```ignore,no_run
21238 /// # use google_cloud_securitycenter_v2::model::UpdateSecurityMarksRequest;
21239 /// use google_cloud_securitycenter_v2::model::SecurityMarks;
21240 /// let x = UpdateSecurityMarksRequest::new().set_security_marks(SecurityMarks::default()/* use setters */);
21241 /// ```
21242 pub fn set_security_marks<T>(mut self, v: T) -> Self
21243 where
21244 T: std::convert::Into<crate::model::SecurityMarks>,
21245 {
21246 self.security_marks = std::option::Option::Some(v.into());
21247 self
21248 }
21249
21250 /// Sets or clears the value of [security_marks][crate::model::UpdateSecurityMarksRequest::security_marks].
21251 ///
21252 /// # Example
21253 /// ```ignore,no_run
21254 /// # use google_cloud_securitycenter_v2::model::UpdateSecurityMarksRequest;
21255 /// use google_cloud_securitycenter_v2::model::SecurityMarks;
21256 /// let x = UpdateSecurityMarksRequest::new().set_or_clear_security_marks(Some(SecurityMarks::default()/* use setters */));
21257 /// let x = UpdateSecurityMarksRequest::new().set_or_clear_security_marks(None::<SecurityMarks>);
21258 /// ```
21259 pub fn set_or_clear_security_marks<T>(mut self, v: std::option::Option<T>) -> Self
21260 where
21261 T: std::convert::Into<crate::model::SecurityMarks>,
21262 {
21263 self.security_marks = v.map(|x| x.into());
21264 self
21265 }
21266
21267 /// Sets the value of [update_mask][crate::model::UpdateSecurityMarksRequest::update_mask].
21268 ///
21269 /// # Example
21270 /// ```ignore,no_run
21271 /// # use google_cloud_securitycenter_v2::model::UpdateSecurityMarksRequest;
21272 /// use wkt::FieldMask;
21273 /// let x = UpdateSecurityMarksRequest::new().set_update_mask(FieldMask::default()/* use setters */);
21274 /// ```
21275 pub fn set_update_mask<T>(mut self, v: T) -> Self
21276 where
21277 T: std::convert::Into<wkt::FieldMask>,
21278 {
21279 self.update_mask = std::option::Option::Some(v.into());
21280 self
21281 }
21282
21283 /// Sets or clears the value of [update_mask][crate::model::UpdateSecurityMarksRequest::update_mask].
21284 ///
21285 /// # Example
21286 /// ```ignore,no_run
21287 /// # use google_cloud_securitycenter_v2::model::UpdateSecurityMarksRequest;
21288 /// use wkt::FieldMask;
21289 /// let x = UpdateSecurityMarksRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
21290 /// let x = UpdateSecurityMarksRequest::new().set_or_clear_update_mask(None::<FieldMask>);
21291 /// ```
21292 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21293 where
21294 T: std::convert::Into<wkt::FieldMask>,
21295 {
21296 self.update_mask = v.map(|x| x.into());
21297 self
21298 }
21299}
21300
21301impl wkt::message::Message for UpdateSecurityMarksRequest {
21302 fn typename() -> &'static str {
21303 "type.googleapis.com/google.cloud.securitycenter.v2.UpdateSecurityMarksRequest"
21304 }
21305}
21306
21307/// Request message for updating a source.
21308#[derive(Clone, Default, PartialEq)]
21309#[non_exhaustive]
21310pub struct UpdateSourceRequest {
21311 /// Required. The source resource to update.
21312 pub source: std::option::Option<crate::model::Source>,
21313
21314 /// The FieldMask to use when updating the source resource.
21315 ///
21316 /// If empty all mutable fields will be updated.
21317 pub update_mask: std::option::Option<wkt::FieldMask>,
21318
21319 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21320}
21321
21322impl UpdateSourceRequest {
21323 /// Creates a new default instance.
21324 pub fn new() -> Self {
21325 std::default::Default::default()
21326 }
21327
21328 /// Sets the value of [source][crate::model::UpdateSourceRequest::source].
21329 ///
21330 /// # Example
21331 /// ```ignore,no_run
21332 /// # use google_cloud_securitycenter_v2::model::UpdateSourceRequest;
21333 /// use google_cloud_securitycenter_v2::model::Source;
21334 /// let x = UpdateSourceRequest::new().set_source(Source::default()/* use setters */);
21335 /// ```
21336 pub fn set_source<T>(mut self, v: T) -> Self
21337 where
21338 T: std::convert::Into<crate::model::Source>,
21339 {
21340 self.source = std::option::Option::Some(v.into());
21341 self
21342 }
21343
21344 /// Sets or clears the value of [source][crate::model::UpdateSourceRequest::source].
21345 ///
21346 /// # Example
21347 /// ```ignore,no_run
21348 /// # use google_cloud_securitycenter_v2::model::UpdateSourceRequest;
21349 /// use google_cloud_securitycenter_v2::model::Source;
21350 /// let x = UpdateSourceRequest::new().set_or_clear_source(Some(Source::default()/* use setters */));
21351 /// let x = UpdateSourceRequest::new().set_or_clear_source(None::<Source>);
21352 /// ```
21353 pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
21354 where
21355 T: std::convert::Into<crate::model::Source>,
21356 {
21357 self.source = v.map(|x| x.into());
21358 self
21359 }
21360
21361 /// Sets the value of [update_mask][crate::model::UpdateSourceRequest::update_mask].
21362 ///
21363 /// # Example
21364 /// ```ignore,no_run
21365 /// # use google_cloud_securitycenter_v2::model::UpdateSourceRequest;
21366 /// use wkt::FieldMask;
21367 /// let x = UpdateSourceRequest::new().set_update_mask(FieldMask::default()/* use setters */);
21368 /// ```
21369 pub fn set_update_mask<T>(mut self, v: T) -> Self
21370 where
21371 T: std::convert::Into<wkt::FieldMask>,
21372 {
21373 self.update_mask = std::option::Option::Some(v.into());
21374 self
21375 }
21376
21377 /// Sets or clears the value of [update_mask][crate::model::UpdateSourceRequest::update_mask].
21378 ///
21379 /// # Example
21380 /// ```ignore,no_run
21381 /// # use google_cloud_securitycenter_v2::model::UpdateSourceRequest;
21382 /// use wkt::FieldMask;
21383 /// let x = UpdateSourceRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
21384 /// let x = UpdateSourceRequest::new().set_or_clear_update_mask(None::<FieldMask>);
21385 /// ```
21386 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21387 where
21388 T: std::convert::Into<wkt::FieldMask>,
21389 {
21390 self.update_mask = v.map(|x| x.into());
21391 self
21392 }
21393}
21394
21395impl wkt::message::Message for UpdateSourceRequest {
21396 fn typename() -> &'static str {
21397 "type.googleapis.com/google.cloud.securitycenter.v2.UpdateSourceRequest"
21398 }
21399}
21400
21401/// Attack path simulation
21402#[derive(Clone, Default, PartialEq)]
21403#[non_exhaustive]
21404pub struct Simulation {
21405 /// Full resource name of the Simulation:
21406 /// `organizations/123/simulations/456`
21407 pub name: std::string::String,
21408
21409 /// Output only. Time simulation was created
21410 pub create_time: std::option::Option<wkt::Timestamp>,
21411
21412 /// Resource value configurations' metadata used in this simulation. Maximum of
21413 /// 100.
21414 pub resource_value_configs_metadata: std::vec::Vec<crate::model::ResourceValueConfigMetadata>,
21415
21416 /// Indicates which cloud provider was used in this simulation.
21417 pub cloud_provider: crate::model::CloudProvider,
21418
21419 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21420}
21421
21422impl Simulation {
21423 /// Creates a new default instance.
21424 pub fn new() -> Self {
21425 std::default::Default::default()
21426 }
21427
21428 /// Sets the value of [name][crate::model::Simulation::name].
21429 ///
21430 /// # Example
21431 /// ```ignore,no_run
21432 /// # use google_cloud_securitycenter_v2::model::Simulation;
21433 /// let x = Simulation::new().set_name("example");
21434 /// ```
21435 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21436 self.name = v.into();
21437 self
21438 }
21439
21440 /// Sets the value of [create_time][crate::model::Simulation::create_time].
21441 ///
21442 /// # Example
21443 /// ```ignore,no_run
21444 /// # use google_cloud_securitycenter_v2::model::Simulation;
21445 /// use wkt::Timestamp;
21446 /// let x = Simulation::new().set_create_time(Timestamp::default()/* use setters */);
21447 /// ```
21448 pub fn set_create_time<T>(mut self, v: T) -> Self
21449 where
21450 T: std::convert::Into<wkt::Timestamp>,
21451 {
21452 self.create_time = std::option::Option::Some(v.into());
21453 self
21454 }
21455
21456 /// Sets or clears the value of [create_time][crate::model::Simulation::create_time].
21457 ///
21458 /// # Example
21459 /// ```ignore,no_run
21460 /// # use google_cloud_securitycenter_v2::model::Simulation;
21461 /// use wkt::Timestamp;
21462 /// let x = Simulation::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
21463 /// let x = Simulation::new().set_or_clear_create_time(None::<Timestamp>);
21464 /// ```
21465 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
21466 where
21467 T: std::convert::Into<wkt::Timestamp>,
21468 {
21469 self.create_time = v.map(|x| x.into());
21470 self
21471 }
21472
21473 /// Sets the value of [resource_value_configs_metadata][crate::model::Simulation::resource_value_configs_metadata].
21474 ///
21475 /// # Example
21476 /// ```ignore,no_run
21477 /// # use google_cloud_securitycenter_v2::model::Simulation;
21478 /// use google_cloud_securitycenter_v2::model::ResourceValueConfigMetadata;
21479 /// let x = Simulation::new()
21480 /// .set_resource_value_configs_metadata([
21481 /// ResourceValueConfigMetadata::default()/* use setters */,
21482 /// ResourceValueConfigMetadata::default()/* use (different) setters */,
21483 /// ]);
21484 /// ```
21485 pub fn set_resource_value_configs_metadata<T, V>(mut self, v: T) -> Self
21486 where
21487 T: std::iter::IntoIterator<Item = V>,
21488 V: std::convert::Into<crate::model::ResourceValueConfigMetadata>,
21489 {
21490 use std::iter::Iterator;
21491 self.resource_value_configs_metadata = v.into_iter().map(|i| i.into()).collect();
21492 self
21493 }
21494
21495 /// Sets the value of [cloud_provider][crate::model::Simulation::cloud_provider].
21496 ///
21497 /// # Example
21498 /// ```ignore,no_run
21499 /// # use google_cloud_securitycenter_v2::model::Simulation;
21500 /// use google_cloud_securitycenter_v2::model::CloudProvider;
21501 /// let x0 = Simulation::new().set_cloud_provider(CloudProvider::GoogleCloudPlatform);
21502 /// let x1 = Simulation::new().set_cloud_provider(CloudProvider::AmazonWebServices);
21503 /// let x2 = Simulation::new().set_cloud_provider(CloudProvider::MicrosoftAzure);
21504 /// ```
21505 pub fn set_cloud_provider<T: std::convert::Into<crate::model::CloudProvider>>(
21506 mut self,
21507 v: T,
21508 ) -> Self {
21509 self.cloud_provider = v.into();
21510 self
21511 }
21512}
21513
21514impl wkt::message::Message for Simulation {
21515 fn typename() -> &'static str {
21516 "type.googleapis.com/google.cloud.securitycenter.v2.Simulation"
21517 }
21518}
21519
21520/// Security Command Center finding source. A finding source
21521/// is an entity or a mechanism that can produce a finding. A source is like a
21522/// container of findings that come from the same scanner, logger, monitor, and
21523/// other tools.
21524#[derive(Clone, Default, PartialEq)]
21525#[non_exhaustive]
21526pub struct Source {
21527 /// The relative resource name of this source. See:
21528 /// <https://cloud.google.com/apis/design/resource_names#relative_resource_name>
21529 /// Example:
21530 /// "organizations/{organization_id}/sources/{source_id}"
21531 pub name: std::string::String,
21532
21533 /// The source's display name.
21534 /// A source's display name must be unique amongst its siblings, for example,
21535 /// two sources with the same parent can't share the same display name.
21536 /// The display name must have a length between 1 and 64 characters
21537 /// (inclusive).
21538 pub display_name: std::string::String,
21539
21540 /// The description of the source (max of 1024 characters).
21541 /// Example:
21542 /// "Web Security Scanner is a web security scanner for common
21543 /// vulnerabilities in App Engine applications. It can automatically
21544 /// scan and detect four common vulnerabilities, including cross-site-scripting
21545 /// (XSS), Flash injection, mixed content (HTTP in HTTPS), and
21546 /// outdated or insecure libraries."
21547 pub description: std::string::String,
21548
21549 /// The canonical name of the finding source. It's either
21550 /// "organizations/{organization_id}/sources/{source_id}",
21551 /// "folders/{folder_id}/sources/{source_id}", or
21552 /// "projects/{project_number}/sources/{source_id}",
21553 /// depending on the closest CRM ancestor of the resource associated with the
21554 /// finding.
21555 pub canonical_name: std::string::String,
21556
21557 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21558}
21559
21560impl Source {
21561 /// Creates a new default instance.
21562 pub fn new() -> Self {
21563 std::default::Default::default()
21564 }
21565
21566 /// Sets the value of [name][crate::model::Source::name].
21567 ///
21568 /// # Example
21569 /// ```ignore,no_run
21570 /// # use google_cloud_securitycenter_v2::model::Source;
21571 /// let x = Source::new().set_name("example");
21572 /// ```
21573 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21574 self.name = v.into();
21575 self
21576 }
21577
21578 /// Sets the value of [display_name][crate::model::Source::display_name].
21579 ///
21580 /// # Example
21581 /// ```ignore,no_run
21582 /// # use google_cloud_securitycenter_v2::model::Source;
21583 /// let x = Source::new().set_display_name("example");
21584 /// ```
21585 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21586 self.display_name = v.into();
21587 self
21588 }
21589
21590 /// Sets the value of [description][crate::model::Source::description].
21591 ///
21592 /// # Example
21593 /// ```ignore,no_run
21594 /// # use google_cloud_securitycenter_v2::model::Source;
21595 /// let x = Source::new().set_description("example");
21596 /// ```
21597 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21598 self.description = v.into();
21599 self
21600 }
21601
21602 /// Sets the value of [canonical_name][crate::model::Source::canonical_name].
21603 ///
21604 /// # Example
21605 /// ```ignore,no_run
21606 /// # use google_cloud_securitycenter_v2::model::Source;
21607 /// let x = Source::new().set_canonical_name("example");
21608 /// ```
21609 pub fn set_canonical_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21610 self.canonical_name = v.into();
21611 self
21612 }
21613}
21614
21615impl wkt::message::Message for Source {
21616 fn typename() -> &'static str {
21617 "type.googleapis.com/google.cloud.securitycenter.v2.Source"
21618 }
21619}
21620
21621/// Contains details about a group of security issues that, when the issues
21622/// occur together, represent a greater risk than when the issues occur
21623/// independently. A group of such issues is referred to as a toxic
21624/// combination.
21625#[derive(Clone, Default, PartialEq)]
21626#[non_exhaustive]
21627pub struct ToxicCombination {
21628 /// The
21629 /// [Attack exposure
21630 /// score](https://cloud.google.com/security-command-center/docs/attack-exposure-learn#attack_exposure_scores)
21631 /// of this toxic combination. The score is a measure of how much this toxic
21632 /// combination exposes one or more high-value resources to potential attack.
21633 pub attack_exposure_score: f64,
21634
21635 /// List of resource names of findings associated with this toxic combination.
21636 /// For example, `organizations/123/sources/456/findings/789`.
21637 pub related_findings: std::vec::Vec<std::string::String>,
21638
21639 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21640}
21641
21642impl ToxicCombination {
21643 /// Creates a new default instance.
21644 pub fn new() -> Self {
21645 std::default::Default::default()
21646 }
21647
21648 /// Sets the value of [attack_exposure_score][crate::model::ToxicCombination::attack_exposure_score].
21649 ///
21650 /// # Example
21651 /// ```ignore,no_run
21652 /// # use google_cloud_securitycenter_v2::model::ToxicCombination;
21653 /// let x = ToxicCombination::new().set_attack_exposure_score(42.0);
21654 /// ```
21655 pub fn set_attack_exposure_score<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
21656 self.attack_exposure_score = v.into();
21657 self
21658 }
21659
21660 /// Sets the value of [related_findings][crate::model::ToxicCombination::related_findings].
21661 ///
21662 /// # Example
21663 /// ```ignore,no_run
21664 /// # use google_cloud_securitycenter_v2::model::ToxicCombination;
21665 /// let x = ToxicCombination::new().set_related_findings(["a", "b", "c"]);
21666 /// ```
21667 pub fn set_related_findings<T, V>(mut self, v: T) -> Self
21668 where
21669 T: std::iter::IntoIterator<Item = V>,
21670 V: std::convert::Into<std::string::String>,
21671 {
21672 use std::iter::Iterator;
21673 self.related_findings = v.into_iter().map(|i| i.into()).collect();
21674 self
21675 }
21676}
21677
21678impl wkt::message::Message for ToxicCombination {
21679 fn typename() -> &'static str {
21680 "type.googleapis.com/google.cloud.securitycenter.v2.ToxicCombination"
21681 }
21682}
21683
21684/// A resource that is determined to have value to a user's system
21685#[derive(Clone, Default, PartialEq)]
21686#[non_exhaustive]
21687pub struct ValuedResource {
21688 /// Valued resource name, for example,
21689 /// e.g.:
21690 /// `organizations/123/simulations/456/valuedResources/789`
21691 pub name: std::string::String,
21692
21693 /// The
21694 /// [full resource
21695 /// name](https://cloud.google.com/apis/design/resource_names#full_resource_name)
21696 /// of the valued resource.
21697 pub resource: std::string::String,
21698
21699 /// The [resource
21700 /// type](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
21701 /// of the valued resource.
21702 pub resource_type: std::string::String,
21703
21704 /// Human-readable name of the valued resource.
21705 pub display_name: std::string::String,
21706
21707 /// How valuable this resource is.
21708 pub resource_value: crate::model::valued_resource::ResourceValue,
21709
21710 /// Exposed score for this valued resource. A value of 0 means no exposure was
21711 /// detected exposure.
21712 pub exposed_score: f64,
21713
21714 /// List of resource value configurations' metadata used to determine the value
21715 /// of this resource. Maximum of 100.
21716 pub resource_value_configs_used: std::vec::Vec<crate::model::ResourceValueConfigMetadata>,
21717
21718 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21719}
21720
21721impl ValuedResource {
21722 /// Creates a new default instance.
21723 pub fn new() -> Self {
21724 std::default::Default::default()
21725 }
21726
21727 /// Sets the value of [name][crate::model::ValuedResource::name].
21728 ///
21729 /// # Example
21730 /// ```ignore,no_run
21731 /// # use google_cloud_securitycenter_v2::model::ValuedResource;
21732 /// let x = ValuedResource::new().set_name("example");
21733 /// ```
21734 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21735 self.name = v.into();
21736 self
21737 }
21738
21739 /// Sets the value of [resource][crate::model::ValuedResource::resource].
21740 ///
21741 /// # Example
21742 /// ```ignore,no_run
21743 /// # use google_cloud_securitycenter_v2::model::ValuedResource;
21744 /// let x = ValuedResource::new().set_resource("example");
21745 /// ```
21746 pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21747 self.resource = v.into();
21748 self
21749 }
21750
21751 /// Sets the value of [resource_type][crate::model::ValuedResource::resource_type].
21752 ///
21753 /// # Example
21754 /// ```ignore,no_run
21755 /// # use google_cloud_securitycenter_v2::model::ValuedResource;
21756 /// let x = ValuedResource::new().set_resource_type("example");
21757 /// ```
21758 pub fn set_resource_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21759 self.resource_type = v.into();
21760 self
21761 }
21762
21763 /// Sets the value of [display_name][crate::model::ValuedResource::display_name].
21764 ///
21765 /// # Example
21766 /// ```ignore,no_run
21767 /// # use google_cloud_securitycenter_v2::model::ValuedResource;
21768 /// let x = ValuedResource::new().set_display_name("example");
21769 /// ```
21770 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21771 self.display_name = v.into();
21772 self
21773 }
21774
21775 /// Sets the value of [resource_value][crate::model::ValuedResource::resource_value].
21776 ///
21777 /// # Example
21778 /// ```ignore,no_run
21779 /// # use google_cloud_securitycenter_v2::model::ValuedResource;
21780 /// use google_cloud_securitycenter_v2::model::valued_resource::ResourceValue;
21781 /// let x0 = ValuedResource::new().set_resource_value(ResourceValue::Low);
21782 /// let x1 = ValuedResource::new().set_resource_value(ResourceValue::Medium);
21783 /// let x2 = ValuedResource::new().set_resource_value(ResourceValue::High);
21784 /// ```
21785 pub fn set_resource_value<
21786 T: std::convert::Into<crate::model::valued_resource::ResourceValue>,
21787 >(
21788 mut self,
21789 v: T,
21790 ) -> Self {
21791 self.resource_value = v.into();
21792 self
21793 }
21794
21795 /// Sets the value of [exposed_score][crate::model::ValuedResource::exposed_score].
21796 ///
21797 /// # Example
21798 /// ```ignore,no_run
21799 /// # use google_cloud_securitycenter_v2::model::ValuedResource;
21800 /// let x = ValuedResource::new().set_exposed_score(42.0);
21801 /// ```
21802 pub fn set_exposed_score<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
21803 self.exposed_score = v.into();
21804 self
21805 }
21806
21807 /// Sets the value of [resource_value_configs_used][crate::model::ValuedResource::resource_value_configs_used].
21808 ///
21809 /// # Example
21810 /// ```ignore,no_run
21811 /// # use google_cloud_securitycenter_v2::model::ValuedResource;
21812 /// use google_cloud_securitycenter_v2::model::ResourceValueConfigMetadata;
21813 /// let x = ValuedResource::new()
21814 /// .set_resource_value_configs_used([
21815 /// ResourceValueConfigMetadata::default()/* use setters */,
21816 /// ResourceValueConfigMetadata::default()/* use (different) setters */,
21817 /// ]);
21818 /// ```
21819 pub fn set_resource_value_configs_used<T, V>(mut self, v: T) -> Self
21820 where
21821 T: std::iter::IntoIterator<Item = V>,
21822 V: std::convert::Into<crate::model::ResourceValueConfigMetadata>,
21823 {
21824 use std::iter::Iterator;
21825 self.resource_value_configs_used = v.into_iter().map(|i| i.into()).collect();
21826 self
21827 }
21828}
21829
21830impl wkt::message::Message for ValuedResource {
21831 fn typename() -> &'static str {
21832 "type.googleapis.com/google.cloud.securitycenter.v2.ValuedResource"
21833 }
21834}
21835
21836/// Defines additional types related to [ValuedResource].
21837pub mod valued_resource {
21838 #[allow(unused_imports)]
21839 use super::*;
21840
21841 /// How valuable the resource is.
21842 ///
21843 /// # Working with unknown values
21844 ///
21845 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
21846 /// additional enum variants at any time. Adding new variants is not considered
21847 /// a breaking change. Applications should write their code in anticipation of:
21848 ///
21849 /// - New values appearing in future releases of the client library, **and**
21850 /// - New values received dynamically, without application changes.
21851 ///
21852 /// Please consult the [Working with enums] section in the user guide for some
21853 /// guidelines.
21854 ///
21855 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
21856 #[derive(Clone, Debug, PartialEq)]
21857 #[non_exhaustive]
21858 pub enum ResourceValue {
21859 /// The resource value isn't specified.
21860 Unspecified,
21861 /// This is a low-value resource.
21862 Low,
21863 /// This is a medium-value resource.
21864 Medium,
21865 /// This is a high-value resource.
21866 High,
21867 /// If set, the enum was initialized with an unknown value.
21868 ///
21869 /// Applications can examine the value using [ResourceValue::value] or
21870 /// [ResourceValue::name].
21871 UnknownValue(resource_value::UnknownValue),
21872 }
21873
21874 #[doc(hidden)]
21875 pub mod resource_value {
21876 #[allow(unused_imports)]
21877 use super::*;
21878 #[derive(Clone, Debug, PartialEq)]
21879 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
21880 }
21881
21882 impl ResourceValue {
21883 /// Gets the enum value.
21884 ///
21885 /// Returns `None` if the enum contains an unknown value deserialized from
21886 /// the string representation of enums.
21887 pub fn value(&self) -> std::option::Option<i32> {
21888 match self {
21889 Self::Unspecified => std::option::Option::Some(0),
21890 Self::Low => std::option::Option::Some(1),
21891 Self::Medium => std::option::Option::Some(2),
21892 Self::High => std::option::Option::Some(3),
21893 Self::UnknownValue(u) => u.0.value(),
21894 }
21895 }
21896
21897 /// Gets the enum value as a string.
21898 ///
21899 /// Returns `None` if the enum contains an unknown value deserialized from
21900 /// the integer representation of enums.
21901 pub fn name(&self) -> std::option::Option<&str> {
21902 match self {
21903 Self::Unspecified => std::option::Option::Some("RESOURCE_VALUE_UNSPECIFIED"),
21904 Self::Low => std::option::Option::Some("RESOURCE_VALUE_LOW"),
21905 Self::Medium => std::option::Option::Some("RESOURCE_VALUE_MEDIUM"),
21906 Self::High => std::option::Option::Some("RESOURCE_VALUE_HIGH"),
21907 Self::UnknownValue(u) => u.0.name(),
21908 }
21909 }
21910 }
21911
21912 impl std::default::Default for ResourceValue {
21913 fn default() -> Self {
21914 use std::convert::From;
21915 Self::from(0)
21916 }
21917 }
21918
21919 impl std::fmt::Display for ResourceValue {
21920 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
21921 wkt::internal::display_enum(f, self.name(), self.value())
21922 }
21923 }
21924
21925 impl std::convert::From<i32> for ResourceValue {
21926 fn from(value: i32) -> Self {
21927 match value {
21928 0 => Self::Unspecified,
21929 1 => Self::Low,
21930 2 => Self::Medium,
21931 3 => Self::High,
21932 _ => Self::UnknownValue(resource_value::UnknownValue(
21933 wkt::internal::UnknownEnumValue::Integer(value),
21934 )),
21935 }
21936 }
21937 }
21938
21939 impl std::convert::From<&str> for ResourceValue {
21940 fn from(value: &str) -> Self {
21941 use std::string::ToString;
21942 match value {
21943 "RESOURCE_VALUE_UNSPECIFIED" => Self::Unspecified,
21944 "RESOURCE_VALUE_LOW" => Self::Low,
21945 "RESOURCE_VALUE_MEDIUM" => Self::Medium,
21946 "RESOURCE_VALUE_HIGH" => Self::High,
21947 _ => Self::UnknownValue(resource_value::UnknownValue(
21948 wkt::internal::UnknownEnumValue::String(value.to_string()),
21949 )),
21950 }
21951 }
21952 }
21953
21954 impl serde::ser::Serialize for ResourceValue {
21955 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
21956 where
21957 S: serde::Serializer,
21958 {
21959 match self {
21960 Self::Unspecified => serializer.serialize_i32(0),
21961 Self::Low => serializer.serialize_i32(1),
21962 Self::Medium => serializer.serialize_i32(2),
21963 Self::High => serializer.serialize_i32(3),
21964 Self::UnknownValue(u) => u.0.serialize(serializer),
21965 }
21966 }
21967 }
21968
21969 impl<'de> serde::de::Deserialize<'de> for ResourceValue {
21970 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
21971 where
21972 D: serde::Deserializer<'de>,
21973 {
21974 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResourceValue>::new(
21975 ".google.cloud.securitycenter.v2.ValuedResource.ResourceValue",
21976 ))
21977 }
21978 }
21979}
21980
21981/// Metadata about a ResourceValueConfig. For example, id and name.
21982#[derive(Clone, Default, PartialEq)]
21983#[non_exhaustive]
21984pub struct ResourceValueConfigMetadata {
21985 /// Resource value config name
21986 pub name: std::string::String,
21987
21988 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21989}
21990
21991impl ResourceValueConfigMetadata {
21992 /// Creates a new default instance.
21993 pub fn new() -> Self {
21994 std::default::Default::default()
21995 }
21996
21997 /// Sets the value of [name][crate::model::ResourceValueConfigMetadata::name].
21998 ///
21999 /// # Example
22000 /// ```ignore,no_run
22001 /// # use google_cloud_securitycenter_v2::model::ResourceValueConfigMetadata;
22002 /// let x = ResourceValueConfigMetadata::new().set_name("example");
22003 /// ```
22004 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22005 self.name = v.into();
22006 self
22007 }
22008}
22009
22010impl wkt::message::Message for ResourceValueConfigMetadata {
22011 fn typename() -> &'static str {
22012 "type.googleapis.com/google.cloud.securitycenter.v2.ResourceValueConfigMetadata"
22013 }
22014}
22015
22016/// Vertex AI-related information associated with the finding.
22017#[derive(Clone, Default, PartialEq)]
22018#[non_exhaustive]
22019pub struct VertexAi {
22020 /// Datasets associated with the finding.
22021 pub datasets: std::vec::Vec<crate::model::vertex_ai::Dataset>,
22022
22023 /// Pipelines associated with the finding.
22024 pub pipelines: std::vec::Vec<crate::model::vertex_ai::Pipeline>,
22025
22026 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22027}
22028
22029impl VertexAi {
22030 /// Creates a new default instance.
22031 pub fn new() -> Self {
22032 std::default::Default::default()
22033 }
22034
22035 /// Sets the value of [datasets][crate::model::VertexAi::datasets].
22036 ///
22037 /// # Example
22038 /// ```ignore,no_run
22039 /// # use google_cloud_securitycenter_v2::model::VertexAi;
22040 /// use google_cloud_securitycenter_v2::model::vertex_ai::Dataset;
22041 /// let x = VertexAi::new()
22042 /// .set_datasets([
22043 /// Dataset::default()/* use setters */,
22044 /// Dataset::default()/* use (different) setters */,
22045 /// ]);
22046 /// ```
22047 pub fn set_datasets<T, V>(mut self, v: T) -> Self
22048 where
22049 T: std::iter::IntoIterator<Item = V>,
22050 V: std::convert::Into<crate::model::vertex_ai::Dataset>,
22051 {
22052 use std::iter::Iterator;
22053 self.datasets = v.into_iter().map(|i| i.into()).collect();
22054 self
22055 }
22056
22057 /// Sets the value of [pipelines][crate::model::VertexAi::pipelines].
22058 ///
22059 /// # Example
22060 /// ```ignore,no_run
22061 /// # use google_cloud_securitycenter_v2::model::VertexAi;
22062 /// use google_cloud_securitycenter_v2::model::vertex_ai::Pipeline;
22063 /// let x = VertexAi::new()
22064 /// .set_pipelines([
22065 /// Pipeline::default()/* use setters */,
22066 /// Pipeline::default()/* use (different) setters */,
22067 /// ]);
22068 /// ```
22069 pub fn set_pipelines<T, V>(mut self, v: T) -> Self
22070 where
22071 T: std::iter::IntoIterator<Item = V>,
22072 V: std::convert::Into<crate::model::vertex_ai::Pipeline>,
22073 {
22074 use std::iter::Iterator;
22075 self.pipelines = v.into_iter().map(|i| i.into()).collect();
22076 self
22077 }
22078}
22079
22080impl wkt::message::Message for VertexAi {
22081 fn typename() -> &'static str {
22082 "type.googleapis.com/google.cloud.securitycenter.v2.VertexAi"
22083 }
22084}
22085
22086/// Defines additional types related to [VertexAi].
22087pub mod vertex_ai {
22088 #[allow(unused_imports)]
22089 use super::*;
22090
22091 /// Vertex AI dataset associated with the finding.
22092 #[derive(Clone, Default, PartialEq)]
22093 #[non_exhaustive]
22094 pub struct Dataset {
22095 /// Resource name of the dataset, e.g.
22096 /// projects/{project}/locations/{location}/datasets/2094040236064505856
22097 pub name: std::string::String,
22098
22099 /// The user defined display name of dataset, e.g. plants-dataset
22100 pub display_name: std::string::String,
22101
22102 /// Data source, such as a BigQuery source URI, e.g.
22103 /// bq://scc-nexus-test.AIPPtest.gsod
22104 pub source: std::string::String,
22105
22106 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22107 }
22108
22109 impl Dataset {
22110 /// Creates a new default instance.
22111 pub fn new() -> Self {
22112 std::default::Default::default()
22113 }
22114
22115 /// Sets the value of [name][crate::model::vertex_ai::Dataset::name].
22116 ///
22117 /// # Example
22118 /// ```ignore,no_run
22119 /// # use google_cloud_securitycenter_v2::model::vertex_ai::Dataset;
22120 /// let x = Dataset::new().set_name("example");
22121 /// ```
22122 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22123 self.name = v.into();
22124 self
22125 }
22126
22127 /// Sets the value of [display_name][crate::model::vertex_ai::Dataset::display_name].
22128 ///
22129 /// # Example
22130 /// ```ignore,no_run
22131 /// # use google_cloud_securitycenter_v2::model::vertex_ai::Dataset;
22132 /// let x = Dataset::new().set_display_name("example");
22133 /// ```
22134 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
22135 mut self,
22136 v: T,
22137 ) -> Self {
22138 self.display_name = v.into();
22139 self
22140 }
22141
22142 /// Sets the value of [source][crate::model::vertex_ai::Dataset::source].
22143 ///
22144 /// # Example
22145 /// ```ignore,no_run
22146 /// # use google_cloud_securitycenter_v2::model::vertex_ai::Dataset;
22147 /// let x = Dataset::new().set_source("example");
22148 /// ```
22149 pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22150 self.source = v.into();
22151 self
22152 }
22153 }
22154
22155 impl wkt::message::Message for Dataset {
22156 fn typename() -> &'static str {
22157 "type.googleapis.com/google.cloud.securitycenter.v2.VertexAi.Dataset"
22158 }
22159 }
22160
22161 /// Vertex AI training pipeline associated with the finding.
22162 #[derive(Clone, Default, PartialEq)]
22163 #[non_exhaustive]
22164 pub struct Pipeline {
22165 /// Resource name of the pipeline, e.g.
22166 /// projects/{project}/locations/{location}/trainingPipelines/5253428229225578496
22167 pub name: std::string::String,
22168
22169 /// The user-defined display name of pipeline, e.g. plants-classification
22170 pub display_name: std::string::String,
22171
22172 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22173 }
22174
22175 impl Pipeline {
22176 /// Creates a new default instance.
22177 pub fn new() -> Self {
22178 std::default::Default::default()
22179 }
22180
22181 /// Sets the value of [name][crate::model::vertex_ai::Pipeline::name].
22182 ///
22183 /// # Example
22184 /// ```ignore,no_run
22185 /// # use google_cloud_securitycenter_v2::model::vertex_ai::Pipeline;
22186 /// let x = Pipeline::new().set_name("example");
22187 /// ```
22188 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22189 self.name = v.into();
22190 self
22191 }
22192
22193 /// Sets the value of [display_name][crate::model::vertex_ai::Pipeline::display_name].
22194 ///
22195 /// # Example
22196 /// ```ignore,no_run
22197 /// # use google_cloud_securitycenter_v2::model::vertex_ai::Pipeline;
22198 /// let x = Pipeline::new().set_display_name("example");
22199 /// ```
22200 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
22201 mut self,
22202 v: T,
22203 ) -> Self {
22204 self.display_name = v.into();
22205 self
22206 }
22207 }
22208
22209 impl wkt::message::Message for Pipeline {
22210 fn typename() -> &'static str {
22211 "type.googleapis.com/google.cloud.securitycenter.v2.VertexAi.Pipeline"
22212 }
22213 }
22214}
22215
22216/// Refers to common vulnerability fields e.g. cve, cvss, cwe etc.
22217#[derive(Clone, Default, PartialEq)]
22218#[non_exhaustive]
22219pub struct Vulnerability {
22220 /// CVE stands for Common Vulnerabilities and Exposures
22221 /// (<https://cve.mitre.org/about/>)
22222 pub cve: std::option::Option<crate::model::Cve>,
22223
22224 /// The offending package is relevant to the finding.
22225 pub offending_package: std::option::Option<crate::model::Package>,
22226
22227 /// The fixed package is relevant to the finding.
22228 pub fixed_package: std::option::Option<crate::model::Package>,
22229
22230 /// The security bulletin is relevant to this finding.
22231 pub security_bulletin: std::option::Option<crate::model::SecurityBulletin>,
22232
22233 /// Provider provided risk_score based on multiple factors. The higher the risk
22234 /// score, the more risky the vulnerability is.
22235 pub provider_risk_score: i64,
22236
22237 /// Represents whether the vulnerability is reachable (detected via static
22238 /// analysis)
22239 pub reachable: bool,
22240
22241 /// Represents one or more Common Weakness Enumeration (CWE) information on
22242 /// this vulnerability.
22243 pub cwes: std::vec::Vec<crate::model::Cwe>,
22244
22245 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22246}
22247
22248impl Vulnerability {
22249 /// Creates a new default instance.
22250 pub fn new() -> Self {
22251 std::default::Default::default()
22252 }
22253
22254 /// Sets the value of [cve][crate::model::Vulnerability::cve].
22255 ///
22256 /// # Example
22257 /// ```ignore,no_run
22258 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22259 /// use google_cloud_securitycenter_v2::model::Cve;
22260 /// let x = Vulnerability::new().set_cve(Cve::default()/* use setters */);
22261 /// ```
22262 pub fn set_cve<T>(mut self, v: T) -> Self
22263 where
22264 T: std::convert::Into<crate::model::Cve>,
22265 {
22266 self.cve = std::option::Option::Some(v.into());
22267 self
22268 }
22269
22270 /// Sets or clears the value of [cve][crate::model::Vulnerability::cve].
22271 ///
22272 /// # Example
22273 /// ```ignore,no_run
22274 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22275 /// use google_cloud_securitycenter_v2::model::Cve;
22276 /// let x = Vulnerability::new().set_or_clear_cve(Some(Cve::default()/* use setters */));
22277 /// let x = Vulnerability::new().set_or_clear_cve(None::<Cve>);
22278 /// ```
22279 pub fn set_or_clear_cve<T>(mut self, v: std::option::Option<T>) -> Self
22280 where
22281 T: std::convert::Into<crate::model::Cve>,
22282 {
22283 self.cve = v.map(|x| x.into());
22284 self
22285 }
22286
22287 /// Sets the value of [offending_package][crate::model::Vulnerability::offending_package].
22288 ///
22289 /// # Example
22290 /// ```ignore,no_run
22291 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22292 /// use google_cloud_securitycenter_v2::model::Package;
22293 /// let x = Vulnerability::new().set_offending_package(Package::default()/* use setters */);
22294 /// ```
22295 pub fn set_offending_package<T>(mut self, v: T) -> Self
22296 where
22297 T: std::convert::Into<crate::model::Package>,
22298 {
22299 self.offending_package = std::option::Option::Some(v.into());
22300 self
22301 }
22302
22303 /// Sets or clears the value of [offending_package][crate::model::Vulnerability::offending_package].
22304 ///
22305 /// # Example
22306 /// ```ignore,no_run
22307 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22308 /// use google_cloud_securitycenter_v2::model::Package;
22309 /// let x = Vulnerability::new().set_or_clear_offending_package(Some(Package::default()/* use setters */));
22310 /// let x = Vulnerability::new().set_or_clear_offending_package(None::<Package>);
22311 /// ```
22312 pub fn set_or_clear_offending_package<T>(mut self, v: std::option::Option<T>) -> Self
22313 where
22314 T: std::convert::Into<crate::model::Package>,
22315 {
22316 self.offending_package = v.map(|x| x.into());
22317 self
22318 }
22319
22320 /// Sets the value of [fixed_package][crate::model::Vulnerability::fixed_package].
22321 ///
22322 /// # Example
22323 /// ```ignore,no_run
22324 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22325 /// use google_cloud_securitycenter_v2::model::Package;
22326 /// let x = Vulnerability::new().set_fixed_package(Package::default()/* use setters */);
22327 /// ```
22328 pub fn set_fixed_package<T>(mut self, v: T) -> Self
22329 where
22330 T: std::convert::Into<crate::model::Package>,
22331 {
22332 self.fixed_package = std::option::Option::Some(v.into());
22333 self
22334 }
22335
22336 /// Sets or clears the value of [fixed_package][crate::model::Vulnerability::fixed_package].
22337 ///
22338 /// # Example
22339 /// ```ignore,no_run
22340 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22341 /// use google_cloud_securitycenter_v2::model::Package;
22342 /// let x = Vulnerability::new().set_or_clear_fixed_package(Some(Package::default()/* use setters */));
22343 /// let x = Vulnerability::new().set_or_clear_fixed_package(None::<Package>);
22344 /// ```
22345 pub fn set_or_clear_fixed_package<T>(mut self, v: std::option::Option<T>) -> Self
22346 where
22347 T: std::convert::Into<crate::model::Package>,
22348 {
22349 self.fixed_package = v.map(|x| x.into());
22350 self
22351 }
22352
22353 /// Sets the value of [security_bulletin][crate::model::Vulnerability::security_bulletin].
22354 ///
22355 /// # Example
22356 /// ```ignore,no_run
22357 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22358 /// use google_cloud_securitycenter_v2::model::SecurityBulletin;
22359 /// let x = Vulnerability::new().set_security_bulletin(SecurityBulletin::default()/* use setters */);
22360 /// ```
22361 pub fn set_security_bulletin<T>(mut self, v: T) -> Self
22362 where
22363 T: std::convert::Into<crate::model::SecurityBulletin>,
22364 {
22365 self.security_bulletin = std::option::Option::Some(v.into());
22366 self
22367 }
22368
22369 /// Sets or clears the value of [security_bulletin][crate::model::Vulnerability::security_bulletin].
22370 ///
22371 /// # Example
22372 /// ```ignore,no_run
22373 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22374 /// use google_cloud_securitycenter_v2::model::SecurityBulletin;
22375 /// let x = Vulnerability::new().set_or_clear_security_bulletin(Some(SecurityBulletin::default()/* use setters */));
22376 /// let x = Vulnerability::new().set_or_clear_security_bulletin(None::<SecurityBulletin>);
22377 /// ```
22378 pub fn set_or_clear_security_bulletin<T>(mut self, v: std::option::Option<T>) -> Self
22379 where
22380 T: std::convert::Into<crate::model::SecurityBulletin>,
22381 {
22382 self.security_bulletin = v.map(|x| x.into());
22383 self
22384 }
22385
22386 /// Sets the value of [provider_risk_score][crate::model::Vulnerability::provider_risk_score].
22387 ///
22388 /// # Example
22389 /// ```ignore,no_run
22390 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22391 /// let x = Vulnerability::new().set_provider_risk_score(42);
22392 /// ```
22393 pub fn set_provider_risk_score<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
22394 self.provider_risk_score = v.into();
22395 self
22396 }
22397
22398 /// Sets the value of [reachable][crate::model::Vulnerability::reachable].
22399 ///
22400 /// # Example
22401 /// ```ignore,no_run
22402 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22403 /// let x = Vulnerability::new().set_reachable(true);
22404 /// ```
22405 pub fn set_reachable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
22406 self.reachable = v.into();
22407 self
22408 }
22409
22410 /// Sets the value of [cwes][crate::model::Vulnerability::cwes].
22411 ///
22412 /// # Example
22413 /// ```ignore,no_run
22414 /// # use google_cloud_securitycenter_v2::model::Vulnerability;
22415 /// use google_cloud_securitycenter_v2::model::Cwe;
22416 /// let x = Vulnerability::new()
22417 /// .set_cwes([
22418 /// Cwe::default()/* use setters */,
22419 /// Cwe::default()/* use (different) setters */,
22420 /// ]);
22421 /// ```
22422 pub fn set_cwes<T, V>(mut self, v: T) -> Self
22423 where
22424 T: std::iter::IntoIterator<Item = V>,
22425 V: std::convert::Into<crate::model::Cwe>,
22426 {
22427 use std::iter::Iterator;
22428 self.cwes = v.into_iter().map(|i| i.into()).collect();
22429 self
22430 }
22431}
22432
22433impl wkt::message::Message for Vulnerability {
22434 fn typename() -> &'static str {
22435 "type.googleapis.com/google.cloud.securitycenter.v2.Vulnerability"
22436 }
22437}
22438
22439/// CVE stands for Common Vulnerabilities and Exposures.
22440/// Information from the [CVE
22441/// record](https://www.cve.org/ResourcesSupport/Glossary) that describes this
22442/// vulnerability.
22443#[derive(Clone, Default, PartialEq)]
22444#[non_exhaustive]
22445pub struct Cve {
22446 /// The unique identifier for the vulnerability. e.g. CVE-2021-34527
22447 pub id: std::string::String,
22448
22449 /// Additional information about the CVE.
22450 /// e.g. <https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-34527>
22451 pub references: std::vec::Vec<crate::model::Reference>,
22452
22453 /// Describe Common Vulnerability Scoring System specified at
22454 /// <https://www.first.org/cvss/v3.1/specification-document>
22455 pub cvssv3: std::option::Option<crate::model::Cvssv3>,
22456
22457 /// Whether upstream fix is available for the CVE.
22458 pub upstream_fix_available: bool,
22459
22460 /// The potential impact of the vulnerability if it was to be exploited.
22461 pub impact: crate::model::cve::RiskRating,
22462
22463 /// The exploitation activity of the vulnerability in the wild.
22464 pub exploitation_activity: crate::model::cve::ExploitationActivity,
22465
22466 /// Whether or not the vulnerability has been observed in the wild.
22467 pub observed_in_the_wild: bool,
22468
22469 /// Whether or not the vulnerability was zero day when the finding was
22470 /// published.
22471 pub zero_day: bool,
22472
22473 /// Date the first publicly available exploit or PoC was released.
22474 pub exploit_release_date: std::option::Option<wkt::Timestamp>,
22475
22476 /// Date of the earliest known exploitation.
22477 pub first_exploitation_date: std::option::Option<wkt::Timestamp>,
22478
22479 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22480}
22481
22482impl Cve {
22483 /// Creates a new default instance.
22484 pub fn new() -> Self {
22485 std::default::Default::default()
22486 }
22487
22488 /// Sets the value of [id][crate::model::Cve::id].
22489 ///
22490 /// # Example
22491 /// ```ignore,no_run
22492 /// # use google_cloud_securitycenter_v2::model::Cve;
22493 /// let x = Cve::new().set_id("example");
22494 /// ```
22495 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22496 self.id = v.into();
22497 self
22498 }
22499
22500 /// Sets the value of [references][crate::model::Cve::references].
22501 ///
22502 /// # Example
22503 /// ```ignore,no_run
22504 /// # use google_cloud_securitycenter_v2::model::Cve;
22505 /// use google_cloud_securitycenter_v2::model::Reference;
22506 /// let x = Cve::new()
22507 /// .set_references([
22508 /// Reference::default()/* use setters */,
22509 /// Reference::default()/* use (different) setters */,
22510 /// ]);
22511 /// ```
22512 pub fn set_references<T, V>(mut self, v: T) -> Self
22513 where
22514 T: std::iter::IntoIterator<Item = V>,
22515 V: std::convert::Into<crate::model::Reference>,
22516 {
22517 use std::iter::Iterator;
22518 self.references = v.into_iter().map(|i| i.into()).collect();
22519 self
22520 }
22521
22522 /// Sets the value of [cvssv3][crate::model::Cve::cvssv3].
22523 ///
22524 /// # Example
22525 /// ```ignore,no_run
22526 /// # use google_cloud_securitycenter_v2::model::Cve;
22527 /// use google_cloud_securitycenter_v2::model::Cvssv3;
22528 /// let x = Cve::new().set_cvssv3(Cvssv3::default()/* use setters */);
22529 /// ```
22530 pub fn set_cvssv3<T>(mut self, v: T) -> Self
22531 where
22532 T: std::convert::Into<crate::model::Cvssv3>,
22533 {
22534 self.cvssv3 = std::option::Option::Some(v.into());
22535 self
22536 }
22537
22538 /// Sets or clears the value of [cvssv3][crate::model::Cve::cvssv3].
22539 ///
22540 /// # Example
22541 /// ```ignore,no_run
22542 /// # use google_cloud_securitycenter_v2::model::Cve;
22543 /// use google_cloud_securitycenter_v2::model::Cvssv3;
22544 /// let x = Cve::new().set_or_clear_cvssv3(Some(Cvssv3::default()/* use setters */));
22545 /// let x = Cve::new().set_or_clear_cvssv3(None::<Cvssv3>);
22546 /// ```
22547 pub fn set_or_clear_cvssv3<T>(mut self, v: std::option::Option<T>) -> Self
22548 where
22549 T: std::convert::Into<crate::model::Cvssv3>,
22550 {
22551 self.cvssv3 = v.map(|x| x.into());
22552 self
22553 }
22554
22555 /// Sets the value of [upstream_fix_available][crate::model::Cve::upstream_fix_available].
22556 ///
22557 /// # Example
22558 /// ```ignore,no_run
22559 /// # use google_cloud_securitycenter_v2::model::Cve;
22560 /// let x = Cve::new().set_upstream_fix_available(true);
22561 /// ```
22562 pub fn set_upstream_fix_available<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
22563 self.upstream_fix_available = v.into();
22564 self
22565 }
22566
22567 /// Sets the value of [impact][crate::model::Cve::impact].
22568 ///
22569 /// # Example
22570 /// ```ignore,no_run
22571 /// # use google_cloud_securitycenter_v2::model::Cve;
22572 /// use google_cloud_securitycenter_v2::model::cve::RiskRating;
22573 /// let x0 = Cve::new().set_impact(RiskRating::Low);
22574 /// let x1 = Cve::new().set_impact(RiskRating::Medium);
22575 /// let x2 = Cve::new().set_impact(RiskRating::High);
22576 /// ```
22577 pub fn set_impact<T: std::convert::Into<crate::model::cve::RiskRating>>(
22578 mut self,
22579 v: T,
22580 ) -> Self {
22581 self.impact = v.into();
22582 self
22583 }
22584
22585 /// Sets the value of [exploitation_activity][crate::model::Cve::exploitation_activity].
22586 ///
22587 /// # Example
22588 /// ```ignore,no_run
22589 /// # use google_cloud_securitycenter_v2::model::Cve;
22590 /// use google_cloud_securitycenter_v2::model::cve::ExploitationActivity;
22591 /// let x0 = Cve::new().set_exploitation_activity(ExploitationActivity::Wide);
22592 /// let x1 = Cve::new().set_exploitation_activity(ExploitationActivity::Confirmed);
22593 /// let x2 = Cve::new().set_exploitation_activity(ExploitationActivity::Available);
22594 /// ```
22595 pub fn set_exploitation_activity<
22596 T: std::convert::Into<crate::model::cve::ExploitationActivity>,
22597 >(
22598 mut self,
22599 v: T,
22600 ) -> Self {
22601 self.exploitation_activity = v.into();
22602 self
22603 }
22604
22605 /// Sets the value of [observed_in_the_wild][crate::model::Cve::observed_in_the_wild].
22606 ///
22607 /// # Example
22608 /// ```ignore,no_run
22609 /// # use google_cloud_securitycenter_v2::model::Cve;
22610 /// let x = Cve::new().set_observed_in_the_wild(true);
22611 /// ```
22612 pub fn set_observed_in_the_wild<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
22613 self.observed_in_the_wild = v.into();
22614 self
22615 }
22616
22617 /// Sets the value of [zero_day][crate::model::Cve::zero_day].
22618 ///
22619 /// # Example
22620 /// ```ignore,no_run
22621 /// # use google_cloud_securitycenter_v2::model::Cve;
22622 /// let x = Cve::new().set_zero_day(true);
22623 /// ```
22624 pub fn set_zero_day<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
22625 self.zero_day = v.into();
22626 self
22627 }
22628
22629 /// Sets the value of [exploit_release_date][crate::model::Cve::exploit_release_date].
22630 ///
22631 /// # Example
22632 /// ```ignore,no_run
22633 /// # use google_cloud_securitycenter_v2::model::Cve;
22634 /// use wkt::Timestamp;
22635 /// let x = Cve::new().set_exploit_release_date(Timestamp::default()/* use setters */);
22636 /// ```
22637 pub fn set_exploit_release_date<T>(mut self, v: T) -> Self
22638 where
22639 T: std::convert::Into<wkt::Timestamp>,
22640 {
22641 self.exploit_release_date = std::option::Option::Some(v.into());
22642 self
22643 }
22644
22645 /// Sets or clears the value of [exploit_release_date][crate::model::Cve::exploit_release_date].
22646 ///
22647 /// # Example
22648 /// ```ignore,no_run
22649 /// # use google_cloud_securitycenter_v2::model::Cve;
22650 /// use wkt::Timestamp;
22651 /// let x = Cve::new().set_or_clear_exploit_release_date(Some(Timestamp::default()/* use setters */));
22652 /// let x = Cve::new().set_or_clear_exploit_release_date(None::<Timestamp>);
22653 /// ```
22654 pub fn set_or_clear_exploit_release_date<T>(mut self, v: std::option::Option<T>) -> Self
22655 where
22656 T: std::convert::Into<wkt::Timestamp>,
22657 {
22658 self.exploit_release_date = v.map(|x| x.into());
22659 self
22660 }
22661
22662 /// Sets the value of [first_exploitation_date][crate::model::Cve::first_exploitation_date].
22663 ///
22664 /// # Example
22665 /// ```ignore,no_run
22666 /// # use google_cloud_securitycenter_v2::model::Cve;
22667 /// use wkt::Timestamp;
22668 /// let x = Cve::new().set_first_exploitation_date(Timestamp::default()/* use setters */);
22669 /// ```
22670 pub fn set_first_exploitation_date<T>(mut self, v: T) -> Self
22671 where
22672 T: std::convert::Into<wkt::Timestamp>,
22673 {
22674 self.first_exploitation_date = std::option::Option::Some(v.into());
22675 self
22676 }
22677
22678 /// Sets or clears the value of [first_exploitation_date][crate::model::Cve::first_exploitation_date].
22679 ///
22680 /// # Example
22681 /// ```ignore,no_run
22682 /// # use google_cloud_securitycenter_v2::model::Cve;
22683 /// use wkt::Timestamp;
22684 /// let x = Cve::new().set_or_clear_first_exploitation_date(Some(Timestamp::default()/* use setters */));
22685 /// let x = Cve::new().set_or_clear_first_exploitation_date(None::<Timestamp>);
22686 /// ```
22687 pub fn set_or_clear_first_exploitation_date<T>(mut self, v: std::option::Option<T>) -> Self
22688 where
22689 T: std::convert::Into<wkt::Timestamp>,
22690 {
22691 self.first_exploitation_date = v.map(|x| x.into());
22692 self
22693 }
22694}
22695
22696impl wkt::message::Message for Cve {
22697 fn typename() -> &'static str {
22698 "type.googleapis.com/google.cloud.securitycenter.v2.Cve"
22699 }
22700}
22701
22702/// Defines additional types related to [Cve].
22703pub mod cve {
22704 #[allow(unused_imports)]
22705 use super::*;
22706
22707 /// The possible values of impact of the vulnerability if it was to be
22708 /// exploited.
22709 ///
22710 /// # Working with unknown values
22711 ///
22712 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22713 /// additional enum variants at any time. Adding new variants is not considered
22714 /// a breaking change. Applications should write their code in anticipation of:
22715 ///
22716 /// - New values appearing in future releases of the client library, **and**
22717 /// - New values received dynamically, without application changes.
22718 ///
22719 /// Please consult the [Working with enums] section in the user guide for some
22720 /// guidelines.
22721 ///
22722 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
22723 #[derive(Clone, Debug, PartialEq)]
22724 #[non_exhaustive]
22725 pub enum RiskRating {
22726 /// Invalid or empty value.
22727 Unspecified,
22728 /// Exploitation would have little to no security impact.
22729 Low,
22730 /// Exploitation would enable attackers to perform activities, or could allow
22731 /// attackers to have a direct impact, but would require additional steps.
22732 Medium,
22733 /// Exploitation would enable attackers to have a notable direct impact
22734 /// without needing to overcome any major mitigating factors.
22735 High,
22736 /// Exploitation would fundamentally undermine the security of affected
22737 /// systems, enable actors to perform significant attacks with minimal
22738 /// effort, with little to no mitigating factors to overcome.
22739 Critical,
22740 /// If set, the enum was initialized with an unknown value.
22741 ///
22742 /// Applications can examine the value using [RiskRating::value] or
22743 /// [RiskRating::name].
22744 UnknownValue(risk_rating::UnknownValue),
22745 }
22746
22747 #[doc(hidden)]
22748 pub mod risk_rating {
22749 #[allow(unused_imports)]
22750 use super::*;
22751 #[derive(Clone, Debug, PartialEq)]
22752 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22753 }
22754
22755 impl RiskRating {
22756 /// Gets the enum value.
22757 ///
22758 /// Returns `None` if the enum contains an unknown value deserialized from
22759 /// the string representation of enums.
22760 pub fn value(&self) -> std::option::Option<i32> {
22761 match self {
22762 Self::Unspecified => std::option::Option::Some(0),
22763 Self::Low => std::option::Option::Some(1),
22764 Self::Medium => std::option::Option::Some(2),
22765 Self::High => std::option::Option::Some(3),
22766 Self::Critical => std::option::Option::Some(4),
22767 Self::UnknownValue(u) => u.0.value(),
22768 }
22769 }
22770
22771 /// Gets the enum value as a string.
22772 ///
22773 /// Returns `None` if the enum contains an unknown value deserialized from
22774 /// the integer representation of enums.
22775 pub fn name(&self) -> std::option::Option<&str> {
22776 match self {
22777 Self::Unspecified => std::option::Option::Some("RISK_RATING_UNSPECIFIED"),
22778 Self::Low => std::option::Option::Some("LOW"),
22779 Self::Medium => std::option::Option::Some("MEDIUM"),
22780 Self::High => std::option::Option::Some("HIGH"),
22781 Self::Critical => std::option::Option::Some("CRITICAL"),
22782 Self::UnknownValue(u) => u.0.name(),
22783 }
22784 }
22785 }
22786
22787 impl std::default::Default for RiskRating {
22788 fn default() -> Self {
22789 use std::convert::From;
22790 Self::from(0)
22791 }
22792 }
22793
22794 impl std::fmt::Display for RiskRating {
22795 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22796 wkt::internal::display_enum(f, self.name(), self.value())
22797 }
22798 }
22799
22800 impl std::convert::From<i32> for RiskRating {
22801 fn from(value: i32) -> Self {
22802 match value {
22803 0 => Self::Unspecified,
22804 1 => Self::Low,
22805 2 => Self::Medium,
22806 3 => Self::High,
22807 4 => Self::Critical,
22808 _ => Self::UnknownValue(risk_rating::UnknownValue(
22809 wkt::internal::UnknownEnumValue::Integer(value),
22810 )),
22811 }
22812 }
22813 }
22814
22815 impl std::convert::From<&str> for RiskRating {
22816 fn from(value: &str) -> Self {
22817 use std::string::ToString;
22818 match value {
22819 "RISK_RATING_UNSPECIFIED" => Self::Unspecified,
22820 "LOW" => Self::Low,
22821 "MEDIUM" => Self::Medium,
22822 "HIGH" => Self::High,
22823 "CRITICAL" => Self::Critical,
22824 _ => Self::UnknownValue(risk_rating::UnknownValue(
22825 wkt::internal::UnknownEnumValue::String(value.to_string()),
22826 )),
22827 }
22828 }
22829 }
22830
22831 impl serde::ser::Serialize for RiskRating {
22832 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22833 where
22834 S: serde::Serializer,
22835 {
22836 match self {
22837 Self::Unspecified => serializer.serialize_i32(0),
22838 Self::Low => serializer.serialize_i32(1),
22839 Self::Medium => serializer.serialize_i32(2),
22840 Self::High => serializer.serialize_i32(3),
22841 Self::Critical => serializer.serialize_i32(4),
22842 Self::UnknownValue(u) => u.0.serialize(serializer),
22843 }
22844 }
22845 }
22846
22847 impl<'de> serde::de::Deserialize<'de> for RiskRating {
22848 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22849 where
22850 D: serde::Deserializer<'de>,
22851 {
22852 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RiskRating>::new(
22853 ".google.cloud.securitycenter.v2.Cve.RiskRating",
22854 ))
22855 }
22856 }
22857
22858 /// The possible values of exploitation activity of the vulnerability in the
22859 /// wild.
22860 ///
22861 /// # Working with unknown values
22862 ///
22863 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22864 /// additional enum variants at any time. Adding new variants is not considered
22865 /// a breaking change. Applications should write their code in anticipation of:
22866 ///
22867 /// - New values appearing in future releases of the client library, **and**
22868 /// - New values received dynamically, without application changes.
22869 ///
22870 /// Please consult the [Working with enums] section in the user guide for some
22871 /// guidelines.
22872 ///
22873 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
22874 #[derive(Clone, Debug, PartialEq)]
22875 #[non_exhaustive]
22876 pub enum ExploitationActivity {
22877 /// Invalid or empty value.
22878 Unspecified,
22879 /// Exploitation has been reported or confirmed to widely occur.
22880 Wide,
22881 /// Limited reported or confirmed exploitation activities.
22882 Confirmed,
22883 /// Exploit is publicly available.
22884 Available,
22885 /// No known exploitation activity, but has a high potential for
22886 /// exploitation.
22887 Anticipated,
22888 /// No known exploitation activity.
22889 NoKnown,
22890 /// If set, the enum was initialized with an unknown value.
22891 ///
22892 /// Applications can examine the value using [ExploitationActivity::value] or
22893 /// [ExploitationActivity::name].
22894 UnknownValue(exploitation_activity::UnknownValue),
22895 }
22896
22897 #[doc(hidden)]
22898 pub mod exploitation_activity {
22899 #[allow(unused_imports)]
22900 use super::*;
22901 #[derive(Clone, Debug, PartialEq)]
22902 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22903 }
22904
22905 impl ExploitationActivity {
22906 /// Gets the enum value.
22907 ///
22908 /// Returns `None` if the enum contains an unknown value deserialized from
22909 /// the string representation of enums.
22910 pub fn value(&self) -> std::option::Option<i32> {
22911 match self {
22912 Self::Unspecified => std::option::Option::Some(0),
22913 Self::Wide => std::option::Option::Some(1),
22914 Self::Confirmed => std::option::Option::Some(2),
22915 Self::Available => std::option::Option::Some(3),
22916 Self::Anticipated => std::option::Option::Some(4),
22917 Self::NoKnown => std::option::Option::Some(5),
22918 Self::UnknownValue(u) => u.0.value(),
22919 }
22920 }
22921
22922 /// Gets the enum value as a string.
22923 ///
22924 /// Returns `None` if the enum contains an unknown value deserialized from
22925 /// the integer representation of enums.
22926 pub fn name(&self) -> std::option::Option<&str> {
22927 match self {
22928 Self::Unspecified => std::option::Option::Some("EXPLOITATION_ACTIVITY_UNSPECIFIED"),
22929 Self::Wide => std::option::Option::Some("WIDE"),
22930 Self::Confirmed => std::option::Option::Some("CONFIRMED"),
22931 Self::Available => std::option::Option::Some("AVAILABLE"),
22932 Self::Anticipated => std::option::Option::Some("ANTICIPATED"),
22933 Self::NoKnown => std::option::Option::Some("NO_KNOWN"),
22934 Self::UnknownValue(u) => u.0.name(),
22935 }
22936 }
22937 }
22938
22939 impl std::default::Default for ExploitationActivity {
22940 fn default() -> Self {
22941 use std::convert::From;
22942 Self::from(0)
22943 }
22944 }
22945
22946 impl std::fmt::Display for ExploitationActivity {
22947 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22948 wkt::internal::display_enum(f, self.name(), self.value())
22949 }
22950 }
22951
22952 impl std::convert::From<i32> for ExploitationActivity {
22953 fn from(value: i32) -> Self {
22954 match value {
22955 0 => Self::Unspecified,
22956 1 => Self::Wide,
22957 2 => Self::Confirmed,
22958 3 => Self::Available,
22959 4 => Self::Anticipated,
22960 5 => Self::NoKnown,
22961 _ => Self::UnknownValue(exploitation_activity::UnknownValue(
22962 wkt::internal::UnknownEnumValue::Integer(value),
22963 )),
22964 }
22965 }
22966 }
22967
22968 impl std::convert::From<&str> for ExploitationActivity {
22969 fn from(value: &str) -> Self {
22970 use std::string::ToString;
22971 match value {
22972 "EXPLOITATION_ACTIVITY_UNSPECIFIED" => Self::Unspecified,
22973 "WIDE" => Self::Wide,
22974 "CONFIRMED" => Self::Confirmed,
22975 "AVAILABLE" => Self::Available,
22976 "ANTICIPATED" => Self::Anticipated,
22977 "NO_KNOWN" => Self::NoKnown,
22978 _ => Self::UnknownValue(exploitation_activity::UnknownValue(
22979 wkt::internal::UnknownEnumValue::String(value.to_string()),
22980 )),
22981 }
22982 }
22983 }
22984
22985 impl serde::ser::Serialize for ExploitationActivity {
22986 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22987 where
22988 S: serde::Serializer,
22989 {
22990 match self {
22991 Self::Unspecified => serializer.serialize_i32(0),
22992 Self::Wide => serializer.serialize_i32(1),
22993 Self::Confirmed => serializer.serialize_i32(2),
22994 Self::Available => serializer.serialize_i32(3),
22995 Self::Anticipated => serializer.serialize_i32(4),
22996 Self::NoKnown => serializer.serialize_i32(5),
22997 Self::UnknownValue(u) => u.0.serialize(serializer),
22998 }
22999 }
23000 }
23001
23002 impl<'de> serde::de::Deserialize<'de> for ExploitationActivity {
23003 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23004 where
23005 D: serde::Deserializer<'de>,
23006 {
23007 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ExploitationActivity>::new(
23008 ".google.cloud.securitycenter.v2.Cve.ExploitationActivity",
23009 ))
23010 }
23011 }
23012}
23013
23014/// Additional Links
23015#[derive(Clone, Default, PartialEq)]
23016#[non_exhaustive]
23017pub struct Reference {
23018 /// Source of the reference e.g. NVD
23019 pub source: std::string::String,
23020
23021 /// Uri for the mentioned source e.g.
23022 /// <https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-34527>.
23023 pub uri: std::string::String,
23024
23025 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23026}
23027
23028impl Reference {
23029 /// Creates a new default instance.
23030 pub fn new() -> Self {
23031 std::default::Default::default()
23032 }
23033
23034 /// Sets the value of [source][crate::model::Reference::source].
23035 ///
23036 /// # Example
23037 /// ```ignore,no_run
23038 /// # use google_cloud_securitycenter_v2::model::Reference;
23039 /// let x = Reference::new().set_source("example");
23040 /// ```
23041 pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23042 self.source = v.into();
23043 self
23044 }
23045
23046 /// Sets the value of [uri][crate::model::Reference::uri].
23047 ///
23048 /// # Example
23049 /// ```ignore,no_run
23050 /// # use google_cloud_securitycenter_v2::model::Reference;
23051 /// let x = Reference::new().set_uri("example");
23052 /// ```
23053 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23054 self.uri = v.into();
23055 self
23056 }
23057}
23058
23059impl wkt::message::Message for Reference {
23060 fn typename() -> &'static str {
23061 "type.googleapis.com/google.cloud.securitycenter.v2.Reference"
23062 }
23063}
23064
23065/// Common Vulnerability Scoring System version 3.
23066#[derive(Clone, Default, PartialEq)]
23067#[non_exhaustive]
23068pub struct Cvssv3 {
23069 /// The base score is a function of the base metric scores.
23070 pub base_score: f64,
23071
23072 /// Base Metrics
23073 /// Represents the intrinsic characteristics of a vulnerability that are
23074 /// constant over time and across user environments.
23075 /// This metric reflects the context by which vulnerability exploitation is
23076 /// possible.
23077 pub attack_vector: crate::model::cvssv_3::AttackVector,
23078
23079 /// This metric describes the conditions beyond the attacker's control that
23080 /// must exist in order to exploit the vulnerability.
23081 pub attack_complexity: crate::model::cvssv_3::AttackComplexity,
23082
23083 /// This metric describes the level of privileges an attacker must possess
23084 /// before successfully exploiting the vulnerability.
23085 pub privileges_required: crate::model::cvssv_3::PrivilegesRequired,
23086
23087 /// This metric captures the requirement for a human user, other than the
23088 /// attacker, to participate in the successful compromise of the vulnerable
23089 /// component.
23090 pub user_interaction: crate::model::cvssv_3::UserInteraction,
23091
23092 /// The Scope metric captures whether a vulnerability in one vulnerable
23093 /// component impacts resources in components beyond its security scope.
23094 pub scope: crate::model::cvssv_3::Scope,
23095
23096 /// This metric measures the impact to the confidentiality of the information
23097 /// resources managed by a software component due to a successfully exploited
23098 /// vulnerability.
23099 pub confidentiality_impact: crate::model::cvssv_3::Impact,
23100
23101 /// This metric measures the impact to integrity of a successfully exploited
23102 /// vulnerability.
23103 pub integrity_impact: crate::model::cvssv_3::Impact,
23104
23105 /// This metric measures the impact to the availability of the impacted
23106 /// component resulting from a successfully exploited vulnerability.
23107 pub availability_impact: crate::model::cvssv_3::Impact,
23108
23109 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23110}
23111
23112impl Cvssv3 {
23113 /// Creates a new default instance.
23114 pub fn new() -> Self {
23115 std::default::Default::default()
23116 }
23117
23118 /// Sets the value of [base_score][crate::model::Cvssv3::base_score].
23119 ///
23120 /// # Example
23121 /// ```ignore,no_run
23122 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
23123 /// let x = Cvssv3::new().set_base_score(42.0);
23124 /// ```
23125 pub fn set_base_score<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
23126 self.base_score = v.into();
23127 self
23128 }
23129
23130 /// Sets the value of [attack_vector][crate::model::Cvssv3::attack_vector].
23131 ///
23132 /// # Example
23133 /// ```ignore,no_run
23134 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
23135 /// use google_cloud_securitycenter_v2::model::cvssv_3::AttackVector;
23136 /// let x0 = Cvssv3::new().set_attack_vector(AttackVector::Network);
23137 /// let x1 = Cvssv3::new().set_attack_vector(AttackVector::Adjacent);
23138 /// let x2 = Cvssv3::new().set_attack_vector(AttackVector::Local);
23139 /// ```
23140 pub fn set_attack_vector<T: std::convert::Into<crate::model::cvssv_3::AttackVector>>(
23141 mut self,
23142 v: T,
23143 ) -> Self {
23144 self.attack_vector = v.into();
23145 self
23146 }
23147
23148 /// Sets the value of [attack_complexity][crate::model::Cvssv3::attack_complexity].
23149 ///
23150 /// # Example
23151 /// ```ignore,no_run
23152 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
23153 /// use google_cloud_securitycenter_v2::model::cvssv_3::AttackComplexity;
23154 /// let x0 = Cvssv3::new().set_attack_complexity(AttackComplexity::Low);
23155 /// let x1 = Cvssv3::new().set_attack_complexity(AttackComplexity::High);
23156 /// ```
23157 pub fn set_attack_complexity<T: std::convert::Into<crate::model::cvssv_3::AttackComplexity>>(
23158 mut self,
23159 v: T,
23160 ) -> Self {
23161 self.attack_complexity = v.into();
23162 self
23163 }
23164
23165 /// Sets the value of [privileges_required][crate::model::Cvssv3::privileges_required].
23166 ///
23167 /// # Example
23168 /// ```ignore,no_run
23169 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
23170 /// use google_cloud_securitycenter_v2::model::cvssv_3::PrivilegesRequired;
23171 /// let x0 = Cvssv3::new().set_privileges_required(PrivilegesRequired::None);
23172 /// let x1 = Cvssv3::new().set_privileges_required(PrivilegesRequired::Low);
23173 /// let x2 = Cvssv3::new().set_privileges_required(PrivilegesRequired::High);
23174 /// ```
23175 pub fn set_privileges_required<
23176 T: std::convert::Into<crate::model::cvssv_3::PrivilegesRequired>,
23177 >(
23178 mut self,
23179 v: T,
23180 ) -> Self {
23181 self.privileges_required = v.into();
23182 self
23183 }
23184
23185 /// Sets the value of [user_interaction][crate::model::Cvssv3::user_interaction].
23186 ///
23187 /// # Example
23188 /// ```ignore,no_run
23189 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
23190 /// use google_cloud_securitycenter_v2::model::cvssv_3::UserInteraction;
23191 /// let x0 = Cvssv3::new().set_user_interaction(UserInteraction::None);
23192 /// let x1 = Cvssv3::new().set_user_interaction(UserInteraction::Required);
23193 /// ```
23194 pub fn set_user_interaction<T: std::convert::Into<crate::model::cvssv_3::UserInteraction>>(
23195 mut self,
23196 v: T,
23197 ) -> Self {
23198 self.user_interaction = v.into();
23199 self
23200 }
23201
23202 /// Sets the value of [scope][crate::model::Cvssv3::scope].
23203 ///
23204 /// # Example
23205 /// ```ignore,no_run
23206 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
23207 /// use google_cloud_securitycenter_v2::model::cvssv_3::Scope;
23208 /// let x0 = Cvssv3::new().set_scope(Scope::Unchanged);
23209 /// let x1 = Cvssv3::new().set_scope(Scope::Changed);
23210 /// ```
23211 pub fn set_scope<T: std::convert::Into<crate::model::cvssv_3::Scope>>(mut self, v: T) -> Self {
23212 self.scope = v.into();
23213 self
23214 }
23215
23216 /// Sets the value of [confidentiality_impact][crate::model::Cvssv3::confidentiality_impact].
23217 ///
23218 /// # Example
23219 /// ```ignore,no_run
23220 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
23221 /// use google_cloud_securitycenter_v2::model::cvssv_3::Impact;
23222 /// let x0 = Cvssv3::new().set_confidentiality_impact(Impact::High);
23223 /// let x1 = Cvssv3::new().set_confidentiality_impact(Impact::Low);
23224 /// let x2 = Cvssv3::new().set_confidentiality_impact(Impact::None);
23225 /// ```
23226 pub fn set_confidentiality_impact<T: std::convert::Into<crate::model::cvssv_3::Impact>>(
23227 mut self,
23228 v: T,
23229 ) -> Self {
23230 self.confidentiality_impact = v.into();
23231 self
23232 }
23233
23234 /// Sets the value of [integrity_impact][crate::model::Cvssv3::integrity_impact].
23235 ///
23236 /// # Example
23237 /// ```ignore,no_run
23238 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
23239 /// use google_cloud_securitycenter_v2::model::cvssv_3::Impact;
23240 /// let x0 = Cvssv3::new().set_integrity_impact(Impact::High);
23241 /// let x1 = Cvssv3::new().set_integrity_impact(Impact::Low);
23242 /// let x2 = Cvssv3::new().set_integrity_impact(Impact::None);
23243 /// ```
23244 pub fn set_integrity_impact<T: std::convert::Into<crate::model::cvssv_3::Impact>>(
23245 mut self,
23246 v: T,
23247 ) -> Self {
23248 self.integrity_impact = v.into();
23249 self
23250 }
23251
23252 /// Sets the value of [availability_impact][crate::model::Cvssv3::availability_impact].
23253 ///
23254 /// # Example
23255 /// ```ignore,no_run
23256 /// # use google_cloud_securitycenter_v2::model::Cvssv3;
23257 /// use google_cloud_securitycenter_v2::model::cvssv_3::Impact;
23258 /// let x0 = Cvssv3::new().set_availability_impact(Impact::High);
23259 /// let x1 = Cvssv3::new().set_availability_impact(Impact::Low);
23260 /// let x2 = Cvssv3::new().set_availability_impact(Impact::None);
23261 /// ```
23262 pub fn set_availability_impact<T: std::convert::Into<crate::model::cvssv_3::Impact>>(
23263 mut self,
23264 v: T,
23265 ) -> Self {
23266 self.availability_impact = v.into();
23267 self
23268 }
23269}
23270
23271impl wkt::message::Message for Cvssv3 {
23272 fn typename() -> &'static str {
23273 "type.googleapis.com/google.cloud.securitycenter.v2.Cvssv3"
23274 }
23275}
23276
23277/// Defines additional types related to [Cvssv3].
23278pub mod cvssv_3 {
23279 #[allow(unused_imports)]
23280 use super::*;
23281
23282 /// This metric reflects the context by which vulnerability exploitation is
23283 /// possible.
23284 ///
23285 /// # Working with unknown values
23286 ///
23287 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23288 /// additional enum variants at any time. Adding new variants is not considered
23289 /// a breaking change. Applications should write their code in anticipation of:
23290 ///
23291 /// - New values appearing in future releases of the client library, **and**
23292 /// - New values received dynamically, without application changes.
23293 ///
23294 /// Please consult the [Working with enums] section in the user guide for some
23295 /// guidelines.
23296 ///
23297 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
23298 #[derive(Clone, Debug, PartialEq)]
23299 #[non_exhaustive]
23300 pub enum AttackVector {
23301 /// Invalid value.
23302 Unspecified,
23303 /// The vulnerable component is bound to the network stack and the set of
23304 /// possible attackers extends beyond the other options listed below, up to
23305 /// and including the entire Internet.
23306 Network,
23307 /// The vulnerable component is bound to the network stack, but the attack is
23308 /// limited at the protocol level to a logically adjacent topology.
23309 Adjacent,
23310 /// The vulnerable component is not bound to the network stack and the
23311 /// attacker's path is via read/write/execute capabilities.
23312 Local,
23313 /// The attack requires the attacker to physically touch or manipulate the
23314 /// vulnerable component.
23315 Physical,
23316 /// If set, the enum was initialized with an unknown value.
23317 ///
23318 /// Applications can examine the value using [AttackVector::value] or
23319 /// [AttackVector::name].
23320 UnknownValue(attack_vector::UnknownValue),
23321 }
23322
23323 #[doc(hidden)]
23324 pub mod attack_vector {
23325 #[allow(unused_imports)]
23326 use super::*;
23327 #[derive(Clone, Debug, PartialEq)]
23328 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23329 }
23330
23331 impl AttackVector {
23332 /// Gets the enum value.
23333 ///
23334 /// Returns `None` if the enum contains an unknown value deserialized from
23335 /// the string representation of enums.
23336 pub fn value(&self) -> std::option::Option<i32> {
23337 match self {
23338 Self::Unspecified => std::option::Option::Some(0),
23339 Self::Network => std::option::Option::Some(1),
23340 Self::Adjacent => std::option::Option::Some(2),
23341 Self::Local => std::option::Option::Some(3),
23342 Self::Physical => std::option::Option::Some(4),
23343 Self::UnknownValue(u) => u.0.value(),
23344 }
23345 }
23346
23347 /// Gets the enum value as a string.
23348 ///
23349 /// Returns `None` if the enum contains an unknown value deserialized from
23350 /// the integer representation of enums.
23351 pub fn name(&self) -> std::option::Option<&str> {
23352 match self {
23353 Self::Unspecified => std::option::Option::Some("ATTACK_VECTOR_UNSPECIFIED"),
23354 Self::Network => std::option::Option::Some("ATTACK_VECTOR_NETWORK"),
23355 Self::Adjacent => std::option::Option::Some("ATTACK_VECTOR_ADJACENT"),
23356 Self::Local => std::option::Option::Some("ATTACK_VECTOR_LOCAL"),
23357 Self::Physical => std::option::Option::Some("ATTACK_VECTOR_PHYSICAL"),
23358 Self::UnknownValue(u) => u.0.name(),
23359 }
23360 }
23361 }
23362
23363 impl std::default::Default for AttackVector {
23364 fn default() -> Self {
23365 use std::convert::From;
23366 Self::from(0)
23367 }
23368 }
23369
23370 impl std::fmt::Display for AttackVector {
23371 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23372 wkt::internal::display_enum(f, self.name(), self.value())
23373 }
23374 }
23375
23376 impl std::convert::From<i32> for AttackVector {
23377 fn from(value: i32) -> Self {
23378 match value {
23379 0 => Self::Unspecified,
23380 1 => Self::Network,
23381 2 => Self::Adjacent,
23382 3 => Self::Local,
23383 4 => Self::Physical,
23384 _ => Self::UnknownValue(attack_vector::UnknownValue(
23385 wkt::internal::UnknownEnumValue::Integer(value),
23386 )),
23387 }
23388 }
23389 }
23390
23391 impl std::convert::From<&str> for AttackVector {
23392 fn from(value: &str) -> Self {
23393 use std::string::ToString;
23394 match value {
23395 "ATTACK_VECTOR_UNSPECIFIED" => Self::Unspecified,
23396 "ATTACK_VECTOR_NETWORK" => Self::Network,
23397 "ATTACK_VECTOR_ADJACENT" => Self::Adjacent,
23398 "ATTACK_VECTOR_LOCAL" => Self::Local,
23399 "ATTACK_VECTOR_PHYSICAL" => Self::Physical,
23400 _ => Self::UnknownValue(attack_vector::UnknownValue(
23401 wkt::internal::UnknownEnumValue::String(value.to_string()),
23402 )),
23403 }
23404 }
23405 }
23406
23407 impl serde::ser::Serialize for AttackVector {
23408 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23409 where
23410 S: serde::Serializer,
23411 {
23412 match self {
23413 Self::Unspecified => serializer.serialize_i32(0),
23414 Self::Network => serializer.serialize_i32(1),
23415 Self::Adjacent => serializer.serialize_i32(2),
23416 Self::Local => serializer.serialize_i32(3),
23417 Self::Physical => serializer.serialize_i32(4),
23418 Self::UnknownValue(u) => u.0.serialize(serializer),
23419 }
23420 }
23421 }
23422
23423 impl<'de> serde::de::Deserialize<'de> for AttackVector {
23424 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23425 where
23426 D: serde::Deserializer<'de>,
23427 {
23428 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AttackVector>::new(
23429 ".google.cloud.securitycenter.v2.Cvssv3.AttackVector",
23430 ))
23431 }
23432 }
23433
23434 /// This metric describes the conditions beyond the attacker's control that
23435 /// must exist in order to exploit the vulnerability.
23436 ///
23437 /// # Working with unknown values
23438 ///
23439 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23440 /// additional enum variants at any time. Adding new variants is not considered
23441 /// a breaking change. Applications should write their code in anticipation of:
23442 ///
23443 /// - New values appearing in future releases of the client library, **and**
23444 /// - New values received dynamically, without application changes.
23445 ///
23446 /// Please consult the [Working with enums] section in the user guide for some
23447 /// guidelines.
23448 ///
23449 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
23450 #[derive(Clone, Debug, PartialEq)]
23451 #[non_exhaustive]
23452 pub enum AttackComplexity {
23453 /// Invalid value.
23454 Unspecified,
23455 /// Specialized access conditions or extenuating circumstances do not exist.
23456 /// An attacker can expect repeatable success when attacking the vulnerable
23457 /// component.
23458 Low,
23459 /// A successful attack depends on conditions beyond the attacker's control.
23460 /// That is, a successful attack cannot be accomplished at will, but requires
23461 /// the attacker to invest in some measurable amount of effort in preparation
23462 /// or execution against the vulnerable component before a successful attack
23463 /// can be expected.
23464 High,
23465 /// If set, the enum was initialized with an unknown value.
23466 ///
23467 /// Applications can examine the value using [AttackComplexity::value] or
23468 /// [AttackComplexity::name].
23469 UnknownValue(attack_complexity::UnknownValue),
23470 }
23471
23472 #[doc(hidden)]
23473 pub mod attack_complexity {
23474 #[allow(unused_imports)]
23475 use super::*;
23476 #[derive(Clone, Debug, PartialEq)]
23477 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23478 }
23479
23480 impl AttackComplexity {
23481 /// Gets the enum value.
23482 ///
23483 /// Returns `None` if the enum contains an unknown value deserialized from
23484 /// the string representation of enums.
23485 pub fn value(&self) -> std::option::Option<i32> {
23486 match self {
23487 Self::Unspecified => std::option::Option::Some(0),
23488 Self::Low => std::option::Option::Some(1),
23489 Self::High => std::option::Option::Some(2),
23490 Self::UnknownValue(u) => u.0.value(),
23491 }
23492 }
23493
23494 /// Gets the enum value as a string.
23495 ///
23496 /// Returns `None` if the enum contains an unknown value deserialized from
23497 /// the integer representation of enums.
23498 pub fn name(&self) -> std::option::Option<&str> {
23499 match self {
23500 Self::Unspecified => std::option::Option::Some("ATTACK_COMPLEXITY_UNSPECIFIED"),
23501 Self::Low => std::option::Option::Some("ATTACK_COMPLEXITY_LOW"),
23502 Self::High => std::option::Option::Some("ATTACK_COMPLEXITY_HIGH"),
23503 Self::UnknownValue(u) => u.0.name(),
23504 }
23505 }
23506 }
23507
23508 impl std::default::Default for AttackComplexity {
23509 fn default() -> Self {
23510 use std::convert::From;
23511 Self::from(0)
23512 }
23513 }
23514
23515 impl std::fmt::Display for AttackComplexity {
23516 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23517 wkt::internal::display_enum(f, self.name(), self.value())
23518 }
23519 }
23520
23521 impl std::convert::From<i32> for AttackComplexity {
23522 fn from(value: i32) -> Self {
23523 match value {
23524 0 => Self::Unspecified,
23525 1 => Self::Low,
23526 2 => Self::High,
23527 _ => Self::UnknownValue(attack_complexity::UnknownValue(
23528 wkt::internal::UnknownEnumValue::Integer(value),
23529 )),
23530 }
23531 }
23532 }
23533
23534 impl std::convert::From<&str> for AttackComplexity {
23535 fn from(value: &str) -> Self {
23536 use std::string::ToString;
23537 match value {
23538 "ATTACK_COMPLEXITY_UNSPECIFIED" => Self::Unspecified,
23539 "ATTACK_COMPLEXITY_LOW" => Self::Low,
23540 "ATTACK_COMPLEXITY_HIGH" => Self::High,
23541 _ => Self::UnknownValue(attack_complexity::UnknownValue(
23542 wkt::internal::UnknownEnumValue::String(value.to_string()),
23543 )),
23544 }
23545 }
23546 }
23547
23548 impl serde::ser::Serialize for AttackComplexity {
23549 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23550 where
23551 S: serde::Serializer,
23552 {
23553 match self {
23554 Self::Unspecified => serializer.serialize_i32(0),
23555 Self::Low => serializer.serialize_i32(1),
23556 Self::High => serializer.serialize_i32(2),
23557 Self::UnknownValue(u) => u.0.serialize(serializer),
23558 }
23559 }
23560 }
23561
23562 impl<'de> serde::de::Deserialize<'de> for AttackComplexity {
23563 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23564 where
23565 D: serde::Deserializer<'de>,
23566 {
23567 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AttackComplexity>::new(
23568 ".google.cloud.securitycenter.v2.Cvssv3.AttackComplexity",
23569 ))
23570 }
23571 }
23572
23573 /// This metric describes the level of privileges an attacker must possess
23574 /// before successfully exploiting the vulnerability.
23575 ///
23576 /// # Working with unknown values
23577 ///
23578 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23579 /// additional enum variants at any time. Adding new variants is not considered
23580 /// a breaking change. Applications should write their code in anticipation of:
23581 ///
23582 /// - New values appearing in future releases of the client library, **and**
23583 /// - New values received dynamically, without application changes.
23584 ///
23585 /// Please consult the [Working with enums] section in the user guide for some
23586 /// guidelines.
23587 ///
23588 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
23589 #[derive(Clone, Debug, PartialEq)]
23590 #[non_exhaustive]
23591 pub enum PrivilegesRequired {
23592 /// Invalid value.
23593 Unspecified,
23594 /// The attacker is unauthorized prior to attack, and therefore does not
23595 /// require any access to settings or files of the vulnerable system to
23596 /// carry out an attack.
23597 None,
23598 /// The attacker requires privileges that provide basic user capabilities
23599 /// that could normally affect only settings and files owned by a user.
23600 /// Alternatively, an attacker with Low privileges has the ability to access
23601 /// only non-sensitive resources.
23602 Low,
23603 /// The attacker requires privileges that provide significant (e.g.,
23604 /// administrative) control over the vulnerable component allowing access to
23605 /// component-wide settings and files.
23606 High,
23607 /// If set, the enum was initialized with an unknown value.
23608 ///
23609 /// Applications can examine the value using [PrivilegesRequired::value] or
23610 /// [PrivilegesRequired::name].
23611 UnknownValue(privileges_required::UnknownValue),
23612 }
23613
23614 #[doc(hidden)]
23615 pub mod privileges_required {
23616 #[allow(unused_imports)]
23617 use super::*;
23618 #[derive(Clone, Debug, PartialEq)]
23619 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23620 }
23621
23622 impl PrivilegesRequired {
23623 /// Gets the enum value.
23624 ///
23625 /// Returns `None` if the enum contains an unknown value deserialized from
23626 /// the string representation of enums.
23627 pub fn value(&self) -> std::option::Option<i32> {
23628 match self {
23629 Self::Unspecified => std::option::Option::Some(0),
23630 Self::None => std::option::Option::Some(1),
23631 Self::Low => std::option::Option::Some(2),
23632 Self::High => std::option::Option::Some(3),
23633 Self::UnknownValue(u) => u.0.value(),
23634 }
23635 }
23636
23637 /// Gets the enum value as a string.
23638 ///
23639 /// Returns `None` if the enum contains an unknown value deserialized from
23640 /// the integer representation of enums.
23641 pub fn name(&self) -> std::option::Option<&str> {
23642 match self {
23643 Self::Unspecified => std::option::Option::Some("PRIVILEGES_REQUIRED_UNSPECIFIED"),
23644 Self::None => std::option::Option::Some("PRIVILEGES_REQUIRED_NONE"),
23645 Self::Low => std::option::Option::Some("PRIVILEGES_REQUIRED_LOW"),
23646 Self::High => std::option::Option::Some("PRIVILEGES_REQUIRED_HIGH"),
23647 Self::UnknownValue(u) => u.0.name(),
23648 }
23649 }
23650 }
23651
23652 impl std::default::Default for PrivilegesRequired {
23653 fn default() -> Self {
23654 use std::convert::From;
23655 Self::from(0)
23656 }
23657 }
23658
23659 impl std::fmt::Display for PrivilegesRequired {
23660 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23661 wkt::internal::display_enum(f, self.name(), self.value())
23662 }
23663 }
23664
23665 impl std::convert::From<i32> for PrivilegesRequired {
23666 fn from(value: i32) -> Self {
23667 match value {
23668 0 => Self::Unspecified,
23669 1 => Self::None,
23670 2 => Self::Low,
23671 3 => Self::High,
23672 _ => Self::UnknownValue(privileges_required::UnknownValue(
23673 wkt::internal::UnknownEnumValue::Integer(value),
23674 )),
23675 }
23676 }
23677 }
23678
23679 impl std::convert::From<&str> for PrivilegesRequired {
23680 fn from(value: &str) -> Self {
23681 use std::string::ToString;
23682 match value {
23683 "PRIVILEGES_REQUIRED_UNSPECIFIED" => Self::Unspecified,
23684 "PRIVILEGES_REQUIRED_NONE" => Self::None,
23685 "PRIVILEGES_REQUIRED_LOW" => Self::Low,
23686 "PRIVILEGES_REQUIRED_HIGH" => Self::High,
23687 _ => Self::UnknownValue(privileges_required::UnknownValue(
23688 wkt::internal::UnknownEnumValue::String(value.to_string()),
23689 )),
23690 }
23691 }
23692 }
23693
23694 impl serde::ser::Serialize for PrivilegesRequired {
23695 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23696 where
23697 S: serde::Serializer,
23698 {
23699 match self {
23700 Self::Unspecified => serializer.serialize_i32(0),
23701 Self::None => serializer.serialize_i32(1),
23702 Self::Low => serializer.serialize_i32(2),
23703 Self::High => serializer.serialize_i32(3),
23704 Self::UnknownValue(u) => u.0.serialize(serializer),
23705 }
23706 }
23707 }
23708
23709 impl<'de> serde::de::Deserialize<'de> for PrivilegesRequired {
23710 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23711 where
23712 D: serde::Deserializer<'de>,
23713 {
23714 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PrivilegesRequired>::new(
23715 ".google.cloud.securitycenter.v2.Cvssv3.PrivilegesRequired",
23716 ))
23717 }
23718 }
23719
23720 /// This metric captures the requirement for a human user, other than the
23721 /// attacker, to participate in the successful compromise of the vulnerable
23722 /// component.
23723 ///
23724 /// # Working with unknown values
23725 ///
23726 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23727 /// additional enum variants at any time. Adding new variants is not considered
23728 /// a breaking change. Applications should write their code in anticipation of:
23729 ///
23730 /// - New values appearing in future releases of the client library, **and**
23731 /// - New values received dynamically, without application changes.
23732 ///
23733 /// Please consult the [Working with enums] section in the user guide for some
23734 /// guidelines.
23735 ///
23736 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
23737 #[derive(Clone, Debug, PartialEq)]
23738 #[non_exhaustive]
23739 pub enum UserInteraction {
23740 /// Invalid value.
23741 Unspecified,
23742 /// The vulnerable system can be exploited without interaction from any user.
23743 None,
23744 /// Successful exploitation of this vulnerability requires a user to take
23745 /// some action before the vulnerability can be exploited.
23746 Required,
23747 /// If set, the enum was initialized with an unknown value.
23748 ///
23749 /// Applications can examine the value using [UserInteraction::value] or
23750 /// [UserInteraction::name].
23751 UnknownValue(user_interaction::UnknownValue),
23752 }
23753
23754 #[doc(hidden)]
23755 pub mod user_interaction {
23756 #[allow(unused_imports)]
23757 use super::*;
23758 #[derive(Clone, Debug, PartialEq)]
23759 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23760 }
23761
23762 impl UserInteraction {
23763 /// Gets the enum value.
23764 ///
23765 /// Returns `None` if the enum contains an unknown value deserialized from
23766 /// the string representation of enums.
23767 pub fn value(&self) -> std::option::Option<i32> {
23768 match self {
23769 Self::Unspecified => std::option::Option::Some(0),
23770 Self::None => std::option::Option::Some(1),
23771 Self::Required => std::option::Option::Some(2),
23772 Self::UnknownValue(u) => u.0.value(),
23773 }
23774 }
23775
23776 /// Gets the enum value as a string.
23777 ///
23778 /// Returns `None` if the enum contains an unknown value deserialized from
23779 /// the integer representation of enums.
23780 pub fn name(&self) -> std::option::Option<&str> {
23781 match self {
23782 Self::Unspecified => std::option::Option::Some("USER_INTERACTION_UNSPECIFIED"),
23783 Self::None => std::option::Option::Some("USER_INTERACTION_NONE"),
23784 Self::Required => std::option::Option::Some("USER_INTERACTION_REQUIRED"),
23785 Self::UnknownValue(u) => u.0.name(),
23786 }
23787 }
23788 }
23789
23790 impl std::default::Default for UserInteraction {
23791 fn default() -> Self {
23792 use std::convert::From;
23793 Self::from(0)
23794 }
23795 }
23796
23797 impl std::fmt::Display for UserInteraction {
23798 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23799 wkt::internal::display_enum(f, self.name(), self.value())
23800 }
23801 }
23802
23803 impl std::convert::From<i32> for UserInteraction {
23804 fn from(value: i32) -> Self {
23805 match value {
23806 0 => Self::Unspecified,
23807 1 => Self::None,
23808 2 => Self::Required,
23809 _ => Self::UnknownValue(user_interaction::UnknownValue(
23810 wkt::internal::UnknownEnumValue::Integer(value),
23811 )),
23812 }
23813 }
23814 }
23815
23816 impl std::convert::From<&str> for UserInteraction {
23817 fn from(value: &str) -> Self {
23818 use std::string::ToString;
23819 match value {
23820 "USER_INTERACTION_UNSPECIFIED" => Self::Unspecified,
23821 "USER_INTERACTION_NONE" => Self::None,
23822 "USER_INTERACTION_REQUIRED" => Self::Required,
23823 _ => Self::UnknownValue(user_interaction::UnknownValue(
23824 wkt::internal::UnknownEnumValue::String(value.to_string()),
23825 )),
23826 }
23827 }
23828 }
23829
23830 impl serde::ser::Serialize for UserInteraction {
23831 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23832 where
23833 S: serde::Serializer,
23834 {
23835 match self {
23836 Self::Unspecified => serializer.serialize_i32(0),
23837 Self::None => serializer.serialize_i32(1),
23838 Self::Required => serializer.serialize_i32(2),
23839 Self::UnknownValue(u) => u.0.serialize(serializer),
23840 }
23841 }
23842 }
23843
23844 impl<'de> serde::de::Deserialize<'de> for UserInteraction {
23845 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23846 where
23847 D: serde::Deserializer<'de>,
23848 {
23849 deserializer.deserialize_any(wkt::internal::EnumVisitor::<UserInteraction>::new(
23850 ".google.cloud.securitycenter.v2.Cvssv3.UserInteraction",
23851 ))
23852 }
23853 }
23854
23855 /// The Scope metric captures whether a vulnerability in one vulnerable
23856 /// component impacts resources in components beyond its security scope.
23857 ///
23858 /// # Working with unknown values
23859 ///
23860 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23861 /// additional enum variants at any time. Adding new variants is not considered
23862 /// a breaking change. Applications should write their code in anticipation of:
23863 ///
23864 /// - New values appearing in future releases of the client library, **and**
23865 /// - New values received dynamically, without application changes.
23866 ///
23867 /// Please consult the [Working with enums] section in the user guide for some
23868 /// guidelines.
23869 ///
23870 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
23871 #[derive(Clone, Debug, PartialEq)]
23872 #[non_exhaustive]
23873 pub enum Scope {
23874 /// Invalid value.
23875 Unspecified,
23876 /// An exploited vulnerability can only affect resources managed by the same
23877 /// security authority.
23878 Unchanged,
23879 /// An exploited vulnerability can affect resources beyond the security scope
23880 /// managed by the security authority of the vulnerable component.
23881 Changed,
23882 /// If set, the enum was initialized with an unknown value.
23883 ///
23884 /// Applications can examine the value using [Scope::value] or
23885 /// [Scope::name].
23886 UnknownValue(scope::UnknownValue),
23887 }
23888
23889 #[doc(hidden)]
23890 pub mod scope {
23891 #[allow(unused_imports)]
23892 use super::*;
23893 #[derive(Clone, Debug, PartialEq)]
23894 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23895 }
23896
23897 impl Scope {
23898 /// Gets the enum value.
23899 ///
23900 /// Returns `None` if the enum contains an unknown value deserialized from
23901 /// the string representation of enums.
23902 pub fn value(&self) -> std::option::Option<i32> {
23903 match self {
23904 Self::Unspecified => std::option::Option::Some(0),
23905 Self::Unchanged => std::option::Option::Some(1),
23906 Self::Changed => std::option::Option::Some(2),
23907 Self::UnknownValue(u) => u.0.value(),
23908 }
23909 }
23910
23911 /// Gets the enum value as a string.
23912 ///
23913 /// Returns `None` if the enum contains an unknown value deserialized from
23914 /// the integer representation of enums.
23915 pub fn name(&self) -> std::option::Option<&str> {
23916 match self {
23917 Self::Unspecified => std::option::Option::Some("SCOPE_UNSPECIFIED"),
23918 Self::Unchanged => std::option::Option::Some("SCOPE_UNCHANGED"),
23919 Self::Changed => std::option::Option::Some("SCOPE_CHANGED"),
23920 Self::UnknownValue(u) => u.0.name(),
23921 }
23922 }
23923 }
23924
23925 impl std::default::Default for Scope {
23926 fn default() -> Self {
23927 use std::convert::From;
23928 Self::from(0)
23929 }
23930 }
23931
23932 impl std::fmt::Display for Scope {
23933 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23934 wkt::internal::display_enum(f, self.name(), self.value())
23935 }
23936 }
23937
23938 impl std::convert::From<i32> for Scope {
23939 fn from(value: i32) -> Self {
23940 match value {
23941 0 => Self::Unspecified,
23942 1 => Self::Unchanged,
23943 2 => Self::Changed,
23944 _ => Self::UnknownValue(scope::UnknownValue(
23945 wkt::internal::UnknownEnumValue::Integer(value),
23946 )),
23947 }
23948 }
23949 }
23950
23951 impl std::convert::From<&str> for Scope {
23952 fn from(value: &str) -> Self {
23953 use std::string::ToString;
23954 match value {
23955 "SCOPE_UNSPECIFIED" => Self::Unspecified,
23956 "SCOPE_UNCHANGED" => Self::Unchanged,
23957 "SCOPE_CHANGED" => Self::Changed,
23958 _ => Self::UnknownValue(scope::UnknownValue(
23959 wkt::internal::UnknownEnumValue::String(value.to_string()),
23960 )),
23961 }
23962 }
23963 }
23964
23965 impl serde::ser::Serialize for Scope {
23966 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23967 where
23968 S: serde::Serializer,
23969 {
23970 match self {
23971 Self::Unspecified => serializer.serialize_i32(0),
23972 Self::Unchanged => serializer.serialize_i32(1),
23973 Self::Changed => serializer.serialize_i32(2),
23974 Self::UnknownValue(u) => u.0.serialize(serializer),
23975 }
23976 }
23977 }
23978
23979 impl<'de> serde::de::Deserialize<'de> for Scope {
23980 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23981 where
23982 D: serde::Deserializer<'de>,
23983 {
23984 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Scope>::new(
23985 ".google.cloud.securitycenter.v2.Cvssv3.Scope",
23986 ))
23987 }
23988 }
23989
23990 /// The Impact metrics capture the effects of a successfully exploited
23991 /// vulnerability on the component that suffers the worst outcome that is most
23992 /// directly and predictably associated with the attack.
23993 ///
23994 /// # Working with unknown values
23995 ///
23996 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23997 /// additional enum variants at any time. Adding new variants is not considered
23998 /// a breaking change. Applications should write their code in anticipation of:
23999 ///
24000 /// - New values appearing in future releases of the client library, **and**
24001 /// - New values received dynamically, without application changes.
24002 ///
24003 /// Please consult the [Working with enums] section in the user guide for some
24004 /// guidelines.
24005 ///
24006 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24007 #[derive(Clone, Debug, PartialEq)]
24008 #[non_exhaustive]
24009 pub enum Impact {
24010 /// Invalid value.
24011 Unspecified,
24012 /// High impact.
24013 High,
24014 /// Low impact.
24015 Low,
24016 /// No impact.
24017 None,
24018 /// If set, the enum was initialized with an unknown value.
24019 ///
24020 /// Applications can examine the value using [Impact::value] or
24021 /// [Impact::name].
24022 UnknownValue(impact::UnknownValue),
24023 }
24024
24025 #[doc(hidden)]
24026 pub mod impact {
24027 #[allow(unused_imports)]
24028 use super::*;
24029 #[derive(Clone, Debug, PartialEq)]
24030 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24031 }
24032
24033 impl Impact {
24034 /// Gets the enum value.
24035 ///
24036 /// Returns `None` if the enum contains an unknown value deserialized from
24037 /// the string representation of enums.
24038 pub fn value(&self) -> std::option::Option<i32> {
24039 match self {
24040 Self::Unspecified => std::option::Option::Some(0),
24041 Self::High => std::option::Option::Some(1),
24042 Self::Low => std::option::Option::Some(2),
24043 Self::None => std::option::Option::Some(3),
24044 Self::UnknownValue(u) => u.0.value(),
24045 }
24046 }
24047
24048 /// Gets the enum value as a string.
24049 ///
24050 /// Returns `None` if the enum contains an unknown value deserialized from
24051 /// the integer representation of enums.
24052 pub fn name(&self) -> std::option::Option<&str> {
24053 match self {
24054 Self::Unspecified => std::option::Option::Some("IMPACT_UNSPECIFIED"),
24055 Self::High => std::option::Option::Some("IMPACT_HIGH"),
24056 Self::Low => std::option::Option::Some("IMPACT_LOW"),
24057 Self::None => std::option::Option::Some("IMPACT_NONE"),
24058 Self::UnknownValue(u) => u.0.name(),
24059 }
24060 }
24061 }
24062
24063 impl std::default::Default for Impact {
24064 fn default() -> Self {
24065 use std::convert::From;
24066 Self::from(0)
24067 }
24068 }
24069
24070 impl std::fmt::Display for Impact {
24071 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24072 wkt::internal::display_enum(f, self.name(), self.value())
24073 }
24074 }
24075
24076 impl std::convert::From<i32> for Impact {
24077 fn from(value: i32) -> Self {
24078 match value {
24079 0 => Self::Unspecified,
24080 1 => Self::High,
24081 2 => Self::Low,
24082 3 => Self::None,
24083 _ => Self::UnknownValue(impact::UnknownValue(
24084 wkt::internal::UnknownEnumValue::Integer(value),
24085 )),
24086 }
24087 }
24088 }
24089
24090 impl std::convert::From<&str> for Impact {
24091 fn from(value: &str) -> Self {
24092 use std::string::ToString;
24093 match value {
24094 "IMPACT_UNSPECIFIED" => Self::Unspecified,
24095 "IMPACT_HIGH" => Self::High,
24096 "IMPACT_LOW" => Self::Low,
24097 "IMPACT_NONE" => Self::None,
24098 _ => Self::UnknownValue(impact::UnknownValue(
24099 wkt::internal::UnknownEnumValue::String(value.to_string()),
24100 )),
24101 }
24102 }
24103 }
24104
24105 impl serde::ser::Serialize for Impact {
24106 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24107 where
24108 S: serde::Serializer,
24109 {
24110 match self {
24111 Self::Unspecified => serializer.serialize_i32(0),
24112 Self::High => serializer.serialize_i32(1),
24113 Self::Low => serializer.serialize_i32(2),
24114 Self::None => serializer.serialize_i32(3),
24115 Self::UnknownValue(u) => u.0.serialize(serializer),
24116 }
24117 }
24118 }
24119
24120 impl<'de> serde::de::Deserialize<'de> for Impact {
24121 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24122 where
24123 D: serde::Deserializer<'de>,
24124 {
24125 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Impact>::new(
24126 ".google.cloud.securitycenter.v2.Cvssv3.Impact",
24127 ))
24128 }
24129 }
24130}
24131
24132/// Package is a generic definition of a package.
24133#[derive(Clone, Default, PartialEq)]
24134#[non_exhaustive]
24135pub struct Package {
24136 /// The name of the package where the vulnerability was detected.
24137 pub package_name: std::string::String,
24138
24139 /// The CPE URI where the vulnerability was detected.
24140 pub cpe_uri: std::string::String,
24141
24142 /// Type of package, for example, os, maven, or go.
24143 pub package_type: std::string::String,
24144
24145 /// The version of the package.
24146 pub package_version: std::string::String,
24147
24148 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24149}
24150
24151impl Package {
24152 /// Creates a new default instance.
24153 pub fn new() -> Self {
24154 std::default::Default::default()
24155 }
24156
24157 /// Sets the value of [package_name][crate::model::Package::package_name].
24158 ///
24159 /// # Example
24160 /// ```ignore,no_run
24161 /// # use google_cloud_securitycenter_v2::model::Package;
24162 /// let x = Package::new().set_package_name("example");
24163 /// ```
24164 pub fn set_package_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24165 self.package_name = v.into();
24166 self
24167 }
24168
24169 /// Sets the value of [cpe_uri][crate::model::Package::cpe_uri].
24170 ///
24171 /// # Example
24172 /// ```ignore,no_run
24173 /// # use google_cloud_securitycenter_v2::model::Package;
24174 /// let x = Package::new().set_cpe_uri("example");
24175 /// ```
24176 pub fn set_cpe_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24177 self.cpe_uri = v.into();
24178 self
24179 }
24180
24181 /// Sets the value of [package_type][crate::model::Package::package_type].
24182 ///
24183 /// # Example
24184 /// ```ignore,no_run
24185 /// # use google_cloud_securitycenter_v2::model::Package;
24186 /// let x = Package::new().set_package_type("example");
24187 /// ```
24188 pub fn set_package_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24189 self.package_type = v.into();
24190 self
24191 }
24192
24193 /// Sets the value of [package_version][crate::model::Package::package_version].
24194 ///
24195 /// # Example
24196 /// ```ignore,no_run
24197 /// # use google_cloud_securitycenter_v2::model::Package;
24198 /// let x = Package::new().set_package_version("example");
24199 /// ```
24200 pub fn set_package_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24201 self.package_version = v.into();
24202 self
24203 }
24204}
24205
24206impl wkt::message::Message for Package {
24207 fn typename() -> &'static str {
24208 "type.googleapis.com/google.cloud.securitycenter.v2.Package"
24209 }
24210}
24211
24212/// SecurityBulletin are notifications of vulnerabilities of Google products.
24213#[derive(Clone, Default, PartialEq)]
24214#[non_exhaustive]
24215pub struct SecurityBulletin {
24216 /// ID of the bulletin corresponding to the vulnerability.
24217 pub bulletin_id: std::string::String,
24218
24219 /// Submission time of this Security Bulletin.
24220 pub submission_time: std::option::Option<wkt::Timestamp>,
24221
24222 /// This represents a version that the cluster receiving this notification
24223 /// should be upgraded to, based on its current version. For example, 1.15.0
24224 pub suggested_upgrade_version: std::string::String,
24225
24226 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24227}
24228
24229impl SecurityBulletin {
24230 /// Creates a new default instance.
24231 pub fn new() -> Self {
24232 std::default::Default::default()
24233 }
24234
24235 /// Sets the value of [bulletin_id][crate::model::SecurityBulletin::bulletin_id].
24236 ///
24237 /// # Example
24238 /// ```ignore,no_run
24239 /// # use google_cloud_securitycenter_v2::model::SecurityBulletin;
24240 /// let x = SecurityBulletin::new().set_bulletin_id("example");
24241 /// ```
24242 pub fn set_bulletin_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24243 self.bulletin_id = v.into();
24244 self
24245 }
24246
24247 /// Sets the value of [submission_time][crate::model::SecurityBulletin::submission_time].
24248 ///
24249 /// # Example
24250 /// ```ignore,no_run
24251 /// # use google_cloud_securitycenter_v2::model::SecurityBulletin;
24252 /// use wkt::Timestamp;
24253 /// let x = SecurityBulletin::new().set_submission_time(Timestamp::default()/* use setters */);
24254 /// ```
24255 pub fn set_submission_time<T>(mut self, v: T) -> Self
24256 where
24257 T: std::convert::Into<wkt::Timestamp>,
24258 {
24259 self.submission_time = std::option::Option::Some(v.into());
24260 self
24261 }
24262
24263 /// Sets or clears the value of [submission_time][crate::model::SecurityBulletin::submission_time].
24264 ///
24265 /// # Example
24266 /// ```ignore,no_run
24267 /// # use google_cloud_securitycenter_v2::model::SecurityBulletin;
24268 /// use wkt::Timestamp;
24269 /// let x = SecurityBulletin::new().set_or_clear_submission_time(Some(Timestamp::default()/* use setters */));
24270 /// let x = SecurityBulletin::new().set_or_clear_submission_time(None::<Timestamp>);
24271 /// ```
24272 pub fn set_or_clear_submission_time<T>(mut self, v: std::option::Option<T>) -> Self
24273 where
24274 T: std::convert::Into<wkt::Timestamp>,
24275 {
24276 self.submission_time = v.map(|x| x.into());
24277 self
24278 }
24279
24280 /// Sets the value of [suggested_upgrade_version][crate::model::SecurityBulletin::suggested_upgrade_version].
24281 ///
24282 /// # Example
24283 /// ```ignore,no_run
24284 /// # use google_cloud_securitycenter_v2::model::SecurityBulletin;
24285 /// let x = SecurityBulletin::new().set_suggested_upgrade_version("example");
24286 /// ```
24287 pub fn set_suggested_upgrade_version<T: std::convert::Into<std::string::String>>(
24288 mut self,
24289 v: T,
24290 ) -> Self {
24291 self.suggested_upgrade_version = v.into();
24292 self
24293 }
24294}
24295
24296impl wkt::message::Message for SecurityBulletin {
24297 fn typename() -> &'static str {
24298 "type.googleapis.com/google.cloud.securitycenter.v2.SecurityBulletin"
24299 }
24300}
24301
24302/// CWE stands for Common Weakness Enumeration. Information about this weakness,
24303/// as described by [CWE](https://cwe.mitre.org/).
24304#[derive(Clone, Default, PartialEq)]
24305#[non_exhaustive]
24306pub struct Cwe {
24307 /// The CWE identifier, e.g. CWE-94
24308 pub id: std::string::String,
24309
24310 /// Any reference to the details on the CWE, for example,
24311 /// <https://cwe.mitre.org/data/definitions/94.html>
24312 pub references: std::vec::Vec<crate::model::Reference>,
24313
24314 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24315}
24316
24317impl Cwe {
24318 /// Creates a new default instance.
24319 pub fn new() -> Self {
24320 std::default::Default::default()
24321 }
24322
24323 /// Sets the value of [id][crate::model::Cwe::id].
24324 ///
24325 /// # Example
24326 /// ```ignore,no_run
24327 /// # use google_cloud_securitycenter_v2::model::Cwe;
24328 /// let x = Cwe::new().set_id("example");
24329 /// ```
24330 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24331 self.id = v.into();
24332 self
24333 }
24334
24335 /// Sets the value of [references][crate::model::Cwe::references].
24336 ///
24337 /// # Example
24338 /// ```ignore,no_run
24339 /// # use google_cloud_securitycenter_v2::model::Cwe;
24340 /// use google_cloud_securitycenter_v2::model::Reference;
24341 /// let x = Cwe::new()
24342 /// .set_references([
24343 /// Reference::default()/* use setters */,
24344 /// Reference::default()/* use (different) setters */,
24345 /// ]);
24346 /// ```
24347 pub fn set_references<T, V>(mut self, v: T) -> Self
24348 where
24349 T: std::iter::IntoIterator<Item = V>,
24350 V: std::convert::Into<crate::model::Reference>,
24351 {
24352 use std::iter::Iterator;
24353 self.references = v.into_iter().map(|i| i.into()).collect();
24354 self
24355 }
24356}
24357
24358impl wkt::message::Message for Cwe {
24359 fn typename() -> &'static str {
24360 "type.googleapis.com/google.cloud.securitycenter.v2.Cwe"
24361 }
24362}
24363
24364/// JobState represents the state of the job.
24365///
24366/// # Working with unknown values
24367///
24368/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24369/// additional enum variants at any time. Adding new variants is not considered
24370/// a breaking change. Applications should write their code in anticipation of:
24371///
24372/// - New values appearing in future releases of the client library, **and**
24373/// - New values received dynamically, without application changes.
24374///
24375/// Please consult the [Working with enums] section in the user guide for some
24376/// guidelines.
24377///
24378/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24379#[derive(Clone, Debug, PartialEq)]
24380#[non_exhaustive]
24381pub enum JobState {
24382 /// Unspecified represents an unknown state and should not be used.
24383 Unspecified,
24384 /// Job is scheduled and pending for run
24385 Pending,
24386 /// Job in progress
24387 Running,
24388 /// Job has completed with success
24389 Succeeded,
24390 /// Job has completed but with failure
24391 Failed,
24392 /// If set, the enum was initialized with an unknown value.
24393 ///
24394 /// Applications can examine the value using [JobState::value] or
24395 /// [JobState::name].
24396 UnknownValue(job_state::UnknownValue),
24397}
24398
24399#[doc(hidden)]
24400pub mod job_state {
24401 #[allow(unused_imports)]
24402 use super::*;
24403 #[derive(Clone, Debug, PartialEq)]
24404 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24405}
24406
24407impl JobState {
24408 /// Gets the enum value.
24409 ///
24410 /// Returns `None` if the enum contains an unknown value deserialized from
24411 /// the string representation of enums.
24412 pub fn value(&self) -> std::option::Option<i32> {
24413 match self {
24414 Self::Unspecified => std::option::Option::Some(0),
24415 Self::Pending => std::option::Option::Some(1),
24416 Self::Running => std::option::Option::Some(2),
24417 Self::Succeeded => std::option::Option::Some(3),
24418 Self::Failed => std::option::Option::Some(4),
24419 Self::UnknownValue(u) => u.0.value(),
24420 }
24421 }
24422
24423 /// Gets the enum value as a string.
24424 ///
24425 /// Returns `None` if the enum contains an unknown value deserialized from
24426 /// the integer representation of enums.
24427 pub fn name(&self) -> std::option::Option<&str> {
24428 match self {
24429 Self::Unspecified => std::option::Option::Some("JOB_STATE_UNSPECIFIED"),
24430 Self::Pending => std::option::Option::Some("PENDING"),
24431 Self::Running => std::option::Option::Some("RUNNING"),
24432 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
24433 Self::Failed => std::option::Option::Some("FAILED"),
24434 Self::UnknownValue(u) => u.0.name(),
24435 }
24436 }
24437}
24438
24439impl std::default::Default for JobState {
24440 fn default() -> Self {
24441 use std::convert::From;
24442 Self::from(0)
24443 }
24444}
24445
24446impl std::fmt::Display for JobState {
24447 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24448 wkt::internal::display_enum(f, self.name(), self.value())
24449 }
24450}
24451
24452impl std::convert::From<i32> for JobState {
24453 fn from(value: i32) -> Self {
24454 match value {
24455 0 => Self::Unspecified,
24456 1 => Self::Pending,
24457 2 => Self::Running,
24458 3 => Self::Succeeded,
24459 4 => Self::Failed,
24460 _ => Self::UnknownValue(job_state::UnknownValue(
24461 wkt::internal::UnknownEnumValue::Integer(value),
24462 )),
24463 }
24464 }
24465}
24466
24467impl std::convert::From<&str> for JobState {
24468 fn from(value: &str) -> Self {
24469 use std::string::ToString;
24470 match value {
24471 "JOB_STATE_UNSPECIFIED" => Self::Unspecified,
24472 "PENDING" => Self::Pending,
24473 "RUNNING" => Self::Running,
24474 "SUCCEEDED" => Self::Succeeded,
24475 "FAILED" => Self::Failed,
24476 _ => Self::UnknownValue(job_state::UnknownValue(
24477 wkt::internal::UnknownEnumValue::String(value.to_string()),
24478 )),
24479 }
24480 }
24481}
24482
24483impl serde::ser::Serialize for JobState {
24484 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24485 where
24486 S: serde::Serializer,
24487 {
24488 match self {
24489 Self::Unspecified => serializer.serialize_i32(0),
24490 Self::Pending => serializer.serialize_i32(1),
24491 Self::Running => serializer.serialize_i32(2),
24492 Self::Succeeded => serializer.serialize_i32(3),
24493 Self::Failed => serializer.serialize_i32(4),
24494 Self::UnknownValue(u) => u.0.serialize(serializer),
24495 }
24496 }
24497}
24498
24499impl<'de> serde::de::Deserialize<'de> for JobState {
24500 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24501 where
24502 D: serde::Deserializer<'de>,
24503 {
24504 deserializer.deserialize_any(wkt::internal::EnumVisitor::<JobState>::new(
24505 ".google.cloud.securitycenter.v2.JobState",
24506 ))
24507 }
24508}
24509
24510/// The cloud provider the finding pertains to.
24511///
24512/// # Working with unknown values
24513///
24514/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24515/// additional enum variants at any time. Adding new variants is not considered
24516/// a breaking change. Applications should write their code in anticipation of:
24517///
24518/// - New values appearing in future releases of the client library, **and**
24519/// - New values received dynamically, without application changes.
24520///
24521/// Please consult the [Working with enums] section in the user guide for some
24522/// guidelines.
24523///
24524/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24525#[derive(Clone, Debug, PartialEq)]
24526#[non_exhaustive]
24527pub enum CloudProvider {
24528 /// The cloud provider is unspecified.
24529 Unspecified,
24530 /// The cloud provider is Google Cloud.
24531 GoogleCloudPlatform,
24532 /// The cloud provider is Amazon Web Services.
24533 AmazonWebServices,
24534 /// The cloud provider is Microsoft Azure.
24535 MicrosoftAzure,
24536 /// If set, the enum was initialized with an unknown value.
24537 ///
24538 /// Applications can examine the value using [CloudProvider::value] or
24539 /// [CloudProvider::name].
24540 UnknownValue(cloud_provider::UnknownValue),
24541}
24542
24543#[doc(hidden)]
24544pub mod cloud_provider {
24545 #[allow(unused_imports)]
24546 use super::*;
24547 #[derive(Clone, Debug, PartialEq)]
24548 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24549}
24550
24551impl CloudProvider {
24552 /// Gets the enum value.
24553 ///
24554 /// Returns `None` if the enum contains an unknown value deserialized from
24555 /// the string representation of enums.
24556 pub fn value(&self) -> std::option::Option<i32> {
24557 match self {
24558 Self::Unspecified => std::option::Option::Some(0),
24559 Self::GoogleCloudPlatform => std::option::Option::Some(1),
24560 Self::AmazonWebServices => std::option::Option::Some(2),
24561 Self::MicrosoftAzure => std::option::Option::Some(3),
24562 Self::UnknownValue(u) => u.0.value(),
24563 }
24564 }
24565
24566 /// Gets the enum value as a string.
24567 ///
24568 /// Returns `None` if the enum contains an unknown value deserialized from
24569 /// the integer representation of enums.
24570 pub fn name(&self) -> std::option::Option<&str> {
24571 match self {
24572 Self::Unspecified => std::option::Option::Some("CLOUD_PROVIDER_UNSPECIFIED"),
24573 Self::GoogleCloudPlatform => std::option::Option::Some("GOOGLE_CLOUD_PLATFORM"),
24574 Self::AmazonWebServices => std::option::Option::Some("AMAZON_WEB_SERVICES"),
24575 Self::MicrosoftAzure => std::option::Option::Some("MICROSOFT_AZURE"),
24576 Self::UnknownValue(u) => u.0.name(),
24577 }
24578 }
24579}
24580
24581impl std::default::Default for CloudProvider {
24582 fn default() -> Self {
24583 use std::convert::From;
24584 Self::from(0)
24585 }
24586}
24587
24588impl std::fmt::Display for CloudProvider {
24589 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24590 wkt::internal::display_enum(f, self.name(), self.value())
24591 }
24592}
24593
24594impl std::convert::From<i32> for CloudProvider {
24595 fn from(value: i32) -> Self {
24596 match value {
24597 0 => Self::Unspecified,
24598 1 => Self::GoogleCloudPlatform,
24599 2 => Self::AmazonWebServices,
24600 3 => Self::MicrosoftAzure,
24601 _ => Self::UnknownValue(cloud_provider::UnknownValue(
24602 wkt::internal::UnknownEnumValue::Integer(value),
24603 )),
24604 }
24605 }
24606}
24607
24608impl std::convert::From<&str> for CloudProvider {
24609 fn from(value: &str) -> Self {
24610 use std::string::ToString;
24611 match value {
24612 "CLOUD_PROVIDER_UNSPECIFIED" => Self::Unspecified,
24613 "GOOGLE_CLOUD_PLATFORM" => Self::GoogleCloudPlatform,
24614 "AMAZON_WEB_SERVICES" => Self::AmazonWebServices,
24615 "MICROSOFT_AZURE" => Self::MicrosoftAzure,
24616 _ => Self::UnknownValue(cloud_provider::UnknownValue(
24617 wkt::internal::UnknownEnumValue::String(value.to_string()),
24618 )),
24619 }
24620 }
24621}
24622
24623impl serde::ser::Serialize for CloudProvider {
24624 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24625 where
24626 S: serde::Serializer,
24627 {
24628 match self {
24629 Self::Unspecified => serializer.serialize_i32(0),
24630 Self::GoogleCloudPlatform => serializer.serialize_i32(1),
24631 Self::AmazonWebServices => serializer.serialize_i32(2),
24632 Self::MicrosoftAzure => serializer.serialize_i32(3),
24633 Self::UnknownValue(u) => u.0.serialize(serializer),
24634 }
24635 }
24636}
24637
24638impl<'de> serde::de::Deserialize<'de> for CloudProvider {
24639 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24640 where
24641 D: serde::Deserializer<'de>,
24642 {
24643 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CloudProvider>::new(
24644 ".google.cloud.securitycenter.v2.CloudProvider",
24645 ))
24646 }
24647}
24648
24649/// Value enum to map to a resource
24650///
24651/// # Working with unknown values
24652///
24653/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24654/// additional enum variants at any time. Adding new variants is not considered
24655/// a breaking change. Applications should write their code in anticipation of:
24656///
24657/// - New values appearing in future releases of the client library, **and**
24658/// - New values received dynamically, without application changes.
24659///
24660/// Please consult the [Working with enums] section in the user guide for some
24661/// guidelines.
24662///
24663/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24664#[derive(Clone, Debug, PartialEq)]
24665#[non_exhaustive]
24666pub enum ResourceValue {
24667 /// Unspecific value
24668 Unspecified,
24669 /// High resource value
24670 High,
24671 /// Medium resource value
24672 Medium,
24673 /// Low resource value
24674 Low,
24675 /// No resource value, e.g. ignore these resources
24676 None,
24677 /// If set, the enum was initialized with an unknown value.
24678 ///
24679 /// Applications can examine the value using [ResourceValue::value] or
24680 /// [ResourceValue::name].
24681 UnknownValue(resource_value::UnknownValue),
24682}
24683
24684#[doc(hidden)]
24685pub mod resource_value {
24686 #[allow(unused_imports)]
24687 use super::*;
24688 #[derive(Clone, Debug, PartialEq)]
24689 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24690}
24691
24692impl ResourceValue {
24693 /// Gets the enum value.
24694 ///
24695 /// Returns `None` if the enum contains an unknown value deserialized from
24696 /// the string representation of enums.
24697 pub fn value(&self) -> std::option::Option<i32> {
24698 match self {
24699 Self::Unspecified => std::option::Option::Some(0),
24700 Self::High => std::option::Option::Some(1),
24701 Self::Medium => std::option::Option::Some(2),
24702 Self::Low => std::option::Option::Some(3),
24703 Self::None => std::option::Option::Some(4),
24704 Self::UnknownValue(u) => u.0.value(),
24705 }
24706 }
24707
24708 /// Gets the enum value as a string.
24709 ///
24710 /// Returns `None` if the enum contains an unknown value deserialized from
24711 /// the integer representation of enums.
24712 pub fn name(&self) -> std::option::Option<&str> {
24713 match self {
24714 Self::Unspecified => std::option::Option::Some("RESOURCE_VALUE_UNSPECIFIED"),
24715 Self::High => std::option::Option::Some("HIGH"),
24716 Self::Medium => std::option::Option::Some("MEDIUM"),
24717 Self::Low => std::option::Option::Some("LOW"),
24718 Self::None => std::option::Option::Some("NONE"),
24719 Self::UnknownValue(u) => u.0.name(),
24720 }
24721 }
24722}
24723
24724impl std::default::Default for ResourceValue {
24725 fn default() -> Self {
24726 use std::convert::From;
24727 Self::from(0)
24728 }
24729}
24730
24731impl std::fmt::Display for ResourceValue {
24732 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24733 wkt::internal::display_enum(f, self.name(), self.value())
24734 }
24735}
24736
24737impl std::convert::From<i32> for ResourceValue {
24738 fn from(value: i32) -> Self {
24739 match value {
24740 0 => Self::Unspecified,
24741 1 => Self::High,
24742 2 => Self::Medium,
24743 3 => Self::Low,
24744 4 => Self::None,
24745 _ => Self::UnknownValue(resource_value::UnknownValue(
24746 wkt::internal::UnknownEnumValue::Integer(value),
24747 )),
24748 }
24749 }
24750}
24751
24752impl std::convert::From<&str> for ResourceValue {
24753 fn from(value: &str) -> Self {
24754 use std::string::ToString;
24755 match value {
24756 "RESOURCE_VALUE_UNSPECIFIED" => Self::Unspecified,
24757 "HIGH" => Self::High,
24758 "MEDIUM" => Self::Medium,
24759 "LOW" => Self::Low,
24760 "NONE" => Self::None,
24761 _ => Self::UnknownValue(resource_value::UnknownValue(
24762 wkt::internal::UnknownEnumValue::String(value.to_string()),
24763 )),
24764 }
24765 }
24766}
24767
24768impl serde::ser::Serialize for ResourceValue {
24769 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24770 where
24771 S: serde::Serializer,
24772 {
24773 match self {
24774 Self::Unspecified => serializer.serialize_i32(0),
24775 Self::High => serializer.serialize_i32(1),
24776 Self::Medium => serializer.serialize_i32(2),
24777 Self::Low => serializer.serialize_i32(3),
24778 Self::None => serializer.serialize_i32(4),
24779 Self::UnknownValue(u) => u.0.serialize(serializer),
24780 }
24781 }
24782}
24783
24784impl<'de> serde::de::Deserialize<'de> for ResourceValue {
24785 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24786 where
24787 D: serde::Deserializer<'de>,
24788 {
24789 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResourceValue>::new(
24790 ".google.cloud.securitycenter.v2.ResourceValue",
24791 ))
24792 }
24793}